From: abd Date: Wed, 14 Jun 2006 13:58:32 +0000 (+0000) Subject: Merge from BR_DEBUG_3_2_0b1 X-Git-Tag: LAST_STABLE_VERSION_21_09_2006_ON_3_2_0~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0aa84210cf7da3868cc8eb26b17a2da8e046b3ae;p=modules%2Fsmesh.git Merge from BR_DEBUG_3_2_0b1 --- diff --git a/INSTALL b/INSTALL index e07cc9976..0ea0b81cb 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1 @@ -This is the version 3.2.0a1 of SMESH -Compatible with : - - KERNEL 3.2.0a1 - - SALOMEGUI 3.2.0a1 - - GEOM 3.2.0a1 - - MED 3.2.0a1 +SALOME2 : SMESH module diff --git a/Makefile.in b/Makefile.in index f3a90dfb5..5c579e676 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # -* Makefile *- # # Author : Patrick GOLDBRONN (CEA) @@ -9,12 +28,12 @@ top_srcdir=@top_srcdir@ top_builddir=. srcdir=@srcdir@ -VPATH=.:@srcdir@:@top_srcdir@/bin:@top_srcdir@/resources:./bin:@top_srcdir@/idl +VPATH=.:@srcdir@:@top_srcdir@/bin:./bin/salome:./resources:@top_srcdir@/resources:./bin:@top_srcdir@/idl @COMMENCE@ -SUBDIRS = idl src doc +SUBDIRS = idl src doc adm_local RESOURCES_FILES = \ delete.png \ @@ -76,11 +95,15 @@ mesh_tree_algo.png \ mesh_tree_algo_quad.png \ mesh_tree_algo_regular.png \ mesh_tree_algo_tetra.png \ +mesh_tree_algo_netgen_2d3d.png \ +mesh_tree_algo_netgen_2d.png \ mesh_tree_hypo_area.png \ mesh_tree_hypo_length.png \ mesh_tree_hypo.png \ mesh_tree_hypo_segment.png \ mesh_tree_hypo_volume.png \ +mesh_tree_hypo_netgen.png \ +mesh_tree_hypo_netgen_2d.png \ mesh_tree_mesh.png \ mesh_tree_importedmesh.png \ mesh_tree_mesh_warn.png \ @@ -127,24 +150,41 @@ SMESH_en.xml \ SMESH.config \ StdMeshers.xml \ SMESHCatalog.xml \ +SalomeApp.xml \ mesh_pattern.png \ pattern_sample_2d.png \ pattern_sample_3D.png \ mesh_add.png \ -mesh_remove.png +mesh_remove.png \ +mesh_quad_edge.png \ +mesh_quad_triangle.png \ +mesh_quad_quadrangle.png \ +mesh_quad_tetrahedron.png \ +mesh_quad_pyramid.png \ +mesh_quad_pentahedron.png \ +mesh_quad_hexahedron.png \ +mesh_conv_to_quad.png BIN_SCRIPT= \ VERSION # copy header files in common directory -ifeq ($(HAVE_SSTREAM),yes) - include_list=include/salome/SALOMEconfig.h -else - include_list=include/salome/SALOMEconfig.h include/salome/sstream + +include_list = include/salome/SALOMEconfig.h \ + include/salome/SMESH_version.h + +ifneq ($(HAVE_SSTREAM),yes) + include_list += include/salome/sstream endif inc: idl $(include_list) +bin: bin/salome/VERSION + +bin/salome/VERSION : bin/VERSION + -$(RM) $@ + $(LN_S) ../../$< $@ + include/salome/SALOMEconfig.h: salome_adm/unix/SALOMEconfig.ref -$(RM) $@ $(LN_S) ../../$< $@ @@ -162,6 +202,10 @@ include/salome/sstream: salome_adm/unix/sstream -$(RM) $@ $(LN_S) ../../$< $@ +include/salome/SMESH_version.h: SMESH_version.h + -$(RM) $@ + $(LN_S) ../../$< $@ + depend: depend_idl depend_idl: diff --git a/adm_local/unix/config_files/check_Geom.m4 b/adm_local/unix/config_files/check_Geom.m4 deleted file mode 100644 index 13f3be40c..000000000 --- a/adm_local/unix/config_files/check_Geom.m4 +++ /dev/null @@ -1,45 +0,0 @@ -# Check availability of Geom binary distribution -# -# Author : Nicolas REJNERI (OPEN CASCADE, 2003) -# - -AC_DEFUN([CHECK_GEOM],[ - -AC_CHECKING(for Geom) - -Geom_ok=no - -AC_ARG_WITH(geom, - [ --with-geom=DIR root directory path of GEOM installation ], - GEOM_DIR="$withval",GEOM_DIR="") - -if test "x$GEOM_DIR" == "x" ; then - -# no --with-geom-dir option used - - if test "x$GEOM_ROOT_DIR" != "x" ; then - - # GEOM_ROOT_DIR environment variable defined - GEOM_DIR=$GEOM_ROOT_DIR - - fi -# -fi - -if test -f ${GEOM_DIR}/lib/salome/libGEOMClient.so ; then - Geom_ok=yes - AC_MSG_RESULT(Using Geom module distribution in ${GEOM_DIR}) - - if test "x$GEOM_ROOT_DIR" == "x" ; then - GEOM_ROOT_DIR=${GEOM_DIR} - fi - AC_SUBST(GEOM_ROOT_DIR) - -else - AC_MSG_WARN("Cannot find compiled Geom module distribution") -fi - -AC_MSG_RESULT(for Geom: $Geom_ok) - -])dnl - diff --git a/adm_local/unix/config_files/check_Med.m4 b/adm_local/unix/config_files/check_Med.m4 deleted file mode 100644 index 727bf4381..000000000 --- a/adm_local/unix/config_files/check_Med.m4 +++ /dev/null @@ -1,45 +0,0 @@ -# Check availability of Med binary distribution -# -# Author : Nicolas REJNERI (OPEN CASCADE, 2003) -# - -AC_DEFUN([CHECK_MED],[ - -AC_CHECKING(for Med) - -Med_ok=no - -AC_ARG_WITH(med, - [ --with-med=DIR root directory path of MED installation ], - MED_DIR="$withval",MED_DIR="") - -if test "x$MED_DIR" == "x" ; then - -# no --with-med-dir option used - - if test "x$MED_ROOT_DIR" != "x" ; then - - # MED_ROOT_DIR environment variable defined - MED_DIR=$MED_ROOT_DIR - - fi -# -fi - -if test -f ${MED_DIR}/idl/salome/MED.idl ; then - Med_ok=yes - AC_MSG_RESULT(Using Med module distribution in ${MED_DIR}) - - if test "x$MED_ROOT_DIR" == "x" ; then - MED_ROOT_DIR=${MED_DIR} - fi - AC_SUBST(MED_ROOT_DIR) - -else - AC_MSG_WARN("Cannot find Med module sources") -fi - -AC_MSG_RESULT(for Med: $Med_ok) - -])dnl - diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in index 5e556548e..71df45053 100644 --- a/adm_local/unix/make_commence.in +++ b/adm_local/unix/make_commence.in @@ -11,8 +11,8 @@ HAVE_SSTREAM=@HAVE_SSTREAM@ LIBS=@LIBS@ LIBSFORBIN=@LIBS@ -LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker $(top_builddir)/lib/salome -LDFLAGSFORBIN=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker $(top_builddir)/lib/salome +LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome -Xlinker -rpath-link -Xlinker +LDFLAGSFORBIN=@LDFLAGS@ -L$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome -Xlinker -rpath-link -Xlinker # add libstdc++ to link c++ library with libtool ! LDFLAGS+= -lstdc++ LDFLAGSFORBIN+= -lstdc++ @@ -54,8 +54,8 @@ PYTHONHOME = @PYTHONHOME@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ -PYTHON_SITE = @PYTHON_SITE@ -PYTHON_SITE_INSTALL = @PYTHON_SITE_INSTALL@ +PYTHON_SITE = $(prefix)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages +PYTHON_SITE_INSTALL = $(prefix)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome # QT @@ -168,6 +168,10 @@ CXXFLAGS+= $(CORBA_CXXFLAGS) #LDFLAGS+= $(CORBA_LIBS) LIBS+=$(CORBA_LIBS) +DOXYGEN = @DOXYGEN@ +DOXYGEN_WITH_PYTHON = @DOXYGEN_WITH_PYTHON@ +DOXYGEN_WITH_STL = @DOXYGEN_WITH_STL@ + ## Shared libraries LT_STATIC_EXEC=@LT_STATIC_EXEC@ DYNAMIC_DIRS=@DYNAMIC_DIRS@ @@ -188,16 +192,33 @@ INSTALL_DATA=@INSTALL_DATA@ # create a symbolic link (or a copie ?) LN_S=@LN_S@ +KERNEL_ROOT_DIR=@KERNEL_ROOT_DIR@ +KERNEL_SITE_DIR=@KERNEL_SITE_DIR@ +KERNEL_LDFLAGS=@KERNEL_LDFLAGS@ +KERNEL_CXXFLAGS=@KERNEL_CXXFLAGS@ + +GUI_ROOT_DIR=@GUI_ROOT_DIR@ +GUI_LDFLAGS=@GUI_LDFLAGS@ +GUI_CXXFLAGS=@GUI_CXXFLAGS@ + +MED_ROOT_DIR=@MED_ROOT_DIR@ +MED_LDFLAGS=@MED_LDFLAGS@ +MED_CXXFLAGS=@MED_CXXFLAGS@ + +GEOM_ROOT_DIR=@GEOM_ROOT_DIR@ +GEOM_LDFLAGS=@GEOM_LDFLAGS@ +GEOM_CXXFLAGS=@GEOM_CXXFLAGS@ + ## Installation points prefix=@prefix@ exec_prefix=@exec_prefix@ -bindir=@bindir@/salome -libdir=@libdir@/salome +bindir=@exec_prefix@/bin/salome +libdir=@exec_prefix@/lib@LIB_LOCATION_SUFFIX@/salome # warning : if user give this path in configure we could have salome/salome :-( includedir=@includedir@/salome datadir=@datadir@/salome idldir=$(prefix)/idl/salome -sharedpydir=@libdir@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules +sharedpydir=@exec_prefix@/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules docdir=${prefix}/doc/salome @@ -224,7 +245,13 @@ all: Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in cd $(top_builddir) ; ./config.status -$(top_builddir)/config.status: $(top_srcdir)/configure +LOCAL_MAKE = make_commence make_conclude make_omniorb + +KERNEL_MAKE = make_module depend SALOMEconfig.h F77config.h sstream envScript + +$(top_builddir)/config.status: $(top_srcdir)/configure \ + $(LOCAL_MAKE:%=$(top_srcdir)/adm_local/unix/%.in) \ + $(KERNEL_MAKE:%=$(KERNEL_ROOT_DIR)/salome_adm/unix/%.in) cd $(top_builddir) ; ./config.status --recheck # VPATH contain $(srcdir), so make configure is good in top_srcdir and we must add target configure otherwise :-) @@ -239,15 +266,42 @@ $(top_srcdir)/configure.in: $(top_srcdir)/configure.in.base cd $(top_srcdir) && ./build_configure -ACLOCAL_SRC = \ -ac_cxx_bool.m4 check_corba.m4 check_vtk.m4 \ -ac_cxx_depend_flag.m4 check_hdf5.m4 enable_pthreads.m4 \ -ac_cxx_mutable.m4 check_mico.m4 libtool.m4 \ -ac_cxx_namespaces.m4 check_omniorb.m4 pyembed.m4 \ -ac_cxx_partial_specialization.m4 check_opengl.m4 python.m4 \ -ac_cxx_typename.m4 check_pthreads.m4 check_cas.m4 \ -ac_cc_warnings.m4 check_qt.m4 check_boost.m4 \ -check_swig.m4 - -$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) - cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files +ACLOCAL_KERNEL = \ + ac_cxx_bool.m4 \ + check_corba.m4 \ + ac_cxx_depend_flag.m4 \ + check_hdf5.m4 \ + enable_pthreads.m4 \ + ac_cxx_mutable.m4 \ + check_mico.m4 \ + ac_cxx_namespaces.m4 \ + check_omniorb.m4 \ + pyembed.m4 \ + ac_cxx_partial_specialization.m4 \ + python.m4 \ + ac_cxx_typename.m4 \ + check_pthreads.m4 \ + check_cas.m4 \ + ac_cc_warnings.m4 \ + check_boost.m4 \ + check_swig.m4 + +ACLOCAL_GUI = \ + check_vtk.m4 \ + check_opengl.m4 \ + check_qt.m4 \ + check_GUI.m4 \ + check_corba_in_GUI.m4 + +ACLOCAL_MED = check_Med.m4 +ACLOCAL_GEOM = check_GEOM.m4 + +$(top_srcdir)/aclocal.m4: $(ACLOCAL_KERNEL:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \ + $(ACLOCAL_GUI:%=@GUI_ROOT_DIR@/adm_local/unix/config_files/%) \ + $(ACLOCAL_MED:%=@MED_ROOT_DIR@/adm_local/unix/config_files/%) \ + $(ACLOCAL_GEOM:%=@GEOM_ROOT_DIR@/adm_local/unix/config_files/%) + cd $(top_srcdir) ; aclocal -I adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \ + -I @GUI_ROOT_DIR@/adm_local/unix/config_files \ + -I @MED_ROOT_DIR@/adm_local/unix/config_files \ + -I @GEOM_ROOT_DIR@/adm_local/unix/config_files + diff --git a/adm_local/unix/make_conclude.in b/adm_local/unix/make_conclude.in index f4827fd31..37c65077f 100644 --- a/adm_local/unix/make_conclude.in +++ b/adm_local/unix/make_conclude.in @@ -35,9 +35,9 @@ LIB_OBJ_F = $(patsubst %.f, %.lo, $(filter %.f, $(LIB_SRC))) # all libtool obj file in library LIB_OBJ = $(LIB_OBJ_CXX) $(LIB_OBJ_CC) $(LIB_OBJ_C) $(LIB_CLIENT_OBJ:%.o=%.lo) $(LIB_SERVER_OBJ:%.o=%.lo) $(LIB_SWIG_OBJ) $(LIB_OBJ_F) -# LIB_BUILD = $(LIB:%.la=$(top_builddir)/lib/salome/%.la) -LIB_BUILD = $(patsubst %.la, $(top_builddir)/lib/salome/%.la, $(filter %.la, $(LIB))) -LIB_BUILD_A = $(patsubst %.a, $(top_builddir)/lib/salome/%.a, $(filter %.a, $(LIB))) +# LIB_BUILD = $(LIB:%.la=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la) +LIB_BUILD = $(patsubst %.la, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la, $(filter %.la, $(LIB))) +LIB_BUILD_A = $(patsubst %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a, $(filter %.a, $(LIB))) ifneq ($(findstring cmodule.la,$(filter %.la, $(LIB))),) LIB_SWIG = $(patsubst %cmodule.la,%.so, $(filter %.la, $(LIB))) @@ -48,7 +48,7 @@ endif lib: $(LIB_BUILD) $(LIB_CLIENT_PY) # we don't build static library ! -$(LIB_BUILD): $(top_builddir)/lib/salome/%.la: %.la +$(LIB_BUILD): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la: %.la -$(RM) $@ -$(RM) $(patsubst %.la, %.so, $@) -$(RM) $(patsubst %.la, %.a, $@) @@ -59,10 +59,10 @@ $(LIB_BUILD): $(top_builddir)/lib/salome/%.la: %.la $(patsubst %.la, %.so, $@).0 || true if ! test -z $(LIB_SWIG) ; then \ - ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib/salome/_$(LIB_SWIG) || true;\ + ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/_$(LIB_SWIG) || true;\ fi; -$(LIB_BUILD_A): $(top_builddir)/lib/salome/%.a: %.a +$(LIB_BUILD_A): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a: %.a -$(RM) $@ ln -sf $(CURDIR)/$< $@ || true @@ -106,7 +106,7 @@ $(DEST_PYSCRIPTS): $(top_builddir)/bin/salome/%: % # copy pyqt files in $(PYTHON_SHARED_SITE) # -PYTHON_SHARED_SITE=$(top_builddir)/lib/python$(PYTHON_VERSION)/site-packages/salome/shared_modules +PYTHON_SHARED_SITE=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules $(PYTHON_SHARED_SITE): $(INSTALL) -d $@ @@ -260,10 +260,10 @@ clean: mostlyclean -$(RM) $(LIB) $(TEST_PROGS) $(BIN) $(CLEAN) -$(RM) TAGS *~ *# core *.core -$(RM) -r .libs - -$(RM) $(top_builddir)/lib/salome/$(LIB) + -$(RM) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB) -$(RM) $(patsubst %,$(top_builddir)/bin/salome/%, $(BIN)) - -$(RM) $(patsubst %.la, %.so, $(top_builddir)/lib/salome/$(LIB)) - -$(RM) $(patsubst %.la, %.a, $(top_builddir)/lib/salome/$(LIB)) + -$(RM) $(patsubst %.la, %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB)) + -$(RM) $(patsubst %.la, %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB)) # remove idl generated files (sources) -$(RM) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC) # remove idl generated files (headers) diff --git a/bin/VERSION b/bin/VERSION deleted file mode 100755 index 2479b4f28..000000000 --- a/bin/VERSION +++ /dev/null @@ -1 +0,0 @@ -THIS IS SALOME - SMESH VERSION: 3.2.0a1 diff --git a/build_configure b/build_configure index b884b1757..121fb5d2a 100755 --- a/build_configure +++ b/build_configure @@ -26,6 +26,31 @@ fi # echo "failed : KERNEL_SRC variable is not correct !" # exit #fi + +######################################################################## +# Test if the GUI_ROOT_DIR is set correctly + +if test ! -d "${GUI_ROOT_DIR}"; then + echo "failed : GUI_ROOT_DIR variable is not correct !" + exit +fi + +######################################################################## +# Test if the MED_ROOT_DIR is set correctly + +if test ! -d "${MED_ROOT_DIR}"; then + echo "failed : MED_ROOT_DIR variable is not correct !" + exit +fi + +######################################################################## +# Test if the GEOM_ROOT_DIR is set correctly + +if test ! -d "${GEOM_ROOT_DIR}"; then + echo "failed : GEOM_ROOT_DIR variable is not correct !" + exit +fi + ######################################################################## # find_in - utility function # @@ -125,10 +150,10 @@ echo " ./salome_adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1 echo " ./salome_adm/unix/F77config.h \\" >> configure.in_tmp1 echo " ./salome_adm/unix/sstream \\" >> configure.in_tmp1 echo " ./salome_adm/unix/depend \\" >> configure.in_tmp1 -echo " ./adm_local/unix/make_omniorb \\" >> configure.in_tmp1 +echo " ./adm_local/unix/make_omniorb:${ABS_CONF_DIR}/adm_local/unix/make_omniorb.in \\" >> configure.in_tmp1 echo " ./salome_adm/unix/envScript \\" >> configure.in_tmp1 -echo " ./adm_local/unix/make_commence \\" >> configure.in_tmp1 -echo " ./adm_local/unix/make_conclude \\" >> configure.in_tmp1 +echo " ./adm_local/unix/make_commence:${ABS_CONF_DIR}/adm_local/unix/make_commence.in \\" >> configure.in_tmp1 +echo " ./adm_local/unix/make_conclude:${ABS_CONF_DIR}/adm_local/unix/make_conclude.in \\" >> configure.in_tmp1 echo " ./salome_adm/unix/make_module \\" >> configure.in_tmp1 \rm -f configure.in_tmp2 configure.in_tmp3 @@ -203,7 +228,10 @@ else echo -n "Creating 'configure' script ... " fi -aclocal --acdir=adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files +aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ + -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \ + -I ${MED_ROOT_DIR}/adm_local/unix/config_files \ + -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files if autoconf then echo "done" diff --git a/configure.in.base b/configure.in.base index d81e49771..cc915a120 100644 --- a/configure.in.base +++ b/configure.in.base @@ -22,8 +22,10 @@ AC_CANONICAL_HOST PACKAGE=salome AC_SUBST(PACKAGE) -VERSION=0.0.1 +VERSION=3.2.0 +XVERSION=0x030200 AC_SUBST(VERSION) +AC_SUBST(XVERSION) dnl dnl Initialize source and build root directories @@ -113,13 +115,7 @@ dnl AC_CXX_HAVE_SSTREAM -echo -echo --------------------------------------------- -echo BOOST Library -echo --------------------------------------------- -echo -CHECK_BOOST dnl dnl --------------------------------------------- @@ -249,6 +245,14 @@ echo CHECK_HDF5 +echo +echo --------------------------------------------- +echo BOOST Library +echo --------------------------------------------- +echo + +CHECK_BOOST + echo echo --------------------------------------------- echo Testing OpenCascade @@ -265,6 +269,26 @@ echo CHECK_HTML_GENERATORS +echo +echo --------------------------------------------- +echo Testing GUI +echo --------------------------------------------- +echo + +CHECK_SALOME_GUI + +echo +echo --------------------------------------------- +echo Testing full GUI +echo --------------------------------------------- +echo + +CHECK_CORBA_IN_GUI +if test "x${CORBA_IN_GUI}" != "xyes"; then + echo "failed : For configure SMESH module necessary full GUI !" + exit +fi + echo echo --------------------------------------------- echo Testing Kernel @@ -326,7 +350,7 @@ else fi # make other build directories -for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources idl +for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources idl do # if test ! -d $rep ; then # eval mkdir $rep diff --git a/doc/Makefile.in b/doc/Makefile.in index 7295ede75..af9e2aae5 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # -* Makefile *- # @@ -19,6 +38,17 @@ docs: @@SETX@; for d in $(SUBDIRS); do \ (cd $$d && $(MAKE) $@) || exit 1; \ done + +usr_docs: + @@SETX@; for d in $(SUBDIRS); do \ + (cd $$d && $(MAKE) $@) || exit 1; \ + done + +dev_docs: + @@SETX@; for d in $(SUBDIRS); do \ + (cd $$d && $(MAKE) $@) || exit 1; \ + done + clean: @@SETX@; for d in $(SUBDIRS); do \ (cd $$d && $(MAKE) $@) || exit 1; \ diff --git a/doc/salome/AddNetgenInSalome2.pdf b/doc/salome/AddNetgenInSalome2.pdf index 34fd25204..d736a6ded 100644 Binary files a/doc/salome/AddNetgenInSalome2.pdf and b/doc/salome/AddNetgenInSalome2.pdf differ diff --git a/doc/salome/Makefile.in b/doc/salome/Makefile.in index bd9a4eab5..4106d1ad3 100644 --- a/doc/salome/Makefile.in +++ b/doc/salome/Makefile.in @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # -* Makefile *- # @@ -12,33 +31,48 @@ srcdir=@srcdir@ VPATH=.:@srcdir@ SUBDIRS= tui gui +SUBDIRSTUI= tui +SUBDIRSGUI= gui @COMMENCE@ -docs: - @@SETX@; for d in $(SUBDIRS); do \ +usr_docs: + @@SETX@; for d in $(SUBDIRSGUI); do \ + (cd $$d && $(MAKE) $@) || exit 1; \ + done; \ + +docs: usr_docs + +dev_docs: + @@SETX@; for d in $(SUBDIRSTUI); do \ (cd $$d && $(MAKE) $@) || exit 1; \ done; \ - cp -f $(srcdir)/SMESH_index_v3.1.0.html SMESH_index_v3.1.0.html clean: @@SETX@; for d in $(SUBDIRS); do \ - (cd $$d && $(MAKE) $@) || exit 1; \ + if test -d $$d/SMESH; then \ + (cd $$d && $(MAKE) $@) || exit 1; \ + fi; \ done distclean: clean @@SETX@; for d in $(SUBDIRS); do \ - (cd $$d && $(MAKE) $@) || exit 1; \ + if test -d $$d/SMESH; then \ + (cd $$d && $(MAKE) $@) || exit 1; \ + fi; \ done install: $(MAKE) docs - (cd tui && $(MAKE) install); - (cd gui && $(MAKE) install); - cp -f SMESH_index_v3.1.0.html $(docdir) + @@SETX@; for d in $(SUBDIRS); do \ + if test -d $$d/SMESH; then \ + (cd $$d && $(MAKE) $@); \ + fi; \ + done uninstall: @@SETX@; for d in $(SUBDIRS); do \ - (cd $$d && $(MAKE) $@) || exit 1; \ + if test -d $$d/SMESH; then \ + (cd $$d && $(MAKE) $@) || exit 1; \ + fi; \ done; \ - rm -fr $(docdir)/SMESH_index_v3.1.0.html diff --git a/doc/salome/SMESH_index_v3.1.0.html b/doc/salome/SMESH_index_v3.1.0.html deleted file mode 100644 index 8d4ef121a..000000000 --- a/doc/salome/SMESH_index_v3.1.0.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - Mesh Module Documentation - - - -
  -
-
                   -   
- - - - - - - - - -
- - - -
- -
-
-
-

Mesh MODULE Documentation

-
-
- - - - - -
-
- -
-

Application-About.png -     

-
- -
- - - - -
-
-
-
-
- -
- -
GUI Documentation
- -
- -
- -

-
- -
- -
TUI Documentation
- -
- -
- -

-
-
-
-
-
-
- - diff --git a/doc/salome/gui/Makefile.in b/doc/salome/gui/Makefile.in index 883a053da..c08ee2735 100644 --- a/doc/salome/gui/Makefile.in +++ b/doc/salome/gui/Makefile.in @@ -1,6 +1,21 @@ -# Copyright (C) 2003 CEA/DEN, EDF R&D +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. # +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# 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 : Vasily Rusyaev (Open Cascade NN) @@ -14,9 +29,11 @@ VPATH=.:@srcdir@ @COMMENCE@ -docs: +usr_docs: cp -fr $(srcdir)/SMESH ./ - -find $(PWD) -name CVS -exec rm -rf {} \; + -find $(PWD) -name CVS -prune -exec rm -rf {} \; + +docs: usr_docs clean: rm -fr `ls | grep -v "Makefile"` @@ -27,7 +44,7 @@ distclean: clean install: mkdir -p $(docdir)/gui cp -rf SMESH $(docdir)/gui - -find $(PWD) -name CVS -exec rm -rf {} \; + -find $(PWD) -name CVS -prune -exec rm -rf {} \; uninstall: rm -rf $(docdir)/gui/SMESH diff --git a/doc/salome/gui/SMESH/about_viewing_meshes.htm b/doc/salome/gui/SMESH/about_viewing_meshes.htm index 77ef54955..d47aa94f8 100755 --- a/doc/salome/gui/SMESH/about_viewing_meshes.htm +++ b/doc/salome/gui/SMESH/about_viewing_meshes.htm @@ -1,150 +1,169 @@ - - - - - -About viewing meshes - - - - - - - - - - - - -

About viewing meshes

- -

You can get information about your mesh, change its presentation parameters - and access to other useful functionalities by right-clicking on it in - the Object Browser.

- -

Then the - following pop-up menu appears:

- -

  

- -

- -

 

- -

The Update button refreshes the presentation of your mesh in the Object - Browser, applying all recent changes.

- -

By clicking on Standard Mesh Infos - and Advanced Mesh - Infos you can learn the Mesh - Infos.

- -

Via Numbering -  you can - display the ID numbers of all meshing elements or nodes composing your - mesh in the viewer.

- -

Via Display Mode, Display - Entity,  Colors - / Size, and  Transparency - you can change the way of presentation of your mesh.

- -

In the Clipping menu you can create - cross-sections of the selected objects.

- -

Quality Controls are described in - the next chapter.

- -

By clicking on Display Only - you hide all other objects.

- -

The Erase button deletes the - selected object from the session.

- -

Using the Change background - button you can set the background color. By default it is black.  

- -

 

- -

See Also - a sample TUI Script of a Viewing Mesh Infos - operation.  

- -

 

- - - - + + + + + +About viewing meshes + + + + + + + + + + + + +

Viewing meshes

+ +

After definition of algorithms and hypotheses a new mesh is listed in + the Object Browser. Right-click on it and select Compute - the mesh will be automatically + displayed in the VTK + 3D Viewer. Alternatively click + Display only to hide all other objects at the same time.

+ +

 

+ +

After the mesh has appeared in the Viewer, you can select it with left + mouse click and  get + information about it, change its presentation parameters and access to + other useful options by right-clicking on the selected mesh.

+ +

  

+ +

+ +

 

+ + + +

 

+ + + + diff --git a/doc/salome/gui/SMESH/adding_quadratic_nodes_and_elements.htm b/doc/salome/gui/SMESH/adding_quadratic_nodes_and_elements.htm index 86db2586e..b4d5067d2 100755 --- a/doc/salome/gui/SMESH/adding_quadratic_nodes_and_elements.htm +++ b/doc/salome/gui/SMESH/adding_quadratic_nodes_and_elements.htm @@ -1,124 +1,124 @@ - - - - - -Adding Quadratic Nodes and Elements - - - - - - - - - - -

Adding Quadratic Elements

- -

MESH modules allows you to work with Quadratic - Elements.

- -

Quadratic Edge in not a straight but a broken line and can be defined - by three points: first, middle and last. All more complex Quadratic - Elements differ from ordinary ones in that they consist of Quadratic - Edges.

- -

To - add a quadratic element to your mesh:

- -

1. Select your mesh in the Object Browser - or in the 3D viewer.

- -

2. From the Modification - menu choose the Add item - and select one of the following:

- -

- -

To create any Quadratic - Element specify the nodes which will form your triangle by selecting - them in the 3D viewer with pressed Shift button. Their numbers will appear - in the dialog box as Corner Nodes - (alternatively you can just input numbers in this field without selection).The - edges formed by the corner nodes will appear in the table. To define the - middle nodes for each edge double-click on the respective field and input - the number of the node. All edges and the object formed by them will be - displayed in the Object browser. When all edges are defined you will be - able to click OK or Apply - button to add the element to the mesh.

- -

 

- -

Reverse - button for Quadratic Edges switches the first and the last nodes. For all other elements it reverses the element. -

- -

 

- - - - + + + + + +Adding Quadratic Nodes and Elements + + + + + + + + + + +

Adding Quadratic Elements

+ +

MESH modules allows you to work with Quadratic + Elements.

+ +

Quadratic Edge in not a straight but a broken line and can be defined + by three points: first, middle and last. All more complex Quadratic + Elements differ from ordinary ones in that they consist of Quadratic + Edges.

+ +

To + add a quadratic element to your mesh:

+ +

1. Select your mesh in the Object Browser + or in the 3D viewer.

+ +

2. From the Modification + menu choose the Add item + and select one of the following:

+ +

+ +

To create any Quadratic + Element specify the nodes which will form your triangle by selecting + them in the 3D viewer with pressed Shift button. Their numbers will appear + in the dialog box as Corner Nodes + (alternatively you can just input numbers in this field without selection).The + edges formed by the corner nodes will appear in the table. To define the + middle nodes for each edge double-click on the respective field and input + the number of the node. All edges and the object formed by them will be + displayed in the Object browser. When all edges are defined you will be + able to click OK or Apply + button to add the element to the mesh.

+ +

 

+ +

Reverse + button for Quadratic Edges switches the first and the last nodes. For all other elements it reverses the element. +

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/aspect_ratio_3d.htm b/doc/salome/gui/SMESH/aspect_ratio_3d.htm index 20573a1fd..bd1d7ddfc 100755 --- a/doc/salome/gui/SMESH/aspect_ratio_3d.htm +++ b/doc/salome/gui/SMESH/aspect_ratio_3d.htm @@ -1,163 +1,203 @@ - - - - - -Aspect ratio 3D - - - - - - - - - - - - -

Aspect ratio 3D

- -

- -

 

- -

This mesh quality criterion resembles to the Aspect ratio - criterion, however, it is applied to 3D mesh elements: tetrahedrons, - pentahedrons, hexahedrons, etc.  

- -

There are simple formulas to evaluate directly the value of quality - Qk for simplex in 3D. The formulas are :

- -
- -

• For tetrahedron :

- -

 

- -

 

- -

where :

- -

- -

To calculate Sk , it is needed to sum the area of each of the 3 faces - with the formula given with the triangle.

- -

 

- -

For the other types of element like pentahedron and hexahedron - the formula is the following :

- -

- -

Where Qi are the quality of all the possible simplex (of same dimension - as the element) that compose the element.

- -

For example, hexahedron is analysed via 6 tetrahedrons this way:

- -

- -

 

- -

For 3D elements with quadrangular faces, aspect ratio of such faces -is also analysed and the maximal one over 3D and 2D qualities is taken.

- -

 

- -

 

- -

See Also - a sample TUI Script of an Aspect - Ratio quality control operation.  

- -

 

- -

 

- -

 

- -

 

- - - - + + + + + +Aspect ratio 3D + + + + + + + + + + + + + +

Aspect ratio 3D

+ +

+ +

 

+ +

The Aspect Ratio 3D mesh quality criterion calculates + the same parameter as the Aspect ratio + criterion, but it is applied to 3D mesh elements: tetrahedrons, pentahedrons, + hexahedrons, etc.  

+ +

 

+ + + +

 

+ +

 

+ +

,

+ +

 

+ +

where SK is the sum of surfaces of the faces + of К and VK is the volume of К :

+ +

 

+ +

T

+ +

 

+ + + +

, where Qi represents the value of Qk for all possible simplexes (of the + same dimension as the element) that compose the element.

+ +

For example, a hexahedron is split in 6 tetrahedrons, the Aspect + ratio 3D is calculated for each of them, then the greatest Qk is considered to be the  Aspect ratio 3D + criterion for the whole  hexahedron.

+ +

+ +

 

+ +

To apply the Aspect Ratio 3D quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Aspect Ratio 3D or click button of the toolbar. + Your mesh will be displayed in the viewer with its elements colored according + to the applied mesh quality control criterion:

+ +

 

+ +

See Also + a sample TUI Script of an Aspect + Ratio 3D quality control operation.  

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/borders_at_multi-connection.htm b/doc/salome/gui/SMESH/borders_at_multi-connection.htm index cba301b96..8ad86b523 100755 --- a/doc/salome/gui/SMESH/borders_at_multi-connection.htm +++ b/doc/salome/gui/SMESH/borders_at_multi-connection.htm @@ -1,115 +1,121 @@ - - - - - -Borders at multi-connection - - - - - - - - - - - - -

Borders at multi-connection

- -

This mesh quality control highlights borders of faces - consisting of edges belonging to several faces. The amount of faces is - specified by user.

- -

 

- -

- -

 

- -

In this picture the borders at multi-connection are displayed in white.

- -

 

- -

See Also - a sample TUI Script of a Borders - at Multi-Connection quality control operation.  

- -

 

- - - - + + + + + +Borders at multi-connection + + + + + + + + + + + + + +

Borders at multi-connection

+ +

This mesh quality control highlights borders of faces + consisting of edges belonging to several faces. The amount of faces is + specified by user.

+ +

 

+ +

+ +

 

+ +

In this picture the borders at multi-connection are displayed in blue.

+ +

 

+ +

See Also + a sample TUI Script of a Borders + at Multi-Connection quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/borders_at_multiconnection_2d.htm b/doc/salome/gui/SMESH/borders_at_multiconnection_2d.htm index 9587602aa..2e9e180c0 100755 --- a/doc/salome/gui/SMESH/borders_at_multiconnection_2d.htm +++ b/doc/salome/gui/SMESH/borders_at_multiconnection_2d.htm @@ -1,110 +1,115 @@ - - - - - -Borders at multiconnection 2D - - - - - - - - - - - - -

Borders at multi-connection 2D

- -

This mesh quality control highlights borders of elements - of mesh, consisting of edges belonging to several elements of mesh.

- -

 

- -

        

- -

 

- -

See Also - a sample TUI Script of a Borders - at Multi-Connection quality control operation.  

- -

 

- - - - + + + + + +Borders at multiconnection 2D + + + + + + + + + + + + + +

Borders at multi-connection 2D

+ +

This mesh quality control highlights borders of elements + of mesh, consisting of edges belonging to several elements of mesh.

+ +

 

+ +

        

+ +

 

+ +

See Also + a sample TUI Script of a Borders + at Multi-Connection quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/clipping.htm b/doc/salome/gui/SMESH/clipping.htm index 8652fd75f..dec479c99 100755 --- a/doc/salome/gui/SMESH/clipping.htm +++ b/doc/salome/gui/SMESH/clipping.htm @@ -1,133 +1,140 @@ - - - - - -Clipping - - - - - - - - - - - -

Clipping

- -

Using this menu you can create cross-section views (clipping planes) - of your mesh.

- -

 

- -

To start, click on the New button.

- -

 

- -

- -

 

- -

Now you can define the parameters of your cross-section: Orientation -  (X-Y, X-Z - or Y-Z); Distance between the - opposite extremities of the object, if - it is set to 0.5 the object is split in two halves; and Rotation - (in angle degrees) around X (Y to Z) - and around Y (X to Z). - If the Show preview button is - on, you can see the clipping plane in the Object - window.

- -

 

- -

- -

 

- -

If the - Auto Apply button is on, you can preview - the cross-section in the Object window

- -

 

- -

- -

 

- -

To get - a new object from Clipping, click - Ok.

- -

 

- -

 

- - - - + + + + + +Clipping + + + + + + + + + + + + +

Clipping

+ +

Using this menu you can create cross-section views (clipping planes) + of your mesh.

+ +

 

+ +

To start, click on the New button.

+ +

 

+ +

+ +

 

+ +

Now you can define the parameters of your cross-section: Orientation +  (X-Y, X-Z + or Y-Z); Distance between the + opposite extremities of the object, if + it is set to 0.5 the object is split in two halves; and Rotation + (in angle degrees) around X (Y to Z) + and around Y (X to Z). + If the Show preview button is + on, you can see the clipping plane in the Object + window.

+ +

 

+ +

+ +

 

+ +

If the + Auto Apply button is on, you can preview + the cross-section in the Object window

+ +

 

+ +

+ +

 

+ +

To get + a new object from Clipping, click + Ok.

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/constructing_meshes.htm b/doc/salome/gui/SMESH/constructing_meshes.htm index 78d8030db..90d82bffc 100755 --- a/doc/salome/gui/SMESH/constructing_meshes.htm +++ b/doc/salome/gui/SMESH/constructing_meshes.htm @@ -1,727 +1,732 @@ - - - - - -Constructing Meshes - - - - - - - - - - -

Creating Meshes

- -

Construction of a Mesh

- -

import salome

- -

import geompy

- -

import StdMeshers

- -

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

- -

smeshgui = salome.ImportComponentGUI("SMESH")

- -

smeshgui.Init(salome.myStudyId);

- -

 

- -

# create a box

- -

box = geompy.MakeBox(0., - 0., 0., 100., 200., 300.)

- -

 

- -

# add box to the study

- -

idbox = geompy.addToStudy(box, - "box")

- -

 

- -

# create a hypothesis

- -

print "-------------------------- - create Hypothesis"

- -

print "-------------------------- - NumberOfSegments"

- -

numberOfSegments - = 7

- -

hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

- -

hypNbSeg.SetNumberOfSegments(numberOfSegments)

- -

print hypNbSeg.GetName()

- -

print hypNbSeg.GetId()

- -

print hypNbSeg.GetNumberOfSegments()

- -

smeshgui.SetName(salome.ObjectToID(hypNbSeg), - "NumberOfSegments_10")

- -

print "-------------------------- - MaxElementArea"

- -

maxElementArea = - 800

- -

hypArea = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

- -

hypArea.SetMaxElementArea(maxElementArea)

- -

print hypArea.GetName()

- -

print hypArea.GetId()

- -

print hypArea.GetMaxElementArea()

- -

smeshgui.SetName(salome.ObjectToID(hypArea), - "MaxElementArea_500")

- -

print "-------------------------- - MaxElementVolume"

- -

maxElementVolume - = 900

- -

hypVolume = smesh.CreateHypothesis("MaxElementVolume", - "libStdMeshersEngine.so")

- -

hypVolume.SetMaxElementVolume(maxElementVolume)

- -

print hypVolume.GetName()

- -

print hypVolume.GetId()

- -

print hypVolume.GetMaxElementVolume()

- -

smeshgui.SetName(salome.ObjectToID(hypVolume), - "MaxElementVolume_500")

- -

 

- -

# create algorithms

- -

print "-------------------------- - create Algorithms"

- -

print "-------------------------- - Regular_1D"

- -

regular1D = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(regular1D), - "Wire Discretisation")

- -

print "-------------------------- - MEFISTO_2D"

- -

mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(mefisto2D), - "MEFISTO_2D")

- -

 

- -

# initialize a mesh with - the box

- -

mesh = smesh.CreateMesh(box)

- -

smeshgui.SetName(salome.ObjectToID(mesh), - "MeshBox")

- -

 

- -

# add the hypothesis to - the box

- -

print "-------------------------- - add hypothesis to the box"

- -

mesh.AddHypothesis(box,hypNbSeg)

- -

mesh.AddHypothesis(box,hypArea)

- -

mesh.AddHypothesis(box,hypVolume)

- -

mesh.AddHypothesis(box,regular1D)

- -

mesh.AddHypothesis(box,mefisto2D)

- -

 

- -

# compute the mesh

- -

print "-------------------------- - compute the mesh of the box"

- -

ret = smesh.Compute(mesh,box)

- -

print ret

- -

if ret == 0:

- -

    print - "probleme when computing the mesh"

- -

salome.sg.updateObjBrowser(1)

- -

 

- -

Construction of a Submesh

- -

 

- -

from - geompy import *

- -

import smesh

- -

 

- -

# create vertices

- -

Point111 = MakeVertex( 0,  0, -  0)

- -

Point211 = MakeVertex(10,  0, -  0)

- -

Point121 = MakeVertex( 0, 10,  0)

- -

Point221 = MakeVertex(10, 10,  0)

- -

Point112 = MakeVertex( 0,  0, - 10)

- -

Point212 = MakeVertex(10,  0, - 10)

- -

Point122 = MakeVertex( 0, 10, 10)

- -

Point222 = MakeVertex(10, 10, 10)

- -

 

- -

# create edges

- -

EdgeX111 = MakeEdge(Point111, Point211)

- -

EdgeX121 = MakeEdge(Point121, Point221)

- -

EdgeX112 = MakeEdge(Point112, Point212)

- -

EdgeX122 = MakeEdge(Point122, Point222)

- -

EdgeY11 = MakeEdge(Point111, Point121)

- -

EdgeY21 = MakeEdge(Point211, Point221)

- -

EdgeY12 = MakeEdge(Point112, Point122)

- -

EdgeY22 = MakeEdge(Point212, Point222)

- -

EdgeZ111 = MakeEdge(Point111, Point112)

- -

EdgeZ211 = MakeEdge(Point211, Point212)

- -

EdgeZ121 = MakeEdge(Point121, Point122)

- -

EdgeZ221 = MakeEdge(Point221, Point222)

- -

 

- -

# create faces

- -

FaceX11 = MakeQuad(EdgeY11, EdgeZ111, - EdgeY12, EdgeZ121)

- -

FaceX21 = MakeQuad(EdgeY21, EdgeZ211, - EdgeY22, EdgeZ221)

- -

FaceY111 = MakeQuad(EdgeX111, EdgeZ111, - EdgeX112, EdgeZ211)

- -

FaceY121 = MakeQuad(EdgeX121, EdgeZ121, - EdgeX122, EdgeZ221)

- -

FaceZ11 = MakeQuad(EdgeX111, EdgeY11, - EdgeX121, EdgeY21)

- -

FaceZ12 = MakeQuad(EdgeX112, EdgeY12, - EdgeX122, EdgeY22)

- -

 

- -

# create a solid

- -

Block = MakeHexa(FaceX11, FaceX21, FaceY111, - FaceY121, FaceZ11, FaceZ12)

- -

 

- -

# create a compound

- -

box = MakeCompound([Block])

- -

 

- -

# add in the study

- -

box_id = addToStudy(box, "Box compound")

- -

 

- -

# create hexahedral mesh - on the box

- -

hexa = smesh.Mesh(box, "Box compound - : hexahedrical mesh")

- -

algo = hexa.Segment()

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut the edge in a fixed number of segments

- -

algo.NumberOfSegments(4)

- -

 

- -

# creates a quadrangle - 2D algorithm for the faces

- -

hexa.Quadrangle()

- -

 

- -

# construct a submesh with - a local hypothesis

- -

algo = hexa.Segment(EdgeX111)

- -

 

- -

# define "Arithmetic1D" - hypothesis to cut an edge in several segments with increasing arithmetic - length

- -

algo.Arithmetic1D(1, 4)

- -

 

- -

# define "Propagation" - hypothesis that propagates all other hypothesis on all edges on the opposite - side in case of quadrangular faces

- -

algo.Propagation()

- -

 

- -

# compute the mesh

- -

hexa.Compute() )

- -

 

- -

Editing of a mesh

- -

 

- -

import - salome

- -

import geompy

- -

import SMESH

- -

import StdMeshers

- -

 

- -

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

- -

smesh.SetCurrentStudy(salome.myStudy)

- -

 

- -

box   = - geompy.MakeBox(0., 0., 0., 20., 20., 20.)

- -

idbox = geompy.addToStudy(box, "box")

- -

 

- -

subShapeList = geompy.SubShapeAll(box, - geompy.ShapeType["EDGE"])

- -

edge   = - subShapeList[0]

- -

name   = - geompy.SubShapeName(edge, box)

- -

idedge = geompy.addToStudyInFather(box, - edge, name)

- -

 

- -

box  = - salome.IDToObject(idbox)

- -

edge = salome.IDToObject(idedge)

- -

 

- -

hyp1 = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

- -

hyp1.SetNumberOfSegments(3)

- -

hyp2 = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

- -

hyp2.SetMaxElementArea(10)

- -

hyp3 = smesh.CreateHypothesis("Arithmetic1D", - "libStdMeshersEngine.so")

- -

hyp3.SetLength(1,1)

- -

hyp3.SetLength(6,0)

- -

hyp4 = smesh.CreateHypothesis("Propagation", - "libStdMeshersEngine.so")

- -

 

- -

algo1 = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

- -

algo2 = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

- -

 

- -

mesh = smesh.CreateMesh(box)

- -

mesh.AddHypothesis(box,hyp1)

- -

mesh.AddHypothesis(box,hyp2)

- -

mesh.AddHypothesis(box,algo1)

- -

mesh.AddHypothesis(box,algo2)

- -

mesh.AddHypothesis(edge,hyp3)

- -

mesh.AddHypothesis(edge,hyp4)

- -

mesh.AddHypothesis(edge,algo1)

- -

 

- -

smesh.Compute(mesh,box)

- -

salome.sg.updateObjBrowser(1)

- -

 

- -

# remove a hypothesis

- -

mesh.RemoveHypothesis(edge,hyp4)

- -

 

- -

smesh.Compute(mesh,box)

- -

salome.sg.updateObjBrowser(1)

- -

 

- -

# change the value - of the hypothesis

- -

hyp2.SetMaxElementArea(2)

- -

mesh.AddHypothesis(box,hyp2)

- -

 

- -

smesh.Compute(mesh,box)

- -

salome.sg.updateObjBrowser(1)

- -

 

- -

Export of a Mesh

- -

 

- -

import - salome

- -

import geompy

- -

import StdMeshers

- -

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

- -

smeshgui = salome.ImportComponentGUI("SMESH")

- -

smeshgui.Init(salome.myStudyId);

- -

 

- -

# create a box

- -

box = geompy.MakeBox(0., - 0., 0., 100., 200., 300.)

- -

 

- -

# add the box to the study

- -

idbox = geompy.addToStudy(box, - "box")

- -

 

- -

# create a hypothesis

- -

print "-------------------------- - create Hypothesis"

- -

print "-------------------------- - NumberOfSegments"

- -

numberOfSegments - = 7

- -

hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

- -

hypNbSeg.SetNumberOfSegments(numberOfSegments)

- -

print hypNbSeg.GetName()

- -

print hypNbSeg.GetId()

- -

print hypNbSeg.GetNumberOfSegments()

- -

smeshgui.SetName(salome.ObjectToID(hypNbSeg), - "NumberOfSegments_10")

- -

print "-------------------------- - MaxElementArea"

- -

maxElementArea = - 800

- -

hypArea = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

- -

hypArea.SetMaxElementArea(maxElementArea)

- -

print hypArea.GetName()

- -

print hypArea.GetId()

- -

print hypArea.GetMaxElementArea()

- -

smeshgui.SetName(salome.ObjectToID(hypArea), - "MaxElementArea_500")

- -

print "-------------------------- - MaxElementVolume"

- -

maxElementVolume - = 900

- -

hypVolume = smesh.CreateHypothesis("MaxElementVolume", - "libStdMeshersEngine.so")

- -

hypVolume.SetMaxElementVolume(maxElementVolume)

- -

print hypVolume.GetName()

- -

print hypVolume.GetId()

- -

print hypVolume.GetMaxElementVolume()

- -

smeshgui.SetName(salome.ObjectToID(hypVolume), - "MaxElementVolume_500")

- -

 

- -

# create algorithms

- -

print "-------------------------- - create Algorithms"

- -

print "-------------------------- - Regular_1D"

- -

regular1D = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(regular1D), - "Wire Discretisation")

- -

print "-------------------------- - MEFISTO_2D"

- -

mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(mefisto2D), - "MEFISTO_2D")

- -

 

- -

# initialize a mesh with - the box

- -

mesh = smesh.CreateMesh(box)

- -

smeshgui.SetName(salome.ObjectToID(mesh), - "MeshBox")

- -

 

- -

# add the hypothesis to - the box

- -

print "-------------------------- - add hypothesis to the box"

- -

mesh.AddHypothesis(box,hypNbSeg)

- -

mesh.AddHypothesis(box,hypArea)

- -

mesh.AddHypothesis(box,hypVolume)

- -

mesh.AddHypothesis(box,regular1D)

- -

mesh.AddHypothesis(box,mefisto2D)

- -

 

- -

# compute the mesh

- -

print "-------------------------- - compute the mesh of the box"

- -

ret = smesh.Compute(mesh,box)

- -

print ret

- -

if ret == 0:

- -

    print - "probleme when computing the mesh"

- -

salome.sg.updateObjBrowser(1)

- -

mesh.ExportMED("/tmp/meshMED.med",0)

- -

 

- -

 

- - - - + + + + + +Constructing Meshes + + + + + + + + + + + +

Creating Meshes

+ +

Construction of a Mesh

+ +

import salome

+ +

import geompy

+ +

import StdMeshers

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smeshgui = salome.ImportComponentGUI("SMESH")

+ +

smeshgui.Init(salome.myStudyId);

+ +

 

+ +

# create a box

+ +

box = geompy.MakeBox(0., + 0., 0., 100., 200., 300.)

+ +

 

+ +

# add box to the study

+ +

idbox = geompy.addToStudy(box, + "box")

+ +

 

+ +

# create a hypothesis

+ +

print "-------------------------- + create Hypothesis"

+ +

print "-------------------------- + NumberOfSegments"

+ +

numberOfSegments + = 7

+ +

hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", + "libStdMeshersEngine.so")

+ +

hypNbSeg.SetNumberOfSegments(numberOfSegments)

+ +

print hypNbSeg.GetName()

+ +

print hypNbSeg.GetId()

+ +

print hypNbSeg.GetNumberOfSegments()

+ +

smeshgui.SetName(salome.ObjectToID(hypNbSeg), + "NumberOfSegments_10")

+ +

print "-------------------------- + MaxElementArea"

+ +

maxElementArea = + 800

+ +

hypArea = smesh.CreateHypothesis("MaxElementArea", + "libStdMeshersEngine.so")

+ +

hypArea.SetMaxElementArea(maxElementArea)

+ +

print hypArea.GetName()

+ +

print hypArea.GetId()

+ +

print hypArea.GetMaxElementArea()

+ +

smeshgui.SetName(salome.ObjectToID(hypArea), + "MaxElementArea_500")

+ +

print "-------------------------- + MaxElementVolume"

+ +

maxElementVolume + = 900

+ +

hypVolume = smesh.CreateHypothesis("MaxElementVolume", + "libStdMeshersEngine.so")

+ +

hypVolume.SetMaxElementVolume(maxElementVolume)

+ +

print hypVolume.GetName()

+ +

print hypVolume.GetId()

+ +

print hypVolume.GetMaxElementVolume()

+ +

smeshgui.SetName(salome.ObjectToID(hypVolume), + "MaxElementVolume_500")

+ +

 

+ +

# create algorithms

+ +

print "-------------------------- + create Algorithms"

+ +

print "-------------------------- + Regular_1D"

+ +

regular1D = smesh.CreateHypothesis("Regular_1D", + "libStdMeshersEngine.so")

+ +

smeshgui.SetName(salome.ObjectToID(regular1D), + "Wire Discretisation")

+ +

print "-------------------------- + MEFISTO_2D"

+ +

mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", + "libStdMeshersEngine.so")

+ +

smeshgui.SetName(salome.ObjectToID(mefisto2D), + "MEFISTO_2D")

+ +

 

+ +

# initialize a mesh with + the box

+ +

mesh = smesh.CreateMesh(box)

+ +

smeshgui.SetName(salome.ObjectToID(mesh), + "MeshBox")

+ +

 

+ +

# add the hypothesis to + the box

+ +

print "-------------------------- + add hypothesis to the box"

+ +

mesh.AddHypothesis(box,hypNbSeg)

+ +

mesh.AddHypothesis(box,hypArea)

+ +

mesh.AddHypothesis(box,hypVolume)

+ +

mesh.AddHypothesis(box,regular1D)

+ +

mesh.AddHypothesis(box,mefisto2D)

+ +

 

+ +

# compute the mesh

+ +

print "-------------------------- + compute the mesh of the box"

+ +

ret = smesh.Compute(mesh,box)

+ +

print ret

+ +

if ret == 0:

+ +

    print + "probleme when computing the mesh"

+ +

salome.sg.updateObjBrowser(1)

+ +

 

+ +

Construction of a Submesh

+ +

 

+ +

from + geompy import *

+ +

import smesh

+ +

 

+ +

# create vertices

+ +

Point111 = MakeVertex( 0,  0, +  0)

+ +

Point211 = MakeVertex(10,  0, +  0)

+ +

Point121 = MakeVertex( 0, 10,  0)

+ +

Point221 = MakeVertex(10, 10,  0)

+ +

Point112 = MakeVertex( 0,  0, + 10)

+ +

Point212 = MakeVertex(10,  0, + 10)

+ +

Point122 = MakeVertex( 0, 10, 10)

+ +

Point222 = MakeVertex(10, 10, 10)

+ +

 

+ +

# create edges

+ +

EdgeX111 = MakeEdge(Point111, Point211)

+ +

EdgeX121 = MakeEdge(Point121, Point221)

+ +

EdgeX112 = MakeEdge(Point112, Point212)

+ +

EdgeX122 = MakeEdge(Point122, Point222)

+ +

EdgeY11 = MakeEdge(Point111, Point121)

+ +

EdgeY21 = MakeEdge(Point211, Point221)

+ +

EdgeY12 = MakeEdge(Point112, Point122)

+ +

EdgeY22 = MakeEdge(Point212, Point222)

+ +

EdgeZ111 = MakeEdge(Point111, Point112)

+ +

EdgeZ211 = MakeEdge(Point211, Point212)

+ +

EdgeZ121 = MakeEdge(Point121, Point122)

+ +

EdgeZ221 = MakeEdge(Point221, Point222)

+ +

 

+ +

# create faces

+ +

FaceX11 = MakeQuad(EdgeY11, EdgeZ111, + EdgeY12, EdgeZ121)

+ +

FaceX21 = MakeQuad(EdgeY21, EdgeZ211, + EdgeY22, EdgeZ221)

+ +

FaceY111 = MakeQuad(EdgeX111, EdgeZ111, + EdgeX112, EdgeZ211)

+ +

FaceY121 = MakeQuad(EdgeX121, EdgeZ121, + EdgeX122, EdgeZ221)

+ +

FaceZ11 = MakeQuad(EdgeX111, EdgeY11, + EdgeX121, EdgeY21)

+ +

FaceZ12 = MakeQuad(EdgeX112, EdgeY12, + EdgeX122, EdgeY22)

+ +

 

+ +

# create a solid

+ +

Block = MakeHexa(FaceX11, FaceX21, FaceY111, + FaceY121, FaceZ11, FaceZ12)

+ +

 

+ +

# create a compound

+ +

box = MakeCompound([Block])

+ +

 

+ +

# add in the study

+ +

box_id = addToStudy(box, "Box compound")

+ +

 

+ +

# create hexahedral mesh + on the box

+ +

hexa = smesh.Mesh(box, "Box compound + : hexahedrical mesh")

+ +

algo = hexa.Segment()

+ +

 

+ +

# define "NumberOfSegments" + hypothesis to cut the edge in a fixed number of segments

+ +

algo.NumberOfSegments(4)

+ +

 

+ +

# creates a quadrangle + 2D algorithm for the faces

+ +

hexa.Quadrangle()

+ +

 

+ +

# construct a submesh with + a local hypothesis

+ +

algo = hexa.Segment(EdgeX111)

+ +

 

+ +

# define "Arithmetic1D" + hypothesis to cut an edge in several segments with increasing arithmetic + length

+ +

algo.Arithmetic1D(1, 4)

+ +

 

+ +

# define "Propagation" + hypothesis that propagates all other hypothesis on all edges on the opposite + side in case of quadrangular faces

+ +

algo.Propagation()

+ +

 

+ +

# compute the mesh

+ +

hexa.Compute()

+ +

 

+ +

Editing of a mesh

+ +

 

+ +

import + salome

+ +

import geompy

+ +

import SMESH

+ +

import StdMeshers

+ +

 

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smesh.SetCurrentStudy(salome.myStudy)

+ +

 

+ +

box   = + geompy.MakeBox(0., 0., 0., 20., 20., 20.)

+ +

idbox = geompy.addToStudy(box, "box")

+ +

 

+ +

subShapeList = geompy.SubShapeAll(box, + geompy.ShapeType["EDGE"])

+ +

edge   = + subShapeList[0]

+ +

name   = + geompy.SubShapeName(edge, box)

+ +

idedge = geompy.addToStudyInFather(box, + edge, name)

+ +

 

+ +

box  = + salome.IDToObject(idbox)

+ +

edge = salome.IDToObject(idedge)

+ +

 

+ +

hyp1 = smesh.CreateHypothesis("NumberOfSegments", + "libStdMeshersEngine.so")

+ +

hyp1.SetNumberOfSegments(3)

+ +

hyp2 = smesh.CreateHypothesis("MaxElementArea", + "libStdMeshersEngine.so")

+ +

hyp2.SetMaxElementArea(10)

+ +

hyp3 = smesh.CreateHypothesis("Arithmetic1D", + "libStdMeshersEngine.so")

+ +

hyp3.SetLength(1,1)

+ +

hyp3.SetLength(6,0)

+ +

hyp4 = smesh.CreateHypothesis("Propagation", + "libStdMeshersEngine.so")

+ +

 

+ +

algo1 = smesh.CreateHypothesis("Regular_1D", + "libStdMeshersEngine.so")

+ +

algo2 = smesh.CreateHypothesis("MEFISTO_2D", + "libStdMeshersEngine.so")

+ +

 

+ +

mesh = smesh.CreateMesh(box)

+ +

mesh.AddHypothesis(box,hyp1)

+ +

mesh.AddHypothesis(box,hyp2)

+ +

mesh.AddHypothesis(box,algo1)

+ +

mesh.AddHypothesis(box,algo2)

+ +

mesh.AddHypothesis(edge,hyp3)

+ +

mesh.AddHypothesis(edge,hyp4)

+ +

mesh.AddHypothesis(edge,algo1)

+ +

 

+ +

smesh.Compute(mesh,box)

+ +

salome.sg.updateObjBrowser(1)

+ +

 

+ +

# remove a hypothesis

+ +

mesh.RemoveHypothesis(edge,hyp4)

+ +

 

+ +

smesh.Compute(mesh,box)

+ +

salome.sg.updateObjBrowser(1)

+ +

 

+ +

# change the value + of the hypothesis

+ +

hyp2.SetMaxElementArea(2)

+ +

mesh.AddHypothesis(box,hyp2)

+ +

 

+ +

smesh.Compute(mesh,box)

+ +

salome.sg.updateObjBrowser(1)

+ +

 

+ +

Export of a Mesh

+ +

 

+ +

import + salome

+ +

import geompy

+ +

import StdMeshers

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smeshgui = salome.ImportComponentGUI("SMESH")

+ +

smeshgui.Init(salome.myStudyId);

+ +

 

+ +

# create a box

+ +

box = geompy.MakeBox(0., + 0., 0., 100., 200., 300.)

+ +

 

+ +

# add the box to the study

+ +

idbox = geompy.addToStudy(box, + "box")

+ +

 

+ +

# create a hypothesis

+ +

print "-------------------------- + create Hypothesis"

+ +

print "-------------------------- + NumberOfSegments"

+ +

numberOfSegments + = 7

+ +

hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", + "libStdMeshersEngine.so")

+ +

hypNbSeg.SetNumberOfSegments(numberOfSegments)

+ +

print hypNbSeg.GetName()

+ +

print hypNbSeg.GetId()

+ +

print hypNbSeg.GetNumberOfSegments()

+ +

smeshgui.SetName(salome.ObjectToID(hypNbSeg), + "NumberOfSegments_10")

+ +

print "-------------------------- + MaxElementArea"

+ +

maxElementArea = + 800

+ +

hypArea = smesh.CreateHypothesis("MaxElementArea", + "libStdMeshersEngine.so")

+ +

hypArea.SetMaxElementArea(maxElementArea)

+ +

print hypArea.GetName()

+ +

print hypArea.GetId()

+ +

print hypArea.GetMaxElementArea()

+ +

smeshgui.SetName(salome.ObjectToID(hypArea), + "MaxElementArea_500")

+ +

print "-------------------------- + MaxElementVolume"

+ +

maxElementVolume + = 900

+ +

hypVolume = smesh.CreateHypothesis("MaxElementVolume", + "libStdMeshersEngine.so")

+ +

hypVolume.SetMaxElementVolume(maxElementVolume)

+ +

print hypVolume.GetName()

+ +

print hypVolume.GetId()

+ +

print hypVolume.GetMaxElementVolume()

+ +

smeshgui.SetName(salome.ObjectToID(hypVolume), + "MaxElementVolume_500")

+ +

 

+ +

# create algorithms

+ +

print "-------------------------- + create Algorithms"

+ +

print "-------------------------- + Regular_1D"

+ +

regular1D = smesh.CreateHypothesis("Regular_1D", + "libStdMeshersEngine.so")

+ +

smeshgui.SetName(salome.ObjectToID(regular1D), + "Wire Discretisation")

+ +

print "-------------------------- + MEFISTO_2D"

+ +

mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", + "libStdMeshersEngine.so")

+ +

smeshgui.SetName(salome.ObjectToID(mefisto2D), + "MEFISTO_2D")

+ +

 

+ +

# initialize a mesh with + the box

+ +

mesh = smesh.CreateMesh(box)

+ +

smeshgui.SetName(salome.ObjectToID(mesh), + "MeshBox")

+ +

 

+ +

# add the hypothesis to + the box

+ +

print "-------------------------- + add hypothesis to the box"

+ +

mesh.AddHypothesis(box,hypNbSeg)

+ +

mesh.AddHypothesis(box,hypArea)

+ +

mesh.AddHypothesis(box,hypVolume)

+ +

mesh.AddHypothesis(box,regular1D)

+ +

mesh.AddHypothesis(box,mefisto2D)

+ +

 

+ +

# compute the mesh

+ +

print "-------------------------- + compute the mesh of the box"

+ +

ret = smesh.Compute(mesh,box)

+ +

print ret

+ +

if ret == 0:

+ +

    print + "probleme when computing the mesh"

+ +

salome.sg.updateObjBrowser(1)

+ +

mesh.ExportMED("/tmp/meshMED.med",0)

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/cshdat_robohelp.htm b/doc/salome/gui/SMESH/cshdat_robohelp.htm index 2e1891e53..4a4ee57e1 100755 --- a/doc/salome/gui/SMESH/cshdat_robohelp.htm +++ b/doc/salome/gui/SMESH/cshdat_robohelp.htm @@ -1,258 +1,258 @@ - - -SMESH reference manual - - - - - - - - - - - - - - - - - + + +Mesh Module Reference Manual + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/cshdat_webhelp.htm b/doc/salome/gui/SMESH/cshdat_webhelp.htm index 2fefa3ad4..db3b49a38 100755 --- a/doc/salome/gui/SMESH/cshdat_webhelp.htm +++ b/doc/salome/gui/SMESH/cshdat_webhelp.htm @@ -1,251 +1,251 @@ - - -SMESH reference manual - - - - - - - - - - - - - - - - - + + +Mesh Module Reference Manual + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/default.css b/doc/salome/gui/SMESH/default.css index de2e5d955..1f8d6d772 100755 --- a/doc/salome/gui/SMESH/default.css +++ b/doc/salome/gui/SMESH/default.css @@ -1,101 +1,101 @@ -BODY { - background-color:#ffffff; - font-family:"Times New Roman" , serif; } -H1 { - font-weight:bold; - font-size:24.0pt; } -LI.kadov-H1 { - font-weight:bold; - font-size:24.0pt; } -H2 { - font-weight:bold; - font-size:18.0pt; } -LI.kadov-H2 { - font-weight:bold; - font-size:18.0pt; } -H3 { - font-weight:bold; - font-size:14.0pt; } -LI.kadov-H3 { - font-weight:bold; - font-size:14.0pt; } -H4 { - font-weight:bold; - font-size:12.0pt; } -LI.kadov-H4 { - font-weight:bold; - font-size:12.0pt; } -H5 { - font-weight:bold; - font-size:10.0pt; } -LI.kadov-H5 { - font-weight:bold; - font-size:10.0pt; } -H6 { - font-weight:bold; - font-size:8.0pt; } -LI.kadov-H6 { - font-weight:bold; - font-size:8.0pt; } -P { - font-size:12.0pt; - margin-top:0pt; - margin-bottom:0pt; } -LI.kadov-P { - font-size:12.0pt; } -A.expandspot { - color:#008000; - cursor:hand; - font-style:italic; - x-text-underline:off; - x-text-overline:off; - x-text-line-through:off; - text-decoration:none none none; } -SPAN.expandtext { - font-style:italic; - font-weight:normal; - color:#ff0000; } -A.dropspot { - cursor:hand; - color:#008000; - font-style:italic; - x-text-underline:off; - x-text-overline:off; - x-text-line-through:off; - text-decoration:none none none; } -A.glossterm { - color:#800000; - cursor:hand; - font-style:italic; - x-text-underline:off; - x-text-overline:off; - x-text-line-through:off; - text-decoration:none none none; } -SPAN.glosstext { - font-style:italic; - font-weight:normal; - color:#0000ff; } -OL { - margin-top:0px; - margin-bottom:0px; } -UL { - margin-top:0px; - margin-bottom:0px; } -A:active { } -A:hover { - x-text-underline:Off; - text-decoration:none; } -A:link { - x-text-underline:Off; - text-decoration:none; } -A:visited { - x-text-underline:Off; - text-decoration:none; } -P.TODO { - font-weight:normal; - font-style:italic; - font-family:"Arial Black" , sans-serif; } -LI.kadov-P-CTODO { - font-weight:normal; - font-style:italic; - font-family:"Arial Black" , sans-serif; } +BODY { + background-color:#ffffff; + font-family:"Times New Roman" , serif; } +H1 { + font-weight:bold; + font-size:24.0pt; } +LI.kadov-H1 { + font-weight:bold; + font-size:24.0pt; } +H2 { + font-weight:bold; + font-size:18.0pt; } +LI.kadov-H2 { + font-weight:bold; + font-size:18.0pt; } +H3 { + font-weight:bold; + font-size:14.0pt; } +LI.kadov-H3 { + font-weight:bold; + font-size:14.0pt; } +H4 { + font-weight:bold; + font-size:12.0pt; } +LI.kadov-H4 { + font-weight:bold; + font-size:12.0pt; } +H5 { + font-weight:bold; + font-size:10.0pt; } +LI.kadov-H5 { + font-weight:bold; + font-size:10.0pt; } +H6 { + font-weight:bold; + font-size:8.0pt; } +LI.kadov-H6 { + font-weight:bold; + font-size:8.0pt; } +P { + font-size:12.0pt; + margin-top:0pt; + margin-bottom:0pt; } +LI.kadov-P { + font-size:12.0pt; } +A.expandspot { + color:#008000; + cursor:hand; + font-style:italic; + x-text-underline:off; + x-text-overline:off; + x-text-line-through:off; + text-decoration:none none none; } +SPAN.expandtext { + font-style:italic; + font-weight:normal; + color:#ff0000; } +A.dropspot { + cursor:hand; + color:#008000; + font-style:italic; + x-text-underline:off; + x-text-overline:off; + x-text-line-through:off; + text-decoration:none none none; } +A.glossterm { + color:#800000; + cursor:hand; + font-style:italic; + x-text-underline:off; + x-text-overline:off; + x-text-line-through:off; + text-decoration:none none none; } +SPAN.glosstext { + font-style:italic; + font-weight:normal; + color:#0000ff; } +OL { + margin-top:0px; + margin-bottom:0px; } +UL { + margin-top:0px; + margin-bottom:0px; } +A:active { } +A:hover { + x-text-underline:Off; + text-decoration:none; } +A:link { + x-text-underline:Off; + text-decoration:none; } +A:visited { + x-text-underline:Off; + text-decoration:none; } +P.TODO { + font-weight:normal; + font-style:italic; + font-family:"Arial Black" , sans-serif; } +LI.kadov-P-CTODO { + font-weight:normal; + font-style:italic; + font-family:"Arial Black" , sans-serif; } diff --git a/doc/salome/gui/SMESH/default_ns.css b/doc/salome/gui/SMESH/default_ns.css index 3eeb3c496..46e8b0018 100755 --- a/doc/salome/gui/SMESH/default_ns.css +++ b/doc/salome/gui/SMESH/default_ns.css @@ -1,118 +1,118 @@ -BODY { - background-color:#ffffff; - font-family:"Times New Roman" , serif; } -H1 { - font-weight:bold; - font-size:24.0pt; - font-family:"Times New Roman" , serif; } -LI.kadov-H1 { - font-weight:bold; - font-size:24.0pt; } -H2 { - font-weight:bold; - font-size:18.0pt; - font-family:"Times New Roman" , serif; } -LI.kadov-H2 { - font-weight:bold; - font-size:18.0pt; } -H3 { - font-weight:bold; - font-size:14.0pt; - font-family:"Times New Roman" , serif; } -LI.kadov-H3 { - font-weight:bold; - font-size:14.0pt; } -H4 { - font-weight:bold; - font-size:12.0pt; - font-family:"Times New Roman" , serif; } -LI.kadov-H4 { - font-weight:bold; - font-size:12.0pt; } -H5 { - font-weight:bold; - font-size:10.0pt; - font-family:"Times New Roman" , serif; } -LI.kadov-H5 { - font-weight:bold; - font-size:10.0pt; } -H6 { - font-weight:bold; - font-size:8.0pt; - font-family:"Times New Roman" , serif; } -LI.kadov-H6 { - font-weight:bold; - font-size:8.0pt; } -P { - font-size:12.0pt; - margin-top:1pt; - margin-bottom:1pt; - font-family:"Times New Roman" , serif; } -LI.kadov-P { - font-size:12.0pt; } -A.expandspot { - color:#008000; - cursor:hand; - font-style:italic; - x-text-underline:off; - x-text-overline:off; - x-text-line-through:off; - text-decoration:none none none; } -SPAN.expandtext { - font-style:italic; - font-weight:normal; - color:#ff0000; } -A.dropspot { - cursor:hand; - color:#008000; - font-style:italic; - x-text-underline:off; - x-text-overline:off; - x-text-line-through:off; - text-decoration:none none none; } -A.glossterm { - color:#800000; - cursor:hand; - font-style:italic; - x-text-underline:off; - x-text-overline:off; - x-text-line-through:off; - text-decoration:none none none; } -SPAN.glosstext { - font-style:italic; - font-weight:normal; - color:#0000ff; } -OL { - margin-top:0px; - margin-bottom:0px; - font-family:"Times New Roman" , serif; } -UL { - margin-top:0px; - margin-bottom:0px; - font-family:"Times New Roman" , serif; } -A:active { } -A:hover { - x-text-underline:Off; - text-decoration:none; } -A:link { - x-text-underline:Off; - text-decoration:none; } -A:visited { - x-text-underline:Off; - text-decoration:none; } -P.TODO { - font-weight:normal; - font-style:italic; - font-family:"Arial Black" , sans-serif; } -LI.kadov-P-CTODO { - font-weight:normal; - font-style:italic; - font-family:"Arial Black" , sans-serif; } -ol ol { - margin-top:1px; } -ol ul { - margin-top:1px; } -ul ul { - margin-top:1px; } -ul ol { - margin-top:1px; } +BODY { + background-color:#ffffff; + font-family:"Times New Roman" , serif; } +H1 { + font-weight:bold; + font-size:24.0pt; + font-family:"Times New Roman" , serif; } +LI.kadov-H1 { + font-weight:bold; + font-size:24.0pt; } +H2 { + font-weight:bold; + font-size:18.0pt; + font-family:"Times New Roman" , serif; } +LI.kadov-H2 { + font-weight:bold; + font-size:18.0pt; } +H3 { + font-weight:bold; + font-size:14.0pt; + font-family:"Times New Roman" , serif; } +LI.kadov-H3 { + font-weight:bold; + font-size:14.0pt; } +H4 { + font-weight:bold; + font-size:12.0pt; + font-family:"Times New Roman" , serif; } +LI.kadov-H4 { + font-weight:bold; + font-size:12.0pt; } +H5 { + font-weight:bold; + font-size:10.0pt; + font-family:"Times New Roman" , serif; } +LI.kadov-H5 { + font-weight:bold; + font-size:10.0pt; } +H6 { + font-weight:bold; + font-size:8.0pt; + font-family:"Times New Roman" , serif; } +LI.kadov-H6 { + font-weight:bold; + font-size:8.0pt; } +P { + font-size:12.0pt; + margin-top:1pt; + margin-bottom:1pt; + font-family:"Times New Roman" , serif; } +LI.kadov-P { + font-size:12.0pt; } +A.expandspot { + color:#008000; + cursor:hand; + font-style:italic; + x-text-underline:off; + x-text-overline:off; + x-text-line-through:off; + text-decoration:none none none; } +SPAN.expandtext { + font-style:italic; + font-weight:normal; + color:#ff0000; } +A.dropspot { + cursor:hand; + color:#008000; + font-style:italic; + x-text-underline:off; + x-text-overline:off; + x-text-line-through:off; + text-decoration:none none none; } +A.glossterm { + color:#800000; + cursor:hand; + font-style:italic; + x-text-underline:off; + x-text-overline:off; + x-text-line-through:off; + text-decoration:none none none; } +SPAN.glosstext { + font-style:italic; + font-weight:normal; + color:#0000ff; } +OL { + margin-top:0px; + margin-bottom:0px; + font-family:"Times New Roman" , serif; } +UL { + margin-top:0px; + margin-bottom:0px; + font-family:"Times New Roman" , serif; } +A:active { } +A:hover { + x-text-underline:Off; + text-decoration:none; } +A:link { + x-text-underline:Off; + text-decoration:none; } +A:visited { + x-text-underline:Off; + text-decoration:none; } +P.TODO { + font-weight:normal; + font-style:italic; + font-family:"Arial Black" , sans-serif; } +LI.kadov-P-CTODO { + font-weight:normal; + font-style:italic; + font-family:"Arial Black" , sans-serif; } +ol ol { + margin-top:1px; } +ol ul { + margin-top:1px; } +ul ul { + margin-top:1px; } +ul ol { + margin-top:1px; } diff --git a/doc/salome/gui/SMESH/defining_hypotheses_tui.htm b/doc/salome/gui/SMESH/defining_hypotheses_tui.htm index 581805053..7f8e0df5a 100755 --- a/doc/salome/gui/SMESH/defining_hypotheses_tui.htm +++ b/doc/salome/gui/SMESH/defining_hypotheses_tui.htm @@ -1,1488 +1,1384 @@ - - - - - -Defining hypotheses TUI - - - - - - - - - - -

Defining Hypotheses and Algorithms

- -

Defining 1D Hypotheses

- -

1D Arithmetic

- -

 

- -

from geompy import - *

- -

import smesh

- -

 

- -

# create vertices

- -

Point111 = MakeVertex( - 0,  0,  0)

- -

Point211 = MakeVertex(10, -  0,  0)

- -

Point121 = MakeVertex( - 0, 10,  0)

- -

Point221 = MakeVertex(10, - 10,  0)

- -

Point112 = MakeVertex( - 0,  0, 10)

- -

Point212 = MakeVertex(10, -  0, 10)

- -

Point122 = MakeVertex( - 0, 10, 10)

- -

Point222 = MakeVertex(10, - 10, 10)

- -

 

- -

# create edges

- -

EdgeX111 = MakeEdge(Point111, - Point211)

- -

EdgeX121 = MakeEdge(Point121, - Point221)

- -

EdgeX112 = MakeEdge(Point112, - Point212)

- -

EdgeX122 = MakeEdge(Point122, - Point222)

- -

EdgeY11 = MakeEdge(Point111, - Point121)

- -

EdgeY21 = MakeEdge(Point211, - Point221)

- -

EdgeY12 = MakeEdge(Point112, - Point122)

- -

EdgeY22 = MakeEdge(Point212, - Point222)

- -

EdgeZ111 = MakeEdge(Point111, - Point112)

- -

EdgeZ211 = MakeEdge(Point211, - Point212)

- -

EdgeZ121 = MakeEdge(Point121, - Point122)

- -

EdgeZ221 = MakeEdge(Point221, - Point222)

- -

 

- -

# create faces

- -

FaceX11 = MakeQuad(EdgeY11, - EdgeZ111, EdgeY12, EdgeZ121)

- -

FaceX21 = MakeQuad(EdgeY21, - EdgeZ211, EdgeY22, EdgeZ221)

- -

FaceY111 = MakeQuad(EdgeX111, - EdgeZ111, EdgeX112, EdgeZ211)

- -

FaceY121 = MakeQuad(EdgeX121, - EdgeZ121, EdgeX122, EdgeZ221)

- -

FaceZ11 = MakeQuad(EdgeX111, - EdgeY11, EdgeX121, EdgeY21)

- -

FaceZ12 = MakeQuad(EdgeX112, - EdgeY12, EdgeX122, EdgeY22)

- -

 

- -

# create a solid

- -

Block = MakeHexa(FaceX11, - FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)

- -

 

- -

# create a compound

- -

box = MakeCompound([Block])

- -

 

- -

# add in the study

- -

box_id = addToStudy(box, - "Box compound")

- -

 

- -

# create a hexahedral mesh on the box

- -

hexa = smesh.Mesh(box, - "Box compound : hexahedrical mesh")

- -

algo = hexa.Segment()

- -

 

- -

# define "NumberOfSegments" hypothesis to cut an edge in a - fixed number of segments

- -

algo.NumberOfSegments(4)

- -

 

- -

# create a quadrangle 2D algorithm for faces

- -

hexa.Quadrangle()

- -

 

- -

# create a hexahedron 3D algorithm for solids

- -

hexa.Hexahedron()

- -

 

- -

# create a local hypothesis

- -

algo = hexa.Segment(EdgeX111)

- -

 

- -

# define "Arithmetic1D" hypothesis to cut an edge in several - segments with arithmetic length increasing

- -

algo.Arithmetic1D(1, - 4)

- -

 

- -

# define "Propagation" hypothesis that propagates all other - hypothesis on all edges on the opposite side in case of quadrangular faces

- -

algo.Propagation()

- -

 

- -

# compute the mesh

- -

hexa.Compute()

- -

 

- -

Deflection 1D and Number of Segments

- -

 

- -

import smesh

- -

import geompy

- -

import salome

- -

gg = salome.ImportComponentGUI("GEOM")

- -

 

- -

# create vertices

- -

px   = - geompy.MakeVertex(100., 0.  , - 0.  )

- -

py   = - geompy.MakeVertex(0.  , - 100., 0.  )

- -

pz   = - geompy.MakeVertex(0.  , - 0.  , 100.)

- -

 

- -

# create a vector from - two points

- -

vxy = geompy.MakeVector(px, - py)

- -

 

- -

# create an arc from - three points

- -

arc = geompy.MakeArc(py, - pz, px)

- -

 

- -

# create a wire

- -

wire = geompy.MakeWire([vxy, - arc])

- -

isPlanarFace = 1

- -

 

- -

# create a face from - the wire

- -

face1 = geompy.MakeFace(wire, - isPlanarFace)

- -

 

- -

# add objects in the - study

- -

id_face1 = geompy.addToStudy(face1,"Face1")

- -

 

- -

# display faces

- -

gg.createAndDisplayGO(id_face1)

- -

gg.setDisplayMode(id_face1,1)

- -

gg.setTransparency(id_face1,0.2)

- -

 

- -

# create hexahedral mesh

- -

hexa = smesh.Mesh(face1, - "Face compound : hexahedrical mesh")

- -

algo = hexa.Triangle()

- -

 

- -

# define "MaxElementArea" - hypothesis to be applied  to - each triangle

- -

algo.MaxElementArea(30)

- -

 

- -

# create a quadrangle - 2D algorithm for faces

- -

hexa.Quadrangle()

- -

 

- -

# create a local hypothesis

- -

algo = hexa.Segment(wire)

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut an edge in a fixed number of segments

- -

algo.NumberOfSegments(6)

- -

 

- -

# define "Deflection1D" - hypothesis

- -

algo.Deflection1D(1)

- -

 

- -

# compute the mesh

- -

hexa.Compute()

- -

 

- -

Start and End Length

- -

from geompy import - *

- -

import smesh

- -

 

- -

# create vertices

- -

Point111 = MakeVertex( - 0,  0,  0)

- -

Point211 = MakeVertex(10, -  0,  0)

- -

Point121 = MakeVertex( - 0, 10,  0)

- -

Point221 = MakeVertex(10, - 10,  0)

- -

Point112 = MakeVertex( - 0,  0, 10)

- -

Point212 = MakeVertex(10, -  0, 10)

- -

Point122 = MakeVertex( - 0, 10, 10)

- -

Point222 = MakeVertex(10, - 10, 10)

- -

 

- -

# create edges

- -

EdgeX111 = MakeEdge(Point111, - Point211)

- -

EdgeX121 = MakeEdge(Point121, - Point221)

- -

EdgeX112 = MakeEdge(Point112, - Point212)

- -

EdgeX122 = MakeEdge(Point122, - Point222)

- -

EdgeY11 = MakeEdge(Point111, - Point121)

- -

EdgeY21 = MakeEdge(Point211, - Point221)

- -

EdgeY12 = MakeEdge(Point112, - Point122)

- -

EdgeY22 = MakeEdge(Point212, - Point222)

- -

EdgeZ111 = MakeEdge(Point111, - Point112)

- -

EdgeZ211 = MakeEdge(Point211, - Point212)

- -

EdgeZ121 = MakeEdge(Point121, - Point122)

- -

EdgeZ221 = MakeEdge(Point221, - Point222)

- -

 

- -

# create faces

- -

FaceX11 = MakeQuad(EdgeY11, - EdgeZ111, EdgeY12, EdgeZ121)

- -

FaceX21 = MakeQuad(EdgeY21, - EdgeZ211, EdgeY22, EdgeZ221)

- -

FaceY111 = MakeQuad(EdgeX111, - EdgeZ111, EdgeX112, EdgeZ211)

- -

FaceY121 = MakeQuad(EdgeX121, - EdgeZ121, EdgeX122, EdgeZ221)

- -

FaceZ11 = MakeQuad(EdgeX111, - EdgeY11, EdgeX121, EdgeY21)

- -

FaceZ12 = MakeQuad(EdgeX112, - EdgeY12, EdgeX122, EdgeY22)

- -

 

- -

# create a solid

- -

Block = MakeHexa(FaceX11, - FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)

- -

 

- -

# create a compound

- -

box = MakeCompound([Block])

- -

 

- -

# add in the study

- -

box_id = addToStudy(box, - "Box compound")

- -

 

- -

# create a hexahedral mesh on the box

- -

hexa = smesh.Mesh(box, - "Box compound : hexahedrical mesh")

- -

algo = hexa.Segment()

- -

 

- -

# define "NumberOfSegments" hypothesis to cut an edge in a - fixed number of segments

- -

algo.NumberOfSegments(4)

- -

 

- -

# create a quadrangle 2D algorithm for faces

- -

hexa.Quadrangle()

- -

 

- -

# create a hexahedron 3D algorithm for solids

- -

hexa.Hexahedron()

- -

 

- -

# create a local hypothesis

- -

algo = hexa.Segment(EdgeX111)

- -

 

- -

# define "StartEndLength" hypothesis to cut an edge in several - segments with increasing geometric length

- -

algo.StartEndLength(1, - 6)

- -

 

- -

# define "Propagation" hypothesis that propagates all other - hypothesis on all edges on the opposite side in case of quadrangular faces

- -

algo.Propagation()

- -

 

- -

# compute the mesh

- -

hexa.Compute()

- -

 

- -

Average Length

- -

from geompy import - *

- -

import smesh

- -

 

- -

# create vertices

- -

Point111 = MakeVertex( - 0,  0,  0)

- -

Point211 = MakeVertex(10, -  0,  0)

- -

Point121 = MakeVertex( - 0, 10,  0)

- -

Point221 = MakeVertex(10, - 10,  0)

- -

Point112 = MakeVertex( - 0,  0, 10)

- -

Point212 = MakeVertex(10, -  0, 10)

- -

Point122 = MakeVertex( - 0, 10, 10)

- -

Point222 = MakeVertex(10, - 10, 10)

- -

 

- -

# create edges

- -

EdgeX111 = MakeEdge(Point111, - Point211)

- -

EdgeX121 = MakeEdge(Point121, - Point221)

- -

EdgeX112 = MakeEdge(Point112, - Point212)

- -

EdgeX122 = MakeEdge(Point122, - Point222)

- -

EdgeY11 = MakeEdge(Point111, - Point121)

- -

EdgeY21 = MakeEdge(Point211, - Point221)

- -

EdgeY12 = MakeEdge(Point112, - Point122)

- -

EdgeY22 = MakeEdge(Point212, - Point222)

- -

EdgeZ111 = MakeEdge(Point111, - Point112)

- -

EdgeZ211 = MakeEdge(Point211, - Point212)

- -

EdgeZ121 = MakeEdge(Point121, - Point122)

- -

EdgeZ221 = MakeEdge(Point221, - Point222)

- -

 

- -

# create faces

- -

FaceX11 = MakeQuad(EdgeY11, - EdgeZ111, EdgeY12, EdgeZ121)

- -

FaceX21 = MakeQuad(EdgeY21, - EdgeZ211, EdgeY22, EdgeZ221)

- -

FaceY111 = MakeQuad(EdgeX111, - EdgeZ111, EdgeX112, EdgeZ211)

- -

FaceY121 = MakeQuad(EdgeX121, - EdgeZ121, EdgeX122, EdgeZ221)

- -

FaceZ11 = MakeQuad(EdgeX111, - EdgeY11, EdgeX121, EdgeY21)

- -

FaceZ12 = MakeQuad(EdgeX112, - EdgeY12, EdgeX122, EdgeY22)

- -

 

- -

# create a solid

- -

Block = MakeHexa(FaceX11, - FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)

- -

 

- -

# create a compound

- -

box = MakeCompound([Block])

- -

 

- -

# add in the study

- -

box_id = addToStudy(box, - "Box compound")

- -

 

- -

# create a hexahedral - mesh on the box

- -

hexa = smesh.Mesh(box, - "Box compound : hexahedrical mesh")

- -

algo = hexa.Segment()

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut an edge in a fixed number of segments

- -

algo.NumberOfSegments(4)

- -

 

- -

# create a quadrangle - 2D algorithm for faces

- -

hexa.Quadrangle()

- -

 

- -

# create a hexahedron - 3D algorithm for solids

- -

hexa.Hexahedron()

- -

 

- -

# create a local hypothesis

- -

algo = hexa.Segment(EdgeX111)

- -

 

- -

# define "LocalLength" - hypothesis to cut an edge in several segments with the same length

- -

algo.LocalLength(2)

- -

 

- -

# define "Propagation" - hypothesis that propagates all other hypothesis on all edges on - the opposite side in case of quadrangular faces

- -

algo.Propagation()

- -

 

- -

# compute the mesh

- -

hexa.Compute()

- -

 

- -

 

- -

Defining 2D and 3D hypotheses

- -

Maximum Element Area

- -

import smesh

- -

import geompy

- -

import salome

- -

gg = salome.ImportComponentGUI("GEOM")

- -

 

- -

# create vertices

- -

px   = - geompy.MakeVertex(100., 0.  , - 0.  )

- -

py   = - geompy.MakeVertex(0.  , - 100., 0.  )

- -

pz   = - geompy.MakeVertex(0.  , - 0.  , 100.)

- -

 

- -

# create a vector from - two points

- -

vxy = geompy.MakeVector(px, - py)

- -

 

- -

# create an arc from three - points

- -

arc = geompy.MakeArc(py, - pz, px)

- -

 

- -

# create a wire

- -

wire = geompy.MakeWire([vxy, - arc])

- -

isPlanarFace = 1

- -

 

- -

# create a face from the - wire

- -

face1 = geompy.MakeFace(wire, - isPlanarFace)

- -

 

- -

# add objects in the study

- -

id_face1 = geompy.addToStudy(face1,"Face1")

- -

 

- -

# display faces

- -

gg.createAndDisplayGO(id_face1)

- -

gg.setDisplayMode(id_face1,1)

- -

gg.setTransparency(id_face1,0.2)

- -

 

- -

# create a hexahedral mesh

- -

hexa = smesh.Mesh(face1, - "Face compound : hexahedrical mesh")

- -

algo = hexa.Triangle()

- -

 

- -

# define "MaxElementArea" - hypothesis to be applied to each triangle

- -

algo.MaxElementArea(7)

- -

 

- -

# create a quadrangle 2D - algorithm for faces

- -

hexa.Quadrangle()

- -

 

- -

# create a local hypothesis

- -

algo = hexa.Segment(wire)

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut an edge in a fixed number of segments

- -

algo.NumberOfSegments(10)

- -

 

- -

# compute the mesh

- -

hexa.Compute()

- -

 

- -

Maximum Element Volume

- -

import - salome

- -

import geompy

- -

import StdMeshers

- -

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

- -

smeshgui = salome.ImportComponentGUI("SMESH")

- -

smeshgui.Init(salome.myStudyId);

- -

 

- -

# create a box

- -

box = geompy.MakeCylinderRH(30, - 50) #MakeBox(0., 0., 0., 100., 200., 300.)

- -

 

- -

# add the box to the - study

- -

idbox = geompy.addToStudy(box, - "box")

- -

 

- -

# create vertices

- -

px   = - geompy.MakeVertex(100., 0.  , - 0.  )

- -

py   = - geompy.MakeVertex(0.  , - 100., 0.  )

- -

pz   = - geompy.MakeVertex(0.  , - 0.  , 100.)

- -

 

- -

# create a vector from - two points

- -

vxy = geompy.MakeVector(px, - py)

- -

 

- -

# create an arc from - three points

- -

arc = geompy.MakeArc(py, - pz, px)

- -

 

- -

# create a wire

- -

wire = geompy.MakeWire([vxy, - arc])

- -

isPlanarFace = 1

- -

 

- -

# create a face from - the wire

- -

#face1

- -

box = geompy.MakeFace(wire, - isPlanarFace)

- -

 

- -

# add objects in the - study

- -

id_face1 = geompy.addToStudy(box,"Face1")

- -

#geompy.addToStudy(face1,"Face1")

- -

 

- -

# display faces

- -

gg.createAndDisplayGO(id_face1)

- -

gg.setDisplayMode(id_face1,1)

- -

gg.setTransparency(id_face1,0.2)

- -

 

- -

# create a hypothesis

- -

print "-------------------------- - create Hypothesis"

- -

print "-------------------------- - NumberOfSegments"

- -

numberOfSegments - = 7

- -

hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

- -

hypNbSeg.SetNumberOfSegments(numberOfSegments)

- -

print hypNbSeg.GetName()

- -

print hypNbSeg.GetId()

- -

print hypNbSeg.GetNumberOfSegments()

- -

smeshgui.SetName(salome.ObjectToID(hypNbSeg), - "NumberOfSegments_10")

- -

print "-------------------------- - MaxElementArea"

- -

maxElementArea = - 800

- -

hypArea = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

- -

hypArea.SetMaxElementArea(maxElementArea)

- -

print hypArea.GetName()

- -

print hypArea.GetId()

- -

print hypArea.GetMaxElementArea()

- -

smeshgui.SetName(salome.ObjectToID(hypArea), - "MaxElementArea_800")

- -

print "-------------------------- - MaxElementVolume"

- -

maxElementVolume - = 900

- -

hypVolume = smesh.CreateHypothesis("MaxElementVolume", - "libStdMeshersEngine.so")

- -

hypVolume.SetMaxElementVolume(maxElementVolume)

- -

print hypVolume.GetName()

- -

print hypVolume.GetId()

- -

print hypVolume.GetMaxElementVolume()

- -

smeshgui.SetName(salome.ObjectToID(hypVolume), - "MaxElementVolume_900")

- -

 

- -

# create algorithms

- -

print "-------------------------- - create Algorithms"

- -

print "-------------------------- - Regular_1D"

- -

regular1D = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(regular1D), - "Wire Discretisation")

- -

print "-------------------------- - MEFISTO_2D"

- -

mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(mefisto2D), - "MEFISTO_2D")

- -

#print "-------------------------- - Hexa_3D (Hexahedron meshing algorithm)"

- -

hexa3D = smesh.CreateHypothesis("Hexa_3D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(hexa3D), - "HEXA_3D")

- -

 

- -

# initialize a mesh - with the box

- -

mesh = smesh.CreateMesh(box)

- -

smeshgui.SetName(salome.ObjectToID(mesh), - "MeshBox")

- -

 

- -

# add a hypothesis - to the box

- -

print "-------------------------- - add hypothesis to the box"

- -

mesh.AddHypothesis(box,hypNbSeg)

- -

mesh.AddHypothesis(box,hypArea)

- -

mesh.AddHypothesis(box,hypVolume)

- -

mesh.AddHypothesis(box,regular1D)

- -

mesh.AddHypothesis(box,mefisto2D)

- -

mesh.AddHypothesis(box,hexa3D)

- -

 

- -

# compute the mesh

- -

print "-------------------------- - compute the mesh of the box"

- -

ret = smesh.Compute(mesh,box)

- -

print ret

- -

if ret == 0:

- -

    print - "probleme when computing the mesh"

- -

salome.sg.updateObjBrowser(1)

- -

 

- -

Defining Additional Hypotheses

- -

Length from Edges

- -

import smesh

- -

import geompy

- -

import salome

- -

gg = salome.ImportComponentGUI("GEOM")

- -

 

- -

# create sketchers

- -

sketcher1 = geompy.MakeSketcher("Sketcher:F - 0 0:TT 70 0:TT 70 70:TT 0 70:WW")

- -

sketcher2 = geompy.MakeSketcher("Sketcher:F - 20 20:TT 50 20:TT 50 50:TT 20 50:WW")

- -

isPlanarFace = 1

- -

 

- -

# create faces from two wires

- -

face1 = geompy.MakeFaces([sketcher1, - sketcher2],isPlanarFace)

- -

 

- -

# add objects in the study

- -

id_face1 = geompy.addToStudy(face1,"Face1")

- -

 

- -

# display faces

- -

gg.createAndDisplayGO(id_face1)

- -

gg.setDisplayMode(id_face1,1)

- -

gg.setTransparency(id_face1,0.2)

- -

 

- -

# create a mesh

- -

hexa = smesh.Mesh(face1, - "Face : triangle 2D mesh")

- -

algo = hexa.Triangle()

- -

 

- -

# define "MaxElementArea" hypothesis to be applied to each - triangle

- -

algo.MaxElementArea(30)

- -

 

- -

# define "LengthFromEdges" hypothesis to build triangles based - on the length of the edges taken from the wire

- -

algo.LengthFromEdges()

- -

 

- -

# create local hypothesis

- -

algo = hexa.Segment()

- -

 

- -

# define "NumberOfSegments" hypothesis to cut an edge in a - fixed number of segments

- -

algo.NumberOfSegments(2)

- -

 

- -

# compute the mesh

- -

hexa.Compute()

- -

 

- -

Propagation

- -

from geompy import - *

- -

import smesh

- -

 

- -

# create vertices

- -

Point111 = MakeVertex( - 0,  0,  0)

- -

Point211 = MakeVertex(10, -  0,  0)

- -

Point121 = MakeVertex( - 0, 10,  0)

- -

Point221 = MakeVertex(10, - 10,  0)

- -

Point112 = MakeVertex( - 0,  0, 10)

- -

Point212 = MakeVertex(10, -  0, 10)

- -

Point122 = MakeVertex( - 0, 10, 10)

- -

Point222 = MakeVertex(10, - 10, 10)

- -

 

- -

# create edges

- -

EdgeX111 = MakeEdge(Point111, - Point211)

- -

EdgeX121 = MakeEdge(Point121, - Point221)

- -

EdgeX112 = MakeEdge(Point112, - Point212)

- -

EdgeX122 = MakeEdge(Point122, - Point222)

- -

EdgeY11 = MakeEdge(Point111, - Point121)

- -

EdgeY21 = MakeEdge(Point211, - Point221)

- -

EdgeY12 = MakeEdge(Point112, - Point122)

- -

EdgeY22 = MakeEdge(Point212, - Point222)

- -

EdgeZ111 = MakeEdge(Point111, - Point112)

- -

EdgeZ211 = MakeEdge(Point211, - Point212)

- -

EdgeZ121 = MakeEdge(Point121, - Point122)

- -

EdgeZ221 = MakeEdge(Point221, - Point222)

- -

 

- -

# create faces

- -

FaceX11 = MakeQuad(EdgeY11, - EdgeZ111, EdgeY12, EdgeZ121)

- -

FaceX21 = MakeQuad(EdgeY21, - EdgeZ211, EdgeY22, EdgeZ221)

- -

FaceY111 = MakeQuad(EdgeX111, - EdgeZ111, EdgeX112, EdgeZ211)

- -

FaceY121 = MakeQuad(EdgeX121, - EdgeZ121, EdgeX122, EdgeZ221)

- -

FaceZ11 = MakeQuad(EdgeX111, - EdgeY11, EdgeX121, EdgeY21)

- -

FaceZ12 = MakeQuad(EdgeX112, - EdgeY12, EdgeX122, EdgeY22)

- -

 

- -

# create a solid

- -

Block = MakeHexa(FaceX11, - FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)

- -

 

- -

# create a compound

- -

box = MakeCompound([Block])

- -

 

- -

# add in the study

- -

box_id = addToStudy(box, - "Box compound")

- -

 

- -

# create a hexahedral - mesh on the box

- -

hexa = smesh.Mesh(box, - "Box compound : hexahedrical mesh")

- -

algo = hexa.Segment()

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut an edge in a fixed number of segments

- -

algo.NumberOfSegments(4)

- -

 

- -

# create a quadrangle - 2D algorithm for faces

- -

hexa.Quadrangle()

- -

 

- -

# create a hexahedron - 3D algorithm for solids

- -

hexa.Hexahedron()

- -

 

- -

# create a local hypothesis

- -

algo = hexa.Segment(EdgeX111)

- -

 

- -

# - define "Arithmetic1D" hypothesis to cut an edge in several segments - with arithmetic length

- -

increasing

- -

algo.Arithmetic1D(1, - 4)

- -

 

- -

# define "Propagation" - hypothesis that propagatea all other hypothesis on all edges on the opposite - side in case of quadrangular faces

- -

algo.Propagation()

- -

 

- -

# compute the mesh

- -

hexa.Compute()

- -

 

- -

Defining Meshing Algorithms

- -

import - salome

- -

import StdMeshers

- -

import NETGENPlugin

- -

 

- -

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

- -

smeshgui = salome.ImportComponentGUI("SMESH")

- -

smeshgui.Init(salome.myStudyId);

- -

 

- -

# create algorithms

- -

print "-------------------------- - create Algorithms"

- -

print "-------------------------- - Regular_1D (Wire discretisation)"

- -

regular1D = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(regular1D), - "Wire Discretisation")

- -

 

- -

print "-------------------------- - MEFISTO_2D (Triangle meshing algorithm)"

- -

mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(mefisto2D), - "MEFISTO_2D")

- -

 

- -

print "-------------------------- - Quadrangle_2D (Quadrangle meshing algorithm)"

- -

quad2D = smesh.CreateHypothesis( - "Quadrangle_2D", "libStdMeshersEngine.so" )

- -

smeshgui.SetName(salome.ObjectToID(quad2D), - "Quadrangle_2D")

- -

 

- -

print "-------------------------- - Hexa_3D (Hexahedron meshing algorithm)"

- -

hexa3D = smesh.CreateHypothesis("Hexa_3D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(hexa3D), - "HEXA_3D")

- -

 

- -

print "-------------------------- - NETGEN_3D (Tetrahedron meshing algorithm)"

- -

netgen3D = smesh.CreateHypothesis("NETGEN_3D", - "libNETGENEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(netgen3D), - "NETGEN_3D")

- -

salome.sg.updateObjBrowser(1)

- -

 

- - - - + + + + + +Defining hypotheses TUI + + + + + + + + + + + +

Defining Hypotheses and Algorithms

+ +

Defining 1D Hypotheses

+ +

1D Arithmetic

+ +

 

+ +

from geompy import + *

+ +

import smesh

+ +

 

+ +

# create vertices

+ +

Point111 = MakeVertex( + 0,  0,  0)

+ +

Point211 = MakeVertex(10, +  0,  0)

+ +

Point121 = MakeVertex( + 0, 10,  0)

+ +

Point221 = MakeVertex(10, + 10,  0)

+ +

Point112 = MakeVertex( + 0,  0, 10)

+ +

Point212 = MakeVertex(10, +  0, 10)

+ +

Point122 = MakeVertex( + 0, 10, 10)

+ +

Point222 = MakeVertex(10, + 10, 10)

+ +

 

+ +

# create edges

+ +

EdgeX111 = MakeEdge(Point111, + Point211)

+ +

EdgeX121 = MakeEdge(Point121, + Point221)

+ +

EdgeX112 = MakeEdge(Point112, + Point212)

+ +

EdgeX122 = MakeEdge(Point122, + Point222)

+ +

EdgeY11 = MakeEdge(Point111, + Point121)

+ +

EdgeY21 = MakeEdge(Point211, + Point221)

+ +

EdgeY12 = MakeEdge(Point112, + Point122)

+ +

EdgeY22 = MakeEdge(Point212, + Point222)

+ +

EdgeZ111 = MakeEdge(Point111, + Point112)

+ +

EdgeZ211 = MakeEdge(Point211, + Point212)

+ +

EdgeZ121 = MakeEdge(Point121, + Point122)

+ +

EdgeZ221 = MakeEdge(Point221, + Point222)

+ +

 

+ +

# create faces

+ +

FaceX11 = MakeQuad(EdgeY11, + EdgeZ111, EdgeY12, EdgeZ121)

+ +

FaceX21 = MakeQuad(EdgeY21, + EdgeZ211, EdgeY22, EdgeZ221)

+ +

FaceY111 = MakeQuad(EdgeX111, + EdgeZ111, EdgeX112, EdgeZ211)

+ +

FaceY121 = MakeQuad(EdgeX121, + EdgeZ121, EdgeX122, EdgeZ221)

+ +

FaceZ11 = MakeQuad(EdgeX111, + EdgeY11, EdgeX121, EdgeY21)

+ +

FaceZ12 = MakeQuad(EdgeX112, + EdgeY12, EdgeX122, EdgeY22)

+ +

 

+ +

# create a solid

+ +

Block = MakeHexa(FaceX11, + FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)

+ +

 

+ +

# create a compound

+ +

box = MakeCompound([Block])

+ +

 

+ +

# add in the study

+ +

box_id = addToStudy(box, + "Box compound")

+ +

 

+ +

# create a hexahedral mesh on the box

+ +

hexa = smesh.Mesh(box, + "Box compound : hexahedrical mesh")

+ +

algo = hexa.Segment()

+ +

 

+ +

# define "NumberOfSegments" hypothesis to cut an edge in a + fixed number of segments

+ +

algo.NumberOfSegments(4)

+ +

 

+ +

# create a quadrangle 2D algorithm for faces

+ +

hexa.Quadrangle()

+ +

 

+ +

# create a hexahedron 3D algorithm for solids

+ +

hexa.Hexahedron()

+ +

 

+ +

# create a local hypothesis

+ +

algo = hexa.Segment(EdgeX111)

+ +

 

+ +

# define "Arithmetic1D" hypothesis to cut an edge in several + segments with arithmetic length increasing

+ +

algo.Arithmetic1D(1, + 4)

+ +

 

+ +

# define "Propagation" hypothesis that propagates all other + hypothesis on all edges on the opposite side in case of quadrangular faces

+ +

algo.Propagation()

+ +

 

+ +

# compute the mesh

+ +

hexa.Compute()

+ +

 

+ +

Deflection 1D and Number of Segments

+ +

 

+ +

import smesh

+ +

import geompy

+ +

import salome

+ +

gg = salome.ImportComponentGUI("GEOM")

+ +

 

+ +

# create vertices

+ +

px   = + geompy.MakeVertex(100., 0.  , + 0.  )

+ +

py   = + geompy.MakeVertex(0.  , + 100., 0.  )

+ +

pz   = + geompy.MakeVertex(0.  , + 0.  , 100.)

+ +

 

+ +

# create a vector from + two points

+ +

vxy = geompy.MakeVector(px, + py)

+ +

 

+ +

# create an arc from + three points

+ +

arc = geompy.MakeArc(py, + pz, px)

+ +

 

+ +

# create a wire

+ +

wire = geompy.MakeWire([vxy, + arc])

+ +

isPlanarFace = 1

+ +

 

+ +

# create a face from + the wire

+ +

face1 = geompy.MakeFace(wire, + isPlanarFace)

+ +

 

+ +

# + get edges from the face

+ +

vxy,arc = geompy.SubShapeAll(face1,geompy.ShapeType["EDGE"])

+ +

 

+ +

# add objects in the + study

+ +

id_face1 = geompy.addToStudy(face1,"Face1")

+ +

id_arc = geompy.addToStudyInFather(face1,arc,"Arc + Edge")

+ +

 

+ +

# display faces

+ +

gg.createAndDisplayGO(id_face1)

+ +

gg.setDisplayMode(id_face1,1)

+ +

gg.setTransparency(id_face1,0.2)

+ +

 

+ +

# create hexahedral mesh

+ +

hexa = smesh.Mesh(face1, + "Face compound : hexahedrical mesh")

+ +

algo = hexa.Triangle()

+ +

 

+ +

# define "MaxElementArea" + hypothesis

+ +

algo.MaxElementArea(30)

+ +

 

+ +

# create a local hypothesis + on the wire

+ +

algo = hexa.Segment(wire)

+ +

 

+ +

# define "NumberOfSegments" + hypothesis to cut a straight edge in a fixed number of segments

+ +

algo.NumberOfSegments(6)

+ +

 

+ +

# define a local "Deflection1D" + hypothesis on the arc

+ +

algo = hexa.Segment(arc)

+ +

algo.Deflection1D(1)

+ +

 

+ +

 

+ +

# compute the mesh

+ +

hexa.Compute()

+ +

 

+ +

Start and End Length

+ +

from geompy import + *

+ +

import smesh

+ +

 

+ +

# create vertices

+ +

Point111 = MakeVertex( + 0,  0,  0)

+ +

Point211 = MakeVertex(10, +  0,  0)

+ +

Point121 = MakeVertex( + 0, 10,  0)

+ +

Point221 = MakeVertex(10, + 10,  0)

+ +

Point112 = MakeVertex( + 0,  0, 10)

+ +

Point212 = MakeVertex(10, +  0, 10)

+ +

Point122 = MakeVertex( + 0, 10, 10)

+ +

Point222 = MakeVertex(10, + 10, 10)

+ +

 

+ +

# create edges

+ +

EdgeX111 = MakeEdge(Point111, + Point211)

+ +

EdgeX121 = MakeEdge(Point121, + Point221)

+ +

EdgeX112 = MakeEdge(Point112, + Point212)

+ +

EdgeX122 = MakeEdge(Point122, + Point222)

+ +

EdgeY11 = MakeEdge(Point111, + Point121)

+ +

EdgeY21 = MakeEdge(Point211, + Point221)

+ +

EdgeY12 = MakeEdge(Point112, + Point122)

+ +

EdgeY22 = MakeEdge(Point212, + Point222)

+ +

EdgeZ111 = MakeEdge(Point111, + Point112)

+ +

EdgeZ211 = MakeEdge(Point211, + Point212)

+ +

EdgeZ121 = MakeEdge(Point121, + Point122)

+ +

EdgeZ221 = MakeEdge(Point221, + Point222)

+ +

 

+ +

# create faces

+ +

FaceX11 = MakeQuad(EdgeY11, + EdgeZ111, EdgeY12, EdgeZ121)

+ +

FaceX21 = MakeQuad(EdgeY21, + EdgeZ211, EdgeY22, EdgeZ221)

+ +

FaceY111 = MakeQuad(EdgeX111, + EdgeZ111, EdgeX112, EdgeZ211)

+ +

FaceY121 = MakeQuad(EdgeX121, + EdgeZ121, EdgeX122, EdgeZ221)

+ +

FaceZ11 = MakeQuad(EdgeX111, + EdgeY11, EdgeX121, EdgeY21)

+ +

FaceZ12 = MakeQuad(EdgeX112, + EdgeY12, EdgeX122, EdgeY22)

+ +

 

+ +

# create a solid

+ +

Block = MakeHexa(FaceX11, + FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)

+ +

 

+ +

# create a compound

+ +

box = MakeCompound([Block])

+ +

 

+ +

# add in the study

+ +

box_id = addToStudy(box, + "Box compound")

+ +

 

+ +

# create a hexahedral mesh on the box

+ +

hexa = smesh.Mesh(box, + "Box compound : hexahedrical mesh")

+ +

algo = hexa.Segment()

+ +

 

+ +

# define "NumberOfSegments" hypothesis to cut an edge in a + fixed number of segments

+ +

algo.NumberOfSegments(4)

+ +

 

+ +

# create a quadrangle 2D algorithm for faces

+ +

hexa.Quadrangle()

+ +

 

+ +

# create a hexahedron 3D algorithm for solids

+ +

hexa.Hexahedron()

+ +

 

+ +

# create a local hypothesis

+ +

algo = hexa.Segment(EdgeX111)

+ +

 

+ +

# define "StartEndLength" hypothesis to cut an edge in several + segments with increasing geometric length

+ +

algo.StartEndLength(1, + 6)

+ +

 

+ +

# define "Propagation" hypothesis that propagates all other + hypothesis on all edges on the opposite side in case of quadrangular faces

+ +

algo.Propagation()

+ +

 

+ +

# compute the mesh

+ +

hexa.Compute()

+ +

 

+ +

Average Length

+ +

from geompy import + *

+ +

import smesh

+ +

 

+ +

# create vertices

+ +

Point111 = MakeVertex( + 0,  0,  0)

+ +

Point211 = MakeVertex(10, +  0,  0)

+ +

Point121 = MakeVertex( + 0, 10,  0)

+ +

Point221 = MakeVertex(10, + 10,  0)

+ +

Point112 = MakeVertex( + 0,  0, 10)

+ +

Point212 = MakeVertex(10, +  0, 10)

+ +

Point122 = MakeVertex( + 0, 10, 10)

+ +

Point222 = MakeVertex(10, + 10, 10)

+ +

 

+ +

# create edges

+ +

EdgeX111 = MakeEdge(Point111, + Point211)

+ +

EdgeX121 = MakeEdge(Point121, + Point221)

+ +

EdgeX112 = MakeEdge(Point112, + Point212)

+ +

EdgeX122 = MakeEdge(Point122, + Point222)

+ +

EdgeY11 = MakeEdge(Point111, + Point121)

+ +

EdgeY21 = MakeEdge(Point211, + Point221)

+ +

EdgeY12 = MakeEdge(Point112, + Point122)

+ +

EdgeY22 = MakeEdge(Point212, + Point222)

+ +

EdgeZ111 = MakeEdge(Point111, + Point112)

+ +

EdgeZ211 = MakeEdge(Point211, + Point212)

+ +

EdgeZ121 = MakeEdge(Point121, + Point122)

+ +

EdgeZ221 = MakeEdge(Point221, + Point222)

+ +

 

+ +

# create faces

+ +

FaceX11 = MakeQuad(EdgeY11, + EdgeZ111, EdgeY12, EdgeZ121)

+ +

FaceX21 = MakeQuad(EdgeY21, + EdgeZ211, EdgeY22, EdgeZ221)

+ +

FaceY111 = MakeQuad(EdgeX111, + EdgeZ111, EdgeX112, EdgeZ211)

+ +

FaceY121 = MakeQuad(EdgeX121, + EdgeZ121, EdgeX122, EdgeZ221)

+ +

FaceZ11 = MakeQuad(EdgeX111, + EdgeY11, EdgeX121, EdgeY21)

+ +

FaceZ12 = MakeQuad(EdgeX112, + EdgeY12, EdgeX122, EdgeY22)

+ +

 

+ +

# create a solid

+ +

Block = MakeHexa(FaceX11, + FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)

+ +

 

+ +

# create a compound

+ +

box = MakeCompound([Block])

+ +

 

+ +

# add in the study

+ +

box_id = addToStudy(box, + "Box compound")

+ +

 

+ +

# create a hexahedral + mesh on the box

+ +

hexa = smesh.Mesh(box, + "Box compound : hexahedrical mesh")

+ +

algo = hexa.Segment()

+ +

 

+ +

# define "NumberOfSegments" + hypothesis to cut an edge in a fixed number of segments

+ +

algo.NumberOfSegments(4)

+ +

 

+ +

# create a quadrangle + 2D algorithm for faces

+ +

hexa.Quadrangle()

+ +

 

+ +

# create a hexahedron + 3D algorithm for solids

+ +

hexa.Hexahedron()

+ +

 

+ +

# create a local hypothesis

+ +

algo = hexa.Segment(EdgeX111)

+ +

 

+ +

# define "LocalLength" + hypothesis to cut an edge in several segments with the same length

+ +

algo.LocalLength(2)

+ +

 

+ +

# define "Propagation" + hypothesis that propagates all other hypothesis on all edges on + the opposite side in case of quadrangular faces

+ +

algo.Propagation()

+ +

 

+ +

# compute the mesh

+ +

hexa.Compute()

+ +

 

+ +

 

+ +

Defining 2D and 3D hypotheses

+ +

Maximum Element Area

+ +

import + smesh

+ +

import geompy

+ +

import salome

+ +

 

+ +

# create a face

+ +

px   = + geompy.MakeVertex(100., 0.  , + 0.  )

+ +

py   = + geompy.MakeVertex(0.  , + 100., 0.  )

+ +

pz   = + geompy.MakeVertex(0.  , + 0.  , 100.)

+ +

 

+ +

vxy = geompy.MakeVector(px, + py)

+ +

arc = geompy.MakeArc(py, + pz, px)

+ +

wire = geompy.MakeWire([vxy, + arc])

+ +

 

+ +

isPlanarFace = 1

+ +

face = geompy.MakeFace(wire, + isPlanarFace)

+ +

 

+ +

# add the face in the + study

+ +

id_face = geompy.addToStudy(face, + "Face to be meshed")

+ +

 

+ +

# create a mesh

+ +

tria_mesh = smesh.Mesh(face, + "Face : triangulation")

+ +

 

+ +

# define 1D meshing:

+ +

algo = tria_mesh.Segment()

+ +

algo.NumberOfSegments(20)

+ +

 

+ +

# define 2D meshing:

+ +

 

+ +

# assign triangulation + algorithm

+ +

algo = tria_mesh.Triangle()

+ +

 

+ +

# apply "Max Element + Area" hypothesis to each triangle

+ +

algo.MaxElementArea(100)

+ +

 

+ +

# compute the mesh

+ +

tria_mesh.Compute() +  

+ +

 

+ +

Maximum Element Volume

+ +

import + salome

+ +

import geompy

+ +

import StdMeshers

+ +

import NETGENPlugin

+ +

 

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smeshgui = salome.ImportComponentGUI("SMESH")

+ +

smeshgui.Init(salome.myStudyId);

+ +

 

+ +

# create a box

+ +

box = geompy.MakeCylinderRH(30, + 50) #MakeBox(0., 0., 0.,

+ +

100., 200., 300.)

+ +

 

+ +

# add the box in the + study

+ +

idbox = geompy.addToStudy(box, + "box")

+ +

 

+ +

# create a set of hypotheses

+ +

 

+ +

# Number of Segments

+ +

numberOfSegments + = 7

+ +

hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", + "libStdMeshersEngine.so")

+ +

hypNbSeg.SetNumberOfSegments(numberOfSegments)

+ +

print hypNbSeg.GetName()

+ +

print hypNbSeg.GetNumberOfSegments()

+ +

smeshgui.SetName(salome.ObjectToID(hypNbSeg), + "NumberOfSegments_7")

+ +

 

+ +

# Max Element Area

+ +

maxElementArea = + 800

+ +

hypArea = smesh.CreateHypothesis("MaxElementArea", + "libStdMeshersEngine.so")

+ +

hypArea.SetMaxElementArea(maxElementArea)

+ +

print hypArea.GetName()

+ +

print hypArea.GetMaxElementArea()

+ +

smeshgui.SetName(salome.ObjectToID(hypArea), + "MaxElementArea_800")

+ +

 

+ +

# Max Element Volume

+ +

maxElementVolume + = 900

+ +

hypVolume = smesh.CreateHypothesis("MaxElementVolume", + "libStdMeshersEngine.so")

+ +

hypVolume.SetMaxElementVolume(maxElementVolume)

+ +

print hypVolume.GetName()

+ +

print hypVolume.GetMaxElementVolume()

+ +

smeshgui.SetName(salome.ObjectToID(hypVolume), + "MaxElementVolume_900")

+ +

 

+ +

# create a set of algorithms

+ +

 

+ +

# Regular_1D

+ +

regular1D = smesh.CreateHypothesis("Regular_1D", + "libStdMeshersEngine.so")

+ +

smeshgui.SetName(salome.ObjectToID(regular1D), + "Wire Discretisation")

+ +

 

+ +

# MEFISTO_2D

+ +

mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", + "libStdMeshersEngine.so")

+ +

smeshgui.SetName(salome.ObjectToID(mefisto2D), + "MEFISTO_2D")

+ +

 

+ +

# NETGEN_3D (Tetrahedron + meshing algorithm)

+ +

tetra3D = smesh.CreateHypothesis("NETGEN_3D", + "libNETGENEngine.so")

+ +

smeshgui.SetName(salome.ObjectToID(tetra3D), + "NETGEN_3D")

+ +

 

+ +

# initialize a mesh + with the box

+ +

mesh = smesh.CreateMesh(box)

+ +

smeshgui.SetName(salome.ObjectToID(mesh), + "MeshBox")

+ +

 

+ +

# add hypotheses and + algorithms to the box

+ +

mesh.AddHypothesis(box,hypNbSeg)

+ +

mesh.AddHypothesis(box,hypArea)

+ +

mesh.AddHypothesis(box,hypVolume)

+ +

mesh.AddHypothesis(box,regular1D)

+ +

mesh.AddHypothesis(box,mefisto2D)

+ +

mesh.AddHypothesis(box,tetra3D)

+ +

 

+ +

# compute the mesh

+ +

ret = smesh.Compute(mesh,box)

+ +

if ret == 0:

+ +

    print + "probleme when computing the mesh"

+ +

else:

+ +

    print + "Computation succeded"

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Length from Edges

+ +

import + salome

+ +

import geompy

+ +

import smesh

+ +

 

+ +

# create sketchers

+ +

sketcher1 = geompy.MakeSketcher("Sketcher:F + 0 0:TT 70 0:TT 70 70:TT 0 70:WW")

+ +

sketcher2 = geompy.MakeSketcher("Sketcher:F + 20 20:TT 50 20:TT 50 50:TT 20 50:WW")

+ +

isPlanarFace = 1

+ +

 

+ +

# create a face from + two wires

+ +

face1 = geompy.MakeFaces([sketcher1, + sketcher2],isPlanarFace)

+ +

 

+ +

# add object in the study

+ +

id_face1 = geompy.addToStudy(face1,"Face1")

+ +

 

+ +

# create a mesh

+ +

tria = smesh.Mesh(face1, + "Face : triangle 2D mesh")

+ +

 

+ +

# Define 1D meshing

+ +

algo = tria.Segment()

+ +

algo.NumberOfSegments(2)

+ +

 

+ +

# create and assign the + algorithm for 2D meshing with triangles

+ +

algo = tria.Triangle()

+ +

 

+ +

# create and assign "LengthFromEdges" + hypothesis to build triangles

+ +

# based on the length + of the edges taken from the wire

+ +

algo.LengthFromEdges()

+ +

 

+ +

# compute the mesh

+ +

tria.Compute()

+ +

 

+ +

Defining Additional Hypotheses

+ +

Propagation

+ +

from + geompy import *

+ +

import smesh

+ +

 

+ +

# create vertices

+ +

Point111 = MakeVertex( + 0,  0,  0)

+ +

Point211 = MakeVertex(10, +  0,  0)

+ +

Point121 = MakeVertex( + 0, 10,  0)

+ +

Point221 = MakeVertex(10, + 10,  0)

+ +

Point112 = MakeVertex( + 0,  0, 10)

+ +

Point212 = MakeVertex(10, +  0, 10)

+ +

Point122 = MakeVertex( + 0, 10, 10)

+ +

Point222 = MakeVertex(10, + 10, 10)

+ +

 

+ +

# create edges

+ +

EdgeX111 = MakeEdge(Point111, + Point211)

+ +

EdgeX121 = MakeEdge(Point121, + Point221)

+ +

EdgeX112 = MakeEdge(Point112, + Point212)

+ +

EdgeX122 = MakeEdge(Point122, + Point222)

+ +

EdgeY11 = MakeEdge(Point111, + Point121)

+ +

EdgeY21 = MakeEdge(Point211, + Point221)

+ +

EdgeY12 = MakeEdge(Point112, + Point122)

+ +

EdgeY22 = MakeEdge(Point212, + Point222)

+ +

EdgeZ111 = MakeEdge(Point111, + Point112)

+ +

EdgeZ211 = MakeEdge(Point211, + Point212)

+ +

EdgeZ121 = MakeEdge(Point121, + Point122)

+ +

EdgeZ221 = MakeEdge(Point221, + Point222)

+ +

 

+ +

# create faces

+ +

FaceX11 = MakeQuad(EdgeY11, + EdgeZ111, EdgeY12, EdgeZ121)

+ +

FaceX21 = MakeQuad(EdgeY21, + EdgeZ211, EdgeY22, EdgeZ221)

+ +

FaceY111 = MakeQuad(EdgeX111, + EdgeZ111, EdgeX112, EdgeZ211)

+ +

FaceY121 = MakeQuad(EdgeX121, + EdgeZ121, EdgeX122, EdgeZ221)

+ +

FaceZ11 = MakeQuad(EdgeX111, + EdgeY11, EdgeX121, EdgeY21)

+ +

FaceZ12 = MakeQuad(EdgeX112, + EdgeY12, EdgeX122, EdgeY22)

+ +

 

+ +

# create a solid

+ +

box = MakeHexa(FaceX11, + FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)

+ +

 

+ +

# add in the study

+ +

box_id = addToStudy(box, + "Box")

+ +

 

+ +

# create a hexahedral + mesh on the box

+ +

hexa = smesh.Mesh(box, + "Box : hexahedrical mesh")

+ +

 

+ +

# create an 1D algorithm + for edges

+ +

algo = hexa.Segment()

+ +

 

+ +

# define "NumberOfSegments" + hypothesis to cut an edge in a fixed number of segments

+ +

algo.NumberOfSegments(4)

+ +

 

+ +

# create a quadrangle + 2D algorithm for faces

+ +

hexa.Quadrangle()

+ +

 

+ +

# create a hexahedron + 3D algorithm for solids

+ +

hexa.Hexahedron()

+ +

 

+ +

# create a local hypothesis

+ +

algo = hexa.Segment(EdgeX111)

+ +

 

+ +

# define "Arithmetic1D" + hypothesis to cut an edge + in several segments with increasing length

+ +

algo.Arithmetic1D(1, + 4)

+ +

 

+ +

# define "Propagation" + hypothesis that propagates all other 1D hypotheses

+ +

# from all edges on the + opposite side of a face in case of quadrangular faces

+ +

algo.Propagation()

+ +

 

+ +

# compute the mesh

+ +

hexa.Compute()  

+ +

Defining Meshing Algorithms

+ +

import + salome

+ +

import StdMeshers

+ +

import NETGENPlugin

+ +

 

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smeshgui = salome.ImportComponentGUI("SMESH")

+ +

smeshgui.Init(salome.myStudyId);

+ +

 

+ +

# create algorithms

+ +

print "-------------------------- + create Algorithms"

+ +

print "-------------------------- + Regular_1D (Wire discretisation)"

+ +

regular1D = smesh.CreateHypothesis("Regular_1D", + "libStdMeshersEngine.so")

+ +

smeshgui.SetName(salome.ObjectToID(regular1D), + "Wire Discretisation")

+ +

 

+ +

print "-------------------------- + MEFISTO_2D (Triangle meshing algorithm)"

+ +

mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", + "libStdMeshersEngine.so")

+ +

smeshgui.SetName(salome.ObjectToID(mefisto2D), + "MEFISTO_2D")

+ +

 

+ +

print "-------------------------- + Quadrangle_2D (Quadrangle meshing algorithm)"

+ +

quad2D = smesh.CreateHypothesis( + "Quadrangle_2D", "libStdMeshersEngine.so" )

+ +

smeshgui.SetName(salome.ObjectToID(quad2D), + "Quadrangle_2D")

+ +

 

+ +

print "-------------------------- + Hexa_3D (Hexahedron meshing algorithm)"

+ +

hexa3D = smesh.CreateHypothesis("Hexa_3D", + "libStdMeshersEngine.so")

+ +

smeshgui.SetName(salome.ObjectToID(hexa3D), + "HEXA_3D")

+ +

 

+ +

print "-------------------------- + NETGEN_3D (Tetrahedron meshing algorithm)"

+ +

netgen3D = smesh.CreateHypothesis("NETGEN_3D", + "libNETGENEngine.so")

+ +

smeshgui.SetName(salome.ObjectToID(netgen3D), + "NETGEN_3D")

+ +

salome.sg.updateObjBrowser(1)

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/deleting_groups.htm b/doc/salome/gui/SMESH/deleting_groups.htm index 85b273571..02a7b47e2 100755 --- a/doc/salome/gui/SMESH/deleting_groups.htm +++ b/doc/salome/gui/SMESH/deleting_groups.htm @@ -1,114 +1,119 @@ - - - - - -Deleting Groups - - - - - - - - - - -

Deleting Groups

- -

To delete a group in the - Main Menu select Mesh - -> Delete Groups and select one or several - groups you wish to delete in the 3D viewer or in the Object Browser.

- -

The selected groups will - be listed in Delete groups with contents - menu. Then click Ok button to remove the selected groups and close the - menu or Apply button to remove them and proceed with the selection.

- -

 

- -

- -

    

- -

 

- -

Please, note that this - operation removes groups with their elements. - To delete a group and leave its elements intact, right-click on the group - in the Object Browser and select Delete - in the pop-up menu or select the group and choose Edit - -> Delete in the Main Menu. -   

- - - - + + + + + +Deleting Groups + + + + + + + + + + + +

Deleting Groups

+ +

To delete a group in the + Main Menu select Mesh + -> Delete Groups and select one or several + groups you wish to delete in the 3D viewer or in the Object Browser.

+ +

The selected groups will + be listed in Delete groups with contents + menu. Then click Ok button to remove the selected groups and close the + menu or Apply button to remove them and proceed with the selection.

+ +

 

+ +

+ +

    

+ +

 

+ +

Please, note that this + operation removes groups with their elements. + To delete a group and leave its elements intact, right-click on the group + in the Object Browser and select Delete + in the pop-up menu or select the group and choose Edit + -> Delete in the Main Menu. +   

+ + + + diff --git a/doc/salome/gui/SMESH/display_entity.htm b/doc/salome/gui/SMESH/display_entity.htm index 8195fc580..51d7d6604 100755 --- a/doc/salome/gui/SMESH/display_entity.htm +++ b/doc/salome/gui/SMESH/display_entity.htm @@ -1,101 +1,101 @@ - - - - - -Display Entity - - - - - - - - - - - -

Display Entity

- -

In this submenu you can choose to display only faces,

- -

 

- -

- -

 

- -

only edges,

- -

 

- -

- -

 

- -

or both.

- - - - + + + + + +Display Entity + + + + + + + + + + + + +

Display Entity

+ +

In this submenu you can choose to display only volumes, faces or edges + or combine them.

+ +

 

+ +

Only Faces                                                  Only + Edges

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/ehelp.xml b/doc/salome/gui/SMESH/ehelp.xml index be729a46c..8d61adcdc 100755 --- a/doc/salome/gui/SMESH/ehelp.xml +++ b/doc/salome/gui/SMESH/ehelp.xml @@ -1,10 +1,10 @@ - - - - - - - - WebSearch - + + + + + + + + WebSearch + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/ehlpdhtm.js b/doc/salome/gui/SMESH/ehlpdhtm.js index 6cfd2e463..7bcb24993 100755 --- a/doc/salome/gui/SMESH/ehlpdhtm.js +++ b/doc/salome/gui/SMESH/ehlpdhtm.js @@ -1,4239 +1,4239 @@ -// eHelp® Corporation Dynamic HTML JavaScript -// Copyright© 1998-2003 eHelp® Corporation.All rights reserved. -// Version=4.82 - -// Warning:Do not modify this file.It is generated by RoboHELP® and changes will be overwritten. - -//// Segment Begin -- (JavaScript 1.0) - -/// Section Begin - General and relative topics(JavaScript 1.0) - -//{{HH_SYMBOL_SECTION -var HH_ChmFilename = ""; -var HH_WindowName = ""; -var HH_GlossaryFont = ""; -var HH_Glossary = ""; -var HH_Avenue = ""; -var HH_ActiveX = false; -//}}HH_SYMBOL_SECTION - -//Begin to support previous generic parameters -//Get the information about the browser. -var gstrBsAgent = navigator.userAgent.toLowerCase(); -var gnBsVer = parseInt(navigator.appVersion); - -var gbBsOpera = (gstrBsAgent.indexOf('opera') != -1); -var gbBsKonqueror = (gstrBsAgent.indexOf('konqueror') != -1); -var gbBsSafari = (gstrBsAgent.indexOf('safari') != -1); -var gbBsIE = (gstrBsAgent.indexOf('msie') != -1) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari; -var gbBsNS = (gstrBsAgent.indexOf('mozilla') != -1) && ((gstrBsAgent.indexOf('spoofer') == -1) && (gstrBsAgent.indexOf('compatible') == -1)) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari; - -var gbBsMac = (gstrBsAgent.indexOf('mac') != -1); -var gbBsWindows = ((gstrBsAgent.indexOf('win') != -1) || (gstrBsAgent.indexOf('16bit') != -1)); -var gbBsSunOS = (gstrBsAgent.indexOf("sunos") != -1); - -var gbBsIE3Before = ((gbBsIE) && (gnBsVer <= 2)); -var gbBsNS3Before = ((gbBsNS) && (gnBsVer <= 3)); - -var gbBsNS2 = ((gbBsNS) && (gnBsVer <= 2)); -var gbBsNS3 = ((gbBsNS) && (gnBsVer == 3)); -var gbBsIE300301 = ((gbBsIE) && (gnBsVer == 2) && ((gstrBsAgent.indexOf("3.00") != -1)||(gstrBsAgent.indexOf("3.0a") != -1)||(gstrBsAgent.indexOf("3.0b")!=-1)||(gstrBsAgent.indexOf("3.01")!=-1))); -var gbBsIE302 = ((gbBsIE) && (gnBsVer == 2) && (gstrBsAgent.indexOf("3.02") != -1)); - -var gbBsNS4 = ((gbBsNS) && (gnBsVer >= 4)); -var gbBsNS6 = ((gbBsNS) && (gnBsVer >= 5)); -var gbBsNS7 = false; - -var gbBsIE4 = ((gbBsIE) && (gnBsVer >= 4)); -var gbBsIE5 = false; -var gbBsIE55 = false; - -var gbBsOpera6 = false; -var gbBsOpera7 = false; - -var gbBsKonqueror3 = false; - - - -gbBsIE = (navigator.appName.indexOf("Microsoft") != -1) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;; -if (gbBsIE) -{ - if (parseInt(navigator.appVersion) >= 4) { - gbBsIE4 = true; - if (gbBsIE4) { - var nPos = gstrBsAgent.indexOf("msie"); - var strIEversion = gstrBsAgent.substring(nPos + 5); - var nVersion = parseFloat(strIEversion); - if (nVersion >= 5) - gbBsIE5 = true; - if (nVersion >= 5.5) - gbBsIE55 = true; - } - } -} -if (gbBsNS6) -{ - var nPos=gstrBsAgent.indexOf("gecko"); - if(nPos!=-1) - { - var nPos2=gstrBsAgent.indexOf("/", nPos); - if(nPos2!=-1) - { - var nVersion=parseFloat(gstrBsAgent.substring(nPos2+1)); - if (nVersion>=20020823) - gbBsNS7=true; - } - } -} -if (gbBsOpera) -{ - var nPos = gstrBsAgent.indexOf("opera"); - if(nPos!=-1) - { - var nVersion = parseFloat(gstrBsAgent.substring(nPos+6)); - if (nVersion >= 6) - { - gbBsOpera6=true; - if (nVersion >=7) - gbBsOpera7=true; - } - } -} -if (gbBsKonqueror) -{ - var nPos = gstrBsAgent.indexOf("konqueror"); - if(nPos!=-1) - { - var nVersion = parseFloat(gstrBsAgent.substring(nPos+10)); - if (nVersion >= 3) - { - gbBsKonqueror3=true; - } - } -} - -function insertAdjacentHTML(obj, where, htmlStr) -{ - if (gbBsIE || gbBsOpera7) - { - obj.insertAdjacentHTML(where, htmlStr); - } - else if (gbBsNS6 || gbBsSafari) - { - var r = obj.ownerDocument.createRange(); - r.setStartBefore(obj); - var parsedHTML = r.createContextualFragment(htmlStr); - - switch (where){ - case 'beforeBegin': - obj.parentNode.insertBefore(parsedHTML,obj); - break; - case 'afterBegin': - obj.insertBefore(parsedHTML,obj.firstChild); - break; - case 'beforeEnd': - obj.appendChild(parsedHTML); - break; - case 'afterEnd': - if (obj.nextSibling){ - obj.parentNode.insertBefore(parsedHTML,obj.nextSibling); - } else { - obj.parentNode.appendChild(parsedHTML); - } - break; - } - } -} - -// Utilities functions. -function BsscHasExtJs() -{ - if( gbBsIE3Before || gbBsNS3Before) - return false; - return true; -} - -// Register event handler -var gBsOnLoads = new Array(); // An array holds all the onload event handler. -var gBsOnClicks = new Array(); // An array holds all the onClick event handler. -var gBsOnUnLoads = new Array(); // An array holds all the OnUnLoad event handler. -var gBsOnMouseOvers = new Array(); // An array holds all the OnMouseOver event handler. -var gBsOnMouseOuts = new Array(); // An array holds all the OnMouseOut event handler. - -var gbOrignalOnMouseDown = null; - -function BsscRegisterOnLoad(funcHandler) -{ - var nLength = gBsOnLoads.length; - gBsOnLoads[nLength] = funcHandler; -} - -function BsscRegisterOnClick(funcHandler) -{ - var nLength = gBsOnClicks.length; - gBsOnClicks[nLength] = funcHandler; -} - -function BsscRegisterOnUnLoad(funcHandler) -{ - var nLength = gBsOnUnLoads.length; - gBsOnUnLoads[nLength] = funcHandler; -} - -function BsscRegisterOnMouseOver(funcHandler) -{ - var nLength = gBsOnMouseOvers.length; - gBsOnMouseOvers[nLength] = funcHandler; -} - -function BsscRegisterOnMouseOut(funcHandler) -{ - var nLength = gBsOnMouseOuts.length; - gBsOnMouseOuts[nLength] = funcHandler; -} - -function BsGeneralOnLoad() -{ - if (!gbBsIE4 && !gbBsNS4) - return; - - // Make everything visible in navigator - if (gbBsNS4 && !gbBsNS6) { - // Make some special effects items visible - for (var iLayer = 0; iLayer < document.layers.length; iLayer++) { - document.layers[iLayer].visibility = "show"; - document.layers[iLayer].left = 0; - } - } -} - -// If resize the netscape browser, need to reload it. -function BsReDo() -{ - if (innerWidth != origWidth || innerHeight != origHeight) - location.reload(); -} -// End of the local functions. - -// The following functions are used by the html files. -function BSSCOnLoad() -{ - if( !BsscHasExtJs() ) - return; - for (var nElement = gBsOnLoads.length - 1; nElement >= 0; nElement--) - gBsOnLoads[nElement](); -} - -function BSSCOnClick() -{ - if (!BsscHasExtJs()) return; - - for (var nElement = gBsOnClicks.length - 1; nElement >= 0; nElement--) - gBsOnClicks[nElement](); -} - -function BSSCOnUnload() -{ - if (!BsscHasExtJs()) return; - for (var nElement = gBsOnUnLoads.length - 1; nElement >= 0; nElement--) - gBsOnUnLoads[nElement](); -} - -function BSSCOnMouseOver() -{ - if (!BsscHasExtJs()) return; - for (var nElement = gBsOnMouseOvers.length - 1; nElement >= 0; nElement--) - gBsOnMouseOvers[nElement](); -} - -function BSSCOnMouseOut() -{ - if (!BsscHasExtJs()) return; - for (var nElement = gBsOnMouseOuts.length - 1; nElement >= 0; nElement--) - { - gBsOnMouseOuts[nElement](); - } -} -// End of invocation of the event handle functions. - -// Add the GereralOnLoad to the onload array. -if (typeof(BsscRegisterOnLoad) != "undefined") -{ - BsscRegisterOnLoad(BsGeneralOnLoad); -} -if (gbBsNS4&&!gbBsNS6) { - origWidth = innerWidth; - origHeight = innerHeight; - onresize = BsReDo; -} -//End to support previous generic parameters - -//Begin to support previous HHActiveX invoking -function BsHHActivateComponents() -{ - if( HH_ActiveX && (HH_ChmFilename != "") && ((self == top) || (self == top.frames[0]))) - { - var objBody = getElementsByTag(document,"BODY")[0]; - if( typeof(objBody) == "object" ) - { - insertAdjacentHTML(objBody, "beforeEnd", ''); - if (HHComponentActivator.object) - HHComponentActivator.Activate(HH_ChmFilename, HH_WindowName, HH_GlossaryFont, HH_Glossary, HH_Avenue); - } - } -} - -function BsHHActivXOnLoad() -{ - if( gbBsIE4 ) - BsHHActivateComponents(); -} - -if( typeof(BsscRegisterOnLoad) != "undefined" ) -{ - BsscRegisterOnLoad(BsHHActivXOnLoad); -} -//End to support previous HHActiveX invoking - -//Begin to support previous relative topics -//If webHelp needs Related Topics DHTMLcode, it's supposed to add it here -var gbPopupMenuTimeoutExpired = false; -var gbInPopupMenu = false; -var gbPopupMenuTopicList = null; -var gOlddocumentClick = null; - -////////////////////////////////////////////////////////////////////////////////////////// -// -// Popup Menu code -// -////////////////////////////////////////////////////////////////////////////////////////// - -var g_bIsPopupMenuInit = false; -function _WritePopupMenuLayer() -{ - if (!g_bIsPopupMenuInit) - { - if (gbBsNS4&&!gbBsNS6) { -//Do not try to write ininle styles for NS! NS can not handle it and will not stop downloading the html page... - document.write("
"); - } else{ - document.write(""); - if (!(gbBsNS4&&!gbBsNS6)) { - document.write(""); - } - } - g_bIsPopupMenuInit = true; - } -} - -//Seek for the bsscright frame -function _SeekFrameByName( cRoot, strName ) -{ - if( cRoot == null ) return null; - if( cRoot.frames == null ) return null; - if( cRoot.frames[strName] != null ) return cRoot.frames[strName]; - for (var i=0; i'; - } else { - strMenu += '' + gbPopupMenuTopicList[fn_arguments[i]].strTitle + ''; - } - strMenu += ''; - - if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) { - i += 2; - } else { - i += 1; - } - } - strMenu += ""; - - if (gbBsMac) { - // totally hack. because ie5 in mac need something. is one of them. mac is mad. - strMenu +="
"; - } - - var layerPopup = null; - var stylePopup = null; - var nEventX = 0; - var nEventY = 0; - var nWindowWidth = 0; - if (gbBsIE4 || gbBsOpera7) { - - layerPopup = getElement("PopupMenu"); - layerPopup.innerHTML = strMenu; - stylePopup = layerPopup.style; - - _BSPSGetClientSize(); - - // Get the position of the item causing the event (relative to its parent) - nEventX = window.event.clientX; - nEventY = window.event.clientY; - - if (nEventY + layerPopup.scrollHeight + 10 < gBsClientHeight) { - nEventY += document.body.scrollTop + 10; - } else { - nEventY = (document.body.scrollTop + gBsClientHeight) - layerPopup.scrollHeight - 20; - } - stylePopup.top = nEventY; - - var nPopupWidth = layerPopup.scrollWidth; - if (gbBsMac) { - nPopupWidth = 80; // we have no idea how to get the dynamic width of the popup. - } - if (nEventX + nPopupWidth + 20 > gBsClientWidth) { - if (gBsClientWidth - nPopupWidth < 5) { - stylePopup.left = 5; - } else { - stylePopup.left = gBsClientWidth - nPopupWidth - 5; - } - } else { - stylePopup.left = nEventX + document.body.scrollLeft + 20; - } - - stylePopup.visibility = "visible"; - if (!gOlddocumentClick && document.onclick) - gOlddocumentClick = document.onclick; - document.onclick = PopupMenu_HandleClick; - - } else if (gbBsNS6 || gbBsKonqueror3||gbBsSafari) { - layerPopup = getElement("PopupMenu"); - layerPopup.style.visibility = "hidden"; - - if (gbBsNS6) - { - var e = fn_arguments[0]; - nEventX = e.pageX; - nEventY = e.pageY; - } - else - { - nEventX = window.event.clientX; - nEventY = window.event.clientY; - } - _BSPSGetClientSize(); - layerPopup.innerHTML = strMenu; - - if (nEventY + layerPopup.offsetHeight + 20 < window.pageYOffset + gBsClientHeight) { - nEventY += 20; - } else { - nEventY = gBsClientHeight + window.pageYOffset - layerPopup.offsetHeight - 20; - } - - if (nEventX + layerPopup.offsetWidth + 20 > gBsClientWidth + window.pageXOffset) { - if (gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth < 20) { - nEventX = 5; - } else { - nEventX = gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth - 20; - } - } else { - nEventX += 20; - } - layerPopup.style.top = nEventY; - layerPopup.style.left = nEventX; - // set again to avoid the stupid frash in netscape 6. - layerPopup.innerHTML = strMenu; - layerPopup.style.visibility = "visible"; - //window.captureEvents(Event.MOUSEDOWN); - if (!gOlddocumentClick && document.onclick) - gOlddocumentClick = document.onclick; - window.onclick = PopupMenu_HandleClick; - } - else if (gbBsNS4) { - layerPopup = document.layers.PopupMenu; - layerPopup.visibility = "hide"; - stylePopup = layerPopup.document; - stylePopup.write(strMenu); - stylePopup.close(); - var e = fn_arguments[0]; - nEventX = e.pageX; - nEventY = e.pageY; - _BSPSGetClientSize(); - if (nEventY + layerPopup.clip.height + 20 < window.pageYOffset + gBsClientHeight) { - nEventY += 20; - } else { - nEventY = gBsClientHeight + window.pageYOffset- layerPopup.clip.height - 20; - } - layerPopup.top = nEventY; - - if (nEventX + layerPopup.clip.width + 20 > gBsClientWidth + window.pageXOffset) { - if (gBsClientWidth + window.pageXOffset - layerPopup.clip.width < 20) { - nEventX = 5; - } else { - nEventX = gBsClientWidth + window.pageXOffset - layerPopup.clip.width - 20; - } - } else { - nEventX += 20; - } - - layerPopup.left = nEventX; - - layerPopup.visibility = "show"; - - window.captureEvents(Event.MOUSEDOWN); - if (!gOlddocumentClick && document.onmousedown) - gOlddocumentClick = document.onmousedown; - window.onmousedown = PopupMenu_HandleClick; - } - - window.gbInPopupMenu = true; - window.gbPopupMenuTimeoutExpired = false; - setTimeout("PopupMenu_Timeout();", 100); - return false; -} - -function PopupMenu_Timeout() -{ - window.gbPopupMenuTimeoutExpired = true; -} - -function PopupMenu_Over(e) -{ - if (gbBsIE4||gbBsOpera7) - e.srcElement.className = "PopupOver"; - else if (gbBsNS6) - e.target.parentNode.className = "PopupOver"; - return; -} - -function PopupMenu_Out(e) -{ - if (gbBsIE4||gbBsOpera7) - e.srcElement.className = "PopupNotOver"; - else if (gbBsNS6) - e.target.parentNode.className = "PopupNotOver"; - return; -} - -function PopupMenu_HandleClick(e) -{ - if (window.gbPopupMenuTimeoutExpired) { - window.gbInPopupMenu = false; - if (gbBsNS4 && !gbBsNS6) { - window.releaseEvents(Event.MOUSEDOWN); - } - - var layerPopup = null; - if (gbBsNS4&&!gbBsNS6) { - layerPopup = document.layers.PopupMenu; - layerPopup.visibility = "hide"; - } else { - layerPopup = getElement("PopupMenu"); - layerPopup.style.visibility = "hidden"; - } - - if (gOlddocumentClick) - { - if (gbBsNS4 && !gbBsNS6) - document.onmousedown = gOlddocumentClick; - else - document.onclick = gOlddocumentClick; - } - } - return; -} - -function BSSCPopup_ClickMac() -{ - if ((!DHTMLPopupSupport()) && (gbBsIE4 || gbBsOpera7)) - { - var bClickOnAnchor = false; - var el; - if ((window.event != null) && - (window.event.srcElement != null)) - { - el = window.event.srcElement; - while (el != null) - { - if ((el.tagName == "A") || (el.tagName == "AREA")) { - bClickOnAnchor = true; - break; - } - if (el.tagName == "BODY") { - break; - } - el = getParentNode(el); - } - } - if (BSSCPopup_IsPopup()) - { - if (!bClickOnAnchor) { - parent.window.gPopupWindow = null; - self.close(); - } - } - else - { - bClosePopupWindow = true; - if ((bClickOnAnchor) && - (el.href) && - ((el.href.indexOf("javascript:BSSCPopup") != -1) || (el.href.indexOf("javascript:null") != -1) || (el.href.indexOf("javascript:void(0)") != -1))) - { - bClosePopupWindow = false; - } - if (bClosePopupWindow) - { - if (window.gPopupWindow != null && !window.gPopupWindow.closed ) - { - window.gPopupWindow.close(); - } - } - } - } -} - -function BsPopupOnClick() -{ - if (!gbBsIE4 && !gbBsOpera7) - return; - - BSSCPopup_ClickMac(); -} - -function _BSSCOnError(message) -{ - if(-1 != message.indexOf("denied") - || -1 != message.indexOf("Object required")) - return true; -} - -//End to support previous relative topics - -/// Section End - General and relative topics (JavaScript 1.0) - -/// Section Begin - Popup (JavaScript 1.0) -//Begin to support previous popup functions - -//variables used to isolate the browser type -var gBsStyVisShow = null; -var gBsStyVisHide = null; -var gBsClientWidth = 640; -var gBsClientHeight = 480; - -// here is the varible for judge popup windows size. these parameter is for IE5.0, it may need adjust for others. -var gBRateH_W = 0.618; // 1.618 Golden cut. -var gBMaxXOfParent = 0.8; -var gBMaxYOfParent = 0.8; -var gBscrollHeight = 16; -var gBscrollWidth = 16; -var gBpermitXDelta = 3; -var gBpermitYDelta = 3; - - -var arrayPopupURL = new Array(); -var arrayAbsPopupURL = new Array(); - -var arrayDirty = new Array(); - -function setAbsPopupURL(nIndex, strURL) -{ - arrayAbsPopupURL[nIndex] = strURL; -} - -function getAbsPopupURL(nIndex) -{ - if (nIndex == -1 || arrayAbsPopupURL.length <= nIndex) return null; - else - return arrayAbsPopupURL[nIndex]; -} - -function getPopupURL(nIndex) -{ - if (nIndex == -1 || arrayPopupURL.length <= nIndex) return null; - else - return arrayPopupURL[nIndex]; -} - -function getPopupID(nIndex) -{ - return gstrPopupID + nIndex; -} - -function getPopupShadowID(nIndex) -{ - return gstrPopupShadowID + nIndex; -} - -function getPopupTopicID(nIndex) -{ - return gstrPopupTopicID + nIndex; -} - -function getPopupIFrameID(nIndex) -{ - return gstrPopupIFrameID + nIndex; -} - -function getPopupIFrameName(nIndex) -{ - return gstrPopupIFrameName + nIndex; -} - - -function getPopupTopicStyle(nIndex) -{ - return getElement(getPopupTopicID(nIndex)).style; -} - -function getPopupShadowStyle(nIndex) -{ - return getElement(getPopupShadowID(nIndex)).style; -} - -function getPopupIFrame(nIndex) -{ - if (gbBsNS6) - return eval("window.frames['" + getPopupIFrameName(nIndex) + "']"); - else - return eval("document.frames['" + getPopupIFrameName(nIndex) + "']"); -} - -function getPopupDivStyle(nIndex) -{ - return getElement(getPopupID(nIndex)).style; -} - -function getPopupIFrameStyle(nIndex) -{ - return getElement(getPopupIFrameID(nIndex)).style; -} - - -function findDiv(strURL) -{ - for (var i = 0; i < arrayPopupURL.length; i ++ ) { - if (arrayPopupURL[i] == strURL) { - return i; - } - } - return -1; -} - -var gnToken = -1; -function takeToken() -{ - gnToken ++; - if (gnToken > 10000) gnToken = 0; - return gnToken; -} - -function IsValidToken(nToken) -{ - return (gnToken == nToken); -} - -function addDiv(strURL) -{ - for (var i = 0; i < arrayPopupURL.length; i ++) { - if (arrayPopupURL[i] == null) { - arrayPopupURL[i] = strURL; - return i; - } - } - arrayPopupURL[i] = strURL; - arrayDirty[i] = true; - return i; -} - -function setDirty() -{ - for (var i = 0; i < arrayPopupURL.length; i ++ ) - arrayDirty[i] = true; -} - -function IsDirty(nIndex) -{ - if (nIndex == -1) - return true; - else - if (arrayDirty.length > nIndex) - return arrayDirty[nIndex]; - else - return true; -} - -function hideAll() -{ - for (var i = 0; i < arrayPopupURL.length; i ++ ) - { - getPopupDivStyle(i).visibility = gBsStyVisHide; - getPopupIFrameStyle(i).visibility = gBsStyVisHide; - } -} - -function getCurrentPopupIFrame() -{ - for (var i = 0; i < arrayPopupURL.length; i ++) - if (getPopupDivStyle(i).visibility == gBsStyVisShow) - return getPopupIFrame(i); - return null; -} - -function setClear(nIndex) -{ - if (nIndex != -1) - arrayDirty[nIndex] = false; -} - -function _BSSCCreatePopupDiv(strURL) -{ - var nIndex = findDiv(strURL); - if (nIndex == -1 ) { - nIndex = addDiv(strURL); - BsPopup_CreateDiv(nIndex); - } - else { - if (IsDirty(nIndex)) { - if("object" == typeof(getPopupIFrame(nIndex).document)) - getPopupIFrame(nIndex).document.location.href = strURL; - } - } - return nIndex; -} - -//Here is the browser type -function _BSPSGetBrowserInfo() -{ - if (gbBsNS4&&!gbBsNS6) - { - gBsStyVisShow = "show"; - gBsStyVisHide = "hide"; - } - else - { - gBsStyVisShow = "visible"; - gBsStyVisHide = "hidden"; - } -} - -_BSPSGetBrowserInfo(); - -//Get client size info -function _BSPSGetClientSize() -{ - if (gbBsNS4||gbBsKonqueror3||gbBsSafari) - { - gBsClientWidth = innerWidth; - gBsClientHeight = innerHeight; - } - else if (gbBsIE4 || gbBsOpera7) - { - gBsClientWidth = document.body.clientWidth; - gBsClientHeight = document.body.clientHeight; - } -} - -var gstrPopupID = 'BSSCPopup'; -var gstrPopupShadowID = 'BSSCPopupShadow'; -var gstrPopupTopicID = 'BSSCPopupTopic'; -var gstrPopupIFrameID = 'BSSCPopupIFrame'; -var gstrPopupIFrameName = 'BSSCPopupIFrameName'; - -var gstrPopupSecondWindowName = 'BSSCPopup'; - -var gPopupWindow = null; -var gnPopupClickX = 0; -var gnPopupClickY = 0; - -var gnPopupScreenClickX = 0; -var gnPopupScreenClickY = 0; - -var gbPopupTimeoutExpired = false; - -function DHTMLPopupSupport() -{ - if (((gbBsIE4) && (!gbBsMac))||gbBsOpera7|| gbBsNS7) { - return true; - } - return false; -} - -function BSSCPopup_IsPopup() -{ - if (DHTMLPopupSupport() && (this.name.indexOf(gstrPopupIFrameName) != -1)) { - return true; - } else if ((gbBsNS4 || gbBsIE4 || gbBsOpera7) && (this.name.indexOf(gstrPopupID) != -1)) { - return true; - } else { - return false; - } -} - -// If there is a hyperlink in a popup window, display the hyperlink in -// the original window. (bsscright) -if (BSSCPopup_IsPopup() && !gbBsIE4 && !gbBsOpera7) { - document.write(""); -} - -// Local functions. -function BsPopup_CreateDiv(nIndex) -{ - if(!DHTMLPopupSupport()) - return; - // DO NOT SET Width and height for the div, otherwize it will make IE4 popup do not work when view the topic alone. - var strPopupDiv = ""; - - var objBody = getElementsByTag(document, "BODY")[0]; - if( typeof(objBody) != "object" ) - return; - - insertAdjacentHTML(objBody, "beforeEnd", strPopupDiv); -} - -function handleLoadNS() -{ - if (this.id) - { - var nIndex = parseInt(this.id.substring(gstrPopupIFrameID.length)); - BSSCPopup_PostWork(nIndex); - } -} - -function BSSCPopup_PostWork(nIndex) -{ - getPopupDivStyle(nIndex).visibility = gBsStyVisShow; - getPopupIFrameStyle(nIndex).visibility =gBsStyVisShow; - - setClear(nIndex); - window.gbPopupTimeoutExpired = true; - - BSSCPopup_ChangeTargettoParent(getPopupIFrame(nIndex).document); - if (gbBsNS6) - getPopupIFrame(nIndex).document.body.addEventListener("click",BSSCPopupClicked,false); - else - getPopupIFrame(nIndex).document.body.onclick = BSSCPopupClicked; - - if (!gbOrignalOnMouseDown && document.onmousedown) - gbOrignalOnMouseDown = document.onmousedown; - - if (gbBsNS6) - document.addEventListener("mousedown", BSSCPopupParentClicked,false); - else - document.onmousedown = BSSCPopupParentClicked; -} - -function BSSCPopup_Timeout(nIndex, nToken) -{ - if (!IsValidToken(nToken)) return; - - if (gbBsNS6||((getPopupIFrame(nIndex).document.readyState == "complete") && - (getPopupIFrame(nIndex).document.body != null))) { - BSSCPopup_PostWork(nIndex); - } else { - setTimeout("BSSCPopup_Timeout(" + nIndex + "," + nToken + ")", 100); - } -} - -// VH 08/10/00 -// do not change target to parent if the href is using javascript -function BSSCPopup_ChangeTargettoParent(tagsObject) -{ - var collA = getElementsByTag(tagsObject, "A"); - BSSCPopup_ChangeTargettoParent2(collA); - - var collIMG = getElementsByTag(tagsObject,"IMG"); - BSSCPopup_ChangeTargettoParent2(collIMG); -} - -function BSSCPopup_ChangeTargettoParent2(colls) -{ - if (colls != null) { - for (var j = 0; j < colls.length; j ++ ) - { - var strtemp = colls[j].href; - if (strtemp) - { - strtemp = strtemp.toLowerCase(); - if (strtemp.indexOf("javascript:") == -1) - if (colls[j].target == "") - colls[j].target = "_parent"; - } - } - } -} - -function BSPSPopupTopicWinHelp(strURL) -{ - _BSSCPopup(strURL); - return; -} - -function _BSSCPopup(strURL, width, height) -{ - var cuswidth = 0; - var cusheight = 0; - if ("undefined" != typeof(width) && "undefined" != typeof(height)) { - cuswidth = width; - cusheight= height; - } - - if (DHTMLPopupSupport()) { - var nToken = takeToken(); // take token first. - var nIndex = _BSSCCreatePopupDiv(strURL); - window.gbPopupTimeoutExpired = false; - var ntWidth = gBsClientWidth; - var ntHeight = gBsClientHeight; - _BSPSGetClientSize(); - if (ntWidth != gBsClientWidth || ntHeight != gBsClientHeight) { - setDirty(); - } - - if (IsDirty(nIndex)) { - if (gbBsMac) { - setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight +")", 400); - } else { - setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 100); - } - } - else { - MoveDivAndShow(nIndex ,nToken, cuswidth, cusheight); - } - } else { - _BSSCPopup2(strURL, cuswidth, cusheight); - } - return; -} - -if (gbBsIE55) -{ - var ehlpdhtm_fOldBefureUnload = window.onbeforeunload; - var gnBsUnload=0; - window.onbeforeunload = window_BUnload; -} - -function window_BUnload() -{ - gnBsUnload++; - if (gnBsUnload>1) - return; - for (var i = 0; i < arrayPopupURL.length; i ++) - removeThis(document.all(getPopupID(i))); - arrayPopupURL.length = 0; - if (ehlpdhtm_fOldBefureUnload) - ehlpdhtm_fOldBefureUnload(); -} - -function _BSSCPopup2(strURL, width, height) -{ - if (gbBsOpera6&&gbBsMac) - { - var wmTemp = window.open(document.location.href, gstrPopupSecondWindowName); - wmTemp.close(); - setTimeout("_BSSCPopup3(\""+strURL+"\","+width+","+height+");",100); - } - else - _BSSCPopup3(strURL, width, height); -} - -function _BSSCPopup3(strURL, width, height) -{ - if (window.name == gstrPopupSecondWindowName) { - window.location = strURL; - } else { - if (!gbBsMac || !gbBsNS4) { - BSSCHidePopupWindow(); - } - var nX = 0; - var nY = 0; - var nHeight = 300; - var nWidth = 400; - if (width > 0 && height > 0) { - nHeight = height; - nWidth = width; - } - _BSPSGetClientSize(); - - nX = window.gnPopupScreenClickX; - nY = window.gnPopupScreenClickY; - - if (nY + nHeight + 40 > screen.availHeight) { - nY = screen.availHeight - nHeight - 40; - } - if (nX + nWidth + 40 > screen.availWidth) { - nX = screen.availWidth - nWidth - 40; - } - - // Launch a separate window - var strParam="titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes"; - if (gbBsNS) { - if (gbBsNS6) { - strParam += ",Height=" + nHeight + ",Width=" + nWidth; - strParam += ",screenX=" + nX + ",screenY=" + nY; - strParam += ",dependent=yes"; - } - else { - strParam += ",OuterHeight=" + nHeight + ",OuterWidth=" + nWidth; - strParam += ",screenX=" + nX + ",screenY=" + nY; - strParam += ",dependent=yes"; - } - } - else { - strParam += ",height=" + nHeight + ",width=" + nWidth; - strParam += ",left=" + nX + ",top=" + nY; - } - if (gbBsSafari) - { - if (window.gPopupWindow) - window.gPopupWindow.close(); - window.gPopupWindow = window.open(strURL, "", strParam); - window.gPopupWindow.name = gstrPopupSecondWindowName; - window.gPopupWindow.moveTo(nX, nY); - widnow.gPopupWindow.document.location.reload(); - } - else - { - var wmTemp=null; - if (gbBsKonqueror3) - { - if (window.gPopupWindow) - window.gPopupWindow.close(); - } - if (gbBsOpera&&gbBsMac) - { - wmTemp= window.open(document.location.href, "Temp", strParam); - } - window.gPopupWindow = window.open(strURL, gstrPopupSecondWindowName, strParam); - if (!gbBsIE) - window.gPopupWindow.focus(); - - if (wmTemp) - wmTemp.close(); - } - - if (gbBsNS4) - setEventHandle(); - else if (gbBsIE4 || gbBsOpera7||gbBsKonqueror3) - setTimeout("setPopupFocus();", 100); - } - return; -} - -function setEventHandle() -{ - window.gPopupWindow.captureEvents(Event.CLICK | Event.BLUR); - window.gPopupWindow.onclick = NonIEPopup_HandleClick; - window.gPopupWindow.onblur = NonIEPopup_HandleBlur; -} - -function setPopupFocus() -{ - window.gPopupWindow.focus(); -} - -function NonIEPopup_HandleBlur(e) -{ - window.gPopupWindow.focus(); -} - -function NonIEPopup_HandleClick(e) -{ - // Because navigator will give the event to the handler before the hyperlink, let's - // first route the event to see if we are clicking on a Popup menu in a popup. - document.routeEvent(e); - - // If a popup menu is active then don't do anything with the click - if (window.gPopupWindow.gbInPopupMenu) { - window.gPopupWindow.captureEvents(Event.CLICK); - window.gPopupWindow.onclick = NonIEPopup_HandleClick; - return false; - } - - // Close the popup window - if(e.target.href) - { - if(e.target.href.indexOf("javascript:")==-1) - { - if (e.target.target=="") - window.location.href = e.target.href; - else - window.open(e.target.href, e.target.target); - this.close(); - } - } - else - this.close(); - return false; -} - -function BSSCPopup_AfterLoad(nIndex, nToken, cuswidth, cusheight) -{ - if (!window.getPopupIFrame(nIndex).document) { - _BSSCPopup2(getPopupURL(nIndex), cuswidth, cusheight); - return; - } - - if (!IsValidToken(nToken)) return; - - if (gbBsNS6) - { - setAbsPopupURL(nIndex, window.getPopupIFrame(nIndex).document.location.href); // change URL to abs url. - BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight); - return; - } - - if ((window.getPopupIFrame(nIndex).document.readyState == "complete") && - (window.getPopupIFrame(nIndex).document.body != null)) { - if (window.getPopupIFrame(nIndex).document.location.href.indexOf("about:blank") != -1) { // add this check. IE will use about:blank" as the default vaule for Iframe. - window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex); - setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200); - } - else - { - setAbsPopupURL(nIndex, window.getPopupIFrame(nIndex).document.location.href); // change URL to abs url. - BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight); - } - } else { - setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200); - } -} - -function BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight) -{ - if (window.gbPopupTimeoutExpired) return; - - if (!IsValidToken(nToken)) return; - - getPopupDivStyle(nIndex).visibility = gBsStyVisHide; - getPopupIFrameStyle(nIndex).visibility = gBsStyVisHide; - - // Determine the width and height for the window - _BSPSGetClientSize(); - - var size = new BSSCSize(0, 0); - - if (cuswidth <= 0 || cusheight <= 0) - BSSCGetContentSize(window.getPopupIFrame(nIndex), size); - else { - size.x = cuswidth; - size.y = cusheight; - } - - // Determine the width and height for the window - var nWidth = size.x; - var nHeight = size.y; - - // for small popup size, we should allow any size. - // The popup size should be ok if bigger than 0 - if (nWidth < 0 || nHeight < 0) return; // there must be something terribly wrong. - - getPopupDivStyle(nIndex).width = nWidth; - getPopupDivStyle(nIndex).height = nHeight; - - getPopupShadowStyle(nIndex).width = nWidth; - getPopupShadowStyle(nIndex).height = nHeight; - getPopupTopicStyle(nIndex).width = nWidth; - getPopupTopicStyle(nIndex).height = nHeight; - if (gbBsIE55) - { - getPopupShadowStyle(nIndex).width = nWidth + 2; - getPopupShadowStyle(nIndex).height = nHeight + 2; - getPopupTopicStyle(nIndex).width = nWidth + 2; - getPopupTopicStyle(nIndex).height = nHeight + 2; - } - - getPopupIFrameStyle(nIndex).width = nWidth; - getPopupIFrameStyle(nIndex).height = nHeight; - if (gbBsIE55 || gbBsNS6) - { - getPopupIFrameStyle(nIndex).top = 0; - getPopupIFrameStyle(nIndex).left = 0; - } - - var strURL = getPopupURL(nIndex); - if (strURL.indexOf("#") != -1&&gbBsNS6) - getPopupIFrame(nIndex).location.reload(); - else if (strURL.indexOf("#") != -1||gbBsNS6) - getPopupIFrame(nIndex).location.href = strURL; // reload again, this will fix the bookmark misunderstand in IE5. - - MoveDivAndShow(nIndex, nToken, cuswidth, cusheight); -} - -function getScrollLeft() -{ - if (document.body.scrollLeft) - return document.body.scrollLeft; - else if (window.pageXOffset) - return window.pageXOffset; - else - return 0; -} - -function getScrollTop() -{ - if (document.body.scrollTop) - return document.body.scrollTop; - else if (window.pageYOffset) - return window.pageYOffset; - else - return 0; -} - - -function MoveDivAndShow(nIndex, nToken, cuswidth, cusheight) -{ - if (window.getPopupIFrame(nIndex).document.location.href != getAbsPopupURL(nIndex)) { // if redirect, reload again. - window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex); - setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200); - return; - } - - // Determine the position of the window - var nClickX = window.gnPopupClickX; - var nClickY = window.gnPopupClickY; - var nTop = 0; - var nLeft = 0; - - var nWidth = parseInt(getPopupDivStyle(nIndex).width); - var nHeight = parseInt(getPopupDivStyle(nIndex).height); - - if (nClickY + nHeight + 20 < gBsClientHeight + getScrollTop()) { - nTop = nClickY + 10; - } else { - nTop = (getScrollTop() + gBsClientHeight) - nHeight - 20; - } - if (nClickX + nWidth < gBsClientWidth + getScrollLeft()) { - nLeft = nClickX; - } else { - nLeft = (getScrollLeft() + gBsClientWidth) - nWidth - 8; - } - - if (nTop < getScrollTop()) nTop = getScrollTop() + 1; - if (nLeft< getScrollLeft()) nLeft = getScrollLeft() + 1; - - getPopupDivStyle(nIndex).left = nLeft; - getPopupDivStyle(nIndex).top = nTop; - - // Set the location of the background blocks - getPopupShadowStyle(nIndex).left = 6; - getPopupShadowStyle(nIndex).top = 6; - if (gbBsIE55) - { - getPopupShadowStyle(nIndex).left = 4; - getPopupShadowStyle(nIndex).top = 4; - } - - if (gbBsMac&&gbBsIE4) { - // Total hack on the iMac to get the IFrame to position properly - getPopupIFrameStyle(nIndex).pixelLeft = 100; - getPopupIFrameStyle(nIndex).pixelLeft = 0; - // Explicitly call BSSCOnLoad because the Mac doesn't seem to do it - getPopupIFrame(nIndex).window.BSSCOnLoad(); - } - - if (gbBsNS6&&IsDirty(nIndex)) - getElement(getPopupIFrameID(nIndex)).addEventListener("load", handleLoadNS, false); - else - BSSCPopup_Timeout(nIndex , nToken ); - return; -} - -function BSSCSize(x, y) -{ - this.x = x; - this.y = y; -} - -function BSSCGetContentSize(thisWindow, size) -{ - if (!gbBsIE4 && !gbBsOpera7 && !gbBsNS4) - return; - - if ((gbBsMac&&gbBsIE4)||gbBsNS4||gbBsOpera7) { - size.x = 320; - size.y = 180; - return; - } - - // Resize the width until it is wide enough to handle the content - // The trick is to start wide and determine when the scrollHeight changes - // because then we know a scrollbar is necessary. We can then go back - // to the next widest size (for no scrollbar) - - var ClientRate = gBsClientHeight / gBsClientWidth; - - - var GoldenSize = new BSSCSize(0,0); - GoldenSize.x = gBsClientWidth * gBMaxXOfParent; - GoldenSize.y = gBsClientHeight *gBMaxYOfParent ; - - if (ClientRate > gBRateH_W) { - GoldenSize.y = GoldenSize.x * gBRateH_W; - } - else { - GoldenSize.x = GoldenSize.y / gBRateH_W; - } - - // Try to using parent specified max x. - var x = 0; - var maxgoldx = GoldenSize.x; - var maxx = gBsClientWidth * gBMaxXOfParent; - - // This double resize causes the document to re-render (and we need it to) - if (!gbBsIE5) - thisWindow.moveTo(10000,10000); // this is used to fix the flash on IE4. - - thisWindow.resizeTo(1, 1); - thisWindow.resizeTo(1, 1); - thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight); - thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight); - - var miny = thisWindow.document.body.scrollHeight + gBscrollHeight; - - if (miny > GoldenSize.y) // the popup does not fix in the parent wanted golden area. so try to expand itself as large as it can - { - thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight); - thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight); - - miny = thisWindow.document.body.scrollHeight + gBscrollHeight; - maxy = gBsClientHeight * gBMaxYOfParent; - - if (miny > maxy) { // the popup must have a scroll, OK let it be. - miny = maxy; - size.x = maxx; - size.y = maxy; - thisWindow.document.body.scroll = 'yes'; // At this time we do want to show scroll any more. so it will looks better a little. - } - else { // popup still can fit in the parent area by someway. now we choose the same h/w rate as parent. - size.y = miny; - - // downsize from maxx , now I try to using binary divide. - x = maxx; - deltax = -maxx/2; - //j = 0; - while (true) { - x = x + deltax; - thisWindow.resizeTo(x, miny); - thisWindow.resizeTo(x, miny); - diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * ClientRate; - if (diffy > gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter - deltax = Math.abs(deltax) /2; - else if (diffy < -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter - deltax = -Math.abs(deltax) /2; - else - // the y is close enough to wanted. - break; - if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore. - break; - } - size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth; - size.y = thisWindow.document.body.scrollHeight;// + gBscrollHeight; - thisWindow.document.body.scroll = 'no'; - } - } - else { - if (thisWindow.document.body.scrollWidth > maxgoldx) { - size.x = maxx; - size.y = miny; - thisWindow.document.body.scroll = 'yes'; - } - else { - // downsize from maxgoldx , now I try to using binary divide. - x = maxgoldx; - deltax = -maxgoldx/2; - while (true) { - x = x + deltax; - thisWindow.resizeTo(x, miny); - thisWindow.resizeTo(x, miny); - diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * gBRateH_W; - if (diffy > gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter - deltax = Math.abs(deltax) /2; - else if (diffy < -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter - deltax = -Math.abs(deltax) /2; - else - // the y is close enough to wanted. - break; - if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore. - break; - } - size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth; - size.y = thisWindow.document.body.scrollHeight ; - thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little. - thisWindow.resizeTo(size.x, size.y); - if (thisWindow.document.body.scrollWidth > size.x) - { - size.x = thisWindow.document.body.scrollWidth; - } - if (thisWindow.document.body.scrollHeight > size.y) - { - size.y = thisWindow.document.body.scrollHeight; - } - } - } - thisWindow.resizeTo(size.x, size.y); - thisWindow.resizeTo(size.x, size.y); - return; -} - -function BSSCPopupParentClicked() -{ - if (!window.gbPopupTimeoutExpired) { - return false; - } - - document.onmousedown = gbOrignalOnMouseDown; - - // Simply hide the popup - hideAll(); - - window.gbPopupTimeoutExpired = false; - - return true; -} - -function isInsideHyperLink(obj) -{ - if (obj&&obj!=getParentNode(obj)) - { - if (obj.tagName=="A"||obj.tagName=="IMG") - return true; - else - return isInsideHyperLink(getParentNode(obj)); - } - else - return false; -} - -function BSSCPopupClicked(e) -{ - if (!window.gbPopupTimeoutExpired) { - return false; - } - - var popupIFrame = getCurrentPopupIFrame(); - if (popupIFrame == null) { - return true; - } - - if (gbBsIE4 && (!((popupIFrame.window.event != null) && - (popupIFrame.window.event.srcElement != null) && - isInsideHyperLink(popupIFrame.window.event.srcElement)))) { - document.onmousedown = gbOrignalOnMouseDown; - - // Simply hide the popup - hideAll(); - window.gbPopupTimeoutExpired = false; - return true; - } - else if (gbBsNS6 && (!((e != null) && - (e.target!= null) && isInsideHyperLink(e.target)))) - { - document.addEventListener("mousedown", gbOrignalOnMouseDown,false); - // Simply hide the popup - hideAll(); - window.gbPopupTimeoutExpired = false; - return true; - } -} - -//trace the mouse over's position for hotspot -function BSPSPopupOnMouseOver(event) -{ - if (gbBsIE4 || gbBsOpera7||gbBsKonqueror3) { - window.gnPopupClickX = event.clientX + getScrollLeft(); - window.gnPopupClickY = event.clientY + getScrollTop(); - window.gnPopupScreenClickX = event.screenX; - window.gnPopupScreenClickY = event.screenY; - } else if (gbBsSafari) { - window.gnPopupClickX = event.clientX + getScrollLeft(); - window.gnPopupClickY = event.clientY + getScrollTop(); - window.gnPopupScreenClickX = event.screenX + window.screenX; - window.gnPopupScreenClickY = event.screenY + window.screenY; - } else if (gbBsNS4) { - window.gnPopupClickX = event.pageX - window.pageXOffset; - window.gnPopupClickY = event.pageY - window.pageYOffset; - window.gnPopupScreenClickX = event.screenX - window.pageXOffset; - window.gnPopupScreenClickY = event.screenY - window.pageYOffset; - } -} - -function BSSCHidePopupWindow() -{ - if (window.gPopupWindow != null) { - if (gbBsNS4) { - if ((typeof window.gPopupWindow != "undefined") && (!window.gPopupWindow.closed)) { - window.gPopupWindow.close(); - window.gPopupWindow = null; - } - } - } - return; -} - -// Add the PopupOnClick to the onclick array. -if (typeof(BsscRegisterOnClick) != "undefined") -{ - BsscRegisterOnClick(BsPopupOnClick); -} -//End to support previous popup functions - -/// Section End - Popup (JavaScript 1.0) - -/// Section Begin - Embedded Stub (JavaScript 1.0) - -function BSSCCreatePopupDiv() -{ - return; -} - -function WritePopupMenuLayer() -{ - if (BsscHasExtJs()) {_WritePopupMenuLayer();} -} - -function BSSCPopup(strURL, width, height) -{ - var re = new RegExp("'", 'g'); - strURL = strURL.replace(re, "%27"); - - if (BsscHasExtJs()) { - _BSSCPopup(strURL, width, height); - }else{ - //Create a temporary window first to ensure the real popup comes up on top - var wndTemp = null; - if (!gbBsNS3) { - wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4"); - } - // Create the real popup window - var wndPopup = window.open(strURL, "BSSCPopup", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400"); - // Close the temporary - if (!gbBsNS3) { - wndTemp.close(); - } else { - wndPopup.focus(); - } - } -} - -var gbWndTemp = null, gbWndPopupLinks = null; -var gbstrParaTotal = ""; - -function PopupMenu_Invoke() -{ - if (typeof(wfRelatedTopic) == 'function' && typeof(IsFlashSupported) == 'function') - { - if (Number(gsSkinVersion) > 2 && IsFlashSupported()) - { - return wfRelatedTopic(PopupMenu_Invoke.arguments); - } - } - if (BsscHasExtJs()) { - return _PopupMenu_Invoke(PopupMenu_Invoke.arguments); - } - if (gbBsNS3Before || gbBsIE3Before ) { - var argLen = PopupMenu_Invoke.arguments.length; - if (argLen < 5) { - window.document.location.href = PopupMenu_Invoke.arguments[3]; - return false; - } - gbWndTemp = null; - gbWndPopupLinks = null; - gbstrParaTotal = ""; - for (var i = 0; i < (argLen - 2) / 2; i++) { - var strParaLine = ""; - if (gbBsNS2){ - strParaLine += "" - strParaLine += PopupMenu_Invoke.arguments[2 * i + 2]; - strParaLine += ""; - } else { - strParaLine += ""); - if (gbBsNS2) { - gbWndPopupLinks.document.write(""); - } else { - //YJ: IE301,302 and NS3.x works fine - gbWndPopupLinks.document.write("<"); - gbWndPopupLinks.document.write("script>"); - gbWndPopupLinks.document.write("function gotoUrl(aUrl) {opener.window.location=aUrl; close();}"); - gbWndPopupLinks.document.write("<"); - gbWndPopupLinks.document.write("/script>"); - } - gbWndPopupLinks.document.write(""); - gbWndPopupLinks.document.write(gbstrParaTotal); - gbWndPopupLinks.document.write(""); - gbWndPopupLinks.document.close(); - - // Close the temporary - if (!gbBsNS3 && gbWndTemp != null) { - gbWndTemp.close(); - }else { - gbWndPopupLinks.focus(); - } - - return true; - } - return false; -} - -/// Section End - Embedded Stub (JavaScript 1.0) - -//// Segment End -- (JavaScript 1.0) - -//// Segment Begin -- (JavaScript 1.2) -/// Section Begin - kadov DHTM (JavaScript 1.2) - -//Begin to support extended and dropdown text effects. -function kadovIsParagraph(el) -{ - return( el.tagName == "P" || el.tagName.indexOf("H") == 0 ) ? true : false; -} - -function kadovInitEachChild(el) -{ - for(var i=0; i "") ) - child.style.setAttribute( "x-on-pageload", "" ); - } - - var href = child.getAttribute("href") - if( href != null && href > "" && href.indexOf( "BSSCPopup" ) >= 0 ) - kadovFilePopupInit(child.id); // Init for Popup - else if( child.className == "dropspot" || child.className == "expandspot" || - child.className == "glossterm" ) - kadovTextPopupInit(child.id);// Init for Expanding/Glossary or DropDown text - else if( child.className == "trigger") - kadovInitTrigger(child.id);// Init for Trigger - else - { - kadovInitEffects(child.id);// Init for DHTML effects - CEngine.SetOneTargetInitialState( child.id ); - } - } - - if( (child.tagName == "IMG") && (child.getAttribute("dynsrc") > "") ) - child.start = "mouseover";// to start a AVI file. fileopen doesn't work - - kadovInitEachChild(child); - } -} - -function kadovRetrieveTextInner(el) -{ - var x = ""; - if( (!el) || (el.tagName == "!") || (el.tagName == "SCRIPT" )) - return x; - - if( kadovIsParagraph(el) ) - { - var strNewID = " "; - if( el.id != "" ) - strNewID += "id=" + el.id + "_NewSpan "; - x = "" + el.innerHTML + ""; - } - else - { - for(var i=0; i 0 ) - if( (nTagClose - nTagOpen) != nDistance ) - return strRawHTML; - - var strCleanOnce = strRawHTML.substring(0, nTagOpen) + strRawHTML.substr(nTagClose + strTagClose.length) ; - return kadovRetrieveCleanHTML( strCleanOnce, strTagOpen, strTagClose ); -} - -function kadovAdjustObjectTag(strRawHTML, nStartPos) -{// adjust object tag for related topics HTML control, because innerHTML misses out the item settings - - //Is there any DTC? - var strDTCTagOpen = ''; - var nDTCTagOpen = strRawHTML.indexOf( strDTCTagOpen, nStartPos ); - if( nDTCTagOpen < 0 ) - return strRawHTML; - var nDTCTagClose = strRawHTML.indexOf( strDTCTagClose, nDTCTagOpen ); - if( nDTCTagClose < nDTCTagOpen) - return strRawHTML; // no Design Time Controls; - - //Is the DTC HTML Help Control? - var strRTObjTagOpen = 'classid=clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11'; - var strRTObjTagClose = ''; - var nRTObjTagOpen = strRawHTML.indexOf( strRTObjTagOpen, nDTCTagOpen ); - if( nRTObjTagOpen < nDTCTagOpen ) - return strRawHTML; - var nRTObjTagClose = strRawHTML.indexOf( strRTObjTagClose, nRTObjTagOpen ); - if( nRTObjTagClose < nRTObjTagOpen ) - return strRawHTML; // is not a HTML help control - - // Is it a related Topics html help control? - var strRTObjLabel = ''; - } - - // to insert the reconstructed item params into runtime object tag - var strAdjustedHTML = strRawHTML.substring(0,nRTObjTagClose) + strRunTimeItemParam + strRawHTML.substring(nRTObjTagClose, strRawHTML.length); - return kadovAdjustObjectTag(strAdjustedHTML, nDTCTagClose + strDTCTagClose.length); -} - -function kadovTextPopupOnLoad( el ) -{ - if( typeof(el) == "string" ) - el = getElement(el); - - var src = el.getAttribute( "x-use-popup" ); - var bNeedMove=true; - if(!src&&el.id) - { - for (var i=0;i"); - strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, ""); - - //work around the bug in HH.exe that highlight the phrases when use Search tab - //this approach is just removing the tag inserted by Microsoft in the runtime - strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "", 52); - - var strStyle = " style='display:none; position:relative;"; - var newDiv = "
" + strCleanHTML + "
"; - - removeThis(srcDiv); // empty the original DIV tag - var elParentPra = kadovFindParentParagraph(el); - if( elParentPra ) - insertAdjacentHTML(elParentPra, "afterEnd", newDiv ); - } - else if( type == "expanding" ) - { - var inner = kadovRetrieveTextInner(srcDiv); - if( inner == "" ) - inner = srcDiv.innerHTML; - var strAdjust = kadovAdjustObjectTag(inner,0); - var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, ""); - strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, ""); - var strClassName = (el.className == "glossterm") ? "glosstext" : "expandtext"; - var newSpan = ""; - removeThis(srcDiv); // empty the original DIV tag - insertAdjacentHTML(el, "afterEnd", newSpan ); - } - } - } - else - { - srcDiv.style.display = "none"; - } - return 0; -} - -function getElementsByTag(obj,sTagName) -{ - if(obj.getElementsByTagName) - return obj.getElementsByTagName(sTagName); - else if(obj.all) - return obj.all.tags(sTagName); - return null; -} - -function getElement(sID) -{ - if(document.getElementById) - return document.getElementById(sID); - else if(document.all) - return document.all(sID); - return null; -} - -function getParentNode(obj) -{ - if(obj.parentNode) - return obj.parentNode; - else if(obj.parentElement) - return obj.parentElement; - return null; -} - -function getChildNodes(obj) -{ - if(obj.childNodes) - { - var children = new Array(); - for (var i = 0; i < obj.childNodes.length; i++) - { - if (obj.childNodes[i].nodeType == 1) - children[children.length] = obj.childNodes[i]; - } - return children; - } - else if(obj.children) - return obj.children; - return null; -} - -function removeThis(obj) -{ - if(obj.parentNode) - obj.parentNode.removeChild(obj); - else - obj.outerHTML=""; -} - -function kadovTextPopup( el ) -{ - if (!gbBsIE4 && !gbBsOpera7 && !gbBsSafari && !gbBsNS6 && !gbBsKonqueror3 ) - return; - - var bNeedMove=true; - - if (window.event) - window.event.cancelBubble = true; - - if( typeof(el) == "string" ) - el = getElement(el); - - if (!el||el==window) - return; - - var src = el.getAttribute( "x-use-popup" ); - if(!src&&el.id) - { - for (var i=0;i= 0 && nNext < values.length ) - { - functions[nIdx] = values.substr( nStart, nNext-nStart+1); - nStart = nNext + 1; - nIdx++; - nNext = values.indexOf( "\)", nStart); - } - - for( var i=0; i= 0 ) - { - nPageClick = arrForClickCount[j].indexOf("="); - if( nPageClick > 0 ) - { - nClickTimes = arrForClickCount[j].substring( nPageClick + 1, arrForClickCount[j].length) * 1; - break; - } - } - } - var args = srcargs; - if( j < arrForClickCount.length ) - {// to strip out the "clicks=99" from the arguments string - args = ""; - for( var k = 0; k < arrForClickCount.length; k ++ ) - { - if( k != j ) - { - args += arrForClickCount[k]; - if( k < arrForClickCount.length - 1 ) - args += ","; - } - } - } - bsscFXInit( null, id, translatedProp, fnname, args, nClickTimes ); - } -} - -function kadovTranslateProp( prop ) -{ - switch( prop ) - { - case "x-on-hover" : return "bsschover"; - case "x-on-pageclick" : return "bsscpageclick"; - case "x-on-pageload" : return "bsscpageload"; - case "x-on-trigger-1" : return "bssctrigger1"; - case "x-on-trigger-2" : return "bssctrigger2"; - } - return null; -} -//End to convert iWrite format to RoboEditor Format for DHTML effects - -//Begin the definition of one entry to DHTML effects -function bsscFXInit( trigger_ID, target_ID, event_type, - action_type, action_setting, event_addional ) -{ - if( (!gbBsWindows && !gbBsSunOS && !(gbBsMac&&gbBsIE5)) || typeof(target_ID) != "string" )//MUST have a target_ID - return; // we don't support Navigator yet - - if( typeof(event_type) == "string" ) - event_type = event_type.toLowerCase(); - if( typeof(action_type) == "string" ) - action_type = action_type.toLowerCase(); - if( typeof(action_setting) == "string" ) - action_setting = action_setting.toLowerCase(); - - // to get the target element then add it to the target list - var eleTarget = CCSSP.GetObject( target_ID ); - if( (eleTarget != null) && (event_type != null) && (action_type != null) ) - { - CEngine.AddOneTarget( target_ID, eleTarget ); - CEngine.BuildTargetObject(target_ID, event_type, action_type, action_setting, event_addional); - } - - // to validate the trigger_ID parameter - if( typeof(trigger_ID) == "string" && trigger_ID != "" ) - CEngine.BuildTriggerObject( trigger_ID, target_ID ); -} -//End the definition of one entry to DHTML effects - -/// Section End - kadov DHTM (JavaScript 1.2) - -/// Section Begin - CCSSP DHTM (JavaScript 1.2) - -//Begin JavaScript libary for cross-platform positioning object. -function CCSSP(){} // constructor of CCSSP class - -CCSSP.GetObject = function( obj ) -{//convert object name string or reference into a valid object reference - if( typeof(obj) == "object" ) - return obj; - else if( typeof(obj) == "string" && obj != "") - { - if( gbBsNS4 ) - return eval("document." + obj); - else - return eval("document.all(\"" + obj + "\")"); - } - else - return null; -} - -CCSSP.MoveObjectTo = function(obj, x, y) -{//positioning an object at a specific pixel coordinate - if( gbBsNS4 ) - obj.moveTo(x,y); - else - { - obj.style.pixelLeft = x; - obj.style.pixelTop = y; - } -} - -CCSSP.MoveObjectBy = function(obj, dx, dy) -{//moveing a object by x and/or y pixel - if( gbBsNS4 ) - obj.moveBy(dx,dy); - else - { - obj.style.pixelLeft += dx; - obj.style.pixelTop += dy; - } -} - -CCSSP.SetObjectBGColor = function(obj, color) -{//set the background color of an object - if( gbBsNS4 ) - obj.bgColor = color; - else - obj.style.backgroundColor = color; -} - -CCSSP.ShowObject = function(obj, bShow) -{// set the object to be visible or invisible - if( gbBsNS4 ) - obj.visibility = (bShow == true) ? 'show' : 'hide'; - else - obj.style.visibility = (bShow == true) ? 'visible' : 'hidden';// when hidden, it still occupy some space. -} - -CCSSP.GetObjectLeft = function(obj) -{// retrieve the x coordinate of a posionable object - if( gbBsNS4 ) - return obj.left; - else - return obj.style.pixelLeft; -} - -CCSSP.GetObjectTop = function(obj) -{// retrieve the y coordinate of a posionable object - if( gbBsNS4 ) - return obj.top; - else - return obj.style.pixelTop; -} - -CCSSP.GetObjectContainLeft = function(obj) -{// retrieve the x coordinate of a posionable object relative to it's parent element - if( gbBsNS4 ) - return obj.pageX; - else - { - if( obj == document.body ) - return obj.clientLeft; - else - return obj.offsetLeft; - } -} - -CCSSP.GetObjectWindowLeft = function(obj) -{// retrieve the x coordinate of a posionable object relative to browser window - if( gbBsNS4 ) - return obj.pageX; - else - { - var nOffsetWindowLeft = 0; - for(var element = obj; element; element = element.offsetParent) - nOffsetWindowLeft += CCSSP.GetObjectContainLeft(element); - return nOffsetWindowLeft; - } -} - -CCSSP.GetObjectContainTop = function(obj) -{// retrieve the y coordinate of a posionable object relative to it's parent element - if( gbBsNS4 ) - return obj.pageY; - else - { - if( obj == document.body ) - return obj.clientTop; - else - return obj.offsetTop; - } -} - -CCSSP.GetObjectWindowTop = function(obj) -{// retrieve the y coordinate of a posionable object relative to browser window - if( gbBsNS4 ) - return obj.pageY; - else - { - var nOffsetWindowTop = 0; - for(var element = obj; element; element = element.offsetParent) - nOffsetWindowTop += CCSSP.GetObjectContainTop(element); - return nOffsetWindowTop; - } -} - -CCSSP.GetObjectHeight = function(obj) -{// retrieve the height of a posionable object - if( gbBsNS4 ) - return obj.clip.height; - else - return obj.offsetHeight; -} - -CCSSP.GetObjectWidth = function(obj) -{// retrieve the width of a posionable object - if( gbBsNS4 ) - return obj.clip.width; - else - return obj.offsetWidth; -} - -CCSSP.RegisterEventHandler = function( srcObj, rawEventName, funcHandler ) -{ // to add the "funcHandler" as the "rawEventName" 's handler to the "srcObj" object,the original event handler will be combined - if (gbBsNS4 && !gbBsNS6) - return ; - - var oldHandler = ""; - - if (gbBsMac &&gbBsIE4&&!gbBsIE5) - { - if (typeof(srcObj[rawEventName.toLowerCase()])=="unknown") - { //search for - - - - - - - - -

Extrusion

- -

Extrusion is a type of surface meshing by generation from discretized - lines. It is used to build mesh elements of plus one dimension than the - swept ones. Each swept 1D element produces one or more quadrangles (or - triangles if one node of a rotated element lays on the revolution axis).

- -

 

- -

To use extrusion:

- -

 

- -

1. From the Modification - menu choose the Extrusion item - or click button in the toolbar. The following dialog box - will appear:

- -

 

- -

 

- -

 

- -

2. In this dialog box you should select

- -
    - -
  • the type of elements - which will be extruded (1D or 2D),

  • - -
  • specify the IDs of - the elements which will be extruded by selecting them in the 3D viewer - or select the whole mesh or submesh,

  • - -
  • specify the vector - along which the elements will be extruded,

  • - -
  • number of steps

  • -
- -

 

- -

3. Click the Apply - or OK button.

- -

 

- -

 

- - --- - - - -
-

-

- -

 

- -
- -

 

- - - - + + + + + +Extrusion + + + + + + + + + + + + +

Extrusion

+ +

Extrusion is a type of surface meshing by generation from discretized + lines. It is used to build mesh elements of plus one dimension than the + swept ones. Each swept 1D element produces one or more quadrangles (or + triangles if one node of a rotated element lays on the revolution axis).

+ +

 

+ +

To use extrusion:

+ +

 

+ +

1. From the Modification + menu choose the Extrusion item + or click button in the toolbar. The following dialog box + will appear:

+ +

 

+ +

 

+ +

 

+ +

2. In this dialog box you should select

+ +
    + +
  • the type of elements + which will be extruded (1D or 2D),

  • + +
  • specify the IDs of + the elements which will be extruded by selecting them in the 3D viewer + or select the whole mesh or submesh,

  • + +
  • specify the vector + along which the elements will be extruded,

  • + +
  • number of steps

  • +
+ +

 

+ +

3. Click the Apply + or OK button.

+ +

 

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

 See + Also a sample TUI Script of an Extrusion + operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/extrusion_along_a_path.htm b/doc/salome/gui/SMESH/extrusion_along_a_path.htm index 1ae2b7b8b..84ecb3ced 100755 --- a/doc/salome/gui/SMESH/extrusion_along_a_path.htm +++ b/doc/salome/gui/SMESH/extrusion_along_a_path.htm @@ -1,191 +1,197 @@ - - - - - -Extrusion along a path - - - - - - - - - - - -

Extrusion along a path

- -

In principle, Extrusion along a path works in the same way as Extrusion, - the main difference is that we define not a vector, but a path of extrusion - which must be a meshed edge or wire. To get an idea of how this algorithm - works, let's see the left image, where we have a 1D circle edge and  a - 2D hexagon to be extruded along this path (in the picture they are angular - because we show the wireframe of the mesh). And now let's see the right - image, showing the result of the operation.  

- -

 

- - --- - - - -
-

-

- -

 

- -

     

- -

 

- -

To use Extrusion along a path:

- -

1. From the Modification - menu choose the Extrusion along - a path item or click button in the toolbar. The - following dialog box will appear:

- -

 

- -

- -

 

- -

2. In the dialog box you should  

- -
    - -
  • select the type of - elements which will be extruded (1D or 2D),

  • - -
  • specify the IDs of - the elements which will be extruded by selecting them in the 3D viewer - or Select the whole mesh, submesh or - group,

  • - -
  • specify the path along - which the elements will be extruded, for this you should specify the Mesh, the Shape, - and the Start point for the extrusion. -

  • -
- -

 

- -

3. There are two optional parameters, which - can be very useful.

- -
    - -
  • If the path of extrusion - is curvilinear, at each iteration the extruded shape is rotated to keep - its initial angularity to the curve. By default, the Base - point around which the shape is rotated is the mass center of the - shape, however, you can specify any point as the Base - Point and the shape will be rotated with respect to this point.

  • - -
  • The shape can also - be rotated around the path to get the resulting mesh in a helical fashion. - At the picture above we see both "oblique-angled" and "right-angled" - mesh elements because Rotation Angles - have not been set for all iterations. You set the values of the angles - at the right and add them to the list of angles at the left by pressing - the button and remove the values from the list by pressing - the button.

  • -
- -

4. Click the Apply - or OK button.

- -

 

- -

 See - Also a sample TUI Script of an Extrusion - along a Path operation.  

- -

 

- -

 

- - - - + + + + + +Extrusion along a path + + + + + + + + + + + + +

Extrusion along a path

+ +

In principle, Extrusion along a path works in the same way as Extrusion, + the main difference is that we define not a vector, but a path of extrusion + which must be a meshed edge or wire. To get an idea of how this algorithm + works, let's see the left image, where we have a 1D circle edge and  a + 2D hexagon to be extruded along this path (in the picture they are angular + because we show the wireframe of the mesh). And now let's see the right + image, showing the result of the operation.  

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

     

+ +

 

+ +

To use Extrusion along a path:

+ +

1. From the Modification + menu choose the Extrusion along + a path item or click button in the toolbar. The + following dialog box will appear:

+ +

 

+ +

+ +

 

+ +

2. In the dialog box you should  

+ +
    + +
  • select the type of + elements which will be extruded (1D or 2D),

  • + +
  • specify the IDs of + the elements which will be extruded by selecting them in the 3D viewer + or Select the whole mesh, submesh or + group,

  • + +
  • specify the path along + which the elements will be extruded, for this you should specify the Mesh, the Shape, + and the Start point for the extrusion. +

  • +
+ +

 

+ +

3. There are two optional parameters, which + can be very useful.

+ +
    + +
  • If the path of extrusion + is curvilinear, at each iteration the extruded shape is rotated to keep + its initial angularity to the curve. By default, the Base + point around which the shape is rotated is the mass center of the + shape, however, you can specify any point as the Base + Point and the shape will be rotated with respect to this point.

  • + +
  • The shape can also + be rotated around the path to get the resulting mesh in a helical fashion. + At the picture above we see both "oblique-angled" and "right-angled" + mesh elements because Rotation Angles + have not been set for all iterations. You set the values of the angles + at the right and add them to the list of angles at the left by pressing + the button and remove the values from the list by pressing + the button.

  • +
+ +

4. Click the Apply + or OK button.

+ +

 

+ +

 See + Also a sample TUI Script of an Extrusion + along a Path operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/about_hypotheses.htm b/doc/salome/gui/SMESH/files/about_hypotheses.htm index 1ed198145..449308c20 100755 --- a/doc/salome/gui/SMESH/files/about_hypotheses.htm +++ b/doc/salome/gui/SMESH/files/about_hypotheses.htm @@ -1,203 +1,213 @@ - - - - - -About hypotheses - - - - - - - - - - - - -

About hypotheses

- -

Hypotheses represent - boundary conditions which will be taken into account at calculations of - meshes or submeshes basing on geometrical objects. These hypotheses allow - you to manage the level of detail of the resulting meshes or submeshes: - when applying different hypotheses with different parameters you can preset - the quantity of meshing elements which will compose your mesh. So, it - will be possible to generate a rough or a more refined mesh or submesh. -

- -

 

- -

In MESH there are the following - Basic Hypotheses (to introduce them, you operate numerical values):

- -
    - -
  • 1D Hypotheses (for meshing of edges):

  • - -
      - -
    • Arithmetic - 1D

    • - -
    • Average - Length

    • - -
    • Deflection - 1D

    • - -
    • Number - of segments

    • - -
    • Start - and end length

    • -
    - -
  • 2D - Hypothesis (for meshing of faces): -

  • -
- - - - - -

 

- -

There also exist some Additional - Hypotheses

- -
    - -
      - -
    • Propagation of 1D Hypothesis on opposite edges

    • - -
    • Length from edges

    • - -
    • Non conform mesh allowed

    • -
    -
- -

 

- -

The choice of a hypothesis depends on:

- -
    - -
  • the geometrical object (shape) which will be meshed

  • - -
  • the algorithm, which will be selected for meshing - of this geometrical object (shape)

  • -
- -

 

- -

 

- - - - + + + + + +About hypotheses + + + + + + + + + + + + + +

About hypotheses

+ +

Hypotheses represent + boundary conditions which will be taken into account at calculations of + meshes or submeshes basing on geometrical objects. These hypotheses allow + you to manage the level of detail of the resulting meshes or submeshes: + when applying different hypotheses with different parameters you can preset + the quantity of meshing elements which will compose your mesh. So, it + will be possible to generate a rough or a more refined mesh or submesh. +

+ +

 

+ +

In MESH there are the following + Basic Hypotheses (to introduce them, you operate numerical values):

+ + + +
    + + +
+ + + +

 

+ +

There also exist some Additional + Hypotheses

+ +
    + +
      + +
    • Propagation of 1D Hypothesis on opposite edges

    • + +
    • Non conform mesh allowed

    • + +
    • Quadratic mesh

    • +
    +
+ +

 

+ +

The choice of a hypothesis depends on:

+ +
    + +
  • the geometrical object (shape) which will be meshed

  • + +
  • the algorithm, which will be selected for meshing + of this geometrical object (shape)

  • +
+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/about_meshes.htm b/doc/salome/gui/SMESH/files/about_meshes.htm index d4ba6d835..353b6a7a8 100755 --- a/doc/salome/gui/SMESH/files/about_meshes.htm +++ b/doc/salome/gui/SMESH/files/about_meshes.htm @@ -1,245 +1,250 @@ - - - - - -About meshes - - - - - - - - - - - -

About meshes

- -

MESH represents - a discretization of a geometrical CAD model into a set of entities with - a simple topology. In MESH there are two options of creation of meshes, - you can:

- -

 

- -
    - -
  • generate meshes on the basis of geometrical shapes - produced in the GEOM module,

  • - -
  • create your own meshes using the MESH functions - destined for modification of generated meshes.

  • -
- -

 

- -

The topology of a mesh is described by the relationships between its - entities including:

- -

 

- -
    - -
  • Node - – 0D element of a mesh presented by a point with coordinates (x, y, z).

  • - -
  • Edge - – 1D element of a mesh defined by two nodes.

  • - -
  • Face - – 2D element of a mesh defined by three or four edges (closed contour).

  • - -
  • Volume - – 3D element of a mesh defined by several faces.

  • -
- -

 

- -

These entities are considered as topological - entities and they don't imply any geometric representation. Only Nodes reference  geometric - representations of points with definite coordinates. The - node entity will contain  additional - information about its position in the space and its relations with the - meshed CAD model. Its position could be described in the following way:

- -

 

- -
    - -
  • 2D - position. It is a free position defined by only two coordinates - x,y.

  • - -
  • 3D - position. It is a free position defined by three coordinates x,y - and z.

  • - -
  • Surface - position. It characterizes the position of a node on a geometric - surface and is defined by the u,v position in the parametric space of - the corresponding surface.

  • - -
  • Line - position. It characterizes the position of a node on a geometric - curve and is defined by the u parameter and the corresponding curve.

  • - -
  • Vertex - position. It characterizes the position of a node on a geometric - point of the meshed CAD model and is defined by the x,y,z coordinates - of the corresponding vertex.

  • -
- -

 

- -

 

- -

Connections

- -

Each mesh entity bounds 0 or more mesh entities - of higher dimension. In the same way each mesh entity is bounded by 0 - or more mesh entities of lower dimension:

- -

 

- -
    - -
  • A node bounds edges, - faces and volumes

  • - -
  • An edge bounds faces, - and volumes

  • - -
  • A face bounds volumes

  • - -
  • A volume is bounded - by faces, edges and nodes

  • - -
  • A face is bounded by - edges, and nodes

  • - -
  • An edge is bounded by - nodes

  • -
- -

 

- -

You can notice that there are two types of - connections: inverse and direct connections.

- -

 

- -

Inverse connections

- -

 

- -

This relationship has a particularity that - the order of bounded entities has not a direct meaning. Also the number - of bounded entities is not fixed.

- -

 

- -

The edges surrounding a node. - The 3rd edge has no more sense that the 5th one.

- -

 

- -

Direct connections

- -

 

- -

This relationship has a particularity that - the order of bounding entities is meaningful. The number of bounding entities - is fixed and depends on the type of the entity (hexahedron, tetrahedron,…).

- -

 

- -

An edge is composed of two - nodes. A face is composed of 3 or 4 edges depending if we are dealing - with triangles or quadrangles.

- -

 

- -

The connections are not only restricted to - entities of one dimension higher or lower. For example some algorithms - may be interested to retrieve all the faces surrounding a node.

- -

 

- -

 

- -

 

- - - - + + + + + +About meshes + + + + + + + + + + + + +

About meshes

+ +

MESH represents + a discretization of a geometrical CAD model into a set of entities with + a simple topology. In MESH there are two options of creation of meshes, + you can:

+ +

 

+ +
    + +
  • generate meshes on the basis of geometrical shapes + produced in the GEOM module,

  • + +
  • create your own meshes using the MESH functions + destined for modification of generated meshes.

  • +
+ +

 

+ +

The topology of a mesh is described by the relationships between its + entities including:

+ +

 

+ +
    + +
  • Node + – 0D element of a mesh presented by a point with coordinates (x, y, z).

  • + +
  • Edge + – 1D element of a mesh defined by two nodes.

  • + +
  • Face + – 2D element of a mesh defined by three or four edges (closed contour).

  • + +
  • Volume + – 3D element of a mesh defined by several faces.

  • +
+ +

 

+ +

These entities are considered as topological + entities and they don't imply any geometric representation. Only Nodes reference  geometric + representations of points with definite coordinates. The + node entity will contain  additional + information about its position in the space and its relations with the + meshed CAD model. Its position could be described in the following way:

+ +

 

+ +
    + +
  • 2D + position. It is a free position defined by only two coordinates + x,y.

  • + +
  • 3D + position. It is a free position defined by three coordinates x,y + and z.

  • + +
  • Surface + position. It characterizes the position of a node on a geometric + surface and is defined by the u,v position in the parametric space of + the corresponding surface.

  • + +
  • Line + position. It characterizes the position of a node on a geometric + curve and is defined by the u parameter and the corresponding curve.

  • + +
  • Vertex + position. It characterizes the position of a node on a geometric + point of the meshed CAD model and is defined by the x,y,z coordinates + of the corresponding vertex.

  • +
+ +

 

+ +

 

+ +

Connections

+ +

Each mesh entity bounds 0 or more mesh entities + of higher dimension. In the same way each mesh entity is bounded by 0 + or more mesh entities of lower dimension:

+ +

 

+ +
    + +
  • A node bounds edges, + faces and volumes

  • + +
  • An edge bounds faces, + and volumes

  • + +
  • A face bounds volumes

  • + +
  • A volume is bounded + by faces, edges and nodes

  • + +
  • A face is bounded by + edges, and nodes

  • + +
  • An edge is bounded by + nodes

  • +
+ +

 

+ +

You can notice that there are two types of + connections: inverse and direct connections.

+ +

 

+ +

Inverse connections

+ +

 

+ +

This relationship has a particularity that + the order of bounded entities has not a direct meaning. Also the number + of bounded entities is not fixed.

+ +

 

+ +

The edges surrounding a node. + The 3rd edge has no more sense that the 5th one.

+ +

 

+ +

Direct connections

+ +

 

+ +

This relationship has a particularity that + the order of bounding entities is meaningful. The number of bounding entities + is fixed and depends on the type of the entity (hexahedron, tetrahedron,…).

+ +

 

+ +

An edge is composed of two + nodes. A face is composed of 3 or 4 edges depending if we are dealing + with triangles or quadrangles.

+ +

 

+ +

The connections are not only restricted to + entities of one dimension higher or lower. For example some algorithms + may be interested to retrieve all the faces surrounding a node.

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/about_meshing_algorithms.htm b/doc/salome/gui/SMESH/files/about_meshing_algorithms.htm index ecc8de1c2..acfdedf3d 100755 --- a/doc/salome/gui/SMESH/files/about_meshing_algorithms.htm +++ b/doc/salome/gui/SMESH/files/about_meshing_algorithms.htm @@ -1,222 +1,227 @@ - - - - - -About meshing algorithms - - - - - - - - - - - - -

Defining meshing algorithms

- -

The MESH module contains a set of meshing algorithms, - which are used for meshing entities (1D, 2D, 3D) composing geometrical - objects. They are as follows:

- -

 

- -
    - -
  • For meshing of 1D entities (edges):

  • -
- -

 

- -
    - -
      - -
    • Wire Discretization meshing algorithm

    • -
    -
- -

 

- -
    - -
  • For meshing of 2D entities (faces):

  • -
- -

 

- -
    - -
      - -
    • Triangle meshing algorithm - Faces are split - into triangular elements.

    • - -
    • Quadrangle meshing algorithm - Faces are split - into quadrangular elements.

    • -
    -
- -

 

- - --- - - - -
-

-

- -

 

- -

 

- -
    - -
  • For meshing of 3D entities (volume - objects):

  • -
- -

 

- -
    - -
      - -
    • Hexahedron meshing algorithm - Volumes are - split into hexahedral (cubic) elements.

    • - -
    • Tetrahedron (Netgen) meshing algorithm - Volumes - are split into tetrahedral (pyramidal) elements.

    • -
    -
- -

 

- - --- - - - -
-

-

- -

 

- -

To apply a meshing algorithm:

- -

Select this algorithm in the Create Mesh dialog box.

- -

 

- -

See Also - a sample TUI Script of a Define - Meshing Algorithm operation.  

- -

 

- - - - + + + + + +About meshing algorithms + + + + + + + + + + + + + +

Defining meshing algorithms

+ +

The MESH module contains a set of meshing algorithms, + which are used for meshing entities (1D, 2D, 3D) composing geometrical + objects. They are as follows:

+ +

 

+ +
    + +
  • For meshing of 1D entities (edges):

  • +
+ +

 

+ +
    + +
      + +
    • Wire Discretization meshing algorithm

    • +
    +
+ +

 

+ +
    + +
  • For meshing of 2D entities (faces):

  • +
+ +

 

+ +
    + +
      + +
    • Triangle meshing algorithm - Faces are split + into triangular elements.

    • + +
    • Quadrangle meshing algorithm - Faces are split + into quadrangular elements.

    • +
    +
+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

 

+ +
    + +
  • For meshing of 3D entities (volume + objects):

  • +
+ +

 

+ +
    + +
      + +
    • Hexahedron meshing algorithm - Volumes are + split into hexahedral (cubic) elements.

    • + +
    • Tetrahedron (Netgen) meshing algorithm - Volumes + are split into tetrahedral (pyramidal) elements.

    • +
    +
+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

To apply a meshing algorithm:

+ +

Select this algorithm in the Create Mesh dialog box.

+ +

 

+ +

See Also + a sample TUI Script of a Define + Meshing Algorithm operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/about_quality_controls.htm b/doc/salome/gui/SMESH/files/about_quality_controls.htm index f52da280f..e8bd41667 100755 --- a/doc/salome/gui/SMESH/files/about_quality_controls.htm +++ b/doc/salome/gui/SMESH/files/about_quality_controls.htm @@ -1,168 +1,175 @@ - - - - - -About quality controls - - - - - - - - - - - -

About quality controls

- -

Mesh - quality control in MESH is destined for visual control of the generated - mesh.

- -

Application of a definite quality control - consists of usage of the corresponding algorithm, which calculates a value - of a definite geometric characteristic (Area, Length of edges, etc) for - all meshing elements, composing your mesh. Then all meshing elements are - colored according the calculated values. The reference between the coloring - of the meshing elements and these calculated values is shown with the - help of a scalar bar, which is displayed near the presentation of your - mesh.      

- -

 

- -

There are 1D, 2D and 3D quality controls. -

- -

  

- -

1D mesh quality controls:

- -

 

- - - -

 

- -

2D mesh quality controls:

- -

 

- - - - - -

 

- -

3D mesh quality controls:

- -

 

- - - -

 

- - - - + + + + + +About quality controls + + + + + + + + + + + + +

About quality controls

+ +

Mesh + quality control in MESH is destined for visual control of the generated + mesh.

+ +

Application of a definite quality control + consists of usage of the corresponding algorithm, which calculates a value + of a definite geometric characteristic (Area, Length of edges, etc) for + all meshing elements, composing your mesh. Then all meshing elements are + colored according the calculated values. The reference between the coloring + of the meshing elements and these calculated values is shown with the + help of a scalar bar, which is displayed near the presentation of your + mesh.      

+ +

 

+ +

There are 1D, 2D and 3D quality controls. +

+ +

  

+ +

1D mesh quality controls:

+ +

 

+ + + +

 

+ +

2D mesh quality controls:

+ +

 

+ + + + + +

 

+ +

3D mesh quality controls:

+ +

 

+ + + +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/adding_nodes_and_elements.htm b/doc/salome/gui/SMESH/files/adding_nodes_and_elements.htm index 420454e40..014d6120d 100755 --- a/doc/salome/gui/SMESH/files/adding_nodes_and_elements.htm +++ b/doc/salome/gui/SMESH/files/adding_nodes_and_elements.htm @@ -1,291 +1,303 @@ - - - - - -Adding nodes and elements - - - - - - - - - - - -

Adding nodes and elements

- -

In SMESH you can add to your mesh different elements such as:

- -

 

- - - -

 

- -

To add a node or an element to your mesh:

- -

 

- -

1. Select your mesh in the Object Browser - or in the 3D viewer.

- -

 

- -

2. From the Modification - menu choose the Add item, - the following associated submenu will appear:

- -

 

- -

- -

 

- -

 

- -

From this submenu select the type of element - which you would like to add to your mesh.

- -

 

- -

  See - Also sample TUI Scripts of  Adding - Nodes and Elements operations. -  

- -

 

- -

Adding nodes

- -

     

- -

 

- -

In this dialog box set coordinates for your - node in the Coordinates set of - fields and click the Apply or - OK button. Your node will be created:

- -

 

- -

Adding edges

- -

 

- -

      

- -

 

- -

In this dialog box specify the nodes which - will form your edge by selecting them in the 3D viewer with pressed Shift - button and click the Apply or - OK button. Your edge will be created:

- -

 

- -

Adding triangles

- -

 

- -

        

- -

 

- -

In this dialog box specify the nodes which - will form your triangle by selecting them in the 3D viewer with pressed - Shift button and click the Apply or - OK button. Your triangle will - be created:

- -

 

- -

Adding quadrangles

- -

        

- -

In this dialog box specify the nodes which - will form your quadrangle by selecting them in the 3D viewer with pressed - Shift button and click the Apply or - OK button. Your quadrangle will - be created:

- -

 

- -

Adding polygons

- -

          

- -

In this dialog box specify the nodes which - will form your polygon by selecting them in the 3D viewer with pressed - Shift button and click the Apply or - OK button.

- -

 

- -

Adding tetrahedrons

- -

- -

 

- -

In this dialog box specify the nodes which - will form your tetrahedron by selecting them in the 3D viewer with pressed - Shift button and click the Apply or - OK button. Your tetrahedron will - be created:

- -

 

- -

- -

Adding hexahedrons

- -

- -

 

- -

In this dialog box specify the nodes which - will form your hexahedron by selecting them in the 3D viewer with pressed - Shift button and click the Apply or - OK button. Your hexahedron will - be created:

- -

 

- -

 

- -

- -

 

- -

Adding polyhedrons

- -

        

- -

 

- -

There are two different ways to add polyhedral - volumes.

- -

If you select Node - as Elements Type you will specify - the nodes which will form the faces of your polyhedron by selecting the - nodes in the 3D viewer with pressed Shift button and clicking the Add button to add the face in the list - of Faces by Nodes, which will form your polyhedron. Note, that it could - be very useful to toggle Polyhedron Preview checkbox to see the results - of your selection.

- -

The second way is somewhat simpler, however, - there are cases when it does not provide you with the necessary level - of precision. If you select Face - as Elements Type, you will be - able to select the faces  which - will form your polyhedron in the 3D viewer with pressed Shift button. - If you've managed to

- -

obtain the necessary result, click the Apply or OK - button. Your hexahedron will be - created.

- -

 

- -

 

- -

 

- - - - + + + + + +Adding nodes and elements + + + + + + + + + + + + +

Adding nodes and elements

+ +

In MESH you can add to your mesh different elements such as:

+ +

 

+ + + +

 

+ +

To add a node or an element to your mesh:

+ +

 

+ +

1. Select your mesh in the Object Browser + or in the 3D viewer.

+ +

 

+ +

2. From the Modification + menu choose the Add item, + the following associated submenu will appear:

+ +

 

+ +

+ +

 

+ +

From this submenu select the type of element + which you would like to add to your mesh.

+ +

 

+ +

  See + Also sample TUI Scripts of  Adding + Nodes and Elements operations. +  

+ +

 

+ +

Adding nodes

+ +

    

+ +

 

+ +

 

+ +

 

+ +

In this dialog box set coordinates for your + node in the Coordinates set of + fields and click the Apply or + OK button. Your node will be created:

+ +

 

+ +

Adding edges

+ +

 

+ +

      

+ +

 

+ +

In this dialog box specify the nodes which + will form your edge by selecting them in the 3D viewer with pressed Shift + button and click the Apply or + OK button. Your edge will be created:

+ +

 

+ +

Adding triangles

+ +

 

+ +

        

+ +

 

+ +

In this dialog box specify the nodes which + will form your triangle by selecting them in the 3D viewer with pressed + Shift button and click the Apply or + OK button. Your triangle will + be created:

+ +

 

+ +

Adding quadrangles

+ +

        

+ +

In this dialog box specify the nodes which + will form your quadrangle by selecting them in the 3D viewer with pressed + Shift button and click the Apply or + OK button. Your quadrangle will + be created:

+ +

 

+ +

Adding polygons +

+ +

          

+ +

In this dialog box specify the nodes which + will form your polygon by selecting them in the 3D viewer with pressed + Shift button and click the Apply or + OK button.

+ +

 

+ +

Adding tetrahedrons

+ +

+ +

 

+ +

In this dialog box specify the nodes which + will form your tetrahedron by selecting them in the 3D viewer with pressed + Shift button and click the Apply or + OK button. Your tetrahedron will + be created:

+ +

 

+ +

+ +

Adding hexahedrons

+ +

+ +

 

+ +

In this dialog box specify the nodes which + will form your hexahedron by selecting them in the 3D viewer with pressed + Shift button and click the Apply or + OK button. Your hexahedron will + be created:

+ +

 

+ +

 

+ +

+ +

 

+ +

Adding polyhedrons

+ +

        

+ +

 

+ +

There are two different ways to add polyhedral + volumes.

+ +

If you select Node + as Elements Type you will specify + the nodes which will form the faces of your polyhedron by selecting the + nodes in the 3D viewer with pressed Shift button and clicking the Add button to add the face in the list + of Faces by Nodes, which will form your polyhedron. Note, that it could + be very useful to toggle Polyhedron Preview checkbox to see the results + of your selection.

+ +

The second way is somewhat simpler, however, + there are cases when it does not provide you with the necessary level + of precision. If you select Face + as Elements Type, you will be + able to select the faces  which + will form your polyhedron in the 3D viewer with pressed Shift button. + If you've managed to

+ +

obtain the necessary result, click the Apply or OK + button. Your hexahedron will be + created.

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/area_of_elements.htm b/doc/salome/gui/SMESH/files/area_of_elements.htm index d92aa5ef3..5947a248c 100755 --- a/doc/salome/gui/SMESH/files/area_of_elements.htm +++ b/doc/salome/gui/SMESH/files/area_of_elements.htm @@ -1,133 +1,138 @@ - - - - - -Area of elements - - - - - - - - - - - - -

Area

- -

Area mesh quality - control is based on the algorithm of area calculation of  meshing - elements . It can be applied to meshes consisting of 2D meshing elements - with 3 and 4 nodes (triangles and quadrangles).    

- -

 

- -

To apply the Area quality control to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Area or click button. Your mesh will be displayed - in the viewer with its elements colored according to the applied mesh - quality control criterion:

- -

 

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of an Area - quality control operation.  

- -

 

- -

 

- - - - + + + + + +Area of elements + + + + + + + + + + + + + +

Area

+ +

Area mesh quality + control is based on the algorithm of area calculation of  meshing + elements. It can be applied to meshes consisting of 2D meshing elements + with 3 and 4 nodes (triangles and quadrangles).    

+ +

 

+ +

To apply the Area quality control to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Area or click button. Your mesh will be displayed + in the viewer with its elements colored according to the applied mesh + quality control criterion:

+ +

 

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of an Area + quality control operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/arithmetic_1d.htm b/doc/salome/gui/SMESH/files/arithmetic_1d.htm index ead4f03b7..e6cac0059 100755 --- a/doc/salome/gui/SMESH/files/arithmetic_1d.htm +++ b/doc/salome/gui/SMESH/files/arithmetic_1d.htm @@ -1,254 +1,330 @@ - - - - - -Arithmetic 1D - - - - - - - - - - - - -

1D Meshing Hypotheses

- -

Arithmetic 1D hypothesis

- -

Arithmetic 1D hypothesis allows - to split edges into segments with a length that changes in arithmetic - progression (Lk = Lk-1 + d) beginning from a given starting length and - up to a given end length.

- -

 

- -

     

- -

 

- -

See Also - a sample TUI Script of a Defining - Arithmetic 1D hypothesis operation.  

- -

Deflection 1D hypothesis

- -

Deflection ID hypothesis can - be applied for meshing curvilinear edges composing your geometrical object. - It uses only one parameter: the value of deflection.  

- -

A geometrical edge is divided into equal segments. The maximum distance - between a point on the edge within a segment and the line connecting the - ends of the segment should not exceed the specified value of deflection - . Then mesh nodes are constructed at end segment locations and 1D mesh - elements are constructed on segments.

- -

 

- -

      

- -

 

- -

See Also - a sample TUI Script of a Defining - Deflection 1D hypothesis operation.  

- -

 

- -

- -

Average Length hypothesis

- -

Average Length hypothesis can - be applied for meshing of edges composing your geometrical object. Definition - of this hypothesis consists of setting the length - of segments, which will split these edges. The points on the edges generated - by these segments will represent nodes of your mesh. Later these nodes - will be used for meshing of the faces abutting to these edges.

- -

 

- -

       

- -

 

- -

See Also - a sample TUI Script of a Defining - Average Length hypothesis operation.  

- -

 

- -

- -

Number of segments hypothesis

- -

Number of segments hypothesis - can be applied for meshing of edges composing your geometrical object. - Definition of this hypothesis consists of setting the number - of segments, which will split these edges. In other words your edges will - be split into a definite number of segments with approximately the same - length. The points on the edges generated by these segments will represent - nodes of your mesh. Later these nodes will be used for meshing of the - faces abutting to these edges.

- -

 

- -

You can set the type of distribution for this - hypothesis in the Hypothesis Construction - dialog bog :

- -

 

- -

Equidistant - Distribution - all segments will have the same length

- -

         

- -

 

- -

Scale Distribution - each - next segment differs from the previous according to the formula: - Ai+1 = Ai - * k, where k is - Scale Factor

- -

\

- -

 

- -

Distribution with Table Density - you - input a number of pairs t - F(t) and - the program computes the formula, which will rule the change of length - of segments.

- -

 

- -

- -

 

- -

Distribution with Analytic Density - you input the formula, which will rule the - change of length of segments

- -

- -

See Also - a sample TUI Script of a Defining - Number of Segments hypothesis operation.  

- -

 

- -

Start and End Length hypothesis.

- -

Start and End Length hypothesis - allows to divide a geometrical edge into segments so that the first and - the last segments have a specified length. The length of each but the - first segment differs from length of the previous one by a constant factor. - Then mesh nodes are constructed at segment ends location and 1D mesh elements - are constructed on them.

- -

 

- -

      

- -

 

- -

See Also - a sample TUI Script of a Defining - Start and End Length  hypothesis - operation.  

- -

 

- - - - + + + + + +Arithmetic 1D + + + + + + + + + + + + + +

1D Meshing Hypotheses

+ + + +

Arithmetic 1D hypothesis

+ +

Arithmetic 1D hypothesis allows + to split edges into segments with a length that changes in arithmetic + progression (Lk = Lk-1 + d) beginning from a given starting length and + up to a given end length.

+ +

 

+ +

     

+ +

 

+ +

See Also + a sample TUI Script of a Defining + Arithmetic 1D hypothesis operation.  

+ +

Deflection 1D hypothesis

+ +

Deflection ID hypothesis can + be applied for meshing curvilinear edges composing your geometrical object. + It uses only one parameter: the value of deflection.  

+ +

A geometrical edge is divided into equal segments. The maximum distance + between a point on the edge within a segment and the line connecting the + ends of the segment should not exceed the specified value of deflection + . Then mesh nodes are constructed at end segment locations and 1D mesh + elements are constructed on segments.

+ +

 

+ +

      

+ +

 

+ +

See Also + a sample TUI Script of a Defining + Deflection 1D hypothesis operation.  

+ +

 

+ +

+ +

Average Length hypothesis

+ +

Average Length hypothesis can + be applied for meshing of edges composing your geometrical object. Definition + of this hypothesis consists of setting the length + of segments, which will split these edges. The points on the edges generated + by these segments will represent nodes of your mesh. Later these nodes + will be used for meshing of the faces abutting to these edges.

+ +

 

+ +

       

+ +

 

+ +

See Also + a sample TUI Script of a Defining + Average Length hypothesis operation.  

+ +

 

+ +

+ +

Number of segments hypothesis

+ +

Number of segments hypothesis + can be applied for meshing of edges composing your geometrical object. + Definition of this hypothesis consists of setting the number + of segments, which will split these edges. In other words your edges will + be split into a definite number of segments with approximately the same + length. The points on the edges generated by these segments will represent + nodes of your mesh. Later these nodes will be used for meshing of the + faces abutting to these edges.

+ +

 

+ +

You can set the type of distribution for this + hypothesis in the Hypothesis Construction + dialog bog :

+ +

 

+ +

Equidistant + Distribution - all segments will have the same length, you define + only the Number of Segments.

+ +

 

+ +

         

+ +

 

+ +

Scale Distribution - each + next segment differs from the previous according to the formula: + Ai+1 = Ai + * k, where k is + a Scale Factor.

+ +

\

+ +

 

+ +

Distribution with Table Density - you + input a number of pairs t - F(t), + where t ranges from 0 to 1, +  and + the module computes the formula, which will rule the change of length + of segments and shows the curve in the plot. You can select the Conversion + mode from Exponent + and Cut negative.

+ +

 

+ +

+ +

 

+ +

Distribution with Analytic Density - you input the formula, which will rule the + change of length of segments and the module shows the curve in the plot.

+ +

+ +

See Also + a sample TUI Script of a Defining + Number of Segments hypothesis operation.  

+ +

 

+ +

Start and End Length hypothesis.

+ +

Start and End Length hypothesis + allows to divide a geometrical edge into segments so that the first and + the last segments have a specified length. The length of each but the + first segment differs from length of the previous one by a constant factor. + Then mesh nodes are constructed at segment ends location and 1D mesh elements + are constructed on them.

+ +

 

+ +

      

+ +

 

+ +

See Also + a sample TUI Script of a Defining + Start and End Length  hypothesis + operation.  

+ +

 

+ +

Automatic Length

+ +

This hypothesis is automatically applied when you select Assign + a set of hypotheses option in Create Mesh menu.

+ +

 

+ +

+ +

 

+ +

The dialog box prompts you to define the quality of the future mesh + by only one parameter, which is Fineness, + ranging from 0 (coarse mesh, low number of elements) to 1 (extremely fine + mesh, great number of elements). Compare one and the same object (sphere) + meshed with minimum and maximum value of this parameter.

+ +

 

+ +

   

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/aspect_ratio.htm b/doc/salome/gui/SMESH/files/aspect_ratio.htm index 37b4dea75..d10a24b01 100755 --- a/doc/salome/gui/SMESH/files/aspect_ratio.htm +++ b/doc/salome/gui/SMESH/files/aspect_ratio.htm @@ -1,164 +1,212 @@ - - - - - -Aspect Ratio - - - - - - - - - - - - -

Aspect Ratio

- -

The Aspect Ratio - quality criterion for mesh elements is defined as follows:

- -

 

- -
    - -
  • For a triangle - 2D element consisting of 3 nodes the Aspect - Ratio is calculated by formula: -

     

    - -

    - -

    - -

    where :

    - -

     

    - -

    - -

     

    - -

     

    -
  • - -
  • For a quadrangle - 2D element consisting of 4 nodes  the - Aspect Ratio is the - quality of the worst triange which can be built taking three nodes of - the quadrangle. There are four triangles to consider:

  • - -

    - -
- - -

To apply the Aspect Ratio quality criterion to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Aspect Ratio or click button in the toolbar. - Your mesh will be displayed in the viewer with its elements colored according - to the applied mesh quality control criterion:

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of an Aspect - Ratio quality control operation.  

- -

 

- - - - + + + + + +Aspect Ratio + + + + + + + + + + + + + +

Aspect Ratio

+ +

The Aspect Ratio + quality criterion for mesh elements reveals the degree of conformity of + a mesh element to the regular element of its type (with all edges having + the same length).  The + criterion can be defined as

+ +

where К + is the considered element of the mesh, hmax is the diameter of the element + К (i.e. the length of the longest edge), рк is the radius of the sphere + inscribed in the element K, and a + is a normalisation value chosen so that QK = 1 when К is an equilateral + simplex.

+ +

 

+ +

The value of QK varies between 1 and +oo and the + closer it is to 1, the better the element К is.

+ +
    + +
  • The Aspect Ratio + of a triangle 2D element consisting + of 3 nodes is calculated by the formula:

  • +
+ +

 

+ +

+ +

,

+ +

 

+ +

where рк is the half perimeter of the + element K and SK is its surface.

+ +

 

+ +

+ +

 

+ +
    + +
  • The Aspect + Ratio of a quadrangle 2D + element consisting of 4 nodes is the worst (i.e. the greatest) value from + all triangles which can be built taking three nodes of the quadrangle. + There are four triangles to consider:

  • +
+ +

+ +

Note, that the Aspect Ratio criterion is + applicable to 2D mesh elements only. For 3D elements we use the Aspect + Ratio 3D criterion.   

+ +

 

+ +

To apply the Aspect Ratio quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Aspect Ratio or click button in the toolbar. + Your mesh will be displayed in the viewer with its elements colored according + to the applied mesh quality control criterion:

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of an Aspect + Ratio quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/changing_orientation_of_elements.htm b/doc/salome/gui/SMESH/files/changing_orientation_of_elements.htm index fa7317e1d..c282fe13b 100755 --- a/doc/salome/gui/SMESH/files/changing_orientation_of_elements.htm +++ b/doc/salome/gui/SMESH/files/changing_orientation_of_elements.htm @@ -1,148 +1,159 @@ - - - - - -Changing orientation of elements - - - - - - - - - - - -

Changing orientation of elements

- -

Orientation of an element is changed by reverting the order of nodes - of the selected elements.

- -

 

- -

To change orientation of elements:

- -

 

- -

1. Display a mesh or a submesh in the 3D - viewer.

- -

 

- -

2. In the Modification - menu select the Orientation item - or click button in the toolbar. The following dialog box - will appear:

- -

 

- -

 

- -

- -

 

- -

 

- -
    - -
  • The main list shall contain the - elements which will be reoriented. You can click on an element - in the 3D viewer and it will be highlighted. After that click the Add button and the ID of this element - will be added to the list. To remove a selected element or elements from - the list click the Remove button. - The Sort button allows to sort - the list of elements IDs. The Set filter - button allows to apply a definite filter to selection of elements - of your group.

  • - -
  • Apply to all radio button allows - to modify the orientation of all elements of the currently displayed mesh - or submesh.

  • - -
  • Select from set of fields allows to - choose a submesh or an existing group whose elements will be automatically - added to the list.

  • -
- -

 

- -

3. Click the Apply - or OK button to confirm - the operation.

- -

 

- - - - + + + + + +Changing orientation of elements + + + + + + + + + + + + +

Changing orientation of elements

+ +

Orientation of an element is changed by reverting the order of nodes + of the selected elements.

+ +

 

+ +

To change orientation of elements:

+ +

 

+ +

1. Display a mesh or a submesh in the 3D + viewer.

+ +

 

+ +

2. In the Modification + menu select the Orientation item + or click button in the toolbar. The following dialog box + will appear:

+ +

 

+ +

 

+ +

+ +

 

+ +

 

+ +
    + +
  • The main list shall contain the + elements which will be reoriented. You can click on an element + in the 3D viewer and it will be highlighted. After that click the Add button and the ID of this element + will be added to the list. To remove a selected element or elements from + the list click the Remove button. + The Sort button allows to sort + the list of elements IDs. The Set filter + button allows to apply a definite filter to selection of elements + of your group.

  • + +
  • Apply to all radio button allows + to modify the orientation of all elements of the currently displayed mesh + or submesh.

  • + +
  • Select from set of fields allows to + choose a submesh or an existing group whose elements will be automatically + added to the list.

  • +
+ +

 

+ +

3. Click the Apply + or OK button to confirm + the operation.

+ +

 

+ +

  See + Also a sample TUI Script of a Change + Orientation operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/constructing_groups_of_specific_elements.htm b/doc/salome/gui/SMESH/files/constructing_groups_of_specific_elements.htm index db59e9e80..0b8e2f5e6 100755 --- a/doc/salome/gui/SMESH/files/constructing_groups_of_specific_elements.htm +++ b/doc/salome/gui/SMESH/files/constructing_groups_of_specific_elements.htm @@ -1,98 +1,103 @@ - - - - - -Constructing groups of specific elements - - - - - - - - - - - -

Constructing groups of specific elements

- -

In MESH you can easily construct groups of specific elements (nodes, - edges, faces or volumes) which will be taken from a definite submesh.

- -

 

- -

To construct a group of specific elements:

- -

 

- -

Right-click on a submesh in the Object Browser - and choose the Construct Group item - or select your submesh in the Object Browser and in the Mesh - menu choose the Construct Group - item. MESH will construct several groups consisting of elements - of the definite type: nodes, edges, faces or volumes.

- - - - + + + + + +Constructing groups of specific elements + + + + + + + + + + + + +

Constructing groups of specific elements

+ +

In MESH you can easily construct groups of specific elements (nodes, + edges, faces or volumes) which will be taken from a definite submesh.

+ +

 

+ +

To construct a group of specific elements:

+ +

 

+ +

Right-click on a submesh in the Object Browser + and choose the Construct Group item + or select your submesh in the Object Browser and in the Mesh + menu choose the Construct Group + item. MESH will construct several groups consisting of elements + of the definite type: nodes, edges, faces or volumes.

+ + + + diff --git a/doc/salome/gui/SMESH/files/constructing_meshes.htm b/doc/salome/gui/SMESH/files/constructing_meshes.htm index 481c03285..1098a35d5 100755 --- a/doc/salome/gui/SMESH/files/constructing_meshes.htm +++ b/doc/salome/gui/SMESH/files/constructing_meshes.htm @@ -1,206 +1,209 @@ - - - - - -Constructing meshes - - - - - - - - - - - - -

Constructing meshes

- -

Construction of a mesh consists of:

- -

 

- -
    - -
  • Selecting a geometrical - object for meshing

  • - -
  • Applying meshing - algorithms and hypotheses which - will be used at computation of this mesh.

  • -
- -

 

- -

To construct a mesh:

- -

1. In the Mesh - menu select Create Mesh or - click button in the toolbar. The following dialog box will - appear:

- -

 

- -

- -

 

- -

2. For example, you need to mesh a 3d object. -

- -

First, type the name for your mesh in the - "Name" box, by default, it is "Mesh_1". Then select - the object you wish to mesh in the Object Browser and click - the "Add" button.

- -

Now you can define 1d Algorithm and 1d Hypotheses, - which will be applied to the edges of your object. (Note that any object - has edges, even if their existence is not apparent, for example, a sphere - has 4 edges). Click the   button to add a hypothesis. Click the button - to define values for the current hypothesis. The use of additional hypotheses - is optional (i.e. you may leave "None" in this box).   

- -

 

- -

Proceed in the same way with 2d and 3d Algorithms - and Hypotheses, note that the choice of hypotheses depends on the algorithm. - There must be one Algorithm and one or several Hypotheses for each dimension - of your object, otherwise you will not get any mesh at all. Of course, - if you wish to mesh a face, which is a 2d object, you don't need to define - 3d Algorithm and Hypotheses.

- -

In the Object - Browser the structure of the new mesh will be displayed as follows:

- -

It contains:

- -
    - -
  • a reference to the - geometrical object on the basis of which the mesh has been constructed;

  • - -
  • Applied - hypotheses folder containing the references to the hypotheses applied - to the construction of the mesh;

  • - -
  • Applied - algorithms folder containing the references to the algorithms applied - to the construction of the mesh.

  • -
- -

 

- -

There is an alternative way to create a mesh - on an object simply by clicking Assign - a set of hypotheses button and selecting between Automatic Tetrahedralization - or Hexahedralization.  The - program will automatically generate a 3D mesh with the most appropriate - settings. In the same way you can apply this functionality for meshing - 2D objects, in which case 3D algorithms are not applied.

- -

 

- -

3. Now, when everything is ready, select - your mesh in the Object Browser. -  From - the Mesh menu select Compute or click button of the toolbar.

- -

If you've done everything right, you'll obtain - something like this.

- -

Consider trying a sample script for construction - of a mesh from our TUI Scripts - section.

- -

 

- -

 

- - - - + + + + + +Constructing meshes + + + + + + + + + + + + + +

Constructing meshes

+ +

Construction of a mesh consists of:

+ +

 

+ +
    + +
  • Selecting a geometrical + object for meshing

  • + +
  • Applying meshing + algorithms and hypotheses which + will be used at computation of this mesh.

  • +
+ +

 

+ +

To construct a mesh:

+ +

1. In the Mesh + menu select Create Mesh or + click button in the toolbar. The following dialog box will + appear:

+ +

 

+ +

+ +

 

+ +

2. For example, you need to mesh a 3d object. +

+ +

First, type the name for your mesh in the + "Name" box, by default, it is "Mesh_1". Then select + the object you wish to mesh in the Object Browser and click + the "Add" button.

+ +

Now you can define 1d Algorithm and 1d Hypotheses, + which will be applied to the edges of your object. (Note that any object + has edges, even if their existence is not apparent, for example, a sphere + has 4 edges). Click the   button to add a hypothesis. Click the button + to define values for the current hypothesis. The use of additional hypotheses + is optional (i.e. you may leave "None" in this box).   

+ +

 

+ +

Proceed in the same way with 2d and 3d Algorithms + and Hypotheses, note that the choice of hypotheses depends on the algorithm. + There must be one Algorithm and one or several Hypotheses for each dimension + of your object, otherwise you will not get any mesh at all. Of course, + if you wish to mesh a face, which is a 2d object, you don't need to define + 3d Algorithm and Hypotheses.

+ +

In the Object + Browser the structure of the new mesh will be displayed as follows:

+ +

It contains:

+ +
    + +
  • a reference to the + geometrical object on the basis of which the mesh has been constructed;

  • + +
  • Applied + hypotheses folder containing the references to the hypotheses applied + to the construction of the mesh;

  • + +
  • Applied + algorithms folder containing the references to the algorithms applied + to the construction of the mesh.

  • +
+ +

 

+ +

There is an alternative way to create a mesh + on an object simply by clicking Assign + a set of hypotheses button and selecting between Automatic Tetrahedralization + or Hexahedralization.  The + program will automatically generate a 3D mesh with the most appropriate + settings. In the same way you can apply this functionality for meshing + 2D objects, in which case 3D algorithms are not applied.

+ +

 

+ +

3. Now, when everything is ready, select + your mesh in the Object Browser. +  From the + Mesh menu select + Compute or click button of the toolbar.

+ +

 

+ +

Consider trying a sample script for construction + of a mesh from our TUI Scripts + section.

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/constructing_submeshes.htm b/doc/salome/gui/SMESH/files/constructing_submeshes.htm index e09d47b80..9e0adf408 100755 --- a/doc/salome/gui/SMESH/files/constructing_submeshes.htm +++ b/doc/salome/gui/SMESH/files/constructing_submeshes.htm @@ -1,172 +1,185 @@ - - - - - -Constructing submeshes - - - - - - - - - - - - -

Constructing submeshes

- -

Construction of a submesh consists of:

- -

 

- -
    - -
  • Selecting a mesh which - will encapsulate your submesh

  • - -
  • Selecting a geometrical - object for meshing

  • - -
  • Applying one or several - previously hypotheses and meshing - algorithms which will be used at computation of this submesh.

  • -
- -

 

- -

To construct a submesh:

- -

 

- -

From the Mesh - menu select Local Hyp. or - click button in the toolbar. The following dialog box will - appear:

- -

 

- -

- -

 

- -

 

- -

In the Object Browser the structure of the - new submesh will be displayed as follows:

- -

 

- -

- -

 

- -

It contains:

- -

 

- -
    - -
  • a reference to the - geometrical object on the basis of which the submesh has been constructed;

  • - -
  • Applied - hypotheses folder containing the references to the hypotheses applied - to the construction of the submesh;

  • - -
  • Applied - algorithms folder containing the references to the algorithms applied - to the construction of the submesh.

  • -
- -

 

- -

 

- -

See Also - a sample TUI Script of a Construct - Submesh operation.  

- -

 

- - - - + + + + + +Constructing submeshes + + + + + + + + + + + + + +

Constructing submeshes

+ +

Construction of a submesh consists of:

+ +

 

+ +
    + +
  • Selecting a mesh which + will encapsulate your submesh

  • + +
  • Selecting a geometrical + object for meshing

  • + +
  • Applying one or several + previously hypotheses and meshing + algorithms which will be used at computation of this submesh.

  • +
+ +

 

+ +

To construct a submesh:

+ +

 

+ +

From the Mesh + menu select Local Hyp. or + click button in the toolbar. The following dialog box will + appear:

+ +

 

+ +

+ +

 

+ +

It allows to define the Name, + the parent Mesh and the Geometry (e.g. a face if the parent + mesh has been built on box) of the submesh. You can define algorithms + and hypotheses in the same way as in Create + mesh menu.  

+ +

 

+ +

In the Object Browser the structure of the + new submesh will be displayed as follows:

+ +

 

+ +

+ +

 

+ +

It contains:

+ +

 

+ +
    + +
  • a reference to the + geometrical object on the basis of which the submesh has been constructed;

  • + +
  • Applied + hypotheses folder containing the references to the hypotheses applied + to the construction of the submesh;

  • + +
  • Applied + algorithms folder containing the references to the algorithms applied + to the construction of the submesh.

  • +
+ +

 

+ +

 

+ +

See Also + a sample TUI Script of a Construct + Submesh operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/creating_groups.htm b/doc/salome/gui/SMESH/files/creating_groups.htm index 1a41ccd0b..1200e5969 100755 --- a/doc/salome/gui/SMESH/files/creating_groups.htm +++ b/doc/salome/gui/SMESH/files/creating_groups.htm @@ -1,269 +1,281 @@ - - - - - -Creating groups - - - - - - - - - - - - -

Creating groups

- -

  In MESH you - can create groups of elements of different types. To create a group of - elements - in the Mesh - menu select Create Group. -

- -

To create any group - you should define the following:   

- -
    - -
  • Mesh: - the name of the mesh whose elements - will form your group. You can select your mesh in the Objet Browser or - in the 3D viewer.

  • - -
  • Elements Type - set of radio buttons allows to select the type of elements which will - form your group:

  • - -
      - -
    • Nodes

    • - -
    • Edges -

    • - -
    • Faces

    • - -
    • Volumes

    • -
    - -
  • Name field allows to enter the name - of your new group.

  • -
- -

SALOME Platform distinguishes - between the two Group types: Standalone - Group and Group on Geometry. -  

- -

Standalone Group

- -

The box for creation of a Standalone - Group appears by default. Standalone - Group consists of mesh elements, which you can define in two possible - ways.

- -
    - -
  • Choosing them manually - with the mouse in the 3D Viewer. You can click on an element in the 3D - viewer and it will be highlighted. After that click the Add - button and the ID of this element will be added to the list.

  • - -
  • Applying Filters. The - Set filter button allows to apply - a definite filter to selection of the elements of your group. See more - about filters on the Selection - filter library page.   

  • -
- -

To remove a selected element or elements - from the list click the Remove button. - The Sort List button allows to - sort the list of IDs of mesh elements.

- -

Select from - set of fields allows to choose a submesh or an existing group whose - elements of the previously defined type will be added to the list of elements - which will form your group.

- -

 

- - --- - - - -
-

-

  

-

 

-

 

-

 

-

 

-

 

-

In this picture the brown cells belong to - a group defined manually.

-

 

-

  In this picture the brown cells belong to the group defined - by the criterion
-Taper > 0.

-

 

-

 

- -

 

- -

   See - Also a sample TUI Script of a Create - a Standalone Group operation.  

- -

Group on Geometry

- -

To create a group on - geometry check Group on geometry - in the Group type field. Group on geometry contains the elements - of a certain type belonging to the selected - geometrical object. To define a group select in the Objet Browser - or in the 3D viewer a geometrical object from which the elements will - be taken. After confirmation of the operation MESH will create a new group - of mesh elements.

- -

 

- - --- - - - -
-

-

In this picture the cells which belong to a certain face - are selected in green.

- -

 

- -

   See - Also a sample TUI Script of a Create - a Group on Geometry operation. -  

- -

 

- -

 

- -

 

- -

 

- -

 

- - - - + + + + + +Creating groups + + + + + + + + + + + + + +

Creating groups

+ +

  In MESH you + can create groups of elements of different types. To create a group of + elements + in the Mesh + menu select Create Group. +

+ +

To create any group + you should define the following:   

+ +
    + +
  • Mesh: + the name of the mesh whose elements + will form your group. You can select your mesh in the Objet Browser or + in the 3D viewer.

  • + +
  • Elements Type + set of radio buttons allows to select the type of elements which will + form your group:

  • + +
      + +
    • Nodes

    • + +
    • Edges +

    • + +
    • Faces

    • + +
    • Volumes

    • +
    + +
  • Name field allows to enter the name + of your new group.

  • +
+ +

SALOME Platform distinguishes + between the two Group types: Standalone + Group and Group on Geometry. +  

+ +

Standalone Group

+ +

Standalone + Group consists of mesh elements, which you can define in two possible + ways.

+ +
    + +
  • Choosing them manually + with the mouse in the 3D Viewer. You can click on an element in the 3D + viewer and it will be highlighted. After that click the Add + button and the ID of this element will be added to the list.

  • + +
  • Applying Filters. The + Set filter button allows to apply + a definite filter to selection of the elements of your group. See more + about filters on the Selection + filter library page.   

  • +
+ +

To remove a selected element or elements + from the list click the Remove button. + The Sort List button allows to + sort the list of IDs of mesh elements.

+ +

Select from + set of fields allows to choose a submesh or an existing group whose + elements of the previously defined type will be added to the list of elements + which will form your group.

+ +

Color Number + (integer only, ranging from 0 to 9999) - allows to assign to the group + a certain index, for example, defining boundary conditions. This feature + introduces a useful element of preprocessing in Mesh module. Note that + Color number attribute has nothing + to do with the colors used for the display of the elements of the group.

+ +

 

+ + +++ + + + +
+

+

  

+

 

+

 

+

 

+

 

+

 

+

In this picture the brown cells belong to + a group defined manually.

+

 

+

  In this picture the brown cells belong to the group defined + by the criterion
+Taper > 0.

+

 

+

 

+ +

 

+ +

   See + Also a sample TUI Script of a Create + a Standalone Group operation.  

+ +

Group on Geometry

+ +

To create a group on + geometry check Group on geometry + in the Group type field. Group on geometry contains the elements + of a certain type belonging to the selected + geometrical object. To define a group select in the Objet Browser + or in the 3D viewer a geometrical object from which the elements will + be taken. After confirmation of the operation a new group of mesh elements + will be created.

+ +

 

+ + +++ + + + +
+

+

In this picture the cells which belong to a certain face + are selected in green.

+ +

 

+ +

   See + Also a sample TUI Script of a Create + a Group on Geometry operation. +  

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/cutting_quadrangles.htm b/doc/salome/gui/SMESH/files/cutting_quadrangles.htm index d9b1e31e6..3ffa9a6ae 100755 --- a/doc/salome/gui/SMESH/files/cutting_quadrangles.htm +++ b/doc/salome/gui/SMESH/files/cutting_quadrangles.htm @@ -1,194 +1,208 @@ - - - - - -Cutting quadrangles - - - - - - - - - - - - -

Cutting quadrangles

- -

This operation allows to cut one or several quadrangle - elements by addition of a supplementary edge which will connect two opposite - corners.

- -

 

- -

To cut quadrangles:

- -

 

- -

1. Display a mesh or a submesh in the 3D - viewer.

- -

2. In the Modification - menu select the Cutting of quadrangles - item or click button in the toolbar. The following - dialog box will appear:

- -

 

- -

- -

 

- -
    - -
  • The main list shall contain the quadrangles - which will be cutted. You can click on an quadrangle in the 3D viewer - and it will be highlighted. After that click the Add - button and the ID of this quadrangle will be added to the list. - To remove a selected element or elements from the list click the Remove button. The Sort - button allows to sort the list of IDs. The Filter button allows to apply a definite - filter to selection of quadrangles.

  • - -
  • Apply to all radio button allows to - modify the orientation of all quadrangles of the currently displayed mesh - or submesh.

  • - -
  • Use diagonal 2-4 radio button allows - to specify the opposite corners which will be connected by the cutting - edge.

  • - -
  • Preview -

  • - -
  • Criterion menu allows to apply the operation - only to those object which meet the chosen criterion (from the list of - Quality Controls, i.e. Skew, Warping, Minimum Angle, etc.)

  • - -
  • Select from set of fields allows to - choose a submesh or an existing group whose quadrangle elements will be - automatically added to the list.

  • -
- -

 

- -

3. Click the Apply - or OK button to confirm - the operation.

- -

 

- - --- - - - -
-

-

- -

 

- -

  See - Also a sample TUI Script of a Cutting - Quadrangles operation.  

- -

 

- - - - + + + + + +Cutting quadrangles + + + + + + + + + + + + + +

Cutting quadrangles

+ +

This operation allows to cut one or several quadrangle + elements by addition of a supplementary edge which will connect two opposite + corners.

+ +

 

+ +

To cut quadrangles:

+ +

 

+ +

1. Display a mesh or a submesh in the 3D + viewer.

+ +

2. In the Modification + menu select the Cutting of quadrangles + item or click button in the toolbar. The following + dialog box will appear:

+ +

 

+ +

+ +

 

+ +
    + +
  • The + main list contains the list of + quadrangles. You can click on an quadrangle in the 3D viewer and it will + be highlighted (lock Shift keyboard button to select several quadrangles). + Click Add button and the ID of this quadrangle will be + added to the list. To remove a selected element or elements from the list + click Remove + button. Sort + list button allows to sort the + list of IDs. Filter + button allows to apply a definite + filter to the selection of quadrangles.

  • + +
  • Apply to all radio button allows to + modify the orientation of all quadrangles of the currently displayed mesh + or submesh.

  • + +
  • Preview + - provides a preview of cutting in + the viewer.

  • + +
  • Criterion

  • + +
  • Use diagonal 1-3 and + Use diagonal 2-4  allows + to specify the opposite corners which will be connected by the cutting + edge.

  • + +
  • Use + numeric factor -  allows + to apply the operation only to those objects which meet the chosen criterion + (from the list of Quality Controls, i.e. Skew, Warping, Minimum Angle, + etc.)

  • + +
  • Select + from - allows to choose a submesh or an existing group whose quadrangle + elements will be automatically added to the list.

  • +
+ +

 

+ +

3. Click the Apply + or OK button to confirm + the operation.

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

  See + Also a sample TUI Script of a Cutting + Quadrangles operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/diagonal_iversion_of_elements.htm b/doc/salome/gui/SMESH/files/diagonal_iversion_of_elements.htm index 871430041..3976832f6 100755 --- a/doc/salome/gui/SMESH/files/diagonal_iversion_of_elements.htm +++ b/doc/salome/gui/SMESH/files/diagonal_iversion_of_elements.htm @@ -1,144 +1,149 @@ - - - - - -Diagonal iversion of elements - - - - - - - - - - - -

Diagonal inversion of elements

- -

 In MESH - you can inverse the diagonal (edge) of a pseudo-quadrangle formed by two - neighboring triangles with one common edge.

- -

 

- -

To inverse the diagonal:

- -

 

- -

1. From the Modification - menu choose the Diagonal inversion - item or click button in the toolbar. The following - dialog box shall appear:

- -

 

- -

- -

 

- -

2. Enter the ID of the required edge in the - Edge  field - or select this edge in the 3D viewer.

- -

 

- -

3. Click the Apply - or OK button.

- -

 

- -

 

- - --- - - - -
-

-

- -

 

- -

  See - Also a sample TUI Script of a Diagonal - Inversion of Elements operation.  

- -

 

- - - - + + + + + +Diagonal iversion of elements + + + + + + + + + + + + +

Diagonal inversion of elements

+ +

 In MESH + you can inverse the diagonal (edge) of a pseudo-quadrangle formed by two + neighboring triangles with one common edge.

+ +

 

+ +

To inverse the diagonal:

+ +

 

+ +

1. From the Modification + menu choose the Diagonal inversion + item or click button in the toolbar. The following + dialog box shall appear:

+ +

 

+ +

+ +

 

+ +

2. Enter the ID of the required edge in the + Edge  field + or select this edge in the 3D viewer.

+ +

 

+ +

3. Click the Apply + or OK button.

+ +

 

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

  See + Also a sample TUI Script of a Diagonal + Inversion of Elements operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/displacing_nodes.htm b/doc/salome/gui/SMESH/files/displacing_nodes.htm index f90a4085c..14898fac2 100755 --- a/doc/salome/gui/SMESH/files/displacing_nodes.htm +++ b/doc/salome/gui/SMESH/files/displacing_nodes.htm @@ -1,165 +1,170 @@ - - - - - -Displacing nodes - - - - - - - - - - - - -

Moving nodes

- -

In MESH you can change the location of any node of your mesh. In this - case all adjacent elements (edges) will be also transformed right after - the displaced node.

- -

 

- -

To displace a node:

- -

 

- -

1. From the Modification - menu choose the Move node item - or click button in the toolbar. The following dialog box - shall appear:

- -

 

- -

- -

 

- -

2. Enter the ID of the required node in the - Node ID  field - or select this node in the 3D viewer. The coordinates of your node will - be automatically displayed in the Coordinates - set of fields.

- -

 

- -

3. Set new coordinates for your node in the - Coordinates set of fields.

- -

 

- -

4. Click the Apply - or OK button.

- -

 

- - --- - - - -
-

-

- -

 

- -

  See - Also a sample TUI Script of a Moving - Nodes operation.  

- -

 

- -

 

- - - - + + + + + +Displacing nodes + + + + + + + + + + + + + +

Moving nodes

+ +

In MESH you can change the location of any node of your mesh. In this + case all adjacent elements (edges) will be also transformed right after + the displaced node.

+ +

 

+ +

To displace a node:

+ +

 

+ +

1. From the Modification + menu choose the Move node item + or click button in the toolbar. The following dialog box + shall appear:

+ +

 

+ +

+ +

 

+ +

2. Enter the ID of the required node in the + Node ID  field + or select this node in the 3D viewer. The coordinates of your node will + be automatically displayed in the Coordinates + set of fields.

+ +

 

+ +

3. Set new coordinates for your node in the + Coordinates set of fields.

+ +

 

+ +

4. Click the Apply + or OK button.

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

  See + Also a sample TUI Script of a Moving + Nodes operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/displaying_nodes_numbers.htm b/doc/salome/gui/SMESH/files/displaying_nodes_numbers.htm index 4f450b7dd..94a2d5425 100755 --- a/doc/salome/gui/SMESH/files/displaying_nodes_numbers.htm +++ b/doc/salome/gui/SMESH/files/displaying_nodes_numbers.htm @@ -1,154 +1,159 @@ - - - - - -Displaying nodes numbers - - - - - - - - - - - - -

Displaying nodes numbers

- -

In MESH you can display the ID numbers of all nodes of your mesh in - the viewer.

- -

 

- -

To display ID numbers of nodes:

- -

 

- -

1. Display your mesh in the viewer

- -

 

- -

2. Right-click on the mesh in the 3D viewer - and from the associated pop-up menu choose Numbering - > Display Nodes #.

- -

 

- -

It will look like as follows:

- -

 

- -

- -

 

- -

Displaying elements numbers

- -

In MESH you can display the ID numbers of all meshing elements composing - your mesh in the viewer.

- -

 

- -

To display ID numbers of elements:

- -

 

- -

1. Display your mesh in the viewer

- -

 

- -

2. Right-click on the mesh in the 3D viewer - and from the associated pop-up menu choose Numbering - > Display Elements #.

- -

 

- -

It will look like as follows:

- -

 

- -

- -

 

- -

 

- - - - + + + + + +Displaying nodes numbers + + + + + + + + + + + + + +

Displaying nodes numbers

+ +

In MESH you can display the ID numbers of all nodes of your mesh in + the viewer.

+ +

 

+ +

To display ID numbers of nodes:

+ +

 

+ +

1. Display your mesh in the viewer

+ +

 

+ +

2. Right-click on the mesh in the 3D viewer + and from the associated pop-up menu choose Numbering + > Display Nodes #.

+ +

 

+ +

It will look like as follows:

+ +

 

+ +

+ +

 

+ +

Displaying elements numbers

+ +

In MESH you can display the ID numbers of all meshing elements composing + your mesh in the viewer.

+ +

 

+ +

To display ID numbers of elements:

+ +

 

+ +

1. Display your mesh in the viewer

+ +

 

+ +

2. Right-click on the mesh in the 3D viewer + and from the associated pop-up menu choose Numbering + > Display Elements #.

+ +

 

+ +

It will look like as follows:

+ +

 

+ +

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/editing_groups.htm b/doc/salome/gui/SMESH/files/editing_groups.htm index 505cdd9b5..adf5054d3 100755 --- a/doc/salome/gui/SMESH/files/editing_groups.htm +++ b/doc/salome/gui/SMESH/files/editing_groups.htm @@ -1,131 +1,134 @@ - - - - - -Editing groups - - - - - - - - - - - - -

Editing groups

- -

To edit an existing group of elements:

- -

 

- -

1. Select your group in the Object Browser - and in the Mesh menu click the - Edit Group item or icon in the toolbar. The following dialog box will appear:

- -

 

- -

- -

 

- -

In this dialog box you can modify the name of your group and add or remove the - elements forming it. For more information see - here.

- -

 

- -

2. Click the OK - or  Apply - button to confirm modification of the group.

- -

 

- -

See Also - a sample TUI Script of an Edit - Group operation.  

- -

 

- - - - + + + + + +Editing groups + + + + + + + + + + + + + +

Editing groups

+ +

To edit an existing group of elements:

+ +

 

+ +

1. Select your group in the Object Browser + and in the Mesh menu click the + Edit Group item or icon in the toolbar. The following dialog box will appear:

+ +

 

+ +

+ +

 

+ +

In this dialog box you can modify the name of your group and add or remove the + elements forming it. For more information see + Creating Groups page.

+ +

2. Click the OK + or  Apply + button to confirm modification of the group.

+ +

 

+ +

See Also + a sample TUI Script of an Edit + Group operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/importing_and_exporting_meshes.htm b/doc/salome/gui/SMESH/files/importing_and_exporting_meshes.htm index 6b3ecf015..5d83de11e 100755 --- a/doc/salome/gui/SMESH/files/importing_and_exporting_meshes.htm +++ b/doc/salome/gui/SMESH/files/importing_and_exporting_meshes.htm @@ -1,152 +1,157 @@ - - - - - -Importing and exporting meshes - - - - - - - - - - - - -

Importing and exporting meshes

- -

In MESH there is a functionality allowing importation/exportation - of meshes from MED, UNV - format files.

- -

 

- -

To import a mesh:

- -

 

- -

1. From the File - menu choose the Import item, from - its sub-menu select the corresponding format (MED,  UNV) - of the file containing your mesh.

- -

2. In the standard Search - File dialog box find the file for importation.

- -

3. Click the OK - button.

- -

 

- -

- -

 

- -

To export a mesh:

- -

 

- -

1. Select the object you wish to export.

- -

2. From the File - menu choose the Export item, from - its sub-menu select the format (MED, UNV) of the file which will contain - your exported mesh..

- -

3. In the standard Search - File select a location for the exported file and enter its - name.

- -

4. Click the OK - button.

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of an Export - Mesh operation.  

- - - - + + + + + +Importing and exporting meshes + + + + + + + + + + + + + +

Importing and exporting meshes

+ +

In MESH there is a functionality allowing importation/exportation + of meshes from MED, UNV + format files.

+ +

 

+ +

To import a mesh:

+ +

 

+ +

1. From the File + menu choose the Import item, from + its sub-menu select the corresponding format (MED,  UNV) + of the file containing your mesh.

+ +

2. In the standard Search + File dialog box find the file for importation.

+ +

3. Click the OK + button.

+ +

 

+ +

+ +

 

+ +

To export a mesh:

+ +

 

+ +

1. Select the object you wish to export.

+ +

2. From the File + menu choose the Export item, from + its sub-menu select the format (MED, UNV) of the file which will contain + your exported mesh..

+ +

3. In the standard Search + File select a location for the exported file and enter its + name.

+ +

4. Click the OK + button.

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of an Export + Mesh operation.  

+ + + + diff --git a/doc/salome/gui/SMESH/files/introduction_to_smesh.htm b/doc/salome/gui/SMESH/files/introduction_to_smesh.htm deleted file mode 100755 index 4bdc32545..000000000 --- a/doc/salome/gui/SMESH/files/introduction_to_smesh.htm +++ /dev/null @@ -1,195 +0,0 @@ - - - - - -Introduction to SMESH - - - - - - - - - - - -

Introduction to MESH

- -

MESH module of - SALOME is destined for:

- -

 

- -
    - -
  • import and export of meshes in MED format,

  • - -
  • meshing geometrical models previously created - or imported by the GEOM component. MESH module allows to apply 1D, 2D, - 3D meshing algorithms and a set of hypotheses:

  • - -
      - -
    • Local length

    • - -
    • Number of segments

    • - -
    • Max Element Area

    • - -
    • Max Element Volume

    • -
    - -
  • modification of locally generated meshes by

  • - -
      - -
    • Addition/deletion of nodes and elements

    • - -
    • Moving nodes and elements

    • -
    - -
  • grouping mesh elements and performing operations - on these groups

  • - -
  • quality control of meshes basing on a set of definite - criteria -

  • -
- -

- -

 

- -

for edges:

- -

 

- -
    - -
      - -
    • Length of edges

    • - -
    • Borders at multi-connections

    • - -
    • Free borders

    • -
    -
- -

 

- -

for faces:

- -

 

- -
    - -
      - -
    • Area

    • - -
    • Free edges

    • - -
    • Borders at multi-connection 2D

    • - -
    • Length 2D

    • - -
    • Minimum angle

    • - -
    • Taper

    • - -
    • Aspect Ratio

    • - -
    • Warping

    • - -
    • Skew

    • -
    -
- -

 

- -

for solids:

- -

 

- -
    - -
      - -
    • Aspect ratio 3D

    • -
    -
- -

 

- -

 

- - - - diff --git a/doc/salome/gui/SMESH/files/length_of_edges.htm b/doc/salome/gui/SMESH/files/length_of_edges.htm index 4238a5cf4..54cf22553 100755 --- a/doc/salome/gui/SMESH/files/length_of_edges.htm +++ b/doc/salome/gui/SMESH/files/length_of_edges.htm @@ -1,132 +1,137 @@ - - - - - -Length of edges - - - - - - - - - - - - -

Length 2D

- -

This quality control criterion consists of calculation - of length of the edges combining the meshing elements (triangles and quadrangles) - of your mesh.

- -

   

- -

To apply the Length 2D quality criterion to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Length 2D or click button in the toolbar. Your - mesh will be displayed in the viewer with its elements colored according - to the applied mesh quality control criterion:

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a  Length - 2D quality control operation.  

- -

 

- -

 

- -

 

- - - - + + + + + +Length of edges + + + + + + + + + + + + + +

Length 2D

+ +

This quality control criterion consists of calculation + of length of the edges combining the meshing elements (triangles and quadrangles) + of your mesh.

+ +

   

+ +

To apply the Length 2D quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Length 2D or click button in the toolbar. Your + mesh will be displayed in the viewer with its elements colored according + to the applied mesh quality control criterion:

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a  Length + 2D quality control operation.  

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/max._element_area_hypothesis.htm b/doc/salome/gui/SMESH/files/max._element_area_hypothesis.htm index e329aab17..213603d7b 100755 --- a/doc/salome/gui/SMESH/files/max._element_area_hypothesis.htm +++ b/doc/salome/gui/SMESH/files/max._element_area_hypothesis.htm @@ -1,120 +1,172 @@ - - - - - -Length from edges - - - - - - - - - - - - -

Max Element Area hypothesis

- -

Max - Element Area hypothesis is applied for meshing of 2D faces composing - your geometrical object. Definition of this hypothesis consists of setting - the maximum area of meshing elements - (depending on the chosen meshing algorithm it can be triangles - or quadrangles), which will compose - the mesh of these 2D faces.

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a Maximum - Element Area hypothesis operation.  

- -

 

- -

- - - - + + + + + +Length from edges + + + + + + + + + + + + + +

2D Meshing Hypotheses

+ + + +

Max Element Area

+ +

Max Element Area hypothesis + is applied for meshing of 2D faces composing your geometrical object. + Definition of this hypothesis consists of setting the maximum + area of meshing elements (depending on the chosen meshing algorithm + it can be triangles or quadrangles), + which will compose the mesh of these 2D faces.

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a Maximum + Element Area hypothesis operation.  

+ +

 

+ +

+ +

 

+ +

 

+ +

Length from Edges

+ +

Length from edges hypothesis + builds 2D mesh segments having a length calculated as an average edge + length for a given wire.

+ +

 

+ +

See Also + a sample TUI Script of a Length + from Edges hypothesis operation.  

+ +

 

+ +

Quadrangle Preference

+ +

This algorithm can be used only together with Quadrangle (Mapping) algorithm. + It allows to build quadrangular meshes even if the number of nodes at + the opposite edges of a meshed face is not equal, otherwise this mesh + will contain some triangular elements.

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/max._element_volume_hypothsis.htm b/doc/salome/gui/SMESH/files/max._element_volume_hypothsis.htm index 08e40aa0a..b9be27030 100755 --- a/doc/salome/gui/SMESH/files/max._element_volume_hypothsis.htm +++ b/doc/salome/gui/SMESH/files/max._element_volume_hypothsis.htm @@ -1,116 +1,122 @@ - - - - - -Non conform mesh allowed hypothesis - - - - - - - - - - - - -

Max Element Volume hypothesis

- -

Max - Element Area hypothesis is applied for meshing of 3D objects composing - your geometrical object. Definition of this hypothesis consists of setting - the maximum volume of 3D meshing - elements (depending on the chosen meshing algorithm it can be hexahedrons - or tetrahedrons), which - will compose the mesh of these 3D objects.

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a Maximum - Element Volume hypothesis operation.  

- -

 

- - - - + + + + + +Non conform mesh allowed hypothesis + + + + + + + + + + + + + +

Max Element Volume hypothesis

+ +

Max + Element Area hypothesis is applied for meshing of 3D objects composing + your geometrical object. Definition of this hypothesis consists of setting + the maximum volume of 3D meshing + elements (depending on the chosen meshing algorithm it can be hexahedrons + or tetrahedrons), which + will compose the mesh of these 3D objects.

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a Maximum + Element Volume hypothesis operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/merging_nodes.htm b/doc/salome/gui/SMESH/files/merging_nodes.htm index fd010796e..b762170ce 100755 --- a/doc/salome/gui/SMESH/files/merging_nodes.htm +++ b/doc/salome/gui/SMESH/files/merging_nodes.htm @@ -1,126 +1,131 @@ - - - - - -Merging nodes - - - - - - - - - - - -

Merging nodes

- -

This functionality allows user to detect groups of coincident - nodes with desirable tolerance, edit these groups and merge.

- -

 

- -

To merge nodes of your mesh:

- -

 

- -

1. From the Modification - choose Transformation and -  from its - sub-menu select the Merge nodes item. - The following dialog box shall appear:

- -

 

- -

- -

 

- -

This dialog box allows to create groups of - coincident nodes and to merge them.

- -

 

- -

            

- -

 

- -

 

- -

 

- -

  See - Also a sample TUI Script of a Merging - Nodes operation.  

- -

 

- - - - + + + + + +Merging nodes + + + + + + + + + + + + +

Merging nodes

+ +

This functionality allows user to detect groups of coincident + nodes with desirable tolerance, edit these groups and merge.

+ +

 

+ +

To merge nodes of your mesh:

+ +

 

+ +

1. From the Modification + choose Transformation and +  from its + sub-menu select the Merge nodes item. + The following dialog box shall appear:

+ +

 

+ +

+ +

 

+ +

This dialog box allows to create groups of + coincident nodes and to merge them.

+ +

 

+ +

            

+ +

 

+ +

 

+ +

 

+ +

  See + Also a sample TUI Script of a Merge + Nodes operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/minimum_angle.htm b/doc/salome/gui/SMESH/files/minimum_angle.htm index b63188d79..edf891759 100755 --- a/doc/salome/gui/SMESH/files/minimum_angle.htm +++ b/doc/salome/gui/SMESH/files/minimum_angle.htm @@ -1,129 +1,134 @@ - - - - - -Minimum angle - - - - - - - - - - - - -

Minimum angle

- -

Minimum angle - mesh quality criterion consists of calculation of the minimum value of - angle between two adjacent sides of a 2D meshing element (triangle or - quadrangle).

- -

 

- -

To apply the Minimum angle quality criterion to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Minimum angle or click button. Your mesh will - be displayed in the viewer with its elements colored according to the - applied mesh quality control criterion:

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a Minimum - Angle quality control operation.  

- -

 

- - - - + + + + + +Minimum angle + + + + + + + + + + + + + +

Minimum angle

+ +

Minimum angle + mesh quality criterion consists of calculation of the minimum value of + angle between two adjacent sides of a 2D meshing element (triangle or + quadrangle).

+ +

 

+ +

To apply the Minimum angle quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Minimum angle or click button. Your mesh will + be displayed in the viewer with its elements colored according to the + applied mesh quality control criterion:

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a Minimum + Angle quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/non_conform_mesh_allowed_hypothesis.htm b/doc/salome/gui/SMESH/files/non_conform_mesh_allowed_hypothesis.htm index 4704610d0..f79a74bc2 100755 --- a/doc/salome/gui/SMESH/files/non_conform_mesh_allowed_hypothesis.htm +++ b/doc/salome/gui/SMESH/files/non_conform_mesh_allowed_hypothesis.htm @@ -1,148 +1,142 @@ - - - - - -Non conform mesh allowed hypothesis - - - - - - - - - - - - -

Additional Hypotheses

- -

Additional Hypotheses can be - applied as a supplement to the main hypotheses, introducing additional - concepts to mesh creation.

- -

 

- -

To define an Additional Hypothesis - simply select it in Create Mesh - menu. These hypotheses are actually changes in the rules of mesh creation - and as such don't possess adjustable values.

- -

 

- -

Non Conform mesh allowed hypothesis

- -

Non Conform mesh allowed hypothesis - allows to generate non-conform meshes (that is, meshes having some edges - ending on an edge or face of adjacent elements).

- -

 

- -

Propagation of 1D Hypothesis on opposite edges

- -

Propagation - of 1D Hypothesis on opposite edges allows to propagate a set hypothesis - onto an opposite edge. If a local hypothesis and propagation are set on - one of edges of a quadrangular face, the opposite edge will have the same - hypothesis, unless another hypothesis has been locally set on such opposite - edge.

- -

 

- -

See Also - a sample TUI Script of a Propagation - hypothesis operation.  

- -

 

- -

Length from edges hypothesis

- -

Length from edges hypothesis - builds 1D mesh segments having a length calculated as an average edge - length for a given wire.

- -

 

- -

See Also - a sample TUI Script of a Length - from Edges hypothesis operation.  

- -

 

- -

 

- - - - + + + + + +Non conform mesh allowed hypothesis + + + + + + + + + + + + + +

Additional Hypotheses

+ +

Additional Hypotheses can be + applied as a supplement to the main hypotheses, introducing additional + concepts to mesh creation.

+ +

 

+ +

To define an Additional Hypothesis + simply select it in Create Mesh + menu. These hypotheses are actually changes in the rules of mesh creation + and as such don't possess adjustable values.

+ +

Non Conform mesh allowed hypothesis

+ +

Non Conform mesh allowed hypothesis + allows to generate non-conform meshes (that is, meshes having some edges + ending on an edge or face of adjacent elements).

+ +

Quadratic Mesh

+ +

Quadratic Mesh hypothesis allows to build a quadratic mesh (whose edges + are not straight but broken lines and can be defined by three points: + first, middle and last) instead of an ordinary one.  

+ +

Propagation of 1D Hypothesis on opposite edges

+ +

Propagation of 1D Hypothesis on opposite + edges allows to propagate a hypothesis onto an opposite edge. If + a local hypothesis and propagation are defined on an edge of a quadrangular + face, the opposite edge will have the same hypothesis, unless another + hypothesis has been locally defined on the opposite edge.

+ +

 

+ +

See Also + a sample TUI Script of a Propagation + hypothesis operation.  

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/reassigning_hypotheses_and_algorithms.htm b/doc/salome/gui/SMESH/files/reassigning_hypotheses_and_algorithms.htm index 0de684dc9..c0b0d06bc 100755 --- a/doc/salome/gui/SMESH/files/reassigning_hypotheses_and_algorithms.htm +++ b/doc/salome/gui/SMESH/files/reassigning_hypotheses_and_algorithms.htm @@ -1,141 +1,147 @@ - - - - - -Reassigning hypotheses and algorithms - - - - - - - - - - - - -

Editing Meshes

- -

After you have created a mesh or submesh with definite applied hypotheses - and algorithms you can edit your mesh by assigning - new hypotheses and algorithms or unassigning - the applied hypotheses and algorithms. The editing proceeds in - the same way as Mesh Creation. -

- -

 

- -

- -

You can also change values for the current hypothesis by clicking the - button.

- -

 

- -

See how a mesh constructed on one and the same geometrical object changes - if we apply different algorithms to it.

- -

 

- -

 

- -

 

- -

- -

 

- -

 

- -

See Also - a sample TUI Script of an Edit - Mesh operation.  

- -

 

- -

 

- -

 

- - - - + + + + + +Reassigning hypotheses and algorithms + + + + + + + + + + + + + +

Editing Meshes

+ +

After you have created a mesh or submesh with definite applied hypotheses + and algorithms you can edit your mesh by assigning + new hypotheses and algorithms or unassigning + the applied hypotheses and algorithms. The editing proceeds in + the same way as Mesh Creation. +

+ +

 

+ +

+ +

You can also change values for the current hypothesis by clicking the + button.

+ +

 

+ +

See how a mesh constructed on one and the same geometrical object changes + if we apply different algorithms to it.

+ +

 

+ +

 

+ +

 

+ +

+ +

 

+ +

 

+ +

See Also + a sample TUI Script of an Edit + Mesh operation.  

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/removing_nodes_and_elements.htm b/doc/salome/gui/SMESH/files/removing_nodes_and_elements.htm index 2a5b82210..9b720e967 100755 --- a/doc/salome/gui/SMESH/files/removing_nodes_and_elements.htm +++ b/doc/salome/gui/SMESH/files/removing_nodes_and_elements.htm @@ -1,223 +1,246 @@ - - - - - -Removing nodes and elements - - - - - - - - - - - - -

Removing nodes and elements

- -

In SMESH you can remove nodes and all types of cells of your mesh.

- -

 

- -

To remove a node:

- -

 

- -

1. Select your mesh in the Object Browser - or in the 3D viewer.

- -

 

- -

2. From the Modification - menu choose Remove and - from the associated submenu select the Remove - nodes, or just click icon in the toolbar. The - following dialog box will appear:

- -

 

- -

- -

 

- -

In this dialog box you can specify one or - several nodes (with pressed Shift button) by choosing them in the 3D viewer.

- -

 

- -

3. Click OK - or Apply  to - confirm deletion of the specified nodes.

- -

 

- -

Be careful while removing - nodes because if you remove a definite node of your mesh all adjacent - elements will be also deleted.

- -

 

- - --- - - - -
-

-

- -

 

- -

 

- -

To remove an element:

- -

 

- -

1. Select your mesh in the Object Browser - or in the 3D viewer.

- -

 

- -

2. From the Modification - menu choose Remove and - from the associated submenu select the Remove - elements, or just click icon in the toolbar. The - following dialog box will appear:

- -

 

- -

- -

 

- -

In this dialog box you can specify one or - several elements of your mesh (with pressed Shift button) by choosing - them in the 3D viewer.

- -

 

- -

3. Click OK - or Apply  to - confirm deletion of the specified elements.

- -

 

- - --- - - - -
-

-

- -

 

- -

 

- -

  See - Also a sample TUI Script of a Removing - Nodes and Elements operation.  

- -

 

- - - - + + + + + +Removing nodes and elements + + + + + + + + + + + + + +

Removing nodes and elements

+ +

In MESH you can remove nodes and all types of cells of your mesh.

+ +

 

+ + + +

 

+ +

To remove a node:

+ +

 

+ +

1. Select your mesh in the Object Browser + or in the 3D viewer.

+ +

 

+ +

2. From the Modification + menu choose Remove and + from the associated submenu select the Remove + nodes, or just click icon in the toolbar. The + following dialog box will appear:

+ +

 

+ +

+ +

 

+ +

In this dialog box you can specify one or + several nodes (with pressed Shift button) by choosing them in the 3D viewer.

+ +

 

+ +

3. Click OK + or Apply  to + confirm deletion of the specified nodes.

+ +

 

+ +

Be careful while removing + nodes because if you remove a definite node of your mesh all adjacent + elements will be also deleted.

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

 

+ +

To remove an element:

+ +

 

+ +

1. Select your mesh in the Object Browser + or in the 3D viewer.

+ +

 

+ +

2. From the Modification + menu choose Remove and + from the associated submenu select the Remove + elements, or just click icon in the toolbar. The + following dialog box will appear:

+ +

 

+ +

+ +

 

+ +

In this dialog box you can specify one or + several elements of your mesh (with pressed Shift button) by choosing + them in the 3D viewer.

+ +

 

+ +

3. Click OK + or Apply  to + confirm deletion of the specified elements.

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

 

+ +

  See + Also a sample TUI Script of a Removing + Nodes and Elements operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/renumbering_nodes_and_elements.htm b/doc/salome/gui/SMESH/files/renumbering_nodes_and_elements.htm index 49b0b0339..577cd3356 100755 --- a/doc/salome/gui/SMESH/files/renumbering_nodes_and_elements.htm +++ b/doc/salome/gui/SMESH/files/renumbering_nodes_and_elements.htm @@ -1,156 +1,176 @@ - - - - - -Renumbering nodes and elements - - - - - - - - - - - -

Renumbering nodes and elements

- -

In SMESH you can renumber the nodes and elements of your mesh.

- -

 

- -

To renumber the nodes of your mesh:

- -

 

- -

1. In the Modification - menu select Renumbering submenu - and choose the Nodes item or click - button in the toolbar. The following dialog box will - appear:

- -

 

- -

- -

 

- -

2. Fill the Mesh - field by selecting your mesh in the Object Browser or in the 3D - viewer.

- -

 

- -

3. Click the Apply - or OK button - to perform the operation.

- -

 

- -

 

- -

To renumber the elements of your mesh:

- -

 

- -

1. In the Modification - menu select Renumbering submenu - and choose the Elements item or - click button in the toolbar. The following dialog box will - appear:

- -

 

- -

- -

 

- -

2. Fill the Mesh - field by selecting your mesh in the Object Browser or in the 3D - viewer.

- -

 

- -

3. Click the Apply - or OK button - to perform the operation.

- -

 

- -

  See - Also a sample TUI Script of a Renumbering - Nodes and Elements operation. -  

- -

 

- -

 

- - - - + + + + + +Renumbering nodes and elements + + + + + + + + + + + + +

Renumbering nodes and elements

+ +

In MESH you can renumber the nodes and elements of your mesh.

+ +

 

+ + + +

 

+ +

To renumber the nodes of your mesh:

+ +

 

+ +

1. In the Modification + menu select Renumbering submenu + and choose the Nodes item or click + button in the toolbar. The following dialog box will + appear:

+ +

 

+ +

+ +

 

+ +

2. Fill the Mesh + field by selecting your mesh in the Object Browser or in the 3D + viewer.

+ +

 

+ +

3. Click the Apply + or OK button + to perform the operation.

+ +

 

+ +

 

+ +

To renumber the elements of your + mesh:

+ +

 

+ +

1. In the Modification + menu select Renumbering submenu + and choose the Elements item or + click button in the toolbar. The following dialog box will + appear:

+ +

 

+ +

+ +

 

+ +

2. Fill the Mesh + field by selecting your mesh in the Object Browser or in the 3D + viewer.

+ +

 

+ +

3. Click the Apply + or OK button + to perform the operation.

+ +

 

+ +

  See + Also a sample TUI Script of a Renumbering + Nodes and Elements operation. +  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/rotation.htm b/doc/salome/gui/SMESH/files/rotation.htm index ea4fcd6f8..2e825820b 100755 --- a/doc/salome/gui/SMESH/files/rotation.htm +++ b/doc/salome/gui/SMESH/files/rotation.htm @@ -1,137 +1,142 @@ - - - - - -Rotation - - - - - - - - - - - -

Rotation

- -

This geometrical operation allows to rotate in space your mesh or some - of its elements.

- -

 

- -

 To - rotate your mesh:

- -

 

- -

From the Modification - choose Transformation and -  from its - sub-menu select the Rotation item. - The following dialog box shall appear:

- -

 

- -

- -

 

- -

In this dialog box you can specify the elements - which should be rotated and the rotation parameters:

- -
    - -
  • Axis: - point and vector

  • - -
  • Angle - of rotation

  • -
- -

 

- -

Create a - copy radio button allows to copy the rotated object.

- -

 

- -

  See - Also a sample TUI Script of a Rotation - operation.  

- -

 

- -

  

- -

 

- - - - + + + + + +Rotation + + + + + + + + + + + + +

Rotation

+ +

This geometrical operation allows to rotate in space your mesh or some + of its elements.

+ +

 

+ +

 To + rotate your mesh:

+ +

 

+ +

From the Modification + choose Transformation and +  from its + sub-menu select the Rotation item. + The following dialog box shall appear:

+ +

 

+ +

+ +

 

+ +

In this dialog box you can specify the elements + which should be rotated and the rotation parameters:

+ +
    + +
  • Axis: + point and vector

  • + +
  • Angle + of rotation

  • +
+ +

 

+ +

Create a + copy radio button allows to copy the rotated object.

+ +

 

+ +

  See + Also a sample TUI Script of a Rotation + operation.  

+ +

 

+ +

  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/running_smesh_module.htm b/doc/salome/gui/SMESH/files/running_smesh_module.htm index 735b385ff..a00aac946 100755 --- a/doc/salome/gui/SMESH/files/running_smesh_module.htm +++ b/doc/salome/gui/SMESH/files/running_smesh_module.htm @@ -1,106 +1,111 @@ - - - - - -Running SMESH module - - - - - - - - - - - -

Running MESH module

- -

To start MESH module in SALOME click icon in the - bottom toolbar or select MESH -  from the - Choose box:                      

- -

 

- -

The desktop of the SALOME - platform will be updated with additional toolbars and menus related to - the MESH component .

- -

 

- -

- -

 

- - - - + + + + + +Running SMESH module + + + + + + + + + + + + +

Running MESH module

+ +

To start MESH module in SALOME click icon in the + bottom toolbar or select MESH +  from the + Choose box:                      

+ +

 

+ +

The desktop of the SALOME + platform will be updated with additional toolbars and menus related to + the MESH component .

+ +

 

+ +

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/sewing_meshes.htm b/doc/salome/gui/SMESH/files/sewing_meshes.htm index c281f9e76..3a461cf25 100755 --- a/doc/salome/gui/SMESH/files/sewing_meshes.htm +++ b/doc/salome/gui/SMESH/files/sewing_meshes.htm @@ -1,337 +1,342 @@ - - - - - -Sewing meshes - - - - - - - - - - - - -

Sewing meshes

- -

In SMESH you can sew elements of  different - meshes. The current functionality allows you to sew:

- -

 

- - - -

 

- -

To sew elements of different meshes:

- -

 

- -

1. From the Modification - menu choose the Transformation - item and  from - its sub-menu select the Sewing item. -

- -

2. Check in the dialog box one of the radio - buttons corresponding to the type of sewing operation you would like to - perform.

- -

3. Fill the other fields available in the - dialog box

- -

4. Click the OK - or Apply button - to perform the operation of sewing.

- -

Sew free borders

- -

This functionality allows you to unite two free borders of a 2D mesh.

- -

 

- -

For sewing free borders you should define three points on each border: - first, second and the last node:

- -

 

- -
    - -
  •  the - first node specifies beginning of the border ;

  • - -
  •  the - second node specifies the part of the border which should be considered - (as far as the free border usually forms a closed contour);

  • - -
  •  the - last node specifies the end of the border.

  • -
- -

 

- -

You can select these nodes in the 3D viewer or define by its id.

- -

 

- -

The first and the second nodes should belong to the same link of a face. - The second and the last nodes of a border can be the same. The first and - the last nodes of two borders can be the same. The corresponding end nodes - of two borders will be merged. Intermediate nodes of two borders will - be either merged or inserted into faces of the opposite border.

- -

 

- -

The sewing algorithm is as follows:

- -

 

- -

1. The parameter (U) of each node within - a border is computed. So that the first node has U=0.0, the last node - has U=1.0, for the rest nodes 0.0 < U < 1.0;

- -

2. Compare node parameters of the two borders. - If two nodes of the opposite borders have close parameters, they are merged, - i.e. a node of the first border is replaced in all elements by a node - of the second border. If a node has no node with a close parameter in - the opposite border, it is inserted into an edge of element of the opposite - border, an element is split. Two nodes are considered close enough to - merge, if difference of their parameters is less than one fifth of minimum - length of adjacent face edges on the borders.

- -

 

- -

- -

 

- -

  See - Also a sample TUI Script of a Sew - Free Borders operation.  

- -

 

- -

 

- -

Sew conform free borders

- -

This functionality can be used to unite two free borders of a 2D mesh. -

- -

 

- -

The borders of meshes for sewing are defined as for "Sew free borders" - except that the second free border is not limited and can be defined by - the first and the second nodes only. The first nodes of two borders can - be the same.

- -

 

- -

The algorithm is following: counting nodes starting at the first ones, - the n-th node of the first border is merged with the n-th node of the - other border, until the end of either of borders. Nodes of the first border - are replaced in all elements with corresponding nodes of the second border.

- -

For sewing conform free borders you should define three points on the - first border and two points on the second one. User can select these nodes - in 3D viewer or define node by its id.

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

  See - Also a sample TUI Script of a Sew - Conform Free Borders operation.  

- -

 

- -

 

- -

Sew border to side

- -

"Sew border to side" is intended to sew a free border to a - mesh surface.

- -

The free border is defined as for "Sewing of free borders". - The place where to sew the border is defined by two nodes, between which - the border faces are placed, so that the first border node is merged with - the first node on the side and the last node of the border is merged with - the second specified node on the side.

- -

 

- -

 

- -

The algorithm is following.

- -

1. Find a sequence of linked nodes on the side such that the found links - to be most co-directed with the links of the free border.

- -

2. Sew two sequences of nodes using algorithm of "Sewing of free - berders".

- -

For sewing border to side you should define three points on the border - and two points on the side. User can select these nodes in 3D viewer or - define node by its id.

- -

- -

  See - Also a sample TUI Script of a Sew - Border to Side operation.  

- -

 

- -

 

- -

Sew side elements

- -

This operation is intended to unite two mesh - surfaces.

- -

 

- -

Surfaces may be defined by either 2d or 3d elements. The number of given - elements of the sides must be the same. The sets of given elements must - be topologically equal, i.e. each node of one element set must have a - corresponding node in the other element set and corresponding nodes must - be equally linked. If there are 3d elements in a set, only their free - faces must obey to that rule.

- -

Two corresponding nodes on each side must be specified. They must belong - to one element and must be located on an element set boundary.

- -

 

- -

Sewing algorithm finds and merges the corresponding nodes starting from - the specified ones.

- -

- -

- -

For sewing side elements you should define elements for sewing and two - nodes for merging on the each side. User can select these elements and - nodes in 3D viewer or define them by its id.

- -

 

- -

See Also a sample TUI Script - of a Sew Side Elements - operation.  

- -

 

- -

 

- - - - + + + + + +Sewing meshes + + + + + + + + + + + + + +

Sewing meshes

+ +

In SMESH you can sew elements of  different + meshes. The current functionality allows you to sew:

+ +

 

+ + + +

 

+ +

To sew elements of different meshes:

+ +

 

+ +

1. From the Modification + menu choose the Transformation + item and  from + its sub-menu select the Sewing item. +

+ +

2. Check in the dialog box one of the radio + buttons corresponding to the type of sewing operation you would like to + perform.

+ +

3. Fill the other fields available in the + dialog box

+ +

4. Click the OK + or Apply button + to perform the operation of sewing.

+ +

Sew free borders

+ +

This functionality allows you to unite two free borders of a 2D mesh.

+ +

 

+ +

For sewing free borders you should define three points on each border: + first, second and the last node:

+ +

 

+ +
    + +
  •  the + first node specifies beginning of the border ;

  • + +
  •  the + second node specifies the part of the border which should be considered + (as far as the free border usually forms a closed contour);

  • + +
  •  the + last node specifies the end of the border.

  • +
+ +

 

+ +

You can select these nodes in the 3D viewer or define by its id.

+ +

 

+ +

The first and the second nodes should belong to the same link of a face. + The second and the last nodes of a border can be the same. The first and + the last nodes of two borders can be the same. The corresponding end nodes + of two borders will be merged. Intermediate nodes of two borders will + be either merged or inserted into faces of the opposite border.

+ +

 

+ +

The sewing algorithm is as follows:

+ +

 

+ +

1. The parameter (U) of each node within + a border is computed. So that the first node has U=0.0, the last node + has U=1.0, for the rest nodes 0.0 < U < 1.0;

+ +

2. Compare node parameters of the two borders. + If two nodes of the opposite borders have close parameters, they are merged, + i.e. a node of the first border is replaced in all elements by a node + of the second border. If a node has no node with a close parameter in + the opposite border, it is inserted into an edge of element of the opposite + border, an element is split. Two nodes are considered close enough to + merge, if difference of their parameters is less than one fifth of minimum + length of adjacent face edges on the borders.

+ +

 

+ +

+ +

 

+ +

  See + Also a sample TUI Script of a Sew + Free Borders operation.  

+ +

 

+ +

 

+ +

Sew conform free borders

+ +

This functionality can be used to unite two free borders of a 2D mesh. +

+ +

 

+ +

The borders of meshes for sewing are defined as for "Sew free borders" + except that the second free border is not limited and can be defined by + the first and the second nodes only. The first nodes of two borders can + be the same.

+ +

 

+ +

The algorithm is following: counting nodes starting at the first ones, + the n-th node of the first border is merged with the n-th node of the + other border, until the end of either of borders. Nodes of the first border + are replaced in all elements with corresponding nodes of the second border.

+ +

For sewing conform free borders you should define three points on the + first border and two points on the second one. User can select these nodes + in 3D viewer or define node by its id.

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ +

  See + Also a sample TUI Script of a Sew + Conform Free Borders operation.  

+ +

 

+ +

 

+ +

Sew border to side

+ +

"Sew border to side" is intended to sew a free border to a + mesh surface.

+ +

The free border is defined as for "Sewing of free borders". + The place where to sew the border is defined by two nodes, between which + the border faces are placed, so that the first border node is merged with + the first node on the side and the last node of the border is merged with + the second specified node on the side.

+ +

 

+ +

 

+ +

The algorithm is following.

+ +

1. Find a sequence of linked nodes on the side such that the found links + to be most co-directed with the links of the free border.

+ +

2. Sew two sequences of nodes using algorithm of "Sewing of free + berders".

+ +

For sewing border to side you should define three points on the border + and two points on the side. User can select these nodes in 3D viewer or + define node by its id.

+ +

+ +

  See + Also a sample TUI Script of a Sew + Border to Side operation.  

+ +

 

+ +

 

+ +

Sew side elements

+ +

This operation is intended to unite two mesh + surfaces.

+ +

 

+ +

Surfaces may be defined by either 2d or 3d elements. The number of given + elements of the sides must be the same. The sets of given elements must + be topologically equal, i.e. each node of one element set must have a + corresponding node in the other element set and corresponding nodes must + be equally linked. If there are 3d elements in a set, only their free + faces must obey to that rule.

+ +

Two corresponding nodes on each side must be specified. They must belong + to one element and must be located on an element set boundary.

+ +

 

+ +

Sewing algorithm finds and merges the corresponding nodes starting from + the specified ones.

+ +

+ +

+ +

For sewing side elements you should define elements for sewing and two + nodes for merging on the each side. User can select these elements and + nodes in 3D viewer or define them by its id.

+ +

 

+ +

See Also a sample TUI Script + of a Sew Side Elements + operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/skew.htm b/doc/salome/gui/SMESH/files/skew.htm index f6280e38a..cfeac0793 100755 --- a/doc/salome/gui/SMESH/files/skew.htm +++ b/doc/salome/gui/SMESH/files/skew.htm @@ -1,140 +1,141 @@ - - - - - -Skew - - - - - - - - - - - - -

Skew

- -

Skew mesh quality - criterion reflects the angle between the lines that join opposite sides - of the element. SKEW  is - a maximum value of all skew angles.

- -

This mesh quality criterion - can be applied to elements composed of 4 and 3 nodes (quadrangles and - triangles)

- -

 

- -

- -

 

- -

To apply the Skew quality criterion to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Skew or click button of the toolbar. Your mesh - will be displayed in the viewer with its elements colored according to - the applied mesh quality control criterion:

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a Skew - quality control operation.  

- -

 

- - - - + + + + + +Skew + + + + + + + + + + + + + +

Skew

+ +

Skew mesh quality + criterion reflects the angle between the lines that join opposite sides + of the element. SKEW  is + a maximum value of all skew angles. This + mesh quality criterion can be applied to elements composed of 4 and 3 + nodes (quadrangles and triangles)

+ +

 

+ +

+ +

 

+ +

To apply the Skew quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Skew or click button of the toolbar. Your mesh + will be displayed in the viewer with its elements colored according to + the applied mesh quality control criterion:

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a Skew + quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/smoothing.htm b/doc/salome/gui/SMESH/files/smoothing.htm index 6cab53dbd..5b34249e0 100755 --- a/doc/salome/gui/SMESH/files/smoothing.htm +++ b/doc/salome/gui/SMESH/files/smoothing.htm @@ -1,190 +1,196 @@ - - - - - -Smoothing - - - - - - - - - - - -

Smoothing

- -

Smoothing is used to adjust the locations of element - corners (nodes) to reduce distortions in these elements.

- -

 

- -

To apply smoothing to the elements of your mesh:

- -

 

- -

1. Display a mesh or a submesh in the 3D - viewer.

- -

2. In the Modification - menu select the Smoothing item - or click button in the toolbar. The dialog - box contains the following fields which should be specified:

- -

 

- -

       

- -
    - -
  • Id Elements field allows to specify - the elements which should be smoothed by selecting them in the 3D viewer. - Note: to select several elements press Shift - button.

  • - -
      - -
    • Smoothing is applied - to the whole mesh or its part

    • - -
    • Fixed nodes - ids: some nodes keep their location during smoothing. If a mesh - is built on a geometry shape, the nodes built on geometrical edges are - always fixed. If smoothing is applied to a part of a mesh then the boundary - nodes of an elements set are also fixed. Any other nodes may be additionally - fixed.

    • - -
    • Smoothing - method:

    • - -
        - -
      • Laplacian - smoothing pulls a node toward the center of surrounding nodes directly - connected to that node along an element edge. Centroidal smoothing pulls - a node toward the element-area-weighted centroid of the surrounding elements. - Typically, the Laplacian method will produce the mesh with the least element - distortion. It is also the faster method.

      • - -
      • Centroidal - smoothing usually produces a mesh that has more uniform element sizes. - Both methods produce good results with "free" meshes.

      • -
      -
    -
- -

 

- -

- -
    - -
  • Iteration limit: both of the smoothing - methods use an iterative procedure to converge toward a smoothed mesh. - All nodes are smoothed according to one of the techniques shown above. - Then the smoothing is reevaluated with the updated nodal locations. This - process continues until the maximum number of iterations has been exceeded, - or all elements has aspect ratio less or equal than the specified one.

  • - -
  • Max. aspect ratio.

  • -
- -

 

- -

3. Click the Apply - or OK button to confirm - the operation.

- -

 

- -

        

- -

 

- -

  See - Also a sample TUI Script of a Smoothing - operation.  

- -

 

- -

 

- - - - + + + + + +Smoothing + + + + + + + + + + + + +

Smoothing

+ +

Smoothing is used to adjust the locations of element + corners (nodes) to reduce distortions in these elements.

+ +

 

+ +

To apply smoothing to the elements of your mesh:

+ +

 

+ +

1. Display a mesh or a submesh in the 3D + viewer.

+ +

2. In the Modification + menu select the Smoothing item + or click button in the toolbar. The dialog + box contains the following fields which should be specified:

+ +

 

+ +

       

+ +
    + +
  • Id Elements field allows to specify + the elements which should be smoothed by selecting them in the 3D viewer + (lock Shift button to select several + elements).

  • + +
      + +
    • Select whole mesh, + submesh or group - smoothing is applied + to the whole mesh or its part.

    • + +
    • Fixed nodes + ids: some nodes keep their location during smoothing. If a mesh + is built on a geometry shape, the nodes built on geometrical edges are + always fixed. If smoothing is applied to a part of a mesh then the boundary + nodes of an elements set are also fixed. Any other nodes may be additionally + fixed.

    • + +
    • Smoothing + Method:

    • + +
        + +
      • Laplacian + smoothing pulls a node toward the center of surrounding nodes directly + connected to that node along an element edge. Centroidal smoothing pulls + a node toward the element-area-weighted centroid of the surrounding elements. + Typically, the Laplacian method will produce the mesh with the least element + distortion. It is also the faster method.

      • + +
      • Centroidal + smoothing usually produces a mesh that has more uniform element sizes. + Both methods produce good results with "free" meshes.

      • +
      +
    +
+ +

 

+ +

+ +
    + +
  • Iteration limit: both of the smoothing + methods use an iterative procedure to converge toward a smoothed mesh. + All nodes are smoothed according to one of the techniques shown above. + Then the smoothing is reevaluated with the updated nodal locations. This + process continues until the maximum number of iterations has been exceeded, + or all elements has aspect ratio less or equal than the specified one.

  • + +
  • Max. aspect ratio.

  • +
+ +

 

+ +

3. Click the Apply + or OK button to confirm + the operation.

+ +

 

+ +

        

+ +

 

+ +

  See + Also a sample TUI Script of a Smoothing + operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/symmetry.htm b/doc/salome/gui/SMESH/files/symmetry.htm index d8f8a43d5..b8e622996 100755 --- a/doc/salome/gui/SMESH/files/symmetry.htm +++ b/doc/salome/gui/SMESH/files/symmetry.htm @@ -1,142 +1,147 @@ - - - - - -Symmetry - - - - - - - - - - - -

Symmetry

- -

This geometrical operation allows to perform a symmetrical copy of your - mesh or some of its elements.

- -

 

- -

 To - apply symmetry to your mesh:

- -

 

- -

From the Modification - choose Transformation and -  from its - sub-menu select the Symmetry item. - The following dialog box shall appear:

- -

 

- -

- -

 

- -

- -

 

- -

- -

 

- -

This operation has three options, you can - symmetrically copy your mesh or some of its elements specifying:

- -
    - -
  • one point

  • - -
  • one axis (point and - vector)

  • - -
  • one plane (point and - normal)

  • -
- -

 

- -

Create a - copy radio button allows to keep the initial elements or mesh.

- -

 

- -

  See - Also a sample TUI Script of a Symmetry - operation.  

- -

 

- - - - + + + + + +Symmetry + + + + + + + + + + + + +

Symmetry

+ +

This geometrical operation allows to perform a symmetrical copy of your + mesh or some of its elements.

+ +

 

+ +

 To + apply symmetry to your mesh:

+ +

 

+ +

From the Modification + choose Transformation and +  from its + sub-menu select the Symmetry item. + The following dialog box shall appear:

+ +

 

+ +

+ +

 

+ +

+ +

 

+ +

+ +

 

+ +

This operation has three options, you can + symmetrically copy your mesh or some of its elements specifying:

+ +
    + +
  • one point

  • + +
  • one axis (point and + vector)

  • + +
  • one plane (point and + normal)

  • +
+ +

 

+ +

Create a + copy radio button allows to keep the initial elements or mesh.

+ +

 

+ +

  See + Also a sample TUI Script of a Symmetry + operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/taper.htm b/doc/salome/gui/SMESH/files/taper.htm index 9b296b2e8..9ea8a26a7 100755 --- a/doc/salome/gui/SMESH/files/taper.htm +++ b/doc/salome/gui/SMESH/files/taper.htm @@ -1,134 +1,141 @@ - - - - - -Taper - - - - - - - - - - - - -

Taper

- -

Taper mesh quality - criterion represents the ratio of the areas of two triangles separated - by a diagonal. So it can be calculated only for elements consisting of - 4 nodes.

- -

- -

 

- -

 

- -

To apply the Taper quality criterion to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Taper or click button in the toolbar. Your mesh - will be displayed in the viewer with its elements colored according to - the applied mesh quality control criterion:

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a Taper - quality control operation.  

- -

 

- - - - + + + + + +Taper + + + + + + + + + + + + + +

Taper

+ +

Taper mesh quality + criterion represents the ratio of the areas of two triangles separated + by a diagonal. So it can be calculated only for elements consisting of + 4 nodes.

+ +

 

+ +

+ +

 

+ +

 

+ +

To apply the Taper quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Taper or click button in the toolbar. Your mesh + will be displayed in the viewer with its elements colored according to + the applied mesh quality control criterion:

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a Taper + quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/translation.htm b/doc/salome/gui/SMESH/files/translation.htm index a07237880..82be5851d 100755 --- a/doc/salome/gui/SMESH/files/translation.htm +++ b/doc/salome/gui/SMESH/files/translation.htm @@ -1,132 +1,137 @@ - - - - - -Translation - - - - - - - - - - - -

Translation

- -

This geometrical operation allows to translate in space your mesh or - some of its elements.

- -

 

- -

 To - translate your mesh:

- -

 

- -

From the Modification - choose Transformation and -  from its - sub-menu select the Translation item. - The following dialog box shall appear:

- -

 

- -

  

- -

 

- -

This operation has two options, you can translate - in space your mesh or some of its elements specifying:

- -
    - -
  • two points (starting - and ending)

  • - -
  • one vector

  • -
- -

Toggle the corresponding checkbox to Select whole mesh, submesh or group.

- -

Create a - copy button allows to copy the translated object.

- -

 

- -

  See - Also a sample TUI Script of a Translation - operation.  

- -

 

- - - - + + + + + +Translation + + + + + + + + + + + + +

Translation

+ +

This geometrical operation allows to translate in space your mesh or + some of its elements.

+ +

 

+ +

 To + translate your mesh:

+ +

 

+ +

From the Modification + choose Transformation and +  from its + sub-menu select the Translation item. + The following dialog box shall appear:

+ +

 

+ +

  

+ +

 

+ +

This operation has two options, you can translate + in space your mesh or some of its elements specifying:

+ +
    + +
  • two points (starting + and ending)

  • + +
  • one vector

  • +
+ +

Toggle the corresponding checkbox to Select whole mesh, submesh or group.

+ +

Create a + copy button allows to copy the translated object.

+ +

 

+ +

  See + Also a sample TUI Script of a Translation + operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/uniting_a_set_of_triangles.htm b/doc/salome/gui/SMESH/files/uniting_a_set_of_triangles.htm index d625b7ecc..69e6ea13b 100755 --- a/doc/salome/gui/SMESH/files/uniting_a_set_of_triangles.htm +++ b/doc/salome/gui/SMESH/files/uniting_a_set_of_triangles.htm @@ -1,182 +1,183 @@ - - - - - -Uniting a set of triangles - - - - - - - - - - - - -

Uniting a set of triangles

- -

In contrast to the - previous operation this one allows to unite at once many triangles - if they have adjacent edges.

- -

 

- -

To union several triangles:

- -

 

- -

- -

1. Display a mesh or a submesh in the 3D - viewer.

- -

2. In the Modification - menu select the Union of triangles - item or click button in the toolbar. The following - dialog box will appear:

- -

 

- -
    - -
  • The main list shall contain the triangles - which will be united. You can click on an triangle in the 3D viewer and - it will be highlighted. After that click the Add - button and the ID of this triangle will be added to the list. To - remove a selected element or elements from the list click the Remove - button. The Sort button - allows to sort the list of IDs. The Set - filter button allows to apply a definite filter to selection of - triangles.

  • - -
  • Apply to all radio button allows to - modify the orientation of all triangles of the currently displayed mesh - or submesh.

  • - -
  • Criterion menu allows to apply the operation - only to those object which meet the chosen criterion (from the list of - Quality Controls, i.e. Skew, Warping, Minimum Angle, etc.)

  • - -
  • Select from set of fields allows to - choose a submesh or an existing group whose triangle elements will be - automatically added to the list.

  • -
- -

 

- -

3. Click the Apply - or OK button to confirm - the operation.

- -

 

- -

If some selected triangle - elements have no adjacent edges with one of the others, the operation - on these elements shall take no effect.

- -

 

- -

 

- -

 

- -

 

- -

   

- -

 

- -

 See - Also a sample TUI Script of a Uniting - a Set of Triangles operation.  

- -

 

- - - - + + + + + +Uniting a set of triangles + + + + + + + + + + + + + +

Uniting a set of triangles

+ +

In contrast to the + previous operation this one allows to unite at once many triangles + if they have adjacent edges.

+ +

 

+ +

To union several triangles:

+ +

 

+ +

+ +

 

+ +

1. Display a mesh or a submesh in the 3D + viewer.

+ +

2. In the Modification + menu select the Union of triangles + item or click button in the toolbar. The following + dialog box will appear:

+ +

 

+ +
    + +
  • The main list shall contain the triangles + which will be united. You can click on an triangle in the 3D viewer and + it will be highlighted. After that click the Add + button and the ID of this triangle will be added to the list. To + remove a selected element or elements from the list click the Remove + button. The Sort button + allows to sort the list of IDs. The Set + filter button allows to apply a definite filter to selection of + triangles.

  • + +
  • Apply to all radio button allows to + modify the orientation of all triangles of the currently displayed mesh + or submesh.

  • + +
  • Criterion menu allows to apply the operation + only to those object which meet the chosen criterion (from the list of + Quality Controls, i.e. Skew, Warping, Minimum Angle, etc.)

  • + +
  • Select from set of fields allows to + choose a submesh or an existing group whose triangle elements will be + automatically added to the list.

  • +
+ +

 

+ +

3. Click the Apply + or OK button to confirm + the operation.

+ +

 

+ +

If some selected triangle + elements have no adjacent edges with one of the others, the operation + on these elements shall take no effect.

+ +

 

+ +

   

+ +

 

+ +

 See + Also a sample TUI Script of a Uniting + a Set of Triangles operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/uniting_two_triangles.htm b/doc/salome/gui/SMESH/files/uniting_two_triangles.htm index 98ad79f5b..738ef90f0 100755 --- a/doc/salome/gui/SMESH/files/uniting_two_triangles.htm +++ b/doc/salome/gui/SMESH/files/uniting_two_triangles.htm @@ -1,146 +1,151 @@ - - - - - -Uniting two triangles - - - - - - - - - - - -

Uniting two triangles

- -

 In MESH - you can union two neighboring triangles (cells) by deletion of the common - edge.

- -

 

- -

To unite two triangles:

- -

 

- -

1. From the Modification - menu choose the Union of two triangles - item or click button in the toolbar. The following - dialog box shall appear:

- -

 

- -

- -

 

- -

2. Enter the ID of the required edge in the - Edge  field - or select this edge in the 3D viewer.

- -

 

- -

3. Click the Apply - or OK button.

- -

 

- -

 

- - --- - - - -
-

-

- -

 

- -

  See - Also a sample TUI Script of a Uniting - Two Triangles operation.  

- -

 

- - - - + + + + + +Uniting two triangles + + + + + + + + + + + + +

Uniting two triangles

+ +

 In MESH + you can union two neighboring triangles (cells) by deletion of the common + edge.

+ +

 

+ +

To unite two triangles:

+ +

 

+ +

1. From the Modification + menu choose the Union of two triangles + item or click button in the toolbar. The following + dialog box shall appear:

+ +

 

+ +

+ +

 

+ +

2. Enter the ID of the required edge in the + Edge  field + or select this edge in the 3D viewer.

+ +

 

+ +

3. Click the Apply + or OK button.

+ +

 

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

  See + Also a sample TUI Script of a Uniting + Two Triangles operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/using_operations_on_groups.htm b/doc/salome/gui/SMESH/files/using_operations_on_groups.htm index 622120a22..4cd9fa069 100755 --- a/doc/salome/gui/SMESH/files/using_operations_on_groups.htm +++ b/doc/salome/gui/SMESH/files/using_operations_on_groups.htm @@ -1,310 +1,315 @@ - - - - - -Using operations on groups - - - - - - - - - - - - -

Using operations on groups

- -

In MESH you can - perform some Boolean operations on groups, which belong to one and the - same mesh.

- -

 

- - - -

 

- -

Union of two groups

- -

This operation allows to create a new group in such a way that all mesh - elements that are present in the initial groups will be added to the new - one.

- -

 

- -

To union two groups:

- -

 

- -

1. In the Mesh - menu select the Union Groups item. - The following dialog box will appear:

- -

 

- - --- - - - -
-

-

       

-

            Group1 -                         Group2 -                          Group12

-

 

-

For example, we have two groups Group1 and Group2.

-

The result of their Union will - be Group12   

- -

  

- -

 In - this dialog box you should specify the name - of the resulting group and two - groups which will be united.

- -

 

- -

2. Click the Ok - or  Apply - button to confirm creation of the group.

- -

 

- -

See Also - a sample TUI Script of a Union - of two Groups operation.  

- -

 

- -

 

- -

 

- -

Intersection of two groups

- -

This operation allows to create a new group in such a way that all mesh - elements that are present in both initial groups are added to the new - one.

- -

 

- -

To intersect two groups:

- -

 

- -

1. In the Mesh - menu select the Intersect Groups - item. The following dialog box will appear:

- -

 

- - --- - - - -
-

-

 

-

            Group1 -                         Group2 -                    Group12a

-

 

-

For example, we have two groups Group1 and Group2.

-

The result of their Intersection - will be Group12a   

- -

 

- -

In this dialog box you should specify the - name of the resulting group and - two groups which will be intersected.

- -

 

- -

2. Click the Ok - or  Apply - button to confirm creation of the group.

- -

 

- -

 See - Also a sample TUI Script of an  Intersection - of two Groups operation.  

- -

 

- -

Cut of two groups

- -

This operation allows to create a new group in such a way that all mesh - elements that are present in the main group but are absent in the tool - group are added to the new one.

- -

 

- -

To cut two groups:

- -

 

- -

1. In the Mesh - menu select the Cut Groups item. - The following dialog box will appear:

- -

 

- - --- - - - -
-

-

    

-

           Group1 -                          Group2 -                        Group12b

-

 

-

For example, we have two groups Group1 and Group2.

-

The result of their Cut will - be Group12b   

- -

 

- -

In this dialog box you should specify the - name of the resulting group and - two groups which will be cut.

- -

 

- -

2. Click the Ok - or  Apply - button to confirm creation of the group.  

- -

 

- -

  See - Also a sample TUI Script of a  Cut - of two Groups operation.  

- -

 

- -

 

- - - - + + + + + +Using operations on groups + + + + + + + + + + + + + +

Using operations on groups

+ +

In MESH you can + perform some Boolean operations on groups, which belong to one and the + same mesh.

+ +

 

+ + + +

 

+ +

Union of two groups

+ +

This operation allows to create a new group in such a way that all mesh + elements that are present in the initial groups will be added to the new + one.

+ +

 

+ +

To union two groups:

+ +

 

+ +

1. In the Mesh + menu select the Union Groups item. + The following dialog box will appear:

+ +

 

+ + +++ + + + +
+

+

       

+

            Group1 +                         Group2 +                          Group12

+

 

+

For example, we have two groups Group1 and Group2.

+

The result of their Union will + be Group12   

+ +

  

+ +

 In + this dialog box you should specify the name + of the resulting group and two + groups which will be united.

+ +

 

+ +

2. Click the Ok + or  Apply + button to confirm creation of the group.

+ +

 

+ +

See Also + a sample TUI Script of a Union + of two Groups operation.  

+ +

 

+ +

 

+ +

 

+ +

Intersection of two groups

+ +

This operation allows to create a new group in such a way that all mesh + elements that are present in both initial groups are added to the new + one.

+ +

 

+ +

To intersect two groups:

+ +

 

+ +

1. In the Mesh + menu select the Intersect Groups + item. The following dialog box will appear:

+ +

 

+ + +++ + + + +
+

+

 

+

            Group1 +                         Group2 +                    Group12a

+

 

+

For example, we have two groups Group1 and Group2.

+

The result of their Intersection + will be Group12a   

+ +

 

+ +

In this dialog box you should specify the + name of the resulting group and + two groups which will be intersected.

+ +

 

+ +

2. Click the Ok + or  Apply + button to confirm creation of the group.

+ +

 

+ +

 See + Also a sample TUI Script of an  Intersection + of two Groups operation.  

+ +

 

+ +

Cut of two groups

+ +

This operation allows to create a new group in such a way that all mesh + elements that are present in the main group but are absent in the tool + group are added to the new one.

+ +

 

+ +

To cut two groups:

+ +

 

+ +

1. In the Mesh + menu select the Cut Groups item. + The following dialog box will appear:

+ +

 

+ + +++ + + + +
+

+

    

+

           Group1 +                          Group2 +                        Group12b

+

 

+

For example, we have two groups Group1 and Group2.

+

The result of their Cut will + be Group12b   

+ +

 

+ +

In this dialog box you should specify the + name of the resulting group and + two groups which will be cut.

+ +

 

+ +

2. Click the Ok + or  Apply + button to confirm creation of the group.  

+ +

 

+ +

  See + Also a sample TUI Script of a  Cut + of two Groups operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/viewing_mesh_info.htm b/doc/salome/gui/SMESH/files/viewing_mesh_info.htm index a2beb2ab5..e6a9ffb21 100755 --- a/doc/salome/gui/SMESH/files/viewing_mesh_info.htm +++ b/doc/salome/gui/SMESH/files/viewing_mesh_info.htm @@ -1,164 +1,184 @@ - - - - - -Viewing mesh info - - - - - - - - - - - - -

Mesh infos

- -

There are two types of information boxes: Standard - Mesh Infos and Advanced - Mesh Infos.

- -

 

- -

The Standard - Mesh Infos box gives only the information on the number of 2D elements - of mesh and the number of nodes. However, from this Info you can learn - about groups selected on this mesh.

- -

To view the Standard - Mesh Infos, select your mesh or submesh in the Object - Browser and select Standard Mesh Infos from - the Mesh menu or click - button in the toolbar. The following information will - be displayed:

- -

 

- -

- -

 

- -

The Advanced Mesh - Infos gives more information about the mesh, including the total - number of faces and volumes and their geometrical types.

- -

To view the Advanced Mesh Infos, select - your mesh or submesh in the Object Browser - and select Advanced - Mesh Infos from the Mesh menu or click button - in the toolbar. The following information will be displayed:

- -

 

- -

- -

 

- -

 

- -

In case you get Mesh Infos via a TUI script, - the information is displayed in Python Console.

- -

 

- -

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- - - - + + + + + +Viewing mesh info + + + + + + + + + + + + + +

Mesh infos

+ +

There are two types of information boxes: Standard + Mesh Infos and Advanced + Mesh Infos.

+ +

 

+ + + +

 

+ +

Standard Mesh Infos

+ +

The Standard + Mesh Infos box gives only the information on the number of elements + of maximum dimension and the number of nodes in the mesh. However, from + this Info you can learn about groups selected on this mesh.

+ +

To view the Standard + Mesh Infos, select your mesh or submesh in the Object + Browser and select Standard Mesh Infos from + the Mesh menu or click + button in the toolbar. The following information will + be displayed:

+ +

 

+ +

+ +

 

+ +

Advanced Mesh Infos

+ +

The Advanced Mesh + Infos gives more information about the mesh, including the total + number of faces and volumes and their geometrical types.

+ +

To view the Advanced Mesh Infos, select + your mesh or submesh in the Object Browser + and select Advanced + Mesh Infos from the Mesh menu or click button + in the toolbar. The following information will be displayed:

+ +

 

+ +

+ +

 

+ +

 

+ +

In case you get Mesh Infos via a TUI + script, the information is displayed in Python Console.

+ +

 

+ +

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/vtk_3d_viewer.htm b/doc/salome/gui/SMESH/files/vtk_3d_viewer.htm index e8ce5413c..ffb8f9a18 100755 --- a/doc/salome/gui/SMESH/files/vtk_3d_viewer.htm +++ b/doc/salome/gui/SMESH/files/vtk_3d_viewer.htm @@ -1,229 +1,229 @@ - - - - - -VTK 3D Viewer - - - - - - - - - - - -

VTK 3D Viewer

- -

VTK - 3D viewer is the default viewer for Mesh Module, allowing to visualize - meshes. It is also used in Post-Pro module for all 3D presentations except - for Gauss Points.

- -

 

- -

The functionalities of - VTK viewer are available via its Viewer Toolbar. Buttons marked with small - downward triangles have extended functionality which can be accessed by - locking on them with left mouse button.  

- -

 

- -

- -
    - -
  • Dump View - exports - an object from the viewer in bmp, png, jpg or jpeg image format.

  • - -
  • Show/Hide Trihedron - - shows or hides coordinate axes.

  • - -
  •  Fit - all - allows to select a point to be the center of a scene representing - all displayed objects in the visible area. -

  • - -
  •   Fit area - resizes - the view to place in the visible area only the contents of a frame drawn - with pressed left mouse button.

  • - -
  • Zoom -  allows - to zoom in and out.

  • - -
  • Panning - if the - represented objects are greater that the visible area and you don't wish - to use Fit all functionality, - click on this button and you'll be able to drag the scene to see its remote - parts.

  • - -
  • Global panning - - represents all displayed objects in the visible area.

  • - -
  • Rotation - allows - to rotate the selected object using the mouse.

  • - -
  • These buttons orientate the scene strictly about coordinate - axes.

  • - -
  • Reset - restores - the default position (isometric) of objects in the scene.

  • - -
  • Scaling - represents - objects deformed (stretched or stuffed) along the axes of coordinates

  • - -
  •  Graduated axes - allows - to define parameters of axes and graduate them.

  • -
- -

 

- -

- -
    - -
  • Axis name

  • - -
  • Is visible - if checked the axis name is displayed in - the viewer.

  • - -
  • Name - - allows to redefine the name of the axis.

  • - -
  • Font - - allows to define color and properties of the font of axis name.

  • - -
  • Labels -

  • - -
  • Is visible - if checked the labels are displayed in the - viewer.

  • - -
  • Number - - allows to define the number of labels.

  • - -
  • Offset - - allows to define the distance between labels.

  • - -
  • Font - - allows to define color and properties of the font of labels names.

  • - -
  • Tick marks

  • - -
  • Is visible - if checked the tick marks are displayed in - the viewer.

  • - -
  • Length - - allows to define the length of tick marks

  • - -
  • Is visible if - checked the axis is displayed in the viewer.

  • -
- - - - + + + + + +VTK 3D Viewer + + + + + + + + + + + +

VTK 3D Viewer

+ +

VTK + 3D viewer is the default viewer for Mesh Module, allowing to visualize + meshes. It is also used in Post-Pro module for all 3D presentations except + for Gauss Points.

+ +

 

+ +

The functionalities of + VTK viewer are available via its Viewer Toolbar. Buttons marked with small + downward triangles have extended functionality which can be accessed by + locking on them with left mouse button.  

+ +

 

+ +

+ +
    + +
  • Dump View - exports + an object from the viewer in bmp, png, jpg or jpeg image format.

  • + +
  • Show/Hide Trihedron + - shows or hides coordinate axes.

  • + +
  •  Fit + all - allows to select a point to be the center of a scene representing + all displayed objects in the visible area. +

  • + +
  •   Fit area - resizes + the view to place in the visible area only the contents of a frame drawn + with pressed left mouse button.

  • + +
  • Zoom -  allows + to zoom in and out.

  • + +
  • Panning - if the + represented objects are greater that the visible area and you don't wish + to use Fit all functionality, + click on this button and you'll be able to drag the scene to see its remote + parts.

  • + +
  • Global panning - + represents all displayed objects in the visible area.

  • + +
  • Rotation - allows + to rotate the selected object using the mouse.

  • + +
  • These buttons orientate the scene strictly about coordinate + axes.

  • + +
  • Reset - restores + the default position (isometric) of objects in the scene.

  • + +
  • Scaling - represents + objects deformed (stretched or stuffed) along the axes of coordinates

  • + +
  •  Graduated axes - allows + to define parameters of axes and graduate them.

  • +
+ +

 

+ +

+ +
    + +
  • Axis name

  • + +
  • Is visible - if checked the axis name is displayed in + the viewer.

  • + +
  • Name + - allows to redefine the name of the axis.

  • + +
  • Font + - allows to define color and properties of the font of axis name.

  • + +
  • Labels +

  • + +
  • Is visible - if checked the labels are displayed in the + viewer.

  • + +
  • Number + - allows to define the number of labels.

  • + +
  • Offset + - allows to define the distance between labels.

  • + +
  • Font + - allows to define color and properties of the font of labels names.

  • + +
  • Tick marks

  • + +
  • Is visible - if checked the tick marks are displayed in + the viewer.

  • + +
  • Length + - allows to define the length of tick marks

  • + +
  • Is visible if + checked the axis is displayed in the viewer.

  • +
+ + + + diff --git a/doc/salome/gui/SMESH/files/warp.htm b/doc/salome/gui/SMESH/files/warp.htm index acc2afc6f..a67d0e2f3 100755 --- a/doc/salome/gui/SMESH/files/warp.htm +++ b/doc/salome/gui/SMESH/files/warp.htm @@ -1,151 +1,156 @@ - - - - - -Warp - - - - - - - - - - - - -

Warping

- -

Warping indicates - that a face is not planar and is applied only to 2D elements with 4 nodes. - This quality control criterion is based on a projection plane created - by:

- -

1. bisecting the four element edges,

- -

2. creating a point on the plane at the vector - average of the corners, where the x-axis extends from the point to the - bisector on edge 2.

- -

The plane normal is in the direction of the - cross product of the x-axis and the vector from the origin to the bisector - of edge 3. Every corner of the quad will then be a distance “h” from the - plane. The length of each half edge is measured and the shortest length - is assigned “l”. The warp angle is the arcsine of the ratio of the projection - height “h” to the half edge length “l”.

- -

 

- -

- -

 

- -

 

- -

To apply the Warping quality criterion to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Warp or click button of the toolbar. Your mesh - will be displayed in the viewer with its elements colored according to - the applied mesh quality control criterion:

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a Warping - quality control operation.  

- -

 

- -

 

- - - - + + + + + +Warp + + + + + + + + + + + + + +

Warping

+ +

Warping indicates + that a face is not planar and is applied only to 2D elements with 4 nodes. + This quality control criterion is based on a projection plane created + by:

+ +

1. bisecting the four element edges,

+ +

2. creating a point on the plane at the vector + average of the corners, where the x-axis extends from the point to the + bisector on edge 2.

+ +

The plane normal is in the direction of the + cross product of the x-axis and the vector from the origin to the bisector + of edge 3. Every corner of the quad will then be a distance “h” from the + plane. The length of each half edge is measured and the shortest length + is assigned “l”. The warp angle is the arcsine of the ratio of the projection + height “h” to the half edge length “l”.

+ +

 

+ +

+ +

 

+ +

 

+ +

To apply the Warping quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Warp or click button of the toolbar. Your mesh + will be displayed in the viewer with its elements colored according to + the applied mesh quality control criterion:

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a Warping + quality control operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/free_borders.htm b/doc/salome/gui/SMESH/free_borders.htm index ebfcb53d4..b262c9cd3 100755 --- a/doc/salome/gui/SMESH/free_borders.htm +++ b/doc/salome/gui/SMESH/free_borders.htm @@ -1,114 +1,120 @@ - - - - - -Free borders - - - - - - - - - - - - -

Free borders

- -

This mesh quality control highlights borders of faces - consisting of edges belonging to one face only.

- -

 

- -

 

- -

 

- -

In this picture the free borders are displayed in white.

- -

 

- -

See Also - a sample TUI Script of a Free - Borders quality control operation.  

- -

 

- - - - + + + + + +Free borders + + + + + + + + + + + + + +

Free borders

+ +

This mesh quality control highlights borders of faces + consisting of edges belonging to one face only.

+ +

 

+ +

 

+ +

 

+ +

In this picture the free borders are displayed in white.

+ +

 

+ +

See Also + a sample TUI Script of a Free + Borders quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/free_edges.htm b/doc/salome/gui/SMESH/free_edges.htm index fa4374670..fe7146d12 100755 --- a/doc/salome/gui/SMESH/free_edges.htm +++ b/doc/salome/gui/SMESH/free_edges.htm @@ -1,117 +1,122 @@ - - - - - -Free_edges - - - - - - - - - - - - -

Free edges

- -

  This - mesh quality control highlights borders of  elements - of mesh consisting of edges belonging to one element of mesh only.

- -

 

- -

- -

 

- -

In this picture some elements of mesh have - been deleted and the "holes" are outlined in red.

- -

 

- -

See Also - a sample TUI Script of a Free - Edges quality control operation.  

- -

 

- - - - + + + + + +Free_edges + + + + + + + + + + + + + +

Free edges

+ +

  This + mesh quality control highlights borders of  elements + of mesh consisting of edges belonging to one element of mesh only.

+ +

 

+ +

+ +

 

+ +

In this picture some elements of mesh have + been deleted and the "holes" are outlined in red.

+ +

 

+ +

See Also + a sample TUI Script of a Free + Edges quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/grouping_elements.htm b/doc/salome/gui/SMESH/grouping_elements.htm index b3f7985c8..143be3035 100755 --- a/doc/salome/gui/SMESH/grouping_elements.htm +++ b/doc/salome/gui/SMESH/grouping_elements.htm @@ -1,1078 +1,973 @@ - - - - - -Grouping Elements - - - - - - - - - - -

Grouping Elements

- -

Create a Standalone Group

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : AREA > - 100

- -

 

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 100 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Area > 100 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group consisting - of faces with area > 100

- -

aGroup = mesh.CreateGroup( - SMESH.FACE, "Area > 100" )

- -

aGroup.Add( anIds - )

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

- -

Create a Group on Geometry

- -

import salome

- -

import geompy

- -

 

- -

import StdMeshers

- -

 

- -

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

- -

 

- -

smeshgui = salome.ImportComponentGUI("SMESH")

- -

smeshgui.Init(salome.myStudyId);

- -

 

- -

# create a box

- -

box = geompy.MakeBox(0., - 0., 0., 100., 100., 100.)

- -

 

- -

# add the box to the study

- -

idbox = geompy.addToStudy(box, - "box")

- -

 

- -

# add the first face of - the box to the study

- -

subShapeList = geompy.SubShapeAll(box, - geompy.ShapeType["FACE"])

- -

face = subShapeList[0]

- -

name = geompy.SubShapeName(face, - box)

- -

idface = geompy.addToStudyInFather(box, - face, name)

- -

 

- -

# create a hypothesis

- -

print "-------------------------- - create Hypothesis"

- -

 

- -

print "-------------------------- - NumberOfSegments"

- -

numberOfSegments - = 7

- -

 

- -

hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

- -

hypNbSeg.SetNumberOfSegments(numberOfSegments)

- -

 

- -

print hypNbSeg.GetName()

- -

print hypNbSeg.GetId()

- -

print hypNbSeg.GetNumberOfSegments()

- -

 

- -

smeshgui.SetName(salome.ObjectToID(hypNbSeg), - "NumberOfSegments_10")

- -

 

- -

print "-------------------------- - MaxElementArea"

- -

maxElementArea = - 800

- -

 

- -

hypArea = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

- -

hypArea.SetMaxElementArea(maxElementArea)

- -

 

- -

print hypArea.GetName()

- -

print hypArea.GetId()

- -

print hypArea.GetMaxElementArea()

- -

 

- -

smeshgui.SetName(salome.ObjectToID(hypArea), - "MaxElementArea_500")

- -

 

- -

print "-------------------------- - MaxElementVolume"

- -

maxElementVolume - = 900

- -

 

- -

hypVolume = smesh.CreateHypothesis("MaxElementVolume", - "libStdMeshersEngine.so")

- -

hypVolume.SetMaxElementVolume(maxElementVolume)

- -

 

- -

print hypVolume.GetName()

- -

print hypVolume.GetId()

- -

print hypVolume.GetMaxElementVolume()

- -

 

- -

smeshgui.SetName(salome.ObjectToID(hypVolume), - "MaxElementVolume_500")

- -

 

- -

# create algorithms

- -

print "-------------------------- - create Algorithms"

- -

 

- -

print "-------------------------- - Regular_1D"

- -

regular1D = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(regular1D), - "Wire Discretisation")

- -

 

- -

print "-------------------------- - Quadrangle_2D"

- -

quad2D = smesh.CreateHypothesis("Quadrangle_2D", - "libStdMeshersEngine.so")

- -

smeshgui.SetName(salome.ObjectToID(quad2D), - "Quadrangle_2D")

- -

 

- -

# initialize a mesh with - the box

- -

mesh = smesh.CreateMesh(box)

- -

smeshgui.SetName(salome.ObjectToID(mesh), - "MeshBox")

- -

 

- -

# add a hypothesis to the - box

- -

print "-------------------------- - add hypothesis to the box"

- -

mesh.AddHypothesis(box,hypNbSeg)

- -

mesh.AddHypothesis(box,hypArea)

- -

mesh.AddHypothesis(box,hypVolume)

- -

mesh.AddHypothesis(box,regular1D)

- -

mesh.AddHypothesis(box,quad2D)

- -

 

- -

# compute the mesh

- -

print "-------------------------- - compute the mesh of the box"

- -

ret = smesh.Compute(mesh,box)

- -

print ret

- -

if ret == 0:

- -

    print - "probleme when computing the mesh"

- -

 

- -

# create geometry groups - on the plane:

- -

aGeomGroup1 = geompy.CreateGroup(face - , geompy.ShapeType["FACE"])

- -

geompy.AddObject(aGeomGroup1, - 1)

- -

 

- -

aGeomGroup2 = geompy.CreateGroup(face - , geompy.ShapeType["EDGE"])

- -

 

- -

geompy.AddObject(aGeomGroup2, - 3)

- -

geompy.AddObject(aGeomGroup2, - 6)

- -

geompy.AddObject(aGeomGroup2, - 8)

- -

geompy.AddObject(aGeomGroup2, - 10)

- -

 

- -

geompy.addToStudy(aGeomGroup1, - "Group on Faces")

- -

geompy.addToStudy(aGeomGroup2, - "Group on Edges")

- -

 

- -

aSmeshGroup1 = mesh.CreateGroupFromGEOM(SMESH.FACE, - "SMESHGroup1", aGeomGroup1)

- -

aSmeshGroup2 = mesh.CreateGroupFromGEOM(SMESH.EDGE, - "SMESHGroup2", aGeomGroup2)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Edit a Group

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : AREA > - 20

- -

 

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 30 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# create a group by adding - elements with area > 20

- -

aGroup = mesh.CreateGroup( - SMESH.FACE, "Area > 20" )

- -

aGroup.Add( anIds - )

- -

 

- -

print "Criterion: - Area > 20 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# Criterion : AREA > - 60

- -

 

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 60 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# create a group of elements - with area [20; 60] by removing elements with area > 60 from  group - aGroup

- -

aGroup.Remove(anIds)

- -

 

- -

# print the result

- -

aGroupElemIDs = - aGroup.GetListOfID()

- -

print "Criterion: - 20 < Area < 60 = ", len( aGroupElemIDs )

- -

for i in range( - len( aGroupElemIDs ) ):

- -

  print - aGroupElemIDs[ i ]

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

 

- -

Union of two groups

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : AREA > - 20

- -

 

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 20 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# create a group by adding - elements with area > 20

- -

aGroup1 = mesh.CreateGroup( - SMESH.FACE, "Area > 20" )

- -

aGroup1.Add( anIds - )

- -

 

- -

print "Criterion: - Area > 20 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# Criterion : AREA = 20

- -

 

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateEqualTo()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 20 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# create a group by adding - elements with area > 20

- -

aGroup2 = mesh.CreateGroup( - SMESH.FACE, "Area = 20" )

- -

aGroup2.Add( anIds - )

- -

 

- -

print "Criterion: - Area = 20 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create union group : - area >= 20

- -

aGroup3 = mesh.UnionGroups(aGroup1, - aGroup2, "Area >= 20")

- -

print "Criterion: - Area >= 20 Nb = ", len( aGroup3.GetListOfID() )

- -

 

- -

# Criterion : AREA < - 20

- -

 

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateLessThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 20 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# create a group by adding - elements with area < 20

- -

aGroup4 = mesh.CreateGroup( - SMESH.FACE, "Area < 20" )

- -

aGroup4.Add( anIds - )

- -

 

- -

print "Criterion: - Area < 20 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

  

- -

# create union group : - area >= 20 and area < 20

- -

aGroup5 = mesh.UnionGroups(aGroup3, - aGroup4, "Any Area")

- -

print "Criterion: - Any Area Nb = ", len( aGroup5.GetListOfID() )

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

- -

 

- -

- -

 

- -

Intersection of two groups

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : AREA > - 20

- -

 

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 20 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# create a group by adding - elements with area > 20

- -

aGroup1 = mesh.CreateGroup( - SMESH.FACE, "Area > 20" )

- -

aGroup1.Add( anIds - )

- -

 

- -

print "Criterion: - Area > 20 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# Criterion : AREA < - 60

- -

 

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateLessThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 60 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# create a group by adding - elements with area < 60

- -

aGroup2 = mesh.CreateGroup( - SMESH.FACE, "Area < 60" )

- -

aGroup2.Add( anIds - )

- -

 

- -

print "Criterion: - Area < 60 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

  

- -

# create an intersection - of groups : 20 < area < 60

- -

aGroup3 = mesh.IntersectGroups(aGroup1, - aGroup2, "20 < Area < 60")

- -

print "Criterion: - 20 < Area < 60 Nb = ", len( aGroup3.GetListOfID() )

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

   

- -

Cut of two groups

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : AREA > - 20

- -

 

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 20 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# create a group by adding - elements with area > 20

- -

aGroupMain = mesh.CreateGroup( - SMESH.FACE, "Area > 20" )

- -

aGroupMain.Add( - anIds )

- -

 

- -

print "Criterion: - Area > 20 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# Criterion : AREA < - 60

- -

 

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateLessThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 60 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# create a group by adding - elements with area < 60

- -

aGroupTool = mesh.CreateGroup( - SMESH.FACE, "Area < 60" )

- -

aGroupTool.Add( - anIds )

- -

 

- -

print "Criterion: - Area < 60 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

  

- -

# create an intersection - of groups : area >= 60

- -

aGroupRes = mesh.CutGroups(aGroupMain, - aGroupTool, "Area >= 60")

- -

print "Criterion: - Area >= 60 Nb = ", len( aGroupRes.GetListOfID() )

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

   

- - - - + + + + + +Grouping Elements + + + + + + + + + + + +

Grouping Elements

+ +

Create a Standalone Group

+ +

 

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : AREA > + 100

+ +

 

+ +

aFunctor = aFilterMgr.CreateArea()

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 100 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print "Criterion: + Area > 100 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group consisting + of faces with area > 100

+ +

aGroup = mesh.CreateGroup( + SMESH.FACE, "Area > 100" )

+ +

aGroup.Add( anIds + )

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

+ +

Create a Group on Geometry

+ +

import salome

+ +

import geompy

+ +

 

+ +

import SMESH

+ +

import StdMeshers

+ +

 

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

 

+ +

# create a box

+ +

box = geompy.MakeBox(0., + 0., 0., 100., 100., 100.)

+ +

 

+ +

# add the box to the study

+ +

idbox = geompy.addToStudy(box, + "box")

+ +

 

+ +

# add the first face of + the box to the study

+ +

subShapeList = geompy.SubShapeAll(box, + geompy.ShapeType["FACE"])

+ +

face = subShapeList[0]

+ +

name = geompy.SubShapeName(face, + box)

+ +

idface = geompy.addToStudyInFather(box, + face, name)

+ +

 

+ +

# create a hypothesis

+ +

numberOfSegments + = 7

+ +

hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", + "libStdMeshersEngine.so")

+ +

hypNbSeg.SetNumberOfSegments(numberOfSegments)

+ +

 

+ +

# create algorithms

+ +

regular1D = smesh.CreateHypothesis("Regular_1D", + "libStdMeshersEngine.so")

+ +

quad2D = smesh.CreateHypothesis("Quadrangle_2D", + "libStdMeshersEngine.so")

+ +

 

+ +

# initialize a mesh with + the box

+ +

mesh = smesh.CreateMesh(box)

+ +

 

+ +

# add hypotheses and algorithms + to the box

+ +

mesh.AddHypothesis(box,hypNbSeg)

+ +

mesh.AddHypothesis(box,regular1D)

+ +

mesh.AddHypothesis(box,quad2D)

+ +

 

+ +

# compute the mesh

+ +

ret = smesh.Compute(mesh,box)

+ +

if ret == 0:

+ +

    print + "probleme when computing the mesh"

+ +

else:

+ +

    print + "Computation succeded"

+ +

 

+ +

# create geometry groups + on the face

+ +

aGeomGroup1 = geompy.CreateGroup(face, + geompy.ShapeType["FACE"])

+ +

geompy.AddObject(aGeomGroup1, + 1)

+ +

 

+ +

aGeomGroup2 = geompy.CreateGroup(face, + geompy.ShapeType["EDGE"])

+ +

geompy.AddObject(aGeomGroup2, + 3)

+ +

geompy.AddObject(aGeomGroup2, + 6)

+ +

geompy.AddObject(aGeomGroup2, + 8)

+ +

geompy.AddObject(aGeomGroup2, + 10)

+ +

 

+ +

geompy.addToStudy(aGeomGroup1, + "Group on Faces")

+ +

geompy.addToStudy(aGeomGroup2, + "Group on Edges")

+ +

 

+ +

# create SMESH groups

+ +

aSmeshGroup1 = mesh.CreateGroupFromGEOM(SMESH.FACE, + "SMESHGroup1",

+ +

aGeomGroup1)

+ +

aSmeshGroup2 = mesh.CreateGroupFromGEOM(SMESH.EDGE, + "SMESHGroup2", aGeomGroup2)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +  

+ +

 

+ +

Edit a Group

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : AREA > + 20

+ +

 

+ +

aFunctor = aFilterMgr.CreateArea()

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 30 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# create a group by adding + elements with area > 20

+ +

aGroup = mesh.CreateGroup( + SMESH.FACE, "Area > 20" )

+ +

aGroup.Add( anIds + )

+ +

 

+ +

print "Criterion: + Area > 20 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# Criterion : AREA > + 60

+ +

 

+ +

aFunctor = aFilterMgr.CreateArea()

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 60 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# create a group of elements + with area [20; 60] by removing elements with area > 60 from  group + aGroup

+ +

aGroup.Remove(anIds)

+ +

 

+ +

# print the result

+ +

aGroupElemIDs = + aGroup.GetListOfID()

+ +

print "Criterion: + 20 < Area < 60 = ", len( aGroupElemIDs )

+ +

for i in range( + len( aGroupElemIDs ) ):

+ +

  print + aGroupElemIDs[ i ]

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

 

+ +

Union of two groups

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : AREA > + 20

+ +

 

+ +

aFunctor = aFilterMgr.CreateArea()

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 20 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# create a group by adding + elements with area > 20

+ +

aGroup1 = mesh.CreateGroup( + SMESH.FACE, "Area > 20" )

+ +

aGroup1.Add( anIds + )

+ +

 

+ +

print "Criterion: + Area > 20 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# Criterion : AREA = 20

+ +

 

+ +

aFunctor = aFilterMgr.CreateArea()

+ +

aPredicate = aFilterMgr.CreateEqualTo()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 20 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# create a group by adding + elements with area > 20

+ +

aGroup2 = mesh.CreateGroup( + SMESH.FACE, "Area = 20" )

+ +

aGroup2.Add( anIds + )

+ +

 

+ +

print "Criterion: + Area = 20 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create union group : + area >= 20

+ +

aGroup3 = mesh.UnionGroups(aGroup1, + aGroup2, "Area >= 20")

+ +

print "Criterion: + Area >= 20 Nb = ", len( aGroup3.GetListOfID() )

+ +

 

+ +

# Criterion : AREA < + 20

+ +

 

+ +

aFunctor = aFilterMgr.CreateArea()

+ +

aPredicate = aFilterMgr.CreateLessThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 20 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# create a group by adding + elements with area < 20

+ +

aGroup4 = mesh.CreateGroup( + SMESH.FACE, "Area < 20" )

+ +

aGroup4.Add( anIds + )

+ +

 

+ +

print "Criterion: + Area < 20 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

  

+ +

# create union group : + area >= 20 and area < 20

+ +

aGroup5 = mesh.UnionGroups(aGroup3, + aGroup4, "Any Area")

+ +

print "Criterion: + Any Area Nb = ", len( aGroup5.GetListOfID() )

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

+ +

 

+ +

+ +

 

+ +

Intersection of two groups

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : AREA > + 20

+ +

 

+ +

aFunctor = aFilterMgr.CreateArea()

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 20 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# create a group by adding + elements with area > 20

+ +

aGroup1 = mesh.CreateGroup( + SMESH.FACE, "Area > 20" )

+ +

aGroup1.Add( anIds + )

+ +

 

+ +

print "Criterion: + Area > 20 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# Criterion : AREA < + 60

+ +

 

+ +

aFunctor = aFilterMgr.CreateArea()

+ +

aPredicate = aFilterMgr.CreateLessThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 60 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# create a group by adding + elements with area < 60

+ +

aGroup2 = mesh.CreateGroup( + SMESH.FACE, "Area < 60" )

+ +

aGroup2.Add( anIds + )

+ +

 

+ +

print "Criterion: + Area < 60 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

  

+ +

# create an intersection + of groups : 20 < area < 60

+ +

aGroup3 = mesh.IntersectGroups(aGroup1, + aGroup2, "20 < Area < 60")

+ +

print "Criterion: + 20 < Area < 60 Nb = ", len( aGroup3.GetListOfID() )

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

   

+ +

Cut of two groups

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : AREA > + 20

+ +

 

+ +

aFunctor = aFilterMgr.CreateArea()

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 20 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# create a group by adding + elements with area > 20

+ +

aGroupMain = mesh.CreateGroup( + SMESH.FACE, "Area > 20" )

+ +

aGroupMain.Add( + anIds )

+ +

 

+ +

print "Criterion: + Area > 20 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# Criterion : AREA < + 60

+ +

 

+ +

aFunctor = aFilterMgr.CreateArea()

+ +

aPredicate = aFilterMgr.CreateLessThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 60 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# create a group by adding + elements with area < 60

+ +

aGroupTool = mesh.CreateGroup( + SMESH.FACE, "Area < 60" )

+ +

aGroupTool.Add( + anIds )

+ +

 

+ +

print "Criterion: + Area < 60 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

  

+ +

# create an intersection + of groups : area >= 60

+ +

aGroupRes = mesh.CutGroups(aGroupMain, + aGroupTool, "Area >= 60")

+ +

print "Criterion: + Area >= 60 Nb = ", len( aGroupRes.GetListOfID() )

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

   

+ + + + diff --git a/doc/salome/gui/SMESH/image10.jpg b/doc/salome/gui/SMESH/image10.jpg index 5a15643bb..14cea8618 100755 Binary files a/doc/salome/gui/SMESH/image10.jpg and b/doc/salome/gui/SMESH/image10.jpg differ diff --git a/doc/salome/gui/SMESH/image129.gif b/doc/salome/gui/SMESH/image129.gif deleted file mode 100755 index c3d2c60cf..000000000 Binary files a/doc/salome/gui/SMESH/image129.gif and /dev/null differ diff --git a/doc/salome/gui/SMESH/image131.gif b/doc/salome/gui/SMESH/image131.gif index 8ca3453fd..dc6433146 100755 Binary files a/doc/salome/gui/SMESH/image131.gif and b/doc/salome/gui/SMESH/image131.gif differ diff --git a/doc/salome/gui/SMESH/image138.gif b/doc/salome/gui/SMESH/image138.gif deleted file mode 100644 index 1659aab9f..000000000 Binary files a/doc/salome/gui/SMESH/image138.gif and /dev/null differ diff --git a/doc/salome/gui/SMESH/image139.gif b/doc/salome/gui/SMESH/image139.gif deleted file mode 100644 index 03943831c..000000000 Binary files a/doc/salome/gui/SMESH/image139.gif and /dev/null differ diff --git a/doc/salome/gui/SMESH/image19.jpg b/doc/salome/gui/SMESH/image19.jpg deleted file mode 100755 index f5c63956a..000000000 Binary files a/doc/salome/gui/SMESH/image19.jpg and /dev/null differ diff --git a/doc/salome/gui/SMESH/image21.gif b/doc/salome/gui/SMESH/image21.gif deleted file mode 100755 index 5dbd12184..000000000 Binary files a/doc/salome/gui/SMESH/image21.gif and /dev/null differ diff --git a/doc/salome/gui/SMESH/image22.gif b/doc/salome/gui/SMESH/image22.gif deleted file mode 100755 index 18b53bf4d..000000000 Binary files a/doc/salome/gui/SMESH/image22.gif and /dev/null differ diff --git a/doc/salome/gui/SMESH/image23.gif b/doc/salome/gui/SMESH/image23.gif deleted file mode 100755 index 5a1216dc6..000000000 Binary files a/doc/salome/gui/SMESH/image23.gif and /dev/null differ diff --git a/doc/salome/gui/SMESH/image24.gif b/doc/salome/gui/SMESH/image24.gif index 3d8032bf0..c678a6132 100755 Binary files a/doc/salome/gui/SMESH/image24.gif and b/doc/salome/gui/SMESH/image24.gif differ diff --git a/doc/salome/gui/SMESH/image26.jpg b/doc/salome/gui/SMESH/image26.jpg deleted file mode 100755 index 3a02cb997..000000000 Binary files a/doc/salome/gui/SMESH/image26.jpg and /dev/null differ diff --git a/doc/salome/gui/SMESH/image27.gif b/doc/salome/gui/SMESH/image27.gif deleted file mode 100755 index 6c8485ca9..000000000 Binary files a/doc/salome/gui/SMESH/image27.gif and /dev/null differ diff --git a/doc/salome/gui/SMESH/image37.gif b/doc/salome/gui/SMESH/image37.gif index edd5263d8..43592da64 100755 Binary files a/doc/salome/gui/SMESH/image37.gif and b/doc/salome/gui/SMESH/image37.gif differ diff --git a/doc/salome/gui/SMESH/image7.jpg b/doc/salome/gui/SMESH/image7.jpg index cbd6170ee..ded3ae99a 100755 Binary files a/doc/salome/gui/SMESH/image7.jpg and b/doc/salome/gui/SMESH/image7.jpg differ diff --git a/doc/salome/gui/SMESH/image71.jpg b/doc/salome/gui/SMESH/image71.jpg index cb1223d38..bdb07ea6b 100755 Binary files a/doc/salome/gui/SMESH/image71.jpg and b/doc/salome/gui/SMESH/image71.jpg differ diff --git a/doc/salome/gui/SMESH/image73.gif b/doc/salome/gui/SMESH/image73.gif deleted file mode 100755 index 504816a3c..000000000 Binary files a/doc/salome/gui/SMESH/image73.gif and /dev/null differ diff --git a/doc/salome/gui/SMESH/image74.gif b/doc/salome/gui/SMESH/image74.gif index c66029e74..db8a4c8cd 100755 Binary files a/doc/salome/gui/SMESH/image74.gif and b/doc/salome/gui/SMESH/image74.gif differ diff --git a/doc/salome/gui/SMESH/index.htm b/doc/salome/gui/SMESH/index.htm index 767e2b766..3163eee1b 100755 --- a/doc/salome/gui/SMESH/index.htm +++ b/doc/salome/gui/SMESH/index.htm @@ -1,180 +1,180 @@ - - -Mesh Module Reference Manual - - - - - - - - - - - - - + + +Mesh Module Reference Manual + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/index_csh.htm b/doc/salome/gui/SMESH/index_csh.htm index 2bd1f6387..867d877c9 100755 --- a/doc/salome/gui/SMESH/index_csh.htm +++ b/doc/salome/gui/SMESH/index_csh.htm @@ -1,106 +1,106 @@ - - -Mesh Module Reference Manual - - - - - - - - - - - - + + +Mesh Module Reference Manual + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/index_rhc.htm b/doc/salome/gui/SMESH/index_rhc.htm index 4e8723907..b751bd4c8 100755 --- a/doc/salome/gui/SMESH/index_rhc.htm +++ b/doc/salome/gui/SMESH/index_rhc.htm @@ -1,106 +1,106 @@ - - -Mesh Module Reference Manual - - - - - - - - - - - - + + +Mesh Module Reference Manual + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/length.htm b/doc/salome/gui/SMESH/length.htm index ea7c01310..db7b0ae0f 100755 --- a/doc/salome/gui/SMESH/length.htm +++ b/doc/salome/gui/SMESH/length.htm @@ -1,112 +1,118 @@ - - - - - -Length - - - - - - - - - - - - -

Length

- -

The Length quality control criterion returns a value - of length of edge.

- -

 

- -

- -

 

- -

 

- -

See Also - a sample TUI Script of a  Length - quality control operation.  

- -

.

- - - - + + + + + +Length + + + + + + + + + + + + + +

Length

+ +

The Length quality control criterion returns a value + of length of edge.

+ +

 

+ +

+ +

 

+ +

 

+ +

See Also + a sample TUI Script of a  Length + quality control operation.  

+ +

.

+ + + + diff --git a/doc/salome/gui/SMESH/merge_elements.htm b/doc/salome/gui/SMESH/merge_elements.htm index 32b5ebfb8..f210b6af8 100755 --- a/doc/salome/gui/SMESH/merge_elements.htm +++ b/doc/salome/gui/SMESH/merge_elements.htm @@ -1,101 +1,101 @@ - - - - - -Merge Elements - - - - - - - - - - -

Merging Elements

- -

This functionality allows to merge coincident elements - of a mesh selectable in the dialog box.

- -

- -

In this picture you see a triangle which coincides with one of the elements - of the mesh. After we apply Merge Elements - functionality, the triangle will be completely merged with the mesh.

- -

- -

  See - Also a sample TUI Script of a Merge - Elements operation.  

- -

 

- -

 

- - - - + + + + + +Merge Elements + + + + + + + + + + +

Merging Elements

+ +

This functionality allows to merge coincident elements + of a mesh selectable in the dialog box.

+ +

+ +

In this picture you see a triangle which coincides with one of the elements + of the mesh. After we apply Merge Elements + functionality, the triangle will be completely merged with the mesh.

+ +

+ +

  See + Also a sample TUI Script of a Merge + Elements operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/mesh.htm b/doc/salome/gui/SMESH/mesh.htm index be7069d51..f849df81a 100755 --- a/doc/salome/gui/SMESH/mesh.htm +++ b/doc/salome/gui/SMESH/mesh.htm @@ -1,216 +1,216 @@ - - - - - -mesh - - - - - - - - - - - -

Introduction to MESH

- -

 

- -

MESH - module of SALOME is destined for:

- - - -

- -

for edges:

- -
    - - -
- -

for faces:

- -
    - - -
- -

for solids:

- -
    - - -
- -

.

- - - - + + + + + +mesh + + + + + + + + + + + +

Introduction to MESH

+ +

 

+ +

MESH + module of SALOME is destined for:

+ + + +

+ +

for edges:

+ +
    + + +
+ +

for faces:

+ +
    + + +
+ +

for solids:

+ +
    + + +
+ +

.

+ + + + diff --git a/doc/salome/gui/SMESH/modifying_meshes.htm b/doc/salome/gui/SMESH/modifying_meshes.htm index 8ba2b742c..4e44b555e 100755 --- a/doc/salome/gui/SMESH/modifying_meshes.htm +++ b/doc/salome/gui/SMESH/modifying_meshes.htm @@ -1,1085 +1,1576 @@ - - - - - -Modifying Meshes - - - - - - - - - - -

Modifying Meshes

- -

Adding Nodes and Elements

- -

Add Node

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# add node

- -

aMeshEditor = mesh.GetMeshEditor()

- -

if aMeshEditor.AddNode(50, - 10, 0) == 1:

- -

    print - "Node addition is OK!"

- -

else:

- -

    print - "KO node addition."

- -

    

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Add Edge

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# add node

- -

aMeshEditor = mesh.GetMeshEditor()

- -

if aMeshEditor.AddNode(50, - 10, 0) == 1:

- -

    print - "Node addition is OK!"

- -

else:

- -

    print - "KO node addition."

- -

 

- -

# add edge

- -

LastNodeId = mesh.NbNodes()

- -

if aMeshEditor.AddEdge([LastNodeId, - 38]) == 1:

- -

    print - "Edge addition is OK!"

- -

else:

- -

    print - "KO edge addition."

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Add Triangle

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# add node

- -

aMeshEditor = mesh.GetMeshEditor()

- -

if aMeshEditor.AddNode(50, - 10, 0) == 1:

- -

    print - "Node addition is OK!"

- -

else:

- -

    print - "KO node addition."

- -

 

- -

LastNodeId = mesh.NbNodes()

- -

 

- -

# add triangle

- -

if aMeshEditor.AddFace([LastNodeId, - 38, 39]) == 1:

- -

    print - "Triangle addition is OK!"

- -

else:

- -

    print - "KO triangle addition."

- -

    

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Add Quadrangle

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# add node

- -

aMeshEditor = mesh.GetMeshEditor()

- -

if aMeshEditor.AddNode(50, - 10, 0) == 1:

- -

    print - "Node addition is OK!"

- -

else:

- -

    print - "KO node addition."

- -

 

- -

LastNodeId = mesh.NbNodes()

- -

 

- -

# add quadrangle

- -

if aMeshEditor.AddNode(40, - 20, 0) == 1:

- -

    print - "Node addition is OK!"

- -

else:

- -

    print - "KO node addition."

- -

if aMeshEditor.AddFace([mesh.NbNodes(), - LastNodeId, 38, 39]) == 1:

- -

    print - "Quadrangle addition is OK!"

- -

else:

- -

    print - "KO quadrangle addition."

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Add Tetrahedron

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# add node

- -

aMeshEditor = mesh.GetMeshEditor()

- -

if aMeshEditor.AddNode(50, - 10, 0) == 1:

- -

    print - "Node addition is OK!"

- -

else:

- -

    print - "KO node addition."

- -

 

- -

LastNodeId = mesh.NbNodes()

- -

 

- -

# add tetrahedron

- -

if aMeshEditor.AddVolume([LastNodeId, - 38, 39, 246]) == 1:

- -

    print - "Tetrahedron addition is OK!"

- -

else:

- -

    print - "KO tetrahedron addition."

- -

    

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Add Hexahedron

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# add nodes

- -

aMeshEditor = mesh.GetMeshEditor()

- -

if aMeshEditor.AddNode(50, - 10, 0) == 1:

- -

    print - "Node addition is OK!"

- -

else:

- -

    print - "KO node addition."

- -

aNodeId1 = mesh.NbNodes()

- -

 

- -

if aMeshEditor.AddNode(47, - 12, 0) == 1:

- -

    print - "Node addition is OK!"

- -

else:

- -

    print - "KO node addition."

- -

aNodeId2 = mesh.NbNodes()

- -

 

- -

if aMeshEditor.AddNode(50, - 10, 10) == 1:

- -

    print - "Node addition is OK!"

- -

else:

- -

    print - "KO node addition."

- -

aNodeId3 = mesh.NbNodes()

- -

 

- -

if aMeshEditor.AddNode(47, - 12, 10) == 1:

- -

    print - "Node addition is OK!"

- -

else:

- -

    print - "KO node addition."

- -

aNodeId4 = mesh.NbNodes()

- -

 

- -

# add hexahedron

- -

if aMeshEditor.AddVolume([aNodeId2, - aNodeId1, 38, 39, aNodeId4, aNodeId3, 245, 246]) == 1:

- -

    print - "Hexahedron addition is OK!"

- -

else:

- -

    print - "KO Hexahedron addition."

- -

    

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Removing Nodes and Elements

- -

Removing Nodes

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# add node

- -

aMeshEditor = mesh.GetMeshEditor()

- -

if aMeshEditor.RemoveNodes([246, - 255]) == 1:

- -

    print - "Node removing is OK!"

- -

else:

- -

    print - "KO node removing."

- -

    

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Removing Elements

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

anEditor = mesh.GetMeshEditor()

- -

anEditor.RemoveElements([850, - 859, 814])

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Renumbering Nodes and Elements

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

anEditor = mesh.GetMeshEditor()

- -

anEditor.RenumberNodes()

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

 

- -

Moving Nodes

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# move node

- -

aMeshEditor = mesh.GetMeshEditor()

- -

aMeshEditor.MoveNode(38, - 20, 10, 0)

- -

    

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Diagonal Inversion

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# inverse diagonal

- -

aMeshEditor = mesh.GetMeshEditor()

- -

aMeshEditor.InverseDiag(700, - 642)

- -

    

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Uniting two Triangles

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# delete diagonal

- -

aMeshEditor = mesh.GetMeshEditor()

- -

aMeshEditor.DeleteDiag(700, - 642)

- -

    

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Uniting a Set of Triangles

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# unite a set of triangles

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateMinimumAngle()

- -

 

- -

aMeshEditor = mesh.GetMeshEditor()

- -

aMeshEditor.TriToQuad([1145, - 1147, 1159, 1135], aFunctor, 60)

- -

    

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Cutting Quadrangles

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# unite a set of triangles

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateMinimumAngle()

- -

 

- -

aMeshEditor = mesh.GetMeshEditor()

- -

aMeshEditor.QuadToTri([405, - 406], aFunctor)

- -

    

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Smoothing

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# smooth

- -

FacesSmooth = [911, - 931, 950, 864, 932]

- -

GroupSmooth = mesh.CreateGroup(SMESH.FACE,"Group - of faces (smooth)")

- -

GroupSmooth.Add(FacesSmooth)

- -

 

- -

aMeshEditor = mesh.GetMeshEditor()

- -

aMeshEditor.SmoothObject(GroupSmooth, - [], 20, 2, SMESH.SMESH_MeshEditor.CENTROIDAL_SMOOTH)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

 

- -

Extrusion

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# extrusion of the group

- -

point = SMESH.PointStruct(0, - 0, 5)

- -

vector = SMESH.DirStruct(point)

- -

FacesTriToQuad = [2381, - 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, - 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, - 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 2417, - 2418, 2419, 2420, 2421, 2422]

- -

 

- -

GroupTriToQuad = mesh.CreateGroup(SMESH.FACE,"Group - of faces (quad)")

- -

GroupTriToQuad.Add(FacesTriToQuad)

- -

 

- -

aMeshEditor = mesh.GetMeshEditor()

- -

aMeshEditor.ExtrusionSweepObject(GroupTriToQuad, - vector, 5)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Extrusion along a Path

- -

import geompy

- -

import smesh

- -

import salome

- -

import SMESH

- -

 

- -

# create a 2D mesh on - a face

- -

# create vertices

- -

px   = - geompy.MakeVertex(100., 0.  , - 0.  )

- -

py   = - geompy.MakeVertex(0.  , - 100., 0.  )

- -

pz   = - geompy.MakeVertex(0.  , - 0.  , 100.)

- -

 

- -

# create a vector from - two points

- -

vxy = geompy.MakeVector(px, - py)

- -

 

- -

# create an arc from - three points

- -

arc = geompy.MakeArc(py, - pz, px)

- -

 

- -

# create a wire

- -

wire = geompy.MakeWire([vxy, - arc])

- -

isPlanarFace = 1

- -

 

- -

# create a face from - the wire

- -

face1 = geompy.MakeFace(wire, - isPlanarFace)

- -

 

- -

# add objects in the - study

- -

id_face1 = geompy.addToStudy(face1,"Face1")

- -

 

- -

# create hexahedrical - mesh

- -

hexa = smesh.Mesh(face1, - "Face compound : hexahedrical mesh")

- -

algo = hexa.Triangle()

- -

 

- -

# define "MaxElementArea" - hypothesis to be applied to each triangle

- -

algo.MaxElementArea(30)

- -

 

- -

# create a quadrangle - 2D algorithm for faces

- -

hexa.Quadrangle()

- -

 

- -

# create a local hypothesis

- -

algo = hexa.Segment(wire)

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut an edge in a fixed number of segments

- -

algo.NumberOfSegments(6)

- -

 

- -

# compute the mesh

- -

hexa.Compute()

- -

 

- -

# create path mesh and - path shape

- -

# create a circle from - three points

- -

px1   = - geompy.MakeVertex(100., 100.  , - 0.  )

- -

py1   = - geompy.MakeVertex(-100.  , - -100., 0.  )

- -

pz1   = - geompy.MakeVertex(0.  , - 0.  , 50.)

- -

circle = geompy.MakeCircleThreePnt(py1, - pz1, px1)

- -

 

- -

# add objects in the - study

- -

id_circle = geompy.addToStudy(circle,"Path")

- -

circlemesh = smesh.Mesh(circle, - "Path mesh")

- -

 

- -

# create a local hypothesis

- -

algo = circlemesh.Segment()

- -

# define "NumberOfSegments" - hypothesis to cut an edge in a fixed number of segments

- -

algo.NumberOfSegments(10)

- -

 

- -

# compute the mesh

- -

circlemesh.Compute()

- -

 

- -

# extrusion of the mesh

- -

aMeshEditor = hexa.GetMesh().GetMeshEditor()

- -

aMeshEditor.ExtrusionAlongPathObject(hexa.GetMesh(), - circlemesh.GetMesh(), circle, 1, 0, [], 0, SMESH.PointStruct(0, 0, 0))

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Revolution

- -

import SMESH

- -

import SMESH_mechanic

- -

import math

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# rotate a sweep object

- -

FacesRotate = [492, - 493, 502, 503]

- -

GroupRotate = mesh.CreateGroup(SMESH.FACE,"Group - of faces (rotate)")

- -

GroupRotate.Add(FacesRotate)

- -

angle45 =  45*math.pi/180

- -

axisXYZ = SMESH.AxisStruct(-38.3128, - -73.3658, -23.321, -13.3402, -13.3265, 6.66632)

- -

 

- -

aMeshEditor = mesh.GetMeshEditor()

- -

aMeshEditor.RotationSweepObject(GroupRotate, - axisXYZ, angle45, 4, 1e-5)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- - - - + + + + + +Modifying Meshes + + + + + + + + + + + +

Modifying Meshes

+ +

Adding Nodes and Elements

+ +

Add Node

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# add node

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

if aMeshEditor.AddNode(50, + 10, 0) == 1:

+ +

    print + "Node addition is OK!"

+ +

else:

+ +

    print + "KO node addition."

+ +

    

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Add Edge

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# add node

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

if aMeshEditor.AddNode(50, + 10, 0) == 1:

+ +

    print + "Node addition is OK!"

+ +

else:

+ +

    print + "KO node addition."

+ +

 

+ +

# add edge

+ +

LastNodeId = mesh.NbNodes()

+ +

if aMeshEditor.AddEdge([LastNodeId, + 38]) == 1:

+ +

    print + "Edge addition is OK!"

+ +

else:

+ +

    print + "KO edge addition."

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Add Triangle

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# add node

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

if aMeshEditor.AddNode(50, + 10, 0) == 1:

+ +

    print + "Node addition is OK!"

+ +

else:

+ +

    print + "KO node addition."

+ +

 

+ +

LastNodeId = mesh.NbNodes()

+ +

 

+ +

# add triangle

+ +

if aMeshEditor.AddFace([LastNodeId, + 38, 39]) == 1:

+ +

    print + "Triangle addition is OK!"

+ +

else:

+ +

    print + "KO triangle addition."

+ +

    

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Add Quadrangle

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# add node

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

if aMeshEditor.AddNode(50, + 10, 0) == 1:

+ +

    print + "Node addition is OK!"

+ +

else:

+ +

    print + "KO node addition."

+ +

 

+ +

LastNodeId = mesh.NbNodes()

+ +

 

+ +

# add quadrangle

+ +

if aMeshEditor.AddNode(40, + 20, 0) == 1:

+ +

    print + "Node addition is OK!"

+ +

else:

+ +

    print + "KO node addition."

+ +

if aMeshEditor.AddFace([mesh.NbNodes(), + LastNodeId, 38, 39]) == 1:

+ +

    print + "Quadrangle addition is OK!"

+ +

else:

+ +

    print + "KO quadrangle addition."

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Add Tetrahedron

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# add node

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

if aMeshEditor.AddNode(50, + 10, 0) == 1:

+ +

    print + "Node addition is OK!"

+ +

else:

+ +

    print + "KO node addition."

+ +

 

+ +

LastNodeId = mesh.NbNodes()

+ +

 

+ +

# add tetrahedron

+ +

if aMeshEditor.AddVolume([LastNodeId, + 38, 39, 246]) == 1:

+ +

    print + "Tetrahedron addition is OK!"

+ +

else:

+ +

    print + "KO tetrahedron addition."

+ +

    

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Add Hexahedron

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# add nodes

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

if aMeshEditor.AddNode(50, + 10, 0) == 1:

+ +

    print + "Node addition is OK!"

+ +

else:

+ +

    print + "KO node addition."

+ +

aNodeId1 = mesh.NbNodes()

+ +

 

+ +

if aMeshEditor.AddNode(47, + 12, 0) == 1:

+ +

    print + "Node addition is OK!"

+ +

else:

+ +

    print + "KO node addition."

+ +

aNodeId2 = mesh.NbNodes()

+ +

 

+ +

if aMeshEditor.AddNode(50, + 10, 10) == 1:

+ +

    print + "Node addition is OK!"

+ +

else:

+ +

    print + "KO node addition."

+ +

aNodeId3 = mesh.NbNodes()

+ +

 

+ +

if aMeshEditor.AddNode(47, + 12, 10) == 1:

+ +

    print + "Node addition is OK!"

+ +

else:

+ +

    print + "KO node addition."

+ +

aNodeId4 = mesh.NbNodes()

+ +

 

+ +

# add hexahedron

+ +

if aMeshEditor.AddVolume([aNodeId2, + aNodeId1, 38, 39, aNodeId4, aNodeId3, 245, 246]) == 1:

+ +

    print + "Hexahedron addition is OK!"

+ +

else:

+ +

    print + "KO Hexahedron addition."

+ +

    

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Add Polygon

+ +

import salome

+ +

import geompy

+ +

import math

+ +

 

+ +

import StdMeshers

+ +

 

+ +

# GEOM module

+ +

shape_mesh = geompy.MakeCylinderRH(13, + 77)

+ +

geompy.addToStudy(shape_mesh, + "cylinder")

+ +

 

+ +

# SMESH module

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smesh.SetCurrentStudy(salome.myStudy)

+ +

mesh = smesh.CreateMesh(shape_mesh)

+ +

MeshEditor = mesh.GetMeshEditor()

+ +

 

+ +

# a method to build a polygonal + mesh element with nb_vert angles:

+ +

def MakePolygon + (a_mesh, x0, y0, z0, radius, nb_vert):

+ +

    node_start_id + = a_mesh.NbNodes() + 1

+ +

    al + = 2.0 * math.pi / nb_vert

+ +

    node_ids + = []

+ +

    

+ +

# Create nodes for a polyhedron

+ +

    for + ii in range(nb_vert):

+ +

        MeshEditor.AddNode(x0 + + radius * math.cos(ii*al),

+ +

                           y0 + + radius * math.sin(ii*al),

+ +

                           z0)

+ +

        node_ids.append(node_start_id + + ii)

+ +

        pass

+ +

    

+ +

# Create a polygon

+ +

    MeshEditor.AddPolygonalFace(node_ids)

+ +

    return + 0

+ +

 

+ +

# Create three polygons

+ +

MakePolygon(mesh, + 0, 0,  0, + 30, 13)

+ +

MakePolygon(mesh, + 0, 0, 10, 21,  9)

+ +

MakePolygon(mesh, + 0, 0, 20, 13,  6)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +  

+ +

 

+ +

Add polyhedron

+ +

import + salome

+ +

import geompy

+ +

import math

+ +

 

+ +

#import SMESH

+ +

import StdMeshers

+ +

 

+ +

# GEOM

+ +

shape_mesh = geompy.MakeCylinderRH(13, + 77)

+ +

geompy.addToStudy(shape_mesh, + "cylinder")

+ +

 

+ +

# SMESH

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smesh.SetCurrentStudy(salome.myStudy)

+ +

mesh = smesh.CreateMesh(shape_mesh)

+ +

MeshEditor = mesh.GetMeshEditor()

+ +

 

+ +

# Now we are going + to create a 12-hedron:

+ +

 

+ +

# Create nodes for + polyhedron

+ +

al = 2 * math.pi + / 5.0

+ +

cosal = math.cos(al)

+ +

 

+ +

aa = 13

+ +

rr = aa / (2.0 * + math.sin(al/2.0))

+ +

dr = 2.0 * rr * + cosal

+ +

r1 = rr + dr

+ +

dh = rr * math.sqrt(2.0 + * (1.0 - cosal * (1.0 + 2.0 * cosal)))

+ +

hh = 2.0 * dh - + dr * (rr*(cosal - 1) + (rr + dr)*(math.cos(al/2) - 1)) / dh

+ +

 

+ +

for i in range(5):

+ +

    MeshEditor.AddNode(rr*math.cos(i*al), + rr*math.sin(i*al),  0) + # 1,3,5,7, 9 # bottom

+ +

    MeshEditor.AddNode(r1*math.cos(i*al), + r1*math.sin(i*al), dh) # + 2,4,6,8,10 # above bottom

+ +

 

+ +

for i in range(5):

+ +

    MeshEditor.AddNode(rr*math.cos(i*al + + al/2.0),

+ +

                       rr*math.sin(i*al + + al/2.0), hh) # 11,13,15,17,19 # + top

+ +

    MeshEditor.AddNode(r1*math.cos(i*al + + al/2.0),

+ +

                       r1*math.sin(i*al + + al/2.0), hh - dh) # 12,14,16,18,20 # + below top

+ +

 

+ +

# Create a polyhedral + volume

+ +

MeshEditor.AddPolyhedralVolume([ + 1,  3,  5, +  7,  9, +  # + bottom

+ +

                                 1, +  2, 12, +  4,  3, +  # + .

+ +

                                 3, +  4, 14, +  6,  5, +  # + .

+ +

                                 5, +  6, 16, +  8,  7, +  # + . above bottom

+ +

                                 7, +  8, 18, + 10,  9, +  # + .

+ +

                                 9, + 10, 20,  2, +  1,  # + .

+ +

                                11, + 12,  4, + 14, 13,  # + -

+ +

                                13, + 14,  6, + 16, 15,  # + -

+ +

                                15, + 16,  8, + 18, 17,  # + - below top

+ +

                                17, + 18, 10, 20, 19,  # + -

+ +

                                19, + 20,  2, + 12, 11,  # + -

+ +

                                11, + 13, 15, 17, 19], # + top

+ +

                               [5,5,5,5,5,5,5,5,5,5,5,5])

+ +

 

+ +

salome.sg.updateObjBrowser(1) +  

+ +

 

+ +

Removing Nodes and Elements

+ +

Removing Nodes

+ +

 

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# add node

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

if aMeshEditor.RemoveNodes([246, + 255]) == 1:

+ +

    print + "Node removing is OK!"

+ +

else:

+ +

    print + "KO node removing."

+ +

    

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Removing Elements

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

anEditor = mesh.GetMeshEditor()

+ +

anEditor.RemoveElements([850, + 859, 814])

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Renumbering Nodes and Elements

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

anEditor = mesh.GetMeshEditor()

+ +

anEditor.RenumberNodes()

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

 

+ +

Moving Nodes

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# move node

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

aMeshEditor.MoveNode(38, + 20, 10, 0)

+ +

    

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Diagonal Inversion

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# inverse diagonal

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

aMeshEditor.InverseDiag(700, + 642)

+ +

    

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Uniting two Triangles

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# delete diagonal

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

aMeshEditor.DeleteDiag(700, + 642)

+ +

    

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Uniting a Set of Triangles

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# unite a set of triangles

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

aFunctor = aFilterMgr.CreateMinimumAngle()

+ +

 

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

aMeshEditor.TriToQuad([1145, + 1147, 1159, 1135], aFunctor, 60)

+ +

    

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Orientation

+ +

import + salome

+ +

import geompy

+ +

 

+ +

import StdMeshers

+ +

 

+ +

# GEOM module

+ +

shape_mesh = geompy.MakeCylinderRH(13, + 77)

+ +

geompy.addToStudy(shape_mesh, + "cylinder")

+ +

 

+ +

# SMESH module

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smesh.SetCurrentStudy(salome.myStudy)

+ +

mesh = smesh.CreateMesh(shape_mesh)

+ +

MeshEditor = mesh.GetMeshEditor()

+ +

 

+ +

# build five quadrangles:

+ +

node_start_id = mesh.NbNodes() + + 1

+ +

dx = 10

+ +

dy = 20

+ +

 

+ +

MeshEditor.AddNode(0.0 + * dx, 0, 0) # 1

+ +

MeshEditor.AddNode(1.0 + * dx, 0, 0) # 2

+ +

MeshEditor.AddNode(2.0 + * dx, 0, 0) # 3

+ +

MeshEditor.AddNode(3.0 + * dx, 0, 0) # 4

+ +

MeshEditor.AddNode(4.0 + * dx, 0, 0) # 5

+ +

MeshEditor.AddNode(5.0 + * dx, 0, 0) # 6

+ +

 

+ +

MeshEditor.AddNode(0.0 + * dx, dy, 0) # 7

+ +

MeshEditor.AddNode(1.0 + * dx, dy, 0) # 8

+ +

MeshEditor.AddNode(2.0 + * dx, dy, 0) # 9

+ +

MeshEditor.AddNode(3.0 + * dx, dy, 0) # 10

+ +

MeshEditor.AddNode(4.0 + * dx, dy, 0) # 11

+ +

MeshEditor.AddNode(5.0 + * dx, dy, 0) # 12

+ +

 

+ +

MeshEditor.AddFace([1, + 2,  8,  7])

+ +

MeshEditor.AddFace([2, + 3,  9,  8])

+ +

MeshEditor.AddFace([3, + 4, 10,  9])

+ +

MeshEditor.AddFace([4, + 5, 11, 10])

+ +

MeshEditor.AddFace([5, + 6, 12, 11])

+ +

 

+ +

# Change orientation + of the second and the fourth faces.

+ +

MeshEditor.Reorient([2, + 4])

+ +

 

+ +

salome.sg.updateObjBrowser(1) +  

+ +

 

+ +

Cutting Quadrangles

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# unite a set of triangles

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

aFunctor = aFilterMgr.CreateMinimumAngle()

+ +

 

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

aMeshEditor.QuadToTri([405, + 406], aFunctor)

+ +

    

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Smoothing

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# smooth

+ +

FacesSmooth = [911, + 931, 950, 864, 932]

+ +

GroupSmooth = mesh.CreateGroup(SMESH.FACE,"Group + of faces (smooth)")

+ +

GroupSmooth.Add(FacesSmooth)

+ +

 

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

aMeshEditor.SmoothObject(GroupSmooth, + [], 20, 2, SMESH.SMESH_MeshEditor.CENTROIDAL_SMOOTH)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

 

+ +

Extrusion

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# extrusion of the group

+ +

point = SMESH.PointStruct(0, + 0, 5)

+ +

vector = SMESH.DirStruct(point)

+ +

FacesTriToQuad = [2381, + 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, + 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, + 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 2417, + 2418, 2419, 2420, 2421, 2422]

+ +

 

+ +

GroupTriToQuad = mesh.CreateGroup(SMESH.FACE,"Group + of faces (quad)")

+ +

GroupTriToQuad.Add(FacesTriToQuad)

+ +

 

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

aMeshEditor.ExtrusionSweepObject(GroupTriToQuad, + vector, 5)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Extrusion along a Path

+ +

import geompy

+ +

import smesh

+ +

import salome

+ +

import SMESH

+ +

 

+ +

# create a face to be + meshed

+ +

px = geompy.MakeVertex(100., + 0.  , 0. +  )

+ +

py = geompy.MakeVertex(0. +  , 100., + 0.  )

+ +

pz = geompy.MakeVertex(0. +  , 0.  , + 100.)

+ +

 

+ +

vxy = geompy.MakeVector(px, + py)

+ +

arc = geompy.MakeArc(py, + pz, px)

+ +

 

+ +

wire = geompy.MakeWire([vxy, + arc])

+ +

isPlanarFace = 1

+ +

 

+ +

face1 = geompy.MakeFace(wire, + isPlanarFace)

+ +

id_face1 = geompy.addToStudy(face1, + "Face1")

+ +

 

+ +

# create a 2D mesh on + the face

+ +

trias = smesh.Mesh(face1, + "Face : 2D mesh")

+ +

 

+ +

algo = trias.Segment()

+ +

algo.NumberOfSegments(6)

+ +

 

+ +

algo = trias.Triangle()

+ +

algo.LengthFromEdges()

+ +

 

+ +

trias.Compute()

+ +

 

+ +

# create a path mesh

+ +

px1 = geompy.MakeVertex(100., + 100.  , + 0.  )

+ +

py1 = geompy.MakeVertex(-100. +  , -100., + 0.  )

+ +

pz1 = geompy.MakeVertex(0. +  , 0.  , + 50.)

+ +

 

+ +

circle = geompy.MakeCircleThreePnt(py1, + pz1, px1)

+ +

id_circle = geompy.addToStudy(circle, + "Path")

+ +

 

+ +

circlemesh = smesh.Mesh(circle, + "Path mesh")

+ +

 

+ +

algo = circlemesh.Segment()

+ +

algo.NumberOfSegments(10)

+ +

 

+ +

circlemesh.Compute()

+ +

 

+ +

# extrusion of the mesh

+ +

# The mesh "trias" + will be extruded along another mesh, which is a sub-mesh of "circlemesh",

+ +

# + corresponding to geometry "circle". In this particular case + the path mesh will be the whole "circlemesh"

+ +

 

+ +

aMeshEditor = trias.GetMesh().GetMeshEditor()

+ +

aMeshEditor.ExtrusionAlongPathObject(trias.GetMesh(), + circlemesh.GetMesh(), circle, 1, 0, [], 0, SMESH.PointStruct(0, 0, 0))

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

Revolution

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

import math

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# rotate a sweep object

+ +

FacesRotate = [492, + 493, 502, 503]

+ +

GroupRotate = mesh.CreateGroup(SMESH.FACE,"Group + of faces (rotate)")

+ +

GroupRotate.Add(FacesRotate)

+ +

angle45 =  45*math.pi/180

+ +

axisXYZ = SMESH.AxisStruct(-38.3128, + -73.3658, -23.321, -13.3402, -13.3265, 6.66632)

+ +

 

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

aMeshEditor.RotationSweepObject(GroupRotate, + axisXYZ, angle45, 4, 1e-5)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Pattern Mapping

+ +

import salome

+ +

import geompy

+ +

import SMESH, smesh

+ +

 

+ +

geompy.init_geom(salome.myStudy)

+ +

smesh.smesh.SetCurrentStudy(salome.myStudy)

+ +

 

+ +

# define geometry

+ +

Box_1 = geompy.MakeBoxDXDYDZ(200, + 200, 200)

+ +

geompy.addToStudy(Box_1, + "Box_1")

+ +

 

+ +

faces = geompy.SubShapeAll(Box_1, + geompy.ShapeType["FACE"])

+ +

Face_1 = faces[0]

+ +

Face_2 = faces[1]

+ +

geompy.addToStudyInFather(Box_1, + Face_1, "Face_1")

+ +

geompy.addToStudyInFather(Box_1, + Face_2, "Face_2")

+ +

 

+ +

# build quadrangle mesh + 3x3 on Face_1

+ +

Mesh_1 = smesh.Mesh(Face_1)

+ +

Wire_discretisation + = Mesh_1.Segment()

+ +

Wire_discretisation.NumberOfSegments(3)

+ +

Mesh_1.Quadrangle()

+ +

 

+ +

isDone = Mesh_1.Compute()

+ +

if not isDone: print + 'Mesh Mesh_1 : computation failed'

+ +

 

+ +

# pattern the mesh

+ +

Mesh_2 = smesh.Mesh(Face_2)

+ +

Nb_Segments_1 = smesh.smesh.CreateHypothesis('NumberOfSegments', + 'libStdMeshersEngine.so')

+ +

Nb_Segments_1.SetNumberOfSegments(1)

+ +

status = Mesh_2.GetMesh().AddHypothesis(Face_2, + Nb_Segments_1)

+ +

status = Mesh_2.GetMesh().AddHypothesis(Face_2, + Wire_discretisation.GetAlgorithm())

+ +

Triangle_Mefisto = + Mesh_2.Triangle()

+ +

Max_Element_Area = + Triangle_Mefisto.MaxElementArea(240)

+ +

 

+ +

isDone = Mesh_2.Compute()

+ +

if not isDone: print + 'Mesh Mesh_2 : computation failed'

+ +

 

+ +

# create a pattern

+ +

pattern = smesh.smesh.GetPattern()

+ +

isDone = pattern.LoadFromFace(Mesh_2.GetMesh(), + Face_2, 0)

+ +

if (isDone != 1):

+ +

print + 'LoadFromFace :', pattern.GetErrorCode()

+ +

 

+ +

# apply the pattern to + a face of the first mesh

+ +

pattern.ApplyToMeshFaces(Mesh_1.GetMesh(), + [17], 0, 0)

+ +

isDone = pattern.MakeMesh(Mesh_1.GetMesh(), + 0, 0)

+ +

if (isDone != 1):

+ +

print + 'MakeMesh :', pattern.GetErrorCode()

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ + + + diff --git a/doc/salome/gui/SMESH/pattern_mapping.htm b/doc/salome/gui/SMESH/pattern_mapping.htm index bc8b8a03b..87685f026 100755 --- a/doc/salome/gui/SMESH/pattern_mapping.htm +++ b/doc/salome/gui/SMESH/pattern_mapping.htm @@ -1,298 +1,311 @@ - - - - - -Pattern mapping - - - - - - - - - - - - -

Pattern mapping

- -

About patterns

- -

The pattern describes a mesh to generate: positions of - nodes within a geometrical domain and nodal connectivity of elements. - As well, a pattern specifies the so-called key-points, i.e. nodes that - will be located at geometrical vertices. Pattern description is stored - in <pattern_name>.smp file.

- -

 

- -

The smp file contains 4 sections:

- -

 

- -

1. The first line holds the number of nodes - (N).

- -

 

- -

2. The next N lines describe nodes coordinates. - Each line holds 2 coordinates of a node.

- -

 

- -

3. A key-points line: indices of nodes to - be mapped on geometrical vertices. An index n refers to a node described - on an n-th line of section 2. The first node index is zero.

- -

 

- -

4. The rest lines describe nodal connectivity - of elements, one line for an element. A line holds indices of nodes forming - an element. An index n refers to a node described on an n-th line of the - section 2. The first node index is zero. There must be 3 or 4 indices - on a line: only 2d elements are allowed.

- -

 

- -

The 2D pattern must contain at least one element and at least one key-point. - All key-points must lay on boundaries.

- -

 

- -

An example of a simple smp file and a preview of a pattern described - in this file:

- -

 

- -

- -

 

- -

 

- -

Application of pattern mapping

- -

To apply pattern mapping to a geometrical object:

- -

 

- -

1. From the Modification - menu choose the Pattern Mapping - item or click button in the toolbar. The following - dialog box shall appear:

- -

 

- - --- - - - -
-

-

- -

 

- -

To apply a pattern to a geometrical object, you should specify:

- -

- a face having the number of vertices equal - to the number of key-points in the pattern; the number of key-points on - internal boundaries of a pattern must also be equal to the number of vertices - on internal boundaries of a face;

- -

- a vertex to which the first key-point should - be mapped,

- -

- reverse or not the order of key-points. - (The order of vertices of a face is counterclockwise looking from outside).

- -

 

- -

Then you either load a .smp pattern file previously created manually - by clicking on the button, or click on the New - button for automatic generation.

- -

For an automatic generation you just specify a geometrical face having - a mesh built on it. Mesh nodes lying on face vertices become key-points. - Additionally, you may choose the way of getting nodes coordinates by projecting nodes on the face instead - of using "positions on face" generated by mesher (if there is - any). Faces having a seam edge can’t be used for automatic pattern creation.

- -

 

- -

When creating a pattern from an existing mesh, there are two possible - cases:

- -

 

- -

1. A sub-mesh on face is selected. A pattern is created from the 2d - elements bound to a face by mesher. Node coordinates are either "positions - on face" computed by mesher, or coordinates got by node projection - on a geometrical surface, according to your choice.

- -

2. A mesh where the main shape is a face, is selected. A pattern is - created from all the 2d elements in a mesh. If all mesh elements are build - by mesher, the user can select the way of getting nodes coordinates, else - all nodes are projected on a face surface.

- - --- - - - -
-

-

- -

 

- -

Mapping algorithm:

- -

The mapping algorithm is as follows:

- -

 

- -

1. Key-points are set in the order that they - are encountered when walking along a pattern boundary so that elements - are on the left. The first key-point is preserved.

- -

2. Find geometrical vertices corresponding - to key-points by vertices order in a face boundary; here, "Reverse - order of key-points" flag is taken into account.

- -

 

- -

- -

 

- -

3. Boundary nodes of a pattern are mapped - onto edges of a face: a node located between certain key-points on a pattern - boundary is mapped on a geometrical edge limited by corresponding geometrical - vertices. Node position on an edge reflects its distance from two key-points.

- -

 

- -

- -

 

- -

4. Coordinates of a non-boundary node in - a parametric space of a face are defined as following. In a parametric - space of a pattern, a node lays at the intersection of two iso-lines, - each of which intersects a pattern boundary at least at two points. Knowing - mapped positions of boundary nodes, we find where isoline-boundary intersection - points are mapped to, and hence we can find mapped isolines direction - and then, two node positions on two mapped isolines. The eventual mapped - position of a node is found as an average of positions on mapped isolines.

- -

 

- -

- - - - + + + + + +Pattern mapping + + + + + + + + + + + + + +

Pattern mapping

+ +

About patterns

+ +

The pattern describes a mesh to generate: positions of + nodes within a geometrical domain and nodal connectivity of elements. + As well, a pattern specifies the so-called key-points, i.e. nodes that + will be located at geometrical vertices. Pattern description is stored + in <pattern_name>.smp file.

+ +

 

+ +

The smp file contains 4 sections:

+ +

 

+ +

1. The first line holds the number of nodes + (N).

+ +

 

+ +

2. The next N lines describe nodes coordinates. + Each line holds 2 coordinates of a node.

+ +

 

+ +

3. A key-points line: indices of nodes to + be mapped on geometrical vertices. An index n refers to a node described + on an n-th line of section 2. The first node index is zero.

+ +

 

+ +

4. The rest lines describe nodal connectivity + of elements, one line for an element. A line holds indices of nodes forming + an element. An index n refers to a node described on an n-th line of the + section 2. The first node index is zero. There must be 3 or 4 indices + on a line: only 2d elements are allowed.

+ +

 

+ +

The 2D pattern must contain at least one element and at least one key-point. + All key-points must lay on boundaries.

+ +

 

+ +

An example of a simple smp file and a preview of a pattern described + in this file:

+ +

 

+ +

+ +

 

+ +

 

+ +

Application of pattern mapping

+ +

To apply pattern mapping to a geometrical object:

+ +

 

+ +

1. From the Modification + menu choose the Pattern Mapping + item or click button in the toolbar. The following + dialog box shall appear:

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

To apply a pattern to a geometrical object, you should specify:

+ +

- a face having the number of vertices equal + to the number of key-points in the pattern; the number of key-points on + internal boundaries of a pattern must also be equal to the number of vertices + on internal boundaries of a face;

+ +

- a vertex to which the first key-point should + be mapped,

+ +

- reverse or not the order of key-points. + (The order of vertices of a face is counterclockwise looking from outside).

+ +

 

+ +

Then you either load a .smp pattern file previously created manually + by clicking on the button, or click on the New + button for automatic generation.

+ +

For an automatic generation you just specify a geometrical face having + a mesh built on it. Mesh nodes lying on face vertices become key-points. + Additionally, you may choose the way of getting nodes coordinates by projecting nodes on the face instead + of using "positions on face" generated by mesher (if there is + any). Faces having a seam edge can’t be used for automatic pattern creation.

+ +

 

+ +

When creating a pattern from an existing mesh, there are two possible + cases:

+ +

 

+ +

1. A sub-mesh on face is selected. A pattern is created from the 2d + elements bound to a face by mesher. Node coordinates are either "positions + on face" computed by mesher, or coordinates got by node projection + on a geometrical surface, according to your choice.

+ +

2. A mesh where the main shape is a face, is selected. A pattern is + created from all the 2d elements in a mesh. If all mesh elements are build + by mesher, the user can select the way of getting nodes coordinates, else + all nodes are projected on a face surface.

+ + +++ + + + +
+

+

+ +

 

+ +

Mapping algorithm:

+ +

The mapping algorithm is as follows:

+ +

 

+ +

1. Key-points are set in the order that they + are encountered when walking along a pattern boundary so that elements + are on the left. The first key-point is preserved.

+ +

2. Find geometrical vertices corresponding + to key-points by vertices order in a face boundary; here, "Reverse + order of key-points" flag is taken into account.

+ +

 

+ +

+ +

 

+ +

3. Boundary nodes of a pattern are mapped + onto edges of a face: a node located between certain key-points on a pattern + boundary is mapped on a geometrical edge limited by corresponding geometrical + vertices. Node position on an edge reflects its distance from two key-points.

+ +

 

+ +

+ +

 

+ +

4. Coordinates of a non-boundary node in + a parametric space of a face are defined as following. In a parametric + space of a pattern, a node lays at the intersection of two iso-lines, + each of which intersects a pattern boundary at least at two points. Knowing + mapped positions of boundary nodes, we find where isoline-boundary intersection + points are mapped to, and hence we can find mapped isolines direction + and then, two node positions on two mapped isolines. The eventual mapped + position of a node is found as an average of positions on mapped isolines.

+ +

 

+ +

+ +

 

+ +

 See + Also a sample TUI Script of a Pattern + Mapping operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/pics/a-advmeshinfo.png b/doc/salome/gui/SMESH/pics/a-advmeshinfo.png deleted file mode 100755 index 41aa28b3a..000000000 Binary files a/doc/salome/gui/SMESH/pics/a-advmeshinfo.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/pics/a-arithmetic1d.png b/doc/salome/gui/SMESH/pics/a-arithmetic1d.png index d34a5e24c..552a9df3a 100755 Binary files a/doc/salome/gui/SMESH/pics/a-arithmetic1d.png and b/doc/salome/gui/SMESH/pics/a-arithmetic1d.png differ diff --git a/doc/salome/gui/SMESH/pics/a-averagelength.png b/doc/salome/gui/SMESH/pics/a-averagelength.png index dc007eb57..d1a0e1e52 100755 Binary files a/doc/salome/gui/SMESH/pics/a-averagelength.png and b/doc/salome/gui/SMESH/pics/a-averagelength.png differ diff --git a/doc/salome/gui/SMESH/pics/a-clipping2.png b/doc/salome/gui/SMESH/pics/a-clipping2.png index 639792ca3..4bd1c9426 100755 Binary files a/doc/salome/gui/SMESH/pics/a-clipping2.png and b/doc/salome/gui/SMESH/pics/a-clipping2.png differ diff --git a/doc/salome/gui/SMESH/pics/a-creategroup.png b/doc/salome/gui/SMESH/pics/a-creategroup.png index 38ef5a856..46462cfa6 100755 Binary files a/doc/salome/gui/SMESH/pics/a-creategroup.png and b/doc/salome/gui/SMESH/pics/a-creategroup.png differ diff --git a/doc/salome/gui/SMESH/pics/a-createmesh1.png b/doc/salome/gui/SMESH/pics/a-createmesh1.png deleted file mode 100755 index 026c88d21..000000000 Binary files a/doc/salome/gui/SMESH/pics/a-createmesh1.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/pics/a-createpolyhedralvolume.png b/doc/salome/gui/SMESH/pics/a-createpolyhedralvolume.png index 532eac08f..b44885ba5 100755 Binary files a/doc/salome/gui/SMESH/pics/a-createpolyhedralvolume.png and b/doc/salome/gui/SMESH/pics/a-createpolyhedralvolume.png differ diff --git a/doc/salome/gui/SMESH/pics/a-cuttingofquadrangles.png b/doc/salome/gui/SMESH/pics/a-cuttingofquadrangles.png index ff9ae68e1..7f4716715 100755 Binary files a/doc/salome/gui/SMESH/pics/a-cuttingofquadrangles.png and b/doc/salome/gui/SMESH/pics/a-cuttingofquadrangles.png differ diff --git a/doc/salome/gui/SMESH/pics/a-deflection1d.png b/doc/salome/gui/SMESH/pics/a-deflection1d.png index 57fd8597a..8d9021290 100755 Binary files a/doc/salome/gui/SMESH/pics/a-deflection1d.png and b/doc/salome/gui/SMESH/pics/a-deflection1d.png differ diff --git a/doc/salome/gui/SMESH/pics/a-editmesh.png b/doc/salome/gui/SMESH/pics/a-editmesh.png deleted file mode 100755 index f5da15a2d..000000000 Binary files a/doc/salome/gui/SMESH/pics/a-editmesh.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/pics/a-exportmesh.png b/doc/salome/gui/SMESH/pics/a-exportmesh.png deleted file mode 100755 index 0c24b1290..000000000 Binary files a/doc/salome/gui/SMESH/pics/a-exportmesh.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/pics/a-extusionalongapath2.png b/doc/salome/gui/SMESH/pics/a-extusionalongapath2.png index f120fc3c0..898d43166 100755 Binary files a/doc/salome/gui/SMESH/pics/a-extusionalongapath2.png and b/doc/salome/gui/SMESH/pics/a-extusionalongapath2.png differ diff --git a/doc/salome/gui/SMESH/pics/a-filteronedges.png b/doc/salome/gui/SMESH/pics/a-filteronedges.png index 48b3ece01..004433248 100755 Binary files a/doc/salome/gui/SMESH/pics/a-filteronedges.png and b/doc/salome/gui/SMESH/pics/a-filteronedges.png differ diff --git a/doc/salome/gui/SMESH/pics/a-maxelarea.png b/doc/salome/gui/SMESH/pics/a-maxelarea.png index b4af4b23f..e3bfa1841 100755 Binary files a/doc/salome/gui/SMESH/pics/a-maxelarea.png and b/doc/salome/gui/SMESH/pics/a-maxelarea.png differ diff --git a/doc/salome/gui/SMESH/pics/a-maxelvolume.png b/doc/salome/gui/SMESH/pics/a-maxelvolume.png index 2611807fd..419d83ff2 100755 Binary files a/doc/salome/gui/SMESH/pics/a-maxelvolume.png and b/doc/salome/gui/SMESH/pics/a-maxelvolume.png differ diff --git a/doc/salome/gui/SMESH/pics/a-nbsegments1.png b/doc/salome/gui/SMESH/pics/a-nbsegments1.png index 35c09094d..a42714aea 100755 Binary files a/doc/salome/gui/SMESH/pics/a-nbsegments1.png and b/doc/salome/gui/SMESH/pics/a-nbsegments1.png differ diff --git a/doc/salome/gui/SMESH/pics/a-nbsegments2.png b/doc/salome/gui/SMESH/pics/a-nbsegments2.png index 7f33c61ff..51e7c9ddb 100755 Binary files a/doc/salome/gui/SMESH/pics/a-nbsegments2.png and b/doc/salome/gui/SMESH/pics/a-nbsegments2.png differ diff --git a/doc/salome/gui/SMESH/pics/a-nbsegments3.png b/doc/salome/gui/SMESH/pics/a-nbsegments3.png deleted file mode 100755 index a21648267..000000000 Binary files a/doc/salome/gui/SMESH/pics/a-nbsegments3.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/pics/a-nbsegments4.png b/doc/salome/gui/SMESH/pics/a-nbsegments4.png deleted file mode 100755 index ebad8cd73..000000000 Binary files a/doc/salome/gui/SMESH/pics/a-nbsegments4.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/pics/a-patterntype.png b/doc/salome/gui/SMESH/pics/a-patterntype.png index 3383cd75e..3d676af1f 100755 Binary files a/doc/salome/gui/SMESH/pics/a-patterntype.png and b/doc/salome/gui/SMESH/pics/a-patterntype.png differ diff --git a/doc/salome/gui/SMESH/pics/a-patterntype1.png b/doc/salome/gui/SMESH/pics/a-patterntype1.png index 38449225a..cffa7da07 100755 Binary files a/doc/salome/gui/SMESH/pics/a-patterntype1.png and b/doc/salome/gui/SMESH/pics/a-patterntype1.png differ diff --git a/doc/salome/gui/SMESH/pics/a-standmeshinfo.png b/doc/salome/gui/SMESH/pics/a-standmeshinfo.png index 6b35f0a99..181c2f460 100755 Binary files a/doc/salome/gui/SMESH/pics/a-standmeshinfo.png and b/doc/salome/gui/SMESH/pics/a-standmeshinfo.png differ diff --git a/doc/salome/gui/SMESH/pics/a-startendlength.png b/doc/salome/gui/SMESH/pics/a-startendlength.png index e48f617d2..8398a792d 100755 Binary files a/doc/salome/gui/SMESH/pics/a-startendlength.png and b/doc/salome/gui/SMESH/pics/a-startendlength.png differ diff --git a/doc/salome/gui/SMESH/pics/a-transparency.png b/doc/salome/gui/SMESH/pics/a-transparency.png index 8e7498d58..78e2b0f31 100755 Binary files a/doc/salome/gui/SMESH/pics/a-transparency.png and b/doc/salome/gui/SMESH/pics/a-transparency.png differ diff --git a/doc/salome/gui/SMESH/pics/a-unionoftriangles.png b/doc/salome/gui/SMESH/pics/a-unionoftriangles.png index d9ef53c11..16016551f 100755 Binary files a/doc/salome/gui/SMESH/pics/a-unionoftriangles.png and b/doc/salome/gui/SMESH/pics/a-unionoftriangles.png differ diff --git a/doc/salome/gui/SMESH/pics/a-viewgeneral.png b/doc/salome/gui/SMESH/pics/a-viewgeneral.png index 09b7c2391..f5637ccfa 100755 Binary files a/doc/salome/gui/SMESH/pics/a-viewgeneral.png and b/doc/salome/gui/SMESH/pics/a-viewgeneral.png differ diff --git a/doc/salome/gui/SMESH/pics/add_edge.png b/doc/salome/gui/SMESH/pics/add_edge.png index 8a532e1d9..8455fcd54 100755 Binary files a/doc/salome/gui/SMESH/pics/add_edge.png and b/doc/salome/gui/SMESH/pics/add_edge.png differ diff --git a/doc/salome/gui/SMESH/pics/add_node.png b/doc/salome/gui/SMESH/pics/add_node.png index cb50bf6e6..562cf16ab 100755 Binary files a/doc/salome/gui/SMESH/pics/add_node.png and b/doc/salome/gui/SMESH/pics/add_node.png differ diff --git a/doc/salome/gui/SMESH/pics/add_polygone.png b/doc/salome/gui/SMESH/pics/add_polygone.png index a76baceae..b05e25b37 100755 Binary files a/doc/salome/gui/SMESH/pics/add_polygone.png and b/doc/salome/gui/SMESH/pics/add_polygone.png differ diff --git a/doc/salome/gui/SMESH/pics/add_polyhedron.png b/doc/salome/gui/SMESH/pics/add_polyhedron.png index 2e23634c9..62c0857a9 100755 Binary files a/doc/salome/gui/SMESH/pics/add_polyhedron.png and b/doc/salome/gui/SMESH/pics/add_polyhedron.png differ diff --git a/doc/salome/gui/SMESH/pics/add_quadrangle.png b/doc/salome/gui/SMESH/pics/add_quadrangle.png index f25b94d9f..b7ec66612 100755 Binary files a/doc/salome/gui/SMESH/pics/add_quadrangle.png and b/doc/salome/gui/SMESH/pics/add_quadrangle.png differ diff --git a/doc/salome/gui/SMESH/pics/add_triangle.png b/doc/salome/gui/SMESH/pics/add_triangle.png index 41c335929..fee1ccf80 100755 Binary files a/doc/salome/gui/SMESH/pics/add_triangle.png and b/doc/salome/gui/SMESH/pics/add_triangle.png differ diff --git a/doc/salome/gui/SMESH/pics/addedge.png b/doc/salome/gui/SMESH/pics/addedge.png index c9eeaf970..8bea8bf6a 100755 Binary files a/doc/salome/gui/SMESH/pics/addedge.png and b/doc/salome/gui/SMESH/pics/addedge.png differ diff --git a/doc/salome/gui/SMESH/pics/addhexahedron.png b/doc/salome/gui/SMESH/pics/addhexahedron.png index fd2ef245a..909bda892 100755 Binary files a/doc/salome/gui/SMESH/pics/addhexahedron.png and b/doc/salome/gui/SMESH/pics/addhexahedron.png differ diff --git a/doc/salome/gui/SMESH/pics/addnode.png b/doc/salome/gui/SMESH/pics/addnode.png index 167a966b8..181e2c9f7 100755 Binary files a/doc/salome/gui/SMESH/pics/addnode.png and b/doc/salome/gui/SMESH/pics/addnode.png differ diff --git a/doc/salome/gui/SMESH/pics/addpolygon.png b/doc/salome/gui/SMESH/pics/addpolygon.png index 785a62341..c59a4b7ee 100755 Binary files a/doc/salome/gui/SMESH/pics/addpolygon.png and b/doc/salome/gui/SMESH/pics/addpolygon.png differ diff --git a/doc/salome/gui/SMESH/pics/addquadrangle.png b/doc/salome/gui/SMESH/pics/addquadrangle.png index 2bbddf158..594078e05 100755 Binary files a/doc/salome/gui/SMESH/pics/addquadrangle.png and b/doc/salome/gui/SMESH/pics/addquadrangle.png differ diff --git a/doc/salome/gui/SMESH/pics/addtetrahedron.png b/doc/salome/gui/SMESH/pics/addtetrahedron.png index 0a415707a..2fc4d062c 100755 Binary files a/doc/salome/gui/SMESH/pics/addtetrahedron.png and b/doc/salome/gui/SMESH/pics/addtetrahedron.png differ diff --git a/doc/salome/gui/SMESH/pics/addtriangle.png b/doc/salome/gui/SMESH/pics/addtriangle.png index 405d6f57f..38349c444 100755 Binary files a/doc/salome/gui/SMESH/pics/addtriangle.png and b/doc/salome/gui/SMESH/pics/addtriangle.png differ diff --git a/doc/salome/gui/SMESH/pics/advanced_mesh_infos.png b/doc/salome/gui/SMESH/pics/advanced_mesh_infos.png index f8341e892..183872a79 100755 Binary files a/doc/salome/gui/SMESH/pics/advanced_mesh_infos.png and b/doc/salome/gui/SMESH/pics/advanced_mesh_infos.png differ diff --git a/doc/salome/gui/SMESH/pics/aqt.png b/doc/salome/gui/SMESH/pics/aqt.png index 32e36bd0e..01ab899dc 100755 Binary files a/doc/salome/gui/SMESH/pics/aqt.png and b/doc/salome/gui/SMESH/pics/aqt.png differ diff --git a/doc/salome/gui/SMESH/pics/automaticlength.png b/doc/salome/gui/SMESH/pics/automaticlength.png index d96ffc82d..0168b58ad 100755 Binary files a/doc/salome/gui/SMESH/pics/automaticlength.png and b/doc/salome/gui/SMESH/pics/automaticlength.png differ diff --git a/doc/salome/gui/SMESH/pics/b-art_end_length.png b/doc/salome/gui/SMESH/pics/b-art_end_length.png index 26da5fa73..1608bc08a 100755 Binary files a/doc/salome/gui/SMESH/pics/b-art_end_length.png and b/doc/salome/gui/SMESH/pics/b-art_end_length.png differ diff --git a/doc/salome/gui/SMESH/pics/b-create_group.png b/doc/salome/gui/SMESH/pics/b-create_group.png deleted file mode 100755 index 6fc2367b3..000000000 Binary files a/doc/salome/gui/SMESH/pics/b-create_group.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/pics/b-erage_length.png b/doc/salome/gui/SMESH/pics/b-erage_length.png index f64077c90..03e8593d7 100755 Binary files a/doc/salome/gui/SMESH/pics/b-erage_length.png and b/doc/salome/gui/SMESH/pics/b-erage_length.png differ diff --git a/doc/salome/gui/SMESH/pics/b-flection1d.png b/doc/salome/gui/SMESH/pics/b-flection1d.png index e160cf55d..1cedcd087 100755 Binary files a/doc/salome/gui/SMESH/pics/b-flection1d.png and b/doc/salome/gui/SMESH/pics/b-flection1d.png differ diff --git a/doc/salome/gui/SMESH/pics/b-ithmetic1d.png b/doc/salome/gui/SMESH/pics/b-ithmetic1d.png index 72f76b951..031aaa734 100755 Binary files a/doc/salome/gui/SMESH/pics/b-ithmetic1d.png and b/doc/salome/gui/SMESH/pics/b-ithmetic1d.png differ diff --git a/doc/salome/gui/SMESH/pics/b-mberofsegments.png b/doc/salome/gui/SMESH/pics/b-mberofsegments.png index 27f68685e..c99316b92 100755 Binary files a/doc/salome/gui/SMESH/pics/b-mberofsegments.png and b/doc/salome/gui/SMESH/pics/b-mberofsegments.png differ diff --git a/doc/salome/gui/SMESH/pics/b-mesh_infos.png b/doc/salome/gui/SMESH/pics/b-mesh_infos.png index 6abd3c184..c1f168fe8 100755 Binary files a/doc/salome/gui/SMESH/pics/b-mesh_infos.png and b/doc/salome/gui/SMESH/pics/b-mesh_infos.png differ diff --git a/doc/salome/gui/SMESH/pics/borders_at_multi_connections1.png b/doc/salome/gui/SMESH/pics/borders_at_multi_connections1.png deleted file mode 100755 index 8a2d16499..000000000 Binary files a/doc/salome/gui/SMESH/pics/borders_at_multi_connections1.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/pics/c-createmesh.png b/doc/salome/gui/SMESH/pics/c-createmesh.png deleted file mode 100755 index 5ff3ffc58..000000000 Binary files a/doc/salome/gui/SMESH/pics/c-createmesh.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/pics/c-editmesh.png b/doc/salome/gui/SMESH/pics/c-editmesh.png deleted file mode 100755 index bbad9686d..000000000 Binary files a/doc/salome/gui/SMESH/pics/c-editmesh.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/pics/create_group.png b/doc/salome/gui/SMESH/pics/create_group.png index 6fc2367b3..ada742f13 100755 Binary files a/doc/salome/gui/SMESH/pics/create_group.png and b/doc/salome/gui/SMESH/pics/create_group.png differ diff --git a/doc/salome/gui/SMESH/pics/creategroup.png b/doc/salome/gui/SMESH/pics/creategroup.png index 12b7d4b14..27c46ad18 100755 Binary files a/doc/salome/gui/SMESH/pics/creategroup.png and b/doc/salome/gui/SMESH/pics/creategroup.png differ diff --git a/doc/salome/gui/SMESH/pics/createmesh-inv.png b/doc/salome/gui/SMESH/pics/createmesh-inv.png index 9ed8a6255..495bb37a6 100755 Binary files a/doc/salome/gui/SMESH/pics/createmesh-inv.png and b/doc/salome/gui/SMESH/pics/createmesh-inv.png differ diff --git a/doc/salome/gui/SMESH/pics/createmesh-inv2.png b/doc/salome/gui/SMESH/pics/createmesh-inv2.png index f73e1df7d..83c4c520d 100755 Binary files a/doc/salome/gui/SMESH/pics/createmesh-inv2.png and b/doc/salome/gui/SMESH/pics/createmesh-inv2.png differ diff --git a/doc/salome/gui/SMESH/pics/createmesh-inv3.png b/doc/salome/gui/SMESH/pics/createmesh-inv3.png index 6c9da9c0a..e75e093d7 100755 Binary files a/doc/salome/gui/SMESH/pics/createmesh-inv3.png and b/doc/salome/gui/SMESH/pics/createmesh-inv3.png differ diff --git a/doc/salome/gui/SMESH/pics/cut_groups1.png b/doc/salome/gui/SMESH/pics/cut_groups1.png index f066a5541..5ee0b2890 100755 Binary files a/doc/salome/gui/SMESH/pics/cut_groups1.png and b/doc/salome/gui/SMESH/pics/cut_groups1.png differ diff --git a/doc/salome/gui/SMESH/pics/cut_groups2.png b/doc/salome/gui/SMESH/pics/cut_groups2.png index 3ec7a93d1..235edf556 100755 Binary files a/doc/salome/gui/SMESH/pics/cut_groups2.png and b/doc/salome/gui/SMESH/pics/cut_groups2.png differ diff --git a/doc/salome/gui/SMESH/pics/cut_groups3.png b/doc/salome/gui/SMESH/pics/cut_groups3.png index 1c5ebed80..a28cc24d1 100755 Binary files a/doc/salome/gui/SMESH/pics/cut_groups3.png and b/doc/salome/gui/SMESH/pics/cut_groups3.png differ diff --git a/doc/salome/gui/SMESH/pics/cutgroups.png b/doc/salome/gui/SMESH/pics/cutgroups.png index 87e6da88b..dfac88557 100755 Binary files a/doc/salome/gui/SMESH/pics/cutgroups.png and b/doc/salome/gui/SMESH/pics/cutgroups.png differ diff --git a/doc/salome/gui/SMESH/pics/deletegroups.png b/doc/salome/gui/SMESH/pics/deletegroups.png index 383a79aa8..d7ce7c099 100755 Binary files a/doc/salome/gui/SMESH/pics/deletegroups.png and b/doc/salome/gui/SMESH/pics/deletegroups.png differ diff --git a/doc/salome/gui/SMESH/pics/diagonalinversion.png b/doc/salome/gui/SMESH/pics/diagonalinversion.png index 967e7a12e..baaaebe09 100755 Binary files a/doc/salome/gui/SMESH/pics/diagonalinversion.png and b/doc/salome/gui/SMESH/pics/diagonalinversion.png differ diff --git a/doc/salome/gui/SMESH/pics/distributionwithanalyticdensity.png b/doc/salome/gui/SMESH/pics/distributionwithanalyticdensity.png index 87ebc5ffe..99723559d 100755 Binary files a/doc/salome/gui/SMESH/pics/distributionwithanalyticdensity.png and b/doc/salome/gui/SMESH/pics/distributionwithanalyticdensity.png differ diff --git a/doc/salome/gui/SMESH/pics/distributionwithtabledensity.png b/doc/salome/gui/SMESH/pics/distributionwithtabledensity.png index 9ea6cab98..fcb1ec81c 100755 Binary files a/doc/salome/gui/SMESH/pics/distributionwithtabledensity.png and b/doc/salome/gui/SMESH/pics/distributionwithtabledensity.png differ diff --git a/doc/salome/gui/SMESH/pics/edit_mesh1.png b/doc/salome/gui/SMESH/pics/edit_mesh1.png index 4369e51b4..fd4699568 100755 Binary files a/doc/salome/gui/SMESH/pics/edit_mesh1.png and b/doc/salome/gui/SMESH/pics/edit_mesh1.png differ diff --git a/doc/salome/gui/SMESH/pics/edit_mesh_change_value_hyp.png b/doc/salome/gui/SMESH/pics/edit_mesh_change_value_hyp.png index 7dee01f7d..646d2f39f 100755 Binary files a/doc/salome/gui/SMESH/pics/edit_mesh_change_value_hyp.png and b/doc/salome/gui/SMESH/pics/edit_mesh_change_value_hyp.png differ diff --git a/doc/salome/gui/SMESH/pics/edit_mesh_remove_hyp.png b/doc/salome/gui/SMESH/pics/edit_mesh_remove_hyp.png index 0a45639aa..144247761 100755 Binary files a/doc/salome/gui/SMESH/pics/edit_mesh_remove_hyp.png and b/doc/salome/gui/SMESH/pics/edit_mesh_remove_hyp.png differ diff --git a/doc/salome/gui/SMESH/pics/editgroup.png b/doc/salome/gui/SMESH/pics/editgroup.png index 384a30399..680b53624 100755 Binary files a/doc/salome/gui/SMESH/pics/editgroup.png and b/doc/salome/gui/SMESH/pics/editgroup.png differ diff --git a/doc/salome/gui/SMESH/pics/editing_groups1.png b/doc/salome/gui/SMESH/pics/editing_groups1.png index beb946ab7..39bbf946e 100755 Binary files a/doc/salome/gui/SMESH/pics/editing_groups1.png and b/doc/salome/gui/SMESH/pics/editing_groups1.png differ diff --git a/doc/salome/gui/SMESH/pics/editing_groups2.png b/doc/salome/gui/SMESH/pics/editing_groups2.png index 7cff1819c..0e25847f4 100755 Binary files a/doc/salome/gui/SMESH/pics/editing_groups2.png and b/doc/salome/gui/SMESH/pics/editing_groups2.png differ diff --git a/doc/salome/gui/SMESH/pics/extrusionalongaline1.png b/doc/salome/gui/SMESH/pics/extrusionalongaline1.png index 86b2cba30..9da5018f2 100755 Binary files a/doc/salome/gui/SMESH/pics/extrusionalongaline1.png and b/doc/salome/gui/SMESH/pics/extrusionalongaline1.png differ diff --git a/doc/salome/gui/SMESH/pics/extrusionalongaline2.png b/doc/salome/gui/SMESH/pics/extrusionalongaline2.png index b039cfce5..ffe57f325 100755 Binary files a/doc/salome/gui/SMESH/pics/extrusionalongaline2.png and b/doc/salome/gui/SMESH/pics/extrusionalongaline2.png differ diff --git a/doc/salome/gui/SMESH/pics/free_borders1.png b/doc/salome/gui/SMESH/pics/free_borders1.png index 6e73c9329..e64eac255 100755 Binary files a/doc/salome/gui/SMESH/pics/free_borders1.png and b/doc/salome/gui/SMESH/pics/free_borders1.png differ diff --git a/doc/salome/gui/SMESH/pics/free_edges.png b/doc/salome/gui/SMESH/pics/free_edges.png index 6f1100c87..c9d6354d4 100755 Binary files a/doc/salome/gui/SMESH/pics/free_edges.png and b/doc/salome/gui/SMESH/pics/free_edges.png differ diff --git a/doc/salome/gui/SMESH/pics/graduatedaxes1.png b/doc/salome/gui/SMESH/pics/graduatedaxes1.png index cf021ba42..92985cf82 100755 Binary files a/doc/salome/gui/SMESH/pics/graduatedaxes1.png and b/doc/salome/gui/SMESH/pics/graduatedaxes1.png differ diff --git a/doc/salome/gui/SMESH/pics/importmesh.png b/doc/salome/gui/SMESH/pics/importmesh.png deleted file mode 100755 index fa858d7f3..000000000 Binary files a/doc/salome/gui/SMESH/pics/importmesh.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/pics/intersect_groups1.png b/doc/salome/gui/SMESH/pics/intersect_groups1.png index 9251b0e7a..4c82027ba 100755 Binary files a/doc/salome/gui/SMESH/pics/intersect_groups1.png and b/doc/salome/gui/SMESH/pics/intersect_groups1.png differ diff --git a/doc/salome/gui/SMESH/pics/intersect_groups2.png b/doc/salome/gui/SMESH/pics/intersect_groups2.png index eeaed8da1..db6a7d12d 100755 Binary files a/doc/salome/gui/SMESH/pics/intersect_groups2.png and b/doc/salome/gui/SMESH/pics/intersect_groups2.png differ diff --git a/doc/salome/gui/SMESH/pics/intersect_groups3.png b/doc/salome/gui/SMESH/pics/intersect_groups3.png index 74f5c2d76..004fbb506 100755 Binary files a/doc/salome/gui/SMESH/pics/intersect_groups3.png and b/doc/salome/gui/SMESH/pics/intersect_groups3.png differ diff --git a/doc/salome/gui/SMESH/pics/intersectgroups.png b/doc/salome/gui/SMESH/pics/intersectgroups.png index b28b4d4d6..edaf6b584 100755 Binary files a/doc/salome/gui/SMESH/pics/intersectgroups.png and b/doc/salome/gui/SMESH/pics/intersectgroups.png differ diff --git a/doc/salome/gui/SMESH/pics/length-crit.png b/doc/salome/gui/SMESH/pics/length-crit.png index 96836cd87..5f13ee5d2 100755 Binary files a/doc/salome/gui/SMESH/pics/length-crit.png and b/doc/salome/gui/SMESH/pics/length-crit.png differ diff --git a/doc/salome/gui/SMESH/pics/length1.png b/doc/salome/gui/SMESH/pics/length1.png deleted file mode 100755 index 53f4f9591..000000000 Binary files a/doc/salome/gui/SMESH/pics/length1.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/pics/length2d.png b/doc/salome/gui/SMESH/pics/length2d.png index 9a5264a02..c7d0068a3 100755 Binary files a/doc/salome/gui/SMESH/pics/length2d.png and b/doc/salome/gui/SMESH/pics/length2d.png differ diff --git a/doc/salome/gui/SMESH/pics/max_el_area.png b/doc/salome/gui/SMESH/pics/max_el_area.png index 88db3d6f8..00547b911 100755 Binary files a/doc/salome/gui/SMESH/pics/max_el_area.png and b/doc/salome/gui/SMESH/pics/max_el_area.png differ diff --git a/doc/salome/gui/SMESH/pics/mergeelems.png b/doc/salome/gui/SMESH/pics/mergeelems.png index 9314da8c3..84769dc99 100755 Binary files a/doc/salome/gui/SMESH/pics/mergeelems.png and b/doc/salome/gui/SMESH/pics/mergeelems.png differ diff --git a/doc/salome/gui/SMESH/pics/mergenodes.png b/doc/salome/gui/SMESH/pics/mergenodes.png index d994afa28..d0e5806d6 100755 Binary files a/doc/salome/gui/SMESH/pics/mergenodes.png and b/doc/salome/gui/SMESH/pics/mergenodes.png differ diff --git a/doc/salome/gui/SMESH/pics/merging_nodes1.png b/doc/salome/gui/SMESH/pics/merging_nodes1.png index f64bdcbe2..bd5ffe4fd 100755 Binary files a/doc/salome/gui/SMESH/pics/merging_nodes1.png and b/doc/salome/gui/SMESH/pics/merging_nodes1.png differ diff --git a/doc/salome/gui/SMESH/pics/merging_nodes2.png b/doc/salome/gui/SMESH/pics/merging_nodes2.png index 8d7cfdd09..085ce3540 100755 Binary files a/doc/salome/gui/SMESH/pics/merging_nodes2.png and b/doc/salome/gui/SMESH/pics/merging_nodes2.png differ diff --git a/doc/salome/gui/SMESH/pics/meshexportmesh.png b/doc/salome/gui/SMESH/pics/meshexportmesh.png index a84b25207..7b748a648 100755 Binary files a/doc/salome/gui/SMESH/pics/meshexportmesh.png and b/doc/salome/gui/SMESH/pics/meshexportmesh.png differ diff --git a/doc/salome/gui/SMESH/pics/meshimportmesh.png b/doc/salome/gui/SMESH/pics/meshimportmesh.png index f87250bf4..0d0fd470d 100755 Binary files a/doc/salome/gui/SMESH/pics/meshimportmesh.png and b/doc/salome/gui/SMESH/pics/meshimportmesh.png differ diff --git a/doc/salome/gui/SMESH/pics/meshtrianglemergeelem1.png b/doc/salome/gui/SMESH/pics/meshtrianglemergeelem1.png index 0f9bd5215..af34335af 100755 Binary files a/doc/salome/gui/SMESH/pics/meshtrianglemergeelem1.png and b/doc/salome/gui/SMESH/pics/meshtrianglemergeelem1.png differ diff --git a/doc/salome/gui/SMESH/pics/movenodes.png b/doc/salome/gui/SMESH/pics/movenodes.png index 16e9e6262..3addc6d5e 100755 Binary files a/doc/salome/gui/SMESH/pics/movenodes.png and b/doc/salome/gui/SMESH/pics/movenodes.png differ diff --git a/doc/salome/gui/SMESH/pics/moving_nodes1.png b/doc/salome/gui/SMESH/pics/moving_nodes1.png index 2bae38850..f37153c9e 100755 Binary files a/doc/salome/gui/SMESH/pics/moving_nodes1.png and b/doc/salome/gui/SMESH/pics/moving_nodes1.png differ diff --git a/doc/salome/gui/SMESH/pics/moving_nodes2.png b/doc/salome/gui/SMESH/pics/moving_nodes2.png index b65e57ae9..63dc54a98 100755 Binary files a/doc/salome/gui/SMESH/pics/moving_nodes2.png and b/doc/salome/gui/SMESH/pics/moving_nodes2.png differ diff --git a/doc/salome/gui/SMESH/pics/orientaation1.png b/doc/salome/gui/SMESH/pics/orientaation1.png index c23b0b8a8..ca2758fc3 100755 Binary files a/doc/salome/gui/SMESH/pics/orientaation1.png and b/doc/salome/gui/SMESH/pics/orientaation1.png differ diff --git a/doc/salome/gui/SMESH/pics/patternmapping1.png b/doc/salome/gui/SMESH/pics/patternmapping1.png index 14daae187..82ee65288 100755 Binary files a/doc/salome/gui/SMESH/pics/patternmapping1.png and b/doc/salome/gui/SMESH/pics/patternmapping1.png differ diff --git a/doc/salome/gui/SMESH/pics/patternmapping2.png b/doc/salome/gui/SMESH/pics/patternmapping2.png index fbcf35544..1727eb846 100755 Binary files a/doc/salome/gui/SMESH/pics/patternmapping2.png and b/doc/salome/gui/SMESH/pics/patternmapping2.png differ diff --git a/doc/salome/gui/SMESH/pics/remove_elements1.png b/doc/salome/gui/SMESH/pics/remove_elements1.png index 538460f43..e68cd0e58 100755 Binary files a/doc/salome/gui/SMESH/pics/remove_elements1.png and b/doc/salome/gui/SMESH/pics/remove_elements1.png differ diff --git a/doc/salome/gui/SMESH/pics/remove_elements2.png b/doc/salome/gui/SMESH/pics/remove_elements2.png index 888188cc7..6ede5e1d7 100755 Binary files a/doc/salome/gui/SMESH/pics/remove_elements2.png and b/doc/salome/gui/SMESH/pics/remove_elements2.png differ diff --git a/doc/salome/gui/SMESH/pics/remove_nodes1.png b/doc/salome/gui/SMESH/pics/remove_nodes1.png index 94caae679..544a73e93 100755 Binary files a/doc/salome/gui/SMESH/pics/remove_nodes1.png and b/doc/salome/gui/SMESH/pics/remove_nodes1.png differ diff --git a/doc/salome/gui/SMESH/pics/remove_nodes2.png b/doc/salome/gui/SMESH/pics/remove_nodes2.png index e9f806402..3448cdae1 100755 Binary files a/doc/salome/gui/SMESH/pics/remove_nodes2.png and b/doc/salome/gui/SMESH/pics/remove_nodes2.png differ diff --git a/doc/salome/gui/SMESH/pics/removeelements.png b/doc/salome/gui/SMESH/pics/removeelements.png index 42a79b5b1..9a1eeff45 100755 Binary files a/doc/salome/gui/SMESH/pics/removeelements.png and b/doc/salome/gui/SMESH/pics/removeelements.png differ diff --git a/doc/salome/gui/SMESH/pics/removenodes.png b/doc/salome/gui/SMESH/pics/removenodes.png index cfcb777c6..47c0fc3da 100755 Binary files a/doc/salome/gui/SMESH/pics/removenodes.png and b/doc/salome/gui/SMESH/pics/removenodes.png differ diff --git a/doc/salome/gui/SMESH/pics/renumberelements.png b/doc/salome/gui/SMESH/pics/renumberelements.png index 0812b5066..ef4809cc4 100755 Binary files a/doc/salome/gui/SMESH/pics/renumberelements.png and b/doc/salome/gui/SMESH/pics/renumberelements.png differ diff --git a/doc/salome/gui/SMESH/pics/renumbernodes.png b/doc/salome/gui/SMESH/pics/renumbernodes.png index 90a0eda13..ffd985b27 100755 Binary files a/doc/salome/gui/SMESH/pics/renumbernodes.png and b/doc/salome/gui/SMESH/pics/renumbernodes.png differ diff --git a/doc/salome/gui/SMESH/pics/revolution1.png b/doc/salome/gui/SMESH/pics/revolution1.png index d459cf463..ba9ed7c62 100755 Binary files a/doc/salome/gui/SMESH/pics/revolution1.png and b/doc/salome/gui/SMESH/pics/revolution1.png differ diff --git a/doc/salome/gui/SMESH/pics/revolution2.png b/doc/salome/gui/SMESH/pics/revolution2.png index a3c005202..e2c9db291 100755 Binary files a/doc/salome/gui/SMESH/pics/revolution2.png and b/doc/salome/gui/SMESH/pics/revolution2.png differ diff --git a/doc/salome/gui/SMESH/pics/rotation.png b/doc/salome/gui/SMESH/pics/rotation.png index 372b9b307..fa35af8c8 100755 Binary files a/doc/salome/gui/SMESH/pics/rotation.png and b/doc/salome/gui/SMESH/pics/rotation.png differ diff --git a/doc/salome/gui/SMESH/pics/rotation1.png b/doc/salome/gui/SMESH/pics/rotation1.png index 5a4ad9901..2fbc60235 100755 Binary files a/doc/salome/gui/SMESH/pics/rotation1.png and b/doc/salome/gui/SMESH/pics/rotation1.png differ diff --git a/doc/salome/gui/SMESH/pics/rotation2.png b/doc/salome/gui/SMESH/pics/rotation2.png index 366771a69..579647f29 100755 Binary files a/doc/salome/gui/SMESH/pics/rotation2.png and b/doc/salome/gui/SMESH/pics/rotation2.png differ diff --git a/doc/salome/gui/SMESH/pics/selectionfilterlibrary.png b/doc/salome/gui/SMESH/pics/selectionfilterlibrary.png index f07c09641..aa48f8d8b 100755 Binary files a/doc/salome/gui/SMESH/pics/selectionfilterlibrary.png and b/doc/salome/gui/SMESH/pics/selectionfilterlibrary.png differ diff --git a/doc/salome/gui/SMESH/pics/sewing1.png b/doc/salome/gui/SMESH/pics/sewing1.png index 795d7a06b..48b0d65a3 100755 Binary files a/doc/salome/gui/SMESH/pics/sewing1.png and b/doc/salome/gui/SMESH/pics/sewing1.png differ diff --git a/doc/salome/gui/SMESH/pics/sewing2.png b/doc/salome/gui/SMESH/pics/sewing2.png index 66a409973..2e8e379d3 100755 Binary files a/doc/salome/gui/SMESH/pics/sewing2.png and b/doc/salome/gui/SMESH/pics/sewing2.png differ diff --git a/doc/salome/gui/SMESH/pics/sewing3.png b/doc/salome/gui/SMESH/pics/sewing3.png index 6c74f1cbf..46fc4352e 100755 Binary files a/doc/salome/gui/SMESH/pics/sewing3.png and b/doc/salome/gui/SMESH/pics/sewing3.png differ diff --git a/doc/salome/gui/SMESH/pics/sewing4.png b/doc/salome/gui/SMESH/pics/sewing4.png index cd9869a85..17f4f42f2 100755 Binary files a/doc/salome/gui/SMESH/pics/sewing4.png and b/doc/salome/gui/SMESH/pics/sewing4.png differ diff --git a/doc/salome/gui/SMESH/pics/smoothing.png b/doc/salome/gui/SMESH/pics/smoothing.png index 0fda00a22..9d4f806f9 100755 Binary files a/doc/salome/gui/SMESH/pics/smoothing.png and b/doc/salome/gui/SMESH/pics/smoothing.png differ diff --git a/doc/salome/gui/SMESH/pics/smoothing1.png b/doc/salome/gui/SMESH/pics/smoothing1.png index 763a5300b..fdc719c9f 100755 Binary files a/doc/salome/gui/SMESH/pics/smoothing1.png and b/doc/salome/gui/SMESH/pics/smoothing1.png differ diff --git a/doc/salome/gui/SMESH/pics/smoothing2.png b/doc/salome/gui/SMESH/pics/smoothing2.png index bfce45739..4dc3f5b9a 100755 Binary files a/doc/salome/gui/SMESH/pics/smoothing2.png and b/doc/salome/gui/SMESH/pics/smoothing2.png differ diff --git a/doc/salome/gui/SMESH/pics/submeshconstruction.png b/doc/salome/gui/SMESH/pics/submeshconstruction.png deleted file mode 100755 index c2c12e5c6..000000000 Binary files a/doc/salome/gui/SMESH/pics/submeshconstruction.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/pics/symmetry1.png b/doc/salome/gui/SMESH/pics/symmetry1.png index 0fe145964..83b4dc484 100755 Binary files a/doc/salome/gui/SMESH/pics/symmetry1.png and b/doc/salome/gui/SMESH/pics/symmetry1.png differ diff --git a/doc/salome/gui/SMESH/pics/symmetry2.png b/doc/salome/gui/SMESH/pics/symmetry2.png index 99c456463..ecdeb58f8 100755 Binary files a/doc/salome/gui/SMESH/pics/symmetry2.png and b/doc/salome/gui/SMESH/pics/symmetry2.png differ diff --git a/doc/salome/gui/SMESH/pics/symmetry3.png b/doc/salome/gui/SMESH/pics/symmetry3.png index 0ded9ce79..2be735dd6 100755 Binary files a/doc/salome/gui/SMESH/pics/symmetry3.png and b/doc/salome/gui/SMESH/pics/symmetry3.png differ diff --git a/doc/salome/gui/SMESH/pics/translation1.png b/doc/salome/gui/SMESH/pics/translation1.png index 745506149..372503390 100755 Binary files a/doc/salome/gui/SMESH/pics/translation1.png and b/doc/salome/gui/SMESH/pics/translation1.png differ diff --git a/doc/salome/gui/SMESH/pics/translation2.png b/doc/salome/gui/SMESH/pics/translation2.png index f321be118..a2b522a0e 100755 Binary files a/doc/salome/gui/SMESH/pics/translation2.png and b/doc/salome/gui/SMESH/pics/translation2.png differ diff --git a/doc/salome/gui/SMESH/pics/union_groups1.png b/doc/salome/gui/SMESH/pics/union_groups1.png index 7b2fc7511..ad4fa0fb4 100755 Binary files a/doc/salome/gui/SMESH/pics/union_groups1.png and b/doc/salome/gui/SMESH/pics/union_groups1.png differ diff --git a/doc/salome/gui/SMESH/pics/union_groups2.png b/doc/salome/gui/SMESH/pics/union_groups2.png index 980e48d41..32e990b85 100755 Binary files a/doc/salome/gui/SMESH/pics/union_groups2.png and b/doc/salome/gui/SMESH/pics/union_groups2.png differ diff --git a/doc/salome/gui/SMESH/pics/union_groups3.png b/doc/salome/gui/SMESH/pics/union_groups3.png index caf6bb42b..13fbd50f7 100755 Binary files a/doc/salome/gui/SMESH/pics/union_groups3.png and b/doc/salome/gui/SMESH/pics/union_groups3.png differ diff --git a/doc/salome/gui/SMESH/pics/uniongroups.png b/doc/salome/gui/SMESH/pics/uniongroups.png index 936c3b9f7..4604e816c 100755 Binary files a/doc/salome/gui/SMESH/pics/uniongroups.png and b/doc/salome/gui/SMESH/pics/uniongroups.png differ diff --git a/doc/salome/gui/SMESH/pics/unionoftwotriangles.png b/doc/salome/gui/SMESH/pics/unionoftwotriangles.png index b9d2bdbd7..5d19fcf4e 100755 Binary files a/doc/salome/gui/SMESH/pics/unionoftwotriangles.png and b/doc/salome/gui/SMESH/pics/unionoftwotriangles.png differ diff --git a/doc/salome/gui/SMESH/pics/uniting_a_set_of_triangles1.png b/doc/salome/gui/SMESH/pics/uniting_a_set_of_triangles1.png index fb00167a5..080a2314c 100755 Binary files a/doc/salome/gui/SMESH/pics/uniting_a_set_of_triangles1.png and b/doc/salome/gui/SMESH/pics/uniting_a_set_of_triangles1.png differ diff --git a/doc/salome/gui/SMESH/pics/uniting_a_set_of_triangles2.png b/doc/salome/gui/SMESH/pics/uniting_a_set_of_triangles2.png index 16d135112..ace401b37 100755 Binary files a/doc/salome/gui/SMESH/pics/uniting_a_set_of_triangles2.png and b/doc/salome/gui/SMESH/pics/uniting_a_set_of_triangles2.png differ diff --git a/doc/salome/gui/SMESH/pics/uniting_two_triangles1.png b/doc/salome/gui/SMESH/pics/uniting_two_triangles1.png index e94be3a0f..09188c0f5 100755 Binary files a/doc/salome/gui/SMESH/pics/uniting_two_triangles1.png and b/doc/salome/gui/SMESH/pics/uniting_two_triangles1.png differ diff --git a/doc/salome/gui/SMESH/pics/uniting_two_triangles2.png b/doc/salome/gui/SMESH/pics/uniting_two_triangles2.png index 5cac5f541..8b58ef9f5 100755 Binary files a/doc/salome/gui/SMESH/pics/uniting_two_triangles2.png and b/doc/salome/gui/SMESH/pics/uniting_two_triangles2.png differ diff --git a/doc/salome/gui/SMESH/presentation.htm b/doc/salome/gui/SMESH/presentation.htm index c12e5bcfd..21c5ae4cc 100755 --- a/doc/salome/gui/SMESH/presentation.htm +++ b/doc/salome/gui/SMESH/presentation.htm @@ -1,129 +1,138 @@ - - - - - -Presentation - - - - - - - - - - - -

Display Mode

- -

By default your objects are represented as set in Preferences.

- -

However, right-clicking on the mesh in the Object - Browser, and selecting Display - Mode, you can display your mesh as: -

- -

 

- -

Wireframe,

- -

- -

 

- -

Shading

- -

- -

 

- -

or Nodes.

- -

- -

 

- -

Wireframe can - combine with Nodes and - Shading.

- -

 

- -

Shading - and Wireframe modes can combine - with Shrink, however - Nodes can't.

- -

- -

 

- - - - + + + + + +Presentation + + + + + + + + + + + + +

Display Mode

+ +

By default your objects are represented as set in Preferences.

+ +

However, right-clicking on the mesh in the Object + Browser, and selecting Display + Mode, you can display your mesh as: +

+ +

 

+ +

Wireframe +

+ +

+ +

 

+ +

Shading

+ +

+ +

 

+ +

or + Nodes.

+ +

+ +

 

+ +

Wireframe can + combine with Nodes and + Shading.

+ +

 

+ +

Shading + and Wireframe modes can combine + with Shrink, however + Nodes can't.

+ +

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/quality_controls.htm b/doc/salome/gui/SMESH/quality_controls.htm index 9b7239010..4e4d2fcdc 100755 --- a/doc/salome/gui/SMESH/quality_controls.htm +++ b/doc/salome/gui/SMESH/quality_controls.htm @@ -1,1536 +1,1634 @@ - - - - - -Quality Controls - - - - - - - - - - -

Quality Controls

- -

Free Borders

- -

import salome

- -

import geompy

- -

import SMESH

- -

import StdMeshers

- -

 

- -

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

- -

smesh.SetCurrentStudy(salome.myStudy)

- -

 

- -

# create a box without - one plane

- -

box = geompy.MakeBox(0., - 0., 0., 20., 20., 15.)

- -

subShapeList = geompy.SubShapeAll(box, - geompy.ShapeType["FACE"])

- -

 

- -

FaceList  = - []

- -

for i in range( - 5 ):

- -

  FaceList.append( - subShapeList[ i ] )

- -

 

- -

aComp = geompy.MakeCompound( - FaceList )

- -

aBox = geompy.Sew( - aComp, 1. )

- -

idbox = geompy.addToStudy( - aBox, "box" )

- -

  

- -

aBox  = - salome.IDToObject( idbox )

- -

 

- -

# create a mesh

- -

hyp1 = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

- -

hyp1.SetNumberOfSegments(5)

- -

hyp2 = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

- -

hyp2.SetMaxElementArea(20)

- -

 

- -

algo1 = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

- -

algo2 = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

- -

 

- -

mesh = smesh.CreateMesh(aBox)

- -

mesh.AddHypothesis(aBox,hyp1)

- -

mesh.AddHypothesis(aBox,hyp2)

- -

mesh.AddHypothesis(aBox,algo1)

- -

mesh.AddHypothesis(aBox,algo2)

- -

 

- -

smesh.Compute(mesh,aBox)

- -

 

- -

smeshgui = salome.ImportComponentGUI("SMESH")

- -

smeshgui.Init(salome.myStudyId);

- -

smeshgui.SetName( - salome.ObjectToID( mesh ), "Mesh_freebord" );

- -

 

- -

# criterion : free borders

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aPredicate = aFilterMgr.CreateFreeBorders()

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Free borders Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup( - SMESH.EDGE, "Free borders" )

- -

aGroup.Add( anIds - )

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Borders at Multiconnection

- -

import salome

- -

import geompy

- -

import SMESH

- -

import StdMeshers

- -

 

- -

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

- -

smesh.SetCurrentStudy(salome.myStudy)

- -

 

- -

# create a box without - one plane

- -

 

- -

box = geompy.MakeBox(0., - 0., 0., 20., 20., 15.)

- -

subShapeList = geompy.SubShapeAll(box, - geompy.ShapeType["FACE"])

- -

 

- -

FaceList  = - []

- -

for i in range( - 5 ):

- -

  FaceList.append( - subShapeList[ i ] )

- -

 

- -

aComp = geompy.MakeCompound( - FaceList )

- -

aBox = geompy.Sew( - aComp, 1. )

- -

idbox = geompy.addToStudy( - aBox, "box" )

- -

  

- -

aBox  = - salome.IDToObject( idbox )

- -

 

- -

# create a mesh

- -

 

- -

hyp1 = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

- -

hyp1.SetNumberOfSegments(5)

- -

hyp2 = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

- -

hyp2.SetMaxElementArea(20)

- -

 

- -

algo1 = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

- -

algo2 = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

- -

 

- -

mesh = smesh.CreateMesh(aBox)

- -

mesh.AddHypothesis(aBox,hyp1)

- -

mesh.AddHypothesis(aBox,hyp2)

- -

mesh.AddHypothesis(aBox,algo1)

- -

mesh.AddHypothesis(aBox,algo2)

- -

 

- -

smesh.Compute(mesh,aBox)

- -

 

- -

smeshgui = salome.ImportComponentGUI("SMESH")

- -

smeshgui.Init(salome.myStudyId);

- -

smeshgui.SetName( - salome.ObjectToID( mesh ), "Mesh_borders_at_multi-connections" - );

- -

 

- -

# Criterion : Borders at - multi-connection

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateMultiConnection()

- -

 

- -

aPredicate = aFilterMgr.CreateEqualTo()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 2 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Borders at multi-connections Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup( - SMESH.EDGE, "Borders at multi-connections" )

- -

aGroup.Add( anIds - )

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Length 1D

- -

 

- -

import salome

- -

import geompy

- -

import SMESH

- -

import StdMeshers

- -

 

- -

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

- -

smesh.SetCurrentStudy(salome.myStudy)

- -

 

- -

# create a box without - one plane

- -

box = geompy.MakeBox(0., - 0., 0., 20., 20., 15.)

- -

subShapeList = geompy.SubShapeAll(box, - geompy.ShapeType["FACE"])

- -

 

- -

FaceList  = - []

- -

for i in range( - 5 ):

- -

  FaceList.append( - subShapeList[ i ] )

- -

 

- -

aComp = geompy.MakeCompound( - FaceList )

- -

aBox = geompy.Sew( - aComp, 1. )

- -

idbox = geompy.addToStudy( - aBox, "box" )

- -

  

- -

aBox  = - salome.IDToObject( idbox )

- -

 

- -

# create a mesh

- -

hyp1 = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

- -

hyp1.SetNumberOfSegments(5)

- -

hyp2 = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

- -

hyp2.SetMaxElementArea(20)

- -

 

- -

algo1 = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

- -

algo2 = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

- -

 

- -

mesh = smesh.CreateMesh(aBox)

- -

mesh.AddHypothesis(aBox,hyp1)

- -

mesh.AddHypothesis(aBox,hyp2)

- -

mesh.AddHypothesis(aBox,algo1)

- -

mesh.AddHypothesis(aBox,algo2)

- -

 

- -

smesh.Compute(mesh,aBox)

- -

 

- -

smeshgui = salome.ImportComponentGUI("SMESH")

- -

smeshgui.Init(salome.myStudyId);

- -

smeshgui.SetName( - salome.ObjectToID( mesh ), "Mesh" );

- -

 

- -

# Criterion : Length > - 3

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateLength()

- -

 

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 3 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Edges length > 3 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup( - SMESH.EDGE, "Edges with legth > 3" )

- -

aGroup.Add( anIds - )

- -

salome.sg.updateObjBrowser(1)

- -

 

- -

Free Edges

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : AREA > - 30

- -

 

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 30 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

anEditor = mesh.GetMeshEditor()

- -

anEditor.RemoveElements(anIds)

- -

 

- -

# Criterion : FREE EDGES

- -

 

- -

aPredicate = aFilterMgr.CreateFreeEdges()

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Free edges Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup( - SMESH.EDGE, "Free edges" )

- -

aGroup.Add( anIds - )

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Length 2D

- -

import salome

- -

import geompy

- -

import SMESH

- -

import StdMeshers

- -

 

- -

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

- -

smesh.SetCurrentStudy(salome.myStudy)

- -

 

- -

# create a box without - one plane

- -

 

- -

box = geompy.MakeBox(0., - 0., 0., 20., 20., 15.)

- -

subShapeList = geompy.SubShapeAll(box, - geompy.ShapeType["FACE"])

- -

 

- -

FaceList  = - []

- -

for i in range( - 5 ):

- -

  FaceList.append( - subShapeList[ i ] )

- -

 

- -

aComp = geompy.MakeCompound( - FaceList )

- -

aBox = geompy.Sew( - aComp, 1. )

- -

idbox = geompy.addToStudy( - aBox, "box" )

- -

  

- -

aBox  = - salome.IDToObject( idbox )

- -

 

- -

# create a mesh

- -

 

- -

hyp1 = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

- -

hyp1.SetNumberOfSegments(5)

- -

hyp2 = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

- -

hyp2.SetMaxElementArea(20)

- -

 

- -

algo1 = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

- -

algo2 = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

- -

 

- -

mesh = smesh.CreateMesh(aBox)

- -

mesh.AddHypothesis(aBox,hyp1)

- -

mesh.AddHypothesis(aBox,hyp2)

- -

mesh.AddHypothesis(aBox,algo1)

- -

mesh.AddHypothesis(aBox,algo2)

- -

 

- -

smesh.Compute(mesh,aBox)

- -

 

- -

smeshgui = salome.ImportComponentGUI("SMESH")

- -

smeshgui.Init(salome.myStudyId);

- -

smeshgui.SetName( - salome.ObjectToID( mesh ), "Mesh" );

- -

 

- -

# Criterion : Length 2D - > 5

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateLength2D()

- -

 

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 5 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Edges length 2D > 5 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup( - SMESH.FACE, "Edges with legth 2D > 5" )

- -

aGroup.Add( anIds - )

- -

salome.sg.updateObjBrowser(1) -  

- -

 

- -

Borders at Multiconnection 2D

- -

import salome

- -

import geompy

- -

import SMESH

- -

import StdMeshers

- -

 

- -

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

- -

smesh.SetCurrentStudy(salome.myStudy)

- -

 

- -

# create a box without - one plane

- -

box = geompy.MakeBox(0., - 0., 0., 20., 20., 15.)

- -

subShapeList = geompy.SubShapeAll(box, - geompy.ShapeType["FACE"])

- -

 

- -

FaceList  = - []

- -

for i in range( - 5 ):

- -

  FaceList.append( - subShapeList[ i ] )

- -

 

- -

aComp = geompy.MakeCompound( - FaceList )

- -

aBox = geompy.Sew( - aComp, 1. )

- -

idbox = geompy.addToStudy( - aBox, "box" )

- -

  

- -

aBox  = - salome.IDToObject( idbox )

- -

 

- -

# create a mesh

- -

hyp1 = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

- -

hyp1.SetNumberOfSegments(5)

- -

hyp2 = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

- -

hyp2.SetMaxElementArea(20)

- -

 

- -

algo1 = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

- -

algo2 = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

- -

 

- -

mesh = smesh.CreateMesh(aBox)

- -

mesh.AddHypothesis(aBox,hyp1)

- -

mesh.AddHypothesis(aBox,hyp2)

- -

mesh.AddHypothesis(aBox,algo1)

- -

mesh.AddHypothesis(aBox,algo2)

- -

 

- -

smesh.Compute(mesh,aBox)

- -

smeshgui = salome.ImportComponentGUI("SMESH")

- -

smeshgui.Init(salome.myStudyId);

- -

smeshgui.SetName( - salome.ObjectToID( mesh ), "Mesh" );

- -

 

- -

# Criterion : MULTI-CONNECTION - 2D = 2

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateMultiConnection2D()

- -

 

- -

aPredicate = aFilterMgr.CreateEqualTo()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 2 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Borders at multi-connection 2D = 2 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup( - SMESH.FACE, "Borders at multi-connection 2D = 2" )

- -

aGroup.Add( anIds - )

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Area

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : AREA > - 100

- -

 

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 100 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Area > 100 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup( - SMESH.FACE, "Area > 100" )

- -

aGroup.Add( anIds - )

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Taper

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : Taper > - 3e-20

- -

 

- -

aFunctor = aFilterMgr.CreateTaper()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 3e-20 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Taper > 3e-20 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup( - SMESH.FACE, "Taper > 3e-20" )

- -

aGroup.Add( anIds - )

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Aspect Ratio

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : ASPECT RATIO - > 1.4

- -

 

- -

aFunctor = aFilterMgr.CreateAspectRatio()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 1.4 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Aspect Ratio > 1.4 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup( - SMESH.FACE, "Aspect Ratio > 1.4" )

- -

aGroup.Add( anIds - )

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Minimum Angle

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : MINIMUM - ANGLE < 70

- -

 

- -

aFunctor = aFilterMgr.CreateMinimumAngle()

- -

aPredicate = aFilterMgr.CreateLessThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 70 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Minimum Angle < 70 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup( - SMESH.FACE, "Minimum Angle < 70" )

- -

aGroup.Add( anIds - )

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Warping

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : WARP ANGLE - > 1e-15

- -

 

- -

aFunctor = aFilterMgr.CreateWarping()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 1e-15 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Warp > 1e-15 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup( - SMESH.FACE, "Warp > 1e-15" )

- -

aGroup.Add( anIds - )

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Skew

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : Skew > - 18

- -

 

- -

aFunctor = aFilterMgr.CreateSkew()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 18 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Skew > 18 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup( - SMESH.FACE, "Skew > 18" )

- -

aGroup.Add( anIds - )

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Aspect Ratio 3D

- -

import SMESH

- -

import SMESH_mechanic_tetra

- -

 

- -

smesh  = - SMESH_mechanic_tetra.smesh

- -

mesh   = - SMESH_mechanic_tetra.mesh

- -

salome = SMESH_mechanic_tetra.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : ASPECT RATIO - 3D > 2.2

- -

 

- -

aFunctor = aFilterMgr.CreateAspectRatio3D()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 2.2 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

# print the result

- -

print "Criterion: - Aspect Ratio 3D > 2.2 Nb = ", len( anIds )

- -

for i in range( - len( anIds ) ):

- -

  print - anIds[ i ]

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup( - SMESH.VOLUME, "Aspect Ratio 3D > 2.2" )

- -

aGroup.Add( anIds - )

- -

 

- -

salome.sg.updateObjBrowser(1) -

- - - - + + + + + +Quality Controls + + + + + + + + + + + +

Quality Controls

+ +

Free Borders

+ +

import salome

+ +

import geompy

+ +

import SMESH

+ +

import StdMeshers

+ +

 

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smesh.SetCurrentStudy(salome.myStudy)

+ +

 

+ +

# create a box without + one plane

+ +

box = geompy.MakeBox(0., + 0., 0., 20., 20., 15.)

+ +

subShapeList = geompy.SubShapeAll(box, + geompy.ShapeType["FACE"])

+ +

 

+ +

FaceList  = + []

+ +

for i in range( + 5 ):

+ +

  FaceList.append( + subShapeList[ i ] )

+ +

 

+ +

aComp = geompy.MakeCompound( + FaceList )

+ +

aBox = geompy.Sew( + aComp, 1. )

+ +

idbox = geompy.addToStudy( + aBox, "box" )

+ +

  

+ +

aBox  = + salome.IDToObject( idbox )

+ +

 

+ +

# create a mesh

+ +

hyp1 = smesh.CreateHypothesis("NumberOfSegments", + "libStdMeshersEngine.so")

+ +

hyp1.SetNumberOfSegments(5)

+ +

hyp2 = smesh.CreateHypothesis("MaxElementArea", + "libStdMeshersEngine.so")

+ +

hyp2.SetMaxElementArea(20)

+ +

 

+ +

algo1 = smesh.CreateHypothesis("Regular_1D", + "libStdMeshersEngine.so")

+ +

algo2 = smesh.CreateHypothesis("MEFISTO_2D", + "libStdMeshersEngine.so")

+ +

 

+ +

mesh = smesh.CreateMesh(aBox)

+ +

mesh.AddHypothesis(aBox,hyp1)

+ +

mesh.AddHypothesis(aBox,hyp2)

+ +

mesh.AddHypothesis(aBox,algo1)

+ +

mesh.AddHypothesis(aBox,algo2)

+ +

 

+ +

smesh.Compute(mesh,aBox)

+ +

 

+ +

smeshgui = salome.ImportComponentGUI("SMESH")

+ +

smeshgui.Init(salome.myStudyId);

+ +

smeshgui.SetName( + salome.ObjectToID( mesh ), "Mesh_freebord" );

+ +

 

+ +

# criterion : free borders

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

aPredicate = aFilterMgr.CreateFreeBorders()

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print "Criterion: + Free borders Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup( + SMESH.EDGE, "Free borders" )

+ +

aGroup.Add( anIds + )

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Borders at Multiconnection

+ +

import salome

+ +

import geompy

+ +

import SMESH

+ +

import StdMeshers

+ +

 

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smesh.SetCurrentStudy(salome.myStudy)

+ +

 

+ +

# create a box without + one plane

+ +

 

+ +

box = geompy.MakeBox(0., + 0., 0., 20., 20., 15.)

+ +

subShapeList = geompy.SubShapeAll(box, + geompy.ShapeType["FACE"])

+ +

 

+ +

FaceList  = + []

+ +

for i in range( + 5 ):

+ +

  FaceList.append( + subShapeList[ i ] )

+ +

 

+ +

aComp = geompy.MakeCompound( + FaceList )

+ +

aBox = geompy.Sew( + aComp, 1. )

+ +

idbox = geompy.addToStudy( + aBox, "box" )

+ +

  

+ +

aBox  = + salome.IDToObject( idbox )

+ +

 

+ +

# create a mesh

+ +

 

+ +

hyp1 = smesh.CreateHypothesis("NumberOfSegments", + "libStdMeshersEngine.so")

+ +

hyp1.SetNumberOfSegments(5)

+ +

hyp2 = smesh.CreateHypothesis("MaxElementArea", + "libStdMeshersEngine.so")

+ +

hyp2.SetMaxElementArea(20)

+ +

 

+ +

algo1 = smesh.CreateHypothesis("Regular_1D", + "libStdMeshersEngine.so")

+ +

algo2 = smesh.CreateHypothesis("MEFISTO_2D", + "libStdMeshersEngine.so")

+ +

 

+ +

mesh = smesh.CreateMesh(aBox)

+ +

mesh.AddHypothesis(aBox,hyp1)

+ +

mesh.AddHypothesis(aBox,hyp2)

+ +

mesh.AddHypothesis(aBox,algo1)

+ +

mesh.AddHypothesis(aBox,algo2)

+ +

 

+ +

smesh.Compute(mesh,aBox)

+ +

 

+ +

smeshgui = salome.ImportComponentGUI("SMESH")

+ +

smeshgui.Init(salome.myStudyId);

+ +

smeshgui.SetName( + salome.ObjectToID( mesh ), "Mesh_borders_at_multi-connections" + );

+ +

 

+ +

# Criterion : Borders at + multi-connection

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

aFunctor = aFilterMgr.CreateMultiConnection()

+ +

 

+ +

aPredicate = aFilterMgr.CreateEqualTo()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 2 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print "Criterion: + Borders at multi-connections Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup( + SMESH.EDGE, "Borders at multi-connections" )

+ +

aGroup.Add( anIds + )

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Length 1D

+ +

 

+ +

import salome

+ +

import geompy

+ +

import SMESH

+ +

import StdMeshers

+ +

 

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smesh.SetCurrentStudy(salome.myStudy)

+ +

 

+ +

# create a box without + one plane

+ +

box = geompy.MakeBox(0., + 0., 0., 20., 20., 15.)

+ +

subShapeList = geompy.SubShapeAll(box, + geompy.ShapeType["FACE"])

+ +

 

+ +

FaceList  = + []

+ +

for i in range( + 5 ):

+ +

  FaceList.append( + subShapeList[ i ] )

+ +

 

+ +

aComp = geompy.MakeCompound( + FaceList )

+ +

aBox = geompy.Sew( + aComp, 1. )

+ +

idbox = geompy.addToStudy( + aBox, "box" )

+ +

  

+ +

aBox  = + salome.IDToObject( idbox )

+ +

 

+ +

# create a mesh

+ +

hyp1 = smesh.CreateHypothesis("NumberOfSegments", + "libStdMeshersEngine.so")

+ +

hyp1.SetNumberOfSegments(5)

+ +

hyp2 = smesh.CreateHypothesis("MaxElementArea", + "libStdMeshersEngine.so")

+ +

hyp2.SetMaxElementArea(20)

+ +

 

+ +

algo1 = smesh.CreateHypothesis("Regular_1D", + "libStdMeshersEngine.so")

+ +

algo2 = smesh.CreateHypothesis("MEFISTO_2D", + "libStdMeshersEngine.so")

+ +

 

+ +

mesh = smesh.CreateMesh(aBox)

+ +

mesh.AddHypothesis(aBox,hyp1)

+ +

mesh.AddHypothesis(aBox,hyp2)

+ +

mesh.AddHypothesis(aBox,algo1)

+ +

mesh.AddHypothesis(aBox,algo2)

+ +

 

+ +

smesh.Compute(mesh,aBox)

+ +

 

+ +

smeshgui = salome.ImportComponentGUI("SMESH")

+ +

smeshgui.Init(salome.myStudyId);

+ +

smeshgui.SetName( + salome.ObjectToID( mesh ), "Mesh" );

+ +

 

+ +

# Criterion : Length > + 3

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

aFunctor = aFilterMgr.CreateLength()

+ +

 

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 3 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print "Criterion: + Edges length > 3 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup( + SMESH.EDGE, "Edges with legth > 3" )

+ +

aGroup.Add( anIds + )

+ +

salome.sg.updateObjBrowser(1)

+ +

 

+ +

Free Edges

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : AREA > + 30

+ +

aFunctor = aFilterMgr.CreateArea()

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 95 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

anEditor = mesh.GetMeshEditor()

+ +

anEditor.RemoveElements(anIds)

+ +

 

+ +

# Criterion : Free Edges

+ +

 

+ +

aPredicate = aFilterMgr.CreateFreeEdges()

+ +

aPredicate.SetMesh( + mesh )

+ +

aBorders = aPredicate.GetBorders()

+ +

 

+ +

# create groups

+ +

aGroupF = mesh.CreateGroup( + SMESH.FACE, "Faces with free edges" )

+ +

aGroupN = mesh.CreateGroup( + SMESH.NODE, "Nodes on free edges" )

+ +

 

+ +

# fill groups with elements, + corresponding to the criterion

+ +

print ""

+ +

print "Criterion: + Free edges Nb = ", len( aBorders )

+ +

for i in range( + len( aBorders ) ):

+ +

  aBorder + = aBorders[ i ]

+ +

  print + "Face # ", aBorder.myElemId, " : Edge between nodes (",

+ +

  print + aBorder.myPnt1, ", ", aBorder.myPnt2, ")"

+ +

  

+ +

  aGroupF.Add( + [aBorder.myElemId] )

+ +

  aGroupN.Add( + [aBorder.myPnt1, aBorder.myPnt2] )

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Length 2D

+ +

import salome

+ +

import geompy

+ +

import SMESH

+ +

import StdMeshers

+ +

 

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smesh.SetCurrentStudy(salome.myStudy)

+ +

 

+ +

# create a box without + one plane

+ +

 

+ +

box = geompy.MakeBox(0., + 0., 0., 20., 20., 15.)

+ +

subShapeList = geompy.SubShapeAll(box, + geompy.ShapeType["FACE"])

+ +

 

+ +

FaceList  = + []

+ +

for i in range( + 5 ):

+ +

  FaceList.append( + subShapeList[ i ] )

+ +

 

+ +

aComp = geompy.MakeCompound( + FaceList )

+ +

aBox = geompy.Sew( + aComp, 1. )

+ +

idbox = geompy.addToStudy( + aBox, "box" )

+ +

  

+ +

aBox  = + salome.IDToObject( idbox )

+ +

 

+ +

# create a mesh

+ +

 

+ +

hyp1 = smesh.CreateHypothesis("NumberOfSegments", + "libStdMeshersEngine.so")

+ +

hyp1.SetNumberOfSegments(5)

+ +

hyp2 = smesh.CreateHypothesis("MaxElementArea", + "libStdMeshersEngine.so")

+ +

hyp2.SetMaxElementArea(20)

+ +

 

+ +

algo1 = smesh.CreateHypothesis("Regular_1D", + "libStdMeshersEngine.so")

+ +

algo2 = smesh.CreateHypothesis("MEFISTO_2D", + "libStdMeshersEngine.so")

+ +

 

+ +

mesh = smesh.CreateMesh(aBox)

+ +

mesh.AddHypothesis(aBox,hyp1)

+ +

mesh.AddHypothesis(aBox,hyp2)

+ +

mesh.AddHypothesis(aBox,algo1)

+ +

mesh.AddHypothesis(aBox,algo2)

+ +

 

+ +

smesh.Compute(mesh,aBox)

+ +

 

+ +

smeshgui = salome.ImportComponentGUI("SMESH")

+ +

smeshgui.Init(salome.myStudyId);

+ +

smeshgui.SetName( + salome.ObjectToID( mesh ), "Mesh" );

+ +

 

+ +

# Criterion : Length 2D + > 5

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

aFunctor = aFilterMgr.CreateLength2D()

+ +

 

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 5 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print "Criterion: + Edges length 2D > 5 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup( + SMESH.FACE, "Edges with legth 2D > 5" )

+ +

aGroup.Add( anIds + )

+ +

salome.sg.updateObjBrowser(1) +  

+ +

 

+ +

Borders at Multiconnection 2D

+ +

import salome

+ +

import geompy

+ +

import SMESH

+ +

import StdMeshers

+ +

 

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smesh.SetCurrentStudy(salome.myStudy)

+ +

 

+ +

# create a box without + one plane

+ +

box = geompy.MakeBox(0., + 0., 0., 20., 20., 15.)

+ +

subShapeList = geompy.SubShapeAll(box, + geompy.ShapeType["FACE"])

+ +

 

+ +

FaceList  = + []

+ +

for i in range( + 5 ):

+ +

  FaceList.append( + subShapeList[ i ] )

+ +

 

+ +

aComp = geompy.MakeCompound( + FaceList )

+ +

aBox = geompy.Sew( + aComp, 1. )

+ +

idbox = geompy.addToStudy( + aBox, "box" )

+ +

  

+ +

aBox  = + salome.IDToObject( idbox )

+ +

 

+ +

# create a mesh

+ +

hyp1 = smesh.CreateHypothesis("NumberOfSegments", + "libStdMeshersEngine.so")

+ +

hyp1.SetNumberOfSegments(5)

+ +

hyp2 = smesh.CreateHypothesis("MaxElementArea", + "libStdMeshersEngine.so")

+ +

hyp2.SetMaxElementArea(20)

+ +

 

+ +

algo1 = smesh.CreateHypothesis("Regular_1D", + "libStdMeshersEngine.so")

+ +

algo2 = smesh.CreateHypothesis("MEFISTO_2D", + "libStdMeshersEngine.so")

+ +

 

+ +

mesh = smesh.CreateMesh(aBox)

+ +

mesh.AddHypothesis(aBox,hyp1)

+ +

mesh.AddHypothesis(aBox,hyp2)

+ +

mesh.AddHypothesis(aBox,algo1)

+ +

mesh.AddHypothesis(aBox,algo2)

+ +

 

+ +

smesh.Compute(mesh,aBox)

+ +

smeshgui = salome.ImportComponentGUI("SMESH")

+ +

smeshgui.Init(salome.myStudyId);

+ +

smeshgui.SetName( + salome.ObjectToID( mesh ), "Mesh" );

+ +

 

+ +

# Criterion : MULTI-CONNECTION + 2D = 2

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

aFunctor = aFilterMgr.CreateMultiConnection2D()

+ +

 

+ +

aPredicate = aFilterMgr.CreateEqualTo()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 2 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print "Criterion: + Borders at multi-connection 2D = 2 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup( + SMESH.FACE, "Borders at multi-connection 2D = 2" )

+ +

aGroup.Add( anIds + )

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Area

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : AREA > + 100

+ +

 

+ +

aFunctor = aFilterMgr.CreateArea()

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 100 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print "Criterion: + Area > 100 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup( + SMESH.FACE, "Area > 100" )

+ +

aGroup.Add( anIds + )

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Taper

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : Taper > + 3e-20

+ +

 

+ +

aFunctor = aFilterMgr.CreateTaper()

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 3e-20 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print "Criterion: + Taper > 3e-20 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup( + SMESH.FACE, "Taper > 3e-20" )

+ +

aGroup.Add( anIds + )

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Aspect Ratio

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : ASPECT RATIO + > 1.4

+ +

 

+ +

aFunctor = aFilterMgr.CreateAspectRatio()

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 1.4 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print "Criterion: + Aspect Ratio > 1.4 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup( + SMESH.FACE, "Aspect Ratio > 1.4" )

+ +

aGroup.Add( anIds + )

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Minimum Angle

+ +

 

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : MINIMUM + ANGLE < 70

+ +

 

+ +

aFunctor = aFilterMgr.CreateMinimumAngle()

+ +

aPredicate = aFilterMgr.CreateLessThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 70 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print "Criterion: + Minimum Angle < 70 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup( + SMESH.FACE, "Minimum Angle < 70" )

+ +

aGroup.Add( anIds + )

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Warping

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : WARP ANGLE + > 1e-15

+ +

 

+ +

aFunctor = aFilterMgr.CreateWarping()

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 1e-15 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print "Criterion: + Warp > 1e-15 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup( + SMESH.FACE, "Warp > 1e-15" )

+ +

aGroup.Add( anIds + )

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Skew

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : Skew > + 18

+ +

 

+ +

aFunctor = aFilterMgr.CreateSkew()

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 18 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print "Criterion: + Skew > 18 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup( + SMESH.FACE, "Skew > 18" )

+ +

aGroup.Add( anIds + )

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Aspect Ratio 3D

+ +

import SMESH

+ +

import SMESH_mechanic_tetra

+ +

 

+ +

smesh  = + SMESH_mechanic_tetra.smesh

+ +

mesh   = + SMESH_mechanic_tetra.mesh

+ +

salome = SMESH_mechanic_tetra.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : ASPECT RATIO + 3D > 2.2

+ +

 

+ +

aFunctor = aFilterMgr.CreateAspectRatio3D()

+ +

aPredicate = aFilterMgr.CreateMoreThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 2.2 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print "Criterion: + Aspect Ratio 3D > 2.2 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup( + SMESH.VOLUME, "Aspect Ratio 3D > 2.2" )

+ +

aGroup.Add( anIds + )

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Volume

+ +

import SMESH

+ +

import SMESH_mechanic_tetra

+ +

 

+ +

smesh  = + SMESH_mechanic_tetra.smesh

+ +

mesh   = + SMESH_mechanic_tetra.mesh

+ +

salome = SMESH_mechanic_tetra.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Criterion : VOLUME < + 7

+ +

 

+ +

aFunctor = aFilterMgr.CreateVolume3D()

+ +

aPredicate = aFilterMgr.CreateLessThan()

+ +

aPredicate.SetNumFunctor( + aFunctor )

+ +

aPredicate.SetMargin( + 7 )

+ +

 

+ +

aFilter = aFilterMgr.CreateFilter()

+ +

aFilter.SetPredicate( + aPredicate )

+ +

 

+ +

anIds = aFilter.GetElementsId( + mesh )

+ +

 

+ +

# print the result

+ +

print ""

+ +

print "Criterion: + Volume < 7 Nb = ", len( anIds )

+ +

for i in range( + len( anIds ) ):

+ +

  print + anIds[ i ]

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup( + SMESH.VOLUME, "Volume < 7" )

+ +

aGroup.Add( anIds + )

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ + + + diff --git a/doc/salome/gui/SMESH/revolution.htm b/doc/salome/gui/SMESH/revolution.htm index d409d47a6..b5d7a667d 100755 --- a/doc/salome/gui/SMESH/revolution.htm +++ b/doc/salome/gui/SMESH/revolution.htm @@ -1,148 +1,156 @@ - - - - - -Revolution - - - - - - - - - - - -

Revolution

- -

Revolution is a type of surface meshing by generation from discretized - lines. It is used to build mesh elements of plus one dimension than the - swept ones. Each swept 1D element produces one or more quadrangles (or - triangles if one node of a rotated element lays on the revolution axis).

- -

 

- -

To apply revolution:

- -

 

- -

1. From the Modification - menu choose the Revolution item - or click button in the toolbar. The following dialog box - shall appear:

- -

 

- -

- -

 

- -

2. In this dialog box you should specify:

- -
    - -
  • the type of elements - which will be extruded (1D or 2D),

  • - -
  • specify the IDs of - the elements which will be revolved by selecting them in the 3D viewer - or select the whole mesh or submesh,

  • - -
  • specify the axis (point - and vector) around which the elements will be revolved,

  • - -
  • angle of rotation,

  • - -
  • number of steps,

  • - -
  • tolerance of rotation

  • -
- -

 

- -

3. Click the Apply - or OK button.

- -

 

- -

- -

 

- -

 See - Also a sample TUI Script of a  Revolution - operation.  

- -

 

- - - - + + + + + +Revolution + + + + + + + + + + + + +

Revolution

+ +

Revolution is a type of surface meshing by generation from discretized + lines. It is used to build mesh elements of plus one dimension than the + swept ones. Each swept 1D element produces one or more quadrangles (or + triangles if one node of a rotated element lays on the revolution axis).

+ +

 

+ +

To apply revolution:

+ +

 

+ +

1. From the Modification + menu choose the Revolution item + or click button in the toolbar. The following dialog box + shall appear:

+ +

 

+ +

+ +

 

+ +

+ +

 

+ +

2. In this dialog box you should specify:

+ +
    + +
  • the type of elements + which will be extruded (1D or 2D),

  • + +
  • specify the IDs of + the elements which will be revolved by selecting them in the 3D viewer + or select the whole mesh or submesh,

  • + +
  • specify the axis (point + and vector) around which the elements will be revolved,

  • + +
  • angle of rotation,

  • + +
  • number of steps,

  • + +
  • tolerance of rotation

  • +
+ +

 

+ +

3. Click the Apply + or OK button.

+ +

 

+ +

+ +

 

+ +

 See + Also a sample TUI Script of a  Revolution + operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/selection_filter_library.htm b/doc/salome/gui/SMESH/selection_filter_library.htm index 333b5b0d2..2a2cb8d78 100755 --- a/doc/salome/gui/SMESH/selection_filter_library.htm +++ b/doc/salome/gui/SMESH/selection_filter_library.htm @@ -1,154 +1,159 @@ - - - - - -Selection filter library - - - - - - - - - - - -

Selection filter library

- -

Selection filter library is a powerful tool enabling to create filters - to be used on meshes. You can access to it from the Main Menu via Tools / Selection filter library.

- -

 

- -

- -

 

- -

Library file name shows - the path and the file name where your filters will be stored. By clicking - the browse button - you can load an existing filter library.

- -

Names of filters lists the filters - created or uploaded for the current study. You can Add - or Delete filters.  

- -

In Filter name box you can specify - the name for your filter. By default it is prefixed with the corresponding - entity type.

- -

Each filter can be applicable to Nodes, - Edges, Faces or Volumes. - You can combine many criteria in one filter, but they all must be of the - same Entity type.

- -

The Add button creates a new - criterion at the end of the list of criteria. The Insert - button creates a new criterion before the selected criterion. The Remove button deletes the selected criterion. - The Clear button deletes all criteria. -  

- -

Each Entity type has its specific - list of criteria, however all filters have common syntax. For each criterion - you should specify the Threshold Value - and whether we search for the elements that should be More, - Less or Equal to this Value. - You should also specify if the criterion is Unary - or Binary.   

- -

Some criteria should have the additional parameter of Tolerance.

- -

 

- -

When we create a Standalone Group - using filters (for this click Set Filters - button in the Create Group menu), - the menu for setting filters looks a bit differently. Toggling Insert - filter in viewer checkbox enables to preview the group selected - with your current filter in the viewer.

- -

In the Source field you choose - if the filter will be applied to the whole Mesh, - the Initial Selection or the Current Group.

- -

Copy from... button gives you - a possibility to load an existing filter from Selection - filter library and Add to... - button gives you a possibility to save your current filter in the Library. -  

- -

 

- -

- - - - + + + + + +Selection filter library + + + + + + + + + + + + +

Selection filter library

+ +

Selection filter library is a powerful tool enabling to create filters + to be used on meshes. You can access to it from the Main Menu via Tools / Selection filter library.

+ +

 

+ +

+ +

 

+ +

Library file name shows + the path and the file name where your filters will be stored. By clicking + the browse button + you can load an existing filter library.

+ +

Names of filters lists the filters + created or uploaded for the current study. You can Add + or Delete filters.  

+ +

In Filter name box you can specify + the name for your filter. By default it is prefixed with the corresponding + entity type.

+ +

Each filter can be applicable to Nodes, + Edges, Faces or Volumes. + You can combine many criteria in one filter, but they all must be of the + same Entity type.

+ +

The Add button creates a new + criterion at the end of the list of criteria. The Insert + button creates a new criterion before the selected criterion. The Remove button deletes the selected criterion. + The Clear button deletes all criteria. +  

+ +

Each Entity type has its specific + list of criteria, however all filters have common syntax. For each criterion + you should specify the Threshold Value + and whether we search for the elements that should be More, + Less or Equal to this Value. + You should also specify if the criterion is Unary + or Binary.   

+ +

Some criteria should have the additional parameter of Tolerance.

+ +

 

+ +

When we create a Standalone Group + using filters (for this click Set Filters + button in the Create Group menu), + the menu for setting filters looks a bit differently. Toggling Insert + filter in viewer checkbox enables to preview the group selected + with your current filter in the viewer.

+ +

In the Source field you choose + if the filter will be applied to the whole Mesh, + the Initial Selection or the Current Group.

+ +

Copy from... button gives you + a possibility to load an existing filter from Selection + filter library and Add to... + button gives you a possibility to save your current filter in the Library. +  

+ +

 

+ +

+ + + + diff --git a/doc/salome/gui/SMESH/smesh.htm b/doc/salome/gui/SMESH/smesh.htm deleted file mode 100755 index 4964c60ea..000000000 --- a/doc/salome/gui/SMESH/smesh.htm +++ /dev/null @@ -1,139 +0,0 @@ - - - - SMESH reference manual - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/salome/gui/SMESH/smesh.log b/doc/salome/gui/SMESH/smesh.log index f87769ff7..73dbb7053 100755 --- a/doc/salome/gui/SMESH/smesh.log +++ b/doc/salome/gui/SMESH/smesh.log @@ -1,495 +1,508 @@ -|SourceProjectName:SMESH.hpr -|DestinationProjectName:smesh.htm -whhost.js -whmsg.js -whmozemu.js -whproxy.js -whstub.js -whutils.js -whver.js -whform.js -whphost.js -whstart.js -whtopic.js -whframes.js -whlang.js -whskin_info.htm -whskin_blank.htm -whskin_pickup.htm -whskin_homepage.htm -whskin_tw.htm -whnjs.htm -whthost.js -whtdhtml.htm -whihost.js -whibody.htm -whiform.htm -whfhost.js -whfbody.htm -whfform.htm -whghost.js -whgbody.htm -whgdhtml.htm -whgdef.htm -whproj.js -whproj.xml -whproj.htm -whxdata\whtoc.xml -whxdata\whidx.xml -whxdata\whfts.xml -whxdata\whglo.xml -whdata\whtoc.js -whdata\whtoc.htm -whdata\whtdata.js -whdata\whidx.js -whdata\whidx.htm -whdata\whidata.js -whdata\whfts.js -whdata\whfts.htm -whdata\whglo.js -whdata\whglo.htm -whdata\whgdata.js -whdata\whftdata.js -whdata\whfwdata.js -whres.xml -webhelp.jar -webhelp.cab -whgdata\whnvp30.htm -whgdata\whnvp31.htm -whgdata\whnvp32.htm -whgdata\whnvp33.htm -whgdata\whnvt30.htm -whgdata\whnvt31.htm -whgdata\whnvt32.htm -whgdata\whnvt33.htm -whgdata\whnvf30.htm -whgdata\whnvf31.htm -whgdata\whnvf32.htm -whgdata\whnvf33.htm -whgdata\whnvl31.htm -whgdata\whnvl32.htm -whgdata\whnvl33.htm -whgdata\whexpbar.gif -cshdat_webhelp.htm -whcsh_home.htm -whcshdata.htm -cshdat_robohelp.htm -wht_tab0.gif -wht_tab1.gif -wht_tab2.gif -wht_tab3.gif -wht_tab4.gif -wht_tab5.gif -wht_tab6.gif -wht_tab7.gif -wht_tab8.gif -wht_glo_h.gif -wht_glo_n.gif -wht_fts_h.gif -wht_fts_n.gif -wht_idx_h.gif -wht_idx_n.gif -wht_toc_h.gif -wht_toc_n.gif -wht_ws.gif -wht_ws_g.gif -wht_logo1.gif -wht_logo2.gif -wht_abgw.jpg -wht_abgi.jpg -wht_abge.jpg -wht_abtw.jpg -wht_abte.jpg -wht_abti.jpg -wht_spac.gif -wht_next.gif -wht_next_g.gif -wht_prev.gif -wht_prev_g.gif -wht_sync.gif -wht_hide.gif -wht_go.gif -whstart.ico -whestart.ico -whrstart.ico -whidhtml.htm -whfdhtml.htm -whskin_banner.htm -whtbar.js -whskin_pdhtml.htm -whskin_papplet.htm -whskin_plist.htm -whskin_tbars.htm -whskin_mbars.htm -wht_toc4.gif -wht_toc1.gif -wht_toc2.gif -wht_toc3.gif -whskin_frmset010.htm -whst_topics.xml -whskin_frmset01.htm -smesh_hha.hhk -smesh.hhc -smesh.hhk -about_viewing_meshes.htm -aspect_ratio_3d.htm -borders_at_multi-connection.htm -borders_at_multiconnection_2d.htm -clipping.htm -constructing_meshes.htm -defining_hypotheses_tui.htm -deleting_groups.htm -display_entity.htm -extrusion.htm -extrusion_along_a_path.htm -files\about_hypotheses.htm -files\about_meshes.htm -files\about_meshing_algorithms.htm -files\about_quality_controls.htm -files\adding_nodes_and_elements.htm -files\area_of_elements.htm -files\arithmetic_1d.htm -files\aspect_ratio.htm -files\changing_orientation_of_elements.htm -files\constructing_groups_of_specific_elements.htm -files\constructing_meshes.htm -files\constructing_submeshes.htm -files\creating_groups.htm -files\cutting_quadrangles.htm -files\diagonal_iversion_of_elements.htm -files\displacing_nodes.htm -files\displaying_nodes_numbers.htm -files\editing_groups.htm -files\importing_and_exporting_meshes.htm -files\introduction_to_smesh.htm -files\length_of_edges.htm -files\max._element_area_hypothesis.htm -files\max._element_volume_hypothsis.htm -files\merging_nodes.htm -files\minimum_angle.htm -files\non_conform_mesh_allowed_hypothesis.htm -files\reassigning_hypotheses_and_algorithms.htm -files\removing_nodes_and_elements.htm -files\renumbering_nodes_and_elements.htm -files\rotation.htm -files\running_smesh_module.htm -files\sewing_meshes.htm -files\skew.htm -files\smoothing.htm -files\symmetry.htm -files\taper.htm -files\translation.htm -files\uniting_a_set_of_triangles.htm -files\uniting_two_triangles.htm -files\using_operations_on_groups.htm -files\viewing_mesh_info.htm -files\warp.htm -free_borders.htm -free_edges.htm -grouping_elements.htm -length.htm -modifying_meshes.htm -pattern_mapping.htm -presentation.htm -quality_controls.htm -revolution.htm -selection_filter_library.htm -transforming_meshes.htm -transparency.htm -viewing_meshes.htm -ehelp.xml -texture_horiz_ltbluebubbles.jpg -smesh.glo -default.css -pics\add_node.png -pics\remove_nodes2.png -pics\merging_nodes2.png -pics\moving_nodes2.png -pics\smoothing2.png -pics\b-mberofsegments.png -pics\b-flection1d.png -pics\a-cuttingofquadrangles.png -image129.gif -pics\addquadrangle.png -pics\intersectgroups.png -pics\editgroup.png -image95.jpg -pics\sewing1.png -image92.gif -image51.jpg -image70.gif -pics\create_group.png -pics\edit_mesh_change_value_hyp.png -pics\free_borders1.png -pics\add_triangle.png -pics\b-art_end_length.png -pics\a-creategroup.png -pics\a-clipping2.png -pics\a-transparency.png -pics\diagonalinversion.png -pics\translation1.png -image96.jpg -pics\sewing2.png -image119.gif -image108.gif -image52.jpg -image82.gif -image71.gif -image30.jpg -pics\rotation1.png -pics\a-createpolyhedralvolume.png -pics\a-patterntype.png -pics\orientaation1.png -pics\translation2.png -pics\cutgroups.png -image97.jpg -pics\sewing3.png -image86.jpg -image50.gif -image94.gif -image83.gif -image31.jpg -pics\add_polyhedron.png -pics\add_edge.png -pics\rotation2.png -pics\b-ithmetic1d.png -image10.jpg -pics\a-maxelarea.png -pics\addhexahedron.png -pics\addtetrahedron.png -image5.jpg -pics\sewing4.png -image95.gif -image76.jpg -image84.gif -image73.gif -image32.jpg -image40.gif -pics\smoothing.png -image88.jpg -image30.gif -image96.gif -image77.jpg -image74.gif -image63.gif -image22.jpg -image41.gif -pics\deletegroups.png -pics\editing_groups1.png -pics\uniting_two_triangles1.png -image7.jpg -pics\a-averagelength.png -pics\a-patterntype1.png -pics\extrusionalongaline1.png -pics\movenodes.png -pics\rotation.png -image56.jpg -image53.gif -image20.gif -image97.gif -image78.jpg -image64.gif -image23.jpg -pics\cut_groups1.png -pics\editing_groups2.png -pics\uniting_two_triangles2.png -pics\a-unionoftriangles.png -pics\a-arithmetic1d.png -pics\a-exportmesh.png -pics\extrusionalongaline2.png -pics\importmesh.png -image79.jpg -image21.gif -image98.gif -image32.gif -pics\cut_groups2.png -image130.gif -pics\max_el_area.png -pics\a-extusionalongapath2.png -pics\a-viewgeneral.png -pics\revolution1.png -pics\addtriangle.png -image99.gif -image55.gif -image88.gif -image36.jpg -image33.gif -image22.gif -image25.jpg -i_blue.jpg -pics\cut_groups3.png -image131.gif -pics\c-editmesh.png -pics\add_quadrangle.png -pics\uniting_a_set_of_triangles1.png -pics\a-deflection1d.png -pics\revolution2.png -pics\unionoftwotriangles.png -pics\addnode.png -image120.gif -image56.gif -image37.jpg -image23.gif -image67.gif -image34.gif -image26.jpg -image132.gif -pics\edit_mesh1.png -pics\remove_elements1.png -pics\uniting_a_set_of_triangles2.png -pics\mergenodes.png -pics\symmetry1.png -image121.gif -image79.gif -image38.jpg -image46.gif -image35.gif -image27.jpg -image24.gif -pics\intersect_groups1.png -image133.gif -pics\length1.png -pics\borders_at_multi_connections1.png -pics\add_polygone.png -pics\remove_elements2.png -pics\a-maxelvolume.png -pics\symmetry2.png -image122.gif -image58.gif -image36.gif -image25.gif -note1.gif -pics\intersect_groups2.png -image134.gif -pics\b-mesh_infos.png -pics\symmetry3.png -pics\addedge.png -image123.gif -image101.gif -image37.gif -pics\intersect_groups3.png -image135.gif -pics\b-erage_length.png -pics\a-standmeshinfo.png -pics\a-nbsegments1.png -pics\patternmapping1.png -image90.jpg -image124.gif -image102.gif -image19.jpg -image49.gif -image27.gif -image38.gif -image136.gif -pics\c-createmesh.png -pics\a-nbsegments2.png -pics\a-startendlength.png -pics\patternmapping2.png -pics\removeelements.png -pics\removenodes.png -pics\uniongroups.png -image125.gif -image103.gif -pics\exemple.gif -image39.gif -image28.gif -pics\union_groups1.png -image137.gif -pics\free_edges.png -pics\a-nbsegments3.png -pics\creategroup.png -image92.jpg -pics\submeshconstruction.png -image126.gif -image104.gif -image18.gif -image70.jpg -pics\union_groups2.png -pics\length2d.png -pics\a-advmeshinfo.png -pics\a-nbsegments4.png -pics\renumbernodes.png -image127.gif -image93.jpg -image105.gif -image19.gif -image71.jpg -pics\selectionfilterlibrary.png -pics\union_groups3.png -pics\edit_mesh_remove_hyp.png -pics\remove_nodes1.png -pics\merging_nodes1.png -pics\moving_nodes1.png -pics\smoothing1.png -pics\a-filteronedges.png -pics\renumberelements.png -pics\addpolygon.png -image94.jpg -image106.gif -image91.gif -image80.gif -smesh.ppf -ehlpdhtm.js -default_ns.css -whxdata\whtdata0.xml -whxdata\whftdata0.xml -whxdata\whfwdata0.xml -whxdata\whgdata0.xml -whdata\whtdata0.htm -whdata\whftdata0.htm -whdata\whfwdata0.htm -whdata\whgdata0.htm -whgdata\whlstt0.htm -whgdata\whlstt1.htm -whgdata\whlstt2.htm -whgdata\whlstt3.htm -whgdata\whlstt4.htm -whgdata\whlstt5.htm -whgdata\whlstt6.htm -whgdata\whlstt7.htm -whgdata\whlstt8.htm -whgdata\whlstt9.htm -whgdata\whlsti0.htm -whgdata\whlstfl0.htm -whgdata\whlstfl1.htm -whgdata\whlstfl2.htm -whgdata\whlstfl3.htm -whgdata\whlstfl4.htm -whgdata\whlstfl5.htm -whgdata\whlstfl6.htm -whgdata\whlstfl7.htm -whgdata\whlstfl8.htm -whgdata\whlstfl9.htm -whgdata\whlstfl10.htm -whgdata\whlstfl11.htm -whgdata\whlstfl12.htm -whgdata\whlstfl13.htm -whgdata\whlstfl14.htm -whgdata\whlstfl15.htm -whgdata\whlstfl16.htm -whgdata\whlstfl17.htm -whgdata\whlstfl18.htm -whgdata\whlstfl19.htm -whgdata\whlstfl20.htm -whgdata\whlstfl21.htm -whgdata\whlstfl22.htm -whgdata\whlstfl23.htm -whgdata\whlstfl24.htm -whgdata\whlstfl25.htm -whgdata\whlstf0.htm -whgdata\whlstf1.htm -whgdata\whlstf2.htm -whgdata\whlstf3.htm -whgdata\whlstf4.htm -whgdata\whlstf5.htm -whgdata\whlstf6.htm -whgdata\whlstf7.htm -whgdata\whlstf8.htm -whgdata\whlstf9.htm -whgdata\whlstf10.htm -whgdata\whlstf11.htm -whgdata\whlstf12.htm -whgdata\whlstg0.htm -smesh.htm -smesh_csh.htm -smesh_rhc.htm +|SourceProjectName:SMESH.hpr +|DestinationProjectName:index.htm +whhost.js +whmsg.js +whmozemu.js +whproxy.js +whstub.js +whutils.js +whver.js +whform.js +whphost.js +whstart.js +whtopic.js +whframes.js +whlang.js +whskin_info.htm +whskin_blank.htm +whskin_pickup.htm +whskin_homepage.htm +whskin_tw.htm +whnjs.htm +whthost.js +whtdhtml.htm +whihost.js +whibody.htm +whiform.htm +whfhost.js +whfbody.htm +whfform.htm +whghost.js +whgbody.htm +whgdhtml.htm +whgdef.htm +whproj.js +whproj.xml +whproj.htm +whxdata\whtoc.xml +whxdata\whidx.xml +whxdata\whfts.xml +whxdata\whglo.xml +whdata\whtoc.js +whdata\whtoc.htm +whdata\whtdata.js +whdata\whidx.js +whdata\whidx.htm +whdata\whidata.js +whdata\whfts.js +whdata\whfts.htm +whdata\whglo.js +whdata\whglo.htm +whdata\whgdata.js +whdata\whftdata.js +whdata\whfwdata.js +whres.xml +webhelp.jar +webhelp.cab +whgdata\whnvp30.htm +whgdata\whnvp31.htm +whgdata\whnvp32.htm +whgdata\whnvp33.htm +whgdata\whnvt30.htm +whgdata\whnvt31.htm +whgdata\whnvt32.htm +whgdata\whnvt33.htm +whgdata\whnvf30.htm +whgdata\whnvf31.htm +whgdata\whnvf32.htm +whgdata\whnvf33.htm +whgdata\whnvl31.htm +whgdata\whnvl32.htm +whgdata\whnvl33.htm +whgdata\whexpbar.gif +cshdat_webhelp.htm +whcsh_home.htm +whcshdata.htm +cshdat_robohelp.htm +whd_topic.xml +whd_nvp10.htm +whd_nvp20.htm +whd_tabs.htm +whd_dpns.htm +whd_tab0.gif +whd_tab1.gif +whd_tab2.gif +whd_tab3.gif +whd_tab4.gif +whd_tab5.gif +whd_tab6.gif +whd_tab7.gif +whd_tab8.gif +whd_toc1.gif +whd_toc2.gif +whd_toc3.gif +whd_toc4.gif +whd_show0.gif +whd_show1.gif +whd_show2.gif +whd_hide0.gif +whd_hide1.gif +whd_hide2.gif +whd_sync0.gif +whd_sync1.gif +whd_sync2.gif +whd_prev0.gif +whd_prev1.gif +whd_prev2.gif +whd_next0.gif +whd_next1.gif +whd_next2.gif +whd_wbsh0.gif +whd_wbsh1.gif +whd_wbsh2.gif +whidhtml.htm +whfdhtml.htm +index_hha.hhk +index.hhc +index.hhk +about_viewing_meshes.htm +adding_quadratic_nodes_and_elements.htm +aspect_ratio_3d.htm +borders_at_multi-connection.htm +borders_at_multiconnection_2d.htm +clipping.htm +constructing_meshes.htm +defining_hypotheses_tui.htm +deleting_groups.htm +display_entity.htm +extrusion.htm +extrusion_along_a_path.htm +files\about_hypotheses.htm +files\about_meshes.htm +files\about_meshing_algorithms.htm +files\about_quality_controls.htm +files\adding_nodes_and_elements.htm +files\area_of_elements.htm +files\arithmetic_1d.htm +files\aspect_ratio.htm +files\changing_orientation_of_elements.htm +files\constructing_groups_of_specific_elements.htm +files\constructing_meshes.htm +files\constructing_submeshes.htm +files\creating_groups.htm +files\cutting_quadrangles.htm +files\diagonal_iversion_of_elements.htm +files\displacing_nodes.htm +files\displaying_nodes_numbers.htm +files\editing_groups.htm +files\importing_and_exporting_meshes.htm +files\length_of_edges.htm +files\max._element_area_hypothesis.htm +files\max._element_volume_hypothsis.htm +files\merging_nodes.htm +files\minimum_angle.htm +files\non_conform_mesh_allowed_hypothesis.htm +files\reassigning_hypotheses_and_algorithms.htm +files\removing_nodes_and_elements.htm +files\renumbering_nodes_and_elements.htm +files\rotation.htm +files\running_smesh_module.htm +files\sewing_meshes.htm +files\skew.htm +files\smoothing.htm +files\symmetry.htm +files\taper.htm +files\translation.htm +files\uniting_a_set_of_triangles.htm +files\uniting_two_triangles.htm +files\using_operations_on_groups.htm +files\viewing_mesh_info.htm +files\vtk_3d_viewer.htm +files\warp.htm +free_borders.htm +free_edges.htm +grouping_elements.htm +length.htm +merge_elements.htm +mesh.htm +modifying_meshes.htm +pattern_mapping.htm +presentation.htm +quality_controls.htm +revolution.htm +selection_filter_library.htm +transforming_meshes.htm +transparency.htm +viewing_meshes.htm +volume.htm +ehelp.xml +texture_horiz_ltbluebubbles.jpg +index.glo +default.css +pics\add_node.png +pics\remove_nodes2.png +pics\merging_nodes2.png +pics\moving_nodes2.png +pics\smoothing2.png +pics\b-mberofsegments.png +pics\b-flection1d.png +pics\a-cuttingofquadrangles.png +pics\addquadrangle.png +pics\intersectgroups.png +pics\editgroup.png +image95.jpg +pics\sewing1.png +image92.gif +image51.jpg +image70.gif +pics\image138.gif +pics\create_group.png +pics\edit_mesh_change_value_hyp.png +pics\free_borders1.png +pics\add_triangle.png +pics\b-art_end_length.png +pics\a-creategroup.png +pics\a-clipping2.png +pics\a-transparency.png +pics\diagonalinversion.png +pics\translation1.png +image96.jpg +pics\sewing2.png +image119.gif +image108.gif +image52.jpg +image82.gif +image71.gif +image30.jpg +pics\distributionwithanalyticdensity.png +pics\image139.gif +pics\rotation1.png +pics\a-createpolyhedralvolume.png +pics\a-patterntype.png +pics\orientaation1.png +pics\translation2.png +pics\cutgroups.png +image97.jpg +pics\sewing3.png +image86.jpg +image50.gif +image94.gif +image83.gif +image31.jpg +pics\graduatedaxes1.png +pics\image107.gif +pics\automaticlength.png +pics\image27.gif +pics\add_polyhedron.png +pics\add_edge.png +pics\rotation2.png +pics\b-ithmetic1d.png +image10.jpg +pics\a-maxelarea.png +pics\addhexahedron.png +pics\addtetrahedron.png +image5.jpg +pics\sewing4.png +image95.gif +image76.jpg +image84.gif +image32.jpg +image40.gif +pics\image108.gif +pics\aqt.png +pics\distributionwithtabledensity.png +pics\smoothing.png +image88.jpg +image30.gif +image96.gif +image77.jpg +image74.gif +image63.gif +image22.jpg +image41.gif +pics\image109.gif +pics\meshimportmesh.png +pics\deletegroups.png +pics\editing_groups1.png +pics\uniting_two_triangles1.png +image7.jpg +pics\a-averagelength.png +pics\a-patterntype1.png +pics\extrusionalongaline1.png +pics\movenodes.png +pics\rotation.png +image56.jpg +image53.gif +image20.gif +image97.gif +image78.jpg +image64.gif +image23.jpg +image151.gif +pics\cut_groups1.png +pics\editing_groups2.png +pics\uniting_two_triangles2.png +pics\a-unionoftriangles.png +pics\a-arithmetic1d.png +pics\extrusionalongaline2.png +image79.jpg +image98.gif +image32.gif +pics\image91.gif +image152.gif +pics\cut_groups2.png +image130.gif +pics\max_el_area.png +pics\a-extusionalongapath2.png +pics\a-viewgeneral.png +pics\revolution1.png +pics\addtriangle.png +image99.gif +image55.gif +image88.gif +image36.jpg +image33.gif +image25.jpg +i_blue.jpg +image15.jpg +image142.gif +pics\cut_groups3.png +image131.gif +pics\add_quadrangle.png +pics\uniting_a_set_of_triangles1.png +pics\a-deflection1d.png +pics\revolution2.png +pics\unionoftwotriangles.png +pics\addnode.png +image120.gif +image56.gif +image37.jpg +image67.gif +image34.gif +image143.gif +image132.gif +pics\edit_mesh1.png +pics\remove_elements1.png +pics\uniting_a_set_of_triangles2.png +pics\mergenodes.png +pics\symmetry1.png +image121.gif +image79.gif +image38.jpg +image46.gif +image35.gif +image27.jpg +image24.gif +pics\createmesh-inv2.png +image144.gif +pics\intersect_groups1.png +image133.gif +pics\add_polygone.png +pics\remove_elements2.png +pics\a-maxelvolume.png +pics\symmetry2.png +image122.gif +image58.gif +image36.gif +image25.gif +note1.gif +pics\createmesh-inv3.png +image145.gif +pics\intersect_groups2.png +image134.gif +pics\b-mesh_infos.png +pics\symmetry3.png +pics\addedge.png +image123.gif +image101.gif +image37.gif +pics\image96.gif +image146.gif +pics\intersect_groups3.png +image135.gif +pics\b-erage_length.png +pics\a-standmeshinfo.png +pics\a-nbsegments1.png +pics\patternmapping1.png +image90.jpg +image124.gif +image102.gif +image49.gif +image38.gif +pics\image100.gif +pics\image97.gif +pics\length-crit.png +image147.gif +image136.gif +pics\a-nbsegments2.png +pics\a-startendlength.png +pics\patternmapping2.png +pics\removeelements.png +pics\removenodes.png +pics\uniongroups.png +image125.gif +image103.gif +pics\exemple.gif +image39.gif +image28.gif +pics\advanced_mesh_infos.png +pics\image98.gif +image148.gif +pics\meshexportmesh.png +pics\image21.gif +pics\union_groups1.png +image137.gif +pics\free_edges.png +pics\creategroup.png +image92.jpg +image126.gif +image104.gif +image18.gif +image70.jpg +pics\createmesh-inv.png +pics\image102.gif +pics\image99.gif +pics\image77.gif +pics\meshtrianglemergeelem1.png +pics\mergeelems.png +pics\union_groups2.png +pics\length2d.png +pics\renumbernodes.png +image127.gif +image93.jpg +image105.gif +image19.gif +image71.jpg +pics\image89.gif +pics\image78.gif +pics\image23.gif +pics\selectionfilterlibrary.png +pics\union_groups3.png +pics\edit_mesh_remove_hyp.png +pics\remove_nodes1.png +pics\merging_nodes1.png +pics\moving_nodes1.png +pics\smoothing1.png +pics\a-filteronedges.png +pics\renumberelements.png +pics\addpolygon.png +image94.jpg +image106.gif +image91.gif +image80.gif +index.ppf +ehlpdhtm.js +default_ns.css +whxdata\whtdata0.xml +whxdata\whftdata0.xml +whxdata\whfwdata0.xml +whxdata\whgdata0.xml +whdata\whtdata0.htm +whdata\whftdata0.htm +whdata\whfwdata0.htm +whdata\whgdata0.htm +whgdata\whlstt0.htm +whgdata\whlstt1.htm +whgdata\whlstt2.htm +whgdata\whlstt3.htm +whgdata\whlstt4.htm +whgdata\whlstt5.htm +whgdata\whlstt6.htm +whgdata\whlstt7.htm +whgdata\whlstt8.htm +whgdata\whlstt9.htm +whgdata\whlsti0.htm +whgdata\whlstfl0.htm +whgdata\whlstfl1.htm +whgdata\whlstfl2.htm +whgdata\whlstfl3.htm +whgdata\whlstfl4.htm +whgdata\whlstfl5.htm +whgdata\whlstfl6.htm +whgdata\whlstfl7.htm +whgdata\whlstfl8.htm +whgdata\whlstfl9.htm +whgdata\whlstfl10.htm +whgdata\whlstfl11.htm +whgdata\whlstfl12.htm +whgdata\whlstfl13.htm +whgdata\whlstfl14.htm +whgdata\whlstfl15.htm +whgdata\whlstfl16.htm +whgdata\whlstfl17.htm +whgdata\whlstfl18.htm +whgdata\whlstfl19.htm +whgdata\whlstfl20.htm +whgdata\whlstfl21.htm +whgdata\whlstfl22.htm +whgdata\whlstfl23.htm +whgdata\whlstfl24.htm +whgdata\whlstfl25.htm +whgdata\whlstf0.htm +whgdata\whlstf1.htm +whgdata\whlstf2.htm +whgdata\whlstf3.htm +whgdata\whlstf4.htm +whgdata\whlstf5.htm +whgdata\whlstf6.htm +whgdata\whlstf7.htm +whgdata\whlstf8.htm +whgdata\whlstf9.htm +whgdata\whlstf10.htm +whgdata\whlstf11.htm +whgdata\whlstf12.htm +whgdata\whlstf13.htm +whgdata\whlstg0.htm +index.htm +index_csh.htm +index_rhc.htm diff --git a/doc/salome/gui/SMESH/smesh_csh.htm b/doc/salome/gui/SMESH/smesh_csh.htm deleted file mode 100755 index ebe4e93f8..000000000 --- a/doc/salome/gui/SMESH/smesh_csh.htm +++ /dev/null @@ -1,106 +0,0 @@ - - -SMESH reference manual - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/salome/gui/SMESH/smesh_rhc.htm b/doc/salome/gui/SMESH/smesh_rhc.htm deleted file mode 100755 index 3bb6f9a54..000000000 --- a/doc/salome/gui/SMESH/smesh_rhc.htm +++ /dev/null @@ -1,106 +0,0 @@ - - -SMESH reference manual - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Hexahedron__inherit__graph.jpg b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Hexahedron__inherit__graph.jpg index 4d1e65ac6..08777ef7c 100644 Binary files a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Hexahedron__inherit__graph.jpg and b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Hexahedron__inherit__graph.jpg differ diff --git a/doc/salome/gui/SMESH/smeshpy_doc/namespacesmesh.html b/doc/salome/gui/SMESH/smeshpy_doc/namespacesmesh.html index 130b8881f..5b3964358 100644 --- a/doc/salome/gui/SMESH/smeshpy_doc/namespacesmesh.html +++ b/doc/salome/gui/SMESH/smeshpy_doc/namespacesmesh.html @@ -7,9 +7,6 @@

Package smesh

-Python package smesh defines several classes, destined for easy and clear mesh creation and edition. -

Example.

-

diff --git a/doc/salome/gui/SMESH/transforming_meshes.htm b/doc/salome/gui/SMESH/transforming_meshes.htm index 6d2ada4f1..a03fcf220 100755 --- a/doc/salome/gui/SMESH/transforming_meshes.htm +++ b/doc/salome/gui/SMESH/transforming_meshes.htm @@ -1,664 +1,866 @@ - - - - - -Transforming Meshes - - - - - - - - - - -

Transforming Meshes

- -

Transforming Meshes

- -

 

- -

Translation

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# translate a mesh

- -

anEditor = mesh.GetMeshEditor()

- -

point = SMESH.PointStruct(-150, -150, - 0)

- -

vector = SMESH.DirStruct(point)

- -

anEditor.TranslateObject(mesh, vector, - 1)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Rotation

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

mport math

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# rotate a mesh

- -

anEditor = mesh.GetMeshEditor()

- -

axisXYZ = SMESH.AxisStruct(0, 0, 0, 5, - 5, 20)

- -

angle180 =  1.5*math.pi

- -

anEditor.RotateObject(mesh, axisXYZ, angle180, - 1)

- -

 

- -

salome.sg.updateObjBrowser(1)

- -

 

- -

 

- -

Symmetry

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

import math

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# create a symmetrical - copy of the mesh mirrored through a point

- -

anEditor = mesh.GetMeshEditor()

- -

anEditor.MirrorObject(mesh, SMESH.AxisStruct(0, - 0, 0, 0, 0, 0), SMESH.SMESH_MeshEditor.POINT, 1)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

 

- -

Merging - Nodes

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# merge nodes

- -

aMeshEditor = mesh.GetMeshEditor()

- -

Tolerance = 25.0

- -

 

- -

GroupsOfNodes = aMeshEditor.FindCoincidentNodes(Tolerance)

- -

aMeshEditor.MergeNodes(GroupsOfNodes)

- -

    

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Sewing Meshes

- -

Sew Meshes Border to Border

- -

import salome

- -

import geompy

- -

import smesh

- -

 

- -

# create two faces of a - box

- -

box1 = geompy.MakeBox(0., - 0., -10., 30., 20., 25.)

- -

subShapeList1 = - geompy.SubShapeAll(box1, geompy.ShapeType["FACE"])

- -

 

- -

box2 = geompy.MakeBox(0., - 5., 0., 20., 20., 15.)

- -

subShapeList2 = - geompy.SubShapeAll(box2, geompy.ShapeType["FACE"])

- -

EdgesList = geompy.SubShapeAll(subShapeList2[ - 1 ], geompy.ShapeType["EDGE"])

- -

 

- -

aComp = geompy.MakeCompound( - [subShapeList1[ 2 ], subShapeList2[ 1 ]] )

- -

idComp = geompy.addToStudy( - aComp, "Two faces" )

- -

aCompobj  = - salome.IDToObject( idComp )

- -

 

- -

# create a mesh on two - faces

- -

 

- -

mesh = smesh.Mesh(aCompobj, - "Two faces : quadrangle mesh")

- -

algo = mesh.Segment()

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut an edge in a fixed number of segments

- -

algo.NumberOfSegments(9)

- -

 

- -

# create a quadrangle 2D - algorithm for faces

- -

mesh.Quadrangle()

- -

 

- -

# create a local hypothesis

- -

algo = mesh.Segment(EdgesList[2])

- -

 

- -

# define "Arithmetic1D" - hypothesis to cut an edge in several segments with increasing arithmetic - length

- -

algo.Arithmetic1D(1, - 4)

- -

 

- -

# define "Propagation" - hypothesis that propagates all other hypothesis on all edges on the opposite - side in case of quadrangular faces

- -

algo.Propagation()

- -

mesh.Compute()

- -

 

- -

# sew free borders

- -

anEditor = mesh.GetMesh().GetMeshEditor()

- -

anEditor.SewBorderToSide(5, - 45, 6, 113, 109, 0, 0)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Sew Conform Free Borders

- -

import salome

- -

import geompy

- -

import smesh

- -

 

- -

# create two faces of the - box

- -

box1 = geompy.MakeBox(0., - 0., -10., 20., 20., 15.)

- -

subShapeList1 = - geompy.SubShapeAll(box1, geompy.ShapeType["FACE"])

- -

 

- -

box2 = geompy.MakeBox(0., - 5., 0., 20., 20., 15.)

- -

subShapeList2 = - geompy.SubShapeAll(box2, geompy.ShapeType["FACE"])

- -

EdgesList = geompy.SubShapeAll(subShapeList2[ - 1 ], geompy.ShapeType["EDGE"])

- -

 

- -

aComp = geompy.MakeCompound( - [subShapeList1[ 2 ], subShapeList2[ 1 ]] )

- -

idComp = geompy.addToStudy( - aComp, "Two faces" )

- -

aCompobj  = - salome.IDToObject( idComp )

- -

 

- -

# create a mesh on two - faces

- -

mesh = smesh.Mesh(aCompobj, - "Two faces : quadrangle mesh")

- -

algo = mesh.Segment()

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut an edge in a fixed number of segments

- -

algo.NumberOfSegments(9)

- -

 

- -

# create a quadrangle 2D - algorithm for faces

- -

mesh.Quadrangle()

- -

 

- -

# create a local hypothesis

- -

algo = mesh.Segment(EdgesList[2])

- -

 

- -

# define "Arithmetic1D" - hypothesis to cut an edge in several segments with increasing arithmetic - length

- -

algo.Arithmetic1D(1, - 4)

- -

 

- -

# define "Propagation" - hypothesis that propagate all other hypothesis on all edges on - the opposite side in case of quadrangular faces

- -

algo.Propagation()

- -

mesh.Compute()

- -

 

- -

# sew free borders

- -

anEditor = mesh.GetMesh().GetMeshEditor()

- -

anEditor.SewConformFreeBorders(5, - 45, 6, 3, 24)

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Sew Free Borders

- -

import salome

- -

import geompy

- -

import smesh

- -

 

- -

# create two faces of the - box

- -

box1 = geompy.MakeBox(0., - 0., 0., 20., 20., 15.)

- -

subShapeList1 = - geompy.SubShapeAll(box1, geompy.ShapeType["FACE"])

- -

 

- -

box2 = geompy.MakeBox(0., - 5., 0., 20., 20., 15.)

- -

subShapeList2 = - geompy.SubShapeAll(box2, geompy.ShapeType["FACE"])

- -

EdgesList = geompy.SubShapeAll(subShapeList2[ - 1 ], geompy.ShapeType["EDGE"])

- -

 

- -

aComp = geompy.MakeCompound( - [subShapeList1[ 2 ], subShapeList2[ 1 ]] )

- -

idComp = geompy.addToStudy( - aComp, "Two faces" )

- -

aCompobj  = - salome.IDToObject( idComp )

- -

 

- -

# create a mesh on two - faces

- -

mesh = smesh.Mesh(aCompobj, - "Two faces : quadrangle mesh")

- -

algo = mesh.Segment()

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut an edge in a fixed number of segments

- -

algo.NumberOfSegments(4)

- -

 

- -

# creates a quadrangle - 2D algorithm for faces

- -

mesh.Quadrangle()

- -

 

- -

# create a local hypothesis

- -

algo = mesh.Segment(EdgesList[2])

- -

 

- -

# define "Arithmetic1D" - hypothesis to cut an edge in several segments with  increasing - arithmetic length

- -

algo.Arithmetic1D(1, - 4)

- -

 

- -

# define "Propagation" - hypothesis that propagate all other hypothesis on all edges on - the opposite side in case of quadrangular faces

- -

algo.Propagation()

- -

mesh.Compute()

- -

 

- -

# sew free borders

- -

anEditor = mesh.GetMesh().GetMeshEditor()

- -

anEditor.SewFreeBorders(6, - 21, 5, 1, 12, 3, 0, 0)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Sew Side Elements

- -

import salome

- -

import geompy

- -

import smesh

- -

 

- -

# create two faces of the - box

- -

box1 = geompy.MakeBox(0., -  0., 0., - 10., 10., 10.)

- -

box2 = geompy.MakeBox(0., - 15., 0., 20., 25., 10.)

- -

EdgesList = geompy.SubShapeAll(box2, - geompy.ShapeType["EDGE"])

- -

 

- -

aComp = geompy.MakeCompound( - [box1, box2] )

- -

idComp = geompy.addToStudy( - aComp, "Two faces" )

- -

aCompobj  = - salome.IDToObject( idComp )

- -

 

- -

# create a mesh on two - faces

- -

mesh = smesh.Mesh(aCompobj, - "Two faces : quadrangle mesh")

- -

algo = mesh.Segment()

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut an edge in a fixed number of segments

- -

algo.NumberOfSegments(2)

- -

 

- -

# create a quadrangle 2D - algorithm for faces

- -

mesh.Quadrangle()

- -

 

- -

# create a local hypothesis

- -

algo = mesh.Segment(EdgesList[8])

- -

 

- -

# define "Arithmetic1D" - hypothesis to cut an edge in several segments with increasing arithmetic - length

- -

algo.NumberOfSegments(4)

- -

 

- -

# define "Propagation" - hypothesis that propagates all other hypothesis on all edges on the opposite side in case - of quadrangular faces

- -

algo.Propagation()

- -

mesh.Compute()

- -

 

- -

# sew free borders

- -

anEditor = mesh.GetMesh().GetMeshEditor()

- -

anEditor.SewSideElements([69, - 70, 71, 72], [91, 92, 89, 90], 8, 38, 23, 58)

- -

salome.sg.updateObjBrowser(1) -

- - - - + + + + + +Transforming Meshes + + + + + + + + + + + +

Transforming Meshes

+ +

Transforming Meshes

+ +

 

+ +

Translation

+ +

 

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# translate a mesh

+ +

anEditor = mesh.GetMeshEditor()

+ +

point = SMESH.PointStruct(-150, -150, + 0)

+ +

vector = SMESH.DirStruct(point)

+ +

anEditor.TranslateObject(mesh, vector, + 1)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Rotation

+ +

 

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

import math

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# rotate a mesh

+ +

anEditor = mesh.GetMeshEditor()

+ +

axisXYZ = SMESH.AxisStruct(0, 0, 0, 5, + 5, 20)

+ +

angle180 =  1.5*math.pi

+ +

anEditor.RotateObject(mesh, axisXYZ, angle180, + 1)

+ +

 

+ +

salome.sg.updateObjBrowser(1)

+ +

 

+ +

 

+ +

Symmetry

+ +

 

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

import math

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# create a symmetrical + copy of the mesh mirrored through a point

+ +

anEditor = mesh.GetMeshEditor()

+ +

anEditor.MirrorObject(mesh, SMESH.AxisStruct(0, + 0, 0, 0, 0, 0), SMESH.SMESH_MeshEditor.POINT, 1)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

 

+ +

Merging + Nodes

+ +

 

+ +

import SMESH

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# merge nodes

+ +

aMeshEditor = mesh.GetMeshEditor()

+ +

Tolerance = 25.0

+ +

 

+ +

GroupsOfNodes = aMeshEditor.FindCoincidentNodes(Tolerance)

+ +

aMeshEditor.MergeNodes(GroupsOfNodes)

+ +

    

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Merging Elements

+ +

import geompy

+ +

import smesh

+ +

import salome

+ +

import SMESH

+ +

 

+ +

# create a face to be meshed

+ +

px = geompy.MakeVertex(100., + 0.  , 0. +  )

+ +

py = geompy.MakeVertex(0. +  , 100., + 0.  )

+ +

pz = geompy.MakeVertex(0. +  , 0.  , + 100.)

+ +

 

+ +

vxy = geompy.MakeVector(px, + py)

+ +

arc = geompy.MakeArc(py, + pz, px)

+ +

 

+ +

wire = geompy.MakeWire([vxy, + arc])

+ +

isPlanarFace = 1

+ +

 

+ +

face1 = geompy.MakeFace(wire, + isPlanarFace)

+ +

id_face1 = geompy.addToStudy(face1, + "Face1")

+ +

 

+ +

# create a 2D mesh on the + face

+ +

trias = smesh.Mesh(face1, + "Face : 2D mesh")

+ +

 

+ +

algo = trias.Segment()

+ +

algo.NumberOfSegments(6)

+ +

 

+ +

algo = trias.Triangle()

+ +

algo.LengthFromEdges()

+ +

 

+ +

trias.Compute()

+ +

 

+ +

tri_mesh = trias.GetMesh()

+ +

 

+ +

# create a path mesh

+ +

px1 = geompy.MakeVertex(100., + 100.  , + 0.  )

+ +

py1 = geompy.MakeVertex(-100. +  , -100., + 0.  )

+ +

pz1 = geompy.MakeVertex(0. +  , 0.  , + 50.)

+ +

 

+ +

circle = geompy.MakeCircleThreePnt(py1, + pz1, px1)

+ +

id_circle = geompy.addToStudy(circle, + "Path")

+ +

 

+ +

circlemesh = smesh.Mesh(circle, + "Path mesh")

+ +

 

+ +

algo = circlemesh.Segment()

+ +

algo.NumberOfSegments(10)

+ +

 

+ +

circlemesh.Compute()

+ +

 

+ +

# extrusion of the mesh

+ +

aMeshEditor = tri_mesh.GetMeshEditor()

+ +

aMeshEditor.ExtrusionAlongPathObject(tri_mesh, + circlemesh.GetMesh(), circle, 1, 0, [], 0, SMESH.PointStruct(0, 0, 0))

+ +

 

+ +

# merge nodes

+ +

print "Number + of nodes before MergeNodes:", tri_mesh.NbNodes()

+ +

 

+ +

tolerance = 0.001

+ +

array_of_nodes_groups + = aMeshEditor.FindCoincidentNodes(tolerance)

+ +

aMeshEditor.MergeNodes(array_of_nodes_groups)

+ +

 

+ +

print "Number + of nodes after MergeNodes:", tri_mesh.NbNodes()

+ +

print ""

+ +

print "Number + of elements before MergeEqualElements:"

+ +

print "Edges +      : + ", tri_mesh.NbEdges()

+ +

print "Triangles +  : ", + tri_mesh.NbTriangles()

+ +

print "Quadrangles: + ", tri_mesh.NbQuadrangles()

+ +

print "Volumes +    : + ", tri_mesh.NbVolumes()

+ +

 

+ +

# merge elements

+ +

aMeshEditor.MergeEqualElements()

+ +

 

+ +

print "Number + of elements after MergeEqualElements:"

+ +

print "Edges +      : + ", tri_mesh.NbEdges()

+ +

print "Triangles +  : ", + tri_mesh.NbTriangles()

+ +

print "Quadrangles: + ", tri_mesh.NbQuadrangles()

+ +

print "Volumes +    : + ", tri_mesh.NbVolumes()

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

Sewing Meshes

+ +

Sew Meshes Border to Border

+ +

import salome

+ +

import geompy

+ +

import smesh

+ +

 

+ +

# create two faces of a + box

+ +

box1 = geompy.MakeBox(0., + 0., -10., 30., 20., 25.)

+ +

subShapeList1 = + geompy.SubShapeAll(box1, geompy.ShapeType["FACE"])

+ +

 

+ +

box2 = geompy.MakeBox(0., + 5., 0., 20., 20., 15.)

+ +

subShapeList2 = + geompy.SubShapeAll(box2, geompy.ShapeType["FACE"])

+ +

EdgesList = geompy.SubShapeAll(subShapeList2[ + 1 ], geompy.ShapeType["EDGE"])

+ +

 

+ +

aComp = geompy.MakeCompound( + [subShapeList1[ 2 ], subShapeList2[ 1 ]] )

+ +

idComp = geompy.addToStudy( + aComp, "Two faces" )

+ +

aCompobj  = + salome.IDToObject( idComp )

+ +

 

+ +

# create a mesh on two + faces

+ +

 

+ +

mesh = smesh.Mesh(aCompobj, + "Two faces : quadrangle mesh")

+ +

algo = mesh.Segment()

+ +

 

+ +

# define "NumberOfSegments" + hypothesis to cut an edge in a fixed number of segments

+ +

algo.NumberOfSegments(9)

+ +

 

+ +

# create a quadrangle 2D + algorithm for faces

+ +

mesh.Quadrangle()

+ +

 

+ +

# create a local hypothesis

+ +

algo = mesh.Segment(EdgesList[2])

+ +

 

+ +

# define "Arithmetic1D" + hypothesis to cut an edge in several segments with increasing arithmetic + length

+ +

algo.Arithmetic1D(1, + 4)

+ +

 

+ +

# define "Propagation" + hypothesis that propagates all other hypothesis on all edges on the opposite + side in case of quadrangular faces

+ +

algo.Propagation()

+ +

mesh.Compute()

+ +

 

+ +

# sew free borders

+ +

anEditor = mesh.GetMesh().GetMeshEditor()

+ +

anEditor.SewBorderToSide(5, + 45, 6, 113, 109, 0, 0)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Sew Conform Free Borders

+ +

import salome

+ +

import geompy

+ +

import smesh

+ +

 

+ +

# create two faces of the + box

+ +

box1 = geompy.MakeBox(0., + 0., -10., 20., 20., 15.)

+ +

subShapeList1 = + geompy.SubShapeAll(box1, geompy.ShapeType["FACE"])

+ +

 

+ +

box2 = geompy.MakeBox(0., + 5., 0., 20., 20., 15.)

+ +

subShapeList2 = + geompy.SubShapeAll(box2, geompy.ShapeType["FACE"])

+ +

EdgesList = geompy.SubShapeAll(subShapeList2[ + 1 ], geompy.ShapeType["EDGE"])

+ +

 

+ +

aComp = geompy.MakeCompound( + [subShapeList1[ 2 ], subShapeList2[ 1 ]] )

+ +

idComp = geompy.addToStudy( + aComp, "Two faces" )

+ +

aCompobj  = + salome.IDToObject( idComp )

+ +

 

+ +

# create a mesh on two + faces

+ +

mesh = smesh.Mesh(aCompobj, + "Two faces : quadrangle mesh")

+ +

algo = mesh.Segment()

+ +

 

+ +

# define "NumberOfSegments" + hypothesis to cut an edge in a fixed number of segments

+ +

algo.NumberOfSegments(9)

+ +

 

+ +

# create a quadrangle 2D + algorithm for faces

+ +

mesh.Quadrangle()

+ +

 

+ +

# create a local hypothesis

+ +

algo = mesh.Segment(EdgesList[2])

+ +

 

+ +

# define "Arithmetic1D" + hypothesis to cut an edge in several segments with increasing arithmetic + length

+ +

algo.Arithmetic1D(1, + 4)

+ +

 

+ +

# define "Propagation" + hypothesis that propagate all other hypothesis on all edges on + the opposite side in case of quadrangular faces

+ +

algo.Propagation()

+ +

mesh.Compute()

+ +

 

+ +

# sew free borders

+ +

anEditor = mesh.GetMesh().GetMeshEditor()

+ +

anEditor.SewConformFreeBorders(5, + 45, 6, 3, 24)

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Sew Free Borders

+ +

import salome

+ +

import geompy

+ +

import smesh

+ +

 

+ +

# create two faces of the + box

+ +

box1 = geompy.MakeBox(0., + 0., 0., 20., 20., 15.)

+ +

subShapeList1 = + geompy.SubShapeAll(box1, geompy.ShapeType["FACE"])

+ +

 

+ +

box2 = geompy.MakeBox(0., + 5., 0., 20., 20., 15.)

+ +

subShapeList2 = + geompy.SubShapeAll(box2, geompy.ShapeType["FACE"])

+ +

EdgesList = geompy.SubShapeAll(subShapeList2[ + 1 ], geompy.ShapeType["EDGE"])

+ +

 

+ +

aComp = geompy.MakeCompound( + [subShapeList1[ 2 ], subShapeList2[ 1 ]] )

+ +

idComp = geompy.addToStudy( + aComp, "Two faces" )

+ +

aCompobj  = + salome.IDToObject( idComp )

+ +

 

+ +

# create a mesh on two + faces

+ +

mesh = smesh.Mesh(aCompobj, + "Two faces : quadrangle mesh")

+ +

algo = mesh.Segment()

+ +

 

+ +

# define "NumberOfSegments" + hypothesis to cut an edge in a fixed number of segments

+ +

algo.NumberOfSegments(4)

+ +

 

+ +

# creates a quadrangle + 2D algorithm for faces

+ +

mesh.Quadrangle()

+ +

 

+ +

# create a local hypothesis

+ +

algo = mesh.Segment(EdgesList[2])

+ +

 

+ +

# define "Arithmetic1D" + hypothesis to cut an edge in several segments with  increasing + arithmetic length

+ +

algo.Arithmetic1D(1, + 4)

+ +

 

+ +

# define "Propagation" + hypothesis that propagate all other hypothesis on all edges on + the opposite side in case of quadrangular faces

+ +

algo.Propagation()

+ +

mesh.Compute()

+ +

 

+ +

# sew free borders

+ +

anEditor = mesh.GetMesh().GetMeshEditor()

+ +

anEditor.SewFreeBorders(6, + 21, 5, 1, 12, 3, 0, 0)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Sew Side Elements

+ +

import salome

+ +

import geompy

+ +

import smesh

+ +

 

+ +

# create two faces of the + box

+ +

box1 = geompy.MakeBox(0., +  0., 0., + 10., 10., 10.)

+ +

box2 = geompy.MakeBox(0., + 15., 0., 20., 25., 10.)

+ +

EdgesList = geompy.SubShapeAll(box2, + geompy.ShapeType["EDGE"])

+ +

 

+ +

aComp = geompy.MakeCompound( + [box1, box2] )

+ +

idComp = geompy.addToStudy( + aComp, "Two faces" )

+ +

aCompobj  = + salome.IDToObject( idComp )

+ +

 

+ +

# create a mesh on two + faces

+ +

mesh = smesh.Mesh(aCompobj, + "Two faces : quadrangle mesh")

+ +

algo = mesh.Segment()

+ +

 

+ +

# define "NumberOfSegments" + hypothesis to cut an edge in a fixed number of segments

+ +

algo.NumberOfSegments(2)

+ +

 

+ +

# create a quadrangle 2D + algorithm for faces

+ +

mesh.Quadrangle()

+ +

 

+ +

# create a local hypothesis

+ +

algo = mesh.Segment(EdgesList[8])

+ +

 

+ +

# define "Arithmetic1D" + hypothesis to cut an edge in several segments with increasing arithmetic + length

+ +

algo.NumberOfSegments(4)

+ +

 

+ +

# define "Propagation" + hypothesis that propagates all other hypothesis on all edges on the opposite side in case + of quadrangular faces

+ +

algo.Propagation()

+ +

mesh.Compute()

+ +

 

+ +

# sew free borders

+ +

anEditor = mesh.GetMesh().GetMeshEditor()

+ +

anEditor.SewSideElements([69, + 70, 71, 72], [91, 92, 89, 90], 8, 38, 23, 58)

+ +

salome.sg.updateObjBrowser(1) +

+ + + + diff --git a/doc/salome/gui/SMESH/transparency.htm b/doc/salome/gui/SMESH/transparency.htm index 701b47a01..ab7df8c56 100755 --- a/doc/salome/gui/SMESH/transparency.htm +++ b/doc/salome/gui/SMESH/transparency.htm @@ -1,92 +1,98 @@ - - - - - -Transparency - - - - - - - - - - - -

Transparency

- -

- -

 

- -

Using this slider you can set the transparency of shading. Absolutely - transparent shading will be invisible. By default it is absolutely opaque. -  

- -

 

- - - - + + + + + +Transparency + + + + + + + + + + + + +

Transparency

+ +

+ +

 

+ +

Using this slider you can set the transparency of shading. Absolutely + transparent shading will be invisible. By default it is absolutely opaque. +  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/viewing_meshes.htm b/doc/salome/gui/SMESH/viewing_meshes.htm index d6a576e1a..37580f7ac 100755 --- a/doc/salome/gui/SMESH/viewing_meshes.htm +++ b/doc/salome/gui/SMESH/viewing_meshes.htm @@ -1,248 +1,253 @@ - - - - - -Viewing Meshes - - - - - - - - - - -

Viewing Meshes

- -

Viewing Mesh Infos

- -

import salome

- -

import geompy

- -

import SMESH

- -

import StdMeshers

- -

 

- -

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", - "SMESH")

- -

smesh.SetCurrentStudy(salome.myStudy)

- -

 

- -

box   = - geompy.MakeBox(0., 0., 0., 20., 20., 20.)

- -

idbox = geompy.addToStudy(box, "box")

- -

 

- -

subShapeList = geompy.SubShapeAll(box, - geompy.ShapeType["EDGE"])

- -

edge   = - subShapeList[0]

- -

name   = - geompy.SubShapeName(edge, box)

- -

idedge = geompy.addToStudyInFather(box, - edge, name)

- -

 

- -

box  = - salome.IDToObject(idbox)

- -

edge = salome.IDToObject(idedge)

- -

 

- -

hyp1 = smesh.CreateHypothesis("NumberOfSegments", - "libStdMeshersEngine.so")

- -

hyp1.SetNumberOfSegments(3)

- -

hyp2 = smesh.CreateHypothesis("MaxElementArea", - "libStdMeshersEngine.so")

- -

hyp2.SetMaxElementArea(10)

- -

hyp3 = smesh.CreateHypothesis("Arithmetic1D", - "libStdMeshersEngine.so")

- -

hyp3.SetLength(1,1)

- -

hyp3.SetLength(6,0)

- -

hyp4 = smesh.CreateHypothesis("Propagation", - "libStdMeshersEngine.so")

- -

 

- -

algo1 = smesh.CreateHypothesis("Regular_1D", - "libStdMeshersEngine.so")

- -

algo2 = smesh.CreateHypothesis("MEFISTO_2D", - "libStdMeshersEngine.so")

- -

mesh = smesh.CreateMesh(box)

- -

 

- -

mesh.AddHypothesis(box,hyp1)

- -

mesh.AddHypothesis(box,hyp2)

- -

mesh.AddHypothesis(box,algo1)

- -

mesh.AddHypothesis(box,algo2)

- -

mesh.AddHypothesis(edge,hyp3)

- -

mesh.AddHypothesis(edge,hyp4)

- -

mesh.AddHypothesis(edge,algo1)

- -

smesh.Compute(mesh,box)

- -

salome.sg.updateObjBrowser(1)

- -

 

- -

# remove one hypothesis

- -

mesh.RemoveHypothesis(edge,hyp4)

- -

smesh.Compute(mesh,box)

- -

salome.sg.updateObjBrowser(1)

- -

 

- -

# change the value - of the hypothesis

- -

hyp2.SetMaxElementArea(2)

- -

mesh.AddHypothesis(box,hyp2)

- -

smesh.Compute(mesh,box)

- -

print "Information about mesh:"

- -

print "Number of nodes       : - ", mesh.NbNodes()

- -

print "Number of edges       : - ", mesh.NbEdges()

- -

print "Number of faces       : - ", mesh.NbFaces()

- -

print "Number of triangles   : - ", mesh.NbTriangles()

- -

print "Number of quadrangles : ", - mesh.NbQuadrangles()

- -

print "Number of polygons    : - ", mesh.NbPolygons()

- -

print "Number of volumes     : - ", mesh.NbVolumes()

- -

print "Number of tetrahedrons: ", - mesh.NbTetras()

- -

print "Number of hexahedrons : ", - mesh.NbHexas()

- -

print "Number of prisms      : - ", mesh.NbPrisms()

- -

print "Number of pyramids    : - ", mesh.NbPyramids()

- -

print "Number of polyhedrons : ", - mesh.NbPolyhedrons()

- -

salome.sg.updateObjBrowser(1)

- -

 

- - - - + + + + + +Viewing Meshes + + + + + + + + + + + +

Viewing Meshes

+ +

Viewing Mesh Infos

+ +

import salome

+ +

import geompy

+ +

import SMESH

+ +

import StdMeshers

+ +

 

+ +

smesh = salome.lcc.FindOrLoadComponent("FactoryServer", + "SMESH")

+ +

smesh.SetCurrentStudy(salome.myStudy)

+ +

 

+ +

box   = + geompy.MakeBox(0., 0., 0., 20., 20., 20.)

+ +

idbox = geompy.addToStudy(box, "box")

+ +

 

+ +

subShapeList = geompy.SubShapeAll(box, + geompy.ShapeType["EDGE"])

+ +

edge   = + subShapeList[0]

+ +

name   = + geompy.SubShapeName(edge, box)

+ +

idedge = geompy.addToStudyInFather(box, + edge, name)

+ +

 

+ +

box  = + salome.IDToObject(idbox)

+ +

edge = salome.IDToObject(idedge)

+ +

 

+ +

hyp1 = smesh.CreateHypothesis("NumberOfSegments", + "libStdMeshersEngine.so")

+ +

hyp1.SetNumberOfSegments(3)

+ +

hyp2 = smesh.CreateHypothesis("MaxElementArea", + "libStdMeshersEngine.so")

+ +

hyp2.SetMaxElementArea(10)

+ +

hyp3 = smesh.CreateHypothesis("Arithmetic1D", + "libStdMeshersEngine.so")

+ +

hyp3.SetLength(1,1)

+ +

hyp3.SetLength(6,0)

+ +

hyp4 = smesh.CreateHypothesis("Propagation", + "libStdMeshersEngine.so")

+ +

 

+ +

algo1 = smesh.CreateHypothesis("Regular_1D", + "libStdMeshersEngine.so")

+ +

algo2 = smesh.CreateHypothesis("MEFISTO_2D", + "libStdMeshersEngine.so")

+ +

mesh = smesh.CreateMesh(box)

+ +

 

+ +

mesh.AddHypothesis(box,hyp1)

+ +

mesh.AddHypothesis(box,hyp2)

+ +

mesh.AddHypothesis(box,algo1)

+ +

mesh.AddHypothesis(box,algo2)

+ +

mesh.AddHypothesis(edge,hyp3)

+ +

mesh.AddHypothesis(edge,hyp4)

+ +

mesh.AddHypothesis(edge,algo1)

+ +

smesh.Compute(mesh,box)

+ +

salome.sg.updateObjBrowser(1)

+ +

 

+ +

# remove one hypothesis

+ +

mesh.RemoveHypothesis(edge,hyp4)

+ +

smesh.Compute(mesh,box)

+ +

salome.sg.updateObjBrowser(1)

+ +

 

+ +

# change the value + of the hypothesis

+ +

hyp2.SetMaxElementArea(2)

+ +

mesh.AddHypothesis(box,hyp2)

+ +

smesh.Compute(mesh,box)

+ +

print "Information about mesh:"

+ +

print "Number of nodes       : + ", mesh.NbNodes()

+ +

print "Number of edges       : + ", mesh.NbEdges()

+ +

print "Number of faces       : + ", mesh.NbFaces()

+ +

print "Number of triangles   : + ", mesh.NbTriangles()

+ +

print "Number of quadrangles : ", + mesh.NbQuadrangles()

+ +

print "Number of polygons    : + ", mesh.NbPolygons()

+ +

print "Number of volumes     : + ", mesh.NbVolumes()

+ +

print "Number of tetrahedrons: ", + mesh.NbTetras()

+ +

print "Number of hexahedrons : ", + mesh.NbHexas()

+ +

print "Number of prisms      : + ", mesh.NbPrisms()

+ +

print "Number of pyramids    : + ", mesh.NbPyramids()

+ +

print "Number of polyhedrons : ", + mesh.NbPolyhedrons()

+ +

salome.sg.updateObjBrowser(1)

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/volume.htm b/doc/salome/gui/SMESH/volume.htm index f55993eaf..bb675f1e0 100755 --- a/doc/salome/gui/SMESH/volume.htm +++ b/doc/salome/gui/SMESH/volume.htm @@ -1,123 +1,123 @@ - - - - - -Volume - - - - - - - - - - - -

Volume

- -

Volume mesh quality - criterion reflects the volume of meshes of a 3D object.

- -

- -

To - apply the Volume quality criterion to your mesh:

- -

1. Display your mesh in the viewer.

- -

2. Choose Controls - > Volume or click button in the toolbar. Your - mesh will be displayed in the viewer with its elements colored according - to the applied mesh quality control criterion:

- -

See Also - a sample TUI Script of a Volume quality control operation. -  

- -

 

- -

 

- -

 

- - - - + + + + + +Volume + + + + + + + + + + + +

Volume

+ +

Volume mesh quality + criterion reflects the volume of meshes of a 3D object.

+ +

+ +

To + apply the Volume quality criterion to your mesh:

+ +

1. Display your mesh in the viewer.

+ +

2. Choose Controls + > Volume or click button in the toolbar. Your + mesh will be displayed in the viewer with its elements colored according + to the applied mesh quality control criterion:

+ +

See Also + a sample TUI Script of a Volume quality control operation. +  

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/webhelp.jar b/doc/salome/gui/SMESH/webhelp.jar index 53b266636..1d1697e76 100755 Binary files a/doc/salome/gui/SMESH/webhelp.jar and b/doc/salome/gui/SMESH/webhelp.jar differ diff --git a/doc/salome/gui/SMESH/whcsh_home.htm b/doc/salome/gui/SMESH/whcsh_home.htm index 38f71d169..ad8f8d4c0 100755 --- a/doc/salome/gui/SMESH/whcsh_home.htm +++ b/doc/salome/gui/SMESH/whcsh_home.htm @@ -1,600 +1,600 @@ - - - - - + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whcshdata.htm b/doc/salome/gui/SMESH/whcshdata.htm index 2964043b7..a21983910 100755 --- a/doc/salome/gui/SMESH/whcshdata.htm +++ b/doc/salome/gui/SMESH/whcshdata.htm @@ -1,87 +1,87 @@ - - -SMESH reference manual - - - - - - - - - - + + +Mesh Module Reference Manual + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whd_dpns.htm b/doc/salome/gui/SMESH/whd_dpns.htm index 1bca23603..3983ccbdd 100755 --- a/doc/salome/gui/SMESH/whd_dpns.htm +++ b/doc/salome/gui/SMESH/whd_dpns.htm @@ -1,43 +1,43 @@ - - -Navigator Pane - - - - - - - - - - - - - + + +Navigator Pane + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whd_nvp10.htm b/doc/salome/gui/SMESH/whd_nvp10.htm index a57fe1e49..05b5f908c 100755 --- a/doc/salome/gui/SMESH/whd_nvp10.htm +++ b/doc/salome/gui/SMESH/whd_nvp10.htm @@ -1,15 +1,15 @@ - - -Navigation Pane - - - - - - - - - - - - + + +Navigation Pane + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whd_nvp20.htm b/doc/salome/gui/SMESH/whd_nvp20.htm index c5754bc41..23c23dc4f 100755 --- a/doc/salome/gui/SMESH/whd_nvp20.htm +++ b/doc/salome/gui/SMESH/whd_nvp20.htm @@ -1,334 +1,334 @@ - - -navigation pane - - - - - - - - - - - - - - - - - + + +navigation pane + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whd_tabs.htm b/doc/salome/gui/SMESH/whd_tabs.htm index 1568f573d..e8c498c88 100755 --- a/doc/salome/gui/SMESH/whd_tabs.htm +++ b/doc/salome/gui/SMESH/whd_tabs.htm @@ -1,533 +1,533 @@ - - -WebHelp Tabs Frame in Navigation Pane - - - - - - - - - - + + +WebHelp Tabs Frame in Navigation Pane + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whd_toc4.gif b/doc/salome/gui/SMESH/whd_toc4.gif index 3f9a03686..354aa6ece 100755 Binary files a/doc/salome/gui/SMESH/whd_toc4.gif and b/doc/salome/gui/SMESH/whd_toc4.gif differ diff --git a/doc/salome/gui/SMESH/whd_topic.xml b/doc/salome/gui/SMESH/whd_topic.xml index a1b0320fb..b1946d757 100755 --- a/doc/salome/gui/SMESH/whd_topic.xml +++ b/doc/salome/gui/SMESH/whd_topic.xml @@ -1,85 +1,85 @@ - - - - - - - - - - -"]]> - - - - -"]]> - - - - -"; -OutputInTopicNavBarDataWebSearch.form();]]> - - - - - - - - - - -"]]> - - - + + + + + + + + + + +"]]> + + + + +"]]> + + + + +"; +OutputInTopicNavBarDataWebSearch.form();]]> + + + + + + + + + + +"]]> + + + diff --git a/doc/salome/gui/SMESH/whdata/whftdata.js b/doc/salome/gui/SMESH/whdata/whftdata.js index 071ae6fc7..addf26223 100755 --- a/doc/salome/gui/SMESH/whdata/whftdata.js +++ b/doc/salome/gui/SMESH/whdata/whftdata.js @@ -1,25 +1,25 @@ -// WebHelp 5.10.001 -var gTEA = new Array(); -function aTE(sTopicTitle, sTopicURL) -{ - var len = gTEA.length; - gTEA[len] = new topicEntry(sTopicTitle, sTopicURL); -} - -function topicEntry(sTopicTitle, sTopicURL) -{ - this.sTopicTitle = sTopicTitle; - this.sTopicURL = sTopicURL; -} - -function window_OnLoad() -{ - if (parent && parent != this) { - if (parent.putFtsTData) - { - parent.putFtsTData(gTEA); - } - } -} - +// WebHelp 5.10.001 +var gTEA = new Array(); +function aTE(sTopicTitle, sTopicURL) +{ + var len = gTEA.length; + gTEA[len] = new topicEntry(sTopicTitle, sTopicURL); +} + +function topicEntry(sTopicTitle, sTopicURL) +{ + this.sTopicTitle = sTopicTitle; + this.sTopicURL = sTopicURL; +} + +function window_OnLoad() +{ + if (parent && parent != this) { + if (parent.putFtsTData) + { + parent.putFtsTData(gTEA); + } + } +} + window.onload = window_OnLoad; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whftdata0.htm b/doc/salome/gui/SMESH/whdata/whftdata0.htm index 3ecd68c6c..9e96f979d 100755 --- a/doc/salome/gui/SMESH/whdata/whftdata0.htm +++ b/doc/salome/gui/SMESH/whdata/whftdata0.htm @@ -1,84 +1,88 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whdata/whfts.htm b/doc/salome/gui/SMESH/whdata/whfts.htm index 1b6176ed0..d243be45f 100755 --- a/doc/salome/gui/SMESH/whdata/whfts.htm +++ b/doc/salome/gui/SMESH/whdata/whfts.htm @@ -1,18 +1,18 @@ - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whfts.js b/doc/salome/gui/SMESH/whdata/whfts.js index 2b6678690..54246f693 100755 --- a/doc/salome/gui/SMESH/whdata/whfts.js +++ b/doc/salome/gui/SMESH/whdata/whfts.js @@ -1,40 +1,40 @@ -// WebHelp 5.10.001 -var gaFileMapping = new Array(); -var gaFileTopicMapping = new Array(); - -function fileMapping(sStartKey, sEndKey, sFileName) -{ - this.sStartKey = sStartKey; - this.sEndKey = sEndKey; - this.sFileName = sFileName; - this.aFtsKeys = null; -} - -function fileTopicMapping(nIdBegin, nIdEnd, sFileName) -{ - this.nBegin = nIdBegin; - this.nEnd = nIdEnd; - this.sFileName = sFileName; - this.aTopics = null; -} - - -function iWM(sStartKey, sEndKey, sFileName) -{ - gaFileMapping[gaFileMapping.length] = new fileMapping(sStartKey, sEndKey, sFileName); -} - -function window_OnLoad() -{ - if (parent && parent != this && parent.ftsReady) - { - parent.ftsReady(gaFileMapping, gaFileTopicMapping); - } -} - -function iTM(nIdBegin, nIdEnd, sFileName) -{ - gaFileTopicMapping[gaFileTopicMapping.length] = new fileTopicMapping(nIdBegin, nIdEnd, sFileName); -} - -window.onload = window_OnLoad; +// WebHelp 5.10.001 +var gaFileMapping = new Array(); +var gaFileTopicMapping = new Array(); + +function fileMapping(sStartKey, sEndKey, sFileName) +{ + this.sStartKey = sStartKey; + this.sEndKey = sEndKey; + this.sFileName = sFileName; + this.aFtsKeys = null; +} + +function fileTopicMapping(nIdBegin, nIdEnd, sFileName) +{ + this.nBegin = nIdBegin; + this.nEnd = nIdEnd; + this.sFileName = sFileName; + this.aTopics = null; +} + + +function iWM(sStartKey, sEndKey, sFileName) +{ + gaFileMapping[gaFileMapping.length] = new fileMapping(sStartKey, sEndKey, sFileName); +} + +function window_OnLoad() +{ + if (parent && parent != this && parent.ftsReady) + { + parent.ftsReady(gaFileMapping, gaFileTopicMapping); + } +} + +function iTM(nIdBegin, nIdEnd, sFileName) +{ + gaFileTopicMapping[gaFileTopicMapping.length] = new fileTopicMapping(nIdBegin, nIdEnd, sFileName); +} + +window.onload = window_OnLoad; diff --git a/doc/salome/gui/SMESH/whdata/whfwdata.js b/doc/salome/gui/SMESH/whdata/whfwdata.js index e9e8bc6c1..8340b59d5 100755 --- a/doc/salome/gui/SMESH/whdata/whfwdata.js +++ b/doc/salome/gui/SMESH/whdata/whfwdata.js @@ -1,37 +1,37 @@ -// WebHelp 5.10.001 -var gWEA = new Array(); -function aWE() -{ - var len = gWEA.length; - gWEA[len] = new ftsEntry(aWE.arguments); -} - -function ftsEntry(fn_arguments) -{ - if (fn_arguments.length && fn_arguments.length >= 1) - { - this.sItemName = fn_arguments[0]; - this.aTopics = null; - var nLen = fn_arguments.length; - if (nLen > 1) - { - this.aTopics = new Array(); - for (var i = 0; i < nLen - 1; i ++ ) - { - this.aTopics[i] = fn_arguments[i + 1]; - } - } - } -} - -function window_OnLoad() -{ - if (parent && parent != this) { - if (parent.putFtsWData) - { - parent.putFtsWData(gWEA); - } - } -} - +// WebHelp 5.10.001 +var gWEA = new Array(); +function aWE() +{ + var len = gWEA.length; + gWEA[len] = new ftsEntry(aWE.arguments); +} + +function ftsEntry(fn_arguments) +{ + if (fn_arguments.length && fn_arguments.length >= 1) + { + this.sItemName = fn_arguments[0]; + this.aTopics = null; + var nLen = fn_arguments.length; + if (nLen > 1) + { + this.aTopics = new Array(); + for (var i = 0; i < nLen - 1; i ++ ) + { + this.aTopics[i] = fn_arguments[i + 1]; + } + } + } +} + +function window_OnLoad() +{ + if (parent && parent != this) { + if (parent.putFtsWData) + { + parent.putFtsWData(gWEA); + } + } +} + window.onload = window_OnLoad; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whfwdata0.htm b/doc/salome/gui/SMESH/whdata/whfwdata0.htm index dfe30b817..edb094244 100755 --- a/doc/salome/gui/SMESH/whdata/whfwdata0.htm +++ b/doc/salome/gui/SMESH/whdata/whfwdata0.htm @@ -1,1148 +1,1317 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whdata/whgdata.js b/doc/salome/gui/SMESH/whdata/whgdata.js index 77e0107f3..e38a107b5 100755 --- a/doc/salome/gui/SMESH/whdata/whgdata.js +++ b/doc/salome/gui/SMESH/whdata/whgdata.js @@ -1,26 +1,26 @@ -// WebHelp 5.10.001 -var gIEA = new Array(); -function aGE(sName, sDef) -{ - var len = gIEA.length; - gIEA[len] = new gloEntry(sName, sDef); -} - -function gloEntry(sName, sDef) -{ - this.sName = sName; - this.sDef = sDef; - this.nNKOff = 0; -} - -function window_OnLoad() -{ - if (parent && parent != this) { - if (parent.putData) - { - parent.putData(gIEA); - } - } -} - +// WebHelp 5.10.001 +var gIEA = new Array(); +function aGE(sName, sDef) +{ + var len = gIEA.length; + gIEA[len] = new gloEntry(sName, sDef); +} + +function gloEntry(sName, sDef) +{ + this.sName = sName; + this.sDef = sDef; + this.nNKOff = 0; +} + +function window_OnLoad() +{ + if (parent && parent != this) { + if (parent.putData) + { + parent.putData(gIEA); + } + } +} + window.onload = window_OnLoad; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whgdata0.htm b/doc/salome/gui/SMESH/whdata/whgdata0.htm index 9d256b1a8..3865725f4 100755 --- a/doc/salome/gui/SMESH/whdata/whgdata0.htm +++ b/doc/salome/gui/SMESH/whdata/whgdata0.htm @@ -1,33 +1,33 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whdata/whglo.htm b/doc/salome/gui/SMESH/whdata/whglo.htm index dc5a67786..9d7ac79f1 100755 --- a/doc/salome/gui/SMESH/whdata/whglo.htm +++ b/doc/salome/gui/SMESH/whdata/whglo.htm @@ -1,16 +1,16 @@ - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whglo.js b/doc/salome/gui/SMESH/whdata/whglo.js index e0519afcb..c34fb24b2 100755 --- a/doc/salome/gui/SMESH/whdata/whglo.js +++ b/doc/salome/gui/SMESH/whdata/whglo.js @@ -1,34 +1,34 @@ -// WebHelp 5.10.001 -var gaFileMapping = new Array(); -function fileMapping(sBK, sEK, sFileName, nNum) -{ - this.sBK = sBK; - this.sEK = sEK; - this.sFileName = sFileName; - this.aKs = null; - this.nNum = nNum; - this.oUsedItems = null; -} - - -function iFM(sBK, sEK, sFileName, nNum) -{ - var i = gaFileMapping.length; - gaFileMapping[i] = new fileMapping(sBK, sEK, sFileName, nNum); - if (i == 0) { - gaFileMapping[i].nTotal = nNum; - } - else { - gaFileMapping[i].nTotal = nNum + gaFileMapping[i - 1].nTotal; - } -} - -function window_OnLoad() -{ - if (parent && parent != this && parent.projReady) - { - parent.projReady(gaFileMapping); - } -} - -window.onload = window_OnLoad; +// WebHelp 5.10.001 +var gaFileMapping = new Array(); +function fileMapping(sBK, sEK, sFileName, nNum) +{ + this.sBK = sBK; + this.sEK = sEK; + this.sFileName = sFileName; + this.aKs = null; + this.nNum = nNum; + this.oUsedItems = null; +} + + +function iFM(sBK, sEK, sFileName, nNum) +{ + var i = gaFileMapping.length; + gaFileMapping[i] = new fileMapping(sBK, sEK, sFileName, nNum); + if (i == 0) { + gaFileMapping[i].nTotal = nNum; + } + else { + gaFileMapping[i].nTotal = nNum + gaFileMapping[i - 1].nTotal; + } +} + +function window_OnLoad() +{ + if (parent && parent != this && parent.projReady) + { + parent.projReady(gaFileMapping); + } +} + +window.onload = window_OnLoad; diff --git a/doc/salome/gui/SMESH/whdata/whidata.js b/doc/salome/gui/SMESH/whdata/whidata.js index 9f0eb15ed..a92184730 100755 --- a/doc/salome/gui/SMESH/whdata/whidata.js +++ b/doc/salome/gui/SMESH/whdata/whidata.js @@ -1,89 +1,89 @@ -// WebHelp 5.10.001 -// const strings -var gIEA = new Array(); -function aIE() -{ - var len = gIEA.length; - gIEA[len] = new indexEntry(aIE.arguments); -} - -function topic(sName, sURL) -{ - this.sName = sName; - this.sURL = sURL; -} - -function indexEntry(fn_arguments) -{ - if (fn_arguments.length && fn_arguments.length >= 3) - { - this.nType = fn_arguments[0]; - this.nPKOff = 0; - this.nNKOff = fn_arguments[1]; - this.sName = fn_arguments[2]; - this.aTopics = null; - var nLen = fn_arguments.length; - if (Math.floor(nLen / 2) * 2 == nLen) - { - this.sTarget = fn_arguments[3]; - if (nLen > 5) - { - this.aTopics = new Array(); - for (var i = 0; i < (nLen - 5)/2; i++) - { - this.aTopics[i] = new topic(fn_arguments[i * 2 + 4], fn_arguments[i * 2 + 5]); - } - } - - } - else - { - if (nLen > 4) - { - this.aTopics = new Array(); - for (var i = 0; i < (nLen - 4)/2; i++) - { - this.aTopics[i] = new topic(fn_arguments[i * 2 + 3], fn_arguments[i * 2 + 4]); - } - } - } - } -} - -function getIndexTopicMappingList(nItemIndex) -{ - var sTopics = ""; - if (gIEA.length > nItemIndex) - { - if (gIEA[nItemIndex].aTopics) - { - var i = 0; - var nLen = gIEA[nItemIndex].aTopics.length; - for (i = 0; i < nLen; i ++) - { - sTopics += "," + gIEA[nItemIndex].aTopics[i]; - } - } - } - return sTopics; -} - -function window_OnLoad() -{ - if (parent && parent != this) { - if (parent.putData) - { - for (var i = 0; i < gIEA.length; i ++ ) - { - if (gIEA[i].nNKOff != 0 && i + gIEA[i].nNKOff + 1 < gIEA.length) - { - - gIEA[i + gIEA[i].nNKOff + 1].nPKOff = gIEA[i].nNKOff; - } - } - parent.putData(gIEA); - } - } -} - +// WebHelp 5.10.001 +// const strings +var gIEA = new Array(); +function aIE() +{ + var len = gIEA.length; + gIEA[len] = new indexEntry(aIE.arguments); +} + +function topic(sName, sURL) +{ + this.sName = sName; + this.sURL = sURL; +} + +function indexEntry(fn_arguments) +{ + if (fn_arguments.length && fn_arguments.length >= 3) + { + this.nType = fn_arguments[0]; + this.nPKOff = 0; + this.nNKOff = fn_arguments[1]; + this.sName = fn_arguments[2]; + this.aTopics = null; + var nLen = fn_arguments.length; + if (Math.floor(nLen / 2) * 2 == nLen) + { + this.sTarget = fn_arguments[3]; + if (nLen > 5) + { + this.aTopics = new Array(); + for (var i = 0; i < (nLen - 5)/2; i++) + { + this.aTopics[i] = new topic(fn_arguments[i * 2 + 4], fn_arguments[i * 2 + 5]); + } + } + + } + else + { + if (nLen > 4) + { + this.aTopics = new Array(); + for (var i = 0; i < (nLen - 4)/2; i++) + { + this.aTopics[i] = new topic(fn_arguments[i * 2 + 3], fn_arguments[i * 2 + 4]); + } + } + } + } +} + +function getIndexTopicMappingList(nItemIndex) +{ + var sTopics = ""; + if (gIEA.length > nItemIndex) + { + if (gIEA[nItemIndex].aTopics) + { + var i = 0; + var nLen = gIEA[nItemIndex].aTopics.length; + for (i = 0; i < nLen; i ++) + { + sTopics += "," + gIEA[nItemIndex].aTopics[i]; + } + } + } + return sTopics; +} + +function window_OnLoad() +{ + if (parent && parent != this) { + if (parent.putData) + { + for (var i = 0; i < gIEA.length; i ++ ) + { + if (gIEA[i].nNKOff != 0 && i + gIEA[i].nNKOff + 1 < gIEA.length) + { + + gIEA[i + gIEA[i].nNKOff + 1].nPKOff = gIEA[i].nNKOff; + } + } + parent.putData(gIEA); + } + } +} + window.onload = window_OnLoad; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whidx.htm b/doc/salome/gui/SMESH/whdata/whidx.htm index 0a0deedd0..a049a96f9 100755 --- a/doc/salome/gui/SMESH/whdata/whidx.htm +++ b/doc/salome/gui/SMESH/whdata/whidx.htm @@ -1,15 +1,15 @@ - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whidx.js b/doc/salome/gui/SMESH/whdata/whidx.js index e0519afcb..c34fb24b2 100755 --- a/doc/salome/gui/SMESH/whdata/whidx.js +++ b/doc/salome/gui/SMESH/whdata/whidx.js @@ -1,34 +1,34 @@ -// WebHelp 5.10.001 -var gaFileMapping = new Array(); -function fileMapping(sBK, sEK, sFileName, nNum) -{ - this.sBK = sBK; - this.sEK = sEK; - this.sFileName = sFileName; - this.aKs = null; - this.nNum = nNum; - this.oUsedItems = null; -} - - -function iFM(sBK, sEK, sFileName, nNum) -{ - var i = gaFileMapping.length; - gaFileMapping[i] = new fileMapping(sBK, sEK, sFileName, nNum); - if (i == 0) { - gaFileMapping[i].nTotal = nNum; - } - else { - gaFileMapping[i].nTotal = nNum + gaFileMapping[i - 1].nTotal; - } -} - -function window_OnLoad() -{ - if (parent && parent != this && parent.projReady) - { - parent.projReady(gaFileMapping); - } -} - -window.onload = window_OnLoad; +// WebHelp 5.10.001 +var gaFileMapping = new Array(); +function fileMapping(sBK, sEK, sFileName, nNum) +{ + this.sBK = sBK; + this.sEK = sEK; + this.sFileName = sFileName; + this.aKs = null; + this.nNum = nNum; + this.oUsedItems = null; +} + + +function iFM(sBK, sEK, sFileName, nNum) +{ + var i = gaFileMapping.length; + gaFileMapping[i] = new fileMapping(sBK, sEK, sFileName, nNum); + if (i == 0) { + gaFileMapping[i].nTotal = nNum; + } + else { + gaFileMapping[i].nTotal = nNum + gaFileMapping[i - 1].nTotal; + } +} + +function window_OnLoad() +{ + if (parent && parent != this && parent.projReady) + { + parent.projReady(gaFileMapping); + } +} + +window.onload = window_OnLoad; diff --git a/doc/salome/gui/SMESH/whdata/whtdata.js b/doc/salome/gui/SMESH/whdata/whtdata.js index d5428a7de..0558e198c 100755 --- a/doc/salome/gui/SMESH/whdata/whtdata.js +++ b/doc/salome/gui/SMESH/whdata/whtdata.js @@ -1,64 +1,64 @@ -// WebHelp 5.10.001 -var gTEA = new Array(); -function aTE() -{ - gTEA[gTEA.length] = new tocEntry(aTE.arguments); -} - -function tocEntry(fn_arguments) -{ - if (fn_arguments.length < 3) - { - alert ("data format wrong!!!"); - return; - } - - this.nType = fn_arguments[0]; - this.nContents = fn_arguments[1]; - this.sItemName = fn_arguments[2]; - - if (this.nType == 1 || this.nType == 2 || this.nType == 16) - { - if (fn_arguments.length > 3) - { - this.sItemURL = fn_arguments[3]; - if (fn_arguments.length > 4) - { - this.sTarget = fn_arguments[4]; - if (fn_arguments.length > 5) - this.sIconRef = fn_arguments[5]; - } - } - } - if (this.nType == 4 || this.nType == 8) - { - if (fn_arguments.length > 3) - { - this.sRefURL = fn_arguments[3]; - if (this.nType == 4) - { - if(this.sRefURL.lastIndexOf("/")!=this.sRefURL.length-1) - this.sRefURL+="/"; - } - if (fn_arguments.length > 4) - { - this.sItemURL = fn_arguments[4]; - if (fn_arguments.length > 5) - { - this.sTarget = fn_arguments[5]; - if (fn_arguments.length > 6) - this.sIconRef = fn_arguments[6]; - } - } - } - } -} - - -function window_OnLoad() -{ - if (parent && parent != this && parent.putData) { - parent.putData(gTEA); - } -} +// WebHelp 5.10.001 +var gTEA = new Array(); +function aTE() +{ + gTEA[gTEA.length] = new tocEntry(aTE.arguments); +} + +function tocEntry(fn_arguments) +{ + if (fn_arguments.length < 3) + { + alert ("data format wrong!!!"); + return; + } + + this.nType = fn_arguments[0]; + this.nContents = fn_arguments[1]; + this.sItemName = fn_arguments[2]; + + if (this.nType == 1 || this.nType == 2 || this.nType == 16) + { + if (fn_arguments.length > 3) + { + this.sItemURL = fn_arguments[3]; + if (fn_arguments.length > 4) + { + this.sTarget = fn_arguments[4]; + if (fn_arguments.length > 5) + this.sIconRef = fn_arguments[5]; + } + } + } + if (this.nType == 4 || this.nType == 8) + { + if (fn_arguments.length > 3) + { + this.sRefURL = fn_arguments[3]; + if (this.nType == 4) + { + if(this.sRefURL.lastIndexOf("/")!=this.sRefURL.length-1) + this.sRefURL+="/"; + } + if (fn_arguments.length > 4) + { + this.sItemURL = fn_arguments[4]; + if (fn_arguments.length > 5) + { + this.sTarget = fn_arguments[5]; + if (fn_arguments.length > 6) + this.sIconRef = fn_arguments[6]; + } + } + } + } +} + + +function window_OnLoad() +{ + if (parent && parent != this && parent.putData) { + parent.putData(gTEA); + } +} window.onload = window_OnLoad; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whtdata0.htm b/doc/salome/gui/SMESH/whdata/whtdata0.htm index 19d460aee..6ff50b0a2 100755 --- a/doc/salome/gui/SMESH/whdata/whtdata0.htm +++ b/doc/salome/gui/SMESH/whdata/whtdata0.htm @@ -1,90 +1,95 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whdata/whtoc.htm b/doc/salome/gui/SMESH/whdata/whtoc.htm index 54e0cbf26..459c3e311 100755 --- a/doc/salome/gui/SMESH/whdata/whtoc.htm +++ b/doc/salome/gui/SMESH/whdata/whtoc.htm @@ -1,16 +1,16 @@ - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whtoc.js b/doc/salome/gui/SMESH/whdata/whtoc.js index 163d8cc9f..62de5a132 100755 --- a/doc/salome/gui/SMESH/whdata/whtoc.js +++ b/doc/salome/gui/SMESH/whdata/whtoc.js @@ -1,31 +1,31 @@ -// WebHelp 5.10.001 -// const strings -var gaProj = new Array(); -var gsRoot = ""; - -function setRoot(sRoot) -{ - gsRoot = sRoot -} - -function aPE(sProjPath, sRootPath) -{ - gaProj[gaProj.length] = new tocProjEntry(sProjPath, sRootPath); -} - -function tocProjEntry(sProjPath, sRootPath) -{ - if(sProjPath.lastIndexOf("/")!=sProjPath.length-1) - sProjPath+="/"; - this.sPPath = sProjPath; - this.sRPath = sRootPath; -} - - -function window_OnLoad() -{ - if (parent && parent != this && parent.projReady) { - parent.projReady(gsRoot, gaProj); - } -} +// WebHelp 5.10.001 +// const strings +var gaProj = new Array(); +var gsRoot = ""; + +function setRoot(sRoot) +{ + gsRoot = sRoot +} + +function aPE(sProjPath, sRootPath) +{ + gaProj[gaProj.length] = new tocProjEntry(sProjPath, sRootPath); +} + +function tocProjEntry(sProjPath, sRootPath) +{ + if(sProjPath.lastIndexOf("/")!=sProjPath.length-1) + sProjPath+="/"; + this.sPPath = sProjPath; + this.sRPath = sRootPath; +} + + +function window_OnLoad() +{ + if (parent && parent != this && parent.projReady) { + parent.projReady(gsRoot, gaProj); + } +} window.onload = window_OnLoad; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whestart.ico b/doc/salome/gui/SMESH/whestart.ico deleted file mode 100755 index 110f18356..000000000 Binary files a/doc/salome/gui/SMESH/whestart.ico and /dev/null differ diff --git a/doc/salome/gui/SMESH/whfbody.htm b/doc/salome/gui/SMESH/whfbody.htm index 86d8e63db..ea648e4b3 100755 --- a/doc/salome/gui/SMESH/whfbody.htm +++ b/doc/salome/gui/SMESH/whfbody.htm @@ -1,37 +1,37 @@ - - -Search Result - - - - - - - - - - - - - - - - - + + +Search Result + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whfdhtml.htm b/doc/salome/gui/SMESH/whfdhtml.htm index 236beec73..c2e65bea1 100755 --- a/doc/salome/gui/SMESH/whfdhtml.htm +++ b/doc/salome/gui/SMESH/whfdhtml.htm @@ -1,30 +1,30 @@ - - -Search Frame - - - - - - - - - + + +Search Frame + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whfform.htm b/doc/salome/gui/SMESH/whfform.htm index f592a738d..e01bedde6 100755 --- a/doc/salome/gui/SMESH/whfform.htm +++ b/doc/salome/gui/SMESH/whfform.htm @@ -1,136 +1,136 @@ - - -Search Form - - - - - - - - - - - - - + + +Search Form + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whfhost.js b/doc/salome/gui/SMESH/whfhost.js index 167acc459..c3c7144fa 100755 --- a/doc/salome/gui/SMESH/whfhost.js +++ b/doc/salome/gui/SMESH/whfhost.js @@ -1,945 +1,945 @@ -// WebHelp 5.10.003 -var gsSK2=null; -var gsSK=null; -var gsFtsBreakChars="\t\r\n\"\\ .,!@#$%^&*()~'`:;<>?/{}[]|+-=\x85\x92\x93\x94\x95\x96\x97\x99\xA9\xAE\xB7"; -var gnCLF=0; -var gsHelpCannotSearch="Cannot search for that phrase."; -var gsNoTopics="No Topics Found."; -var gsLoadingDivID="LoadingDiv"; -var gsLoadingMsg="Loading data, please wait..."; -var gsSearchMsg="Searching..."; -var gsResultDivID="ResultDiv"; -var gaaFCD=new Array(); -var gaaFTCD=new Array(); -var goCF=null; -var goCTF=null; -var gaTI=null; -var gnCurrentOp=0; -var gbNot=false; -var gbReady=false; -var gnLoadFts=1; -var gnCacheLimits=5; -var gaCCD=new Array(); -var gbXML=false; -var gaData=new Array(); -var gsBgColor="#ffffff"; -var gsBgImage=""; -var gsMargin="0pt"; -var gsIndent="0pt"; -var gsCheckKey=null; -var gnIndexNum=0; -var gaFtsContentsCon=null; -var gaTopicCheckInfo=null; -var gnTopicCheck=0; -var goFont=null; -var goErrFont=null; -var goHoverFont=null; -var gsABgColor="#cccccc"; -var gbWhFHost=false; -var gbFirst=false; - -function setBackground(sBgImage) -{ - gsBgImage=sBgImage; -} - -function setBackgroundcolor(sBgColor) -{ - gsBgColor=sBgColor; -} - -function setFont(sType,sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration) -{ - var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration); - if(sType=="Normal") - goFont=vFont; - else if(sType=="Error") - goErrFont=vFont; - else if(sType=="Hover") - goHoverFont=vFont; -} - -function setActiveBgColor(sBgColor) -{ - gsABgColor=sBgColor; -} - -function setMargin(sMargin) -{ - gsMargin=sMargin; -} - -function setIndent(sIndent) -{ - gsIndent=sIndent; -} - -function updateCache(oCF) -{ - var len=gaCCD.length; - if(len0&&sURL) - { - var topic=new Object(); - topic.sTopicTitle=name; - topic.sTopicURL=sURL; - aTopics[aTopics.length]=topic; - } - } - oChild=oChild.nextSibling; - } - putFtsTData(aTopics); - } - } - else if(gnLoadFts==2) - { - var node=xmlDoc.lastChild; - if(node) - { - var oChild=node.firstChild; - var aFtsContents=new Array(); - while(oChild) - { - if(oChild.nodeName=="key") - { - var name=oChild.getAttribute("name"); - if(name&&name.length>0) - { - var item=new Object(); - item.sItemName=name; - aFtsContents[aFtsContents.length]=item; - var oChildChild=oChild.firstChild; - while(oChildChild) - { - if(oChildChild.nodeName=="#text") - { - var sIDs=oChildChild.nodeValue; - if(sIDs) - { - var nBPos=0; - do - { - var nPos=sIDs.indexOf(",",nBPos); - var sID=null; - if(nPos!=-1) - sID=sIDs.substring(nBPos,nPos); - else - sID=sIDs.substring(nBPos); - - if(sID) - { - var id=parseInt(sID); - if(!isNaN(id)) - { - if(!item.aTopics) - item.aTopics=new Array(); - item.aTopics[item.aTopics.length]=id; - } - } - nBPos=nPos+1; - }while(nBPos!=0&&nBPos0) - { - document.body.background=gsBgImage; - } - if(gsBgColor&&gsBgColor.length>0) - { - document.body.bgColor=gsBgColor; - } - writeResultDiv(); - loadFts(); - var oMsg=new whMessage(WH_MSG_SHOWFTS,this,1,null) - SendMessage(oMsg); -} - -function writeResultDiv() -{ - var sHTML="
"; - document.body.insertAdjacentHTML("beforeEnd",sHTML); -} - -function loadFts() -{ - if(!gbReady) - { - var oResMsg=new whMessage(WH_MSG_GETPROJINFO,this,1,null); - if(SendMessage(oResMsg)&&oResMsg.oParam) - { - gbReady=true; - var oProj=oResMsg.oParam; - var aProj=oProj.aProj; - gbXML=oProj.bXML; - if(aProj.length>0) - { - var sLangId=aProj[0].sLangId; - for(var i=0;i=0)&&(gsFtsBreakChars.charAt(nSep)=="|"))){ - gnCurrentOp=0; - gbNot=false; - }else if((sCW=="and")||((nSep>=0)&&(gsFtsBreakChars.charAt(nSep)=="&"))){ - gnCurrentOp=1; - gbNot=false; - }else if((sCW=="not")|| - ((nSep>=0)&&(gsFtsBreakChars.charAt(nSep)=="~"))){ - gbNot=!gbNot; - }else if(sCW!=""&&!IsStopWord(sCW,gaFtsStop)){ - var sCurrentStem=GetStem(sCW); - gsCW=sCurrentStem; - ftsFindKeyword(); - return; - } - findOneKey(); - } - else{ - displayTopics(); - checkAgain(); - } -} - -function checkAgain() -{ - gsCheckKey = ""; - gnIndexNum = 0; - gsSK=gsSK2; - gsSK2=null; - if(gsSK!=null) - setTimeout("findFTSKey();",1); -} - -function displayTopics() -{ - var sHTML=""; - var sLine=""; - for(var i=0;i"+_textToHtml(gaTI[i].sTopicTitle)+""; - if(i>>4<<4==i) - { - sHTML+=sLine; - sLine=""; - } - } - if(sLine.length>0) - sHTML+=sLine; - - if(sHTML.length==0) - sHTML="

"+gsNoTopics+"

" - else - sHTML="
"+sHTML+"
"; - - var resultDiv=getElement(gsResultDivID); - if(resultDiv) - resultDiv.innerHTML=sHTML; -} - -function displayMsg(sErrorMsg) -{ - var sHTML="

"+sErrorMsg+"

"; - - var resultDiv=getElement(gsResultDivID); - if(resultDiv) - resultDiv.innerHTML=sHTML; -} - -function ftsFindKeyword() -{ - var sKey=gsCW; - var bNeedLoad=false; - var aFtsContentsCon=null; - var s=0; - if(sKey==null) return; - if(!gsCheckKey||sKey!=gsCheckKey||gnIndexNum==0) - { - aFtsContentsCon=new Array(); - gnCheck=0; - gsCheckKey=sKey; - gnTopicCheck=0; - gaTopicCheckInfo=null; - } - else{ - s=gnIndexNum; - aFtsContentsCon=gaFtsContentsCon; - } - for(var i=gnCheck;i=aTI.length) - { - aLS=gaTI; - aSS=aTI; - } - else - { - aLS=aTI; - aSS=gaTI; - } - var s=0; - for(var i=0;i=0) - { - var nM; - var bFound=false; - do{ - nM=(nB+nE)>>1; - if(compare(aTI[nM].sTopicTitle,oTI.sTopicTitle)>0) - nE=nM-1; - else if(compare(aTI[nM].sTopicTitle,oTI.sTopicTitle)<0) - nB=nM+1; - else - { - bFound=true; - break; - } - }while(nB<=nE); - if(bFound) - insertItemIntoArray(aTI,nM,oTI); - else - { - if(compare(aTI[nM].sTopicTitle,oTI.sTopicTitle)<0) - insertItemIntoArray(aTI,nM+1,oTI); - else - insertItemIntoArray(aTI,nM,oTI); - } - } - else - aTI[0]=oTI; -} - -function mergeTopics(aTI1,aTI2) -{ - var i1=0; - var i2=0; - var len1=aTI1.length; - var len2=aTI2.length; - var aTopicNew=new Array(); - var i=0; - while(i1>1; - if(compare(keys[nM].sItemName,sKey)>0) - nE=nM-1; - else if(compare(keys[nM].sItemName,sKey)<0) - nB=nM+1; - else{ - bFound=true; - break; - } - }while(nB<=nE); - if(bFound) - { - if(keys[nM].aTopics) - { - for(var i=0;i>1; - if(aFTCD[nM].nBegin>nTopicId) - nE=nM-1; - else if(aFTCD[nM].nEnd

Data Structures

"; - sForm += ""; - sForm += ""; - sForm += "
"; - sForm += "

" + gsTitle + "
"; - if (gbWithButton && gnType >= 0) - { - sForm += ""; - } - sForm += "
" - if (gnType == 0) - { - if (!gsText) - gsText="Go"; - sForm += "\""+gsText+"\""; - } - else - sForm += gsText ; - sForm += "

"; - return sForm; -} - -function onMouseOver() -{ - if (getElement("go") && gsOverImage) - getElement("go").src = gsOverImage; -} - -function onMouseDown() -{ - if (getElement("go") && gsClickImage) - getElement("go").src = gsClickImage; -} - -function onMouseUp() -{ - if (getElement("go") && gsOutImage) - getElement("go").src = gsOutImage; -} - -function onMouseOut() -{ - if (getElement("go") && gsOutImage) - getElement("go").src = gsOutImage; -} - -if (window.gbWhUtil&&window.gbWhVer&&window.gbWhProxy&&window.gbWhMsg) -{ - goTitleFont=new whFont("Arial", "9pt", "#000000", "normal", "normal", "none"); - goNormalFont=new whFont("Arial", "9pt", "#000000", "normal", "normal", "none"); - goHoverFont=new whFont("Arial", "9pt", "#000000", "normal", "normal", "underline"); - gbWhForm=true; -} -else +// WebHelp 5.10.001 +var gfunLookUp; +var gbInputEnable; +var gfunInit; +var gstrFormName= ""; +var gbWithButton = false; +var gsTitle=""; +var gsOverImage = ""; +var gsOutImage = ""; +var gsClickImage = ""; +var gsText = ""; +var gsBgColor = "#c0c0c0"; +var gsBgImage = ""; +var gbInImage = 0; +var gbInputEnable = 0; + +var goTitleFont=null; +var goInputFont=null; +var goNormalFont=null; +var goHoverFont=null; +var gnType=-1; +var gbWhForm=false; + +function setBackground(sBgImage) +{ + if (sBgImage != null && sBgImage.length > 0) + gsBgImage = sBgImage; + + if (gsBgImage && gsBgImage .length > 0) + { + document.body.background = gsBgImage ; + } +} + +function setBackgroundcolor(sBgColor) +{ + if (sBgColor != null && sBgColor.length > 0) + gsBgColor = sBgColor; + + if (gsBgColor&& gsBgColor.length > 0) + { + document.body.bgColor = gsBgColor; + } +} + +function setBtnType(sType) +{ + if (sType == "image") + { + gnType = 0; + } + else if (sType == "text") + { + gnType = 1; + } +} + +function setGoImage1(sImage1) +{ + gsOutImage = sImage1; + if (gsOutImage && gsOutImage.length > 0) + gbWithButton = true; +} + +function setGoImage2(sImage2) +{ + gsOverImage = sImage2; + if (gsOverImage && gsOverImage.length > 0) + gbWithButton = true; +} + +function setGoImage3(sImage3) +{ + gsClickImage = sImage3; + if (gsClickImage && gsClickImage.length > 0) + gbWithButton = true; +} + +function setGoText(sText) +{ + gsText = sText; + if (gsText.length > 0) + gbWithButton = true; +} + +function setFont(sType, sFontName, sFontSize, sFontColor, sFontStyle, sFontWeight, sFontDecoration) +{ + var vFont = new whFont(sFontName, sFontSize, sFontColor, sFontStyle, sFontWeight, sFontDecoration); + if (sType == "Title") + { + goTitleFont = vFont; + var vFont1 = new whFont(sFontName, sFontSize, "black", sFontStyle, sFontWeight, sFontDecoration); + goInputFont=vFont1; + } + else if (sType == "Normal") + goNormalFont = vFont; + else if (sType == "Hover") + goHoverFont = vFont; +} + +function writeFormStyle() +{ + var sStyle = ""; + document.write(sStyle); +} + +function lookupKeyDown() +{ + if (gbInputEnable) + { + if (gbIE4) + { + if (event.keyCode == 13) //Enter key + gfunLookUp(true); + else + gfunLookUp(false); + } + else + gfunLookUp(false); + } +} + +function init() +{ + if (gfunInit) + gfunInit(); + if (!window.Array) return; + document.onkeyup = lookupKeyDown; +} + +function inputSubmit() +{ + if ((gbInputEnable && !gbIE4)|| gbInImage) + gfunLookUp(true); +} + +function inputEnable(bEnable) +{ + gbInputEnable = bEnable; +} + +function inImage(bImage) +{ + gbInImage = bImage; +} + +function getFormHTML() +{ + var sForm = ""; + sForm += ""; + sForm += ""; + sForm += ""; + sForm += "
"; + sForm += "

" + gsTitle + "
"; + if (gbWithButton && gnType >= 0) + { + sForm += ""; + } + sForm += "
" + if (gnType == 0) + { + if (!gsText) + gsText="Go"; + sForm += "\""+gsText+"\""; + } + else + sForm += gsText ; + sForm += "

"; + return sForm; +} + +function onMouseOver() +{ + if (getElement("go") && gsOverImage) + getElement("go").src = gsOverImage; +} + +function onMouseDown() +{ + if (getElement("go") && gsClickImage) + getElement("go").src = gsClickImage; +} + +function onMouseUp() +{ + if (getElement("go") && gsOutImage) + getElement("go").src = gsOutImage; +} + +function onMouseOut() +{ + if (getElement("go") && gsOutImage) + getElement("go").src = gsOutImage; +} + +if (window.gbWhUtil&&window.gbWhVer&&window.gbWhProxy&&window.gbWhMsg) +{ + goTitleFont=new whFont("Arial", "9pt", "#000000", "normal", "normal", "none"); + goNormalFont=new whFont("Arial", "9pt", "#000000", "normal", "normal", "none"); + goHoverFont=new whFont("Arial", "9pt", "#000000", "normal", "normal", "underline"); + gbWhForm=true; +} +else document.location.reload(); \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whframes.js b/doc/salome/gui/SMESH/whframes.js index 2040f336f..121011e2d 100755 --- a/doc/salome/gui/SMESH/whframes.js +++ b/doc/salome/gui/SMESH/whframes.js @@ -1,79 +1,79 @@ -// WebHelp 5.10.001 -// this value should be identical to the value used in whproxy.js -window.whname = "wh_stub"; - -// this file will be used by Topic and NavBar and NavPane and other components -// and this file is used in child frame html. -// and the whstub.js will be used in the start page. -// see reference in whstub.js. -// Internal Area -var gbInited = false; -var gWndStubPage = null; -function getStubPage() -{ - if (!gbInited) - { - gWndStubPage = getStubPage_inter(window); - gbInited = true; - } - return gWndStubPage; -} - -function getStubPage_inter(wCurrent) { - if (null == wCurrent.parent || wCurrent.parent == wCurrent) - return null; - - if (wCurrent.parent.whname && "wh_stub" == wCurrent.parent.whname) - return wCurrent.parent; - else - if (wCurrent.parent.frames.length != 0 && wCurrent.parent != wCurrent) - return getStubPage_inter(wCurrent.parent); - else - return null; -} - -// Public interface begin here................ -function RegisterListener(framename, nMessageId) -{ - var wStartPage = getStubPage(); - if (wStartPage && wStartPage != this) { - return wStartPage.RegisterListener(framename, nMessageId); - } - else - return false; -} - -function RegisterListener2(oframe, nMessageId) -{ - var wStartPage = getStubPage(); - if (wStartPage && wStartPage != this) { - return wStartPage.RegisterListener2(oframe, nMessageId); - } - else - return false; -} - -function UnRegisterListener2(oframe, nMessageId) -{ - var wStartPage = getStubPage(); - if (wStartPage && wStartPage != this && wStartPage.UnRegisterListener2) { - return wStartPage.UnRegisterListener2(oframe, nMessageId); - } - else - return false; -} - -function SendMessage(oMessage) -{ - var nMsgId = oMessage.nMessageId; - if (nMsgId == WH_MSG_ISINFRAMESET && oMessage.wSender != this) - return true; - var wStartPage = getStubPage(); - if (wStartPage && wStartPage != this && wStartPage.SendMessage) - { - return wStartPage.SendMessage(oMessage); - } - else - return false; -} +// WebHelp 5.10.001 +// this value should be identical to the value used in whproxy.js +window.whname = "wh_stub"; + +// this file will be used by Topic and NavBar and NavPane and other components +// and this file is used in child frame html. +// and the whstub.js will be used in the start page. +// see reference in whstub.js. +// Internal Area +var gbInited = false; +var gWndStubPage = null; +function getStubPage() +{ + if (!gbInited) + { + gWndStubPage = getStubPage_inter(window); + gbInited = true; + } + return gWndStubPage; +} + +function getStubPage_inter(wCurrent) { + if (null == wCurrent.parent || wCurrent.parent == wCurrent) + return null; + + if (wCurrent.parent.whname && "wh_stub" == wCurrent.parent.whname) + return wCurrent.parent; + else + if (wCurrent.parent.frames.length != 0 && wCurrent.parent != wCurrent) + return getStubPage_inter(wCurrent.parent); + else + return null; +} + +// Public interface begin here................ +function RegisterListener(framename, nMessageId) +{ + var wStartPage = getStubPage(); + if (wStartPage && wStartPage != this) { + return wStartPage.RegisterListener(framename, nMessageId); + } + else + return false; +} + +function RegisterListener2(oframe, nMessageId) +{ + var wStartPage = getStubPage(); + if (wStartPage && wStartPage != this) { + return wStartPage.RegisterListener2(oframe, nMessageId); + } + else + return false; +} + +function UnRegisterListener2(oframe, nMessageId) +{ + var wStartPage = getStubPage(); + if (wStartPage && wStartPage != this && wStartPage.UnRegisterListener2) { + return wStartPage.UnRegisterListener2(oframe, nMessageId); + } + else + return false; +} + +function SendMessage(oMessage) +{ + var nMsgId = oMessage.nMessageId; + if (nMsgId == WH_MSG_ISINFRAMESET && oMessage.wSender != this) + return true; + var wStartPage = getStubPage(); + if (wStartPage && wStartPage != this && wStartPage.SendMessage) + { + return wStartPage.SendMessage(oMessage); + } + else + return false; +} var gbWhProxy=true; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whgbody.htm b/doc/salome/gui/SMESH/whgbody.htm index 476ec2d66..34d782d2d 100755 --- a/doc/salome/gui/SMESH/whgbody.htm +++ b/doc/salome/gui/SMESH/whgbody.htm @@ -1,35 +1,35 @@ - - -Glossary Term - - - - - - - - - - - - - - - - + + +Glossary Term + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf0.htm b/doc/salome/gui/SMESH/whgdata/whlstf0.htm index aa2e343b1..08501c590 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf0.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf0.htm @@ -1,44 +1,44 @@ - - -Search Words List - - - - - - - -

- - -0d
1d 1 2 3 4 5 6 7 8 9 10 11 12 13
1e 1 2
2d 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
3d 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
3e
3rd
5th
-

-able
above 1 2
abox
absent
absolutely
abutting
access 1 2
according 1 2 3 4 5 6 7 8 9 10 11
account 1 2
acomp 1 2
acompobj
actually
add 1 2 3 4 5 6 7 8 9 10 11 12 13 14
added 1 2 3 4 5
addedge
addface
addhypothesis 1 2 3 4 5
adding 1 2 3
addition 1 2 3
additional 1 2 3 4 5 6 7
additionally 1 2
addnode
addobject
addtostudy 1 2 3 4 5 6 7
addtostudyinfather 1 2 3
addvolume
adjacent 1 2 3 4 5 6
adjust
adjustable
advanced 1 2
afilter 1 2
afiltermgr 1 2 3
afunctor 1 2 3
ageomgroup1
ageomgroup2
agroup 1 2
agroup1
agroup2
agroup3
agroup4
agroup5
agroupelemids
agroupmain
agroupres
agrouptool
ai
algo 1 2 3 4
algo1 1 2 3
algo2 1 2 3
algorithm 1 2 3 4 5 6 7 8 9 10 11 12 13 14
algorithms 1 2 3 4 5 6 7 8 9
allow
allowed 1 2 3
allowing
allows 1 2 3 4 5 6 7 8 9 10 11 12 13 14
along 1 2 3 4 5
alternative
always
amesheditor 1 2
amount
analytic
aneditor 1 2 3
angle 1 2 3 4 5 6 7 8 9 10 11
angle180
angle45
angled
angles 1 2
angular
angularity
anids 1 2
anodeid1
anodeid2
anodeid3
anodeid4
another
any 1 2 3 4 5 6 7 8
apparent
appear 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
appears 1 2
append
applicable
application 1 2
applied 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
apply 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
applying 1 2 3 4 5
appropriate
approximately
apredicate 1 2


>> - - - - - + + +Search Words List + + + + + + + +

+ + +0d
1d 1 2 3 4 5 6 7 8 9 10 11 12 13
1e 1 2
2d 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
3d 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
3e
3rd
3x3
5th
+

+a_mesh
aa
able 1 2 3
aborder
aborders
above 1 2 3
abox
absent
absolutely
abutting
access 1 2
accessed
according 1 2 3 4 5 6 7 8 9 10 11 12 13
account 1 2
acomp 1 2
acompobj
actually
add 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
added 1 2 3 4 5
addedge
addface
addhypothesis 1 2 3 4 5 6
adding 1 2 3 4
addition 1 2 3
additional 1 2 3 4 5 6 7
additionally 1 2
addnode
addobject
addpolygonalface
addpolyhedralvolume
addtostudy 1 2 3 4 5 6 7
addtostudyinfather 1 2 3 4 5
addvolume
adjacent 1 2 3 4 5 6
adjust
adjustable
advanced 1 2
afilter 1 2
afiltermgr 1 2 3
afunctor 1 2 3
ageomgroup1
ageomgroup2
agroup 1 2
agroup1
agroup2
agroup3
agroup4
agroup5
agroupelemids
agroupf
agroupmain
agroupn
agroupres
agrouptool
ai
al
algo 1 2 3 4
algo1 1 2 3
algo2 1 2 3
algorithm 1 2 3 4 5 6 7 8 9 10 11 12 13
algorithms 1 2 3 4 5 6 7 8 9 10
allow
allowed 1 2 3
allowing 1 2
allows 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
along 1 2 3 4 5 6
alternative
alternatively 1 2
always
amesheditor 1 2
amount
analytic
aneditor 1 2 3
angle 1 2 3 4 5 6 7 8 9 10 11
angle180
angle45
angled
angles 1 2 3
angular
angularity
anids 1 2
anodeid1
anodeid2
anodeid3
anodeid4
another 1 2
any 1 2 3 4 5 6 7 8 9
apparent
appear 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
appeared
append 1 2
applicable 1 2
application 1 2
applied 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
apply 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
applying 1 2 3 4 5
applytomeshfaces
appropriate
approximately
apredicate 1 2


>> + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf1.htm b/doc/salome/gui/SMESH/whgdata/whlstf1.htm index 517741c6e..935c39087 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf1.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf1.htm @@ -1,45 +1,45 @@ - - -Search Words List - - - - - - - -

<<

-

-arc 1 2
arcsine
area 1 2 3 4 5 6 7 8 9 10 11
areas
arithmetic 1 2 3 4 5
arithmetic1d 1 2 3 4
around 1 2 3
asmeshgroup1
asmeshgroup2
aspect 1 2 3 4 5 6
assign
assigned
assigning
associated 1 2 3
auto
automatic 1 2
automatically 1 2 3 4 5
available
average 1 2 3 4 5 6
axis 1 2 3 4 5
axisstruct 1 2
axisxyz 1 2
-

-background
bar
base
based 1 2 3
basic
basing 1 2
basis 1 2 3
become
before
beginning 1 2
belong 1 2 3
belonging 1 2 3 4 5
berders
binary
bisecting
bisector
bit
black
block 1 2
bog
boolean
border 1 2
borders 1 2 3 4 5 6 7 8 9
both 1 2 3 4
bottom
bound
boundaries
boundary 1 2 3 4
bounded
bounding
bounds
box 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
box_id 1 2
box1
box2
boxes
brown
browse
browser 1 2 3 4 5 6 7 8 9 10 11 12
build 1 2 3 4
builds
built 1 2
button 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
buttons 1 2
-

-cad
calculate
calculated 1 2 3 4
calculates
calculation 1 2 3
calculations
called
careful
case 1 2 3 4 5 6
cases 1 2
cells 1 2 3
center 1 2
centroid
centroidal
centroidal_smooth
certain 1 2
change 1 2 3 4 5 6 7
changed
changes 1 2 3 4
changing
chapter
characteristic
characterizes
check 1 2
checkbox 1 2 3
choice 1 2 3
choose 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
choosing 1 2
chosen 1 2 3 4
circle 1 2
circlemesh
clear
click 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
clicking 1 2 3 4 5 6 7
clipping 1 2
close 1 2
closed 1 2


>> - - - - - + + +Search Words List + + + + + + + +

<<

+

+arc 1 2 3
arcsine
area 1 2 3 4 5 6 7 8 9 10 11
areas
arithmetic 1 2 3 4 5 6
arithmetic1d 1 2 3 4
around 1 2 3
array_of_nodes_groups
asmeshgroup1
asmeshgroup2
aspect 1 2 3 4 5 6
assign 1 2 3 4
assigned
assigning
associated 1 2 3
attribute
auto
automatic 1 2 3 4 5
automatically 1 2 3 4 5 6 7
available 1 2
average 1 2 3 4 5 6 7
axes
axis 1 2 3 4 5 6
axisstruct 1 2
axisxyz 1 2
+

+background
bar
base
based 1 2 3
basic 1 2
basing 1 2
basis 1 2 3
become
before 1 2
beginning 1 2
belong 1 2 3
belonging 1 2 3 4 5
below
berders
better
binary
bisecting
bisector
bit
black
block 1 2
blue
bmp 1 2
bog
boolean
border 1 2
borders 1 2 3 4 5 6 7 8 9
both 1 2 3 4
bottom 1 2
bound
boundaries
boundary 1 2 3 4 5
bounded
bounding
bounds
box 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
box_1
box_id 1 2
box1
box2
boxes
broken 1 2
brown
browse
browser 1 2 3 4 5 6 7 8 9 10 11 12 13
build 1 2 3 4 5 6 7
builds
built 1 2 3 4
button 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
buttons 1 2 3
+

+cad
calculated 1 2 3 4 5
calculates 1 2
calculation 1 2 3
calculations
called
careful
case 1 2 3 4 5 6 7
cases 1 2
cells 1 2 3
center 1 2 3
centroid
centroidal
centroidal_smooth
certain 1 2
change 1 2 3 4 5 6 7 8
changed
changes 1 2 3 4
changing
characteristic
characterizes
check 1 2
checkbox 1 2 3
checked
choice 1 2 3
choose 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
choosing 1 2
chosen 1 2 3 4 5


>> + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf10.htm b/doc/salome/gui/SMESH/whgdata/whlstf10.htm index 4da6489cc..8963e8a27 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf10.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf10.htm @@ -1,43 +1,43 @@ - - -Search Words List - - - - - - - -

<<

-

-side 1 2 3 4 5
sides 1 2 3
simple 1 2 3
simpler
simplex
simply 1 2
size
sizes
sk
sketcher
sketcher1
sketcher2
sketchers
skew 1 2 3 4 5 6
slider
smesh 1 2 3 4 5 6 7 8 9 10 11
smesh_mechanic 1 2 3 4
smesh_mechanic_tetra
smesh_mesheditor 1 2
smeshgroup1
smeshgroup2
smeshgui 1 2 3 4
smooth
smoothed
smoothing 1 2
smoothobject
smp
so 1 2 3 4 5 6 7 8 9 10 11
solid 1 2
solids 1 2
something
somewhat
sort 1 2 3 4
source
space 1 2 3 4
specific 1 2
specified 1 2 3 4 5
specifies 1 2
specify 1 2 3 4 5 6 7 8 9 10 11
specifying 1 2
sphere
split 1 2 3 4
standalone 1 2 3
standard 1 2 3
start 1 2 3 4 5 6
startendlength
starting 1 2 3
stdmeshers 1 2 3 4 5
steps 1 2
stored 1 2
structure 1 2
study 1 2 3 4 5
sub 1 2 3 4 5 6 7
submenu 1 2 3 4
submesh 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
submeshes 1 2
subshapeall 1 2 3 4 5
subshapelist 1 2 3 4
subshapelist1
subshapelist2
subshapename 1 2 3
sum
supplement
supplementary
surface 1 2 3 4 5
surfaces
surrounding 1 2
sweep
swept 1 2
symmetrical 1 2
symmetrically
symmetry 1 2
syntax
-

-t 1 2 3 4 5 6
table
take
taken 1 2 3 4 5
taper 1 2 3 4 5
techniques
tetrahedral
tetrahedralization
tetrahedron 1 2 3 4 5 6
tetrahedrons 1 2 3 4
th 1 2
them 1 2 3 4 5 6 7 8 9 10 11 12
those 1 2
three 1 2 3 4 5
threshold
tmp
toggle 1 2
toggling
tolerance 1 2 3 4
tool 1 2
toolbar 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
toolbars
tools
topological
topologically
topology
total
toward
transformation 1 2 3 4 5
transformed
transforming
translate 1 2
translated
translateobject
translation 1 2
transparency 1 2
transparent
triangle 1 2 3 4 5 6 7 8
triangles 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
triangular
tritoquad
trying


>> - - - - - + + +Search Words List + + + + + + + +

<<

+

+right 1 2 3 4 5 6 7
rotate 1 2 3 4
rotated 1 2 3 4
rotateobject
rotation 1 2 3 4 5 6
rotationsweepobject
rough
rr
rule 1 2
rules
running
+

+s
salome 1 2 3 4 5 6 7 8 9 10
same 1 2 3 4 5 6 7 8 9 10 11 12 13 14
sample 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
save
scalar
scale
scaling
scene
script 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
scripts 1 2
seam
search 1 2
second 1 2 3
section 1 2 3
sections 1 2
see 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
segment 1 2 3 4 5
segments 1 2 3 4 5 6 7
select 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
selectable
selected 1 2 3 4 5 6 7 8 9 10 11
selecting 1 2 3 4 5 6 7 8 9 10
selection 1 2 3 4 5 6 7 8
sense
separated
sequence
sequences
set 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
setcurrentstudy 1 2 3 4
setdisplaymode
setlength 1 2
setmargin 1 2
setmaxelementarea 1 2 3 4
setmaxelementvolume 1 2
setmesh
setname 1 2 3
setnumberofsegments 1 2 3 4 5 6
setnumfunctor 1 2
setpredicate 1 2
sets
setting 1 2 3 4
settings
settransparency
sew 1 2 3
sewbordertoside
sewconformfreeborders
sewfreeborders
sewing 1 2
sewsideelements
sg 1 2 3 4 5 6 7
shading 1 2 3
shall 1 2 3 4 5 6 7 8 9 10 11
shape 1 2 3 4
shape_mesh
shapes
shapetype 1 2 3 4 5 6 7
shift 1 2 3 4 5
shortest
should 1 2 3 4 5 6 7 8 9 10 11
show 1 2 3
showing
shown 1 2
shows 1 2 3
shrink


>> + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf11.htm b/doc/salome/gui/SMESH/whgdata/whlstf11.htm index 4b436debf..76c55a2eb 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf11.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf11.htm @@ -1,51 +1,43 @@ - - -Search Words List - - - - - - - -

<<

-

-tt
tui 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
two 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
type 1 2 3 4 5 6 7 8 9 10 11
types 1 2 3 4 5
typically
-

-u 1 2
unary
unassigning
uniform
union 1 2 3 4
uniongroups
unite 1 2 3 4
united 1 2
uniting 1 2 3
unless
unv
up 1 2 3 4
update
updated 1 2
updateobjbrowser 1 2 3 4 5 6 7
uploaded
usage
used 1 2 3 4 5 6 7 8 9 10
useful 1 2 3
user 1 2 3 4
uses
using 1 2 3 4 5 6 7 8
usually 1 2
-

-v
value 1 2 3 4 5 6 7 8 9 10
values 1 2 3 4 5 6
ve 1 2
vector 1 2 3 4 5 6 7 8 9 10
vertex 1 2
vertices 1 2 3 4
very 1 2
via 1 2 3
view
viewer 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
viewing 1 2
views
visual
volume 1 2 3 4 5 6 7
volumes 1 2 3 4 5 6 7 8 9
vxy 1 2
-

-walking
warp 1 2
warping 1 2 3 4 5 6
way 1 2 3 4 5 6 7 8
ways 1 2
weighted
well
whether
while
white 1 2
whole 1 2 3 4 5 6
whose 1 2 3 4
will 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
window
wire 1 2 3 4 5 6 7
wireframe 1 2
wires
wish 1 2 3
within 1 2 3
without
words
works
would 1 2
ww
-

-x 1 2 3
-

-y 1 2


>> - - - - - + + +Search Words List + + + + + + + +

<<

+

+side 1 2 3 4
sides 1 2 3
simple 1 2
simpler
simplex
simplexes
simply 1 2
sin
size
sizes
sk 1 2
sketcher
sketcher1
sketcher2
sketchers
skew 1 2 3 4 5 6
slider
small
smesh 1 2 3 4 5 6 7 8
smesh_mechanic 1 2 3 4
smesh_mechanic_tetra
smesh_mesheditor 1 2
smeshgroup1
smeshgroup2
smeshgui 1 2 3
smooth
smoothed
smoothing 1 2
smoothobject
smp
so 1 2 3 4 5 6 7 8 9 10 11 12
solid 1 2
solids 1 2
somewhat
sort 1 2 3 4
source
space 1 2 3 4
specific 1 2
specified 1 2 3 4 5
specifies 1 2
specify 1 2 3 4 5 6 7 8 9 10 11 12
specifying 1 2
sphere 1 2 3
split 1 2 3 4 5
sqrt
standalone 1 2 3
standard 1 2 3
start 1 2 3 4 5 6 7
startendlength
starting 1 2 3
status
stdmeshers 1 2 3 4 5 6
steps 1 2
stored 1 2
straight 1 2 3
stretched
strictly
structure 1 2
study 1 2 3 4
stuffed
sub 1 2 3 4 5 6 7 8
submenu 1 2 3 4
submesh 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
submeshes 1 2
subshapeall 1 2 3 4 5 6 7
subshapelist 1 2 3 4
subshapelist1
subshapelist2
subshapename 1 2 3
succeded 1 2
sum
supplement
supplementary
surface 1 2 3 4 5 6
surfaces 1 2
surrounding 1 2
sweep
swept 1 2
switches
symmetrical 1 2
symmetrically
symmetry 1 2
syntax
+

+t 1 2 3 4 5 6 7 8
table 1 2
take
taken 1 2 3 4 5
taking
taper 1 2 3 4 5
techniques
tetra3d
tetrahedral
tetrahedralization
tetrahedron 1 2 3 4 5 6
tetrahedrons 1 2 3 4
th 1 2
them 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
those 1 2
three 1 2 3 4 5 6 7 8
threshold
tick
time
tmp
together
toggle 1 2
toggling
tolerance 1 2 3 4
tool 1 2
toolbar 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
toolbars
tools
top
topological
topologically
topology
total
toward


>> + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf12.htm b/doc/salome/gui/SMESH/whgdata/whlstf12.htm index eba1f809a..33daac708 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf12.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf12.htm @@ -1,42 +1,47 @@ - - -Search Words List - - - - - - - -

<<

-

-your 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
-

-z 1 2
zero


- - - - + + +Search Words List + + + + + + + +

<<

+

+transformation 1 2 3 4 5
transformed
transforming
translate 1 2
translated
translateobject
translation 1 2
transparency 1 2
transparent
tri_mesh
tria
tria_mesh
triangle 1 2 3 4 5 6 7 8 9 10
triangle_mefisto
triangles 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
triangular 1 2
triangulation
trias 1 2
trihedron
tritoquad
trying
tt
tui 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
two 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
type 1 2 3 4 5 6 7 8 9 10 11 12
types 1 2 3 4 5
typically
+

+u 1 2
unary
unassigning
uniform
union 1 2 3 4
uniongroups
unite 1 2 3 4
united 1 2
uniting 1 2 3
unless
unv
up 1 2 3
update
updated 1 2
updateobjbrowser 1 2 3 4 5 6 7
uploaded
usage
used 1 2 3 4 5 6 7 8 9 10 11 12 13
useful 1 2 3 4
user 1 2 3 4
uses
using 1 2 3 4 5 6 7 8
usually 1 2
+

+v
value 1 2 3 4 5 6 7 8 9 10
values 1 2 3 4 5 6
varies
various
ve
vector 1 2 3 4 5 6 7 8 9 10
vertex 1 2
vertices 1 2 3
very 1 2
via 1 2 3
view 1 2 3
viewer 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
viewing 1 2
views
visible
visual
visualize
vk
volume 1 2 3 4 5 6 7 8 9 10 11
volumes 1 2 3 4 5 6 7 8 9 10 11
vtk 1 2
vxy 1 2 3
+

+walking
warp 1 2
warping 1 2 3 4 5 6
way 1 2 3 4 5 6 7 8
ways 1 2
weighted
well
whether
while
white
whole 1 2 3 4 5 6 7 8
whose 1 2 3 4 5


>> + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf13.htm b/doc/salome/gui/SMESH/whgdata/whlstf13.htm index 8275a922c..591da7bac 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf13.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf13.htm @@ -1,46 +1,46 @@ - - -Search Words List - - - - - - - -

<<

-

-will 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
window
wire 1 2 3 4 5 6 7
wire_discretisation
wireframe 1 2 3
wires
wish 1 2 3 4
within 1 2 3
without 1 2
words
work
works
worst
would 1 2
ww
-

-x 1 2 3
x0
-

-y 1 2
y0
your 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
-

-z 1 2
z0
zero
zoom


- - - - + + +Search Words List + + + + + + + +

<<

+

+will 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
window
wire 1 2 3 4 5 6 7
wire_discretisation
wireframe 1 2 3
wires
wish 1 2 3 4
within 1 2 3
without 1 2
words
work
works
worst
would 1 2
ww
+

+x 1 2 3
x0
+

+y 1 2
y0
your 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
+

+z 1 2
z0
zero
zoom


+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf2.htm b/doc/salome/gui/SMESH/whgdata/whlstf2.htm index 72a955e1f..04d1e8ba8 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf2.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf2.htm @@ -1,43 +1,41 @@ - - -Search Words List - - - - - - - -

<<

-

-co
coincident
color
colored 1 2 3 4 5 6 7 8
coloring
colors
combine 1 2
combining
common 1 2 3
compare
component 1 2
compose 1 2 3 4
composed 1 2
composing 1 2 3 4 5 6 7
compound 1 2 3
computation 1 2
compute 1 2 3 4 5 6 7 8
computed 1 2
computes
computing 1 2 3
concepts
conditions
confirm 1 2 3 4 5 6 7
confirmation
conform 1 2 3 4
connect
connected 1 2
connecting
connection 1 2 3 4 5
connections 1 2 3
connectivity
consider
considered 1 2
consisting 1 2 3 4 5 6 7 8 9
consists 1 2 3 4 5 6 7 8 9
console
constant
construct 1 2 3 4
constructed 1 2 3 4
constructing 1 2 3
construction 1 2 3 4
contain 1 2 3 4 5 6
containing 1 2 3
contains 1 2 3 4 5 6
contents
continues
contour 1 2
contrast
control 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
controls 1 2 3 4 5 6 7 8 9 10 11 12
converge
coordinates 1 2 3 4
copy 1 2 3 4 5
corner
corners 1 2 3
corresponding 1 2 3 4 5 6 7
could 1 2
counterclockwise
counting
course
create 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
createanddisplaygo
createarea 1 2
createaspectratio
createaspectratio3d
created 1 2 3 4 5 6
createequalto 1 2
createfilter 1 2
createfiltermanager 1 2 3
createfreeborders
createfreeedges
creategroup 1 2 3
creategroupfromgeom
createhypothesis 1 2 3 4 5
createlength
createlength2d
createlessthan 1 2
createmesh 1 2 3 4 5
createminimumangle 1 2
createmorethan 1 2
createmulticonnection
createmulticonnection2d
creates 1 2 3
createskew
createtaper
createwarping
creating 1 2 3 4
creation 1 2 3 4 5 6
criteria 1 2
criterion 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
cross 1 2 3
cubic
current 1 2 3 4
currently 1 2 3
curve 1 2
curvilinear 1 2
cut 1 2 3 4 5 6 7
cutgroups
cutted
cutting 1 2
-

-d
dealing
default 1 2 3 4 5 6 7
define 1 2 3 4 5 6 7 8 9 10 11
defined 1 2 3 4 5
defining 1 2 3
definite 1 2 3 4 5 6 7 8 9 10 11
definition 1 2 3
deflection 1 2 3
deflection1d
degrees
delete 1 2 3
deleted 1 2
deletediag
deletes 1 2
deleting
deletion 1 2 3
density
depending 1 2 3
depends 1 2 3
describe
described 1 2 3
describes
description
desirable
desktop
destined 1 2 3
detail
detect


>> - - - - - + + +Search Words List + + + + + + + +

<<

+

+circle 1 2 3
circlemesh 1 2
clear
click 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
clicking 1 2 3 4 5 6 7
clipping 1 2
close 1 2
closed 1 2
closer
co
coarse
coincident 1 2
coincides
color 1 2 3
colored 1 2 3 4 5 6 7 8 9 10
coloring
colors 1 2
combine 1 2 3
combining
common 1 2 3
compare 1 2
completely
complex
component 1 2
compose 1 2 3 4
composed 1 2
composing 1 2 3 4 5 6 7
compound 1 2
computation 1 2 3 4 5
compute 1 2 3 4 5 6 7 8 9
computed 1 2
computes
computing 1 2 3
concepts
conditions 1 2
confirm 1 2 3 4 5 6 7
confirmation
conform 1 2 3 4
conformity
connect
connected 1 2
connecting
connection 1 2 3 4 5
connections 1 2
connectivity
consider 1 2
considered 1 2 3 4
consist
consisting 1 2 3 4 5 6 7 8 9
consists 1 2 3 4 5 6 7 8 9
console
constant
construct 1 2 3 4
constructed 1 2 3 4
constructing 1 2 3
construction 1 2 3 4
contain 1 2 3 4 5 6
containing 1 2 3
contains 1 2 3 4 5 6 7
contents 1 2
continues
contour 1 2
contrast
control 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
controls 1 2 3 4 5 6 7 8 9 10 11 12 13 14
converge
conversion
coordinate
coordinates 1 2 3 4 5
copy 1 2 3 4 5
corner 1 2
corners 1 2 3
corresponding 1 2 3 4 5 6 7 8 9
cos
cosal
could 1 2
counterclockwise
counting
course
create 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
createanddisplaygo
createarea 1 2
createaspectratio
createaspectratio3d
created 1 2 3 4 5 6 7
createequalto 1 2
createfilter 1 2
createfiltermanager 1 2 3
createfreeborders
createfreeedges
creategroup 1 2 3
creategroupfromgeom
createhypothesis 1 2 3 4 5 6
createlength
createlength2d
createlessthan 1 2
createmesh 1 2 3 4 5 6
createminimumangle 1 2
createmorethan 1 2
createmulticonnection
createmulticonnection2d
creates 1 2 3
createskew
createtaper
createvolume3d
createwarping
creating 1 2 3 4 5
creation 1 2 3 4 5
criteria 1 2
criterion 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
cross 1 2 3


>> + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf3.htm b/doc/salome/gui/SMESH/whgdata/whlstf3.htm index 1fbec6fd1..ae0831898 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf3.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf3.htm @@ -1,43 +1,45 @@ - - -Search Words List - - - - - - - -

<<

-

-diagonal 1 2 3 4
dialog 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
difference 1 2
different 1 2 3 4 5
differently
differs
dimension 1 2 3 4 5
direct
directed
direction 1 2
directly 1 2
dirstruct 1 2
discretisation 1 2 3
discretization 1 2
discretized 1 2
displace
displaced
display 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
displayed 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
displaying
distance 1 2 3 4
distinguishes
distortion
distortions
distribution
divide
divided
does
domain
don 1 2 3
done
-

-e 1 2 3 4 5
easily
edge 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
edges 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
edgeslist
edgex111 1 2
edgex112 1 2
edgex121 1 2
edgex122 1 2
edgey11 1 2
edgey12 1 2
edgey21 1 2
edgey22 1 2
edgez111 1 2
edgez121 1 2
edgez211 1 2
edgez221 1 2
edit 1 2 3 4 5
editing 1 2 3
effect
either 1 2
element 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
elements 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
else 1 2
enables
enabling
encapsulate
encountered
end 1 2 3 4 5
ending 1 2
ends
enough
enter 1 2 3 4 5
entities 1 2
entity 1 2 3 4
equal 1 2 3 4 5 6
equally
equidistant
equilateral
erase
etc 1 2 3 4
evaluate
even
eventual
every
everything
example 1 2 3 4
exceed
exceeded
except
exist
existence
existing 1 2 3 4 5 6 7
export 1 2 3
exportation
exported
exporting
exportmed
extends
extremities
extruded 1 2 3
extrusion 1 2 3
extrusionalongpathobject
extrusionsweepobject


>> - - - - - + + +Search Words List + + + + + + + +

<<

+

+cubic
current 1 2 3 4
currently 1 2 3
curve 1 2 3
curvilinear 1 2
cut 1 2 3 4 5 6 7
cutgroups
cutting 1 2
cylinder
+

+d
dealing
def
default 1 2 3 4 5 6 7
define 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
defined 1 2 3 4 5 6 7
defining 1 2 3 4
definite 1 2 3 4 5 6 7 8 9 10 11
definition 1 2 3 4
deflection 1 2 3 4
deflection1d
deformed
degree
degrees
delete 1 2 3
deleted 1 2
deletediag
deletes
deleting
deletion 1 2
density
depending 1 2 3
depends 1 2 3
describe
described 1 2
describes
description
desirable
desktop
destined 1 2 3
detail
detailed
detect
dh
diagonal 1 2 3 4
dialog 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
diameter
differ
difference 1 2
different 1 2 3 4 5
differently
differs
dimension 1 2 3 4 5 6
direct
directed
direction 1 2
directly
dirstruct 1 2
discretisation 1 2
discretization 1 2
discretized 1 2
displace
displaced
display 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
displayed 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
displaying
distance 1 2 3 4 5
distinguishes
distortion
distortions
distribution
divide
divided
does
domain
don 1 2 3 4
double
downward
dr
drag
drawn
dump 1 2
dx
dy
+

+e 1 2 3 4 5 6 7
easily
edge 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
edges 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
edgeslist
edgex111 1 2
edgex112 1 2
edgex121 1 2
edgex122 1 2
edgey11 1 2
edgey12 1 2
edgey21 1 2
edgey22 1 2
edgez111 1 2
edgez121 1 2
edgez211 1 2
edgez221 1 2
edit 1 2 3 4 5
editing 1 2 3


>> + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf4.htm b/doc/salome/gui/SMESH/whgdata/whlstf4.htm index 17d2c171e..ed628ead1 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf4.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf4.htm @@ -1,47 +1,43 @@ - - -Search Words List - - - - - - - -

<<

-

- - -f 1 2
face 1 2 3 4 5 6 7 8 9 10 11 12 13 14
face1 1 2
facelist
faces 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
facesrotate
facessmooth
facestritoquad
facex11 1 2
facex21 1 2
facey111 1 2
facey121 1 2
facez11 1 2
facez12 1 2
factor
factoryserver 1 2 3 4 5
far
fashion
faster
field 1 2 3 4 5 6 7
fields 1 2 3 4 5 6 7 8
fifth
file 1 2 3
files
fill 1 2
filter 1 2 3 4 5
filters 1 2
find 1 2 3
findcoincidentnodes
findorloadcomponent 1 2 3 4 5
finds
first 1 2 3 4 5
fixed 1 2 3 4 5 6
flag
folder 1 2
following 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
follows 1 2 3 4 5 6 7
format 1 2
formed
forming 1 2
forms
formula 1 2
formulas
four 1 2
free 1 2 3 4 5 6 7 8 9
functionalities
functionality 1 2 3 4
functions
-

-generate 1 2 3 4 5
generated 1 2 3 4 5
generation 1 2 3
geom 1 2 3
geometric 1 2 3
geometrical 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
geometry 1 2 3
geompy 1 2 3 4 5 6 7
get 1 2 3 4 5
getelementsid 1 2
getid 1 2 3
getlistofid
getmaxelementarea 1 2 3
getmaxelementvolume 1 2 3
getmesh 1 2
getmesheditor 1 2 3
getname 1 2 3
getnumberofsegments 1 2 3
getting
gg
given 1 2 3 4
gives 1 2
good
got
green
group 1 2 3 4 5 6 7 8 9 10 11 12 13 14
group1
group12
group12a
group12b
group2
grouping 1 2
grouprotate
groups 1 2 3 4 5 6 7 8 9
groupsmooth
groupsofnodes
grouptritoquad
-

-h
h1
h2
half
halves
having 1 2
height 1 2
helical
help
hence
here 1 2
hexa 1 2 3
hexa_3d
hexa3d
hexagon
hexahedral 1 2 3
hexahedralization
hexahedrical 1 2 3
hexahedron 1 2 3 4 5 6
hexahedrons 1 2 3 4


>> - - - - - + + +Search Words List + + + + + + + +

<<

+

+effect
either 1 2
element 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
elements 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
else 1 2 3 4
enables
enabling
encapsulate
encountered
end 1 2 3 4 5 6
ending 1 2
ends
enough
enter 1 2 3 4 5
entities 1 2
entity 1 2 3 4
equal 1 2 3 4 5 6
equally
equidistant
equilateral
erase
etc 1 2 3 4
even 1 2
eventual
every
everything
example 1 2 3 4 5 6
exceed
exceeded
except 1 2
exist
existence
existing 1 2 3 4 5 6 7
exponent
export 1 2 3
exportation
exported
exporting
exportmed
exports 1 2
extended
extends
extremely
extremities
extruded 1 2 3 4
extrusion 1 2 3 4
extrusionalongpathobject 1 2
extrusionsweepobject
+

+f 1 2
face 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
face_1
face_2
face1 1 2 3
facelist
faces 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
facesrotate
facessmooth
facestritoquad
facex11 1 2
facex21 1 2
facey111 1 2
facey121 1 2
facez11 1 2
facez12 1 2
factor 1 2
factoryserver 1 2 3 4 5 6
failed
far
fashion
faster
feature
field 1 2 3 4 5 6 7 8
fields 1 2 3 4 5 6 7
fifth
file 1 2 3
files
fill 1 2 3
filter 1 2 3 4 5
filters 1 2
find 1 2 3
findcoincidentnodes
findorloadcomponent 1 2 3 4 5 6
finds
fine
fineness
first 1 2 3 4 5 6 7 8
fit
five
fixed 1 2 3 4 5
flag
folder 1 2
following 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
follows 1 2 3 4 5 6
font
format 1 2 3 4
formed 1 2
forming 1 2
forms
formula 1 2 3
four 1 2 3
fourth


>> + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf5.htm b/doc/salome/gui/SMESH/whgdata/whlstf5.htm index 062e145bc..04a0271e8 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf5.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf5.htm @@ -1,49 +1,47 @@ - - -Search Words List - - - - - - - -

<<

-

-hide
higher
highlighted 1 2 3 4
highlights 1 2 3 4
holds
holes
how 1 2
hyp
hyp1 1 2 3
hyp2 1 2 3
hyp3 1 2
hyp4 1 2
hyparea 1 2 3
hypnbseg 1 2 3
hypotheses 1 2 3 4 5 6 7 8
hypothesis 1 2 3 4 5 6 7 8 9 10 11 12 13
hypvolume 1 2 3
-

-i 1 2 3 4 5 6 7
icon 1 2 3
id 1 2 3 4 5 6 7 8 9 10 11 12
id_circle
id_face1 1 2
idbox 1 2 3 4 5
idcomp
idea
idedge 1 2
idface
ids 1 2 3 4 5 6 7 8
idtoobject 1 2 3 4
if 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
image
imply
import 1 2 3 4 5 6 7 8 9
importation
importcomponentgui 1 2 3 4
imported
importing
including 1 2
increasing 1 2 3
index
indicates
indices
info
information 1 2 3 4 5
infos 1 2 3
init 1 2 3 4
initial 1 2 3 4
initialize 1 2 3
input
insert
inserted
instead
intact
intended
interested
intermediate
internal
intersect
intersected
intersectgroups
intersection 1 2 3
intersects
introduce
introducing
introduction
inverse 1 2 3
inversediag
inversion 1 2
invisible
iso
isoline
isolines
isplanarface 1 2
item 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
iteration 1 2
iterations 1 2
iterative
-

-join
just 1 2
-

-k
keep 1 2 3
key
knowing
ko
-

-l
laplacian
largest
last 1 2
lastnodeid
lay
lays 1 2 3
lcc 1 2 3 4 5
learn 1 2
least 1 2
leave 1 2
left 1 2
legth
len 1 2
length 1 2 3 4 5 6 7 8 9 10 11 12 13 14
lengthfromedges
less 1 2 3
let
level 1 2
libnetgenengine
library 1 2
libstdmeshersengine 1 2 3 4 5
like 1 2 3 4 5
limit
limited 1 2
line 1 2 3
lines 1 2 3 4
link
linked
links
list 1 2 3 4 5 6 7
listed
lists


>> - - - - - + + +Search Words List + + + + + + + +

<<

+

+frame
free 1 2 3 4 5 6 7 8 9
functionalities
functionality 1 2 3 4 5 6
functions
future
+

+g
gauss
generate 1 2 3 4 5
generated 1 2 3 4 5
generation 1 2 3
geom 1 2 3 4
geometric 1 2 3
geometrical 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
geometry 1 2 3 4 5
geompy 1 2 3 4 5 6 7
get 1 2 3 4 5 6
getalgorithm
getborders
getelementsid 1 2
geterrorcode
getid
getlistofid
getmaxelementarea 1 2
getmaxelementvolume 1 2
getmesh 1 2
getmesheditor 1 2 3
getname 1 2
getnumberofsegments 1 2
getpattern
getting
gg
given 1 2 3
gives 1 2
global
going
good
got
graduate
graduated
graphically
great
greater
greatest 1 2
green
group 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
group1
group12
group12a
group12b
group2
grouping 1 2
grouprotate
groups 1 2 3 4 5 6 7 8 9 10
groupsmooth
groupsofnodes
grouptritoquad
+

+h
half 1 2
halves
having 1 2 3 4
hedron
height
helical
help
hence
here
hexa 1 2
hexa_3d
hexa3d
hexagon
hexahedral 1 2 3
hexahedralization
hexahedrical 1 2
hexahedron 1 2 3 4 5 6
hexahedrons 1 2 3 4
hh
hide 1 2
hides
hiding
higher
highlighted 1 2 3 4
highlights 1 2 3 4
hmax
holds
holes
how 1 2
hyp
hyp1 1 2 3
hyp2 1 2 3
hyp3 1 2
hyp4 1 2
hyparea 1 2
hypnbseg 1 2 3
hypotheses 1 2 3 4 5 6 7 8 9 10 11
hypothesis 1 2 3 4 5 6 7 8 9 10 11 12
hypvolume 1 2
+

+i 1 2 3 4 5 6 7 8 9
icon 1 2 3
id 1 2 3 4 5 6 7 8 9 10 11 12
id_arc
id_circle 1 2
id_face
id_face1 1 2 3
idbox 1 2 3 4 5
idcomp
idea
idedge 1 2
idface
ids 1 2 3 4 5 6 7 8
idtoobject 1 2 3 4


>> + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf6.htm b/doc/salome/gui/SMESH/whgdata/whlstf6.htm index 50564f773..1ed1a07e2 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf6.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf6.htm @@ -1,45 +1,49 @@ - - -Search Words List - - - - - - - -

<<

-

-lk
ll
load 1 2
local 1 2 3 4 5 6 7
locallength
locally 1 2
located 1 2
location 1 2 3 4
locations 1 2
longest
look
looking
looks
lower
lying
-

-main 1 2 3 4 5 6 7 8 9
makearc 1 2
makebox 1 2 3 4 5 6
makecirclethreepnt
makecompound 1 2 3 4
makecylinderrh
makeedge 1 2
makeface 1 2
makefaces
makehexa 1 2
makequad 1 2
makesketcher
makevector 1 2
makevertex 1 2 3
makewire 1 2
manage
managed
manually 1 2
mapped
mapping
mass
math 1 2
max 1 2 3 4 5
maxelementarea 1 2 3 4 5 6
maxelementarea_500 1 2
maxelementarea_800
maxelementvolume 1 2 3
maxelementvolume_500 1 2
maxelementvolume_900
maximum 1 2 3 4 5 6
meaning
meaningful
measured
meet 1 2
mefisto_2d 1 2 3 4
mefisto2d 1 2
menu 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
menus
merge 1 2 3
merged
mergenodes
merges
merging 1 2 3
mesh 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
mesh_1
mesh_borders_at_multi
mesh_freebord
meshbox 1 2 3
meshed 1 2 3
mesher
meshes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
meshing 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
meshmed
method
methods
minimum 1 2 3 4 5 6 7
mirrored
mirrorobject
mode 1 2
model
models
modes
modification 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
modify 1 2 3 4
modifying
module 1 2 3 4
mouse
move 1 2
movenode
moving 1 2 3
mport
multi 1 2 3 4 5
multiconnection
multiplied
must 1 2 3 4 5
mystudy 1 2 3
mystudyid 1 2 3 4
-

-n 1 2


>> - - - - - + + +Search Words List + + + + + + + +

<<

+

+if 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
ii
image 1 2 3
imply
import 1 2 3 4 5 6 7 8 9
importation
importcomponentgui 1 2 3
imported
importing
including 1 2
increasing 1 2 3
index 1 2
indicates
indices
info
information 1 2 3 4 5
infos 1 2 3
init 1 2 3
init_geom
initial 1 2 3 4
initialize 1 2 3
input 1 2
inscribed
insert
inserted
instead 1 2
intact
integer
intended
interested
intermediate
internal
intersect
intersected
intersectgroups
intersection 1 2 3
intersects
introduce
introduces
introducing
introduction
inverse 1 2 3
inversediag
inversion 1 2
invisible
isdone
iso
isoline
isolines
isometric
isplanarface 1 2 3
item 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
iteration 1 2
iterations 1 2
iterative
+

+join
jpeg 1 2
jpg 1 2
just 1 2 3
+

+k 1 2
keep 1 2 3
key
keyboard
knowing
ko
+

+l
labels
laplacian
last 1 2 3 4
lastnodeid
lay
lays 1 2 3
lcc 1 2 3 4 5 6
learn
least 1 2
leave 1 2
left 1 2 3 4
legth
len 1 2
length 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
lengthfromedges 1 2 3
less 1 2 3
let
level 1 2
libnetgenengine
library 1 2
libstdmeshersengine 1 2 3 4 5 6
like 1 2 3 4
limit
limited 1 2
line 1 2 3 4
lines 1 2 3 4 5
link
linked
links
list 1 2 3 4 5 6 7
listed 1 2
lists
lk
ll
load 1 2
loadfromface
local 1 2 3 4 5
locallength
locally 1 2
located 1 2
location 1 2 3 4
locations 1 2
lock 1 2
locking
longest
look
looking
looks
low
lower
lying
+

+main 1 2 3 4 5 6 7 8 9
makearc 1 2 3
makebox 1 2 3 4 5 6
makeboxdxdydz
makecirclethreepnt 1 2
makecompound 1 2 3 4
makecylinderrh 1 2
makeedge 1 2
makeface 1 2 3
makefaces
makehexa 1 2
makemesh
makepolygon
makequad 1 2
makesketcher
makevector 1 2 3
makevertex 1 2 3 4
makewire 1 2 3
manage
managed
manually 1 2
mapped
mapping 1 2 3
marked
marks
mass
math 1 2
max 1 2 3 4 5 6
max_element_area
maxelementarea 1 2 3 4 5
maxelementarea_500
maxelementarea_800
maxelementvolume 1 2
maxelementvolume_500
maxelementvolume_900
maximum 1 2 3 4 5 6 7


>> + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf7.htm b/doc/salome/gui/SMESH/whgdata/whlstf7.htm index fd6f6ffcf..b4c892050 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf7.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf7.htm @@ -1,45 +1,43 @@ - - -Search Words List - - - - - - - -

<<

-

-name 1 2 3 4 5 6 7 8 9
names
nb 1 2
nbedges
nbfaces
nbhexas
nbnodes 1 2
nbpolygons
nbpolyhedrons
nbprisms
nbpyramids
nbquadrangles
nbtetras
nbtriangles
nbvolumes
necessary
need
needed
neighboring 1 2
netgen
netgen_3d
netgen3d
netgenplugin
new 1 2 3 4 5 6 7 8 9
next 1 2 3
nodal 1 2
node 1 2 3 4 5 6 7 8 9 10
nodes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
none
normal 1 2
note 1 2 3 4
notice
now 1 2 3
number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
numbering 1 2
numberofsegments 1 2 3 4 5 6 7
numberofsegments_10 1 2 3
numbers 1 2
numerical
-

-obey
object 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
objects 1 2 3 4 5 6 7 8
objecttoid 1 2 3 4
objet
oblique
obtain 1 2
ok 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
once
one 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
ones 1 2 3
onto 1 2
opaque
operate
operation 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
operations 1 2 3
opposite 1 2 3 4 5 6 7 8 9
optional 1 2
options 1 2 3
order 1 2 3
orientation 1 2 3 4
origin
others
otherwise
our
outlined
outside
own
-

-page
pairs
parameter 1 2 3 4
parameters 1 2 3 4 5 6
parametric 1 2
part 1 2
particularity
path 1 2 3
pattern
pattern_name
patterns
pentahedron
pentahedrons
perfect
perform 1 2 3 4
performing
pi 1 2
picture 1 2 3 4 5
place
placed
planar
plane 1 2 3 4 5
planes
platform 1 2
please
plus 1 2


>> - - - - - + + +Search Words List + + + + + + + +

<<

+

+meaning
meaningful
measured
meet 1 2
mefisto_2d 1 2 3 4
mefisto2d 1 2
menu 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
menus
merge 1 2 3 4
merged 1 2
mergeequalelements
mergenodes
merges
merging 1 2 3 4
mesh 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
mesh_1 1 2
mesh_2
mesh_borders_at_multi
mesh_freebord
meshbox 1 2
meshed 1 2 3 4 5 6 7 8
mesheditor
mesher
meshes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
meshing 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
meshmed
method 1 2
methods
middle 1 2
minimum 1 2 3 4 5 6 7 8
mirrored
mirrorobject
mode 1 2 3
model
models
modes
modification 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
modify 1 2 3 4
modifying
module 1 2 3 4 5 6 7 8
modules
mouse 1 2 3
move 1 2
movenode
moving 1 2
multi 1 2 3 4 5
multiconnection
must 1 2 3 4 5
myelemid
mypnt1
mypnt2
mystudy 1 2 3 4
mystudyid 1 2 3
+

+n 1 2
name 1 2 3 4 5 6 7 8 9 10 11
names 1 2
nb 1 2
nb_segments_1
nb_vert
nbedges 1 2
nbfaces
nbhexas
nbnodes 1 2 3
nbpolygons
nbpolyhedrons
nbprisms
nbpyramids
nbquadrangles 1 2
nbtetras
nbtriangles 1 2
nbvolumes 1 2
necessary
need
negative
neighboring 1 2
netgen
netgen_3d
netgen3d
netgenplugin
new 1 2 3 4 5 6 7 8 9 10
next 1 2
nodal 1 2
node 1 2 3 4 5 6 7 8 9 10 11 12
node_ids
node_start_id
nodes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
none
normal 1 2
normalisation
note 1 2 3 4 5
nothing
notice
now 1 2 3 4


>> + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf8.htm b/doc/salome/gui/SMESH/whgdata/whlstf8.htm index 84e5db924..536f7e166 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf8.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf8.htm @@ -1,45 +1,45 @@ - - -Search Words List - - - - - - - -

<<

-

-point 1 2 3 4 5 6 7 8 9 10
point111 1 2
point112 1 2
point121 1 2
point122 1 2
point211 1 2
point212 1 2
point221 1 2
point222 1 2
points 1 2 3 4 5 6 7
pointstruct 1 2
polygon
polygons 1 2
polyhedral
polyhedron
polyhedrons 1 2
pop 1 2 3
position 1 2
positions
possess
possibility
possible 1 2 3 4
powerful
precision
preferences
prefixed
present
presentation 1 2
presented
preserved
preset
press
pressed 1 2
pressing
preview 1 2 3 4 5
previous 1 2
previously 1 2 3 4
principle
print 1 2 3 4 5 6
prisms
probleme 1 2 3
procedure 1 2
proceed 1 2
proceeds
process
produce
produced
produces 1 2 3
product
program 1 2
progression
projected
projecting
projection 1 2
propagate 1 2
propagatea
propagates 1 2 3
propagation 1 2 3 4 5 6
provide
pseudo
pulls
px 1 2
px1
py 1 2
py1
pyramidal
pyramids
python
pz 1 2
pz1
-

-qi
qk
quad 1 2
quad2d 1 2
quadrangle 1 2 3 4 5 6 7 8 9 10 11
quadrangle_2d 1 2
quadrangles 1 2 3 4 5 6 7 8 9 10 11
quadrangular 1 2 3 4 5
quadtotri
quality 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
quantity
-

-radio 1 2 3 4 5 6 7
range 1 2
ratio 1 2 3 4 5 6 7 8
ready
recent
red
reduce
reevaluated
reference 1 2 3 4
references 1 2
refers
refined
reflects 1 2
refreshes
regular_1d 1 2 3 4 5
regular1d 1 2 3
related
relations
relationship
relationships
remaining
remove 1 2 3 4 5 6 7 8 9 10 11 12
removeelements 1 2
removehypothesis 1 2
removenodes
removes
removing 1 2 3
renumber
renumbering 1 2
renumbernodes
reoriented
repeated
replaced
represent 1 2
representation
representations
represented
represents 1 2
required 1 2 3
resembles
respect
rest 1 2
restricted
result 1 2 3 4 5
resulting 1 2 3
results 1 2
ret 1 2 3
retained
retrieve
returns
reverse
reverting
revolution 1 2 3
revolved


>> - - - - - + + +Search Words List + + + + + + + +

<<

+

+number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
numbering 1 2
numberofsegments 1 2 3 4 5 6 7
numberofsegments_10
numberofsegments_7
numbers 1 2 3
numeric
numerical
+

+obey
object 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
objects 1 2 3 4 5 6 7 8 9
objecttoid 1 2 3
objet
oblique
obtain
offset
ok 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
once
one 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
ones 1 2 3 4
onto 1 2
oo
opaque
operate
operation 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
operations 1 2 3
opposite 1 2 3 4 5 6 7 8 9 10
option
optional 1 2
options 1 2 3 4
order 1 2 3
ordinary 1 2
orientate
orientation 1 2 3 4 5
origin
others
otherwise 1 2
our
out
outlined
outside
own
+

+page 1 2
pairs
panning
parameter 1 2 3 4 5
parameters 1 2 3 4 5 6 7
parametric 1 2
parent
part 1 2
particular
particularity
parts
pass
path 1 2 3 4
pattern 1 2
pattern_name
patterns
pentahedron
pentahedrons
perform 1 2 3 4
performing
perimeter
pi 1 2
picture 1 2 3 4 5 6
place 1 2
placed
planar
plane 1 2 3 4
planes
platform 1 2
please
plot
plus 1 2
png 1 2
point 1 2 3 4 5 6 7 8 9 10 11
point111 1 2
point112 1 2
point121 1 2
point122 1 2
point211 1 2
point212 1 2
point221 1 2
point222 1 2
points 1 2 3 4 5 6 7 8 9
pointstruct 1 2
polygon 1 2
polygonal
polygons 1 2 3
polyhedral 1 2
polyhedron 1 2
polyhedrons 1 2
pop 1 2
position 1 2 3
positions
possess
possibility
possible 1 2 3 4
post
powerful


>> + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstf9.htm b/doc/salome/gui/SMESH/whgdata/whlstf9.htm index 5287461a8..8b8cc4f22 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstf9.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstf9.htm @@ -1,43 +1,45 @@ - - -Search Words List - - - - - - - -

<<

-

-right 1 2 3 4 5 6 7 8
rotate 1 2 3
rotated 1 2 3 4
rotateobject
rotation 1 2 3 4 5
rotationsweepobject
rough
rule 1 2
rules
running
-

-s 1 2
salome 1 2 3 4 5 6 7 8 9 10
same 1 2 3 4 5 6 7 8 9 10 11
sample 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
save
scalar
scale
script 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
scripts 1 2
seam
search 1 2
second 1 2
section 1 2 3
sections 1 2
see 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
segment 1 2 3 4 5
segments 1 2 3 4 5 6 7 8
select 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
selected 1 2 3 4 5 6 7 8 9 10
selecting 1 2 3 4 5 6 7 8 9
selection 1 2 3 4 5 6 7
sense
separated
sequence
sequences
session
set 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
setcurrentstudy 1 2 3
setdisplaymode
setlength 1 2
setmargin 1 2
setmaxelementarea 1 2 3 4 5
setmaxelementvolume 1 2 3
setname 1 2 3 4
setnumberofsegments 1 2 3 4 5
setnumfunctor 1 2
setpredicate 1 2
sets
setting 1 2 3 4
settings
settransparency
sew 1 2 3
sewbordertoside
sewconformfreeborders
sewfreeborders
sewing 1 2
sewsideelements
sg 1 2 3 4 5 6 7
shading 1 2
shall 1 2 3 4 5 6 7 8 9 10 11 12
shape 1 2 3 4 5 6
shapes
shapetype 1 2 3 4 5
shift 1 2 3
shortest 1 2
should 1 2 3 4 5 6 7 8 9 10 11
show 1 2
showing
shown 1 2
shows
shrink


>> - - - - - + + +Search Words List + + + + + + + +

<<

+

+precision
preference 1 2 3
preferences
prefixed
preprocessing
present
presentation 1 2
presentations
presented
presents
preserved
preset
pressed 1 2 3 4
pressing
preview 1 2 3 4 5
previous 1 2
previously 1 2 3 4
principle
print 1 2 3 4 5 6 7
prisms
pro
probleme 1 2 3
procedure
proceed 1 2
proceeds
process
produce
produced
produces 1 2 3
product
program
progression
projected
projecting
projection 1 2
prompts
propagate 1 2
propagates 1 2 3
propagation 1 2 3 4 5 6
properties
provide
provides 1 2
pseudo
pulls
px 1 2 3
px1 1 2
py 1 2 3
py1 1 2
pyramidal
pyramids
python
pz 1 2 3
pz1 1 2
+

+qi
qk 1 2
quad 1 2
quad2d 1 2
quadrangle 1 2 3 4 5 6 7 8 9 10 11 12 13 14
quadrangle_2d 1 2
quadrangles 1 2 3 4 5 6 7 8 9 10 11 12
quadrangular 1 2 3 4 5 6
quadratic 1 2 3
quadtotri
quality 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
quantity
+

+r1
radio 1 2 3 4 5 6 7
radius 1 2
range 1 2 3
ranges
ranging 1 2
ratio 1 2 3 4 5 6 7 8
ready
recent
red
redefine 1 2
reduce
reevaluated
reference 1 2 3 4
references 1 2
refers
refined
reflects 1 2 3
refreshes
regular
regular_1d 1 2 3 4 5
regular1d 1 2 3
related
relations
relationship
relationships
remote
removal
remove 1 2 3 4 5 6 7 8 9 10 11 12
removeelements 1 2
removehypothesis 1 2
removenodes
removes
removing 1 2 3
renumber
renumbering 1 2
renumbernodes
reorient
reoriented
replaced
represent 1 2
representation
representations
represented 1 2
representing
represents 1 2 3 4
required 1 2 3
reset
resizes
respect
respective
rest 1 2
restores
restricted
result 1 2 3 4 5
resulting 1 2 3
results 1 2
ret 1 2 3
retrieve
return
returns
reveals
reverse 1 2
reverses
reverting
revolution 1 2 3
revolved


>> + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl0.htm b/doc/salome/gui/SMESH/whgdata/whlstfl0.htm index 96e9afaab..db38e6123 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl0.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl0.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ {D {E {D {E {R {T ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ {D {E {D {E {R {X {T ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl1.htm b/doc/salome/gui/SMESH/whgdata/whlstfl1.htm index 5887b7f2d..c2a4482fc 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl1.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl1.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ AB AC AD AF AG AI AL AM AN AP AR AS AU AV AX ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ A AA AB AC AD AF AG AI AL AM AN AP AR AS AT AU AV AX ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl10.htm b/doc/salome/gui/SMESH/whgdata/whlstfl10.htm index dfd413347..c098d325e 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl10.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl10.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ JO JU ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ JO JP JU ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl11.htm b/doc/salome/gui/SMESH/whgdata/whlstfl11.htm index d3df6cf0d..a4b61af40 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl11.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl11.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ K KE KN KO ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ K KE KN KO ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl12.htm b/doc/salome/gui/SMESH/whgdata/whlstfl12.htm index e21d26ebe..3030e6e2f 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl12.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl12.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ L LA LC LE LI LK LL LO LY ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ L LA LC LE LI LK LL LO LY ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl13.htm b/doc/salome/gui/SMESH/whgdata/whlstfl13.htm index 0dc3c66ec..7a88bdbfd 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl13.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl13.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ MA ME MI MO MP MU MY ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ MA ME MI MO MU MY ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl14.htm b/doc/salome/gui/SMESH/whgdata/whlstfl14.htm index e350d8d85..a95f81ad0 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl14.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl14.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ N NA NB NE NO NU ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ N NA NB NE NO NU ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl15.htm b/doc/salome/gui/SMESH/whgdata/whlstfl15.htm index 0e43816be..22c113ba5 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl15.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl15.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ OB OK ON OP OR OT OU OW ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ OB OF OK ON OO OP OR OT OU OW ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl16.htm b/doc/salome/gui/SMESH/whgdata/whlstfl16.htm index 5548d7520..104e96624 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl16.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl16.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ PA PE PI PL PO PR PS PU PX PY PZ ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ PA PE PI PL PN PO PR PS PU PX PY PZ ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl17.htm b/doc/salome/gui/SMESH/whgdata/whlstfl17.htm index c1f802da9..4b829d95e 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl17.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl17.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ QI QK QU ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ QI QK QU ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl18.htm b/doc/salome/gui/SMESH/whgdata/whlstfl18.htm index d421e5f99..d88f02625 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl18.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl18.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ RA RE RI RO RU ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ R RA RE RI RO RR RU ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl19.htm b/doc/salome/gui/SMESH/whgdata/whlstfl19.htm index 9a900084a..0f9a64456 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl19.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl19.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ S SA SC SE SG SH SI SK SL SM SO SP ST SU SW SY ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ S SA SC SE SG SH SI SK SL SM SO SP SQ ST SU SW SY ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl2.htm b/doc/salome/gui/SMESH/whgdata/whlstfl2.htm index 3f1ebc933..a3520eb6d 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl2.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl2.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ BA BE BI BL BO BR BU ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ BA BE BI BL BM BO BR BU ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl20.htm b/doc/salome/gui/SMESH/whgdata/whlstfl20.htm index db8d0f9c2..9ecb3e66a 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl20.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl20.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ T TA TE TH TM TO TR TT TU TW TY ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ T TA TE TH TI TM TO TR TT TU TW TY ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl21.htm b/doc/salome/gui/SMESH/whgdata/whlstfl21.htm index 0115e00c7..1d1f4d32b 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl21.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl21.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ U UN UP US ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ U UN UP US ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl22.htm b/doc/salome/gui/SMESH/whgdata/whlstfl22.htm index deb26cc72..64fda2b25 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl22.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl22.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ V VA VE VI VO VX ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ V VA VE VI VK VO VT VX ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl23.htm b/doc/salome/gui/SMESH/whgdata/whlstfl23.htm index 404291137..e471bd527 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl23.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl23.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ WA WE WH WI WO WW ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ WA WE WH WI WO WW ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl24.htm b/doc/salome/gui/SMESH/whgdata/whlstfl24.htm index 2bee610ae..4b43a080d 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl24.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl24.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ Y YO ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ Y YO ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl25.htm b/doc/salome/gui/SMESH/whgdata/whlstfl25.htm index c486f0eb5..772d69deb 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl25.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl25.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ Z ZE ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ Z ZE ZO ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl3.htm b/doc/salome/gui/SMESH/whgdata/whlstfl3.htm index e397aa250..e8b36271e 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl3.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl3.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ CA CE CH CI CL CO CR CU ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ CA CE CH CI CL CO CR CU CY ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl4.htm b/doc/salome/gui/SMESH/whgdata/whlstfl4.htm index 77d8cf42d..f30ab155c 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl4.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl4.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ D DE DI DO ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ D DE DH DI DO DR DU DX DY ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl5.htm b/doc/salome/gui/SMESH/whgdata/whlstfl5.htm index 36c77c992..00bfc5ad6 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl5.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl5.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ E EA ED EF EI EL EN EQ ER ET EV EX ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ E EA ED EF EI EL EN EQ ER ET EV EX ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl6.htm b/doc/salome/gui/SMESH/whgdata/whlstfl6.htm index f6c4e8822..f3ca3ef9a 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl6.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl6.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ F FA FI FL FO FR FU ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ F FA FE FI FL FO FR FU ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl7.htm b/doc/salome/gui/SMESH/whgdata/whlstfl7.htm index 8e905ec46..8f2fe56a3 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl7.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl7.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ GE GG GI GO GR ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ G GA GE GG GI GL GO GR ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl8.htm b/doc/salome/gui/SMESH/whgdata/whlstfl8.htm index 3fa0c5689..d21d35916 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl8.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl8.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ H HA HE HI HO HY ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ H HA HE HH HI HM HO HY ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstfl9.htm b/doc/salome/gui/SMESH/whgdata/whlstfl9.htm index 0cd296c34..1885c47bd 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstfl9.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstfl9.htm @@ -1,45 +1,45 @@ - - -Search Words letter - - - - - - - - - -

^ I IC ID IF IM IN IS IT ^

- - - - - + + +Search Words letter + + + + + + + + + +

^ I IC ID IF II IM IN IS IT ^

+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstg0.htm b/doc/salome/gui/SMESH/whgdata/whlstg0.htm index a9d3f26ba..193fb7c67 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstg0.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstg0.htm @@ -1,75 +1,75 @@ - - -Glossary words list - - - - - - - -

Cell

-

Element of a mesh. Cells are determined by their connectivity. They can have 0,1,2 or 3 dimension.

-

Component

-

One integer or real value can correspond to each component of a field and to each entity of a mesh

-

Descendant connectivity

-

It is a description of the entities of the mesh with dimension N. This description is made by an ordered list of geometrical entities (nodes, edges, or faces) with dimension N-1.

-

Edge

-

An edge of a volumetric or surface mesh. It is composed of 2 or 3 nodes (2 vertex nodes and optionally one middle node).

-

Entity of a mesh

-

Geometrical component of the mesh: node, cell, face and edge. Faces and edges are only intermediate entities allowing to define the cells in descendant connectivity.

-

Equivalence

-

Equivalence represents a list of correspondance 2 by 2 of the entities of the same dimension.

-

Face

-

Face of a volumetrical cell (triangle, quadrangle).

-

Family

-

Entities of a mesh are described by a certain number  of characteristics (boundary conditions, groups membership). Families represent classes equivalent to these characteristics (two entities of a mesh can belong to the same family if they have the same characteristics). Every family is determined by a set of attributes and a list of groups membership.

-

Field

-

Field consists of one or several scalar components. One definite type is associated to the given field and the values corresponding to different components are all of the same type.

-

Field profile

-

Fields can be defined only on one part of the mesh. Profile  of the field or profile of the component of a field indicates which entities of the mesh contain values.

-

Group

-

Unordered set of entities of a mesh. One entity can belong to  several groups.

-

Mesh

-

Mesh is described by its geometry: list of nodes and list of cells which constitute this mesh. Supplementary information is added with the help of families (initial, boundary conditions).

-

Nodal connectivity

-

It is a description of an entity of the mesh by an ordered list of nodes constituting this entity.

-

Node

-

Node can be an isolated node of a mesh, a vertex or middle node of an edge. A node is associated to a point.

-

Point

-

Geometrical entity determined by its coordinates in the space.

-

Reference connectivity

-

For each type of entity of a mesh, reference connectivity define the topology of an entity.

-

Result

-

List of fields referring to one mesh.

-

Study

-

Study represents a chain of sequences of calculations.

-



- - - - - + + +Glossary words list + + + + + + + +

Cell

+

Element of a mesh. Cells are determined by their connectivity. They can have 0,1,2 or 3 dimension.

+

Component

+

One integer or real value can correspond to each component of a field and to each entity of a mesh

+

Descendant connectivity

+

It is a description of the entities of the mesh with dimension N. This description is made by an ordered list of geometrical entities (nodes, edges, or faces) with dimension N-1.

+

Edge

+

An edge of a volumetric or surface mesh. It is composed of 2 or 3 nodes (2 vertex nodes and optionally one middle node).

+

Entity of a mesh

+

Geometrical component of the mesh: node, cell, face and edge. Faces and edges are only intermediate entities allowing to define the cells in descendant connectivity.

+

Equivalence

+

Equivalence represents a list of correspondance 2 by 2 of the entities of the same dimension.

+

Face

+

Face of a volumetrical cell (triangle, quadrangle).

+

Family

+

Entities of a mesh are described by a certain number  of characteristics (boundary conditions, groups membership). Families represent classes equivalent to these characteristics (two entities of a mesh can belong to the same family if they have the same characteristics). Every family is determined by a set of attributes and a list of groups membership.

+

Field

+

Field consists of one or several scalar components. One definite type is associated to the given field and the values corresponding to different components are all of the same type.

+

Field profile

+

Fields can be defined only on one part of the mesh. Profile  of the field or profile of the component of a field indicates which entities of the mesh contain values.

+

Group

+

Unordered set of entities of a mesh. One entity can belong to  several groups.

+

Mesh

+

Mesh is described by its geometry: list of nodes and list of cells which constitute this mesh. Supplementary information is added with the help of families (initial, boundary conditions).

+

Nodal connectivity

+

It is a description of an entity of the mesh by an ordered list of nodes constituting this entity.

+

Node

+

Node can be an isolated node of a mesh, a vertex or middle node of an edge. A node is associated to a point.

+

Point

+

Geometrical entity determined by its coordinates in the space.

+

Reference connectivity

+

For each type of entity of a mesh, reference connectivity define the topology of an entity.

+

Result

+

List of fields referring to one mesh.

+

Study

+

Study represents a chain of sequences of calculations.

+



+ + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlsti0.htm b/doc/salome/gui/SMESH/whgdata/whlsti0.htm index a3aec907a..32e2c7fd9 100755 --- a/doc/salome/gui/SMESH/whgdata/whlsti0.htm +++ b/doc/salome/gui/SMESH/whgdata/whlsti0.htm @@ -1,39 +1,39 @@ - - - -Index words list - - - - - - - - - - - - + + + +Index words list + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstt0.htm b/doc/salome/gui/SMESH/whgdata/whlstt0.htm index d2f734bdd..cd467da7c 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstt0.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstt0.htm @@ -1,51 +1,51 @@ - - - -Content - - - - - - - - - - -
-

- MESH module
-

- -
-

-

- - - - + + + +Content + + + + + + + + + + +
+

+ MESH module
+

+ +
+

+

+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstt1.htm b/doc/salome/gui/SMESH/whgdata/whlstt1.htm index fe922823e..5d6bc46f4 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstt1.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstt1.htm @@ -1,59 +1,59 @@ - - - -Content - - - - - - - - - - -
-

- MESH module
-    Introduction to MESH
-    Running MESH module
-    Creating meshes
-    Viewing meshes
-    Quality controls
-    Grouping elements
-    Modifying meshes
-    TUI Scripts
-

- -
-

-

- - - - + + + +Content + + + + + + + + + + +
+

+ MESH module
+    Introduction to Mesh
+    Running MESH module
+    Creating meshes
+    Viewing meshes
+    Quality controls
+    Grouping elements
+    Modifying meshes
+    TUI Scripts
+

+ +
+

+

+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstt2.htm b/doc/salome/gui/SMESH/whgdata/whlstt2.htm index e0efee9af..b7afcda57 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstt2.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstt2.htm @@ -1,66 +1,66 @@ - - - -Content - - - - - - - - - - -
-

- MESH module
-    Introduction to MESH
-    Running MESH module
-    Creating meshes
-       About meshes
-       Importing and exporting meshes
-       Constructing meshes
-       Defining meshing algorithms
-       Defining hypotheses
-       Constructing submeshes
-       Editing Meshes
-    Viewing meshes
-    Quality controls
-    Grouping elements
-    Modifying meshes
-    TUI Scripts
-

- -
-

-

- - - - + + + +Content + + + + + + + + + + +
+

+ MESH module
+    Introduction to Mesh
+    Running MESH module
+    Creating meshes
+       About meshes
+       Importing and exporting meshes
+       Constructing meshes
+       Defining meshing algorithms
+       Defining hypotheses
+       Constructing submeshes
+       Editing Meshes
+    Viewing meshes
+    Quality controls
+    Grouping elements
+    Modifying meshes
+    TUI Scripts
+

+ +
+

+

+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstt3.htm b/doc/salome/gui/SMESH/whgdata/whlstt3.htm index 86348a194..ac6e4b465 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstt3.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstt3.htm @@ -1,71 +1,71 @@ - - - -Content - - - - - - - - - - -
-

- MESH module
-    Introduction to MESH
-    Running MESH module
-    Creating meshes
-       About meshes
-       Importing and exporting meshes
-       Constructing meshes
-       Defining meshing algorithms
-       Defining hypotheses
-          About Hypotheses
-          1D Meshing Hypotheses
-          Max Element Area hypothesis
-          Max Element Volume hypothesis
-          Additional Hypotheses
-       Constructing submeshes
-       Editing Meshes
-    Viewing meshes
-    Quality controls
-    Grouping elements
-    Modifying meshes
-    TUI Scripts
-

- -
-

-

- - - - + + + +Content + + + + + + + + + + +
+

+ MESH module
+    Introduction to Mesh
+    Running MESH module
+    Creating meshes
+       About meshes
+       Importing and exporting meshes
+       Constructing meshes
+       Defining meshing algorithms
+       Defining hypotheses
+          About Hypotheses
+          1D Meshing Hypotheses
+          2D Meshing Hypotheses
+          Max Element Volume hypothesis
+          Additional Hypotheses
+       Constructing submeshes
+       Editing Meshes
+    Viewing meshes
+    Quality controls
+    Grouping elements
+    Modifying meshes
+    TUI Scripts
+

+ +
+

+

+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstt4.htm b/doc/salome/gui/SMESH/whgdata/whlstt4.htm index d1c22f43b..4f265b629 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstt4.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstt4.htm @@ -1,66 +1,67 @@ - - - -Content - - - - - - - - - - -
-

- MESH module
-    Introduction to MESH
-    Running MESH module
-    Creating meshes
-    Viewing meshes
-       About viewing meshes
-       Mesh infos
-       Numbering
-       Display Mode
-       Display Entity
-       Transparency
-       Clipping
-    Quality controls
-    Grouping elements
-    Modifying meshes
-    TUI Scripts
-

- -
-

-

- - - - + + + +Content + + + + + + + + + + +
+

+ MESH module
+    Introduction to Mesh
+    Running MESH module
+    Creating meshes
+    Viewing meshes
+       Viewing meshes
+       VTK 3D Viewer
+       Mesh infos
+       Numbering
+       Display Mode
+       Display Entity
+       Transparency
+       Clipping
+    Quality controls
+    Grouping elements
+    Modifying meshes
+    TUI Scripts
+

+ +
+

+

+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstt5.htm b/doc/salome/gui/SMESH/whgdata/whlstt5.htm index cd1933f02..52771a655 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstt5.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstt5.htm @@ -1,73 +1,74 @@ - - - -Content - - - - - - - - - - -
-

- MESH module
-    Introduction to MESH
-    Running MESH module
-    Creating meshes
-    Viewing meshes
-    Quality controls
-       About quality controls
-       Free borders
-       Borders at multi-connection
-       Length
-       Free edges
-       Length 2D
-       Borders at multi-connection 2D
-       Area
-       Taper
-       Aspect ratio
-       Minimum angle
-       Warping
-       Skew
-       Aspect ratio 3D
-    Grouping elements
-    Modifying meshes
-    TUI Scripts
-

- -
-

-

- - - - + + + +Content + + + + + + + + + + +
+

+ MESH module
+    Introduction to Mesh
+    Running MESH module
+    Creating meshes
+    Viewing meshes
+    Quality controls
+       About quality controls
+       Free borders
+       Borders at multi-connection
+       Length
+       Free edges
+       Length 2D
+       Borders at multi-connection 2D
+       Area
+       Taper
+       Aspect ratio
+       Minimum angle
+       Warping
+       Skew
+       Aspect ratio 3D
+       Volume
+    Grouping elements
+    Modifying meshes
+    TUI Scripts
+

+ +
+

+

+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstt6.htm b/doc/salome/gui/SMESH/whgdata/whlstt6.htm index ec775d82f..4fc97717f 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstt6.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstt6.htm @@ -1,65 +1,65 @@ - - - -Content - - - - - - - - - - -
-

- MESH module
-    Introduction to MESH
-    Running MESH module
-    Creating meshes
-    Viewing meshes
-    Quality controls
-    Grouping elements
-       Creating groups
-       Editing groups
-       Using operations on groups
-       Constructing groups of specific elements
-       Deleting Groups
-       Selection filter library
-    Modifying meshes
-    TUI Scripts
-

- -
-

-

- - - - + + + +Content + + + + + + + + + + +
+

+ MESH module
+    Introduction to Mesh
+    Running MESH module
+    Creating meshes
+    Viewing meshes
+    Quality controls
+    Grouping elements
+       Creating groups
+       Editing groups
+       Using operations on groups
+       Constructing groups of specific elements
+       Deleting Groups
+       Selection filter library
+    Modifying meshes
+    TUI Scripts
+

+ +
+

+

+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstt7.htm b/doc/salome/gui/SMESH/whgdata/whlstt7.htm index ed5f4bbd7..fd900d801 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstt7.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstt7.htm @@ -1,74 +1,76 @@ - - - -Content - - - - - - - - - - -
-

- MESH module
-    Introduction to MESH
-    Running MESH module
-    Creating meshes
-    Viewing meshes
-    Quality controls
-    Grouping elements
-    Modifying meshes
-       Adding nodes and elements
-       Removing nodes and elements
-       Renumbering nodes and elements
-       Transforming meshes
-       Moving nodes
-       Diagonal inversion of elements
-       Uniting two triangles
-       Uniting a set of triangles
-       Changing orientation of elements
-       Cutting quadrangles
-       Smoothing
-       Extrusion
-       Extrusion along a path
-       Revolution
-       Pattern mapping
-    TUI Scripts
-

- -
-

-

- - - - + + + +Content + + + + + + + + + + +
+

+ MESH module
+    Introduction to Mesh
+    Running MESH module
+    Creating meshes
+    Viewing meshes
+    Quality controls
+    Grouping elements
+    Modifying meshes
+       Adding nodes and elements
+       Adding quadratic elements
+       Removing nodes and elements
+       Renumbering nodes and elements
+       Transforming meshes
+       Moving nodes
+       Diagonal inversion of elements
+       Uniting two triangles
+       Uniting a set of triangles
+       Changing orientation of elements
+       Cutting quadrangles
+       Smoothing
+       Extrusion
+       Extrusion along a path
+       Revolution
+       Pattern mapping
+    TUI Scripts
+       Access to Mesh module functionality from Python (using smesh.py)
+

+ +
+

+

+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstt8.htm b/doc/salome/gui/SMESH/whgdata/whlstt8.htm index b7eb512dd..9817ab956 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstt8.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstt8.htm @@ -1,79 +1,81 @@ - - - -Content - - - - - - - - - - -
-

- MESH module
-    Introduction to MESH
-    Running MESH module
-    Creating meshes
-    Viewing meshes
-    Quality controls
-    Grouping elements
-    Modifying meshes
-       Adding nodes and elements
-       Removing nodes and elements
-       Renumbering nodes and elements
-       Transforming meshes
-          Translation
-          Rotation
-          Symmetry
-          Sewing meshes
-          Merging nodes
-       Moving nodes
-       Diagonal inversion of elements
-       Uniting two triangles
-       Uniting a set of triangles
-       Changing orientation of elements
-       Cutting quadrangles
-       Smoothing
-       Extrusion
-       Extrusion along a path
-       Revolution
-       Pattern mapping
-    TUI Scripts
-

- -
-

-

- - - - + + + +Content + + + + + + + + + + +
+

+ MESH module
+    Introduction to Mesh
+    Running MESH module
+    Creating meshes
+    Viewing meshes
+    Quality controls
+    Grouping elements
+    Modifying meshes
+       Adding nodes and elements
+       Adding quadratic elements
+       Removing nodes and elements
+       Renumbering nodes and elements
+       Transforming meshes
+          Translation
+          Rotation
+          Symmetry
+          Sewing meshes
+          Merging nodes
+          Merging Elements
+       Moving nodes
+       Diagonal inversion of elements
+       Uniting two triangles
+       Uniting a set of triangles
+       Changing orientation of elements
+       Cutting quadrangles
+       Smoothing
+       Extrusion
+       Extrusion along a path
+       Revolution
+       Pattern mapping
+    TUI Scripts
+

+ +
+

+

+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whlstt9.htm b/doc/salome/gui/SMESH/whgdata/whlstt9.htm index 0167d9f7b..eb0cc3d36 100755 --- a/doc/salome/gui/SMESH/whgdata/whlstt9.htm +++ b/doc/salome/gui/SMESH/whgdata/whlstt9.htm @@ -1,66 +1,66 @@ - - - -Content - - - - - - - - - - -
-

- MESH module
-    Introduction to MESH
-    Running MESH module
-    Creating meshes
-    Viewing meshes
-    Quality controls
-    Grouping elements
-    Modifying meshes
-    TUI Scripts
-       Creating Meshes
-       Defining Hypotheses
-       Viewing Meshes
-       Quality Controls
-       Grouping Elements
-       Modifying Meshes
-       Transforming Meshes
-

- -
-

-

- - - - + + + +Content + + + + + + + + + + +
+

+ MESH module
+    Introduction to Mesh
+    Running MESH module
+    Creating meshes
+    Viewing meshes
+    Quality controls
+    Grouping elements
+    Modifying meshes
+    TUI Scripts
+       Creating Meshes
+       Defining Hypotheses
+       Viewing Meshes
+       Quality Controls
+       Grouping Elements
+       Modifying Meshes
+       Transforming Meshes
+

+ +
+

+

+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whnvf30.htm b/doc/salome/gui/SMESH/whgdata/whnvf30.htm index 33dae3be2..7cff7ce54 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvf30.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvf30.htm @@ -1,13 +1,13 @@ - - - -toc frame - - - - - - - - - + + + +toc frame + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whnvf31.htm b/doc/salome/gui/SMESH/whgdata/whnvf31.htm index a9128b803..91a985f9f 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvf31.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvf31.htm @@ -1,15 +1,15 @@ - - - -Index frame - - - - - - - - - - - + + + +Index frame + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whnvf32.htm b/doc/salome/gui/SMESH/whgdata/whnvf32.htm index ae872731a..bc2231fbf 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvf32.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvf32.htm @@ -1,15 +1,15 @@ - - - -search frame - - - - - - - - - - - + + + +search frame + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whnvf33.htm b/doc/salome/gui/SMESH/whgdata/whnvf33.htm index 9af2824d1..6c091d828 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvf33.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvf33.htm @@ -1,15 +1,15 @@ - - - -Glossary frame - - - - - - - - - - - + + + +Glossary frame + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whnvl31.htm b/doc/salome/gui/SMESH/whgdata/whnvl31.htm index 870e98ef4..e29abc01c 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvl31.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvl31.htm @@ -1,43 +1,43 @@ - - - -Index Letters - - - - - - - - - - - - + + + +Index Letters + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whgdata/whnvl32.htm b/doc/salome/gui/SMESH/whgdata/whnvl32.htm index 3b103a8b6..1f7176c6d 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvl32.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvl32.htm @@ -1,72 +1,72 @@ - - - -Search Letters - - - - - - - - -

- # - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z -

- - - - + + + +Search Letters + + + + + + + + +

+ # + A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z +

+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whnvl33.htm b/doc/salome/gui/SMESH/whgdata/whnvl33.htm index f3659d1c4..d6f20c33c 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvl33.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvl33.htm @@ -1,72 +1,72 @@ - - - -Glossary Letters - - - - - - - - -

- # - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z -

- - - - + + + +Glossary Letters + + + + + + + + +

+ # + A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z +

+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whnvp30.htm b/doc/salome/gui/SMESH/whgdata/whnvp30.htm index 1a8036de8..0c9cb814b 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvp30.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvp30.htm @@ -1,16 +1,16 @@ - - - - Content Navigation Pane - - - - - - - - - + + + + Content Navigation Pane + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whgdata/whnvp31.htm b/doc/salome/gui/SMESH/whgdata/whnvp31.htm index fa146f1f8..87921c0b7 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvp31.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvp31.htm @@ -1,16 +1,16 @@ - - - - Index Navigation Pane - - - - - - - - - + + + + Index Navigation Pane + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whgdata/whnvp32.htm b/doc/salome/gui/SMESH/whgdata/whnvp32.htm index c334807b1..90697b01f 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvp32.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvp32.htm @@ -1,16 +1,16 @@ - - - - Search Navigation Pane - - - - - - - - - + + + + Search Navigation Pane + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whgdata/whnvp33.htm b/doc/salome/gui/SMESH/whgdata/whnvp33.htm index 8fb4636f0..8351bcbea 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvp33.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvp33.htm @@ -1,16 +1,16 @@ - - - - Glossary Navigation Pane - - - - - - - - - + + + + Glossary Navigation Pane + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whgdata/whnvt30.htm b/doc/salome/gui/SMESH/whgdata/whnvt30.htm index 35e6ef5b8..ec1bb840f 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvt30.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvt30.htm @@ -1,47 +1,47 @@ - - - -Content Navigation Tab - - - - - - - - - - - -
- -
- - - - + + + +Content Navigation Tab + + + + + + + + + + + +
+ +
+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whnvt31.htm b/doc/salome/gui/SMESH/whgdata/whnvt31.htm index 53dd7e91c..e17d82548 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvt31.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvt31.htm @@ -1,45 +1,45 @@ - - - -Index Navigation Tab - - - - - - - - - - - -
- -
- - - - + + + +Index Navigation Tab + + + + + + + + + + + +
+ +
+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whnvt32.htm b/doc/salome/gui/SMESH/whgdata/whnvt32.htm index 464a4cc4a..d63892533 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvt32.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvt32.htm @@ -1,45 +1,45 @@ - - - -Search Navigation Tab - - - - - - - - - - - -
- -
- - - - + + + +Search Navigation Tab + + + + + + + + + + + +
+ +
+ + + + diff --git a/doc/salome/gui/SMESH/whgdata/whnvt33.htm b/doc/salome/gui/SMESH/whgdata/whnvt33.htm index eb46f192b..af63a0257 100755 --- a/doc/salome/gui/SMESH/whgdata/whnvt33.htm +++ b/doc/salome/gui/SMESH/whgdata/whnvt33.htm @@ -1,45 +1,45 @@ - - - -Glossary Navigation Tab - - - - - - - - - - - -
- -
- - - - + + + +Glossary Navigation Tab + + + + + + + + + + + +
+ +
+ + + + diff --git a/doc/salome/gui/SMESH/whgdef.htm b/doc/salome/gui/SMESH/whgdef.htm index ae435749c..5ff0f6781 100755 --- a/doc/salome/gui/SMESH/whgdef.htm +++ b/doc/salome/gui/SMESH/whgdef.htm @@ -1,98 +1,98 @@ - - -Glossary Definition - - - - - - - - - - - - + + +Glossary Definition + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whgdhtml.htm b/doc/salome/gui/SMESH/whgdhtml.htm index 6ffb2947a..d02a99feb 100755 --- a/doc/salome/gui/SMESH/whgdhtml.htm +++ b/doc/salome/gui/SMESH/whgdhtml.htm @@ -1,150 +1,150 @@ - - -Glossary - - - - - - - - - - - - - + + +Glossary + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whghost.js b/doc/salome/gui/SMESH/whghost.js index 56e1d5659..9ebcf24dd 100755 --- a/doc/salome/gui/SMESH/whghost.js +++ b/doc/salome/gui/SMESH/whghost.js @@ -1,247 +1,247 @@ -// WebHelp 5.10.004 -var gbXML=false; -var gaDef=new Array(); -var gsBgColor="#ffffff"; -var gsBgImage=""; -var goFont=null; -var goHoverFont=null; -var gsMargin="2pt"; -var gsIndent="2pt"; -var gsActiveBgColor="#cccccc"; -var gbWhGHost=false; -var gbShowDef=true; -var gsGloId="Glo_" - -function setBackground(sBgImage) -{ - gsBgImage=sBgImage; -} - -function setBackgroundcolor(sBgColor) -{ - gsBgColor=sBgColor; -} - -function setFont(sType,sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration) -{ - var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration); - if(sType=="Normal") - goFont=vFont; - else if(sType=="Hover") - goHoverFont=vFont; -} - -function setActiveBgColor(sBgColor) -{ - gsActiveBgColor=sBgColor; -} - -function setMargin(sMargin) -{ - gsMargin=sMargin; -} - -function setIndent(sIndent) -{ - gsIndent=sIndent; -} - -function insertDef(sKName,sDef) -{ - var nLength=gaDef.length - var oGlo=new nameDefPair(sKName,sDef); - gaDef[nLength]=oGlo; - return nLength; -} - -function showDef(nDef) -{ - if(nDef"; - sHTML+=""+sKName+"

"; - oHTML.addHTML(sHTML,nLength,bDown,true,sRawKName); - if(gbShowDef) - { - setTimeout("showDef(0);",100); - gbShowDef = false; - } - } -} - -function HighLight(nIndex) -{ - var oObj=getElement(getGloId(nIndex)); - if(oObj) - HighLightElement(oObj,gsActiveBgColor,"transparent"); -} - -function getGloId(nIndex) -{ - return gsGloId+nIndex; -} - -function adjustPosition(bDown,aDataCon,aCurIdxSet,nLength,aPos) -{ - if(bDown) - { - for(var i=0;inIIdx) - return aDataCon[nIdxSet].aKs[nIIdx].sDef; - else - return null; -} - -function getItemName(aDataCon,nIdxSet,nIIdx) -{ - if(nIdxSetnIIdx) - return aDataCon[nIdxSet].aKs[nIIdx].sName; - else - return null; -} - -function window_OnLoad() -{ - if(gsBgImage&&gsBgImage.length>0) - document.body.background=gsBgImage; - if(gsBgColor&&gsBgColor.length>0) - document.body.bgColor=gsBgColor; - document.body.insertAdjacentHTML("beforeEnd",writeLoadingDiv()); - loadGlo(); - var oMsg=new whMessage(WH_MSG_SHOWGLO,this,1,null) - SendMessage(oMsg); -} - -function loadGlo() -{ - if(!gbReady) - { - var oResMsg=new whMessage(WH_MSG_GETPROJINFO,this,1,null); - if(SendMessage(oResMsg)&&oResMsg.oParam) - { - gbReady=true; - var oProj=oResMsg.oParam; - var aProj=oProj.aProj; - gbXML=oProj.bXML; - if(aProj.length>0) - { - var sLangId=aProj[0].sLangId; - for(var i=0;i"; + sHTML+=""+sKName+"

"; + oHTML.addHTML(sHTML,nLength,bDown,true,sRawKName); + if(gbShowDef) + { + setTimeout("showDef(0);",100); + gbShowDef = false; + } + } +} + +function HighLight(nIndex) +{ + var oObj=getElement(getGloId(nIndex)); + if(oObj) + HighLightElement(oObj,gsActiveBgColor,"transparent"); +} + +function getGloId(nIndex) +{ + return gsGloId+nIndex; +} + +function adjustPosition(bDown,aDataCon,aCurIdxSet,nLength,aPos) +{ + if(bDown) + { + for(var i=0;inIIdx) + return aDataCon[nIdxSet].aKs[nIIdx].sDef; + else + return null; +} + +function getItemName(aDataCon,nIdxSet,nIIdx) +{ + if(nIdxSetnIIdx) + return aDataCon[nIdxSet].aKs[nIIdx].sName; + else + return null; +} + +function window_OnLoad() +{ + if(gsBgImage&&gsBgImage.length>0) + document.body.background=gsBgImage; + if(gsBgColor&&gsBgColor.length>0) + document.body.bgColor=gsBgColor; + document.body.insertAdjacentHTML("beforeEnd",writeLoadingDiv()); + loadGlo(); + var oMsg=new whMessage(WH_MSG_SHOWGLO,this,1,null) + SendMessage(oMsg); +} + +function loadGlo() +{ + if(!gbReady) + { + var oResMsg=new whMessage(WH_MSG_GETPROJINFO,this,1,null); + if(SendMessage(oResMsg)&&oResMsg.oParam) + { + gbReady=true; + var oProj=oResMsg.oParam; + var aProj=oProj.aProj; + gbXML=oProj.bXML; + if(aProj.length>0) + { + var sLangId=aProj[0].sLangId; + for(var i=0;i0) - { - var sTarget=oC.getAttribute("target"); - var item=new Object(); - item.nType=2; - item.sName=sName; - if(sTarget) - item.sTarget=sTarget; - item.nPKOff=nPrev; - aData[aData.length]=item; - var nCurIndex=aData.length; - processKey(oC,aData,item); - nNext=aData.length-nCurIndex; - item.nNKOff=nNext; - } - } - else if(oC.nodeName=="letter") - { - var name=oC.getAttribute("name"); - if(name&&name.length>0) - { - var item=new Object(); - item.nType=1; - item.sName=name; - item.nPKOff=nPrev; - nNext=0; - item.nNKOff=nNext; - aData[aData.length]=item; - } - } - else if(oC.nodeName=="entry") - { - var name=oC.getAttribute("name"); - var def=oC.getAttribute("value"); - if(name&&name.length>0) - { - var item=new Object(); - item.sName=name; - item.sDef=def; - item.nPKOff=nPrev; - nNext=0; - item.nNKOff=nNext; - aData[aData.length]=item; - } - } - oC=oC.nextSibling; - } - putData(aData); - } - } -} - -function processKey(element,aData,item) -{ - var i=0; - var nPrev=0; - var nNext=0; - var oC=element.firstChild; - while(oC) - { - if(oC.nodeName=="topic") - { - var name=oC.getAttribute("name"); - var url=oC.getAttribute("url"); - if(url&&url.length!=0) - { - if(!name||name.length==0) - name=url; - var topic=new Object(); - topic.sName=name; - topic.sURL=url; - if(!item.aTopics) - item.aTopics=new Array(); - item.aTopics[item.aTopics.length]=topic; - } - } - else if(oC.nodeName=="key") - { - nPrev=nNext; - var name=oC.getAttribute("name"); - if(name&&name.length!=0) - { - var subItem=new Object(); - subItem.sName=name; - subItem.nType=3; - subItem.nPKOff=nPrev; - aData[aData.length]=subItem; - var nCurIndex=aData.length; - processKey(oC,aData,subItem); - nNext=aData.length-nCurIndex; - subItem.nNKOff=nNext; - } - } - oC=oC.nextSibling; - } -} - -function putData(aData) -{ - endLoading(); - var oCData=goCData; - if(oCData) - { - oCData.aKs=aData; - if(gnNKI==-1) - setTimeout("checkReady();",1); - else - { - gsSKA=getKByIdx(oCData,gnNKI); - gbNeedCalc=true; - gbScrl=true; - gnNKI=-1; - if(gsSKA) - setTimeout("checkReady();",1); - else - { - markEnd(); - setTimeout("checkAgain();",50); - } - } - } -} - -function markEnd() -{ - if(gbProcess) - gbProcess=false; -} - -function endLoading() -{ - var oDiv=getElement(gsLoadingDivID); - if(oDiv) - oDiv.style.visibility="hidden"; -} - -function markBegin() -{ - gbProcess=true; -} - -function beginLoading() -{ - var oDiv=getElement(gsLoadingDivID); - if(oDiv) - { - oDiv.style.top=document.body.scrollTop; - oDiv.style.visibility="visible"; - } -} - -function indexHTMLPart() -{ - this.sHTML=""; - this.nNeeded=0; - this.nCurrent=0; - this.nConsumed=0; - this.sFK=null; - this.sLK=null; - this.addHTML=function(sHTML,nConsumed,bDown,bK,sK){ - if(bDown) - this.sHTML+=sHTML; - else - this.sHTML=sHTML+this.sHTML; - this.nCurrent++; - this.nConsumed+=nConsumed; - if(bK) - { - if(!this.sFK) - this.sFK=sK; - if(!this.sLK) - this.sLK=sK; - if(bDown) - this.sLK=sK; - else - this.sFK=sK; - } - } - this.appendHTML=function(oHTML,bDown){ - this.addSubHTML(oHTML,bDown); - if(!this.sFK) - this.sFK=oHTML.sFK; - if(!this.sLK) - this.sLK=oHTML.sLK; - if(bDown) - this.sLK=oHTML.sLK; - else - this.sFK=oHTML.sFK; - } - - this.addSubHTML=function(oHTML,bDown){ - if(bDown) - this.sHTML+=oHTML.sHTML; - else - this.sHTML=oHTML.sHTML+this.sHTML; - this.nCurrent+=oHTML.nCurrent; - this.nConsumed+=oHTML.nConsumed; - } -} - -function getMaxUnits() -{ - return Math.floor(gnMaxMargin/gnUHeight)+1; -} - -function getFakeItemsHTMLbyCount(nB,nCount) -{ - var nMU=getMaxUnits(); - var nNum=Math.floor(nCount/nMU); - var sHTML=""; - for(var i=0;i "; -} - -function fakeItemsArea(nB,n,sKA,sKB,obj) -{ - this.nB=nB; - this.nNum=n; - this.sKA=sKA; - this.sKB=sKB; - this.obj=obj; - this.nMargin=(n-1)*gnUHeight; - - this.setNum=function(n) - { - var nLastobj=-1; - var nDelta=this.nMargin; - this.nMargin=(n-1)*gnUHeight; - nDelta=nDelta-this.nMargin; - if(n>0) - { - this.nNum=n; - var nMU=getMaxUnits(); - nLastobj=Math.floor((n-1)/nMU); - if(this.obj.length) - this.obj[nLastobj].style.marginTop=((n-1)%nMU)*gnUHeight; - else - this.obj.style.marginTop=((n-1)%nMU)*gnUHeight; - } - if(this.obj.length) - { - for(var i=this.obj.length-1;i>nLastobj;i--) - removeThis(this.obj[i]); - } - else - { - if(nLastobj==-1) - removeThis(this.obj); - } - return nDelta; - } - this.insertAdjacentHTML=function(sWhere,sHTML) - { - if(sWhere=="beforeBegin") - { - if(this.obj.length) - this.obj[0].insertAdjacentHTML(sWhere,sHTML); - else - this.obj.insertAdjacentHTML(sWhere,sHTML); - } - else if(sWhere=="afterEnd") - { - if(this.obj.length) - { - if(gbMac&&gbIE5&&this.obj[this.obj.length-1].nextSibling) - this.obj[this.obj.length-1].nextSibling.insertAdjacentHTML("beforeBegin",sHTML); - else - this.obj[this.obj.length-1].insertAdjacentHTML(sWhere,sHTML); - } - else - { - if(gbMac&&gbIE5&&this.obj.nextSibling) - this.obj.nextSibling.insertAdjacentHTML("beforeBegin",sHTML); - else - this.obj.insertAdjacentHTML(sWhere,sHTML); - } - } - } - this.getBtm=function() - { - if(this.obj.length) - return this.obj[this.obj.length-1].offsetTop; - else - return this.obj.offsetTop; - } - this.getTop=function() - { - return this.getBtm()-this.nMargin; - } -} - -function usedItems(nB,nE) -{ - this.nB=nB; - this.nE=nE; - this.oN=null; -} - -function checkReady() -{ - var len=gaChunks.length; - var bNeedLoad=false; - var aDataCon; - var s=0; - var bDown=(gsSKB==null); - var sK=bDown?gsSKA:gsSKB; - if(sK==null) - { - markEnd(); - setTimeout("checkAgain();",50); - return; - } - if(!gsChK||sK!=gsChK||gnNum==0) - { - gnCheck=0; - gsChK=sK; - aDataCon=new Array(); - } - else{ - s=gnNum; - aDataCon=gaDataCon; - } - for(var i=gnCheck;i0&&aPos[i]>=0&&aPos[i]0) - { - sCurrentK=aDataCon[i].aKs[aPos[i]].sName; - } - } - } - return sCurrentK; -} - -function checkAgain() -{ - if(!gbProcess) - { - if(gsBCK!=null) - { - gsCK=gsBCK; - gsBCK=null; - findCK(); - } - else - { - markBegin(); - getUnitIdx(document.body.scrollTop,document.body.clientHeight); - } - } - else - setTimeout("checkAgain()",50); -} - -function getLimit(aDataCon,aPos,aMaxPos,aMinPos,i) -{ - aMaxPos[i]=aDataCon[i].nNum; - aMinPos[i]=-1; - var oPNode=null; - if(aDataCon[i].oUsedItems) - { - var oUsedItems=aDataCon[i].oUsedItems; - do{ - if(oUsedItems.nB>aPos[i]) - { - aMaxPos[i]=oUsedItems.nB; - break; - } - oPNode=oUsedItems; - oUsedItems=oUsedItems.oN; - }while(oUsedItems!=null); - if(oPNode) - aMinPos[i]=oPNode.nE; - } - else if(aDataCon[i].aKs==null) - { - aMaxPos[i]=aMinPos[i]=aPos[i]; - } - if(aMinPos[i]>=aPos[i]||aMaxPos[i]<=aPos[i]) - { - aMaxPos[i]=aMinPos[i]=aPos[i]; - } -} - -function getIdxPos(oIdx,bDown,sK) -{ - var aKs=oIdx.aKs; - var nIdx; - if(bDown) - nIdx=oIdx.nNum; - else - nIdx=-1; - if(aKs!=null) - { - for(var i=0;i0) - { - nIdx=i; - break; - } - } - else - { - if(compare(aKs[i].sName,sK)<0) - nIdx=i; - else - break; - } - i+=aKs[i].nNKOff; - } - } - else if(oIdx.aKsOnly) - { - var aKsOnly=oIdx.aKsOnly; - for(var i=0;i0) - { - nIdx=i; - break; - } - } - else - { - if(compare(aKsOnly[i],sK)<0) - nIdx=i; - else - break; - } - } - } - } - return nIdx; -} - -function writeItems(oHTML,aDataCon,aPos,aMinPos,aMaxPos,bDown,nLevel) -{ - var aOldPos=new Array(); - for(var i=0;iaMinPos[i])) - { - if(sCurrentK==""|| - (bDown&&compare(sCurrentK,aDataCon[i].aKs[aPos[i]].sName)>0)|| - (!bDown&&compare(sCurrentK,aDataCon[i].aKs[aPos[i]].sName)<0)) - { - sCurrentK=aDataCon[i].aKs[aPos[i]].sName; - p=0; - aCurIdxSet[p++]=i; - } - else if(compare(sCurrentK,aDataCon[i].aKs[aPos[i]].sName)==0){ - aCurIdxSet[p++]=i; - } - } - else if(nLevel==1&&aMaxPos[i]!=aMinPos[i]){ - if(bDown&&aPos[i]==aMaxPos[i]) - { - if(aDataCon[i].aKs) - { - gsSKA=aDataCon[i].aKs[aOldPos[i]].sName; - return false; - } - } - else if(!bDown&&aPos[i]==aMinPos[i]) - { - if(aDataCon[i].aKs) - { - gsSKB=aDataCon[i].aKs[aOldPos[i]].sName; - return false; - } - } - } - } - if(p>=1){ - for(var s=0;s0); - return true; -} - -function updateUsedK(aDataCon,aOriPos,aOldPos,bDown) -{ - for(var i=0;inB) - { - if(oUsedItems.nB==nE+1) - { - oUsedItems.nB=nB; - } - else{ - var oNewNode=new usedItems(oUsedItems.nB,oUsedItems.nE); - oNewNode.oN=oUsedItems.oN; - oUsedItems.nB=nB; - oUsedItems.nE=nE; - oUsedItems.oN=oNewNode; - } - break; - } - oPNode=oUsedItems; - oUsedItems=oUsedItems.oN; - }while(oUsedItems); - if(!oUsedItems) - { - if(oPNode!=null) - oPNode.oN=new usedItems(nB,nE); - } - if(oPNode!=null){ - if(oPNode.nE==oPNode.oN.nB-1) - { - oPNode.nE=oPNode.oN.nE; - oPNode.oN=oPNode.oN.oN; - } - } - } -} - -function projInfo(sPPath,sDPath,sFile) -{ - this.sPPath=sPPath; - this.sDPath=sDPath; - this.sFile=sFile; -} - -function addProjInfo(sPPath,sDPath,sFile) -{ - var oIdxInfo=new projInfo(sPPath,sDPath,sFile); - gaData[gaData.length]=oIdxInfo; - return oIdxInfo; -} - -function writeDataIFrame() -{ - if(gnLoad=nPos) return true; - oUsed=oUsed.oN; - } - return false; -} - -function getKByIdx(oCData,nB) -{ - var nRelPos=nB-(oCData.nTotal-oCData.nNum); - var aIKs=oCData.aKs; - if(nRelPos>=0&&aIKs&&nRelPos=0) - { - do{ - oK=aIKs[nRelPos--]; - } - while((oK.nType==3||isUsed(oCData,nRelPos+1))&&nRelPos>=0); - } - if(oK.nType!=3) - { - return oK.sName; - } - } - } - return null; -} - -function loadData2(sFileName) -{ - disEvt(); - if(gbXML) - loadDataXML(sFileName); - else - loadData(sFileName); - enEvt(); -} - -function projReady(aChunk) -{ - gaChunks[gnLoad++]=aChunk; - var len=aChunk.length; - var nTotal=0; - if(len>0) - nTotal=aChunk[len-1].nTotal; - gnItems+=nTotal; - if(nTotal>gnMaxItems) - { - gnMaxItems=nTotal; - gnRef=gnLoad-1; - } - setTimeout("writeDataIFrame();",1); -} - -function writeFakeItems() -{ - disEvt(); - gnUHeight=15; - var sHTML=getFakeItemsHTMLbyCount(0,gnItems); - document.body.insertAdjacentHTML("beforeEnd",sHTML); - var obj=getH6ById(0); - if (document.body != null) - { - gnVisible=Math.ceil(document.body.clientHeight/gnUHeight); - } - gaFakes[0]=new fakeItemsArea(0,gnItems,"",getEndString(),obj); - enEvt(); -} - -function getEndString() -{ - var sBC=getBiggestChar(); - return sBC+sBC+sBC+sBC+sBC+sBC+sBC+sBC; -} - -function getUnitIdx(nScrl,nHeight) -{ - if(gaFakes.length==0) - { - markEnd(); - return; - } - var nB=0; - var nE=gaFakes.length-1; - var nM=-1; - var nTop=0; - var nBtm=0; - var bF=false; - do{ - nM=(nB+nE)>>1; - nBtm=gaFakes[nM].getBtm(); - nTop=gaFakes[nM].getTop(); - - if(nTop>=nScrl+nHeight) - nE=nM-1; - else if(nBtm=nB); - if(bF) - { - if(nTop>=nScrl){ - gsSKA=gaFakes[nM].sKA; - gsSKB=null; - gnNeeded=Math.ceil((nHeight-nTop+nScrl)/gnUHeight); - gnIns=gaFakes[nM].nB; - checkReady(); - } - else if(nBtm<=nScrl+nHeight){ - gsSKB=gaFakes[nM].sKB; - gsSKA=null; - gnNeeded=Math.ceil((nBtm-nScrl+gnScrlMgn)/gnUHeight); - gbNeedCalc=true; - checkReady(); - } - else{ - gnNeeded=gnVisible; - var nUnitIdx=gaFakes[nM].nB+Math.floor((nScrl-nTop)/gnUHeight); - if (!showItemsInEvaluation(nUnitIdx)) - { - gsSKA=gaFakes[nM].sKA; - gsSKB=null; - gnNeeded=Math.ceil(nHeight/gnUHeight); - gnIns=gaFakes[nM].nB; - checkReady(); - } - } - } - else - markEnd(); -} - -function disEvt() -{ - window.onscroll=null; - window.onresize=null; -} - -function enEvt() -{ - window.onscroll=window_OnScroll; - window.onresize=window_OnResize; -} - -function insertIdxKs(nIns,oHTML,bScrl) -{ - var bRtn=true; - disEvt(); - var nCount=oHTML.nConsumed; - var nB=0; - var nE=gaFakes.length-1; - var nM=-1; - var bF=false; - do{ - nM=(nB+nE)>>1; - if(gaFakes[nM].nB>nIns) - nE=nM-1; - else if(gaFakes[nM].nB+gaFakes[nM].nNum<=nIns) - nB=nM+1; - else{ - bF=true; - break; - } - }while(nE>=nB); - if(bF) - { - var oFIA=gaFakes[nM]; - var nOffsetTop=oFIA.getTop(); - var nOffsetBottom=oFIA.getBtm(); - var nDelta=0; - var nHDiff=nIns-oFIA.nB; - var nTDiff=oFIA.nNum+oFIA.nB-(nIns+nCount); - if(nHDiff>0) - { - nDelta=oFIA.setNum(nHDiff); - var sOldKBefore=oFIA.sKB; - oFIA.sKB=oHTML.sFK; - if(nTDiff>0) - { - var sHTML=getFakeItemsHTMLbyCount(nIns,nTDiff); - oFIA.insertAdjacentHTML("afterEnd",sHTML); - var obj=getH6ById(nIns); - insertItemIntoArray(gaFakes,nM+1,new fakeItemsArea(nIns+nCount,nTDiff,oHTML.sLK,sOldKBefore,obj)); - } - oFIA.insertAdjacentHTML("afterEnd",oHTML.sHTML); - if(bScrl) - { - if(gbMac&&gbIE4) - { - var nScrollPos=nOffsetBottom-nDelta; - while(document.body.scrollTop!=nScrollPos) - document.body.scrollTop=nScrollPos; - } - else - window.scrollTo(0,nOffsetBottom-nDelta); - } - } - else{ - oFIA.insertAdjacentHTML("beforeBegin",oHTML.sHTML); - if(bScrl){ - if(gbMac&&gbIE4) - { - var nScrollPos=nOffsetTop; - while(document.body.scrollTop!=nScrollPos) - document.body.scrollTop=nScrollPos; - } - else - window.scrollTo(0,nOffsetTop); - } - - if(nTDiff>0) - { - oFIA.nB=nIns+nCount; - nDelta=oFIA.setNum(nTDiff); - oFIA.sKA=oHTML.sLK; - } - else{ - gaFakes[nM].setNum(0); - removeItemFromArray(gaFakes,nM); - } - } - } - else - bRtn=false; - enEvt(); - return bRtn; -} - -function window_OnScroll() -{ - gnSE++; - setTimeout("procScroll();",50); -} - -function procScroll() -{ - if(gnSE==1&&!gbProcess) - { - markBegin(); - getUnitIdx(document.body.scrollTop,document.body.clientHeight); - } - gnSE--; -} - -function window_OnResize() -{ - gnRE++; - setTimeout("procResize();",50); -} - -function procResize() -{ - if(gnRE==1&&!gbProcess) - { - markBegin(); - gnVisible=Math.ceil(document.body.clientHeight/gnUHeight); - if(gnIns==-1) - getUnitIdx(document.body.scrollTop,document.body.clientHeight); - } - gnRE--; -} - -function getChunkByIdx(nIdx,nPosition) -{ - var oCData=null; - if(nIdx0) - { - var nB=0; - var nE=len-1; - var bF=false; - do{ - var nM=(nB+nE)>>1; - if(nPositionnB); - if(bF) - oCData=gaChunks[nIdx][nE]; - else if(nPosition0) - { - var nB=0; - var nE=len-1; - var bF=false; - do{ - var nM=(nB+nE+(bDown?0:1))>>1; - if(bDown) - { - if(compare(sK,gaChunks[nIdx][nM].sEK)<0) - { - bF=true; - nE=nM; - } - else - nB=nM+1; - } - else - { - if(compare(sK,gaChunks[nIdx][nM].sBK)>0) - { - bF=true; - nB=nM; - } - else - nE=nM-1; - } - }while(nE>nB); - if(bF) - { - if(bDown) - nCandId=nE; - else - nCandId=nB; - } - else - { - if(bDown) - { - if(gaChunks[nIdx].length>nB&&compare(sK,gaChunks[nIdx][nB].sEK)<0) - nCandId=nB; - else - nCandId=gaChunks[nIdx].length-1; - } - else - { - if(0<=nE&&compare(sK,gaChunks[nIdx][nE].sBK)>0) - nCandId=nE; - else - nCandId=0; - } - } - return gaChunks[nIdx][nCandId]; - } - } - return null; -} - -function findCK() -{ - if(gsCK!=null) - { - gsSKA=gsCK; - gbFindCK=true; - gnNeeded=1; - markBegin(); - checkReady(); - } -} - -function writeLoadingDiv(nIIdx) -{ - return ""; -} - +// WebHelp 5.10.002 +var gaChunks=new Array(); +var gaFakes=new Array(); +var gaDataCon=null; +var gaData=new Array(); + +var gbFindCK=false;; +var gbNeedCalc=false; +var gbScrl=false; +var gbProcess=false; +var gbReady=false; + +var gnCheck=0; +var gnNum=0; +var gnIns=-1; +var gnLoad=0; +var gnRef=-1; +var gnMaxItems=0; +var gnMaxMargin=32000; +var gnNeeded=0; +var gnNKI=-1; +var gnRE=0; +var gnScrlMgn=30; +var gnSE=0; +var gnVisible=0; +var gnItems=0; +var gnUHeight=1; + +var gsBCK=null; +var gsChK=null; +var gsCK=null; +var gsLoadingDivID="LoadingDiv"; +var gsLoadingMsg="Loading data, please wait..."; +var gsSKA=null; +var gsSKB=null; + +var gbLoadInfo=false; + +function onLoadXMLError() +{ + if(gbLoadInfo) + { + var aChunk=new Array(); + projReady(aChunk); + } + else + { + var aData=new Array(); + putData(aData); + } +} + +function putDataXML(xmlDoc,sDocPath) +{ + if(gbLoadInfo) + { + var node=xmlDoc.lastChild; + if(node) + { + var nTotal=0 + var aChunk=new Array(); + var oC=node.firstChild; + while(oC) + { + if(oC.nodeName=="chunkinfo") + { + var item=new Object(); + item.sBK=oC.getAttribute("first"); + item.sEK=oC.getAttribute("last"); + item.sFileName=oC.getAttribute("url"); + item.nNum=parseInt(oC.getAttribute("num")); + nTotal+=item.nNum; + item.nTotal=nTotal; + aChunk[aChunk.length]=item; + } + oC=oC.nextSibling; + } + projReady(aChunk); + } + } + else + { + var node=xmlDoc.lastChild; + if(node) + { + var aData=new Array(); + var nPrev=0; + var nNext=0; + var oC=node.firstChild; + while(oC) + { + nPrev=nNext; + if(oC.nodeName=="key") + { + var sName=oC.getAttribute("name"); + if(sName&&sName.length>0) + { + var sTarget=oC.getAttribute("target"); + var item=new Object(); + item.nType=2; + item.sName=sName; + if(sTarget) + item.sTarget=sTarget; + item.nPKOff=nPrev; + aData[aData.length]=item; + var nCurIndex=aData.length; + processKey(oC,aData,item); + nNext=aData.length-nCurIndex; + item.nNKOff=nNext; + } + } + else if(oC.nodeName=="letter") + { + var name=oC.getAttribute("name"); + if(name&&name.length>0) + { + var item=new Object(); + item.nType=1; + item.sName=name; + item.nPKOff=nPrev; + nNext=0; + item.nNKOff=nNext; + aData[aData.length]=item; + } + } + else if(oC.nodeName=="entry") + { + var name=oC.getAttribute("name"); + var def=oC.getAttribute("value"); + if(name&&name.length>0) + { + var item=new Object(); + item.sName=name; + item.sDef=def; + item.nPKOff=nPrev; + nNext=0; + item.nNKOff=nNext; + aData[aData.length]=item; + } + } + oC=oC.nextSibling; + } + putData(aData); + } + } +} + +function processKey(element,aData,item) +{ + var i=0; + var nPrev=0; + var nNext=0; + var oC=element.firstChild; + while(oC) + { + if(oC.nodeName=="topic") + { + var name=oC.getAttribute("name"); + var url=oC.getAttribute("url"); + if(url&&url.length!=0) + { + if(!name||name.length==0) + name=url; + var topic=new Object(); + topic.sName=name; + topic.sURL=url; + if(!item.aTopics) + item.aTopics=new Array(); + item.aTopics[item.aTopics.length]=topic; + } + } + else if(oC.nodeName=="key") + { + nPrev=nNext; + var name=oC.getAttribute("name"); + if(name&&name.length!=0) + { + var subItem=new Object(); + subItem.sName=name; + subItem.nType=3; + subItem.nPKOff=nPrev; + aData[aData.length]=subItem; + var nCurIndex=aData.length; + processKey(oC,aData,subItem); + nNext=aData.length-nCurIndex; + subItem.nNKOff=nNext; + } + } + oC=oC.nextSibling; + } +} + +function putData(aData) +{ + endLoading(); + var oCData=goCData; + if(oCData) + { + oCData.aKs=aData; + if(gnNKI==-1) + setTimeout("checkReady();",1); + else + { + gsSKA=getKByIdx(oCData,gnNKI); + gbNeedCalc=true; + gbScrl=true; + gnNKI=-1; + if(gsSKA) + setTimeout("checkReady();",1); + else + { + markEnd(); + setTimeout("checkAgain();",50); + } + } + } +} + +function markEnd() +{ + if(gbProcess) + gbProcess=false; +} + +function endLoading() +{ + var oDiv=getElement(gsLoadingDivID); + if(oDiv) + oDiv.style.visibility="hidden"; +} + +function markBegin() +{ + gbProcess=true; +} + +function beginLoading() +{ + var oDiv=getElement(gsLoadingDivID); + if(oDiv) + { + oDiv.style.top=document.body.scrollTop; + oDiv.style.visibility="visible"; + } +} + +function indexHTMLPart() +{ + this.sHTML=""; + this.nNeeded=0; + this.nCurrent=0; + this.nConsumed=0; + this.sFK=null; + this.sLK=null; + this.addHTML=function(sHTML,nConsumed,bDown,bK,sK){ + if(bDown) + this.sHTML+=sHTML; + else + this.sHTML=sHTML+this.sHTML; + this.nCurrent++; + this.nConsumed+=nConsumed; + if(bK) + { + if(!this.sFK) + this.sFK=sK; + if(!this.sLK) + this.sLK=sK; + if(bDown) + this.sLK=sK; + else + this.sFK=sK; + } + } + this.appendHTML=function(oHTML,bDown){ + this.addSubHTML(oHTML,bDown); + if(!this.sFK) + this.sFK=oHTML.sFK; + if(!this.sLK) + this.sLK=oHTML.sLK; + if(bDown) + this.sLK=oHTML.sLK; + else + this.sFK=oHTML.sFK; + } + + this.addSubHTML=function(oHTML,bDown){ + if(bDown) + this.sHTML+=oHTML.sHTML; + else + this.sHTML=oHTML.sHTML+this.sHTML; + this.nCurrent+=oHTML.nCurrent; + this.nConsumed+=oHTML.nConsumed; + } +} + +function getMaxUnits() +{ + return Math.floor(gnMaxMargin/gnUHeight)+1; +} + +function getFakeItemsHTMLbyCount(nB,nCount) +{ + var nMU=getMaxUnits(); + var nNum=Math.floor(nCount/nMU); + var sHTML=""; + for(var i=0;i "; +} + +function fakeItemsArea(nB,n,sKA,sKB,obj) +{ + this.nB=nB; + this.nNum=n; + this.sKA=sKA; + this.sKB=sKB; + this.obj=obj; + this.nMargin=(n-1)*gnUHeight; + + this.setNum=function(n) + { + var nLastobj=-1; + var nDelta=this.nMargin; + this.nMargin=(n-1)*gnUHeight; + nDelta=nDelta-this.nMargin; + if(n>0) + { + this.nNum=n; + var nMU=getMaxUnits(); + nLastobj=Math.floor((n-1)/nMU); + if(this.obj.length) + this.obj[nLastobj].style.marginTop=((n-1)%nMU)*gnUHeight; + else + this.obj.style.marginTop=((n-1)%nMU)*gnUHeight; + } + if(this.obj.length) + { + for(var i=this.obj.length-1;i>nLastobj;i--) + removeThis(this.obj[i]); + } + else + { + if(nLastobj==-1) + removeThis(this.obj); + } + return nDelta; + } + this.insertAdjacentHTML=function(sWhere,sHTML) + { + if(sWhere=="beforeBegin") + { + if(this.obj.length) + this.obj[0].insertAdjacentHTML(sWhere,sHTML); + else + this.obj.insertAdjacentHTML(sWhere,sHTML); + } + else if(sWhere=="afterEnd") + { + if(this.obj.length) + { + if(gbMac&&gbIE5&&this.obj[this.obj.length-1].nextSibling) + this.obj[this.obj.length-1].nextSibling.insertAdjacentHTML("beforeBegin",sHTML); + else + this.obj[this.obj.length-1].insertAdjacentHTML(sWhere,sHTML); + } + else + { + if(gbMac&&gbIE5&&this.obj.nextSibling) + this.obj.nextSibling.insertAdjacentHTML("beforeBegin",sHTML); + else + this.obj.insertAdjacentHTML(sWhere,sHTML); + } + } + } + this.getBtm=function() + { + if(this.obj.length) + return this.obj[this.obj.length-1].offsetTop; + else + return this.obj.offsetTop; + } + this.getTop=function() + { + return this.getBtm()-this.nMargin; + } +} + +function usedItems(nB,nE) +{ + this.nB=nB; + this.nE=nE; + this.oN=null; +} + +function checkReady() +{ + var len=gaChunks.length; + var bNeedLoad=false; + var aDataCon; + var s=0; + var bDown=(gsSKB==null); + var sK=bDown?gsSKA:gsSKB; + if(sK==null) + { + markEnd(); + setTimeout("checkAgain();",50); + return; + } + if(!gsChK||sK!=gsChK||gnNum==0) + { + gnCheck=0; + gsChK=sK; + aDataCon=new Array(); + } + else{ + s=gnNum; + aDataCon=gaDataCon; + } + for(var i=gnCheck;i0&&aPos[i]>=0&&aPos[i]0) + { + sCurrentK=aDataCon[i].aKs[aPos[i]].sName; + } + } + } + return sCurrentK; +} + +function checkAgain() +{ + if(!gbProcess) + { + if(gsBCK!=null) + { + gsCK=gsBCK; + gsBCK=null; + findCK(); + } + else + { + markBegin(); + getUnitIdx(document.body.scrollTop,document.body.clientHeight); + } + } + else + setTimeout("checkAgain()",50); +} + +function getLimit(aDataCon,aPos,aMaxPos,aMinPos,i) +{ + aMaxPos[i]=aDataCon[i].nNum; + aMinPos[i]=-1; + var oPNode=null; + if(aDataCon[i].oUsedItems) + { + var oUsedItems=aDataCon[i].oUsedItems; + do{ + if(oUsedItems.nB>aPos[i]) + { + aMaxPos[i]=oUsedItems.nB; + break; + } + oPNode=oUsedItems; + oUsedItems=oUsedItems.oN; + }while(oUsedItems!=null); + if(oPNode) + aMinPos[i]=oPNode.nE; + } + else if(aDataCon[i].aKs==null) + { + aMaxPos[i]=aMinPos[i]=aPos[i]; + } + if(aMinPos[i]>=aPos[i]||aMaxPos[i]<=aPos[i]) + { + aMaxPos[i]=aMinPos[i]=aPos[i]; + } +} + +function getIdxPos(oIdx,bDown,sK) +{ + var aKs=oIdx.aKs; + var nIdx; + if(bDown) + nIdx=oIdx.nNum; + else + nIdx=-1; + if(aKs!=null) + { + for(var i=0;i0) + { + nIdx=i; + break; + } + } + else + { + if(compare(aKs[i].sName,sK)<0) + nIdx=i; + else + break; + } + i+=aKs[i].nNKOff; + } + } + else if(oIdx.aKsOnly) + { + var aKsOnly=oIdx.aKsOnly; + for(var i=0;i0) + { + nIdx=i; + break; + } + } + else + { + if(compare(aKsOnly[i],sK)<0) + nIdx=i; + else + break; + } + } + } + } + return nIdx; +} + +function writeItems(oHTML,aDataCon,aPos,aMinPos,aMaxPos,bDown,nLevel) +{ + var aOldPos=new Array(); + for(var i=0;iaMinPos[i])) + { + if(sCurrentK==""|| + (bDown&&compare(sCurrentK,aDataCon[i].aKs[aPos[i]].sName)>0)|| + (!bDown&&compare(sCurrentK,aDataCon[i].aKs[aPos[i]].sName)<0)) + { + sCurrentK=aDataCon[i].aKs[aPos[i]].sName; + p=0; + aCurIdxSet[p++]=i; + } + else if(compare(sCurrentK,aDataCon[i].aKs[aPos[i]].sName)==0){ + aCurIdxSet[p++]=i; + } + } + else if(nLevel==1&&aMaxPos[i]!=aMinPos[i]){ + if(bDown&&aPos[i]==aMaxPos[i]) + { + if(aDataCon[i].aKs) + { + gsSKA=aDataCon[i].aKs[aOldPos[i]].sName; + return false; + } + } + else if(!bDown&&aPos[i]==aMinPos[i]) + { + if(aDataCon[i].aKs) + { + gsSKB=aDataCon[i].aKs[aOldPos[i]].sName; + return false; + } + } + } + } + if(p>=1){ + for(var s=0;s0); + return true; +} + +function updateUsedK(aDataCon,aOriPos,aOldPos,bDown) +{ + for(var i=0;inB) + { + if(oUsedItems.nB==nE+1) + { + oUsedItems.nB=nB; + } + else{ + var oNewNode=new usedItems(oUsedItems.nB,oUsedItems.nE); + oNewNode.oN=oUsedItems.oN; + oUsedItems.nB=nB; + oUsedItems.nE=nE; + oUsedItems.oN=oNewNode; + } + break; + } + oPNode=oUsedItems; + oUsedItems=oUsedItems.oN; + }while(oUsedItems); + if(!oUsedItems) + { + if(oPNode!=null) + oPNode.oN=new usedItems(nB,nE); + } + if(oPNode!=null){ + if(oPNode.nE==oPNode.oN.nB-1) + { + oPNode.nE=oPNode.oN.nE; + oPNode.oN=oPNode.oN.oN; + } + } + } +} + +function projInfo(sPPath,sDPath,sFile) +{ + this.sPPath=sPPath; + this.sDPath=sDPath; + this.sFile=sFile; +} + +function addProjInfo(sPPath,sDPath,sFile) +{ + var oIdxInfo=new projInfo(sPPath,sDPath,sFile); + gaData[gaData.length]=oIdxInfo; + return oIdxInfo; +} + +function writeDataIFrame() +{ + if(gnLoad=nPos) return true; + oUsed=oUsed.oN; + } + return false; +} + +function getKByIdx(oCData,nB) +{ + var nRelPos=nB-(oCData.nTotal-oCData.nNum); + var aIKs=oCData.aKs; + if(nRelPos>=0&&aIKs&&nRelPos=0) + { + do{ + oK=aIKs[nRelPos--]; + } + while((oK.nType==3||isUsed(oCData,nRelPos+1))&&nRelPos>=0); + } + if(oK.nType!=3) + { + return oK.sName; + } + } + } + return null; +} + +function loadData2(sFileName) +{ + disEvt(); + if(gbXML) + loadDataXML(sFileName); + else + loadData(sFileName); + enEvt(); +} + +function projReady(aChunk) +{ + gaChunks[gnLoad++]=aChunk; + var len=aChunk.length; + var nTotal=0; + if(len>0) + nTotal=aChunk[len-1].nTotal; + gnItems+=nTotal; + if(nTotal>gnMaxItems) + { + gnMaxItems=nTotal; + gnRef=gnLoad-1; + } + setTimeout("writeDataIFrame();",1); +} + +function writeFakeItems() +{ + disEvt(); + gnUHeight=15; + var sHTML=getFakeItemsHTMLbyCount(0,gnItems); + document.body.insertAdjacentHTML("beforeEnd",sHTML); + var obj=getH6ById(0); + if (document.body != null) + { + gnVisible=Math.ceil(document.body.clientHeight/gnUHeight); + } + gaFakes[0]=new fakeItemsArea(0,gnItems,"",getEndString(),obj); + enEvt(); +} + +function getEndString() +{ + var sBC=getBiggestChar(); + return sBC+sBC+sBC+sBC+sBC+sBC+sBC+sBC; +} + +function getUnitIdx(nScrl,nHeight) +{ + if(gaFakes.length==0) + { + markEnd(); + return; + } + var nB=0; + var nE=gaFakes.length-1; + var nM=-1; + var nTop=0; + var nBtm=0; + var bF=false; + do{ + nM=(nB+nE)>>1; + nBtm=gaFakes[nM].getBtm(); + nTop=gaFakes[nM].getTop(); + + if(nTop>=nScrl+nHeight) + nE=nM-1; + else if(nBtm=nB); + if(bF) + { + if(nTop>=nScrl){ + gsSKA=gaFakes[nM].sKA; + gsSKB=null; + gnNeeded=Math.ceil((nHeight-nTop+nScrl)/gnUHeight); + gnIns=gaFakes[nM].nB; + checkReady(); + } + else if(nBtm<=nScrl+nHeight){ + gsSKB=gaFakes[nM].sKB; + gsSKA=null; + gnNeeded=Math.ceil((nBtm-nScrl+gnScrlMgn)/gnUHeight); + gbNeedCalc=true; + checkReady(); + } + else{ + gnNeeded=gnVisible; + var nUnitIdx=gaFakes[nM].nB+Math.floor((nScrl-nTop)/gnUHeight); + if (!showItemsInEvaluation(nUnitIdx)) + { + gsSKA=gaFakes[nM].sKA; + gsSKB=null; + gnNeeded=Math.ceil(nHeight/gnUHeight); + gnIns=gaFakes[nM].nB; + checkReady(); + } + } + } + else + markEnd(); +} + +function disEvt() +{ + window.onscroll=null; + window.onresize=null; +} + +function enEvt() +{ + window.onscroll=window_OnScroll; + window.onresize=window_OnResize; +} + +function insertIdxKs(nIns,oHTML,bScrl) +{ + var bRtn=true; + disEvt(); + var nCount=oHTML.nConsumed; + var nB=0; + var nE=gaFakes.length-1; + var nM=-1; + var bF=false; + do{ + nM=(nB+nE)>>1; + if(gaFakes[nM].nB>nIns) + nE=nM-1; + else if(gaFakes[nM].nB+gaFakes[nM].nNum<=nIns) + nB=nM+1; + else{ + bF=true; + break; + } + }while(nE>=nB); + if(bF) + { + var oFIA=gaFakes[nM]; + var nOffsetTop=oFIA.getTop(); + var nOffsetBottom=oFIA.getBtm(); + var nDelta=0; + var nHDiff=nIns-oFIA.nB; + var nTDiff=oFIA.nNum+oFIA.nB-(nIns+nCount); + if(nHDiff>0) + { + nDelta=oFIA.setNum(nHDiff); + var sOldKBefore=oFIA.sKB; + oFIA.sKB=oHTML.sFK; + if(nTDiff>0) + { + var sHTML=getFakeItemsHTMLbyCount(nIns,nTDiff); + oFIA.insertAdjacentHTML("afterEnd",sHTML); + var obj=getH6ById(nIns); + insertItemIntoArray(gaFakes,nM+1,new fakeItemsArea(nIns+nCount,nTDiff,oHTML.sLK,sOldKBefore,obj)); + } + oFIA.insertAdjacentHTML("afterEnd",oHTML.sHTML); + if(bScrl) + { + if(gbMac&&gbIE4) + { + var nScrollPos=nOffsetBottom-nDelta; + while(document.body.scrollTop!=nScrollPos) + document.body.scrollTop=nScrollPos; + } + else + window.scrollTo(0,nOffsetBottom-nDelta); + } + } + else{ + oFIA.insertAdjacentHTML("beforeBegin",oHTML.sHTML); + if(bScrl){ + if(gbMac&&gbIE4) + { + var nScrollPos=nOffsetTop; + while(document.body.scrollTop!=nScrollPos) + document.body.scrollTop=nScrollPos; + } + else + window.scrollTo(0,nOffsetTop); + } + + if(nTDiff>0) + { + oFIA.nB=nIns+nCount; + nDelta=oFIA.setNum(nTDiff); + oFIA.sKA=oHTML.sLK; + } + else{ + gaFakes[nM].setNum(0); + removeItemFromArray(gaFakes,nM); + } + } + } + else + bRtn=false; + enEvt(); + return bRtn; +} + +function window_OnScroll() +{ + gnSE++; + setTimeout("procScroll();",50); +} + +function procScroll() +{ + if(gnSE==1&&!gbProcess) + { + markBegin(); + getUnitIdx(document.body.scrollTop,document.body.clientHeight); + } + gnSE--; +} + +function window_OnResize() +{ + gnRE++; + setTimeout("procResize();",50); +} + +function procResize() +{ + if(gnRE==1&&!gbProcess) + { + markBegin(); + gnVisible=Math.ceil(document.body.clientHeight/gnUHeight); + if(gnIns==-1) + getUnitIdx(document.body.scrollTop,document.body.clientHeight); + } + gnRE--; +} + +function getChunkByIdx(nIdx,nPosition) +{ + var oCData=null; + if(nIdx0) + { + var nB=0; + var nE=len-1; + var bF=false; + do{ + var nM=(nB+nE)>>1; + if(nPositionnB); + if(bF) + oCData=gaChunks[nIdx][nE]; + else if(nPosition0) + { + var nB=0; + var nE=len-1; + var bF=false; + do{ + var nM=(nB+nE+(bDown?0:1))>>1; + if(bDown) + { + if(compare(sK,gaChunks[nIdx][nM].sEK)<0) + { + bF=true; + nE=nM; + } + else + nB=nM+1; + } + else + { + if(compare(sK,gaChunks[nIdx][nM].sBK)>0) + { + bF=true; + nB=nM; + } + else + nE=nM-1; + } + }while(nE>nB); + if(bF) + { + if(bDown) + nCandId=nE; + else + nCandId=nB; + } + else + { + if(bDown) + { + if(gaChunks[nIdx].length>nB&&compare(sK,gaChunks[nIdx][nB].sEK)<0) + nCandId=nB; + else + nCandId=gaChunks[nIdx].length-1; + } + else + { + if(0<=nE&&compare(sK,gaChunks[nIdx][nE].sBK)>0) + nCandId=nE; + else + nCandId=0; + } + } + return gaChunks[nIdx][nCandId]; + } + } + return null; +} + +function findCK() +{ + if(gsCK!=null) + { + gsSKA=gsCK; + gbFindCK=true; + gnNeeded=1; + markBegin(); + checkReady(); + } +} + +function writeLoadingDiv(nIIdx) +{ + return ""; +} + var gbWhHost=true; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whibody.htm b/doc/salome/gui/SMESH/whibody.htm index a279fa888..46aeaa20c 100755 --- a/doc/salome/gui/SMESH/whibody.htm +++ b/doc/salome/gui/SMESH/whibody.htm @@ -1,284 +1,284 @@ - - -Index content - - - - - - - - - - - - - - - - - - - + + +Index content + + + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whidhtml.htm b/doc/salome/gui/SMESH/whidhtml.htm index 945fdc8f0..feb7b2b21 100755 --- a/doc/salome/gui/SMESH/whidhtml.htm +++ b/doc/salome/gui/SMESH/whidhtml.htm @@ -1,30 +1,30 @@ - - -Index - - - - - - - - - + + +Index + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whiform.htm b/doc/salome/gui/SMESH/whiform.htm index 76674d78d..ad8862182 100755 --- a/doc/salome/gui/SMESH/whiform.htm +++ b/doc/salome/gui/SMESH/whiform.htm @@ -1,91 +1,91 @@ - - -Index form - - - - - - - - - - - - - + + +Index form + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whihost.js b/doc/salome/gui/SMESH/whihost.js index 9aaf13a6a..d48c493ee 100755 --- a/doc/salome/gui/SMESH/whihost.js +++ b/doc/salome/gui/SMESH/whihost.js @@ -1,424 +1,424 @@ -// WebHelp 5.10.002 -var gsDefaultTarget="bsscright"; -var gsBgColor="#ffffff"; -var gsBgImage=""; -var goIdxFont=null; -var goIdxEmptyFont=null; -var goIdxHoverFont=null; -var gsIdxMargin="0pt"; -var gsIdxIndent="8pt"; -var gsIdxActiveBgColor="#cccccc"; -var gsCK = null; -var gsBCK = null; -var gbCR = false; -var gbBCR = false; -var gbWhIHost=true; - -function myEvent() -{ - this.pageX = 0; - this.pageY = 0; -} -var _event=new myEvent(); - -function setBackgroundcolor(sBgColor) -{ - gsBgColor=sBgColor; -} - -function setBackground(sBgImage) -{ - gsBgImage=sBgImage; -} - -function setFont(sType,sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration) -{ - var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration); - if(sType=="Normal") - goIdxFont=vFont; - else if(sType=="Empty") - goIdxEmptyFont=vFont; - else if(sType=="Hover") - goIdxHoverFont=vFont; -} - -function setActiveBgColor(sBgColor) -{ - gsIdxActiveBgColor=sBgColor; -} - -function setMargin(sMargin) -{ - gsIdxMargin=sMargin; -} - -function setIndent(sIndent) -{ - gsIdxIndent=sIndent; -} - -function writeOneItem(oHTML,bDown,aDataCon,aCurIdxSet,nLength,aPos,nLevel) -{ - var sHTML=""; - var nIdxSet=aCurIdxSet[0]; - var nIIdx=aPos[nIdxSet]; - var sKOriName=getItemName(aDataCon,nIdxSet,nIIdx); - var sKName=_textToHtml(sKOriName); - - var nIdxIndent=parseInt(gsIdxIndent); - var sTopics=""; - if(nLevel==1){ - if(getItemType(aDataCon,nIdxSet,nIIdx)==1) - { - sHTML+="
"; - sHTML+=""+sKName+"
"; - } - else{ - for(var i=0;i"; - sHTML+="0) - sHTML+=sTopics+");return false;\">"+sKName+"

"; - else - sHTML+=");return false;\" style=\""+getFontStyle(goIdxEmptyFont)+"\">"+sKName+"

"; - } - } - else if(nLevel>=2){ - var nIndent=nIdxIndent*nLevel; - for(var i=0;i"; - else - sHTML+="
"; - sHTML+="0) - sHTML+=sTopics+");return false;\">"+sKName+"
"; - else - sHTML+=");return false;\" style=\""+getFontStyle(goIdxEmptyFont)+"\">"+sKName+""; - } - oHTML.addHTML(sHTML,nLength,bDown,(nLevel==1),sKOriName); -} - -function getTargetName(aDataCon,nIdxSet,nIIdx) -{ - if(nIdxSetnIIdx) - if(aDataCon[nIdxSet].aKs[nIIdx].sTarget) - return aDataCon[nIdxSet].aKs[nIIdx].sTarget; - return gsDefaultTarget; -} - -function mergeItems(oHTML,bDown,aDataCon,aCurIdxSet,nLength,aPos,nLevel) -{ - var oLocalHTML=new indexHTMLPart(); - writeOneItem(oLocalHTML,bDown,aDataCon,aCurIdxSet,nLength,aPos,nLevel); - - var aLocalPos=new Array(); - var aMaxPos=new Array(); - for(var i=0;i0) - aMaxPos[aCurIdxSet[i]]=aLocalPos[aCurIdxSet[i]]+nNKOff; - } - var oSubHTML=new indexHTMLPart(); - writeItems(oSubHTML,aDataCon,aLocalPos,null,aMaxPos,true,nLevel+1); - oLocalHTML.addSubHTML(oSubHTML,true); - oHTML.appendHTML(oLocalHTML,bDown); -} - -function adjustPosition(bDown,aDataCon,aCurIdxSet,nLength,aPos) -{ - if(bDown) - { - for(var i=0;inIIdx) - return aDataCon[nIdxSet].aKs[nIIdx].sName; - else - return null; -} - -function getItemType(aDataCon,nIdxSet,nIIdx) -{ - if(nIdxSetnIIdx) - return aDataCon[nIdxSet].aKs[nIIdx].nType; - else - return 0; -} - -function getNKOff(aDataCon,nIdxSet,nIIdx) -{ - if(nIdxSetnIIdx) - return aDataCon[nIdxSet].aKs[nIIdx].nNKOff; - else - return null; -} - -function getPKOff(aDataCon,nIdxSet,nIIdx) -{ - if(nIdxSetnIIdx) - return aDataCon[nIdxSet].aKs[nIIdx].nPKOff; - else - return null; -} - -function window_OnLoad() -{ - if(gsBgImage&&gsBgImage.length>0) - { - document.body.background=gsBgImage; - } - if(gsBgColor&&gsBgColor.length>0) - { - document.body.bgColor=gsBgColor; - } - document.body.insertAdjacentHTML("beforeEnd",writeLoadingDiv()); - loadIdx(); - var oMsg=new whMessage(WH_MSG_SHOWIDX,this,1,null) - SendMessage(oMsg); -} - -function loadIdx() -{ - if(!gbReady) - { - var oResMsg=new whMessage(WH_MSG_GETPROJINFO,this,1,null); - if(SendMessage(oResMsg)&&oResMsg.oParam) - { - gbReady=true; - var oProj=oResMsg.oParam; - var aProj=oProj.aProj; - gbXML=oProj.bXML; - if(aProj.length>0) - { - var sLangId=aProj[0].sLangId; - for(var i=0;inIIdx) - { - if(aDataCon[nIdxSet].aKs[nIIdx].aTopics) - { - var nLen=aDataCon[nIdxSet].aKs[nIIdx].aTopics.length; - var nProj=aDataCon[nIdxSet].nProjId; - var sPath=gaData[nProj].sPPath; - for(var i=0;i>1; - sItem=getInnerText(oP[nM]); - - if(compare(sItem,sK)==0) - { - bF=true; - break; - } - else if(compare(sItem,sK)>0) - nE=nM-1; - else if(compare(sItem,sK)<0) - nB=nM; - } - if(!bF) - { - if(nB==nE) nM=nB; - - if(nM+10){ - var nbTag=getElementsByTag(oMatch,"NOBR"); - if(nbTag&&nbTag.length>0) - HighLightElement(nbTag[0], gsIdxActiveBgColor, "transparent"); - if (gbCR) - { - if (gbIE4) - tempColl(0).click(); - else - { - var strCommand = tempColl[0].getAttribute("onClick"); - var nstrCommand = strCommand.indexOf(";"); - strCommand = strCommand.substring(0, nstrCommand); - strCommand = strCommand.replace("event", "_event"); - window._event.pageX = oMatch.offsetLeft ; - window._event.pageY = oMatch.offsetTop + 20; - window.setTimeout(strCommand, 100); - } - } - } - } - gsCK=gsBCK; - gbCR=gbBCR; - if(gsBCK!=null) - { - gsBCK=null; - gbBCR=false; - findCK(); - return false; - } - - } - return true; -} - -function clearHighLight() -{ - resetHighLight(gsBgColor); -} - -function IndexWriteClassStyle() -{ - var sStyle=""; - sStyle+=""; - document.write(sStyle); - return; -} - -function window_Unload() -{ - UnRegisterListener2(this,WH_MSG_PROJECTREADY); - UnRegisterListener2(this,WH_MSG_SEARCHINDEXKEY); -} - -function onSendMessage(oMsg) -{ - if(oMsg) - { - var nMsgId=oMsg.nMessageId; - if(nMsgId==WH_MSG_SEARCHINDEXKEY) - { - if(oMsg.oParam && oMsg.oParam.sInput) - { - if(gsCK==null) - { - gsCK=oMsg.oParam.sInput; - gbCR = oMsg.oParam.bCR; - findCK(); - } - else - { - gsBCK=oMsg.oParam.sInput; - gbBCR = oMsg.oParam.bCR; - } - } - } - else if(nMsgId==WH_MSG_PROJECTREADY) - { - loadIdx(); - } - } - return true; -} - -if(window.gbWhVer&&window.gbWhLang&&window.gbWhMsg&&window.gbWhUtil&&window.gbWhHost&&window.gbWhProxy) -{ - RegisterListener2(this,WH_MSG_PROJECTREADY); - RegisterListener2(this,WH_MSG_SEARCHINDEXKEY); - goIdxFont=new whFont("Verdana","8pt","#000000","normal","normal","none"); - goIdxEmptyFont=new whFont("Verdana","8pt","#666666","normal","normal","none"); - goIdxHoverFont=new whFont("Verdana","8pt","#007f00","normal","normal","underline"); - - window.onload=window_OnLoad; - window.onbeforeunload=window_BUnload; - window.onunload=window_Unload; - gbWhIHost=true; -} -else - document.location.reload(); - +// WebHelp 5.10.002 +var gsDefaultTarget="bsscright"; +var gsBgColor="#ffffff"; +var gsBgImage=""; +var goIdxFont=null; +var goIdxEmptyFont=null; +var goIdxHoverFont=null; +var gsIdxMargin="0pt"; +var gsIdxIndent="8pt"; +var gsIdxActiveBgColor="#cccccc"; +var gsCK = null; +var gsBCK = null; +var gbCR = false; +var gbBCR = false; +var gbWhIHost=true; + +function myEvent() +{ + this.pageX = 0; + this.pageY = 0; +} +var _event=new myEvent(); + +function setBackgroundcolor(sBgColor) +{ + gsBgColor=sBgColor; +} + +function setBackground(sBgImage) +{ + gsBgImage=sBgImage; +} + +function setFont(sType,sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration) +{ + var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration); + if(sType=="Normal") + goIdxFont=vFont; + else if(sType=="Empty") + goIdxEmptyFont=vFont; + else if(sType=="Hover") + goIdxHoverFont=vFont; +} + +function setActiveBgColor(sBgColor) +{ + gsIdxActiveBgColor=sBgColor; +} + +function setMargin(sMargin) +{ + gsIdxMargin=sMargin; +} + +function setIndent(sIndent) +{ + gsIdxIndent=sIndent; +} + +function writeOneItem(oHTML,bDown,aDataCon,aCurIdxSet,nLength,aPos,nLevel) +{ + var sHTML=""; + var nIdxSet=aCurIdxSet[0]; + var nIIdx=aPos[nIdxSet]; + var sKOriName=getItemName(aDataCon,nIdxSet,nIIdx); + var sKName=_textToHtml(sKOriName); + + var nIdxIndent=parseInt(gsIdxIndent); + var sTopics=""; + if(nLevel==1){ + if(getItemType(aDataCon,nIdxSet,nIIdx)==1) + { + sHTML+="
"; + sHTML+=""+sKName+"
"; + } + else{ + for(var i=0;i"; + sHTML+="0) + sHTML+=sTopics+");return false;\">"+sKName+"

"; + else + sHTML+=");return false;\" style=\""+getFontStyle(goIdxEmptyFont)+"\">"+sKName+"

"; + } + } + else if(nLevel>=2){ + var nIndent=nIdxIndent*nLevel; + for(var i=0;i"; + else + sHTML+="
"; + sHTML+="0) + sHTML+=sTopics+");return false;\">"+sKName+"
"; + else + sHTML+=");return false;\" style=\""+getFontStyle(goIdxEmptyFont)+"\">"+sKName+""; + } + oHTML.addHTML(sHTML,nLength,bDown,(nLevel==1),sKOriName); +} + +function getTargetName(aDataCon,nIdxSet,nIIdx) +{ + if(nIdxSetnIIdx) + if(aDataCon[nIdxSet].aKs[nIIdx].sTarget) + return aDataCon[nIdxSet].aKs[nIIdx].sTarget; + return gsDefaultTarget; +} + +function mergeItems(oHTML,bDown,aDataCon,aCurIdxSet,nLength,aPos,nLevel) +{ + var oLocalHTML=new indexHTMLPart(); + writeOneItem(oLocalHTML,bDown,aDataCon,aCurIdxSet,nLength,aPos,nLevel); + + var aLocalPos=new Array(); + var aMaxPos=new Array(); + for(var i=0;i0) + aMaxPos[aCurIdxSet[i]]=aLocalPos[aCurIdxSet[i]]+nNKOff; + } + var oSubHTML=new indexHTMLPart(); + writeItems(oSubHTML,aDataCon,aLocalPos,null,aMaxPos,true,nLevel+1); + oLocalHTML.addSubHTML(oSubHTML,true); + oHTML.appendHTML(oLocalHTML,bDown); +} + +function adjustPosition(bDown,aDataCon,aCurIdxSet,nLength,aPos) +{ + if(bDown) + { + for(var i=0;inIIdx) + return aDataCon[nIdxSet].aKs[nIIdx].sName; + else + return null; +} + +function getItemType(aDataCon,nIdxSet,nIIdx) +{ + if(nIdxSetnIIdx) + return aDataCon[nIdxSet].aKs[nIIdx].nType; + else + return 0; +} + +function getNKOff(aDataCon,nIdxSet,nIIdx) +{ + if(nIdxSetnIIdx) + return aDataCon[nIdxSet].aKs[nIIdx].nNKOff; + else + return null; +} + +function getPKOff(aDataCon,nIdxSet,nIIdx) +{ + if(nIdxSetnIIdx) + return aDataCon[nIdxSet].aKs[nIIdx].nPKOff; + else + return null; +} + +function window_OnLoad() +{ + if(gsBgImage&&gsBgImage.length>0) + { + document.body.background=gsBgImage; + } + if(gsBgColor&&gsBgColor.length>0) + { + document.body.bgColor=gsBgColor; + } + document.body.insertAdjacentHTML("beforeEnd",writeLoadingDiv()); + loadIdx(); + var oMsg=new whMessage(WH_MSG_SHOWIDX,this,1,null) + SendMessage(oMsg); +} + +function loadIdx() +{ + if(!gbReady) + { + var oResMsg=new whMessage(WH_MSG_GETPROJINFO,this,1,null); + if(SendMessage(oResMsg)&&oResMsg.oParam) + { + gbReady=true; + var oProj=oResMsg.oParam; + var aProj=oProj.aProj; + gbXML=oProj.bXML; + if(aProj.length>0) + { + var sLangId=aProj[0].sLangId; + for(var i=0;inIIdx) + { + if(aDataCon[nIdxSet].aKs[nIIdx].aTopics) + { + var nLen=aDataCon[nIdxSet].aKs[nIIdx].aTopics.length; + var nProj=aDataCon[nIdxSet].nProjId; + var sPath=gaData[nProj].sPPath; + for(var i=0;i>1; + sItem=getInnerText(oP[nM]); + + if(compare(sItem,sK)==0) + { + bF=true; + break; + } + else if(compare(sItem,sK)>0) + nE=nM-1; + else if(compare(sItem,sK)<0) + nB=nM; + } + if(!bF) + { + if(nB==nE) nM=nB; + + if(nM+10){ + var nbTag=getElementsByTag(oMatch,"NOBR"); + if(nbTag&&nbTag.length>0) + HighLightElement(nbTag[0], gsIdxActiveBgColor, "transparent"); + if (gbCR) + { + if (gbIE4) + tempColl(0).click(); + else + { + var strCommand = tempColl[0].getAttribute("onClick"); + var nstrCommand = strCommand.indexOf(";"); + strCommand = strCommand.substring(0, nstrCommand); + strCommand = strCommand.replace("event", "_event"); + window._event.pageX = oMatch.offsetLeft ; + window._event.pageY = oMatch.offsetTop + 20; + window.setTimeout(strCommand, 100); + } + } + } + } + gsCK=gsBCK; + gbCR=gbBCR; + if(gsBCK!=null) + { + gsBCK=null; + gbBCR=false; + findCK(); + return false; + } + + } + return true; +} + +function clearHighLight() +{ + resetHighLight(gsBgColor); +} + +function IndexWriteClassStyle() +{ + var sStyle=""; + sStyle+=""; + document.write(sStyle); + return; +} + +function window_Unload() +{ + UnRegisterListener2(this,WH_MSG_PROJECTREADY); + UnRegisterListener2(this,WH_MSG_SEARCHINDEXKEY); +} + +function onSendMessage(oMsg) +{ + if(oMsg) + { + var nMsgId=oMsg.nMessageId; + if(nMsgId==WH_MSG_SEARCHINDEXKEY) + { + if(oMsg.oParam && oMsg.oParam.sInput) + { + if(gsCK==null) + { + gsCK=oMsg.oParam.sInput; + gbCR = oMsg.oParam.bCR; + findCK(); + } + else + { + gsBCK=oMsg.oParam.sInput; + gbBCR = oMsg.oParam.bCR; + } + } + } + else if(nMsgId==WH_MSG_PROJECTREADY) + { + loadIdx(); + } + } + return true; +} + +if(window.gbWhVer&&window.gbWhLang&&window.gbWhMsg&&window.gbWhUtil&&window.gbWhHost&&window.gbWhProxy) +{ + RegisterListener2(this,WH_MSG_PROJECTREADY); + RegisterListener2(this,WH_MSG_SEARCHINDEXKEY); + goIdxFont=new whFont("Verdana","8pt","#000000","normal","normal","none"); + goIdxEmptyFont=new whFont("Verdana","8pt","#666666","normal","normal","none"); + goIdxHoverFont=new whFont("Verdana","8pt","#007f00","normal","normal","underline"); + + window.onload=window_OnLoad; + window.onbeforeunload=window_BUnload; + window.onunload=window_Unload; + gbWhIHost=true; +} +else + document.location.reload(); + diff --git a/doc/salome/gui/SMESH/whlang.js b/doc/salome/gui/SMESH/whlang.js index 870be0e17..fb848c513 100755 --- a/doc/salome/gui/SMESH/whlang.js +++ b/doc/salome/gui/SMESH/whlang.js @@ -1,453 +1,453 @@ -// WebHelp 5.10.001 -var garrSortChar=new Array(); -var gaFtsStop=new Array(); -var gaFtsStem=new Array(); -var gbWhLang=false; - -garrSortChar[0] = 0; -garrSortChar[1] = 1; -garrSortChar[2] = 2; -garrSortChar[3] = 3; -garrSortChar[4] = 4; -garrSortChar[5] = 5; -garrSortChar[6] = 6; -garrSortChar[7] = 7; -garrSortChar[8] = 8; -garrSortChar[9] = 40; -garrSortChar[10] = 41; -garrSortChar[11] = 42; -garrSortChar[12] = 43; -garrSortChar[13] = 44; -garrSortChar[14] = 9; -garrSortChar[15] = 10; -garrSortChar[16] = 11; -garrSortChar[17] = 12; -garrSortChar[18] = 13; -garrSortChar[19] = 14; -garrSortChar[20] = 15; -garrSortChar[21] = 16; -garrSortChar[22] = 17; -garrSortChar[23] = 18; -garrSortChar[24] = 19; -garrSortChar[25] = 20; -garrSortChar[26] = 21; -garrSortChar[27] = 22; -garrSortChar[28] = 23; -garrSortChar[29] = 24; -garrSortChar[30] = 25; -garrSortChar[31] = 26; -garrSortChar[32] = 38; -garrSortChar[33] = 45; -garrSortChar[34] = 46; -garrSortChar[35] = 47; -garrSortChar[36] = 48; -garrSortChar[37] = 49; -garrSortChar[38] = 50; -garrSortChar[39] = 33; -garrSortChar[40] = 51; -garrSortChar[41] = 52; -garrSortChar[42] = 53; -garrSortChar[43] = 88; -garrSortChar[44] = 54; -garrSortChar[45] = 34; -garrSortChar[46] = 55; -garrSortChar[47] = 56; -garrSortChar[48] = 115; -garrSortChar[49] = 119; -garrSortChar[50] = 121; -garrSortChar[51] = 123; -garrSortChar[52] = 125; -garrSortChar[53] = 126; -garrSortChar[54] = 127; -garrSortChar[55] = 128; -garrSortChar[56] = 129; -garrSortChar[57] = 130; -garrSortChar[58] = 57; -garrSortChar[59] = 58; -garrSortChar[60] = 89; -garrSortChar[61] = 90; -garrSortChar[62] = 91; -garrSortChar[63] = 59; -garrSortChar[64] = 60; -garrSortChar[65] = 131; -garrSortChar[66] = 148; -garrSortChar[67] = 150; -garrSortChar[68] = 154; -garrSortChar[69] = 158; -garrSortChar[70] = 168; -garrSortChar[71] = 171; -garrSortChar[72] = 173; -garrSortChar[73] = 175; -garrSortChar[74] = 185; -garrSortChar[75] = 187; -garrSortChar[76] = 189; -garrSortChar[77] = 191; -garrSortChar[78] = 193; -garrSortChar[79] = 197; -garrSortChar[80] = 214; -garrSortChar[81] = 216; -garrSortChar[82] = 218; -garrSortChar[83] = 220; -garrSortChar[84] = 225; -garrSortChar[85] = 230; -garrSortChar[86] = 240; -garrSortChar[87] = 242; -garrSortChar[88] = 244; -garrSortChar[89] = 246; -garrSortChar[90] = 252; -garrSortChar[91] = 61; -garrSortChar[92] = 62; -garrSortChar[93] = 63; -garrSortChar[94] = 64; -garrSortChar[95] = 66; -garrSortChar[96] = 67; -garrSortChar[97] = 131; -garrSortChar[98] = 148; -garrSortChar[99] = 150; -garrSortChar[100] = 154; -garrSortChar[101] = 158; -garrSortChar[102] = 168; -garrSortChar[103] = 171; -garrSortChar[104] = 173; -garrSortChar[105] = 175; -garrSortChar[106] = 185; -garrSortChar[107] = 187; -garrSortChar[108] = 189; -garrSortChar[109] = 191; -garrSortChar[110] = 193; -garrSortChar[111] = 197; -garrSortChar[112] = 214; -garrSortChar[113] = 216; -garrSortChar[114] = 218; -garrSortChar[115] = 220; -garrSortChar[116] = 225; -garrSortChar[117] = 230; -garrSortChar[118] = 240; -garrSortChar[119] = 242; -garrSortChar[120] = 244; -garrSortChar[121] = 246; -garrSortChar[122] = 252; -garrSortChar[123] = 68; -garrSortChar[124] = 69; -garrSortChar[125] = 70; -garrSortChar[126] = 71; -garrSortChar[127] = 27; -garrSortChar[128] = 114; -garrSortChar[129] = 28; -garrSortChar[130] = 82; -garrSortChar[131] = 170; -garrSortChar[132] = 85; -garrSortChar[133] = 112; -garrSortChar[134] = 109; -garrSortChar[135] = 110; -garrSortChar[136] = 65; -garrSortChar[137] = 113; -garrSortChar[138] = 223; -garrSortChar[139] = 86; -garrSortChar[140] = 213; -garrSortChar[141] = 29; -garrSortChar[142] = 255; -garrSortChar[143] = 30; -garrSortChar[144] = 31; -garrSortChar[145] = 80; -garrSortChar[146] = 81; -garrSortChar[147] = 83; -garrSortChar[148] = 84; -garrSortChar[149] = 111; -garrSortChar[150] = 36; -garrSortChar[151] = 37; -garrSortChar[152] = 79; -garrSortChar[153] = 229; -garrSortChar[154] = 222; -garrSortChar[155] = 87; -garrSortChar[156] = 212; -garrSortChar[157] = 32; -garrSortChar[158] = 254; -garrSortChar[159] = 251; -garrSortChar[160] = 39; -garrSortChar[161] = 72; -garrSortChar[162] = 97; -garrSortChar[163] = 98; -garrSortChar[164] = 99; -garrSortChar[165] = 100; -garrSortChar[166] = 73; -garrSortChar[167] = 101; -garrSortChar[168] = 74; -garrSortChar[169] = 102; -garrSortChar[170] = 133; -garrSortChar[171] = 93; -garrSortChar[172] = 103; -garrSortChar[173] = 35; -garrSortChar[174] = 104; -garrSortChar[175] = 75; -garrSortChar[176] = 105; -garrSortChar[177] = 92; -garrSortChar[178] = 122; -garrSortChar[179] = 124; -garrSortChar[180] = 76; -garrSortChar[181] = 106; -garrSortChar[182] = 107; -garrSortChar[183] = 108; -garrSortChar[184] = 77; -garrSortChar[185] = 120; -garrSortChar[186] = 199; -garrSortChar[187] = 94; -garrSortChar[188] = 116; -garrSortChar[189] = 117; -garrSortChar[190] = 118; -garrSortChar[191] = 78; -garrSortChar[192] = 131; -garrSortChar[193] = 131; -garrSortChar[194] = 131; -garrSortChar[195] = 131; -garrSortChar[196] = 131; -garrSortChar[197] = 131; -garrSortChar[198] = 131; -garrSortChar[199] = 150; -garrSortChar[200] = 158; -garrSortChar[201] = 158; -garrSortChar[202] = 158; -garrSortChar[203] = 158; -garrSortChar[204] = 175; -garrSortChar[205] = 175; -garrSortChar[206] = 175; -garrSortChar[207] = 175; -garrSortChar[208] = 154; -garrSortChar[209] = 193; -garrSortChar[210] = 197; -garrSortChar[211] = 197; -garrSortChar[212] = 197; -garrSortChar[213] = 197; -garrSortChar[214] = 197; -garrSortChar[215] = 95; -garrSortChar[216] = 197; -garrSortChar[217] = 230; -garrSortChar[218] = 230; -garrSortChar[219] = 230; -garrSortChar[220] = 230; -garrSortChar[221] = 246; -garrSortChar[222] = 227; -garrSortChar[223] = 224; -garrSortChar[224] = 131; -garrSortChar[225] = 131; -garrSortChar[226] = 131; -garrSortChar[227] = 131; -garrSortChar[228] = 131; -garrSortChar[229] = 131; -garrSortChar[230] = 131; -garrSortChar[231] = 150; -garrSortChar[232] = 158; -garrSortChar[233] = 158; -garrSortChar[234] = 158; -garrSortChar[235] = 158; -garrSortChar[236] = 175; -garrSortChar[237] = 175; -garrSortChar[238] = 175; -garrSortChar[239] = 175; -garrSortChar[240] = 154; -garrSortChar[241] = 193; -garrSortChar[242] = 197; -garrSortChar[243] = 197; -garrSortChar[244] = 197; -garrSortChar[245] = 197; -garrSortChar[246] = 197; -garrSortChar[247] = 96; -garrSortChar[248] = 197; -garrSortChar[249] = 230; -garrSortChar[250] = 230; -garrSortChar[251] = 230; -garrSortChar[252] = 230; -garrSortChar[253] = 246; -garrSortChar[254] = 227; -garrSortChar[255] = 250; - -gaFtsStop[0] = "a"; -gaFtsStop[1] = "about"; -gaFtsStop[2] = "after"; -gaFtsStop[3] = "against"; -gaFtsStop[4] = "all"; -gaFtsStop[5] = "also"; -gaFtsStop[6] = "among"; -gaFtsStop[7] = "an"; -gaFtsStop[8] = "and"; -gaFtsStop[9] = "are"; -gaFtsStop[10] = "as"; -gaFtsStop[11] = "at"; -gaFtsStop[12] = "be"; -gaFtsStop[13] = "became"; -gaFtsStop[14] = "because"; -gaFtsStop[15] = "been"; -gaFtsStop[16] = "between"; -gaFtsStop[17] = "but"; -gaFtsStop[18] = "by"; -gaFtsStop[19] = "can"; -gaFtsStop[20] = "come"; -gaFtsStop[21] = "do"; -gaFtsStop[22] = "during"; -gaFtsStop[23] = "each"; -gaFtsStop[24] = "early"; -gaFtsStop[25] = "for"; -gaFtsStop[26] = "form"; -gaFtsStop[27] = "found"; -gaFtsStop[28] = "from"; -gaFtsStop[29] = "had"; -gaFtsStop[30] = "has"; -gaFtsStop[31] = "have"; -gaFtsStop[32] = "he"; -gaFtsStop[33] = "her"; -gaFtsStop[34] = "his"; -gaFtsStop[35] = "however"; -gaFtsStop[36] = "in"; -gaFtsStop[37] = "include"; -gaFtsStop[38] = "into"; -gaFtsStop[39] = "is"; -gaFtsStop[40] = "it"; -gaFtsStop[41] = "its"; -gaFtsStop[42] = "late"; -gaFtsStop[43] = "later"; -gaFtsStop[44] = "made"; -gaFtsStop[45] = "many"; -gaFtsStop[46] = "may"; -gaFtsStop[47] = "me"; -gaFtsStop[48] = "med"; -gaFtsStop[49] = "more"; -gaFtsStop[50] = "most"; -gaFtsStop[51] = "near"; -gaFtsStop[52] = "no"; -gaFtsStop[53] = "non"; -gaFtsStop[54] = "not"; -gaFtsStop[55] = "of"; -gaFtsStop[56] = "on"; -gaFtsStop[57] = "only"; -gaFtsStop[58] = "or"; -gaFtsStop[59] = "other"; -gaFtsStop[60] = "over"; -gaFtsStop[61] = "several"; -gaFtsStop[62] = "she"; -gaFtsStop[63] = "some"; -gaFtsStop[64] = "such"; -gaFtsStop[65] = "than"; -gaFtsStop[66] = "that"; -gaFtsStop[67] = "the"; -gaFtsStop[68] = "their"; -gaFtsStop[69] = "then"; -gaFtsStop[70] = "there"; -gaFtsStop[71] = "these"; -gaFtsStop[72] = "they"; -gaFtsStop[73] = "this"; -gaFtsStop[74] = "through"; -gaFtsStop[75] = "to"; -gaFtsStop[76] = "under"; -gaFtsStop[77] = "until"; -gaFtsStop[78] = "use"; -gaFtsStop[79] = "was"; -gaFtsStop[80] = "we"; -gaFtsStop[81] = "were"; -gaFtsStop[82] = "when"; -gaFtsStop[83] = "where"; -gaFtsStop[84] = "which"; -gaFtsStop[85] = "who"; -gaFtsStop[86] = "with"; -gaFtsStop[87] = "you"; - -gaFtsStem[0] = "ed"; -gaFtsStem[1] = "es"; -gaFtsStem[2] = "er"; -gaFtsStem[3] = "e"; -gaFtsStem[4] = "s"; -gaFtsStem[5] = "ingly"; -gaFtsStem[6] = "ing"; -gaFtsStem[7] = "ly"; - - -// as javascript 1.3 support unicode instead of ISO-Latin-1 -// need to transfer come code back to ISO-Latin-1 for compare purpose -// Note: Different Language(Code page) maybe need different array: -var gaUToC=new Array(); -gaUToC[8364]=128; -gaUToC[8218]=130; -gaUToC[402]=131; -gaUToC[8222]=132; -gaUToC[8230]=133; -gaUToC[8224]=134; -gaUToC[8225]=135; -gaUToC[710]=136; -gaUToC[8240]=137; -gaUToC[352]=138; -gaUToC[8249]=139; -gaUToC[338]=140; -gaUToC[381]=142; -gaUToC[8216]=145; -gaUToC[8217]=146; -gaUToC[8220]=147; -gaUToC[8221]=148; -gaUToC[8226]=149; -gaUToC[8211]=150; -gaUToC[8212]=151; -gaUToC[732]=152; -gaUToC[8482]=153; -gaUToC[353]=154; -gaUToC[8250]=155; -gaUToC[339]=156; -gaUToC[382]=158; -gaUToC[376]=159; - -var gsBiggestChar=""; -function getBiggestChar() -{ - if(gsBiggestChar.length==0) - { - if(garrSortChar.length<256) - gsBiggestChar=String.fromCharCode(255); - else - { - var nBiggest=0; - var nBigChar=0; - for(var i=0;i<=255;i++) - { - if(garrSortChar[i]>nBiggest) - { - nBiggest=garrSortChar[i]; - nBigChar=i; - } - } - gsBiggestChar=String.fromCharCode(nBigChar); - } - - } - return gsBiggestChar; -} - -function getCharCode(str,i) -{ - var code=str.charCodeAt(i) - if(code>256) - { - code=gaUToC[code]; - } - return code; -} - -function compare(strText1,strText2) -{ - if(garrSortChar.length<256) - { - var strt1=strText1.toLowerCase(); - var strt2=strText2.toLowerCase(); - if(strt1strt2) return 1; - return 0; - } - else - { - for(var i=0;igarrSortChar[getCharCode(strText2,i)]) return 1; - } - if(strText1.lengthstrText2.length) return 1; - return 0; - } -} +// WebHelp 5.10.001 +var garrSortChar=new Array(); +var gaFtsStop=new Array(); +var gaFtsStem=new Array(); +var gbWhLang=false; + +garrSortChar[0] = 0; +garrSortChar[1] = 1; +garrSortChar[2] = 2; +garrSortChar[3] = 3; +garrSortChar[4] = 4; +garrSortChar[5] = 5; +garrSortChar[6] = 6; +garrSortChar[7] = 7; +garrSortChar[8] = 8; +garrSortChar[9] = 40; +garrSortChar[10] = 41; +garrSortChar[11] = 42; +garrSortChar[12] = 43; +garrSortChar[13] = 44; +garrSortChar[14] = 9; +garrSortChar[15] = 10; +garrSortChar[16] = 11; +garrSortChar[17] = 12; +garrSortChar[18] = 13; +garrSortChar[19] = 14; +garrSortChar[20] = 15; +garrSortChar[21] = 16; +garrSortChar[22] = 17; +garrSortChar[23] = 18; +garrSortChar[24] = 19; +garrSortChar[25] = 20; +garrSortChar[26] = 21; +garrSortChar[27] = 22; +garrSortChar[28] = 23; +garrSortChar[29] = 24; +garrSortChar[30] = 25; +garrSortChar[31] = 26; +garrSortChar[32] = 38; +garrSortChar[33] = 45; +garrSortChar[34] = 46; +garrSortChar[35] = 47; +garrSortChar[36] = 48; +garrSortChar[37] = 49; +garrSortChar[38] = 50; +garrSortChar[39] = 33; +garrSortChar[40] = 51; +garrSortChar[41] = 52; +garrSortChar[42] = 53; +garrSortChar[43] = 88; +garrSortChar[44] = 54; +garrSortChar[45] = 34; +garrSortChar[46] = 55; +garrSortChar[47] = 56; +garrSortChar[48] = 115; +garrSortChar[49] = 119; +garrSortChar[50] = 121; +garrSortChar[51] = 123; +garrSortChar[52] = 125; +garrSortChar[53] = 126; +garrSortChar[54] = 127; +garrSortChar[55] = 128; +garrSortChar[56] = 129; +garrSortChar[57] = 130; +garrSortChar[58] = 57; +garrSortChar[59] = 58; +garrSortChar[60] = 89; +garrSortChar[61] = 90; +garrSortChar[62] = 91; +garrSortChar[63] = 59; +garrSortChar[64] = 60; +garrSortChar[65] = 131; +garrSortChar[66] = 148; +garrSortChar[67] = 150; +garrSortChar[68] = 154; +garrSortChar[69] = 158; +garrSortChar[70] = 168; +garrSortChar[71] = 171; +garrSortChar[72] = 173; +garrSortChar[73] = 175; +garrSortChar[74] = 185; +garrSortChar[75] = 187; +garrSortChar[76] = 189; +garrSortChar[77] = 191; +garrSortChar[78] = 193; +garrSortChar[79] = 197; +garrSortChar[80] = 214; +garrSortChar[81] = 216; +garrSortChar[82] = 218; +garrSortChar[83] = 220; +garrSortChar[84] = 225; +garrSortChar[85] = 230; +garrSortChar[86] = 240; +garrSortChar[87] = 242; +garrSortChar[88] = 244; +garrSortChar[89] = 246; +garrSortChar[90] = 252; +garrSortChar[91] = 61; +garrSortChar[92] = 62; +garrSortChar[93] = 63; +garrSortChar[94] = 64; +garrSortChar[95] = 66; +garrSortChar[96] = 67; +garrSortChar[97] = 131; +garrSortChar[98] = 148; +garrSortChar[99] = 150; +garrSortChar[100] = 154; +garrSortChar[101] = 158; +garrSortChar[102] = 168; +garrSortChar[103] = 171; +garrSortChar[104] = 173; +garrSortChar[105] = 175; +garrSortChar[106] = 185; +garrSortChar[107] = 187; +garrSortChar[108] = 189; +garrSortChar[109] = 191; +garrSortChar[110] = 193; +garrSortChar[111] = 197; +garrSortChar[112] = 214; +garrSortChar[113] = 216; +garrSortChar[114] = 218; +garrSortChar[115] = 220; +garrSortChar[116] = 225; +garrSortChar[117] = 230; +garrSortChar[118] = 240; +garrSortChar[119] = 242; +garrSortChar[120] = 244; +garrSortChar[121] = 246; +garrSortChar[122] = 252; +garrSortChar[123] = 68; +garrSortChar[124] = 69; +garrSortChar[125] = 70; +garrSortChar[126] = 71; +garrSortChar[127] = 27; +garrSortChar[128] = 114; +garrSortChar[129] = 28; +garrSortChar[130] = 82; +garrSortChar[131] = 170; +garrSortChar[132] = 85; +garrSortChar[133] = 112; +garrSortChar[134] = 109; +garrSortChar[135] = 110; +garrSortChar[136] = 65; +garrSortChar[137] = 113; +garrSortChar[138] = 223; +garrSortChar[139] = 86; +garrSortChar[140] = 213; +garrSortChar[141] = 29; +garrSortChar[142] = 255; +garrSortChar[143] = 30; +garrSortChar[144] = 31; +garrSortChar[145] = 80; +garrSortChar[146] = 81; +garrSortChar[147] = 83; +garrSortChar[148] = 84; +garrSortChar[149] = 111; +garrSortChar[150] = 36; +garrSortChar[151] = 37; +garrSortChar[152] = 79; +garrSortChar[153] = 229; +garrSortChar[154] = 222; +garrSortChar[155] = 87; +garrSortChar[156] = 212; +garrSortChar[157] = 32; +garrSortChar[158] = 254; +garrSortChar[159] = 251; +garrSortChar[160] = 39; +garrSortChar[161] = 72; +garrSortChar[162] = 97; +garrSortChar[163] = 98; +garrSortChar[164] = 99; +garrSortChar[165] = 100; +garrSortChar[166] = 73; +garrSortChar[167] = 101; +garrSortChar[168] = 74; +garrSortChar[169] = 102; +garrSortChar[170] = 133; +garrSortChar[171] = 93; +garrSortChar[172] = 103; +garrSortChar[173] = 35; +garrSortChar[174] = 104; +garrSortChar[175] = 75; +garrSortChar[176] = 105; +garrSortChar[177] = 92; +garrSortChar[178] = 122; +garrSortChar[179] = 124; +garrSortChar[180] = 76; +garrSortChar[181] = 106; +garrSortChar[182] = 107; +garrSortChar[183] = 108; +garrSortChar[184] = 77; +garrSortChar[185] = 120; +garrSortChar[186] = 199; +garrSortChar[187] = 94; +garrSortChar[188] = 116; +garrSortChar[189] = 117; +garrSortChar[190] = 118; +garrSortChar[191] = 78; +garrSortChar[192] = 131; +garrSortChar[193] = 131; +garrSortChar[194] = 131; +garrSortChar[195] = 131; +garrSortChar[196] = 131; +garrSortChar[197] = 131; +garrSortChar[198] = 131; +garrSortChar[199] = 150; +garrSortChar[200] = 158; +garrSortChar[201] = 158; +garrSortChar[202] = 158; +garrSortChar[203] = 158; +garrSortChar[204] = 175; +garrSortChar[205] = 175; +garrSortChar[206] = 175; +garrSortChar[207] = 175; +garrSortChar[208] = 154; +garrSortChar[209] = 193; +garrSortChar[210] = 197; +garrSortChar[211] = 197; +garrSortChar[212] = 197; +garrSortChar[213] = 197; +garrSortChar[214] = 197; +garrSortChar[215] = 95; +garrSortChar[216] = 197; +garrSortChar[217] = 230; +garrSortChar[218] = 230; +garrSortChar[219] = 230; +garrSortChar[220] = 230; +garrSortChar[221] = 246; +garrSortChar[222] = 227; +garrSortChar[223] = 224; +garrSortChar[224] = 131; +garrSortChar[225] = 131; +garrSortChar[226] = 131; +garrSortChar[227] = 131; +garrSortChar[228] = 131; +garrSortChar[229] = 131; +garrSortChar[230] = 131; +garrSortChar[231] = 150; +garrSortChar[232] = 158; +garrSortChar[233] = 158; +garrSortChar[234] = 158; +garrSortChar[235] = 158; +garrSortChar[236] = 175; +garrSortChar[237] = 175; +garrSortChar[238] = 175; +garrSortChar[239] = 175; +garrSortChar[240] = 154; +garrSortChar[241] = 193; +garrSortChar[242] = 197; +garrSortChar[243] = 197; +garrSortChar[244] = 197; +garrSortChar[245] = 197; +garrSortChar[246] = 197; +garrSortChar[247] = 96; +garrSortChar[248] = 197; +garrSortChar[249] = 230; +garrSortChar[250] = 230; +garrSortChar[251] = 230; +garrSortChar[252] = 230; +garrSortChar[253] = 246; +garrSortChar[254] = 227; +garrSortChar[255] = 250; + +gaFtsStop[0] = "a"; +gaFtsStop[1] = "about"; +gaFtsStop[2] = "after"; +gaFtsStop[3] = "against"; +gaFtsStop[4] = "all"; +gaFtsStop[5] = "also"; +gaFtsStop[6] = "among"; +gaFtsStop[7] = "an"; +gaFtsStop[8] = "and"; +gaFtsStop[9] = "are"; +gaFtsStop[10] = "as"; +gaFtsStop[11] = "at"; +gaFtsStop[12] = "be"; +gaFtsStop[13] = "became"; +gaFtsStop[14] = "because"; +gaFtsStop[15] = "been"; +gaFtsStop[16] = "between"; +gaFtsStop[17] = "but"; +gaFtsStop[18] = "by"; +gaFtsStop[19] = "can"; +gaFtsStop[20] = "come"; +gaFtsStop[21] = "do"; +gaFtsStop[22] = "during"; +gaFtsStop[23] = "each"; +gaFtsStop[24] = "early"; +gaFtsStop[25] = "for"; +gaFtsStop[26] = "form"; +gaFtsStop[27] = "found"; +gaFtsStop[28] = "from"; +gaFtsStop[29] = "had"; +gaFtsStop[30] = "has"; +gaFtsStop[31] = "have"; +gaFtsStop[32] = "he"; +gaFtsStop[33] = "her"; +gaFtsStop[34] = "his"; +gaFtsStop[35] = "however"; +gaFtsStop[36] = "in"; +gaFtsStop[37] = "include"; +gaFtsStop[38] = "into"; +gaFtsStop[39] = "is"; +gaFtsStop[40] = "it"; +gaFtsStop[41] = "its"; +gaFtsStop[42] = "late"; +gaFtsStop[43] = "later"; +gaFtsStop[44] = "made"; +gaFtsStop[45] = "many"; +gaFtsStop[46] = "may"; +gaFtsStop[47] = "me"; +gaFtsStop[48] = "med"; +gaFtsStop[49] = "more"; +gaFtsStop[50] = "most"; +gaFtsStop[51] = "near"; +gaFtsStop[52] = "no"; +gaFtsStop[53] = "non"; +gaFtsStop[54] = "not"; +gaFtsStop[55] = "of"; +gaFtsStop[56] = "on"; +gaFtsStop[57] = "only"; +gaFtsStop[58] = "or"; +gaFtsStop[59] = "other"; +gaFtsStop[60] = "over"; +gaFtsStop[61] = "several"; +gaFtsStop[62] = "she"; +gaFtsStop[63] = "some"; +gaFtsStop[64] = "such"; +gaFtsStop[65] = "than"; +gaFtsStop[66] = "that"; +gaFtsStop[67] = "the"; +gaFtsStop[68] = "their"; +gaFtsStop[69] = "then"; +gaFtsStop[70] = "there"; +gaFtsStop[71] = "these"; +gaFtsStop[72] = "they"; +gaFtsStop[73] = "this"; +gaFtsStop[74] = "through"; +gaFtsStop[75] = "to"; +gaFtsStop[76] = "under"; +gaFtsStop[77] = "until"; +gaFtsStop[78] = "use"; +gaFtsStop[79] = "was"; +gaFtsStop[80] = "we"; +gaFtsStop[81] = "were"; +gaFtsStop[82] = "when"; +gaFtsStop[83] = "where"; +gaFtsStop[84] = "which"; +gaFtsStop[85] = "who"; +gaFtsStop[86] = "with"; +gaFtsStop[87] = "you"; + +gaFtsStem[0] = "ed"; +gaFtsStem[1] = "es"; +gaFtsStem[2] = "er"; +gaFtsStem[3] = "e"; +gaFtsStem[4] = "s"; +gaFtsStem[5] = "ingly"; +gaFtsStem[6] = "ing"; +gaFtsStem[7] = "ly"; + + +// as javascript 1.3 support unicode instead of ISO-Latin-1 +// need to transfer come code back to ISO-Latin-1 for compare purpose +// Note: Different Language(Code page) maybe need different array: +var gaUToC=new Array(); +gaUToC[8364]=128; +gaUToC[8218]=130; +gaUToC[402]=131; +gaUToC[8222]=132; +gaUToC[8230]=133; +gaUToC[8224]=134; +gaUToC[8225]=135; +gaUToC[710]=136; +gaUToC[8240]=137; +gaUToC[352]=138; +gaUToC[8249]=139; +gaUToC[338]=140; +gaUToC[381]=142; +gaUToC[8216]=145; +gaUToC[8217]=146; +gaUToC[8220]=147; +gaUToC[8221]=148; +gaUToC[8226]=149; +gaUToC[8211]=150; +gaUToC[8212]=151; +gaUToC[732]=152; +gaUToC[8482]=153; +gaUToC[353]=154; +gaUToC[8250]=155; +gaUToC[339]=156; +gaUToC[382]=158; +gaUToC[376]=159; + +var gsBiggestChar=""; +function getBiggestChar() +{ + if(gsBiggestChar.length==0) + { + if(garrSortChar.length<256) + gsBiggestChar=String.fromCharCode(255); + else + { + var nBiggest=0; + var nBigChar=0; + for(var i=0;i<=255;i++) + { + if(garrSortChar[i]>nBiggest) + { + nBiggest=garrSortChar[i]; + nBigChar=i; + } + } + gsBiggestChar=String.fromCharCode(nBigChar); + } + + } + return gsBiggestChar; +} + +function getCharCode(str,i) +{ + var code=str.charCodeAt(i) + if(code>256) + { + code=gaUToC[code]; + } + return code; +} + +function compare(strText1,strText2) +{ + if(garrSortChar.length<256) + { + var strt1=strText1.toLowerCase(); + var strt2=strText2.toLowerCase(); + if(strt1strt2) return 1; + return 0; + } + else + { + for(var i=0;igarrSortChar[getCharCode(strText2,i)]) return 1; + } + if(strText1.lengthstrText2.length) return 1; + return 0; + } +} gbWhLang=true; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whmozemu.js b/doc/salome/gui/SMESH/whmozemu.js index 84c6de1ed..8fd89b275 100755 --- a/doc/salome/gui/SMESH/whmozemu.js +++ b/doc/salome/gui/SMESH/whmozemu.js @@ -1,67 +1,67 @@ -// WebHelp 5.10.002 -if (! window.gbIE4 && window.gbNav6 && !document.childNodes[0].insertAdjacentHTML){ - -HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode) -{ - switch (where){ - case 'beforeBegin': - this.parentNode.insertBefore(parsedNode,this); - break; - case 'afterBegin': - this.insertBefore(parsedNode,this.firstChild); - break; - case 'beforeEnd': - this.appendChild(parsedNode); - break; - case 'afterEnd': - if (this.nextSibling){ - this.parentNode.insertBefore(parsedNode,this.nextSibling); - } else { - this.parentNode.appendChild(parsedNode); - } - break; - } -} - -HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr){ - - var r = this.ownerDocument.createRange(); - r.setStartBefore(this); - var parsedHTML = r.createContextualFragment(htmlStr); - this.insertAdjacentElement(where,parsedHTML); -} - - -HTMLElement.prototype.insertAdjacentText = function(where,txtStr){ - - var parsedText = document.createTextNode(txtStr); - this.insertAdjacentElement(where,parsedText); -} -} - -function testScroll() { - // Initialize scrollbar cache if necessary - if (window._pageXOffset==null) { - window._pageXOffset = window.pageXOffset; - window._pageYOffset = window.pageYOffset; - } - // Expose Internet Explorer compatible object model - document.scrollTop = window.pageYOffset; - document.scrollLeft = window.pageXOffset; - window.document.scrollHeight = document.height; - window.document.scrollWidth = document.width; - window.document.clientWidth = window.innerWidth; - window.document.clientHeight = window.innerHeight; - - // If cache!=current values, call the onscroll event - if (((window.pageXOffset!=window._pageXOffset) || (window.pageYOffset!=window._pageYOffset)) && (window.onscroll)) - window.onscroll(); - // Cache new values - window._pageXOffset = window.pageXOffset; - window._pageYOffset = window.pageYOffset; - } - -// Create compatibility layer for Netscape -if (window.gbNav6 && !window.gbNav7) { - setInterval("testScroll()",50) +// WebHelp 5.10.002 +if (! window.gbIE4 && window.gbNav6 && !document.childNodes[0].insertAdjacentHTML){ + +HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode) +{ + switch (where){ + case 'beforeBegin': + this.parentNode.insertBefore(parsedNode,this); + break; + case 'afterBegin': + this.insertBefore(parsedNode,this.firstChild); + break; + case 'beforeEnd': + this.appendChild(parsedNode); + break; + case 'afterEnd': + if (this.nextSibling){ + this.parentNode.insertBefore(parsedNode,this.nextSibling); + } else { + this.parentNode.appendChild(parsedNode); + } + break; + } +} + +HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr){ + + var r = this.ownerDocument.createRange(); + r.setStartBefore(this); + var parsedHTML = r.createContextualFragment(htmlStr); + this.insertAdjacentElement(where,parsedHTML); +} + + +HTMLElement.prototype.insertAdjacentText = function(where,txtStr){ + + var parsedText = document.createTextNode(txtStr); + this.insertAdjacentElement(where,parsedText); +} +} + +function testScroll() { + // Initialize scrollbar cache if necessary + if (window._pageXOffset==null) { + window._pageXOffset = window.pageXOffset; + window._pageYOffset = window.pageYOffset; + } + // Expose Internet Explorer compatible object model + document.scrollTop = window.pageYOffset; + document.scrollLeft = window.pageXOffset; + window.document.scrollHeight = document.height; + window.document.scrollWidth = document.width; + window.document.clientWidth = window.innerWidth; + window.document.clientHeight = window.innerHeight; + + // If cache!=current values, call the onscroll event + if (((window.pageXOffset!=window._pageXOffset) || (window.pageYOffset!=window._pageYOffset)) && (window.onscroll)) + window.onscroll(); + // Cache new values + window._pageXOffset = window.pageXOffset; + window._pageYOffset = window.pageYOffset; + } + +// Create compatibility layer for Netscape +if (window.gbNav6 && !window.gbNav7) { + setInterval("testScroll()",50) } \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whmsg.js b/doc/salome/gui/SMESH/whmsg.js index 52ffcd243..492114be7 100755 --- a/doc/salome/gui/SMESH/whmsg.js +++ b/doc/salome/gui/SMESH/whmsg.js @@ -1,69 +1,69 @@ -// WebHelp 5.10.002 -var WH_MSG_RESIZEPANE =0x0100; -var WH_MSG_SHOWPANE =0x0101; -var WH_MSG_HIDEPANE =0x0102; -var WH_MSG_SYNCTOC =0x0103; -var WH_MSG_NEXT =0x0104; -var WH_MSG_PREV =0x0105; -var WH_MSG_NOSEARCHINPUT =0x0106; -var WH_MSG_NOSYNC =0x0107; -var WH_MSG_ENABLEWEBSEARCH =0x0108; - -var WH_MSG_ISPANEVISIBLE =0x0109; -var WH_MSG_PANESTATUE =0x010a; - -var WH_MSG_SYNCINFO =0x010b; -var WH_MSG_PANEINFO =0x010c; -var WH_MSG_WEBSEARCH =0x010d; - -var WH_MSG_SEARCHINDEXKEY =0x0201; - -var WH_MSG_SEARCHFTSKEY =0x020a; - -var WH_MSG_PROJECTREADY =0x0301; -var WH_MSG_GETPROJINFO =0x0302; - -var WH_MSG_SHOWTOC =0x0401; -var WH_MSG_SHOWIDX =0x0402; -var WH_MSG_SHOWFTS =0x0403; -var WH_MSG_SHOWGLO =0x0404; - -var WH_MSG_SHOWGLODEF =0x0500; - -var WH_MSG_GETTOCPATHS =0x0600; -var WH_MSG_GETAVIAVENUES =0x0601; -var WH_MSG_GETCURRENTAVENUE =0x0602; -var WH_MSG_GETPANEINFO =0x0603; -var WH_MSG_AVENUEINFO =0x0604; - -var WH_MSG_GETSTARTFRAME =0x0701; -var WH_MSG_GETDEFAULTTOPIC =0x0702; - -var WH_MSG_SEARCHTHIS =0x0801; -var WH_MSG_GETSEARCHS =0x0802; - -var WH_MSG_ISINFRAMESET =0x0900; - -var WH_MSG_TOOLBARORDER =0x0a00; -var WH_MSG_MINIBARORDER =0x0a01; -var WH_MSG_ISSYNCSSUPPORT =0x0a02; -var WH_MSG_ISSEARCHSUPPORT =0x0a03; -var WH_MSG_GETPANETYPE =0x0a04; -var WH_MSG_BACKUPSEARCH =0x0a05; -var WH_MSG_GETPANES =0x0a06; -var WH_MSG_INITSEARCHSTRING =0x0a07; -var WH_MSG_RELOADNS6 =0x0a08; -var WH_MSG_ISAVENUESUPPORT =0x0a09; - -var WH_MSG_GETCMD =0x0b00; -var WH_MSG_GETPANE =0x0b01; -var WH_MSG_GETDEFPANE =0x0b02; - -function whMessage(nMessageId,wSender,nVersion,oParam) -{ - this.nMessageId=nMessageId; - this.wSender=wSender; - this.nVersion=nVersion; - this.oParam=oParam; -} +// WebHelp 5.10.002 +var WH_MSG_RESIZEPANE =0x0100; +var WH_MSG_SHOWPANE =0x0101; +var WH_MSG_HIDEPANE =0x0102; +var WH_MSG_SYNCTOC =0x0103; +var WH_MSG_NEXT =0x0104; +var WH_MSG_PREV =0x0105; +var WH_MSG_NOSEARCHINPUT =0x0106; +var WH_MSG_NOSYNC =0x0107; +var WH_MSG_ENABLEWEBSEARCH =0x0108; + +var WH_MSG_ISPANEVISIBLE =0x0109; +var WH_MSG_PANESTATUE =0x010a; + +var WH_MSG_SYNCINFO =0x010b; +var WH_MSG_PANEINFO =0x010c; +var WH_MSG_WEBSEARCH =0x010d; + +var WH_MSG_SEARCHINDEXKEY =0x0201; + +var WH_MSG_SEARCHFTSKEY =0x020a; + +var WH_MSG_PROJECTREADY =0x0301; +var WH_MSG_GETPROJINFO =0x0302; + +var WH_MSG_SHOWTOC =0x0401; +var WH_MSG_SHOWIDX =0x0402; +var WH_MSG_SHOWFTS =0x0403; +var WH_MSG_SHOWGLO =0x0404; + +var WH_MSG_SHOWGLODEF =0x0500; + +var WH_MSG_GETTOCPATHS =0x0600; +var WH_MSG_GETAVIAVENUES =0x0601; +var WH_MSG_GETCURRENTAVENUE =0x0602; +var WH_MSG_GETPANEINFO =0x0603; +var WH_MSG_AVENUEINFO =0x0604; + +var WH_MSG_GETSTARTFRAME =0x0701; +var WH_MSG_GETDEFAULTTOPIC =0x0702; + +var WH_MSG_SEARCHTHIS =0x0801; +var WH_MSG_GETSEARCHS =0x0802; + +var WH_MSG_ISINFRAMESET =0x0900; + +var WH_MSG_TOOLBARORDER =0x0a00; +var WH_MSG_MINIBARORDER =0x0a01; +var WH_MSG_ISSYNCSSUPPORT =0x0a02; +var WH_MSG_ISSEARCHSUPPORT =0x0a03; +var WH_MSG_GETPANETYPE =0x0a04; +var WH_MSG_BACKUPSEARCH =0x0a05; +var WH_MSG_GETPANES =0x0a06; +var WH_MSG_INITSEARCHSTRING =0x0a07; +var WH_MSG_RELOADNS6 =0x0a08; +var WH_MSG_ISAVENUESUPPORT =0x0a09; + +var WH_MSG_GETCMD =0x0b00; +var WH_MSG_GETPANE =0x0b01; +var WH_MSG_GETDEFPANE =0x0b02; + +function whMessage(nMessageId,wSender,nVersion,oParam) +{ + this.nMessageId=nMessageId; + this.wSender=wSender; + this.nVersion=nVersion; + this.oParam=oParam; +} var gbWhMsg=true; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whnjs.htm b/doc/salome/gui/SMESH/whnjs.htm index 33eec3535..d7da2cabc 100755 --- a/doc/salome/gui/SMESH/whnjs.htm +++ b/doc/salome/gui/SMESH/whnjs.htm @@ -1,25 +1,25 @@ - - -SMESH reference manual - - - - - - - - - - - -<p>Your browser does not support frames. We recommend that you update your browser to a version that supports frames.</p><p>To view the Help system without frames click on this<a href="whgdata/whnvp30.htm">hyperlink.</a></p> + + +Mesh Module Reference Manual + + + + + + + + + + + +<p>Your browser does not support frames. We recommend that you update your browser to a version that supports frames.</p><p>To view the Help system without frames click on this<a href="whgdata/whnvp30.htm">hyperlink.</a></p> \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whphost.js b/doc/salome/gui/SMESH/whphost.js index 9c91b49c8..b8f74f46f 100755 --- a/doc/salome/gui/SMESH/whphost.js +++ b/doc/salome/gui/SMESH/whphost.js @@ -1,581 +1,581 @@ -// WebHelp 5.10.005 -var gaProj=new Array(); -var gnChecked=0; -var gsProjName=""; -var gbReady=false; -var goMan=null; -var gbXML=false; -var gsFirstPane=""; -var gServerEnabled=false; -var gsPath=""; -var gbWhPHost=false; -var goDiv = null; -var gsHTML = ""; - -if (navigator.currentNavPen) - gsFirstPane = navigator.currentNavPen; - - -function delayLoad() -{ - if (goDiv&&gsHTML) - { - goDiv.innerHTML=gsHTML; - goDiv=null; - gsHTML=""; - } -} - -function whCom(sName,sComFile) -{ - this.msName=sName; - this.msDivId=sName+"Div"; - this.msIFrameId=sName+"IFrame"; - this.msComFile=sComFile; - this.mbloaded=false; - this.mbShow=false; - this.show=function(bShow) - { - if(this.mbShow!=bShow) - { - if(bShow&&!this.mbloaded) - { - this.load(); - } - - var oDiv=getElement(this.msDivId); - if(oDiv) - { - if(gbIE55||(gbIE5&&gbMac)) - { - var oIframe=getElement(this.msIFrameId); - if(oIframe) - { - if(bShow) - { - oDiv.style.zIndex=3; - if(oIframe!=null) - { - oIframe.style.zIndex=3; - if (!gbIE55) - oIframe.style.visibility="visible"; - } - } - else - { - oDiv.style.zIndex=2; - if(oIframe!=null) - { - oIframe.style.zIndex=2; - if (!gbIE55) - oIframe.style.visibility="hidden"; - } - } - } - } - if (!gbIE55) - oDiv.style.visibility=(bShow==true)?'visible':'hidden'; - this.mbShow=bShow; - } - - } - } - this.load=function() - { - if(!this.mbloaded) - { - if(this.msComFile.length>0){ - var strFile= _getFullPath(getPath(), this.msComFile); - var oDiv=getElement(this.msDivId); - if(oDiv){ - if(gbIE4||gbOpera7){ - var nIFrameHeight=oDiv.style.pixelHeight; - var nIFrameWidth=oDiv.style.pixelWidth; - var sHTML=""; - }else{ - sHTML+="100%; height:100%;\">"; - } - oDiv.innerHTML=sHTML; - }else if(gbNav6){ - gsHTML=""; - goDiv = oDiv; - setTimeout("delayLoad()", 100); - } - this.mbloaded=true; - } - } - } - } - this.unload=function() - { - var oDiv=getElement(this.msDivId); - if(oDiv) - oDiv.innerHTML=""; - } - this.getDivHTML=function() - { - var sHTML=""; - if(gbMac&&gbIE4) - sHTML+="
"; - else if(gbIE5) - sHTML+="
"; - else if(gbIE4||gbWindows) - sHTML+="
"; - else - sHTML+="
"; - sHTML+="
"; - return sHTML; - } -} - -function whComMan() -{ - this.sName=""; - this.maCom=new Array(); - this.addCom=function(sName,sComFile) - { - var owhCom=new whCom(sName,sComFile); - this.maCom[this.maCom.length]=owhCom; - } - this.init=function() - { - var sHTML=""; - for(var i=0;i0) - { - if(oMsg.oParam==1) - gsFirstPane="toc"; - else if(oMsg.oParam==2) - gsFirstPane="idx"; - else if(oMsg.oParam==3) - gsFirstPane="fts"; - else if(oMsg.oParam==4) - gsFirstPane="glo"; - } - else if(oMsg.oParam==0) - { - bHidePane=true; - } - } - goMan.init(); - if(gsProjName!="") - loadData2(gsProjName); - if (bHidePane) - { - gsFirstPane=""; - var oMsg1=new whMessage(WH_MSG_HIDEPANE, this, 1, null) - SendMessage(oMsg1); - } - else - { - if(gsFirstPane!="") - goMan.show(gsFirstPane); - else - goMan.showById(0); - } -} - -function setServerEnabled() -{ - gServerEnabled = true; -} - -function loadData2(strFile) -{ - if(gbXML) - loadDataXML(strFile); - else - loadData(strFile); -} - -function addProject(bPreferXML,sXMLName,sHTMLName) -{ - var bLoadXML=bPreferXML; - if(!gbIE4&&!gbNav6&&!gbOpera7) - return; - if(gbIE4&&!gbIE5) - bLoadXML=false; - if (gbIE5&&!gbMac) - bLoadXML=true; - if(gbIE55||gbNav6) - bLoadXML=true; - if(gbOpera7) - bLoadXML=false; - if(bLoadXML) - addProjectXML(sXMLName); - else - addProjectHTML(sHTMLName); -} - -function addProjectHTML(sName) -{ - gbXML=false; - gsProjName=sName; -} - -function addProjectXML(sName) -{ - gbXML=true; - gsProjName=sName; -} - -function window_MyBunload() -{ - goMan.unload(); - window_BUnload(); -} - -function putDataXML(xmlDoc,sdocPath) -{ - if(xmlDoc!=null) - { - var projectNode=xmlDoc.getElementsByTagName("project")[0]; - if(projectNode) - { - var aRProj=new Array(); - aRProj[0]=new Object(); - aRProj[0].sPPath=_getPath(sdocPath); - var sLangId=projectNode.getAttribute("langid"); - if(sLangId) - { - aRProj[0].sLangId=sLangId; - } - var sDPath=projectNode.getAttribute("datapath"); - if(sDPath) - { - if(sDPath.lastIndexOf("/")!=sDPath.length-1) - sDPath+="/"; - aRProj[0].sDPath=sDPath; - } - else - aRProj[0].sDPath=""; - aRProj[0].sToc=projectNode.getAttribute("toc"); - aRProj[0].sIdx=projectNode.getAttribute("index"); - aRProj[0].sFts=projectNode.getAttribute("fts"); - aRProj[0].sGlo=projectNode.getAttribute("glossary"); - var RmtProject=projectNode.getElementsByTagName("remote"); - var nCount=1; - for (var i=0;i 1 && document.body.clientHeight>1) - { - var oMsg = new whMessage(WH_MSG_RESIZEPANE, this, 1, null); - SendMessage(oMsg); - } - } -} - -function window_unload() -{ - UnRegisterListener2(this,WH_MSG_GETPROJINFO); - UnRegisterListener2(this,WH_MSG_SHOWTOC); - UnRegisterListener2(this,WH_MSG_SHOWIDX); - UnRegisterListener2(this,WH_MSG_SHOWFTS); - UnRegisterListener2(this,WH_MSG_SHOWGLO); - UnRegisterListener2(this,WH_MSG_GETPANEINFO); -} - -function onSendMessage(oMsg) -{ - if(oMsg) - { - var nMsgId=oMsg.nMessageId; - if(nMsgId==WH_MSG_GETPROJINFO) - { - if(gbReady) - { - var oProj=new Object(); - oProj.aProj=gaProj; - oProj.bXML=gbXML; - oMsg.oParam=oProj; - } - else - return false; - } - else if(nMsgId==WH_MSG_SHOWTOC) - { - if(goMan) - goMan.show("toc"); - var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "toc"); - SendMessage(onMsg); - onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null); - SendMessage(onMsg); - } - else if(nMsgId==WH_MSG_SHOWIDX) - { - if(goMan) - goMan.show("idx"); - var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "idx"); - SendMessage(onMsg); - onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null); - SendMessage(onMsg); - } - else if(nMsgId==WH_MSG_SHOWFTS) - { - if(goMan) - goMan.show("fts"); - var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "fts"); - SendMessage(onMsg); - onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null); - SendMessage(onMsg); - } - else if(nMsgId==WH_MSG_SHOWGLO) - { - if(goMan) - goMan.show("glo"); - var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "glo"); - SendMessage(onMsg); - onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null); - SendMessage(onMsg); - } - else if(nMsgId==WH_MSG_GETPANEINFO) - { - oMsg.oParam=goMan.getCurrent(); - return false; - } - } - return true; -} - -if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy) -{ - RegisterListener2(this,WH_MSG_GETPROJINFO); - RegisterListener2(this,WH_MSG_SHOWTOC); - RegisterListener2(this,WH_MSG_SHOWIDX); - RegisterListener2(this,WH_MSG_SHOWFTS); - RegisterListener2(this,WH_MSG_SHOWGLO); - RegisterListener2(this,WH_MSG_GETPANEINFO); - - if((gbMac&&gbIE4)||(gbSunOS&&gbIE5)||gbOpera7) - { - window.onresize=window_resize; - } - else if(gbIE4) - { - window.onresize=window_resize2; - } - window.onload=window_OnLoad; - window.onbeforeunload=window_MyBunload; - window.onunload=window_unload; - gbWhPHost=true; -} -else - document.location.reload(); - +// WebHelp 5.10.005 +var gaProj=new Array(); +var gnChecked=0; +var gsProjName=""; +var gbReady=false; +var goMan=null; +var gbXML=false; +var gsFirstPane=""; +var gServerEnabled=false; +var gsPath=""; +var gbWhPHost=false; +var goDiv = null; +var gsHTML = ""; + +if (navigator.currentNavPen) + gsFirstPane = navigator.currentNavPen; + + +function delayLoad() +{ + if (goDiv&&gsHTML) + { + goDiv.innerHTML=gsHTML; + goDiv=null; + gsHTML=""; + } +} + +function whCom(sName,sComFile) +{ + this.msName=sName; + this.msDivId=sName+"Div"; + this.msIFrameId=sName+"IFrame"; + this.msComFile=sComFile; + this.mbloaded=false; + this.mbShow=false; + this.show=function(bShow) + { + if(this.mbShow!=bShow) + { + if(bShow&&!this.mbloaded) + { + this.load(); + } + + var oDiv=getElement(this.msDivId); + if(oDiv) + { + if(gbIE55||(gbIE5&&gbMac)) + { + var oIframe=getElement(this.msIFrameId); + if(oIframe) + { + if(bShow) + { + oDiv.style.zIndex=3; + if(oIframe!=null) + { + oIframe.style.zIndex=3; + if (!gbIE55) + oIframe.style.visibility="visible"; + } + } + else + { + oDiv.style.zIndex=2; + if(oIframe!=null) + { + oIframe.style.zIndex=2; + if (!gbIE55) + oIframe.style.visibility="hidden"; + } + } + } + } + if (!gbIE55) + oDiv.style.visibility=(bShow==true)?'visible':'hidden'; + this.mbShow=bShow; + } + + } + } + this.load=function() + { + if(!this.mbloaded) + { + if(this.msComFile.length>0){ + var strFile= _getFullPath(getPath(), this.msComFile); + var oDiv=getElement(this.msDivId); + if(oDiv){ + if(gbIE4||gbOpera7){ + var nIFrameHeight=oDiv.style.pixelHeight; + var nIFrameWidth=oDiv.style.pixelWidth; + var sHTML=""; + }else{ + sHTML+="100%; height:100%;\">"; + } + oDiv.innerHTML=sHTML; + }else if(gbNav6){ + gsHTML=""; + goDiv = oDiv; + setTimeout("delayLoad()", 100); + } + this.mbloaded=true; + } + } + } + } + this.unload=function() + { + var oDiv=getElement(this.msDivId); + if(oDiv) + oDiv.innerHTML=""; + } + this.getDivHTML=function() + { + var sHTML=""; + if(gbMac&&gbIE4) + sHTML+="
"; + else if(gbIE5) + sHTML+="
"; + else if(gbIE4||gbWindows) + sHTML+="
"; + else + sHTML+="
"; + sHTML+="
"; + return sHTML; + } +} + +function whComMan() +{ + this.sName=""; + this.maCom=new Array(); + this.addCom=function(sName,sComFile) + { + var owhCom=new whCom(sName,sComFile); + this.maCom[this.maCom.length]=owhCom; + } + this.init=function() + { + var sHTML=""; + for(var i=0;i0) + { + if(oMsg.oParam==1) + gsFirstPane="toc"; + else if(oMsg.oParam==2) + gsFirstPane="idx"; + else if(oMsg.oParam==3) + gsFirstPane="fts"; + else if(oMsg.oParam==4) + gsFirstPane="glo"; + } + else if(oMsg.oParam==0) + { + bHidePane=true; + } + } + goMan.init(); + if(gsProjName!="") + loadData2(gsProjName); + if (bHidePane) + { + gsFirstPane=""; + var oMsg1=new whMessage(WH_MSG_HIDEPANE, this, 1, null) + SendMessage(oMsg1); + } + else + { + if(gsFirstPane!="") + goMan.show(gsFirstPane); + else + goMan.showById(0); + } +} + +function setServerEnabled() +{ + gServerEnabled = true; +} + +function loadData2(strFile) +{ + if(gbXML) + loadDataXML(strFile); + else + loadData(strFile); +} + +function addProject(bPreferXML,sXMLName,sHTMLName) +{ + var bLoadXML=bPreferXML; + if(!gbIE4&&!gbNav6&&!gbOpera7) + return; + if(gbIE4&&!gbIE5) + bLoadXML=false; + if (gbIE5&&!gbMac) + bLoadXML=true; + if(gbIE55||gbNav6) + bLoadXML=true; + if(gbOpera7) + bLoadXML=false; + if(bLoadXML) + addProjectXML(sXMLName); + else + addProjectHTML(sHTMLName); +} + +function addProjectHTML(sName) +{ + gbXML=false; + gsProjName=sName; +} + +function addProjectXML(sName) +{ + gbXML=true; + gsProjName=sName; +} + +function window_MyBunload() +{ + goMan.unload(); + window_BUnload(); +} + +function putDataXML(xmlDoc,sdocPath) +{ + if(xmlDoc!=null) + { + var projectNode=xmlDoc.getElementsByTagName("project")[0]; + if(projectNode) + { + var aRProj=new Array(); + aRProj[0]=new Object(); + aRProj[0].sPPath=_getPath(sdocPath); + var sLangId=projectNode.getAttribute("langid"); + if(sLangId) + { + aRProj[0].sLangId=sLangId; + } + var sDPath=projectNode.getAttribute("datapath"); + if(sDPath) + { + if(sDPath.lastIndexOf("/")!=sDPath.length-1) + sDPath+="/"; + aRProj[0].sDPath=sDPath; + } + else + aRProj[0].sDPath=""; + aRProj[0].sToc=projectNode.getAttribute("toc"); + aRProj[0].sIdx=projectNode.getAttribute("index"); + aRProj[0].sFts=projectNode.getAttribute("fts"); + aRProj[0].sGlo=projectNode.getAttribute("glossary"); + var RmtProject=projectNode.getElementsByTagName("remote"); + var nCount=1; + for (var i=0;i 1 && document.body.clientHeight>1) + { + var oMsg = new whMessage(WH_MSG_RESIZEPANE, this, 1, null); + SendMessage(oMsg); + } + } +} + +function window_unload() +{ + UnRegisterListener2(this,WH_MSG_GETPROJINFO); + UnRegisterListener2(this,WH_MSG_SHOWTOC); + UnRegisterListener2(this,WH_MSG_SHOWIDX); + UnRegisterListener2(this,WH_MSG_SHOWFTS); + UnRegisterListener2(this,WH_MSG_SHOWGLO); + UnRegisterListener2(this,WH_MSG_GETPANEINFO); +} + +function onSendMessage(oMsg) +{ + if(oMsg) + { + var nMsgId=oMsg.nMessageId; + if(nMsgId==WH_MSG_GETPROJINFO) + { + if(gbReady) + { + var oProj=new Object(); + oProj.aProj=gaProj; + oProj.bXML=gbXML; + oMsg.oParam=oProj; + } + else + return false; + } + else if(nMsgId==WH_MSG_SHOWTOC) + { + if(goMan) + goMan.show("toc"); + var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "toc"); + SendMessage(onMsg); + onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null); + SendMessage(onMsg); + } + else if(nMsgId==WH_MSG_SHOWIDX) + { + if(goMan) + goMan.show("idx"); + var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "idx"); + SendMessage(onMsg); + onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null); + SendMessage(onMsg); + } + else if(nMsgId==WH_MSG_SHOWFTS) + { + if(goMan) + goMan.show("fts"); + var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "fts"); + SendMessage(onMsg); + onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null); + SendMessage(onMsg); + } + else if(nMsgId==WH_MSG_SHOWGLO) + { + if(goMan) + goMan.show("glo"); + var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "glo"); + SendMessage(onMsg); + onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null); + SendMessage(onMsg); + } + else if(nMsgId==WH_MSG_GETPANEINFO) + { + oMsg.oParam=goMan.getCurrent(); + return false; + } + } + return true; +} + +if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy) +{ + RegisterListener2(this,WH_MSG_GETPROJINFO); + RegisterListener2(this,WH_MSG_SHOWTOC); + RegisterListener2(this,WH_MSG_SHOWIDX); + RegisterListener2(this,WH_MSG_SHOWFTS); + RegisterListener2(this,WH_MSG_SHOWGLO); + RegisterListener2(this,WH_MSG_GETPANEINFO); + + if((gbMac&&gbIE4)||(gbSunOS&&gbIE5)||gbOpera7) + { + window.onresize=window_resize; + } + else if(gbIE4) + { + window.onresize=window_resize2; + } + window.onload=window_OnLoad; + window.onbeforeunload=window_MyBunload; + window.onunload=window_unload; + gbWhPHost=true; +} +else + document.location.reload(); + diff --git a/doc/salome/gui/SMESH/whproj.htm b/doc/salome/gui/SMESH/whproj.htm index 821daea24..2549c9a7c 100755 --- a/doc/salome/gui/SMESH/whproj.htm +++ b/doc/salome/gui/SMESH/whproj.htm @@ -1,24 +1,24 @@ - - -project description - - - - - - - - - - + + +project description + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whproj.js b/doc/salome/gui/SMESH/whproj.js index ae38fa994..7f607a446 100755 --- a/doc/salome/gui/SMESH/whproj.js +++ b/doc/salome/gui/SMESH/whproj.js @@ -1,85 +1,85 @@ -// WebHelp 5.10.001 -var gaProj=new Array(); - -gaProj[0]=new project(""); - -function setLangId(sLangId) -{ - gaProj[0].sLangId=sLangId; -} - -function setDataPath(sPath) -{ - if(sPath.length!=0) - { - if(sPath.lastIndexOf("/")!=sPath.length-1) - sPath+="/"; - gaProj[0].sDPath=sPath; - } - else - gaProj[0].sDPath=""; -} - -function addToc(sFile) -{ - gaProj[0].sToc=sFile; -} - -function addIdx(sFile) -{ - gaProj[0].sIdx=sFile; -} - -function addFts(sFile) -{ - gaProj[0].sFts=sFile; -} - -function addGlo(sFile) -{ - gaProj[0].sGlo=sFile; -} - -function addRemoteProject(sProjRelPath) -{ - if(sProjRelPath.lastIndexOf("/")!=sProjRelPath.length-1) - sProjRelPath+="/"; - gaProj[gaProj.length]=new project(sProjRelPath); -} - -function project(sPPath) -{ - this.sPPath=sPPath; - this.sLangId=""; - this.sDPath=""; - this.sToc=""; - this.sIdx=""; - this.sFts=""; - this.sGlo=""; -} - -window.onload=window_OnLoad; - -function window_OnLoad() -{ - gsName=document.location.href; - gsName=_replaceSlash(gsName); - var nPos=gsName.lastIndexOf("/"); - if(nPos!=-1) - gaProj[0].sPPath=gsName.substring(0,nPos+1); - else - alert("Error in Loading navigation component. Please regenerate WebHelp."); - patchPath(gaProj); - if(parent&&parent!=this&& typeof(parent.putProjectInfo)=="function") - { - parent.putProjectInfo(gaProj); - } -} - -function patchPath(aProj) -{ - for(var i=1;i - - + + + diff --git a/doc/salome/gui/SMESH/whproxy.js b/doc/salome/gui/SMESH/whproxy.js index d0ee29813..8ea8b6819 100755 --- a/doc/salome/gui/SMESH/whproxy.js +++ b/doc/salome/gui/SMESH/whproxy.js @@ -1,74 +1,74 @@ -// WebHelp 5.10.001 -var gbInited=false; -var gWndStubPage=null; -function getStubPage() -{ - if(!gbInited) - { - gWndStubPage=getStubPage_inter(window); - gbInited=true; - } - return gWndStubPage; -} - -function getStubPage_inter(wCurrent) -{ - if(null==wCurrent.parent||wCurrent.parent==wCurrent) - return null; - - if(typeof(wCurrent.parent.whname)=="string"&&"wh_stub"==wCurrent.parent.whname) - return wCurrent.parent; - else - if(wCurrent.parent.frames.length!=0&&wCurrent.parent!=wCurrent) - return getStubPage_inter(wCurrent.parent); - else - return null; -} - -function RegisterListener(framename,nMessageId) -{ - var wSP=getStubPage(); - if(wSP&&wSP!=this) - return wSP.RegisterListener(framename,nMessageId); - else - return false; -} - -function RegisterListener2(oframe,nMessageId) -{ - var wSP=getStubPage(); - if(wSP&&wSP!=this) - return wSP.RegisterListener2(oframe,nMessageId); - else - return false; -} - -function UnRegisterListener2(oframe,nMessageId) -{ - var wSP=getStubPage(); - if(wSP&&wSP!=this&&wSP.UnRegisterListener2) - return wSP.UnRegisterListener2(oframe,nMessageId); - else - return false; -} - -function SendMessage(oMessage) -{ - var wSP=getStubPage(); - if(wSP&&wSP!=this&&wSP.SendMessage) - return wSP.SendMessage(oMessage); - else - return false; -} - -var gbWhProxy=true; - -var gbPreview=false; -gbPreview=false; -if (gbPreview) - document.oncontextmenu=contextMenu; - -function contextMenu() -{ - return false; -} +// WebHelp 5.10.001 +var gbInited=false; +var gWndStubPage=null; +function getStubPage() +{ + if(!gbInited) + { + gWndStubPage=getStubPage_inter(window); + gbInited=true; + } + return gWndStubPage; +} + +function getStubPage_inter(wCurrent) +{ + if(null==wCurrent.parent||wCurrent.parent==wCurrent) + return null; + + if(typeof(wCurrent.parent.whname)=="string"&&"wh_stub"==wCurrent.parent.whname) + return wCurrent.parent; + else + if(wCurrent.parent.frames.length!=0&&wCurrent.parent!=wCurrent) + return getStubPage_inter(wCurrent.parent); + else + return null; +} + +function RegisterListener(framename,nMessageId) +{ + var wSP=getStubPage(); + if(wSP&&wSP!=this) + return wSP.RegisterListener(framename,nMessageId); + else + return false; +} + +function RegisterListener2(oframe,nMessageId) +{ + var wSP=getStubPage(); + if(wSP&&wSP!=this) + return wSP.RegisterListener2(oframe,nMessageId); + else + return false; +} + +function UnRegisterListener2(oframe,nMessageId) +{ + var wSP=getStubPage(); + if(wSP&&wSP!=this&&wSP.UnRegisterListener2) + return wSP.UnRegisterListener2(oframe,nMessageId); + else + return false; +} + +function SendMessage(oMessage) +{ + var wSP=getStubPage(); + if(wSP&&wSP!=this&&wSP.SendMessage) + return wSP.SendMessage(oMessage); + else + return false; +} + +var gbWhProxy=true; + +var gbPreview=false; +gbPreview=false; +if (gbPreview) + document.oncontextmenu=contextMenu; + +function contextMenu() +{ + return false; +} diff --git a/doc/salome/gui/SMESH/whres.xml b/doc/salome/gui/SMESH/whres.xml index f3f010a3f..b79fae014 100755 --- a/doc/salome/gui/SMESH/whres.xml +++ b/doc/salome/gui/SMESH/whres.xml @@ -1,256 +1,256 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - </fonts> - <button normal="" hover="" /> - <editwith value="20" /> - </form> - <background color="#ffffff" img="" /> - <fonts> - <normal name="Tahoma" size="8pt" color="#000000" style="Normal" weight="Normal" decoration="none" /> - <hover name="Tahoma" size="8pt" color="#000080" style="Normal" weight="Normal" decoration="underline" /> - <empty name="" size="8pt" color="" style="" weight="" decoration="" /> - </fonts> - <activebackgroundcolor attr="#c0c0c0" /> - <margin attr="" /> - <indent attr="" /> - </index> - <fts> - <form> - <fonts> - <title name="Tahoma" size="8pt" color="#000080" style="Normal" weight="Normal" decoration="none" /> - </fonts> - <button normal="" hover="" /> - <editwith value="20" /> - </form> - <background color="#ffffff" img="" /> - <fonts> - <normal name="Tahoma" size="8pt" color="#000000" style="Normal" weight="Normal" decoration="none" /> - <hover name="Tahoma" size="8pt" color="#000080" style="Normal" weight="Normal" decoration="underline" /> - <error name="Tahoma" size="8pt" color="#000000" style="Normal" weight="Normal" decoration="none" /> - </fonts> - <activebackgroundcolor attr="#c0c0c0" /> - <margin attr="" /> - <indent attr="" /> - </fts> - <glossary> - <background color="#ffffff" img="" /> - <fonts> - <normal name="Tahoma" size="8pt" color="#000000" style="Normal" weight="Normal" decoration="none" /> - <hover name="Tahoma" size="8pt" color="#000080" style="Normal" weight="Normal" decoration="underline" /> - </fonts> - <activebackgroundcolor attr="#c0c0c0" /> - <margin attr="" /> - <indent attr="" /> - </glossary> - </paneskin> +<?xml version='1.0' encoding='windows-1252' ?> +<resource> +<item name="Prev" value="<<" /> +<item name="Hide" value="Hide" /> +<item name="SyncTocTooltip" value="Sync TOC" /> +<item name="InTopicSearchBtnText" value="Go" /> +<item name="FtsInputPrompt" value="Type in the word(s) to search for:" /> +<item name="Done" value="Done" /> +<item name="Logo/Author" value="Powered By" /> +<item name="MergeError1" value="The merged Help system" /> +<item name="JS_alert_cantLoadProject" value="Can't load project:" /> +<item name="Next" value=">>" /> +<item name="SyncToc" value="SyncToc" /> +<item name="MergeError2" value="is using a different language from the master Help system, which will cause the index and full-text search functionality to be disabled in the merged Help system." /> +<item name="nls_body_instruction" value="Enter your question in the text box above, then click GO." /> +<item name="ToolBarSearchBtnText" value="Go" /> +<item name="SuggestViewNoFrameMessage" value="To view the Help system without frames click on this" /> +<item name="Hide_Navigation_Component" value="Hide Navigation Component" /> +<item name="FtsBtnText" value="Go" /> +<item name="TopicsFound" value="Topics Found" /> +<item name="LoadingContentsData" value="Loading, click here to cancel..." /> +<item name="Definition" value="Definition:" /> +<item name="CompletingContents" value="Completing Contents..." /> +<item name="Seperate" value="|" /> +<item name="GeneratedBy" value="Generated by" /> +<item name="PoweredBy" value="Powered by" /> +<item name="IndexAlphabetBookmarks" value="ABCDEFGHIJKLMNOPQRSTUVWXYZ" /> +<item name="Contents" value="Contents" /> +<item name="IndexSelectTopicLabel" value="Select a topic, then click Display" /> +<item name="Disabled Prev" value="<<" /> +<item name="Glossary" value="Glossary" /> +<item name="Search" value="Search" /> +<item name="CantSearch" value="Cannot search for that phrase." /> +<item name="LoadingIndex" value="Loading Index..." /> +<item name="LoadingData" value="Loading data, please wait..." /> +<item name="Show_Navigation_Component" value="Show Navigation Component" /> +<item name="Book" value="Book" /> +<item name="Disabled Next" value=">>" /> +<item name="nls_body_empty" value="Sorry, we were unable to find a good answer for your question." /> +<item name="nls_button_go_hint" value="Go Search" /> +<item name="Find" value="Find" /> +<item name="CantOpenURLorFile" value="Can't open URL or file" /> +<item name="Print" value="Print" /> +<item name="About" value="About" /> +<item name="Author" value="Author" /> +<item name="IndexSelectTopicTitle" value="Select a Topic" /> +<item name="Blank_topic_text" value="This topic was created by WinHelp Project Conversion Wizard, and is the destination of a missing topic or broken hyperlink." /> +<item name="BrowserLimitedMessage" value="Your browser does not support frames. We recommend that you update your browser to a version that supports frames." /> +<item name="LoadingTOCItem" value="Loading Table of Contents:" /> +<item name="Display" value="Display" /> +<item name="Cancel" value="Cancel" /> +<item name="IndexSelectTopicError" value="Please select a topic." /> +<item name="nls_edit_label" value="Type in your question:" /> +<item name="SearchLabel" value="Search" /> +<item name="RelateTopicListPrompt" value="Click a topic, then click Display." /> +<item name="NextTooltip" value="Next Topic" /> +<item name="JS_alert_colorlimitation" value="WebHelp has detected that your display is set to 16 colors. For full WebHelp support, please set your display to use 256 or more colors." /> +<item name="TopicsNotFound" value="No Topics Found." /> +<item name="Show" value="Show" /> +<item name="PreTooltip" value="Previous Topic" /> +<item name="SearchPrompt" value="- Search -" /> +<item name="IndexBtnText" value="Go" /> +<item name="JS_alert_ProjectLoadingFail" value="Could not load correctly, please click Refresh." /> +<item name="LoadingContents" value="Loading contents, please wait..." /> +<item name="Term" value="Term:" /> +<item name="WebSearchButton" value="WebSearch" /> +<item name="Remote_Page" value="Remote Page" /> +<item name="WebSearch" value="WebSearch" /> +<item name="LoadingFTS" value="Reading Search Data..." /> +<item name="Index" value="Index" /> +<item name="JS_alert_ErrorInLoading" value="Error in Loading navigation component. Please regenerate WebHelp." /> +<item name="JS_alert_appletNotLoad" value="Unable to load applet. If you are using an old version of Netscape, the prefs.js file needs to be edited." /> +<item name="IndexInputPrompt" value="Type in the keyword to find:" /> +<item name="Page" value="Page" /> +<item name="SuggestViewNoFrameMsg2" value="hyperlink." /> +<item name="nls_button_go_text" value="Go" /> +<item name="Searching" value="Searching..." /> + + <item name="English" value="" /> + <item name="langorder" value="0,1,2,3,4,5,6,7,8,40,41,42,43,44,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,38,45,46,47,48,49,50,33,51,52,53,88,54,34,55,56,115,119,121,123,125,126,127,128,129,130,57,58,89,90,91,59,60,131,148,150,154,158,168,171,173,175,185,187,189,191,193,197,214,216,218,220,225,230,240,242,244,246,252,61,62,63,64,66,67,131,148,150,154,158,168,171,173,175,185,187,189,191,193,197,214,216,218,220,225,230,240,242,244,246,252,68,69,70,71,27,114,28,82,170,85,112,109,110,65,113,223,86,213,29,255,30,31,80,81,83,84,111,36,37,79,229,222,87,212,32,254,251,39,72,97,98,99,100,73,101,74,102,133,93,103,35,104,75,105,92,122,124,76,106,107,108,77,120,199,94,116,117,118,78,131,131,131,131,131,131,131,150,158,158,158,158,175,175,175,175,154,193,197,197,197,197,197,95,197,230,230,230,230,246,227,224,131,131,131,131,131,131,131,150,158,158,158,158,175,175,175,175,154,193,197,197,197,197,197,96,197,230,230,230,230,246,227,250," /> + + <panes show="0"> + <toc /> + <fts /> + <glossary /> + </panes> + + <stopwords> + <word name="a" /> + <word name="about" /> + <word name="after" /> + <word name="against" /> + <word name="all" /> + <word name="also" /> + <word name="among" /> + <word name="an" /> + <word name="and" /> + <word name="are" /> + <word name="as" /> + <word name="at" /> + <word name="be" /> + <word name="became" /> + <word name="because" /> + <word name="been" /> + <word name="between" /> + <word name="but" /> + <word name="by" /> + <word name="can" /> + <word name="come" /> + <word name="do" /> + <word name="during" /> + <word name="each" /> + <word name="early" /> + <word name="for" /> + <word name="form" /> + <word name="found" /> + <word name="from" /> + <word name="had" /> + <word name="has" /> + <word name="have" /> + <word name="he" /> + <word name="her" /> + <word name="his" /> + <word name="however" /> + <word name="in" /> + <word name="include" /> + <word name="into" /> + <word name="is" /> + <word name="it" /> + <word name="its" /> + <word name="late" /> + <word name="later" /> + <word name="made" /> + <word name="many" /> + <word name="may" /> + <word name="me" /> + <word name="med" /> + <word name="more" /> + <word name="most" /> + <word name="near" /> + <word name="no" /> + <word name="non" /> + <word name="not" /> + <word name="of" /> + <word name="on" /> + <word name="only" /> + <word name="or" /> + <word name="other" /> + <word name="over" /> + <word name="several" /> + <word name="she" /> + <word name="some" /> + <word name="such" /> + <word name="than" /> + <word name="that" /> + <word name="the" /> + <word name="their" /> + <word name="then" /> + <word name="there" /> + <word name="these" /> + <word name="they" /> + <word name="this" /> + <word name="through" /> + <word name="to" /> + <word name="under" /> + <word name="until" /> + <word name="use" /> + <word name="was" /> + <word name="we" /> + <word name="were" /> + <word name="when" /> + <word name="where" /> + <word name="which" /> + <word name="who" /> + <word name="with" /> + <word name="you" /> + </stopwords> + + <stems> + <stem name="ed" /> + <stem name="es" /> + <stem name="er" /> + <stem name="e" /> + <stem name="s" /> + <stem name="ingly" /> + <stem name="ing" /> + <stem name="ly" /> + </stems> + + <paneskin> + <background color="" img="" /> + <font name="Arial" size="9pt" color="#000000" style="normal" weight="normal" decoration="none" /> + <toc> + <background color="" img="" /> + <icons> + <book open="whd_toc2.gif" close="whd_toc1.gif" /> + <item local="whd_toc3.gif" remote="whd_toc4.gif" /> + <newbook open="whd_toc2.gif" close="whd_toc1.gif" /> + <newitem local="whd_toc3.gif" remote="whd_toc4.gif" /> + </icons> + <fonts> + <normal name="Arial" size="9pt" color="#000000" style="normal" weight="normal" decoration="none" /> + <hover name="Arial" size="9pt" color="#007f00" style="normal" weight="normal" decoration="underline" /> + </fonts> + <activebackgroundcolor attr="#cccccc" /> + <margin attr="0pt" /> + <indent attr="9pt" /> + </toc> + <index> + <form> + <fonts> + <title name="Arial" size="9pt" color="#000000" style="normal" weight="normal" decoration="none" /> + </fonts> + <button normal="" hover="" /> + <editwith value="28" /> + </form> + <background color="" img="" /> + <fonts> + <normal name="Arial" size="9pt" color="#000000" style="normal" weight="normal" decoration="none" /> + <hover name="Arial" size="9pt" color="#007f00" style="normal" weight="normal" decoration="underline" /> + <empty name="Arial" size="9pt" color="#666666" style="normal" weight="normal" decoration="none" /> + </fonts> + <activebackgroundcolor attr="#cccccc" /> + <margin attr="0pt" /> + <indent attr="9pt" /> + </index> + <fts> + <form> + <fonts> + <title name="Arial" size="9pt" color="#000000" style="normal" weight="normal" decoration="none" /> + </fonts> + <button normal="" hover="" /> + <editwith value="28" /> + </form> + <background color="" img="" /> + <fonts> + <normal name="Arial" size="9pt" color="#000000" style="normal" weight="normal" decoration="none" /> + <hover name="Arial" size="9pt" color="#007f00" style="normal" weight="normal" decoration="underline" /> + <error name="Arial" size="9pt" color="#000000" style="normal" weight="normal" decoration="none" /> + </fonts> + <activebackgroundcolor attr="#cccccc" /> + <margin attr="0pt" /> + <indent attr="9pt" /> + </fts> + <glossary> + <background color="" img="" /> + <fonts> + <normal name="Arial" size="9pt" color="#000000" style="normal" weight="normal" decoration="none" /> + <hover name="Arial" size="9pt" color="#007f00" style="normal" weight="normal" decoration="underline" /> + </fonts> + <activebackgroundcolor attr="#cccccc" /> + <margin attr="0pt" /> + <indent attr="9pt" /> + </glossary> + </paneskin> </resource> \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whrstart.ico b/doc/salome/gui/SMESH/whrstart.ico deleted file mode 100755 index bffcd6eb9..000000000 Binary files a/doc/salome/gui/SMESH/whrstart.ico and /dev/null differ diff --git a/doc/salome/gui/SMESH/whskin_banner.htm b/doc/salome/gui/SMESH/whskin_banner.htm deleted file mode 100755 index 39ed797e6..000000000 --- a/doc/salome/gui/SMESH/whskin_banner.htm +++ /dev/null @@ -1,49 +0,0 @@ -<html> -<head> -<title>About WebHelp                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Macromedia

-

Copyright © 1992 - 2004, eHelp Corporation

-

Author: eHelp Corporation

-
-

Powered by: WebHelp 5.50 -
Generated by: RoboHelp X5 -
www.ehelp.com

-
- - \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whskin_blank.htm b/doc/salome/gui/SMESH/whskin_blank.htm index 43439a8c7..a61ddecbe 100755 --- a/doc/salome/gui/SMESH/whskin_blank.htm +++ b/doc/salome/gui/SMESH/whskin_blank.htm @@ -1,10 +1,10 @@ - - -Blank Page - - - - - - - + + +Blank Page + + + + + + + diff --git a/doc/salome/gui/SMESH/whskin_frmset01.htm b/doc/salome/gui/SMESH/whskin_frmset01.htm deleted file mode 100755 index 3b8d56ad3..000000000 --- a/doc/salome/gui/SMESH/whskin_frmset01.htm +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whskin_frmset010.htm b/doc/salome/gui/SMESH/whskin_frmset010.htm deleted file mode 100755 index 8a02235c8..000000000 --- a/doc/salome/gui/SMESH/whskin_frmset010.htm +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whskin_homepage.htm b/doc/salome/gui/SMESH/whskin_homepage.htm index 4964c60ea..3163eee1b 100755 --- a/doc/salome/gui/SMESH/whskin_homepage.htm +++ b/doc/salome/gui/SMESH/whskin_homepage.htm @@ -1,139 +1,180 @@ - - - - SMESH reference manual - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + +Mesh Module Reference Manual + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whskin_info.htm b/doc/salome/gui/SMESH/whskin_info.htm index 5da80d8a0..484f54777 100755 --- a/doc/salome/gui/SMESH/whskin_info.htm +++ b/doc/salome/gui/SMESH/whskin_info.htm @@ -1,20 +1,20 @@ - - -WebHelp 5.50 - - - - -

WebHelp 5.50 System Info

- - - - - - - - - -
Start Page smesh.htm
Skin Name Default
Generating Time 18:07 12/02/2005
Language ID 1033
Compile Script webhelp5_compile_script.xml
Compile Build Version 13.10.606
Product Name WebHelp 5.50
Authoring Tool Name RoboHelp X5
- + + +WebHelp 5.50 + + + + +

WebHelp 5.50 System Info

+
+ + + + + + + + +
Start Page index.htm
Skin Name
Generating Time 12:45 05/22/2006
Language ID 1033
Compile Script webhelp5_compile_script.xml
Compile Build Version 13.10.606
Product Name WebHelp 5.50
Authoring Tool Name RoboHelp X5
+ \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whskin_mbars.htm b/doc/salome/gui/SMESH/whskin_mbars.htm deleted file mode 100755 index c4fa48af8..000000000 --- a/doc/salome/gui/SMESH/whskin_mbars.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - WebHelp Navigation Mini-bar - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whskin_papplet.htm b/doc/salome/gui/SMESH/whskin_papplet.htm deleted file mode 100755 index 5f8296ad6..000000000 --- a/doc/salome/gui/SMESH/whskin_papplet.htm +++ /dev/null @@ -1,360 +0,0 @@ - - -Navigation Pane - - - - - - - - - - - - - - - - - - diff --git a/doc/salome/gui/SMESH/whskin_pdhtml.htm b/doc/salome/gui/SMESH/whskin_pdhtml.htm deleted file mode 100755 index 763aa1429..000000000 --- a/doc/salome/gui/SMESH/whskin_pdhtml.htm +++ /dev/null @@ -1,64 +0,0 @@ - - - Navigation Pane - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whskin_pickup.htm b/doc/salome/gui/SMESH/whskin_pickup.htm index 1f1af7fc4..d06481fca 100755 --- a/doc/salome/gui/SMESH/whskin_pickup.htm +++ b/doc/salome/gui/SMESH/whskin_pickup.htm @@ -1,229 +1,229 @@ - - -Select a Topic                                                                                    - - - - - - -

Select a topic, then click Display

-
-
-
- - - -
- - - + + +Select a Topic                                                                                    + + + + + + +

Select a topic, then click Display

+
+
+ + + + +
+ + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whskin_plist.htm b/doc/salome/gui/SMESH/whskin_plist.htm deleted file mode 100755 index f7cf6d1d5..000000000 --- a/doc/salome/gui/SMESH/whskin_plist.htm +++ /dev/null @@ -1,238 +0,0 @@ - - - Navigation Pane - - - - - - - - - \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whskin_tbars.htm b/doc/salome/gui/SMESH/whskin_tbars.htm deleted file mode 100755 index 6cb490239..000000000 --- a/doc/salome/gui/SMESH/whskin_tbars.htm +++ /dev/null @@ -1,101 +0,0 @@ - - - WebHelp Navigation Toolbar - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whskin_tw.htm b/doc/salome/gui/SMESH/whskin_tw.htm index 69737fa1e..01bee59ac 100755 --- a/doc/salome/gui/SMESH/whskin_tw.htm +++ b/doc/salome/gui/SMESH/whskin_tw.htm @@ -1,63 +1,63 @@ - - - + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whst_topics.xml b/doc/salome/gui/SMESH/whst_topics.xml deleted file mode 100755 index 6dce99867..000000000 --- a/doc/salome/gui/SMESH/whst_topics.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - -";]]> - - - - -"]]> - - - - -"; -OutputInTopicNavBarDataWebSearch.form();]]> - - - - - - - - - - -";]]> - - - diff --git a/doc/salome/gui/SMESH/whstart.ico b/doc/salome/gui/SMESH/whstart.ico deleted file mode 100755 index 365eceac8..000000000 Binary files a/doc/salome/gui/SMESH/whstart.ico and /dev/null differ diff --git a/doc/salome/gui/SMESH/whstart.js b/doc/salome/gui/SMESH/whstart.js index 77f37ee6a..69a40758d 100755 --- a/doc/salome/gui/SMESH/whstart.js +++ b/doc/salome/gui/SMESH/whstart.js @@ -1,432 +1,432 @@ -// WebHelp 5.10.003 -RegisterListener2(this, WH_MSG_GETSTARTFRAME); -RegisterListener2(this, WH_MSG_GETDEFAULTTOPIC); -RegisterListener2(this, WH_MSG_MINIBARORDER); -RegisterListener2(this, WH_MSG_TOOLBARORDER); -RegisterListener2(this, WH_MSG_ISSEARCHSUPPORT); -RegisterListener2(this, WH_MSG_ISSYNCSSUPPORT); -RegisterListener2(this, WH_MSG_ISAVENUESUPPORT); -RegisterListener2(this, WH_MSG_GETPANETYPE); -RegisterListener2(this, WH_MSG_GETPANES); -RegisterListener2(this, WH_MSG_RELOADNS6); -RegisterListener2(this, WH_MSG_GETCMD); -RegisterListener2(this, WH_MSG_GETPANE); -RegisterListener2(this, WH_MSG_GETDEFPANE); - -if (gbNav6) -{ - var gnReload=0; - setTimeout("delayReload();",5000); -} - -function delayReload() -{ - if (!(this.cMRServer && cMRServer.m_strVersion)) - { - if(gnReload!=2) - { - if(nViewFrameType&&nViewFrameType==1) - document.location=document.location; - } - } -} - -var gsToolbarOrder = "toc|fts|glo|blankblock|searchform|banner"; -var gsMinibarOrder = "blankblock|hide2|"; - -var gsTopic = "files/introduction_to_smesh.htm"; -var PANE_OPT_SEARCH = 1; -var PANE_OPT_BROWSESEQ = 2; -var gnOpts=-1; -var gnCmd=-1; -var gnPans=2; -var gsBtns="invalid"; -var gsDefaultBtn="invalid"; -var gbHasTitle=false; - -if (location.hash.length > 1) -{ - var sParam = location.hash; - if (sParam.indexOf("#<") == 0) - { - document.location = "whcsh_home.htm#" + sParam.substring(2); - } - else if (sParam.indexOf("#>>") == 0) - { - parseParam(sParam.substring(3)); - sParam = "#" + gsTopic + sParam.substring(1); - } - else - { - var nPos = sParam.indexOf(">>"); - if (nPos>1) - { - gsTopic = sParam.substring(1, nPos); - parseParam(sParam.substring(nPos+2)); - } - else - gsTopic = sParam.substring(1); - } - if (gnPans == 1 && gsTopic) - { - var strURL=location.href; - if (location.hash) - { - var nPos=location.href.indexOf(location.hash); - strURL=strURL.substring(0, nPos); - } - if (gbHasTitle) - document.location=_getPath(strURL)+ "whskin_tw.htm" + sParam; - else - document.location=_getPath(strURL)+ gsTopic; - } -} - -function parseParam(sParam) -{ - if (sParam) - { - var nBPos=0; - do - { - var nPos=sParam.indexOf(">>", nBPos); - if (nPos!=-1) - { - if (nPos>0) - { - var sPart=sParam.substring(nBPos, nPos); - parsePart(sPart); - } - nBPos = nPos + 2; - } - else - { - var sPart=sParam.substring(nBPos); - parsePart(sPart); - break; - } - } while(nBPos < sParam.length); - } -} - -function parsePart(sPart) -{ - if(sPart.toLowerCase().indexOf("cmd=")==0) - { - gnCmd=parseInt(sPart.substring(4)); - } - else if(sPart.toLowerCase().indexOf("cap=")==0) - { - document.title=_browserStringToText(sPart.substring(4)); - gbHasTitle=true; - } - else if(sPart.toLowerCase().indexOf("pan=")==0) - { - gnPans=parseInt(sPart.substring(4)); - } - else if(sPart.toLowerCase().indexOf("pot=")==0) - { - gnOpts=parseInt(sPart.substring(4)); - } - else if(sPart.toLowerCase().indexOf("pbs=")==0) - { - var sRawBtns = sPart.substring(4); - var aBtns = sRawBtns.split("|"); - for (var i=0;i 1) +{ + var sParam = location.hash; + if (sParam.indexOf("#<") == 0) + { + document.location = "whcsh_home.htm#" + sParam.substring(2); + } + else if (sParam.indexOf("#>>") == 0) + { + parseParam(sParam.substring(3)); + sParam = "#" + gsTopic + sParam.substring(1); + } + else + { + var nPos = sParam.indexOf(">>"); + if (nPos>1) + { + gsTopic = sParam.substring(1, nPos); + parseParam(sParam.substring(nPos+2)); + } + else + gsTopic = sParam.substring(1); + } + if (gnPans == 1 && gsTopic) + { + var strURL=location.href; + if (location.hash) + { + var nPos=location.href.indexOf(location.hash); + strURL=strURL.substring(0, nPos); + } + if (gbHasTitle) + document.location=_getPath(strURL)+ "whskin_tw.htm" + sParam; + else + document.location=_getPath(strURL)+ gsTopic; + } +} + +function parseParam(sParam) +{ + if (sParam) + { + var nBPos=0; + do + { + var nPos=sParam.indexOf(">>", nBPos); + if (nPos!=-1) + { + if (nPos>0) + { + var sPart=sParam.substring(nBPos, nPos); + parsePart(sPart); + } + nBPos = nPos + 2; + } + else + { + var sPart=sParam.substring(nBPos); + parsePart(sPart); + break; + } + } while(nBPos < sParam.length); + } +} + +function parsePart(sPart) +{ + if(sPart.toLowerCase().indexOf("cmd=")==0) + { + gnCmd=parseInt(sPart.substring(4)); + } + else if(sPart.toLowerCase().indexOf("cap=")==0) + { + document.title=_browserStringToText(sPart.substring(4)); + gbHasTitle=true; + } + else if(sPart.toLowerCase().indexOf("pan=")==0) + { + gnPans=parseInt(sPart.substring(4)); + } + else if(sPart.toLowerCase().indexOf("pot=")==0) + { + gnOpts=parseInt(sPart.substring(4)); + } + else if(sPart.toLowerCase().indexOf("pbs=")==0) + { + var sRawBtns = sPart.substring(4); + var aBtns = sRawBtns.split("|"); + for (var i=0;i0) - { - frame=getframehandle(frames[i].frames,framename); - if(null!=frame) - return frame; - } - } - return frame; -} - -function AddToArray(arr,obj) -{ - var bFound=false; - for(var i=0;ii) - return gArrayCompoentsArray[i]; - else - return null; - } - } - return null; -} - -function CreateComponentsArray(nMessageId) -{ - var len=gArrayRegistedMessage.length; - gArrayRegistedMessage[len]=nMessageId; - gArrayCompoentsArray[len]=new Array(); - return gArrayCompoentsArray[len]; -} - -function listener(sName,oWindow) -{ - this.sName=sName; - this.oWindow=oWindow; -} - -function RegisterListener(windowName,nMessageId) -{ - var arrayComponents=GetComponentsArray(nMessageId); - if(arrayComponents==null) - arrayComponents=CreateComponentsArray(nMessageId); - - if(arrayComponents!=null) - { - for (var i=0;i0){ - for(var i=0;i0) + { + frame=getframehandle(frames[i].frames,framename); + if(null!=frame) + return frame; + } + } + return frame; +} + +function AddToArray(arr,obj) +{ + var bFound=false; + for(var i=0;ii) + return gArrayCompoentsArray[i]; + else + return null; + } + } + return null; +} + +function CreateComponentsArray(nMessageId) +{ + var len=gArrayRegistedMessage.length; + gArrayRegistedMessage[len]=nMessageId; + gArrayCompoentsArray[len]=new Array(); + return gArrayCompoentsArray[len]; +} + +function listener(sName,oWindow) +{ + this.sName=sName; + this.oWindow=oWindow; +} + +function RegisterListener(windowName,nMessageId) +{ + var arrayComponents=GetComponentsArray(nMessageId); + if(arrayComponents==null) + arrayComponents=CreateComponentsArray(nMessageId); + + if(arrayComponents!=null) + { + for (var i=0;i0){ + for(var i=0;ii+4) - { - if (button.arguments[4+i]) - this.aIs[i]=_getFullPath(_getPath(document.location.href),button.arguments[4+i]); - else - this.aIs[i]=""; - i++; - } -} - -function getImage(oImage,sTitle) -{ - if(oImage.aIs[0]) - { - var sI=""; - if(sTitle=="") - sTitle=oImage.sText; - sI+="\""+sTitle+"\"0) - sI+=" width="+oImage.nWidth; - if(oImage.nHeight>0) - sI+=" height="+oImage.nHeight; - sI+=" border=0 align=\"absmiddle\">"; - return sI; - } - return ""; -} - -function getCurrentAveName() -{ - var oSelect=getElement("avenue"); - if(oSelect) - return oSelect.value; - else - return ""; -} - -function updateWebSearch(bEnable) -{ - var oWebSearch=getElement("btnwebsearch"); - var oWebSearchParent=null; - if(oWebSearch) - oWebSearchParent=getParentNode(oWebSearch); - goWebSearchEnable=bEnable; - if(oWebSearchParent) - { - if(bEnable) - enableButton(oWebSearchParent,goWebSearch); - else - disableButton(oWebSearchParent,goWebSearch); - } - -} - -function setState(oEL,sState) -{ - if(gbNav6||gbOpera) - oEL.setAttribute("state",sState); - else - oEL.state=sState; -} - -function updateAvenueIfNeeded() -{ - gbUpdateTimerCount--; - if (gbNeedUpdateAve&&gbUpdateTimerCount==0) - { - updateAvenue(); - } -} - -function updateAvenue() -{ - var sSelect=getAvenueHTML(gaAvenues); - var oSelect=getElement("avenue"); - if(oSelect) - { - if(gbNav6) - { - var oParent=getParentNode(oSelect); - - if(oParent) - { - removeThis(oSelect); - oParent.insertAdjacentHTML("afterBegin",sSelect); - } - } - else - oSelect.outerHTML=sSelect; - oSelect=getElement("avenue"); - if(isValidAvenue(gaAvenues,gsCurAveName)) - oSelect.value=gsCurAveName; - } - updateAveButton(); -} - -function initAveButtonObj() -{ - if(!gbAveButttnInited) - { - var oNext=getElement("btnavnext"); - if(oNext) - goNextParent=getParentNode(oNext); - - var oPrev=getElement("btnavprev"); - if(oPrev) - goPrevParent=getParentNode(oPrev); - } - gbAveButttnInited=true; -} - -function disableAveButton() -{ - initAveButtonObj(); - if(goNextParent) - disableButton(goNextParent,goNext); - if(goPrevParent) - disableButton(goPrevParent,goPrev); -} - -function disableButton(oEl,oBtn) -{ - setState(oEl,"disable"); - var sPF=oEl.className.substring(0,6); - oEl.className=sPF+"Disable"; - var oAs = getElementsByTag(oEl,"a"); - if (oAs.length>0) - { - oAs[0].style.cursor="default"; - } - var oIs=getElementsByTag(oEl,"img"); - if(oIs.length>0&&oBtn&&oBtn.aIs&&oBtn.aIs.length>3) - { - if(oBtn.aIs[3]) - oIs[0].src=oBtn.aIs[3]; - } - else - oEl.style.visibility="hidden"; -} - -function enableButton(oEl,oBtn) -{ - setState(oEl,"normal"); - if(oEl==goEl) - { - var sPF=oEl.className.substring(0,6); - oEl.className=sPF+"Up"; - } - var oAs = getElementsByTag(oEl,"a"); - if (oAs.length>0) - { - oAs[0].style.cursor="hand"; - } - var oIs=getElementsByTag(oEl,"img"); - if(oIs.length>0&&oBtn&&oBtn.aIs&&oBtn.aIs.length>0) - { - if(oBtn.aIs[0]) - oIs[0].src=oBtn.aIs[0]; - } - oEl.style.visibility="visible"; -} - -function updateAveButton() -{ - initAveButtonObj(); - var strAveName=getCurrentAvenue(); - if(strAveName!="") - { - if(gaAvenues) - { - for(var i=0;i0) - { - for(var i=0;i"; - sSelect+=""; - if(aAvenues) - { - for(var i=0;i"+aAvenues[i].sName+""; - } - } - sSelect+=""; - return sSelect; -} - -function addAvenueSelection() -{ - var oMsg=new whMessage(WH_MSG_GETAVIAVENUES,this,1,new Object()); - var sButton=""; - if(SendMessage(oMsg)) - { - sButton=getAvenueHTML(oMsg.oParam.aAvenues); - } - else - { - sButton=getAvenueHTML(null); - } - gaButtons[gaButtons.length]=""+sButton+""; -} - -function setSearchFormTitle(sTitle) -{ - gsSearchFormTitle=sTitle; -} - -function highLightIfNeeded() -{ - if(document.searchForm.searchString.value==gsSearchPrompt) - { - document.searchForm.searchString.select(); - } -} - -function addSearchForm() -{ - var sPropmptString=gsSearchPrompt; - - var nWidth=20; - if(!nWidth) nWidth=20; - if(gbNav4) nWidth=nWidth*.6; - - if(gsSearchFormTitle) - sPropmptString=""; - var sButton=""; - if(gbNav6) - sButton=""+sButton; - if("image"=="text") - { - sButton+=""; - } - else if("image"=="image"&&gsIGo) - { - sButton+=""; - } - sButton+="
"+_textToHtml(gsSearchFormTitle)+"" - sButton+="\"Go\"
"; - if(gbNav6) - sButton+=""; - var nBtn=gaButtons.length; - gaButtons[nBtn]=""+sButton+""; - gaTypes[nBtn]="searchform"; -} - -function getShowHide() -{ - var sText=""; - var sI=""; - if(hasNavPane()) - { - if(goHide) - { - if(gnShowHideStyle&BTN_TEXT) - sText=goHide.sText; - if(gnShowHideStyle&BTN_IMG) - sI=getImage(goHide,"Hide"); - } - } - else - { - if(goShow) - { - if(gnShowHideStyle&BTN_TEXT) - sText=goShow.sText; - if(gnShowHideStyle&BTN_IMG) - sI=getImage(goShow,"Show"); - } - } - var sButton=genButton(sText,sI,gnShowHideStyle); - return sButton; -} - -function addBanner(sImage) -{ - if(sImage) - { - var nBtn=gaButtons.length; - gaButtons[nBtn]="     \"About"; - gaTypes[nBtn]="banner"; - } -} - -function showBanner() -{ - if (!gbPreview) - { - var nWidth=390; - var nHeight=204; - var nScreenWidth=screen.width; - var nScreenHeight=screen.height; - var nLeft=(nScreenWidth-nWidth)/2; - var nTop=(nScreenHeight-nHeight)/2; - if (gbIE4) - { - if (gbIE5) - nHeight+=20; - else - nHeight+=40; - window.showModalDialog("whskin_banner.htm","","dialogHeight:"+nHeight+"px;dialogWidth:"+nWidth+"px;resizable:no;status:no;scroll:no;help:no;center:yes;"); - } - else - window.open("whskin_banner.htm","banner","dependent,innerHeight="+nHeight+",innerWidth="+nWidth+",height="+nHeight+",width="+nWidth+",resizable=no,menubar=no,location=no,personalbar=no,status=no,scrollbar=no,toolbar=no,screenX="+nLeft+",screenY="+nTop); - } -} - -function addButton(sType,nStyle,sTitle,sHref,sOnClick,sOnMouseOver,sOnLoad,nWidth,nHeight,sI1,sI2,sI3,sI4,sI5,sI6) -{ - var sButton=""; - var bMini=false; - var sText=""; - var sI=""; - var bState=false; - var nBtn=gaButtons.length; - var bHref=false; - if(sType=="show"&&isShowHideEnable()) - { - var svTitle="Show Navigation Component"; - sButton=""; - gnShowHideStyle=nStyle; - goShow=new button(sType,sTitle,nWidth,nHeight,sI1,sI2,sI3); - gaObjBtns[nBtn]=goShow; - if(gnShowHide!=-1) - { - nBtn=gnShowHide; - } - else - { - gnShowHide=nBtn; - } - sButton+=getShowHide(); - sButton+=""; - bState=true; - } - else if(sType=="hide"&&isShowHideEnable()) - { - var svTitle="Hide Navigation Component"; - sButton=""; - gnShowHideStyle=nStyle; - goHide=new button(sType,sTitle,nWidth,nHeight,sI1,sI2,sI3); - gaObjBtns[nBtn]=goHide; - if(gnShowHide!=-1) - { - nBtn=gnShowHide; - } - else - { - gnShowHide=nBtn; - } - sButton+=getShowHide(); - sButton+=""; - bState=true; - } - else if(sType=="hide2"&&(!gbNav4)&&(!gbOpera)) - { - var svTitle="Hide Navigation Component"; - sButton=""; - gnShowHideStyle=nStyle; - if(!sI1) - sI1=gsIHide; - goHide2=new button(sType,sTitle,nWidth,nHeight,sI1,sI2,sI3); - gaObjBtns[nBtn]=goHide2; - if(nStyle&BTN_TEXT) - sText=goHide2.sText - - if(nStyle&BTN_IMG) - sI=getImage(goHide2,svTitle); - sButton+=genButton(sText,sI,nStyle); - sButton+=""; - bMini=true; - } - else if(sType=="synctoc") - { - var svTitle="Sync TOC"; - sButton=""; - if(!sI1) - sI1=gsISync; - goSync=new button(sType,sTitle,nWidth,nHeight,sI1,sI2,sI3); - gaObjBtns[nBtn]=goSync; - if(nStyle&BTN_TEXT) - sText=goSync.sText - - if(nStyle&BTN_IMG) - sI=getImage(goSync,svTitle); - sButton+=genButton(sText,sI,nStyle); - sButton+=""; - bMini=true; - } - else if(sType=="toc") - { - var svTitle="Contents"; - sButton=""; - if(!sI1) - sI1=gsIToc; - if(!sI2) - sI2=gsITocS; - if(!sI4) - sI4=gsITocS; - goToc=new button(sType,sTitle,nWidth,nHeight,sI1,sI2,sI3,sI4,sI5,sI6); - gaObjBtns[nBtn]=goToc; - if(nStyle&BTN_TEXT) - sText=goToc.sText - - if(nStyle&BTN_IMG) - sI=getImage(goToc,svTitle); - sButton+=genButton(sText,sI,nStyle); - sButton+=""; - bState=true; - } - else if(sType=="idx") - { - var svTitle="Index"; - sButton=""; - if(!sI1) - sI1=gsIIndex; - if(!sI2) - sI2=gsIIndexS; - if(!sI4) - sI4=gsIIndexS; - goIdx=new button(sType,sTitle,nWidth,nHeight,sI1,sI2,sI3,sI4,sI5,sI6); - gaObjBtns[nBtn]=goIdx; - if(nStyle&BTN_TEXT) - sText=goIdx.sText - - if(nStyle&BTN_IMG) - sI=getImage(goIdx,svTitle); - sButton+=genButton(sText,sI,nStyle); - sButton+=""; - bState=true; - } - else if(sType=="fts") - { - var svTitle="Search"; - sButton=""; - if(!sI1) - sI1=gsISearch; - if(!sI2) - sI2=gsISearchS; - if(!sI4) - sI4=gsISearchS; - goFts=new button(sType,sTitle,nWidth,nHeight,sI1,sI2,sI3,sI4,sI5,sI6); - gaObjBtns[nBtn]=goFts; - if(nStyle&BTN_TEXT) - sText=goFts.sText - - if(nStyle&BTN_IMG) - sI=getImage(goFts,svTitle); - sButton+=genButton(sText,sI,nStyle); - sButton+=""; - bState=true; - } - else if(sType=="glo") - { - var svTitle="Glossary"; - sButton=""; - if(!sI1) - sI1=gsIGlossary; - if(!sI2) - sI2=gsIGlossaryS; - if(!sI4) - sI4=gsIGlossaryS; - goGlo=new button(sType,sTitle,nWidth,nHeight,sI1,sI2,sI3,sI4,sI5,sI6); - gaObjBtns[nBtn]=goGlo; - if(nStyle&BTN_TEXT) - sText=goGlo.sText - - if(nStyle&BTN_IMG) - sI=getImage(goGlo,svTitle); - sButton+=genButton(sText,sI,nStyle); - sButton+=""; - bState=true; - } - else if(sType=="avnext") - { - var svTitle="Next Topic"; - sButton=""; - if(!sI1) - sI1=gsINext; - if(!sI4) - sI4=gsINextD; - goNext=new button(sType,sTitle,nWidth,nHeight,sI1,sI2,sI3,sI4,sI5,sI6); - gaObjBtns[nBtn]=goNext; - if(nStyle&BTN_TEXT) - sText=goNext.sText - - if(nStyle&BTN_IMG) - sI=getImage(goNext,svTitle); - sButton+=genButton(sText,sI,nStyle); - sButton+=""; - bMini=true; - } - else if(sType=="avprev") - { - var svTitle="Previous Topic"; - sButton=""; - if(!sI1) - sI1=gsIPrev; - if(!sI4) - sI4=gsIPrevD; - goPrev=new button(sType,sTitle,nWidth,nHeight,sI1,sI2,sI3,sI4,sI5,sI6); - gaObjBtns[nBtn]=goPrev; - if(nStyle&BTN_TEXT) - sText=goPrev.sText - - if(nStyle&BTN_IMG) - sI=getImage(goPrev,svTitle); - sButton+=genButton(sText,sI,nStyle); - sButton+=""; - bMini=true; - } - else if(sType=="blankblock") - { - gaButtons[nBtn]=null; - gaTypes[nBtn]=sType; - } - else if(sType=="websearch") - { - var svTitle="WebSearch"; - sButton=""; - if(!sI1) - sI1=gsIWebSearch; - if(!sI4) - sI4=gsIWebSearchD; - goWebSearch=new button(sType,sTitle,nWidth,nHeight,sI1,sI2,sI3,sI4,sI5,sI6); - gaObjBtns[nBtn]=goWebSearch; - if(nStyle&BTN_TEXT) - sText=goWebSearch.sText - - if(nStyle&BTN_IMG) - sI=getImage(goWebSearch,svTitle); - sButton+=genButton(sText,sI,nStyle); - sButton+=""; - } - else if(sType.indexOf("custom")==0) - { - var nCusBtnIdx=goCusButton.length; - goCusButton[nCusBtnIdx]=new cusButton(sType,sTitle,sOnClick,sOnMouseOver,sOnLoad,nWidth,nHeight,sI1,sI2,sI3); - gaObjBtns[nBtn]=goCusButton[nCusBtnIdx]; - var re=new RegExp("\"","g"); - var svTitle=sTitle.replace(re, """); - if(sHref&&sHref.length!=0) - { - sButton=""; - if(nStyle&BTN_TEXT) - sText=sTitle; - if(nStyle&BTN_IMG) - sI+=getImage(goCusButton[nCusBtnIdx],sTitle); - sButton+=genButton(sText,sI,nStyle); - sButton+=""; - } - if(sButton.length!=0) - { - var btnClass=""; - if(sText||bMini) - btnClass="clsBtnNormal"; - else - btnClass="clsNoBNormal"; - - if(!bState) - { - if(bHref) - gaButtons[nBtn]=""+sButton+""; - else - gaButtons[nBtn]=""+sButton+""; - } - else - gaButtons[nBtn]=""+sButton+""; - gaTypes[nBtn]=sType; - } - - if(sType=="avenuesel") - addAvenueSelection(); - else if(sType=="searchform") - addSearchForm(); - else if(sType=="banner") - { - if(!sI1) - sI1=gsIBanner; - addBanner(sI1); - } -} - -function isShowHideEnable() -{ - if(gbIE4) - return true; - else - return false; -} - -function genButton(sText,sI,nStyle) -{ - var sButton=""; - var sShowText=_textToHtml(sText); - if (gbNav4 && !gbNav6) - sShowText += " "; - if(sText!=""&&sI!="") - { - if(nStyle&BTN_IMG_TOP) - sButton+=sI+"
"+ sShowText; - else if(nStyle&BTN_IMG_BOTTOM) - sButton+=sText+"
"+sI; - else if(nStyle&BTN_IMG_RIGHT) - sButton+=sText+" "+sI; - else - sButton+=sI+" "+sShowText; - } - else if(sText!="") - { - sButton+=sShowText; - } - else if(sI!="") - { - sButton+=sI; - } - return sButton; -} - -function searchB() -{ - var onMsg=new whMessage(WH_MSG_SHOWFTS,this,1,null); - SendMessage(onMsg); - - var oMsg=new whMessage(WH_MSG_SEARCHTHIS,this,1,document.searchForm.searchString.value); - if(!SendMessage(oMsg)) - gstrSearch=document.searchForm.searchString.value; - else - gstrSearch=""; -} - -function ReSortToolbarButtons() -{ - var bSearchEnabled=isSearchEnabled(); - var strOrder=""; - var oMsg=new whMessage(WH_MSG_TOOLBARORDER,this,1,null); - if(SendMessage(oMsg)) - { - strOrder=oMsg.oParam; - } - if(strOrder.length>0) - { - gaOrders=strOrder.split("|"); - var aTempButtons=new Array(); - var ti=0; - for(var si=0;si0) - { - gaOrders=strOrder.split("|"); - var aTempButtons=new Array(); - var ti=0; - for(var si=0;si0) - { - var strHeight="100%"; - var strWidth="100%"; - if (gbNav4) - { - strHeight=window.innerHeight-4; - strWidth=window.innerWidth-4; - } - if (gbIE4) - { - strHeight=document.body.clientHeight-4; - strWidth=document.body.clientWidth-4; - } - if(gbNav6) - sHTML=""; - else - sHTML="
"; - if((gnButtonLayout&LAYOUT)==HLAYOUT) - { - sHTML+=""; - for(var i=0;i"; - } - sHTML+=""; - } - else - { - for(var i=0;i"+gaButtons[i]+""; - else - sHTML+=""; - } - } - if(gbNav6) - sHTML+="
"; - else - sHTML+=""; - } - document.write(sHTML); - if(document.body) - document.body.onselectstart=onSelect; - updateAveButton(); -} - -function hasNavPane() -{ - if(gnHasNavPane==-1) - { - gnHasNavPane=0; - var oParam=new Object(); - oParam.bVisible=false; - var oMsg=new whMessage(WH_MSG_ISPANEVISIBLE,this,1,oParam); - if(SendMessage(oMsg)) - { - if(oParam.bVisible) - gnHasNavPane=1; - } - - } - if(gnHasNavPane==1) - return true; - else - return false; -} - -function getTocInfo() -{ - var oParam=new Object(); - oParam.oTocInfo=null; - var oMsg=new whMessage(WH_MSG_GETTOCPATHS,this,1,oParam); - if(SendMessage(oMsg)) - { - goTocInfo=oParam.oTocInfo; - gbTocInfoInited=true; - } -} - -function onBtnClick(e) -{ - var oEl=null; - var oElo=null; - if(gbNav6) - { - oElo=e.target; - while(oElo&&oElo.nodeName.indexOf("#")==0) oElo=getParentNode(oElo); - oEl=oElo; - } - else - { - oElo=event.srcElement; - oEl=oElo; - event.cancelBubble=true; - } - while(-1==oEl.className.indexOf("clsBtn")&&-1==oEl.className.indexOf("clsNoB")) - { - oEl=getParentNode(oEl); - if(!oEl) return; - } - if(oElo.tagName=="A"||oElo.tagName=="IMG") return true; - var oaA=getElementsByTag(oElo,"A"); - if(oaA&&oaA.length) - { - var oA=oaA[0]; - if(gbNav6) - { - var sCmd=oA.getAttribute("onclick"); - var nCmd=sCmd.indexOf("return false;"); - if(nCmd!=-1); - sCmd=sCmd.substring(0,nCmd); - setTimeout(sCmd,1); - } - else - oA.onclick(); - } -} - -function onBtnMouseDown(e,nBtn) -{ - var oEl=null; - if(gbNav6) - { - var oElo=e.target; - while(oElo&&oElo.nodeName.indexOf("#")==0) oElo=getParentNode(oElo); - oEl=oElo; - } - else - { - oEl=event.srcElement; - event.cancelBubble=true; - } - while(-1==oEl.className.indexOf("clsBtn")&&-1==oEl.className.indexOf("clsNoB")) - { - oEl=getParentNode(oEl); - if(!oEl) return; - } - var sPF=oEl.className.substring(0,6); - var oIs=getElementsByTag(oEl,"img"); - if(oIs.length>0&&gaObjBtns[nBtn]&&gaObjBtns[nBtn].aIs&&gaObjBtns[nBtn].aIs.length>2) - { - if(gaObjBtns[nBtn].aIs[2]) - oIs[0].src=gaObjBtns[nBtn].aIs[2]; - } - var sState=getState(oEl); - if(sState!="disable") - { - oEl.className=sPF+"Down"; - } -} - -function onBtnMouseUp(e,nBtn) -{ - var oEl=null; - if(gbNav6) - { - var oElo=e.target; - while(oElo&&oElo.nodeName.indexOf("#")==0) oElo=getParentNode(oElo); - oEl=oElo; - } - else - { - oEl=event.srcElement; - event.cancelBubble=true; - } - while(-1==oEl.className.indexOf("clsBtn")&&-1==oEl.className.indexOf("clsNoB")) - { - oEl=getParentNode(oEl); - if(!oEl) return; - } - var sPF=oEl.className.substring(0,6); - var sState=getState(oEl); - if(sState=="down"||sState=="disable") - { - var oIs=getElementsByTag(oEl,"img"); - if(oIs.length>0&&gaObjBtns[nBtn]&&gaObjBtns[nBtn].aIs&&gaObjBtns[nBtn].aIs.length>3) - { - if(gaObjBtns[nBtn].aIs[3]) - oIs[0].src=gaObjBtns[nBtn].aIs[3]; - } - } - else - { - var oIs=getElementsByTag(oEl,"img"); - if(oIs.length>0&&gaObjBtns[nBtn]&&gaObjBtns[nBtn].aIs&&gaObjBtns[nBtn].aIs.length>0) - { - if(gaObjBtns[nBtn].aIs[0]) - oIs[0].src=gaObjBtns[nBtn].aIs[0]; - } - } - if(goEl==oEl) - { - if(sState!="down"&&sState!="disable") - { - oEl.className=sPF+"Up"; - } - } -} - -function getState(oEl) -{ - var sState=""; - if(gbNav6||gbOpera) - sState=oEl.getAttribute("state"); - else - if(oEl.state) - sState=oEl.state; - return sState; -} - -function onBtnMouseOver(e,nBtn) -{ - markButton(e); - var oEl=null; - if(gbNav6) - { - var oElo=e.target; - while(oElo&&oElo.nodeName.indexOf("#")==0) oElo=getParentNode(oElo); - oEl=oElo; - } - else - { - oEl=event.srcElement; - event.cancelBubble=true; - } - while(-1==oEl.className.indexOf("clsBtn")&&-1==oEl.className.indexOf("clsNoB")) - { - oEl=getParentNode(oEl); - if(!oEl) return; - } - var sPF=oEl.className.substring(0,6); - var sState=getState(oEl); - if(sState=="down"||sState=="disable") - { - if(sState=="down") - oEl.className=sPF+"Down"; - var oIs=getElementsByTag(oEl,"img"); - if(oIs.length>0&&gaObjBtns[nBtn]&&gaObjBtns[nBtn].aIs&&gaObjBtns[nBtn].aIs.length>4) - { - if(gaObjBtns[nBtn].aIs[4]) - oIs[0].src=gaObjBtns[nBtn].aIs[4]; - } - } - else - { - oEl.className=sPF+"Up"; - var oIs=getElementsByTag(oEl,"img"); - if(oIs.length>0&&gaObjBtns[nBtn]&&gaObjBtns[nBtn].aIs&&gaObjBtns[nBtn].aIs.length>1) - { - if(gaObjBtns[nBtn].aIs[1]) - oIs[0].src=gaObjBtns[nBtn].aIs[1]; - } - } -} - -function onBtnMouseOut(e,nBtn) -{ - goEl=null; - var oEl=null; - if(gbNav6) - { - var oElo=e.target; - while(oElo&&oElo.nodeName.indexOf("#")==0) oElo=getParentNode(oElo); - oEl=oElo; - } - else - { - oEl=event.srcElement; - event.cancelBubble=true; - } - while(-1==oEl.className.indexOf("clsBtn")&&-1==oEl.className.indexOf("clsNoB")) - { - oEl=getParentNode(oEl); - if(!oEl) return; - } - var sPF=oEl.className.substring(0,6); - var sState=getState(oEl); - if(sState=="down"||sState=="disable") - { - var oIs=getElementsByTag(oEl,"img"); - if(oIs.length>0&&gaObjBtns[nBtn]&&gaObjBtns[nBtn].aIs&&gaObjBtns[nBtn].aIs.length>3) - { - if(gaObjBtns[nBtn].aIs[3]) - oIs[0].src=gaObjBtns[nBtn].aIs[3]; - } - if(sState=="down") - oEl.className=sPF+"Down"; - } - else - { - var oIs=getElementsByTag(oEl,"img"); - if(oIs.length>0&&gaObjBtns[nBtn]&&gaObjBtns[nBtn].aIs&&gaObjBtns[nBtn].aIs.length>0) - { - if(gaObjBtns[nBtn].aIs[0]) - oIs[0].src=gaObjBtns[nBtn].aIs[0]; - } - oEl.className=sPF+"Normal"; - } -} - -function showToc() -{ - var oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null) - SendMessage(oMsg); -} - -function showIndex() -{ - var oMsg=new whMessage(WH_MSG_SHOWIDX,this,1,null) - SendMessage(oMsg); -} - -function showFts() -{ - var oMsg=new whMessage(WH_MSG_SHOWFTS,this,1,null) - SendMessage(oMsg); -} - -function showGlossary() -{ - var oMsg=new whMessage(WH_MSG_SHOWGLO,this,1,null) - SendMessage(oMsg); -} - -function syncWithShow() -{ - if(!gbTocInfoInited) - { - getTocInfo(); - } - if(goTocInfo) - { - showToc(); - var oParam=goTocInfo; - var oMsg=new whMessage(WH_MSG_SYNCTOC,this,1,oParam); - SendMessage(oMsg); - } -} - -function markButton(e) -{ - var oEl=null; - if(gbNav6) - { - var oElo=e.target; - while(oElo&&oElo.nodeName.indexOf("#")==0) oElo=getParentNode(oElo); - oEl=oElo; - } - else - oEl=event.srcElement; - while(oEl&&oEl.tagName!="TD") oEl=getParentNode(oEl); - if(oEl) - goEl=oEl; -} - -function showHidePane() -{ - var oMsg=null; - if(hasNavPane()) - oMsg=new whMessage(WH_MSG_HIDEPANE,this,1,null); - else - oMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null); - SendMessage(oMsg); -} - -function goAveNext() -{ - goAvenue(true); -} - -function goAvePrev() -{ - goAvenue(false); -} - -function doWebSearch() -{ - if (goWebSearchEnable) - { - var oMsg=new whMessage(WH_MSG_WEBSEARCH,this,1,null); - SendMessage(oMsg); - } -} - -function goAvenue(bNext) -{ - var oMsg=null; - initAveButtonObj(); - gsCurAveName=getCurrentAveName(); - if(gbNav4&&!gbNav6) - { - if(bNext) - { - gaAvenues=null; - updateAvenue(); - oMsg=new whMessage(WH_MSG_NEXT,this,1,null); - SendMessage(oMsg); - } - else if(!bNext) - { - gaAvenues=null; - updateAvenue(); - oMsg=new whMessage(WH_MSG_PREV,this,1,null); - SendMessage(oMsg); - } - } - else - { - if(bNext&&goNextParent) - { - var sState=getState(goNextParent); - if(sState!="disable") - { - gaAvenues=null; - gbNeedUpdateAve=true; - gbUpdateTimerCount++; - setTimeout("updateAvenueIfNeeded();", 2000); - oMsg=new whMessage(WH_MSG_NEXT,this,1,null); - SendMessage(oMsg); - } - } - else if(!bNext&&goPrevParent) - { - var sState=getState(goPrevParent); - if(sState!="disable") - { - gaAvenues=null; - gbNeedUpdateAve=true; - gbUpdateTimerCount++; - setTimeout("updateAvenueIfNeeded();", 2000); - oMsg=new whMessage(WH_MSG_PREV,this,1,null); - SendMessage(oMsg); - } - } - } -} - -function window_Unload() -{ - if(!gbNav4||gbNav6) - { - UnRegisterListener2(this,WH_MSG_GETSEARCHS); - UnRegisterListener2(this,WH_MSG_PANESTATUE); - UnRegisterListener2(this,WH_MSG_SYNCINFO); - UnRegisterListener2(this,WH_MSG_PANEINFO); - UnRegisterListener2(this,WH_MSG_AVENUEINFO); - UnRegisterListener2(this,WH_MSG_GETCURRENTAVENUE); - UnRegisterListener2(this,WH_MSG_ENABLEWEBSEARCH); - UnRegisterListener2(this,WH_MSG_INITSEARCHSTRING); - UnRegisterListener2(this,WH_MSG_NOSEARCHINPUT); - UnRegisterListener2(this,WH_MSG_NOSYNC); - } -} - -function window_OnLoad() -{ - if(!gbOpera7&&document.body) - { - if(gsBgImage&&gsBgImage.length>0) - { - document.body.background=gsBgImage; - } - if(gsBgColor&&gsBgColor.length>0) - { - document.body.bgColor=gsBgColor; - } - } - doCusOnLoad(); - var oMsg=new whMessage(WH_MSG_GETPANEINFO,this,1,null); - if(SendMessage(oMsg)) - { - setTimeout("flipPaneButton(\""+oMsg.oParam+"\");",1); - } - if (!gaAvenues) - { - var oMsg2=new whMessage(WH_MSG_GETAVIAVENUES,this,1,new Object()); - if(SendMessage(oMsg2)) - { - gaAvenues=oMsg2.oParam.aAvenues; - gbNeedUpdateAve=false; - setTimeout("updateAvenue();",1); - } - } -} - -function onSendMessage(oMsg) -{ - var nMsgId=oMsg.nMessageId; - if(nMsgId==WH_MSG_GETSEARCHS) - { - if(document.searchForm&&document.searchForm.searchString) - { - oMsg.oParam.sValue=document.searchForm.searchString.value; - return false; - } - } - else if(nMsgId==WH_MSG_PANESTATUE) - { - if(oMsg.oParam=="visible") - { - if(isShowHideEnable()) - setTimeout("flipShowHide(true);",1); - setTimeout("showPaneButton();",1); - } - else - { - if(isShowHideEnable()) - setTimeout("flipShowHide(false);",1); - setTimeout("hidePaneButton();",1); - } - } - else if(nMsgId==WH_MSG_PANEINFO) - { - if(oMsg.oParam) - setTimeout("flipPaneButton(\""+oMsg.oParam+"\");",1); - else - setTimeout("hidePaneButton();",1); - } - else if(nMsgId==WH_MSG_SYNCINFO) - { - if(oMsg.oParam) - goTocInfo=oMsg.oParam; - else - goTocInfo=null; - gbTocInfoInited=true; - } - else if(nMsgId==WH_MSG_AVENUEINFO) - { - gaAvenues=oMsg.oParam; - gbNeedUpdateAve=false; - setTimeout("updateAvenue();",1); - } - else if(nMsgId==WH_MSG_GETCURRENTAVENUE) - { - var sAveName=getCurrentAvenue(); - if(sAveName!="") - { - oMsg.oParam.sAvenue=sAveName; - return false; - } - else - return true; - } - else if(nMsgId==WH_MSG_ENABLEWEBSEARCH) - { - setTimeout("updateWebSearch("+oMsg.oParam+");",1); - } - else if(nMsgId==WH_MSG_INITSEARCHSTRING) - { - if(gstrSearch!="") - { - oMsg.oParam=gstrSearch; - gstrSearch=""; - return false; - } - } - else if(nMsgId==WH_MSG_NOSEARCHINPUT) - { - var oSearchInput = getElement("searchInput"); - if (oSearchInput) - { - oSearchInput.style.visibility = "hidden"; - return false; - } - } - else if(nMsgId==WH_MSG_NOSYNC) - { - var oSync = getElement("btnsynctoc"); - if (oSync) - { - oSync.style.visibility = "hidden"; - return false; - } - } - return true; -} - -function getCurrentAvenue() -{ - var strAveName=""; - var oSelect=getElement("avenue"); - if(oSelect) - { - strAveName=oSelect.value; - } - return strAveName; -} - -function initBtn() -{ - var oBtn=null; - oBtn=getElement("btntoc"); - if(oBtn) - gaBtns[gaBtns.length]=oBtn; - oBtn=getElement("btnidx"); - if(oBtn) - gaBtns[gaBtns.length]=oBtn; - oBtn=getElement("btnfts"); - if(oBtn) - gaBtns[gaBtns.length]=oBtn; - oBtn=getElement("btnglo"); - if(oBtn) - gaBtns[gaBtns.length]=oBtn; - gbInitBtn=true; -} - -function showPaneButton() -{ - flipPaneButton(gsPane); -} - -function hidePaneButton() -{ - flipPaneButton(""); -} - -function flipPaneButton(sPane) -{ - if (sPane) - gsPane=sPane; - if(!gbInitBtn) - initBtn(); - - var oUp=null; - if(sPane) - { - oUp=getElement("btn"+sPane); - } - for(var i=0;i0) - { - var strClassName=oaA[0].className; - oaA[0].className="btnsel"+strClassName.substring(3); - } - } - var oIs=getElementsByTag(oEl,"img"); - var oBtn=getButtonObjByType(gaBtns[i].id.substring(3)); - if(oIs.length>0&&oBtn&&oBtn.aIs&&oBtn.aIs.length>3) - { - if(oBtn.aIs[3]) - oIs[0].src=oBtn.aIs[3]; - } - } - } - else - { - var oEl=getParentNode(gaBtns[i]); - var sState=getState(oEl); - var sPF=oEl.className.substring(0,6); - if(sState=="down") - { - setState(oEl,"up"); - if(oEl==goEl) - oEl.className=sPF+"Up"; - else - oEl.className=sPF+"Normal"; - - if(sPF=="clsBtn") - { - if(gaBtns[i].id) - { - var sColor=getBtnColor(gaBtns[i].id.substring(3),false); - if(sColor) - { - oEl.style.backgroundColor=sColor - } - else - { - oEl.style.backgroundColor=""; - } - } - - var oaA=getElementsByTag(oEl,"A"); - if(oaA.length>0) - { - var strClassName=oaA[0].className; - oaA[0].className="btn"+strClassName.substring(6); - } - } - var oIs=getElementsByTag(oEl,"img"); - var oBtn=getButtonObjByType(gaBtns[i].id.substring(3)); - if(oIs.length>0&&oBtn&&oBtn.aIs&&oBtn.aIs.length>0) - { - if(oBtn.aIs[0]) - oIs[0].src=oBtn.aIs[0]; - } - } - } - } - } -} - -function flipShowHide(bShow) -{ - gnHasNavPane=-1; - var oA=getElement("btnshowhide"); - if(oA) - { - var oEl=getParentNode(oA); - var sPF=oEl.className.substring(0,6); - if(oEl&&oEl.state) - { - if(bShow) - { - oEl.state="down"; - oEl.className=sPF+"Down"; - } - else - { - oEl.state="up"; - - if(oEl==goEl) - oEl.className=sPF+"Up"; - else - oEl.className=sPF+"Normal"; - } - } - oA.innerHTML=getShowHide(); - } -} - -function cusOnClick(nIdx) -{ - if(goCusButton.length>nIdx) - { - var sOnClick=goCusButton[nIdx].sOnClick; - if(sOnClick&&sOnClick.length>0) - { - if(!gbPreview) - eval(sOnClick); - return false; - } - } - return true; -} - -function cusOnMouseOver(nIdx) -{ - if(goCusButton.length>nIdx) - { - var sOnMouseOver=goCusButton[nIdx].sOnMouseOver; - if(sOnMouseOver&&sOnMouseOver.length>0) - { - if(!gbPreview) - eval(sOnMouseOver); - return false; - } - } - return true; -} - -function doCusOnLoad() -{ - if(!gbPreview&&gaOrders) - { - for(var i=0;ii+7) - { - if (cusButton.arguments[7+i]) - this.aIs[i]=_getFullPath(_getPath(document.location.href),cusButton.arguments[7+i]); - else - this.aIs[i]=""; - i++; - } - if(sOnLoad) - { - registerOnLoad(sOnLoad,sType); - } -} - -function getBtnColor(sType,bSel) -{ - var aBtnColors=null; - if(bSel) - aBtnColors=gaSelBtnBgColor; - else - aBtnColors=gaBtnBgColor; - if(aBtnColors) - { - for(var i=0;i - -Table of contents - - - - - - - - - - - - - - - + + +Table of contents + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whthost.js b/doc/salome/gui/SMESH/whthost.js index 54ddc9aac..1a864bbcd 100755 --- a/doc/salome/gui/SMESH/whthost.js +++ b/doc/salome/gui/SMESH/whthost.js @@ -1,1504 +1,1504 @@ -// WebHelp 5.10.007 -var gaHSLoad=new Array(); -var gnMinIdx=0; -var gnInsIdx=-1; -var gsLoadingDivID="LoadingDiv"; -var gsLoadingMsg="Loading, click here to cancel..."; -var gaProj=null; -var gaTocs=new Array(); -var goChunk=null; -var gbReady=false; -var gbToc=false; -var gbXML=false; -var gaRoot=new Array(); -var gnCC=-1; -var gsTP=""; -var gaBTPs=""; -var gsCTPath=""; -var gnLT=-1; -var gsPathSplit="\n"; -var gsBgColor="#ffffff"; -var gsBgImage=""; -var goFont=null; -var goHFont=null; - -var gsMargin="0pt"; -var gsIndent="15pt"; -var gsABgColor="#cccccc"; - -var giBookClose=""; -var giBookOpen=""; -var giBookItem=""; -var giURLItem=""; -var giNewBookClose=""; -var giNewBookOpen=""; -var giNewBookItem=""; -var giNewURLItem=""; -var gnImages=0; -var gnLoadedImages=0; -var gaImgs=new Array(); -var gbLoadData=false; -var gobj=null; -var gaTocsNs61Fix=null; -var gbWhTHost=false; -var gBookItems=new Array(); -var gInSync=false; -var gbLData=false; -var gbNeedFillStub=false; -var gbLoadToc=false; - -function chunkInfoQueue() -{ - this.aContent=new Array(); - this.inQueue=function(cInfo) - { - this.aContent[this.aContent.length]=cInfo; - } - this.deQueue=function() - { - var cInfo=null; - if(this.aContent.length>0) - { - cInfo=this.aContent[0]; - for(var i=1;i0) - { - var nCIdx=0; - do { - nCIdx++; - var i=nIdx+nCIdx; - var nItemType=getItemType(i); - if(nItemType==1){ - if (!isBookEmpty(i)) - return false; - } - else if(nItemType==4){ - var sSrc=getRefURL(i); - var nProj=getProject(sSrc); - if(nProj!=-1){ - sSrc=gaRoot[nProj].sToc; - if(sSrc) - return false; - } - } - else if(nItemType==2||nItemType==16||nItemType==8) - return false; - } while(nCIdx

\"Book\""; - sHTML+=" "+sName+"

"; - var sURL=_textToHtml_nonbsp(getItemURL(nIdx)); - if(sURL!="") - addBookItem(getBookId(nIdx),_textToHtml_nonbsp(getTopicTarget(nIdx)),sURL); - sHTML+="
"; - } - else - sHTML=""; - } - else - { - sHTML+="stub>
"; - gbNeedFillStub=true; - setTimeout("fillStub("+nIdx+","+bLocalProject+");",100); - } - return sHTML; -} - -function checkFillStub() -{ - if(!gbLData) - { - if(gchunkRequestQueue.length()>0) - { - var cInfo=gchunkRequestQueue.deQueue(); - if(cInfo) - { - fillStub(cInfo.nIdx,cInfo.bLocal); - return; - } - } - } - if(gbNeedFillStub) - { - gbNeedFillStub=false; - setTimeout("syncInit()",1); - } -} - -function fillStub(nIdx,bLocalProject) -{ - if(!gbLData) - { - gbLData=true; - var sObj=getElement(getPBId(nIdx)); - if(sObj!=null) - { - tocExpandHelpSet(nIdx,bLocalProject); - gbNeedFillStub=false; - setTimeout("syncInit()",1); - } - else - setTimeout("fillStub("+nIdx+","+bLocalProject+");",100); - } - else - gchunkRequestQueue.inQueue(new chunkInfo(nIdx,bLocalProject)); -} - -function getBookId(nIdx){return "B_"+nIdx;} - -function getItemId(nIdx){return "I_"+nIdx;} - -function markBook(nIdx) -{ - var obj=getElement(getItemId(nIdx)); - if(obj==null) - obj=getElement(getBookId(nIdx)); - if(gbNav6) - { - gobj=obj; - setTimeout("delayMarkObj();",1); - } - else - markObj(obj); -} - -function delayMarkObj() -{ - if(gobj) - { - markObj(gobj); - gobj=null; - } -} - -function markObj(obj) -{ - if(obj!=null) - { - HighLightElement(obj,gsABgColor,"transparent"); - var sPath=calTocPath(obj); - if(gsCTPath!=sPath) - gsCTPath=sPath; - } -} - -function markItem(nIdx) -{ - var obj=getElement(getItemId(nIdx)); - if(gbNav6) - { - gobj=obj; - setTimeout("delayMarkObj();",1); - } - else - markObj(getElement(getItemId(nIdx))); -} - -function calTocPath(obj) -{ - var sPath=getInnerText2(obj); - var pObj=getParentNode(obj); - do - { - while(pObj!=null&&!isCBId(pObj.id)) pObj=getParentNode(pObj); - if(pObj!=null) - { - var nId=getIdByCBId(pObj.id); - var sObj=getElement(getPBId(nId)); - if(sObj!=null) - { - var objs=getItemsByBook(sObj); - for(var i=0;i\""+sAltString+"\" "+sName+"

"; - return sHTML; -} - -function writeBookItems(nIdx,num) -{ - var sHTML=""; - if(num>0){ - var nCIdx=0; - do{ - nCIdx++; - var i=nIdx+nCIdx; - var nItemType=getItemType(i); - if(nItemType==1||nItemType==4||nItemType==8){ - sHTML+=writeBook(i); - nCIdx+=getItemContentsNum(i); - } - else if(nItemType==2||nItemType==16){ - sHTML+=writeAnItem(i); - } - } - while(nCIdx"+gsLoadingMsg+"
"; -} - -function getItemName(nIdx) -{ - var oChunk=getChunk(nIdx); - if(oChunk) - return oChunk.aTocs[nIdx-oChunk.nMI].sItemName; - else - return null; -} - -function getItemContentsNum(nIdx) -{ - var oChunk=getChunk(nIdx); - if(oChunk) - return oChunk.aTocs[nIdx-oChunk.nMI].nContents; - else - return null; -} - -function getItemType(nIdx) -{ - var oChunk=getChunk(nIdx); - if(oChunk) - return oChunk.aTocs[nIdx-oChunk.nMI].nType; - else - return 0; -} - -function getItemURL(nIdx) -{ - var oChunk=getChunk(nIdx); - if(oChunk) - { - var sPath=oChunk.aTocs[nIdx-oChunk.nMI].sItemURL; - if(!(sPath==null||sPath=="")) - { - return _getFullPath(oChunk.sPPath,sPath); - } - } - return ""; -} - -function getRefURL(nIdx) -{ - var oChunk=getChunk(nIdx); - if(oChunk) - { - var sPath=oChunk.aTocs[nIdx-oChunk.nMI].sRefURL; - if(!(sPath==null||sPath=="")) - { - return _getFullPath(oChunk.sPPath,sPath) - } - } - return ""; -} - -function getTopicTarget(nIdx) -{ - var oChunk=getChunk(nIdx); - if(oChunk) - { - if(typeof(oChunk.aTocs[nIdx-oChunk.nMI].sTarget)!="undefined") - return oChunk.aTocs[nIdx-oChunk.nMI].sTarget; - } - return ""; -} - -function getItemIcon(nIdx,nIconIdx) -{ - var oChunk=getChunk(nIdx); - if(oChunk) - { - if(typeof(oChunk.aTocs[nIdx-oChunk.nMI].sIconRef)!="undefined") - { - var sIconRef=oChunk.aTocs[nIdx-oChunk.nMI].sIconRef; - var nIndex=sIconRef.indexOf(";"); - while(nIconIdx-->0&&nIndex!=-1) - { - sIconRef=sIconRef.substring(nIndex+1); - nIndex=sIconRef.indexOf(";"); - } - if(nIconIdx<0) - { - if(nIndex!=-1) - sIconRef=sIconRef.substring(0,nIndex); - return _getFullPath(oChunk.sPPath,sIconRef) - } - } - } - return ""; -} - -function TocWriteClassStyle() -{ - var sStyle=""; - document.write(sStyle); -} - -function TocWriteFixedWidth(bBegin,nWidth) -{ - if((gbIE4)&&(gbMac)&&(!gbIE5)){ - if(bBegin) - document.write("
"); - else - document.write("
"); - } -} - -function TocInitPage() -{ - var tempColl=getItemsByBook(document.body); - if(tempColl.length>0) - tempColl[0].focus(); -} - -function getItemsFromObj(obj) -{ - var aAnchor=new Array(); - var tempColl=getChildrenByTag(obj,"P"); - if(tempColl&&tempColl.length>0) - { - var anobr=new Array(); - for(var i=0;i0) - for(var j=0;j0) - for(var u=0;u0) - for(var j=0;jdocument.body.clientHeight){ - nNewScroll=nTop-20; - } - } - document.body.scrollTop=nNewScroll; -} - -function TocExpand(nId,bChangeImg,bForceOpen) -{ - var oDiv=getElement(getCBId(nId)); - if(oDiv==null) return null; - - var whichIm=document.images[getBId(nId)]; - if((oDiv.style.display!="block")||bForceOpen){ - oDiv.style.display="block"; - if(bChangeImg){ - var sPath=getPath(whichIm.src); - sPath=_getFullPath(sPath,getBookImage(nId,false)); - whichIm.src=sPath; - } - }else{ - oDiv.style.display="none"; - if(bChangeImg){ - var sPath=getPath(whichIm.src); - sPath=_getFullPath(sPath,getBookImage(nId,true)); - whichIm.src=sPath; - } - if(gbMac&&gbIE5){ - this.parent.document.getElementById("tocIFrame").style.width="101%"; - this.parent.document.getElementById("tocIFrame").style.width="100%"; - } - } - return oDiv; -} - -function getChunkId(n) -{ - var nCan=-1; - for(var i=0;i=gaTocs[nCan].nMI) - nCan=i; - } - if(nCan!=-1) - return nCan; - else - return -1; -} - -function getChunk(n) -{ - if(gnCC!=-1&&gaTocs[gnCC].nMI<=n&&(gnCC==gaTocs.length-1|| - gaTocs[gnCC+1].nMI>n)) - { - return gaTocs[gnCC]; - } - else{ - gnCC=getChunkId(n); - if(gnCC!=-1) - return gaTocs[gnCC]; - else - return null; - } -} - -function getBookImage(nIdx,bClosed) -{ - var nIdx=bClosed?0:1; - var sIcon=getItemIcon(nIdx,nIdx); - if(sIcon=="") - if(bClosed) - sIcon=giBookClose; - else - sIcon=giBookOpen; - return _getFullPath(gaProj[0].sPPath,sIcon); -} - -function getItemImage(nIdx,bRemote) -{ - var sIcon=getItemIcon(nIdx,0); - if(sIcon=="") - if(bRemote) - sIcon=giURLItem; - else - sIcon=giBookItem; - return _getFullPath(gaProj[0].sPPath,sIcon); -} - -function getInnerText2(obj) -{ - var sText=getInnerText(obj); - if(sText.length>0&&!gbOpera7) - sText=sText.substring(1); - return sText; -} - -function expandToc(oObj,sRest,aIdList) -{ - var len=aIdList.length; - var nPos=sRest.indexOf(gsPathSplit); - if(nPos!=-1) - { - sPart=sRest.substring(0,nPos); - sRest=sRest.substring(nPos+1); - } - else - { - sPart=sRest; - var aTagAs=getItemsByBook(oObj); - for(var s=0;s0) - { - if(gbNav6) - { - var sCommand=obj[0].getAttribute("onClick"); - var nCommand=sCommand.indexOf(";"); - sCommand=sCommand.substring(0,nCommand); - setTimeout(sCommand,1); - } - else - obj[0].click(); - } - return -1; - } - var nRet=expandToc(oCObj,sRest,aIdList); - if(nRet) - return nRet; - } - } - aIdList.length=len; - return 0; -} - -function getIdByPBId(sPId) -{ - return parseInt(sPId.substring(2,sPId.length-1)); -} - -function getIdByCBId(sCId) -{ - return parseInt(sCId.substring(2,sCId.length-1)); -} - -function isPBId(sId) -{ - return (sId&&sId.indexOf("B_")==0&&sId.lastIndexOf("P")==sId.length-1); -} - -function isCBId(sId) -{ - return (sId&&sId.indexOf("B_")==0&&sId.lastIndexOf("C")==sId.length-1); -} - -function getBId(nIdx) -{ - return "B_"+nIdx; -} - -function getPBId(nIdx) -{ - return getBId(nIdx)+"P"; -} - -function getCBId(nIdx) -{ - return getBId(nIdx)+"C"; -} - -function getClosestTocPath(aPaths) -{ - var nMaxSimilarity=0; - var nThatIndex=-1; - var sPath=null; - if(aPaths.length==0) return sPath; - for(var i=0;inMaxSimilarity) - { - nMaxSimilarity=nSimilarity; - nThatIndex=i; - } - } - if(nThatIndex!=-1) - sPath=aPaths[nThatIndex]; - else - sPath=aPaths[0]; - return sPath; -} - -function comparePath(sPath1,sPath2) -{ - var nMaxSimilarity=0; - var nStartPos1=0; - var nPos1=-1; - var nStartPos2=0; - var nPos2=-1; - do{ - var sCheck1=null; - var sCheck2=null; - nPos1=sPath1.indexOf(gsPathSplit,nStartPos1); - if(nPos1!=-1) - { - sCheck1=sPath1.substring(nStartPos1,nPos1); - nStartPos1=nPos1+1; - } - else - { - sCheck1=sPath1.substring(nStartPos1); - nStartPos1=-1; - } - nPos2=sPath2.indexOf(gsPathSplit,nStartPos2); - if(nPos1!=-1) - { - sCheck2=sPath2.substring(nStartPos2,nPos2); - nStartPos2=nPos2+1; - } - else - { - sCheck2=sPath2.substring(nStartPos2); - nStartPos2=-1; - } - if(sCheck1==sCheck2) - nMaxSimilarity++; - else - break; - }while(nStartPos1!=-1&&nStartPos2!=-1); - return nMaxSimilarity; -} - -function getTocPaths(oTopicParam) -{ - var aRelTocPaths=oTopicParam.aPaths; - var aPaths=new Array(); - for(var i=0;i0) - { - for(var i=0;i0) - { - document.body.background=gsBgImage; - } - if(gsBgColor&&gsBgColor.length>0) - { - document.body.bgColor=gsBgColor; - } - loadToc(); - var oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null) - SendMessage(oMsg); -} - -function loadImages() -{ - if(giBookClose) - { - gaImgs[gnImages]=giBookClose; - gnImages++; - } - if(giBookOpen) - { - gaImgs[gnImages]=giBookOpen; - gnImages++; - } - if(giBookItem) - { - gaImgs[gnImages]=giBookItem; - gnImages++; - } - if(giURLItem) - { - gaImgs[gnImages]=giURLItem; - gnImages++; - } - if(giNewBookClose) - { - gaImgs[gnImages]=giNewBookClose; - gnImages++; - } - if(giNewBookOpen) - { - gaImgs[gnImages]=giNewBookOpen; - gnImages++; - } - if(giNewBookItem) - { - gaImgs[gnImages]=giNewBookItem; - gnImages++; - } - if(giNewURLItem) - { - gaImgs[gnImages]=giNewURLItem; - gnImages++; - } - if(gnImages>0) - { - setTimeout("loadDataAfter();",1000); - loadImage(gaImgs[0]); - } - else - loadDataAfter(); -} - -function loadImage(sURL) -{ - var oImg=new Image(); - oImg.onload=checkImageLoading; - oImg.onerror=errorImageLoading; - oImg.src=_getFullPath(gaProj[0].sPPath,sURL); -} - -function loadDataAfter() -{ - if(!gbLoadData) - { - gbLoadData=true; - loadTData(); - } -} - -function errorImageLoading() -{ - gnLoadedImages++; - if(gnImages==gnLoadedImages) - loadDataAfter(); - else - loadImage(gaImgs[gnLoadedImages]); -} - -function checkImageLoading() -{ - gnLoadedImages++; - if(gnImages==gnLoadedImages) - loadDataAfter(); - else - loadImage(gaImgs[gnLoadedImages]); -} - -function window_unload() -{ - UnRegisterListener2(this,WH_MSG_PROJECTREADY); - UnRegisterListener2(this,WH_MSG_SYNCTOC); - UnRegisterListener2(this,WH_MSG_SHOWTOC); -} - -function onSendMessage(oMsg) -{ - if(oMsg) - { - var nMsgId=oMsg.nMessageId; - if(nMsgId==WH_MSG_PROJECTREADY) - { - loadToc(); - } - else if(nMsgId==WH_MSG_SYNCTOC) - { - if(gbReady) - { - syncWithPaths(oMsg.oParam); - } - } - else if(nMsgId==WH_MSG_SHOWTOC) - { - if(!gbNav6) - document.body.focus(); - } - } - return true; -} - -if(window.gbWhUtil&&window.gbWhVer&&window.gbWhMsg&&window.gbWhProxy) -{ - RegisterListener2(this,WH_MSG_PROJECTREADY); - RegisterListener2(this,WH_MSG_SYNCTOC); - RegisterListener2(this,WH_MSG_SHOWTOC); - goFont=new whFont("Verdana","8pt","#000000","normal","normal","none"); - goHFont=new whFont("Verdana","8pt","#007f00","normal","normal","underline"); - - window.onload=window_OnLoad; - window.onbeforeunload=window_BUnload; - window.onunload=window_unload; - gbWhTHost=true; -} -else +// WebHelp 5.10.007 +var gaHSLoad=new Array(); +var gnMinIdx=0; +var gnInsIdx=-1; +var gsLoadingDivID="LoadingDiv"; +var gsLoadingMsg="Loading, click here to cancel..."; +var gaProj=null; +var gaTocs=new Array(); +var goChunk=null; +var gbReady=false; +var gbToc=false; +var gbXML=false; +var gaRoot=new Array(); +var gnCC=-1; +var gsTP=""; +var gaBTPs=""; +var gsCTPath=""; +var gnLT=-1; +var gsPathSplit="\n"; +var gsBgColor="#ffffff"; +var gsBgImage=""; +var goFont=null; +var goHFont=null; + +var gsMargin="0pt"; +var gsIndent="15pt"; +var gsABgColor="#cccccc"; + +var giBookClose=""; +var giBookOpen=""; +var giBookItem=""; +var giURLItem=""; +var giNewBookClose=""; +var giNewBookOpen=""; +var giNewBookItem=""; +var giNewURLItem=""; +var gnImages=0; +var gnLoadedImages=0; +var gaImgs=new Array(); +var gbLoadData=false; +var gobj=null; +var gaTocsNs61Fix=null; +var gbWhTHost=false; +var gBookItems=new Array(); +var gInSync=false; +var gbLData=false; +var gbNeedFillStub=false; +var gbLoadToc=false; + +function chunkInfoQueue() +{ + this.aContent=new Array(); + this.inQueue=function(cInfo) + { + this.aContent[this.aContent.length]=cInfo; + } + this.deQueue=function() + { + var cInfo=null; + if(this.aContent.length>0) + { + cInfo=this.aContent[0]; + for(var i=1;i0) + { + var nCIdx=0; + do { + nCIdx++; + var i=nIdx+nCIdx; + var nItemType=getItemType(i); + if(nItemType==1){ + if (!isBookEmpty(i)) + return false; + } + else if(nItemType==4){ + var sSrc=getRefURL(i); + var nProj=getProject(sSrc); + if(nProj!=-1){ + sSrc=gaRoot[nProj].sToc; + if(sSrc) + return false; + } + } + else if(nItemType==2||nItemType==16||nItemType==8) + return false; + } while(nCIdx

\"Book\""; + sHTML+=" "+sName+"

"; + var sURL=_textToHtml_nonbsp(getItemURL(nIdx)); + if(sURL!="") + addBookItem(getBookId(nIdx),_textToHtml_nonbsp(getTopicTarget(nIdx)),sURL); + sHTML+="
"; + } + else + sHTML=""; + } + else + { + sHTML+="stub>
"; + gbNeedFillStub=true; + setTimeout("fillStub("+nIdx+","+bLocalProject+");",100); + } + return sHTML; +} + +function checkFillStub() +{ + if(!gbLData) + { + if(gchunkRequestQueue.length()>0) + { + var cInfo=gchunkRequestQueue.deQueue(); + if(cInfo) + { + fillStub(cInfo.nIdx,cInfo.bLocal); + return; + } + } + } + if(gbNeedFillStub) + { + gbNeedFillStub=false; + setTimeout("syncInit()",1); + } +} + +function fillStub(nIdx,bLocalProject) +{ + if(!gbLData) + { + gbLData=true; + var sObj=getElement(getPBId(nIdx)); + if(sObj!=null) + { + tocExpandHelpSet(nIdx,bLocalProject); + gbNeedFillStub=false; + setTimeout("syncInit()",1); + } + else + setTimeout("fillStub("+nIdx+","+bLocalProject+");",100); + } + else + gchunkRequestQueue.inQueue(new chunkInfo(nIdx,bLocalProject)); +} + +function getBookId(nIdx){return "B_"+nIdx;} + +function getItemId(nIdx){return "I_"+nIdx;} + +function markBook(nIdx) +{ + var obj=getElement(getItemId(nIdx)); + if(obj==null) + obj=getElement(getBookId(nIdx)); + if(gbNav6) + { + gobj=obj; + setTimeout("delayMarkObj();",1); + } + else + markObj(obj); +} + +function delayMarkObj() +{ + if(gobj) + { + markObj(gobj); + gobj=null; + } +} + +function markObj(obj) +{ + if(obj!=null) + { + HighLightElement(obj,gsABgColor,"transparent"); + var sPath=calTocPath(obj); + if(gsCTPath!=sPath) + gsCTPath=sPath; + } +} + +function markItem(nIdx) +{ + var obj=getElement(getItemId(nIdx)); + if(gbNav6) + { + gobj=obj; + setTimeout("delayMarkObj();",1); + } + else + markObj(getElement(getItemId(nIdx))); +} + +function calTocPath(obj) +{ + var sPath=getInnerText2(obj); + var pObj=getParentNode(obj); + do + { + while(pObj!=null&&!isCBId(pObj.id)) pObj=getParentNode(pObj); + if(pObj!=null) + { + var nId=getIdByCBId(pObj.id); + var sObj=getElement(getPBId(nId)); + if(sObj!=null) + { + var objs=getItemsByBook(sObj); + for(var i=0;i\""+sAltString+"\" "+sName+"

"; + return sHTML; +} + +function writeBookItems(nIdx,num) +{ + var sHTML=""; + if(num>0){ + var nCIdx=0; + do{ + nCIdx++; + var i=nIdx+nCIdx; + var nItemType=getItemType(i); + if(nItemType==1||nItemType==4||nItemType==8){ + sHTML+=writeBook(i); + nCIdx+=getItemContentsNum(i); + } + else if(nItemType==2||nItemType==16){ + sHTML+=writeAnItem(i); + } + } + while(nCIdx"+gsLoadingMsg+"
"; +} + +function getItemName(nIdx) +{ + var oChunk=getChunk(nIdx); + if(oChunk) + return oChunk.aTocs[nIdx-oChunk.nMI].sItemName; + else + return null; +} + +function getItemContentsNum(nIdx) +{ + var oChunk=getChunk(nIdx); + if(oChunk) + return oChunk.aTocs[nIdx-oChunk.nMI].nContents; + else + return null; +} + +function getItemType(nIdx) +{ + var oChunk=getChunk(nIdx); + if(oChunk) + return oChunk.aTocs[nIdx-oChunk.nMI].nType; + else + return 0; +} + +function getItemURL(nIdx) +{ + var oChunk=getChunk(nIdx); + if(oChunk) + { + var sPath=oChunk.aTocs[nIdx-oChunk.nMI].sItemURL; + if(!(sPath==null||sPath=="")) + { + return _getFullPath(oChunk.sPPath,sPath); + } + } + return ""; +} + +function getRefURL(nIdx) +{ + var oChunk=getChunk(nIdx); + if(oChunk) + { + var sPath=oChunk.aTocs[nIdx-oChunk.nMI].sRefURL; + if(!(sPath==null||sPath=="")) + { + return _getFullPath(oChunk.sPPath,sPath) + } + } + return ""; +} + +function getTopicTarget(nIdx) +{ + var oChunk=getChunk(nIdx); + if(oChunk) + { + if(typeof(oChunk.aTocs[nIdx-oChunk.nMI].sTarget)!="undefined") + return oChunk.aTocs[nIdx-oChunk.nMI].sTarget; + } + return ""; +} + +function getItemIcon(nIdx,nIconIdx) +{ + var oChunk=getChunk(nIdx); + if(oChunk) + { + if(typeof(oChunk.aTocs[nIdx-oChunk.nMI].sIconRef)!="undefined") + { + var sIconRef=oChunk.aTocs[nIdx-oChunk.nMI].sIconRef; + var nIndex=sIconRef.indexOf(";"); + while(nIconIdx-->0&&nIndex!=-1) + { + sIconRef=sIconRef.substring(nIndex+1); + nIndex=sIconRef.indexOf(";"); + } + if(nIconIdx<0) + { + if(nIndex!=-1) + sIconRef=sIconRef.substring(0,nIndex); + return _getFullPath(oChunk.sPPath,sIconRef) + } + } + } + return ""; +} + +function TocWriteClassStyle() +{ + var sStyle=""; + document.write(sStyle); +} + +function TocWriteFixedWidth(bBegin,nWidth) +{ + if((gbIE4)&&(gbMac)&&(!gbIE5)){ + if(bBegin) + document.write("
"); + else + document.write("
"); + } +} + +function TocInitPage() +{ + var tempColl=getItemsByBook(document.body); + if(tempColl.length>0) + tempColl[0].focus(); +} + +function getItemsFromObj(obj) +{ + var aAnchor=new Array(); + var tempColl=getChildrenByTag(obj,"P"); + if(tempColl&&tempColl.length>0) + { + var anobr=new Array(); + for(var i=0;i0) + for(var j=0;j0) + for(var u=0;u0) + for(var j=0;jdocument.body.clientHeight){ + nNewScroll=nTop-20; + } + } + document.body.scrollTop=nNewScroll; +} + +function TocExpand(nId,bChangeImg,bForceOpen) +{ + var oDiv=getElement(getCBId(nId)); + if(oDiv==null) return null; + + var whichIm=document.images[getBId(nId)]; + if((oDiv.style.display!="block")||bForceOpen){ + oDiv.style.display="block"; + if(bChangeImg){ + var sPath=getPath(whichIm.src); + sPath=_getFullPath(sPath,getBookImage(nId,false)); + whichIm.src=sPath; + } + }else{ + oDiv.style.display="none"; + if(bChangeImg){ + var sPath=getPath(whichIm.src); + sPath=_getFullPath(sPath,getBookImage(nId,true)); + whichIm.src=sPath; + } + if(gbMac&&gbIE5){ + this.parent.document.getElementById("tocIFrame").style.width="101%"; + this.parent.document.getElementById("tocIFrame").style.width="100%"; + } + } + return oDiv; +} + +function getChunkId(n) +{ + var nCan=-1; + for(var i=0;i=gaTocs[nCan].nMI) + nCan=i; + } + if(nCan!=-1) + return nCan; + else + return -1; +} + +function getChunk(n) +{ + if(gnCC!=-1&&gaTocs[gnCC].nMI<=n&&(gnCC==gaTocs.length-1|| + gaTocs[gnCC+1].nMI>n)) + { + return gaTocs[gnCC]; + } + else{ + gnCC=getChunkId(n); + if(gnCC!=-1) + return gaTocs[gnCC]; + else + return null; + } +} + +function getBookImage(nIdx,bClosed) +{ + var nIdx=bClosed?0:1; + var sIcon=getItemIcon(nIdx,nIdx); + if(sIcon=="") + if(bClosed) + sIcon=giBookClose; + else + sIcon=giBookOpen; + return _getFullPath(gaProj[0].sPPath,sIcon); +} + +function getItemImage(nIdx,bRemote) +{ + var sIcon=getItemIcon(nIdx,0); + if(sIcon=="") + if(bRemote) + sIcon=giURLItem; + else + sIcon=giBookItem; + return _getFullPath(gaProj[0].sPPath,sIcon); +} + +function getInnerText2(obj) +{ + var sText=getInnerText(obj); + if(sText.length>0&&!gbOpera7) + sText=sText.substring(1); + return sText; +} + +function expandToc(oObj,sRest,aIdList) +{ + var len=aIdList.length; + var nPos=sRest.indexOf(gsPathSplit); + if(nPos!=-1) + { + sPart=sRest.substring(0,nPos); + sRest=sRest.substring(nPos+1); + } + else + { + sPart=sRest; + var aTagAs=getItemsByBook(oObj); + for(var s=0;s0) + { + if(gbNav6) + { + var sCommand=obj[0].getAttribute("onClick"); + var nCommand=sCommand.indexOf(";"); + sCommand=sCommand.substring(0,nCommand); + setTimeout(sCommand,1); + } + else + obj[0].click(); + } + return -1; + } + var nRet=expandToc(oCObj,sRest,aIdList); + if(nRet) + return nRet; + } + } + aIdList.length=len; + return 0; +} + +function getIdByPBId(sPId) +{ + return parseInt(sPId.substring(2,sPId.length-1)); +} + +function getIdByCBId(sCId) +{ + return parseInt(sCId.substring(2,sCId.length-1)); +} + +function isPBId(sId) +{ + return (sId&&sId.indexOf("B_")==0&&sId.lastIndexOf("P")==sId.length-1); +} + +function isCBId(sId) +{ + return (sId&&sId.indexOf("B_")==0&&sId.lastIndexOf("C")==sId.length-1); +} + +function getBId(nIdx) +{ + return "B_"+nIdx; +} + +function getPBId(nIdx) +{ + return getBId(nIdx)+"P"; +} + +function getCBId(nIdx) +{ + return getBId(nIdx)+"C"; +} + +function getClosestTocPath(aPaths) +{ + var nMaxSimilarity=0; + var nThatIndex=-1; + var sPath=null; + if(aPaths.length==0) return sPath; + for(var i=0;inMaxSimilarity) + { + nMaxSimilarity=nSimilarity; + nThatIndex=i; + } + } + if(nThatIndex!=-1) + sPath=aPaths[nThatIndex]; + else + sPath=aPaths[0]; + return sPath; +} + +function comparePath(sPath1,sPath2) +{ + var nMaxSimilarity=0; + var nStartPos1=0; + var nPos1=-1; + var nStartPos2=0; + var nPos2=-1; + do{ + var sCheck1=null; + var sCheck2=null; + nPos1=sPath1.indexOf(gsPathSplit,nStartPos1); + if(nPos1!=-1) + { + sCheck1=sPath1.substring(nStartPos1,nPos1); + nStartPos1=nPos1+1; + } + else + { + sCheck1=sPath1.substring(nStartPos1); + nStartPos1=-1; + } + nPos2=sPath2.indexOf(gsPathSplit,nStartPos2); + if(nPos1!=-1) + { + sCheck2=sPath2.substring(nStartPos2,nPos2); + nStartPos2=nPos2+1; + } + else + { + sCheck2=sPath2.substring(nStartPos2); + nStartPos2=-1; + } + if(sCheck1==sCheck2) + nMaxSimilarity++; + else + break; + }while(nStartPos1!=-1&&nStartPos2!=-1); + return nMaxSimilarity; +} + +function getTocPaths(oTopicParam) +{ + var aRelTocPaths=oTopicParam.aPaths; + var aPaths=new Array(); + for(var i=0;i0) + { + for(var i=0;i0) + { + document.body.background=gsBgImage; + } + if(gsBgColor&&gsBgColor.length>0) + { + document.body.bgColor=gsBgColor; + } + loadToc(); + var oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null) + SendMessage(oMsg); +} + +function loadImages() +{ + if(giBookClose) + { + gaImgs[gnImages]=giBookClose; + gnImages++; + } + if(giBookOpen) + { + gaImgs[gnImages]=giBookOpen; + gnImages++; + } + if(giBookItem) + { + gaImgs[gnImages]=giBookItem; + gnImages++; + } + if(giURLItem) + { + gaImgs[gnImages]=giURLItem; + gnImages++; + } + if(giNewBookClose) + { + gaImgs[gnImages]=giNewBookClose; + gnImages++; + } + if(giNewBookOpen) + { + gaImgs[gnImages]=giNewBookOpen; + gnImages++; + } + if(giNewBookItem) + { + gaImgs[gnImages]=giNewBookItem; + gnImages++; + } + if(giNewURLItem) + { + gaImgs[gnImages]=giNewURLItem; + gnImages++; + } + if(gnImages>0) + { + setTimeout("loadDataAfter();",1000); + loadImage(gaImgs[0]); + } + else + loadDataAfter(); +} + +function loadImage(sURL) +{ + var oImg=new Image(); + oImg.onload=checkImageLoading; + oImg.onerror=errorImageLoading; + oImg.src=_getFullPath(gaProj[0].sPPath,sURL); +} + +function loadDataAfter() +{ + if(!gbLoadData) + { + gbLoadData=true; + loadTData(); + } +} + +function errorImageLoading() +{ + gnLoadedImages++; + if(gnImages==gnLoadedImages) + loadDataAfter(); + else + loadImage(gaImgs[gnLoadedImages]); +} + +function checkImageLoading() +{ + gnLoadedImages++; + if(gnImages==gnLoadedImages) + loadDataAfter(); + else + loadImage(gaImgs[gnLoadedImages]); +} + +function window_unload() +{ + UnRegisterListener2(this,WH_MSG_PROJECTREADY); + UnRegisterListener2(this,WH_MSG_SYNCTOC); + UnRegisterListener2(this,WH_MSG_SHOWTOC); +} + +function onSendMessage(oMsg) +{ + if(oMsg) + { + var nMsgId=oMsg.nMessageId; + if(nMsgId==WH_MSG_PROJECTREADY) + { + loadToc(); + } + else if(nMsgId==WH_MSG_SYNCTOC) + { + if(gbReady) + { + syncWithPaths(oMsg.oParam); + } + } + else if(nMsgId==WH_MSG_SHOWTOC) + { + if(!gbNav6) + document.body.focus(); + } + } + return true; +} + +if(window.gbWhUtil&&window.gbWhVer&&window.gbWhMsg&&window.gbWhProxy) +{ + RegisterListener2(this,WH_MSG_PROJECTREADY); + RegisterListener2(this,WH_MSG_SYNCTOC); + RegisterListener2(this,WH_MSG_SHOWTOC); + goFont=new whFont("Verdana","8pt","#000000","normal","normal","none"); + goHFont=new whFont("Verdana","8pt","#007f00","normal","normal","underline"); + + window.onload=window_OnLoad; + window.onbeforeunload=window_BUnload; + window.onunload=window_unload; + gbWhTHost=true; +} +else document.location.reload(); \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whtopic.js b/doc/salome/gui/SMESH/whtopic.js index 8a53281c8..e9d9cd19a 100755 --- a/doc/salome/gui/SMESH/whtopic.js +++ b/doc/salome/gui/SMESH/whtopic.js @@ -1,724 +1,725 @@ -// WebHelp 5.10.005 -var gsPPath=""; -var gaPaths=new Array(); -var gaAvenues=new Array(); - -var goFrame=null; -var gsStartPage=""; -var gsRelCurPagePath=""; -var gsSearchFormHref=""; -var gnTopicOnly=-1; -var gnOutmostTopic=-1; - -var BTN_TEXT=1; -var BTN_IMG=2; - -var goSync=null; - -var goShow=null; -var goHide=null; - -var goPrev=null; -var goNext=null; -var gnForm=0; -var goShowNav=null; -var goHideNav=null; - -var goWebSearch=null; - -var gsBtnStyle=""; -var gaButtons=new Array(); -var gaTypes=new Array(); -var whtopic_foldUnload=null; -var gbWhTopic=false; -var gbCheckSync=false; -var gbSyncEnabled=false; - -function setButtonFont(sType,sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration) -{ - var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration); - gsBtnStyle+=".whtbtn"+sType+"{"+getFontStyle(vFont)+"}"; -} - -function writeBtnStyle() -{ - if(gaButtons.length>0) - { - if(gsBtnStyle.length>0) - { - var sStyle=""; - document.write(sStyle); - } - } -} - -function button(sText,nWidth,nHeight) -{ - this.sText=sText; - this.nWidth=nWidth; - this.nHeight=nHeight; - - this.aImgs=new Array(); - var i=0; - while(button.arguments.length>i+3) - { - this.aImgs[i]=button.arguments[3+i]; - i++; - } -} - -//project info -function setRelStartPage(sPath) -{ - if(gsPPath.length==0) - { - gsPPath=_getFullPath(_getPath(document.location.href),_getPath(sPath)); - gsStartPage=_getFullPath(_getPath(document.location.href),sPath); - gsRelCurPagePath=_getRelativeFileName(gsStartPage,document.location.href); - } -} - -function getImage(oImage,sType) -{ - var sImg=""; - if(oImage&&oImage.aImgs&&(oImage.aImgs.length>0)) - { - sImg+="\""+sType+"\"0) - sImg+=" width="+oImage.nWidth; - if(oImage.nHeight>0) - sImg+=" height="+oImage.nHeight; - sImg+=" border=0>"; - } - return sImg; -} - -function addTocInfo(sTocPath) -{ - gaPaths[gaPaths.length]=sTocPath; -} - -function addAvenueInfo(sName,sPrev,sNext) -{ - gaAvenues[gaAvenues.length]=new avenueInfo(sName,sPrev,sNext); -} - -function addButton(sType,nStyle,sText,sHref,sOnClick,sOnMouseOver,sOnLoad,nWidth,nHeight,sImg1,sImg2,sImg3) -{ - var sButton=""; - var nBtn=gaButtons.length; - if(sType=="prev") - { - if(canGo(false)) - { - var sTitle="Previous Topic"; - goPrev=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); - sButton=""; - if(nStyle==BTN_TEXT) - sButton+=goPrev.sText; - else - sButton+=getImage(goPrev,sTitle); - sButton+=""; - } - } - else if(sType=="next") - { - if(canGo(true)) - { - var sTitle="Next Topic"; - goNext=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); - sButton=""; - if(nStyle==BTN_TEXT) - sButton+=goNext.sText; - else - sButton+=getImage(goNext,sTitle); - sButton+=""; - } - } - else if(sType=="show") - { - if(isTopicOnly()&&(!gbOpera6||gbOpera7)) - { - var sTitle="Show Navigation Component"; - goShow=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); - sButton=""; - if(nStyle==BTN_TEXT) - sButton+=goShow.sText; - else - sButton+=getImage(goShow,sTitle); - sButton+=""; - } - } - else if(sType=="hide") - { - if(!isTopicOnly()&&!gbOpera6) - { - var sTitle="Hide Navigation Component"; - goHide=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); - sButton=""; - if(nStyle==BTN_TEXT) - sButton+=goHide.sText; - else - sButton+=getImage(goHide,sTitle); - sButton+=""; - } - } - else if(sType=="shownav") - { - if(isShowHideEnable()) - { - var sTitle="Show Navigation Component"; - goShowNav=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); - sButton=""; - if(nStyle==BTN_TEXT) - sButton+=goShowNav.sText; - else - sButton+=getImage(goShowNav,sTitle); - sButton+=""; - } - } - else if(sType=="hidenav") - { - if(isShowHideEnable()) - { - var sTitle="Hide Navigation Component"; - goHideNav=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); - sButton=""; - if(nStyle==BTN_TEXT) - sButton+=goHideNav.sText; - else - sButton+=getImage(goHideNav,sTitle); - sButton+=""; - } - } - else if(sType=="synctoc") - { - if(gaPaths.length>0) - { - var sTitle="Sync TOC"; - goSync=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); - sButton=""; - if(nStyle==BTN_TEXT) - sButton+=goSync.sText; - else - sButton+=getImage(goSync,sTitle); - sButton+=""; - } - } - else if(sType=="websearch") - { - if(gsSearchFormHref.length>0) - { - var sTitle="WebSearch"; - goWebSearch=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); - sButton=""; - if(nStyle==BTN_TEXT) - sButton+=goWebSearch.sText; - else - sButton+=getImage(goWebSearch,sTitle); - sButton+=""; - } - } - else if(sType=="searchform") - { - gaButtons[nBtn]="NeedSearchForm"; - gaTypes[nBtn]=sType; - } - if(sButton.length!=0) - { - if(nStyle==BTN_TEXT) - sButton+=" "; - gaButtons[nBtn]=""+sButton+""; - gaTypes[nBtn]=sType; - } -} - -function isSyncEnabled() -{ - if(!gbCheckSync) - { - var oMsg=new whMessage(WH_MSG_ISSYNCSSUPPORT,this,1,null); - if(SendMessage(oMsg)) - { - gbSyncEnabled=oMsg.oParam; - } - gbCheckSync=true; - } - return gbSyncEnabled; -} - -function isInPopup() -{ - return (window.name.indexOf("BSSCPopup")!=-1); -} - -function getIntopicBar(sAlign) -{ - var sHTML=""; - if(gaButtons.length>0) - { - sHTML+="
"; - - sHTML+=""; - for(var i=0;i0) - { - var sHTML=""; - if(nAligns!=0) - { - sHTML+="
" - if(nAligns&1) - sHTML+=""; - if(nAligns&2) - sHTML+=""; - if(nAligns&4) - sHTML+=""; - sHTML+="
"+getIntopicBar("left")+""+getIntopicBar("center")+""+getIntopicBar("right")+"
"; - document.write(sHTML); - } - } -} - -function sendAveInfoOut() -{ - if(!isInPopup()) - setTimeout("sendAveInfo();",100); -} - -function sendAveInfo() -{ - var oMsg=new whMessage(WH_MSG_AVENUEINFO,this,1,gaAvenues); - SendMessage(oMsg); -} - - -function onNext() -{ - var oMsg=new whMessage(WH_MSG_NEXT,this,1,null); - SendMessage(oMsg); -} - -function onPrev() -{ - var oMsg=new whMessage(WH_MSG_PREV,this,1,null); - SendMessage(oMsg); -} - -function createSyncInfo() -{ - var oParam=new Object(); - if(gsPPath.length==0) - gsPPath=_getPath(document.location.href); - oParam.sPPath=gsPPath; - oParam.sTPath=document.location.href; - oParam.aPaths=gaPaths; - return oParam; -} - -function syncWithShow() -{ - if(isTopicOnly()) - show(); - else - { - sync(); - showTocPane(); - } -} - -function showTocPane() -{ - var oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null); - SendMessage(oMsg); -} - -function sendSyncInfo() -{ - if(!isInPopup()) - { - var oParam=null; - if(gaPaths.length>0) - { - oParam=createSyncInfo(); - } - var oMsg=new whMessage(WH_MSG_SYNCINFO,this,1,oParam); - SendMessage(oMsg); - } -} - -function sendInvalidSyncInfo() -{ - if(!isInPopup()) - { - var oMsg=new whMessage(WH_MSG_SYNCINFO,this,1,null); - SendMessage(oMsg); - } -} - -function enableWebSearch(bEnable) -{ - if(!isInPopup()) - { - var oMsg=new whMessage(WH_MSG_ENABLEWEBSEARCH,this,1,bEnable); - SendMessage(oMsg); - } -} - -function autoSync(nSync) -{ - if(nSync==0) return; - if(isInPopup()) return; - if(isOutMostTopic()) - sync(); -} - -function isOutMostTopic() -{ - if(gnOutmostTopic==-1) - { - var oMessage=new whMessage(WH_MSG_ISINFRAMESET,this,1,null); - if(SendMessage(oMessage)) - gnOutmostTopic=0; - else - gnOutmostTopic=1; - } - return (gnOutmostTopic==1); -} - -function sync() -{ - if(gaPaths.length>0) - { - var oParam=createSyncInfo(); - var oMessage=new whMessage(WH_MSG_SYNCTOC,this,1,oParam); - SendMessage(oMessage); - } -} - - -function avenueInfo(sName,sPrev,sNext) -{ - this.sName=sName; - this.sPrev=sPrev; - this.sNext=sNext; -} - -function getCurrentAvenue() -{ - var oParam=new Object(); - oParam.sAvenue=null; - var oMessage=new whMessage(WH_MSG_GETCURRENTAVENUE,this,1,oParam); - SendMessage(oMessage); - return oParam.sAvenue; -} - -function unRegisterListener() -{ - sendInvalidSyncInfo(); - enableWebSearch(false); - if(whtopic_foldUnload) - whtopic_foldUnload(); -} - -function onSendMessage(oMsg) -{ - var nMsgId=oMsg.nMessageId; - if(nMsgId==WH_MSG_GETAVIAVENUES) - { - oMsg.oParam.aAvenues=gaAvenues; - return false; - } - else if(nMsgId==WH_MSG_GETTOCPATHS) - { - if(isOutMostTopic()) - { - oMsg.oParam.oTocInfo=createSyncInfo(); - return false; - } - else - return true; - } - else if(nMsgId==WH_MSG_NEXT) - { - goAvenue(true); - } - else if(nMsgId==WH_MSG_PREV) - { - goAvenue(false); - } - else if(nMsgId==WH_MSG_WEBSEARCH) - { - websearch(); - } - return true; -} - -function goAvenue(bNext) -{ - var sTopic=null; - var sAvenue=getCurrentAvenue(); - var nAvenue=-1; - if(sAvenue!=null&&sAvenue!="") - { - for(var i=0;i0&&bNext) - { - sTopic=gaAvenues[i].sNext; - break; - } - else if(gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev.length>0&&!bNext) - { - sTopic=gaAvenues[i].sPrev; - break; - } - } - } - - if(sTopic!=null&&sTopic!="") - { - if(gsPPath!=null&&gsPPath!="") - { - sFullTopicPath=_getFullPath(gsPPath,sTopic); - document.location=sFullTopicPath; - } - } -} - -function canGo(bNext) -{ - for(var i=0;i0&&bNext)|| - (gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev.length>0&&!bNext)) - return true; - } - return false; -} - -function show() -{ - if(gsStartPage!="") - window.location=gsStartPage+"#"+gsRelCurPagePath; -} - -function hide() -{ - if(goFrame!=null) - { - goFrame.location=window.location; - } -} - -function isTopicOnly() -{ - if(gnTopicOnly==-1) - { - var oParam=new Object(); - oParam.oFrame=null; - var oMsg=new whMessage(WH_MSG_GETSTARTFRAME,this,1,oParam); - if(SendMessage(oMsg)) - { - goFrame=oParam.oFrame; - gnTopicOnly=0; - } - else - gnTopicOnly=1; - } - if(gnTopicOnly==1) - return true; - else - return false; -} - -function websearch() -{ - if(gbNav4) - { - if(document.ehelpform) - document.ehelpform.submit(); - } - else - { - if(window.ehelpform) - window.ehelpform.submit(); - } -} - -function addSearchFormHref(sHref) -{ - gsSearchFormHref=sHref; - enableWebSearch(true); -} - -function searchB(nForm) -{ - var sValue=eval("document.searchForm"+nForm+".searchString.value"); - var oMsg=new whMessage(WH_MSG_SEARCHTHIS,this,1,sValue); - SendMessage(oMsg); -} - -function getSearchFormHTML() -{ - var sHTML=""; - gnForm++; - var sFormName="searchForm"+gnForm; - var sButton="
" - sButton+=""; - if(""=="text") - { - sButton+=""; - } - else if(""=="image") - { - sButton+="" - sButton+=""; - } - sButton+="
"; - sHTML=""+sButton+""; - return sHTML; -} - -function showHidePane(bShow) -{ - var oMsg=null; - if(bShow) - oMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null); - else - oMsg=new whMessage(WH_MSG_HIDEPANE,this,1,null); - SendMessage(oMsg); -} - -function isShowHideEnable() -{ - if(gbIE4) - return true; - else - return false; -} - - -function PickupDialog_Invoke() -{ - if(!gbIE4||gbMac) - { - if(typeof(_PopupMenu_Invoke)=="function") - return _PopupMenu_Invoke(PickupDialog_Invoke.arguments); - } - else - { - if(PickupDialog_Invoke.arguments.length>2) - { - var sPickup="whskin_pickup.htm"; - var sPickupPath=gsPPath+sPickup; - if(gbIE4) - { - var sFrame=PickupDialog_Invoke.arguments[1]; - var aTopics=new Array(); - for(var i=2;i1) - { - var nWidth=300; - var nHeight=180; - var nScreenWidth=screen.width; - var nScreenHeight=screen.height; - var nLeft=(nScreenWidth-nWidth)/2; - var nTop=(nScreenHeight-nHeight)/2; - if(gbIE4) - { - var vRet=window.showModalDialog(sPickupPath,aTopics,"dialogHeight:"+nHeight+"px;dialogWidth:"+nWidth+"px;resizable:yes;status:no;scroll:no;help:no;center:yes;"); - if(vRet) - { - var sURL=vRet.m_url; - if(sFrame) - window.open(sURL,sFrame); - else - window.open(sURL,"_self"); - } - } - } - else if(aTopics.length==1) - { - var sURL=aTopics[0].m_sURL - if(sFrame) - window.open(sURL,sFrame); - else - window.open(sURL,"_self"); - } - } - } - } -} - -if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy) -{ - RegisterListener("bsscright",WH_MSG_GETAVIAVENUES); - RegisterListener("bsscright",WH_MSG_GETTOCPATHS); - RegisterListener("bsscright",WH_MSG_NEXT); - RegisterListener("bsscright",WH_MSG_PREV); - RegisterListener("bsscright",WH_MSG_WEBSEARCH); - if(gbMac&&gbIE4) - { - if(typeof(window.onunload)!="unknown") - if(window.onunload.toString!=unRegisterListener.toString) - whtopic_foldUnload=window.onunload; - } - else - { - if(window.onunload) - if(window.onunload.toString!=unRegisterListener.toString) - whtopic_foldUnload=window.onunload; - } - window.onunload=unRegisterListener; - setButtonFont("show","","10pt","","","",""); - - gbWhTopic=true; -} -else +// WebHelp 5.10.005 +var gsPPath=""; +var gaPaths=new Array(); +var gaAvenues=new Array(); + +var goFrame=null; +var gsStartPage=""; +var gsRelCurPagePath=""; +var gsSearchFormHref=""; +var gnTopicOnly=-1; +var gnOutmostTopic=-1; + +var BTN_TEXT=1; +var BTN_IMG=2; + +var goSync=null; + +var goShow=null; +var goHide=null; + +var goPrev=null; +var goNext=null; +var gnForm=0; +var goShowNav=null; +var goHideNav=null; + +var goWebSearch=null; + +var gsBtnStyle=""; +var gaButtons=new Array(); +var gaTypes=new Array(); +var whtopic_foldUnload=null; +var gbWhTopic=false; +var gbCheckSync=false; +var gbSyncEnabled=false; + +function setButtonFont(sType,sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration) +{ + var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration); + gsBtnStyle+=".whtbtn"+sType+"{"+getFontStyle(vFont)+"}"; +} + +function writeBtnStyle() +{ + if(gaButtons.length>0) + { + if(gsBtnStyle.length>0) + { + var sStyle=""; + document.write(sStyle); + } + } +} + +function button(sText,nWidth,nHeight) +{ + this.sText=sText; + this.nWidth=nWidth; + this.nHeight=nHeight; + + this.aImgs=new Array(); + var i=0; + while(button.arguments.length>i+3) + { + this.aImgs[i]=button.arguments[3+i]; + i++; + } +} + +//project info +function setRelStartPage(sPath) +{ + if(gsPPath.length==0) + { + gsPPath=_getFullPath(_getPath(document.location.href),_getPath(sPath)); + gsStartPage=_getFullPath(_getPath(document.location.href),sPath); + gsRelCurPagePath=_getRelativeFileName(gsStartPage,document.location.href); + } +} + +function getImage(oImage,sType) +{ + var sImg=""; + if(oImage&&oImage.aImgs&&(oImage.aImgs.length>0)) + { + sImg+="\""+sType+"\"0) + sImg+=" width="+oImage.nWidth; + if(oImage.nHeight>0) + sImg+=" height="+oImage.nHeight; + sImg+=" border=0>"; + } + return sImg; +} + +function addTocInfo(sTocPath) +{ + gaPaths[gaPaths.length]=sTocPath; +} + +function addAvenueInfo(sName,sPrev,sNext) +{ + gaAvenues[gaAvenues.length]=new avenueInfo(sName,sPrev,sNext); +} + +function addButton(sType,nStyle,sText,sHref,sOnClick,sOnMouseOver,sOnLoad,nWidth,nHeight,sImg1,sImg2,sImg3) +{ + var sButton=""; + var nBtn=gaButtons.length; + if(sType=="prev") + { + if(canGo(false)) + { + var sTitle="Previous Topic"; + goPrev=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goPrev.sText; + else + sButton+=getImage(goPrev,sTitle); + sButton+=""; + } + } + else if(sType=="next") + { + if(canGo(true)) + { + var sTitle="Next Topic"; + goNext=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goNext.sText; + else + sButton+=getImage(goNext,sTitle); + sButton+=""; + } + } + else if(sType=="show") + { + if(isTopicOnly()&&(!gbOpera6||gbOpera7)) + { + var sTitle="Show Navigation Component"; + goShow=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goShow.sText; + else + sButton+=getImage(goShow,sTitle); + sButton+=""; + } + } + else if(sType=="hide") + { + if(!isTopicOnly()&&!gbOpera6) + { + var sTitle="Hide Navigation Component"; + goHide=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goHide.sText; + else + sButton+=getImage(goHide,sTitle); + sButton+=""; + } + } + else if(sType=="shownav") + { + if(isShowHideEnable()) + { + var sTitle="Show Navigation Component"; + goShowNav=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goShowNav.sText; + else + sButton+=getImage(goShowNav,sTitle); + sButton+=""; + } + } + else if(sType=="hidenav") + { + if(isShowHideEnable()) + { + var sTitle="Hide Navigation Component"; + goHideNav=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goHideNav.sText; + else + sButton+=getImage(goHideNav,sTitle); + sButton+=""; + } + } + else if(sType=="synctoc") + { + if(gaPaths.length>0) + { + var sTitle="Sync TOC"; + goSync=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goSync.sText; + else + sButton+=getImage(goSync,sTitle); + sButton+=""; + } + } + else if(sType=="websearch") + { + if(gsSearchFormHref.length>0) + { + var sTitle="WebSearch"; + goWebSearch=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goWebSearch.sText; + else + sButton+=getImage(goWebSearch,sTitle); + sButton+=""; + } + } + else if(sType=="searchform") + { + gaButtons[nBtn]="NeedSearchForm"; + gaTypes[nBtn]=sType; + } + if(sButton.length!=0) + { + if(nStyle==BTN_TEXT) + sButton+=" "; + gaButtons[nBtn]=""+sButton+""; + gaTypes[nBtn]=sType; + } +} + +function isSyncEnabled() +{ + if(!gbCheckSync) + { + var oMsg=new whMessage(WH_MSG_ISSYNCSSUPPORT,this,1,null); + if(SendMessage(oMsg)) + { + gbSyncEnabled=oMsg.oParam; + } + gbCheckSync=true; + } + return gbSyncEnabled; +} + +function isInPopup() +{ + return (window.name.indexOf("BSSCPopup")!=-1); +} + +function getIntopicBar(sAlign) +{ + var sHTML=""; + if(gaButtons.length>0) + { + sHTML+="
"; + + sHTML+=""; + for(var i=0;i0) + { + var sHTML=""; + if(nAligns!=0) + { + sHTML+="
" + if(nAligns&1) + sHTML+=""; + if(nAligns&2) + sHTML+=""; + if(nAligns&4) + sHTML+=""; + sHTML+="
"+getIntopicBar("left")+""+getIntopicBar("center")+""+getIntopicBar("right")+"
"; + document.write(sHTML); + } + } +} + +function sendAveInfoOut() +{ + if(!isInPopup()) + setTimeout("sendAveInfo();",100); +} + +function sendAveInfo() +{ + var oMsg=new whMessage(WH_MSG_AVENUEINFO,this,1,gaAvenues); + SendMessage(oMsg); +} + + +function onNext() +{ + var oMsg=new whMessage(WH_MSG_NEXT,this,1,null); + SendMessage(oMsg); +} + +function onPrev() +{ + var oMsg=new whMessage(WH_MSG_PREV,this,1,null); + SendMessage(oMsg); +} + +function createSyncInfo() +{ + var oParam=new Object(); + if(gsPPath.length==0) + gsPPath=_getPath(document.location.href); + oParam.sPPath=gsPPath; + oParam.sTPath=document.location.href; + oParam.aPaths=gaPaths; + return oParam; +} + +function syncWithShow() +{ + if(isTopicOnly()) + show(); + else + { + sync(); + showTocPane(); + } +} + +function showTocPane() +{ + var oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null); + SendMessage(oMsg); +} + +function sendSyncInfo() +{ + if(!isInPopup()) + { + var oParam=null; + if(gaPaths.length>0) + { + oParam=createSyncInfo(); + } + var oMsg=new whMessage(WH_MSG_SYNCINFO,this,1,oParam); + SendMessage(oMsg); + } +} + +function sendInvalidSyncInfo() +{ + if(!isInPopup()) + { + var oMsg=new whMessage(WH_MSG_SYNCINFO,this,1,null); + SendMessage(oMsg); + } +} + +function enableWebSearch(bEnable) +{ + if(!isInPopup()) + { + var oMsg=new whMessage(WH_MSG_ENABLEWEBSEARCH,this,1,bEnable); + SendMessage(oMsg); + } +} + +function autoSync(nSync) +{ + if(nSync==0) return; + if(isInPopup()) return; + if(isOutMostTopic()) + sync(); +} + +function isOutMostTopic() +{ + if(gnOutmostTopic==-1) + { + var oMessage=new whMessage(WH_MSG_ISINFRAMESET,this,1,null); + if(SendMessage(oMessage)) + gnOutmostTopic=0; + else + gnOutmostTopic=1; + } + return (gnOutmostTopic==1); +} + +function sync() +{ + if(gaPaths.length>0) + { + var oParam=createSyncInfo(); + var oMessage=new whMessage(WH_MSG_SYNCTOC,this,1,oParam); + SendMessage(oMessage); + } +} + + +function avenueInfo(sName,sPrev,sNext) +{ + this.sName=sName; + this.sPrev=sPrev; + this.sNext=sNext; +} + +function getCurrentAvenue() +{ + var oParam=new Object(); + oParam.sAvenue=null; + var oMessage=new whMessage(WH_MSG_GETCURRENTAVENUE,this,1,oParam); + SendMessage(oMessage); + return oParam.sAvenue; +} + +function unRegisterListener() +{ + sendInvalidSyncInfo(); + enableWebSearch(false); + if(whtopic_foldUnload) + whtopic_foldUnload(); +} + +function onSendMessage(oMsg) +{ + var nMsgId=oMsg.nMessageId; + if(nMsgId==WH_MSG_GETAVIAVENUES) + { + oMsg.oParam.aAvenues=gaAvenues; + return false; + } + else if(nMsgId==WH_MSG_GETTOCPATHS) + { + if(isOutMostTopic()) + { + oMsg.oParam.oTocInfo=createSyncInfo(); + return false; + } + else + return true; + } + else if(nMsgId==WH_MSG_NEXT) + { + goAvenue(true); + } + else if(nMsgId==WH_MSG_PREV) + { + goAvenue(false); + } + else if(nMsgId==WH_MSG_WEBSEARCH) + { + websearch(); + } + return true; +} + +function goAvenue(bNext) +{ + var sTopic=null; + var sAvenue=getCurrentAvenue(); + var nAvenue=-1; + if(sAvenue!=null&&sAvenue!="") + { + for(var i=0;i0&&bNext) + { + sTopic=gaAvenues[i].sNext; + break; + } + else if(gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev.length>0&&!bNext) + { + sTopic=gaAvenues[i].sPrev; + break; + } + } + } + + if(sTopic!=null&&sTopic!="") + { + if(gsPPath!=null&&gsPPath!="") + { + sFullTopicPath=_getFullPath(gsPPath,sTopic); + document.location=sFullTopicPath; + } + } +} + +function canGo(bNext) +{ + for(var i=0;i0&&bNext)|| + (gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev.length>0&&!bNext)) + return true; + } + return false; +} + +function show() +{ + if(gsStartPage!="") + window.location=gsStartPage+"#"+gsRelCurPagePath; +} + +function hide() +{ + if(goFrame!=null) + { + goFrame.location=window.location; + } +} + +function isTopicOnly() +{ + if(gnTopicOnly==-1) + { + var oParam=new Object(); + oParam.oFrame=null; + var oMsg=new whMessage(WH_MSG_GETSTARTFRAME,this,1,oParam); + if(SendMessage(oMsg)) + { + goFrame=oParam.oFrame; + gnTopicOnly=0; + } + else + gnTopicOnly=1; + } + if(gnTopicOnly==1) + return true; + else + return false; +} + +function websearch() +{ + if(gbNav4) + { + if(document.ehelpform) + document.ehelpform.submit(); + } + else + { + if(window.ehelpform) + window.ehelpform.submit(); + } +} + +function addSearchFormHref(sHref) +{ + gsSearchFormHref=sHref; + enableWebSearch(true); +} + +function searchB(nForm) +{ + var sValue=eval("document.searchForm"+nForm+".searchString.value"); + var oMsg=new whMessage(WH_MSG_SEARCHTHIS,this,1,sValue); + SendMessage(oMsg); +} + +function getSearchFormHTML() +{ + var sHTML=""; + gnForm++; + var sFormName="searchForm"+gnForm; + var sButton="
" + sButton+=""; + if(""=="text") + { + sButton+=""; + } + else if(""=="image") + { + sButton+="" + sButton+=""; + } + sButton+="
"; + sHTML=""+sButton+""; + return sHTML; +} + +function showHidePane(bShow) +{ + var oMsg=null; + if(bShow) + oMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null); + else + oMsg=new whMessage(WH_MSG_HIDEPANE,this,1,null); + SendMessage(oMsg); +} + +function isShowHideEnable() +{ + if(gbIE4) + return true; + else + return false; +} + + +function PickupDialog_Invoke() +{ + if(!gbIE4||gbMac) + { + if(typeof(_PopupMenu_Invoke)=="function") + return _PopupMenu_Invoke(PickupDialog_Invoke.arguments); + } + else + { + if(PickupDialog_Invoke.arguments.length>2) + { + var sPickup="whskin_pickup.htm"; + var sPickupPath=gsPPath+sPickup; + if(gbIE4) + { + var sFrame=PickupDialog_Invoke.arguments[1]; + var aTopics=new Array(); + for(var i=2;i1) + { + var nWidth=300; + var nHeight=180; + var nScreenWidth=screen.width; + var nScreenHeight=screen.height; + var nLeft=(nScreenWidth-nWidth)/2; + var nTop=(nScreenHeight-nHeight)/2; + if(gbIE4) + { + var vRet=window.showModalDialog(sPickupPath,aTopics,"dialogHeight:"+nHeight+"px;dialogWidth:"+nWidth+"px;resizable:yes;status:no;scroll:no;help:no;center:yes;"); + if(vRet) + { + var sURL=vRet.m_url; + if(sFrame) + window.open(sURL,sFrame); + else + window.open(sURL,"_self"); + } + } + } + else if(aTopics.length==1) + { + var sURL=aTopics[0].m_sURL + if(sFrame) + window.open(sURL,sFrame); + else + window.open(sURL,"_self"); + } + } + } + } +} + +if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy) +{ + RegisterListener("bsscright",WH_MSG_GETAVIAVENUES); + RegisterListener("bsscright",WH_MSG_GETTOCPATHS); + RegisterListener("bsscright",WH_MSG_NEXT); + RegisterListener("bsscright",WH_MSG_PREV); + RegisterListener("bsscright",WH_MSG_WEBSEARCH); + if(gbMac&&gbIE4) + { + if(typeof(window.onunload)!="unknown") + if(window.onunload.toString!=unRegisterListener.toString) + whtopic_foldUnload=window.onunload; + } + else + { + if(window.onunload) + if(window.onunload.toString!=unRegisterListener.toString) + whtopic_foldUnload=window.onunload; + } + window.onunload=unRegisterListener; + setButtonFont("show","","","","","",""); +setButtonFont("hide","","","","","",""); + + gbWhTopic=true; +} +else document.location.reload(); \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whutils.js b/doc/salome/gui/SMESH/whutils.js index 85fae7e05..5026b24a3 100755 --- a/doc/salome/gui/SMESH/whutils.js +++ b/doc/salome/gui/SMESH/whutils.js @@ -1,527 +1,527 @@ -// WebHelp 5.10.004 -var gsFileName=""; -var gsDivName=""; -var xmlDoc=null; -var sdocPath=null; -var gsInsertBeforeEndHTML=""; -var sReplaceStringsSrc=new Array(); -var gsDivName="dataDiv"; -var gnLoadDivNum=0; -sReplaceStringsSrc[0]="&"; -sReplaceStringsSrc[1]=">"; -sReplaceStringsSrc[2]="<"; -sReplaceStringsSrc[3]="""; -sReplaceStringsSrc[4]=String.fromCharCode(8364); -sReplaceStringsSrc[5]=" "; - -var sReplaceStringsDst=new Array(); -sReplaceStringsDst[0]="&"; -sReplaceStringsDst[1]=">"; -sReplaceStringsDst[2]="<"; -sReplaceStringsDst[3]="\""; -sReplaceStringsDst[4]=String.fromCharCode(128); -sReplaceStringsDst[5]=" "; -var goHighLighted=null; - -function _getRelativePath(strParentPath,strCurrentPath) -{ - if(_isAbsPath(strCurrentPath)) return _getPath(strCurrentPath); - strParentPath=_replaceSlash(strParentPath); - strParentPath=_getPath(strParentPath); - strCurrentPath=_replaceSlash(strCurrentPath); - strCurrentPath=_getPath(strCurrentPath); - for(var i=0;i0) - { - var nPosx=sPath.indexOf("/",nPos+2); - if(nPosx>0) - return sPath.substring(0,nPosx); - else - return sPath; - } - return sPath; -} - -function _getFullPath(sPath,sRelPath) -{ - if(_isAbsPath(sRelPath)) - return sRelPath; - else if(_isAbsPathToHost(sRelPath)) - return _getHost(sPath)+sRelPath; - else - { - var sFullPath=sPath; - var nPathPos=0; - while(nPathPos!=-1) - { - var nPathPos=sRelPath.indexOf("../"); - if(nPathPos!=-1) - { - sRelPath=sRelPath.substring(nPathPos+3); - sFullPath=sFullPath.substring(0,sFullPath.length-1); - var nPos2=sFullPath.lastIndexOf("/"); - if(nPos2!=-1) - sFullPath=sFullPath.substring(0,nPos2+1); - else - break; - } - } - sFullPath+=sRelPath; - return sFullPath; - } -} - -function _isAbsPath(strPath) -{ - var strUpper=strPath.toUpperCase(); - return (strUpper.indexOf(":")!=-1||strUpper.indexOf("\\\\")==0); -} - -function _replaceSlash(strURL) -{ - var re=new RegExp("\\\\","g"); - var strReplacedURL=strURL.replace(re,"/"); - return strReplacedURL; -} - -function _getPath(strURL) -{ - pathpos=strURL.lastIndexOf("/"); - if(pathpos>0) - return strURL.substring(0,pathpos+1); - else - return ""; -} - -function removeItemFromArray(oArray,i) -{ - if(oArray.length&&i>=0&&i=0&&i<=oArray.length) - { - var len=oArray.length; - for(var s=len;s>i;s--) - oArray[s]=oArray[s-1]; - oArray[i]=obj; - } -} - -function loadData(sFileName) -{ - var i=gnLoadDivNum; - var sName=gsDivName+gnLoadDivNum++; - loadData_2(sFileName,sName); -} - -function loadData_2(sFileName,sDivName) -{ - if(!getElement(sDivName)) - { - if(!insertDataDiv(sDivName)) - { - gsFileName=sFileName; - gsDivName=sDivName; - return; - } - } - var sHTML=""; - if(gbMac) - sHTML+=""; - else - sHTML+=""; - - var oDivCon=getElement(sDivName); - if(oDivCon) - { - if(gbNav6) - { - if(oDivCon.getElementsByTagName&&oDivCon.getElementsByTagName("iFrame").length>0) - { - oDivCon.getElementsByTagName("iFrame")[0].src=sFileName; - } - else - oDivCon.innerHTML=sHTML; - } - else - oDivCon.innerHTML=sHTML; - } -} - -function loadDataXML(sFileName) -{ - var sCurrentDocPath=_getPath(document.location.href); - sdocPath=_getFullPath(sCurrentDocPath,sFileName); - if(gbIE5) - { - xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); - xmlDoc.async=true; - xmlDoc.onreadystatechange=checkState; - if(document.body!=null) - xmlDoc.load(sdocPath); - } - else if(gbNav6) - { - xmlDoc=document.implementation.createDocument("","",null); - xmlDoc.addEventListener("load",initializeData,false); - xmlDoc.load(sdocPath,"text/xml"); - } -} - -function initializeData() -{ - if(xmlDoc!=null) - putDataXML(xmlDoc,sdocPath); -} - -function checkState() -{ - if(xmlDoc!=null) - { - var state=xmlDoc.readyState; - if(state==4) - { - var err=xmlDoc.parseError; - if(err.errorCode==0) - putDataXML(xmlDoc,sdocPath); - else - onLoadXMLError(); - } - } -} - -function insertDataDiv(sName) -{ - var sHTML=""; - if(gbMac) - sHTML+="
"; - else - sHTML+="
"; - if((gbIE5||gbNav6)&&document.body) - document.body.insertAdjacentHTML("beforeEnd",sHTML); - else - { - gsInsertBeforeEndHTML=sHTML; - setTimeout("insertWhenBodyReady();",100); - return false; - } - return true; -} - -function insertWhenBodyReady() -{ - if(gsInsertBeforeEndHTML=="") return; - if(document.body) - { - document.body.insertAdjacentHTML("beforeEnd",gsInsertBeforeEndHTML); - gsInsertBeforeEndHTML=""; - loadData_2(gsFileName,gsDivName); - } - else - { - setTimeout("insertWhenBodyReady();",100); - } -} - -function window_BUnload() -{ - for(var i=0;i='0'&&sBStr.charAt(i)<='9') - { - sNum+=sBStr.charAt(i++); - } - if(sNum!=""){ - var nNum=parseInt(sNum,16); - sText+=String.fromCharCode(nNum); - sBStr=sBStr.substring(i); - } - nPos=sBStr.indexOf('%'); - } - sText+=sBStr; - return sText; -} - -function excapeSingleQuotandSlash(str) -{ - if(str==null) return null; - var nPos=0; - var sRes=""; - var nPosNew=str.indexOf("\\",nPos); - while(nPosNew!=-1){ - sRes+=str.substring(nPos,nPosNew+1)+"\\"; - nPos=nPosNew+1; - nPosNew=str.indexOf("\\",nPos); - } - if(nPos0) + { + var nPosx=sPath.indexOf("/",nPos+2); + if(nPosx>0) + return sPath.substring(0,nPosx); + else + return sPath; + } + return sPath; +} + +function _getFullPath(sPath,sRelPath) +{ + if(_isAbsPath(sRelPath)) + return sRelPath; + else if(_isAbsPathToHost(sRelPath)) + return _getHost(sPath)+sRelPath; + else + { + var sFullPath=sPath; + var nPathPos=0; + while(nPathPos!=-1) + { + var nPathPos=sRelPath.indexOf("../"); + if(nPathPos!=-1) + { + sRelPath=sRelPath.substring(nPathPos+3); + sFullPath=sFullPath.substring(0,sFullPath.length-1); + var nPos2=sFullPath.lastIndexOf("/"); + if(nPos2!=-1) + sFullPath=sFullPath.substring(0,nPos2+1); + else + break; + } + } + sFullPath+=sRelPath; + return sFullPath; + } +} + +function _isAbsPath(strPath) +{ + var strUpper=strPath.toUpperCase(); + return (strUpper.indexOf(":")!=-1||strUpper.indexOf("\\\\")==0); +} + +function _replaceSlash(strURL) +{ + var re=new RegExp("\\\\","g"); + var strReplacedURL=strURL.replace(re,"/"); + return strReplacedURL; +} + +function _getPath(strURL) +{ + pathpos=strURL.lastIndexOf("/"); + if(pathpos>0) + return strURL.substring(0,pathpos+1); + else + return ""; +} + +function removeItemFromArray(oArray,i) +{ + if(oArray.length&&i>=0&&i=0&&i<=oArray.length) + { + var len=oArray.length; + for(var s=len;s>i;s--) + oArray[s]=oArray[s-1]; + oArray[i]=obj; + } +} + +function loadData(sFileName) +{ + var i=gnLoadDivNum; + var sName=gsDivName+gnLoadDivNum++; + loadData_2(sFileName,sName); +} + +function loadData_2(sFileName,sDivName) +{ + if(!getElement(sDivName)) + { + if(!insertDataDiv(sDivName)) + { + gsFileName=sFileName; + gsDivName=sDivName; + return; + } + } + var sHTML=""; + if(gbMac) + sHTML+=""; + else + sHTML+=""; + + var oDivCon=getElement(sDivName); + if(oDivCon) + { + if(gbNav6) + { + if(oDivCon.getElementsByTagName&&oDivCon.getElementsByTagName("iFrame").length>0) + { + oDivCon.getElementsByTagName("iFrame")[0].src=sFileName; + } + else + oDivCon.innerHTML=sHTML; + } + else + oDivCon.innerHTML=sHTML; + } +} + +function loadDataXML(sFileName) +{ + var sCurrentDocPath=_getPath(document.location.href); + sdocPath=_getFullPath(sCurrentDocPath,sFileName); + if(gbIE5) + { + xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); + xmlDoc.async=true; + xmlDoc.onreadystatechange=checkState; + if(document.body!=null) + xmlDoc.load(sdocPath); + } + else if(gbNav6) + { + xmlDoc=document.implementation.createDocument("","",null); + xmlDoc.addEventListener("load",initializeData,false); + xmlDoc.load(sdocPath,"text/xml"); + } +} + +function initializeData() +{ + if(xmlDoc!=null) + putDataXML(xmlDoc,sdocPath); +} + +function checkState() +{ + if(xmlDoc!=null) + { + var state=xmlDoc.readyState; + if(state==4) + { + var err=xmlDoc.parseError; + if(err.errorCode==0) + putDataXML(xmlDoc,sdocPath); + else + onLoadXMLError(); + } + } +} + +function insertDataDiv(sName) +{ + var sHTML=""; + if(gbMac) + sHTML+="
"; + else + sHTML+="
"; + if((gbIE5||gbNav6)&&document.body) + document.body.insertAdjacentHTML("beforeEnd",sHTML); + else + { + gsInsertBeforeEndHTML=sHTML; + setTimeout("insertWhenBodyReady();",100); + return false; + } + return true; +} + +function insertWhenBodyReady() +{ + if(gsInsertBeforeEndHTML=="") return; + if(document.body) + { + document.body.insertAdjacentHTML("beforeEnd",gsInsertBeforeEndHTML); + gsInsertBeforeEndHTML=""; + loadData_2(gsFileName,gsDivName); + } + else + { + setTimeout("insertWhenBodyReady();",100); + } +} + +function window_BUnload() +{ + for(var i=0;i='0'&&sBStr.charAt(i)<='9') + { + sNum+=sBStr.charAt(i++); + } + if(sNum!=""){ + var nNum=parseInt(sNum,16); + sText+=String.fromCharCode(nNum); + sBStr=sBStr.substring(i); + } + nPos=sBStr.indexOf('%'); + } + sText+=sBStr; + return sText; +} + +function excapeSingleQuotandSlash(str) +{ + if(str==null) return null; + var nPos=0; + var sRes=""; + var nPosNew=str.indexOf("\\",nPos); + while(nPosNew!=-1){ + sRes+=str.substring(nPos,nPosNew+1)+"\\"; + nPos=nPosNew+1; + nPosNew=str.indexOf("\\",nPos); + } + if(nPos=4) - { - if(navigator.appName=="Netscape") - { - gbNav4=true; - if(gnVerMajor>=5) - gbNav6=true; - } - gbIE4=(navigator.appName.indexOf("Microsoft")!=-1); - } - if(gbNav6) - { - var nPos=gAgent.indexOf("gecko"); - if(nPos!=-1) - { - var nPos2=gAgent.indexOf("/", nPos); - if(nPos2!=-1) - { - var nVersion=parseFloat(gAgent.substring(nPos2+1)); - if(nVersion>=20010726) - { - gbNav61=true; - if (nVersion>=20020823) - gbNav7=true; - } - } - } - }else if(gbIE4) - { - var nPos=gAgent.indexOf("msie"); - if(nPos!=-1) - { - var nVersion=parseFloat(gAgent.substring(nPos+5)); - if(nVersion>=5) - { - gbIE5=true; - if(nVersion>=5.5) - gbIE55=true; - } - } - } -} -else if (gbOpera) -{ - var nPos = gAgent.indexOf("opera"); - if(nPos!=-1) - { - var nVersion=parseFloat(gAgent.substring(nPos+6)); - if(nVersion>=6) - { - gbOpera6=true; - if(nVersion>=7) - gbOpera7=true; - } - } -} -else if (gbKonqueror) -{ - var nPos = gAgent.indexOf("konqueror"); - if(nPos!=-1) - { - var nVersion = parseFloat(gAgent.substring(nPos+10)); - if (nVersion >= 3) - { - gbKonqueror3=true; - } - } -} - +// WebHelp 5.10.006 +var gbNav=false; +var gbNav6=false; +var gbNav61=false; +var gbNav7=false; +var gbNav4=false; +var gbIE4=false; +var gbIE=false; +var gbIE5=false; +var gbIE55=false; +var gbOpera6=false; +var gbOpera7=false; +var gbKonqueror3=false; + +var gAgent=navigator.userAgent.toLowerCase(); +var gbMac=(gAgent.indexOf("mac")!=-1); +var gbSunOS=(gAgent.indexOf("sunos")!=-1); +var gbOpera=(gAgent.indexOf("opera")!=-1); +var gbKonqueror=(gAgent.indexOf("konqueror")!= -1); +var gbSafari=(gAgent.indexOf("safari")!= -1); +var gbWindows=((gAgent.indexOf('win')!= -1)||(gAgent.indexOf('16bit')!= -1)); +var gbMozilla=((gAgent.indexOf('gecko')!=-1) && (gAgent.indexOf('netscape')==-1)); + + +var gVersion=navigator.appVersion.toLowerCase(); + +var gnVerMajor=parseInt(gVersion); +var gnVerMinor=parseFloat(gVersion); + +if(!gbOpera&&!gbKonqueror&&!gbSafari) // opera can mimic IE or Netscape by settings. +{ + gbIE=(navigator.appName.indexOf("Microsoft")!=-1); + gbNav=(gAgent.indexOf('mozilla')!=-1) && ((gAgent.indexOf('spoofer')==-1) && (gAgent.indexOf('compatible')==-1)); + if(gnVerMajor>=4) + { + if(navigator.appName=="Netscape") + { + gbNav4=true; + if(gnVerMajor>=5) + gbNav6=true; + } + gbIE4=(navigator.appName.indexOf("Microsoft")!=-1); + } + if(gbNav6) + { + var nPos=gAgent.indexOf("gecko"); + if(nPos!=-1) + { + var nPos2=gAgent.indexOf("/", nPos); + if(nPos2!=-1) + { + var nVersion=parseFloat(gAgent.substring(nPos2+1)); + if(nVersion>=20010726) + { + gbNav61=true; + if (nVersion>=20020823) + gbNav7=true; + } + } + } + }else if(gbIE4) + { + var nPos=gAgent.indexOf("msie"); + if(nPos!=-1) + { + var nVersion=parseFloat(gAgent.substring(nPos+5)); + if(nVersion>=5) + { + gbIE5=true; + if(nVersion>=5.5) + gbIE55=true; + } + } + } +} +else if (gbOpera) +{ + var nPos = gAgent.indexOf("opera"); + if(nPos!=-1) + { + var nVersion=parseFloat(gAgent.substring(nPos+6)); + if(nVersion>=6) + { + gbOpera6=true; + if(nVersion>=7) + gbOpera7=true; + } + } +} +else if (gbKonqueror) +{ + var nPos = gAgent.indexOf("konqueror"); + if(nPos!=-1) + { + var nVersion = parseFloat(gAgent.substring(nPos+10)); + if (nVersion >= 3) + { + gbKonqueror3=true; + } + } +} + var gbWhVer=true; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whxdata/whftdata0.xml b/doc/salome/gui/SMESH/whxdata/whftdata0.xml index 053989ed4..3c5f6ca5d 100755 --- a/doc/salome/gui/SMESH/whxdata/whftdata0.xml +++ b/doc/salome/gui/SMESH/whxdata/whftdata0.xml @@ -1,70 +1,74 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whxdata/whfts.xml b/doc/salome/gui/SMESH/whxdata/whfts.xml index 58b9c0e24..023ab7c77 100755 --- a/doc/salome/gui/SMESH/whxdata/whfts.xml +++ b/doc/salome/gui/SMESH/whxdata/whfts.xml @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/doc/salome/gui/SMESH/whxdata/whfwdata0.xml b/doc/salome/gui/SMESH/whxdata/whfwdata0.xml index 028a018b6..bf8dac36b 100755 --- a/doc/salome/gui/SMESH/whxdata/whfwdata0.xml +++ b/doc/salome/gui/SMESH/whxdata/whfwdata0.xml @@ -1,1134 +1,1303 @@ - - - 12,4,5,23,6,55,57,60,42,63,65, - 12, - 15,16,17,18,19,21,5,24,6,25,26,27,28,9,10,55,29,31,34,35,57,58,60,38,39,61,42,43,44,46,63,48,49,50,65,52, - 5,6,55,57,63,65, - 5,6,55,57,60, - 63, - 63, - 57, - 57, - 57, - 57, - 57,63, - 57, - 60,63, - 63, - 60, - 57, - 11,12,13,14,17,21,6,9,10,30,36,60,61, - 57,60, - 15,16,18,1,19,21,5,24,6,25,26,27,28,9,10,29,31,35,57,58,60,38,39,61,42,43,44,46,63,48,49,50,65,52, - 5,6,55,57,60,63,65, - 5,6, - 63, - 57,63, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 63, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 57, - 63, - 57, - 11,12,13,14,16,18,1,3,21,5,6,9,10,30,32,31,35,57,58,60,61,42,63,51,52, - 12,16,18,1,19,21,5,24,25,26,9,10,55,29,58,60,38,39,61,42,43,44,63,48,49,65,52, - 6,55,57,60,63, - 5,6, - 57, - 57, - 57, - 57, - 57, - 57,63, - 57, - 11,12,13,14,15,1,19,21,23,24,6,7,25,26,27,9,10,30,33,60,38,39,61,42,44,48,49, - 60, - 12, - 12,16,18,21,5,24,6,26,10,29,57,58,60,42,43,46,63,52, - 57, - 57, - 57, - 57,63, - 57, - 57, - 57, - 4,57,60,63, - 6,57, - 57, - 57, - 63, - 12, - 5,6,55,57,63,65, - 55,57, - 57, - 57, - 63, - 5,6,55, - 6,60,63, - 57, - 63, - 63, - 57, - 55,63, - 5,6,55, - 57, - 57, - 57, - 57, - 63, - 63, - 63, - 5,6,55, - 63, - 57, - 63, - 57, - 57, - 57, - 15, - 10,44, - 60, - 50, - 64, - 17, - 0,62, - 14,16,17,18,31,35,58,43,44,46,52, - 11,58, - 60,63, - 63, - 36, - 15,19,23,24,55,57,48,50, - 15,19,21,5,23,24,6,28,10,55,57,60,62,48, - 57, - 57, - 5,6,55,60,65, - 24,30,57, - 11,12,21,6,36,58,41,62,44, - 57, - 55, - 5,6,55,57,60,63,65, - 5,55,65, - 57, - 26,35,36,38,42,48, - 44, - 36, - 0,51, - 55,60, - 55,57,60, - 55,57,60, - 55, - 55, - 55,60, - 55, - 55, - 55, - 55, - 55, - 55, - 55, - 55, - 55, - 17, - 5,6,57,63, - 5,60,65, - 5,60,65, - 11,12,13,14,16,21,5,22,6,10,55,30,32,57,33,58,37,42,63, - 11,17,19,23,24,29,30,34,36,58,40,42,44,45,47,48,50, - 9,10,57,58,44, - 21, - 44, - 57,63, - 2, - 17, - 57,60,63, - 14,4,24,10,30,35,60,61,40,43,48,52, - 63, - 57, - 10, - 10, - 55,60, - 57, - 57, - 57, - 57, - 36, - 12,21,23,26,10,55,58,44, - 13,15,16,18,19,4,21,23,24,7,25,26,28,9,10,30,31,35,58,37,38,39,61,42,43,44,45,46,48,49,50,52, - 21, - 0,15,19,21,22,23,24,25,26,28,9,10,34,58,38,39,61,40,45,47,48,49,50, - 60, - 16,17,18,1,21,22,6,32,31,35,57,33,36,37,62,43,44,46,52, - 62, - 14,58, - 11,0,21,22,23, - 21, - 17, - 55,60, - 6,57, - 52, - 11,14,16,1,6,55,30,32,33,60,44,46, - 11,17,5,6,63, - 5,6,63,65, - 4,10,61, - 55, - 55, - 14,18,1,30,60,44, - 21,37,52, - 15,27,38, - 4, - 21,58, - 19,21,24,26,48, - 42, - 11,17,6,36,58,52, - 9,61,40,45,52, - 57,63, - 57,63, - 0, - 14, - 11,16,6,10,30,52, - 12,21,22, - 11, - 58, - 62, - 17,42, - 2,3,23,53,54,42,50, - 42, - 62, - 52, - 52, - 62, - 0, - 5,6, - 17, - 50, - 42,63, - 14,2,3,53,54,30,60,42,63, - 8,10,44,50, - 41, - 12,58, - 58, - 11,58,42,44, - 13,15,19,21,5,22,23,24,6,25,26,28,9,10,55,29,34,58,60,38,39,61,40,41,62,42,44,45,63,47,48,49,50,51,65, - 5,6, - 63, - 63, - 23, - 0,15,20,21,22,23,7,28,59,38,39,62,51, - 6,9,36,58,61, - 58,44, - 0,15,16,18,19,4,21,22,23,24,7,25,26,28,9,10,29,31,35,58,37,38,39,61,40,62,42,43,44,45,46,47,48,49,50,51,52, - 12, - 58, - 14,18,1,36,46, - 11,16,31,35, - 38, - 15,21,5,6,26,58,63,51, - 23,38,49, - 10,44, - 44, - 44, - 57, - 23,58, - 0,17,19,5,26,36,37,65, - 0, - 14, - 12, - 23,42, - 15,62,47, - 11,21,58, - 15,16,18,19,20,23,24,7,25,26,8,27,9,10,29,31,34,35,58,38,39,61,40,41,62,42,43,45,46,47,48,49,52, - 24,32,33,48, - 10,57, - 57, - 62, - 0,15,16,18,19,4,20,21,22,23,24,7,25,26,27,28,9,10,29,31,35,58,59,37,38,39,61,41,62,42,43,44,46,48,49,50,51,52, - 0,4, - 12,7,42, - 42, - 34, - 14,0,16,18,31,35,43,46,52, - 31,59,62, - 25,62,49, - 42, - 30,41, - 11,12,13,14,0,17,1,27,32,33,43, - 5,6,57, - 17,21,5,6,55,57,58,60,42,63,65, - 21,22, - 36, - 11, - 19,24,28,38,44,48,50, - 23, - 11,36,42,63, - 17,24,44, - 12,14,2,3,30,60, - 58, - 21, - 12,42, - 14,16,17,18,2,3,20,21,22,23,53,54,55,32,31,35,33,46, - 51, - 17, - 17,20,21,5,22,37, - 17,21,5,22, - 12,13,19,21,22,23,24,29,58,44,48, - 7, - 44, - 12,42, - 48, - 14,0,16,18,1,2,3,24,53,54,30,56,31,35,60,43,46,48,52, - 44, - 12,15,26,58, - 40,62,45,63,47, - 52, - 24,44,52, - 12,14,29,58,62,42,47, - 12,15, - 42, - 58, - 21, - 12,13,0,15,4,21,5,23,6,55,30,34,57,36,58,60,37,40,62,45,63,47,50,52, - 6, - 55,60, - 60, - 60, - 55,60, - 55,60, - 55,57,60, - 60, - 60, - 55,57,60, - 55, - 5,6,55,60,65, - 60, - 60, - 55,60, - 5,6,55,60,65, - 57,60, - 55,60, - 60, - 60, - 60, - 60, - 60, - 12,23,36,58,37,50, - 30,62, - 16,18,1,23,24,55,56,31,35,60,62,43,46,48,52, - 0,4,52, - 13, - 19,21,24,37,62,42,48, - 12,10, - 17,10, - 5,24,6,55,57,63,50, - 55, - 17, - 12, - 0,21,23,10,59,62,64, - 12,13,17,18,4,21,5,23,6,10,57,36,58,42,63, - 12,14,17,19,20,23,24,30,37,38,48, - 17,32,33, - 11,17,6, - 6, - 4, - 0,7,54,57,38,62, - 57, - 30,38,49, - 17, - 11,12,21,32,33, - 12,0,58, - 58, - 34, - 41, - 12,14,30, - 11, - 34, - 24,25,57,46, - 13,15,17,19,21,22,24,25,26,28,9,10,29,34,58,38,39,61,40,42,44,45,47,48,49,50, - 17, - 10,42, - 11,15,23,37,62,42, - 12,1,21,9,61, - 12,1,42,44, - 58,52, - 57,63, - 5,6,55, - 9,61, - 12,13, - 26, - 14,0,16,18,2,19,21,22,24,6,26,8,27,53,31,35,59,43,44,46,48,51,52, - 17,4,58,52, - 23, - 44, - 17, - 17, - 15, - 58, - 12,21,36, - 21,24,58,42,48, - 20, - 11,12,13,14,15,17,18,2,3,20,21,5,23,24,6,25,26,8,10,53,54,55,30,56,31,57,36,58,60,62,42,44,63,48,49,65,52, - 63, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 5,7,28,55,34,37, - 48, - 58,42, - 11,12,13,14,0,15,16,17,18,1,3,19,20,23,24,6,7,25,26,27,28,9,10,54,55,30,32,31,35,57,33,36,58,38,39,61,40,62,42,43,44,45,46,63,47,48,50,51,52, - 57,58, - 62, - 22, - 58, - 11,17,6,36,62,42,47, - 42, - 23,25,26,29,49, - 12,13, - 12,0,8,62, - 17,18,58,62,42,44, - 17, - 18, - 0, - 14,1,24,48, - 1, - 21, - 58, - 52, - 21, - 12,21,58,50, - 17, - 44, - 42, - 11,19,23,24,28,58,62,48, - 21, - 5,29,30, - 29, - 5, - 52, - 4, - 9,10,61, - 9,10,57, - 57, - 57, - 17,6, - 11,12,13,15,17,1,2,20,21,5,23,6,8,53,55,30,32,57,36,58,60,62,42,63,51,65,52, - 6,57, - 60, - 57, - 57, - 57, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 17, - 5,6,55,60,65, - 42, - 10, - 44, - 15,19,23,24,25,26,39,62,42,44,48,49, - 42, - 29,58,62, - 39,42, - 19,23,24,62,48, - 23,62, - 29,58,42, - 63, - 5,6,55,60,65, - 17,21,55,58,42, - 12,5,6,57,44,63, - 58, - 21,22, - 11,12,13,0,15,18,1,19,21,22,23,24,25,26,27,28,9,10,34,58,38,39,61,40,42,44,45,47,48,49,50,51, - 25,28,58,42, - 29,30, - 17,1, - 12,52, - 12,14,53,54,30,60,42,44,63, - 12, - 0, - 21,29,34,42, - 11,12,14,17,21,30,36,58, - 9,58,61, - 12,6,30, - 12,14,6, - 11,12,13,17,21,22,23,30,32,33,58,37,40,44,45,47,51, - 23,55,44, - 5,6,55,57,60,63,65, - 0,4,21,10,58,51, - 55,60, - 5,6,55, - 55, - 5,6,55, - 5,6,55, - 57,63, - 57,60,63, - 5,6,55, - 5,6,55, - 6, - 62,51, - 17,1,36,42, - 44, - 58, - 23, - 19,20,23,24,7,28,10,55,30,34,57,60,62,47,48,50,51, - 50, - 50, - 50, - 50, - 50, - 57, - 57, - 63, - 57, - 52, - 18, - 18, - 52, - 4, - 36,58, - 18,52, - 10, - 14, - 58, - 28,58, - 5,6,57, - 6, - 6, - 10, - 13,5,6, - 21, - 5,6,57, - 12,13,15,1,6,57,33,65, - 0, - 12, - 2,3,19,23,24,53,54,48, - 54, - 58, - 10,37, - 22, - 5,60,65, - 5,60,65, - 5,65, - 5,65, - 5,6,55, - 5,6,55, - 11,17,21,22,6,30,36,37, - 11,17,21,5,6,55,32,57,33,36,37,63,65, - 5,6,55, - 21,24,55,58,60,42,48, - 28,38,41, - 0,17,19,23,24,25,26,27,9,10,61,42,44,48,49, - 57, - 6,57, - 5,6,55,60,65, - 63, - 10, - 5,65, - 55, - 5,60,63,65, - 12,15,4,21,5,6,9,10,55,57,36,58,37,38,61,62,42,44,48, - 10, - 12, - 5,6,55,29,30,57,60,63,65, - 29, - 5,6,55,60, - 12,51, - 5,6,63, - 58, - 58, - 52, - 0,51,65, - 12,0,28,51,65, - 5,6,55,60, - 10,62,45,50, - 5,6,55, - 17, - 62,42, - 58, - 7, - 42, - 12, - 42, - 58, - 58,50, - 55, - 55,58,50, - 11,36, - 30, - 12,25,57, - 57, - 25,57, - 64, - 58, - 58, - 6,57, - 15,19,20,24,25,26,28,9,10,29,34,58,39,61,40,42,44,45,47,48,49,50, - 10,44, - 44, - 43, - 58,38, - 17, - 10,44,45, - 58, - 58, - 57, - 52, - 44, - 18, - 17,42, - 57, - 9,58,61, - 5,6,55,60,65, - 0,51, - 58,44, - 21,7, - 10,58, - 60, - 55,60, - 11,14,17,18,5,6,30,56,31,36,60,42,63,52, - 6, - 62,42,44, - 10, - 11,15, - 6, - 23,62, - 5,6,55,60,65, - 15,1,21,27,42, - 58,42,44, - 12,17,9,58,61,43, - 42, - 15,19,23,24,7,10,62,48, - 17, - 21, - 58,62, - 5,22,6,30,57,36,63, - 6, - 58,42, - 17,26,29,44, - 18, - 27,58,62, - 12, - 58, - 19,24,7,10,36,58,62,48,50, - 6,57, - 5,6,55,60,63,65, - 57, - 5,6,60,63, - 6, - 5,6, - 6,57, - 5,6, - 5,6, - 6, - 6,57, - 5,6,57, - 6,57, - 11,15, - 23,58, - 58, - 10, - 57,63, - 11,30,32,33,44, - 5,6,55,57,60,65, - 5,55, - 6, - 5,6,55, - 5,55, - 6, - 17,6,32,33,43,44, - 12, - 12, - 52, - 24,48, - 5,6,60,65, - 5,6, - 0,15,19,4,20,21,22,23,24,7,25,26,27,28,9,10,29,34,36,58,38,39,61,40,41,62,42,44,45,47,48,49,50,51, - 34,42,63, - 63, - 11,12,13,14,0,15,16,17,18,1,2,3,19,4,20,21,5,22,23,24,6,7,25,26,27,28,9,10,53,54,55,29,30,32,31,34,35,57,33,36,58,59,60,37,38,39,61,40,41,62,42,43,44,45,46,63,47,48,49,50,51,65,52, - 21, - 60, - 60, - 5,6,55, - 5, - 44, - 14,24,30,35,60,42,48, - 63, - 63, - 0,59, - 12,30, - 12,15,19,24,25,26,28,9,10,30,34,58,38,39,61,40,42,44,45,47,48,49, - 19,24,28,57,48, - 12,13,30,41, - 23, - 26,30,57, - 57, - 63, - 14,2,3,30,60, - 60, - 18, - 21,10,58,62,42, - 5,60,65, - 5,6,55,60, - 58,42, - 21,5,23,28,55,29,62,50,65, - 55,60, - 65, - 65, - 65, - 57,65, - 65, - 65, - 65, - 65, - 65, - 65, - 65, - 65, - 21, - 15, - 1, - 25,49, - 13, - 6, - 6, - 6, - 4,21,22,23,26,58,37,62,50, - 0,17,58, - 12,0,15,16,17,18,19,20,23,26,27,9,30,34,57,58,59,38,39,61,62,42,43,44,46,63,51,65,52, - 58,44, - 21, - 45,52, - 15,21,7,44, - 12, - 4,21,10, - 11,12,17,5,6,9,30,57,58,61,42,44,63,51,65, - 0,27, - 5,6,55,57,60,63,65, - 5,6,55, - 11, - 42, - 11,13,0,15,17,4,20,21,22,23,24,6,7,28,29,32,57,33,58,59,37,38,39,40,47,48,51, - 5,6,55,60, - 23, - 10, - 15,21, - 15,19,4,24,7,25,26,28,9,10,29,57,38,39,61,42,44,48,49,50, - 12,17,21,22,24,7,25,9,53,54,36,58,60,37,38,61,62,42,44,45,47,48,50,65, - 48, - 36,58, - 64, - 11, - 13,0,15,16,17,18,1,2,3,19,22,23,24,7,25,26,28,9,10,53,54,29,30,56,32,31,34,35,33,36,37,38,39,61,40,42,43,44,45,46,47,48,49,50,52, - 11,4,5,24,6,36,42,43,63, - 12,45,47, - 21,10, - 12,19,58, - 19,4,24,48, - 52, - 48, - 21, - 21, - 54, - 58, - 12, - 23, - 17, - 12,17,62,42, - 11,0,4,10,40,42, - 12,58, - 42,44, - 12, - 10,57,62, - 58, - 58, - 1, - 18, - 30,39,42,45,50, - 57,63, - 2,23,10,53,54, - 42, - 4,55,60,45,52, - 52, - 23,41, - 7, - 9,61, - 12,17,6,10,57,58,61,40,42,45,63,47,52, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 5,6, - 57,63, - 15,65, - 15, - 15,65, - 0,7,27, - 12,58, - 36, - 62, - 11,1,23,58, - 62, - 15, - 59, - 62, - 15,10,38,44, - 12,50, - 14,0, - 58, - 11, - 15,4,24,58,62, - 17,48, - 22,23,30,58, - 10, - 5,6,55,57,60,65, - 65, - 5,6,55, - 21,7, - 18,44, - 37, - 44, - 12,9,61,44, - 52, - 17,21, - 17, - 58, - 58,52, - 5,6,36,63, - 6, - 11,5,6,36,63,65, - 15, - 25, - 44, - 6,57, - 57, - 6,57, - 57, - 65, - 13, - 51, - 6,57, - 57, - 1, - 1, - 57,52, - 6,55, - 12,13,15,16,18,1,5,24,6,25,9,32,31,35,57,61,43,63,65, - 6,55, - 13,5,6,36,63, - 57, - 14,0,16,18,1,2,3,24,53,54,30,56,31,35,60,43,46,48,52, - 11, - 19,23,24,40,42,45,48, - 55,60, - 14,18,1,30,60,44,46,52, - 21, - 0, - 54, - 44, - 44, - 58, - 12,14,21,22, - 11, - 58,43, - 0, - 5,6,55,60,65, - 5,6,55, - 41, - 12, - 12, - 18, - 19,5,23,24,7,28,10,55,57,38,62,48,65, - 57,60, - 5,65, - 57, - 39, - 57,39, - 57, - 19, - 18, - 42, - 11,12,17,59,46, - 12, - 25,26,49, - 1, - 10, - 58,42, - 12, - 11,15,10,55,60,44,50, - 5,6,55, - 18, - 12, - 56, - 58, - 19, - 9,57,61, - 61, - 0,20,21,7,26,27,10,59, - 9,10,57,61,40,63, - 63, - 4,10,61,40,63, - 57, - 11, - 17,36,42, - 41, - 18,10, - 5,23,6,55,30,57,60,41,63,65, - 12,17,1,21,6,10,36,37,62,42,50, - 13,0,15,16,17,18,1,2,3,21,22,23,24,25,26,28,9,10,53,54,29,56,32,31,34,35,33,36,37,38,39,61,40,42,43,44,45,46,47,48,49,50,52, - 62, - 17, - 14, - 13,0,15,16,17,18,1,2,3,21,22,23,24,25,26,28,9,10,53,54,29,56,32,31,34,35,33,36,37,38,39,61,40,42,43,44,45,46,47,48,49,50,51,52, - 13,0,15,16,17,18,1,2,3,4,22,23,24,25,26,28,9,10,53,54,29,56,32,31,34,35,33,36,37,38,39,61,40,42,43,44,45,46,47,48,49,50,52, - 58, - 29,62, - 15,42, - 0,4,21,58, - 11,17,5,6,30,57,36,63, - 11,13,0,15,19,20,21,22,23,24,7,25,26,28,9,10,29,34,36,58,59,38,39,61,40,41,62,42,44,45,47,48,49,50,51, - 15,19,23,24,7,62,48, - 12, - 46, - 42, - 0, - 12,13,0,15,17,19,4,21,23,24,26,10,30,32,57,33,36,58,59,62,42,44,64,48, - 5,60,65, - 6, - 5,65, - 55,60, - 5,6,55,60,65, - 5,6,55, - 5,6,55,60, - 5,6,55,60,65, - 55,60, - 55,60, - 21, - 6, - 60,42,63, - 63, - 63, - 63, - 63, - 5,6,55,57,60,63,65, - 59,64, - 19,24,25,26,34,58,61,40,45,47,48,49, - 11,12,18,10,57,58,44, - 5,55,60,63,65, - 15,38,44, - 18,52, - 17,23,9,10,58,61,40,62,42,44,50, - 4,10,62, - 14,44, - 59, - 18,5,6,35,42,43,63, - 21,36, - 12,15,1,58, - 1, - 0,44, - 1, - 6, - 6, - 6, - 6, - 14,24,30,60,43,48, - 64, - 15,5,6,55,57,60,38,39,42,63,65, - 55,57,60,63, - 60, - 57,63, - 55, - 55, - 5,6,55,60, - 57,44, - 57, - 58, - 11,17,18,5,6,55,58,60,42,46,65, - 5,6,30, - 21, - 15, - 19,23,24,48, - 62, - 12,58,40,47, - 17,2,58,38,42,44, - 20,62, - 15,24,9,10,58,38,61,40,62,44,45,47,50, - 21, - 13,17,4,42, - 23,55,62, - 0,29,51, - 11,17,4,6,10,41,42,47, - 6, - 5,6,55,60,65, - 9,61, - 58,62, - 21,22, - 5,6,55,57,62, - 29,34,58,40,42,45,47, - 15,8,38,39, - 11,19,20,5,22,23,24,9,10,37,61,44,47,48,51, - 5,55,60,63,65, - 5,55,60,65, - 63, - 63, - 5,55,65, - 1, - 36, - 24, - 12,9,58,61,42, - 12,44, - 57, - 9,61, - 45,63, - 45,63, - 62, - 12,17,21,36,58,59, - 17, - 48, - 11,20,23,6,58, - 14,23,30,60,46, - 44, - 13, - 21, - 12,13,15,1,6,57,33,65, - 58,42, - 11,15,17,23,7,9,10,34,38,61,42,44, - 24,48, - 12,6,57,42,45, - 62, - 5, - 15,62,47, - 34,61,62,63, - 62,50, - 18,19,21,22,24,25,26,28,9,10,31,58,38,39,61,41,43,44,46,48,49,51,52, - 12,42, - 12, - 51, - 44, - 26,63, - 34,40,42,45,47, - 63,47, - 63, - 63,47, - 0,64, - 64, - 12,13,15,16,18,1,6,25,9,32,31,35,57,61,43,46,48,49,65, - 13, - 57, - 21, - 6, - 13,0,15,16,17,18,1,2,3,21,22,23,24,25,26,28,9,10,53,54,29,56,32,31,34,35,33,36,37,38,39,61,40,42,43,44,45,46,47,48,49,50,51,52, - 12,15,18,4,23,24,6,25,10,55,35,57,58,42,46,63,47,49,50,51, - 12,15,17,1,20,21,23,9,10,38,61,62,42,51, - 44, - 12,42, - 62, - 37, - 44, - 55,48,49,50, - 55, - 57,42,48,49,50, - 36, - 29, - 0,17,7,27, - 0,41,44, - 5,6,55,57,60,63,65, - 62, - 12,13,0,17,2,4,21,22,9,34,58,61,62,42,44,64,50, - 14, - 0,15,10, - 42,44, - 12, - 11,14,17,18,1,21,5,10,56,35,36,37,62,43,65, - 15,21, - 6,9,10,57,61,40,45,63,47,52, - 12,58, - 5,6,57,58, - 15,10, - 0,62,51, - 0,15,16,18,19,4,23,24,7,25,26,27,9,10,31,35,38,39,61,62,42,43,44,46,48,49,51,65,52, - 14, - 11,12,13,15,20,23,6,30,33,60,62,51,65, - 6,57, - 58, - 14,24,30,60,48,52, - 12,0,15,21,23,10,58,37,50, - 44, - 58, - 62, - 38, - 2,53, - 9,10,61,62,44,47, - 19,23,24,48, - 11,12,15,16,17,18,19,20,21,22,23,24,7,26,27,28,9,10,29,32,31,35,33,36,58,38,39,61,41,62,42,43,44,46,64,48,50,51,52, - 4, - 13,5,6,10,55,57,36, - 10,59, - 21,7,29, - 17,58,42, - 60, - 17, - 10, - 15,42, - 6, - 12,4,52, - 12,4, - 11,12,14,0,15,16,17,18,19,4,20,21,22,23,26,27,28,29,32,31,34,35,33,58,59,37,38,39,40,62,43,44,45,46,47,51,52, - 12,4, - 58, - - + + + 13,18,5,6,24,7,56,60,63,42,66,68, + 66, + 13, + 16,1,17,18,19,2,20,22,6,25,7,26,27,28,29,10,11,56,30,31,34,35,60,61,63,38,39,64,42,43,44,46,66,48,49,50,68,69,53, + 6,7,56,60,66,68, + 6,7,56,60,63,66, + 66, + 60, + 66, + 60, + 60, + 60, + 60, + 60,66, + 60, + 60, + 60,63,66, + 66, + 60, + 60, + 60,63, + 60, + 60, + 12,13,14,15,18,22,7,10,11,59,36,63,64, + 60,63, + 16,1,17,19,2,20,22,6,25,7,26,27,28,29,10,11,30,31,35,60,61,63,38,39,64,42,43,44,46,66,48,49,50,68,69,53, + 6,7,56,60,63,66,68, + 6,7,60, + 60,66, + 60,66, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 66, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 60, + 66, + 60, + 12,13,14,15,17,19,4,22,6,7,10,11,32,31,59,35,60,61,63,64,42,66,53, + 13,17,19,20,22,6,25,26,27,10,11,56,30,60,61,63,38,39,64,42,43,44,66,48,49,68,53, + 7,56,60,63,66, + 6,7, + 60, + 60, + 60, + 60, + 60, + 60,66, + 60, + 12,13,14,15,0,16,1,19,2,20,22,24,25,7,8,26,27,28,10,11,59,33,63,38,39,64,42,44,48,49,69,52, + 63, + 13, + 60, + 13,17,19,22,6,25,7,27,11,30,60,61,63,42,43,46,66,53, + 60, + 60, + 60, + 60,66, + 60, + 60, + 60, + 5,60,63,66, + 7,60,66, + 60, + 60, + 66, + 13, + 2,6,7,56,60,66,68, + 56,60, + 60, + 60, + 66, + 6,7,56,60,63, + 7,63,66, + 60, + 66, + 66, + 60, + 60, + 56,60,66, + 6,7, + 60, + 60, + 60, + 60, + 66, + 60,66, + 66, + 6,7, + 66, + 60, + 66, + 60, + 60, + 63, + 60, + 24, + 60, + 60, + 16,1,52, + 63, + 63, + 11,60,44, + 63, + 50, + 67, + 18, + 0,65,52, + 15,17,18,19,2,31,35,61,43,44,46,69,53, + 12,61, + 63,66, + 66, + 36, + 16,1,20,24,25,56,60,48,50, + 16,1,20,22,6,24,25,7,29,11,56,60,63,65,48, + 60, + 60, + 6,7,56,60,63,68, + 25,59,60, + 12,13,22,7,36,61,41,65,44, + 60, + 56, + 60, + 60, + 6,7,56,60,63,66,68, + 6,7,56,60,68, + 60, + 27,35,36,38,42,48, + 44, + 36, + 0,51, + 56,63, + 56,60,63, + 56,60,63, + 56, + 56, + 56,63, + 56, + 56, + 56, + 56, + 56, + 56, + 63, + 56, + 63, + 56, + 56, + 18, + 60, + 6,7,60,66, + 6,63,68, + 6,63,68, + 12,13,14,15,0,17,22,6,23,7,11,56,32,59,33,61,37,42,66, + 12,0,1,18,20,23,24,25,30,32,58,34,59,36,61,40,42,44,45,47,48,50,52, + 10,11,60,61,44,52, + 22, + 0,1, + 44, + 60,66, + 3, + 18, + 60,63,66, + 15,5,25,11,59,35,60,63,64,40,43,48,53, + 66, + 60, + 11, + 11, + 56,63, + 60, + 60, + 60, + 60, + 60,36, + 13,1,22,24,27,11,56,61,44, + 14,16,1,17,19,2,20,5,22,24,25,7,8,26,27,29,10,11,31,58,59,35,60,61,37,38,39,64,42,43,44,45,46,48,49,50,69,53, + 22, + 0,16,1,20,22,23,25,26,27,29,10,11,34,61,38,39,64,40,45,47,48,49,50, + 60,63, + 17,18,19,2,22,23,32,31,35,33,36,37,65,43,44,46,69,53, + 19,65, + 15,61, + 12,0,22,23,24, + 60, + 22, + 18, + 56,63, + 7,60,66, + 53, + 12,15,17,7,56,32,59,33,63,44,46,52, + 12,18,6,7,59,66, + 6,7,66,68, + 5,11,64, + 66, + 56, + 56, + 15,19,2,59,63,44, + 18,22,24,7,37,53, + 16,28,38, + 24, + 5, + 12,18,22,59,61, + 0,18,20,22,25,27,48, + 42,52, + 12,18,7,32,59,61,53, + 52, + 10,64,40,45,52,53, + 60,66, + 60,66, + 0, + 15, + 12,17,7,11,59,53, + 13,22,23, + 12,0, + 61, + 65,66, + 18,42, + 3,4,24,54,55,42,50, + 60, + 42, + 19, + 65, + 53, + 53, + 65, + 0, + 6,7, + 3, + 0,52, + 18, + 50, + 42,66, + 15,3,4,54,55,59,63,42,66, + 0,11,44,50, + 60,41, + 13,61, + 61, + 12,24,61,42,44, + 14,16,1,18,20,22,6,23,25,7,26,27,29,10,11,56,30,58,34,61,63,38,39,64,40,41,65,42,44,45,66,47,48,49,50,51,68, + 60, + 6,7, + 66, + 66, + 1,36, + 24, + 0,16,1,21,22,23,24,8,29,62,38,39,65,51, + 7,10,32,60,36,61,64, + 19,23,61,44, + 16,1,17,19,2,20,5,22,23,24,25,8,26,27,29,10,11,30,31,35,61,37,38,39,64,40,65,42,43,44,45,46,47,48,49,50,51,69,52,53, + 13, + 61, + 15,19,2,32,46, + 12,17,31,35, + 38, + 16,22,6,7,27,60,61,66,51, + 24,38,49, + 11,44,52, + 44, + 44, + 60, + 24,61, + 0,18,20,6,27,60,36,37,68, + 15, + 13, + 24,42,52, + 16,65,47, + 12,22,61, + 16,1,17,19,2,20,21,24,25,8,26,27,9,28,10,11,30,31,34,35,61,38,39,64,40,41,65,42,43,45,46,47,48,49,69,53, + 19,25,32,33,48, + 11,60,66, + 60,66, + 65, + 0,16,1,17,19,2,20,5,21,22,23,24,25,8,26,27,28,29,10,11,30,31,35,61,62,37,38,39,64,41,65,42,43,44,46,48,49,50,51,69,52,53, + 0,5, + 13,19,8,42, + 60,42, + 18, + 58, + 58,34, + 15,0,17,19,2,24,31,35,43,46,69,52,53, + 9,31,62,65, + 26,65,49, + 18,42, + 58, + 1, + 59,41, + 12,13,14,15,0,18,2,28,32,33,43, + 6,7, + 0,18,22,6,7,56,60,61,63,42,66,68, + 22,23,7,56,60, + 36, + 12,24, + 20,25,29,38,44,48,50, + 24, + 12,36,42,66, + 19, + 18,25,44, + 13,15,3,4,59,63, + 61, + 19,22, + 13,19,2,42, + 15,1,17,18,19,3,4,21,22,23,24,54,55,56,32,31,35,33,46, + 51, + 18, + 18,21,22,6,23,37, + 18,22,6,23, + 13,14,20,22,23,24,25,30,32,61,44,48, + 8,52, + 44, + 13,42, + 48, + 15,0,17,19,2,3,4,25,54,55,57,31,59,35,63,43,46,48,69,53, + 44, + 18, + 13,16,27,61,52, + 40,65,45,66,47, + 1,53, + 25,44,53, + 13,15,30,60,61,63,65,42,47, + 60, + 13,16, + 42, + 61, + 22, + 13,14,0,16,1,18,5,22,6,23,24,7,29,56,34,59,60,36,61,63,37,40,65,45,66,47,50,53, + 7, + 56,63, + 63, + 63, + 56,63, + 56,63, + 56,60,63, + 63, + 63, + 56,60,63, + 56, + 6,7,56,60,63,68, + 63, + 63, + 56,63, + 6,7,56,60,63,68, + 60,63, + 56,63, + 63, + 63, + 63, + 63, + 63, + 63, + 13,36,61,37,50, + 59,65, + 17,19,2,24,25,56,57,31,35,63,65,43,46,48,69,53, + 0,5,53, + 14, + 20,22,25,37,65,42,48, + 13,18,11, + 18,11, + 18,6,25,7,56,60,66,50, + 56, + 60, + 18, + 13, + 60, + 0,22,11,62,65,67,52, + 13,14,1,18,19,5,22,6,23,24,7,11,60,36,61,42,66,52, + 13,15,18,20,21,24,25,59,37,38,48, + 0,18,32,33, + 12,18,7,59, + 7, + 52, + 19,5, + 8,55,60,38,65, + 60, + 38,49, + 18, + 12,13,22,32,33, + 13,61, + 61, + 34, + 41, + 13,15,59, + 12,0, + 34, + 60, + 25,26,60,46, + 14,16,1,18,20,22,23,25,26,27,29,10,11,30,58,34,61,38,39,64,40,42,44,45,47,48,49,50, + 19, + 1, + 18, + 11,42, + 12,16,24,37,65,42, + 13,2,22,10,64,51, + 13,42,44, + 61,53, + 60,66, + 6,7, + 10,64, + 13,14, + 27, + 15,0,1,17,19,2,3,20,22,23,24,25,7,27,9,28,54,31,35,62,43,44,46,48,51,69,52,53, + 18,5,61,52,53, + 24, + 44, + 18, + 18, + 16, + 61, + 13,22,36,52, + 1, + 52, + 60, + 52, + 52, + 0,52, + 60, + 60, + 19,22,23,25,61,42,48, + 21, + 12,13,14,15,0,16,1,18,19,3,4,21,22,6,24,25,7,26,27,9,11,54,55,56,57,32,31,59,60,36,61,63,65,42,44,66,48,49,68,53, + 66, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 6,8,29,56,34,37, + 48, + 61,42, + 12,13,14,15,0,16,1,17,18,19,2,4,20,21,24,25,7,8,26,27,28,29,10,11,55,56,32,31,58,59,35,60,33,36,61,63,38,39,64,40,65,42,43,44,45,46,66,47,48,50,51,69,53, + 7,56,60,61, + 65, + 23, + 61, + 12,18,7,59,36,65,42,47, + 42, + 24,26,27,30,49, + 13,14, + 13,0,9,65, + 18,32,61,65,42,44, + 18, + 19, + 0, + 15,2,25,48, + 22,32, + 61, + 53, + 22, + 13,2,22,24,61,50, + 18, + 44, + 42,52, + 12,20,24,25,29,61,65,48, + 22, + 18, + 0,6,30,59,52, + 30, + 6, + 52,53, + 18, + 5, + 10,11,60,64, + 10,11,60,66, + 60,66, + 60, + 18,7, + 12,13,14,0,16,18,2,3,21,22,6,23,24,7,9,54,56,32,59,60,36,61,63,65,42,66,51,68,53, + 60, + 60, + 7,60,66, + 63, + 60, + 60, + 60, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 18,25, + 6,7,56,60,63,68, + 60, + 42, + 11, + 44, + 24, + 16,1,20,24,26,27,39,65,42,44,48,49, + 42, + 30,61,65, + 63,39,42, + 20,24,25,65,48, + 24,65, + 18, + 30,61,42, + 66, + 6,7,56,60,63,68, + 18, + 1,18,22,56,60,36,61,42, + 52, + 60, + 13,6,7,44,66, + 61, + 22,23, + 12,13,14,16,1,2,20,22,23,24,25,26,27,28,29,10,11,34,61,38,39,64,40,42,44,45,47,48,49,50,51, + 52, + 1,26,29,61,42, + 0,30,59,52, + 18,19,2, + 13,19,53, + 60, + 52, + 13,15,54,55,59,63,42,44,66, + 13, + 52, + 22,30,58,34,42,52, + 18, + 23, + 52, + 12,13,15,18,22,59,36,61, + 10,61,64, + 13,7,59,60, + 13,15,7, + 12,13,14,18,22,23,24,32,59,33,61,37,40,44,45,47,51, + 23,24,56,60,44, + 6,7,56,60,63,66,68, + 0,5,22,7,11,61,51, + 60, + 63, + 56,63, + 60, + 6, + 56, + 6,7, + 6,7, + 60,66, + 60,63,66, + 6,7, + 6,7, + 60, + 7, + 65,51, + 18,32,42, + 52, + 60, + 44, + 61, + 52, + 0, + 18,52, + 19,2, + 24, + 20,21,24,25,8,29,11,56,34,59,60,63,65,44,47,48,50,51, + 50, + 50, + 50, + 50, + 50, + 60, + 60, + 66, + 60, + 53, + 19,53, + 5, + 19,32,36,61, + 60, + 53, + 11, + 15, + 61, + 61, + 6,7, + 7, + 7, + 11, + 14,6,7, + 22, + 6,7, + 13,14,16,2,7,60,33,68, + 60, + 0,52, + 13, + 3,4,20,24,25,54,55,48, + 19, + 55, + 61, + 11,37, + 23, + 6,63,68, + 6,63,68, + 6,68, + 6,68, + 6,7, + 6,7,56, + 12,0,18,22,23,7,56,32,59,36,37, + 12,18,22,6,7,56,32,33,36,37,66,68, + 6,7, + 19,22,25,56,60,61,63,42,48, + 29,38,41, + 0,18,20,24,25,26,27,28,10,11,64,42,44,48,49, + 7, + 60,66, + 7, + 7,60,66, + 6,7,56,63,68, + 66, + 11, + 6,68, + 56, + 6,63,66,68, + 13,16,5,22,6,23,7,10,11,56,32,60,36,61,37,38,64,65,42,44,48,52, + 60, + 0,11,52, + 13, + 6,7,56,30,59,60,63,66,68, + 30, + 6,7,63, + 13,51, + 6,7,66, + 24,61, + 61, + 53, + 0,51,68, + 13,0,29,51,68, + 6,7,63, + 60, + 11,65,45,50, + 6,7,56, + 1,18, + 19, + 65,42, + 36,61, + 8, + 24, + 42, + 13, + 42, + 61, + 61,50, + 56, + 56,61,50, + 12,24,36, + 59, + 13,26,60, + 60, + 26,60, + 67, + 60, + 61, + 61, + 52, + 7,60,66, + 16,1,20,21,25,26,27,29,10,11,30,34,61,39,64,40,42,44,45,47,48,49,50, + 11,44, + 44, + 43, + 0,52, + 0,52, + 1,61,38, + 18,19, + 11,44,45, + 61, + 25, + 61, + 60, + 53, + 52, + 44, + 1,18,36,42, + 60, + 10,61,64, + 6,7,56,60,63,68, + 51, + 61,44, + 22,8, + 0,11,61,52, + 63, + 56,63, + 12,15,18,19,6,7,57,32,31,59,63,42,66,52,53, + 7,60,66, + 65,42,44, + 11, + 12,16, + 7, + 24,65, + 6,7,56,60,63,68, + 16,2,28,42, + 61,42,44, + 13,1,18,10,36,61,64,43, + 42, + 0,16,20,24,25,8,11,65,48, + 18, + 52, + 61,65, + 60, + 6,23,7,59,36,66, + 7, + 61,42, + 18,27,30,44, + 25,44,52, + 19, + 28,61,65, + 13,18, + 61, + 20,25,8,11,36,61,65,48,50, + 7,60,66, + 6,7,56,63,66,68, + 60, + 60,66, + 6,7,63,66, + 7,60, + 6,7, + 7,60,66, + 6,7, + 60, + 60, + 6,7, + 7, + 7,60,66, + 6,7,60,66, + 7,60,66, + 12,16, + 24,61, + 32,60,61, + 52, + 11, + 60,66, + 12,7,32,59,33,44, + 60, + 6,7,60,63,68, + 6, + 7, + 6,7, + 6, + 7, + 18,7,32,33,43,44,51, + 13, + 13, + 53, + 25,48, + 6,7,63,68, + 6,7, + 16,1,18,20,5,21,22,23,24,25,8,26,27,28,29,10,11,30,34,36,61,38,39,64,40,41,65,42,44,45,47,48,49,50,51, + 58,34,42,66, + 66, + 66, + 12,13,14,15,0,16,1,17,18,19,2,3,4,20,5,21,22,6,23,24,25,7,8,26,27,28,29,10,11,54,55,56,30,32,31,58,34,59,35,60,33,36,61,62,63,37,38,39,64,40,41,65,42,43,44,45,46,66,47,48,49,50,51,68,69,52,53, + 22,60, + 60, + 63, + 63, + 6,7, + 60, + 6, + 60,44, + 1,36, + 15,18,25,59,35,63,42,48, + 66, + 66, + 0,18,62, + 13,59, + 13,16,1,20,25,26,27,29,10,11,34,59,61,38,39,64,40,42,44,45,47,48,49, + 20,25,29,60,48, + 13,14,1,18,24,59,60,41,52, + 0,24,52, + 27,60, + 60, + 15,3,4,59,63, + 63, + 22,11,61,65,42, + 63, + 63, + 63, + 6,60,63,68, + 6,7,63, + 61,42, + 22,6,23,24,29,56,30,65,50,68,52, + 56,63, + 60, + 60, + 66,68, + 68, + 68, + 60,66,68, + 68, + 68, + 68, + 68, + 66,68, + 68, + 66,68, + 66,68, + 22, + 16, + 18, + 26,49, + 14, + 7, + 7, + 7, + 0,5,22,23,24,27,61,37,65,50, + 18,61, + 13,0,16,1,17,18,19,20,21,24,27,28,10,32,34,59,60,61,62,63,38,39,64,65,42,43,44,46,66,51,68,53, + 61,44, + 60, + 60, + 22, + 45,53, + 19, + 16,19,22,24,8, + 24, + 13, + 5,22,11,60, + 12,13,1,18,6,24,7,10,32,59,61,64,42,44,66,51,68,52, + 0,1,28, + 6,7,56,60,63,66,68, + 6, + 7, + 25, + 12, + 42, + 12,14,0,16,1,18,5,21,22,23,24,25,7,8,29,30,32,60,33,61,62,37,38,39,40,47,48,51,69,52, + 6,7,63, + 24, + 11, + 16, + 52, + 16,1,20,5,25,8,26,27,29,10,11,30,60,38,39,64,42,44,48,49,50, + 13,1,18,22,23,25,8,26,10,54,55,58,36,61,63,37,38,64,65,42,44,45,47,48,50,68, + 48, + 36,61, + 19, + 67, + 12, + 14,16,17,18,19,2,3,4,20,23,24,25,8,26,27,29,10,11,54,55,30,57,32,31,58,34,59,35,33,36,61,37,38,39,64,40,42,43,44,45,46,47,48,49,50,69,53, + 12,5,6,25,7,32,36,42,43,66, + 13,0,18,45,47, + 22,11, + 13,20,61, + 1,36, + 52, + 20,5,25,60,48, + 53, + 48, + 22,32, + 22, + 52, + 55, + 61, + 13, + 24,29, + 18, + 52, + 13,18,2,65,42, + 12,0,5,11,40,42,52, + 13,61, + 23, + 42,44,52, + 60, + 13, + 60, + 11,60,65,66, + 60,61, + 61, + 2, + 59,39,42,45,50, + 19, + 60,66, + 3,24,11,54,55,58, + 42,52, + 5,63,45,53, + 53, + 24,41, + 8, + 18, + 10,64, + 0,52, + 13,1,18,7,11,60,36,61,64,40,42,45,66,47,52,53, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 6,7, + 60,66, + 16,60,68, + 60, + 16,60, + 16,60,68, + 8,28, + 13,61,52, + 36, + 65, + 12,2,24,61, + 52, + 65, + 16, + 12,32,59,62, + 65, + 24, + 16,1,11,38,52, + 13,0,50, + 15,0,52, + 61, + 12, + 16,5,25,61,65, + 18,48, + 23,24,59,61, + 11, + 6,7,56,60,63,66,68, + 68, + 52, + 6,7,56, + 22,8, + 44, + 37, + 44, + 13,10,64,44, + 53, + 22, + 18, + 61, + 61,53, + 18, + 6,7,36,66, + 12,6,7,36,66,68, + 52, + 0,16,25, + 26, + 44, + 7,60,66, + 60,66, + 7,60,66, + 60,66, + 68, + 14, + 51, + 7,60,66, + 60,66, + 2, + 19,2, + 60,53, + 7,56, + 12,13,14,16,17,19,2,6,25,7,26,10,32,31,59,35,60,64,43,66,68, + 7,56, + 14,6,7,32,36,66, + 12,1,36, + 60, + 15,0,17,18,19,2,3,4,25,54,55,57,31,59,35,63,43,46,48,69,53, + 12, + 60, + 20,24,25,40,42,45,48, + 19,60, + 18,24,56,60,63, + 15,19,2,59,63,44,46,53, + 22, + 0, + 55, + 0,52, + 44, + 44, + 61, + 13,15,22,23, + 12, + 61,43,69, + 0, + 19, + 6,7,56,63,68, + 6,7,56, + 41, + 13, + 13, + 52, + 20,6,24,25,8,29,11,56,60,38,65,48,68, + 59, + 60,63, + 6,68, + 60, + 39, + 60,39, + 60, + 20,60, + 42, + 12,13,18,2,62,46,52, + 13, + 26,27,49, + 52, + 52, + 11, + 1, + 61,42, + 52, + 13, + 12,16,11,56,63,44,50, + 6,7,56, + 13, + 57,60, + 19, + 1,61, + 20, + 10,60,64, + 64, + 0,21,8,27,28,11,62, + 10,11,60,64,40,66,52, + 66, + 5,11,64,40,66,52, + 60, + 12, + 60, + 18,36,42, + 41, + 11, + 6,24,7,56,59,60,63,41,66,68, + 13,0,18,19,2,22,23,7,11,36,37,65,42,50, + 14,16,17,18,19,2,3,4,20,22,23,24,25,26,27,29,10,11,54,55,30,57,32,31,58,34,35,33,36,61,37,38,39,64,40,42,43,44,45,46,47,48,49,50,69,53, + 65, + 18,52, + 15, + 52, + 14,16,17,18,19,2,3,4,20,22,23,24,25,26,27,29,10,11,54,55,30,57,32,31,58,34,35,33,36,61,37,38,39,64,40,42,43,44,45,46,47,48,49,50,51,69,53, + 14,16,17,18,19,2,3,4,20,5,23,24,25,26,27,29,10,11,54,55,30,57,32,31,58,34,35,33,36,61,37,38,39,64,40,42,43,44,45,46,47,48,49,50,69,52,53, + 61, + 30,65, + 16,60,42, + 0,5,22,61, + 12,18,6,7,32,59,60,66, + 12,14,0,16,1,18,20,21,22,23,24,25,8,26,27,29,10,11,30,34,36,61,62,38,39,64,40,41,65,42,44,45,47,48,49,50,51,52, + 58, + 16,1,20,24,25,8,65,48, + 13, + 46, + 42, + 13,14,16,18,20,5,22,24,7,27,11,32,59,60,33,61,62,65,42,44,67,48, + 6,60,63,68, + 7, + 6,68, + 56,63, + 6,7,63,68, + 6,7, + 63, + 6,7,63, + 6,7,56,60,63,68, + 56,63, + 56,63, + 22, + 7, + 63,42,66, + 66, + 66, + 66, + 66, + 6,7,56,60,63,66,68, + 0,62,67, + 20,26,27,34,61,64,40,45,47,48,49, + 12,13,11,61,44, + 60, + 6,7,56,60,63,66,68, + 16,1,25,38,44, + 53, + 18,24,10,11,61,64,40,65,42,44,50, + 18,5,11,65,52, + 15,44, + 62, + 6,7,35,42,43,66, + 22,36, + 13,16,61, + 19,2, + 60, + 0,44, + 19,2, + 7, + 7, + 7, + 7, + 15,25,59,63,43,48, + 67, + 52, + 6,7,56,60,63,42,66,68, + 56,60,63,66, + 63, + 60,66, + 56, + 56, + 6,7,63, + 60,44, + 60, + 61, + 12,18,19,6,7,56,60,61,63,42,46,68, + 6,7,59, + 16, + 20,24,25,48, + 65, + 13,61,40,47, + 18,3,61,38,42,44, + 21,65, + 16,1,25,10,11,61,38,64,40,65,44,45,47,50, + 18,19,22, + 14,18,2,5,42, + 60, + 24,56,65, + 0,30,51, + 12,18,5,7,11,59,41,42,47, + 7, + 60, + 6,7,56,60,63,68, + 10,64, + 61,65, + 1,7,36, + 52, + 52, + 22,23, + 6,7,56,65, + 52, + 30,34,60,61,40,42,45,47, + 16,9,38,39, + 12,20,21,6,23,24,25,10,11,37,64,44,47,48,51, + 6,7,56,60,63,66,68, + 6,56,63,68, + 66, + 66, + 6,56,68, + 7,56, + 2, + 36, + 25, + 13,19,2,10,61,64,42, + 13,44, + 60, + 10,64, + 1, + 45,66, + 45,66, + 65, + 13,18,2,22,36,61,62,52, + 1,18, + 19,48, + 12,21,24,7,61, + 15,24,59,63,46, + 44, + 7, + 14, + 22, + 13,14,16,2,7,60,33,68, + 61,42, + 12,16,1,18,2,24,8,9,10,11,34,38,64,42,44,52, + 25,48, + 13,1,19,7,60,36,42,45, + 65, + 52, + 0, + 6, + 32, + 16,65,47, + 34,64,65,66, + 65,50, + 19,2,20,22,23,25,26,27,29,10,11,31,61,38,39,64,41,43,44,46,48,49,51,69,52,53, + 60, + 13,42, + 13, + 51, + 44, + 27,66, + 34,40,42,45,47, + 66,47, + 66, + 66,47, + 0,67, + 67, + 66, + 7,60,66, + 7, + 13,14,16,1,17,19,7,26,10,32,31,58,35,60,64,43,46,66,48,49,68,52, + 60, + 14,32, + 7, + 52, + 60, + 22, + 7, + 14,16,17,18,19,2,3,4,20,22,23,24,25,26,27,29,10,11,54,55,30,57,32,31,58,34,35,33,36,61,37,38,39,64,40,42,43,44,45,46,47,48,49,50,51,69,53, + 13,16,5,24,25,7,26,11,56,35,60,61,42,46,66,47,49,50,51, + 13,16,18,19,2,21,22,24,10,11,38,64,65,42,51, + 44, + 13,42, + 65, + 37, + 44, + 56,48,49,50, + 56, + 60,42,48,49,50, + 36, + 30, + 18,8,28, + 0,41,44, + 6,7,56,60,63,66,68, + 65, + 13,14,18,3,5,22,23,24,10,32,34,61,64,65,42,44,67,50,52, + 15, + 0,16,24,11, + 42,44, + 13, + 12,15,18,19,2,22,6,11,57,35,36,37,65,43,68, + 19, + 0, + 16, + 7,10,11,60,64,40,45,66,47,53, + 13,61, + 6,7,61, + 16,11, + 65,51,52, + 0,16,1,17,19,2,20,5,24,25,8,26,27,28,10,11,31,35,38,39,64,65,42,43,44,46,48,49,51,68,69,52,53, + 52, + 15, + 52, + 2, + 12,13,14,15,16,2,21,24,7,9,59,60,33,63,65,66,51,68,69, + 0,52, + 7,60,66, + 61, + 15,25,59,63,48,53, + 13,16,22,23,24,11,61,37,50, + 44, + 61, + 65, + 38, + 54, + 2,10,11,60,64,65,44,47, + 20,24,25,36,48, + 12,13,0,16,1,17,18,19,2,20,21,22,23,24,25,8,27,28,29,10,11,30,32,31,58,35,60,33,36,61,38,39,64,41,65,42,43,44,46,67,48,50,51,69,53, + 5, + 14,6,7,11,32,60,66, + 60, + 0,11,62, + 22,8,30,52, + 18,61,42, + 1,63, + 18, + 1,11, + 19, + 16,42, + 7, + 13,5,53, + 60, + 13,5, + 60, + 12,13,15,0,16,1,17,18,19,2,20,5,21,22,23,24,27,28,29,30,32,31,34,35,33,61,62,37,38,39,40,65,43,44,45,46,47,51,69,53, + 13,5, + 60, + 61, + 52, + + diff --git a/doc/salome/gui/SMESH/whxdata/whgdata0.xml b/doc/salome/gui/SMESH/whxdata/whgdata0.xml index 0075ff8d5..b0993a043 100755 --- a/doc/salome/gui/SMESH/whxdata/whgdata0.xml +++ b/doc/salome/gui/SMESH/whxdata/whgdata0.xml @@ -1,22 +1,22 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whxdata/whglo.xml b/doc/salome/gui/SMESH/whxdata/whglo.xml index 0f1cd68e5..ac67056d3 100755 --- a/doc/salome/gui/SMESH/whxdata/whglo.xml +++ b/doc/salome/gui/SMESH/whxdata/whglo.xml @@ -1,5 +1,5 @@ - - - - + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whxdata/whidx.xml b/doc/salome/gui/SMESH/whxdata/whidx.xml index ac66bb966..44f05e5be 100755 --- a/doc/salome/gui/SMESH/whxdata/whidx.xml +++ b/doc/salome/gui/SMESH/whxdata/whidx.xml @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/doc/salome/gui/SMESH/whxdata/whtdata0.xml b/doc/salome/gui/SMESH/whxdata/whtdata0.xml index f4771caad..26bf3274f 100755 --- a/doc/salome/gui/SMESH/whxdata/whtdata0.xml +++ b/doc/salome/gui/SMESH/whxdata/whtdata0.xml @@ -1,88 +1,93 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whxdata/whtoc.xml b/doc/salome/gui/SMESH/whxdata/whtoc.xml index a271ba7cc..871ec25b9 100755 --- a/doc/salome/gui/SMESH/whxdata/whtoc.xml +++ b/doc/salome/gui/SMESH/whxdata/whtoc.xml @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/doc/salome/tui/Makefile.in b/doc/salome/tui/Makefile.in index 894cc0c6d..ba71fe6fb 100644 --- a/doc/salome/tui/Makefile.in +++ b/doc/salome/tui/Makefile.in @@ -1,6 +1,21 @@ -# Copyright (C) 2003 CEA/DEN, EDF R&D +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. # +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# 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 : Vasily Rusyaev (Open Cascade NN) @@ -19,25 +34,45 @@ doxygen=@DOXYGEN@ PYTHON_SCRIPTS = \ smesh.py -docs: +dev_docs: cp -fr $(srcdir)/SMESH ./INPUT; \ + cp -fr ./SMESH/doxyfile ./SMESH/doxyfile_py ./INPUT; \ + cp -fr ./SMESH/sources/static/tree.js ./INPUT/sources/static; \ cd INPUT; \ sed 's|../../../share/salome|$(root_srcdir)|' ./doxyfile > ./doxyfile1; \ - mv -f doxyfile1 doxyfile; \ - $(doxygen) ./doxyfile; \ - mkdir py1; mkdir py2; \ - cd .. - for file in $(PYTHON_SCRIPTS) dummy; do \ - if [ $$file != "dummy" ]; then \ - cp $(root_srcdir)/src/SMESH_SWIG/$$file INPUT/py1/; \ - fi ; \ - done - cd INPUT; \ - python $(KERNEL_ROOT_DIR)/doc/salome/tui/KERNEL/pythfilter.py ./py1 ./py2; \ - sed 's|list_py_files_to_process|$(PYTHON_SCRIPTS)|' ./doxyfile_py > py2/doxyfile_py; \ - cd py2; \ - $(doxygen) ./doxyfile_py; \ - cd ../..; \ + sed 's|../../build/salome|$(top_builddir)|' ./doxyfile1 > ./doxyfile2; \ + mv -f doxyfile2 doxyfile1; \ + if (test "x@DOXYGEN_WITH_PYTHON@" = "xyes"); then \ + echo "DOXYGEN SUPPORT PYTHON - @DOXYGEN_WITH_PYTHON@"; \ + sed 's|python_extension_must_be_here|*.py|' ./doxyfile1 > ./doxyfile2; \ + mv -f doxyfile2 doxyfile1; \ + $(doxygen) -u ./doxyfile1; \ + if( test "x@DOXYGEN_WITH_STL@" = "xyes"); then \ + sed -e 's|BUILTIN_STL_SUPPORT = NO|BUILTIN_STL_SUPPORT = YES|' ./doxyfile1 > ./doxyfile2; \ + mv -f doxyfile2 doxyfile1; \ + fi; \ + mv -f doxyfile1 doxyfile; \ + $(doxygen) ./doxyfile; \ + cd ..; \ + else \ + sed 's|python_extension_must_be_here||' ./doxyfile1 > ./doxyfile2; \ + mv -f doxyfile2 doxyfile1; \ + mv -f doxyfile1 doxyfile; \ + $(doxygen) ./doxyfile; \ + mkdir py1; mkdir py2; \ + cd ..; \ + for file in $(PYTHON_SCRIPTS) dummy; do \ + if [ $$file != "dummy" ]; then \ + cp $(root_srcdir)/src/GEOM_SWIG/$$file INPUT/py1/; \ + fi ; \ + done; \ + cd INPUT; \ + python $(KERNEL_ROOT_DIR)/doc/salome/tui/KERNEL/pythfilter.py ./py1 ./py2; \ + sed 's|list_py_files_to_process|$(PYTHON_SCRIPTS)|' ./doxyfile_py > py2/doxyfile_py; \ + cd py2; \ + $(doxygen) ./doxyfile_py; \ + cd ../..; \ + fi; \ cp -fr $(srcdir)/SMESH/sources/static/*.* ./SMESH/ cp -fr $(srcdir)/SMESH/sources/ SMESH/ cp -fr $(srcdir)/SMESH/HTML/ SMESH/ diff --git a/doc/salome/tui/SMESH/doxyfile b/doc/salome/tui/SMESH/doxyfile deleted file mode 100755 index d663d3850..000000000 --- a/doc/salome/tui/SMESH/doxyfile +++ /dev/null @@ -1,203 +0,0 @@ -# Doxyfile 1.3-rc1 - -#--------------------------------------------------------------------------- -# General configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = "SALOME - SMESH - v.3.2.0a1" -PROJECT_NUMBER = id#1.1 -OUTPUT_DIRECTORY = ../ -OUTPUT_LANGUAGE = English -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = NO -ALWAYS_DETAILED_SEC = YES -INLINE_INHERITED_MEMB = YES -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -INTERNAL_DOCS = YES -CASE_SENSE_NAMES = YES -SHORT_NAMES = NO -HIDE_SCOPE_NAMES = NO -VERBATIM_HEADERS = YES -SHOW_INCLUDE_FILES = YES -JAVADOC_AUTOBRIEF = YES -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = NO -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 5 -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ALIASES = -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 25 -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = YES -SHOW_USED_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = log.txt -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = ../../../share/salome/idl/SMESH_Gen.idl \ - ../../../share/salome/idl/SMESH_Mesh.idl \ - ../../../share/salome/idl/SMESH_BasicHypothesis.idl \ - ../../../share/salome/idl/SMESH_Hypothesis.idl -FILE_PATTERNS = -RECURSIVE = NO -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = sources/ -INPUT_FILTER = -FILTER_SOURCE_FILES = YES -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = SMESH -HTML_FILE_EXTENSION = .html -HTML_HEADER = sources/myheader.html -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = YES -TOC_EXPAND = YES -DISABLE_INDEX = YES -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_SCHEMA = -XML_DTD = -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = NO -#--------------------------------------------------------------------------- -# Configuration::addtions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = NO -HAVE_DOT = YES -CLASS_GRAPH = YES -COLLABORATION_GRAPH = NO -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DOT_IMAGE_FORMAT = jpg -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1200 -GENERATE_LEGEND = NO -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO -CGI_NAME = search.cgi -CGI_URL = -DOC_URL = -DOC_ABSPATH = -BIN_ABSPATH = /usr/local/bin/ -EXT_DOC_PATHS = diff --git a/doc/salome/tui/SMESH/doxyfile_py b/doc/salome/tui/SMESH/doxyfile_py deleted file mode 100755 index 3b4a048cb..000000000 --- a/doc/salome/tui/SMESH/doxyfile_py +++ /dev/null @@ -1,200 +0,0 @@ -# Doxyfile 1.3-rc1 - -#--------------------------------------------------------------------------- -# General configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = "SALOME - SMESH - v.3.2.0a1" -PROJECT_NUMBER = id#1.1 -OUTPUT_DIRECTORY = ../ -OUTPUT_LANGUAGE = English -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = NO -ALWAYS_DETAILED_SEC = YES -INLINE_INHERITED_MEMB = YES -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -INTERNAL_DOCS = YES -CASE_SENSE_NAMES = YES -SHORT_NAMES = NO -HIDE_SCOPE_NAMES = NO -VERBATIM_HEADERS = YES -SHOW_INCLUDE_FILES = YES -JAVADOC_AUTOBRIEF = YES -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = NO -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 5 -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ALIASES = -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 25 -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = YES -SHOW_USED_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = log.txt -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = list_py_files_to_process -FILE_PATTERNS = -RECURSIVE = NO -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = ../sources/ -INPUT_FILTER = -FILTER_SOURCE_FILES = YES -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = ../SMESH/meshpy_doc -HTML_FILE_EXTENSION = .html -HTML_HEADER = ../sources/myheader_py2.html -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = YES -TOC_EXPAND = YES -DISABLE_INDEX = YES -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_SCHEMA = -XML_DTD = -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = NO -#--------------------------------------------------------------------------- -# Configuration::addtions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = NO -HAVE_DOT = YES -CLASS_GRAPH = YES -COLLABORATION_GRAPH = NO -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DOT_IMAGE_FORMAT = jpg -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1200 -GENERATE_LEGEND = NO -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO -CGI_NAME = search.cgi -CGI_URL = -DOC_URL = -DOC_ABSPATH = -BIN_ABSPATH = /usr/local/bin/ -EXT_DOC_PATHS = diff --git a/doc/salome/tui/SMESH/sources/Application-About.png b/doc/salome/tui/SMESH/sources/Application-About.png index 7b58330d5..df0d5a187 100755 Binary files a/doc/salome/tui/SMESH/sources/Application-About.png and b/doc/salome/tui/SMESH/sources/Application-About.png differ diff --git a/doc/salome/tui/SMESH/sources/bg_salome.gif b/doc/salome/tui/SMESH/sources/bg_salome.gif index 677b70468..429489c69 100755 Binary files a/doc/salome/tui/SMESH/sources/bg_salome.gif and b/doc/salome/tui/SMESH/sources/bg_salome.gif differ diff --git a/doc/salome/tui/SMESH/sources/myheader.html b/doc/salome/tui/SMESH/sources/myheader.html index 83ca543cd..d2efb75fa 100755 --- a/doc/salome/tui/SMESH/sources/myheader.html +++ b/doc/salome/tui/SMESH/sources/myheader.html @@ -5,20 +5,9 @@ Main Page +   -
- - - - - - -
-
-
- - diff --git a/doc/salome/tui/SMESH/sources/static/doxygen.css b/doc/salome/tui/SMESH/sources/static/doxygen.css index 0a8e93d50..389449d87 100755 --- a/doc/salome/tui/SMESH/sources/static/doxygen.css +++ b/doc/salome/tui/SMESH/sources/static/doxygen.css @@ -1,21 +1,129 @@ -H1 { text-align: center; } -CAPTION { font-weight: bold } +H1 { + text-align: center; +} + +CAPTION { + font-weight: bold +} + +/* Link in the top navbar */ A.qindex {} + A.qindexRef {} -A.el { text-decoration: none; font-weight: bold } -A.elRef { font-weight: bold } -A.code { text-decoration: none; font-weight: normal; color: #4444ee } -A.codeRef { font-weight: normal; color: #4444ee } -A:hover { text-decoration: none; background-color: lightblue } -DL.el { margin-left: -1cm } -DIV.fragment { width: 100%; border: none; background-color: #CCCCCC } -DIV.ah { background-color: #CCCCCC; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } -TD.md { background-color: lightblue; font-weight: bold; } -TD.mdname1 { background-color: lightblue; font-weight: bold; color: #602020; } -TD.mdname { background-color: lightblue; font-weight: bold; color: #602020; width: 600px; } -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: url(sources/bg_salome.gif) } + +/* Link to any cross-referenced Doxygen element */ +A.el { + text-decoration: none; + font-weight: bold +} + +A.elRef { + font-weight: bold +} + +/* Link to any cross-referenced Doxygen element inside a code section + (ex: header) +*/ +A.code { + text-decoration: none; + font-weight: normal; + color: #4444ee +} + +A.codeRef { + font-weight: normal; + color: #4444ee +} + +A:hover { + text-decoration: none; + background-color: lightblue +} + +DL.el { + margin-left: -1cm +} + +/* A code fragment (ex: header) */ +DIV.fragment { + width: 100%; + border: none; + background-color: #CCCCCC +} + +/* 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 +} + +/* Method name (+ type) */ +TD.md { + background-color: lightblue; + font-weight: bold; +} + +/* 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.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; @@ -28,6 +136,8 @@ TD.indexkey { 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; @@ -40,6 +150,7 @@ TD.indexvalue { margin-top : 2px; margin-bottom : 2px } + span.keyword { color: #008000 } span.keywordtype { color: #604020 } span.keywordflow { color: #e08000 } diff --git a/doc/salome/tui/SMESH/sources/static/tree.js b/doc/salome/tui/SMESH/sources/static/tree.js deleted file mode 100755 index f55fe0b98..000000000 --- a/doc/salome/tui/SMESH/sources/static/tree.js +++ /dev/null @@ -1,29 +0,0 @@ -foldersTree = gFld("SALOME v.3.2.0a1 ", "", "") - insDoc(foldersTree, gLnk("Main Page", "", "main.html")) - -aux1 = insFld(foldersTree, gFld("TUI Reference Guide", "")) - aux2 = insFld(aux1, gFld("Modules", "")) - aux3 = insFld(aux2, gFld("SALOME SMESH module", "")) -/*! insDoc(aux3, gLnk("Overview", "", "overview_SMESH.html"))*/ - aux4 = insFld(aux3, gFld("Packages", "")) - insDoc(aux4, gLnk("SMESH", "", "namespaceSMESH.html")) -/*! insDoc(aux3, gLnk("Examples", "", "examples_SMESH.html")) -*/ - - insDoc(aux1, gLnk("Data Structures", "", "annotated.html")) - insDoc(aux1, gLnk("Class Hierarchy", "", "hierarchy.html")) - insDoc(aux1, gLnk("Class methods list", "", "functions.html")) - insDoc(aux1, gLnk("Namespace Members", "", "namespacemembers.html")) - insDoc(aux1, gLnk("File List", "", "files.html")) - -aux1 = insFld(foldersTree, gFld("IDL/Python mapping", "")) - insDoc(aux1, gLnk("Mapping of SMESH IDL definitions to Python language", "", "page2.html")) - -aux1 = insFld(foldersTree, gFld("Python Commands", "", "meshpy_doc/main.html")) - insDoc(aux1, gLnk("Package List", "", "meshpy_doc/namespaces.html")) - insDoc(aux1, gLnk("Data Structures", "", "meshpy_doc/annotated.html")) - insDoc(aux1, gLnk("Namespace Members", "", "meshpy_doc/namespacemembers.html")) - insDoc(aux1, gLnk("File List", "", "meshpy_doc/files.html")) - -aux1 = insFld(foldersTree, gFld("Adding meshers in SMESH", "")) - insDoc(aux1, gLnk("Using Plugin mechanism in SMESH", "", "PluginMeshers.html")) diff --git a/idl/Makefile.in b/idl/Makefile.in index 8bc4e84d3..65dc0f799 100644 --- a/idl/Makefile.in +++ b/idl/Makefile.in @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # # generate dependencies for idl file : # @@ -34,7 +53,7 @@ $(IDL_FILES:%=$(top_builddir)/idl/salome/%):$(IDL_FILES:%=$(top_srcdir)/idl/%) lib: pyidl -PYTHON_BUILD_SITE=$(top_builddir)/lib/python$(PYTHON_VERSION)/site-packages/@PACKAGE@ +PYTHON_BUILD_SITE=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/@PACKAGE@ pyidl: $(PYTHON_BUILD_SITE) $(IDL_FILES:%.idl=$(PYTHON_BUILD_SITE)/%_idl.py) diff --git a/idl/SMESH_BasicHypothesis.idl b/idl/SMESH_BasicHypothesis.idl index b6367b75d..2479147db 100644 --- a/idl/SMESH_BasicHypothesis.idl +++ b/idl/SMESH_BasicHypothesis.idl @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -286,6 +286,20 @@ module StdMeshers { }; + /*! + * StdMeshers_QuadraticMesh: interface of "QuadraticMesh" hypothesis. + * This is an auxiliary 1D hypothesis whose presence forces construction + * of quadratic edges. + * If the 2D mesher sees that all boundary edges are quadratic ones, + * it generates quadratic faces, else it generates linear faces using + * medium nodes as if they were vertex ones. + * The 3D mesher generates quadratic volumes only if all boundary faces + * are quadratic ones, else it fails. + */ + interface StdMeshers_QuadraticMesh : SMESH::SMESH_Hypothesis + { + }; + /*! * StdMeshers_Regular_1D: interface of "Wire discretisation" algorithm diff --git a/idl/SMESH_Filter.idl b/idl/SMESH_Filter.idl index edf3b7477..b32b3d22f 100644 --- a/idl/SMESH_Filter.idl +++ b/idl/SMESH_Filter.idl @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -27,6 +27,7 @@ #include "SALOME_Exception.idl" #include "SALOME_GenericObj.idl" +#include "GEOM_Gen.idl" #include "SMESH_Mesh.idl" #include "GEOM_Gen.idl" diff --git a/idl/SMESH_Gen.idl b/idl/SMESH_Gen.idl index bc6edfb72..2f608b954 100644 --- a/idl/SMESH_Gen.idl +++ b/idl/SMESH_Gen.idl @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -59,6 +59,16 @@ module SMESH SMESH_Pattern GetPattern(); + /*! + Set the current mode + */ + void SetEmbeddedMode( in boolean theMode ); + + /*! + Get the current mode + */ + boolean IsEmbeddedMode(); + /*! Set the current study */ @@ -103,6 +113,12 @@ module SMESH SMESH_Mesh CreateMesh( in GEOM::GEOM_Object theObject ) raises ( SALOME::SALOME_Exception ); + /*! + * Create a empty mesh object + */ + SMESH_Mesh CreateEmptyMesh() + raises ( SALOME::SALOME_Exception ); + /*! * Create Mesh object importing data from given UNV file */ diff --git a/idl/SMESH_Group.idl b/idl/SMESH_Group.idl index 37657674b..2ef815f1b 100644 --- a/idl/SMESH_Group.idl +++ b/idl/SMESH_Group.idl @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -84,6 +84,16 @@ module SMESH * Returns the mesh object this group belongs to */ SMESH_Mesh GetMesh(); + + /*! + * Sets group color number + */ + void SetColorNumber( in long color ); + + /*! + * Returns group color number + */ + long GetColorNumber(); }; /*! diff --git a/idl/SMESH_Hypothesis.idl b/idl/SMESH_Hypothesis.idl index 69832b9ed..b4fdd1c81 100644 --- a/idl/SMESH_Hypothesis.idl +++ b/idl/SMESH_Hypothesis.idl @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl index 8e1321197..5134fe24b 100644 --- a/idl/SMESH_Mesh.idl +++ b/idl/SMESH_Mesh.idl @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -28,15 +28,15 @@ #include "SALOME_Exception.idl" #include "SALOME_GenericObj.idl" - #include "GEOM_Gen.idl" #include "MED.idl" - module SMESH { interface SMESH_Hypothesis; typedef sequence ListOfHypothesis; + interface SMESH_GroupBase; + typedef sequence ListOfGroups; typedef sequence double_array ; typedef sequence long_array ; @@ -60,7 +60,14 @@ module SMESH MOVE_NODE, CHANGE_ELEMENT_NODES, CHANGE_POLYHEDRON_NODES, - RENUMBER + RENUMBER, + ADD_QUADEDGE, + ADD_QUADTRIANGLE, + ADD_QUADQUADRANGLE, + ADD_QUADTETRAHEDRON, + ADD_QUADPYRAMID, + ADD_QUADPENTAHEDRON, + ADD_QUADHEXAHEDRON }; struct log_block @@ -95,6 +102,15 @@ module SMESH FACE, VOLUME }; + + /*! + * ElementOrder points out entities of what order are requested + */ + enum ElementOrder { + ORDER_ANY, /*! entities of any order */ + ORDER_LINEAR, /*! entities of 1st order */ + ORDER_QUADRATIC /*! entities of 2nd order */ + }; /*! * Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods) @@ -110,7 +126,8 @@ module SMESH HYP_INCOMPATIBLE, // hypothesis does not fit algo HYP_NOTCONFORM, // not conform mesh is produced appling a hypothesis HYP_ALREADY_EXIST,// such hypothesis already exist - HYP_BAD_DIM // bad dimension + HYP_BAD_DIM, // bad dimension + HYP_BAD_SUBSHAPE // shape is neither the main one, nor its subshape, nor a group }; /*! @@ -154,7 +171,6 @@ module SMESH long_array GetIDs(); }; - interface SMESH_GroupBase; interface SMESH_Group; interface SMESH_GroupOnGeom; interface SMESH_subMesh; @@ -221,6 +237,12 @@ module SMESH void RemoveGroupWithContents( in SMESH_GroupBase aGroup ) raises (SALOME::SALOME_Exception); + /*! + * Get the list of groups existing in the mesh + */ + ListOfGroups GetGroups() + raises (SALOME::SALOME_Exception); + /*! * Union of two groups * New group is created. All mesh elements that are @@ -326,6 +348,11 @@ module SMESH SMESH_MeshEditor GetMeshEditor() raises (SALOME::SALOME_Exception); + /*! Check group names for duplications. + * Consider maximum group name length stored in MED file. + */ + boolean HasDuplicatedGroupNamesMED(); + /*! * Export Mesh to different MED Formats * @params @@ -373,33 +400,60 @@ module SMESH long NbEdges() raises (SALOME::SALOME_Exception); + long NbEdgesOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbFaces() raises (SALOME::SALOME_Exception); + long NbFacesOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbTriangles() raises (SALOME::SALOME_Exception); + long NbTrianglesOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbQuadrangles() raises (SALOME::SALOME_Exception); + long NbQuadranglesOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbPolygons() raises (SALOME::SALOME_Exception); long NbVolumes() raises (SALOME::SALOME_Exception); + long NbVolumesOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbTetras() raises (SALOME::SALOME_Exception); + long NbTetrasOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbHexas() raises (SALOME::SALOME_Exception); + long NbHexasOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbPyramids() raises (SALOME::SALOME_Exception); + long NbPyramidsOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbPrisms() raises (SALOME::SALOME_Exception); + long NbPrismsOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbPolyhedrons() raises (SALOME::SALOME_Exception); @@ -421,10 +475,97 @@ module SMESH ElementType GetElementType( in long id, in boolean iselem ) raises (SALOME::SALOME_Exception); + long_array GetSubMeshElementsId(in long ShapeID) + raises (SALOME::SALOME_Exception); + + long_array GetSubMeshNodesId(in long ShapeID, in boolean all ) + raises (SALOME::SALOME_Exception); + + ElementType GetSubMeshElementType(in long ShapeID) + raises (SALOME::SALOME_Exception); + /*! * Get mesh description */ string Dump(); + + /*! + * Get mesh pointer + */ + long GetMeshPtr(); + + /*! + * Get XYZ coordinates of node as list of double + * If there is not node for given ID - returns empty list + */ + double_array GetNodeXYZ(in long id); + + /*! + * For given node returns list of IDs of inverse elements + * If there is not node for given ID - returns empty list + */ + long_array GetNodeInverseElements(in long id); + + /*! + * If given element is node returns IDs of shape from position + * else - return ID of result shape after ::FindShape() + * from SMESH_MeshEditor + * If there is not element for given ID - returns -1 + */ + long GetShapeID(in long id); + + /*! + * Returns number of nodes for given element + * If there is not element for given ID - returns -1 + */ + long GetElemNbNodes(in long id); + + /*! + * Returns ID of node by given index for given element + * If there is not element for given ID - returns -1 + * If there is not node for given index - returns -2 + */ + long GetElemNode(in long id, in long index); + + /*! + * Returns true if given node is medium node + * in given quadratic element + */ + boolean IsMediumNode(in long ide, in long idn); + + /*! + * Returns true if given node is medium node + * in one of quadratic elements + */ + boolean IsMediumNodeOfAnyElem(in long idn, in ElementType elem_type); + + /*! + * Returns number of edges for given element + */ + long ElemNbEdges(in long id); + + /*! + * Returns number of faces for given element + */ + long ElemNbFaces(in long id); + + /*! + * Returns true if given element is polygon + */ + boolean IsPoly(in long id); + + /*! + * Returns true if given element is quadratic + */ + boolean IsQuadratic(in long id); + + /*! + * Returns XYZ coordinates of bary center for given element + * as list of double + * If there is not element for given ID - returns empty list + */ + double_array BaryCenter(in long id); + }; interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource @@ -499,13 +640,15 @@ module SMESH boolean RemoveNodes(in long_array IDsOfNodes); - boolean AddNode(in double x, in double y, in double z); + long AddNode(in double x, in double y, in double z); + + long AddEdge(in long_array IDsOfNodes); - boolean AddEdge(in long_array IDsOfNodes); + long AddFace(in long_array IDsOfNodes); - boolean AddFace(in long_array IDsOfNodes); + long AddPolygonalFace(in long_array IdsOfNodes); - boolean AddVolume(in long_array IDsOfNodes); + long AddVolume(in long_array IDsOfNodes); /*! * Create volume of many faces, giving nodes for each face. @@ -513,7 +656,7 @@ module SMESH * \param Quantities List of integer values, Quantities[i] * gives quantity of nodes in face number i. */ - boolean AddPolyhedralVolume (in long_array IdsOfNodes, + long AddPolyhedralVolume (in long_array IdsOfNodes, in long_array Quantities); /*! @@ -522,7 +665,7 @@ module SMESH * \note The created volume will refer only to nodes * of the given faces, not to the faces itself. */ - boolean AddPolyhedralVolumeByFaces (in long_array IdsOfFaces); + long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces); boolean MoveNode(in long NodeID, in double x, in double y, in double z); @@ -625,6 +768,10 @@ module SMESH in double MaxAspectRatio, in Smooth_Method Method); + void ConvertToQuadratic(in boolean theForce3d); + + boolean ConvertFromQuadratic(); + void RenumberNodes(); void RenumberElements(); @@ -779,6 +926,27 @@ module SMESH in long NodeID2OfSide1ToMerge, in long NodeID2OfSide2ToMerge); + /*! + * Set new nodes for given element. + * If number of nodes is not corresponded to type of + * element - returns false + */ + boolean ChangeElemNodes(in long ide, in long_array newIDs); + + /*! + * If during last operation of MeshEditor some nodes were + * created this method returns list of it's IDs, if new nodes + * not creared - returns empty list + */ + long_array GetLastCreatedNodes(); + + /*! + * If during last operation of MeshEditor some elements were + * created this method returns list of it's IDs, if new elements + * not creared - returns empty list + */ + long_array GetLastCreatedElems(); + }; }; diff --git a/idl/SMESH_Pattern.idl b/idl/SMESH_Pattern.idl index d2324a0b2..a844b3c49 100644 --- a/idl/SMESH_Pattern.idl +++ b/idl/SMESH_Pattern.idl @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -140,6 +140,7 @@ module SMESH // Load(face) ERR_LOADF_NARROW_FACE, // too narrow face ERR_LOADF_CLOSED_FACE, // closed face + ERR_LOADF_CANT_PROJECT, // impossible to project nodes // Load(volume) ERR_LOADV_BAD_SHAPE, // volume is not a brick of 6 faces ERR_LOADV_COMPUTE_PARAMS, // cant compute point parameters diff --git a/resources/SMESHCatalog.xml b/resources/SMESHCatalog.xml deleted file mode 100644 index 90d187320..000000000 --- a/resources/SMESHCatalog.xml +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - SMESH - Mesh - MESH - NRI - 3.2.0a1 - Mesh component - 1 - ModuleMesh.png - 1 - - - SMESH - - - - CreateHypothesis - - - - 1 - - - string - anHyp - - - - long - studyId - - - - - - SMESH_Hypothesis - aHyp - - - - - - Init - - - - 1 - - - GEOM_Gen - geomEngine - - - - long - studyId - - - - GEOM_Shape - aShape - - - - - - SMESH_Mesh - aMesh - - - - - - Compute - - - - 1 - - - SMESH_Mesh - aMesh - - - - GEOM_Shape - aSubShape - - - - - - boolean - res - Result - - - - - IsReadyToCompute - - - - 1 - - - SMESH_Mesh - aMesh - - - - GEOM_Shape - aSubShape - - - - - boolean - res - Result - - - - SMESH_Mesh - - - - AddHypothesis - - - - 1 - - - GEOM_Shape - aSubShape - - - - SMESH_Hypothesis - aHyp - - - - - - boolean - res - Result - - - - - - hostname = localhost - - - diff --git a/resources/StdMeshers.xml b/resources/StdMeshers.xml index 5c0cee6b3..32702d21c 100644 --- a/resources/StdMeshers.xml +++ b/resources/StdMeshers.xml @@ -57,6 +57,12 @@ icon-id="mesh_algo_quad.png" dim="2"/> + + + hypos="LocalLength,Arithmetic1D,StartEndLength,NumberOfSegments,Deflection1D,AutomaticLength" + opt-hypos="Propagation,QuadraticMesh" + output="EDGE" + dim="1"/> + hypos="LengthFromEdges,MaxElementArea" + input="EDGE" + output="TRIA" + dim="2"/> diff --git a/resources/mesh_conv_to_quad.png b/resources/mesh_conv_to_quad.png index ae39c7e0a..95dae88e7 100755 Binary files a/resources/mesh_conv_to_quad.png and b/resources/mesh_conv_to_quad.png differ diff --git a/resources/mesh_quad_edge.png b/resources/mesh_quad_edge.png index 184498a50..8e744d86a 100644 Binary files a/resources/mesh_quad_edge.png and b/resources/mesh_quad_edge.png differ diff --git a/resources/mesh_quad_hexahedron.png b/resources/mesh_quad_hexahedron.png index d7dcfb266..d4af5e829 100644 Binary files a/resources/mesh_quad_hexahedron.png and b/resources/mesh_quad_hexahedron.png differ diff --git a/resources/mesh_quad_pentahedron.png b/resources/mesh_quad_pentahedron.png index 1a5f7d8db..b6e451ce0 100644 Binary files a/resources/mesh_quad_pentahedron.png and b/resources/mesh_quad_pentahedron.png differ diff --git a/resources/mesh_quad_pyramid.png b/resources/mesh_quad_pyramid.png index 2de86738f..a553ee40a 100644 Binary files a/resources/mesh_quad_pyramid.png and b/resources/mesh_quad_pyramid.png differ diff --git a/resources/mesh_quad_quadrangle.png b/resources/mesh_quad_quadrangle.png index ebab66c77..57acd7a42 100644 Binary files a/resources/mesh_quad_quadrangle.png and b/resources/mesh_quad_quadrangle.png differ diff --git a/resources/mesh_quad_tetrahedron.png b/resources/mesh_quad_tetrahedron.png index d9c2daece..f386add11 100644 Binary files a/resources/mesh_quad_tetrahedron.png and b/resources/mesh_quad_tetrahedron.png differ diff --git a/resources/mesh_quad_triangle.png b/resources/mesh_quad_triangle.png index d617c4e33..141a01706 100644 Binary files a/resources/mesh_quad_triangle.png and b/resources/mesh_quad_triangle.png differ diff --git a/resources/mesh_tree_algo_netgen_2d.png b/resources/mesh_tree_algo_netgen_2d.png index 092eae3c0..81d265938 100755 Binary files a/resources/mesh_tree_algo_netgen_2d.png and b/resources/mesh_tree_algo_netgen_2d.png differ diff --git a/resources/mesh_tree_algo_netgen_2d3d.png b/resources/mesh_tree_algo_netgen_2d3d.png index eeaf98afe..99a84a1ef 100644 Binary files a/resources/mesh_tree_algo_netgen_2d3d.png and b/resources/mesh_tree_algo_netgen_2d3d.png differ diff --git a/resources/mesh_tree_hypo_netgen.png b/resources/mesh_tree_hypo_netgen.png index ad5e9f3c4..43bd81e38 100644 Binary files a/resources/mesh_tree_hypo_netgen.png and b/resources/mesh_tree_hypo_netgen.png differ diff --git a/resources/mesh_tree_hypo_netgen_2d.png b/resources/mesh_tree_hypo_netgen_2d.png index cd813c86a..c72e4af45 100644 Binary files a/resources/mesh_tree_hypo_netgen_2d.png and b/resources/mesh_tree_hypo_netgen_2d.png differ diff --git a/src/Controls/Makefile.in b/src/Controls/Makefile.in index 5cc836126..3416e9751 100644 --- a/src/Controls/Makefile.in +++ b/src/Controls/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -43,10 +43,10 @@ LIB_SRC = SMESH_Controls.cxx BIN = SMESHControls BIN_SRC = -CPPFLAGS+=$(OCC_INCLUDES) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome +CPPFLAGS+=$(OCC_INCLUDES) $(BOOST_CPPFLAGS) $(KERNEL_CXXFLAGS) -LDFLAGS+=$(OCC_KERNEL_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome -lOpUtil -lSMDS -lTKBRep -lTKG3d +LDFLAGS+=$(OCC_KERNEL_LIBS) $(KERNEL_LDFLAGS) -lOpUtil -lSMDS -lTKBRep -lTKG3d -LDFLAGSFORBIN += -lSMDS -L${KERNEL_ROOT_DIR}/lib/salome -lOpUtil -lSALOMELocalTrace -lSALOMEBasics $(OCC_KERNEL_LIBS) -lTKBRep -lTKG3d +LDFLAGSFORBIN += -lSMDS $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics $(OCC_KERNEL_LIBS) -lTKBRep -lTKG3d @CONCLUDE@ diff --git a/src/Controls/SMESHControls.cxx b/src/Controls/SMESHControls.cxx index 0c8d145a3..e36685db8 100644 --- a/src/Controls/SMESHControls.cxx +++ b/src/Controls/SMESHControls.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "SMESH_ControlsDef.hxx" diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index 717f8e66a..bad6ae8f9 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "SMESH_ControlsDef.hxx" @@ -46,6 +46,8 @@ #include "SMDS_MeshElement.hxx" #include "SMDS_MeshNode.hxx" #include "SMDS_VolumeTool.hxx" +#include "SMDS_QuadraticFaceOfNodes.hxx" +#include "SMDS_QuadraticEdge.hxx" /* @@ -87,32 +89,69 @@ namespace{ return 0; const SMDS_MeshElement* anEdge = theMesh->FindElement( theId ); - if ( anEdge == 0 || anEdge->GetType() != SMDSAbs_Edge || anEdge->NbNodes() != 2 ) + if ( anEdge == 0 || anEdge->GetType() != SMDSAbs_Edge/* || anEdge->NbNodes() != 2 */) return 0; - TColStd_MapOfInteger aMap; - - int aResult = 0; - SMDS_ElemIteratorPtr anIter = anEdge->nodesIterator(); - if ( anIter != 0 ) { - while( anIter->more() ) { - const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next(); - if ( aNode == 0 ) - return 0; - SMDS_ElemIteratorPtr anElemIter = aNode->GetInverseElementIterator(); - while( anElemIter->more() ) { - const SMDS_MeshElement* anElem = anElemIter->next(); - if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge ) { - int anId = anElem->GetID(); - - if ( anIter->more() ) // i.e. first node - aMap.Add( anId ); - else if ( aMap.Contains( anId ) ) - aResult++; - } - } + // for each pair of nodes in anEdge (there are 2 pairs in a quadratic edge) + // count elements containing both nodes of the pair. + // Note that there may be such cases for a quadratic edge (a horizontal line): + // + // Case 1 Case 2 + // | | | | | + // | | | | | + // +-----+------+ +-----+------+ + // | | | | + // | | | | + // result sould be 2 in both cases + // + int aResult0 = 0, aResult1 = 0; + // last node, it is a medium one in a quadratic edge + const SMDS_MeshNode* aLastNode = anEdge->GetNode( anEdge->NbNodes() - 1 ); + const SMDS_MeshNode* aNode0 = anEdge->GetNode( 0 ); + const SMDS_MeshNode* aNode1 = anEdge->GetNode( 1 ); + if ( aNode1 == aLastNode ) aNode1 = 0; + + SMDS_ElemIteratorPtr anElemIter = aLastNode->GetInverseElementIterator(); + while( anElemIter->more() ) { + const SMDS_MeshElement* anElem = anElemIter->next(); + if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge ) { + SMDS_ElemIteratorPtr anIter = anElem->nodesIterator(); + while ( anIter->more() ) { + if ( const SMDS_MeshElement* anElemNode = anIter->next() ) { + if ( anElemNode == aNode0 ) { + aResult0++; + if ( !aNode1 ) break; // not a quadratic edge + } + else if ( anElemNode == aNode1 ) + aResult1++; + } + } } } + int aResult = max ( aResult0, aResult1 ); + +// TColStd_MapOfInteger aMap; + +// SMDS_ElemIteratorPtr anIter = anEdge->nodesIterator(); +// if ( anIter != 0 ) { +// while( anIter->more() ) { +// const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next(); +// if ( aNode == 0 ) +// return 0; +// SMDS_ElemIteratorPtr anElemIter = aNode->GetInverseElementIterator(); +// while( anElemIter->more() ) { +// const SMDS_MeshElement* anElem = anElemIter->next(); +// if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge ) { +// int anId = anElem->GetID(); + +// if ( anIter->more() ) // i.e. first node +// aMap.Add( anId ); +// else if ( aMap.Contains( anId ) ) +// aResult++; +// } +// } +// } +// } return aResult; } @@ -154,23 +193,41 @@ bool NumericalFunctor::GetPoints(const int theId, } bool NumericalFunctor::GetPoints(const SMDS_MeshElement* anElem, - TSequenceOfXYZ& theRes ) + TSequenceOfXYZ& theRes ) { theRes.clear(); if ( anElem == 0) return false; + theRes.reserve( anElem->NbNodes() ); + // Get nodes of the element - SMDS_ElemIteratorPtr anIter = anElem->nodesIterator(); - if ( anIter != 0 ) - { - while( anIter->more() ) - { - const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next(); - if ( aNode != 0 ){ + SMDS_ElemIteratorPtr anIter; + + if ( anElem->IsQuadratic() ) { + switch ( anElem->GetType() ) { + case SMDSAbs_Edge: + anIter = static_cast + (anElem)->interlacedNodesElemIterator(); + break; + case SMDSAbs_Face: + anIter = static_cast + (anElem)->interlacedNodesElemIterator(); + break; + default: + anIter = anElem->nodesIterator(); + //return false; + } + } + else { + anIter = anElem->nodesIterator(); + } + + if ( anIter ) { + while( anIter->more() ) { + if ( const SMDS_MeshNode* aNode = static_cast( anIter->next() )) theRes.push_back( gp_XYZ( aNode->X(), aNode->Y(), aNode->Z() ) ); - } } } @@ -189,6 +246,7 @@ void NumericalFunctor::SetPrecision( const long thePrecision ) double NumericalFunctor::GetValue( long theId ) { + myCurrElement = myMesh->FindElement( theId ); TSequenceOfXYZ P; if ( GetPoints( theId, P )) { @@ -285,6 +343,7 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P ) // According to "Mesh quality control" by Nadir Bouhamau referring to // Pascal Jean Frey and Paul-Louis George. Maillages, applications aux elements finis. // Hermes Science publications, Paris 1999 ISBN 2-7462-0024-4 + // PAL10872 int nbNodes = P.size(); @@ -426,6 +485,7 @@ namespace{ double AspectRatio3D::GetValue( const TSequenceOfXYZ& P ) { double aQuality = 0.0; + if(myCurrElement->IsPoly()) return aQuality; int nbNodes = P.size(); switch(nbNodes){ case 4:{ @@ -840,22 +900,21 @@ SMDSAbs_ElementType Skew::GetType() const */ double Area::GetValue( const TSequenceOfXYZ& P ) { - double aArea = 0; - if ( P.size() == 3 ) - return getArea( P( 1 ), P( 2 ), P( 3 ) ); - else if (P.size() > 3) - aArea = getArea( P( 1 ), P( 2 ), P( 3 ) ); - else - return 0; - - for (int i=4; i<=P.size(); i++) - aArea += getArea(P(1),P(i-1),P(i)); - return aArea; + gp_Vec aVec1( P(2) - P(1) ); + gp_Vec aVec2( P(3) - P(1) ); + gp_Vec SumVec = aVec1 ^ aVec2; + for (int i=4; i<=P.size(); i++) { + gp_Vec aVec1( P(i-1) - P(1) ); + gp_Vec aVec2( P(i) - P(1) ); + gp_Vec tmp = aVec1 ^ aVec2; + SumVec.Add(tmp); + } + return SumVec.Magnitude() * 0.5; } double Area::GetBadRate( double Value, int /*nbNodes*/ ) const { - // meaningless as it is not quality control functor + // meaningless as it is not a quality control functor return Value; } @@ -871,7 +930,11 @@ SMDSAbs_ElementType Area::GetType() const */ double Length::GetValue( const TSequenceOfXYZ& P ) { - return ( P.size() == 2 ? getDistance( P( 1 ), P( 2 ) ) : 0 ); + switch ( P.size() ) { + case 2: return getDistance( P( 1 ), P( 2 ) ); + case 3: return getDistance( P( 1 ), P( 2 ) ) + getDistance( P( 2 ), P( 3 ) ); + default: return 0.; + } } double Length::GetBadRate( double Value, int /*nbNodes*/ ) const @@ -894,7 +957,10 @@ double Length2D::GetValue( long theElementId) { TSequenceOfXYZ P; + //cout<<"Length2D::GetValue"<FindElement( theElementId ); @@ -908,7 +974,11 @@ double Length2D::GetValue( long theElementId) case SMDSAbs_Edge: if (len == 2){ aVal = getDistance( P( 1 ), P( 2 ) ); - break; + break; + } + else if (len == 3){ // quadratic edge + aVal = getDistance(P( 1 ),P( 3 )) + getDistance(P( 3 ),P( 2 )); + break; } case SMDSAbs_Face: if (len == 3){ // triangles @@ -926,6 +996,22 @@ double Length2D::GetValue( long theElementId) aVal = Max(Max(L1,L2),Max(L3,L4)); break; } + if (len == 6){ // quadratic triangles + double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 )); + double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 )); + double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 1 )); + aVal = Max(L1,Max(L2,L3)); + //cout<<"L1="< diff --git a/src/DriverDAT/DriverDAT_R_SMDS_Mesh.h b/src/DriverDAT/DriverDAT_R_SMDS_Mesh.h index 3fb011078..4186b8d13 100644 --- a/src/DriverDAT/DriverDAT_R_SMDS_Mesh.h +++ b/src/DriverDAT/DriverDAT_R_SMDS_Mesh.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _INCLUDE_DRIVERDAT_R_SMDS_MESH #define _INCLUDE_DRIVERDAT_R_SMDS_MESH diff --git a/src/DriverDAT/DriverDAT_R_SMESHDS_Document.cxx b/src/DriverDAT/DriverDAT_R_SMESHDS_Document.cxx index c7d9b2230..9726bf15a 100644 --- a/src/DriverDAT/DriverDAT_R_SMESHDS_Document.cxx +++ b/src/DriverDAT/DriverDAT_R_SMESHDS_Document.cxx @@ -15,6 +15,6 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "DriverDAT_R_SMESHDS_Document.h" diff --git a/src/DriverDAT/DriverDAT_R_SMESHDS_Document.h b/src/DriverDAT/DriverDAT_R_SMESHDS_Document.h index 6e5508684..c26ca913e 100644 --- a/src/DriverDAT/DriverDAT_R_SMESHDS_Document.h +++ b/src/DriverDAT/DriverDAT_R_SMESHDS_Document.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _INCLUDE_DRIVERDAT_R_SMESHDS_DOCUMENT #define _INCLUDE_DRIVERDAT_R_SMESHDS_DOCUMENT diff --git a/src/DriverDAT/DriverDAT_R_SMESHDS_Mesh.cxx b/src/DriverDAT/DriverDAT_R_SMESHDS_Mesh.cxx index a7e974f52..5101213c9 100644 --- a/src/DriverDAT/DriverDAT_R_SMESHDS_Mesh.cxx +++ b/src/DriverDAT/DriverDAT_R_SMESHDS_Mesh.cxx @@ -15,6 +15,6 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "DriverDAT_R_SMESHDS_Mesh.h" diff --git a/src/DriverDAT/DriverDAT_R_SMESHDS_Mesh.h b/src/DriverDAT/DriverDAT_R_SMESHDS_Mesh.h index 64fd36a1b..0147ce4a5 100644 --- a/src/DriverDAT/DriverDAT_R_SMESHDS_Mesh.h +++ b/src/DriverDAT/DriverDAT_R_SMESHDS_Mesh.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _INCLUDE_DRIVERDAT_R_SMESHDS_MESH #define _INCLUDE_DRIVERDAT_R_SMESHDS_MESH diff --git a/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx b/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx index 1f8d5ab61..e48161c4e 100644 --- a/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx +++ b/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include @@ -32,7 +32,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform() Status aResult = DRS_OK; int nbNodes, nbCells; - int i; + //int i; char *file2Read = (char *)myFile.c_str(); FILE* aFileId = fopen(file2Read, "w+"); @@ -52,7 +52,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform() nbNodes = myMesh->NbNodes(); /* Combien de mailles, faces ou aretes ? */ - int nb_of_nodes, nb_of_edges, nb_of_faces, nb_of_volumes; + int /*nb_of_nodes,*/ nb_of_edges, nb_of_faces, nb_of_volumes; nb_of_edges = myMesh->NbEdges(); nb_of_faces = myMesh->NbFaces(); nb_of_volumes = myMesh->NbVolumes(); diff --git a/src/DriverDAT/DriverDAT_W_SMDS_Mesh.h b/src/DriverDAT/DriverDAT_W_SMDS_Mesh.h index 43f13a9df..ce013c5b9 100644 --- a/src/DriverDAT/DriverDAT_W_SMDS_Mesh.h +++ b/src/DriverDAT/DriverDAT_W_SMDS_Mesh.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/DriverDAT/DriverDAT_W_SMESHDS_Document.cxx b/src/DriverDAT/DriverDAT_W_SMESHDS_Document.cxx index 1cd9699af..37faa1d6f 100644 --- a/src/DriverDAT/DriverDAT_W_SMESHDS_Document.cxx +++ b/src/DriverDAT/DriverDAT_W_SMESHDS_Document.cxx @@ -15,6 +15,6 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "DriverDAT_W_SMESHDS_Document.h" diff --git a/src/DriverDAT/DriverDAT_W_SMESHDS_Document.h b/src/DriverDAT/DriverDAT_W_SMESHDS_Document.h index f9118f0e3..802a2dee7 100644 --- a/src/DriverDAT/DriverDAT_W_SMESHDS_Document.h +++ b/src/DriverDAT/DriverDAT_W_SMESHDS_Document.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _INCLUDE_DRIVERDAT_W_SMESHDS_DOCUMENT #define _INCLUDE_DRIVERDAT_W_SMESHDS_DOCUMENT diff --git a/src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.cxx b/src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.cxx index e17c6cdd2..7dc9fc830 100644 --- a/src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.cxx +++ b/src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.cxx @@ -15,6 +15,6 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "DriverDAT_W_SMESHDS_Mesh.h" diff --git a/src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.h b/src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.h index 35edc2b62..3d18b5907 100644 --- a/src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.h +++ b/src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/DriverDAT/Makefile.in b/src/DriverDAT/Makefile.in index 41904009a..59c7d3355 100644 --- a/src/DriverDAT/Makefile.in +++ b/src/DriverDAT/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -49,11 +49,11 @@ LIB_CLIENT_IDL = LIB_SERVER_IDL = # additionnal information to compil and link file -CPPFLAGS += -I${KERNEL_ROOT_DIR}/include/salome $(OCC_INCLUDES) $(BOOST_CPPFLAGS) -CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome +CPPFLAGS += $(KERNEL_CXXFLAGS) $(OCC_INCLUDES) $(BOOST_CPPFLAGS) +CXXFLAGS += $(KERNEL_CXXFLAGS) LDFLAGS += -lMeshDriver $(OCC_KERNEL_LIBS) -LDFLAGSFORBIN += -lMeshDriver -lSMDS -L${KERNEL_ROOT_DIR}/lib/salome -lOpUtil -lSALOMELocalTrace -lSALOMEBasics +LDFLAGSFORBIN += -lMeshDriver -lSMDS $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics @CONCLUDE@ diff --git a/src/DriverMED/DriverMED_Family.cxx b/src/DriverMED/DriverMED_Family.cxx index 47a923dbd..ebd21783d 100644 --- a/src/DriverMED/DriverMED_Family.cxx +++ b/src/DriverMED/DriverMED_Family.cxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -32,6 +32,103 @@ using namespace std; +//============================================================================= +/*! + * Default constructor + */ +//============================================================================= +DriverMED_Family +::DriverMED_Family(): + myGroupAttributVal(0) +{} + + +//============================================================================= +const ElementsSet& +DriverMED_Family +::GetElements () const +{ + return myElements; +} + +int +DriverMED_Family +::GetId () const +{ + return myId; +} + +void +DriverMED_Family +::SetId (const int theId) +{ + myId = theId; +} + +void +DriverMED_Family +::AddElement(const SMDS_MeshElement* theElement) +{ + myElements.insert(theElement); +} + +void +DriverMED_Family +::AddGroupName(std::string theGroupName) +{ + myGroupNames.insert(theGroupName); +} + +void +DriverMED_Family +::SetType(const SMDSAbs_ElementType theType) +{ + myType = theType; +} + +SMDSAbs_ElementType +DriverMED_Family +::GetType() +{ + return myType; +} + +bool +DriverMED_Family +::MemberOf(std::string theGroupName) const +{ + return myGroupNames.find(theGroupName) != myGroupNames.end(); +} + +const MED::TStringSet& +DriverMED_Family +::GetGroupNames () const +{ + return myGroupNames; +} + + +int +DriverMED_Family +::GetGroupAttributVal() const +{ + return myGroupAttributVal; +} + +void +DriverMED_Family +::SetGroupAttributVal( int theValue) +{ + myGroupAttributVal = theValue; +} + +bool +DriverMED_Family +::IsEmpty () const +{ + return myElements.empty(); +} + //============================================================================= /*! * Split each group from list on some parts (families) @@ -39,15 +136,16 @@ using namespace std; * Resulting families have no common elements. */ //============================================================================= -list DriverMED_Family::MakeFamilies - (const map & theSubMeshes, - const list& theGroups, - const bool doGroupOfNodes, - const bool doGroupOfEdges, - const bool doGroupOfFaces, - const bool doGroupOfVolumes) +DriverMED_FamilyPtrList +DriverMED_Family +::MakeFamilies(const SMESHDS_SubMeshPtrMap& theSubMeshes, + const SMESHDS_GroupBasePtrList& theGroups, + const bool doGroupOfNodes, + const bool doGroupOfEdges, + const bool doGroupOfFaces, + const bool doGroupOfVolumes) { - list aFamilies; + DriverMED_FamilyPtrList aFamilies; string anAllNodesGroupName = "Group_Of_All_Nodes"; string anAllEdgesGroupName = "Group_Of_All_Edges"; @@ -61,22 +159,23 @@ list DriverMED_Family::MakeFamilies int aElemFamId = FIRST_ELEM_FAMILY; // Process sub-meshes - map::const_iterator aSMIter = theSubMeshes.begin(); + SMESHDS_SubMeshPtrMap::const_iterator aSMIter = theSubMeshes.begin(); for (; aSMIter != theSubMeshes.end(); aSMIter++) { - if ( aSMIter->second->IsComplexSubmesh() ) + const int anId = aSMIter->first; + SMESHDS_SubMesh* aSubMesh = aSMIter->second; + if ( aSubMesh->IsComplexSubmesh() ) continue; // submesh containing other submeshs - list aSMFams = SplitByType((*aSMIter).second, (*aSMIter).first); - list::iterator aSMFamsIter = aSMFams.begin(); + DriverMED_FamilyPtrList aSMFams = SplitByType(aSubMesh,anId); + DriverMED_FamilyPtrList::iterator aSMFamsIter = aSMFams.begin(); for (; aSMFamsIter != aSMFams.end(); aSMFamsIter++) { DriverMED_FamilyPtr aFam2 = (*aSMFamsIter); - - list::iterator aFamsIter = aFamilies.begin(); + DriverMED_FamilyPtrList::iterator aFamsIter = aFamilies.begin(); while (aFamsIter != aFamilies.end()) { DriverMED_FamilyPtr aFam1 = *aFamsIter; - list::iterator aCurrIter = aFamsIter++; + DriverMED_FamilyPtrList::iterator aCurrIter = aFamsIter++; if (aFam1->myType == aFam2->myType) { DriverMED_FamilyPtr aCommon (new DriverMED_Family); @@ -89,7 +188,8 @@ list DriverMED_Family::MakeFamilies { aFamilies.erase(aCurrIter); } - if (aFam2->IsEmpty()) break; + if (aFam2->IsEmpty()) + break; } } // The rest elements of family @@ -101,30 +201,32 @@ list DriverMED_Family::MakeFamilies } // Process groups - list::const_iterator aGroupsIter = theGroups.begin(); + SMESHDS_GroupBasePtrList::const_iterator aGroupsIter = theGroups.begin(); for (; aGroupsIter != theGroups.end(); aGroupsIter++) { DriverMED_FamilyPtr aFam2 (new DriverMED_Family); aFam2->Init(*aGroupsIter); - list::iterator aFamsIter = aFamilies.begin(); + DriverMED_FamilyPtrList::iterator aFamsIter = aFamilies.begin(); while (aFamsIter != aFamilies.end()) { DriverMED_FamilyPtr aFam1 = *aFamsIter; - list::iterator aCurrIter = aFamsIter++; + DriverMED_FamilyPtrList::iterator aCurrIter = aFamsIter++; if (aFam1->myType == aFam2->myType) { DriverMED_FamilyPtr aCommon (new DriverMED_Family); aFam1->Split(aFam2, aCommon); if (!aCommon->IsEmpty()) { + aCommon->SetGroupAttributVal(0); aFamilies.push_back(aCommon); } if (aFam1->IsEmpty()) { aFamilies.erase(aCurrIter); } - if (aFam2->IsEmpty()) break; + if (aFam2->IsEmpty()) + break; } } // The rest elements of group @@ -134,7 +236,7 @@ list DriverMED_Family::MakeFamilies } } - list::iterator aFamsIter = aFamilies.begin(); + DriverMED_FamilyPtrList::iterator aFamsIter = aFamilies.begin(); for (; aFamsIter != aFamilies.end(); aFamsIter++) { DriverMED_FamilyPtr aFam = *aFamsIter; @@ -210,33 +312,33 @@ MED::PFamilyInfo DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper, const MED::PMeshInfo& theMeshInfo) const { - string aValue; - ostringstream aStr; - aStr << "FAM_" << myId; set::const_iterator aGrIter = myGroupNames.begin(); - for (; aGrIter != myGroupNames.end(); aGrIter++) - { + for(; aGrIter != myGroupNames.end(); aGrIter++){ aStr << "_" << *aGrIter; } - aValue = aStr.str(); - /* - MED::TStringVector anAttrDescs (1, ""); // 1 attribute with empty description, - MED::TIntVector anAttrIds (1, myId); // Id=0, - MED::TIntVector anAttrVals (1, myId); // Value=0 - */ - - MED::PFamilyInfo anInfo = theWrapper->CrFamilyInfo(theMeshInfo, - aValue, - myId, - myGroupNames); -/* - anAttrDescs, - anAttrIds, - anAttrVals); -*/ + MED::PFamilyInfo anInfo; + string aValue = aStr.str(); + if(myId == 0){ + anInfo = theWrapper->CrFamilyInfo(theMeshInfo, + aValue, + myId, + myGroupNames); + }else{ + MED::TStringVector anAttrDescs (1, ""); // 1 attribute with empty description, + MED::TIntVector anAttrIds (1, myId); // Id=0, + MED::TIntVector anAttrVals (1); + anAttrVals[0] = myGroupAttributVal != 0? myGroupAttributVal: myId; + anInfo = theWrapper->CrFamilyInfo(theMeshInfo, + aValue, + myId, + myGroupNames, + anAttrDescs, + anAttrIds, + anAttrVals); + } // cout << endl; // cout << "Groups: "; @@ -279,6 +381,14 @@ void DriverMED_Family::Init (SMESHDS_GroupBase* theGroup) // Groups list myGroupNames.clear(); myGroupNames.insert(string(theGroup->GetStoreName())); + + myGroupAttributVal = 0; + + if (theGroup->GetColorGroup()!=0) + { + myGroupAttributVal = theGroup->GetColorGroup(); + } + } //============================================================================= @@ -287,10 +397,12 @@ void DriverMED_Family::Init (SMESHDS_GroupBase* theGroup) * on the basis of the elements type. */ //============================================================================= -list DriverMED_Family::SplitByType (SMESHDS_SubMesh* theSubMesh, - const int theId) +DriverMED_FamilyPtrList +DriverMED_Family +::SplitByType (SMESHDS_SubMesh* theSubMesh, + const int theId) { - list aFamilies; + DriverMED_FamilyPtrList aFamilies; DriverMED_FamilyPtr aNodesFamily (new DriverMED_Family); DriverMED_FamilyPtr anEdgesFamily (new DriverMED_Family); DriverMED_FamilyPtr aFacesFamily (new DriverMED_Family); @@ -361,7 +473,7 @@ void DriverMED_Family::Split (DriverMED_FamilyPtr by, DriverMED_FamilyPtr common) { // Elements - set::iterator anIter = by->myElements.begin(); + ElementsSet::iterator anIter = by->myElements.begin(); while ( anIter != by->myElements.end()) { if (myElements.find(*anIter) != myElements.end()) @@ -378,7 +490,7 @@ void DriverMED_Family::Split (DriverMED_FamilyPtr by, { // Groups list common->myGroupNames = myGroupNames; - set::iterator aGrNamesIter = by->myGroupNames.begin(); + MED::TStringSet::iterator aGrNamesIter = by->myGroupNames.begin(); for (; aGrNamesIter != by->myGroupNames.end(); aGrNamesIter++) { common->myGroupNames.insert(*aGrNamesIter); diff --git a/src/DriverMED/DriverMED_Family.h b/src/DriverMED/DriverMED_Family.h index aaab3bd20..64ad65a56 100644 --- a/src/DriverMED/DriverMED_Family.h +++ b/src/DriverMED/DriverMED_Family.h @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -47,76 +47,92 @@ class DriverMED_Family; typedef boost::shared_ptr DriverMED_FamilyPtr; +typedef std::list DriverMED_FamilyPtrList; +typedef std::map SMESHDS_SubMeshPtrMap; +typedef std::list SMESHDS_GroupBasePtrList; +typedef std::set ElementsSet; class MESHDRIVERMED_EXPORT DriverMED_Family { public: - // Methods for groups storing to MED - - static std::list MakeFamilies (const std::map & theSubMeshes, - const std::list& theGroups, - const bool doGroupOfNodes, - const bool doGroupOfEdges, - const bool doGroupOfFaces, - const bool doGroupOfVolumes); - // Split each group from list and each sub-mesh from list - // on some parts (families) on the basis of the elements membership in other groups - // from and other sub-meshes from . - // Resulting families have no common elements. - - MED::PFamilyInfo GetFamilyInfo (const MED::PWrapper& theWrapper, - const MED::PMeshInfo& theMeshInfo) const; - // Create TFamilyInfo for this family - - const std::set& GetElements () const { return myElements; } - // Returns elements of this family - - int GetId () const { return myId; } - // Returns a family ID + DriverMED_Family(); + + //! Methods for groups storing to MED + /*! + Split each group from list and each sub-mesh from list + on some parts (families) on the basis of the elements membership in other groups + from and other sub-meshes from . + Resulting families have no common elements. + */ + static + DriverMED_FamilyPtrList + MakeFamilies (const SMESHDS_SubMeshPtrMap& theSubMeshes, + const SMESHDS_GroupBasePtrList& theGroups, + const bool doGroupOfNodes, + const bool doGroupOfEdges, + const bool doGroupOfFaces, + const bool doGroupOfVolumes); + + //! Create TFamilyInfo for this family + MED::PFamilyInfo + GetFamilyInfo (const MED::PWrapper& theWrapper, + const MED::PMeshInfo& theMeshInfo) const; + + //! Returns elements of this family + const ElementsSet& GetElements () const; + + //! Returns a family ID + int GetId () const; + + //! Sets a family ID + void SetId (const int theId); public: // Methods for groups reading from MED - void AddElement (const SMDS_MeshElement* theElement) { myElements.insert(theElement); } + void AddElement(const SMDS_MeshElement* theElement); - void AddGroupName (std::string theGroupName) { myGroupNames.insert(theGroupName); } + const MED::TStringSet& GetGroupNames() const; + void AddGroupName(std::string theGroupName); - void SetType (const SMDSAbs_ElementType theType) { myType = theType; } - SMDSAbs_ElementType GetType () { return myType; } + void SetType(const SMDSAbs_ElementType theType); + SMDSAbs_ElementType GetType(); - bool MemberOf (std::string theGroupName) const - { return (myGroupNames.find(theGroupName) != myGroupNames.end()); } + bool MemberOf(std::string theGroupName) const; - const MED::TStringSet& GetGroupNames () const { return myGroupNames; } - - void SetId (const int theId) { myId = theId; } - // Sets a family ID + int GetGroupAttributVal() const; + void SetGroupAttributVal( int theValue); private: + //! Initialize the tool by SMESHDS_GroupBase void Init (SMESHDS_GroupBase* group); - // Initialize the tool by SMESHDS_GroupBase - static std::list SplitByType (SMESHDS_SubMesh* theSubMesh, - const int theId); - // Split on some parts (families) - // on the basis of the elements type. + //! Split on some parts (families) on the basis of the elements type. + static + DriverMED_FamilyPtrList + SplitByType(SMESHDS_SubMesh* theSubMesh, + const int theId); + + /*! Remove from elements, common with , + Remove from elements, common with , + Create family from common elements, with combined groups list. + */ void Split (DriverMED_FamilyPtr by, DriverMED_FamilyPtr common); - // Remove from elements, common with , - // Remove from elements, common with , - // Create family from common elements, with combined groups list. - bool IsEmpty () const { return myElements.empty(); } - // Check, if this family has empty list of elements + //! Check, if this family has empty list of elements + bool IsEmpty () const; + private: int myId; SMDSAbs_ElementType myType; - std::set myElements; + ElementsSet myElements; MED::TStringSet myGroupNames; + int myGroupAttributVal; }; #endif diff --git a/src/DriverMED/DriverMED_R_SMDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMDS_Mesh.cxx index cac48ff45..6c9c4dabc 100644 --- a/src/DriverMED/DriverMED_R_SMDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMDS_Mesh.cxx @@ -15,6 +15,6 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "DriverMED_R_SMDS_Mesh.h" diff --git a/src/DriverMED/DriverMED_R_SMDS_Mesh.h b/src/DriverMED/DriverMED_R_SMDS_Mesh.h index 29c7dc074..6d488bed5 100644 --- a/src/DriverMED/DriverMED_R_SMDS_Mesh.h +++ b/src/DriverMED/DriverMED_R_SMDS_Mesh.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _INCLUDE_DRIVERMED_R_SMDS_MESH #define _INCLUDE_DRIVERMED_R_SMDS_MESH diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Document.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Document.cxx index 9527382ad..5843cd9cf 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Document.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Document.cxx @@ -15,6 +15,6 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "DriverMED_R_SMESHDS_Document.h" diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Document.h b/src/DriverMED/DriverMED_R_SMESHDS_Document.h index 137acbb4e..0672ebf37 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Document.h +++ b/src/DriverMED/DriverMED_R_SMESHDS_Document.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _INCLUDE_DRIVERMED_R_SMESHDS_DOCUMENT #define _INCLUDE_DRIVERMED_R_SMESHDS_DOCUMENT diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index 44e05bf77..7e7c9b6ae 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -41,6 +41,7 @@ #ifdef _DEBUG_ static int MYDEBUG = 0; +//#define _DEXCEPT_ #else static int MYDEBUG = 0; #endif @@ -69,10 +70,12 @@ DriverMED_R_SMESHDS_Mesh ::Perform() { Status aResult = DRS_FAIL; +#ifndef _DEXCEPT_ try{ +#endif myFamilies.clear(); if(MYDEBUG) MESSAGE("Perform - myFile : "<GetNbMeshes()){ @@ -80,6 +83,7 @@ DriverMED_R_SMESHDS_Mesh // Reading the MED mesh //--------------------- PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh+1); + string aMeshName; if (myMeshId != -1) { ostringstream aMeshNameStr; @@ -91,6 +95,7 @@ DriverMED_R_SMESHDS_Mesh if(MYDEBUG) MESSAGE("Perform - aMeshName : "<GetName()); if(aMeshName != aMeshInfo->GetName()) continue; aResult = DRS_OK; + //TInt aMeshDim = aMeshInfo->GetDim(); // Reading MED families to the temporary structure @@ -118,9 +123,16 @@ DriverMED_R_SMESHDS_Mesh } } + if (aMeshInfo->GetType() == MED::eSTRUCTURE){ + bool aRes = buildMeshGrille(aMed,aMeshInfo); + continue; + } + // Reading MED nodes to the corresponding SMDS structure //------------------------------------------------------ - PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo); + PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo); + if(!aNodeInfo) + continue; PCoordHelper aCoordHelper = GetCoordHelper(aNodeInfo); @@ -195,7 +207,9 @@ DriverMED_R_SMESHDS_Mesh SMDS_MeshElement* anElement = NULL; TInt aFamNum = aPolygoneInfo->GetFamNum(iElem); +#ifndef _DEXCEPT_ try{ +#endif if(anIsElemNum){ TInt anElemId = aPolygoneInfo->GetElemNum(iElem); anElement = myMesh->AddPolygonalFaceWithID(aNodeIds,anElemId); @@ -207,12 +221,13 @@ DriverMED_R_SMESHDS_Mesh anElement = myMesh->AddPolygonalFace(aNodes); isRenum = anIsElemNum; } +#ifndef _DEXCEPT_ }catch(const std::exception& exc){ aResult = DRS_FAIL; }catch (...){ aResult = DRS_FAIL; } - +#endif if(!anElement){ aResult = DRS_WARN_SKIP_ELEM; }else{ @@ -265,7 +280,9 @@ DriverMED_R_SMESHDS_Mesh SMDS_MeshElement* anElement = NULL; TInt aFamNum = aPolyedreInfo->GetFamNum(iElem); +#ifndef _DEXCEPT_ try{ +#endif if(anIsElemNum){ TInt anElemId = aPolyedreInfo->GetElemNum(iElem); anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId); @@ -277,12 +294,13 @@ DriverMED_R_SMESHDS_Mesh anElement = myMesh->AddPolyhedralVolume(aNodes,aQuantities); isRenum = anIsElemNum; } +#ifndef _DEXCEPT_ }catch(const std::exception& exc){ aResult = DRS_FAIL; }catch(...){ aResult = DRS_FAIL; } - +#endif if(!anElement){ aResult = DRS_WARN_SKIP_ELEM; }else{ @@ -302,238 +320,388 @@ DriverMED_R_SMESHDS_Mesh break; } default: { - PCellInfo aCellInfo = aMed->GetPCellInfo(aMeshInfo,anEntity,aGeom); - EBooleen anIsElemNum = takeNumbers ? aCellInfo->IsElemNum() : eFAUX; - TInt aNbElems = aCellInfo->GetNbElem(); - if(MYDEBUG) MESSAGE("Perform - anEntity = "<GetFamNum(iElem); - try{ - //MESSAGE("Try to create element # " << iElem << " with id = " - // << aCellInfo->GetElemNum(iElem)); - switch(aGeom){ - case eSEG2: - case eSEG3: - if(anIsElemNum) - anElement = myMesh->AddEdgeWithID(aNodeIds[0], - aNodeIds[1], - aCellInfo->GetElemNum(iElem)); - if (!anElement) { - anElement = myMesh->AddEdge(FindNode(myMesh,aNodeIds[0]), - FindNode(myMesh,aNodeIds[1])); - isRenum = anIsElemNum; - } - break; - case eTRIA3: - case eTRIA6: - aNbNodes = 3; - if(anIsElemNum) - anElement = myMesh->AddFaceWithID(aNodeIds[0], - aNodeIds[1], - aNodeIds[2], - aCellInfo->GetElemNum(iElem)); - if (!anElement) { - anElement = myMesh->AddFace(FindNode(myMesh,aNodeIds[0]), - FindNode(myMesh,aNodeIds[1]), - FindNode(myMesh,aNodeIds[2])); - isRenum = anIsElemNum; - } - break; - case eQUAD4: - case eQUAD8: - aNbNodes = 4; - // There is some differnce between SMDS and MED - if(anIsElemNum) - anElement = myMesh->AddFaceWithID(aNodeIds[0], - aNodeIds[1], - aNodeIds[2], - aNodeIds[3], - aCellInfo->GetElemNum(iElem)); - if (!anElement) { - anElement = myMesh->AddFace(FindNode(myMesh,aNodeIds[0]), - FindNode(myMesh,aNodeIds[1]), - FindNode(myMesh,aNodeIds[2]), - FindNode(myMesh,aNodeIds[3])); - isRenum = anIsElemNum; - } - break; - case eTETRA4: - case eTETRA10: - aNbNodes = 4; - if(anIsElemNum) - anElement = myMesh->AddVolumeWithID(aNodeIds[0], - aNodeIds[1], - aNodeIds[2], - aNodeIds[3], - aCellInfo->GetElemNum(iElem)); - if (!anElement) { - anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]), - FindNode(myMesh,aNodeIds[1]), - FindNode(myMesh,aNodeIds[2]), - FindNode(myMesh,aNodeIds[3])); - isRenum = anIsElemNum; - } - break; - case ePYRA5: - case ePYRA13: - aNbNodes = 5; - // There is some differnce between SMDS and MED - if(anIsElemNum) - anElement = myMesh->AddVolumeWithID(aNodeIds[0], - aNodeIds[1], - aNodeIds[2], - aNodeIds[3], - aNodeIds[4], - aCellInfo->GetElemNum(iElem)); - if (!anElement) { - anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]), - FindNode(myMesh,aNodeIds[1]), - FindNode(myMesh,aNodeIds[2]), - FindNode(myMesh,aNodeIds[3]), - FindNode(myMesh,aNodeIds[4])); - isRenum = anIsElemNum; - } - break; - case ePENTA6: - case ePENTA15: - aNbNodes = 6; - if(anIsElemNum) - anElement = myMesh->AddVolumeWithID(aNodeIds[0], - aNodeIds[1], - aNodeIds[2], - aNodeIds[3], - aNodeIds[4], - aNodeIds[5], - aCellInfo->GetElemNum(iElem)); - if (!anElement) { - anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]), - FindNode(myMesh,aNodeIds[1]), - FindNode(myMesh,aNodeIds[2]), - FindNode(myMesh,aNodeIds[3]), - FindNode(myMesh,aNodeIds[4]), - FindNode(myMesh,aNodeIds[5])); - isRenum = anIsElemNum; - } - break; - case eHEXA8: - case eHEXA20: - aNbNodes = 8; - if(anIsElemNum) - anElement = myMesh->AddVolumeWithID(aNodeIds[0], - aNodeIds[1], - aNodeIds[2], - aNodeIds[3], - aNodeIds[4], - aNodeIds[5], - aNodeIds[6], - aNodeIds[7], - aCellInfo->GetElemNum(iElem)); - if (!anElement) { - anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]), - FindNode(myMesh,aNodeIds[1]), - FindNode(myMesh,aNodeIds[2]), - FindNode(myMesh,aNodeIds[3]), - FindNode(myMesh,aNodeIds[4]), - FindNode(myMesh,aNodeIds[5]), - FindNode(myMesh,aNodeIds[6]), - FindNode(myMesh,aNodeIds[7])); - isRenum = anIsElemNum; - } - break; - } - }catch(const std::exception& exc){ - //INFOS("Follow exception was cought:\n\t"<AddElement(anElement); - myFamilies[aFamNum]->SetType(anElement->GetType()); - } - } - } - }} - } - } + anIsValidConnect = true; +#ifndef _DEXCEPT_ + }catch(const std::exception& exc){ + //INFOS("Follow exception was cought:\n\t"<GetFamNum(iElem); +#ifndef _DEXCEPT_ + try{ +#endif + //MESSAGE("Try to create element # " << iElem << " with id = " + // << aCellInfo->GetElemNum(iElem)); + switch(aGeom){ + case eSEG2: + if(anIsElemNum) + anElement = myMesh->AddEdgeWithID(aNodeIds[0], + aNodeIds[1], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddEdge(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1])); + isRenum = anIsElemNum; + } + break; + case eSEG3: + if(anIsElemNum) + anElement = myMesh->AddEdgeWithID(aNodeIds[0], + aNodeIds[1], + aNodeIds[2], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddEdge(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1]), + FindNode(myMesh,aNodeIds[2])); + isRenum = anIsElemNum; + } + break; + case eTRIA3: + aNbNodes = 3; + if(anIsElemNum) + anElement = myMesh->AddFaceWithID(aNodeIds[0], + aNodeIds[1], + aNodeIds[2], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddFace(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1]), + FindNode(myMesh,aNodeIds[2])); + isRenum = anIsElemNum; + } + break; + case eTRIA6: + aNbNodes = 6; + if(anIsElemNum) + anElement = myMesh->AddFaceWithID(aNodeIds[0], aNodeIds[1], + aNodeIds[2], aNodeIds[3], + aNodeIds[4], aNodeIds[5], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddFace(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1]), + FindNode(myMesh,aNodeIds[2]), + FindNode(myMesh,aNodeIds[3]), + FindNode(myMesh,aNodeIds[4]), + FindNode(myMesh,aNodeIds[5])); + isRenum = anIsElemNum; + } + break; + case eQUAD4: + aNbNodes = 4; + if(anIsElemNum) + anElement = myMesh->AddFaceWithID(aNodeIds[0], aNodeIds[1], + aNodeIds[2], aNodeIds[3], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddFace(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1]), + FindNode(myMesh,aNodeIds[2]), + FindNode(myMesh,aNodeIds[3])); + isRenum = anIsElemNum; + } + break; + case eQUAD8: + aNbNodes = 8; + if(anIsElemNum) + anElement = myMesh->AddFaceWithID(aNodeIds[0], aNodeIds[1], + aNodeIds[2], aNodeIds[3], + aNodeIds[4], aNodeIds[5], + aNodeIds[6], aNodeIds[7], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddFace(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1]), + FindNode(myMesh,aNodeIds[2]), + FindNode(myMesh,aNodeIds[3]), + FindNode(myMesh,aNodeIds[4]), + FindNode(myMesh,aNodeIds[5]), + FindNode(myMesh,aNodeIds[6]), + FindNode(myMesh,aNodeIds[7])); + isRenum = anIsElemNum; + } + break; + case eTETRA4: + aNbNodes = 4; + if(anIsElemNum) + anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1], + aNodeIds[2], aNodeIds[3], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1]), + FindNode(myMesh,aNodeIds[2]), + FindNode(myMesh,aNodeIds[3])); + isRenum = anIsElemNum; + } + break; + case eTETRA10: + aNbNodes = 10; + if(anIsElemNum) + anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1], + aNodeIds[2], aNodeIds[3], + aNodeIds[4], aNodeIds[5], + aNodeIds[6], aNodeIds[7], + aNodeIds[8], aNodeIds[9], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1]), + FindNode(myMesh,aNodeIds[2]), + FindNode(myMesh,aNodeIds[3]), + FindNode(myMesh,aNodeIds[4]), + FindNode(myMesh,aNodeIds[5]), + FindNode(myMesh,aNodeIds[6]), + FindNode(myMesh,aNodeIds[7]), + FindNode(myMesh,aNodeIds[8]), + FindNode(myMesh,aNodeIds[9])); + isRenum = anIsElemNum; + } + break; + case ePYRA5: + aNbNodes = 5; + // There is some differnce between SMDS and MED + if(anIsElemNum) + anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1], + aNodeIds[2], aNodeIds[3], + aNodeIds[4], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1]), + FindNode(myMesh,aNodeIds[2]), + FindNode(myMesh,aNodeIds[3]), + FindNode(myMesh,aNodeIds[4])); + isRenum = anIsElemNum; + } + break; + case ePYRA13: + aNbNodes = 13; + // There is some differnce between SMDS and MED + if(anIsElemNum) + anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1], + aNodeIds[2], aNodeIds[3], + aNodeIds[4], aNodeIds[5], + aNodeIds[6], aNodeIds[7], + aNodeIds[8], aNodeIds[9], + aNodeIds[10], aNodeIds[11], + aNodeIds[12], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1]), + FindNode(myMesh,aNodeIds[2]), + FindNode(myMesh,aNodeIds[3]), + FindNode(myMesh,aNodeIds[4]), + FindNode(myMesh,aNodeIds[5]), + FindNode(myMesh,aNodeIds[6]), + FindNode(myMesh,aNodeIds[7]), + FindNode(myMesh,aNodeIds[8]), + FindNode(myMesh,aNodeIds[9]), + FindNode(myMesh,aNodeIds[10]), + FindNode(myMesh,aNodeIds[11]), + FindNode(myMesh,aNodeIds[12])); + isRenum = anIsElemNum; + } + break; + case ePENTA6: + aNbNodes = 6; + if(anIsElemNum) + anElement = myMesh->AddVolumeWithID(aNodeIds[0], + aNodeIds[1], + aNodeIds[2], + aNodeIds[3], + aNodeIds[4], + aNodeIds[5], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1]), + FindNode(myMesh,aNodeIds[2]), + FindNode(myMesh,aNodeIds[3]), + FindNode(myMesh,aNodeIds[4]), + FindNode(myMesh,aNodeIds[5])); + isRenum = anIsElemNum; + } + break; + case ePENTA15: + aNbNodes = 15; + if(anIsElemNum) + anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1], + aNodeIds[2], aNodeIds[3], + aNodeIds[4], aNodeIds[5], + aNodeIds[6], aNodeIds[7], + aNodeIds[8], aNodeIds[9], + aNodeIds[10], aNodeIds[11], + aNodeIds[12], aNodeIds[13], + aNodeIds[14], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1]), + FindNode(myMesh,aNodeIds[2]), + FindNode(myMesh,aNodeIds[3]), + FindNode(myMesh,aNodeIds[4]), + FindNode(myMesh,aNodeIds[5]), + FindNode(myMesh,aNodeIds[6]), + FindNode(myMesh,aNodeIds[7]), + FindNode(myMesh,aNodeIds[8]), + FindNode(myMesh,aNodeIds[9]), + FindNode(myMesh,aNodeIds[10]), + FindNode(myMesh,aNodeIds[11]), + FindNode(myMesh,aNodeIds[12]), + FindNode(myMesh,aNodeIds[13]), + FindNode(myMesh,aNodeIds[14])); + isRenum = anIsElemNum; + } + break; + case eHEXA8: + aNbNodes = 8; + if(anIsElemNum) + anElement = myMesh->AddVolumeWithID(aNodeIds[0], + aNodeIds[1], + aNodeIds[2], + aNodeIds[3], + aNodeIds[4], + aNodeIds[5], + aNodeIds[6], + aNodeIds[7], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1]), + FindNode(myMesh,aNodeIds[2]), + FindNode(myMesh,aNodeIds[3]), + FindNode(myMesh,aNodeIds[4]), + FindNode(myMesh,aNodeIds[5]), + FindNode(myMesh,aNodeIds[6]), + FindNode(myMesh,aNodeIds[7])); + isRenum = anIsElemNum; + } + break; + case eHEXA20: + aNbNodes = 20; + if(anIsElemNum) + anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1], + aNodeIds[2], aNodeIds[3], + aNodeIds[4], aNodeIds[5], + aNodeIds[6], aNodeIds[7], + aNodeIds[8], aNodeIds[9], + aNodeIds[10], aNodeIds[11], + aNodeIds[12], aNodeIds[13], + aNodeIds[14], aNodeIds[15], + aNodeIds[16], aNodeIds[17], + aNodeIds[18], aNodeIds[19], + aCellInfo->GetElemNum(iElem)); + if (!anElement) { + anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]), + FindNode(myMesh,aNodeIds[1]), + FindNode(myMesh,aNodeIds[2]), + FindNode(myMesh,aNodeIds[3]), + FindNode(myMesh,aNodeIds[4]), + FindNode(myMesh,aNodeIds[5]), + FindNode(myMesh,aNodeIds[6]), + FindNode(myMesh,aNodeIds[7]), + FindNode(myMesh,aNodeIds[8]), + FindNode(myMesh,aNodeIds[9]), + FindNode(myMesh,aNodeIds[10]), + FindNode(myMesh,aNodeIds[11]), + FindNode(myMesh,aNodeIds[12]), + FindNode(myMesh,aNodeIds[13]), + FindNode(myMesh,aNodeIds[14]), + FindNode(myMesh,aNodeIds[15]), + FindNode(myMesh,aNodeIds[16]), + FindNode(myMesh,aNodeIds[17]), + FindNode(myMesh,aNodeIds[18]), + FindNode(myMesh,aNodeIds[19])); + isRenum = anIsElemNum; + } + break; + } +#ifndef _DEXCEPT_ + }catch(const std::exception& exc){ + //INFOS("Follow exception was cought:\n\t"<AddElement(anElement); + myFamilies[aFamNum]->SetType(anElement->GetType()); + } + } + } + }} + } + } } } +#ifndef _DEXCEPT_ }catch(const std::exception& exc){ INFOS("Follow exception was cought:\n\t"<edgesIterator(); - TInt aNbConnectivity = MED::GetNbNodes(eSEG2); - MED::TIntVector anElemNums(aNbElems); - MED::TIntVector aFamilyNums(aNbElems); - MED::TIntVector aConnectivity(aNbElems*aNbConnectivity); - - for(TInt iElem = 0, iConn = 0; anIter->more(); iElem++, iConn+=aNbConnectivity){ + while ( anIter->more() ) + if ( anIter->next()->NbNodes() == 3 ) + ++aNbSeg3; + aNbSeg2 = aNbElems - aNbSeg3; + + TInt aNbSeg2Conn = MED::GetNbNodes(eSEG2); + MED::TIntVector aSeg2ElemNums, aSeg2FamilyNums, aSeg2Conn; + aSeg2ElemNums .reserve( aNbSeg2 ); + aSeg2FamilyNums.reserve( aNbSeg2 ); + aSeg2Conn .reserve( aNbSeg2*aNbSeg2Conn ); + + TInt aNbSeg3Conn = MED::GetNbNodes(eSEG3); + MED::TIntVector aSeg3ElemNums, aSeg3FamilyNums, aSeg3Conn; + aSeg3ElemNums .reserve( aNbSeg3 ); + aSeg3FamilyNums.reserve( aNbSeg3 ); + aSeg3Conn .reserve( aNbSeg3*aNbSeg3Conn ); + + anIter = myMesh->edgesIterator(); + while ( anIter->more() ) { const SMDS_MeshEdge* anElem = anIter->next(); - SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator(); - for(TInt iNode = 0; iNode < aNbConnectivity && aNodesIter->more(); iNode++){ - const SMDS_MeshElement* aNode = aNodesIter->next(); + TInt aNbNodes = anElem->NbNodes(); + + TInt aNbConnectivity; + MED::TIntVector* anElemNums; + MED::TIntVector* aFamilyNums; + MED::TIntVector* aConnectivity; + switch(aNbNodes){ + case 2: + aNbConnectivity = aNbSeg2Conn; + anElemNums = &aSeg2ElemNums; + aFamilyNums = &aSeg2FamilyNums; + aConnectivity = &aSeg2Conn; + break; + case 3: + aNbConnectivity = aNbSeg3Conn; + anElemNums = &aSeg3ElemNums; + aFamilyNums = &aSeg3FamilyNums; + aConnectivity = &aSeg3Conn; + break; + default: + break; + } + + for(TInt iNode = 0; iNode < aNbNodes; iNode++) { + const SMDS_MeshElement* aNode = anElem->GetNode( iNode ); #ifdef _EDF_NODE_IDS_ - aConnectivity[iConn+iNode] = aNodeIdMap[aNode->GetID()]; + aConnectivity->push_back( aNodeIdMap[aNode->GetID()] ); #else - aConnectivity[iConn+iNode] = aNode->GetID(); + aConnectivity->push_back( aNode->GetID() ); #endif - } - anElemNums[iElem] = anElem->GetID(); + } - if (anElemFamMap.find(anElem) != anElemFamMap.end()) - aFamilyNums[iElem] = anElemFamMap[anElem]; + anElemNums->push_back(anElem->GetID()); + + map::iterator edge_fam = anElemFamMap.find( anElem ); + if ( edge_fam != anElemFamMap.end() ) + aFamilyNums->push_back( edge_fam->second ); else - aFamilyNums[iElem] = myEdgesDefaultFamilyId; + aFamilyNums->push_back( myFacesDefaultFamilyId ); } - PCellInfo aCellInfo = myMed->CrCellInfo(aMeshInfo, - SMDS_MED_ENTITY, - eSEG2, - aConnectivity, - SMDS_MED_CONNECTIVITY, - aFamilyNums, - anElemNums); - myMed->SetCellInfo(aCellInfo); + if ( aNbSeg2 ) { + PCellInfo aCellInfo = myMed->CrCellInfo(aMeshInfo, + SMDS_MED_ENTITY, + eSEG2, + aSeg2Conn, + SMDS_MED_CONNECTIVITY, + aSeg2FamilyNums, + aSeg2ElemNums); + myMed->SetCellInfo(aCellInfo); + } + if ( aNbSeg3 ) { + PCellInfo aCellInfo = myMed->CrCellInfo(aMeshInfo, + SMDS_MED_ENTITY, + eSEG3, + aSeg3Conn, + SMDS_MED_CONNECTIVITY, + aSeg3FamilyNums, + aSeg3ElemNums); + myMed->SetCellInfo(aCellInfo); + } } // Storing SMDS Faces @@ -442,6 +493,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() MED::TIntVector aTriaConn; aTriaConn.reserve(aNbElems*aNbTriaConn); + TInt aNbTria6Conn = MED::GetNbNodes(eTRIA6); + MED::TIntVector anTria6ElemNums; + anTria6ElemNums.reserve(aNbElems); + MED::TIntVector aTria6FamilyNums; + aTria6FamilyNums.reserve(aNbElems); + MED::TIntVector aTria6Conn; + aTria6Conn.reserve(aNbElems*aNbTria6Conn); + TInt aNbQuadConn = MED::GetNbNodes(eQUAD4); MED::TIntVector aQuadElemNums; aQuadElemNums.reserve(aNbElems); @@ -450,6 +509,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() MED::TIntVector aQuadConn; aQuadConn.reserve(aNbElems*aNbQuadConn); + TInt aNbQuad8Conn = MED::GetNbNodes(eQUAD8); + MED::TIntVector aQuad8ElemNums; + aQuad8ElemNums.reserve(aNbElems); + MED::TIntVector aQuad8FamilyNums; + aQuad8FamilyNums.reserve(aNbElems); + MED::TIntVector aQuad8Conn; + aQuad8Conn.reserve(aNbElems*aNbQuad8Conn); + MED::TIntVector aPolygoneElemNums; aPolygoneElemNums.reserve(aNbElems); MED::TIntVector aPolygoneInds; @@ -473,7 +540,8 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() anElemNums = &aPolygoneElemNums; aFamilyNums = &aPolygoneFamilyNums; aConnectivity = &aPolygoneConn; - } else { + } + else { switch(aNbNodes){ case 3: aNbConnectivity = aNbTriaConn; @@ -487,6 +555,18 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() aFamilyNums = &aQuadFamilyNums; aConnectivity = &aQuadConn; break; + case 6: + aNbConnectivity = aNbTria6Conn; + anElemNums = &anTria6ElemNums; + aFamilyNums = &aTria6FamilyNums; + aConnectivity = &aTria6Conn; + break; + case 8: + aNbConnectivity = aNbQuad8Conn; + anElemNums = &aQuad8ElemNums; + aFamilyNums = &aQuad8FamilyNums; + aConnectivity = &aQuad8Conn; + break; default: break; } @@ -550,6 +630,28 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() MESSAGE("Perform - anEntity = "< #include diff --git a/src/DriverSTL/DriverSTL_R_SMDS_Mesh.h b/src/DriverSTL/DriverSTL_R_SMDS_Mesh.h index 078e88e18..5253bf074 100644 --- a/src/DriverSTL/DriverSTL_R_SMDS_Mesh.h +++ b/src/DriverSTL/DriverSTL_R_SMDS_Mesh.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _INCLUDE_DRIVERSTL_R_SMDS_MESH #define _INCLUDE_DRIVERSTL_R_SMDS_MESH diff --git a/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cxx b/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cxx index 04ce4058a..8b2ed581b 100644 --- a/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cxx +++ b/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include @@ -228,7 +228,7 @@ Driver_Mesh::Status DriverSTL_W_SMDS_Mesh::writeBinary() const } // write number of triangles - unsigned int NBT = nbTri; + //unsigned int NBT = nbTri; aFile.Write((Standard_Address)sval,LABEL_SIZE); writeInteger(nbTri,aFile); diff --git a/src/DriverSTL/DriverSTL_W_SMDS_Mesh.h b/src/DriverSTL/DriverSTL_W_SMDS_Mesh.h index 30fb26ec6..e320415ff 100644 --- a/src/DriverSTL/DriverSTL_W_SMDS_Mesh.h +++ b/src/DriverSTL/DriverSTL_W_SMDS_Mesh.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/DriverSTL/Makefile.in b/src/DriverSTL/Makefile.in index 558ae2d31..76c594f62 100644 --- a/src/DriverSTL/Makefile.in +++ b/src/DriverSTL/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -49,11 +49,11 @@ LIB_CLIENT_IDL = LIB_SERVER_IDL = # additionnal information to compil and link file -CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) -CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome +CPPFLAGS += $(OCC_INCLUDES) $(KERNEL_CXXFLAGS) $(BOOST_CPPFLAGS) +CXXFLAGS += $(OCC_CXXFLAGS) $(KERNEL_CXXFLAGS) LDFLAGS += $(OCC_KERNEL_LIBS) -lMeshDriver -lTKSTL -lTKTopAlgo -lTKMesh -LDFLAGSFORBIN += -lMeshDriver -lSMDS -L${KERNEL_ROOT_DIR}/lib/salome -lOpUtil -lSALOMELocalTrace -lSALOMEBasics $(OCC_KERNEL_LIBS) -lTKSTL -lTKTopAlgo -lTKMesh -lTKBO +LDFLAGSFORBIN += -lMeshDriver -lSMDS $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics $(OCC_KERNEL_LIBS) -lTKSTL -lTKTopAlgo -lTKMesh -lTKBO @CONCLUDE@ diff --git a/src/DriverSTL/STL_Test.cxx b/src/DriverSTL/STL_Test.cxx index 78dc0df71..95a2e2d6b 100644 --- a/src/DriverSTL/STL_Test.cxx +++ b/src/DriverSTL/STL_Test.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com //#include "DriverSTL_R_SMDS_Mesh.h" #include "DriverSTL_W_SMDS_Mesh.h" diff --git a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx index 12c091632..77a439a7d 100644 --- a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx @@ -15,15 +15,17 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "DriverUNV_R_SMDS_Mesh.h" #include "SMDS_Mesh.hxx" +#include "SMDS_MeshGroup.hxx" #include "utilities.h" #include "UNV2411_Structure.hxx" #include "UNV2412_Structure.hxx" +#include "UNV2417_Structure.hxx" #include "UNV_Utilities.hxx" using namespace std; @@ -36,6 +38,13 @@ static int MYDEBUG = 0; #endif +DriverUNV_R_SMDS_Mesh::~DriverUNV_R_SMDS_Mesh() +{ + if (myGroup != 0) + delete myGroup; +} + + Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() { Status aResult = DRS_OK; @@ -64,11 +73,21 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() SMDS_MeshElement* anElement = NULL; const TElementLab& aLabel = anIter->first; const TRecord& aRec = anIter->second; - if(IsBeam(aRec.fe_descriptor_id)){ - anElement = myMesh->AddEdgeWithID(aRec.node_labels[0], - aRec.node_labels[1], - aLabel); - }else if(IsFace(aRec.fe_descriptor_id)){ + if(IsBeam(aRec.fe_descriptor_id)) { + switch ( aRec.node_labels.size() ) { + case 2: // edge with two nodes + anElement = myMesh->AddEdgeWithID(aRec.node_labels[0], + aRec.node_labels[1], + aLabel); + break; + case 3: // quadratic edge (with 3 nodes) + anElement = myMesh->AddEdgeWithID(aRec.node_labels[0], + aRec.node_labels[2], + aRec.node_labels[1], + aLabel); + } + } + else if(IsFace(aRec.fe_descriptor_id)) { switch(aRec.fe_descriptor_id){ case 71: // TRI3 case 72: @@ -76,43 +95,75 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() case 41: // Plane Stress Linear Triangle - TRI3 case 91: // Thin Shell Linear Triangle - TRI3 + anElement = myMesh->AddFaceWithID(aRec.node_labels[0], + aRec.node_labels[1], + aRec.node_labels[2], + aLabel); + break; case 42: // Plane Stress Quadratic Triangle - TRI6 case 92: // Thin Shell Quadratic Triangle - TRI6 - anElement = myMesh->AddFaceWithID(aRec.node_labels[0], - aRec.node_labels[1], aRec.node_labels[2], + aRec.node_labels[4], + aRec.node_labels[1], + aRec.node_labels[3], + aRec.node_labels[5], aLabel); break; case 44: // Plane Stress Linear Quadrilateral - QUAD4 case 94: // Thin Shell Linear Quadrilateral - QUAD4 + anElement = myMesh->AddFaceWithID(aRec.node_labels[0], + aRec.node_labels[1], + aRec.node_labels[2], + aRec.node_labels[3], + aLabel); + break; case 45: // Plane Stress Quadratic Quadrilateral - QUAD8 case 95: // Thin Shell Quadratic Quadrilateral - QUAD8 anElement = myMesh->AddFaceWithID(aRec.node_labels[0], - aRec.node_labels[1], aRec.node_labels[2], + aRec.node_labels[4], + aRec.node_labels[6], + aRec.node_labels[1], aRec.node_labels[3], + aRec.node_labels[5], + aRec.node_labels[7], aLabel); break; } - }else if(IsVolume(aRec.fe_descriptor_id)){ + } + else if(IsVolume(aRec.fe_descriptor_id)){ switch(aRec.fe_descriptor_id){ case 111: // Solid Linear Tetrahedron - TET4 - case 118: // Solid Quadratic Tetrahedron - TET10 - anElement = myMesh->AddVolumeWithID(aRec.node_labels[0], aRec.node_labels[2], aRec.node_labels[1], aRec.node_labels[3], aLabel); break; + + case 118: // Solid Quadratic Tetrahedron - TET10 + anElement = myMesh->AddVolumeWithID(aRec.node_labels[0], + aRec.node_labels[4], + aRec.node_labels[2], + + aRec.node_labels[9], + + aRec.node_labels[5], + aRec.node_labels[3], + aRec.node_labels[1], + + aRec.node_labels[6], + aRec.node_labels[8], + aRec.node_labels[7], + aLabel); + break; case 112: // Solid Linear Prism - PRISM6 - anElement = myMesh->AddVolumeWithID(aRec.node_labels[0], aRec.node_labels[2], aRec.node_labels[1], @@ -123,13 +174,25 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() break; case 113: // Solid Quadratic Prism - PRISM15 - anElement = myMesh->AddVolumeWithID(aRec.node_labels[0], aRec.node_labels[4], aRec.node_labels[2], + aRec.node_labels[9], aRec.node_labels[13], aRec.node_labels[11], + + aRec.node_labels[5], + aRec.node_labels[3], + aRec.node_labels[1], + + aRec.node_labels[14], + aRec.node_labels[12], + aRec.node_labels[10], + + aRec.node_labels[6], + aRec.node_labels[8], + aRec.node_labels[7], aLabel); break; @@ -146,26 +209,142 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() break; case 116: // Solid Quadratic Brick - HEX20 - anElement = myMesh->AddVolumeWithID(aRec.node_labels[0], aRec.node_labels[6], aRec.node_labels[4], aRec.node_labels[2], + aRec.node_labels[12], aRec.node_labels[18], aRec.node_labels[16], aRec.node_labels[14], + + aRec.node_labels[7], + aRec.node_labels[5], + aRec.node_labels[3], + aRec.node_labels[1], + + aRec.node_labels[19], + aRec.node_labels[17], + aRec.node_labels[15], + aRec.node_labels[13], + + aRec.node_labels[8], + aRec.node_labels[11], + aRec.node_labels[10], + aRec.node_labels[9], + aLabel); + break; + + case 114: // pyramid of 13 nodes (quadratic) - PIRA13 + anElement = myMesh->AddVolumeWithID(aRec.node_labels[0], + aRec.node_labels[6], + aRec.node_labels[4], + aRec.node_labels[2], + aRec.node_labels[7], + aRec.node_labels[5], + aRec.node_labels[3], + aRec.node_labels[1], + + aRec.node_labels[8], + aRec.node_labels[11], + aRec.node_labels[10], + aRec.node_labels[9], + aRec.node_labels[12], aLabel); break; + } } - if(!anElement) - MESSAGE("DriverUNV_R_SMDS_Mesh::Perform - can not add element with ID = "<FindNode(aRec.NodeList[i]); + if (aNode) + aNodesGroup->Add(aNode); + } + } + if (aElementsNb > 0){ + SMDS_MeshGroup* aEdgesGroup = 0; + SMDS_MeshGroup* aFacesGroup = 0; + SMDS_MeshGroup* aVolumeGroup = 0; + bool createdGroup = false; + + for (i = 0; i < aElementsNb; i++) { + const SMDS_MeshElement* aElement = myMesh->FindElement(aRec.ElementList[i]); + if (aElement) { + switch (aElement->GetType()) { + case SMDSAbs_Edge: + if (!aEdgesGroup) { + aEdgesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Edge); + if (!useSuffix && createdGroup) useSuffix = true; + std::string aEdgesGrName = (useSuffix) ? aRec.GroupName + "_Edges" : aRec.GroupName; + myGroupNames.insert(TGroupNamesMap::value_type(aEdgesGroup, aEdgesGrName)); + myGroupId.insert(TGroupIdMap::value_type(aEdgesGroup, aLabel)); + createdGroup = true; + } + aEdgesGroup->Add(aElement); + break; + case SMDSAbs_Face: + if (!aFacesGroup) { + aFacesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Face); + if (!useSuffix && createdGroup) useSuffix = true; + std::string aFacesGrName = (useSuffix) ? aRec.GroupName + "_Faces" : aRec.GroupName; + myGroupNames.insert(TGroupNamesMap::value_type(aFacesGroup, aFacesGrName)); + myGroupId.insert(TGroupIdMap::value_type(aFacesGroup, aLabel)); + createdGroup = true; + } + aFacesGroup->Add(aElement); + break; + case SMDSAbs_Volume: + if (!aVolumeGroup) { + aVolumeGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Volume); + if (!useSuffix && createdGroup) useSuffix = true; + std::string aVolumeGrName = (useSuffix) ? aRec.GroupName + "_Volumes" : aRec.GroupName; + myGroupNames.insert(TGroupNamesMap::value_type(aVolumeGroup, aVolumeGrName)); + myGroupId.insert(TGroupIdMap::value_type(aVolumeGroup, aLabel)); + createdGroup = true; + } + aVolumeGroup->Add(aElement); + break; + } + } + } + } + } + } + } + } + catch(const std::exception& exc){ INFOS("Follow exception was cought:\n\t"< +#include + class SMDS_Mesh; +class SMDS_MeshGroup; + + +typedef std::map TGroupNamesMap; +typedef std::map TGroupIdMap; class MESHDRIVERUNV_EXPORT DriverUNV_R_SMDS_Mesh: public Driver_SMDS_Mesh { public: + DriverUNV_R_SMDS_Mesh():Driver_SMDS_Mesh(),myGroup(0) {}; + ~DriverUNV_R_SMDS_Mesh(); + virtual Status Perform(); + + const SMDS_MeshGroup* GetGroup() const { return myGroup;} + const TGroupNamesMap& GetGroupNamesMap() const { return myGroupNames; } + const TGroupIdMap& GetGroupIdMap() const { return myGroupId; } + + private: + SMDS_MeshGroup* myGroup; + TGroupNamesMap myGroupNames; + TGroupIdMap myGroupId; }; #endif diff --git a/src/DriverUNV/DriverUNV_R_SMESHDS_Document.cxx b/src/DriverUNV/DriverUNV_R_SMESHDS_Document.cxx index 0e1b871fc..b5560b4dc 100644 --- a/src/DriverUNV/DriverUNV_R_SMESHDS_Document.cxx +++ b/src/DriverUNV/DriverUNV_R_SMESHDS_Document.cxx @@ -15,6 +15,6 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "DriverUNV_R_SMESHDS_Document.h" diff --git a/src/DriverUNV/DriverUNV_R_SMESHDS_Document.h b/src/DriverUNV/DriverUNV_R_SMESHDS_Document.h index 79de1b838..d99847660 100644 --- a/src/DriverUNV/DriverUNV_R_SMESHDS_Document.h +++ b/src/DriverUNV/DriverUNV_R_SMESHDS_Document.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _INCLUDE_DRIVERUNV_R_SMESHDS_DOCUMENT #define _INCLUDE_DRIVERUNV_R_SMESHDS_DOCUMENT diff --git a/src/DriverUNV/DriverUNV_R_SMESHDS_Mesh.cxx b/src/DriverUNV/DriverUNV_R_SMESHDS_Mesh.cxx index e4fcbf3e0..64a0e1a21 100644 --- a/src/DriverUNV/DriverUNV_R_SMESHDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_R_SMESHDS_Mesh.cxx @@ -15,6 +15,6 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "DriverUNV_R_SMESHDS_Mesh.h" diff --git a/src/DriverUNV/DriverUNV_R_SMESHDS_Mesh.h b/src/DriverUNV/DriverUNV_R_SMESHDS_Mesh.h index ef1ceede4..6381ddd08 100644 --- a/src/DriverUNV/DriverUNV_R_SMESHDS_Mesh.h +++ b/src/DriverUNV/DriverUNV_R_SMESHDS_Mesh.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _INCLUDE_DRIVERUNV_R_SMESHDS_MESH #define _INCLUDE_DRIVERUNV_R_SMESHDS_MESH diff --git a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx index 3fe3b18ef..eeb2ff4b8 100644 --- a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx @@ -15,18 +15,23 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include #include "DriverUNV_W_SMDS_Mesh.h" #include "SMDS_Mesh.hxx" +#include "SMESHDS_GroupBase.hxx" +//#include "SMESH_Group.hxx" +#include "SMDS_QuadraticEdge.hxx" +#include "SMDS_QuadraticFaceOfNodes.hxx" #include "utilities.h" #include "UNV2411_Structure.hxx" #include "UNV2412_Structure.hxx" +#include "UNV2417_Structure.hxx" #include "UNV_Utilities.hxx" using namespace std; @@ -86,12 +91,19 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() int aNbNodes = anElem->NbNodes(); TRecord aRec; aRec.node_labels.reserve(aNbNodes); - SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator(); + SMDS_ElemIteratorPtr aNodesIter; + if( anElem->IsQuadratic() ) { + aNodesIter = static_cast + ( anElem )->interlacedNodesElemIterator(); + aRec.fe_descriptor_id = 22; + } else { + aNodesIter = anElem->nodesIterator(); + aRec.fe_descriptor_id = 11; + } for(; aNodesIter->more();){ const SMDS_MeshElement* aNode = aNodesIter->next(); aRec.node_labels.push_back(aNode->GetID()); } - aRec.fe_descriptor_id = 11; aDataSet2412.insert(TDataSet::value_type(aLabel,aRec)); } MESSAGE("Perform - aDataSet2412.size() = "<NbNodes(); TRecord aRec; aRec.node_labels.reserve(aNbNodes); - SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator(); + SMDS_ElemIteratorPtr aNodesIter; + if( anElem->IsQuadratic() ) + aNodesIter = static_cast + ( anElem )->interlacedNodesElemIterator(); + else + aNodesIter = anElem->nodesIterator(); for(; aNodesIter->more();){ const SMDS_MeshElement* aNode = aNodesIter->next(); aRec.node_labels.push_back(aNode->GetID()); @@ -118,6 +135,12 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() case 4: aRec.fe_descriptor_id = 44; break; + case 6: + aRec.fe_descriptor_id = 42; + break; + case 8: + aRec.fe_descriptor_id = 45; + break; default: continue; } @@ -160,6 +183,30 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() anId = 115; break; } + case 10: { + static int anIds[] = {0,4,2,9,5,3, 1,6,8, 7}; + aConn = anIds; + anId = 118; + break; + } + case 13: { + static int anIds[] = {0,6,4,2,7,5,3,1,8,11,10,9,12}; + aConn = anIds; + anId = 114; + break; + } + case 15: { + static int anIds[] = {0,4,2,9,13,11,5,3,1,14,12,10,6,8,7}; + aConn = anIds; + anId = 113; + break; + } + case 20: { + static int anIds[] = {0,6, 4,2, 12,18,16,14,7, 5, 3, 1, 19,17,15,13,8, 11,10,9}; + aConn = anIds; + anId = 116; + break; + } default: continue; } @@ -177,9 +224,79 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() } UNV2412::Write(out_stream,aDataSet2412); } - }catch(const std::exception& exc){ + { + using namespace UNV2417; + if (myGroups.size() > 0) { + TDataSet aDataSet2417; + TGroupList::const_iterator aIter = myGroups.begin(); + for (; aIter != myGroups.end(); aIter++) { + SMESHDS_GroupBase* aGroupDS = *aIter; + TRecord aRec; + aRec.GroupName = aGroupDS->GetStoreName(); + + int i; + SMDS_ElemIteratorPtr aIter = aGroupDS->GetElements(); + if (aGroupDS->GetType() == SMDSAbs_Node) { + aRec.NodeList.resize(aGroupDS->Extent()); + i = 0; + while (aIter->more()) { + const SMDS_MeshElement* aElem = aIter->next(); + aRec.NodeList[i] = aElem->GetID(); + i++; + } + } else { + aRec.ElementList.resize(aGroupDS->Extent()); + i = 0; + while (aIter->more()) { + const SMDS_MeshElement* aElem = aIter->next(); + aRec.ElementList[i] = aElem->GetID(); + i++; + } + } + aDataSet2417.insert(TDataSet::value_type(aGroupDS->GetID(), aRec)); + } + UNV2417::Write(out_stream,aDataSet2417); + myGroups.clear(); + } + } + /* { + using namespace UNV2417; + TDataSet aDataSet2417; + for ( TGroupsMap::iterator it = myGroupsMap.begin(); it != myGroupsMap.end(); it++ ) { + SMESH_Group* aGroup = it->second; + SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS(); + if ( aGroupDS ) { + TRecord aRec; + aRec.GroupName = aGroup->GetName(); + int i; + SMDS_ElemIteratorPtr aIter = aGroupDS->GetElements(); + if (aGroupDS->GetType() == SMDSAbs_Node) { + aRec.NodeList.resize(aGroupDS->Extent()); + i = 0; + while (aIter->more()) { + const SMDS_MeshElement* aElem = aIter->next(); + aRec.NodeList[i] = aElem->GetID(); + i++; + } + } else { + aRec.ElementList.resize(aGroupDS->Extent()); + i = 0; + while (aIter->more()) { + const SMDS_MeshElement* aElem = aIter->next(); + aRec.ElementList[i] = aElem->GetID(); + i++; + } + } + aDataSet2417.insert(TDataSet::value_type(aGroupDS->GetID(), aRec)); + } + } + UNV2417::Write(out_stream,aDataSet2417); + }*/ + } + catch(const std::exception& exc){ INFOS("Follow exception was cought:\n\t"< + + +typedef std::list TGroupList; class MESHDRIVERUNV_EXPORT DriverUNV_W_SMDS_Mesh: public Driver_SMDS_Mesh { public: virtual Status Perform(); + + void AddGroup(SMESHDS_GroupBase* theGroup) { myGroups.push_back(theGroup); } + + private: + TGroupList myGroups; }; diff --git a/src/DriverUNV/DriverUNV_W_SMESHDS_Document.cxx b/src/DriverUNV/DriverUNV_W_SMESHDS_Document.cxx index 0e73e1cae..f2070fabd 100644 --- a/src/DriverUNV/DriverUNV_W_SMESHDS_Document.cxx +++ b/src/DriverUNV/DriverUNV_W_SMESHDS_Document.cxx @@ -15,6 +15,6 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "DriverUNV_W_SMESHDS_Document.h" diff --git a/src/DriverUNV/DriverUNV_W_SMESHDS_Document.h b/src/DriverUNV/DriverUNV_W_SMESHDS_Document.h index d16410172..10575d3a8 100644 --- a/src/DriverUNV/DriverUNV_W_SMESHDS_Document.h +++ b/src/DriverUNV/DriverUNV_W_SMESHDS_Document.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _INCLUDE_DRIVERUNV_W_SMESHDS_DOCUMENT #define _INCLUDE_DRIVERUNV_W_SMESHDS_DOCUMENT diff --git a/src/DriverUNV/DriverUNV_W_SMESHDS_Mesh.cxx b/src/DriverUNV/DriverUNV_W_SMESHDS_Mesh.cxx index 2cbfe4dc9..c9c7d3ee7 100644 --- a/src/DriverUNV/DriverUNV_W_SMESHDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_W_SMESHDS_Mesh.cxx @@ -15,6 +15,6 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "DriverUNV_W_SMESHDS_Mesh.h" diff --git a/src/DriverUNV/DriverUNV_W_SMESHDS_Mesh.h b/src/DriverUNV/DriverUNV_W_SMESHDS_Mesh.h index 8d9263d00..fc1f5e650 100644 --- a/src/DriverUNV/DriverUNV_W_SMESHDS_Mesh.h +++ b/src/DriverUNV/DriverUNV_W_SMESHDS_Mesh.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _INCLUDE_DRIVERUNV_W_SMESHDS_MESH #define _INCLUDE_DRIVERUNV_W_SMESHDS_MESH diff --git a/src/DriverUNV/Makefile.in b/src/DriverUNV/Makefile.in index debe7da04..e637046b6 100644 --- a/src/DriverUNV/Makefile.in +++ b/src/DriverUNV/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -51,7 +51,7 @@ LIB_SRC = \ DriverUNV_W_SMESHDS_Document.cxx \ DriverUNV_W_SMDS_Mesh.cxx \ DriverUNV_W_SMESHDS_Mesh.cxx \ - UNV_Utilities.cxx UNV2411_Structure.cxx UNV2412_Structure.cxx SMESH_DriverUNV.hxx + UNV_Utilities.cxx UNV2411_Structure.cxx UNV2412_Structure.cxx UNV2417_Structure.cxx SMESH_DriverUNV.hxx # Executables targets BIN = UNV_Test @@ -61,11 +61,11 @@ LIB_CLIENT_IDL = LIB_SERVER_IDL = # additionnal information to compil and link file -CPPFLAGS += -I${KERNEL_ROOT_DIR}/include/salome $(OCC_INCLUDES) $(BOOST_CPPFLAGS) -CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome +CPPFLAGS += $(KERNEL_CXXFLAGS) $(OCC_INCLUDES) $(BOOST_CPPFLAGS) +CXXFLAGS += $(KERNEL_CXXFLAGS) LDFLAGS += -lMeshDriver $(OCC_KERNEL_LIBS) -LDFLAGSFORBIN += -lMeshDriver -lSMDS -L${KERNEL_ROOT_DIR}/lib/salome -lOpUtil -lSALOMELocalTrace -lSALOMEBasics +LDFLAGSFORBIN += -lMeshDriver -lSMDS $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics @CONCLUDE@ diff --git a/src/DriverUNV/UNV2411_Structure.cxx b/src/DriverUNV/UNV2411_Structure.cxx index 9b78920fc..35d19442a 100644 --- a/src/DriverUNV/UNV2411_Structure.cxx +++ b/src/DriverUNV/UNV2411_Structure.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include #include diff --git a/src/DriverUNV/UNV2411_Structure.hxx b/src/DriverUNV/UNV2411_Structure.hxx index ee4134251..8503e6446 100644 --- a/src/DriverUNV/UNV2411_Structure.hxx +++ b/src/DriverUNV/UNV2411_Structure.hxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef UNV2411_Structure_HeaderFile #define UNV2411_Structure_HeaderFile diff --git a/src/DriverUNV/UNV2412_Structure.cxx b/src/DriverUNV/UNV2412_Structure.cxx index 0160d7b68..ef41a9990 100644 --- a/src/DriverUNV/UNV2412_Structure.cxx +++ b/src/DriverUNV/UNV2412_Structure.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include #include @@ -63,7 +63,7 @@ void UNV2412::Read(std::ifstream& in_stream, TDataSet& theDataSet) // end of dataset is reached break; } - + int n_nodes; TRecord aRec; in_stream>>aRec.fe_descriptor_id; @@ -142,9 +142,10 @@ void UNV2412::Write(std::ofstream& out_stream, const TDataSet& theDataSet) bool UNV2412::IsBeam(int theFeDescriptorId){ switch (theFeDescriptorId){ - case 11: - case 21: - case 22: + case 11: // edge with 2 nodes + case 21: + case 22: // edge with 3 nodes + case 23: // curved beam case 24: case 25: return true; @@ -197,6 +198,8 @@ bool UNV2412::IsVolume(int theFeDescriptorId){ case 116: // Solid Quadratic Brick - HEX20 case 117: // Solid Cubic Brick + + case 114: // pyramid of 13 nodes (quadratic) return true; } return false; diff --git a/src/DriverUNV/UNV2412_Structure.hxx b/src/DriverUNV/UNV2412_Structure.hxx index 8c4003d37..8e1d50f48 100644 --- a/src/DriverUNV/UNV2412_Structure.hxx +++ b/src/DriverUNV/UNV2412_Structure.hxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef UNV2412_Structure_HeaderFile #define UNV2412_Structure_HeaderFile diff --git a/src/DriverUNV/UNV_Test.cxx b/src/DriverUNV/UNV_Test.cxx index 0156b5051..4c7a43329 100644 --- a/src/DriverUNV/UNV_Test.cxx +++ b/src/DriverUNV/UNV_Test.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "UNV2411_Structure.hxx" #include "UNV2412_Structure.hxx" diff --git a/src/DriverUNV/UNV_Utilities.cxx b/src/DriverUNV/UNV_Utilities.cxx index 0781e5a4c..0d65092bd 100644 --- a/src/DriverUNV/UNV_Utilities.cxx +++ b/src/DriverUNV/UNV_Utilities.cxx @@ -1,10 +1,21 @@ -// Copyright (C) 2003 CEA/DEN, EDF R&D +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// -// File : VISU_DatConvertor.cxx -// Author : Alexey PETROV -// Module : VISU +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "UNV_Utilities.hxx" diff --git a/src/DriverUNV/UNV_Utilities.hxx b/src/DriverUNV/UNV_Utilities.hxx index f87837ace..59af2c4fe 100644 --- a/src/DriverUNV/UNV_Utilities.hxx +++ b/src/DriverUNV/UNV_Utilities.hxx @@ -1,10 +1,21 @@ -// Copyright (C) 2003 CEA/DEN, EDF R&D +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// -// File : VISU_DatConvertor.hxx -// Author : Alexey PETROV -// Module : VISU +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef MED_Utilities_HeaderFile #define MED_Utilities_HeaderFile diff --git a/src/MEFISTO2/Makefile.in b/src/MEFISTO2/Makefile.in index d1c403357..aea95bcfb 100644 --- a/src/MEFISTO2/Makefile.in +++ b/src/MEFISTO2/Makefile.in @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# 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 : # Module : SMESH @@ -23,8 +42,8 @@ LIB_CLIENT_IDL = LIB_SERVER_IDL = # additionnal information to compil and link file -CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome -CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome +CPPFLAGS += $(OCC_INCLUDES) $(KERNEL_CXXFLAGS) +CXXFLAGS += $(OCC_CXXFLAGS) $(KERNEL_CXXFLAGS) ifeq ($(F77),gfortran) LDFLAGS += -lgfortran diff --git a/src/MEFISTO2/aptrte.cxx b/src/MEFISTO2/aptrte.cxx index d2b4b3693..9f4723322 100755 --- a/src/MEFISTO2/aptrte.cxx +++ b/src/MEFISTO2/aptrte.cxx @@ -67,6 +67,7 @@ void deltacpu_( R & dtcpu ) return; } + void aptrte( Z nutysu, R aretmx, Z nblf, Z * nudslf, R2 * uvslf, Z nbpti, R2 * uvpti, diff --git a/src/Makefile.in b/src/Makefile.in index c4bbfd85f..e9ce50778 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -31,9 +31,11 @@ VPATH=.:@srcdir@ @COMMENCE@ +MED_CXXFLAGS=@MED_CXXFLAGS@ + SUBDIRS = \ SMDS SMESHDS Controls Driver DriverMED DriverDAT DriverUNV DriverSTL \ - SMESH SMESH_I OBJECT SMESHFiltersSelection SMESHGUI SMESH_SWIG \ + SMESH SMESH_I SMESHClient OBJECT SMESHFiltersSelection SMESHGUI SMESH_SWIG \ MEFISTO2 StdMeshers StdMeshers_I StdMeshersGUI @MODULE@ diff --git a/src/NETGEN/Makefile.in b/src/NETGEN/Makefile.in index fc2e0476a..dd6e419c7 100644 --- a/src/NETGEN/Makefile.in +++ b/src/NETGEN/Makefile.in @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # -* Makefile *- # # Author : Nadir Bouhamou (CEA) diff --git a/src/NETGENPlugin/Makefile.in b/src/NETGENPlugin/Makefile.in index 577190928..a17bcf1b7 100644 --- a/src/NETGENPlugin/Makefile.in +++ b/src/NETGENPlugin/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -57,11 +57,11 @@ BIN_SRC = # additionnal information to compil and link file NETGEN_INCLUDES=@NETGEN_INCLUDES@ -CPPFLAGS+= $(OCC_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \ - -I${GEOM_ROOT_DIR}/include/salome $(NETGEN_INCLUDES) $(BOOST_CPPFLAGS) -CXXFLAGS+= $(OCC_CXXFLAGS) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \ - -I${GEOM_ROOT_DIR}/include/salome $(NETGEN_INCLUDES) +CPPFLAGS+= $(OCC_INCLUDES) $(HDF5_INCLUDES) $(KERNEL_CXXFLAGS) \ + $(GEOM_CXXFLAGS) $(NETGEN_INCLUDES) $(BOOST_CPPFLAGS) +CXXFLAGS+= $(OCC_CXXFLAGS) $(HDF5_INCLUDES) $(KERNEL_CXXFLAGS) \ + $(GEOM_CXXFLAGS) $(NETGEN_INCLUDES) -LDFLAGS+= $(HDF5_LIBS) -lSMESHimpl -lSMESHEngine -lStdMeshers -lStdMeshersEngine -lNETGEN -L${KERNEL_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome -lSalomeGenericObj +LDFLAGS+= $(HDF5_LIBS) -lSMESHimpl -lSMESHEngine -lStdMeshers -lStdMeshersEngine -lNETGEN $(KERNEL_LDFLAGS) $(GEOM_LDFLAGS) -lSalomeGenericObj @CONCLUDE@ diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx index 7c2f7a9bc..ca46afd0e 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // //============================================================================= // File : NETGENPlugin_NETGEN_3D.cxx diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx index dd67278fb..f640b15d0 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // //============================================================================= // File : NETGENPlugin_NETGEN_3D.hxx diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx index 489d6822e..0429bc9c1 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx index 724fafa55..ad0c59b4b 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/NETGENPlugin/NETGENPlugin_i.cxx b/src/NETGENPlugin/NETGENPlugin_i.cxx index 7ec0e06f5..4401a1e54 100644 --- a/src/NETGENPlugin/NETGENPlugin_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/NETGENPlugin/NETGENPlugin_icons.po b/src/NETGENPlugin/NETGENPlugin_icons.po index a3f6297d7..544555e33 100644 --- a/src/NETGENPlugin/NETGENPlugin_icons.po +++ b/src/NETGENPlugin/NETGENPlugin_icons.po @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # This is a Qt message file in .po format. Each msgid starts with # a scope. This scope should *NOT* be translated - eg. "Foo::Bar" # would be translated to "Pub", not "Foo::Pub". diff --git a/src/OBJECT/Makefile.in b/src/OBJECT/Makefile.in index 8cf070ccf..aeddd7b2b 100644 --- a/src/OBJECT/Makefile.in +++ b/src/OBJECT/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -31,28 +31,109 @@ VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl @COMMENCE@ -EXPORT_HEADERS = SMESH_Actor.h SMESH_Object.h SMESH_ObjectDef.h SMESH_ActorUtils.h +EXPORT_HEADERS = \ + SMESH_Actor.h \ + SMESH_Object.h \ + SMESH_ObjectDef.h \ + SMESH_ActorUtils.h # Libraries targets LIB = libSMESHObject.la -LIB_SRC = SMESH_Object.cxx SMESH_DeviceActor.cxx SMESH_Actor.cxx \ - SMESH_ExtractGeometry.cxx SMESH_ActorUtils.cxx +LIB_SRC = \ + SMESH_Object.cxx \ + SMESH_DeviceActor.cxx \ + SMESH_Actor.cxx \ + SMESH_ExtractGeometry.cxx \ + SMESH_ActorUtils.cxx LIB_CLIENT_IDL = SALOME_Exception.idl \ SALOME_GenericObj.idl \ + SALOME_Comm.idl \ + MED.idl \ SMESH_Mesh.idl \ - SMESH_Group.idl + SMESH_Group.idl \ + SALOMEDS.idl \ + SMESH_Gen.idl \ + GEOM_Gen.idl \ + SMESH_Hypothesis.idl # Executables targets BIN = BIN_SRC = -CPPFLAGS+=$(OCC_INCLUDES) $(VTK_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \ - $(BOOST_CPPFLAGS) $(QT_INCLUDES) -LDFLAGS+=$(OCC_KERNEL_LIBS) $(VTK_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome -lSMDS \ - -lSalomeApp -lSalomeObject -lSMESHControls +CPPFLAGS+= \ + $(KERNEL_CXXFLAGS) \ + $(GUI_CXXFLAGS) \ + $(OCC_INCLUDES) \ + $(VTK_INCLUDES) \ + $(BOOST_CPPFLAGS) \ + $(QT_INCLUDES) \ + $(MED_CXXFLAGS) +LDFLAGS+= \ + $(KERNEL_LDFLAGS) \ + $(GUI_LDFLAGS) \ + $(OCC_KERNEL_LIBS) \ + $(VTK_LIBS) \ + $(MED_LDFLAGS) \ + -lSMDS \ + -lSMESHClient \ + -lSalomeApp \ + -lSalomeObject \ + -lSMESHControls + +LDFLAGSFORBIN += \ + $(GEOM_LDFLAGS) \ + $(MED_LDFLAGS) \ + $(LDFLAGS) \ + -lqtx \ + -lsuit \ + -lstd \ + -lCAM \ + -lLightApp \ + -lObjBrowser \ + -lSalomePrs \ + -lSalomeDS \ + -lTOOLSDS \ + -lSalomeDSImpl \ + -lSalomeDSClient \ + -lSalomeHDFPersist \ + -lSalomeResourcesManager \ + -lSalomeLifeCycleCORBA \ + -lSalomeNotification \ + -lSalomeContainer \ + -lSalomeCatalog \ + -lSalomeSession \ + -lRegistry \ + -lNMTTools \ + -lNMTDS \ + -lmed_V2_1 \ + -lMEDWrapper \ + -lMEDWrapperBase \ + -lMEDWrapper_V2_1 \ + -lMEDWrapper_V2_2 \ + -lPlot2d \ + -lGLViewer \ + -lOCCViewer \ + -lVTKViewer \ + -lSVTK \ + -lSOCC \ + -lSPlot2d \ + -lSUPERVGraph \ + -lPyInterp \ + -lPythonConsole \ + -lLogWindow \ + -lLightApp \ + -lSalomeContainer \ + -lToolsGUI \ + -lSalomeNS \ + -lEvent \ + -lSalomeGenericObj \ + -lSALOMELocalTrace \ + -lwith_loggerTraceCollector \ + -lSALOMEBasics \ + -lOpUtil @CONCLUDE@ diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 5b21ac70a..53c8758f3 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -122,15 +122,15 @@ SMESH_ActorDef::SMESH_ActorDef() if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) ) myControlsPrecision = (long)SMESH::GetFloat( "SMESH", "controls_precision", -1 ); - float aPointSize = SMESH::GetFloat("SMESH:node_size",3); - float aLineWidth = SMESH::GetFloat("SMESH:element_width",1); + vtkFloatingPointType aPointSize = SMESH::GetFloat("SMESH:node_size",3); + vtkFloatingPointType aLineWidth = SMESH::GetFloat("SMESH:element_width",1); vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New(); VTKViewer_ExtractUnstructuredGrid* aFilter = NULL; //Definition 2D and 3D divices of the actor //----------------------------------------- - float anRGB[3] = {1,1,1}; + vtkFloatingPointType anRGB[3] = {1,1,1}; mySurfaceProp = vtkProperty::New(); SMESH::GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) ); mySurfaceProp->SetColor( anRGB[0], anRGB[1], anRGB[2] ); @@ -150,6 +150,8 @@ SMESH_ActorDef::SMESH_ActorDef() aFilter->RegisterCellsWithType(VTK_TRIANGLE); aFilter->RegisterCellsWithType(VTK_POLYGON); aFilter->RegisterCellsWithType(VTK_QUAD); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD); my3DActor = SMESH_DeviceActor::New(); my3DActor->SetUserMatrix(aMatrix); @@ -164,6 +166,8 @@ SMESH_ActorDef::SMESH_ActorDef() aFilter->RegisterCellsWithType(VTK_HEXAHEDRON); aFilter->RegisterCellsWithType(VTK_WEDGE); aFilter->RegisterCellsWithType(VTK_PYRAMID); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON); aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET); //Definition 1D divice of the actor @@ -185,6 +189,7 @@ SMESH_ActorDef::SMESH_ActorDef() aFilter = my1DActor->GetExtractUnstructuredGrid(); aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding); aFilter->RegisterCellsWithType(VTK_LINE); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE); my1DProp = vtkProperty::New(); my1DProp->DeepCopy(myEdgeProp); @@ -210,6 +215,7 @@ SMESH_ActorDef::SMESH_ActorDef() aFilter = my1DExtActor->GetExtractUnstructuredGrid(); aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding); aFilter->RegisterCellsWithType(VTK_LINE); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE); //Definition 0D divice of the actor @@ -263,8 +269,6 @@ SMESH_ActorDef::SMESH_ActorDef() myHighlitableActor->PickableOff(); myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe); - SetShrinkFactor( SMESH::GetFloat( "SMESH:shrink_coeff", 0.75 ) ); - myName = ""; myIO = NULL; @@ -744,17 +748,19 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj, my2DActor->GetMapper()->SetLookupTable(myLookupTable); my3DActor->GetMapper()->SetLookupTable(myLookupTable); - float aFactor, aUnits; + vtkFloatingPointType aFactor, aUnits; my2DActor->GetPolygonOffsetParameters(aFactor,aUnits); my2DActor->SetPolygonOffsetParameters(aFactor,aUnits*0.75); - //SetIsShrunkable(theGrid->GetNumberOfCells() > 10); - SetIsShrunkable(true); - SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr(); if( !mgr ) return false; + //SetIsShrunkable(theGrid->GetNumberOfCells() > 10); + SetIsShrunkable(true); + + SetShrinkFactor( SMESH::GetFloat( "SMESH:shrink_coeff", 0.75 ) ); + int aMode = mgr->integerValue( "SMESH", "display_mode" ); SetRepresentation(-1); @@ -776,7 +782,7 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj, } -float* SMESH_ActorDef::GetBounds(){ +vtkFloatingPointType* SMESH_ActorDef::GetBounds(){ return myNodeActor->GetBounds(); } @@ -835,15 +841,17 @@ bool SMESH_ActorDef::IsInfinitive(){ void SMESH_ActorDef::SetIsShrunkable(bool theShrunkable){ + if ( myIsShrinkable == theShrunkable ) + return; myIsShrinkable = theShrunkable; Modified(); } -float SMESH_ActorDef::GetShrinkFactor(){ +vtkFloatingPointType SMESH_ActorDef::GetShrinkFactor(){ return myBaseActor->GetShrinkFactor(); } -void SMESH_ActorDef::SetShrinkFactor(float theValue){ +void SMESH_ActorDef::SetShrinkFactor(vtkFloatingPointType theValue){ myBaseActor->SetShrinkFactor(theValue); my1DActor->SetShrinkFactor(theValue); @@ -890,7 +898,7 @@ int SMESH_ActorDef::GetNodeObjId(int theVtkID){ return myPickableActor->GetNodeObjId(theVtkID); } -float* SMESH_ActorDef::GetNodeCoord(int theObjID){ +vtkFloatingPointType* SMESH_ActorDef::GetNodeCoord(int theObjID){ return myPickableActor->GetNodeCoord(theObjID); } @@ -1015,6 +1023,7 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){ if(myEntityMode & eEdges){ if (MYDEBUG) MESSAGE("EDGES"); aFilter->RegisterCellsWithType(VTK_LINE); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE); } if(myEntityMode & eFaces){ @@ -1022,6 +1031,8 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){ aFilter->RegisterCellsWithType(VTK_TRIANGLE); aFilter->RegisterCellsWithType(VTK_POLYGON); aFilter->RegisterCellsWithType(VTK_QUAD); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD); } if(myEntityMode & eVolumes){ @@ -1031,6 +1042,8 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){ aFilter->RegisterCellsWithType(VTK_HEXAHEDRON); aFilter->RegisterCellsWithType(VTK_WEDGE); aFilter->RegisterCellsWithType(VTK_PYRAMID); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON); aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET); } aFilter->Update(); @@ -1135,6 +1148,8 @@ void SMESH_ActorDef::SetRepresentation(int theMode){ void SMESH_ActorDef::SetPointRepresentation(bool theIsPointsVisible){ + if ( myIsPointsVisible == theIsPointsVisible ) + return; myIsPointsVisible = theIsPointsVisible; SetRepresentation(GetRepresentation()); } @@ -1175,12 +1190,16 @@ void SMESH_ActorDef::UpdateHighlight(){ void SMESH_ActorDef::highlight(bool theHighlight){ + if ( myIsHighlighted == theHighlight ) + return; myIsHighlighted = theHighlight; UpdateHighlight(); } void SMESH_ActorDef::SetPreSelected(bool thePreselect){ + if ( myIsPreselected == thePreselect ) + return; myIsPreselected = thePreselect; UpdateHighlight(); } @@ -1250,15 +1269,15 @@ void SMESH_ActorDef::ReleaseGraphicsResources(vtkWindow *renWin){ } -static void GetColor(vtkProperty *theProperty, float& r,float& g,float& b){ - float* aColor = theProperty->GetColor(); +static void GetColor(vtkProperty *theProperty, vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){ + vtkFloatingPointType* aColor = theProperty->GetColor(); r = aColor[0]; g = aColor[1]; b = aColor[2]; } -void SMESH_ActorDef::SetOpacity(float theValue){ +void SMESH_ActorDef::SetOpacity(vtkFloatingPointType theValue){ mySurfaceProp->SetOpacity(theValue); myBackSurfaceProp->SetOpacity(theValue); myEdgeProp->SetOpacity(theValue); @@ -1268,74 +1287,74 @@ void SMESH_ActorDef::SetOpacity(float theValue){ } -float SMESH_ActorDef::GetOpacity(){ +vtkFloatingPointType SMESH_ActorDef::GetOpacity(){ return mySurfaceProp->GetOpacity(); } -void SMESH_ActorDef::SetSufaceColor(float r,float g,float b){ +void SMESH_ActorDef::SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){ mySurfaceProp->SetColor(r,g,b); Modified(); } -void SMESH_ActorDef::GetSufaceColor(float& r,float& g,float& b){ +void SMESH_ActorDef::GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){ ::GetColor(mySurfaceProp,r,g,b); } -void SMESH_ActorDef::SetBackSufaceColor(float r,float g,float b){ +void SMESH_ActorDef::SetBackSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){ myBackSurfaceProp->SetColor(r,g,b); Modified(); } -void SMESH_ActorDef::GetBackSufaceColor(float& r,float& g,float& b){ +void SMESH_ActorDef::GetBackSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){ ::GetColor(myBackSurfaceProp,r,g,b); } -void SMESH_ActorDef::SetEdgeColor(float r,float g,float b){ +void SMESH_ActorDef::SetEdgeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){ myEdgeProp->SetColor(r,g,b); my1DProp->SetColor(r,g,b); my1DExtProp->SetColor(1.0-r,1.0-g,1.0-b); Modified(); } -void SMESH_ActorDef::GetEdgeColor(float& r,float& g,float& b){ +void SMESH_ActorDef::GetEdgeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){ ::GetColor(myEdgeProp,r,g,b); } -void SMESH_ActorDef::SetNodeColor(float r,float g,float b){ +void SMESH_ActorDef::SetNodeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){ myNodeProp->SetColor(r,g,b); Modified(); } -void SMESH_ActorDef::GetNodeColor(float& r,float& g,float& b){ +void SMESH_ActorDef::GetNodeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){ ::GetColor(myNodeProp,r,g,b); } -void SMESH_ActorDef::SetHighlightColor(float r,float g,float b){ +void SMESH_ActorDef::SetHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){ myHighlightProp->SetColor(r,g,b); Modified(); } -void SMESH_ActorDef::GetHighlightColor(float& r,float& g,float& b){ +void SMESH_ActorDef::GetHighlightColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){ ::GetColor(myHighlightProp,r,g,b); } -void SMESH_ActorDef::SetPreHighlightColor(float r,float g,float b){ +void SMESH_ActorDef::SetPreHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){ myPreselectProp->SetColor(r,g,b); Modified(); } -void SMESH_ActorDef::GetPreHighlightColor(float& r,float& g,float& b){ +void SMESH_ActorDef::GetPreHighlightColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){ ::GetColor(myPreselectProp,r,g,b); } -float SMESH_ActorDef::GetLineWidth(){ +vtkFloatingPointType SMESH_ActorDef::GetLineWidth(){ return myEdgeProp->GetLineWidth(); } -void SMESH_ActorDef::SetLineWidth(float theVal){ +void SMESH_ActorDef::SetLineWidth(vtkFloatingPointType theVal){ myEdgeProp->SetLineWidth(theVal); my1DProp->SetLineWidth(theVal + aLineWidthInc); @@ -1345,7 +1364,7 @@ void SMESH_ActorDef::SetLineWidth(float theVal){ } -void SMESH_ActorDef::SetNodeSize(float theVal){ +void SMESH_ActorDef::SetNodeSize(vtkFloatingPointType theVal){ myNodeProp->SetPointSize(theVal); myHighlightProp->SetPointSize(theVal); myPreselectProp->SetPointSize(theVal); @@ -1356,7 +1375,7 @@ void SMESH_ActorDef::SetNodeSize(float theVal){ Modified(); } -float SMESH_ActorDef::GetNodeSize(){ +vtkFloatingPointType SMESH_ActorDef::GetNodeSize(){ return myNodeProp->GetPointSize(); } @@ -1429,21 +1448,21 @@ GetClippingPlane(vtkIdType theID) static void ComputeBoundsParam(vtkDataSet* theDataSet, - float theDirection[3], float theMinPnt[3], - float& theMaxBoundPrj, float& theMinBoundPrj) + vtkFloatingPointType theDirection[3], vtkFloatingPointType theMinPnt[3], + vtkFloatingPointType& theMaxBoundPrj, vtkFloatingPointType& theMinBoundPrj) { - float aBounds[6]; + vtkFloatingPointType aBounds[6]; theDataSet->GetBounds(aBounds); //Enlarge bounds in order to avoid conflicts of precision for(int i = 0; i < 6; i += 2){ static double EPS = 1.0E-3; - float aDelta = (aBounds[i+1] - aBounds[i])*EPS; + vtkFloatingPointType aDelta = (aBounds[i+1] - aBounds[i])*EPS; aBounds[i] -= aDelta; aBounds[i+1] += aDelta; } - float aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]}, + 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]}, @@ -1456,7 +1475,7 @@ static void ComputeBoundsParam(vtkDataSet* theDataSet, theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]); theMinBoundPrj = theMaxBoundPrj; for(int i = 1; i < 8; i++){ - float aTmp = vtkMath::Dot(theDirection,aBoundPoints[i]); + vtkFloatingPointType aTmp = vtkMath::Dot(theDirection,aBoundPoints[i]); if(theMaxBoundPrj < aTmp){ theMaxBoundPrj = aTmp; aMaxId = i; @@ -1466,7 +1485,7 @@ static void ComputeBoundsParam(vtkDataSet* theDataSet, aMinId = i; } } - float *aMinPnt = aBoundPoints[aMaxId]; + vtkFloatingPointType *aMinPnt = aBoundPoints[aMaxId]; theMinPnt[0] = aMinPnt[0]; theMinPnt[1] = aMinPnt[1]; theMinPnt[2] = aMinPnt[2]; @@ -1474,11 +1493,11 @@ static void ComputeBoundsParam(vtkDataSet* theDataSet, static void DistanceToPosition(vtkDataSet* theDataSet, - float theDirection[3], float theDist, float thePos[3]) + vtkFloatingPointType theDirection[3], vtkFloatingPointType theDist, vtkFloatingPointType thePos[3]) { - float aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; + vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj); - float aLength = (aMaxBoundPrj-aMinBoundPrj)*theDist; + vtkFloatingPointType aLength = (aMaxBoundPrj-aMinBoundPrj)*theDist; thePos[0] = aMinPnt[0]-theDirection[0]*aLength; thePos[1] = aMinPnt[1]-theDirection[1]*aLength; thePos[2] = aMinPnt[2]-theDirection[2]*aLength; @@ -1486,29 +1505,29 @@ static void DistanceToPosition(vtkDataSet* theDataSet, static void PositionToDistance(vtkDataSet* theDataSet, - float theDirection[3], float thePos[3], float& theDist) + vtkFloatingPointType theDirection[3], vtkFloatingPointType thePos[3], vtkFloatingPointType& theDist) { - float aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; + vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj); - float aPrj = vtkMath::Dot(theDirection,thePos); + vtkFloatingPointType aPrj = vtkMath::Dot(theDirection,thePos); theDist = (aPrj-aMinBoundPrj)/(aMaxBoundPrj-aMinBoundPrj); } -void SMESH_ActorDef::SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane) +void SMESH_ActorDef::SetPlaneParam(vtkFloatingPointType theDir[3], vtkFloatingPointType theDist, vtkPlane* thePlane) { thePlane->SetNormal(theDir); - float anOrigin[3]; + vtkFloatingPointType anOrigin[3]; ::DistanceToPosition(GetUnstructuredGrid(),theDir,theDist,anOrigin); thePlane->SetOrigin(anOrigin); } -void SMESH_ActorDef::GetPlaneParam(float theDir[3], float& theDist, vtkPlane* thePlane) +void SMESH_ActorDef::GetPlaneParam(vtkFloatingPointType theDir[3], vtkFloatingPointType& theDist, vtkPlane* thePlane) { thePlane->GetNormal(theDir); - float anOrigin[3]; + vtkFloatingPointType anOrigin[3]; thePlane->GetOrigin(anOrigin); ::PositionToDistance(GetUnstructuredGrid(),theDir,anOrigin,theDist); } @@ -1598,21 +1617,21 @@ void SMESH_ActorDef::UpdateScalarBar() myScalarBarActor->SetOrientationToVertical(); - float aXVal = horiz ? 0.20 : 0.01; + vtkFloatingPointType aXVal = horiz ? 0.20 : 0.01; if( mgr->hasValue( "SMESH", name + "x" ) ) aXVal = mgr->doubleValue( "SMESH", name + "x", aXVal ); - float aYVal = horiz ? 0.01 : 0.1; + vtkFloatingPointType aYVal = horiz ? 0.01 : 0.1; if( mgr->hasValue( "SMESH", name + "y" ) ) aYVal = mgr->doubleValue( "SMESH", name + "y", aYVal ); myScalarBarActor->SetPosition( aXVal, aYVal ); - float aWVal = horiz ? 0.60 : 0.10; + vtkFloatingPointType aWVal = horiz ? 0.60 : 0.10; if( mgr->hasValue( "SMESH", name + "width" ) ) aWVal = mgr->doubleValue( "SMESH", name + "width", aWVal ); myScalarBarActor->SetWidth( aWVal ); - float aHVal = horiz ? 0.12 : 0.80; + vtkFloatingPointType aHVal = horiz ? 0.12 : 0.80; if( mgr->hasValue( "SMESH", name + "height" ) ) aHVal = mgr->doubleValue( "SMESH", name + "height", aHVal ); myScalarBarActor->SetHeight( aHVal ); diff --git a/src/OBJECT/SMESH_Actor.h b/src/OBJECT/SMESH_Actor.h index 8114f529b..04dd4cead 100644 --- a/src/OBJECT/SMESH_Actor.h +++ b/src/OBJECT/SMESH_Actor.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -50,29 +50,29 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor const char* theName, int theIsClear); - virtual void SetSufaceColor(float r,float g,float b) = 0; - virtual void GetSufaceColor(float& r,float& g,float& b) = 0; + virtual void SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0; + virtual void GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0; - virtual void SetBackSufaceColor(float r,float g,float b) = 0; - virtual void GetBackSufaceColor(float& r,float& g,float& b) = 0; + virtual void SetBackSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0; + virtual void GetBackSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0; - virtual void SetEdgeColor(float r,float g,float b) = 0; - virtual void GetEdgeColor(float& r,float& g,float& b) = 0; + virtual void SetEdgeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0; + virtual void GetEdgeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0; - virtual void SetNodeColor(float r,float g,float b) = 0; - virtual void GetNodeColor(float& r,float& g,float& b) = 0; + virtual void SetNodeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0; + virtual void GetNodeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0; - virtual void SetHighlightColor(float r,float g,float b) = 0; - virtual void GetHighlightColor(float& r,float& g,float& b) = 0; + virtual void SetHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0; + virtual void GetHighlightColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0; - virtual void SetPreHighlightColor(float r,float g,float b) = 0; - virtual void GetPreHighlightColor(float& r,float& g,float& b) = 0; + virtual void SetPreHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0; + virtual void GetPreHighlightColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0; - virtual float GetLineWidth() = 0; - virtual void SetLineWidth(float theVal) = 0; + virtual vtkFloatingPointType GetLineWidth() = 0; + virtual void SetLineWidth(vtkFloatingPointType theVal) = 0; - virtual void SetNodeSize(float size) = 0; - virtual float GetNodeSize() = 0; + virtual void SetNodeSize(vtkFloatingPointType size) = 0; + virtual vtkFloatingPointType GetNodeSize() = 0; enum EReperesent { ePoint, eEdge, eSurface}; @@ -85,7 +85,7 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0; - virtual void SetShrinkFactor(float theValue) = 0; + virtual void SetShrinkFactor(vtkFloatingPointType theValue) = 0; virtual void SetPointsLabeled(bool theIsPointsLabeled) = 0; virtual bool GetPointsLabeled() = 0; @@ -101,8 +101,8 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor virtual vtkScalarBarActor* GetScalarBarActor() = 0; - virtual void SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane) = 0; - virtual void GetPlaneParam(float theDir[3], float& theDist, vtkPlane* thePlane) = 0; + virtual void SetPlaneParam(vtkFloatingPointType theDir[3], vtkFloatingPointType theDist, vtkPlane* thePlane) = 0; + virtual void GetPlaneParam(vtkFloatingPointType theDir[3], vtkFloatingPointType& theDist, vtkPlane* thePlane) = 0; virtual void RemoveAllClippingPlanes() = 0; virtual vtkIdType GetNumberOfClippingPlanes() = 0; diff --git a/src/OBJECT/SMESH_ActorDef.h b/src/OBJECT/SMESH_ActorDef.h index 5df608124..c1e55d415 100644 --- a/src/OBJECT/SMESH_ActorDef.h +++ b/src/OBJECT/SMESH_ActorDef.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -79,7 +79,8 @@ class vtkTimeStamp; class SMESH_DeviceActor; -class SMESHOBJECT_EXPORT SMESH_ActorDef : public SMESH_Actor{ +class SMESH_ActorDef : public SMESH_Actor +{ friend class SMESH_VisualObj; friend class SMESH_Actor; @@ -100,35 +101,35 @@ class SMESHOBJECT_EXPORT SMESH_ActorDef : public SMESH_Actor{ virtual bool IsInfinitive(); - virtual void SetOpacity(float theValue); - virtual float GetOpacity(); + virtual void SetOpacity(vtkFloatingPointType theValue); + virtual vtkFloatingPointType GetOpacity(); - virtual void SetSufaceColor(float r,float g,float b); - virtual void GetSufaceColor(float& r,float& g,float& b); + virtual void SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b); + virtual void GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b); - virtual void SetBackSufaceColor(float r,float g,float b); - virtual void GetBackSufaceColor(float& r,float& g,float& b); + virtual void SetBackSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b); + virtual void GetBackSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b); - virtual void SetEdgeColor(float r,float g,float b); - virtual void GetEdgeColor(float& r,float& g,float& b); + virtual void SetEdgeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b); + virtual void GetEdgeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b); - virtual void SetNodeColor(float r,float g,float b); - virtual void GetNodeColor(float& r,float& g,float& b); + virtual void SetNodeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b); + virtual void GetNodeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b); - virtual void SetHighlightColor(float r,float g,float b); - virtual void GetHighlightColor(float& r,float& g,float& b); + virtual void SetHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b); + virtual void GetHighlightColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b); - virtual void SetPreHighlightColor(float r,float g,float b); - virtual void GetPreHighlightColor(float& r,float& g,float& b); + virtual void SetPreHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b); + virtual void GetPreHighlightColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b); - virtual float GetLineWidth(); - virtual void SetLineWidth(float theVal); + virtual vtkFloatingPointType GetLineWidth(); + virtual void SetLineWidth(vtkFloatingPointType theVal); - virtual void SetNodeSize(float size) ; - virtual float GetNodeSize() ; + virtual void SetNodeSize(vtkFloatingPointType size) ; + virtual vtkFloatingPointType GetNodeSize() ; virtual int GetNodeObjId(int theVtkID); - virtual float* GetNodeCoord(int theObjID); + virtual vtkFloatingPointType* GetNodeCoord(int theObjID); virtual int GetElemObjId(int theVtkID); virtual vtkCell* GetElemCell(int theObjID); @@ -146,15 +147,15 @@ class SMESHOBJECT_EXPORT SMESH_ActorDef : public SMESH_Actor{ virtual void SetPointRepresentation(bool theIsPointsVisible); virtual bool GetPointRepresentation(); - virtual float* GetBounds(); + virtual vtkFloatingPointType* GetBounds(); virtual void SetTransform(VTKViewer_Transform* theTransform); virtual vtkUnstructuredGrid* GetUnstructuredGrid(); virtual vtkDataSet* GetInput(); virtual vtkMapper* GetMapper(); - virtual float GetShrinkFactor(); - virtual void SetShrinkFactor(float theValue); + virtual vtkFloatingPointType GetShrinkFactor(); + virtual void SetShrinkFactor(vtkFloatingPointType theValue); virtual bool IsShrunkable() { return myIsShrinkable;} virtual bool IsShrunk() { return myIsShrunk;} @@ -172,8 +173,8 @@ class SMESHOBJECT_EXPORT SMESH_ActorDef : public SMESH_Actor{ virtual vtkScalarBarActor* GetScalarBarActor(){ return myScalarBarActor;} - virtual void SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane); - virtual void GetPlaneParam(float theDir[3], float& theDist, vtkPlane* thePlane); + virtual void SetPlaneParam(vtkFloatingPointType theDir[3], vtkFloatingPointType theDist, vtkPlane* thePlane); + virtual void GetPlaneParam(vtkFloatingPointType theDir[3], vtkFloatingPointType& theDist, vtkPlane* thePlane); virtual void RemoveAllClippingPlanes(); virtual vtkIdType GetNumberOfClippingPlanes(); diff --git a/src/OBJECT/SMESH_ActorUtils.cxx b/src/OBJECT/SMESH_ActorUtils.cxx index feee143db..e498c2f72 100644 --- a/src/OBJECT/SMESH_ActorUtils.cxx +++ b/src/OBJECT/SMESH_ActorUtils.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "SMESH_ActorUtils.h" @@ -35,12 +35,15 @@ static int MYDEBUG = 1; static int MYDEBUG = 0; #endif -namespace SMESH{ +namespace SMESH +{ - float GetFloat( const QString& theValue, float theDefault ) + vtkFloatingPointType + GetFloat( const QString& theValue, + vtkFloatingPointType theDefault ) { int pos = theValue.find( ":" ); - float val = theDefault; + vtkFloatingPointType val = theDefault; if( pos>=0 ) { QString name = theValue.right( theValue.length()-pos-1 ), @@ -51,17 +54,23 @@ namespace SMESH{ return val; } - float GetFloat( const QString& theValue, const QString& theSection, float theDefault ) + vtkFloatingPointType + GetFloat( const QString& theValue, + const QString& theSection, + vtkFloatingPointType theDefault ) { - float val = theDefault; + vtkFloatingPointType val = theDefault; SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr(); if( mgr ) - val = (float) mgr->doubleValue( theValue, theSection, theDefault ); + val = (vtkFloatingPointType) mgr->doubleValue( theValue, theSection, theDefault ); return val; } - void WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, const char* theFileName){ + void + WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, + const char* theFileName) + { vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New(); aWriter->SetFileName(theFileName); aWriter->SetInput(theGrid); @@ -71,7 +80,10 @@ namespace SMESH{ aWriter->Delete(); } - QColor GetColor( const QString& theSect, const QString& theName, const QColor& def ) + QColor + GetColor( const QString& theSect, + const QString& theName, + const QColor& def ) { QColor c = def; SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr(); @@ -80,7 +92,13 @@ namespace SMESH{ return c; } - void GetColor( const QString& theSect, const QString& theName, int& r, int& g, int& b, const QColor& def ) + void + GetColor( const QString& theSect, + const QString& theName, + int& r, + int& g, + int& b, + const QColor& def ) { QColor c = def; SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr(); @@ -90,7 +108,13 @@ namespace SMESH{ SUIT_Tools::rgbSet( SUIT_Tools::rgbSet( c ), r, g, b ); } - void GetColor( const QString& theSect, const QString& theName, float& r, float& g, float& b, const QColor& def ) + void + GetColor( const QString& theSect, + const QString& theName, + vtkFloatingPointType& r, + vtkFloatingPointType& g, + vtkFloatingPointType& b, + const QColor& def ) { int ir( 0 ), ig( 0 ), ib( 0 ); GetColor( theSect, theName, ir, ig, ib, def ); diff --git a/src/OBJECT/SMESH_ActorUtils.h b/src/OBJECT/SMESH_ActorUtils.h index 32a27fa33..7231cdb84 100644 --- a/src/OBJECT/SMESH_ActorUtils.h +++ b/src/OBJECT/SMESH_ActorUtils.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef SMESH_ACTORUTILS_H #define SMESH_ACTORUTILS_H @@ -25,19 +25,51 @@ #include #include +#include "VTKViewer.h" + class vtkUnstructuredGrid; -namespace SMESH{ - - float SMESHOBJECT_EXPORT GetFloat( const QString& theValue, float theDefault = 0 ); - float SMESHOBJECT_EXPORT GetFloat( const QString& theName, const QString& theSection, float theDefault = 0 ); +namespace SMESH +{ +SMESHOBJECT_EXPORT + vtkFloatingPointType + GetFloat( const QString& theValue, + vtkFloatingPointType theDefault = 0 ); + +SMESHOBJECT_EXPORT + vtkFloatingPointType + GetFloat( const QString& theName, + const QString& theSection, + vtkFloatingPointType theDefault = 0 ); + +SMESHOBJECT_EXPORT + QColor + GetColor( const QString& theSect, + const QString& theName, + const QColor&t = QColor() ); - QColor SMESHOBJECT_EXPORT GetColor( const QString& theSect, const QString& theName, const QColor&t = QColor() ); - void SMESHOBJECT_EXPORT GetColor( const QString& theSect, const QString& theName, int&, int&, int&, const QColor&t = QColor() ); - void SMESHOBJECT_EXPORT GetColor( const QString& theSect, const QString& theName, float&, float&, float&, const QColor&t = QColor() ); +SMESHOBJECT_EXPORT + void + GetColor( const QString& theSect, + const QString& theName, + int&, + int&, + int&, + const QColor&t = QColor() ); - void WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, const char* theFileName); +SMESHOBJECT_EXPORT + void + GetColor( const QString& theSect, + const QString& theName, + vtkFloatingPointType&, + vtkFloatingPointType&, + vtkFloatingPointType&, + const QColor&t = QColor() ); +SMESHOBJECT_EXPORT + void + WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, + const char* theFileName); } #endif diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index 3548aaefe..0b3a424c4 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -31,6 +31,7 @@ #include "SMESH_ExtractGeometry.h" #include "SMESH_ControlsDef.hxx" #include "SMESH_ActorUtils.h" +#include "VTKViewer_CellLocationsArray.h" #include #include @@ -55,7 +56,6 @@ #include #include -#include #include #include @@ -75,7 +75,8 @@ using namespace std; vtkStandardNewMacro(SMESH_DeviceActor); -SMESH_DeviceActor::SMESH_DeviceActor() +SMESH_DeviceActor +::SMESH_DeviceActor() { if(MYDEBUG) MESSAGE("SMESH_DeviceActor - "<Delete(); @@ -139,8 +142,8 @@ SMESH_DeviceActor::~SMESH_DeviceActor(){ void -SMESH_DeviceActor:: -SetStoreGemetryMapping(bool theStoreMapping) +SMESH_DeviceActor +::SetStoreGemetryMapping(bool theStoreMapping) { myGeomFilter->SetStoreMapping(theStoreMapping); SetStoreClippingMapping(theStoreMapping); @@ -148,8 +151,8 @@ SetStoreGemetryMapping(bool theStoreMapping) void -SMESH_DeviceActor:: -SetStoreClippingMapping(bool theStoreMapping) +SMESH_DeviceActor +::SetStoreClippingMapping(bool theStoreMapping) { myStoreClippingMapping = theStoreMapping; myExtractGeometry->SetStoreMapping(theStoreMapping && myIsImplicitFunctionUsed); @@ -158,15 +161,17 @@ SetStoreClippingMapping(bool theStoreMapping) void -SMESH_DeviceActor:: -SetStoreIDMapping(bool theStoreMapping) +SMESH_DeviceActor +::SetStoreIDMapping(bool theStoreMapping) { myExtractUnstructuredGrid->SetStoreMapping(theStoreMapping); } -void SMESH_DeviceActor::Init(TVisualObjPtr theVisualObj, - vtkImplicitBoolean* theImplicitBoolean) +void +SMESH_DeviceActor +::Init(TVisualObjPtr theVisualObj, + vtkImplicitBoolean* theImplicitBoolean) { myVisualObj = theVisualObj; myExtractGeometry->SetImplicitFunction(theImplicitBoolean); @@ -175,8 +180,8 @@ void SMESH_DeviceActor::Init(TVisualObjPtr theVisualObj, void -SMESH_DeviceActor:: -SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed) +SMESH_DeviceActor +::SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed) { int anId = 0; if(theIsImplicitFunctionUsed) @@ -189,7 +194,10 @@ SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed) } -void SMESH_DeviceActor::SetUnstructuredGrid(vtkUnstructuredGrid* theGrid){ +void +SMESH_DeviceActor +::SetUnstructuredGrid(vtkUnstructuredGrid* theGrid) +{ if(theGrid){ //myIsShrinkable = theGrid->GetNumberOfCells() > 10; myIsShrinkable = true; @@ -231,20 +239,28 @@ void SMESH_DeviceActor::SetUnstructuredGrid(vtkUnstructuredGrid* theGrid){ } -VTKViewer_ExtractUnstructuredGrid* SMESH_DeviceActor::GetExtractUnstructuredGrid(){ +VTKViewer_ExtractUnstructuredGrid* +SMESH_DeviceActor +::GetExtractUnstructuredGrid() +{ return myExtractUnstructuredGrid; } -vtkUnstructuredGrid* SMESH_DeviceActor::GetUnstructuredGrid(){ +vtkUnstructuredGrid* +SMESH_DeviceActor +::GetUnstructuredGrid() +{ myExtractUnstructuredGrid->Update(); return myExtractUnstructuredGrid->GetOutput(); } -void SMESH_DeviceActor::SetControlMode(SMESH::Controls::FunctorPtr theFunctor, - vtkScalarBarActor* theScalarBarActor, - vtkLookupTable* theLookupTable) +void +SMESH_DeviceActor +::SetControlMode(SMESH::Controls::FunctorPtr theFunctor, + vtkScalarBarActor* theScalarBarActor, + vtkLookupTable* theLookupTable) { bool anIsInitialized = theFunctor; if(anIsInitialized){ @@ -284,6 +300,7 @@ void SMESH_DeviceActor::SetControlMode(SMESH::Controls::FunctorPtr theFunctor, aScalars->Delete(); theLookupTable->SetRange(aScalars->GetRange()); + theLookupTable->SetNumberOfTableValues(theScalarBarActor->GetMaximumNumberOfColors()); theLookupTable->Build(); myMergeFilter->SetScalars(aDataSet); @@ -293,9 +310,11 @@ void SMESH_DeviceActor::SetControlMode(SMESH::Controls::FunctorPtr theFunctor, theScalarBarActor->SetVisibility(anIsInitialized); } -void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor, - vtkScalarBarActor* theScalarBarActor, - vtkLookupTable* theLookupTable) +void +SMESH_DeviceActor +::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor, + vtkScalarBarActor* theScalarBarActor, + vtkLookupTable* theLookupTable) { bool anIsInitialized = theFunctor; myExtractUnstructuredGrid->ClearRegisteredCells(); @@ -347,7 +366,7 @@ void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor } } - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( aNbCells ); @@ -407,7 +426,7 @@ void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor } } - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( aNbCells ); @@ -432,7 +451,9 @@ void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor theScalarBarActor->SetVisibility(anIsInitialized); } -void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor) +void +SMESH_DeviceActor +::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor) { myExtractUnstructuredGrid->ClearRegisteredCells(); myExtractUnstructuredGrid->ClearRegisteredCellsWithType(); @@ -487,7 +508,7 @@ void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor } } - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( aNbCells ); @@ -505,7 +526,10 @@ void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor -unsigned long int SMESH_DeviceActor::GetMTime(){ +unsigned long int +SMESH_DeviceActor +::GetMTime() +{ unsigned long mTime = this->Superclass::GetMTime(); mTime = max(mTime,myExtractGeometry->GetMTime()); mTime = max(mTime,myExtractUnstructuredGrid->GetMTime()); @@ -516,12 +540,18 @@ unsigned long int SMESH_DeviceActor::GetMTime(){ } -void SMESH_DeviceActor::SetTransform(VTKViewer_Transform* theTransform){ +void +SMESH_DeviceActor +::SetTransform(VTKViewer_Transform* theTransform) +{ myTransformFilter->SetTransform(theTransform); } -void SMESH_DeviceActor::SetShrink() { +void +SMESH_DeviceActor +::SetShrink() +{ if ( !myIsShrinkable ) return; if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() ) { @@ -531,7 +561,10 @@ void SMESH_DeviceActor::SetShrink() { } } -void SMESH_DeviceActor::UnShrink() { +void +SMESH_DeviceActor +::UnShrink() +{ if ( !myIsShrunk ) return; if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() ) { @@ -543,18 +576,29 @@ void SMESH_DeviceActor::UnShrink() { } -void SMESH_DeviceActor::SetRepresentation(EReperesent theMode){ +void +SMESH_DeviceActor +::SetRepresentation(EReperesent theMode) +{ switch(theMode){ case ePoint: myGeomFilter->SetInside(true); + myGeomFilter->SetWireframeMode(false); GetProperty()->SetRepresentation(0); break; + case eWireframe: + myGeomFilter->SetInside(false); + myGeomFilter->SetWireframeMode(true); + GetProperty()->SetRepresentation(theMode); + break; case eInsideframe: myGeomFilter->SetInside(true); + myGeomFilter->SetWireframeMode(true); GetProperty()->SetRepresentation(1); break; - default : + case eSurface: myGeomFilter->SetInside(false); + myGeomFilter->SetWireframeMode(false); GetProperty()->SetRepresentation(theMode); } myRepresentation = theMode; @@ -564,7 +608,10 @@ void SMESH_DeviceActor::SetRepresentation(EReperesent theMode){ } -void SMESH_DeviceActor::SetVisibility(int theMode){ +void +SMESH_DeviceActor +::SetVisibility(int theMode) +{ if(!myExtractUnstructuredGrid->GetInput() || GetUnstructuredGrid()->GetNumberOfCells()) { @@ -575,7 +622,10 @@ void SMESH_DeviceActor::SetVisibility(int theMode){ } -int SMESH_DeviceActor::GetVisibility(){ +int +SMESH_DeviceActor +::GetVisibility() +{ if(!GetUnstructuredGrid()->GetNumberOfCells()){ vtkLODActor::SetVisibility(false); } @@ -583,7 +633,10 @@ int SMESH_DeviceActor::GetVisibility(){ } -int SMESH_DeviceActor::GetNodeObjId(int theVtkID){ +int +SMESH_DeviceActor +::GetNodeObjId(int theVtkID) +{ vtkIdType anID = theVtkID; if(IsImplicitFunctionUsed()) @@ -594,16 +647,22 @@ int SMESH_DeviceActor::GetNodeObjId(int theVtkID){ return aRetID; } -float* SMESH_DeviceActor::GetNodeCoord(int theObjID){ +vtkFloatingPointType* +SMESH_DeviceActor +::GetNodeCoord(int theObjID) +{ vtkDataSet* aDataSet = myMergeFilter->GetOutput(); vtkIdType anID = myVisualObj->GetNodeVTKId(theObjID); - float* aCoord = aDataSet->GetPoint(anID); + vtkFloatingPointType* aCoord = aDataSet->GetPoint(anID); if(MYDEBUG) MESSAGE("GetNodeCoord - theObjID = "< +#include +#include +#include +#include +#include +#include +#include using namespace std; @@ -80,8 +80,8 @@ void SMESH_ExtractGeometry::Execute() vtkIdList *cellPts; vtkCell *cell; int numCellPts; - float *x; - float multiplier; + vtkFloatingPointType *x; + vtkFloatingPointType multiplier; vtkPoints *newPts; vtkIdList *newCellPts; vtkDataSet *input = this->GetInput(); @@ -156,7 +156,7 @@ void SMESH_ExtractGeometry::Execute() // To extract boundary cells, we have to create supplemental information if ( this->ExtractBoundaryCells ) { - float val; + vtkFloatingPointType val; newScalars = vtkFloatArray::New(); newScalars->SetNumberOfValues(numPts); diff --git a/src/OBJECT/SMESH_ExtractGeometry.h b/src/OBJECT/SMESH_ExtractGeometry.h index c557718f9..97435e05e 100644 --- a/src/OBJECT/SMESH_ExtractGeometry.h +++ b/src/OBJECT/SMESH_ExtractGeometry.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef SALOME_ExtractGeometry_HeaderFile #define SALOME_ExtractGeometry_HeaderFile @@ -25,6 +25,7 @@ #include #include +#include "VTKViewer.h" class SMESHOBJECT_EXPORT SMESH_ExtractGeometry : public vtkExtractGeometry{ public: diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 93a67a582..4fdbcf0e6 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -31,13 +31,15 @@ #include "SMDS_Mesh.hxx" #include "SMESH_Actor.h" #include "SMESH_ControlsDef.hxx" -#include +#include "SalomeApp_Application.h" +#include "VTKViewer_ExtractUnstructuredGrid.h" +#include "VTKViewer_CellLocationsArray.h" +#include CORBA_SERVER_HEADER(SMESH_Gen) #include CORBA_SERVER_HEADER(SALOME_Exception) #include #include -#include #include #include @@ -69,271 +71,6 @@ static int MYDEBUGWITHFILES = 0; #endif -namespace{ - - inline const SMDS_MeshNode* FindNode(const SMDS_Mesh* theMesh, int theId){ - if(const SMDS_MeshNode* anElem = theMesh->FindNode(theId)) return anElem; - EXCEPTION(runtime_error,"SMDS_Mesh::FindNode - cannot find a SMDS_MeshNode for ID = "<FindElement(theId)) return anElem; - EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot find a SMDS_MeshElement for ID = "<AddNodeWithID(aCoords[aCoordId], - aCoords[aCoordId+1], - aCoords[aCoordId+2], - anIndexes[anElemId]); - if(!anElem) - EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddNodeWithID for ID = "<AddEdgeWithID(anIndexes[anIndexId+1], - anIndexes[anIndexId+2], - anIndexes[anIndexId]); - if(!anElem) - EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddEdgeWithID for ID = "<AddFaceWithID(anIndexes[anIndexId+1], - anIndexes[anIndexId+2], - anIndexes[anIndexId+3], - anIndexes[anIndexId]); - if(!anElem) - EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<AddFaceWithID(anIndexes[anIndexId+1], - anIndexes[anIndexId+2], - anIndexes[anIndexId+3], - anIndexes[anIndexId+4], - anIndexes[anIndexId]); - if(!anElem) - EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "< nodes_ids (aNbNodes); - for (int i = 0; i < aNbNodes; i++) { - nodes_ids[i] = anIndexes[anIndexId++]; - } - - SMDS_MeshElement* anElem = theMesh->AddPolygonalFaceWithID(nodes_ids, aFaceId); - if (!anElem) - EXCEPTION(runtime_error, "SMDS_Mesh::FindElement - cannot AddPolygonalFaceWithID for ID = " - << anElemId); - } - } - - - inline void AddTetrasWithID(SMDS_Mesh* theMesh, - SMESH::log_array_var& theSeq, - CORBA::Long theId) - { - const SMESH::long_array& anIndexes = theSeq[theId].indexes; - CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(5*aNbElems != anIndexes.length()) - EXCEPTION(runtime_error,"AddEdgeWithID - 5*aNbElems != anIndexes.length()"); - for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){ - SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], - anIndexes[anIndexId+2], - anIndexes[anIndexId+3], - anIndexes[anIndexId+4], - anIndexes[anIndexId]); - if(!anElem) - EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<AddVolumeWithID(anIndexes[anIndexId+1], - anIndexes[anIndexId+2], - anIndexes[anIndexId+3], - anIndexes[anIndexId+4], - anIndexes[anIndexId+5], - anIndexes[anIndexId]); - if(!anElem) - EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<AddVolumeWithID(anIndexes[anIndexId+1], - anIndexes[anIndexId+2], - anIndexes[anIndexId+3], - anIndexes[anIndexId+4], - anIndexes[anIndexId+5], - anIndexes[anIndexId+6], - anIndexes[anIndexId]); - if(!anElem) - EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<AddVolumeWithID(anIndexes[anIndexId+1], - anIndexes[anIndexId+2], - anIndexes[anIndexId+3], - anIndexes[anIndexId+4], - anIndexes[anIndexId+5], - anIndexes[anIndexId+6], - anIndexes[anIndexId+7], - anIndexes[anIndexId+8], - anIndexes[anIndexId]); - if(!anElem) - EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "< nodes_ids (aNbNodes); - for (int i = 0; i < aNbNodes; i++) { - nodes_ids[i] = anIndexes[anIndexId++]; - } - - int aNbFaces = anIndexes[anIndexId++]; - std::vector quantities (aNbFaces); - for (int i = 0; i < aNbFaces; i++) { - quantities[i] = anIndexes[anIndexId++]; - } - - SMDS_MeshElement* anElem = - theMesh->AddPolyhedralVolumeWithID(nodes_ids, quantities, aFaceId); - if (!anElem) - EXCEPTION(runtime_error, "SMDS_Mesh::FindElement - cannot AddPolyhedralVolumeWithID for ID = " - << anElemId); - } - } - - - inline void ChangePolyhedronNodes (SMDS_Mesh* theMesh, - SMESH::log_array_var& theSeq, - CORBA::Long theId) - { - const SMESH::long_array& anIndexes = theSeq[theId].indexes; - CORBA::Long iind = 0, aNbElems = theSeq[theId].number; - - for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) - { - // find element - const SMDS_MeshElement* elem = FindElement(theMesh, anIndexes[iind++]); - // nb nodes - int nbNodes = anIndexes[iind++]; - // nodes - std::vector aNodes (nbNodes); - for (int iNode = 0; iNode < nbNodes; iNode++) { - aNodes[iNode] = FindNode(theMesh, anIndexes[iind++]); - } - // nb faces - int nbFaces = anIndexes[iind++]; - // quantities - std::vector quantities (nbFaces); - for (int iFace = 0; iFace < nbFaces; iFace++) { - quantities[iFace] = anIndexes[iind++]; - } - // change - theMesh->ChangePolyhedronNodes(elem, aNodes, quantities); - } - } - - -} /* Class : SMESH_VisualObjDef Description : Base class for all mesh objects to be visuilised @@ -350,12 +87,16 @@ static inline vtkIdType getCellType( const SMDSAbs_ElementType theType, switch( theType ) { case SMDSAbs_Edge: - return theNbNodes == 2 ? VTK_LINE : VTK_EMPTY_CELL; + if( theNbNodes == 2 ) return VTK_LINE; + else if ( theNbNodes == 3 ) return VTK_QUADRATIC_EDGE; + else return VTK_EMPTY_CELL; case SMDSAbs_Face : if (thePoly && theNbNodes>2 ) return VTK_POLYGON; else if ( theNbNodes == 3 ) return VTK_TRIANGLE; else if ( theNbNodes == 4 ) return VTK_QUAD; + else if ( theNbNodes == 6 ) return VTK_QUADRATIC_TRIANGLE; + else if ( theNbNodes == 8 ) return VTK_QUADRATIC_QUAD; else return VTK_EMPTY_CELL; case SMDSAbs_Volume: @@ -364,6 +105,15 @@ static inline vtkIdType getCellType( const SMDSAbs_ElementType theType, else if ( theNbNodes == 5 ) return VTK_PYRAMID; else if ( theNbNodes == 6 ) return VTK_WEDGE; else if ( theNbNodes == 8 ) return VTK_HEXAHEDRON; + else if ( theNbNodes == 10 ) { + return VTK_QUADRATIC_TETRA; + } + else if ( theNbNodes == 20 ) { + return VTK_QUADRATIC_HEXAHEDRON; + } + else if ( theNbNodes==13 || theNbNodes==15 ) { + return VTK_CONVEX_POINT_SET; + } else return VTK_EMPTY_CELL; default: return VTK_EMPTY_CELL; @@ -485,42 +235,6 @@ void SMESH_VisualObjDef::buildNodePrs() aPoints->Delete(); myGrid->SetCells( 0, 0, 0 ); - - // Create cells - /* - int nbPoints = aPoints->GetNumberOfPoints(); - vtkIdList *anIdList = vtkIdList::New(); - anIdList->SetNumberOfIds( 1 ); - - vtkCellArray *aCells = vtkCellArray::New(); - aCells->Allocate( 2 * nbPoints, 0 ); - - vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New(); - aCellTypesArray->SetNumberOfComponents( 1 ); - aCellTypesArray->Allocate( nbPoints ); - - for( vtkIdType aCellId = 0; aCellId < nbPoints; aCellId++ ) - { - anIdList->SetId( 0, aCellId ); - aCells->InsertNextCell( anIdList ); - aCellTypesArray->InsertNextValue( VTK_VERTEX ); - } - - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); - aCellLocationsArray->SetNumberOfComponents( 1 ); - aCellLocationsArray->SetNumberOfTuples( nbPoints ); - - aCells->InitTraversal(); - for( vtkIdType i = 0, *pts, npts; aCells->GetNextCell( npts, pts ); i++ ) - aCellLocationsArray->SetValue( i, aCells->GetTraversalLocation( npts ) ); - - myGrid->SetCells( aCellTypesArray, aCellLocationsArray, aCells ); - - aCellLocationsArray->Delete(); - aCellTypesArray->Delete(); - aCells->Delete(); - anIdList->Delete(); - */ } //================================================================================= @@ -651,11 +365,34 @@ void SMESH_VisualObjDef::buildElemPrs() static int anIds[] = {0,1,2,3,4,5}; for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); - } else if (aNbNodes == 8) { + } + else if (aNbNodes == 8) { static int anIds[] = {0,3,2,1,4,7,6,5}; for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); - } else { + } + else if (aNbNodes == 10) { + static int anIds[] = {0,2,1,3,6,5,4,7,9,8}; + for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); + } + else if (aNbNodes == 13) { + static int anIds[] = {0,3,2,1,4,8,7,6,5,9,12,11,10}; + for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); + } + else if (aNbNodes == 15) { + static int anIds[] = {0,2,1,3,5,4,8,7,6,11,10,9,12,14,13}; + for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); + //for (int k = 0; k < aNbNodes; k++) { + // int nn = aConnectivities[k]; + // const SMDS_MeshNode* N = static_cast (aConnect[nn]); + // cout<<"k="<X()<<","<Y()<<","<Z()<<")"< 0) { @@ -681,7 +418,7 @@ void SMESH_VisualObjDef::buildElemPrs() // Insert cells in grid - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( aNbCells ); @@ -748,14 +485,11 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId, // function : SMESH_MeshObj // purpose : Constructor //================================================================================= -SMESH_MeshObj::SMESH_MeshObj(SMESH::SMESH_Mesh_ptr theMesh) +SMESH_MeshObj::SMESH_MeshObj(SMESH::SMESH_Mesh_ptr theMesh): + myClient(SalomeApp_Application::orb(),theMesh) { if ( MYDEBUG ) - MESSAGE("SMESH_MeshObj - theMesh->_is_nil() = "<_is_nil()); - - myMeshServer = SMESH::SMESH_Mesh::_duplicate( theMesh ); - myMeshServer->Register(); - myMesh = new SMDS_Mesh(); + MESSAGE("SMESH_MeshObj - this = "<_is_nil() = "<_is_nil()); } //================================================================================= @@ -764,8 +498,8 @@ SMESH_MeshObj::SMESH_MeshObj(SMESH::SMESH_Mesh_ptr theMesh) //================================================================================= SMESH_MeshObj::~SMESH_MeshObj() { - myMeshServer->Destroy(); - delete myMesh; + if ( MYDEBUG ) + MESSAGE("SMESH_MeshObj - this = "<GetLog( theIsClear ); - CORBA::Long aLength = aSeq->length(); - - if( MYDEBUG ) MESSAGE( "Update: length of the script is "<RemoveNode( FindNode( myMesh, anIndexes[anElemId] ) ); - break; - - case SMESH::REMOVE_ELEMENT: - for( ; anElemId < aNbElems; anElemId++ ) - myMesh->RemoveElement( FindElement( myMesh, anIndexes[anElemId] ) ); - break; - - case SMESH::MOVE_NODE: - for(CORBA::Long aCoordId=0; anElemId < aNbElems; anElemId++, aCoordId+=3) - { - SMDS_MeshNode* node = - const_cast( FindNode( myMesh, anIndexes[anElemId] )); - node->setXYZ( aCoords[aCoordId], aCoords[aCoordId+1], aCoords[aCoordId+2] ); - } - break; - - case SMESH::CHANGE_ELEMENT_NODES: - for ( CORBA::Long i = 0; anElemId < aNbElems; anElemId++ ) - { - // find element - const SMDS_MeshElement* elem = FindElement( myMesh, anIndexes[i++] ); - // nb nodes - int nbNodes = anIndexes[i++]; - // nodes - //ASSERT( nbNodes < 9 ); - const SMDS_MeshNode** aNodes = new const SMDS_MeshNode*[ nbNodes ]; - for ( int iNode = 0; iNode < nbNodes; iNode++ ) - aNodes[ iNode ] = FindNode( myMesh, anIndexes[i++] ); - // change - myMesh->ChangeElementNodes( elem, aNodes, nbNodes ); - } - break; - - case SMESH::CHANGE_POLYHEDRON_NODES: - ChangePolyhedronNodes(myMesh, aSeq, anId); - break; - case SMESH::RENUMBER: - for(CORBA::Long i=0; anElemId < aNbElems; anElemId++, i+=3) - { - myMesh->Renumber( anIndexes[i], anIndexes[i+1], anIndexes[i+2] ); - } - break; - - default:; - } - } - } - catch ( SALOME::SALOME_Exception& exc ) - { - INFOS("Following exception was cought:\n\t"<NbNodes() = "<NbNodes()); - MESSAGE("Update - myMesh->NbEdges() = "<NbEdges()); - MESSAGE("Update - myMesh->NbFaces() = "<NbFaces()); - MESSAGE("Update - myMesh->NbVolumes() = "<NbVolumes()); - } - - // Fill unstructured grid - buildPrs(); + if ( myClient.Update(theIsClear) ) + buildPrs(); // Fill unstructured grid } //================================================================================= @@ -887,7 +519,7 @@ void SMESH_MeshObj::Update( int theIsClear ) //================================================================================= int SMESH_MeshObj::GetElemDimension( const int theObjId ) { - const SMDS_MeshElement* anElem = myMesh->FindElement( theObjId ); + const SMDS_MeshElement* anElem = myClient->FindElement( theObjId ); if ( anElem == 0 ) return 0; @@ -911,22 +543,22 @@ int SMESH_MeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const { case SMDSAbs_Node: { - return myMesh->NbNodes(); + return myClient->NbNodes(); } break; case SMDSAbs_Edge: { - return myMesh->NbEdges(); + return myClient->NbEdges(); } break; case SMDSAbs_Face: { - return myMesh->NbFaces(); + return myClient->NbFaces(); } break; case SMDSAbs_Volume: { - return myMesh->NbVolumes(); + return myClient->NbVolumes(); } break; default: @@ -943,25 +575,25 @@ int SMESH_MeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& { case SMDSAbs_Node: { - SMDS_NodeIteratorPtr anIter = myMesh->nodesIterator(); + SMDS_NodeIteratorPtr anIter = myClient->nodesIterator(); while ( anIter->more() ) theObjs.push_back( anIter->next() ); } break; case SMDSAbs_Edge: { - SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator(); + SMDS_EdgeIteratorPtr anIter = myClient->edgesIterator(); while ( anIter->more() ) theObjs.push_back( anIter->next() ); } break; case SMDSAbs_Face: { - SMDS_FaceIteratorPtr anIter = myMesh->facesIterator(); + SMDS_FaceIteratorPtr anIter = myClient->facesIterator(); while ( anIter->more() ) theObjs.push_back( anIter->next() ); } break; case SMDSAbs_Volume: { - SMDS_VolumeIteratorPtr anIter = myMesh->volumesIterator(); + SMDS_VolumeIteratorPtr anIter = myClient->volumesIterator(); while ( anIter->more() ) theObjs.push_back( anIter->next() ); } break; @@ -987,7 +619,7 @@ void SMESH_MeshObj::UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor //================================================================================= bool SMESH_MeshObj::IsNodePrs() const { - return myMesh->NbEdges() == 0 &&myMesh->NbFaces() == 0 &&myMesh->NbVolumes() == 0 ; + return myClient->NbEdges() == 0 &&myClient->NbFaces() == 0 && myClient->NbVolumes() == 0 ; } @@ -1256,15 +888,3 @@ bool SMESH_subMeshObj::IsNodePrs() const { return mySubMeshServer->GetNumberOfElements() == 0; } - - - - - - - - - - - - diff --git a/src/OBJECT/SMESH_Object.h b/src/OBJECT/SMESH_Object.h index 5d7a1580a..9e2f49dcf 100644 --- a/src/OBJECT/SMESH_Object.h +++ b/src/OBJECT/SMESH_Object.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/OBJECT/SMESH_ObjectDef.h b/src/OBJECT/SMESH_ObjectDef.h index fb0ca9771..327664867 100644 --- a/src/OBJECT/SMESH_ObjectDef.h +++ b/src/OBJECT/SMESH_ObjectDef.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -29,6 +29,10 @@ #ifndef SMESH_OBJECTDEF_H #define SMESH_OBJECTDEF_H +#include "SMESH_Controls.hxx" +#include "SMESH_Object.h" +#include "SMESH_Client.hxx" + // IDL Headers #include #include CORBA_SERVER_HEADER(SMESH_Mesh) @@ -37,9 +41,6 @@ #include #include -#include "SMESH_Controls.hxx" -#include "SMESH_Object.h" - class vtkPoints; class SALOME_ExtractUnstructuredGrid; @@ -121,13 +122,11 @@ public: virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ); - SMESH::SMESH_Mesh_ptr GetMeshServer() { return myMeshServer.in(); } - SMDS_Mesh* GetMesh() const { return myMesh; } + SMESH::SMESH_Mesh_ptr GetMeshServer() { return myClient.GetMeshServer(); } + SMDS_Mesh* GetMesh() const { return myClient.GetMesh(); } protected: - - SMESH::SMESH_Mesh_var myMeshServer; - SMDS_Mesh* myMesh; + SMESH_Client myClient; }; diff --git a/src/SMDS/Makefile.in b/src/SMDS/Makefile.in index 32fc0da59..01df90ab4 100644 --- a/src/SMDS/Makefile.in +++ b/src/SMDS/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -29,6 +29,7 @@ top_srcdir=@top_srcdir@ top_builddir=../.. srcdir=@srcdir@ VPATH=.:@srcdir@:@top_srcdir@/idl +KERNEL_CXXFLAGS=@KERNEL_CXXFLAGS@ @COMMENCE@ @@ -59,21 +60,10 @@ LIB_SRC = \ SMDS_FaceOfEdges.cxx \ SMDS_FaceOfNodes.cxx \ SMDS_PolygonalFaceOfNodes.cxx \ - SMDS_VolumeTool.cxx -# SMDS_Tria3OfNodes.cxx \ -# SMDS_HexahedronOfNodes.cxx - -#SMDSControl_BoundaryEdges.cxx \ -#SMDSControl_BoundaryFaces.cxx \ -#SMDSControl.cxx \ -#SMDSControl_MeshBoundary.cxx \ -#SMDSEdit_Transform.cxx \ -#SMDS_MeshNodeIDFactory.cxx \ -#SMDS_MeshPrism.cxx \ -#SMDS_MeshPyramid.cxx \ -#SMDS_MeshQuadrangle.cxx \ -#SMDS_MeshTetrahedron.cxx \ -#SMDS_MeshTriangle.cxx \ + SMDS_VolumeTool.cxx \ + SMDS_QuadraticEdge.cxx \ + SMDS_QuadraticFaceOfNodes.cxx \ + SMDS_QuadraticVolumeOfNodes.cxx LIB_CLIENT_IDL = @@ -114,26 +104,16 @@ EXPORT_HEADERS= \ SMDS_FaceOfNodes.hxx \ SMDS_PolygonalFaceOfNodes.hxx \ SMDS_VolumeTool.hxx \ + SMDS_QuadraticEdge.hxx \ + SMDS_QuadraticFaceOfNodes.hxx \ + SMDS_QuadraticVolumeOfNodes.hxx \ + SMDS_SetIterator.hxx \ SMESH_SMDS.hxx -# SMDS_Tria3OfNodes.hxx \ -# SMDS_HexahedronOfNodes.hxx - -#SMDSControl_BoundaryEdges.hxx \ -#SMDSControl_BoundaryFaces.hxx \ -#SMDSControl.hxx \ -#SMDSControl_MeshBoundary.hxx \ -#SMDSEdit_Transform.hxx \ -#SMDS_MeshPrism.hxx \ -#SMDS_MeshPyramid.hxx \ -#SMDS_MeshQuadrangle.hxx \ -#SMDS_MeshTetrahedron.hxx \ -#SMDS_MeshTriangle.hxx \ -#SMDS_MeshNodeIDFactory.hxx # additionnal information to compil and link file -CPPFLAGS += -I${KERNEL_ROOT_DIR}/include/salome $(OCC_INCLUDES) $(BOOST_CPPFLAGS) -CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome -LDFLAGS += -L${KERNEL_ROOT_DIR}/lib/salome $(OCC_KERNEL_LIBS) +CPPFLAGS += $(KERNEL_CXXFLAGS) $(OCC_INCLUDES) $(BOOST_CPPFLAGS) +CXXFLAGS += $(KERNEL_CXXFLAGS) +LDFLAGS += $(KERNEL_LDFLAGS) $(OCC_KERNEL_LIBS) # additional file to be cleaned diff --git a/src/SMDS/SMDSAbs_ElementType.hxx b/src/SMDS/SMDSAbs_ElementType.hxx index c474a4e55..fed89972f 100644 --- a/src/SMDS/SMDSAbs_ElementType.hxx +++ b/src/SMDS/SMDSAbs_ElementType.hxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org or email : webmaster@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_EdgePosition.cxx b/src/SMDS/SMDS_EdgePosition.cxx index 82c92b398..836b01e3a 100644 --- a/src/SMDS/SMDS_EdgePosition.cxx +++ b/src/SMDS/SMDS_EdgePosition.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_EdgePosition.hxx b/src/SMDS/SMDS_EdgePosition.hxx index a8d85c256..a89e77400 100644 --- a/src/SMDS/SMDS_EdgePosition.hxx +++ b/src/SMDS/SMDS_EdgePosition.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_ElemIterator.hxx b/src/SMDS/SMDS_ElemIterator.hxx index c8432afdd..624113cf0 100755 --- a/src/SMDS/SMDS_ElemIterator.hxx +++ b/src/SMDS/SMDS_ElemIterator.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -33,8 +33,24 @@ #include class SMDS_MeshElement; +class SMDS_MeshNode; +class SMDS_MeshEdge; +class SMDS_MeshFace; +class SMDS_MeshVolume; typedef SMDS_Iterator SMDS_ElemIterator; typedef boost::shared_ptr > SMDS_ElemIteratorPtr; +typedef SMDS_Iterator SMDS_NodeIterator; +typedef boost::shared_ptr > SMDS_NodeIteratorPtr; + +typedef SMDS_Iterator SMDS_EdgeIterator; +typedef boost::shared_ptr > SMDS_EdgeIteratorPtr; + +typedef SMDS_Iterator SMDS_FaceIterator; +typedef boost::shared_ptr > SMDS_FaceIteratorPtr; + +typedef SMDS_Iterator SMDS_VolumeIterator; +typedef boost::shared_ptr > SMDS_VolumeIteratorPtr; + #endif diff --git a/src/SMDS/SMDS_FaceOfEdges.cxx b/src/SMDS/SMDS_FaceOfEdges.cxx index 640c55d30..2e5651fff 100644 --- a/src/SMDS/SMDS_FaceOfEdges.cxx +++ b/src/SMDS/SMDS_FaceOfEdges.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifdef _MSC_VER #pragma warning(disable:4786) @@ -155,3 +155,29 @@ SMDS_FaceOfEdges::SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1, }*/ + +int SMDS_FaceOfEdges::NbNodes() const +{ + return myEdges[0]->NbNodes() + myEdges[1]->NbNodes() + myEdges[2]->NbNodes() + + ( myNbEdges == 4 ? myEdges[3]->NbNodes() : 0 ) - myNbEdges; +} + +/*! + * \brief Return node by its index + * \param ind - node index + * \retval const SMDS_MeshNode* - the node + * + * Index is wrapped if it is out of a valid range + */ +const SMDS_MeshNode* SMDS_FaceOfEdges::GetNode(const int ind) const +{ + int index = WrappedIndex( ind ); + for ( int i = 0; i < myNbEdges; ++i ) { + if ( index >= myEdges[ i ]->NbNodes() ) + index -= myEdges[ i ]->NbNodes(); + else + return myEdges[ i ]->GetNode( index ); + } + return 0; +} + diff --git a/src/SMDS/SMDS_FaceOfEdges.hxx b/src/SMDS/SMDS_FaceOfEdges.hxx index a314697e3..4a0a8850c 100644 --- a/src/SMDS/SMDS_FaceOfEdges.hxx +++ b/src/SMDS/SMDS_FaceOfEdges.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _SMDS_FaceOfEdges_HeaderFile #define _SMDS_FaceOfEdges_HeaderFile @@ -44,10 +44,21 @@ class SMDS_EXPORT SMDS_FaceOfEdges:public SMDS_MeshFace const SMDS_MeshEdge* edge4); SMDSAbs_ElementType GetType() const; + int NbNodes() const; int NbEdges() const; int NbFaces() const; // friend bool operator<(const SMDS_FaceOfEdges& e1, const SMDS_FaceOfEdges& e2); + + /*! + * \brief Return node by its index + * \param ind - node index + * \retval const SMDS_MeshNode* - the node + * + * Index is wrapped if it is out of a valid range + */ + virtual const SMDS_MeshNode* GetNode(const int ind) const; + protected: SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const; diff --git a/src/SMDS/SMDS_FaceOfNodes.cxx b/src/SMDS/SMDS_FaceOfNodes.cxx index aa6870824..0ad564ef7 100644 --- a/src/SMDS/SMDS_FaceOfNodes.cxx +++ b/src/SMDS/SMDS_FaceOfNodes.cxx @@ -17,12 +17,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifdef _MSC_VER #pragma warning(disable:4786) #endif +#include "SMDS_SetIterator.hxx" #include "SMDS_FaceOfNodes.hxx" #include "SMDS_IteratorOfElements.hxx" #include "SMDS_MeshNode.hxx" @@ -68,25 +69,11 @@ void SMDS_FaceOfNodes::Print(ostream & OS) const //purpose : //======================================================================= -class SMDS_FaceOfNodes_MyIterator:public SMDS_ElemIterator +class SMDS_FaceOfNodes_MyIterator:public SMDS_NodeArrayElemIterator { - const SMDS_MeshNode* const *mySet; - int myLength; - int index; public: SMDS_FaceOfNodes_MyIterator(const SMDS_MeshNode* const *s, int l): - mySet(s),myLength(l),index(0) {} - - bool more() - { - return index set1,set2; diff --git a/src/SMDS/SMDS_FaceOfNodes.hxx b/src/SMDS/SMDS_FaceOfNodes.hxx index 1ce06047c..7779c6ffd 100644 --- a/src/SMDS/SMDS_FaceOfNodes.hxx +++ b/src/SMDS/SMDS_FaceOfNodes.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _SMDS_FaceOfNodes_HeaderFile #define _SMDS_FaceOfNodes_HeaderFile @@ -46,6 +46,16 @@ class SMDS_EXPORT SMDS_FaceOfNodes:public SMDS_MeshFace int NbEdges() const; int NbFaces() const; int NbNodes() const; + + /*! + * \brief Return node by its index + * \param ind - node index + * \retval const SMDS_MeshNode* - the node + * + * Index is wrapped if it is out of a valid range + */ + virtual const SMDS_MeshNode* GetNode(const int ind) const; + protected: SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const; diff --git a/src/SMDS/SMDS_FacePosition.cxx b/src/SMDS/SMDS_FacePosition.cxx index c97e64f7a..835f17bc6 100644 --- a/src/SMDS/SMDS_FacePosition.cxx +++ b/src/SMDS/SMDS_FacePosition.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_FacePosition.hxx b/src/SMDS/SMDS_FacePosition.hxx index 7c6a2fa04..d928efe58 100644 --- a/src/SMDS/SMDS_FacePosition.hxx +++ b/src/SMDS/SMDS_FacePosition.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_Iterator.hxx b/src/SMDS/SMDS_Iterator.hxx index 21824c1e7..5d17b6fa2 100644 --- a/src/SMDS/SMDS_Iterator.hxx +++ b/src/SMDS/SMDS_Iterator.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _SMDS_Iterator_HeaderFile #define _SMDS_Iterator_HeaderFile diff --git a/src/SMDS/SMDS_IteratorOfElements.cxx b/src/SMDS/SMDS_IteratorOfElements.cxx index 472ae0d54..77a00c802 100644 --- a/src/SMDS/SMDS_IteratorOfElements.cxx +++ b/src/SMDS/SMDS_IteratorOfElements.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifdef _MSC_VER #pragma warning(disable:4786) diff --git a/src/SMDS/SMDS_IteratorOfElements.hxx b/src/SMDS/SMDS_IteratorOfElements.hxx index ba44c1841..02569d81a 100644 --- a/src/SMDS/SMDS_IteratorOfElements.hxx +++ b/src/SMDS/SMDS_IteratorOfElements.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "SMESH_SMDS.hxx" diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index 6381e547e..26a998117 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifdef _MSC_VER #pragma warning(disable:4786) @@ -31,6 +31,9 @@ #include "SMDS_FaceOfEdges.hxx" #include "SMDS_PolyhedralVolumeOfNodes.hxx" #include "SMDS_PolygonalFaceOfNodes.hxx" +#include "SMDS_QuadraticEdge.hxx" +#include "SMDS_QuadraticFaceOfNodes.hxx" +#include "SMDS_QuadraticVolumeOfNodes.hxx" #include #include @@ -138,6 +141,8 @@ SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, int ID) { + if ( !n1 || !n2 ) return 0; + SMDS_MeshEdge * edge=new SMDS_MeshEdge(n1,n2); if(myElementIDFactory->BindID(ID, edge)) { SMDS_MeshNode *node1,*node2; @@ -190,7 +195,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, { SMDS_MeshFace * face=createTriangle(n1, n2, n3); - if (!registerElement(ID, face)) { + if (face && !registerElement(ID, face)) { RemoveElement(face, false); face = NULL; } @@ -241,7 +246,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, { SMDS_MeshFace * face=createQuadrangle(n1, n2, n3, n4); - if (!registerElement(ID, face)) { + if (face && !registerElement(ID, face)) { RemoveElement(face, false); face = NULL; } @@ -273,6 +278,8 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshEdge * e1, { if (!hasConstructionEdges()) return NULL; + if ( !e1 || !e2 || !e3 ) return 0; + SMDS_MeshFace * face = new SMDS_FaceOfEdges(e1,e2,e3); myFaces.Add(face); @@ -310,6 +317,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshEdge * e1, { if (!hasConstructionEdges()) return NULL; + if ( !e1 || !e2 || !e3 || !e4 ) return 0; SMDS_MeshFace * face = new SMDS_FaceOfEdges(e1,e2,e3,e4); myFaces.Add(face); @@ -371,7 +379,8 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n4, int ID) { - SMDS_MeshVolume* volume; + SMDS_MeshVolume* volume = 0; + if ( !n1 || !n2 || !n3 || !n4) return volume; if(hasConstructionFaces()) { SMDS_MeshFace * f1=FindFaceOrCreate(n1,n2,n3); SMDS_MeshFace * f2=FindFaceOrCreate(n1,n2,n4); @@ -453,7 +462,8 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n5, int ID) { - SMDS_MeshVolume* volume; + SMDS_MeshVolume* volume = 0; + if ( !n1 || !n2 || !n3 || !n4 || !n5) return volume; if(hasConstructionFaces()) { SMDS_MeshFace * f1=FindFaceOrCreate(n1,n2,n3,n4); SMDS_MeshFace * f2=FindFaceOrCreate(n1,n2,n5); @@ -539,7 +549,8 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n6, int ID) { - SMDS_MeshVolume* volume; + SMDS_MeshVolume* volume = 0; + if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6) return volume; if(hasConstructionFaces()) { SMDS_MeshFace * f1=FindFaceOrCreate(n1,n2,n3); SMDS_MeshFace * f2=FindFaceOrCreate(n4,n5,n6); @@ -637,7 +648,8 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n8, int ID) { - SMDS_MeshVolume* volume; + SMDS_MeshVolume* volume = 0; + if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8) return volume; if(hasConstructionFaces()) { SMDS_MeshFace * f1=FindFaceOrCreate(n1,n2,n3,n4); SMDS_MeshFace * f2=FindFaceOrCreate(n5,n6,n7,n8); @@ -694,6 +706,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshFace * f1, { if (!hasConstructionFaces()) return NULL; + if ( !f1 || !f2 || !f3 || !f4) return 0; SMDS_MeshVolume * volume = new SMDS_VolumeOfFaces(f1,f2,f3,f4); myVolumes.Add(volume); @@ -735,6 +748,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshFace * f1, { if (!hasConstructionFaces()) return NULL; + if ( !f1 || !f2 || !f3 || !f4 || !f5) return 0; SMDS_MeshVolume * volume = new SMDS_VolumeOfFaces(f1,f2,f3,f4,f5); myVolumes.Add(volume); @@ -778,6 +792,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshFace * f1, { if (!hasConstructionFaces()) return NULL; + if ( !f1 || !f2 || !f3 || !f4 || !f5 || !f6) return 0; SMDS_MeshVolume * volume = new SMDS_VolumeOfFaces(f1,f2,f3,f4,f5,f6); myVolumes.Add(volume); @@ -821,6 +836,8 @@ SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID } else { + for ( int i = 0; i < nodes.size(); ++i ) + if ( !nodes[ i ] ) return 0; face = new SMDS_PolygonalFaceOfNodes(nodes); myFaces.Add(face); } @@ -882,6 +899,8 @@ SMDS_MeshVolume* SMDS_Mesh::AddPolyhedralVolumeWithID MESSAGE("Error : Not implemented"); return NULL; } else { + for ( int i = 0; i < nodes.size(); ++i ) + if ( !nodes[ i ] ) return 0; volume = new SMDS_PolyhedralVolumeOfNodes(nodes, quantities); myVolumes.Add(volume); } @@ -941,6 +960,7 @@ SMDS_MeshFace * SMDS_Mesh::createTriangle(const SMDS_MeshNode * node1, const SMDS_MeshNode * node2, const SMDS_MeshNode * node3) { + if ( !node1 || !node2 || !node3) return 0; if(hasConstructionEdges()) { SMDS_MeshEdge *edge1, *edge2, *edge3; @@ -969,6 +989,7 @@ SMDS_MeshFace * SMDS_Mesh::createQuadrangle(const SMDS_MeshNode * node1, const SMDS_MeshNode * node3, const SMDS_MeshNode * node4) { + if ( !node1 || !node2 || !node3 || !node4 ) return 0; if(hasConstructionEdges()) { SMDS_MeshEdge *edge1, *edge2, *edge3, *edge4; @@ -1084,19 +1105,32 @@ bool SMDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * elem, if ( edge ) Ok = const_cast( edge )->ChangeNodes( nodes[0], nodes[1] ); } + else if ( nbnodes == 3 ) { + const SMDS_QuadraticEdge* edge = dynamic_cast( elem ); + if ( edge ) + Ok = const_cast( edge )->ChangeNodes( nodes[0], nodes[1], nodes[2] ); + } break; } case SMDSAbs_Face: { const SMDS_FaceOfNodes* face = dynamic_cast( elem ); if ( face ) { Ok = const_cast( face )->ChangeNodes( nodes, nbnodes ); - } else { - /// ??? begin - const SMDS_PolygonalFaceOfNodes* face = dynamic_cast(elem); - if (face) { - Ok = const_cast(face)->ChangeNodes(nodes, nbnodes); + } + else { + const SMDS_QuadraticFaceOfNodes* QF = + dynamic_cast( elem ); + if ( QF ) { + Ok = const_cast( QF )->ChangeNodes( nodes, nbnodes ); + } + else { + /// ??? begin + const SMDS_PolygonalFaceOfNodes* face = dynamic_cast(elem); + if (face) { + Ok = const_cast(face)->ChangeNodes(nodes, nbnodes); + } + /// ??? end } - /// ??? end } break; } @@ -1109,8 +1143,15 @@ bool SMDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * elem, //} case SMDSAbs_Volume: { const SMDS_VolumeOfNodes* vol = dynamic_cast( elem ); - if ( vol ) + if ( vol ) { Ok = const_cast( vol )->ChangeNodes( nodes, nbnodes ); + } + else { + const SMDS_QuadraticVolumeOfNodes* QV = dynamic_cast( elem ); + if ( QV ) { + Ok = const_cast( QV )->ChangeNodes( nodes, nbnodes ); + } + } break; } default: @@ -1200,6 +1241,7 @@ bool SMDS_Mesh::ChangePolyhedronNodes (const SMDS_MeshElement * elem, return Ok; } + //======================================================================= //function : FindEdge //purpose : @@ -1207,54 +1249,96 @@ bool SMDS_Mesh::ChangePolyhedronNodes (const SMDS_MeshElement * elem, const SMDS_MeshEdge* SMDS_Mesh::FindEdge(int idnode1, int idnode2) const { - const SMDS_MeshNode * node1=FindNode(idnode1); - const SMDS_MeshNode * node2=FindNode(idnode2); - if((node1==NULL)||(node2==NULL)) return NULL; - return FindEdge(node1,node2); + const SMDS_MeshNode * node1=FindNode(idnode1); + const SMDS_MeshNode * node2=FindNode(idnode2); + if((node1==NULL)||(node2==NULL)) return NULL; + return FindEdge(node1,node2); } //#include "Profiler.h" const SMDS_MeshEdge* SMDS_Mesh::FindEdge(const SMDS_MeshNode * node1, const SMDS_MeshNode * node2) { - const SMDS_MeshEdge * toReturn=NULL; - //PROFILER_Init(); - //PROFILER_Set(); - SMDS_ElemIteratorPtr it1=node1->edgesIterator(); - //PROFILER_Get(0); - //PROFILER_Set(); - while(it1->more()) - { - const SMDS_MeshEdge * e=static_cast - (it1->next()); - SMDS_ElemIteratorPtr it2=e->nodesIterator(); - while(it2->more()) - { - if(it2->next()->GetID()==node2->GetID()) - { - toReturn=e; - break; - } - } - } - //PROFILER_Get(1); - return toReturn; + const SMDS_MeshEdge * toReturn=NULL; + //PROFILER_Init(); + //PROFILER_Set(); + SMDS_ElemIteratorPtr it1=node1->edgesIterator(); + //PROFILER_Get(0); + //PROFILER_Set(); + while(it1->more()) { + const SMDS_MeshEdge * e=static_cast (it1->next()); + SMDS_ElemIteratorPtr it2=e->nodesIterator(); + while(it2->more()) { + if(it2->next()->GetID()==node2->GetID()) { + toReturn = e; + break; + } + } + } + //PROFILER_Get(1); + return toReturn; } +//======================================================================= +//function : FindEdgeOrCreate +//purpose : +//======================================================================= + SMDS_MeshEdge* SMDS_Mesh::FindEdgeOrCreate(const SMDS_MeshNode * node1, - const SMDS_MeshNode * node2) + const SMDS_MeshNode * node2) +{ + if ( !node1 || !node2) return 0; + SMDS_MeshEdge * toReturn=NULL; + toReturn=const_cast(FindEdge(node1,node2)); + if(toReturn==NULL) { + toReturn=new SMDS_MeshEdge(node1,node2); + myEdges.Add(toReturn); + } + return toReturn; +} + + +//======================================================================= +//function : FindEdge +//purpose : +//======================================================================= + +const SMDS_MeshEdge* SMDS_Mesh::FindEdge(int idnode1, int idnode2, + int idnode3) const { - SMDS_MeshEdge * toReturn=NULL; - toReturn=const_cast(FindEdge(node1,node2)); - if(toReturn==NULL) - { - toReturn=new SMDS_MeshEdge(node1,node2); - myEdges.Add(toReturn); - } - return toReturn; + const SMDS_MeshNode * node1=FindNode(idnode1); + const SMDS_MeshNode * node2=FindNode(idnode2); + const SMDS_MeshNode * node3=FindNode(idnode3); + return FindEdge(node1,node2,node3); +} + +const SMDS_MeshEdge* SMDS_Mesh::FindEdge(const SMDS_MeshNode * node1, + const SMDS_MeshNode * node2, + const SMDS_MeshNode * node3) +{ + if ( !node1 || !node2 || !node3 ) return 0; + const SMDS_MeshEdge * toReturn = NULL; + SMDS_ElemIteratorPtr it1 = node1->edgesIterator(); + while(it1->more()) { + const SMDS_MeshEdge * e = static_cast (it1->next()); + SMDS_ElemIteratorPtr it2 = e->nodesIterator(); + int tmp = 0; + while(it2->more()) { + int nID = it2->next()->GetID(); + if( nID==node2->GetID() || nID==node3->GetID() ) { + tmp++; + if(tmp==2) { + toReturn = e; + break; + } + } + } + } + return toReturn; } + //======================================================================= //function : FindFace //purpose : @@ -1263,118 +1347,219 @@ SMDS_MeshEdge* SMDS_Mesh::FindEdgeOrCreate(const SMDS_MeshNode * node1, const SMDS_MeshFace* SMDS_Mesh::FindFace(int idnode1, int idnode2, int idnode3) const { - const SMDS_MeshNode * node1=FindNode(idnode1); - const SMDS_MeshNode * node2=FindNode(idnode2); - const SMDS_MeshNode * node3=FindNode(idnode3); - if((node1==NULL)||(node2==NULL)||(node3==NULL)) return NULL; - return FindFace(node1, node2, node3); + const SMDS_MeshNode * node1=FindNode(idnode1); + const SMDS_MeshNode * node2=FindNode(idnode2); + const SMDS_MeshNode * node3=FindNode(idnode3); + return FindFace(node1, node2, node3); } -const SMDS_MeshFace* SMDS_Mesh::FindFace( - const SMDS_MeshNode *node1, - const SMDS_MeshNode *node2, - const SMDS_MeshNode *node3) +const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1, + const SMDS_MeshNode *node2, + const SMDS_MeshNode *node3) { - const SMDS_MeshFace * face; - const SMDS_MeshElement * node; - bool node2found, node3found; - - SMDS_ElemIteratorPtr it1=node1->facesIterator(); - while(it1->more()) - { - face=static_cast(it1->next()); - if(face->NbNodes()!=3) continue; - SMDS_ElemIteratorPtr it2=face->nodesIterator(); - node2found=false; - node3found=false; - while(it2->more()) - { - node=it2->next(); - if(node->GetID()==node2->GetID()) node2found=true; - if(node->GetID()==node3->GetID()) node3found=true; - } - if(node2found&&node3found) - return face; - } - return NULL; + if ( !node1 || !node2 || !node3 ) return 0; + const SMDS_MeshFace * face; + const SMDS_MeshElement * node; + bool node2found, node3found; + + SMDS_ElemIteratorPtr it1 = node1->facesIterator(); + while(it1->more()) { + face = static_cast(it1->next()); + if(face->NbNodes()!=3) continue; + SMDS_ElemIteratorPtr it2 = face->nodesIterator(); + node2found = false; + node3found = false; + while(it2->more()) { + node = it2->next(); + if(node->GetID()==node2->GetID()) node2found = true; + if(node->GetID()==node3->GetID()) node3found = true; + } + if( node2found && node3found ) + return face; + } + return NULL; } -SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate( - const SMDS_MeshNode *node1, - const SMDS_MeshNode *node2, - const SMDS_MeshNode *node3) +SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate(const SMDS_MeshNode *node1, + const SMDS_MeshNode *node2, + const SMDS_MeshNode *node3) { - SMDS_MeshFace * toReturn=NULL; - toReturn=const_cast(FindFace(node1,node2,node3)); - if(toReturn==NULL) - { - toReturn=createTriangle(node1,node2,node3); - } - return toReturn; + SMDS_MeshFace * toReturn=NULL; + toReturn = const_cast(FindFace(node1,node2,node3)); + if(toReturn==NULL) { + toReturn = createTriangle(node1,node2,node3); + } + return toReturn; } + //======================================================================= //function : FindFace //purpose : //======================================================================= -const SMDS_MeshFace* SMDS_Mesh::FindFace(int idnode1, int idnode2, int idnode3, - int idnode4) const +const SMDS_MeshFace* SMDS_Mesh::FindFace(int idnode1, int idnode2, + int idnode3, int idnode4) const { - const SMDS_MeshNode * node1=FindNode(idnode1); - const SMDS_MeshNode * node2=FindNode(idnode2); - const SMDS_MeshNode * node3=FindNode(idnode3); - const SMDS_MeshNode * node4=FindNode(idnode4); - if((node1==NULL)||(node2==NULL)||(node3==NULL)||(node4==NULL)) return NULL; - return FindFace(node1, node2, node3, node4); + const SMDS_MeshNode * node1=FindNode(idnode1); + const SMDS_MeshNode * node2=FindNode(idnode2); + const SMDS_MeshNode * node3=FindNode(idnode3); + const SMDS_MeshNode * node4=FindNode(idnode4); + return FindFace(node1, node2, node3, node4); } -const SMDS_MeshFace* SMDS_Mesh::FindFace( - const SMDS_MeshNode *node1, - const SMDS_MeshNode *node2, - const SMDS_MeshNode *node3, - const SMDS_MeshNode *node4) +const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1, + const SMDS_MeshNode *node2, + const SMDS_MeshNode *node3, + const SMDS_MeshNode *node4) { - const SMDS_MeshFace * face; - const SMDS_MeshElement * node; - bool node2found, node3found, node4found; - SMDS_ElemIteratorPtr it1=node1->facesIterator(); - while(it1->more()) - { - face=static_cast(it1->next()); - if(face->NbNodes()!=4) continue; - SMDS_ElemIteratorPtr it2=face->nodesIterator(); - node2found=false; - node3found=false; - node4found=false; - while(it2->more()) - { - node=it2->next(); - if(node->GetID()==node2->GetID()) node2found=true; - if(node->GetID()==node3->GetID()) node3found=true; - if(node->GetID()==node4->GetID()) node4found=true; - } - if(node2found&&node3found&&node4found) - return face; - } - return NULL; + if( (node1==NULL) || (node2==NULL) || (node3==NULL) || (node4==NULL) ) + return NULL; + const SMDS_MeshFace * face; + const SMDS_MeshElement * node; + bool node2found, node3found, node4found; + SMDS_ElemIteratorPtr it1 = node1->facesIterator(); + while(it1->more()) { + face = static_cast(it1->next()); + if(face->NbNodes()!=4) continue; + SMDS_ElemIteratorPtr it2 = face->nodesIterator(); + node2found = false; + node3found = false; + node4found = false; + while(it2->more()) { + node=it2->next(); + if(node->GetID()==node2->GetID()) node2found = true; + if(node->GetID()==node3->GetID()) node3found = true; + if(node->GetID()==node4->GetID()) node4found = true; + } + if( node2found && node3found && node4found ) + return face; + } + return NULL; } -SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate( - const SMDS_MeshNode *node1, - const SMDS_MeshNode *node2, - const SMDS_MeshNode *node3, - const SMDS_MeshNode *node4) +SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate(const SMDS_MeshNode *node1, + const SMDS_MeshNode *node2, + const SMDS_MeshNode *node3, + const SMDS_MeshNode *node4) { - SMDS_MeshFace * toReturn=NULL; - toReturn=const_cast(FindFace(node1,node2,node3,node4)); - if(toReturn==NULL) - { - toReturn=createQuadrangle(node1,node2,node3,node4); - } - return toReturn; + SMDS_MeshFace * toReturn=NULL; + toReturn=const_cast(FindFace(node1,node2,node3,node4)); + if(toReturn==NULL) { + toReturn=createQuadrangle(node1,node2,node3,node4); + } + return toReturn; +} + + +//======================================================================= +//function : FindFace +//purpose :quadratic triangle +//======================================================================= + +const SMDS_MeshFace* SMDS_Mesh::FindFace(int idnode1, int idnode2, + int idnode3, int idnode4, + int idnode5, int idnode6) const +{ + const SMDS_MeshNode * node1 = FindNode(idnode1); + const SMDS_MeshNode * node2 = FindNode(idnode2); + const SMDS_MeshNode * node3 = FindNode(idnode3); + const SMDS_MeshNode * node4 = FindNode(idnode4); + const SMDS_MeshNode * node5 = FindNode(idnode5); + const SMDS_MeshNode * node6 = FindNode(idnode6); + return FindFace(node1, node2, node3, node4, node5, node6); +} + +const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1, + const SMDS_MeshNode *node2, + const SMDS_MeshNode *node3, + const SMDS_MeshNode *node4, + const SMDS_MeshNode *node5, + const SMDS_MeshNode *node6) +{ + if( (node1==NULL) || (node2==NULL) || (node3==NULL) || + (node4==NULL) || (node5==NULL) || (node6==NULL) ) return NULL; + const SMDS_MeshFace * face; + const SMDS_MeshElement * node; + SMDS_ElemIteratorPtr it1 = node1->facesIterator(); + while(it1->more()) { + face = static_cast(it1->next()); + if(face->NbNodes()!=6) continue; + SMDS_ElemIteratorPtr it2 = face->nodesIterator(); + int tmp = 0; + while(it2->more()) { + node = it2->next(); + if(node->GetID()==node2->GetID()) tmp++; + if(node->GetID()==node3->GetID()) tmp++; + if(node->GetID()==node4->GetID()) tmp++; + if(node->GetID()==node5->GetID()) tmp++; + if(node->GetID()==node6->GetID()) tmp++; + } + if( tmp==5 ) + return static_cast(face); + } + return NULL; +} + + +//======================================================================= +//function : FindFace +//purpose : quadratic quadrangle +//======================================================================= + +const SMDS_MeshFace* SMDS_Mesh::FindFace(int idnode1, int idnode2, + int idnode3, int idnode4, + int idnode5, int idnode6, + int idnode7, int idnode8) const +{ + const SMDS_MeshNode * node1 = FindNode(idnode1); + const SMDS_MeshNode * node2 = FindNode(idnode2); + const SMDS_MeshNode * node3 = FindNode(idnode3); + const SMDS_MeshNode * node4 = FindNode(idnode4); + const SMDS_MeshNode * node5 = FindNode(idnode5); + const SMDS_MeshNode * node6 = FindNode(idnode6); + const SMDS_MeshNode * node7 = FindNode(idnode7); + const SMDS_MeshNode * node8 = FindNode(idnode8); + return FindFace(node1, node2, node3, node4, node5, node6, node7, node8); +} + +const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1, + const SMDS_MeshNode *node2, + const SMDS_MeshNode *node3, + const SMDS_MeshNode *node4, + const SMDS_MeshNode *node5, + const SMDS_MeshNode *node6, + const SMDS_MeshNode *node7, + const SMDS_MeshNode *node8) +{ + if( (node1==NULL) || (node2==NULL) || (node3==NULL) || (node4==NULL) || + (node5==NULL) || (node6==NULL) || (node7==NULL) || (node8==NULL) ) + return NULL; + const SMDS_MeshFace * face; + const SMDS_MeshElement * node; + SMDS_ElemIteratorPtr it1 = node1->facesIterator(); + while(it1->more()) { + face = static_cast(it1->next()); + if(face->NbNodes()!=8) continue; + SMDS_ElemIteratorPtr it2 = face->nodesIterator(); + int tmp = 0; + while(it2->more()) { + node = it2->next(); + if(node->GetID()==node2->GetID()) tmp++; + if(node->GetID()==node3->GetID()) tmp++; + if(node->GetID()==node4->GetID()) tmp++; + if(node->GetID()==node5->GetID()) tmp++; + if(node->GetID()==node6->GetID()) tmp++; + if(node->GetID()==node7->GetID()) tmp++; + if(node->GetID()==node8->GetID()) tmp++; + } + if( tmp==7 ) + return face; + } + return NULL; } + //======================================================================= //function : FindElement //purpose : @@ -1382,7 +1567,7 @@ SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate( const SMDS_MeshElement* SMDS_Mesh::FindElement(int IDelem) const { - return myElementIDFactory->MeshElement(IDelem); + return myElementIDFactory->MeshElement(IDelem); } //======================================================================= @@ -1411,6 +1596,8 @@ const SMDS_MeshFace* SMDS_Mesh::FindFace (std::vector nod set faces; for (int inode = 0; inode < nbNodes && isFound; inode++) { + if ( !nodes[ inode ]) return 0; + set new_faces; SMDS_ElemIteratorPtr itF = nodes[inode]->facesIterator(); @@ -2075,6 +2262,57 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, delete s1; } + +/////////////////////////////////////////////////////////////////////////////// +///@param elem The element to delete +/////////////////////////////////////////////////////////////////////////////// +void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem) +{ + SMDSAbs_ElementType aType = elem->GetType(); + if (aType == SMDSAbs_Node) { + // only free node can be removed by this method + const SMDS_MeshNode* n = static_cast(elem); + SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator(); + if (!itFe->more()) { // free node + myNodes.Remove(const_cast(n)); + myNodeIDFactory->ReleaseID(elem->GetID()); + delete elem; + } + } else { + if (hasConstructionEdges() || hasConstructionFaces()) + // this methods is only for meshes without descendants + return; + + // Remove element from of its nodes + SMDS_ElemIteratorPtr itn = elem->nodesIterator(); + while (itn->more()) { + SMDS_MeshNode * n = static_cast + (const_cast(itn->next())); + n->RemoveInverseElement(elem); + } + + // in meshes without descendants elements are always free + switch (aType) { + case SMDSAbs_Edge: + myEdges.Remove(static_cast + (const_cast(elem))); + break; + case SMDSAbs_Face: + myFaces.Remove(static_cast + (const_cast(elem))); + break; + case SMDSAbs_Volume: + myVolumes.Remove(static_cast + (const_cast(elem))); + break; + default: + break; + } + myElementIDFactory->ReleaseID(elem->GetID()); + delete elem; + } +} + /*! * Checks if the element is present in mesh. * Useful to determine dead pointers. @@ -2200,4 +2438,573 @@ SMDSAbs_ElementType SMDS_Mesh::GetElementType( const int id, const bool iselem ) } else return elem->GetType(); -} \ No newline at end of file +} + + + +//******************************************************************** +//******************************************************************** +//******** ********* +//***** Methods for addition of quadratic elements ****** +//******** ********* +//******************************************************************** +//******************************************************************** + +//======================================================================= +//function : AddEdgeWithID +//purpose : +//======================================================================= +SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(int n1, int n2, int n12, int ID) +{ + return SMDS_Mesh::AddEdgeWithID + ((SMDS_MeshNode*) myNodeIDFactory->MeshElement(n1), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n2), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n12), + ID); +} + +//======================================================================= +//function : AddEdge +//purpose : +//======================================================================= +SMDS_MeshEdge* SMDS_Mesh::AddEdge(const SMDS_MeshNode* n1, + const SMDS_MeshNode* n2, + const SMDS_MeshNode* n12) +{ + return SMDS_Mesh::AddEdgeWithID(n1, n2, n12, myElementIDFactory->GetFreeID()); +} + +//======================================================================= +//function : AddEdgeWithID +//purpose : +//======================================================================= +SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n12, + int ID) +{ + if ( !n1 || !n2 || !n12 ) return 0; + SMDS_QuadraticEdge* edge = new SMDS_QuadraticEdge(n1,n2,n12); + if(myElementIDFactory->BindID(ID, edge)) { + SMDS_MeshNode *node1,*node2, *node12; + node1 = const_cast(n1); + node2 = const_cast(n2); + node12 = const_cast(n12); + node1->AddInverseElement(edge); + node2->AddInverseElement(edge); + node12->AddInverseElement(edge); + myEdges.Add(edge); + return edge; + } + else { + delete edge; + return NULL; + } +} + + +//======================================================================= +//function : AddFace +//purpose : +//======================================================================= +SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31) +{ + return SMDS_Mesh::AddFaceWithID(n1,n2,n3,n12,n23,n31, + myElementIDFactory->GetFreeID()); +} + +//======================================================================= +//function : AddFaceWithID +//purpose : +//======================================================================= +SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3, + int n12,int n23,int n31, int ID) +{ + return SMDS_Mesh::AddFaceWithID + ((SMDS_MeshNode *)myNodeIDFactory->MeshElement(n1) , + (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n2) , + (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n3) , + (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n12), + (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n23), + (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n31), + ID); +} + +//======================================================================= +//function : AddFaceWithID +//purpose : +//======================================================================= +SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + int ID) +{ + if ( !n1 || !n2 || !n3 || !n12 || !n23 || !n31) return 0; + if(hasConstructionEdges()) { + // creation quadratic edges - not implemented + return 0; + } + SMDS_QuadraticFaceOfNodes* face = + new SMDS_QuadraticFaceOfNodes(n1,n2,n3,n12,n23,n31); + myFaces.Add(face); + + if (!registerElement(ID, face)) { + RemoveElement(face, false); + face = NULL; + } + return face; +} + + +//======================================================================= +//function : AddFace +//purpose : +//======================================================================= +SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41) +{ + return SMDS_Mesh::AddFaceWithID(n1,n2,n3,n4,n12,n23,n34,n41, + myElementIDFactory->GetFreeID()); +} + +//======================================================================= +//function : AddFaceWithID +//purpose : +//======================================================================= +SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4, + int n12,int n23,int n34,int n41, int ID) +{ + return SMDS_Mesh::AddFaceWithID + ((SMDS_MeshNode *)myNodeIDFactory->MeshElement(n1) , + (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n2) , + (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n3) , + (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n4) , + (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n12), + (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n23), + (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n34), + (SMDS_MeshNode *)myNodeIDFactory->MeshElement(n41), + ID); +} + +//======================================================================= +//function : AddFaceWithID +//purpose : +//======================================================================= +SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + int ID) +{ + if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n34 || !n41) return 0; + if(hasConstructionEdges()) { + // creation quadratic edges - not implemented + } + SMDS_QuadraticFaceOfNodes* face = + new SMDS_QuadraticFaceOfNodes(n1,n2,n3,n4,n12,n23,n34,n41); + myFaces.Add(face); + + if (!registerElement(ID, face)) { + RemoveElement(face, false); + face = NULL; + } + return face; +} + + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n24, + const SMDS_MeshNode * n34) +{ + int ID = myElementIDFactory->GetFreeID(); + SMDS_MeshVolume * v = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n12, n23, + n31, n14, n24, n34, ID); + if(v==NULL) myElementIDFactory->ReleaseID(ID); + return v; +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : +//======================================================================= +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, + int n12,int n23,int n31, + int n14,int n24,int n34, int ID) +{ + return SMDS_Mesh::AddVolumeWithID + ((SMDS_MeshNode*) myNodeIDFactory->MeshElement(n1) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n2) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n3) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n4) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n12), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n23), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n31), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n14), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n24), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n34), + ID); +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : 2d order tetrahedron of 10 nodes +//======================================================================= +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n24, + const SMDS_MeshNode * n34, + int ID) +{ + if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n31 || !n14 || !n24 || !n34) + return 0; + if(hasConstructionFaces()) { + // creation quadratic faces - not implemented + return 0; + } + SMDS_QuadraticVolumeOfNodes * volume = + new SMDS_QuadraticVolumeOfNodes(n1,n2,n3,n4,n12,n23,n31,n14,n24,n34); + myVolumes.Add(volume); + + if (!registerElement(ID, volume)) { + RemoveElement(volume, false); + volume = NULL; + } + return volume; +} + + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n35, + const SMDS_MeshNode * n45) +{ + int ID = myElementIDFactory->GetFreeID(); + SMDS_MeshVolume * v = + SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n12, n23, n34, n41, + n15, n25, n35, n45, ID); + if(v==NULL) myElementIDFactory->ReleaseID(ID); + return v; +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : +//======================================================================= +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, + int n12,int n23,int n34,int n41, + int n15,int n25,int n35,int n45, int ID) +{ + return SMDS_Mesh::AddVolumeWithID + ((SMDS_MeshNode*) myNodeIDFactory->MeshElement(n1) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n2) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n3) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n4) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n5) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n12), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n23), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n34), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n41), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n15), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n25), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n35), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n45), + ID); +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : 2d order pyramid of 13 nodes +//======================================================================= +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n35, + const SMDS_MeshNode * n45, + int ID) +{ + if (!n1 || !n2 || !n3 || !n4 || !n5 || !n12 || !n23 || + !n34 || !n41 || !n15 || !n25 || !n35 || !n45) + return 0; + if(hasConstructionFaces()) { + // creation quadratic faces - not implemented + return 0; + } + SMDS_QuadraticVolumeOfNodes * volume = + new SMDS_QuadraticVolumeOfNodes(n1,n2,n3,n4,n5,n12,n23, + n34,n41,n15,n25,n35,n45); + myVolumes.Add(volume); + + if (!registerElement(ID, volume)) { + RemoveElement(volume, false); + volume = NULL; + } + return volume; +} + + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n45, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n64, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n36) +{ + int ID = myElementIDFactory->GetFreeID(); + SMDS_MeshVolume * v = + SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n12, n23, n31, + n45, n56, n64, n14, n25, n36, ID); + if(v==NULL) myElementIDFactory->ReleaseID(ID); + return v; +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : +//======================================================================= +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, + int n4, int n5, int n6, + int n12,int n23,int n31, + int n45,int n56,int n64, + int n14,int n25,int n36, int ID) +{ + return SMDS_Mesh::AddVolumeWithID + ((SMDS_MeshNode*) myNodeIDFactory->MeshElement(n1) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n2) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n3) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n4) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n5) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n6) , + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n12), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n23), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n31), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n45), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n56), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n64), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n14), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n25), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n36), + ID); +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : 2d order Pentahedron with 15 nodes +//======================================================================= +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n45, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n64, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n36, + int ID) +{ + if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n12 || !n23 || + !n31 || !n45 || !n56 || !n64 || !n14 || !n25 || !n36) + return 0; + if(hasConstructionFaces()) { + // creation quadratic faces - not implemented + return 0; + } + SMDS_QuadraticVolumeOfNodes * volume = + new SMDS_QuadraticVolumeOfNodes(n1,n2,n3,n4,n5,n6,n12,n23,n31, + n45,n56,n64,n14,n25,n36); + myVolumes.Add(volume); + + if (!registerElement(ID, volume)) { + RemoveElement(volume, false); + volume = NULL; + } + return volume; +} + + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n7, + const SMDS_MeshNode * n8, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n67, + const SMDS_MeshNode * n78, + const SMDS_MeshNode * n85, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n26, + const SMDS_MeshNode * n37, + const SMDS_MeshNode * n48) +{ + int ID = myElementIDFactory->GetFreeID(); + SMDS_MeshVolume * v = + SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, n12, n23, n34, n41, + n56, n67, n78, n85, n15, n26, n37, n48, ID); + if(v==NULL) myElementIDFactory->ReleaseID(ID); + return v; +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : +//======================================================================= +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, + int n5, int n6, int n7, int n8, + int n12,int n23,int n34,int n41, + int n56,int n67,int n78,int n85, + int n15,int n26,int n37,int n48, int ID) +{ + return SMDS_Mesh::AddVolumeWithID + ((SMDS_MeshNode*) myNodeIDFactory->MeshElement(n1), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n2), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n3), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n4), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n5), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n6), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n7), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n8), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n12), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n23), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n34), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n41), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n56), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n67), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n78), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n85), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n15), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n26), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n37), + (SMDS_MeshNode*) myNodeIDFactory->MeshElement(n48), + ID); +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : 2d order Hexahedrons with 20 nodes +//======================================================================= +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n7, + const SMDS_MeshNode * n8, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n67, + const SMDS_MeshNode * n78, + const SMDS_MeshNode * n85, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n26, + const SMDS_MeshNode * n37, + const SMDS_MeshNode * n48, + int ID) +{ + if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8 || !n12 || !n23 || + !n34 || !n41 || !n56 || !n67 || !n78 || !n85 || !n15 || !n26 || !n37 || !n48) + return 0; + if(hasConstructionFaces()) { + return 0; + // creation quadratic faces - not implemented + } + SMDS_QuadraticVolumeOfNodes * volume = + new SMDS_QuadraticVolumeOfNodes(n1,n2,n3,n4,n5,n6,n7,n8,n12,n23,n34,n41, + n56,n67,n78,n85,n15,n26,n37,n48); + myVolumes.Add(volume); + + if (!registerElement(ID, volume)) { + RemoveElement(volume, false); + volume = NULL; + } + return volume; +} + diff --git a/src/SMDS/SMDS_Mesh.hxx b/src/SMDS/SMDS_Mesh.hxx index 7225b7162..2cdf3749b 100644 --- a/src/SMDS/SMDS_Mesh.hxx +++ b/src/SMDS/SMDS_Mesh.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -41,15 +41,6 @@ #include #include -typedef SMDS_Iterator SMDS_NodeIterator; -typedef boost::shared_ptr > SMDS_NodeIteratorPtr; -typedef SMDS_Iterator SMDS_EdgeIterator; -typedef boost::shared_ptr > SMDS_EdgeIteratorPtr; -typedef SMDS_Iterator SMDS_FaceIterator; -typedef boost::shared_ptr > SMDS_FaceIteratorPtr; -typedef SMDS_Iterator SMDS_VolumeIterator; -typedef boost::shared_ptr > SMDS_VolumeIteratorPtr; - class SMDS_EXPORT SMDS_Mesh:public SMDS_MeshObject{ public: @@ -75,6 +66,16 @@ public: virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2); + // 2d order edge with 3 nodes: n12 - node between n1 and n2 + virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int n12, int ID); + virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n12, + int ID); + virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n12); + virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, @@ -111,6 +112,44 @@ public: const SMDS_MeshEdge * e3, const SMDS_MeshEdge * e4); + // 2d order triangle of 6 nodes + virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, + int n12,int n23,int n31, int ID); + virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + int ID); + virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31); + + // 2d order quadrangle + virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, + int n12,int n23,int n34,int n41, int ID); + virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + int ID); + virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41); + virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, @@ -205,6 +244,153 @@ public: const SMDS_MeshFace * f5, const SMDS_MeshFace * f6); + // 2d order tetrahedron of 10 nodes + virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, + int n12,int n23,int n31, + int n14,int n24,int n34, int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n24, + const SMDS_MeshNode * n34, + int ID); + virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n24, + const SMDS_MeshNode * n34); + + // 2d order pyramid of 13 nodes + virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, + int n12,int n23,int n34,int n41, + int n15,int n25,int n35,int n45, + int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n35, + const SMDS_MeshNode * n45, + int ID); + virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n35, + const SMDS_MeshNode * n45); + + // 2d order Pentahedron with 15 nodes + virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, + int n4, int n5, int n6, + int n12,int n23,int n31, + int n45,int n56,int n64, + int n14,int n25,int n36, + int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n45, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n64, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n36, + int ID); + virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n45, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n64, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n36); + + // 2d oreder Hexahedrons with 20 nodes + virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, + int n5, int n6, int n7, int n8, + int n12,int n23,int n34,int n41, + int n56,int n67,int n78,int n85, + int n15,int n26,int n37,int n48, + int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n7, + const SMDS_MeshNode * n8, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n67, + const SMDS_MeshNode * n78, + const SMDS_MeshNode * n85, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n26, + const SMDS_MeshNode * n37, + const SMDS_MeshNode * n48, + int ID); + virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n7, + const SMDS_MeshNode * n8, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n67, + const SMDS_MeshNode * n78, + const SMDS_MeshNode * n85, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n26, + const SMDS_MeshNode * n37, + const SMDS_MeshNode * n48); + virtual SMDS_MeshFace* AddPolygonalFaceWithID (std::vector nodes_ids, const int ID); @@ -236,6 +422,12 @@ public: virtual void RemoveEdge(const SMDS_MeshEdge * edge); virtual void RemoveFace(const SMDS_MeshFace * face); virtual void RemoveVolume(const SMDS_MeshVolume * volume); + + /*! Remove only the given element and only if it is free. + * Method does not work for meshes with descendants. + * Implemented for fast cleaning of meshes. + */ + virtual void RemoveFreeElement(const SMDS_MeshElement * elem); virtual bool RemoveFromParent(); virtual bool RemoveSubMesh(const SMDS_Mesh * aMesh); @@ -252,11 +444,19 @@ public: const SMDS_MeshNode *FindNode(int idnode) const; const SMDS_MeshEdge *FindEdge(int idnode1, int idnode2) const; + const SMDS_MeshEdge *FindEdge(int idnode1, int idnode2, int idnode3) const; const SMDS_MeshFace *FindFace(int idnode1, int idnode2, int idnode3) const; const SMDS_MeshFace *FindFace(int idnode1, int idnode2, int idnode3, int idnode4) const; + const SMDS_MeshFace *FindFace(int idnode1, int idnode2, int idnode3, + int idnode4, int idnode5, int idnode6) const; + const SMDS_MeshFace *FindFace(int idnode1, int idnode2, int idnode3, int idnode4, + int idnode5, int idnode6, int idnode7, int idnode8) const; const SMDS_MeshElement *FindElement(int IDelem) const; static const SMDS_MeshEdge* FindEdge(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2); + static const SMDS_MeshEdge* FindEdge(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3); static const SMDS_MeshFace* FindFace(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3); @@ -264,6 +464,20 @@ public: const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4); + static const SMDS_MeshFace* FindFace(const SMDS_MeshNode *n1, + const SMDS_MeshNode *n2, + const SMDS_MeshNode *n3, + const SMDS_MeshNode *n4, + const SMDS_MeshNode *n5, + const SMDS_MeshNode *n6); + static const SMDS_MeshFace* FindFace(const SMDS_MeshNode *n1, + const SMDS_MeshNode *n2, + const SMDS_MeshNode *n3, + const SMDS_MeshNode *n4, + const SMDS_MeshNode *n5, + const SMDS_MeshNode *n6, + const SMDS_MeshNode *n7, + const SMDS_MeshNode *n8); const SMDS_MeshFace *FindFace(std::vector nodes_ids) const; static const SMDS_MeshFace* FindFace(std::vector nodes); diff --git a/src/SMDS/SMDS_MeshEdge.cxx b/src/SMDS/SMDS_MeshEdge.cxx index 66c8ae3d5..ee79fcd2c 100644 --- a/src/SMDS/SMDS_MeshEdge.cxx +++ b/src/SMDS/SMDS_MeshEdge.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -135,6 +135,18 @@ bool operator<(const SMDS_MeshEdge & e1, const SMDS_MeshEdge & e2) else return false; } +/*! + * \brief Return node by its index + * \param ind - node index + * \retval const SMDS_MeshNode* - the node + * + * Index is wrapped if it is out of a valid range + */ +const SMDS_MeshNode* SMDS_MeshEdge::GetNode(const int ind) const +{ + return myNodes[ WrappedIndex( ind )]; +} + //======================================================================= //function : ChangeNodes //purpose : diff --git a/src/SMDS/SMDS_MeshEdge.hxx b/src/SMDS/SMDS_MeshEdge.hxx index c5c5102ed..10a1f66d8 100644 --- a/src/SMDS/SMDS_MeshEdge.hxx +++ b/src/SMDS/SMDS_MeshEdge.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -46,12 +46,22 @@ class SMDS_EXPORT SMDS_MeshEdge:public SMDS_MeshElement int NbNodes() const; int NbEdges() const; friend bool operator<(const SMDS_MeshEdge& e1, const SMDS_MeshEdge& e2); + + /*! + * \brief Return node by its index + * \param ind - node index + * \retval const SMDS_MeshNode* - the node + * + * Index is wrapped if it is out of a valid range + */ + virtual const SMDS_MeshNode* GetNode(const int ind) const; + protected: SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const; - private: - const SMDS_MeshNode* myNodes[2]; + protected: + const SMDS_MeshNode* myNodes[3]; }; #endif diff --git a/src/SMDS/SMDS_MeshElement.cxx b/src/SMDS/SMDS_MeshElement.cxx index 8d4d9b75d..e6f84076b 100644 --- a/src/SMDS/SMDS_MeshElement.cxx +++ b/src/SMDS/SMDS_MeshElement.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifdef _MSC_VER #pragma warning(disable:4786) @@ -192,3 +192,46 @@ bool operator<(const SMDS_MeshElement& e1, const SMDS_MeshElement& e2) } return false; } + +bool SMDS_MeshElement::IsValidIndex(const int ind) const +{ + return ( ind>-1 && indnext(); + if ( it->more() ) + return static_cast (it->next()); + return 0; +} + +bool SMDS_MeshElement::IsQuadratic() const +{ + return false; +} + +bool SMDS_MeshElement::IsMediumNode(const SMDS_MeshNode* node) const +{ + return false; +} + +//================================================================================ + /*! + * \brief Check if a node belongs to the element + * \param node - the node to check + * \retval int - node index within the element, -1 if not found + */ +//================================================================================ + +int SMDS_MeshElement::GetNodeIndex( const SMDS_MeshNode* node ) const +{ + SMDS_ElemIteratorPtr nIt = nodesIterator(); + for ( int i = 0; nIt->more(); ++i ) + if ( nIt->next() == node ) + return i; + return -1; +} diff --git a/src/SMDS/SMDS_MeshElement.hxx b/src/SMDS/SMDS_MeshElement.hxx index b3de99645..42e0db284 100644 --- a/src/SMDS/SMDS_MeshElement.hxx +++ b/src/SMDS/SMDS_MeshElement.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -46,32 +46,71 @@ class SMDS_MeshFace; /////////////////////////////////////////////////////////////////////////////// class SMDS_EXPORT SMDS_MeshElement:public SMDS_MeshObject { +public: - public: - SMDS_ElemIteratorPtr nodesIterator() const; - SMDS_ElemIteratorPtr edgesIterator() const; - SMDS_ElemIteratorPtr facesIterator() const; - virtual SMDS_ElemIteratorPtr - elementsIterator(SMDSAbs_ElementType type) const; + SMDS_ElemIteratorPtr nodesIterator() const; + SMDS_ElemIteratorPtr edgesIterator() const; + SMDS_ElemIteratorPtr facesIterator() const; + virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const; - virtual int NbNodes() const; - virtual int NbEdges() const; - virtual int NbFaces() const; - int GetID() const; + virtual int NbNodes() const; + virtual int NbEdges() const; + virtual int NbFaces() const; + int GetID() const; - ///Return the type of the current element - virtual SMDSAbs_ElementType GetType() const = 0; - virtual bool IsPoly() const { return false; }; + ///Return the type of the current element + virtual SMDSAbs_ElementType GetType() const = 0; + virtual bool IsPoly() const { return false; }; + virtual bool IsQuadratic() const; - friend SMDS_EXPORT std::ostream & operator <<(std::ostream & OS, const SMDS_MeshElement *); - friend SMDS_EXPORT bool SMDS_MeshElementIDFactory::BindID(int ID,SMDS_MeshElement*elem); + virtual bool IsMediumNode(const SMDS_MeshNode* node) const; - protected: - SMDS_MeshElement(int ID=-1); - virtual void Print(std::ostream & OS) const; - - private: - int myID; + friend SMDS_EXPORT std::ostream & operator <<(std::ostream & OS, const SMDS_MeshElement *); + friend SMDS_EXPORT bool SMDS_MeshElementIDFactory::BindID(int ID,SMDS_MeshElement*elem); + + // =========================== + // Access to nodes by index + // =========================== + /*! + * \brief Return node by its index + * \param ind - node index + * \retval const SMDS_MeshNode* - the node + * + * Index is wrapped if it is out of a valid range + */ + virtual const SMDS_MeshNode* GetNode(const int ind) const; + + /*! + * \brief Return true if index of node is valid (0 <= ind < NbNodes()) + * \param ind - node index + * \retval bool - index check result + */ + virtual bool IsValidIndex(const int ind) const; + + /*! + * \brief Return a valid node index, fixing the given one if necessary + * \param ind - node index + * \retval int - valid node index + */ + int WrappedIndex(const int ind) const { + if ( ind < 0 ) return -( ind % NbNodes()); + if ( ind >= NbNodes() ) return ind % NbNodes(); + return ind; + } + + /*! + * \brief Check if a node belongs to the element + * \param node - the node to check + * \retval int - node index within the element, -1 if not found + */ + int GetNodeIndex( const SMDS_MeshNode* node ) const; + +protected: + SMDS_MeshElement(int ID=-1); + virtual void Print(std::ostream & OS) const; + +private: + int myID; }; #endif diff --git a/src/SMDS/SMDS_MeshElementIDFactory.cxx b/src/SMDS/SMDS_MeshElementIDFactory.cxx index 8fc09230b..cac5fc1c6 100644 --- a/src/SMDS/SMDS_MeshElementIDFactory.cxx +++ b/src/SMDS/SMDS_MeshElementIDFactory.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_MeshElementIDFactory.hxx b/src/SMDS/SMDS_MeshElementIDFactory.hxx index 02c5309b3..b78358f30 100644 --- a/src/SMDS/SMDS_MeshElementIDFactory.hxx +++ b/src/SMDS/SMDS_MeshElementIDFactory.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_MeshFace.cxx b/src/SMDS/SMDS_MeshFace.cxx index b7014293a..e67103e8b 100644 --- a/src/SMDS/SMDS_MeshFace.cxx +++ b/src/SMDS/SMDS_MeshFace.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "SMDS_MeshFace.hxx" diff --git a/src/SMDS/SMDS_MeshFace.hxx b/src/SMDS/SMDS_MeshFace.hxx index bd3c3f17a..dbc5698e8 100644 --- a/src/SMDS/SMDS_MeshFace.hxx +++ b/src/SMDS/SMDS_MeshFace.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_MeshGroup.cxx b/src/SMDS/SMDS_MeshGroup.cxx index 0cb481c50..adbde5081 100644 --- a/src/SMDS/SMDS_MeshGroup.cxx +++ b/src/SMDS/SMDS_MeshGroup.cxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org or email : webmaster@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_MeshGroup.hxx b/src/SMDS/SMDS_MeshGroup.hxx index c3f3278d1..f23b601b7 100644 --- a/src/SMDS/SMDS_MeshGroup.hxx +++ b/src/SMDS/SMDS_MeshGroup.hxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org or email : webmaster@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -50,6 +50,8 @@ class SMDS_EXPORT SMDS_MeshGroup:public SMDS_MeshObject bool IsEmpty() const { return myElements.empty(); } int Extent() const { return myElements.size(); } + int SubGroupsNb() const { return myChildren.size(); } + SMDSAbs_ElementType GetType() const { return myType; } bool Contains(const SMDS_MeshElement * theElem) const; @@ -62,16 +64,27 @@ class SMDS_EXPORT SMDS_MeshGroup:public SMDS_MeshObject const SMDS_MeshElement* Next() const { return *(const_cast(myIterator))++; } + void InitSubGroupsIterator() const + { const_cast(myGroupIterator) = myChildren.begin(); } + + bool MoreSubGroups() const { return myGroupIterator != myChildren.end(); } + + const SMDS_MeshGroup* NextSubGroup() const + { return *(const_cast(myGroupIterator))++; } + private: SMDS_MeshGroup(SMDS_MeshGroup* theParent, const SMDSAbs_ElementType theType = SMDSAbs_All); typedef std::set::const_iterator TIterator; + typedef std::list::const_iterator TGroupIterator; + const SMDS_Mesh * myMesh; SMDSAbs_ElementType myType; std::set myElements; SMDS_MeshGroup * myParent; std::list myChildren; TIterator myIterator; + TGroupIterator myGroupIterator; }; #endif diff --git a/src/SMDS/SMDS_MeshIDFactory.cxx b/src/SMDS/SMDS_MeshIDFactory.cxx index 536b2f783..989e42be3 100644 --- a/src/SMDS/SMDS_MeshIDFactory.cxx +++ b/src/SMDS/SMDS_MeshIDFactory.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_MeshIDFactory.hxx b/src/SMDS/SMDS_MeshIDFactory.hxx index ade5a31a0..8e57247da 100644 --- a/src/SMDS/SMDS_MeshIDFactory.hxx +++ b/src/SMDS/SMDS_MeshIDFactory.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_MeshNode.cxx b/src/SMDS/SMDS_MeshNode.cxx index 06ab12173..1d968dcbb 100644 --- a/src/SMDS/SMDS_MeshNode.cxx +++ b/src/SMDS/SMDS_MeshNode.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifdef _MSC_VER #pragma warning(disable:4786) diff --git a/src/SMDS/SMDS_MeshNode.hxx b/src/SMDS/SMDS_MeshNode.hxx index 1a245b1ef..86a032efd 100644 --- a/src/SMDS/SMDS_MeshNode.hxx +++ b/src/SMDS/SMDS_MeshNode.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -54,6 +54,15 @@ class SMDS_EXPORT SMDS_MeshNode:public SMDS_MeshElement void setXYZ(double x, double y, double z); friend bool operator<(const SMDS_MeshNode& e1, const SMDS_MeshNode& e2); + /*! + * \brief Return node by its index + * \param ind - node index + * \retval const SMDS_MeshNode* - the node + * + * Index is wrapped if it is out of a valid range + */ + virtual const SMDS_MeshNode* GetNode(const int) const { return this; } + protected: SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const; diff --git a/src/SMDS/SMDS_MeshObject.cxx b/src/SMDS/SMDS_MeshObject.cxx index b822b8098..262bb59ec 100644 --- a/src/SMDS/SMDS_MeshObject.cxx +++ b/src/SMDS/SMDS_MeshObject.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_MeshObject.hxx b/src/SMDS/SMDS_MeshObject.hxx index da7c92657..50af0db8f 100644 --- a/src/SMDS/SMDS_MeshObject.hxx +++ b/src/SMDS/SMDS_MeshObject.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_MeshVolume.cxx b/src/SMDS/SMDS_MeshVolume.cxx index 561f0dccb..7300675e2 100644 --- a/src/SMDS/SMDS_MeshVolume.cxx +++ b/src/SMDS/SMDS_MeshVolume.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_MeshVolume.hxx b/src/SMDS/SMDS_MeshVolume.hxx index d988febe5..33bc8c48b 100644 --- a/src/SMDS/SMDS_MeshVolume.hxx +++ b/src/SMDS/SMDS_MeshVolume.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_PolygonalFaceOfNodes.cxx b/src/SMDS/SMDS_PolygonalFaceOfNodes.cxx index 38abf18c2..897cd6993 100644 --- a/src/SMDS/SMDS_PolygonalFaceOfNodes.cxx +++ b/src/SMDS/SMDS_PolygonalFaceOfNodes.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifdef _MSC_VER #pragma warning(disable:4786) @@ -26,7 +26,7 @@ #include "SMDS_PolygonalFaceOfNodes.hxx" #include "SMDS_IteratorOfElements.hxx" -//#include "SMDS_MeshNode.hxx" +#include "SMDS_SetIterator.hxx" #include "utilities.h" using namespace std; @@ -128,28 +128,11 @@ void SMDS_PolygonalFaceOfNodes::Print(ostream & OS) const //function : elementsIterator //purpose : //======================================================================= -class SMDS_PolygonalFaceOfNodes_MyIterator:public SMDS_ElemIterator +class SMDS_PolygonalFaceOfNodes_MyIterator:public SMDS_NodeVectorElemIterator { - //const SMDS_MeshNode* const *mySet; - const std::vector mySet; - //int myLength; - int index; public: - //SMDS_PolygonalFaceOfNodes_MyIterator(const SMDS_MeshNode* const *s, int l): - // mySet(s),myLength(l),index(0) {} - SMDS_PolygonalFaceOfNodes_MyIterator(const std::vector s): - mySet(s),index(0) {} - - bool more() - { - return index < mySet.size(); - } - - const SMDS_MeshElement* next() - { - index++; - return mySet[index-1]; - } + SMDS_PolygonalFaceOfNodes_MyIterator(const vector& s): + SMDS_NodeVectorElemIterator( s.begin(), s.end() ) {} }; SMDS_ElemIteratorPtr SMDS_PolygonalFaceOfNodes::elementsIterator @@ -172,3 +155,16 @@ SMDS_ElemIteratorPtr SMDS_PolygonalFaceOfNodes::elementsIterator } return SMDS_ElemIteratorPtr(); } + +/*! + * \brief Return node by its index + * \param ind - node index + * \retval const SMDS_MeshNode* - the node + * + * Index is wrapped if it is out of a valid range + */ +const SMDS_MeshNode* SMDS_PolygonalFaceOfNodes::GetNode(const int ind) const +{ + return myNodes[ WrappedIndex( ind )]; +} + diff --git a/src/SMDS/SMDS_PolygonalFaceOfNodes.hxx b/src/SMDS/SMDS_PolygonalFaceOfNodes.hxx index 59f204b69..13c1536b7 100644 --- a/src/SMDS/SMDS_PolygonalFaceOfNodes.hxx +++ b/src/SMDS/SMDS_PolygonalFaceOfNodes.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _SMDS_PolygonalFaceOfNodes_HeaderFile #define _SMDS_PolygonalFaceOfNodes_HeaderFile @@ -52,6 +52,15 @@ class SMDS_EXPORT SMDS_PolygonalFaceOfNodes:public SMDS_MeshFace virtual void Print (std::ostream & OS) const; + /*! + * \brief Return node by its index + * \param ind - node index + * \retval const SMDS_MeshNode* - the node + * + * Index is wrapped if it is out of a valid range + */ + virtual const SMDS_MeshNode* GetNode(const int ind) const; + protected: virtual SMDS_ElemIteratorPtr elementsIterator (SMDSAbs_ElementType type) const; diff --git a/src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx b/src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx index 84ce2134d..1c4fd4761 100644 --- a/src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx +++ b/src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifdef _MSC_VER #pragma warning(disable:4786) diff --git a/src/SMDS/SMDS_PolyhedralVolumeOfNodes.hxx b/src/SMDS/SMDS_PolyhedralVolumeOfNodes.hxx index dd6c92712..ddac4c659 100644 --- a/src/SMDS/SMDS_PolyhedralVolumeOfNodes.hxx +++ b/src/SMDS/SMDS_PolyhedralVolumeOfNodes.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_Position.cxx b/src/SMDS/SMDS_Position.cxx index 926aa4bf9..bd9a7a24b 100644 --- a/src/SMDS/SMDS_Position.cxx +++ b/src/SMDS/SMDS_Position.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_Position.hxx b/src/SMDS/SMDS_Position.hxx index 034cb85a7..742bde4c3 100644 --- a/src/SMDS/SMDS_Position.hxx +++ b/src/SMDS/SMDS_Position.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_QuadraticEdge.hxx b/src/SMDS/SMDS_QuadraticEdge.hxx index 6c6099602..ab6e2dbf8 100644 --- a/src/SMDS/SMDS_QuadraticEdge.hxx +++ b/src/SMDS/SMDS_QuadraticEdge.hxx @@ -27,10 +27,12 @@ #ifndef _SMDS_QuadraticEdge_HeaderFile #define _SMDS_QuadraticEdge_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshEdge.hxx" #include -class SMDS_WNT_EXPORT SMDS_QuadraticEdge: public SMDS_MeshEdge +class SMDS_EXPORT SMDS_QuadraticEdge: public SMDS_MeshEdge { public: diff --git a/src/SMDS/SMDS_QuadraticFaceOfNodes.hxx b/src/SMDS/SMDS_QuadraticFaceOfNodes.hxx index d174e813e..9328f9844 100644 --- a/src/SMDS/SMDS_QuadraticFaceOfNodes.hxx +++ b/src/SMDS/SMDS_QuadraticFaceOfNodes.hxx @@ -27,9 +27,11 @@ #ifndef _SMDS_QuadraticFaceOfNodes_HeaderFile #define _SMDS_QuadraticFaceOfNodes_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshFace.hxx" -class SMDS_WNT_EXPORT SMDS_QuadraticFaceOfNodes:public SMDS_MeshFace +class SMDS_EXPORT SMDS_QuadraticFaceOfNodes:public SMDS_MeshFace { public: SMDS_QuadraticFaceOfNodes (const SMDS_MeshNode * n1, diff --git a/src/SMDS/SMDS_QuadraticVolumeOfNodes.hxx b/src/SMDS/SMDS_QuadraticVolumeOfNodes.hxx index 23f4369d3..c03735fee 100644 --- a/src/SMDS/SMDS_QuadraticVolumeOfNodes.hxx +++ b/src/SMDS/SMDS_QuadraticVolumeOfNodes.hxx @@ -27,9 +27,11 @@ #ifndef _SMDS_QuadraticVolumeOfNodes_HeaderFile #define _SMDS_QuadraticVolumeOfNodes_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshVolume.hxx" -class SMDS_WNT_EXPORT SMDS_QuadraticVolumeOfNodes: public SMDS_MeshVolume +class SMDS_EXPORT SMDS_QuadraticVolumeOfNodes: public SMDS_MeshVolume { public: // tetrahedron of 10 nodes diff --git a/src/SMDS/SMDS_SpacePosition.cxx b/src/SMDS/SMDS_SpacePosition.cxx index 7ce582f91..399663d2f 100644 --- a/src/SMDS/SMDS_SpacePosition.cxx +++ b/src/SMDS/SMDS_SpacePosition.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_SpacePosition.hxx b/src/SMDS/SMDS_SpacePosition.hxx index f0e880b2c..560cab094 100644 --- a/src/SMDS/SMDS_SpacePosition.hxx +++ b/src/SMDS/SMDS_SpacePosition.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_TypeOfPosition.hxx b/src/SMDS/SMDS_TypeOfPosition.hxx index 8c0631bfc..5384a8ce5 100644 --- a/src/SMDS/SMDS_TypeOfPosition.hxx +++ b/src/SMDS/SMDS_TypeOfPosition.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_VertexPosition.cxx b/src/SMDS/SMDS_VertexPosition.cxx index 022f76ad3..e39e3fc2d 100644 --- a/src/SMDS/SMDS_VertexPosition.cxx +++ b/src/SMDS/SMDS_VertexPosition.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_VertexPosition.hxx b/src/SMDS/SMDS_VertexPosition.hxx index 3abe55197..f06ba302c 100644 --- a/src/SMDS/SMDS_VertexPosition.hxx +++ b/src/SMDS/SMDS_VertexPosition.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_VolumeOfFaces.cxx b/src/SMDS/SMDS_VolumeOfFaces.cxx index 51e71f86c..2d1dc94e6 100644 --- a/src/SMDS/SMDS_VolumeOfFaces.cxx +++ b/src/SMDS/SMDS_VolumeOfFaces.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_VolumeOfFaces.hxx b/src/SMDS/SMDS_VolumeOfFaces.hxx index 540bc3192..2bf783ab3 100644 --- a/src/SMDS/SMDS_VolumeOfFaces.hxx +++ b/src/SMDS/SMDS_VolumeOfFaces.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMDS/SMDS_VolumeOfNodes.cxx b/src/SMDS/SMDS_VolumeOfNodes.cxx index cd893f484..0428095da 100644 --- a/src/SMDS/SMDS_VolumeOfNodes.cxx +++ b/src/SMDS/SMDS_VolumeOfNodes.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifdef _MSC_VER #pragma warning(disable:4786) @@ -25,6 +25,7 @@ #include "SMDS_VolumeOfNodes.hxx" #include "SMDS_MeshNode.hxx" +#include "SMDS_SetIterator.hxx" #include "utilities.h" using namespace std; @@ -170,29 +171,14 @@ int SMDS_VolumeOfNodes::NbEdges() const return 0; } -class SMDS_VolumeOfNodes_MyIterator:public SMDS_ElemIterator +class SMDS_VolumeOfNodes_MyIterator:public SMDS_NodeArrayElemIterator { - const SMDS_MeshNode* const* mySet; - int myLength; - int index; public: SMDS_VolumeOfNodes_MyIterator(const SMDS_MeshNode* const* s, int l): - mySet(s),myLength(l),index(0) {} - - bool more() - { - return index EXTERNAL { 1, 2, 6, 5, 1 }}; static int Hexa_nbN [] = { 4, 4, 4, 4, 4, 4 }; + +/* +// N3 +// + +// /|\ +// 7/ | \8 +// / |4 \ QUADRATIC +// N0 +---|---+ N1 TETRAHEDRON +// \ +9 / +// \ | / +// 6\ | /5 +// \|/ +// + +// N2 +*/ +static int QuadTetra_F [4][7] = { // FORWARD == EXTERNAL + { 0, 4, 1, 5, 2, 6, 0 }, // All faces have external normals + { 0, 7, 3, 8, 1, 4, 0 }, + { 1, 8, 3, 9, 2, 5, 1 }, + { 0, 6, 2, 9, 3, 7, 0 }}; +static int QuadTetra_R [4][7] = { // REVERSED + { 0, 4, 1, 5, 2, 6, 0 }, // All faces but a bottom have external normals + { 0, 4, 1, 8, 3, 7, 0 }, + { 1, 5, 2, 9, 3, 8, 1 }, + { 0, 7, 3, 9, 2, 6, 0 }}; +static int QuadTetra_RE [4][7] = { // REVERSED -> FORWARD (EXTERNAL) + { 0, 6, 2, 5, 1, 4, 0 }, // All faces have external normals + { 0, 4, 1, 8, 3, 7, 0 }, + { 1, 5, 2, 9, 3, 8, 1 }, + { 0, 7, 3, 9, 2, 6, 0 }}; +static int QuadTetra_nbN [] = { 6, 6, 6, 6 }; + +// +// QUADRATIC +// PYRAMID +// +// +4 +// +// +// 10+-----+11 +// | | 9 - middle point for (0,4) etc. +// | | +// 9+-----+12 +// +// 6 +// 1+----+----+2 +// | | +// | | +// 5+ +7 +// | | +// | | +// 0+----+----+3 +// 8 +static int QuadPyram_F [5][9] = { // FORWARD == EXTERNAL + { 0, 5, 1, 6, 2, 7, 3, 8, 0 }, // All faces have external normals + { 0, 9, 4, 10,1, 5, 0, 4, 4 }, + { 1, 10,4, 11,2, 6, 1, 4, 4 }, + { 2, 11,4, 12,3, 7, 2, 4, 4 }, + { 3, 12,4, 9, 0, 8, 3, 4, 4 }}; +static int QuadPyram_R [5][9] = { // REVERSED + { 0, 5, 1, 6, 2, 7, 3, 8, 0 }, // All faces but a bottom have external normals + { 0, 5, 1, 10,4, 9, 0, 4, 4 }, + { 1, 6, 2, 11,4, 10,1, 4, 4 }, + { 2, 7, 3, 12,4, 11,2, 4, 4 }, + { 3, 8, 0, 9, 4, 12,3, 4, 4 }}; +static int QuadPyram_RE [5][9] = { // REVERSED -> FORWARD (EXTERNAL) + { 0, 8, 3, 7, 2, 6, 1, 5, 0 }, // All faces but a bottom have external normals + { 0, 5, 1, 10,4, 9, 0, 4, 4 }, + { 1, 6, 2, 11,4, 10,1, 4, 4 }, + { 2, 7, 3, 12,4, 11,2, 4, 4 }, + { 3, 8, 0, 9, 4, 12,3, 4, 4 }}; +static int QuadPyram_nbN [] = { 8, 6, 6, 6, 6 }; + +/* +// + N4 +// /|\ +// 9/ | \10 +// / | \ +// / | \ +// N3 +----+----+ N5 +// | |11 | +// | | | +// | +13 | QUADRATIC +// | | | PENTAHEDRON +// | | | +// | | | +// | | | +// 12+ | +14 +// | | | +// | | | +// | + N1 | +// | / \ | +// | 6/ \7 | +// | / \ | +// |/ \| +// N0 +---------+ N2 +// 8 +*/ +static int QuadPenta_F [5][9] = { // FORWARD + { 0, 6, 1, 7, 2, 8, 0, 0, 0 }, // Top face has an internal normal, other - external + { 3, 9, 4, 10,5, 11,3, 3, 3 }, // 0 is bottom, 1 is top face + { 0, 8, 2, 14,5, 11,3, 12,0 }, + { 1, 13,4, 10,5, 14,2, 7, 1 }, + { 0, 12,3, 9, 4, 13,1, 6, 0 }}; +static int QuadPenta_R [5][9] = { // REVERSED + { 0, 6, 1, 7, 2, 8, 0, 0, 0 }, // Bottom face has an internal normal, other - external + { 3, 9, 4, 10,5, 11,3, 3, 3 }, // 0 is bottom, 1 is top face + { 0, 12,3, 11,5, 14,2, 8, 0 }, + { 1, 7, 2, 14,5, 10,4, 13,1 }, + { 0, 6, 1, 13,4, 9, 3, 12,0 }}; +static int QuadPenta_FE [5][9] = { // FORWARD -> EXTERNAL + { 0, 6, 1, 7, 2, 8, 0, 0, 0 }, + { 3,11, 5, 10,4, 9, 3, 3, 3 }, + { 0, 8, 2, 14,5, 11,3, 12,0 }, + { 1, 13,4, 10,5, 14,2, 7, 1 }, + { 0, 12,3, 9, 4, 13,1, 6, 0 }}; +static int QuadPenta_RE [5][9] = { // REVERSED -> EXTERNAL + { 0, 8, 2, 7, 1, 6, 0, 0, 0 }, + { 3, 9, 4, 10,5, 11,3, 3, 3 }, + { 0, 12,3, 11,5, 14,2, 8, 0 }, + { 1, 7, 2, 14,5, 10,4, 13,1 }, + { 0, 6, 1, 13,4, 9, 3, 12,0 }}; +static int QuadPenta_nbN [] = { 6, 6, 8, 8, 8 }; + +/* +// 13 +// N5+-----+-----+N6 +// /| /| +// 12+ | 14+ | +// / | / | +// N4+-----+-----+N7 | QUADRATIC +// | | 15 | | HEXAHEDRON +// | | | | +// | 17+ | +18 +// | | | | +// | | | | +// | | | | +// 16+ | +19 | +// | | | | +// | | 9 | | +// | N1+-----+-|---+N2 +// | / | / +// | +8 | +10 +// |/ |/ +// N0+-----+-----+N3 +// 11 +*/ +static int QuadHexa_F [6][9] = { // FORWARD + { 0, 8, 1, 9, 2, 10,3, 11,0 }, // opposite faces are neighbouring, + { 4, 12,5, 13,6, 14,7, 15,4 }, // odd face(1,3,5) normal is internal, even(0,2,4) - external + { 1, 8, 0, 16,4, 12,5, 17,1 }, // same index nodes of opposite faces are linked + { 2, 10,3, 19,7, 14,6, 18,2 }, + { 0, 11,3, 19,7, 15,4, 16,0 }, + { 1, 9, 2, 18,6, 13,5, 17,1 }}; +// static int Hexa_R [6][5] = { // REVERSED +// { 0, 3, 2, 1, 0 }, // opposite faces are neighbouring, +// { 4, 7, 6, 5, 4 }, // odd face(1,3,5) normal is external, even(0,2,4) - internal +// { 1, 5, 4, 0, 1 }, // same index nodes of opposite faces are linked +// { 2, 6, 7, 3, 2 }, +// { 0, 4, 7, 3, 0 }, +// { 1, 5, 6, 2, 1 }}; +static int QuadHexa_FE [6][9] = { // FORWARD -> EXTERNAL + { 0, 8, 1, 9, 2, 10,3, 11,0 }, // opposite faces are neighbouring, + { 4, 15,7, 14,6, 13,5, 12,4 }, // all face normals are external, + { 0, 16,4, 12,5, 17,1, 8, 0 }, // links in opposite faces: 0-0, 1-3, 2-2, 3-1 + { 3, 10,2, 18,6, 14,7, 19,3 }, + { 0, 11,3, 19,7, 15,4, 16,0 }, + { 1, 17,5, 13,6, 18,2, 9, 1 }}; +static int QuadHexa_RE [6][9] = { // REVERSED -> EXTERNAL + { 0, 11,3, 10,2, 9, 1, 8, 0 }, // opposite faces are neighbouring, + { 4, 12,5, 13,6, 14,7, 15,4 }, // all face normals are external, + { 0, 8, 1, 17,5, 12,4, 16,0 }, // links in opposite faces: 0-0, 1-3, 2-2, 3-1 + { 3, 19,7, 14,6, 18,2, 10,3 }, + { 0, 16,4, 15,7, 19,3, 11,0 }, + { 1, 9, 2, 18,6, 13,5, 17,1 }}; +static int QuadHexa_nbN [] = { 8, 8, 8, 8, 8, 8 }; + + // ======================================================== // to perform some calculations without linkage to CASCADE // ======================================================== @@ -323,12 +501,17 @@ bool SMDS_VolumeTool::Set (const SMDS_MeshElement* theVolume) MESSAGE("Warning: bad volumic element"); return false; } - } else { + } + else { switch ( myVolumeNbNodes ) { case 4: case 5: case 6: - case 8: { + case 8: + case 10: + case 13: + case 15: + case 20: { // define volume orientation XYZ botNormal; GetFaceNormal( 0, botNormal.x, botNormal.y, botNormal.z ); @@ -387,6 +570,34 @@ void SMDS_VolumeTool::Inverse () SWAP_NODES( myVolumeNodes, 1, 3 ); SWAP_NODES( myVolumeNodes, 5, 7 ); break; + + case 10: + SWAP_NODES( myVolumeNodes, 1, 2 ); + SWAP_NODES( myVolumeNodes, 4, 6 ); + SWAP_NODES( myVolumeNodes, 8, 9 ); + break; + case 13: + SWAP_NODES( myVolumeNodes, 1, 3 ); + SWAP_NODES( myVolumeNodes, 5, 8 ); + SWAP_NODES( myVolumeNodes, 6, 7 ); + SWAP_NODES( myVolumeNodes, 10, 12 ); + break; + case 15: + SWAP_NODES( myVolumeNodes, 1, 2 ); + SWAP_NODES( myVolumeNodes, 4, 5 ); + SWAP_NODES( myVolumeNodes, 6, 8 ); + SWAP_NODES( myVolumeNodes, 9, 11 ); + SWAP_NODES( myVolumeNodes, 13, 14 ); + break; + case 20: + SWAP_NODES( myVolumeNodes, 1, 3 ); + SWAP_NODES( myVolumeNodes, 5, 7 ); + SWAP_NODES( myVolumeNodes, 8, 11 ); + SWAP_NODES( myVolumeNodes, 9, 10 ); + SWAP_NODES( myVolumeNodes, 12, 15 ); + SWAP_NODES( myVolumeNodes, 13, 14 ); + SWAP_NODES( myVolumeNodes, 17, 19 ); + break; default:; } } @@ -402,14 +613,25 @@ SMDS_VolumeTool::VolumeType SMDS_VolumeTool::GetVolumeType() const return POLYHEDA; if ( myVolume ) { - static const VolumeType types[] = { - TETRA, // myVolumeNbNodes = 4 - PYRAM, // myVolumeNbNodes = 5 - PENTA, // myVolumeNbNodes = 6 - UNKNOWN, // myVolumeNbNodes = 7 - HEXA // myVolumeNbNodes = 8 - }; - return types[ myVolumeNbNodes - 4 ]; +// static const VolumeType types[] = { +// TETRA, // myVolumeNbNodes = 4 +// PYRAM, // myVolumeNbNodes = 5 +// PENTA, // myVolumeNbNodes = 6 +// UNKNOWN, // myVolumeNbNodes = 7 +// HEXA // myVolumeNbNodes = 8 +// }; +// return types[ myVolumeNbNodes - 4 ]; + switch(myVolumeNbNodes) { + case 4: return TETRA; break; + case 5: return PYRAM; break; + case 6: return PENTA; break; + case 8: return HEXA; break; + case 10: return QUAD_TETRA; break; + case 13: return QUAD_PYRAM; break; + case 15: return QUAD_PENTA; break; + case 20: return QUAD_HEXA; break; + default: break; + } } return UNKNOWN; @@ -491,7 +713,7 @@ double SMDS_VolumeTool::GetSize() const else { const static int ind[] = { - 0, 1, 3, 6, 11 }; + 0, 1, 3, 6, 11, 19, 32, 46, 66}; const static int vtab[][4] = { // tetrahedron { 0, 1, 2, 3 }, @@ -507,15 +729,80 @@ double SMDS_VolumeTool::GetSize() const { 4, 1, 6, 5 }, { 1, 3, 6, 2 }, { 4, 6, 3, 7 }, - { 1, 4, 6, 3 } + { 1, 4, 6, 3 }, + + // quadratic tetrahedron + { 0, 4, 6, 7 }, + { 1, 5, 4, 8 }, + { 2, 6, 5, 9 }, + { 7, 8, 9, 3 }, + { 4, 6, 7, 9 }, + { 4, 5, 6, 9 }, + { 4, 7, 8, 9 }, + { 4, 5, 9, 8 }, + + // quadratic pyramid + { 0, 5, 8, 9 }, + { 1, 5,10, 6 }, + { 2, 6,11, 7 }, + { 3, 7,12, 8 }, + { 4, 9,11,10 }, + { 4, 9,12,11 }, + { 10, 5, 9, 8 }, + { 10, 8, 9,12 }, + { 10, 8,12, 7 }, + { 10, 7,12,11 }, + { 10, 7,11, 6 }, + { 10, 5, 8, 6 }, + { 10, 6, 8, 7 }, + + // quadratic pentahedron + { 12, 0, 8, 6 }, + { 12, 8, 7, 6 }, + { 12, 8, 2, 7 }, + { 12, 6, 7, 1 }, + { 12, 1, 7,13 }, + { 12, 7, 2,13 }, + { 12, 2,14,13 }, + + { 12, 3, 9,11 }, + { 12,11, 9,10 }, + { 12,11,10, 5 }, + { 12, 9, 4,10 }, + { 12,14, 5,10 }, + { 12,14,10, 4 }, + { 12,14, 4,13 }, + + // quadratic hexahedron + { 16, 0,11, 8 }, + { 16,11, 9, 8 }, + { 16, 8, 9, 1 }, + { 16,11, 3,10 }, + { 16,11,10, 9 }, + { 16,10, 2, 9 }, + { 16, 3,19, 2 }, + { 16, 2,19,18 }, + { 16, 2,18,17 }, + { 16, 2,17, 1 }, + + { 16, 4,12,15 }, + { 16,12, 5,13 }, + { 16,12,13,15 }, + { 16,13, 6,14 }, + { 16,13,14,15 }, + { 16,14, 7,15 }, + { 16, 6, 5,17 }, + { 16,18, 6,17 }, + { 16,18, 7, 6 }, + { 16,18,19, 7 }, + }; int type = GetVolumeType(); int n1 = ind[type]; int n2 = ind[type+1]; - for (int i = n1; i < n2; i++) - { + for (int i = n1; i < n2; i++) { V -= getTetraVolume( myVolumeNodes[ vtab[i][0] ], myVolumeNodes[ vtab[i][1] ], myVolumeNodes[ vtab[i][2] ], @@ -647,12 +934,16 @@ bool SMDS_VolumeTool::IsFaceExternal( int faceIndex ) switch ( myVolumeNbNodes ) { case 4: case 5: + case 10: + case 13: // only the bottom of a reversed tetrahedron can be internal return ( myVolForward || faceIndex != 0 ); case 6: + case 15: // in a forward pentahedron, the top is internal, in a reversed one - bottom return ( myVolForward ? faceIndex != 1 : faceIndex != 0 ); - case 8: { + case 8: + case 20: { // in a forward hexahedron, even face normal is external, odd - internal bool odd = faceIndex % 2; return ( myVolForward ? !odd : odd ); @@ -679,7 +970,8 @@ bool SMDS_VolumeTool::GetFaceNormal (int faceIndex, double & X, double & Y, doub XYZ aVec13( p3 - p1 ); XYZ cross = aVec12.Crossed( aVec13 ); - if ( myFaceNbNodes == 4 ) { + //if ( myFaceNbNodes == 4 ) { + if ( myFaceNbNodes >3 ) { XYZ p4 ( myFaceNodes[3] ); XYZ aVec14( p4 - p1 ); XYZ cross2 = aVec13.Crossed( aVec14 ); @@ -815,7 +1107,7 @@ bool SMDS_VolumeTool::IsLinked (const SMDS_MeshNode* theNode1, bool SMDS_VolumeTool::IsLinked (const int theNode1Index, const int theNode2Index) const { - if (myVolume->IsPoly()) { + if ( myVolume->IsPoly() ) { return IsLinked(myVolumeNodes[theNode1Index], myVolumeNodes[theNode2Index]); } @@ -853,6 +1145,57 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index, default:; } break; + case 10: + { + switch ( minInd ) { + case 0: if( maxInd==4 || maxInd==6 || maxInd==7 ) return true; + case 1: if( maxInd==4 || maxInd==5 || maxInd==8 ) return true; + case 2: if( maxInd==5 || maxInd==6 || maxInd==9 ) return true; + case 3: if( maxInd==7 || maxInd==8 || maxInd==9 ) return true; + default:; + } + break; + } + case 13: + { + switch ( minInd ) { + case 0: if( maxInd==5 || maxInd==8 || maxInd==9 ) return true; + case 1: if( maxInd==5 || maxInd==6 || maxInd==10 ) return true; + case 2: if( maxInd==6 || maxInd==7 || maxInd==11 ) return true; + case 3: if( maxInd==7 || maxInd==8 || maxInd==12 ) return true; + case 4: if( maxInd==9 || maxInd==10 || maxInd==11 || maxInd==12 ) return true; + default:; + } + break; + } + case 15: + { + switch ( minInd ) { + case 0: if( maxInd==6 || maxInd==8 || maxInd==12 ) return true; + case 1: if( maxInd==6 || maxInd==7 || maxInd==13 ) return true; + case 2: if( maxInd==7 || maxInd==8 || maxInd==14 ) return true; + case 3: if( maxInd==9 || maxInd==11 || maxInd==12 ) return true; + case 4: if( maxInd==9 || maxInd==10 || maxInd==13 ) return true; + case 5: if( maxInd==10 || maxInd==11 || maxInd==14 ) return true; + default:; + } + break; + } + case 20: + { + switch ( minInd ) { + case 0: if( maxInd==8 || maxInd==11 || maxInd==16 ) return true; + case 1: if( maxInd==8 || maxInd==9 || maxInd==17 ) return true; + case 2: if( maxInd==9 || maxInd==10 || maxInd==18 ) return true; + case 3: if( maxInd==10 || maxInd==11 || maxInd==19 ) return true; + case 4: if( maxInd==12 || maxInd==15 || maxInd==16 ) return true; + case 5: if( maxInd==12 || maxInd==13 || maxInd==17 ) return true; + case 6: if( maxInd==13 || maxInd==14 || maxInd==18 ) return true; + case 7: if( maxInd==14 || maxInd==15 || maxInd==19 ) return true; + default:; + } + break; + } default:; } return false; @@ -894,8 +1237,7 @@ bool SMDS_VolumeTool::IsFreeFace( int faceIndex ) typedef map< const SMDS_MeshElement*, int > TElemIntMap; TElemIntMap volNbShared; TElemIntMap::iterator vNbIt; - for ( int iNode = 0; iNode < nbFaceNodes; iNode++ ) - { + for ( int iNode = 0; iNode < nbFaceNodes; iNode++ ) { const SMDS_MeshNode* n = nodes[ iNode ]; SMDS_ElemIteratorPtr eIt = n->GetInverseElementIterator(); while ( eIt->more() ) { @@ -903,10 +1245,12 @@ bool SMDS_VolumeTool::IsFreeFace( int faceIndex ) if ( elem != myVolume && elem->GetType() == SMDSAbs_Volume ) { int nbShared = 1; vNbIt = volNbShared.find( elem ); - if ( vNbIt == volNbShared.end() ) + if ( vNbIt == volNbShared.end() ) { volNbShared.insert ( TElemIntMap::value_type( elem, nbShared )); - else + } + else { nbShared = ++(*vNbIt).second; + } if ( nbShared > maxNbShared ) maxNbShared = nbShared; } @@ -922,8 +1266,7 @@ bool SMDS_VolumeTool::IsFreeFace( int faceIndex ) if ( IsFaceExternal( faceIndex )) intNormal = XYZ( -intNormal.x, -intNormal.y, -intNormal.z ); XYZ p0 ( nodes[0] ), baryCenter; - for ( vNbIt = volNbShared.begin(); vNbIt != volNbShared.end(); vNbIt++ ) - { + for ( vNbIt = volNbShared.begin(); vNbIt != volNbShared.end(); vNbIt++ ) { int nbShared = (*vNbIt).second; if ( nbShared >= 3 ) { SMDS_VolumeTool volume( (*vNbIt).first ); @@ -935,20 +1278,20 @@ bool SMDS_VolumeTool::IsFreeFace( int faceIndex ) // remove a volume from volNbShared map volNbShared.erase( vNbIt ); } + // here volNbShared contains only volumes laying on the // opposite side of the face - if ( volNbShared.empty() ) + if ( volNbShared.empty() ) { return free; // is free + } // check if the whole area of a face is shared bool isShared[] = { false, false, false, false }; // 4 triangle parts of a quadrangle - for ( vNbIt = volNbShared.begin(); vNbIt != volNbShared.end(); vNbIt++ ) - { + for ( vNbIt = volNbShared.begin(); vNbIt != volNbShared.end(); vNbIt++ ) { SMDS_VolumeTool volume( (*vNbIt).first ); bool prevLinkShared = false; int nbSharedLinks = 0; - for ( int iNode = 0; iNode < nbFaceNodes; iNode++ ) - { + for ( int iNode = 0; iNode < nbFaceNodes; iNode++ ) { bool linkShared = volume.IsLinked( nodes[ iNode ], nodes[ iNode + 1] ); if ( linkShared ) nbSharedLinks++; @@ -1059,7 +1402,8 @@ bool SMDS_VolumeTool::setFace( int faceIndex ) } myFaceNodes[ myFaceNbNodes ] = myFaceNodes[ 0 ]; // last = first - } else { + } + else { // choose face node indices switch ( myVolumeNbNodes ) { case 4: @@ -1090,6 +1434,34 @@ bool SMDS_VolumeTool::setFace( int faceIndex ) else myFaceNodeIndices = Hexa_F[ faceIndex ]; break; + case 10: + myFaceNbNodes = QuadTetra_nbN[ faceIndex ]; + if ( myExternalFaces ) + myFaceNodeIndices = myVolForward ? QuadTetra_F[ faceIndex ] : QuadTetra_RE[ faceIndex ]; + else + myFaceNodeIndices = myVolForward ? QuadTetra_F[ faceIndex ] : QuadTetra_R[ faceIndex ]; + break; + case 13: + myFaceNbNodes = QuadPyram_nbN[ faceIndex ]; + if ( myExternalFaces ) + myFaceNodeIndices = myVolForward ? QuadPyram_F[ faceIndex ] : QuadPyram_RE[ faceIndex ]; + else + myFaceNodeIndices = myVolForward ? QuadPyram_F[ faceIndex ] : QuadPyram_R[ faceIndex ]; + break; + case 15: + myFaceNbNodes = QuadPenta_nbN[ faceIndex ]; + if ( myExternalFaces ) + myFaceNodeIndices = myVolForward ? QuadPenta_FE[ faceIndex ] : QuadPenta_RE[ faceIndex ]; + else + myFaceNodeIndices = myVolForward ? QuadPenta_F[ faceIndex ] : QuadPenta_R[ faceIndex ]; + break; + case 20: + myFaceNbNodes = QuadHexa_nbN[ faceIndex ]; + if ( myExternalFaces ) + myFaceNodeIndices = myVolForward ? QuadHexa_FE[ faceIndex ] : QuadHexa_RE[ faceIndex ]; + else + myFaceNodeIndices = QuadHexa_F[ faceIndex ]; + break; default: return false; } @@ -1118,6 +1490,10 @@ SMDS_VolumeTool::VolumeType SMDS_VolumeTool::GetType(int nbNodes) case 5: return PYRAM; case 6: return PENTA; case 8: return HEXA; + case 10: return QUAD_TETRA; + case 13: return QUAD_PYRAM; + case 15: return QUAD_PENTA; + case 20: return QUAD_HEXA; default:return UNKNOWN; } } @@ -1130,10 +1506,14 @@ SMDS_VolumeTool::VolumeType SMDS_VolumeTool::GetType(int nbNodes) int SMDS_VolumeTool::NbFaces( VolumeType type ) { switch ( type ) { - case TETRA: return 4; - case PYRAM: return 5; - case PENTA: return 5; - case HEXA : return 6; + case TETRA : + case QUAD_TETRA: return 4; + case PYRAM : + case QUAD_PYRAM: return 5; + case PENTA : + case QUAD_PENTA: return 5; + case HEXA : + case QUAD_HEXA : return 6; default: return 0; } } @@ -1155,6 +1535,10 @@ const int* SMDS_VolumeTool::GetFaceNodesIndices(VolumeType type, case PYRAM: return Pyramid_F[ faceIndex ]; case PENTA: return external ? Penta_FE[ faceIndex ] : Penta_F[ faceIndex ]; case HEXA: return external ? Hexa_FE[ faceIndex ] : Hexa_F[ faceIndex ]; + case QUAD_TETRA: return QuadTetra_F[ faceIndex ]; + case QUAD_PYRAM: return QuadPyram_F[ faceIndex ]; + case QUAD_PENTA: return external ? QuadPenta_FE[ faceIndex ] : QuadPenta_F[ faceIndex ]; + case QUAD_HEXA: return external ? QuadHexa_FE[ faceIndex ] : QuadHexa_F[ faceIndex ]; default:; } return 0; @@ -1173,6 +1557,10 @@ int SMDS_VolumeTool::NbFaceNodes(VolumeType type, case PYRAM: return Pyramid_nbN[ faceIndex ]; case PENTA: return Penta_nbN[ faceIndex ]; case HEXA: return Hexa_nbN[ faceIndex ]; + case QUAD_TETRA: return QuadTetra_nbN[ faceIndex ]; + case QUAD_PYRAM: return QuadPyram_nbN[ faceIndex ]; + case QUAD_PENTA: return QuadPenta_nbN[ faceIndex ]; + case QUAD_HEXA: return QuadHexa_nbN[ faceIndex ]; default:; } return 0; diff --git a/src/SMDS/SMDS_VolumeTool.hxx b/src/SMDS/SMDS_VolumeTool.hxx index 357475a81..5385eb2dc 100644 --- a/src/SMDS/SMDS_VolumeTool.hxx +++ b/src/SMDS/SMDS_VolumeTool.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -51,7 +51,8 @@ class SMDS_EXPORT SMDS_VolumeTool { public: - enum VolumeType { UNKNOWN = -1, TETRA = 0, PYRAM, PENTA, HEXA, POLYHEDA }; + enum VolumeType { UNKNOWN = -1, TETRA = 0, PYRAM, PENTA, HEXA, QUAD_TETRA, + QUAD_PYRAM, QUAD_PENTA, QUAD_HEXA, POLYHEDA }; SMDS_VolumeTool (); ~SMDS_VolumeTool (); diff --git a/src/SMESH/Makefile.in b/src/SMESH/Makefile.in index 383bf2182..64b82fd2b 100644 --- a/src/SMESH/Makefile.in +++ b/src/SMESH/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -39,6 +39,7 @@ EXPORT_HEADERS= \ SMESH_Mesh.hxx \ SMESH_subMesh.hxx \ SMESH_Hypothesis.hxx \ + SMESH_HypoFilter.hxx \ SMESH_Algo.hxx \ SMESH_1D_Algo.hxx \ SMESH_2D_Algo.hxx \ @@ -51,6 +52,7 @@ EXPORT_HEADERS= \ SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx \ SMESH_SequenceOfElemPtr.hxx \ SMESH_SequenceOfNode.hxx \ + SMESH_MesherHelper.hxx \ SMESH_SMESH.hxx EXPORT_PYSCRIPTS = @@ -69,7 +71,8 @@ LIB_SRC = SMESH_Gen.cxx SMESH_Mesh.cxx SMESH_subMesh.cxx \ SMESH_MeshEditor.cxx \ SMESH_Block.cxx \ SMESH_Pattern.cxx \ - SMESH_HypoFilter.cxx + SMESH_HypoFilter.cxx \ + SMESH_MesherHelper.cxx LIB_SERVER_IDL = @@ -80,11 +83,11 @@ BIN = BIN_SRC = # additionnal information to compile and link file -CPPFLAGS+= $(OCC_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \ - -I${MED_ROOT_DIR}/include/salome -I${GEOM_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) -CXXFLAGS+= $(OCC_CXXFLAGS) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \ - -I${MED_ROOT_DIR}/include/salome -I${GEOM_ROOT_DIR}/include/salome -LDFLAGS+= -L${KERNEL_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome -L${MED_ROOT_DIR}/lib/salome -lNMTTools -lSMESHDS -lMeshDriverDAT -lMeshDriverSTL -lMeshDriverMED -lMeshDriverUNV +CPPFLAGS+= $(OCC_INCLUDES) $(HDF5_INCLUDES) $(KERNEL_CXXFLAGS) \ + $(MED_CXXFLAGS) $(GEOM_CXX_FLAGS) $(BOOST_CPPFLAGS) +CXXFLAGS+= $(OCC_CXXFLAGS) $(HDF5_INCLUDES) $(KERNEL_CXXFLAGS) \ + $(MED_CXXFLAGS) $(GEOM_CXX_FLAGS) +LDFLAGS+= $(KERNEL_LDFLAGS) $(GEOM_LDFLAGS) $(MED_LDFLAGS) -lNMTTools -lSMESHDS -lMeshDriverDAT -lMeshDriverSTL -lMeshDriverMED -lMeshDriverUNV @CAS_LDPATH@ -lTKShHealing @CONCLUDE@ diff --git a/src/SMESH/SMESH_1D_Algo.cxx b/src/SMESH/SMESH_1D_Algo.cxx index 7a3e9d813..122419379 100644 --- a/src/SMESH/SMESH_1D_Algo.cxx +++ b/src/SMESH/SMESH_1D_Algo.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH/SMESH_1D_Algo.hxx b/src/SMESH/SMESH_1D_Algo.hxx index 653b37c0c..c7582b1b4 100644 --- a/src/SMESH/SMESH_1D_Algo.hxx +++ b/src/SMESH/SMESH_1D_Algo.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH/SMESH_2D_Algo.cxx b/src/SMESH/SMESH_2D_Algo.cxx index 1e11fc42a..84d0db491 100644 --- a/src/SMESH/SMESH_2D_Algo.cxx +++ b/src/SMESH/SMESH_2D_Algo.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -28,7 +28,7 @@ #include "SMESH_2D_Algo.hxx" #include "SMESH_Gen.hxx" -#include "SMESH_subMesh.hxx" +#include #include "utilities.h" @@ -81,13 +81,14 @@ int SMESH_2D_Algo::NumberOfWires(const TopoDS_Shape& S) int SMESH_2D_Algo::NumberOfPoints(SMESH_Mesh& aMesh, const TopoDS_Wire& W) { int nbPoints = 0; - for (TopExp_Explorer exp(W,TopAbs_EDGE); exp.More(); exp.Next()) - { - const TopoDS_Edge& E = TopoDS::Edge(exp.Current()); - int nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes(); - //SCRUTE(nb); - nbPoints += nb +1; // internal points plus 1 vertex of 2 (last point ?) - } - //SCRUTE(nbPoints); + for (TopExp_Explorer exp(W,TopAbs_EDGE); exp.More(); exp.Next()) { + const TopoDS_Edge& E = TopoDS::Edge(exp.Current()); + int nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes(); + if(_quadraticMesh) + nb = nb/2; + nbPoints += nb + 1; // internal points plus 1 vertex of 2 (last point ?) + } return nbPoints; } + + diff --git a/src/SMESH/SMESH_2D_Algo.hxx b/src/SMESH/SMESH_2D_Algo.hxx index dce6fbcfd..1156854e7 100644 --- a/src/SMESH/SMESH_2D_Algo.hxx +++ b/src/SMESH/SMESH_2D_Algo.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -32,7 +32,8 @@ #include "SMESH_SMESH.hxx" #include "SMESH_Algo.hxx" -#include +#include "SMESH_subMesh.hxx" +#include "TopoDS_Wire.hxx" class SMESH_EXPORT SMESH_2D_Algo: public SMESH_Algo @@ -43,6 +44,7 @@ public: int NumberOfWires(const TopoDS_Shape& S); int NumberOfPoints(SMESH_Mesh& aMesh,const TopoDS_Wire& W); + }; #endif diff --git a/src/SMESH/SMESH_3D_Algo.cxx b/src/SMESH/SMESH_3D_Algo.cxx index 3e1e5a407..ed3004ff0 100644 --- a/src/SMESH/SMESH_3D_Algo.cxx +++ b/src/SMESH/SMESH_3D_Algo.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -28,7 +28,6 @@ #include "SMESH_3D_Algo.hxx" #include "SMESH_Gen.hxx" -#include "SMESH_subMesh.hxx" #include "utilities.h" @@ -57,3 +56,5 @@ SMESH_3D_Algo::SMESH_3D_Algo(int hypId, int studyId, SMESH_Gen* gen) SMESH_3D_Algo::~SMESH_3D_Algo() { } + + diff --git a/src/SMESH/SMESH_3D_Algo.hxx b/src/SMESH/SMESH_3D_Algo.hxx index cf96d86ad..2939c27b3 100644 --- a/src/SMESH/SMESH_3D_Algo.hxx +++ b/src/SMESH/SMESH_3D_Algo.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -39,6 +39,7 @@ class SMESH_EXPORT SMESH_3D_Algo: public: SMESH_3D_Algo(int hypId, int studyId, SMESH_Gen* gen); virtual ~SMESH_3D_Algo(); + }; #endif diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index f468b926c..8f4b62f39 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -70,6 +70,7 @@ SMESH_Algo::SMESH_Algo(int hypId, int studyId, gen->_mapAlgo[hypId] = this; _onlyUnaryInput = _requireDescretBoundary = true; + _quadraticMesh = false; } //============================================================================= @@ -103,18 +104,17 @@ const vector < string > &SMESH_Algo::GetCompatibleHypothesis() */ //============================================================================= -const list & SMESH_Algo::GetUsedHypothesis( - SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) +const list & +SMESH_Algo::GetUsedHypothesis(SMESH_Mesh & aMesh, + const TopoDS_Shape & aShape, + const bool ignoreAuxiliary) { _usedHypList.clear(); - if ( !_compatibleHypothesis.empty() ) + SMESH_HypoFilter filter; + if ( InitCompatibleHypoFilter( filter, ignoreAuxiliary )) { - SMESH_HypoFilter filter( SMESH_HypoFilter::HasName( _compatibleHypothesis[0] )); - for ( int i = 1; i < _compatibleHypothesis.size(); ++i ) - filter.Or( filter.HasName( _compatibleHypothesis[ i ] )); - aMesh.GetHypotheses( aShape, filter, _usedHypList, true ); - if ( _usedHypList.size() > 1 ) + if ( ignoreAuxiliary && _usedHypList.size() > 1 ) _usedHypList.clear(); //only one compatible hypothesis allowed } return _usedHypList; @@ -128,18 +128,16 @@ const list & SMESH_Algo::GetUsedHypothesis( */ //============================================================================= -const list & SMESH_Algo::GetAppliedHypothesis( - SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) +const list & +SMESH_Algo::GetAppliedHypothesis(SMESH_Mesh & aMesh, + const TopoDS_Shape & aShape, + const bool ignoreAuxiliary) { _appliedHypList.clear(); - if ( !_compatibleHypothesis.empty() ) - { - SMESH_HypoFilter filter( SMESH_HypoFilter::HasName( _compatibleHypothesis[0] )); - for ( int i = 1; i < _compatibleHypothesis.size(); ++i ) - filter.Or( filter.HasName( _compatibleHypothesis[ i ] )); - + SMESH_HypoFilter filter; + if ( InitCompatibleHypoFilter( filter, ignoreAuxiliary )) aMesh.GetHypotheses( aShape, filter, _appliedHypList, false ); - } + return _appliedHypList; } @@ -345,3 +343,28 @@ bool SMESH_Algo::GetNodeParamOnEdge(const SMESHDS_Mesh* theMesh, return theParams.size() > 1; } + +//================================================================================ +/*! + * \brief Make filter recognize only compatible hypotheses + * \param theFilter - the filter to initialize + * \param ignoreAuxiliary - make filter ignore compatible auxiliary hypotheses + */ +//================================================================================ + +bool SMESH_Algo::InitCompatibleHypoFilter( SMESH_HypoFilter & theFilter, + const bool ignoreAuxiliary) const +{ + if ( !_compatibleHypothesis.empty() ) + { + theFilter.Init( theFilter.HasName( _compatibleHypothesis[0] )); + for ( int i = 1; i < _compatibleHypothesis.size(); ++i ) + theFilter.Or( theFilter.HasName( _compatibleHypothesis[ i ] )); + + if ( ignoreAuxiliary ) + theFilter.AndNot( theFilter.IsAuxiliary() ); + + return true; + } + return false; +} diff --git a/src/SMESH/SMESH_Algo.hxx b/src/SMESH/SMESH_Algo.hxx index 9bdb7d09a..bb39baa01 100644 --- a/src/SMESH/SMESH_Algo.hxx +++ b/src/SMESH/SMESH_Algo.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -35,16 +35,20 @@ #include #include +#include #include #include #include +#include class SMESH_Gen; class SMESH_Mesh; +class SMESH_HypoFilter; class TopoDS_Face; class TopoDS_Shape; class SMESHDS_Mesh; +class SMDS_MeshNode; class SMESH_EXPORT SMESH_Algo:public SMESH_Hypothesis { @@ -60,13 +64,27 @@ class SMESH_EXPORT SMESH_Algo:public SMESH_Hypothesis virtual bool Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) = 0; virtual const std::list & - GetUsedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape); + GetUsedHypothesis(SMESH_Mesh & aMesh, + const TopoDS_Shape & aShape, + const bool ignoreAuxiliary=true); const list & - GetAppliedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape); + GetAppliedHypothesis(SMESH_Mesh & aMesh, + const TopoDS_Shape & aShape, + const bool ignoreAuxiliary=true); static double EdgeLength(const TopoDS_Edge & E); + + /*! + * \brief Make filter recognize only compatible hypotheses + * \param theFilter - the filter to initialize + * \param ignoreAuxiliary - make filter ignore compatible auxiliary hypotheses + * \retval bool - true if the algo has compatible hypotheses + */ + bool InitCompatibleHypoFilter( SMESH_HypoFilter & theFilter, + const bool ignoreAuxiliary) const; + /*! * \brief Fill vector of node parameters on geometrical edge, including vertex nodes * \param theMesh - The mesh containing nodes @@ -123,6 +141,9 @@ class SMESH_EXPORT SMESH_Algo:public SMESH_Hypothesis std::vector _compatibleHypothesis; std::list _appliedHypList; std::list _usedHypList; + + // quadratic mesh creation required + bool _quadraticMesh; }; #endif diff --git a/src/SMESH/SMESH_Block.cxx b/src/SMESH/SMESH_Block.cxx index 431208fcf..3a0868330 100644 --- a/src/SMESH/SMESH_Block.cxx +++ b/src/SMESH/SMESH_Block.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // File : SMESH_Pattern.hxx // Created : Mon Aug 2 10:30:00 2004 diff --git a/src/SMESH/SMESH_Block.hxx b/src/SMESH/SMESH_Block.hxx index f641ba64c..50eb417ce 100644 --- a/src/SMESH/SMESH_Block.hxx +++ b/src/SMESH/SMESH_Block.hxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // File : SMESH_Block.hxx // Created : Tue Nov 30 12:42:18 2004 diff --git a/src/SMESH/SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx b/src/SMESH/SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx index 4cec8043f..1fee866c6 100644 --- a/src/SMESH/SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx +++ b/src/SMESH/SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx // Created: 26.09.05 17:41:10 diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index c5a611a29..1febbb03a 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -102,33 +102,24 @@ SMESH_Gen::~SMESH_Gen() */ //============================================================================= -SMESH_Mesh* SMESH_Gen::CreateMesh(int studyId) -throw(SALOME_Exception) +SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode) + throw(SALOME_Exception) { - Unexpect aCatch(SalomeException); - MESSAGE("SMESH_Gen::CreateMesh"); -// if (aShape.ShapeType() == TopAbs_COMPOUND) -// { -// INFOS("Mesh Compound not yet implemented!"); -// throw(SALOME_Exception(LOCALIZED("Mesh Compound not yet implemented!"))); -// } + Unexpect aCatch(SalomeException); + MESSAGE("SMESH_Gen::CreateMesh"); - // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document - - StudyContextStruct *myStudyContext = GetStudyContext(studyId); - - // create a new SMESH_mesh object - - SMESH_Mesh *mesh = new SMESH_Mesh(_localId++, - studyId, - this, - myStudyContext->myDocument); - myStudyContext->mapMesh[_localId] = mesh; + // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document + StudyContextStruct *aStudyContext = GetStudyContext(theStudyId); - // associate a TopoDS_Shape to the mesh + // create a new SMESH_mesh object + SMESH_Mesh *aMesh = new SMESH_Mesh(_localId++, + theStudyId, + this, + theIsEmbeddedMode, + aStudyContext->myDocument); + aStudyContext->mapMesh[_localId] = aMesh; -//mesh->ShapeToMesh(aShape); - return mesh; + return aMesh; } //============================================================================= @@ -633,13 +624,14 @@ SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) if ( algoList.empty() ) return NULL; - if (algoList.size() > 1 ) { // check if there is one algo several times - list ::iterator algo = algoList.begin(); - for ( ; algo != algoList.end(); ++algo ) - if ( (*algo) != algoList.front() && - (*algo)->GetName() != algoList.front()->GetName() ) - return NULL; - } + // Now it is checked in SMESH_Mesh::GetHypotheses() +// if (algoList.size() > 1 ) { // check if there is one algo several times +// list ::iterator algo = algoList.begin(); +// for ( ; algo != algoList.end(); ++algo ) +// if ( (*algo) != algoList.front() && +// (*algo)->GetName() != algoList.front()->GetName() ) +// return NULL; +// } return const_cast ( static_cast( algoList.front() )); } @@ -702,37 +694,20 @@ void SMESH_Gen::Close(int studyId) int SMESH_Gen::GetShapeDim(const TopAbs_ShapeEnum & aShapeType) { - int shapeDim = -1; // Shape dimension: 0D, 1D, 2D, 3D - int type = aShapeType;//.ShapeType(); - switch (type) - { - case TopAbs_COMPOUND: - case TopAbs_COMPSOLID: - case TopAbs_SOLID: - case TopAbs_SHELL: - { - shapeDim = 3; - break; - } - // case TopAbs_SHELL: - case TopAbs_FACE: - { - shapeDim = 2; - break; - } - case TopAbs_WIRE: - case TopAbs_EDGE: - { - shapeDim = 1; - break; - } - case TopAbs_VERTEX: - { - shapeDim = 0; - break; - } - } - return shapeDim; + static vector dim; + if ( dim.empty() ) + { + dim.resize( TopAbs_SHAPE, -1 ); + dim[ TopAbs_COMPOUND ] = 3; + dim[ TopAbs_COMPSOLID ] = 3; + dim[ TopAbs_SOLID ] = 3; + dim[ TopAbs_SHELL ] = 3; + dim[ TopAbs_FACE ] = 2; + dim[ TopAbs_WIRE ] = 1; + dim[ TopAbs_EDGE ] = 1; + dim[ TopAbs_VERTEX ] = 0; + } + return dim[ aShapeType ]; } //============================================================================= diff --git a/src/SMESH/SMESH_Gen.hxx b/src/SMESH/SMESH_Gen.hxx index 04b1bcb34..c2b8729c6 100644 --- a/src/SMESH/SMESH_Gen.hxx +++ b/src/SMESH/SMESH_Gen.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -62,7 +62,7 @@ class SMESH_EXPORT SMESH_Gen // SMESH_Hypothesis *CreateHypothesis(const char *anHyp, int studyId) // throw(SALOME_Exception); - SMESH_Mesh* CreateMesh(int studyId) + SMESH_Mesh* CreateMesh(int theStudyId, bool theIsEmbeddedMode) throw(SALOME_Exception); bool Compute(::SMESH_Mesh & aMesh, const TopoDS_Shape & aShape); diff --git a/src/SMESH/SMESH_Group.cxx b/src/SMESH/SMESH_Group.cxx index 49cade122..c0a777b61 100644 --- a/src/SMESH/SMESH_Group.cxx +++ b/src/SMESH/SMESH_Group.cxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH/SMESH_Group.hxx b/src/SMESH/SMESH_Group.hxx index 604d55f20..1b13bc578 100644 --- a/src/SMESH/SMESH_Group.hxx +++ b/src/SMESH/SMESH_Group.hxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -55,6 +55,9 @@ class SMESH_EXPORT SMESH_Group SMESHDS_GroupBase * GetGroupDS () { return myGroupDS; } + void SetColorNumber (int theColorNumber) { myColorNumber = theColorNumber; } + int GetColorNumber() const { return myColorNumber; } + private: SMESH_Group (const SMESH_Group& theOther); // prohibited copy constructor @@ -63,7 +66,7 @@ class SMESH_EXPORT SMESH_Group SMESHDS_GroupBase * myGroupDS; std::string myName; - + int myColorNumber; }; #endif diff --git a/src/SMESH/SMESH_HypoFilter.cxx b/src/SMESH/SMESH_HypoFilter.cxx index ff14016d8..fe0bcd466 100644 --- a/src/SMESH/SMESH_HypoFilter.cxx +++ b/src/SMESH/SMESH_HypoFilter.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -75,6 +75,17 @@ bool SMESH_HypoFilter::ApplicablePredicate::IsOk(const SMESH_Hypothesis* aHyp, return SMESH_subMesh::IsApplicableHypotesis( aHyp, (TopAbs_ShapeEnum)_shapeType ); }; +//======================================================================= +//function : IsAuxiliaryPredicate::IsOk +//purpose : +//======================================================================= + +bool SMESH_HypoFilter::IsAuxiliaryPredicate::IsOk(const SMESH_Hypothesis* aHyp, + const TopoDS_Shape& /*aShape*/) const +{ + return aHyp->IsAuxiliary(); +}; + //======================================================================= //function : ApplicablePredicate::ApplicablePredicate //purpose : @@ -190,6 +201,17 @@ SMESH_HypoPredicate* SMESH_HypoFilter::IsAlgo() return new TypePredicate( MORE, SMESHDS_Hypothesis::PARAM_ALGO ); } +//======================================================================= +//function : IsAuxiliary +//purpose : +//======================================================================= + +SMESH_HypoPredicate* SMESH_HypoFilter::IsAuxiliary() +{ + return new IsAuxiliaryPredicate(); +} + + //======================================================================= //function : IsGlobal //purpose : @@ -287,6 +309,7 @@ SMESH_HypoFilter & SMESH_HypoFilter::Init ( SMESH_HypoPredicate* aPredicate, bo list::const_iterator pred = myPredicates.begin(); for ( ; pred != myPredicates.end(); ++pred ) delete *pred; + myPredicates.clear(); add( notNagate ? AND : AND_NOT, aPredicate ); return *this; diff --git a/src/SMESH/SMESH_HypoFilter.hxx b/src/SMESH/SMESH_HypoFilter.hxx index 24ece73b4..ca883167e 100644 --- a/src/SMESH/SMESH_HypoFilter.hxx +++ b/src/SMESH/SMESH_HypoFilter.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -53,7 +53,7 @@ class SMESH_EXPORT SMESH_HypoPredicate { friend class SMESH_HypoFilter; }; -class SMESH_HypoFilter: public SMESH_HypoPredicate +class SMESH_EXPORT SMESH_HypoFilter: public SMESH_HypoPredicate { public: // Create and add predicates. @@ -69,6 +69,7 @@ class SMESH_HypoFilter: public SMESH_HypoPredicate // Create predicates static SMESH_HypoPredicate* IsAlgo(); + static SMESH_HypoPredicate* IsAuxiliary(); static SMESH_HypoPredicate* IsApplicableTo(const TopoDS_Shape& theShape); static SMESH_HypoPredicate* IsAssignedTo(const TopoDS_Shape& theShape); static SMESH_HypoPredicate* Is(const SMESH_Hypothesis* theHypo); @@ -160,6 +161,11 @@ class SMESH_HypoFilter: public SMESH_HypoPredicate const TopoDS_Shape& aShape) const; }; + struct IsAuxiliaryPredicate : public SMESH_HypoPredicate { + bool IsOk(const SMESH_Hypothesis* aHyp, + const TopoDS_Shape& aShape) const; + }; + }; diff --git a/src/SMESH/SMESH_Hypothesis.cxx b/src/SMESH/SMESH_Hypothesis.cxx index 6cad0b0fd..36564d322 100644 --- a/src/SMESH/SMESH_Hypothesis.cxx +++ b/src/SMESH/SMESH_Hypothesis.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -72,13 +72,14 @@ SMESH_Hypothesis::~SMESH_Hypothesis() int SMESH_Hypothesis::GetDim() const { - int dim = -1; + int dim = 0; switch (_type) { case ALGO_1D: dim = 1; break; case ALGO_2D: dim = 2; break; case ALGO_3D: dim = 3; break; - case PARAM_ALGO: dim = _param_algo_dim; break; + case PARAM_ALGO: + dim = ( _param_algo_dim < 0 ) ? -_param_algo_dim : _param_algo_dim; break; } return dim; } @@ -124,14 +125,15 @@ void SMESH_Hypothesis::NotifySubMeshesHypothesisModification() itm++) { SMESH_Mesh* mesh = (*itm).second; - const list& subMeshes = - mesh->GetSubMeshUsingHypothesis(this); + mesh->NotifySubMeshesHypothesisModification( this ); +// const list& subMeshes = +// mesh->GetSubMeshUsingHypothesis(this); - //for all subMeshes using hypothesis +// //for all subMeshes using hypothesis - list::const_iterator its; - for (its = subMeshes.begin(); its != subMeshes.end(); its++) - (*its)->ComputeStateEngine(SMESH_subMesh::MODIF_HYP); +// list::const_iterator its; +// for (its = subMeshes.begin(); its != subMeshes.end(); its++) +// (*its)->ComputeStateEngine(SMESH_subMesh::MODIF_HYP); } } diff --git a/src/SMESH/SMESH_Hypothesis.hxx b/src/SMESH/SMESH_Hypothesis.hxx index 79e439ef1..6f4cf0254 100644 --- a/src/SMESH/SMESH_Hypothesis.hxx +++ b/src/SMESH/SMESH_Hypothesis.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -51,18 +51,19 @@ public: HYP_INCOMPATIBLE, // hypothesis does not fit algo HYP_NOTCONFORM, // not conform mesh is produced appling a hypothesis HYP_ALREADY_EXIST,// such hypothesis already exist - HYP_BAD_DIM // bad dimension + HYP_BAD_DIM, // bad dimension + HYP_BAD_SUBSHAPE // shape is neither the main one, nor its subshape, nor a group }; static bool IsStatusFatal(Hypothesis_Status theStatus) { return theStatus >= HYP_UNKNOWN_FATAL; } SMESH_Hypothesis(int hypId, int studyId, SMESH_Gen* gen); virtual ~SMESH_Hypothesis(); - int GetDim() const; + virtual int GetDim() const; int GetStudyId() const; - void NotifySubMeshesHypothesisModification(); - int GetShapeType() const; - const char* GetLibName() const; + virtual void NotifySubMeshesHypothesisModification(); + virtual int GetShapeType() const; + virtual const char* GetLibName() const; void SetLibName(const char* theLibName); /*! @@ -73,6 +74,17 @@ public: */ virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape)=0; + /*! + * \brief Return true if me is an auxiliary hypothesis + * \retval bool - auxiliary or not + * + * An auxiliary hypothesis is optional, i.e. an algorithm + * can work without it and another hypothesis of the same + * dimention can be assigned to the shape + */ + virtual bool IsAuxiliary() const + { return GetType() == PARAM_ALGO && _param_algo_dim <= 0; } + protected: SMESH_Gen* _gen; int _studyId; diff --git a/src/SMESH/SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx b/src/SMESH/SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx index 838d1f6a8..678e995c9 100644 --- a/src/SMESH/SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx +++ b/src/SMESH/SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx // Created: 20.09.05 09:51:12 diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index a4b5f80af..bb88ca0bd 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -63,6 +63,9 @@ #include "Utils_ExceptHandlers.hxx" +// maximum stored group name length in MED file +#define MAX_MED_GROUP_NAME_LENGTH 80 + #ifdef _DEBUG_ static int MYDEBUG = 0; #else @@ -76,17 +79,21 @@ static int MYDEBUG = 0; */ //============================================================================= -SMESH_Mesh::SMESH_Mesh(int localId, int studyId, SMESH_Gen * gen, SMESHDS_Document * myDocument) -: _groupId( 0 ) +SMESH_Mesh::SMESH_Mesh(int theLocalId, + int theStudyId, + SMESH_Gen* theGen, + bool theIsEmbeddedMode, + SMESHDS_Document* theDocument): + _groupId( 0 ) { INFOS("SMESH_Mesh::SMESH_Mesh(int localId)"); - _id = localId; - _studyId = studyId; - _gen = gen; - _myDocument = myDocument; - _idDoc = _myDocument->NewMesh(); - _myMeshDS = _myDocument->GetMesh(_idDoc); - _isShapeToMesh = false; + _id = theLocalId; + _studyId = theStudyId; + _gen = theGen; + _myDocument = theDocument; + _idDoc = theDocument->NewMesh(theIsEmbeddedMode); + _myMeshDS = theDocument->GetMesh(_idDoc); + _isShapeToMesh = false; } //============================================================================= @@ -149,7 +156,7 @@ void SMESH_Mesh::ShapeToMesh(const TopoDS_Shape & aShape) // fill _mapAncestors _mapAncestors.Clear(); int desType, ancType; - for ( desType = TopAbs_EDGE; desType > TopAbs_COMPOUND; desType-- ) + for ( desType = TopAbs_VERTEX; desType > TopAbs_COMPOUND; desType-- ) for ( ancType = desType - 1; ancType >= TopAbs_COMPOUND; ancType-- ) TopExp::MapShapesAndAncestors ( aShape, (TopAbs_ShapeEnum) desType, @@ -177,10 +184,40 @@ int SMESH_Mesh::UNVToMesh(const char* theFileName) myReader.SetMeshId(-1); myReader.Perform(); if(MYDEBUG){ - MESSAGE("MEDToMesh - _myMeshDS->NbNodes() = "<<_myMeshDS->NbNodes()); - MESSAGE("MEDToMesh - _myMeshDS->NbEdges() = "<<_myMeshDS->NbEdges()); - MESSAGE("MEDToMesh - _myMeshDS->NbFaces() = "<<_myMeshDS->NbFaces()); - MESSAGE("MEDToMesh - _myMeshDS->NbVolumes() = "<<_myMeshDS->NbVolumes()); + MESSAGE("UNVToMesh - _myMeshDS->NbNodes() = "<<_myMeshDS->NbNodes()); + MESSAGE("UNVToMesh - _myMeshDS->NbEdges() = "<<_myMeshDS->NbEdges()); + MESSAGE("UNVToMesh - _myMeshDS->NbFaces() = "<<_myMeshDS->NbFaces()); + MESSAGE("UNVToMesh - _myMeshDS->NbVolumes() = "<<_myMeshDS->NbVolumes()); + } + SMDS_MeshGroup* aGroup = (SMDS_MeshGroup*) myReader.GetGroup(); + if (aGroup != 0) { + TGroupNamesMap aGroupNames = myReader.GetGroupNamesMap(); + //const TGroupIdMap& aGroupId = myReader.GetGroupIdMap(); + aGroup->InitSubGroupsIterator(); + while (aGroup->MoreSubGroups()) { + SMDS_MeshGroup* aSubGroup = (SMDS_MeshGroup*) aGroup->NextSubGroup(); + std::string aName = aGroupNames[aSubGroup]; + int aId; + + SMESH_Group* aSMESHGroup = AddGroup( aSubGroup->GetType(), aName.c_str(), aId ); + if ( aSMESHGroup ) { + if(MYDEBUG) MESSAGE("UNVToMesh - group added: "<( aSMESHGroup->GetGroupDS() ); + if ( aGroupDS ) { + aGroupDS->SetStoreName(aName.c_str()); + aSubGroup->InitIterator(); + const SMDS_MeshElement* aElement = 0; + while (aSubGroup->More()) { + aElement = aSubGroup->Next(); + if (aElement) { + aGroupDS->SMDSGroup().Add(aElement); + } + } + if (aElement) + aGroupDS->SetType(aElement->GetType()); + } + } + } } return 1; } @@ -235,7 +272,7 @@ int SMESH_Mesh::MEDToMesh(const char* theFileName, const char* theMeshName) int SMESH_Mesh::STLToMesh(const char* theFileName) { - if(MYDEBUG) MESSAGE("UNVToMesh - theFileName = "<NbNodes() = "<<_myMeshDS->NbNodes()); - MESSAGE("MEDToMesh - _myMeshDS->NbEdges() = "<<_myMeshDS->NbEdges()); - MESSAGE("MEDToMesh - _myMeshDS->NbFaces() = "<<_myMeshDS->NbFaces()); - MESSAGE("MEDToMesh - _myMeshDS->NbVolumes() = "<<_myMeshDS->NbVolumes()); + MESSAGE("STLToMesh - _myMeshDS->NbNodes() = "<<_myMeshDS->NbNodes()); + MESSAGE("STLToMesh - _myMeshDS->NbEdges() = "<<_myMeshDS->NbEdges()); + MESSAGE("STLToMesh - _myMeshDS->NbFaces() = "<<_myMeshDS->NbFaces()); + MESSAGE("STLToMesh - _myMeshDS->NbVolumes() = "<<_myMeshDS->NbVolumes()); } return 1; } @@ -267,6 +304,9 @@ SMESH_Hypothesis::Hypothesis_Status if(MYDEBUG) MESSAGE("SMESH_Mesh::AddHypothesis"); SMESH_subMesh *subMesh = GetSubMesh(aSubShape); + if ( !subMesh || !subMesh->GetId()) + return SMESH_Hypothesis::HYP_BAD_SUBSHAPE; + SMESHDS_SubMesh *subMeshDS = subMesh->GetSubMeshDS(); if ( subMeshDS && subMeshDS->IsComplexSubmesh() ) // group of sub-shapes and maybe of not sub- { @@ -520,45 +560,62 @@ const SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const TopoDS_Shape & aSubS //purpose : //======================================================================= -bool SMESH_Mesh::GetHypotheses(const TopoDS_Shape & aSubShape, - const SMESH_HypoFilter& aFilter, - list & aHypList, - const bool andAncestors) const +//================================================================================ +/*! + * \brief Return hypothesis assigned to the shape + * \param aSubShape - the shape to check + * \param aFilter - the hypothesis filter + * \param aHypList - the list of the found hypotheses + * \param andAncestors - flag to check hypos assigned to ancestors of the shape + * \retval int - number of unique hypos in aHypList + */ +//================================================================================ + +int SMESH_Mesh::GetHypotheses(const TopoDS_Shape & aSubShape, + const SMESH_HypoFilter& aFilter, + list & aHypList, + const bool andAncestors) const { - int nbHyp = 0; + set hypTypes; // to exclude same type hypos from the result list + int nbHyps = 0; + + // fill in hypTypes + list::const_iterator hyp; + for ( hyp = aHypList.begin(); hyp != aHypList.end(); hyp++ ) + if ( hypTypes.insert( (*hyp)->GetName() ).second ) + nbHyps++; + + // get hypos from aSubShape { const list& hypList = _myMeshDS->GetHypothesis(aSubShape); - list::const_iterator hyp = hypList.begin(); - for ( ; hyp != hypList.end(); hyp++ ) - if ( aFilter.IsOk (static_cast( *hyp ), aSubShape)) { + for ( hyp = hypList.begin(); hyp != hypList.end(); hyp++ ) + if ( aFilter.IsOk (static_cast( *hyp ), aSubShape) && + hypTypes.insert( (*hyp)->GetName() ).second ) + { aHypList.push_back( *hyp ); - nbHyp++; + nbHyps++; } } - // get hypos from shape of one type only: if any hypo is found on edge, do - // not look up on faces - if ( !nbHyp && andAncestors ) + + // get hypos from ancestors of aSubShape + if ( andAncestors ) { TopTools_MapOfShape map; TopTools_ListIteratorOfListOfShape it( GetAncestors( aSubShape )); - int shapeType = it.More() ? it.Value().ShapeType() : TopAbs_SHAPE; for (; it.More(); it.Next() ) { - if ( nbHyp && shapeType != it.Value().ShapeType() ) - break; - shapeType = it.Value().ShapeType(); - if ( !map.Add( it.Value() )) + if ( !map.Add( it.Value() )) continue; const list& hypList = _myMeshDS->GetHypothesis(it.Value()); - list::const_iterator hyp = hypList.begin(); - for ( ; hyp != hypList.end(); hyp++ ) - if (aFilter.IsOk( static_cast( *hyp ), it.Value() )) { - aHypList.push_back( *hyp ); - nbHyp++; - } + for ( hyp = hypList.begin(); hyp != hypList.end(); hyp++ ) + if (aFilter.IsOk( static_cast( *hyp ), it.Value() ) && + hypTypes.insert( (*hyp)->GetName() ).second ) { + aHypList.push_back( *hyp ); + nbHyps++; + } } } - return nbHyp; + return nbHyps; } //============================================================================= @@ -616,28 +673,31 @@ SMESH_Gen *SMESH_Mesh::GetGen() //============================================================================= SMESH_subMesh *SMESH_Mesh::GetSubMesh(const TopoDS_Shape & aSubShape) -throw(SALOME_Exception) + throw(SALOME_Exception) { Unexpect aCatch(SalomeException); SMESH_subMesh *aSubMesh; int index = _myMeshDS->ShapeToIndex(aSubShape); - + // for submeshes on GEOM Group if ( !index && aSubShape.ShapeType() == TopAbs_COMPOUND ) { TopoDS_Iterator it( aSubShape ); if ( it.More() ) index = _myMeshDS->AddCompoundSubmesh( aSubShape, it.Value().ShapeType() ); } +// if ( !index ) +// return NULL; // neither sub-shape nor a group - if (_mapSubMesh.find(index) != _mapSubMesh.end()) - { - aSubMesh = _mapSubMesh[index]; - } + map ::iterator i_sm = _mapSubMesh.find(index); + if ( i_sm != _mapSubMesh.end()) + { + aSubMesh = i_sm->second; + } else - { - aSubMesh = new SMESH_subMesh(index, this, _myMeshDS, aSubShape); - _mapSubMesh[index] = aSubMesh; - } + { + aSubMesh = new SMESH_subMesh(index, this, _myMeshDS, aSubShape); + _mapSubMesh[index] = aSubMesh; + } return aSubMesh; } @@ -649,20 +709,17 @@ throw(SALOME_Exception) //============================================================================= SMESH_subMesh *SMESH_Mesh::GetSubMeshContaining(const TopoDS_Shape & aSubShape) -throw(SALOME_Exception) + throw(SALOME_Exception) { Unexpect aCatch(SalomeException); - bool isFound = false; SMESH_subMesh *aSubMesh = NULL; int index = _myMeshDS->ShapeToIndex(aSubShape); - if (_mapSubMesh.find(index) != _mapSubMesh.end()) - { - aSubMesh = _mapSubMesh[index]; - isFound = true; - } - if (!isFound) - aSubMesh = NULL; + + map ::iterator i_sm = _mapSubMesh.find(index); + if ( i_sm != _mapSubMesh.end()) + aSubMesh = i_sm->second; + return aSubMesh; } @@ -690,15 +747,17 @@ throw(SALOME_Exception) //======================================================================= bool SMESH_Mesh::IsUsedHypothesis(SMESHDS_Hypothesis * anHyp, - const TopoDS_Shape & aSubShape) + const SMESH_subMesh* aSubMesh) { SMESH_Hypothesis* hyp = static_cast(anHyp); - // check if anHyp is applicable to aSubShape - SMESH_subMesh * subMesh = GetSubMeshContaining( aSubShape ); - if ( !subMesh || !subMesh->IsApplicableHypotesis( hyp )) + + // check if anHyp can be used to mesh aSubMesh + if ( !aSubMesh || !aSubMesh->IsApplicableHypotesis( hyp )) return false; - SMESH_Algo *algo = _gen->GetAlgo(*this, aSubShape); + const TopoDS_Shape & aSubShape = const_cast( aSubMesh )->GetSubShape(); + + SMESH_Algo *algo = _gen->GetAlgo(*this, aSubShape ); // algorithm if (anHyp->GetType() > SMESHDS_Hypothesis::PARAM_ALGO) @@ -708,17 +767,19 @@ bool SMESH_Mesh::IsUsedHypothesis(SMESHDS_Hypothesis * anHyp, if (algo) { // look trough hypotheses used by algo - const list &usedHyps = - algo->GetUsedHypothesis(*this, aSubShape); - return ( find( usedHyps.begin(), usedHyps.end(), anHyp ) != usedHyps.end() ); + SMESH_HypoFilter hypoKind; + if ( algo->InitCompatibleHypoFilter( hypoKind, !hyp->IsAuxiliary() )) { + list usedHyps; + if ( GetHypotheses( aSubShape, hypoKind, usedHyps, true )) + return ( find( usedHyps.begin(), usedHyps.end(), anHyp ) != usedHyps.end() ); + } } // look through all assigned hypotheses - SMESH_HypoFilter filter( SMESH_HypoFilter::Is( hyp )); - return GetHypothesis( aSubShape, filter, true ); + //SMESH_HypoFilter filter( SMESH_HypoFilter::Is( hyp )); + return false; //GetHypothesis( aSubShape, filter, true ); } - //============================================================================= /*! * @@ -726,28 +787,100 @@ bool SMESH_Mesh::IsUsedHypothesis(SMESHDS_Hypothesis * anHyp, //============================================================================= const list < SMESH_subMesh * >& - SMESH_Mesh::GetSubMeshUsingHypothesis(SMESHDS_Hypothesis * anHyp) -throw(SALOME_Exception) +SMESH_Mesh::GetSubMeshUsingHypothesis(SMESHDS_Hypothesis * anHyp) + throw(SALOME_Exception) { Unexpect aCatch(SalomeException); - if(MYDEBUG) MESSAGE("SMESH_Mesh::GetSubMeshUsingHypothesis"); - map < int, SMESH_subMesh * >::iterator itsm; - _subMeshesUsingHypothesisList.clear(); - for (itsm = _mapSubMesh.begin(); itsm != _mapSubMesh.end(); itsm++) - { - SMESH_subMesh *aSubMesh = (*itsm).second; - if ( IsUsedHypothesis ( anHyp, aSubMesh->GetSubShape() )) - _subMeshesUsingHypothesisList.push_back(aSubMesh); - } - return _subMeshesUsingHypothesisList; + if(MYDEBUG) MESSAGE("SMESH_Mesh::GetSubMeshUsingHypothesis"); + map < int, SMESH_subMesh * >::iterator itsm; + _subMeshesUsingHypothesisList.clear(); + for (itsm = _mapSubMesh.begin(); itsm != _mapSubMesh.end(); itsm++) + { + SMESH_subMesh *aSubMesh = (*itsm).second; + if ( IsUsedHypothesis ( anHyp, aSubMesh )) + _subMeshesUsingHypothesisList.push_back(aSubMesh); + } + return _subMeshesUsingHypothesisList; +} + +//======================================================================= +//function : NotifySubMeshesHypothesisModification +//purpose : Say all submeshes using theChangedHyp that it has been modified +//======================================================================= + +void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* theChangedHyp) +{ + Unexpect aCatch(SalomeException); + + const SMESH_Hypothesis* hyp = static_cast(theChangedHyp); + + const SMESH_Algo *foundAlgo = 0; + SMESH_HypoFilter algoKind( SMESH_HypoFilter::IsAlgo() ); + SMESH_HypoFilter compatibleHypoKind; + list usedHyps; + + + map < int, SMESH_subMesh * >::iterator itsm; + for (itsm = _mapSubMesh.begin(); itsm != _mapSubMesh.end(); itsm++) + { + SMESH_subMesh *aSubMesh = (*itsm).second; + if ( aSubMesh->IsApplicableHypotesis( hyp )) + { + const TopoDS_Shape & aSubShape = aSubMesh->GetSubShape(); + + if ( !foundAlgo ) // init filter for algo search + algoKind.And( algoKind.IsApplicableTo( aSubShape )); + + const SMESH_Algo *algo = static_cast + ( GetHypothesis( aSubShape, algoKind, true )); + + if ( algo ) + { + bool sameAlgo = ( algo == foundAlgo ); + if ( !sameAlgo && foundAlgo ) + sameAlgo = ( strcmp( algo->GetName(), foundAlgo->GetName() ) == 0); + + if ( !sameAlgo ) { // init filter for used hypos search + if ( !algo->InitCompatibleHypoFilter( compatibleHypoKind, !hyp->IsAuxiliary() )) + continue; // algo does not use any hypothesis + foundAlgo = algo; + } + + // check if hyp is used by algo + usedHyps.clear(); + if ( GetHypotheses( aSubShape, compatibleHypoKind, usedHyps, true ) && + find( usedHyps.begin(), usedHyps.end(), hyp ) != usedHyps.end() ) + { + aSubMesh->ComputeStateEngine(SMESH_subMesh::MODIF_HYP); + + if ( algo->GetDim() == 1 && IsPropagationHypothesis( aSubShape )) + CleanMeshOnPropagationChain( aSubShape ); + } + } + } + } } //============================================================================= -/*! - * +/*! Export* methods. + * To store mesh contents on disk in different formats. */ //============================================================================= +bool SMESH_Mesh::HasDuplicatedGroupNamesMED() +{ + set aGroupNames; + for ( map::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) { + SMESH_Group* aGroup = it->second; + string aGroupName = aGroup->GetName(); + aGroupName.resize(MAX_MED_GROUP_NAME_LENGTH); + if (!aGroupNames.insert(aGroupName).second) + return true; + } + + return false; +} + void SMESH_Mesh::ExportMED(const char *file, const char* theMeshName, bool theAutoGroups, @@ -755,6 +888,7 @@ void SMESH_Mesh::ExportMED(const char *file, throw(SALOME_Exception) { Unexpect aCatch(SalomeException); + DriverMED_W_SMESHDS_Mesh myWriter; myWriter.SetFile ( file, MED::EVersion(theVersion) ); myWriter.SetMesh ( _myMeshDS ); @@ -772,15 +906,28 @@ void SMESH_Mesh::ExportMED(const char *file, myWriter.AddGroupOfVolumes(); } + // Pass groups to writer. Provide unique group names. + set aGroupNames; + char aString [256]; + int maxNbIter = 10000; // to guarantee cycle finish for ( map::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) { SMESH_Group* aGroup = it->second; SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS(); if ( aGroupDS ) { - aGroupDS->SetStoreName( aGroup->GetName() ); + string aGroupName0 = aGroup->GetName(); + aGroupName0.resize(MAX_MED_GROUP_NAME_LENGTH); + string aGroupName = aGroupName0; + for (int i = 1; !aGroupNames.insert(aGroupName).second && i < maxNbIter; i++) { + sprintf(&aString[0], "GR_%d_%s", i, aGroupName0.c_str()); + aGroupName = aString; + aGroupName.resize(MAX_MED_GROUP_NAME_LENGTH); + } + aGroupDS->SetStoreName( aGroupName.c_str() ); myWriter.AddGroup( aGroupDS ); } } + // Perform export myWriter.Perform(); } @@ -801,6 +948,17 @@ void SMESH_Mesh::ExportUNV(const char *file) throw(SALOME_Exception) myWriter.SetFile(string(file)); myWriter.SetMesh(_myMeshDS); myWriter.SetMeshId(_idDoc); + // myWriter.SetGroups(_mapGroup); + + for ( map::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) { + SMESH_Group* aGroup = it->second; + SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS(); + if ( aGroupDS ) { + string aGroupName = aGroup->GetName(); + aGroupDS->SetStoreName( aGroupName.c_str() ); + myWriter.AddGroup( aGroupDS ); + } + } myWriter.Perform(); } @@ -831,10 +989,21 @@ int SMESH_Mesh::NbNodes() throw(SALOME_Exception) * */ //============================================================================= -int SMESH_Mesh::NbEdges() throw(SALOME_Exception) +int SMESH_Mesh::NbEdges(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); - return _myMeshDS->NbEdges(); + if (order == ORDER_ANY) + return _myMeshDS->NbEdges(); + + int Nb = 0; + SMDS_EdgeIteratorPtr it = _myMeshDS->edgesIterator(); + while (it->more()) { + const SMDS_MeshEdge* cur = it->next(); + if ( order == ORDER_LINEAR && !cur->IsQuadratic() || + order == ORDER_QUADRATIC && cur->IsQuadratic() ) + Nb++; + } + return Nb; } //============================================================================= @@ -842,26 +1011,40 @@ int SMESH_Mesh::NbEdges() throw(SALOME_Exception) * */ //============================================================================= -int SMESH_Mesh::NbFaces() throw(SALOME_Exception) +int SMESH_Mesh::NbFaces(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); - return _myMeshDS->NbFaces(); + if (order == ORDER_ANY) + return _myMeshDS->NbFaces(); + + int Nb = 0; + SMDS_FaceIteratorPtr it = _myMeshDS->facesIterator(); + while (it->more()) { + const SMDS_MeshFace* cur = it->next(); + if ( order == ORDER_LINEAR && !cur->IsQuadratic() || + order == ORDER_QUADRATIC && cur->IsQuadratic() ) + Nb++; + } + return Nb; } /////////////////////////////////////////////////////////////////////////////// /// Return the number of 3 nodes faces in the mesh. This method run in O(n) /////////////////////////////////////////////////////////////////////////////// -int SMESH_Mesh::NbTriangles() throw(SALOME_Exception) +int SMESH_Mesh::NbTriangles(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); int Nb = 0; SMDS_FaceIteratorPtr itFaces=_myMeshDS->facesIterator(); - //while(itFaces->more()) if(itFaces->next()->NbNodes()==3) Nb++; - const SMDS_MeshFace * curFace; while (itFaces->more()) { - curFace = itFaces->next(); - if (!curFace->IsPoly() && curFace->NbNodes() == 3) Nb++; + const SMDS_MeshFace* curFace = itFaces->next(); + int nbnod = curFace->NbNodes(); + if ( !curFace->IsPoly() && + ( order == ORDER_ANY && (nbnod==3 || nbnod==6) || + order == ORDER_LINEAR && nbnod==3 || + order == ORDER_QUADRATIC && nbnod==6 ) ) + Nb++; } return Nb; } @@ -869,17 +1052,20 @@ int SMESH_Mesh::NbTriangles() throw(SALOME_Exception) /////////////////////////////////////////////////////////////////////////////// /// Return the number of 4 nodes faces in the mesh. This method run in O(n) /////////////////////////////////////////////////////////////////////////////// -int SMESH_Mesh::NbQuadrangles() throw(SALOME_Exception) +int SMESH_Mesh::NbQuadrangles(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); int Nb = 0; SMDS_FaceIteratorPtr itFaces=_myMeshDS->facesIterator(); - //while(itFaces->more()) if(itFaces->next()->NbNodes()==4) Nb++; - const SMDS_MeshFace * curFace; while (itFaces->more()) { - curFace = itFaces->next(); - if (!curFace->IsPoly() && curFace->NbNodes() == 4) Nb++; + const SMDS_MeshFace* curFace = itFaces->next(); + int nbnod = curFace->NbNodes(); + if ( !curFace->IsPoly() && + ( order == ORDER_ANY && (nbnod==4 || nbnod==8) || + order == ORDER_LINEAR && nbnod==4 || + order == ORDER_QUADRATIC && nbnod==8 ) ) + Nb++; } return Nb; } @@ -902,64 +1088,87 @@ int SMESH_Mesh::NbPolygons() throw(SALOME_Exception) * */ //============================================================================= -int SMESH_Mesh::NbVolumes() throw(SALOME_Exception) +int SMESH_Mesh::NbVolumes(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); - return _myMeshDS->NbVolumes(); + if (order == ORDER_ANY) + return _myMeshDS->NbVolumes(); + + int Nb = 0; + SMDS_VolumeIteratorPtr it = _myMeshDS->volumesIterator(); + while (it->more()) { + const SMDS_MeshVolume* cur = it->next(); + if ( order == ORDER_LINEAR && !cur->IsQuadratic() || + order == ORDER_QUADRATIC && cur->IsQuadratic() ) + Nb++; + } + return Nb; } -int SMESH_Mesh::NbTetras() throw(SALOME_Exception) +int SMESH_Mesh::NbTetras(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); int Nb = 0; SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator(); - //while(itVolumes->more()) if(itVolumes->next()->NbNodes()==4) Nb++; - const SMDS_MeshVolume * curVolume; while (itVolumes->more()) { - curVolume = itVolumes->next(); - if (!curVolume->IsPoly() && curVolume->NbNodes() == 4) Nb++; + const SMDS_MeshVolume* curVolume = itVolumes->next(); + int nbnod = curVolume->NbNodes(); + if ( !curVolume->IsPoly() && + ( order == ORDER_ANY && (nbnod==4 || nbnod==10) || + order == ORDER_LINEAR && nbnod==4 || + order == ORDER_QUADRATIC && nbnod==10 ) ) + Nb++; } return Nb; } -int SMESH_Mesh::NbHexas() throw(SALOME_Exception) +int SMESH_Mesh::NbHexas(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); int Nb = 0; SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator(); - //while(itVolumes->more()) if(itVolumes->next()->NbNodes()==8) Nb++; - const SMDS_MeshVolume * curVolume; while (itVolumes->more()) { - curVolume = itVolumes->next(); - if (!curVolume->IsPoly() && curVolume->NbNodes() == 8) Nb++; + const SMDS_MeshVolume* curVolume = itVolumes->next(); + int nbnod = curVolume->NbNodes(); + if ( !curVolume->IsPoly() && + ( order == ORDER_ANY && (nbnod==8 || nbnod==20) || + order == ORDER_LINEAR && nbnod==8 || + order == ORDER_QUADRATIC && nbnod==20 ) ) + Nb++; } return Nb; } -int SMESH_Mesh::NbPyramids() throw(SALOME_Exception) +int SMESH_Mesh::NbPyramids(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); int Nb = 0; SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator(); - //while(itVolumes->more()) if(itVolumes->next()->NbNodes()==5) Nb++; - const SMDS_MeshVolume * curVolume; while (itVolumes->more()) { - curVolume = itVolumes->next(); - if (!curVolume->IsPoly() && curVolume->NbNodes() == 5) Nb++; + const SMDS_MeshVolume* curVolume = itVolumes->next(); + int nbnod = curVolume->NbNodes(); + if ( !curVolume->IsPoly() && + ( order == ORDER_ANY && (nbnod==5 || nbnod==13) || + order == ORDER_LINEAR && nbnod==5 || + order == ORDER_QUADRATIC && nbnod==13 ) ) + Nb++; } return Nb; } -int SMESH_Mesh::NbPrisms() throw(SALOME_Exception) +int SMESH_Mesh::NbPrisms(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); int Nb = 0; SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator(); - //while(itVolumes->more()) if(itVolumes->next()->NbNodes()==6) Nb++; - const SMDS_MeshVolume * curVolume; while (itVolumes->more()) { - curVolume = itVolumes->next(); - if (!curVolume->IsPoly() && curVolume->NbNodes() == 6) Nb++; + const SMDS_MeshVolume* curVolume = itVolumes->next(); + int nbnod = curVolume->NbNodes(); + if ( !curVolume->IsPoly() && + ( order == ORDER_ANY && (nbnod==6 || nbnod==15) || + order == ORDER_LINEAR && nbnod==6 || + order == ORDER_QUADRATIC && nbnod==15 ) ) + Nb++; } return Nb; } @@ -1152,7 +1361,7 @@ void SMESH_Mesh::CleanMeshOnPropagationChain (const TopoDS_Shape& theMainEdge) SMESH_subMesh *subMesh = GetSubMesh(anEdge); SMESHDS_SubMesh *subMeshDS = subMesh->GetSubMeshDS(); if (subMeshDS && subMeshDS->NbElements() > 0) { - subMesh->ComputeStateEngine(SMESH_subMesh::CLEANDEP); + subMesh->ComputeStateEngine(SMESH_subMesh::CLEAN); } } } diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx index 246bbbca8..35bd13d50 100644 --- a/src/SMESH/SMESH_Mesh.hxx +++ b/src/SMESH/SMESH_Mesh.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -81,8 +81,11 @@ class SMESH_EXPORT SMESH_Mesh SMESH_Mesh(); SMESH_Mesh(const SMESH_Mesh&); public: - SMESH_Mesh(int localId, int studyId, SMESH_Gen * gen, - SMESHDS_Document * myDocument); + SMESH_Mesh(int theLocalId, + int theStudyId, + SMESH_Gen* theGen, + bool theIsEmbeddedMode, + SMESHDS_Document* theDocument); virtual ~SMESH_Mesh(); @@ -112,10 +115,10 @@ public: const SMESH_HypoFilter& aFilter, const bool andAncestors) const; - bool GetHypotheses(const TopoDS_Shape & aSubShape, - const SMESH_HypoFilter& aFilter, - list & aHypList, - const bool andAncestors) const; + int GetHypotheses(const TopoDS_Shape & aSubShape, + const SMESH_HypoFilter& aFilter, + list & aHypList, + const bool andAncestors) const; const list & GetLog() throw(SALOME_Exception); @@ -136,12 +139,15 @@ public: SMESH_subMesh *GetSubMeshContaining(const int aShapeID) throw(SALOME_Exception); + void NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* theChangedHyp); + // Say all submeshes that theChangedHyp has been modified + const list < SMESH_subMesh * >& GetSubMeshUsingHypothesis(SMESHDS_Hypothesis * anHyp) throw(SALOME_Exception); - bool IsUsedHypothesis(SMESHDS_Hypothesis * anHyp, - const TopoDS_Shape & aSubShape); + bool IsUsedHypothesis(SMESHDS_Hypothesis * anHyp, + const SMESH_subMesh * aSubMesh); // Return True if anHyp is used to mesh aSubShape bool IsNotConformAllowed() const; @@ -152,7 +158,12 @@ public: const TopTools_ListOfShape& GetAncestors(const TopoDS_Shape& theSubShape) const; // return list of ancestors of theSubShape in the order // that lower dimention shapes come first. - + + /*! Check group names for duplications. + * Consider maximum group name length stored in MED file. + */ + bool HasDuplicatedGroupNamesMED(); + void ExportMED(const char *file, const char* theMeshName = NULL, bool theAutoGroups = true, @@ -165,25 +176,34 @@ public: int NbNodes() throw(SALOME_Exception); - int NbEdges() throw(SALOME_Exception); + /*! + * ElementOrder points out entities of what order are requested + */ + enum ElementOrder { + ORDER_ANY, /*! entities of any order */ + ORDER_LINEAR, /*! entities of 1st order */ + ORDER_QUADRATIC /*! entities of 2nd order */ + }; + + int NbEdges(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbFaces() throw(SALOME_Exception); + int NbFaces(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbTriangles() throw(SALOME_Exception); + int NbTriangles(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbQuadrangles() throw(SALOME_Exception); + int NbQuadrangles(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); int NbPolygons() throw(SALOME_Exception); - int NbVolumes() throw(SALOME_Exception); + int NbVolumes(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbTetras() throw(SALOME_Exception); + int NbTetras(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbHexas() throw(SALOME_Exception); + int NbHexas(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbPyramids() throw(SALOME_Exception); + int NbPyramids(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbPrisms() throw(SALOME_Exception); + int NbPrisms(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); int NbPolyhedrons() throw(SALOME_Exception); diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 572fa86c7..5e35f719c 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -34,12 +34,14 @@ #include "SMDS_PolyhedralVolumeOfNodes.hxx" #include "SMDS_FacePosition.hxx" #include "SMDS_SpacePosition.hxx" +#include "SMDS_QuadraticFaceOfNodes.hxx" #include "SMESHDS_Group.hxx" #include "SMESHDS_Mesh.hxx" #include "SMESH_subMesh.hxx" #include "SMESH_ControlsDef.hxx" +#include "SMESH_MesherHelper.hxx" #include "utilities.h" @@ -64,6 +66,7 @@ #include #include #include +#include #include @@ -75,8 +78,12 @@ typedef map > TElemOfNode typedef map > TElemOfElemListMap; typedef map > TNodeOfNodeListMap; typedef TNodeOfNodeListMap::iterator TNodeOfNodeListMapItr; +//typedef map > TNodeOfNodeVecMap; +//typedef TNodeOfNodeVecMap::iterator TNodeOfNodeVecMapItr; typedef map > TElemOfVecOfNnlmiMap; +//typedef map > TElemOfVecOfMapNodesMap; +typedef pair NLink; //======================================================================= //function : SMESH_MeshEditor @@ -97,13 +104,14 @@ myMesh( theMesh ) bool SMESH_MeshEditor::Remove (const list< int >& theIDs, const bool isNodes ) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); SMESHDS_Mesh* aMesh = GetMeshDS(); set< SMESH_subMesh *> smmap; list::const_iterator it = theIDs.begin(); - for ( ; it != theIDs.end(); it++ ) - { + for ( ; it != theIDs.end(); it++ ) { const SMDS_MeshElement * elem; if ( isNodes ) elem = aMesh->FindNode( *it ); @@ -114,16 +122,12 @@ bool SMESH_MeshEditor::Remove (const list< int >& theIDs, // Find sub-meshes to notify about modification SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator(); - while ( nodeIt->more() ) - { + while ( nodeIt->more() ) { const SMDS_MeshNode* node = static_cast( nodeIt->next() ); const SMDS_PositionPtr& aPosition = node->GetPosition(); if ( aPosition.get() ) { - int aShapeID = aPosition->GetShapeId(); - if ( aShapeID ) { - TopoDS_Shape aShape = aMesh->IndexToShape( aShapeID ); - SMESH_subMesh * sm = GetMesh()->GetSubMeshContaining( aShape ); - if ( sm ) + if ( int aShapeID = aPosition->GetShapeId() ) { + if ( SMESH_subMesh * sm = GetMesh()->GetSubMeshContaining( aShapeID ) ) smmap.insert( sm ); } } @@ -142,6 +146,11 @@ bool SMESH_MeshEditor::Remove (const list< int >& theIDs, for ( smIt = smmap.begin(); smIt != smmap.end(); smIt++ ) (*smIt)->ComputeStateEngine( SMESH_subMesh::MESH_ENTITY_REMOVED ); } + + // Check if the whole mesh becomes empty + if ( SMESH_subMesh * sm = GetMesh()->GetSubMeshContaining( 1 ) ) + sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE ); + return true; } @@ -153,12 +162,14 @@ bool SMESH_MeshEditor::Remove (const list< int >& theIDs, int SMESH_MeshEditor::FindShape (const SMDS_MeshElement * theElem) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + SMESHDS_Mesh * aMesh = GetMeshDS(); if ( aMesh->ShapeToMesh().IsNull() ) return 0; - if ( theElem->GetType() == SMDSAbs_Node ) - { + if ( theElem->GetType() == SMDSAbs_Node ) { const SMDS_PositionPtr& aPosition = static_cast( theElem )->GetPosition(); if ( aPosition.get() ) @@ -169,25 +180,22 @@ int SMESH_MeshEditor::FindShape (const SMDS_MeshElement * theElem) TopoDS_Shape aShape; // the shape a node is on SMDS_ElemIteratorPtr nodeIt = theElem->nodesIterator(); - while ( nodeIt->more() ) - { + while ( nodeIt->more() ) { const SMDS_MeshNode* node = static_cast( nodeIt->next() ); const SMDS_PositionPtr& aPosition = node->GetPosition(); if ( aPosition.get() ) { - int aShapeID = aPosition->GetShapeId(); - SMESHDS_SubMesh * sm = aMesh->MeshElements( aShapeID ); - if ( sm ) - { - if ( sm->Contains( theElem )) - return aShapeID; - if ( aShape.IsNull() ) - aShape = aMesh->IndexToShape( aShapeID ); - } - else - { - //MESSAGE ( "::FindShape() No SubShape for aShapeID " << aShapeID ); - } + int aShapeID = aPosition->GetShapeId(); + SMESHDS_SubMesh * sm = aMesh->MeshElements( aShapeID ); + if ( sm ) { + if ( sm->Contains( theElem )) + return aShapeID; + if ( aShape.IsNull() ) + aShape = aMesh->IndexToShape( aShapeID ); + } + else { + //MESSAGE ( "::FindShape() No SubShape for aShapeID " << aShapeID ); } + } } // None of nodes is on a proper shape, @@ -197,17 +205,108 @@ int SMESH_MeshEditor::FindShape (const SMDS_MeshElement * theElem) return 0; } TopTools_ListIteratorOfListOfShape ancIt( GetMesh()->GetAncestors( aShape )); - for ( ; ancIt.More(); ancIt.Next() ) - { - SMESHDS_SubMesh * sm = aMesh->MeshElements( ancIt.Value() ); - if ( sm && sm->Contains( theElem )) - return aMesh->ShapeToIndex( ancIt.Value() ); + for ( ; ancIt.More(); ancIt.Next() ) { + SMESHDS_SubMesh * sm = aMesh->MeshElements( ancIt.Value() ); + if ( sm && sm->Contains( theElem )) + return aMesh->ShapeToIndex( ancIt.Value() ); } //MESSAGE ("::FindShape() - SHAPE NOT FOUND") return 0; } +//======================================================================= +//function : IsMedium +//purpose : +//======================================================================= + +bool SMESH_MeshEditor::IsMedium(const SMDS_MeshNode* node, + const SMDSAbs_ElementType typeToCheck) +{ + bool isMedium = false; + SMDS_ElemIteratorPtr it = node->GetInverseElementIterator(); + while (it->more()) { + const SMDS_MeshElement* elem = it->next(); + isMedium = elem->IsMediumNode(node); + if ( typeToCheck == SMDSAbs_All || elem->GetType() == typeToCheck ) + break; + } + return isMedium; +} + +//======================================================================= +//function : ShiftNodesQuadTria +//purpose : auxilary +// Shift nodes in the array corresponded to quadratic triangle +// example: (0,1,2,3,4,5) -> (1,2,0,4,5,3) +//======================================================================= +static void ShiftNodesQuadTria(const SMDS_MeshNode* aNodes[]) +{ + const SMDS_MeshNode* nd1 = aNodes[0]; + aNodes[0] = aNodes[1]; + aNodes[1] = aNodes[2]; + aNodes[2] = nd1; + const SMDS_MeshNode* nd2 = aNodes[3]; + aNodes[3] = aNodes[4]; + aNodes[4] = aNodes[5]; + aNodes[5] = nd2; +} + +//======================================================================= +//function : GetNodesFromTwoTria +//purpose : auxilary +// Shift nodes in the array corresponded to quadratic triangle +// example: (0,1,2,3,4,5) -> (1,2,0,4,5,3) +//======================================================================= +static bool GetNodesFromTwoTria(const SMDS_MeshElement * theTria1, + const SMDS_MeshElement * theTria2, + const SMDS_MeshNode* N1[], + const SMDS_MeshNode* N2[]) +{ + SMDS_ElemIteratorPtr it = theTria1->nodesIterator(); + int i=0; + while(i<6) { + N1[i] = static_cast( it->next() ); + i++; + } + if(it->more()) return false; + it = theTria2->nodesIterator(); + i=0; + while(i<6) { + N2[i] = static_cast( it->next() ); + i++; + } + if(it->more()) return false; + + int sames[3] = {-1,-1,-1}; + int nbsames = 0; + int j; + for(i=0; i<3; i++) { + for(j=0; j<3; j++) { + if(N1[i]==N2[j]) { + sames[i] = j; + nbsames++; + break; + } + } + } + if(nbsames!=2) return false; + if(sames[0]>-1) { + ShiftNodesQuadTria(N1); + if(sames[1]>-1) { + ShiftNodesQuadTria(N1); + } + } + i = sames[0] + sames[1] + sames[2]; + for(; i<2; i++) { + ShiftNodesQuadTria(N2); + } + // now we receive following N1 and N2 (using numeration as above image) + // tria1 : (1 2 4 5 9 7) and tria2 : (3 4 2 8 9 6) + // i.e. first nodes from both arrays determ new diagonal + return true; +} + //======================================================================= //function : InverseDiag //purpose : Replace two neighbour triangles with ones built on the same 4 nodes @@ -218,73 +317,121 @@ int SMESH_MeshEditor::FindShape (const SMDS_MeshElement * theElem) bool SMESH_MeshEditor::InverseDiag (const SMDS_MeshElement * theTria1, const SMDS_MeshElement * theTria2 ) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + if (!theTria1 || !theTria2) return false; + const SMDS_FaceOfNodes* F1 = dynamic_cast( theTria1 ); - if (!F1) return false; const SMDS_FaceOfNodes* F2 = dynamic_cast( theTria2 ); - if (!F2) return false; + if (F1 && F2) { - // 1 +--+ A theTria1: ( 1 A B ) A->2 ( 1 2 B ) 1 +--+ A - // | /| theTria2: ( B A 2 ) B->1 ( 1 A 2 ) |\ | - // |/ | | \| - // B +--+ 2 B +--+ 2 + // 1 +--+ A theTria1: ( 1 A B ) A->2 ( 1 2 B ) 1 +--+ A + // | /| theTria2: ( B A 2 ) B->1 ( 1 A 2 ) |\ | + // |/ | | \| + // B +--+ 2 B +--+ 2 - // put nodes in array and find out indices of the same ones - const SMDS_MeshNode* aNodes [6]; - int sameInd [] = { 0, 0, 0, 0, 0, 0 }; - int i = 0; - SMDS_ElemIteratorPtr it = theTria1->nodesIterator(); - while ( it->more() ) - { - aNodes[ i ] = static_cast( it->next() ); - - if ( i > 2 ) // theTria2 - // find same node of theTria1 - for ( int j = 0; j < 3; j++ ) - if ( aNodes[ i ] == aNodes[ j ]) { - sameInd[ j ] = i; - sameInd[ i ] = j; - break; - } - // next - i++; - if ( i == 3 ) { - if ( it->more() ) - return false; // theTria1 is not a triangle - it = theTria2->nodesIterator(); + // put nodes in array and find out indices of the same ones + const SMDS_MeshNode* aNodes [6]; + int sameInd [] = { 0, 0, 0, 0, 0, 0 }; + int i = 0; + SMDS_ElemIteratorPtr it = theTria1->nodesIterator(); + while ( it->more() ) { + aNodes[ i ] = static_cast( it->next() ); + + if ( i > 2 ) // theTria2 + // find same node of theTria1 + for ( int j = 0; j < 3; j++ ) + if ( aNodes[ i ] == aNodes[ j ]) { + sameInd[ j ] = i; + sameInd[ i ] = j; + break; + } + // next + i++; + if ( i == 3 ) { + if ( it->more() ) + return false; // theTria1 is not a triangle + it = theTria2->nodesIterator(); + } + if ( i == 6 && it->more() ) + return false; // theTria2 is not a triangle } - if ( i == 6 && it->more() ) - return false; // theTria2 is not a triangle - } - - // find indices of 1,2 and of A,B in theTria1 - int iA = 0, iB = 0, i1 = 0, i2 = 0; - for ( i = 0; i < 6; i++ ) - { - if ( sameInd [ i ] == 0 ) - if ( i < 3 ) i1 = i; - else i2 = i; - else if (i < 3) - if ( iA ) iB = i; - else iA = i; - } - // nodes 1 and 2 should not be the same - if ( aNodes[ i1 ] == aNodes[ i2 ] ) - return false; - - - // theTria1: A->2 - aNodes[ iA ] = aNodes[ i2 ]; - // theTria2: B->1 - aNodes[ sameInd[ iB ]] = aNodes[ i1 ]; + + // find indices of 1,2 and of A,B in theTria1 + int iA = 0, iB = 0, i1 = 0, i2 = 0; + for ( i = 0; i < 6; i++ ) { + if ( sameInd [ i ] == 0 ) + if ( i < 3 ) i1 = i; + else i2 = i; + else if (i < 3) + if ( iA ) iB = i; + else iA = i; + } + // nodes 1 and 2 should not be the same + if ( aNodes[ i1 ] == aNodes[ i2 ] ) + return false; - //MESSAGE( theTria1 << theTria2 ); + // theTria1: A->2 + aNodes[ iA ] = aNodes[ i2 ]; + // theTria2: B->1 + aNodes[ sameInd[ iB ]] = aNodes[ i1 ]; - GetMeshDS()->ChangeElementNodes( theTria1, aNodes, 3 ); - GetMeshDS()->ChangeElementNodes( theTria2, &aNodes[ 3 ], 3 ); + //MESSAGE( theTria1 << theTria2 ); + + GetMeshDS()->ChangeElementNodes( theTria1, aNodes, 3 ); + GetMeshDS()->ChangeElementNodes( theTria2, &aNodes[ 3 ], 3 ); + + //MESSAGE( theTria1 << theTria2 ); - //MESSAGE( theTria1 << theTria2 ); + return true; + + } // end if(F1 && F2) + + // check case of quadratic faces + const SMDS_QuadraticFaceOfNodes* QF1 = + dynamic_cast (theTria1); + if(!QF1) return false; + const SMDS_QuadraticFaceOfNodes* QF2 = + dynamic_cast (theTria2); + if(!QF2) return false; + + // 5 + // 1 +--+--+ 2 theTria1: (1 2 4 5 9 7) or (2 4 1 9 7 5) or (4 1 2 7 5 9) + // | /| theTria2: (2 3 4 6 8 9) or (3 4 2 8 9 6) or (4 2 3 9 6 8) + // | / | + // 7 + + + 6 + // | /9 | + // |/ | + // 4 +--+--+ 3 + // 8 + + const SMDS_MeshNode* N1 [6]; + const SMDS_MeshNode* N2 [6]; + if(!GetNodesFromTwoTria(theTria1,theTria2,N1,N2)) + return false; + // now we receive following N1 and N2 (using numeration as above image) + // tria1 : (1 2 4 5 9 7) and tria2 : (3 4 2 8 9 6) + // i.e. first nodes from both arrays determ new diagonal + + const SMDS_MeshNode* N1new [6]; + const SMDS_MeshNode* N2new [6]; + N1new[0] = N1[0]; + N1new[1] = N2[0]; + N1new[2] = N2[1]; + N1new[3] = N1[4]; + N1new[4] = N2[3]; + N1new[5] = N1[5]; + N2new[0] = N1[0]; + N2new[1] = N1[1]; + N2new[2] = N2[0]; + N2new[3] = N1[3]; + N2new[4] = N2[5]; + N2new[5] = N1[4]; + // replaces nodes in faces + GetMeshDS()->ChangeElementNodes( theTria1, N1new, 6 ); + GetMeshDS()->ChangeElementNodes( theTria2, N2new, 6 ); return true; } @@ -316,9 +463,17 @@ static bool findTriangles(const SMDS_MeshNode * theNode1, if ( elem->GetType() == SMDSAbs_Face && emap.find( elem ) != emap.end() ) if ( theTria1 ) { - theTria2 = elem; + // theTria1 must be element with minimum ID + if( theTria1->GetID() < elem->GetID() ) { + theTria2 = elem; + } + else { + theTria2 = theTria1; + theTria1 = elem; + } break; - } else { + } + else { theTria1 = elem; } } @@ -335,6 +490,9 @@ static bool findTriangles(const SMDS_MeshNode * theNode1, bool SMESH_MeshEditor::InverseDiag (const SMDS_MeshNode * theNode1, const SMDS_MeshNode * theNode2) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + MESSAGE( "::InverseDiag()" ); const SMDS_MeshElement *tr1, *tr2; @@ -342,55 +500,65 @@ bool SMESH_MeshEditor::InverseDiag (const SMDS_MeshNode * theNode1, return false; const SMDS_FaceOfNodes* F1 = dynamic_cast( tr1 ); - if (!F1) return false; + //if (!F1) return false; const SMDS_FaceOfNodes* F2 = dynamic_cast( tr2 ); - if (!F2) return false; - - // 1 +--+ A tr1: ( 1 A B ) A->2 ( 1 2 B ) 1 +--+ A - // | /| tr2: ( B A 2 ) B->1 ( 1 A 2 ) |\ | - // |/ | | \| - // B +--+ 2 B +--+ 2 - - // put nodes in array - // and find indices of 1,2 and of A in tr1 and of B in tr2 - int i, iA1 = 0, i1 = 0; - const SMDS_MeshNode* aNodes1 [3]; - SMDS_ElemIteratorPtr it; - for (i = 0, it = tr1->nodesIterator(); it->more(); i++ ) { - aNodes1[ i ] = static_cast( it->next() ); - if ( aNodes1[ i ] == theNode1 ) - iA1 = i; // node A in tr1 - else if ( aNodes1[ i ] != theNode2 ) - i1 = i; // node 1 - } - int iB2 = 0, i2 = 0; - const SMDS_MeshNode* aNodes2 [3]; - for (i = 0, it = tr2->nodesIterator(); it->more(); i++ ) { - aNodes2[ i ] = static_cast( it->next() ); - if ( aNodes2[ i ] == theNode2 ) - iB2 = i; // node B in tr2 - else if ( aNodes2[ i ] != theNode1 ) - i2 = i; // node 2 - } - - // nodes 1 and 2 should not be the same - if ( aNodes1[ i1 ] == aNodes2[ i2 ] ) - return false; - - // tr1: A->2 - aNodes1[ iA1 ] = aNodes2[ i2 ]; - // tr2: B->1 - aNodes2[ iB2 ] = aNodes1[ i1 ]; + //if (!F2) return false; + if (F1 && F2) { + + // 1 +--+ A tr1: ( 1 A B ) A->2 ( 1 2 B ) 1 +--+ A + // | /| tr2: ( B A 2 ) B->1 ( 1 A 2 ) |\ | + // |/ | | \| + // B +--+ 2 B +--+ 2 + + // put nodes in array + // and find indices of 1,2 and of A in tr1 and of B in tr2 + int i, iA1 = 0, i1 = 0; + const SMDS_MeshNode* aNodes1 [3]; + SMDS_ElemIteratorPtr it; + for (i = 0, it = tr1->nodesIterator(); it->more(); i++ ) { + aNodes1[ i ] = static_cast( it->next() ); + if ( aNodes1[ i ] == theNode1 ) + iA1 = i; // node A in tr1 + else if ( aNodes1[ i ] != theNode2 ) + i1 = i; // node 1 + } + int iB2 = 0, i2 = 0; + const SMDS_MeshNode* aNodes2 [3]; + for (i = 0, it = tr2->nodesIterator(); it->more(); i++ ) { + aNodes2[ i ] = static_cast( it->next() ); + if ( aNodes2[ i ] == theNode2 ) + iB2 = i; // node B in tr2 + else if ( aNodes2[ i ] != theNode1 ) + i2 = i; // node 2 + } + + // nodes 1 and 2 should not be the same + if ( aNodes1[ i1 ] == aNodes2[ i2 ] ) + return false; - //MESSAGE( tr1 << tr2 ); + // tr1: A->2 + aNodes1[ iA1 ] = aNodes2[ i2 ]; + // tr2: B->1 + aNodes2[ iB2 ] = aNodes1[ i1 ]; - GetMeshDS()->ChangeElementNodes( tr1, aNodes1, 3 ); - GetMeshDS()->ChangeElementNodes( tr2, aNodes2, 3 ); + //MESSAGE( tr1 << tr2 ); - //MESSAGE( tr1 << tr2 ); + GetMeshDS()->ChangeElementNodes( tr1, aNodes1, 3 ); + GetMeshDS()->ChangeElementNodes( tr2, aNodes2, 3 ); - return true; + //MESSAGE( tr1 << tr2 ); + + return true; + } + // check case of quadratic faces + const SMDS_QuadraticFaceOfNodes* QF1 = + dynamic_cast (tr1); + if(!QF1) return false; + const SMDS_QuadraticFaceOfNodes* QF2 = + dynamic_cast (tr2); + if(!QF2) return false; + return InverseDiag(tr1,tr2); } //======================================================================= @@ -406,12 +574,16 @@ bool getQuadrangleNodes(const SMDS_MeshNode * theQuadNodes [], const SMDS_MeshElement * tr1, const SMDS_MeshElement * tr2 ) { + if( tr1->NbNodes() != tr2->NbNodes() ) + return false; // find the 4-th node to insert into tr1 const SMDS_MeshNode* n4 = 0; SMDS_ElemIteratorPtr it = tr2->nodesIterator(); - while ( !n4 && it->more() ) - { + int i=0; + //while ( !n4 && it->more() ) { + while ( !n4 && i<3 ) { const SMDS_MeshNode * n = static_cast( it->next() ); + i++; bool isDiag = ( n == theNode1 || n == theNode2 ); if ( !isDiag ) n4 = n; @@ -419,19 +591,19 @@ bool getQuadrangleNodes(const SMDS_MeshNode * theQuadNodes [], // Make an array of nodes to be in a quadrangle int iNode = 0, iFirstDiag = -1; it = tr1->nodesIterator(); - while ( it->more() ) - { + i=0; + //while ( it->more() ) { + while ( i<3 ) { const SMDS_MeshNode * n = static_cast( it->next() ); + i++; bool isDiag = ( n == theNode1 || n == theNode2 ); - if ( isDiag ) - { + if ( isDiag ) { if ( iFirstDiag < 0 ) iFirstDiag = iNode; else if ( iNode - iFirstDiag == 1 ) theQuadNodes[ iNode++ ] = n4; // insert the 4-th node between diagonal nodes } - else if ( n == n4 ) - { + else if ( n == n4 ) { return false; // tr1 and tr2 should not have all the same nodes } theQuadNodes[ iNode++ ] = n; @@ -452,6 +624,9 @@ bool getQuadrangleNodes(const SMDS_MeshNode * theQuadNodes [], bool SMESH_MeshEditor::DeleteDiag (const SMDS_MeshNode * theNode1, const SMDS_MeshNode * theNode2) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + MESSAGE( "::DeleteDiag()" ); const SMDS_MeshElement *tr1, *tr2; @@ -459,20 +634,68 @@ bool SMESH_MeshEditor::DeleteDiag (const SMDS_MeshNode * theNode1, return false; const SMDS_FaceOfNodes* F1 = dynamic_cast( tr1 ); - if (!F1) return false; + //if (!F1) return false; const SMDS_FaceOfNodes* F2 = dynamic_cast( tr2 ); - if (!F2) return false; + //if (!F2) return false; + if (F1 && F2) { - const SMDS_MeshNode* aNodes [ 4 ]; - if ( ! getQuadrangleNodes( aNodes, theNode1, theNode2, tr1, tr2 )) - return false; + const SMDS_MeshNode* aNodes [ 4 ]; + if ( ! getQuadrangleNodes( aNodes, theNode1, theNode2, tr1, tr2 )) + return false; + + //MESSAGE( endl << tr1 << tr2 ); + + GetMeshDS()->ChangeElementNodes( tr1, aNodes, 4 ); + myLastCreatedElems.Append(tr1); + GetMeshDS()->RemoveElement( tr2 ); + + //MESSAGE( endl << tr1 ); - //MESSAGE( endl << tr1 << tr2 ); + return true; + } - GetMeshDS()->ChangeElementNodes( tr1, aNodes, 4 ); + // check case of quadratic faces + const SMDS_QuadraticFaceOfNodes* QF1 = + dynamic_cast (tr1); + if(!QF1) return false; + const SMDS_QuadraticFaceOfNodes* QF2 = + dynamic_cast (tr2); + if(!QF2) return false; + + // 5 + // 1 +--+--+ 2 tr1: (1 2 4 5 9 7) or (2 4 1 9 7 5) or (4 1 2 7 5 9) + // | /| tr2: (2 3 4 6 8 9) or (3 4 2 8 9 6) or (4 2 3 9 6 8) + // | / | + // 7 + + + 6 + // | /9 | + // |/ | + // 4 +--+--+ 3 + // 8 + + const SMDS_MeshNode* N1 [6]; + const SMDS_MeshNode* N2 [6]; + if(!GetNodesFromTwoTria(tr1,tr2,N1,N2)) + return false; + // now we receive following N1 and N2 (using numeration as above image) + // tria1 : (1 2 4 5 9 7) and tria2 : (3 4 2 8 9 6) + // i.e. first nodes from both arrays determ new diagonal + + const SMDS_MeshNode* aNodes[8]; + aNodes[0] = N1[0]; + aNodes[1] = N1[1]; + aNodes[2] = N2[0]; + aNodes[3] = N2[1]; + aNodes[4] = N1[3]; + aNodes[5] = N2[5]; + aNodes[6] = N2[3]; + aNodes[7] = N1[5]; + + GetMeshDS()->ChangeElementNodes( tr1, aNodes, 8 ); + myLastCreatedElems.Append(tr1); GetMeshDS()->RemoveElement( tr2 ); - //MESSAGE( endl << tr1 ); + // remove middle node (9) + GetMeshDS()->RemoveNode( N1[4] ); return true; } @@ -484,6 +707,9 @@ bool SMESH_MeshEditor::DeleteDiag (const SMDS_MeshNode * theNode1, bool SMESH_MeshEditor::Reorient (const SMDS_MeshElement * theElem) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + if (!theElem) return false; SMDS_ElemIteratorPtr it = theElem->nodesIterator(); @@ -493,16 +719,39 @@ bool SMESH_MeshEditor::Reorient (const SMDS_MeshElement * theElem) switch ( theElem->GetType() ) { case SMDSAbs_Edge: - case SMDSAbs_Face: - { - int i = theElem->NbNodes(); - vector aNodes( i ); - while ( it->more() ) - aNodes[ --i ]= static_cast( it->next() ); - return GetMeshDS()->ChangeElementNodes( theElem, &aNodes[0], theElem->NbNodes() ); + case SMDSAbs_Face: { + if(!theElem->IsQuadratic()) { + int i = theElem->NbNodes(); + vector aNodes( i ); + while ( it->more() ) + aNodes[ --i ]= static_cast( it->next() ); + return GetMeshDS()->ChangeElementNodes( theElem, &aNodes[0], theElem->NbNodes() ); + } + else { + // quadratic elements + if(theElem->GetType()==SMDSAbs_Edge) { + vector aNodes(3); + aNodes[1]= static_cast( it->next() ); + aNodes[0]= static_cast( it->next() ); + aNodes[2]= static_cast( it->next() ); + return GetMeshDS()->ChangeElementNodes( theElem, &aNodes[0], 3 ); + } + else { + int nbn = theElem->NbNodes(); + vector aNodes(nbn); + aNodes[0]= static_cast( it->next() ); + int i=1; + for(; i( it->next() ); + } + for(i=0; i( it->next() ); + } + return GetMeshDS()->ChangeElementNodes( theElem, &aNodes[0], nbn ); + } + } } - case SMDSAbs_Volume: - { + case SMDSAbs_Volume: { if (theElem->IsPoly()) { const SMDS_PolyhedralVolumeOfNodes* aPolyedre = static_cast( theElem ); @@ -519,16 +768,17 @@ bool SMESH_MeshEditor::Reorient (const SMDS_MeshElement * theElem) for (int iface = 1; iface <= nbFaces; iface++) { int inode, nbFaceNodes = aPolyedre->NbFaceNodes(iface); quantities[iface - 1] = nbFaceNodes; - + for (inode = nbFaceNodes; inode >= 1; inode--) { const SMDS_MeshNode* curNode = aPolyedre->GetFaceNode(iface, inode); poly_nodes.push_back(curNode); } } - + return GetMeshDS()->ChangePolyhedronNodes( theElem, poly_nodes, quantities ); - } else { + } + else { SMDS_VolumeTool vTool; if ( !vTool.Set( theElem )) return false; @@ -563,9 +813,12 @@ static double getBadRate (const SMDS_MeshElement* theElem, // theCrit is used to select a diagonal to cut //======================================================================= -bool SMESH_MeshEditor::QuadToTri (set & theElems, +bool SMESH_MeshEditor::QuadToTri (map & theElems, SMESH::Controls::NumericalFunctorPtr theCrit) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + MESSAGE( "::QuadToTri()" ); if ( !theCrit.get() ) @@ -573,15 +826,19 @@ bool SMESH_MeshEditor::QuadToTri (set & theElems, SMESHDS_Mesh * aMesh = GetMeshDS(); - set< const SMDS_MeshElement * >::iterator itElem; - for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) - { - const SMDS_MeshElement* elem = (*itElem); - if ( !elem || elem->GetType() != SMDSAbs_Face || elem->NbNodes() != 4 ) + Handle(Geom_Surface) surface; + SMESH_MesherHelper helper( *GetMesh() ); + + map::iterator itElem; + for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) { + const SMDS_MeshElement* elem = (*itElem).second; + if ( !elem || elem->GetType() != SMDSAbs_Face ) + continue; + if ( elem->NbNodes() != ( elem->IsQuadratic() ? 8 : 4 )) continue; // retrieve element nodes - const SMDS_MeshNode* aNodes [4]; + const SMDS_MeshNode* aNodes [8]; SMDS_ElemIteratorPtr itN = elem->nodesIterator(); int i = 0; while ( itN->more() ) @@ -598,30 +855,107 @@ bool SMESH_MeshEditor::QuadToTri (set & theElems, aBadRate2 = getBadRate( &tr3, theCrit ) + getBadRate( &tr4, theCrit ); int aShapeId = FindShape( elem ); - //MESSAGE( "aBadRate1 = " << aBadRate1 << "; aBadRate2 = " << aBadRate2 - // << " ShapeID = " << aShapeId << endl << elem ); + const SMDS_MeshElement* newElem = 0; - if ( aBadRate1 <= aBadRate2 ) { - // tr1 + tr2 is better - aMesh->ChangeElementNodes( elem, aNodes, 3 ); - //MESSAGE( endl << elem ); + if( !elem->IsQuadratic() ) { - elem = aMesh->AddFace( aNodes[2], aNodes[3], aNodes[0] ); + // split liner quadrangle + + if ( aBadRate1 <= aBadRate2 ) { + // tr1 + tr2 is better + aMesh->ChangeElementNodes( elem, aNodes, 3 ); + newElem = aMesh->AddFace( aNodes[2], aNodes[3], aNodes[0] ); + } + else { + // tr3 + tr4 is better + aMesh->ChangeElementNodes( elem, &aNodes[1], 3 ); + newElem = aMesh->AddFace( aNodes[3], aNodes[0], aNodes[1] ); + } } else { - // tr3 + tr4 is better - aMesh->ChangeElementNodes( elem, &aNodes[1], 3 ); - //MESSAGE( endl << elem ); - elem = aMesh->AddFace( aNodes[3], aNodes[0], aNodes[1] ); - } - //MESSAGE( endl << elem ); + // split qudratic quadrangle + + // get surface elem is on + if ( aShapeId != helper.GetSubShapeID() ) { + surface.Nullify(); + TopoDS_Shape shape; + if ( aShapeId > 0 ) + shape = aMesh->IndexToShape( aShapeId ); + if ( !shape.IsNull() && shape.ShapeType() == TopAbs_FACE ) { + TopoDS_Face face = TopoDS::Face( shape ); + surface = BRep_Tool::Surface( face ); + if ( !surface.IsNull() ) + helper.SetSubShape( shape ); + } + } + // get elem nodes + const SMDS_MeshNode* aNodes [8]; + const SMDS_MeshNode* inFaceNode = 0; + SMDS_ElemIteratorPtr itN = elem->nodesIterator(); + int i = 0; + while ( itN->more() ) { + aNodes[ i++ ] = static_cast( itN->next() ); + if ( !inFaceNode && helper.GetNodeUVneedInFaceNode() && + aNodes[ i-1 ]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ) + { + inFaceNode = aNodes[ i-1 ]; + } + } + // find middle point for (0,1,2,3) + // and create a node in this point; + gp_XYZ p( 0,0,0 ); + if ( surface.IsNull() ) { + for(i=0; i<4; i++) + p += gp_XYZ(aNodes[i]->X(), aNodes[i]->Y(), aNodes[i]->Z() ); + p /= 4; + } + else { + TopoDS_Face face = TopoDS::Face( helper.GetSubShape() ); + gp_XY uv( 0,0 ); + for(i=0; i<4; i++) + uv += helper.GetNodeUV( face, aNodes[i], inFaceNode ); + uv /= 4.; + p = surface->Value( uv.X(), uv.Y() ).XYZ(); + } + const SMDS_MeshNode* newN = aMesh->AddNode( p.X(), p.Y(), p.Z() ); + myLastCreatedNodes.Append(newN); + + // create a new element + const SMDS_MeshNode* N[6]; + if ( aBadRate1 <= aBadRate2 ) { + N[0] = aNodes[0]; + N[1] = aNodes[1]; + N[2] = aNodes[2]; + N[3] = aNodes[4]; + N[4] = aNodes[5]; + N[5] = newN; + newElem = aMesh->AddFace(aNodes[2], aNodes[3], aNodes[0], + aNodes[6], aNodes[7], newN ); + } + else { + N[0] = aNodes[1]; + N[1] = aNodes[2]; + N[2] = aNodes[3]; + N[3] = aNodes[5]; + N[4] = aNodes[6]; + N[5] = newN; + newElem = aMesh->AddFace(aNodes[3], aNodes[0], aNodes[1], + aNodes[7], aNodes[4], newN ); + } + aMesh->ChangeElementNodes( elem, N, 6 ); + + } // qudratic case + + // care of a new element + + myLastCreatedElems.Append(newElem); + AddToSameGroups( newElem, elem, aMesh ); // put a new triangle on the same shape if ( aShapeId ) - aMesh->SetMeshElementOnShape( elem, aShapeId ); + aMesh->SetMeshElementOnShape( newElem, aShapeId ); } - return true; } @@ -632,33 +966,42 @@ bool SMESH_MeshEditor::QuadToTri (set & theElems, int SMESH_MeshEditor::BestSplit (const SMDS_MeshElement* theQuad, SMESH::Controls::NumericalFunctorPtr theCrit) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + if (!theCrit.get()) return -1; - if (!theQuad || theQuad->GetType() != SMDSAbs_Face || theQuad->NbNodes() != 4) + if (!theQuad || theQuad->GetType() != SMDSAbs_Face ) return -1; - // retrieve element nodes - const SMDS_MeshNode* aNodes [4]; - SMDS_ElemIteratorPtr itN = theQuad->nodesIterator(); - int i = 0; - while (itN->more()) - aNodes[ i++ ] = static_cast( itN->next() ); + if( theQuad->NbNodes()==4 || + (theQuad->NbNodes()==8 && theQuad->IsQuadratic()) ) { - // compare two sets of possible triangles - double aBadRate1, aBadRate2; // to what extent a set is bad - SMDS_FaceOfNodes tr1 ( aNodes[0], aNodes[1], aNodes[2] ); - SMDS_FaceOfNodes tr2 ( aNodes[2], aNodes[3], aNodes[0] ); - aBadRate1 = getBadRate( &tr1, theCrit ) + getBadRate( &tr2, theCrit ); + // retrieve element nodes + const SMDS_MeshNode* aNodes [4]; + SMDS_ElemIteratorPtr itN = theQuad->nodesIterator(); + int i = 0; + //while (itN->more()) + while (i<4) { + aNodes[ i++ ] = static_cast( itN->next() ); + } + // compare two sets of possible triangles + double aBadRate1, aBadRate2; // to what extent a set is bad + SMDS_FaceOfNodes tr1 ( aNodes[0], aNodes[1], aNodes[2] ); + SMDS_FaceOfNodes tr2 ( aNodes[2], aNodes[3], aNodes[0] ); + aBadRate1 = getBadRate( &tr1, theCrit ) + getBadRate( &tr2, theCrit ); - SMDS_FaceOfNodes tr3 ( aNodes[1], aNodes[2], aNodes[3] ); - SMDS_FaceOfNodes tr4 ( aNodes[3], aNodes[0], aNodes[1] ); - aBadRate2 = getBadRate( &tr3, theCrit ) + getBadRate( &tr4, theCrit ); + SMDS_FaceOfNodes tr3 ( aNodes[1], aNodes[2], aNodes[3] ); + SMDS_FaceOfNodes tr4 ( aNodes[3], aNodes[0], aNodes[1] ); + aBadRate2 = getBadRate( &tr3, theCrit ) + getBadRate( &tr4, theCrit ); - if (aBadRate1 <= aBadRate2) // tr1 + tr2 is better - return 1; // diagonal 1-3 + if (aBadRate1 <= aBadRate2) // tr1 + tr2 is better + return 1; // diagonal 1-3 - return 2; // diagonal 2-4 + return 2; // diagonal 2-4 + } + return -1; } //======================================================================= @@ -679,52 +1022,161 @@ void SMESH_MeshEditor::AddToSameGroups (const SMDS_MeshElement* elemToAdd, } } + +//======================================================================= +//function : RemoveElemFromGroups +//purpose : Remove removeelem to the groups the elemInGroups belongs to +//======================================================================= +void SMESH_MeshEditor::RemoveElemFromGroups (const SMDS_MeshElement* removeelem, + SMESHDS_Mesh * aMesh) +{ + const set& groups = aMesh->GetGroups(); + if (!groups.empty()) + { + set::const_iterator GrIt = groups.begin(); + for (; GrIt != groups.end(); GrIt++) + { + SMESHDS_Group* grp = dynamic_cast(*GrIt); + if (!grp || grp->IsEmpty()) continue; + grp->SMDSGroup().Remove(removeelem); + } + } +} + + //======================================================================= //function : QuadToTri //purpose : Cut quadrangles into triangles. // theCrit is used to select a diagonal to cut //======================================================================= -bool SMESH_MeshEditor::QuadToTri (std::set & theElems, - const bool the13Diag) +bool SMESH_MeshEditor::QuadToTri (std::map & theElems, + const bool the13Diag) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + MESSAGE( "::QuadToTri()" ); SMESHDS_Mesh * aMesh = GetMeshDS(); - set< const SMDS_MeshElement * >::iterator itElem; - for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) - { - const SMDS_MeshElement* elem = (*itElem); - if ( !elem || elem->GetType() != SMDSAbs_Face || elem->NbNodes() != 4 ) + Handle(Geom_Surface) surface; + SMESH_MesherHelper helper( *GetMesh() ); + + map::iterator itElem; + for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) { + const SMDS_MeshElement* elem = (*itElem).second; + if ( !elem || elem->GetType() != SMDSAbs_Face ) continue; + bool isquad = elem->NbNodes()==4 || elem->NbNodes()==8; + if(!isquad) continue; - // retrieve element nodes - const SMDS_MeshNode* aNodes [4]; - SMDS_ElemIteratorPtr itN = elem->nodesIterator(); - int i = 0; - while ( itN->more() ) - aNodes[ i++ ] = static_cast( itN->next() ); + if(elem->NbNodes()==4) { + // retrieve element nodes + const SMDS_MeshNode* aNodes [4]; + SMDS_ElemIteratorPtr itN = elem->nodesIterator(); + int i = 0; + while ( itN->more() ) + aNodes[ i++ ] = static_cast( itN->next() ); - int aShapeId = FindShape( elem ); - const SMDS_MeshElement* newElem = 0; - if ( the13Diag ) - { - aMesh->ChangeElementNodes( elem, aNodes, 3 ); - newElem = aMesh->AddFace( aNodes[2], aNodes[3], aNodes[0] ); - } - else - { - aMesh->ChangeElementNodes( elem, &aNodes[1], 3 ); - newElem = aMesh->AddFace( aNodes[3], aNodes[0], aNodes[1] ); + int aShapeId = FindShape( elem ); + const SMDS_MeshElement* newElem = 0; + if ( the13Diag ) { + aMesh->ChangeElementNodes( elem, aNodes, 3 ); + newElem = aMesh->AddFace( aNodes[2], aNodes[3], aNodes[0] ); + } + else { + aMesh->ChangeElementNodes( elem, &aNodes[1], 3 ); + newElem = aMesh->AddFace( aNodes[3], aNodes[0], aNodes[1] ); + } + myLastCreatedElems.Append(newElem); + // put a new triangle on the same shape and add to the same groups + if ( aShapeId ) + aMesh->SetMeshElementOnShape( newElem, aShapeId ); + AddToSameGroups( newElem, elem, aMesh ); } - // put a new triangle on the same shape and add to the same groups + // Quadratic quadrangle - if ( aShapeId ) - aMesh->SetMeshElementOnShape( newElem, aShapeId ); + if( elem->NbNodes()==8 && elem->IsQuadratic() ) { - AddToSameGroups( newElem, elem, aMesh ); + // get surface elem is on + int aShapeId = FindShape( elem ); + if ( aShapeId != helper.GetSubShapeID() ) { + surface.Nullify(); + TopoDS_Shape shape; + if ( aShapeId > 0 ) + shape = aMesh->IndexToShape( aShapeId ); + if ( !shape.IsNull() && shape.ShapeType() == TopAbs_FACE ) { + TopoDS_Face face = TopoDS::Face( shape ); + surface = BRep_Tool::Surface( face ); + if ( !surface.IsNull() ) + helper.SetSubShape( shape ); + } + } + + const SMDS_MeshNode* aNodes [8]; + const SMDS_MeshNode* inFaceNode = 0; + SMDS_ElemIteratorPtr itN = elem->nodesIterator(); + int i = 0; + while ( itN->more() ) { + aNodes[ i++ ] = static_cast( itN->next() ); + if ( !inFaceNode && helper.GetNodeUVneedInFaceNode() && + aNodes[ i-1 ]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ) + { + inFaceNode = aNodes[ i-1 ]; + } + } + + // find middle point for (0,1,2,3) + // and create a node in this point; + gp_XYZ p( 0,0,0 ); + if ( surface.IsNull() ) { + for(i=0; i<4; i++) + p += gp_XYZ(aNodes[i]->X(), aNodes[i]->Y(), aNodes[i]->Z() ); + p /= 4; + } + else { + TopoDS_Face geomFace = TopoDS::Face( helper.GetSubShape() ); + gp_XY uv( 0,0 ); + for(i=0; i<4; i++) + uv += helper.GetNodeUV( geomFace, aNodes[i], inFaceNode ); + uv /= 4.; + p = surface->Value( uv.X(), uv.Y() ).XYZ(); + } + const SMDS_MeshNode* newN = aMesh->AddNode( p.X(), p.Y(), p.Z() ); + myLastCreatedNodes.Append(newN); + + // create a new element + const SMDS_MeshElement* newElem = 0; + const SMDS_MeshNode* N[6]; + if ( the13Diag ) { + N[0] = aNodes[0]; + N[1] = aNodes[1]; + N[2] = aNodes[2]; + N[3] = aNodes[4]; + N[4] = aNodes[5]; + N[5] = newN; + newElem = aMesh->AddFace(aNodes[2], aNodes[3], aNodes[0], + aNodes[6], aNodes[7], newN ); + } + else { + N[0] = aNodes[1]; + N[1] = aNodes[2]; + N[2] = aNodes[3]; + N[3] = aNodes[5]; + N[4] = aNodes[6]; + N[5] = newN; + newElem = aMesh->AddFace(aNodes[3], aNodes[0], aNodes[1], + aNodes[7], aNodes[4], newN ); + } + myLastCreatedElems.Append(newElem); + aMesh->ChangeElementNodes( elem, N, 6 ); + // put a new triangle on the same shape and add to the same groups + if ( aShapeId ) + aMesh->SetMeshElementOnShape( newElem, aShapeId ); + AddToSameGroups( newElem, elem, aMesh ); + } } return true; @@ -747,18 +1199,24 @@ double getAngle(const SMDS_MeshElement * tr1, if ( !SMESH::Controls::NumericalFunctor::GetPoints( tr1, P1 ) || !SMESH::Controls::NumericalFunctor::GetPoints( tr2, P2 )) return angle; - gp_Vec N1 = gp_Vec( P1(2) - P1(1) ) ^ gp_Vec( P1(3) - P1(1) ); + gp_Vec N1,N2; + if(!tr1->IsQuadratic()) + N1 = gp_Vec( P1(2) - P1(1) ) ^ gp_Vec( P1(3) - P1(1) ); + else + N1 = gp_Vec( P1(3) - P1(1) ) ^ gp_Vec( P1(5) - P1(1) ); if ( N1.SquareMagnitude() <= gp::Resolution() ) return angle; - gp_Vec N2 = gp_Vec( P2(2) - P2(1) ) ^ gp_Vec( P2(3) - P2(1) ); + if(!tr2->IsQuadratic()) + N2 = gp_Vec( P2(2) - P2(1) ) ^ gp_Vec( P2(3) - P2(1) ); + else + N2 = gp_Vec( P2(3) - P2(1) ) ^ gp_Vec( P2(5) - P2(1) ); if ( N2.SquareMagnitude() <= gp::Resolution() ) return angle; // find the first diagonal node n1 in the triangles: // take in account a diagonal link orientation const SMDS_MeshElement *nFirst[2], *tr[] = { tr1, tr2 }; - for ( int t = 0; t < 2; t++ ) - { + for ( int t = 0; t < 2; t++ ) { SMDS_ElemIteratorPtr it = tr[ t ]->nodesIterator(); int i = 0, iDiag = -1; while ( it->more()) { @@ -788,7 +1246,6 @@ double getAngle(const SMDS_MeshElement * tr1, // class generating a unique ID for a pair of nodes // and able to return nodes by that ID // ================================================= - class LinkID_Gen { public: @@ -819,6 +1276,7 @@ class LinkID_Gen { long myMaxID; }; + //======================================================================= //function : TriToQuad //purpose : Fuse neighbour triangles into quadrangles. @@ -827,75 +1285,89 @@ class LinkID_Gen { // fusion is still performed. //======================================================================= -bool SMESH_MeshEditor::TriToQuad (set & theElems, +bool SMESH_MeshEditor::TriToQuad (map & theElems, SMESH::Controls::NumericalFunctorPtr theCrit, const double theMaxAngle) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + MESSAGE( "::TriToQuad()" ); if ( !theCrit.get() ) return false; SMESHDS_Mesh * aMesh = GetMeshDS(); - LinkID_Gen aLinkID_Gen( aMesh ); - + //LinkID_Gen aLinkID_Gen( aMesh ); // Prepare data for algo: build // 1. map of elements with their linkIDs // 2. map of linkIDs with their elements - map< long, list< const SMDS_MeshElement* > > mapLi_listEl; - map< long, list< const SMDS_MeshElement* > >::iterator itLE; - map< const SMDS_MeshElement*, set< long > > mapEl_setLi; - map< const SMDS_MeshElement*, set< long > >::iterator itEL; - - set::iterator itElem; - for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) - { - const SMDS_MeshElement* elem = (*itElem); - if ( !elem || elem->NbNodes() != 3 ) - continue; + //map< long, list< const SMDS_MeshElement* > > mapLi_listEl; + //map< long, list< const SMDS_MeshElement* > >::iterator itLE; + //map< const SMDS_MeshElement*, set< long > > mapEl_setLi; + //map< const SMDS_MeshElement*, set< long > >::iterator itEL; + + map< NLink, list< const SMDS_MeshElement* > > mapLi_listEl; + map< NLink, list< const SMDS_MeshElement* > >::iterator itLE; + map< const SMDS_MeshElement*, set< NLink > > mapEl_setLi; + map< const SMDS_MeshElement*, set< NLink > >::iterator itEL; + + map::iterator itElem; + for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) { + const SMDS_MeshElement* elem = (*itElem).second; + //if ( !elem || elem->NbNodes() != 3 ) + // continue; + if(!elem || elem->GetType() != SMDSAbs_Face ) continue; + bool IsTria = elem->NbNodes()==3 || (elem->NbNodes()==6 && elem->IsQuadratic()); + if(!IsTria) continue; // retrieve element nodes const SMDS_MeshNode* aNodes [4]; SMDS_ElemIteratorPtr itN = elem->nodesIterator(); int i = 0; - while ( itN->more() ) + //while ( itN->more() ) + while ( i<3 ) aNodes[ i++ ] = static_cast( itN->next() ); ASSERT( i == 3 ); aNodes[ 3 ] = aNodes[ 0 ]; // fill maps - for ( i = 0; i < 3; i++ ) - { - long linkID = aLinkID_Gen.GetLinkID( aNodes[ i ], aNodes[ i+1 ] ); + for ( i = 0; i < 3; i++ ) { + //long linkID = aLinkID_Gen.GetLinkID( aNodes[ i ], aNodes[ i+1 ] ); + NLink link(( aNodes[i] < aNodes[i+1] ? aNodes[i] : aNodes[i+1] ), + ( aNodes[i] < aNodes[i+1] ? aNodes[i+1] : aNodes[i] )); // check if elements sharing a link can be fused - itLE = mapLi_listEl.find( linkID ); - if ( itLE != mapLi_listEl.end() ) - { + //itLE = mapLi_listEl.find( linkID ); + itLE = mapLi_listEl.find( link ); + if ( itLE != mapLi_listEl.end() ) { if ((*itLE).second.size() > 1 ) // consider only 2 elems adjacent by a link continue; const SMDS_MeshElement* elem2 = (*itLE).second.front(); -// if ( FindShape( elem ) != FindShape( elem2 )) -// continue; // do not fuse triangles laying on different shapes + //if ( FindShape( elem ) != FindShape( elem2 )) + // continue; // do not fuse triangles laying on different shapes if ( getAngle( elem, elem2, aNodes[i], aNodes[i+1] ) > theMaxAngle ) continue; // avoid making badly shaped quads (*itLE).second.push_back( elem ); } - else - mapLi_listEl[ linkID ].push_back( elem ); - mapEl_setLi [ elem ].insert( linkID ); + else { + //mapLi_listEl[ linkID ].push_back( elem ); + mapLi_listEl[ link ].push_back( elem ); + } + //mapEl_setLi [ elem ].insert( linkID ); + mapEl_setLi [ elem ].insert( link ); } } // Clean the maps from the links shared by a sole element, ie // links to which only one element is bound in mapLi_listEl - for ( itLE = mapLi_listEl.begin(); itLE != mapLi_listEl.end(); itLE++ ) - { + for ( itLE = mapLi_listEl.begin(); itLE != mapLi_listEl.end(); itLE++ ) { int nbElems = (*itLE).second.size(); if ( nbElems < 2 ) { const SMDS_MeshElement* elem = (*itLE).second.front(); - long link = (*itLE).first; + //long link = (*itLE).first; + NLink link = (*itLE).first; mapEl_setLi[ elem ].erase( link ); if ( mapEl_setLi[ elem ].empty() ) mapEl_setLi.erase( elem ); @@ -904,18 +1376,15 @@ bool SMESH_MeshEditor::TriToQuad (set & theElems, // Algo: fuse triangles into quadrangles - while ( ! mapEl_setLi.empty() ) - { + while ( ! mapEl_setLi.empty() ) { // Look for the start element: // the element having the least nb of shared links const SMDS_MeshElement* startElem = 0; int minNbLinks = 4; - for ( itEL = mapEl_setLi.begin(); itEL != mapEl_setLi.end(); itEL++ ) - { + for ( itEL = mapEl_setLi.begin(); itEL != mapEl_setLi.end(); itEL++ ) { int nbLinks = (*itEL).second.size(); - if ( nbLinks < minNbLinks ) - { + if ( nbLinks < minNbLinks ) { startElem = (*itEL).first; minNbLinks = nbLinks; if ( minNbLinks == 1 ) @@ -925,17 +1394,16 @@ bool SMESH_MeshEditor::TriToQuad (set & theElems, // search elements to fuse starting from startElem or links of elements // fused earlyer - startLinks - list< long > startLinks; - while ( startElem || !startLinks.empty() ) - { - while ( !startElem && !startLinks.empty() ) - { + //list< long > startLinks; + list< NLink > startLinks; + while ( startElem || !startLinks.empty() ) { + while ( !startElem && !startLinks.empty() ) { // Get an element to start, by a link - long linkId = startLinks.front(); + //long linkId = startLinks.front(); + NLink linkId = startLinks.front(); startLinks.pop_front(); itLE = mapLi_listEl.find( linkId ); - if ( itLE != mapLi_listEl.end() ) - { + if ( itLE != mapLi_listEl.end() ) { list< const SMDS_MeshElement* > & listElem = (*itLE).second; list< const SMDS_MeshElement* >::iterator itE = listElem.begin(); for ( ; itE != listElem.end() ; itE++ ) @@ -945,69 +1413,83 @@ bool SMESH_MeshEditor::TriToQuad (set & theElems, } } - if ( startElem ) - { + if ( startElem ) { // Get candidates to be fused - const SMDS_MeshElement *tr1 = startElem, *tr2 = 0, *tr3 = 0; - long link12, link13; + //long link12, link13; + NLink link12, link13; startElem = 0; ASSERT( mapEl_setLi.find( tr1 ) != mapEl_setLi.end() ); - set< long >& setLi = mapEl_setLi[ tr1 ]; + //set< long >& setLi = mapEl_setLi[ tr1 ]; + set< NLink >& setLi = mapEl_setLi[ tr1 ]; ASSERT( !setLi.empty() ); - set< long >::iterator itLi; - for ( itLi = setLi.begin(); itLi != setLi.end(); itLi++ ) - { - long linkID = (*itLi); + //set< long >::iterator itLi; + set< NLink >::iterator itLi; + for ( itLi = setLi.begin(); itLi != setLi.end(); itLi++ ) { + //long linkID = (*itLi); + NLink linkID = (*itLi); itLE = mapLi_listEl.find( linkID ); if ( itLE == mapLi_listEl.end() ) continue; + const SMDS_MeshElement* elem = (*itLE).second.front(); if ( elem == tr1 ) elem = (*itLE).second.back(); mapLi_listEl.erase( itLE ); if ( mapEl_setLi.find( elem ) == mapEl_setLi.end()) continue; - if ( tr2 ) - { + if ( tr2 ) { tr3 = elem; link13 = linkID; } - else - { + else { tr2 = elem; link12 = linkID; } // add other links of elem to list of links to re-start from - set< long >& links = mapEl_setLi[ elem ]; - set< long >::iterator it; - for ( it = links.begin(); it != links.end(); it++ ) - { - long linkID2 = (*it); + //set< long >& links = mapEl_setLi[ elem ]; + //set< long >::iterator it; + set< NLink >& links = mapEl_setLi[ elem ]; + set< NLink >::iterator it; + for ( it = links.begin(); it != links.end(); it++ ) { + //long linkID2 = (*it); + NLink linkID2 = (*it); if ( linkID2 != linkID ) startLinks.push_back( linkID2 ); } } // Get nodes of possible quadrangles - const SMDS_MeshNode *n12 [4], *n13 [4]; bool Ok12 = false, Ok13 = false; + //const SMDS_MeshNode *linkNode1, *linkNode2; const SMDS_MeshNode *linkNode1, *linkNode2; - if ( tr2 && - aLinkID_Gen.GetNodes( link12, linkNode1, linkNode2 ) && - getQuadrangleNodes( n12, linkNode1, linkNode2, tr1, tr2 )) - Ok12 = true; - if ( tr3 && - aLinkID_Gen.GetNodes( link13, linkNode1, linkNode2 ) && - getQuadrangleNodes( n13, linkNode1, linkNode2, tr1, tr3 )) - Ok13 = true; + if(tr2) { + //const SMDS_MeshNode *linkNode1 = link12.first; + //const SMDS_MeshNode *linkNode2 = link12.second; + linkNode1 = link12.first; + linkNode2 = link12.second; + //if ( tr2 && + // aLinkID_Gen.GetNodes( link12, linkNode1, linkNode2 ) && + // getQuadrangleNodes( n12, linkNode1, linkNode2, tr1, tr2 )) + // Ok12 = true; + if ( tr2 && getQuadrangleNodes( n12, linkNode1, linkNode2, tr1, tr2 )) + Ok12 = true; + } + if(tr3) { + linkNode1 = link13.first; + linkNode2 = link13.second; + //if ( tr3 && + // aLinkID_Gen.GetNodes( link13, linkNode1, linkNode2 ) && + // getQuadrangleNodes( n13, linkNode1, linkNode2, tr1, tr3 )) + // Ok13 = true; + if ( tr3 && getQuadrangleNodes( n13, linkNode1, linkNode2, tr1, tr3 )) + Ok13 = true; + } // Choose a pair to fuse - - if ( Ok12 && Ok13 ) - { + if ( Ok12 && Ok13 ) { SMDS_FaceOfNodes quad12 ( n12[ 0 ], n12[ 1 ], n12[ 2 ], n12[ 3 ] ); SMDS_FaceOfNodes quad13 ( n13[ 0 ], n13[ 1 ], n13[ 2 ], n13[ 3 ] ); double aBadRate12 = getBadRate( &quad12, theCrit ); @@ -1018,24 +1500,98 @@ bool SMESH_MeshEditor::TriToQuad (set & theElems, Ok13 = false; } - // Make quadrangles // and remove fused elems and removed links from the maps - mapEl_setLi.erase( tr1 ); - if ( Ok12 ) - { + if ( Ok12 ) { mapEl_setLi.erase( tr2 ); mapLi_listEl.erase( link12 ); - aMesh->ChangeElementNodes( tr1, n12, 4 ); - aMesh->RemoveElement( tr2 ); + if(tr1->NbNodes()==3) { + if( tr1->GetID() < tr2->GetID() ) { + aMesh->ChangeElementNodes( tr1, n12, 4 ); + myLastCreatedElems.Append(tr1); + aMesh->RemoveElement( tr2 ); + } + else { + aMesh->ChangeElementNodes( tr2, n12, 4 ); + myLastCreatedElems.Append(tr2); + aMesh->RemoveElement( tr1); + } + } + else { + const SMDS_MeshNode* N1 [6]; + const SMDS_MeshNode* N2 [6]; + GetNodesFromTwoTria(tr1,tr2,N1,N2); + // now we receive following N1 and N2 (using numeration as above image) + // tria1 : (1 2 4 5 9 7) and tria2 : (3 4 2 8 9 6) + // i.e. first nodes from both arrays determ new diagonal + const SMDS_MeshNode* aNodes[8]; + aNodes[0] = N1[0]; + aNodes[1] = N1[1]; + aNodes[2] = N2[0]; + aNodes[3] = N2[1]; + aNodes[4] = N1[3]; + aNodes[5] = N2[5]; + aNodes[6] = N2[3]; + aNodes[7] = N1[5]; + if( tr1->GetID() < tr2->GetID() ) { + GetMeshDS()->ChangeElementNodes( tr1, aNodes, 8 ); + myLastCreatedElems.Append(tr1); + GetMeshDS()->RemoveElement( tr2 ); + } + else { + GetMeshDS()->ChangeElementNodes( tr2, aNodes, 8 ); + myLastCreatedElems.Append(tr2); + GetMeshDS()->RemoveElement( tr1 ); + } + // remove middle node (9) + GetMeshDS()->RemoveNode( N1[4] ); + } } - else if ( Ok13 ) - { + else if ( Ok13 ) { mapEl_setLi.erase( tr3 ); mapLi_listEl.erase( link13 ); - aMesh->ChangeElementNodes( tr1, n13, 4 ); - aMesh->RemoveElement( tr3 ); + if(tr1->NbNodes()==3) { + if( tr1->GetID() < tr2->GetID() ) { + aMesh->ChangeElementNodes( tr1, n13, 4 ); + myLastCreatedElems.Append(tr1); + aMesh->RemoveElement( tr3 ); + } + else { + aMesh->ChangeElementNodes( tr3, n13, 4 ); + myLastCreatedElems.Append(tr3); + aMesh->RemoveElement( tr1 ); + } + } + else { + const SMDS_MeshNode* N1 [6]; + const SMDS_MeshNode* N2 [6]; + GetNodesFromTwoTria(tr1,tr3,N1,N2); + // now we receive following N1 and N2 (using numeration as above image) + // tria1 : (1 2 4 5 9 7) and tria2 : (3 4 2 8 9 6) + // i.e. first nodes from both arrays determ new diagonal + const SMDS_MeshNode* aNodes[8]; + aNodes[0] = N1[0]; + aNodes[1] = N1[1]; + aNodes[2] = N2[0]; + aNodes[3] = N2[1]; + aNodes[4] = N1[3]; + aNodes[5] = N2[5]; + aNodes[6] = N2[3]; + aNodes[7] = N1[5]; + if( tr1->GetID() < tr2->GetID() ) { + GetMeshDS()->ChangeElementNodes( tr1, aNodes, 8 ); + myLastCreatedElems.Append(tr1); + GetMeshDS()->RemoveElement( tr3 ); + } + else { + GetMeshDS()->ChangeElementNodes( tr3, aNodes, 8 ); + myLastCreatedElems.Append(tr3); + GetMeshDS()->RemoveElement( tr1 ); + } + // remove middle node (9) + GetMeshDS()->RemoveNode( N1[4] ); + } } // Next element to fuse: the rejected one @@ -1349,22 +1905,23 @@ void laplacianSmooth(const SMDS_MeshNode* theNode, if ( elem->GetType() != SMDSAbs_Face ) continue; - // put all nodes in array - int nbNodes = 0, iNode = 0; - vector< const SMDS_MeshNode*> aNodes( elem->NbNodes() ); - SMDS_ElemIteratorPtr itN = elem->nodesIterator(); - while ( itN->more() ) - { - aNodes[ nbNodes ] = static_cast( itN->next() ); - if ( aNodes[ nbNodes ] == theNode ) - iNode = nbNodes; // index of theNode within aNodes - nbNodes++; + for ( int i = 0; i < elem->NbNodes(); ++i ) { + if ( elem->GetNode( i ) == theNode ) { + // add linked nodes + int iBefore = i - 1; + int iAfter = i + 1; + if ( elem->IsQuadratic() ) { + int nbCorners = elem->NbNodes() / 2; + if ( iAfter >= nbCorners ) + iAfter = 0; // elem->GetNode() wraps index + if ( iBefore == -1 ) + iBefore = nbCorners - 1; + } + nodeSet.insert( elem->GetNode( iAfter )); + nodeSet.insert( elem->GetNode( iBefore )); + break; + } } - // add linked nodes - int iAfter = ( iNode + 1 == nbNodes ) ? 0 : iNode + 1; - nodeSet.insert( aNodes[ iAfter ]); - int iBefore = ( iNode == 0 ) ? nbNodes - 1 : iNode - 1; - nodeSet.insert( aNodes[ iBefore ]); } // compute new coodrs @@ -1435,9 +1992,13 @@ void centroidalSmooth(const SMDS_MeshNode* theNode, gp_XYZ elemCenter(0.,0.,0.); SMESH::Controls::TSequenceOfXYZ aNodePoints; SMDS_ElemIteratorPtr itN = elem->nodesIterator(); - while ( itN->more() ) - { + int nn = elem->NbNodes(); + if(elem->IsQuadratic()) nn = nn/2; + int i=0; + //while ( itN->more() ) { + while ( i( itN->next() ); + i++; gp_XYZ aP( aNode->X(), aNode->Y(), aNode->Z() ); aNodePoints.push_back( aP ); if ( !theSurface.IsNull() ) { // smooth in 2D @@ -1449,12 +2010,11 @@ void centroidalSmooth(const SMDS_MeshNode* theNode, } double elemArea = anAreaFunc.GetValue( aNodePoints ); totalArea += elemArea; - elemCenter /= elem->NbNodes(); + elemCenter /= nn; aNewXYZ += elemCenter * elemArea; } aNewXYZ /= totalArea; if ( !theSurface.IsNull() ) { - ASSERT( theUVMap.find( theNode ) != theUVMap.end() ); theUVMap[ theNode ]->SetCoord( aNewXYZ.X(), aNewXYZ.Y() ); aNewXYZ = theSurface->Value( aNewXYZ.X(), aNewXYZ.Y() ).XYZ(); } @@ -1497,18 +2057,23 @@ static bool getClosestUV (Extrema_GenExtPS& projector, // on edges and boundary nodes are always fixed. //======================================================================= -void SMESH_MeshEditor::Smooth (set & theElems, +void SMESH_MeshEditor::Smooth (map & theElems, set & theFixedNodes, const SmoothMethod theSmoothMethod, const int theNbIterations, double theTgtAspectRatio, const bool the2D) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + MESSAGE((theSmoothMethod==LAPLACIAN ? "LAPLACIAN" : "CENTROIDAL") << "--::Smooth()"); if ( theTgtAspectRatio < 1.0 ) theTgtAspectRatio = 1.0; + const double disttol = 1.e-16; + SMESH::Controls::AspectRatio aQualityFunc; SMESHDS_Mesh* aMesh = GetMeshDS(); @@ -1516,15 +2081,17 @@ void SMESH_MeshEditor::Smooth (set & theElems, if ( theElems.empty() ) { // add all faces to theElems SMDS_FaceIteratorPtr fIt = aMesh->facesIterator(); - while ( fIt->more() ) - theElems.insert( fIt->next() ); + while ( fIt->more() ) { + const SMDS_MeshElement* face = fIt->next(); + theElems.insert( make_pair(face->GetID(),face) ); + } } // get all face ids theElems are on set< int > faceIdSet; - set< const SMDS_MeshElement* >::iterator itElem; + map::iterator itElem; if ( the2D ) for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) { - int fId = FindShape( *itElem ); + int fId = FindShape( (*itElem).second ); // check that corresponding submesh exists and a shape is face if (fId && faceIdSet.find( fId ) == faceIdSet.end() && @@ -1541,8 +2108,7 @@ void SMESH_MeshEditor::Smooth (set & theElems, // =============================================== set< int >::reverse_iterator fId = faceIdSet.rbegin(); // treate 0 fId at the end - for ( ; fId != faceIdSet.rend(); ++fId ) - { + for ( ; fId != faceIdSet.rend(); ++fId ) { // get face surface and submesh Handle(Geom_Surface) surface; SMESHDS_SubMesh* faceSubMesh = 0; @@ -1569,6 +2135,7 @@ void SMESH_MeshEditor::Smooth (set & theElems, // compute UV for them // --------------------------------------------------------- bool checkBoundaryNodes = false; + bool isQuadratic = false; set setMovableNodes; map< const SMDS_MeshNode*, gp_XY* > uvMap, uvMap2; list< gp_XY > listUV; // uvs the 2 uvMaps refer to @@ -1583,12 +2150,11 @@ void SMESH_MeshEditor::Smooth (set & theElems, int nbElemOnFace = 0; itElem = theElems.begin(); // loop on not yet smoothed elements: look for elems on a face - while ( itElem != theElems.end() ) - { + while ( itElem != theElems.end() ) { if ( faceSubMesh && nbElemOnFace == faceSubMesh->NbElements() ) break; // all elements found - const SMDS_MeshElement* elem = (*itElem); + const SMDS_MeshElement* elem = (*itElem).second; if ( !elem || elem->GetType() != SMDSAbs_Face || elem->NbNodes() < 3 || ( faceSubMesh && !faceSubMesh->Contains( elem ))) { ++itElem; @@ -1598,11 +2164,17 @@ void SMESH_MeshEditor::Smooth (set & theElems, theElems.erase( itElem++ ); nbElemOnFace++; + if ( !isQuadratic ) + isQuadratic = elem->IsQuadratic(); + // get movable nodes of elem const SMDS_MeshNode* node; SMDS_TypeOfPosition posType; SMDS_ElemIteratorPtr itN = elem->nodesIterator(); - while ( itN->more() ) { + int nn = 0, nbn = elem->NbNodes(); + if(elem->IsQuadratic()) + nbn = nbn/2; + while ( nn++ < nbn ) { node = static_cast( itN->next() ); const SMDS_PositionPtr& pos = node->GetPosition(); posType = pos.get() ? pos->GetTypeOfPosition() : SMDS_TOP_3DSPACE; @@ -1636,7 +2208,10 @@ void SMESH_MeshEditor::Smooth (set & theElems, // get nodes to check UV list< const SMDS_MeshNode* > uvCheckNodes; itN = elem->nodesIterator(); - while ( itN->more() ) { + nn = 0; nbn = elem->NbNodes(); + if(elem->IsQuadratic()) + nbn = nbn/2; + while ( nn++ < nbn ) { node = static_cast( itN->next() ); if ( uvMap.find( node ) == uvMap.end() ) uvCheckNodes.push_back( node ); @@ -1657,8 +2232,7 @@ void SMESH_MeshEditor::Smooth (set & theElems, } // check UV on face list< const SMDS_MeshNode* >::iterator n = uvCheckNodes.begin(); - for ( ; n != uvCheckNodes.end(); ++n ) - { + for ( ; n != uvCheckNodes.end(); ++n ) { node = *n; gp_XY uv( 0, 0 ); const SMDS_PositionPtr& pos = node->GetPosition(); @@ -1725,29 +2299,25 @@ void SMESH_MeshEditor::Smooth (set & theElems, // fix nodes on mesh boundary - if ( checkBoundaryNodes ) - { + if ( checkBoundaryNodes ) { typedef pair TLink; map< TLink, int > linkNbMap; // how many times a link encounters in elemsOnFace map< TLink, int >::iterator link_nb; // put all elements links to linkNbMap list< const SMDS_MeshElement* >::iterator elemIt = elemsOnFace.begin(); - for ( ; elemIt != elemsOnFace.end(); ++elemIt ) - { - // put elem nodes in array - vector< const SMDS_MeshNode* > nodes; - nodes.reserve( (*elemIt)->NbNodes() + 1 ); - SMDS_ElemIteratorPtr itN = (*elemIt)->nodesIterator(); - while ( itN->more() ) - nodes.push_back( static_cast( itN->next() )); - nodes.push_back( nodes.front() ); + for ( ; elemIt != elemsOnFace.end(); ++elemIt ) { + const SMDS_MeshElement* elem = (*elemIt); + int nbn = elem->NbNodes(); + if(elem->IsQuadratic()) + nbn = nbn/2; // loop on elem links: insert them in linkNbMap - for ( int iN = 1; iN < nodes.size(); ++iN ) { + const SMDS_MeshNode* curNode, *prevNode = elem->GetNode( nbn ); + for ( int iN = 0; iN < nbn; ++iN ) { + curNode = elem->GetNode( iN ); TLink link; - if ( nodes[ iN-1 ]->GetID() < nodes[ iN ]->GetID() ) - link = make_pair( nodes[ iN-1 ], nodes[ iN ] ); - else - link = make_pair( nodes[ iN ], nodes[ iN-1 ] ); + if ( curNode < prevNode ) link = make_pair( curNode , prevNode ); + else link = make_pair( prevNode , curNode ); + prevNode = curNode; link_nb = linkNbMap.find( link ); if ( link_nb == linkNbMap.end() ) linkNbMap.insert( make_pair ( link, 1 )); @@ -1771,11 +2341,9 @@ void SMESH_MeshEditor::Smooth (set & theElems, // ----------------------------------------------------- set nodesNearSeam; // to smooth using uvMap2 - if ( !surface.IsNull() ) - { + if ( !surface.IsNull() ) { TopExp_Explorer eExp( face, TopAbs_EDGE ); - for ( ; eExp.More(); eExp.Next() ) - { + for ( ; eExp.More(); eExp.Next() ) { TopoDS_Edge edge = TopoDS::Edge( eExp.Current() ); if ( !BRep_Tool::IsClosed( edge, face )) continue; @@ -1799,8 +2367,11 @@ void SMESH_MeshEditor::Smooth (set & theElems, // get nodes on seam and its vertices list< const SMDS_MeshNode* > seamNodes; SMDS_NodeIteratorPtr nSeamIt = sm->GetNodes(); - while ( nSeamIt->more() ) - seamNodes.push_back( nSeamIt->next() ); + while ( nSeamIt->more() ) { + const SMDS_MeshNode* node = nSeamIt->next(); + if ( !isQuadratic || !IsMedium( node )) + seamNodes.push_back( node ); + } TopExp_Explorer vExp( edge, TopAbs_VERTEX ); for ( ; vExp.More(); vExp.Next() ) { sm = aMesh->MeshElements( vExp.Current() ); @@ -1812,8 +2383,7 @@ void SMESH_MeshEditor::Smooth (set & theElems, } // loop on nodes on seam list< const SMDS_MeshNode* >::iterator noSeIt = seamNodes.begin(); - for ( ; noSeIt != seamNodes.end(); ++noSeIt ) - { + for ( ; noSeIt != seamNodes.end(); ++noSeIt ) { const SMDS_MeshNode* nSeam = *noSeIt; map< const SMDS_MeshNode*, gp_XY* >::iterator n_uv = uvMap.find( nSeam ); if ( n_uv == uvMap.end() ) @@ -1829,14 +2399,15 @@ void SMESH_MeshEditor::Smooth (set & theElems, // collect movable nodes linked to ones on seam in nodesNearSeam SMDS_ElemIteratorPtr eIt = nSeam->GetInverseElementIterator(); - while ( eIt->more() ) - { + while ( eIt->more() ) { const SMDS_MeshElement* e = eIt->next(); if ( e->GetType() != SMDSAbs_Face ) continue; int nbUseMap1 = 0, nbUseMap2 = 0; SMDS_ElemIteratorPtr nIt = e->nodesIterator(); - while ( nIt->more() ) + int nn = 0, nbn = e->NbNodes(); + if(e->IsQuadratic()) nbn = nbn/2; + while ( nn++ < nbn ) { const SMDS_MeshNode* n = static_cast( nIt->next() ); @@ -1858,10 +2429,10 @@ void SMESH_MeshEditor::Smooth (set & theElems, } // for centroidalSmooth all element nodes must // be on one side of a seam - if ( theSmoothMethod == CENTROIDAL && nbUseMap1 && nbUseMap2 ) - { + if ( theSmoothMethod == CENTROIDAL && nbUseMap1 && nbUseMap2 ) { SMDS_ElemIteratorPtr nIt = e->nodesIterator(); - while ( nIt->more() ) { + nn = 0; + while ( nn++ < nbn ) { const SMDS_MeshNode* n = static_cast( nIt->next() ); setMovableNodes.erase( n ); @@ -1884,12 +2455,10 @@ void SMESH_MeshEditor::Smooth (set & theElems, int it = -1; double maxRatio = -1., maxDisplacement = -1.; set::iterator nodeToMove; - for ( it = 0; it < theNbIterations; it++ ) - { + for ( it = 0; it < theNbIterations; it++ ) { maxDisplacement = 0.; nodeToMove = setMovableNodes.begin(); - for ( ; nodeToMove != setMovableNodes.end(); nodeToMove++ ) - { + for ( ; nodeToMove != setMovableNodes.end(); nodeToMove++ ) { const SMDS_MeshNode* node = (*nodeToMove); gp_XYZ aPrevPos ( node->X(), node->Y(), node->Z() ); @@ -1907,7 +2476,8 @@ void SMESH_MeshEditor::Smooth (set & theElems, maxDisplacement = aDispl; } // no node movement => exit - if ( maxDisplacement < 1.e-16 ) { + //if ( maxDisplacement < 1.e-16 ) { + if ( maxDisplacement < disttol ) { MESSAGE("-- no node movement --"); break; } @@ -1915,8 +2485,7 @@ void SMESH_MeshEditor::Smooth (set & theElems, // check elements quality maxRatio = 0; list< const SMDS_MeshElement* >::iterator elemIt = elemsOnFace.begin(); - for ( ; elemIt != elemsOnFace.end(); ++elemIt ) - { + for ( ; elemIt != elemsOnFace.end(); ++elemIt ) { const SMDS_MeshElement* elem = (*elemIt); if ( !elem || elem->GetType() != SMDSAbs_Face ) continue; @@ -1945,10 +2514,8 @@ void SMESH_MeshEditor::Smooth (set & theElems, // new nodes positions are computed, // record movement in DS and set new UV // --------------------------------------- - nodeToMove = setMovableNodes.begin(); - for ( ; nodeToMove != setMovableNodes.end(); nodeToMove++ ) - { + for ( ; nodeToMove != setMovableNodes.end(); nodeToMove++ ) { SMDS_MeshNode* node = const_cast< SMDS_MeshNode* > (*nodeToMove); aMesh->MoveNode( node, node->X(), node->Y(), node->Z() ); map< const SMDS_MeshNode*, gp_XY* >::iterator node_uv = uvMap.find( node ); @@ -1959,7 +2526,50 @@ void SMESH_MeshEditor::Smooth (set & theElems, } } + // move medium nodes of quadratic elements + if ( isQuadratic ) + { + SMESH_MesherHelper helper( *GetMesh() ); + if ( !face.IsNull() ) + helper.SetSubShape( face ); + list< const SMDS_MeshElement* >::iterator elemIt = elemsOnFace.begin(); + for ( ; elemIt != elemsOnFace.end(); ++elemIt ) { + const SMDS_QuadraticFaceOfNodes* QF = + dynamic_cast (*elemIt); + if(QF) { + vector Ns; + Ns.reserve(QF->NbNodes()+1); + SMDS_NodeIteratorPtr anIter = QF->interlacedNodesIterator(); + while ( anIter->more() ) + Ns.push_back( anIter->next() ); + Ns.push_back( Ns[0] ); + double x, y, z; + for(int i=0; iNbNodes(); i=i+2) { + if ( !surface.IsNull() ) { + gp_XY uv1 = helper.GetNodeUV( face, Ns[i], Ns[i+2] ); + gp_XY uv2 = helper.GetNodeUV( face, Ns[i+2], Ns[i] ); + gp_XY uv = ( uv1 + uv2 ) / 2.; + gp_Pnt xyz = surface->Value( uv.X(), uv.Y() ); + x = xyz.X(); y = xyz.Y(); z = xyz.Z(); + } + else { + x = (Ns[i]->X() + Ns[i+2]->X())/2; + y = (Ns[i]->Y() + Ns[i+2]->Y())/2; + z = (Ns[i]->Z() + Ns[i+2]->Z())/2; + } + if( fabs( Ns[i+1]->X() - x ) > disttol || + fabs( Ns[i+1]->Y() - y ) > disttol || + fabs( Ns[i+1]->Z() - z ) > disttol ) { + // we have to move i+1 node + aMesh->MoveNode( Ns[i+1], x, y, z ); + } + } + } + } + } + } // loop on face ids + } //======================================================================= @@ -2000,7 +2610,9 @@ static bool isReverse(vector prevNodes, static void sweepElement(SMESHDS_Mesh* aMesh, const SMDS_MeshElement* elem, const vector & newNodesItVec, - list& newElems) + list& newElems, + const int nbSteps, + SMESH_SequenceOfElemPtr& myLastCreatedElems) { // Loop on elem nodes: // find new nodes and detect same nodes indices @@ -2010,32 +2622,52 @@ static void sweepElement(SMESHDS_Mesh* aMesh, //const SMDS_MeshNode* prevNod[ nbNodes ], *nextNod[ nbNodes ]; vector prevNod( nbNodes ); vector nextNod( nbNodes ); + vector midlNod( nbNodes ); int iNode, nbSame = 0, iNotSameNode = 0, iSameNode = 0; + vector sames(nbNodes); - for ( iNode = 0; iNode < nbNodes; iNode++ ) - { + //bool issimple[nbNodes]; + vector issimple(nbNodes); + + for ( iNode = 0; iNode < nbNodes; iNode++ ) { TNodeOfNodeListMapItr nnIt = newNodesItVec[ iNode ]; const SMDS_MeshNode* node = nnIt->first; const list< const SMDS_MeshNode* > & listNewNodes = nnIt->second; if ( listNewNodes.empty() ) return; + if(listNewNodes.size()==nbSteps) { + issimple[iNode] = true; + } + else { + issimple[iNode] = false; + } + itNN[ iNode ] = listNewNodes.begin(); prevNod[ iNode ] = node; nextNod[ iNode ] = listNewNodes.front(); +//cout<<"iNode="<GetID() ); return; } +// if( elem->IsQuadratic() && nbSame>0 ) { +// MESSAGE( "Can not rotate quadratic element " << elem->GetID() ); +// return; +// } + int iBeforeSame = 0, iAfterSame = 0, iOpposSame = 0; if ( nbSame > 0 ) { iBeforeSame = ( iSameNode == 0 ? nbNodes - 1 : iSameNode - 1 ); @@ -2043,6 +2675,12 @@ static void sweepElement(SMESHDS_Mesh* aMesh, iOpposSame = ( iSameNode - 2 < 0 ? iSameNode + 2 : iSameNode - 2 ); } +//if(nbNodes==8) +//cout<<" prevNod[0]="<< prevNod[0]<<" prevNod[1]="<< prevNod[1] +// <<" prevNod[2]="<< prevNod[2]<<" prevNod[3]="<< prevNod[4] +// <<" prevNod[4]="<< prevNod[4]<<" prevNod[5]="<< prevNod[5] +// <<" prevNod[6]="<< prevNod[6]<<" prevNod[7]="<< prevNod[7]< 2 && !isReverse( prevNod, nextNod, nbNodes, iNotSameNode )) { @@ -2057,82 +2695,195 @@ static void sweepElement(SMESHDS_Mesh* aMesh, } // make new elements - int iStep, nbSteps = newNodesItVec[ 0 ]->second.size(); - for (iStep = 0; iStep < nbSteps; iStep++ ) - { + int iStep;//, nbSteps = newNodesItVec[ 0 ]->second.size(); + for (iStep = 0; iStep < nbSteps; iStep++ ) { // get next nodes for ( iNode = 0; iNode < nbNodes; iNode++ ) { - nextNod[ iNode ] = *itNN[ iNode ]; - itNN[ iNode ]++; + if(issimple[iNode]) { + nextNod[ iNode ] = *itNN[ iNode ]; + itNN[ iNode ]++; + } + else { + if( elem->GetType()==SMDSAbs_Node ) { + // we have to use two nodes + midlNod[ iNode ] = *itNN[ iNode ]; + itNN[ iNode ]++; + nextNod[ iNode ] = *itNN[ iNode ]; + itNN[ iNode ]++; + } + else if(!elem->IsQuadratic() || + elem->IsQuadratic() && elem->IsMediumNode(prevNod[iNode]) ) { + // we have to use each second node + itNN[ iNode ]++; + nextNod[ iNode ] = *itNN[ iNode ]; + itNN[ iNode ]++; + } + else { + // we have to use two nodes + midlNod[ iNode ] = *itNN[ iNode ]; + itNN[ iNode ]++; + nextNod[ iNode ] = *itNN[ iNode ]; + itNN[ iNode ]++; + } + } } SMDS_MeshElement* aNewElem = 0; - switch ( nbNodes ) - { - case 0: - return; - case 1: { // NODE - if ( nbSame == 0 ) - aNewElem = aMesh->AddEdge( prevNod[ 0 ], nextNod[ 0 ] ); - break; - } - case 2: { // EDGE - - if ( nbSame == 0 ) - aNewElem = aMesh->AddFace(prevNod[ 0 ], prevNod[ 1 ], - nextNod[ 1 ], nextNod[ 0 ] ); - else - aNewElem = aMesh->AddFace(prevNod[ 0 ], prevNod[ 1 ], - nextNod[ iNotSameNode ] ); - break; - } - case 3: { // TRIANGLE - - if ( nbSame == 0 ) // --- pentahedron - aNewElem = aMesh->AddVolume (prevNod[ i0 ], prevNod[ 1 ], prevNod[ i2 ], - nextNod[ i0 ], nextNod[ 1 ], nextNod[ i2 ] ); + if(!elem->IsPoly()) { + switch ( nbNodes ) { + case 0: + return; + case 1: { // NODE + if ( nbSame == 0 ) { + if(issimple[0]) + aNewElem = aMesh->AddEdge( prevNod[ 0 ], nextNod[ 0 ] ); + else + aNewElem = aMesh->AddEdge( prevNod[ 0 ], nextNod[ 0 ], midlNod[ 0 ] ); + } + break; + } + case 2: { // EDGE + if ( nbSame == 0 ) + aNewElem = aMesh->AddFace(prevNod[ 0 ], prevNod[ 1 ], + nextNod[ 1 ], nextNod[ 0 ] ); + else + aNewElem = aMesh->AddFace(prevNod[ 0 ], prevNod[ 1 ], + nextNod[ iNotSameNode ] ); + break; + } - else if ( nbSame == 1 ) // --- pyramid - aNewElem = aMesh->AddVolume (prevNod[ iBeforeSame ], prevNod[ iAfterSame ], - nextNod[ iAfterSame ], nextNod[ iBeforeSame ], - nextNod[ iSameNode ]); + case 3: { // TRIANGLE or quadratic edge + if(elem->GetType() == SMDSAbs_Face) { // TRIANGLE - else // 2 same nodes: --- tetrahedron - aNewElem = aMesh->AddVolume (prevNod[ i0 ], prevNod[ 1 ], prevNod[ i2 ], - nextNod[ iNotSameNode ]); - break; - } - case 4: { // QUADRANGLE + if ( nbSame == 0 ) // --- pentahedron + aNewElem = aMesh->AddVolume (prevNod[ i0 ], prevNod[ 1 ], prevNod[ i2 ], + nextNod[ i0 ], nextNod[ 1 ], nextNod[ i2 ] ); - if ( nbSame == 0 ) // --- hexahedron - aNewElem = aMesh->AddVolume (prevNod[ i0 ], prevNod[ 1 ], prevNod[ i2 ], prevNod[ 3 ], - nextNod[ i0 ], nextNod[ 1 ], nextNod[ i2 ], nextNod[ 3 ]); + else if ( nbSame == 1 ) // --- pyramid + aNewElem = aMesh->AddVolume (prevNod[ iBeforeSame ], prevNod[ iAfterSame ], + nextNod[ iAfterSame ], nextNod[ iBeforeSame ], + nextNod[ iSameNode ]); - else if ( nbSame == 1 ) // --- pyramid + pentahedron - { - aNewElem = aMesh->AddVolume (prevNod[ iBeforeSame ], prevNod[ iAfterSame ], - nextNod[ iAfterSame ], nextNod[ iBeforeSame ], - nextNod[ iSameNode ]); - newElems.push_back( aNewElem ); - aNewElem = aMesh->AddVolume (prevNod[ iAfterSame ], prevNod[ iOpposSame ], - prevNod[ iBeforeSame ], nextNod[ iAfterSame ], - nextNod[ iOpposSame ], nextNod[ iBeforeSame ] ); - } - else if ( nbSame == 2 ) // pentahedron - { - if ( prevNod[ iBeforeSame ] == nextNod[ iBeforeSame ] ) - // iBeforeSame is same too - aNewElem = aMesh->AddVolume (prevNod[ iBeforeSame ], prevNod[ iOpposSame ], - nextNod[ iOpposSame ], prevNod[ iSameNode ], - prevNod[ iAfterSame ], nextNod[ iAfterSame ]); - else - // iAfterSame is same too - aNewElem = aMesh->AddVolume (prevNod[ iSameNode ], prevNod[ iBeforeSame ], - nextNod[ iBeforeSame ], prevNod[ iAfterSame ], - prevNod[ iOpposSame ], nextNod[ iOpposSame ]); + else // 2 same nodes: --- tetrahedron + aNewElem = aMesh->AddVolume (prevNod[ i0 ], prevNod[ 1 ], prevNod[ i2 ], + nextNod[ iNotSameNode ]); + } + else { // quadratic edge + if(nbSame==0) { // quadratic quadrangle + aNewElem = aMesh->AddFace(prevNod[0], nextNod[0], nextNod[1], prevNod[1], + midlNod[0], nextNod[2], midlNod[1], prevNod[2]); + } + else if(nbSame==1) { // quadratic triangle + if(sames[0]==2) + return; // medium node on axis + else if(sames[0]==0) { + aNewElem = aMesh->AddFace(prevNod[0], nextNod[1], prevNod[1], + nextNod[2], midlNod[1], prevNod[2]); + } + else { // sames[0]==1 + aNewElem = aMesh->AddFace(prevNod[0], nextNod[0], prevNod[1], + midlNod[0], nextNod[2], prevNod[2]); + } + } + else + return; + } + break; + } + case 4: { // QUADRANGLE + + if ( nbSame == 0 ) // --- hexahedron + aNewElem = aMesh->AddVolume (prevNod[ i0 ], prevNod[ 1 ], prevNod[ i2 ], prevNod[ 3 ], + nextNod[ i0 ], nextNod[ 1 ], nextNod[ i2 ], nextNod[ 3 ]); + + else if ( nbSame == 1 ) { // --- pyramid + pentahedron + aNewElem = aMesh->AddVolume (prevNod[ iBeforeSame ], prevNod[ iAfterSame ], + nextNod[ iAfterSame ], nextNod[ iBeforeSame ], + nextNod[ iSameNode ]); + newElems.push_back( aNewElem ); + aNewElem = aMesh->AddVolume (prevNod[ iAfterSame ], prevNod[ iOpposSame ], + prevNod[ iBeforeSame ], nextNod[ iAfterSame ], + nextNod[ iOpposSame ], nextNod[ iBeforeSame ] ); + } + else if ( nbSame == 2 ) { // pentahedron + if ( prevNod[ iBeforeSame ] == nextNod[ iBeforeSame ] ) + // iBeforeSame is same too + aNewElem = aMesh->AddVolume (prevNod[ iBeforeSame ], prevNod[ iOpposSame ], + nextNod[ iOpposSame ], prevNod[ iSameNode ], + prevNod[ iAfterSame ], nextNod[ iAfterSame ]); + else + // iAfterSame is same too + aNewElem = aMesh->AddVolume (prevNod[ iSameNode ], prevNod[ iBeforeSame ], + nextNod[ iBeforeSame ], prevNod[ iAfterSame ], + prevNod[ iOpposSame ], nextNod[ iOpposSame ]); + } + break; + } + case 6: { // quadratic triangle + // create pentahedron with 15 nodes + if(i0>0) { // reversed case + aNewElem = aMesh->AddVolume (prevNod[0], prevNod[2], prevNod[1], + nextNod[0], nextNod[2], nextNod[1], + prevNod[5], prevNod[4], prevNod[3], + nextNod[5], nextNod[4], nextNod[3], + midlNod[0], midlNod[2], midlNod[1]); + } + else { // not reversed case + aNewElem = aMesh->AddVolume (prevNod[0], prevNod[1], prevNod[2], + nextNod[0], nextNod[1], nextNod[2], + prevNod[3], prevNod[4], prevNod[5], + nextNod[3], nextNod[4], nextNod[5], + midlNod[0], midlNod[1], midlNod[2]); + } + break; + } + case 8: { // quadratic quadrangle + // create hexahedron with 20 nodes + if(i0>0) { // reversed case + aNewElem = aMesh->AddVolume (prevNod[0], prevNod[3], prevNod[2], prevNod[1], + nextNod[0], nextNod[3], nextNod[2], nextNod[1], + prevNod[7], prevNod[6], prevNod[5], prevNod[4], + nextNod[7], nextNod[6], nextNod[5], nextNod[4], + midlNod[0], midlNod[3], midlNod[2], midlNod[1]); + } + else { // not reversed case + aNewElem = aMesh->AddVolume (prevNod[0], prevNod[1], prevNod[2], prevNod[3], + nextNod[0], nextNod[1], nextNod[2], nextNod[3], + prevNod[4], prevNod[5], prevNod[6], prevNod[7], + nextNod[4], nextNod[5], nextNod[6], nextNod[7], + midlNod[0], midlNod[1], midlNod[2], midlNod[3]); + } + break; + } + default: { + // realized for extrusion only + //vector polyedre_nodes (nbNodes*2 + 4*nbNodes); + //vector quantities (nbNodes + 2); + + //quantities[0] = nbNodes; // bottom of prism + //for (int inode = 0; inode < nbNodes; inode++) { + // polyedre_nodes[inode] = prevNod[inode]; + //} + + //quantities[1] = nbNodes; // top of prism + //for (int inode = 0; inode < nbNodes; inode++) { + // polyedre_nodes[nbNodes + inode] = nextNod[inode]; + //} + + //for (int iface = 0; iface < nbNodes; iface++) { + // quantities[iface + 2] = 4; + // int inextface = (iface == nbNodes - 1) ? 0 : iface + 1; + // polyedre_nodes[2*nbNodes + 4*iface + 0] = prevNod[iface]; + // polyedre_nodes[2*nbNodes + 4*iface + 1] = prevNod[inextface]; + // polyedre_nodes[2*nbNodes + 4*iface + 2] = nextNod[inextface]; + // polyedre_nodes[2*nbNodes + 4*iface + 3] = nextNod[iface]; + //} + //aNewElem = aMesh->AddPolyhedralVolume (polyedre_nodes, quantities); + break; + } } - break; } - default: { + + if(!aNewElem) { // realized for extrusion only vector polyedre_nodes (nbNodes*2 + 4*nbNodes); vector quantities (nbNodes + 2); @@ -2157,9 +2908,11 @@ static void sweepElement(SMESHDS_Mesh* aMesh, } aNewElem = aMesh->AddPolyhedralVolume (polyedre_nodes, quantities); } - } - if ( aNewElem ) + + if ( aNewElem ) { newElems.push_back( aNewElem ); + myLastCreatedElems.Append(aNewElem); + } // set new prev nodes for ( iNode = 0; iNode < nbNodes; iNode++ ) @@ -2177,26 +2930,40 @@ static void makeWalls (SMESHDS_Mesh* aMesh, TNodeOfNodeListMap & mapNewNodes, TElemOfElemListMap & newElemsMap, TElemOfVecOfNnlmiMap & elemNewNodesMap, - set& elemSet) + map& elemSet, + const int nbSteps, + SMESH_SequenceOfElemPtr& myLastCreatedElems) { ASSERT( newElemsMap.size() == elemNewNodesMap.size() ); // Find nodes belonging to only one initial element - sweep them to get edges. TNodeOfNodeListMapItr nList = mapNewNodes.begin(); - for ( ; nList != mapNewNodes.end(); nList++ ) - { + for ( ; nList != mapNewNodes.end(); nList++ ) { const SMDS_MeshNode* node = static_cast( nList->first ); SMDS_ElemIteratorPtr eIt = node->GetInverseElementIterator(); int nbInitElems = 0; - while ( eIt->more() && nbInitElems < 2 ) - if ( elemSet.find( eIt->next() ) != elemSet.end() ) + const SMDS_MeshElement* el = 0; + SMDSAbs_ElementType highType = SMDSAbs_Edge; // count most complex elements only + while ( eIt->more() && nbInitElems < 2 ) { + el = eIt->next(); + SMDSAbs_ElementType type = el->GetType(); + if ( type == SMDSAbs_Volume || type < highType ) continue; + if ( type > highType ) { + nbInitElems = 0; + highType = type; + } + if ( elemSet.find(el->GetID()) != elemSet.end() ) nbInitElems++; + } if ( nbInitElems < 2 ) { - vector newNodesItVec( 1, nList ); - list newEdges; - sweepElement( aMesh, node, newNodesItVec, newEdges ); + bool NotCreateEdge = el && el->IsQuadratic() && el->IsMediumNode(node); + if(!NotCreateEdge) { + vector newNodesItVec( 1, nList ); + list newEdges; + sweepElement( aMesh, node, newNodesItVec, newEdges, nbSteps, myLastCreatedElems ); + } } } @@ -2205,62 +2972,103 @@ static void makeWalls (SMESHDS_Mesh* aMesh, TElemOfElemListMap::iterator itElem = newElemsMap.begin(); TElemOfVecOfNnlmiMap::iterator itElemNodes = elemNewNodesMap.begin(); - for ( ; itElem != newElemsMap.end(); itElem++, itElemNodes++ ) - { + for ( ; itElem != newElemsMap.end(); itElem++, itElemNodes++ ) { const SMDS_MeshElement* elem = itElem->first; vector& vecNewNodes = itElemNodes->second; - if ( elem->GetType() == SMDSAbs_Edge ) - { + if ( elem->GetType() == SMDSAbs_Edge ) { // create a ceiling edge - aMesh->AddEdge(vecNewNodes[ 0 ]->second.back(), - vecNewNodes[ 1 ]->second.back() ); + if (!elem->IsQuadratic()) { + if ( !aMesh->FindEdge( vecNewNodes[ 0 ]->second.back(), + vecNewNodes[ 1 ]->second.back())) + myLastCreatedElems.Append(aMesh->AddEdge(vecNewNodes[ 0 ]->second.back(), + vecNewNodes[ 1 ]->second.back())); + } + else { + if ( !aMesh->FindEdge( vecNewNodes[ 0 ]->second.back(), + vecNewNodes[ 1 ]->second.back(), + vecNewNodes[ 2 ]->second.back())) + myLastCreatedElems.Append(aMesh->AddEdge(vecNewNodes[ 0 ]->second.back(), + vecNewNodes[ 1 ]->second.back(), + vecNewNodes[ 2 ]->second.back())); + } } if ( elem->GetType() != SMDSAbs_Face ) continue; + if(itElem->second.size()==0) continue; + bool hasFreeLinks = false; - set avoidSet; - avoidSet.insert( elem ); + map avoidSet; + avoidSet.insert( make_pair(elem->GetID(),elem) ); - // loop on a face nodes set aFaceLastNodes; int iNode, nbNodes = vecNewNodes.size(); - for ( iNode = 0; iNode < nbNodes; iNode++ ) - { - aFaceLastNodes.insert( vecNewNodes[ iNode ]->second.back() ); - // look for free links of a face - int iNext = ( iNode + 1 == nbNodes ) ? 0 : iNode + 1; - const SMDS_MeshNode* n1 = vecNewNodes[ iNode ]->first; - const SMDS_MeshNode* n2 = vecNewNodes[ iNext ]->first; - // check if a link is free - if ( ! SMESH_MeshEditor::FindFaceInSet ( n1, n2, elemSet, avoidSet )) - { - hasFreeLinks = true; - // make an edge and a ceiling for a new edge - if ( !aMesh->FindEdge( n1, n2 )) - aMesh->AddEdge( n1, n2 ); - n1 = vecNewNodes[ iNode ]->second.back(); - n2 = vecNewNodes[ iNext ]->second.back(); - if ( !aMesh->FindEdge( n1, n2 )) - aMesh->AddEdge( n1, n2 ); + if(!elem->IsQuadratic()) { + // loop on the face nodes + for ( iNode = 0; iNode < nbNodes; iNode++ ) { + aFaceLastNodes.insert( vecNewNodes[ iNode ]->second.back() ); + // look for free links of the face + int iNext = ( iNode + 1 == nbNodes ) ? 0 : iNode + 1; + const SMDS_MeshNode* n1 = vecNewNodes[ iNode ]->first; + const SMDS_MeshNode* n2 = vecNewNodes[ iNext ]->first; + // check if a link is free + if ( ! SMESH_MeshEditor::FindFaceInSet ( n1, n2, elemSet, avoidSet )) { + hasFreeLinks = true; + // make an edge and a ceiling for a new edge + if ( !aMesh->FindEdge( n1, n2 )) { + myLastCreatedElems.Append(aMesh->AddEdge( n1, n2 )); + } + n1 = vecNewNodes[ iNode ]->second.back(); + n2 = vecNewNodes[ iNext ]->second.back(); + if ( !aMesh->FindEdge( n1, n2 )) { + myLastCreatedElems.Append(aMesh->AddEdge( n1, n2 )); + } + } + } + } + else { // elem is quadratic face + int nbn = nbNodes/2; + for ( iNode = 0; iNode < nbn; iNode++ ) { + aFaceLastNodes.insert( vecNewNodes[ iNode ]->second.back() ); + int iNext = ( iNode + 1 == nbn ) ? 0 : iNode + 1; + const SMDS_MeshNode* n1 = vecNewNodes[ iNode ]->first; + const SMDS_MeshNode* n2 = vecNewNodes[ iNext ]->first; + // check if a link is free + if ( ! SMESH_MeshEditor::FindFaceInSet ( n1, n2, elemSet, avoidSet )) { + hasFreeLinks = true; + // make an edge and a ceiling for a new edge + // find medium node + const SMDS_MeshNode* n3 = vecNewNodes[ iNode+nbn ]->first; + if ( !aMesh->FindEdge( n1, n2, n3 )) { + myLastCreatedElems.Append(aMesh->AddEdge( n1, n2, n3 )); + } + n1 = vecNewNodes[ iNode ]->second.back(); + n2 = vecNewNodes[ iNext ]->second.back(); + n3 = vecNewNodes[ iNode+nbn ]->second.back(); + if ( !aMesh->FindEdge( n1, n2, n3 )) { + myLastCreatedElems.Append(aMesh->AddEdge( n1, n2, n3 )); + } + } + } + for ( iNode = nbn; iNode < 2*nbn; iNode++ ) { + aFaceLastNodes.insert( vecNewNodes[ iNode ]->second.back() ); } } + // sweep free links into faces - if ( hasFreeLinks ) - { + if ( hasFreeLinks ) { list & newVolumes = itElem->second; - int iStep, nbSteps = vecNewNodes[0]->second.size(); + int iStep; //, nbSteps = vecNewNodes[0]->second.size(); int iVol, volNb, nbVolumesByStep = newVolumes.size() / nbSteps; set initNodeSet, faceNodeSet; for ( iNode = 0; iNode < nbNodes; iNode++ ) initNodeSet.insert( vecNewNodes[ iNode ]->first ); - for ( volNb = 0; volNb < nbVolumesByStep; volNb++ ) - { + for ( volNb = 0; volNb < nbVolumesByStep; volNb++ ) { list::iterator v = newVolumes.begin(); iVol = 0; while ( iVol++ < volNb ) v++; @@ -2268,37 +3076,69 @@ static void makeWalls (SMESHDS_Mesh* aMesh, list< int > fInd; SMDS_VolumeTool vTool( *v ); int iF, nbF = vTool.NbFaces(); - for ( iF = 0; iF < nbF; iF ++ ) + for ( iF = 0; iF < nbF; iF ++ ) { if (vTool.IsFreeFace( iF ) && vTool.GetFaceNodes( iF, faceNodeSet ) && initNodeSet != faceNodeSet) // except an initial face fInd.push_back( iF ); + } if ( fInd.empty() ) continue; // create faces for all steps - for ( iStep = 0; iStep < nbSteps; iStep++ ) - { + // if such a face has been already created by sweep of edge, assure that its orientation is OK + for ( iStep = 0; iStep < nbSteps; iStep++ ) { vTool.Set( *v ); vTool.SetExternalNormal(); list< int >::iterator ind = fInd.begin(); - for ( ; ind != fInd.end(); ind++ ) - { + for ( ; ind != fInd.end(); ind++ ) { const SMDS_MeshNode** nodes = vTool.GetFaceNodes( *ind ); - switch ( vTool.NbFaceNodes( *ind ) ) { - case 3: - aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] ); break; - case 4: - aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ], nodes[ 3 ] ); break; + int nbn = vTool.NbFaceNodes( *ind ); + switch ( nbn ) { + case 3: { ///// triangle + const SMDS_MeshFace * f = aMesh->FindFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ]); + if ( !f ) + myLastCreatedElems.Append(aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] )); + else if ( nodes[ 1 ] != f->GetNode( f->GetNodeIndex( nodes[ 0 ] ) + 1 )) + aMesh->ChangeElementNodes( f, nodes, nbn ); + break; + } + case 4: { ///// quadrangle + const SMDS_MeshFace * f = aMesh->FindFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ], nodes[ 3 ]); + if ( !f ) + myLastCreatedElems.Append(aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ], nodes[ 3 ] )); + else if ( nodes[ 1 ] != f->GetNode( f->GetNodeIndex( nodes[ 0 ] ) + 1 )) + aMesh->ChangeElementNodes( f, nodes, nbn ); + break; + } default: - { - int nbPolygonNodes = vTool.NbFaceNodes( *ind ); - vector polygon_nodes (nbPolygonNodes); - for (int inode = 0; inode < nbPolygonNodes; inode++) { - polygon_nodes[inode] = nodes[inode]; + if( (*v)->IsQuadratic() ) { + if(nbn==6) { /////// quadratic triangle + const SMDS_MeshFace * f = aMesh->FindFace( nodes[0], nodes[2], nodes[4], + nodes[1], nodes[3], nodes[5] ); + if ( !f ) + myLastCreatedElems.Append(aMesh->AddFace(nodes[0], nodes[2], nodes[4], + nodes[1], nodes[3], nodes[5])); + else if ( nodes[ 2 ] != f->GetNode( f->GetNodeIndex( nodes[ 0 ] ) + 1 )) + aMesh->ChangeElementNodes( f, nodes, nbn ); + } + else { /////// quadratic quadrangle + const SMDS_MeshFace * f = aMesh->FindFace( nodes[0], nodes[2], nodes[4], nodes[6], + nodes[1], nodes[3], nodes[5], nodes[7] ); + if ( !f ) + myLastCreatedElems.Append(aMesh->AddFace(nodes[0], nodes[2], nodes[4], nodes[6], + nodes[1], nodes[3], nodes[5], nodes[7])); + else if ( nodes[ 2 ] != f->GetNode( f->GetNodeIndex( nodes[ 0 ] ) + 1 )) + aMesh->ChangeElementNodes( f, nodes, nbn ); } - aMesh->AddPolygonalFace(polygon_nodes); - break; + } + else { //////// polygon + vector polygon_nodes ( nodes, &nodes[nbn] ); + const SMDS_MeshFace * f = aMesh->FindFace( polygon_nodes ); + if ( !f ) + myLastCreatedElems.Append(aMesh->AddPolygonalFace(polygon_nodes)); + else if ( nodes[ 1 ] != f->GetNode( f->GetNodeIndex( nodes[ 0 ] ) + 1 )) + aMesh->ChangeElementNodes( f, nodes, nbn ); } } } @@ -2312,36 +3152,48 @@ static void makeWalls (SMESHDS_Mesh* aMesh, // make a ceiling face with a normal external to a volume SMDS_VolumeTool lastVol( itElem->second.back() ); + int iF = lastVol.GetFaceIndex( aFaceLastNodes ); - if ( iF >= 0 ) - { + if ( iF >= 0 ) { lastVol.SetExternalNormal(); const SMDS_MeshNode** nodes = lastVol.GetFaceNodes( iF ); - switch ( lastVol.NbFaceNodes( iF ) ) { + int nbn = lastVol.NbFaceNodes( iF ); + switch ( nbn ) { case 3: if (!hasFreeLinks || !aMesh->FindFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ])) - aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] ); + myLastCreatedElems.Append(aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] )); break; case 4: if (!hasFreeLinks || !aMesh->FindFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ], nodes[ 3 ])) - aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ], nodes[ 3 ] ); + myLastCreatedElems.Append(aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ], nodes[ 3 ] )); break; default: - { - int nbPolygonNodes = lastVol.NbFaceNodes( iF ); - vector polygon_nodes (nbPolygonNodes); - for (int inode = 0; inode < nbPolygonNodes; inode++) { - polygon_nodes[inode] = nodes[inode]; + if(itElem->second.back()->IsQuadratic()) { + if(nbn==6) { + if (!hasFreeLinks || + !aMesh->FindFace(nodes[0], nodes[2], nodes[4], + nodes[1], nodes[3], nodes[5]) ) { + myLastCreatedElems.Append(aMesh->AddFace(nodes[0], nodes[2], nodes[4], + nodes[1], nodes[3], nodes[5])); + } + } + else { // nbn==8 + if (!hasFreeLinks || + !aMesh->FindFace(nodes[0], nodes[2], nodes[4], nodes[6], + nodes[1], nodes[3], nodes[5], nodes[7]) ) + myLastCreatedElems.Append(aMesh->AddFace(nodes[0], nodes[2], nodes[4], nodes[6], + nodes[1], nodes[3], nodes[5], nodes[7])); } + } + else { + vector polygon_nodes ( nodes, &nodes[nbn] ); if (!hasFreeLinks || !aMesh->FindFace(polygon_nodes)) - aMesh->AddPolygonalFace(polygon_nodes); + myLastCreatedElems.Append(aMesh->AddPolygonalFace(polygon_nodes)); } - break; - } + } // switch } - } // loop on swept elements } @@ -2350,15 +3202,20 @@ static void makeWalls (SMESHDS_Mesh* aMesh, //purpose : //======================================================================= -void SMESH_MeshEditor::RotationSweep(set & theElems, +void SMESH_MeshEditor::RotationSweep(map & theElems, const gp_Ax1& theAxis, const double theAngle, const int theNbSteps, const double theTol) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + MESSAGE( "RotationSweep()"); gp_Trsf aTrsf; aTrsf.SetRotation( theAxis, theAngle ); + gp_Trsf aTrsf2; + aTrsf2.SetRotation( theAxis, theAngle/2. ); gp_Lin aLine( theAxis ); double aSqTol = theTol * theTol; @@ -2370,10 +3227,9 @@ void SMESH_MeshEditor::RotationSweep(set & theElems, TElemOfElemListMap newElemsMap; // loop on theElems - set< const SMDS_MeshElement* >::iterator itElem; - for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) - { - const SMDS_MeshElement* elem = (*itElem); + map::iterator itElem; + for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) { + const SMDS_MeshElement* elem = (*itElem).second; if ( !elem ) continue; vector & newNodesItVec = mapElemNewNodes[ elem ]; @@ -2387,8 +3243,7 @@ void SMESH_MeshEditor::RotationSweep(set & theElems, const SMDS_MeshNode* node = static_cast( itN->next() ); TNodeOfNodeListMapItr nIt = mapNewNodes.find( node ); - if ( nIt == mapNewNodes.end() ) - { + if ( nIt == mapNewNodes.end() ) { nIt = mapNewNodes.insert( make_pair( node, list() )).first; list& listNewNodes = nIt->second; @@ -2400,19 +3255,57 @@ void SMESH_MeshEditor::RotationSweep(set & theElems, const SMDS_MeshNode * newNode = node; for ( int i = 0; i < theNbSteps; i++ ) { if ( !isOnAxis ) { - aTrsf.Transforms( coord[0], coord[1], coord[2] ); + if( elem->IsQuadratic() && !elem->IsMediumNode(node) ) { + // create two nodes + aTrsf2.Transforms( coord[0], coord[1], coord[2] ); + //aTrsf.Transforms( coord[0], coord[1], coord[2] ); + newNode = aMesh->AddNode( coord[0], coord[1], coord[2] ); + myLastCreatedNodes.Append(newNode); + listNewNodes.push_back( newNode ); + aTrsf2.Transforms( coord[0], coord[1], coord[2] ); + //aTrsf.Transforms( coord[0], coord[1], coord[2] ); + } + else { + aTrsf.Transforms( coord[0], coord[1], coord[2] ); + } newNode = aMesh->AddNode( coord[0], coord[1], coord[2] ); + myLastCreatedNodes.Append(newNode); } listNewNodes.push_back( newNode ); } } + else { + // if current elem is quadratic and current node is not medium + // we have to check - may be it is needed to insert additional nodes + if( elem->IsQuadratic() && !elem->IsMediumNode(node) ) { + list< const SMDS_MeshNode* > & listNewNodes = nIt->second; + if(listNewNodes.size()==theNbSteps) { + listNewNodes.clear(); + // make new nodes + gp_XYZ aXYZ( node->X(), node->Y(), node->Z() ); + double coord[3]; + aXYZ.Coord( coord[0], coord[1], coord[2] ); + const SMDS_MeshNode * newNode = node; + for(int i = 0; iAddNode( coord[0], coord[1], coord[2] ); + myLastCreatedNodes.Append(newNode); + listNewNodes.push_back( newNode ); + aTrsf2.Transforms( coord[0], coord[1], coord[2] ); + newNode = aMesh->AddNode( coord[0], coord[1], coord[2] ); + myLastCreatedNodes.Append(newNode); + listNewNodes.push_back( newNode ); + } + } + } + } newNodesItVec.push_back( nIt ); } // make new elements - sweepElement( aMesh, elem, newNodesItVec, newElemsMap[elem] ); + sweepElement( aMesh, elem, newNodesItVec, newElemsMap[elem], theNbSteps, myLastCreatedElems ); } - makeWalls( aMesh, mapNewNodes, newElemsMap, mapElemNewNodes, theElems ); + makeWalls( aMesh, mapNewNodes, newElemsMap, mapElemNewNodes, theElems, theNbSteps, myLastCreatedElems ); } @@ -2427,6 +3320,9 @@ const SMDS_MeshNode* SMESH_MeshEditor::CreateNode(const double x, const double tolnode, SMESH_SequenceOfNode& aNodes) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + gp_Pnt P1(x,y,z); SMESHDS_Mesh * aMesh = myMesh->GetMeshDS(); @@ -2453,6 +3349,7 @@ const SMDS_MeshNode* SMESH_MeshEditor::CreateNode(const double x, // create new node and return it const SMDS_MeshNode* NewNode = aMesh->AddNode(x,y,z); + myLastCreatedNodes.Append(NewNode); return NewNode; } @@ -2463,7 +3360,7 @@ const SMDS_MeshNode* SMESH_MeshEditor::CreateNode(const double x, //======================================================================= void SMESH_MeshEditor::ExtrusionSweep - (set & theElems, + (map & theElems, const gp_Vec& theStep, const int theNbSteps, TElemOfElemListMap& newElemsMap, @@ -2489,27 +3386,34 @@ void SMESH_MeshEditor::ExtrusionSweep //======================================================================= void SMESH_MeshEditor::ExtrusionSweep - (set & theElems, + (map & theElems, ExtrusParam& theParams, TElemOfElemListMap& newElemsMap, const int theFlags, const double theTolerance) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + SMESHDS_Mesh* aMesh = GetMeshDS(); + int nbsteps = theParams.mySteps->Length(); + TNodeOfNodeListMap mapNewNodes; + //TNodeOfNodeVecMap mapNewNodes; TElemOfVecOfNnlmiMap mapElemNewNodes; + //TElemOfVecOfMapNodesMap mapElemNewNodes; // loop on theElems - set< const SMDS_MeshElement* >::iterator itElem; - for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) - { + map::iterator itElem; + for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) { // check element type - const SMDS_MeshElement* elem = (*itElem); + const SMDS_MeshElement* elem = (*itElem).second; if ( !elem ) continue; vector & newNodesItVec = mapElemNewNodes[ elem ]; + //vector & newNodesItVec = mapElemNewNodes[ elem ]; newNodesItVec.reserve( elem->NbNodes() ); // loop on elem nodes @@ -2520,15 +3424,34 @@ void SMESH_MeshEditor::ExtrusionSweep const SMDS_MeshNode* node = static_cast( itN->next() ); TNodeOfNodeListMap::iterator nIt = mapNewNodes.find( node ); - if ( nIt == mapNewNodes.end() ) - { + //TNodeOfNodeVecMap::iterator nIt = mapNewNodes.find( node ); + if ( nIt == mapNewNodes.end() ) { nIt = mapNewNodes.insert( make_pair( node, list() )).first; + //nIt = mapNewNodes.insert( make_pair( node, vector() )).first; list& listNewNodes = nIt->second; + //vector& vecNewNodes = nIt->second; + //vecNewNodes.reserve(nbsteps); // make new nodes double coord[] = { node->X(), node->Y(), node->Z() }; - int nbsteps = theParams.mySteps->Length(); + //int nbsteps = theParams.mySteps->Length(); for ( int i = 0; i < nbsteps; i++ ) { + if( elem->IsQuadratic() && !elem->IsMediumNode(node) ) { + // create additional node + double x = coord[0] + theParams.myDir.X()*theParams.mySteps->Value(i+1)/2.; + double y = coord[1] + theParams.myDir.Y()*theParams.mySteps->Value(i+1)/2.; + double z = coord[2] + theParams.myDir.Z()*theParams.mySteps->Value(i+1)/2.; + if( theFlags & EXTRUSION_FLAG_SEW ) { + const SMDS_MeshNode * newNode = CreateNode(x, y, z, + theTolerance, theParams.myNodes); + listNewNodes.push_back( newNode ); + } + else { + const SMDS_MeshNode * newNode = aMesh->AddNode(x, y, z); + myLastCreatedNodes.Append(newNode); + listNewNodes.push_back( newNode ); + } + } //aTrsf.Transforms( coord[0], coord[1], coord[2] ); coord[0] = coord[0] + theParams.myDir.X()*theParams.mySteps->Value(i+1); coord[1] = coord[1] + theParams.myDir.Y()*theParams.mySteps->Value(i+1); @@ -2537,20 +3460,63 @@ void SMESH_MeshEditor::ExtrusionSweep const SMDS_MeshNode * newNode = CreateNode(coord[0], coord[1], coord[2], theTolerance, theParams.myNodes); listNewNodes.push_back( newNode ); + //vecNewNodes[i]=newNode; } else { const SMDS_MeshNode * newNode = aMesh->AddNode( coord[0], coord[1], coord[2] ); + myLastCreatedNodes.Append(newNode); listNewNodes.push_back( newNode ); + //vecNewNodes[i]=newNode; + } + } + } + else { + // if current elem is quadratic and current node is not medium + // we have to check - may be it is needed to insert additional nodes + if( elem->IsQuadratic() && !elem->IsMediumNode(node) ) { + list< const SMDS_MeshNode* > & listNewNodes = nIt->second; + if(listNewNodes.size()==nbsteps) { + listNewNodes.clear(); + double coord[] = { node->X(), node->Y(), node->Z() }; + for ( int i = 0; i < nbsteps; i++ ) { + double x = coord[0] + theParams.myDir.X()*theParams.mySteps->Value(i+1); + double y = coord[1] + theParams.myDir.Y()*theParams.mySteps->Value(i+1); + double z = coord[2] + theParams.myDir.Z()*theParams.mySteps->Value(i+1); + if( theFlags & EXTRUSION_FLAG_SEW ) { + const SMDS_MeshNode * newNode = CreateNode(x, y, z, + theTolerance, theParams.myNodes); + listNewNodes.push_back( newNode ); + } + else { + const SMDS_MeshNode * newNode = aMesh->AddNode(x, y, z); + myLastCreatedNodes.Append(newNode); + listNewNodes.push_back( newNode ); + } + coord[0] = coord[0] + theParams.myDir.X()*theParams.mySteps->Value(i+1); + coord[1] = coord[1] + theParams.myDir.Y()*theParams.mySteps->Value(i+1); + coord[2] = coord[2] + theParams.myDir.Z()*theParams.mySteps->Value(i+1); + if( theFlags & EXTRUSION_FLAG_SEW ) { + const SMDS_MeshNode * newNode = CreateNode(coord[0], coord[1], coord[2], + theTolerance, theParams.myNodes); + listNewNodes.push_back( newNode ); + } + else { + const SMDS_MeshNode * newNode = aMesh->AddNode( coord[0], coord[1], coord[2] ); + myLastCreatedNodes.Append(newNode); + listNewNodes.push_back( newNode ); + } + } } } } newNodesItVec.push_back( nIt ); } // make new elements - sweepElement( aMesh, elem, newNodesItVec, newElemsMap[elem] ); + sweepElement( aMesh, elem, newNodesItVec, newElemsMap[elem], nbsteps, myLastCreatedElems ); } + if( theFlags & EXTRUSION_FLAG_BOUNDARY ) { - makeWalls( aMesh, mapNewNodes, newElemsMap, mapElemNewNodes, theElems ); + makeWalls( aMesh, mapNewNodes, newElemsMap, mapElemNewNodes, theElems, nbsteps, myLastCreatedElems ); } } @@ -2604,7 +3570,7 @@ protected: //purpose : //======================================================================= SMESH_MeshEditor::Extrusion_Error - SMESH_MeshEditor::ExtrusionAlongTrack (std::set & theElements, + SMESH_MeshEditor::ExtrusionAlongTrack (std::map & theElements, SMESH_subMesh* theTrack, const SMDS_MeshNode* theN1, const bool theHasAngles, @@ -2612,12 +3578,15 @@ SMESH_MeshEditor::Extrusion_Error const bool theHasRefPoint, const gp_Pnt& theRefPoint) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + MESSAGE("SMESH_MeshEditor::ExtrusionAlongTrack") int j, aNbTP, aNbE, aNb; double aT1, aT2, aT, aAngle, aX, aY, aZ; std::list aPrms; std::list::iterator aItD; - std::set< const SMDS_MeshElement* >::iterator itElem; + std::map::iterator itElem; Standard_Real aTx1, aTx2, aL2, aTolVec, aTolVec2; gp_Pnt aP3D, aV0; @@ -2757,7 +3726,7 @@ SMESH_MeshEditor::Extrusion_Error itElem = theElements.begin(); for ( ; itElem != theElements.end(); itElem++ ) { - const SMDS_MeshElement* elem = (*itElem); + const SMDS_MeshElement* elem = (*itElem).second; SMDS_ElemIteratorPtr itN = elem->nodesIterator(); while ( itN->more() ) { @@ -2786,7 +3755,7 @@ SMESH_MeshEditor::Extrusion_Error for ( itElem = theElements.begin(); itElem != theElements.end(); itElem++ ) { // check element type - const SMDS_MeshElement* elem = (*itElem); + const SMDS_MeshElement* elem = (*itElem).second; aTypeE = elem->GetType(); if ( !elem || ( aTypeE != SMDSAbs_Face && aTypeE != SMDSAbs_Edge ) ) continue; @@ -2859,10 +3828,20 @@ SMESH_MeshEditor::Extrusion_Error } // make new node + if( elem->IsQuadratic() && !elem->IsMediumNode(node) ) { + // create additional node + double x = ( aPN1.X() + aPN0.X() )/2.; + double y = ( aPN1.Y() + aPN0.Y() )/2.; + double z = ( aPN1.Z() + aPN0.Z() )/2.; + const SMDS_MeshNode* newNode = aMesh->AddNode(x,y,z); + myLastCreatedNodes.Append(newNode); + listNewNodes.push_back( newNode ); + } aX = aPN1.X(); aY = aPN1.Y(); aZ = aPN1.Z(); const SMDS_MeshNode* newNode = aMesh->AddNode( aX, aY, aZ ); + myLastCreatedNodes.Append(newNode); listNewNodes.push_back( newNode ); aPN0 = aPN1; @@ -2871,13 +3850,47 @@ SMESH_MeshEditor::Extrusion_Error aDT0x = aDT1x; } } + + else { + // if current elem is quadratic and current node is not medium + // we have to check - may be it is needed to insert additional nodes + if( elem->IsQuadratic() && !elem->IsMediumNode(node) ) { + list< const SMDS_MeshNode* > & listNewNodes = nIt->second; + if(listNewNodes.size()==aNbTP-1) { + vector aNodes(2*(aNbTP-1)); + gp_XYZ P(node->X(), node->Y(), node->Z()); + list< const SMDS_MeshNode* >::iterator it = listNewNodes.begin(); + int i; + for(i=0; iX() + P.X() )/2.; + double y = ( N->Y() + P.Y() )/2.; + double z = ( N->Z() + P.Z() )/2.; + const SMDS_MeshNode* newN = aMesh->AddNode(x,y,z); + myLastCreatedNodes.Append(newN); + aNodes[2*i] = newN; + aNodes[2*i+1] = N; + P = gp_XYZ(N->X(),N->Y(),N->Z()); + } + listNewNodes.clear(); + for(i=0; i<2*(aNbTP-1); i++) { + listNewNodes.push_back(aNodes[i]); + } + } + } + } + newNodesItVec.push_back( nIt ); } // make new elements - sweepElement( aMesh, elem, newNodesItVec, newElemsMap[elem] ); + //sweepElement( aMesh, elem, newNodesItVec, newElemsMap[elem], + // newNodesItVec[0]->second.size(), myLastCreatedElems ); + sweepElement( aMesh, elem, newNodesItVec, newElemsMap[elem], + aNbTP-1, myLastCreatedElems ); } - makeWalls( aMesh, mapNewNodes, newElemsMap, mapElemNewNodes, theElements ); + makeWalls( aMesh, mapNewNodes, newElemsMap, mapElemNewNodes, theElements, + aNbTP-1, myLastCreatedElems ); return EXTR_OK; } @@ -2887,10 +3900,13 @@ SMESH_MeshEditor::Extrusion_Error //purpose : //======================================================================= -void SMESH_MeshEditor::Transform (set & theElems, +void SMESH_MeshEditor::Transform (map & theElems, const gp_Trsf& theTrsf, const bool theCopy) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + bool needReverse; switch ( theTrsf.Form() ) { case gp_PntMirror: @@ -2908,13 +3924,12 @@ void SMESH_MeshEditor::Transform (set & theElems, // elements sharing moved nodes; those of them which have all // nodes mirrored but are not in theElems are to be reversed - set inverseElemSet; + map inverseElemSet; // loop on theElems - set< const SMDS_MeshElement* >::iterator itElem; - for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) - { - const SMDS_MeshElement* elem = (*itElem); + map::iterator itElem; + for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) { + const SMDS_MeshElement* elem = (*itElem).second; if ( !elem ) continue; @@ -2934,8 +3949,10 @@ void SMESH_MeshEditor::Transform (set & theElems, coord[2] = node->Z(); theTrsf.Transforms( coord[0], coord[1], coord[2] ); const SMDS_MeshNode * newNode = node; - if ( theCopy ) + if ( theCopy ) { newNode = aMesh->AddNode( coord[0], coord[1], coord[2] ); + myLastCreatedNodes.Append(newNode); + } else { aMesh->MoveNode( node, coord[0], coord[1], coord[2] ); // node position on shape becomes invalid @@ -2947,8 +3964,10 @@ void SMESH_MeshEditor::Transform (set & theElems, // keep inverse elements if ( !theCopy && needReverse ) { SMDS_ElemIteratorPtr invElemIt = node->GetInverseElementIterator(); - while ( invElemIt->more() ) - inverseElemSet.insert( invElemIt->next() ); + while ( invElemIt->more() ) { + const SMDS_MeshElement* iel = invElemIt->next(); + inverseElemSet.insert( make_pair(iel->GetID(),iel) ); + } } } } @@ -2959,7 +3978,7 @@ void SMESH_MeshEditor::Transform (set & theElems, return; if ( !inverseElemSet.empty()) { - set::iterator invElemIt = inverseElemSet.begin(); + map::iterator invElemIt = inverseElemSet.begin(); for ( ; invElemIt != inverseElemSet.end(); invElemIt++ ) theElems.insert( *invElemIt ); } @@ -2983,9 +4002,8 @@ void SMESH_MeshEditor::Transform (set & theElems, { 0, 1, 2, 3, 4, 5, 6, 7 } // FORWARD }; - for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) - { - const SMDS_MeshElement* elem = (*itElem); + for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) { + const SMDS_MeshElement* elem = (*itElem).second; if ( !elem || elem->GetType() == SMDSAbs_Node ) continue; @@ -3018,8 +4036,9 @@ void SMESH_MeshEditor::Transform (set & theElems, continue; // not all nodes transformed if ( theCopy ) { - aMesh->AddPolygonalFace(poly_nodes); - } else { + myLastCreatedElems.Append(aMesh->AddPolygonalFace(poly_nodes)); + } + else { aMesh->ChangePolygonNodes(elem, poly_nodes); } } @@ -3056,8 +4075,9 @@ void SMESH_MeshEditor::Transform (set & theElems, continue; // not all nodes transformed if ( theCopy ) { - aMesh->AddPolyhedralVolume(poly_nodes, quantities); - } else { + myLastCreatedElems.Append(aMesh->AddPolyhedralVolume(poly_nodes, quantities)); + } + else { aMesh->ChangePolyhedronNodes(elem, poly_nodes, quantities); } } @@ -3075,12 +4095,46 @@ void SMESH_MeshEditor::Transform (set & theElems, else i = index[ nbNodes - 4 ]; + if(elem->IsQuadratic()) { + static int anIds[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; + i = anIds; + if(needReverse) { + if(nbNodes==3) { // quadratic edge + static int anIds[] = {1,0,2}; + i = anIds; + } + else if(nbNodes==6) { // quadratic triangle + static int anIds[] = {0,2,1,5,4,3}; + i = anIds; + } + else if(nbNodes==8) { // quadratic quadrangle + static int anIds[] = {0,3,2,1,7,6,5,4}; + i = anIds; + } + else if(nbNodes==10) { // quadratic tetrahedron of 10 nodes + static int anIds[] = {0,2,1,3,6,5,4,7,9,8}; + i = anIds; + } + else if(nbNodes==13) { // quadratic pyramid of 13 nodes + static int anIds[] = {0,3,2,1,4,8,7,6,5,9,12,11,10}; + i = anIds; + } + else if(nbNodes==15) { // quadratic pentahedron with 15 nodes + static int anIds[] = {0,2,1,3,5,4,8,7,6,11,10,9,12,14,13}; + i = anIds; + } + else { // nbNodes==20 - quadratic hexahedron with 20 nodes + static int anIds[] = {0,3,2,1,4,7,6,5,11,10,9,8,15,14,13,12,16,19,18,17}; + i = anIds; + } + } + } + // find transformed nodes const SMDS_MeshNode* nodes[8]; int iNode = 0; SMDS_ElemIteratorPtr itN = elem->nodesIterator(); - while ( itN->more() ) - { + while ( itN->more() ) { const SMDS_MeshNode* node = static_cast( itN->next() ); TNodeNodeMap::iterator nodeMapIt = nodeMap.find( node ); @@ -3091,31 +4145,55 @@ void SMESH_MeshEditor::Transform (set & theElems, if ( iNode != nbNodes ) continue; // not all nodes transformed - if ( theCopy ) - { + if ( theCopy ) { // add a new element switch ( elemType ) { case SMDSAbs_Edge: - aMesh->AddEdge( nodes[ 0 ], nodes[ 1 ] ); + if ( nbNodes == 2 ) + myLastCreatedElems.Append(aMesh->AddEdge( nodes[ 0 ], nodes[ 1 ] )); + else + myLastCreatedElems.Append(aMesh->AddEdge( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] )); break; case SMDSAbs_Face: if ( nbNodes == 3 ) - aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] ); - else - aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] , nodes[ 3 ]); + myLastCreatedElems.Append(aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] )); + else if(nbNodes==4) + myLastCreatedElems.Append(aMesh->AddFace( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] , nodes[ 3 ])); + else if(nbNodes==6) + myLastCreatedElems.Append(aMesh->AddFace(nodes[0], nodes[1], nodes[2], nodes[3], + nodes[4], nodes[5])); + else // nbNodes==8 + myLastCreatedElems.Append(aMesh->AddFace(nodes[0], nodes[1], nodes[2], nodes[3], + nodes[4], nodes[5], nodes[6], nodes[7])); break; case SMDSAbs_Volume: if ( nbNodes == 4 ) - aMesh->AddVolume( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] , nodes[ 3 ] ); + myLastCreatedElems.Append(aMesh->AddVolume( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] , nodes[ 3 ] )); else if ( nbNodes == 8 ) - aMesh->AddVolume( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] , nodes[ 3 ], - nodes[ 4 ], nodes[ 5 ], nodes[ 6 ] , nodes[ 7 ]); + myLastCreatedElems.Append(aMesh->AddVolume( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] , nodes[ 3 ], + nodes[ 4 ], nodes[ 5 ], nodes[ 6 ] , nodes[ 7 ])); else if ( nbNodes == 6 ) - aMesh->AddVolume( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] , nodes[ 3 ], - nodes[ 4 ], nodes[ 5 ]); + myLastCreatedElems.Append(aMesh->AddVolume( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] , nodes[ 3 ], + nodes[ 4 ], nodes[ 5 ])); else if ( nbNodes == 5 ) - aMesh->AddVolume( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] , nodes[ 3 ], - nodes[ 4 ]); + myLastCreatedElems.Append(aMesh->AddVolume( nodes[ 0 ], nodes[ 1 ], nodes[ 2 ] , nodes[ 3 ], + nodes[ 4 ])); + else if(nbNodes==10) + myLastCreatedElems.Append(aMesh->AddVolume(nodes[0], nodes[1], nodes[2], nodes[3], nodes[4], + nodes[5], nodes[6], nodes[7], nodes[8], nodes[9])); + else if(nbNodes==13) + myLastCreatedElems.Append(aMesh->AddVolume(nodes[0], nodes[1], nodes[2], nodes[3], nodes[4], + nodes[5], nodes[6], nodes[7], nodes[8], nodes[9], + nodes[10], nodes[11], nodes[12])); + else if(nbNodes==15) + myLastCreatedElems.Append(aMesh->AddVolume(nodes[0], nodes[1], nodes[2], nodes[3], nodes[4], + nodes[5], nodes[6], nodes[7], nodes[8], nodes[9], + nodes[10], nodes[11], nodes[12], nodes[13], nodes[14])); + else // nbNodes==20 + myLastCreatedElems.Append(aMesh->AddVolume(nodes[0], nodes[1], nodes[2], nodes[3], nodes[4], + nodes[5], nodes[6], nodes[7], nodes[8], nodes[9], + nodes[10], nodes[11], nodes[12], nodes[13], nodes[14], + nodes[15], nodes[16], nodes[17], nodes[18], nodes[19])); break; default:; } @@ -3139,6 +4217,9 @@ void SMESH_MeshEditor::FindCoincidentNodes (set & theNodes const double theTolerance, TListOfListOfNodes & theGroupsOfNodes) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + double tol2 = theTolerance * theTolerance; list nodes; @@ -3172,7 +4253,10 @@ void SMESH_MeshEditor::FindCoincidentNodes (set & theNodes groupPtr = & theGroupsOfNodes.back(); groupPtr->push_back( n1 ); } - groupPtr->push_back( n2 ); + if(groupPtr->front()>n2) + groupPtr->push_front( n2 ); + else + groupPtr->push_back( n2 ); it2 = nodes.erase( it2 ); it2--; } @@ -3271,6 +4355,9 @@ int SMESH_MeshEditor::SimplifyFace (const vector faceNode void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + SMESHDS_Mesh* aMesh = GetMeshDS(); TNodeNodeMap nodeNodeMap; // node to replace - new node @@ -3280,13 +4367,11 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) // Fill nodeNodeMap and elems TListOfListOfNodes::iterator grIt = theGroupsOfNodes.begin(); - for ( ; grIt != theGroupsOfNodes.end(); grIt++ ) - { + for ( ; grIt != theGroupsOfNodes.end(); grIt++ ) { list& nodes = *grIt; list::iterator nIt = nodes.begin(); const SMDS_MeshNode* nToKeep = *nIt; - for ( ; nIt != nodes.end(); nIt++ ) - { + for ( ; nIt != nodes.end(); nIt++ ) { const SMDS_MeshNode* nToRemove = *nIt; nodeNodeMap.insert( TNodeNodeMap::value_type( nToRemove, nToKeep )); if ( nToRemove != nToKeep ) { @@ -3295,15 +4380,16 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) } SMDS_ElemIteratorPtr invElemIt = nToRemove->GetInverseElementIterator(); - while ( invElemIt->more() ) - elems.insert( invElemIt->next() ); + while ( invElemIt->more() ) { + const SMDS_MeshElement* elem = invElemIt->next(); + elems.insert(elem); + } } } // Change element nodes or remove an element set::iterator eIt = elems.begin(); - for ( ; eIt != elems.end(); eIt++ ) - { + for ( ; eIt != elems.end(); eIt++ ) { const SMDS_MeshElement* elem = *eIt; int nbNodes = elem->NbNodes(); int aShapeId = FindShape( elem ); @@ -3318,8 +4404,7 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) // get new seq of nodes SMDS_ElemIteratorPtr itN = elem->nodesIterator(); - while ( itN->more() ) - { + while ( itN->more() ) { const SMDS_MeshNode* n = static_cast( itN->next() ); @@ -3339,8 +4424,7 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) bool isOk = true; int nbUniqueNodes = nodeSet.size(); - if ( nbNodes != nbUniqueNodes ) // some nodes stick - { + if ( nbNodes != nbUniqueNodes ) { // some nodes stick // Polygons and Polyhedral volumes if (elem->IsPoly()) { @@ -3365,19 +4449,23 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) poly_nodes[ii] = polygons_nodes[inode]; } SMDS_MeshElement* newElem = aMesh->AddPolygonalFace(poly_nodes); + myLastCreatedElems.Append(newElem); if (aShapeId) aMesh->SetMeshElementOnShape(newElem, aShapeId); } aMesh->ChangeElementNodes(elem, &polygons_nodes[inode], quantities[nbNew - 1]); - } else { + } + else { rmElemIds.push_back(elem->GetID()); } - } else if (elem->GetType() == SMDSAbs_Volume) { + } + else if (elem->GetType() == SMDSAbs_Volume) { // Polyhedral volume if (nbUniqueNodes < 4) { rmElemIds.push_back(elem->GetID()); - } else { + } + else { // each face has to be analized in order to check volume validity const SMDS_PolyhedralVolumeOfNodes* aPolyedre = static_cast( elem ); @@ -3412,11 +4500,13 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) else rmElemIds.push_back(elem->GetID()); - } else { + } + else { rmElemIds.push_back(elem->GetID()); } } - } else { + } + else { } continue; @@ -3474,6 +4564,7 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) curNodes[ 4 ], curNodes[ 5 ], curNodes[ iRepl[ 0 ] == 2 ? 1 : 2 ]); + myLastCreatedElems.Append(newElem); if ( aShapeId ) aMesh->SetMeshElementOnShape( newElem, aShapeId ); // 2. : reverse a bottom @@ -3487,7 +4578,96 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) else isOk = false; break; - case 8: { //////////////////////////////////// HEXAHEDRON + case 8: { + if(elem->IsQuadratic()) { // Quadratic quadrangle + // 1 5 2 + // +---+---+ + // | | + // | | + // 4+ +6 + // | | + // | | + // +---+---+ + // 0 7 3 + isOk = false; + if(nbRepl==3) { + nbUniqueNodes = 6; + if( iRepl[0]==0 && iRepl[1]==1 && iRepl[2]==4 ) { + uniqueNodes[0] = curNodes[0]; + uniqueNodes[1] = curNodes[2]; + uniqueNodes[2] = curNodes[3]; + uniqueNodes[3] = curNodes[5]; + uniqueNodes[4] = curNodes[6]; + uniqueNodes[5] = curNodes[7]; + isOk = true; + } + if( iRepl[0]==0 && iRepl[1]==3 && iRepl[2]==7 ) { + uniqueNodes[0] = curNodes[0]; + uniqueNodes[1] = curNodes[1]; + uniqueNodes[2] = curNodes[2]; + uniqueNodes[3] = curNodes[4]; + uniqueNodes[4] = curNodes[5]; + uniqueNodes[5] = curNodes[6]; + isOk = true; + } + if( iRepl[0]==0 && iRepl[1]==4 && iRepl[2]==7 ) { + uniqueNodes[0] = curNodes[1]; + uniqueNodes[1] = curNodes[2]; + uniqueNodes[2] = curNodes[3]; + uniqueNodes[3] = curNodes[5]; + uniqueNodes[4] = curNodes[6]; + uniqueNodes[5] = curNodes[0]; + isOk = true; + } + if( iRepl[0]==1 && iRepl[1]==2 && iRepl[2]==5 ) { + uniqueNodes[0] = curNodes[0]; + uniqueNodes[1] = curNodes[1]; + uniqueNodes[2] = curNodes[3]; + uniqueNodes[3] = curNodes[4]; + uniqueNodes[4] = curNodes[6]; + uniqueNodes[5] = curNodes[7]; + isOk = true; + } + if( iRepl[0]==1 && iRepl[1]==4 && iRepl[2]==5 ) { + uniqueNodes[0] = curNodes[0]; + uniqueNodes[1] = curNodes[2]; + uniqueNodes[2] = curNodes[3]; + uniqueNodes[3] = curNodes[1]; + uniqueNodes[4] = curNodes[6]; + uniqueNodes[5] = curNodes[7]; + isOk = true; + } + if( iRepl[0]==2 && iRepl[1]==3 && iRepl[2]==6 ) { + uniqueNodes[0] = curNodes[0]; + uniqueNodes[1] = curNodes[1]; + uniqueNodes[2] = curNodes[2]; + uniqueNodes[3] = curNodes[4]; + uniqueNodes[4] = curNodes[5]; + uniqueNodes[5] = curNodes[7]; + isOk = true; + } + if( iRepl[0]==2 && iRepl[1]==5 && iRepl[2]==6 ) { + uniqueNodes[0] = curNodes[0]; + uniqueNodes[1] = curNodes[1]; + uniqueNodes[2] = curNodes[3]; + uniqueNodes[3] = curNodes[4]; + uniqueNodes[4] = curNodes[2]; + uniqueNodes[5] = curNodes[7]; + isOk = true; + } + if( iRepl[0]==3 && iRepl[1]==6 && iRepl[2]==7 ) { + uniqueNodes[0] = curNodes[0]; + uniqueNodes[1] = curNodes[1]; + uniqueNodes[2] = curNodes[2]; + uniqueNodes[3] = curNodes[4]; + uniqueNodes[4] = curNodes[5]; + uniqueNodes[5] = curNodes[3]; + isOk = true; + } + } + break; + } + //////////////////////////////////// HEXAHEDRON isOk = false; SMDS_VolumeTool hexa (elem); hexa.SetExternalNormal(); @@ -3550,6 +4730,7 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) curNodes[ind[ 3 ]], curNodes[ind[ 2 ]], curNodes[indTop[ 0 ]]); + myLastCreatedElems.Append(newElem); if ( aShapeId ) aMesh->SetMeshElementOnShape( newElem, aShapeId ); isOk = true; @@ -3615,6 +4796,7 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) curNodes[ i2 ], curNodes[ i3d ], curNodes[ i2t ]); + myLastCreatedElems.Append(newElem); if ( aShapeId ) aMesh->SetMeshElementOnShape( newElem, aShapeId ); isOk = true; @@ -3691,11 +4873,13 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) } aMesh->ChangePolyhedronNodes( elem, poly_nodes, quantities ); } - } else { + } + else { // Change regular element or polygon aMesh->ChangeElementNodes( elem, uniqueNodes, nbUniqueNodes ); } - } else { + } + else { // Remove invalid regular element or invalid polygon rmElemIds.push_back( elem->GetID() ); } @@ -3710,6 +4894,35 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) Remove( rmElemIds, false ); } + +// ================================================= +// class : SortableElement +// purpose : auxilary +// ================================================= +class SortableElement : public set +{ + public: + + SortableElement( const SMDS_MeshElement* theElem ) + { + myID = theElem->GetID(); + SMDS_ElemIteratorPtr nodeIt = theElem->nodesIterator(); + while ( nodeIt->more() ) + this->insert( nodeIt->next() ); + } + + const long GetID() const + { return myID; } + + void SetID(const long anID) const + { myID = anID; } + + + private: + mutable long myID; +}; + + //======================================================================= //function : MergeEqualElements //purpose : Remove all but one of elements built on the same nodes. @@ -3717,6 +4930,9 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) void SMESH_MeshEditor::MergeEqualElements() { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + SMESHDS_Mesh* aMesh = GetMeshDS(); SMDS_EdgeIteratorPtr eIt = aMesh->edgesIterator(); @@ -3727,8 +4943,7 @@ void SMESH_MeshEditor::MergeEqualElements() for ( int iDim = 1; iDim <= 3; iDim++ ) { - set< set > setOfNodeSet; - + set< SortableElement > setOfNodeSet; while ( 1 ) { // get next element const SMDS_MeshElement* elem = 0; @@ -3741,16 +4956,21 @@ void SMESH_MeshEditor::MergeEqualElements() } if ( !elem ) break; - // get elem nodes - set nodeSet; - SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator(); - while ( nodeIt->more() ) - nodeSet.insert( nodeIt->next() ); + SortableElement SE(elem); // check uniqueness - bool isUnique = setOfNodeSet.insert( nodeSet ).second; - if ( !isUnique ) - rmElemIds.push_back( elem->GetID() ); + pair< set::iterator, bool> pp = setOfNodeSet.insert(SE); + if( !(pp.second) ) { + set::iterator itSE = pp.first; + SortableElement SEold = *itSE; + if( SEold.GetID() > SE.GetID() ) { + rmElemIds.push_back( SEold.GetID() ); + (*itSE).SetID(SE.GetID()); + } + else { + rmElemIds.push_back( SE.GetID() ); + } + } } } @@ -3767,17 +4987,17 @@ void SMESH_MeshEditor::MergeEqualElements() const SMDS_MeshElement* SMESH_MeshEditor::FindFaceInSet(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2, - const set& elemSet, - const set& avoidSet) + const map& elemSet, + const map& avoidSet) { SMDS_ElemIteratorPtr invElemIt = n1->GetInverseElementIterator(); while ( invElemIt->more() ) { // loop on inverse elements of n1 const SMDS_MeshElement* elem = invElemIt->next(); if (elem->GetType() != SMDSAbs_Face || - avoidSet.find( elem ) != avoidSet.end() ) + avoidSet.find( elem->GetID() ) != avoidSet.end() ) continue; - if ( !elemSet.empty() && elemSet.find( elem ) == elemSet.end()) + if ( !elemSet.empty() && elemSet.find( elem->GetID() ) == elemSet.end()) continue; // get face nodes and find index of n1 int i1, nbN = elem->NbNodes(), iNode = 0; @@ -3791,14 +5011,53 @@ const SMDS_MeshElement* i1 = iNode - 1; } // find a n2 linked to n1 - for ( iNode = 0; iNode < 2; iNode++ ) { - if ( iNode ) // node before n1 - n = faceNodes[ i1 == 0 ? nbN - 1 : i1 - 1 ]; - else // node after n1 - n = faceNodes[ i1 + 1 == nbN ? 0 : i1 + 1 ]; - if ( n == n2 ) - return elem; + if(!elem->IsQuadratic()) { + for ( iNode = 0; iNode < 2; iNode++ ) { + if ( iNode ) // node before n1 + n = faceNodes[ i1 == 0 ? nbN - 1 : i1 - 1 ]; + else // node after n1 + n = faceNodes[ i1 + 1 == nbN ? 0 : i1 + 1 ]; + if ( n == n2 ) + return elem; + } } + else { // analysis for quadratic elements + bool IsFind = false; + // check using only corner nodes + for ( iNode = 0; iNode < 2; iNode++ ) { + if ( iNode ) // node before n1 + n = faceNodes[ i1 == 0 ? nbN/2 - 1 : i1 - 1 ]; + else // node after n1 + n = faceNodes[ i1 + 1 == nbN/2 ? 0 : i1 + 1 ]; + if ( n == n2 ) + IsFind = true; + } + if(IsFind) { + return elem; + } + else { + // check using all nodes + const SMDS_QuadraticFaceOfNodes* F = + static_cast(elem); + // use special nodes iterator + iNode = 0; + SMDS_NodeIteratorPtr anIter = F->interlacedNodesIterator(); + while ( anIter->more() ) { + faceNodes[iNode] = static_cast(anIter->next()); + if ( faceNodes[ iNode++ ] == n1 ) + i1 = iNode - 1; + } + for ( iNode = 0; iNode < 2; iNode++ ) { + if ( iNode ) // node before n1 + n = faceNodes[ i1 == 0 ? nbN - 1 : i1 - 1 ]; + else // node after n1 + n = faceNodes[ i1 + 1 == nbN ? 0 : i1 + 1 ]; + if ( n == n2 ) { + return elem; + } + } + } + } // end analysis for quadratic elements } return 0; } @@ -3812,9 +5071,9 @@ static const SMDS_MeshElement* findAdjacentFace(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2, const SMDS_MeshElement* elem) { - set elemSet, avoidSet; + map elemSet, avoidSet; if ( elem ) - avoidSet.insert ( elem ); + avoidSet.insert ( make_pair(elem->GetID(),elem) ); return SMESH_MeshEditor::FindFaceInSet( n1, n2, elemSet, avoidSet ); } @@ -3842,12 +5101,12 @@ static bool findFreeBorder (const SMDS_MeshNode* theFirstNode, theNodes.push_back( theFirstNode ); theNodes.push_back( theSecondNode ); - const SMDS_MeshNode* nodes [5], *nIgnore = theFirstNode, * nStart = theSecondNode; + //vector nodes; + const SMDS_MeshNode *nIgnore = theFirstNode, *nStart = theSecondNode; set < const SMDS_MeshElement* > foundElems; bool needTheLast = ( theLastNode != 0 ); - while ( nStart != theLastNode ) - { + while ( nStart != theLastNode ) { if ( nStart == theFirstNode ) return !needTheLast; @@ -3858,13 +5117,26 @@ static bool findFreeBorder (const SMDS_MeshNode* theFirstNode, SMDS_ElemIteratorPtr invElemIt = nStart->facesIterator(); while ( invElemIt->more() ) { const SMDS_MeshElement* e = invElemIt->next(); - if ( e == curElem || foundElems.insert( e ).second ) - { + if ( e == curElem || foundElems.insert( e ).second ) { // get nodes - SMDS_ElemIteratorPtr nIt = e->nodesIterator(); int iNode = 0, nbNodes = e->NbNodes(); - while ( nIt->more() ) - nodes[ iNode++ ] = static_cast( nIt->next() ); + //const SMDS_MeshNode* nodes[nbNodes+1]; + vector nodes(nbNodes+1); + + if(e->IsQuadratic()) { + const SMDS_QuadraticFaceOfNodes* F = + static_cast(e); + // use special nodes iterator + SMDS_NodeIteratorPtr anIter = F->interlacedNodesIterator(); + while( anIter->more() ) { + nodes[ iNode++ ] = anIter->next(); + } + } + else { + SMDS_ElemIteratorPtr nIt = e->nodesIterator(); + while ( nIt->more() ) + nodes[ iNode++ ] = static_cast( nIt->next() ); + } nodes[ iNode ] = nodes[ 0 ]; // check 2 links for ( iNode = 0; iNode < nbNodes; iNode++ ) @@ -3980,6 +5252,9 @@ SMESH_MeshEditor::Sew_Error const bool toCreatePolygons, const bool toCreatePolyedrs) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + MESSAGE("::SewFreeBorder()"); Sew_Error aResult = SEW_OK; @@ -3999,8 +5274,7 @@ SMESH_MeshEditor::Sew_Error MESSAGE(" Free Border 1 not found " ); aResult = SEW_BORDER1_NOT_FOUND; } - if (theSideIsFreeBorder) - { + if (theSideIsFreeBorder) { // Free border 2 // -------------- if (!findFreeBorder(theSideFirstNode, theSideSecondNode, theSideThirdNode, @@ -4012,8 +5286,7 @@ SMESH_MeshEditor::Sew_Error if ( aResult != SEW_OK ) return aResult; - if (!theSideIsFreeBorder) - { + if (!theSideIsFreeBorder) { // Side 2 // -------------- @@ -4039,8 +5312,7 @@ SMESH_MeshEditor::Sew_Error gp_XYZ Ps2( theSideSecondNode->X(), theSideSecondNode->Y(), theSideSecondNode->Z() ); double tol2 = 1.e-8; gp_Vec Vbs1( Pb1 - Ps1 ),Vbs2( Pb2 - Ps2 ); - if ( Vbs1.SquareMagnitude() > tol2 || Vbs2.SquareMagnitude() > tol2 ) - { + if ( Vbs1.SquareMagnitude() > tol2 || Vbs2.SquareMagnitude() > tol2 ) { // Need node movement. // find X and Z axes to create trsf @@ -4069,8 +5341,7 @@ SMESH_MeshEditor::Sew_Error nBordXYZ.insert( TNodeXYZMap::value_type( n, xyz )); } } - else - { + else { // just insert nodes XYZ in the nBordXYZ map for ( nBordIt = bordNodes.begin(); nBordIt != bordNodes.end(); nBordIt++ ) { const SMDS_MeshNode* n = *nBordIt; @@ -4123,13 +5394,27 @@ SMESH_MeshEditor::Sew_Error const SMDS_MeshNode** nodes = isVolume ? volume.GetNodes() : faceNodes; if ( isVolume ) // --volume hasVolumes = true; - else if ( nbNodes > 2 ) { // --face + //else if ( nbNodes > 2 ) { // --face + else if ( elem->GetType()==SMDSAbs_Face ) { // --face // retrieve all face nodes and find iPrevNode - an index of the prevSideNode - SMDS_ElemIteratorPtr nIt = elem->nodesIterator(); - while ( nIt->more() ) { - nodes[ iNode ] = static_cast( nIt->next() ); - if ( nodes[ iNode++ ] == prevSideNode ) - iPrevNode = iNode - 1; + if(elem->IsQuadratic()) { + const SMDS_QuadraticFaceOfNodes* F = + static_cast(elem); + // use special nodes iterator + SMDS_NodeIteratorPtr anIter = F->interlacedNodesIterator(); + while( anIter->more() ) { + nodes[ iNode ] = anIter->next(); + if ( nodes[ iNode++ ] == prevSideNode ) + iPrevNode = iNode - 1; + } + } + else { + SMDS_ElemIteratorPtr nIt = elem->nodesIterator(); + while ( nIt->more() ) { + nodes[ iNode ] = static_cast( nIt->next() ); + if ( nodes[ iNode++ ] == prevSideNode ) + iPrevNode = iNode - 1; + } } // there are 2 links to check nbNodes = 2; @@ -4142,7 +5427,8 @@ SMESH_MeshEditor::Sew_Error if ( isVolume ) { if ( !volume.IsLinked( n, prevSideNode )) continue; - } else { + } + else { if ( iNode ) // a node before prevSideNode n = nodes[ iPrevNode == 0 ? elem->NbNodes() - 1 : iPrevNode - 1 ]; else // a node after prevSideNode @@ -4428,18 +5714,39 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement* theFace, il1 = il2 = i3 = i4 = -1; //const SMDS_MeshNode* nodes[ theFace->NbNodes() ]; vector nodes( theFace->NbNodes() ); - SMDS_ElemIteratorPtr nodeIt = theFace->nodesIterator(); - while ( nodeIt->more() ) { - const SMDS_MeshNode* n = static_cast( nodeIt->next() ); - if ( n == theBetweenNode1 ) - il1 = iNode; - else if ( n == theBetweenNode2 ) - il2 = iNode; - else if ( i3 < 0 ) - i3 = iNode; - else - i4 = iNode; - nodes[ iNode++ ] = n; + + if(theFace->IsQuadratic()) { + const SMDS_QuadraticFaceOfNodes* F = + static_cast(theFace); + // use special nodes iterator + SMDS_NodeIteratorPtr anIter = F->interlacedNodesIterator(); + while( anIter->more() ) { + const SMDS_MeshNode* n = anIter->next(); + if ( n == theBetweenNode1 ) + il1 = iNode; + else if ( n == theBetweenNode2 ) + il2 = iNode; + else if ( i3 < 0 ) + i3 = iNode; + else + i4 = iNode; + nodes[ iNode++ ] = n; + } + } + else { + SMDS_ElemIteratorPtr nodeIt = theFace->nodesIterator(); + while ( nodeIt->more() ) { + const SMDS_MeshNode* n = static_cast( nodeIt->next() ); + if ( n == theBetweenNode1 ) + il1 = iNode; + else if ( n == theBetweenNode2 ) + il2 = iNode; + else if ( i3 < 0 ) + i3 = iNode; + else + i4 = iNode; + nodes[ iNode++ ] = n; + } } if ( il1 < 0 || il2 < 0 || i3 < 0 ) return ; @@ -4468,25 +5775,48 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement* theFace, // add nodes of face up to first node of link bool isFLN = false; - nodeIt = theFace->nodesIterator(); - while ( nodeIt->more() && !isFLN ) { - const SMDS_MeshNode* n = static_cast( nodeIt->next() ); - poly_nodes[iNode++] = n; - if (n == nodes[il1]) { - isFLN = true; - } - } - // add nodes to insert - list::iterator nIt = aNodesToInsert.begin(); - for (; nIt != aNodesToInsert.end(); nIt++) { - poly_nodes[iNode++] = *nIt; + if(theFace->IsQuadratic()) { + const SMDS_QuadraticFaceOfNodes* F = + static_cast(theFace); + // use special nodes iterator + SMDS_NodeIteratorPtr anIter = F->interlacedNodesIterator(); + while( anIter->more() && !isFLN ) { + const SMDS_MeshNode* n = anIter->next(); + poly_nodes[iNode++] = n; + if (n == nodes[il1]) { + isFLN = true; + } + } + // add nodes to insert + list::iterator nIt = aNodesToInsert.begin(); + for (; nIt != aNodesToInsert.end(); nIt++) { + poly_nodes[iNode++] = *nIt; + } + // add nodes of face starting from last node of link + while ( anIter->more() ) { + poly_nodes[iNode++] = anIter->next(); + } } - - // add nodes of face starting from last node of link - while ( nodeIt->more() ) { - const SMDS_MeshNode* n = static_cast( nodeIt->next() ); - poly_nodes[iNode++] = n; + else { + SMDS_ElemIteratorPtr nodeIt = theFace->nodesIterator(); + while ( nodeIt->more() && !isFLN ) { + const SMDS_MeshNode* n = static_cast( nodeIt->next() ); + poly_nodes[iNode++] = n; + if (n == nodes[il1]) { + isFLN = true; + } + } + // add nodes to insert + list::iterator nIt = aNodesToInsert.begin(); + for (; nIt != aNodesToInsert.end(); nIt++) { + poly_nodes[iNode++] = *nIt; + } + // add nodes of face starting from last node of link + while ( nodeIt->more() ) { + const SMDS_MeshNode* n = static_cast( nodeIt->next() ); + poly_nodes[iNode++] = n; + } } // edit or replace the face @@ -4494,11 +5824,12 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement* theFace, if (theFace->IsPoly()) { aMesh->ChangePolygonNodes(theFace, poly_nodes); - - } else { + } + else { int aShapeId = FindShape( theFace ); SMDS_MeshElement* newElem = aMesh->AddPolygonalFace(poly_nodes); + myLastCreatedElems.Append(newElem); if ( aShapeId && newElem ) aMesh->SetMeshElementOnShape( newElem, aShapeId ); @@ -4507,82 +5838,196 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement* theFace, return; } - // put aNodesToInsert between theBetweenNode1 and theBetweenNode2 - int nbLinkNodes = 2 + aNodesToInsert.size(); - //const SMDS_MeshNode* linkNodes[ nbLinkNodes ]; - vector linkNodes( nbLinkNodes ); - linkNodes[ 0 ] = nodes[ il1 ]; - linkNodes[ nbLinkNodes - 1 ] = nodes[ il2 ]; - list::iterator nIt = aNodesToInsert.begin(); - for ( iNode = 1; nIt != aNodesToInsert.end(); nIt++ ) { - linkNodes[ iNode++ ] = *nIt; - } - // decide how to split a quadrangle: compare possible variants - // and choose which of splits to be a quadrangle - int i1, i2, iSplit, nbSplits = nbLinkNodes - 1, iBestQuad; - if ( nbFaceNodes == 3 ) - { - iBestQuad = nbSplits; - i4 = i3; - } - else if ( nbFaceNodes == 4 ) - { - SMESH::Controls::NumericalFunctorPtr aCrit( new SMESH::Controls::AspectRatio); - double aBestRate = DBL_MAX; - for ( int iQuad = 0; iQuad < nbSplits; iQuad++ ) { - i1 = 0; i2 = 1; - double aBadRate = 0; - // evaluate elements quality - for ( iSplit = 0; iSplit < nbSplits; iSplit++ ) { - if ( iSplit == iQuad ) { - SMDS_FaceOfNodes quad (linkNodes[ i1++ ], - linkNodes[ i2++ ], - nodes[ i3 ], - nodes[ i4 ]); - aBadRate += getBadRate( &quad, aCrit ); + if( !theFace->IsQuadratic() ) { + + // put aNodesToInsert between theBetweenNode1 and theBetweenNode2 + int nbLinkNodes = 2 + aNodesToInsert.size(); + //const SMDS_MeshNode* linkNodes[ nbLinkNodes ]; + vector linkNodes( nbLinkNodes ); + linkNodes[ 0 ] = nodes[ il1 ]; + linkNodes[ nbLinkNodes - 1 ] = nodes[ il2 ]; + list::iterator nIt = aNodesToInsert.begin(); + for ( iNode = 1; nIt != aNodesToInsert.end(); nIt++ ) { + linkNodes[ iNode++ ] = *nIt; + } + // decide how to split a quadrangle: compare possible variants + // and choose which of splits to be a quadrangle + int i1, i2, iSplit, nbSplits = nbLinkNodes - 1, iBestQuad; + if ( nbFaceNodes == 3 ) { + iBestQuad = nbSplits; + i4 = i3; + } + else if ( nbFaceNodes == 4 ) { + SMESH::Controls::NumericalFunctorPtr aCrit( new SMESH::Controls::AspectRatio); + double aBestRate = DBL_MAX; + for ( int iQuad = 0; iQuad < nbSplits; iQuad++ ) { + i1 = 0; i2 = 1; + double aBadRate = 0; + // evaluate elements quality + for ( iSplit = 0; iSplit < nbSplits; iSplit++ ) { + if ( iSplit == iQuad ) { + SMDS_FaceOfNodes quad (linkNodes[ i1++ ], + linkNodes[ i2++ ], + nodes[ i3 ], + nodes[ i4 ]); + aBadRate += getBadRate( &quad, aCrit ); + } + else { + SMDS_FaceOfNodes tria (linkNodes[ i1++ ], + linkNodes[ i2++ ], + nodes[ iSplit < iQuad ? i4 : i3 ]); + aBadRate += getBadRate( &tria, aCrit ); + } } - else { - SMDS_FaceOfNodes tria (linkNodes[ i1++ ], - linkNodes[ i2++ ], - nodes[ iSplit < iQuad ? i4 : i3 ]); - aBadRate += getBadRate( &tria, aCrit ); + // choice + if ( aBadRate < aBestRate ) { + iBestQuad = iQuad; + aBestRate = aBadRate; } } - // choice - if ( aBadRate < aBestRate ) { - iBestQuad = iQuad; - aBestRate = aBadRate; + } + + // create new elements + SMESHDS_Mesh *aMesh = GetMeshDS(); + int aShapeId = FindShape( theFace ); + + i1 = 0; i2 = 1; + for ( iSplit = 0; iSplit < nbSplits - 1; iSplit++ ) { + SMDS_MeshElement* newElem = 0; + if ( iSplit == iBestQuad ) + newElem = aMesh->AddFace (linkNodes[ i1++ ], + linkNodes[ i2++ ], + nodes[ i3 ], + nodes[ i4 ]); + else + newElem = aMesh->AddFace (linkNodes[ i1++ ], + linkNodes[ i2++ ], + nodes[ iSplit < iBestQuad ? i4 : i3 ]); + myLastCreatedElems.Append(newElem); + if ( aShapeId && newElem ) + aMesh->SetMeshElementOnShape( newElem, aShapeId ); + } + + // change nodes of theFace + const SMDS_MeshNode* newNodes[ 4 ]; + newNodes[ 0 ] = linkNodes[ i1 ]; + newNodes[ 1 ] = linkNodes[ i2 ]; + newNodes[ 2 ] = nodes[ iSplit >= iBestQuad ? i3 : i4 ]; + newNodes[ 3 ] = nodes[ i4 ]; + aMesh->ChangeElementNodes( theFace, newNodes, iSplit == iBestQuad ? 4 : 3 ); + } // end if(!theFace->IsQuadratic()) + else { // theFace is quadratic + // we have to split theFace on simple triangles and one simple quadrangle + int tmp = il1/2; + int nbshift = tmp*2; + // shift nodes in nodes[] by nbshift + int i,j; + for(i=0; iAddFace (linkNodes[ i1++ ], - linkNodes[ i2++ ], - nodes[ i3 ], - nodes[ i4 ]); - else - newElem = aMesh->AddFace (linkNodes[ i1++ ], - linkNodes[ i2++ ], - nodes[ iSplit < iBestQuad ? i4 : i3 ]); - if ( aShapeId && newElem ) - aMesh->SetMeshElementOnShape( newElem, aShapeId ); + int n1,n2,n3; + if(nbFaceNodes==6) { // quadratic triangle + SMDS_MeshElement* newElem = + aMesh->AddFace(nodes[3],nodes[4],nodes[5]); + myLastCreatedElems.Append(newElem); + if ( aShapeId && newElem ) + aMesh->SetMeshElementOnShape( newElem, aShapeId ); + if(theFace->IsMediumNode(nodes[il1])) { + // create quadrangle + newElem = aMesh->AddFace(nodes[0],nodes[1],nodes[3],nodes[5]); + myLastCreatedElems.Append(newElem); + if ( aShapeId && newElem ) + aMesh->SetMeshElementOnShape( newElem, aShapeId ); + n1 = 1; + n2 = 2; + n3 = 3; + } + else { + // create quadrangle + newElem = aMesh->AddFace(nodes[1],nodes[2],nodes[3],nodes[5]); + myLastCreatedElems.Append(newElem); + if ( aShapeId && newElem ) + aMesh->SetMeshElementOnShape( newElem, aShapeId ); + n1 = 0; + n2 = 1; + n3 = 5; + } + } + else { // nbFaceNodes==8 - quadratic quadrangle + SMDS_MeshElement* newElem = + aMesh->AddFace(nodes[3],nodes[4],nodes[5]); + myLastCreatedElems.Append(newElem); + if ( aShapeId && newElem ) + aMesh->SetMeshElementOnShape( newElem, aShapeId ); + newElem = aMesh->AddFace(nodes[5],nodes[6],nodes[7]); + myLastCreatedElems.Append(newElem); + if ( aShapeId && newElem ) + aMesh->SetMeshElementOnShape( newElem, aShapeId ); + newElem = aMesh->AddFace(nodes[5],nodes[7],nodes[3]); + myLastCreatedElems.Append(newElem); + if ( aShapeId && newElem ) + aMesh->SetMeshElementOnShape( newElem, aShapeId ); + if(theFace->IsMediumNode(nodes[il1])) { + // create quadrangle + newElem = aMesh->AddFace(nodes[0],nodes[1],nodes[3],nodes[7]); + myLastCreatedElems.Append(newElem); + if ( aShapeId && newElem ) + aMesh->SetMeshElementOnShape( newElem, aShapeId ); + n1 = 1; + n2 = 2; + n3 = 3; + } + else { + // create quadrangle + newElem = aMesh->AddFace(nodes[1],nodes[2],nodes[3],nodes[7]); + myLastCreatedElems.Append(newElem); + if ( aShapeId && newElem ) + aMesh->SetMeshElementOnShape( newElem, aShapeId ); + n1 = 0; + n2 = 1; + n3 = 7; + } + } + // create needed triangles using n1,n2,n3 and inserted nodes + int nbn = 2 + aNodesToInsert.size(); + //const SMDS_MeshNode* aNodes[nbn]; + vector aNodes(nbn); + aNodes[0] = nodes[n1]; + aNodes[nbn-1] = nodes[n2]; + list::iterator nIt = aNodesToInsert.begin(); + for ( iNode = 1; nIt != aNodesToInsert.end(); nIt++ ) { + aNodes[iNode++] = *nIt; + } + for(i=1; iAddFace(aNodes[i-1],aNodes[i],nodes[n3]); + myLastCreatedElems.Append(newElem); + if ( aShapeId && newElem ) + aMesh->SetMeshElementOnShape( newElem, aShapeId ); + } + // remove old quadratic face + aMesh->RemoveElement(theFace); } - - // change nodes of theFace - const SMDS_MeshNode* newNodes[ 4 ]; - newNodes[ 0 ] = linkNodes[ i1 ]; - newNodes[ 1 ] = linkNodes[ i2 ]; - newNodes[ 2 ] = nodes[ iSplit >= iBestQuad ? i3 : i4 ]; - newNodes[ 3 ] = nodes[ i4 ]; - aMesh->ChangeElementNodes( theFace, newNodes, iSplit == iBestQuad ? 4 : 3 ); } //======================================================================= @@ -4593,6 +6038,9 @@ void SMESH_MeshEditor::UpdateVolumes (const SMDS_MeshNode* theBetweenNode const SMDS_MeshNode* theBetweenNode2, list& theNodesToInsert) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + SMDS_ElemIteratorPtr invElemIt = theBetweenNode1->GetInverseElementIterator(); while (invElemIt->more()) { // loop on inverse elements of theBetweenNode1 const SMDS_MeshElement* elem = invElemIt->next(); @@ -4628,7 +6076,8 @@ void SMESH_MeshEditor::UpdateVolumes (const SMDS_MeshNode* theBetweenNode poly_nodes.push_back(*nIt); } } - } else if (faceNodes[inode] == theBetweenNode2) { + } + else if (faceNodes[inode] == theBetweenNode2) { if (faceNodes[inode + 1] == theBetweenNode1) { nbInserted = theNodesToInsert.size(); @@ -4640,7 +6089,8 @@ void SMESH_MeshEditor::UpdateVolumes (const SMDS_MeshNode* theBetweenNode } poly_nodes.push_back(*nIt); } - } else { + } + else { } } } @@ -4653,11 +6103,13 @@ void SMESH_MeshEditor::UpdateVolumes (const SMDS_MeshNode* theBetweenNode if (elem->IsPoly()) { aMesh->ChangePolyhedronNodes(elem, poly_nodes, quantities); - } else { + } + else { int aShapeId = FindShape( elem ); SMDS_MeshElement* newElem = aMesh->AddPolyhedralVolume(poly_nodes, quantities); + myLastCreatedElems.Append(newElem); if (aShapeId && newElem) aMesh->SetMeshElementOnShape(newElem, aShapeId); @@ -4666,19 +6118,350 @@ void SMESH_MeshEditor::UpdateVolumes (const SMDS_MeshNode* theBetweenNode } } +//======================================================================= +//function : ConvertElemToQuadratic +//purpose : +//======================================================================= +void SMESH_MeshEditor::ConvertElemToQuadratic(SMESHDS_SubMesh *theSm, + SMESH_MesherHelper* theHelper, + const bool theForce3d) +{ + if( !theSm ) return; + SMESHDS_Mesh* meshDS = GetMeshDS(); + SMDS_ElemIteratorPtr ElemItr = theSm->GetElements(); + while(ElemItr->more()) + { + const SMDS_MeshElement* elem = ElemItr->next(); + if( !elem ) continue; + + int id = elem->GetID(); + int nbNodes = elem->NbNodes(); + vector aNds (nbNodes); + + for(int i = 0; i < nbNodes; i++) + { + aNds[i] = elem->GetNode(i); + } + + SMDSAbs_ElementType aType = elem->GetType(); + const SMDS_MeshElement* NewElem = 0; + + switch( aType ) + { + case SMDSAbs_Edge : + { + meshDS->RemoveFreeElement(elem, theSm); + NewElem = theHelper->AddQuadraticEdge(aNds[0], aNds[1], id, theForce3d); + break; + } + case SMDSAbs_Face : + { + if(elem->IsQuadratic()) continue; + + meshDS->RemoveFreeElement(elem, theSm); + switch(nbNodes) + { + case 3: + NewElem = theHelper->AddFace(aNds[0], aNds[1], aNds[2], id, theForce3d); + break; + case 4: + NewElem = theHelper->AddFace(aNds[0], aNds[1], aNds[2], aNds[3], id, theForce3d); + break; + default: + continue; + } + break; + } + case SMDSAbs_Volume : + { + if( elem->IsQuadratic() ) continue; + + meshDS->RemoveFreeElement(elem, theSm); + switch(nbNodes) + { + case 4: + NewElem = theHelper->AddVolume(aNds[0], aNds[1], aNds[2], aNds[3], id, true); + break; + case 6: + NewElem = theHelper->AddVolume(aNds[0], aNds[1], aNds[2], aNds[3], aNds[4], aNds[5], id, true); + break; + case 8: + NewElem = theHelper->AddVolume(aNds[0], aNds[1], aNds[2], aNds[3], + aNds[4], aNds[5], aNds[6], aNds[7], id, true); + break; + default: + continue; + } + break; + } + default : + continue; + } + if( NewElem ) + { + AddToSameGroups( NewElem, elem, meshDS); + theSm->AddElement( NewElem ); + } + } +} + +//======================================================================= +//function : ConvertToQuadratic +//purpose : +//======================================================================= +void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d) +{ + SMESHDS_Mesh* meshDS = GetMeshDS(); + + SMESH_MesherHelper* aHelper = new SMESH_MesherHelper(*myMesh); + aHelper->SetKeyIsQuadratic( true ); + const TopoDS_Shape& aShape = meshDS->ShapeToMesh(); + + if ( !aShape.IsNull() && GetMesh()->GetSubMeshContaining(aShape) ) + { + SMESH_subMesh *aSubMesh = GetMesh()->GetSubMeshContaining(aShape); + + const map < int, SMESH_subMesh * >& aMapSM = aSubMesh->DependsOn(); + map < int, SMESH_subMesh * >::const_iterator itsub; + for (itsub = aMapSM.begin(); itsub != aMapSM.end(); itsub++) + { + SMESHDS_SubMesh *sm = ((*itsub).second)->GetSubMeshDS(); + aHelper->SetSubShape( (*itsub).second->GetSubShape() ); + ConvertElemToQuadratic(sm, aHelper, theForce3d); + } + aHelper->SetSubShape( aSubMesh->GetSubShape() ); + ConvertElemToQuadratic(aSubMesh->GetSubMeshDS(), aHelper, theForce3d); + } + else + { + SMDS_EdgeIteratorPtr aEdgeItr = meshDS->edgesIterator(); + while(aEdgeItr->more()) + { + const SMDS_MeshEdge* edge = aEdgeItr->next(); + if(edge) + { + int id = edge->GetID(); + const SMDS_MeshNode* n1 = edge->GetNode(0); + const SMDS_MeshNode* n2 = edge->GetNode(1); + + RemoveElemFromGroups (edge, meshDS); + meshDS->SMDS_Mesh::RemoveFreeElement(edge); + + const SMDS_QuadraticEdge* NewEdge = aHelper->AddQuadraticEdge(n1, n2, id, theForce3d); + AddToSameGroups(NewEdge, edge, meshDS); + } + } + SMDS_FaceIteratorPtr aFaceItr = meshDS->facesIterator(); + while(aFaceItr->more()) + { + const SMDS_MeshFace* face = aFaceItr->next(); + if(!face || face->IsQuadratic() ) continue; + + int id = face->GetID(); + int nbNodes = face->NbNodes(); + vector aNds (nbNodes); + + for(int i = 0; i < nbNodes; i++) + { + aNds[i] = face->GetNode(i); + } + + RemoveElemFromGroups (face, meshDS); + meshDS->SMDS_Mesh::RemoveFreeElement(face); + + SMDS_MeshFace * NewFace = 0; + switch(nbNodes) + { + case 3: + NewFace = aHelper->AddFace(aNds[0], aNds[1], aNds[2], id, theForce3d); + break; + case 4: + NewFace = aHelper->AddFace(aNds[0], aNds[1], aNds[2], aNds[3], id, theForce3d); + break; + default: + continue; + } + AddToSameGroups(NewFace, face, meshDS); + } + SMDS_VolumeIteratorPtr aVolumeItr = meshDS->volumesIterator(); + while(aVolumeItr->more()) + { + const SMDS_MeshVolume* volume = aVolumeItr->next(); + if(!volume || volume->IsQuadratic() ) continue; + + int id = volume->GetID(); + int nbNodes = volume->NbNodes(); + vector aNds (nbNodes); + + for(int i = 0; i < nbNodes; i++) + { + aNds[i] = volume->GetNode(i); + } + + RemoveElemFromGroups (volume, meshDS); + meshDS->SMDS_Mesh::RemoveFreeElement(volume); + + SMDS_MeshVolume * NewVolume = 0; + switch(nbNodes) + { + case 4: + NewVolume = aHelper->AddVolume(aNds[0], aNds[1], aNds[2], + aNds[3], id, true ); + break; + case 6: + NewVolume = aHelper->AddVolume(aNds[0], aNds[1], aNds[2], + aNds[3], aNds[4], aNds[5], id, true); + break; + case 8: + NewVolume = aHelper->AddVolume(aNds[0], aNds[1], aNds[2], aNds[3], + aNds[4], aNds[5], aNds[6], aNds[7], id, true); + break; + default: + continue; + } + AddToSameGroups(NewVolume, volume, meshDS); + } + } + delete aHelper; +} + +//======================================================================= +//function : RemoveQuadElem +//purpose : +//======================================================================= +void SMESH_MeshEditor::RemoveQuadElem(SMESHDS_SubMesh *theSm, + SMDS_ElemIteratorPtr theItr, + RemoveQuadNodeMap& theRemoveNodeMap) +{ + SMESHDS_Mesh* meshDS = GetMeshDS(); + while( theItr->more() ) + { + const SMDS_MeshElement* elem = theItr->next(); + if( elem ) + { + if( !elem->IsQuadratic() ) + continue; + + int id = elem->GetID(); + + int nbNodes = elem->NbNodes(), idx = 0; + vector aNds; + + for(int i = 0; i < nbNodes; i++) + { + const SMDS_MeshNode* n = elem->GetNode(i); + + if( elem->IsMediumNode( n ) ) + { + ItRemoveQuadNodeMap itRNM = theRemoveNodeMap.find( n ); + if( itRNM == theRemoveNodeMap.end() ) + { + theRemoveNodeMap.insert(RemoveQuadNodeMap::value_type( n,theSm )); + } + } + else + aNds.push_back( n ); + } + + idx = aNds.size(); + if( !idx ) continue; + SMDSAbs_ElementType aType = elem->GetType(); + + //remove old quadratic elements + meshDS->RemoveFreeElement( elem, theSm ); + + SMDS_MeshElement * NewElem = 0; + switch(aType) + { + case SMDSAbs_Edge: + NewElem = meshDS->AddEdgeWithID( aNds[0], aNds[1] ,id ); + break; + case SMDSAbs_Face: + if( idx==3 ) NewElem = meshDS->AddFaceWithID( aNds[0], + aNds[1], aNds[2], id ); + if( idx==4 ) NewElem = meshDS->AddFaceWithID( aNds[0], + aNds[1], aNds[2], aNds[3],id ); + break; + case SMDSAbs_Volume: + if( idx==4 ) NewElem = meshDS->AddVolumeWithID( aNds[0], + aNds[1], aNds[2], aNds[3], id ); + if( idx==6 ) NewElem = meshDS->AddVolumeWithID( aNds[0], + aNds[1], aNds[2], aNds[3], + aNds[4], aNds[5], id ); + if( idx==8 ) NewElem = meshDS->AddVolumeWithID(aNds[0], + aNds[1], aNds[2], aNds[3], + aNds[4], aNds[5], aNds[6], + aNds[7] ,id ); + break; + default: + break; + } + + AddToSameGroups(NewElem, elem, meshDS); + if( theSm ) + theSm->AddElement( NewElem ); + } + } +} +//======================================================================= +//function : ConvertFromQuadratic +//purpose : +//======================================================================= +bool SMESH_MeshEditor::ConvertFromQuadratic() +{ + SMESHDS_Mesh* meshDS = GetMeshDS(); + RemoveQuadNodeMap aRemoveNodeMap; + + const TopoDS_Shape& aShape = meshDS->ShapeToMesh(); + + if ( !aShape.IsNull() && GetMesh()->GetSubMeshContaining(aShape) ) + { + SMESH_subMesh *aSubMesh = GetMesh()->GetSubMeshContaining(aShape); + + const map < int, SMESH_subMesh * >& aMapSM = aSubMesh->DependsOn(); + map < int, SMESH_subMesh * >::const_iterator itsub; + for (itsub = aMapSM.begin(); itsub != aMapSM.end(); itsub++) + { + SMESHDS_SubMesh *sm = ((*itsub).second)->GetSubMeshDS(); + if( sm ) + RemoveQuadElem( sm, sm->GetElements(), aRemoveNodeMap ); + } + SMESHDS_SubMesh *Sm = aSubMesh->GetSubMeshDS(); + if( Sm ) + RemoveQuadElem( Sm, Sm->GetElements(), aRemoveNodeMap ); + } + else + { + SMESHDS_SubMesh *aSM = 0; + RemoveQuadElem( aSM, meshDS->elementsIterator(), aRemoveNodeMap ); + } + + //remove all quadratic nodes + ItRemoveQuadNodeMap itRNM = aRemoveNodeMap.begin(); + for ( ; itRNM != aRemoveNodeMap.end(); itRNM++ ) + { + meshDS->RemoveFreeNode( (*itRNM).first, (*itRNM).second ); + } + + return true; +} + //======================================================================= //function : SewSideElements //purpose : //======================================================================= SMESH_MeshEditor::Sew_Error - SMESH_MeshEditor::SewSideElements (set& theSide1, - set& theSide2, + SMESH_MeshEditor::SewSideElements (map& theSide1, + map& theSide2, const SMDS_MeshNode* theFirstNode1, const SMDS_MeshNode* theFirstNode2, const SMDS_MeshNode* theSecondNode1, const SMDS_MeshNode* theSecondNode2) { + myLastCreatedElems.Clear(); + myLastCreatedNodes.Clear(); + MESSAGE ("::::SewSideElements()"); if ( theSide1.size() != theSide2.size() ) return SEW_DIFF_NB_OF_ELEMENTS; @@ -4705,28 +6488,45 @@ SMESH_MeshEditor::Sew_Error set * faceSetPtr[] = { &faceSet1, &faceSet2 }; set * volSetPtr[] = { &volSet1, &volSet2 }; set * nodeSetPtr[] = { &nodeSet1, &nodeSet2 }; - set * elemSetPtr[] = { &theSide1, &theSide2 }; + map * elemSetPtr[] = { &theSide1, &theSide2 }; int iSide, iFace, iNode; for ( iSide = 0; iSide < 2; iSide++ ) { set * nodeSet = nodeSetPtr[ iSide ]; - set * elemSet = elemSetPtr[ iSide ]; + map * elemSet = elemSetPtr[ iSide ]; set * faceSet = faceSetPtr[ iSide ]; set * volSet = volSetPtr [ iSide ]; - set::iterator vIt, eIt; + set::iterator vIt; + map::iterator eIt; set::iterator nIt; - // ----------------------------------------------------------- - // 1a. Collect nodes of existing faces - // and build set of face nodes in order to detect missing - // faces corresponing to sides of volumes - // ----------------------------------------------------------- + // check that given nodes belong to given elements + const SMDS_MeshNode* n1 = ( iSide == 0 ) ? theFirstNode1 : theFirstNode2; + const SMDS_MeshNode* n2 = ( iSide == 0 ) ? theSecondNode1 : theSecondNode2; + int firstIndex = -1, secondIndex = -1; + for (eIt = elemSet->begin(); eIt != elemSet->end(); eIt++ ) { + const SMDS_MeshElement* elem = (*eIt).second; + if ( firstIndex < 0 ) firstIndex = elem->GetNodeIndex( n1 ); + if ( secondIndex < 0 ) secondIndex = elem->GetNodeIndex( n2 ); + if ( firstIndex > -1 && secondIndex > -1 ) break; + } + if ( firstIndex < 0 || secondIndex < 0 ) { + // we can simply return until temporary faces created + return (iSide == 0 ) ? SEW_BAD_SIDE1_NODES : SEW_BAD_SIDE2_NODES; + } + + // ----------------------------------------------------------- + // 1a. Collect nodes of existing faces + // and build set of face nodes in order to detect missing + // faces corresponing to sides of volumes + // ----------------------------------------------------------- set< set > setOfFaceNodeSet; // loop on the given element of a side for (eIt = elemSet->begin(); eIt != elemSet->end(); eIt++ ) { - const SMDS_MeshElement* elem = *eIt; + //const SMDS_MeshElement* elem = *eIt; + const SMDS_MeshElement* elem = (*eIt).second; if ( elem->GetType() == SMDSAbs_Face ) { faceSet->insert( elem ); set faceNodeSet; @@ -4775,8 +6575,7 @@ SMESH_MeshEditor::Sew_Error // face does not exist // ------------------------------------------------------------------------- - if ( !volSet->empty() ) - { + if ( !volSet->empty() ) { //int nodeSetSize = nodeSet->size(); // loop on given volumes @@ -4799,13 +6598,12 @@ SMESH_MeshEditor::Sew_Error // no such a face is given but it still can exist, check it if ( nbNodes == 3 ) { aFreeFace = aMesh->FindFace( fNodes[0],fNodes[1],fNodes[2] ); - } else if ( nbNodes == 4 ) { + } + else if ( nbNodes == 4 ) { aFreeFace = aMesh->FindFace( fNodes[0],fNodes[1],fNodes[2],fNodes[3] ); - } else { - vector poly_nodes (nbNodes); - for (int inode = 0; inode < nbNodes; inode++) { - poly_nodes[inode] = fNodes[inode]; - } + } + else { + vector poly_nodes ( fNodes, & fNodes[nbNodes]); aFreeFace = aMesh->FindFace(poly_nodes); } } @@ -4813,13 +6611,12 @@ SMESH_MeshEditor::Sew_Error // create a temporary face if ( nbNodes == 3 ) { aFreeFace = aTmpFacesMesh.AddFace( fNodes[0],fNodes[1],fNodes[2] ); - } else if ( nbNodes == 4 ) { + } + else if ( nbNodes == 4 ) { aFreeFace = aTmpFacesMesh.AddFace( fNodes[0],fNodes[1],fNodes[2],fNodes[3] ); - } else { - vector poly_nodes (nbNodes); - for (int inode = 0; inode < nbNodes; inode++) { - poly_nodes[inode] = fNodes[inode]; - } + } + else { + vector poly_nodes ( fNodes, & fNodes[nbNodes]); aFreeFace = aTmpFacesMesh.AddPolygonalFace(poly_nodes); } } @@ -4845,7 +6642,7 @@ SMESH_MeshEditor::Sew_Error const SMDS_MeshElement* e = invElemIt->next(); if ( faceSet->find( e ) != faceSet->end() ) nbSharedNodes++; - if ( elemSet->find( e ) != elemSet->end() ) + if ( elemSet->find( e->GetID() ) != elemSet->end() ) nbSharedNodes++; } } @@ -4862,10 +6659,10 @@ SMESH_MeshEditor::Sew_Error // choose a face most close to the bary center of the opposite side gp_XYZ aBC( 0., 0., 0. ); set addedNodes; - set * elemSet2 = elemSetPtr[ 1 - iSide ]; + map * elemSet2 = elemSetPtr[ 1 - iSide ]; eIt = elemSet2->begin(); for ( eIt = elemSet2->begin(); eIt != elemSet2->end(); eIt++ ) { - SMDS_ElemIteratorPtr nodeIt = (*eIt)->nodesIterator(); + SMDS_ElemIteratorPtr nodeIt = (*eIt).second->nodesIterator(); while ( nodeIt->more() ) { // loop on free face nodes const SMDS_MeshNode* n = static_cast( nodeIt->next() ); @@ -4967,8 +6764,7 @@ SMESH_MeshEditor::Sew_Error // loop on links in linkList; find faces by links and append links // of the found faces to linkList list< TPairOfNodes >::iterator linkIt[] = { linkList[0].begin(), linkList[1].begin() } ; - for ( ; linkIt[0] != linkList[0].end(); linkIt[0]++, linkIt[1]++ ) - { + for ( ; linkIt[0] != linkList[0].end(); linkIt[0]++, linkIt[1]++ ) { TPairOfNodes link[] = { *linkIt[0], *linkIt[1] }; long linkID = aLinkID_Gen.GetLinkID( link[0].first, link[0].second ); if ( linkIdSet.find( linkID ) == linkIdSet.end() ) @@ -4980,8 +6776,12 @@ SMESH_MeshEditor::Sew_Error // --------------------------------------------------------------- const SMDS_MeshElement* face[] = { 0, 0 }; - const SMDS_MeshNode* faceNodes[ 2 ][ 5 ]; - const SMDS_MeshNode* notLinkNodes[ 2 ][ 2 ] = {{ 0, 0 },{ 0, 0 }} ; + //const SMDS_MeshNode* faceNodes[ 2 ][ 5 ]; + vector fnodes1(9); + vector fnodes2(9); + //const SMDS_MeshNode* notLinkNodes[ 2 ][ 2 ] = {{ 0, 0 },{ 0, 0 }} ; + vector notLinkNodes1(6); + vector notLinkNodes2(6); int iLinkNode[2][2]; for ( iSide = 0; iSide < 2; iSide++ ) { // loop on 2 sides const SMDS_MeshNode* n1 = link[iSide].first; @@ -5005,40 +6805,109 @@ SMESH_MeshEditor::Sew_Error faceSet->erase( f ); // get face nodes and find ones of a link iNode = 0; - SMDS_ElemIteratorPtr nIt = f->nodesIterator(); - while ( nIt->more() ) { - const SMDS_MeshNode* n = - static_cast( nIt->next() ); - if ( n == n1 ) - iLinkNode[ iSide ][ 0 ] = iNode; - else if ( n == n2 ) - iLinkNode[ iSide ][ 1 ] = iNode; - else if ( notLinkNodes[ iSide ][ 0 ] ) - notLinkNodes[ iSide ][ 1 ] = n; - else - notLinkNodes[ iSide ][ 0 ] = n; - faceNodes[ iSide ][ iNode++ ] = n; + int nbl = -1; + if(f->IsPoly()) { + if(iSide==0) { + fnodes1.resize(f->NbNodes()+1); + notLinkNodes1.resize(f->NbNodes()-2); + } + else { + fnodes2.resize(f->NbNodes()+1); + notLinkNodes2.resize(f->NbNodes()-2); + } + } + if(!f->IsQuadratic()) { + SMDS_ElemIteratorPtr nIt = f->nodesIterator(); + while ( nIt->more() ) { + const SMDS_MeshNode* n = + static_cast( nIt->next() ); + if ( n == n1 ) { + iLinkNode[ iSide ][ 0 ] = iNode; + } + else if ( n == n2 ) { + iLinkNode[ iSide ][ 1 ] = iNode; + } + //else if ( notLinkNodes[ iSide ][ 0 ] ) + // notLinkNodes[ iSide ][ 1 ] = n; + //else + // notLinkNodes[ iSide ][ 0 ] = n; + else { + nbl++; + if(iSide==0) + notLinkNodes1[nbl] = n; + //notLinkNodes1.push_back(n); + else + notLinkNodes2[nbl] = n; + //notLinkNodes2.push_back(n); + } + //faceNodes[ iSide ][ iNode++ ] = n; + if(iSide==0) { + fnodes1[iNode++] = n; + } + else { + fnodes2[iNode++] = n; + } + } + } + else { // f->IsQuadratic() + const SMDS_QuadraticFaceOfNodes* F = + static_cast(f); + // use special nodes iterator + SMDS_NodeIteratorPtr anIter = F->interlacedNodesIterator(); + while ( anIter->more() ) { + const SMDS_MeshNode* n = + static_cast( anIter->next() ); + if ( n == n1 ) { + iLinkNode[ iSide ][ 0 ] = iNode; + } + else if ( n == n2 ) { + iLinkNode[ iSide ][ 1 ] = iNode; + } + else { + nbl++; + if(iSide==0) { + notLinkNodes1[nbl] = n; + } + else { + notLinkNodes2[nbl] = n; + } + } + if(iSide==0) { + fnodes1[iNode++] = n; + } + else { + fnodes2[iNode++] = n; + } + } + } + //faceNodes[ iSide ][ iNode ] = faceNodes[ iSide ][ 0 ]; + if(iSide==0) { + fnodes1[iNode] = fnodes1[0]; + } + else { + fnodes2[iNode] = fnodes1[0]; } - faceNodes[ iSide ][ iNode ] = faceNodes[ iSide ][ 0 ]; } } } } + // check similarity of elements of the sides if (aResult == SEW_OK && ( face[0] && !face[1] ) || ( !face[0] && face[1] )) { MESSAGE("Correspondent face not found on side " << ( face[0] ? 1 : 0 )); - if ( nReplaceMap.size() == 2 ) // faces on input nodes not found + if ( nReplaceMap.size() == 2 ) { // faces on input nodes not found aResult = ( face[0] ? SEW_BAD_SIDE2_NODES : SEW_BAD_SIDE1_NODES ); - else + } + else { aResult = SEW_TOPO_DIFF_SETS_OF_ELEMENTS; + } break; // do not return because it s necessary to remove tmp faces } // set nodes to merge // ------------------- - if ( face[0] && face[1] ) - { + if ( face[0] && face[1] ) { int nbNodes = face[0]->NbNodes(); if ( nbNodes != face[1]->NbNodes() ) { MESSAGE("Diff nb of face nodes"); @@ -5046,9 +6915,12 @@ SMESH_MeshEditor::Sew_Error break; // do not return because it s necessary to remove tmp faces } bool reverse[] = { false, false }; // order of notLinkNodes of quadrangle - if ( nbNodes == 3 ) + if ( nbNodes == 3 ) { + //nReplaceMap.insert( TNodeNodeMap::value_type + // ( notLinkNodes[0][0], notLinkNodes[1][0] )); nReplaceMap.insert( TNodeNodeMap::value_type - ( notLinkNodes[0][0], notLinkNodes[1][0] )); + ( notLinkNodes1[0], notLinkNodes2[0] )); + } else { for ( iSide = 0; iSide < 2; iSide++ ) { // loop on 2 sides // analyse link orientation in faces @@ -5062,34 +6934,44 @@ SMESH_MeshEditor::Sew_Error reverse[ iSide ] = !reverse[ iSide ]; } if ( reverse[0] == reverse[1] ) { - nReplaceMap.insert( TNodeNodeMap::value_type - ( notLinkNodes[0][0], notLinkNodes[1][0] )); - nReplaceMap.insert( TNodeNodeMap::value_type - ( notLinkNodes[0][1], notLinkNodes[1][1] )); + //nReplaceMap.insert( TNodeNodeMap::value_type + // ( notLinkNodes[0][0], notLinkNodes[1][0] )); + //nReplaceMap.insert( TNodeNodeMap::value_type + // ( notLinkNodes[0][1], notLinkNodes[1][1] )); + for(int nn=0; nn::iterator, bool > iter_isnew = linkIdSet.insert( linkID ); if ( !iter_isnew.second ) { // already in a set: no need to process linkIdSet.erase( iter_isnew.first ); } else // new in set == encountered for the first time: add { - const SMDS_MeshNode* n1 = nodes[ iNode ]; - const SMDS_MeshNode* n2 = nodes[ iNode + 1]; + //const SMDS_MeshNode* n1 = nodes[ iNode ]; + //const SMDS_MeshNode* n2 = nodes[ iNode + 1]; + const SMDS_MeshNode* n1 = fnodes1[ iNode ]; + const SMDS_MeshNode* n2 = fnodes1[ iNode + 1]; linkList[0].push_back ( TPairOfNodes( n1, n2 )); linkList[1].push_back ( TPairOfNodes( nReplaceMap[n1], nReplaceMap[n2] )); } @@ -5121,8 +7003,7 @@ SMESH_MeshEditor::Sew_Error // loop on nodes replacement map TNodeNodeMap::iterator nReplaceMapIt = nReplaceMap.begin(), nnIt; for ( ; nReplaceMapIt != nReplaceMap.end(); nReplaceMapIt++ ) - if ( (*nReplaceMapIt).first != (*nReplaceMapIt).second ) - { + if ( (*nReplaceMapIt).first != (*nReplaceMapIt).second ) { const SMDS_MeshNode* nToRemove = (*nReplaceMapIt).first; nodeIDsToRemove.push_back( nToRemove->GetID() ); // loop on elements sharing nToRemove @@ -5131,7 +7012,7 @@ SMESH_MeshEditor::Sew_Error const SMDS_MeshElement* e = invElemIt->next(); // get a new suite of nodes: make replacement int nbReplaced = 0, i = 0, nbNodes = e->NbNodes(); - const SMDS_MeshNode* nodes[ 8 ]; + vector< const SMDS_MeshNode*> nodes( nbNodes ); SMDS_ElemIteratorPtr nIt = e->nodesIterator(); while ( nIt->more() ) { const SMDS_MeshNode* n = @@ -5147,9 +7028,9 @@ SMESH_MeshEditor::Sew_Error // elemIDsToRemove.push_back( e->GetID() ); // else if ( nbReplaced ) - aMesh->ChangeElementNodes( e, nodes, nbNodes ); + aMesh->ChangeElementNodes( e, & nodes[0], nbNodes ); } - } + } Remove( nodeIDsToRemove, true ); diff --git a/src/SMESH/SMESH_MeshEditor.hxx b/src/SMESH/SMESH_MeshEditor.hxx index 9dfaf0af6..3c3c9568b 100644 --- a/src/SMESH/SMESH_MeshEditor.hxx +++ b/src/SMESH/SMESH_MeshEditor.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -35,8 +35,10 @@ #include "SMESH_Mesh.hxx" #include "SMESH_Controls.hxx" #include "SMESH_SequenceOfNode.hxx" +#include "SMESH_SequenceOfElemPtr.hxx" #include "gp_Dir.hxx" #include "TColStd_HSequenceOfReal.hxx" +#include "SMESH_MesherHelper.hxx" #include #include @@ -44,6 +46,9 @@ typedef map > TElemOfElemListMap; +typedef map RemoveQuadNodeMap; +typedef map::iterator ItRemoveQuadNodeMap; + class SMDS_MeshElement; class SMDS_MeshFace; class SMDS_MeshNode; @@ -90,7 +95,7 @@ class SMESH_EXPORT SMESH_MeshEditor { * is still performed; theMaxAngle is mesured in radians. * \retval bool - Success or not. */ - bool TriToQuad (std::set & theElems, + bool TriToQuad (std::map & theElems, SMESH::Controls::NumericalFunctorPtr theCriterion, const double theMaxAngle); @@ -100,7 +105,7 @@ class SMESH_EXPORT SMESH_MeshEditor { * \param theCriterion - Is used to choose a diagonal for splitting. * \retval bool - Success or not. */ - bool QuadToTri (std::set & theElems, + bool QuadToTri (std::map & theElems, SMESH::Controls::NumericalFunctorPtr theCriterion); /*! @@ -109,7 +114,7 @@ class SMESH_EXPORT SMESH_MeshEditor { * \param the13Diag - Is used to choose a diagonal for splitting. * \retval bool - Success or not. */ - bool QuadToTri (std::set & theElems, + bool QuadToTri (std::map & theElems, const bool the13Diag); /*! @@ -124,7 +129,7 @@ class SMESH_EXPORT SMESH_MeshEditor { enum SmoothMethod { LAPLACIAN = 0, CENTROIDAL }; - void Smooth (std::set & theElements, + void Smooth (std::map & theElements, std::set & theFixedNodes, const SmoothMethod theSmoothMethod, const int theNbIterations, @@ -140,7 +145,7 @@ class SMESH_EXPORT SMESH_MeshEditor { // on geometrical faces - void RotationSweep (std::set & theElements, + void RotationSweep (std::map & theElements, const gp_Ax1& theAxis, const double theAngle, const int theNbSteps, @@ -190,7 +195,7 @@ class SMESH_EXPORT SMESH_MeshEditor { * EXTRUSION_FLAG_SEW is set */ void ExtrusionSweep - (set & theElems, + (map & theElems, const gp_Vec& theStep, const int theNbSteps, TElemOfElemListMap& newElemsMap, @@ -207,7 +212,7 @@ class SMESH_EXPORT SMESH_MeshEditor { * EXTRUSION_FLAG_SEW is set * param theParams - special structure for manage of extrusion */ - void ExtrusionSweep (set & theElems, + void ExtrusionSweep (map & theElems, ExtrusParam& theParams, TElemOfElemListMap& newElemsMap, const int theFlags, @@ -227,7 +232,7 @@ class SMESH_EXPORT SMESH_MeshEditor { EXTR_CANT_GET_TANGENT }; - Extrusion_Error ExtrusionAlongTrack (std::set & theElements, + Extrusion_Error ExtrusionAlongTrack (std::map & theElements, SMESH_subMesh* theTrackPattern, const SMDS_MeshNode* theNodeStart, const bool theHasAngles, @@ -237,7 +242,7 @@ class SMESH_EXPORT SMESH_MeshEditor { // Generate new elements by extrusion of theElements along path given by theTrackPattern, // theHasAngles are the rotation angles, base point can be given by theRefPoint - void Transform (std::set & theElements, + void Transform (std::map & theElements, const gp_Trsf& theTrsf, const bool theCopy); // Move or copy theElements applying theTrsf to their nodes @@ -314,8 +319,8 @@ class SMESH_EXPORT SMESH_MeshEditor { // nodes are inserted. // Return false, if sewing failed. - Sew_Error SewSideElements (std::set& theSide1, - std::set& theSide2, + Sew_Error SewSideElements (std::map& theSide1, + std::map& theSide2, const SMDS_MeshNode* theFirstNode1ToMerge, const SMDS_MeshNode* theFirstNode2ToMerge, const SMDS_MeshNode* theSecondNode1ToMerge, @@ -341,6 +346,15 @@ class SMESH_EXPORT SMESH_MeshEditor { // insert theNodesToInsert into all volumes, containing link // theBetweenNode1 - theBetweenNode2, between theBetweenNode1 and theBetweenNode2. + void ConvertToQuadratic(const bool theForce3d); + //converts all mesh to quadratic one, deletes old elements, replacing + //them with quadratic ones with the same id. + + bool ConvertFromQuadratic(); + //converts all mesh from quadratic to ordinary ones, deletes old quadratic elements, replacing + //them with ordinary mesh elements with the same id. + + // static int SortQuadNodes (const SMDS_Mesh * theMesh, // int theNodeIds[] ); // // Set 4 nodes of a quadrangle face in a good order. @@ -357,28 +371,68 @@ class SMESH_EXPORT SMESH_MeshEditor { SMESHDS_Mesh * aMesh); // Add elemToAdd to the groups the elemInGroups belongs to + static void RemoveElemFromGroups (const SMDS_MeshElement* removeelem, + SMESHDS_Mesh * aMesh); + // remove elemToAdd from the groups + static const SMDS_MeshElement* FindFaceInSet(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2, - const std::set& elemSet, - const std::set& avoidSet); + const std::map& elemSet, + const std::map& avoidSet); // Return a face having linked nodes n1 and n2 and which is // - not in avoidSet, // - in elemSet provided that !elemSet.empty() + /*! + * \brief Returns true if given node is medium + * \param n - node to check + * \param typeToCheck - type of elements containing the node to ask about node status + * \retval bool - check result + */ + static bool IsMedium(const SMDS_MeshNode* node, + const SMDSAbs_ElementType typeToCheck = SMDSAbs_All); + int FindShape (const SMDS_MeshElement * theElem); // Return an index of the shape theElem is on // or zero if a shape not found - SMESH_Mesh * GetMesh() { return myMesh; } SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); } - private: + SMESH_SequenceOfElemPtr GetLastCreatedNodes() { return myLastCreatedNodes; } + + SMESH_SequenceOfElemPtr GetLastCreatedElems() { return myLastCreatedElems; } + +private: + + void ConvertElemToQuadratic(SMESHDS_SubMesh *theSm, + SMESH_MesherHelper* theHelper, + const bool theForce3d); + //Auxiliary function for "ConvertToQuadratic" is intended to convert + //elements contained in submesh to quadratic + + void RemoveQuadElem( SMESHDS_SubMesh *theSm, + SMDS_ElemIteratorPtr theItr, + RemoveQuadNodeMap& theRemoveNodeMap); + //Auxiliary function for "ConvertFromQuadratic" is intended to convert quadratic + //element to ordinary and for removing quadratic nodes + +private: SMESH_Mesh * myMesh; + /*! + * Sequence for keeping nodes created during last operation + */ + SMESH_SequenceOfElemPtr myLastCreatedNodes; + + /*! + * Sequence for keeping elements created during last operation + */ + SMESH_SequenceOfElemPtr myLastCreatedElems; + }; #endif diff --git a/src/SMESH/SMESH_MesherHelper.hxx b/src/SMESH/SMESH_MesherHelper.hxx index 4ae2101ec..a94c23641 100644 --- a/src/SMESH/SMESH_MesherHelper.hxx +++ b/src/SMESH/SMESH_MesherHelper.hxx @@ -26,6 +26,8 @@ #ifndef SMESH_MesherHelper_HeaderFile #define SMESH_MesherHelper_HeaderFile +#include "SMESH_SMESH.hxx" + #include #include #include @@ -48,7 +50,7 @@ typedef map::iterator ItNLinkNode; * is called. */ -class SMESH_MesherHelper +class SMESH_EXPORT SMESH_MesherHelper { public: // ---------- PUBLIC METHODS ---------- diff --git a/src/SMESH/SMESH_Pattern.cxx b/src/SMESH/SMESH_Pattern.cxx index 493799d35..61b0fa841 100644 --- a/src/SMESH/SMESH_Pattern.cxx +++ b/src/SMESH/SMESH_Pattern.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // File : SMESH_Pattern.hxx // Created : Mon Aug 2 10:30:00 2004 @@ -509,34 +509,53 @@ static gp_XY project (const SMDS_MeshNode* theNode, } //======================================================================= -//function : isMeshBoundToShape -//purpose : return true if all 2d elements are bound to shape +//function : areNodesBound +//purpose : true if all nodes of faces are bound to shapes //======================================================================= -static bool isMeshBoundToShape(SMESH_Mesh* theMesh) +template bool areNodesBound( TFaceIterator & faceItr ) { - // check faces binding - SMESHDS_Mesh * aMeshDS = theMesh->GetMeshDS(); - SMESHDS_SubMesh * aMainSubMesh = aMeshDS->MeshElements( aMeshDS->ShapeToMesh() ); - if ( aMeshDS->NbFaces() != aMainSubMesh->NbElements() ) - return false; - - // check face nodes binding - SMDS_FaceIteratorPtr fIt = aMeshDS->facesIterator(); - while ( fIt->more() ) + while ( faceItr->more() ) { - SMDS_ElemIteratorPtr nIt = fIt->next()->nodesIterator(); + SMDS_ElemIteratorPtr nIt = faceItr->next()->nodesIterator(); while ( nIt->more() ) { const SMDS_MeshNode* node = static_cast( nIt->next() ); SMDS_PositionPtr pos = node->GetPosition(); - if ( !pos || !pos->GetShapeId() ) + if ( !pos || !pos->GetShapeId() ) { return false; + } } } return true; } +//======================================================================= +//function : isMeshBoundToShape +//purpose : return true if all 2d elements are bound to shape +// if aFaceSubmesh != NULL, then check faces bound to it +// else check all faces in aMeshDS +//======================================================================= + +static bool isMeshBoundToShape(SMESHDS_Mesh * aMeshDS, + SMESHDS_SubMesh * aFaceSubmesh, + const bool isMainShape) +{ + if ( isMainShape ) { + // check that all faces are bound to aFaceSubmesh + if ( aMeshDS->NbFaces() != aFaceSubmesh->NbElements() ) + return false; + } + + // check face nodes binding + if ( aFaceSubmesh ) { + SMDS_ElemIteratorPtr fIt = aFaceSubmesh->GetElements(); + return areNodesBound( fIt ); + } + SMDS_FaceIteratorPtr fIt = aMeshDS->facesIterator(); + return areNodesBound( fIt ); +} + //======================================================================= //function : Load //purpose : Create a pattern from the mesh built on . @@ -573,32 +592,53 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, for ( ; elIt != eList.end() ; elIt++ ) if ( BRep_Tool::IsClosed( *elIt , face )) return setErrorCode( ERR_LOADF_CLOSED_FACE ); - + + // check that requested or needed projection is possible + bool isMainShape = theMesh->IsMainShape( face ); + bool needProject = !isMeshBoundToShape( aMeshDS, fSubMesh, isMainShape ); + bool canProject = ( nbElems ? true : isMainShape ); + + if ( ( theProject || needProject ) && !canProject ) + return setErrorCode( ERR_LOADF_CANT_PROJECT ); Extrema_GenExtPS projector; GeomAdaptor_Surface aSurface( BRep_Tool::Surface( face )); - if ( theProject || nbElems == 0 ) + if ( theProject || needProject ) projector.Initialize( aSurface, 20,20, 1e-5,1e-5 ); int iPoint = 0; TNodePointIDMap nodePointIDMap; - if ( nbElems == 0 || (theProject && - theMesh->IsMainShape( face ) && - !isMeshBoundToShape( theMesh ))) + if ( needProject ) { - MESSAGE("Project the whole mesh"); + MESSAGE("Project the submesh"); // --------------------------------------------------------------- - // The case where the whole mesh is projected to theFace + // The case where the submesh is projected to theFace // --------------------------------------------------------------- - // put nodes of all faces in the nodePointIDMap and fill myElemPointIDs - SMDS_FaceIteratorPtr fIt = aMeshDS->facesIterator(); - while ( fIt->more() ) + // get all faces + list< const SMDS_MeshElement* > faces; + if ( nbElems > 0 ) { + SMDS_ElemIteratorPtr fIt = fSubMesh->GetElements(); + while ( fIt->more() ) { + const SMDS_MeshElement* f = fIt->next(); + if ( f && f->GetType() == SMDSAbs_Face ) + faces.push_back( f ); + } + } + else { + SMDS_FaceIteratorPtr fIt = aMeshDS->facesIterator(); + while ( fIt->more() ) + faces.push_back( fIt->next() ); + } + + // put nodes of all faces into the nodePointIDMap and fill myElemPointIDs + list< const SMDS_MeshElement* >::iterator fIt = faces.begin(); + for ( ; fIt != faces.end(); ++fIt ) { myElemPointIDs.push_back( TElemDef() ); TElemDef& elemPoints = myElemPointIDs.back(); - SMDS_ElemIteratorPtr nIt = fIt->next()->nodesIterator(); + SMDS_ElemIteratorPtr nIt = (*fIt)->nodesIterator(); while ( nIt->more() ) { const SMDS_MeshElement* node = nIt->next(); @@ -837,7 +877,21 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, double dU = maxU - minU, dV = maxV - minV; if ( dU <= DBL_MIN || dV <= DBL_MIN ) { Clear(); - return setErrorCode( ERR_LOADF_NARROW_FACE ); + bndBox.SetVoid(); + // define where is the problem, in the face or in the mesh + TopExp_Explorer vExp( face, TopAbs_VERTEX ); + for ( ; vExp.More(); vExp.Next() ) { + gp_Pnt2d uv = BRep_Tool::Parameters( TopoDS::Vertex( vExp.Current() ), face ); + bndBox.Add( uv ); + } + bndBox.Get( minU, minV, maxU, maxV ); + dU = maxU - minU, dV = maxV - minV; + if ( dU <= DBL_MIN || dV <= DBL_MIN ) + // face problem + return setErrorCode( ERR_LOADF_NARROW_FACE ); + else + // mesh is projected onto a line, e.g. + return setErrorCode( ERR_LOADF_CANT_PROJECT ); } double ratio = dU / dV, maxratio = 3, scale; int iCoord = 0; @@ -3189,8 +3243,13 @@ void SMESH_Pattern:: myPolyElems.reserve( myIdsOnBoundary.size() ); // make a set of refined elements - set< const SMDS_MeshElement* > avoidSet, elemSet; - avoidSet.insert( myElements.begin(), myElements.end() ); + map avoidSet, elemSet; + std::vector::iterator itv = myElements.begin(); + for(; itv!=myElements.end(); itv++) { + const SMDS_MeshElement* el = (*itv); + avoidSet.insert( make_pair(el->GetID(),el) ); + } + //avoidSet.insert( myElements.begin(), myElements.end() ); map< TNodeSet, list< list< int > > >::iterator indListIt, nn_IdList; @@ -3220,7 +3279,7 @@ void SMESH_Pattern:: SMESH_MeshEditor::FindFaceInSet( n1, n2, elemSet, avoidSet ); if ( face ) { - avoidSet.insert ( face ); + avoidSet.insert ( make_pair(face->GetID(),face) ); myPolyElems.push_back( face ); // some links of are split; @@ -3341,7 +3400,7 @@ void SMESH_Pattern:: while ( eIt->more() ) { const SMDS_MeshElement* elem = eIt->next(); - if ( !volTool.Set( elem ) || !avoidSet.insert( elem ).second ) + if ( !volTool.Set( elem ) || !avoidSet.insert( make_pair(elem->GetID(),elem) ).second ) continue; // skip faces or refined elements // add polyhedron definition myPolyhedronQuantities.push_back(vector ()); @@ -3493,6 +3552,40 @@ bool SMESH_Pattern:: return makePoly; } +//======================================================================= +//function : clearSubMesh +//purpose : +//======================================================================= + +static bool clearSubMesh( SMESH_Mesh* theMesh, + const TopoDS_Shape& theShape) +{ + bool removed = false; + if ( SMESH_subMesh * aSubMesh = theMesh->GetSubMeshContaining( theShape )) + { + if ( aSubMesh->GetSubMeshDS() ) { + removed = + aSubMesh->GetSubMeshDS()->NbElements() || aSubMesh->GetSubMeshDS()->NbNodes(); + aSubMesh->ComputeStateEngine( SMESH_subMesh::CLEAN ); + } + } + else { + SMESHDS_Mesh* aMeshDS = theMesh->GetMeshDS(); + if ( SMESHDS_SubMesh* aSubMeshDS = aMeshDS->MeshElements( theShape )) + { + SMDS_ElemIteratorPtr eIt = aSubMeshDS->GetElements(); + removed = eIt->more(); + while ( eIt->more() ) + aMeshDS->RemoveElement( eIt->next() ); + SMDS_NodeIteratorPtr nIt = aSubMeshDS->GetNodes(); + removed = removed || nIt->more(); + while ( nIt->more() ) + aMeshDS->RemoveNode( static_cast( nIt->next() )); + } + } + return removed; +} + //======================================================================= //function : clearMesh //purpose : clear mesh elements existing on myShape in theMesh @@ -3503,20 +3596,11 @@ void SMESH_Pattern::clearMesh(SMESH_Mesh* theMesh) const if ( !myShape.IsNull() ) { - if ( SMESH_subMesh * aSubMesh = theMesh->GetSubMesh/*Containing*/( myShape )) - { - aSubMesh->ComputeStateEngine( SMESH_subMesh::CLEANDEP ); - } - else { - SMESHDS_Mesh* aMeshDS = theMesh->GetMeshDS(); - if ( SMESHDS_SubMesh* aSubMeshDS = aMeshDS->MeshElements( myShape )) + if ( !clearSubMesh( theMesh, myShape ) && !myIs2D ) { // myShape is SHELL but volumes may be bound to SOLID + TopTools_ListIteratorOfListOfShape it( theMesh->GetAncestors( myShape )); + for (; it.More() && it.Value().ShapeType() == TopAbs_SOLID; it.Next()) { - SMDS_ElemIteratorPtr eIt = aSubMeshDS->GetElements(); - while ( eIt->more() ) - aMeshDS->RemoveElement( eIt->next() ); - SMDS_NodeIteratorPtr nIt = aSubMeshDS->GetNodes(); - while ( nIt->more() ) - aMeshDS->RemoveNode( static_cast( nIt->next() )); + clearSubMesh( theMesh, it.Value() ); } } } @@ -4010,6 +4094,8 @@ bool SMESH_Pattern::findBoundaryPoints() MESSAGE(" findBoundaryPoints() "); + myNbKeyPntInBoundary.clear(); + if ( myIs2D ) { set< TPoint* > pointsInElems; diff --git a/src/SMESH/SMESH_Pattern.hxx b/src/SMESH/SMESH_Pattern.hxx index 753e0237a..c74ffbe9f 100644 --- a/src/SMESH/SMESH_Pattern.hxx +++ b/src/SMESH/SMESH_Pattern.hxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // File : SMESH_Pattern.hxx // Created : Mon Aug 2 10:30:00 2004 @@ -159,6 +159,7 @@ class SMESH_EXPORT SMESH_Pattern { // Load(face) ERR_LOADF_NARROW_FACE, // too narrow face ERR_LOADF_CLOSED_FACE, // closed face + ERR_LOADF_CANT_PROJECT, // impossible to project nodes // Load(volume) ERR_LOADV_BAD_SHAPE, // volume is not a brick of 6 faces ERR_LOADV_COMPUTE_PARAMS, // cant compute point parameters diff --git a/src/SMESH/SMESH_SequenceOfElemPtr.hxx b/src/SMESH/SMESH_SequenceOfElemPtr.hxx index c31a483f0..64978e395 100644 --- a/src/SMESH/SMESH_SequenceOfElemPtr.hxx +++ b/src/SMESH/SMESH_SequenceOfElemPtr.hxx @@ -15,12 +15,11 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: SMESH_SequenceOfElemPtr.hxx // Created: 26.09.05 17:41:10 // Author: Sergey KUUL -// Copyright: Airbus Industries 2004 #ifndef SMESH_SequenceOfElemPtr_HeaderFile @@ -30,7 +29,6 @@ #include -//#include #include typedef const SMDS_MeshElement* SMDS_MeshElementPtr; diff --git a/src/SMESH/SMESH_SequenceOfNode.hxx b/src/SMESH/SMESH_SequenceOfNode.hxx index 35d6d17cb..d4edf9502 100644 --- a/src/SMESH/SMESH_SequenceOfNode.hxx +++ b/src/SMESH/SMESH_SequenceOfNode.hxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: SMESH_SequenceOfNode.hxx // Created: 11.11.05 10:00:04 diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index a5cb3c7ba..093d3c1ca 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -52,7 +52,8 @@ #include #endif -using namespace std; +#include +#include //============================================================================= /*! @@ -77,8 +78,8 @@ SMESH_subMesh::SMESH_subMesh(int Id, SMESH_Mesh * father, SMESHDS_Mesh * meshDS, } else { - _algoState = NO_ALGO; - _computeState = NOT_READY; + _algoState = NO_ALGO; + _computeState = NOT_READY; } } @@ -90,8 +91,8 @@ SMESH_subMesh::SMESH_subMesh(int Id, SMESH_Mesh * father, SMESHDS_Mesh * meshDS, SMESH_subMesh::~SMESH_subMesh() { - MESSAGE("SMESH_subMesh::~SMESH_subMesh"); - // **** + MESSAGE("SMESH_subMesh::~SMESH_subMesh"); + // **** } //============================================================================= @@ -102,8 +103,8 @@ SMESH_subMesh::~SMESH_subMesh() int SMESH_subMesh::GetId() const { - //MESSAGE("SMESH_subMesh::GetId"); - return _Id; + //MESSAGE("SMESH_subMesh::GetId"); + return _Id; } //============================================================================= @@ -114,19 +115,16 @@ int SMESH_subMesh::GetId() const SMESHDS_SubMesh * SMESH_subMesh::GetSubMeshDS() { - //MESSAGE("SMESH_subMesh::GetSubMeshDS"); - if (_subMeshDS==NULL) - { - //MESSAGE("subMesh pointer still null, trying to get it..."); - _subMeshDS = _meshDS->MeshElements(_subShape); // may be null ... - if (_subMeshDS==NULL) - { - MESSAGE("problem... subMesh still empty"); - //NRI ASSERT(0); - //NRI throw SALOME_Exception(LOCALIZED(subMesh still empty)); - } - } - return _subMeshDS; + // submesh appears in DS only when a mesher set nodes and elements on it + if (_subMeshDS==NULL) + { + _subMeshDS = _meshDS->MeshElements(_subShape); // may be null ... +// if (_subMeshDS==NULL) +// { +// MESSAGE("problem... subMesh still empty"); +// } + } + return _subMeshDS; } //============================================================================= @@ -151,7 +149,6 @@ SMESHDS_SubMesh* SMESH_subMesh::CreateSubMeshDS() SMESH_subMesh *SMESH_subMesh::GetFirstToCompute() { - //MESSAGE("SMESH_subMesh::GetFirstToCompute"); const map < int, SMESH_subMesh * >&subMeshes = DependsOn(); SMESH_subMesh *firstToCompute = 0; @@ -159,13 +156,10 @@ SMESH_subMesh *SMESH_subMesh::GetFirstToCompute() for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++) { SMESH_subMesh *sm = (*itsub).second; - // SCRUTE(sm->GetId()); - // SCRUTE(sm->GetComputeState()); bool readyToCompute = (sm->GetComputeState() == READY_TO_COMPUTE); if (readyToCompute) { firstToCompute = sm; - //SCRUTE(sm->GetId()); break; } } @@ -191,22 +185,30 @@ bool SMESH_subMesh::SubMeshesComputed() //MESSAGE("SMESH_subMesh::SubMeshesComputed"); const map < int, SMESH_subMesh * >&subMeshes = DependsOn(); + int myDim = SMESH_Gen::GetShapeDim( _subShape ); + int dimToCheck = myDim - 1; bool subMeshesComputed = true; map < int, SMESH_subMesh * >::const_iterator itsub; for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++) { SMESH_subMesh *sm = (*itsub).second; + const TopoDS_Shape & ss = sm->GetSubShape(); + // MSV 07.04.2006: restrict checking to myDim-1 only. Ex., there is no sense + // in checking of existence of edges if the algo needs only faces. Moreover, + // degenerated edges may have no submesh, as after computing NETGEN_2D. + int dim = SMESH_Gen::GetShapeDim( ss ); + if (dim < dimToCheck) + continue; SMESHDS_SubMesh * ds = sm->GetSubMeshDS(); // PAL10974. // There are some tricks with compute states, e.g. Penta_3D leaves // one face with READY_TO_COMPUTE state in order to be able to // recompute 3D when a locale triangle hypo changes (see PAL7428). // So we check if mesh is really present - //bool computeOk = (sm->GetComputeState() == COMPUTE_OK); - bool computeOk = ( ds && ( ds->GetNodes()->more() || ds->GetElements()->more() )); + bool computeOk = (sm->GetComputeState() == COMPUTE_OK || + (ds && ( ds->GetNodes()->more() || ds->GetElements()->more() ))); if (!computeOk) { - const TopoDS_Shape & ss = sm->GetSubShape(); int type = ss.ShapeType(); subMeshesComputed = false; @@ -424,20 +426,12 @@ void SMESH_subMesh::InsertDependence(const TopoDS_Shape aSubShape) int ordType = 9 - type; // 2 = Vertex, 8 = CompSolid int cle = aSubMesh->GetId(); cle += 10000000 * ordType; // sort map by ordType then index - if (_mapDepend.find(cle) == _mapDepend.end()) + if ( _mapDepend.find( cle ) == _mapDepend.end()) { _mapDepend[cle] = aSubMesh; - const map < int, SMESH_subMesh * >&subMap = aSubMesh->DependsOn(); - map < int, SMESH_subMesh * >::const_iterator im; - for (im = subMap.begin(); im != subMap.end(); im++) - { - int clesub = (*im).first; - SMESH_subMesh *sm = (*im).second; - if (_mapDepend.find(clesub) == _mapDepend.end()) - _mapDepend[clesub] = sm; - } + const map < int, SMESH_subMesh * > & subMap = aSubMesh->DependsOn(); + _mapDepend.insert( subMap.begin(), subMap.end() ); } - } //============================================================================= @@ -446,7 +440,7 @@ void SMESH_subMesh::InsertDependence(const TopoDS_Shape aSubShape) */ //============================================================================= -const TopoDS_Shape & SMESH_subMesh::GetSubShape() +const TopoDS_Shape & SMESH_subMesh::GetSubShape() const { //MESSAGE("SMESH_subMesh::GetSubShape"); return _subShape; @@ -484,20 +478,18 @@ bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis, return ( theHypothesis->GetShapeType() & (1<< theShapeType)); // hypothesis - int aShapeDim = 100; switch ( theShapeType ) { - case TopAbs_EDGE: aShapeDim = 1; break; - case TopAbs_FACE: aShapeDim = 2; break; - case TopAbs_SHELL:aShapeDim = 3; break; - case TopAbs_SOLID:aShapeDim = 3; break; -// case TopAbs_VERTEX: + case TopAbs_EDGE: + case TopAbs_FACE: + case TopAbs_SHELL: + case TopAbs_SOLID: + return SMESH_Gen::GetShapeDim( theShapeType ) == theHypothesis->GetDim(); // case TopAbs_WIRE: // case TopAbs_COMPSOLID: // case TopAbs_COMPOUND: - default: return false; + default:; } - - return ( theHypothesis->GetDim() == aShapeDim ); + return false; } //============================================================================= @@ -555,7 +547,7 @@ SMESH_Hypothesis::Hypothesis_Status if ( ! CanAddHypothesis( anHyp )) return SMESH_Hypothesis::HYP_BAD_DIM; - if ( GetSimilarAttached( _subShape, anHyp ) ) + if ( /*!anHyp->IsAuxiliary() &&*/ GetSimilarAttached( _subShape, anHyp ) ) return SMESH_Hypothesis::HYP_ALREADY_EXIST; if ( !_meshDS->AddHypothesis(_subShape, anHyp)) @@ -564,9 +556,9 @@ SMESH_Hypothesis::Hypothesis_Status // Serve Propagation of 1D hypothesis if (event == ADD_HYP) { bool isPropagationOk = true; - string hypName = anHyp->GetName(); + bool isPropagationHyp = ( strcmp( "Propagation", anHyp->GetName() ) == 0 ); - if (hypName == "Propagation") { + if ( isPropagationHyp ) { TopExp_Explorer exp (_subShape, TopAbs_EDGE); TopTools_MapOfShape aMap; for (; exp.More(); exp.Next()) { @@ -594,7 +586,11 @@ SMESH_Hypothesis::Hypothesis_Status } else { } - if (!isPropagationOk && ret < SMESH_Hypothesis::HYP_CONCURENT) { + if ( isPropagationOk ) { + if ( isPropagationHyp ) + return ret; // nothing more to do for "Propagation" hypothesis + } + else if ( ret < SMESH_Hypothesis::HYP_CONCURENT) { ret = SMESH_Hypothesis::HYP_CONCURENT; } } // Serve Propagation of 1D hypothesis @@ -613,7 +609,9 @@ SMESH_Hypothesis::Hypothesis_Status { bool isPropagationOk = true; SMESH_HypoFilter propagFilter( SMESH_HypoFilter::HasName( "Propagation" )); - if ( propagFilter.IsOk( anHyp, _subShape )) + bool isPropagationHyp = propagFilter.IsOk( anHyp, _subShape ); + + if ( isPropagationHyp ) { TopExp_Explorer exp (_subShape, TopAbs_EDGE); TopTools_MapOfShape aMap; @@ -635,10 +633,27 @@ SMESH_Hypothesis::Hypothesis_Status isPropagationOk = _father->RebuildPropagationChains(); } - if (!isPropagationOk && ret < SMESH_Hypothesis::HYP_CONCURENT) { + if ( isPropagationOk ) { + if ( isPropagationHyp ) + return ret; // nothing more to do for "Propagation" hypothesis + } + else if ( ret < SMESH_Hypothesis::HYP_CONCURENT) { ret = SMESH_Hypothesis::HYP_CONCURENT; } } // Serve Propagation of 1D hypothesis + else // event == REMOVE_ALGO + { + SMESH_Algo* algo = dynamic_cast (anHyp); + if (!algo->NeedDescretBoundary()) + { + // clean all mesh in the tree of the current submesh; + // we must perform it now because later + // we will have no information about the type of the removed algo + CleanDependants(); + ComputeStateEngine( CLEAN ); + CleanDependsOn(); + } + } } // ------------------ @@ -713,7 +728,7 @@ SMESH_Hypothesis::Hypothesis_Status SetAlgoState(HYP_OK); if (SMESH_Hypothesis::IsStatusFatal( ret )) _meshDS->RemoveHypothesis(_subShape, anHyp); - else if (!_father->IsUsedHypothesis( anHyp, _subShape )) + else if (!_father->IsUsedHypothesis( anHyp, this )) { _meshDS->RemoveHypothesis(_subShape, anHyp); ret = SMESH_Hypothesis::HYP_INCOMPATIBLE; @@ -803,7 +818,7 @@ SMESH_Hypothesis::Hypothesis_Status // ret should be fatal: anHyp was not added ret = SMESH_Hypothesis::HYP_INCOMPATIBLE; } - else if (!_father->IsUsedHypothesis( anHyp, _subShape )) + else if (!_father->IsUsedHypothesis( anHyp, this )) ret = SMESH_Hypothesis::HYP_INCOMPATIBLE; if (SMESH_Hypothesis::IsStatusFatal( ret )) @@ -867,7 +882,7 @@ SMESH_Hypothesis::Hypothesis_Status ASSERT(algo); if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) { - if (_father->IsUsedHypothesis( anHyp, _subShape )) // new Hyp + if (_father->IsUsedHypothesis( anHyp, this )) // new Hyp modifiedHyp = true; } else @@ -1001,9 +1016,7 @@ bool SMESH_subMesh::IsConform(const SMESH_Algo* theAlgo) void SMESH_subMesh::SetAlgoState(int state) { -// if (state != _oldAlgoState) -// int retc = ComputeStateEngine(MODIF_ALGO_STATE); - _algoState = state; + _algoState = state; } //============================================================================= @@ -1019,7 +1032,7 @@ SMESH_Hypothesis::Hypothesis_Status SMESH_Hypothesis::Hypothesis_Status ret = SMESH_Hypothesis::HYP_OK; //EAP: a wire (dim==1) should notify edges (dim==1) //EAP: int dim = SMESH_Gen::GetShapeDim(_subShape); - if (/*EAP:dim > 1*/ _subShape.ShapeType() < TopAbs_EDGE ) + if (_subShape.ShapeType() < TopAbs_EDGE ) // wire,face etc { const map < int, SMESH_subMesh * >&subMeshes = DependsOn(); @@ -1044,18 +1057,15 @@ SMESH_Hypothesis::Hypothesis_Status void SMESH_subMesh::CleanDependsOn() { - MESSAGE("SMESH_subMesh::CleanDependsOn"); - // **** parcourir les ancetres dans l'ordre de dépendance + //MESSAGE("SMESH_subMesh::CleanDependsOn"); - ComputeStateEngine(CLEAN); - - const map < int, SMESH_subMesh * >&dependson = DependsOn(); - map < int, SMESH_subMesh * >::const_iterator its; - for (its = dependson.begin(); its != dependson.end(); its++) - { - SMESH_subMesh *sm = (*its).second; - sm->ComputeStateEngine(CLEAN); - } + const map < int, SMESH_subMesh * >&dependson = DependsOn(); + map < int, SMESH_subMesh * >::const_iterator its; + for (its = dependson.begin(); its != dependson.end(); its++) + { + SMESH_subMesh *sm = (*its).second; + sm->ComputeStateEngine(CLEAN); + } } //============================================================================= @@ -1110,31 +1120,33 @@ void SMESH_subMesh::DumpAlgoState(bool isMain) } } -//============================================================================= +//================================================================================ /*! - * + * \brief Remove nodes and elements bound to submesh + * \param subMesh - submesh containing nodes and elements */ -//============================================================================= +//================================================================================ -static void removeSubMesh( SMESHDS_Mesh * meshDS, const TopoDS_Shape& subShape) +static void cleanSubMesh( SMESH_subMesh * subMesh ) { - SMESHDS_SubMesh * subMeshDS = meshDS->MeshElements(subShape); - if (subMeshDS!=NULL) - { - SMDS_ElemIteratorPtr ite=subMeshDS->GetElements(); - while(ite->more()) - { - const SMDS_MeshElement * elt = ite->next(); - //MESSAGE( " RM elt: "<GetID()<<" ( "<NbNodes()<<" )" ); - meshDS->RemoveElement(elt); - } + if (subMesh) { + if (SMESHDS_SubMesh * subMeshDS = subMesh->GetSubMeshDS()) { + SMESHDS_Mesh * meshDS = subMesh->GetFather()->GetMeshDS(); + SMDS_ElemIteratorPtr ite = subMeshDS->GetElements(); + while (ite->more()) { + const SMDS_MeshElement * elt = ite->next(); + //MESSAGE( " RM elt: "<GetID()<<" ( "<NbNodes()<<" )" ); + //meshDS->RemoveElement(elt); + meshDS->RemoveFreeElement(elt, subMeshDS); + } - SMDS_NodeIteratorPtr itn=subMeshDS->GetNodes(); - while(itn->more()) - { - const SMDS_MeshNode * node = itn->next(); - //MESSAGE( " RM node: "<GetID()); - meshDS->RemoveNode(node); + SMDS_NodeIteratorPtr itn = subMeshDS->GetNodes(); + while (itn->more()) { + const SMDS_MeshNode * node = itn->next(); + //MESSAGE( " RM node: "<GetID()); + //meshDS->RemoveNode(node); + meshDS->RemoveFreeNode(node, subMeshDS); + } } } } @@ -1174,21 +1186,21 @@ bool SMESH_subMesh::ComputeStateEngine(int event) case NOT_READY: switch (event) { - case MODIF_HYP: // nothing to do - break; + case MODIF_HYP: case MODIF_ALGO_STATE: - if (_algoState == HYP_OK) + algo = gen->GetAlgo((*_father), _subShape); + if (algo && !algo->NeedDescretBoundary()) + CleanDependsOn(); // clean sub-meshes with event CLEAN + if (event == MODIF_ALGO_STATE && _algoState == HYP_OK) { _computeState = READY_TO_COMPUTE; } break; - case COMPUTE: // nothing to do + case COMPUTE: // nothing to do break; case CLEAN: - RemoveSubMeshElementsAndNodes(); - break; - case CLEANDEP: CleanDependants(); + RemoveSubMeshElementsAndNodes(); break; case SUBMESH_COMPUTED: // nothing to do break; @@ -1212,11 +1224,14 @@ bool SMESH_subMesh::ComputeStateEngine(int event) case READY_TO_COMPUTE: switch (event) { - case MODIF_HYP: // nothing to do - break; + case MODIF_HYP: case MODIF_ALGO_STATE: - _computeState = NOT_READY; algo = gen->GetAlgo((*_father), _subShape); + if (algo && !algo->NeedDescretBoundary()) + CleanDependsOn(); // clean sub-meshes with event CLEAN + if (event == MODIF_HYP) + break; // nothing else to do when MODIF_HYP + _computeState = NOT_READY; if (algo) { ret = algo->CheckHypothesis((*_father), _subShape, hyp_status); @@ -1246,13 +1261,19 @@ bool SMESH_subMesh::ComputeStateEngine(int event) } // compute CleanDependants(); - //RemoveSubMeshElementsAndNodes(); - //removeSubMesh( _meshDS, _subShape ); - if (!algo->NeedDescretBoundary() && !algo->OnlyUnaryInput()) - ret = ApplyToCollection( algo, GetCollection( gen, algo ) ); - else - ret = algo->Compute((*_father), _subShape); - + RemoveSubMeshElementsAndNodes(); + { + try { + if (!algo->NeedDescretBoundary() && !algo->OnlyUnaryInput()) + ret = ApplyToCollection( algo, GetCollection( gen, algo ) ); + else + ret = algo->Compute((*_father), _subShape); + } + catch (Standard_Failure) { + MESSAGE( "Exception in algo->Compute() "); + ret = false; + } + } if (!ret) { MESSAGE("problem in algo execution: failed to compute"); @@ -1262,6 +1283,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event) #ifdef _DEBUG_ // Show vertices location of a failed shape + cout << algo->GetName() << " failed on shape with the following vertices:" << endl; TopTools_IndexedMapOfShape vMap; TopExp::MapShapes( _subShape, TopAbs_VERTEX, vMap ); for ( int iv = 1; iv <= vMap.Extent(); ++iv ) { @@ -1281,6 +1303,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event) } break; case CLEAN: + CleanDependants(); RemoveSubMeshElementsAndNodes(); _computeState = NOT_READY; algo = gen->GetAlgo((*_father), _subShape); @@ -1291,9 +1314,6 @@ bool SMESH_subMesh::ComputeStateEngine(int event) _computeState = READY_TO_COMPUTE; } break; - case CLEANDEP: - CleanDependants(); - break; case SUBMESH_COMPUTED: // nothing to do break; case SUBMESH_RESTORED: @@ -1320,20 +1340,16 @@ bool SMESH_subMesh::ComputeStateEngine(int event) switch (event) { case MODIF_HYP: - CleanDependants(); // recursive recall with event CLEANDEP - algo = gen->GetAlgo((*_father), _subShape); - if (algo && !algo->NeedDescretBoundary()) - CleanDependsOn(); // remove sub-mesh with event CLEANDEP - break; case MODIF_ALGO_STATE: - CleanDependants(); // recursive recall with event CLEANDEP + ComputeStateEngine( CLEAN ); algo = gen->GetAlgo((*_father), _subShape); if (algo && !algo->NeedDescretBoundary()) - CleanDependsOn(); // remove sub-mesh with event CLEANDEP + CleanDependsOn(); // clean sub-meshes with event CLEAN break; - case COMPUTE: // nothing to do + case COMPUTE: // nothing to do break; case CLEAN: + CleanDependants(); // clean sub-meshes, dependant on this one, with event CLEAN RemoveSubMeshElementsAndNodes(); _computeState = NOT_READY; algo = gen->GetAlgo((*_father), _subShape); @@ -1344,9 +1360,6 @@ bool SMESH_subMesh::ComputeStateEngine(int event) _computeState = READY_TO_COMPUTE; } break; - case CLEANDEP: - CleanDependants(); // recursive recall with event CLEANDEP - break; case SUBMESH_COMPUTED: // nothing to do break; case SUBMESH_RESTORED: @@ -1391,15 +1404,13 @@ bool SMESH_subMesh::ComputeStateEngine(int event) case COMPUTE: // nothing to do break; case CLEAN: + CleanDependants(); // submeshes dependent on me should be cleaned as well RemoveSubMeshElementsAndNodes(); if (_algoState == HYP_OK) _computeState = READY_TO_COMPUTE; else _computeState = NOT_READY; break; - case CLEANDEP: - CleanDependants(); - break; case SUBMESH_COMPUTED: // allow retry compute if (_algoState == HYP_OK) _computeState = READY_TO_COMPUTE; @@ -1535,19 +1546,22 @@ void SMESH_subMesh::UpdateDependantsState(const compute_event theEvent) void SMESH_subMesh::CleanDependants() { + int dimToClean = SMESH_Gen::GetShapeDim( _subShape ) + 1; + TopTools_ListIteratorOfListOfShape it( _father->GetAncestors( _subShape )); for (; it.More(); it.Next()) { const TopoDS_Shape& ancestor = it.Value(); - // PAL8021. do not go upper than SOLID, else ComputeStateEngine(CLEANDEP) - // will erase mesh on other shapes in a compound - if ( ancestor.ShapeType() >= TopAbs_SOLID ) { - SMESH_subMesh *aSubMesh = _father->GetSubMeshContaining(ancestor); - if (aSubMesh) - aSubMesh->ComputeStateEngine(CLEANDEP); + if ( SMESH_Gen::GetShapeDim( ancestor ) == dimToClean ) { + // PAL8021. do not go upper than SOLID, else ComputeStateEngine(CLEAN) + // will erase mesh on other shapes in a compound + if ( ancestor.ShapeType() >= TopAbs_SOLID ) { + SMESH_subMesh *aSubMesh = _father->GetSubMeshContaining(ancestor); + if (aSubMesh) + aSubMesh->ComputeStateEngine(CLEAN); + } } } - ComputeStateEngine(CLEAN); } //============================================================================= @@ -1560,22 +1574,23 @@ void SMESH_subMesh::RemoveSubMeshElementsAndNodes() { //SCRUTE(_subShape.ShapeType()); - removeSubMesh( _meshDS, _subShape ); + cleanSubMesh( this ); // algo may bind a submesh not to _subShape, eg 3D algo // sets nodes on SHELL while _subShape may be SOLID int dim = SMESH_Gen::GetShapeDim( _subShape ); int type = _subShape.ShapeType() + 1; - for ( ; type <= TopAbs_EDGE; type++) + for ( ; type <= TopAbs_EDGE; type++) { if ( dim == SMESH_Gen::GetShapeDim( (TopAbs_ShapeEnum) type )) { TopExp_Explorer exp( _subShape, (TopAbs_ShapeEnum) type ); for ( ; exp.More(); exp.Next() ) - removeSubMesh( _meshDS, exp.Current() ); + cleanSubMesh( _father->GetSubMeshContaining( exp.Current() )); } else break; + } } //======================================================================= @@ -1627,8 +1642,9 @@ TopoDS_Shape SMESH_subMesh::GetCollection(SMESH_Gen * theGen, SMESH_Algo* theAlg if ( mainShape.IsSame( _subShape )) return _subShape; + const bool ignoreAuxiliaryHyps = false; list aUsedHyp = - theAlgo->GetUsedHypothesis( *_father, _subShape ); // copy + theAlgo->GetUsedHypothesis( *_father, _subShape, ignoreAuxiliaryHyps ); // copy // put in a compound all shapes with the same hypothesis assigned // and a good ComputState @@ -1646,7 +1662,7 @@ TopoDS_Shape SMESH_subMesh::GetCollection(SMESH_Gen * theGen, SMESH_Algo* theAlg if (subMesh->GetComputeState() == READY_TO_COMPUTE && anAlgo == theAlgo && - anAlgo->GetUsedHypothesis( *_father, S ) == aUsedHyp) + anAlgo->GetUsedHypothesis( *_father, S, ignoreAuxiliaryHyps ) == aUsedHyp) { aBuilder.Add( aCompound, S ); } @@ -1657,26 +1673,31 @@ TopoDS_Shape SMESH_subMesh::GetCollection(SMESH_Gen * theGen, SMESH_Algo* theAlg //======================================================================= //function : GetSimilarAttached -//purpose : return nb of hypotheses attached to theShape. +//purpose : return a hypothesis attached to theShape. // If theHyp is provided, similar but not same hypotheses -// are countered; else only applicable ones having theHypType -// are countered +// is returned; else only applicable ones having theHypType +// is returned //======================================================================= const SMESH_Hypothesis* SMESH_subMesh::GetSimilarAttached(const TopoDS_Shape& theShape, const SMESH_Hypothesis * theHyp, const int theHypType) { - SMESH_HypoFilter filter; - filter.Init( SMESH_HypoFilter::HasType( theHyp ? theHyp->GetType() : theHypType )); + SMESH_HypoFilter hypoKind; + hypoKind.Init( hypoKind.HasType( theHyp ? theHyp->GetType() : theHypType )); if ( theHyp ) { - filter.And( SMESH_HypoFilter::HasDim( theHyp->GetDim() )); - filter.AndNot( SMESH_HypoFilter::Is( theHyp )); + hypoKind.And ( hypoKind.HasDim( theHyp->GetDim() )); + hypoKind.AndNot( hypoKind.Is( theHyp )); + if ( theHyp->IsAuxiliary() ) + hypoKind.And( hypoKind.HasName( theHyp->GetName() )); + else + hypoKind.AndNot( hypoKind.IsAuxiliary()); + } + else { + hypoKind.And( hypoKind.IsApplicableTo( theShape )); } - else - filter.And( SMESH_HypoFilter::IsApplicableTo( theShape )); - return _father->GetHypothesis( theShape, filter, false ); + return _father->GetHypothesis( theShape, hypoKind, false ); } //======================================================================= diff --git a/src/SMESH/SMESH_subMesh.hxx b/src/SMESH/SMESH_subMesh.hxx index 2bebf84d1..053389a50 100644 --- a/src/SMESH/SMESH_subMesh.hxx +++ b/src/SMESH/SMESH_subMesh.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -72,7 +72,7 @@ class SMESH_EXPORT SMESH_subMesh const map < int, SMESH_subMesh * >&DependsOn(); //const map < int, SMESH_subMesh * >&Dependants(); - const TopoDS_Shape & GetSubShape(); + const TopoDS_Shape & GetSubShape() const; // bool _vertexSet; // only for vertex subMesh, set to false for dim > 0 @@ -95,7 +95,7 @@ class SMESH_EXPORT SMESH_subMesh enum compute_event { MODIF_HYP, MODIF_ALGO_STATE, COMPUTE, - CLEAN, CLEANDEP, SUBMESH_COMPUTED, SUBMESH_RESTORED, + CLEAN, SUBMESH_COMPUTED, SUBMESH_RESTORED, MESH_ENTITY_REMOVED, CHECK_COMPUTE_STATE }; @@ -105,17 +105,13 @@ class SMESH_EXPORT SMESH_subMesh SMESH_Hypothesis::Hypothesis_Status SubMeshesAlgoStateEngine(int event, SMESH_Hypothesis * anHyp); - int GetAlgoState() { return _algoState; } + int GetAlgoState() const { return _algoState; } + int GetComputeState() const { return _computeState; }; void DumpAlgoState(bool isMain); bool ComputeStateEngine(int event); - int GetComputeState() - { - return _computeState; - }; - bool IsConform(const SMESH_Algo* theAlgo); // check if a conform mesh will be produced by the Algo diff --git a/src/SMESHClient/SMESH_Client.cxx b/src/SMESHClient/SMESH_Client.cxx index bd52bc042..135b0fa85 100644 --- a/src/SMESHClient/SMESH_Client.cxx +++ b/src/SMESHClient/SMESH_Client.cxx @@ -749,11 +749,11 @@ SMESH_Client::Update(bool theIsClear) int nbNodes = anIndexes[i++]; // nodes //ASSERT( nbNodes < 9 ); - const SMDS_MeshNode* aNodes[ nbNodes ]; + vector aNodes( nbNodes ); for ( int iNode = 0; iNode < nbNodes; iNode++ ) aNodes[ iNode ] = FindNode( mySMDSMesh, anIndexes[i++] ); // change - mySMDSMesh->ChangeElementNodes( elem, aNodes, nbNodes ); + mySMDSMesh->ChangeElementNodes( elem, &aNodes[0], nbNodes ); } break; diff --git a/src/SMESHClient/SMESH_Client.hxx b/src/SMESHClient/SMESH_Client.hxx index cc17cf88c..b33e8c898 100644 --- a/src/SMESHClient/SMESH_Client.hxx +++ b/src/SMESHClient/SMESH_Client.hxx @@ -32,10 +32,14 @@ #include CORBA_SERVER_HEADER(SMESH_Gen) #include CORBA_SERVER_HEADER(SMESH_Mesh) -#if defined WNT && defined WIN32 && defined SALOME_WNT_EXPORTS -#define SMESHCLIENT_WNT_EXPORT __declspec( dllexport ) +#ifdef WNT +# ifdef SMESHCLIENT_EXPORTS +# define SMESHCLIENT_EXPORT __declspec( dllexport ) +# else +# define SMESHCLIENT_EXPORT __declspec( dllimport ) +# endif #else -#define SMESHCLIENT_WNT_EXPORT +# define SMESHCLIENTEXPORT #endif class SMESHDS_Mesh; @@ -45,7 +49,7 @@ class SMDS_Mesh; //===================================================================== // SMESH_Client : class definition //===================================================================== -class SMESHCLIENT_WNT_EXPORT SMESH_Client +class SMESHCLIENT_EXPORT SMESH_Client { public: static diff --git a/src/SMESHDS/Makefile.in b/src/SMESHDS/Makefile.in index 8ed411f00..c1584c8e5 100644 --- a/src/SMESHDS/Makefile.in +++ b/src/SMESHDS/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -72,8 +72,8 @@ EXPORT_HEADERS= \ SMESHDS_DataMapOfShape.hxx # additionnal information to compil and link file -CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) -CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome +CPPFLAGS += $(OCC_INCLUDES) $(KERNEL_CXXFLAGS) $(BOOST_CPPFLAGS) +CXXFLAGS += $(OCC_CXXFLAGS) $(KERNEL_CXXFLAGS) LDFLAGS += $(OCC_KERNEL_LIBS) -lSMDS diff --git a/src/SMESHDS/SMESHDS_Command.cxx b/src/SMESHDS/SMESHDS_Command.cxx index b55b5af1c..8ce255c7f 100644 --- a/src/SMESHDS/SMESHDS_Command.cxx +++ b/src/SMESHDS/SMESHDS_Command.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -33,7 +33,7 @@ using namespace std; //======================================================================= -//function : +//function : Constructor //purpose : //======================================================================= SMESHDS_Command::SMESHDS_Command(const SMESHDS_CommandType aType):myType(aType), @@ -41,6 +41,14 @@ myNumber(0) { } +//======================================================================= +//function : Destructor +//purpose : +//======================================================================= +SMESHDS_Command::~SMESHDS_Command() +{ +} + //======================================================================= //function : //purpose : @@ -408,3 +416,199 @@ const list < double >&SMESHDS_Command::GetCoords() { return myReals; } + + +//******************************************************************** +//***** Methods for quadratic elements ****** +//******************************************************************** + +//======================================================================= +//function : AddEdge +//purpose : +//======================================================================= +void SMESHDS_Command::AddEdge(int NewEdgeID, int n1, int n2, int n12) +{ + if (!myType == SMESHDS_AddQuadEdge) { + MESSAGE("SMESHDS_Command::AddEdge : Bad Type"); + return; + } + myIntegers.push_back(NewEdgeID); + myIntegers.push_back(n1); + myIntegers.push_back(n2); + myIntegers.push_back(n12); + myNumber++; +} + +//======================================================================= +//function : AddFace +//purpose : +//======================================================================= +void SMESHDS_Command::AddFace(int NewFaceID, + int n1, int n2, int n3, + int n12, int n23, int n31) +{ + if (!myType == SMESHDS_AddQuadTriangle) { + MESSAGE("SMESHDS_Command::AddFace : Bad Type"); + return; + } + myIntegers.push_back(NewFaceID); + myIntegers.push_back(n1); + myIntegers.push_back(n2); + myIntegers.push_back(n3); + myIntegers.push_back(n12); + myIntegers.push_back(n23); + myIntegers.push_back(n31); + myNumber++; +} + +//======================================================================= +//function : AddFace +//purpose : +//======================================================================= +void SMESHDS_Command::AddFace(int NewFaceID, + int n1, int n2, int n3, int n4, + int n12, int n23, int n34, int n41) +{ + if (!myType == SMESHDS_AddQuadQuadrangle) { + MESSAGE("SMESHDS_Command::AddFace : Bad Type"); + return; + } + myIntegers.push_back(NewFaceID); + myIntegers.push_back(n1); + myIntegers.push_back(n2); + myIntegers.push_back(n3); + myIntegers.push_back(n4); + myIntegers.push_back(n12); + myIntegers.push_back(n23); + myIntegers.push_back(n34); + myIntegers.push_back(n41); + myNumber++; +} + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, + int n12, int n23, int n31, + int n14, int n24, int n34) +{ + if (!myType == SMESHDS_AddQuadTetrahedron) { + MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); + return; + } + myIntegers.push_back(NewVolID); + myIntegers.push_back(n1); + myIntegers.push_back(n2); + myIntegers.push_back(n3); + myIntegers.push_back(n4); + myIntegers.push_back(n12); + myIntegers.push_back(n23); + myIntegers.push_back(n31); + myIntegers.push_back(n14); + myIntegers.push_back(n24); + myIntegers.push_back(n34); + myNumber++; +} + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, + int n3, int n4, int n5, + int n12, int n23, int n34, int n41, + int n15, int n25, int n35, int n45) +{ + if (!myType == SMESHDS_AddQuadPyramid) { + MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); + return; + } + myIntegers.push_back(NewVolID); + myIntegers.push_back(n1); + myIntegers.push_back(n2); + myIntegers.push_back(n3); + myIntegers.push_back(n4); + myIntegers.push_back(n5); + myIntegers.push_back(n12); + myIntegers.push_back(n23); + myIntegers.push_back(n34); + myIntegers.push_back(n41); + myIntegers.push_back(n15); + myIntegers.push_back(n25); + myIntegers.push_back(n35); + myIntegers.push_back(n45); + myNumber++; +} + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, + int n3, int n4, int n5,int n6, + int n12, int n23, int n31, + int n45, int n56, int n64, + int n14, int n25, int n36) +{ + if (!myType == SMESHDS_AddQuadPentahedron) { + MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); + return; + } + myIntegers.push_back(NewVolID); + myIntegers.push_back(n1); + myIntegers.push_back(n2); + myIntegers.push_back(n3); + myIntegers.push_back(n4); + myIntegers.push_back(n5); + myIntegers.push_back(n6); + myIntegers.push_back(n12); + myIntegers.push_back(n23); + myIntegers.push_back(n31); + myIntegers.push_back(n45); + myIntegers.push_back(n56); + myIntegers.push_back(n64); + myIntegers.push_back(n14); + myIntegers.push_back(n25); + myIntegers.push_back(n36); + myNumber++; +} + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, + int n4, int n5, int n6, int n7, int n8, + int n12, int n23, int n34, int n41, + int n56, int n67, int n78, int n85, + int n15, int n26, int n37, int n48) +{ + if (!myType == SMESHDS_AddQuadHexahedron) { + MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); + return; + } + myIntegers.push_back(NewVolID); + myIntegers.push_back(n1); + myIntegers.push_back(n2); + myIntegers.push_back(n3); + myIntegers.push_back(n4); + myIntegers.push_back(n5); + myIntegers.push_back(n6); + myIntegers.push_back(n7); + myIntegers.push_back(n8); + myIntegers.push_back(n12); + myIntegers.push_back(n23); + myIntegers.push_back(n34); + myIntegers.push_back(n41); + myIntegers.push_back(n56); + myIntegers.push_back(n67); + myIntegers.push_back(n78); + myIntegers.push_back(n85); + myIntegers.push_back(n15); + myIntegers.push_back(n26); + myIntegers.push_back(n37); + myIntegers.push_back(n48); + myNumber++; +} + diff --git a/src/SMESHDS/SMESHDS_Command.hxx b/src/SMESHDS/SMESHDS_Command.hxx index 3439cfc1c..a48bc6fed 100644 --- a/src/SMESHDS/SMESHDS_Command.hxx +++ b/src/SMESHDS/SMESHDS_Command.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -56,6 +56,28 @@ class SMESHDS_EXPORT SMESHDS_Command void AddPolyhedralVolume (const int ElementID, std::vector nodes_ids, std::vector quantities); + // special methods for quadratic elements + void AddEdge(int NewEdgeID, int n1, int n2, int n12); + void AddFace(int NewFaceID, int n1, int n2, int n3, + int n12, int n23, int n31); + void AddFace(int NewFaceID, int n1, int n2, int n3, int n4, + int n12, int n23, int n34, int n41); + void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, + int n12, int n23, int n31, int n14, int n24, int n34); + void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, int n5, + int n12, int n23, int n34, int n41, + int n15, int n25, int n35, int n45); + void AddVolume(int NewVolID, int n1, int n2, int n3, + int n4, int n5, int n6, + int n12, int n23, int n31, + int n45, int n56, int n64, + int n14, int n25, int n36); + void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, + int n5, int n6, int n7, int n8, + int n12, int n23, int n34, int n41, + int n56, int n67, int n78, int n85, + int n15, int n26, int n37, int n48); + void MoveNode(int NewNodeID, double x, double y, double z); void RemoveNode(int NodeID); void RemoveElement(int ElementID); diff --git a/src/SMESHDS/SMESHDS_CommandType.hxx b/src/SMESHDS/SMESHDS_CommandType.hxx index f2c505b1f..9a11105b1 100644 --- a/src/SMESHDS/SMESHDS_CommandType.hxx +++ b/src/SMESHDS/SMESHDS_CommandType.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -30,22 +30,30 @@ //#include enum SMESHDS_CommandType { - SMESHDS_AddNode, - SMESHDS_AddEdge, - SMESHDS_AddTriangle, - SMESHDS_AddQuadrangle, - SMESHDS_AddPolygon, - SMESHDS_AddTetrahedron, - SMESHDS_AddPyramid, - SMESHDS_AddPrism, - SMESHDS_AddHexahedron, - SMESHDS_AddPolyhedron, - SMESHDS_RemoveNode, - SMESHDS_RemoveElement, - SMESHDS_MoveNode, - SMESHDS_ChangeElementNodes, - SMESHDS_ChangePolyhedronNodes, - SMESHDS_Renumber + SMESHDS_AddNode, + SMESHDS_AddEdge, + SMESHDS_AddTriangle, + SMESHDS_AddQuadrangle, + SMESHDS_AddPolygon, + SMESHDS_AddTetrahedron, + SMESHDS_AddPyramid, + SMESHDS_AddPrism, + SMESHDS_AddHexahedron, + SMESHDS_AddPolyhedron, + SMESHDS_RemoveNode, + SMESHDS_RemoveElement, + SMESHDS_MoveNode, + SMESHDS_ChangeElementNodes, + SMESHDS_ChangePolyhedronNodes, + SMESHDS_Renumber, + // special types for quadratic elements + SMESHDS_AddQuadEdge, + SMESHDS_AddQuadTriangle, + SMESHDS_AddQuadQuadrangle, + SMESHDS_AddQuadTetrahedron, + SMESHDS_AddQuadPyramid, + SMESHDS_AddQuadPentahedron, + SMESHDS_AddQuadHexahedron }; diff --git a/src/SMESHDS/SMESHDS_Document.cxx b/src/SMESHDS/SMESHDS_Document.cxx index f533a72a7..87fb9a0d4 100644 --- a/src/SMESHDS/SMESHDS_Document.cxx +++ b/src/SMESHDS/SMESHDS_Document.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -43,13 +43,13 @@ SMESHDS_Document::SMESHDS_Document(int UserID):myUserID(UserID) //function : NewMesh //purpose : //======================================================================= -int SMESHDS_Document::NewMesh() +int SMESHDS_Document::NewMesh(bool theIsEmbeddedMode) { - static int NewMeshID = 0; - NewMeshID++; - SMESHDS_Mesh *aNewMesh = new SMESHDS_Mesh(NewMeshID); - myMeshes[NewMeshID] = aNewMesh; - return NewMeshID; + static int aNewMeshID = 0; + aNewMeshID++; + SMESHDS_Mesh *aNewMesh = new SMESHDS_Mesh(aNewMeshID,theIsEmbeddedMode); + myMeshes[aNewMeshID] = aNewMesh; + return aNewMeshID; } //======================================================================= diff --git a/src/SMESHDS/SMESHDS_Document.hxx b/src/SMESHDS/SMESHDS_Document.hxx index c7184a90e..67894d3dd 100644 --- a/src/SMESHDS/SMESHDS_Document.hxx +++ b/src/SMESHDS/SMESHDS_Document.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -38,7 +38,7 @@ class SMESHDS_EXPORT SMESHDS_Document { public: SMESHDS_Document(int UserID); - int NewMesh(); + int NewMesh(bool theIsEmbeddedMode); void RemoveMesh(int MeshID); SMESHDS_Mesh * GetMesh(int MeshID); void AddHypothesis(SMESHDS_Hypothesis * H); diff --git a/src/SMESHDS/SMESHDS_Group.cxx b/src/SMESHDS/SMESHDS_Group.cxx index 9c7dfa4a9..1955f56bf 100644 --- a/src/SMESHDS/SMESHDS_Group.cxx +++ b/src/SMESHDS/SMESHDS_Group.cxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -113,7 +113,8 @@ bool SMESHDS_Group::Remove (const int theID) return true; } -//======================================================================= + +//====================================================================== //function : Clear //purpose : //======================================================================= diff --git a/src/SMESHDS/SMESHDS_Group.hxx b/src/SMESHDS/SMESHDS_Group.hxx index 8ceabf523..489feb377 100644 --- a/src/SMESHDS/SMESHDS_Group.hxx +++ b/src/SMESHDS/SMESHDS_Group.hxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHDS/SMESHDS_GroupBase.cxx b/src/SMESHDS/SMESHDS_GroupBase.cxx index c4adcc53b..52b21e168 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.cxx +++ b/src/SMESHDS/SMESHDS_GroupBase.cxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHDS/SMESHDS_GroupBase.hxx b/src/SMESHDS/SMESHDS_GroupBase.hxx index 29c388e6a..2bba90532 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.hxx +++ b/src/SMESHDS/SMESHDS_GroupBase.hxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -68,6 +68,12 @@ class SMESHDS_EXPORT SMESHDS_GroupBase virtual ~SMESHDS_GroupBase() {} + void SetColorGroup (int theColorGroup) + { myColorGroup = theColorGroup;} + + int GetColorGroup() const + { return myColorGroup;} + protected: const SMDS_MeshElement* findInMesh (const int theID) const; void resetIterator(); @@ -86,7 +92,7 @@ class SMESHDS_EXPORT SMESHDS_GroupBase int myCurIndex; int myCurID; SMDS_ElemIteratorPtr myIterator; - + int myColorGroup; }; #endif diff --git a/src/SMESHDS/SMESHDS_GroupOnGeom.cxx b/src/SMESHDS/SMESHDS_GroupOnGeom.cxx index 187357a67..ede4f0566 100644 --- a/src/SMESHDS/SMESHDS_GroupOnGeom.cxx +++ b/src/SMESHDS/SMESHDS_GroupOnGeom.cxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHDS/SMESHDS_GroupOnGeom.hxx b/src/SMESHDS/SMESHDS_GroupOnGeom.hxx index cbec91ece..eaee815f8 100644 --- a/src/SMESHDS/SMESHDS_GroupOnGeom.hxx +++ b/src/SMESHDS/SMESHDS_GroupOnGeom.hxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHDS/SMESHDS_Hypothesis.cxx b/src/SMESHDS/SMESHDS_Hypothesis.cxx index 29501c440..023ebf20b 100644 --- a/src/SMESHDS/SMESHDS_Hypothesis.cxx +++ b/src/SMESHDS/SMESHDS_Hypothesis.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHDS/SMESHDS_Hypothesis.hxx b/src/SMESHDS/SMESHDS_Hypothesis.hxx index 28a2964c2..904ee1ec9 100644 --- a/src/SMESHDS/SMESHDS_Hypothesis.hxx +++ b/src/SMESHDS/SMESHDS_Hypothesis.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index c22dd883e..36e185f8a 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -50,9 +50,19 @@ using namespace std; //function : Create //purpose : //======================================================================= -SMESHDS_Mesh::SMESHDS_Mesh(int MeshID):myMeshID(MeshID) +SMESHDS_Mesh::SMESHDS_Mesh(int theMeshID, bool theIsEmbeddedMode): + myMeshID(theMeshID), + myIsEmbeddedMode(theIsEmbeddedMode), + myCurSubID(-1) { - myScript = new SMESHDS_Script(); + myScript = new SMESHDS_Script(theIsEmbeddedMode); + myCurSubMesh = 0; +} + +//======================================================================= +bool SMESHDS_Mesh::IsEmbeddedMode() +{ + return myIsEmbeddedMode; } //======================================================================= @@ -631,10 +641,10 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolume //purpose : //======================================================================= -static void removeFromContainers (map & theSubMeshes, - set& theGroups, - list & theElems, - const bool isNode) +static void removeFromContainers (map& theSubMeshes, + set& theGroups, + list& theElems, + const bool isNode) { if ( theElems.empty() ) return; @@ -706,6 +716,33 @@ void SMESHDS_Mesh::RemoveNode(const SMDS_MeshNode * n) removeFromContainers( myShapeIndexToSubMesh, myGroups, removedNodes, true ); } +//======================================================================= +//function : RemoveFreeNode +//purpose : +//======================================================================= +void SMESHDS_Mesh::RemoveFreeNode(const SMDS_MeshNode * n, SMESHDS_SubMesh * subMesh) +{ + myScript->RemoveNode(n->GetID()); + + // Rm from group + // Node can belong to several groups + if (!myGroups.empty()) { + set::iterator GrIt = myGroups.begin(); + for (; GrIt != myGroups.end(); GrIt++) { + SMESHDS_Group* group = dynamic_cast(*GrIt); + if (!group || group->IsEmpty()) continue; + group->SMDSGroup().Remove(n); + } + } + + // Rm from sub-mesh + // Node should belong to only one sub-mesh + if( subMesh ) + subMesh->RemoveNode(n); + + SMDS_Mesh::RemoveFreeElement(n); +} + //======================================================================= //function : RemoveElement //purpose : @@ -728,6 +765,108 @@ void SMESHDS_Mesh::RemoveElement(const SMDS_MeshElement * elt) removeFromContainers( myShapeIndexToSubMesh, myGroups, removedElems, false ); } +//======================================================================= +//function : RemoveFreeElement +//purpose : +//======================================================================== +void SMESHDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elt, SMESHDS_SubMesh * subMesh) +{ + if (elt->GetType() == SMDSAbs_Node) { + RemoveFreeNode( static_cast(elt), subMesh); + return; + } + + if (hasConstructionEdges() || hasConstructionFaces()) + // this methods is only for meshes without descendants + return; + + myScript->RemoveElement(elt->GetID()); + + // Rm from group + // Node can belong to several groups + if (!myGroups.empty()) { + set::iterator GrIt = myGroups.begin(); + for (; GrIt != myGroups.end(); GrIt++) { + SMESHDS_Group* group = dynamic_cast(*GrIt); + if (!group || group->IsEmpty()) continue; + group->SMDSGroup().Remove(elt); + } + } + + // Rm from sub-mesh + // Element should belong to only one sub-mesh + if( subMesh ) + subMesh->RemoveElement(elt); + + SMDS_Mesh::RemoveFreeElement(elt); +} + +//================================================================================ +/*! + * \brief return submesh by shape + * \param shape - the subshape + * \retval SMESHDS_SubMesh* - the found submesh + * + * search of submeshes is optimized + */ +//================================================================================ + +SMESHDS_SubMesh* SMESHDS_Mesh::getSubmesh( const TopoDS_Shape & shape ) +{ + if ( shape.IsNull() ) + return 0; + + if ( !myCurSubShape.IsNull() && shape.IsSame( myCurSubShape )) + return myCurSubMesh; + + getSubmesh( ShapeToIndex( shape )); + myCurSubShape = shape; + return myCurSubMesh; +} + +//================================================================================ +/*! + * \brief return submesh by subshape index + * \param Index - the subshape index + * \retval SMESHDS_SubMesh* - the found submesh + * search of submeshes is optimized + */ +//================================================================================ + +SMESHDS_SubMesh* SMESHDS_Mesh::getSubmesh( const int Index ) +{ + //Update or build submesh + if ( Index != myCurSubID ) { + map::iterator it = myShapeIndexToSubMesh.find( Index ); + if ( it == myShapeIndexToSubMesh.end() ) + it = myShapeIndexToSubMesh.insert( make_pair(Index, new SMESHDS_SubMesh() )).first; + myCurSubMesh = it->second; + myCurSubID = Index; + myCurSubShape.Nullify(); // myCurSubShape no more corresponds to submesh + } + return myCurSubMesh; +} + +//================================================================================ +/*! + * \brief Add element or node to submesh + * \param elem - element to add + * \param subMesh - submesh to be filled in + */ +//================================================================================ + +bool SMESHDS_Mesh::add(const SMDS_MeshElement* elem, SMESHDS_SubMesh* subMesh ) +{ + if ( elem && subMesh ) { + if ( elem->GetType() == SMDSAbs_Node ) + subMesh->AddNode( static_cast( elem )); + else + subMesh->AddElement( elem ); + return true; + } + return false; +} + //======================================================================= //function : SetNodeOnVolume //purpose : @@ -735,7 +874,8 @@ void SMESHDS_Mesh::RemoveElement(const SMDS_MeshElement * elt) void SMESHDS_Mesh::SetNodeInVolume(SMDS_MeshNode * aNode, const TopoDS_Shell & S) { - SetNodeInVolume( aNode, myIndexToShape.FindIndex(S) ); + if ( add( aNode, getSubmesh(S) )) + const_cast( aNode->GetPosition().get() )->SetShapeId( myCurSubID ); } //======================================================================= //function : SetNodeOnVolume @@ -744,7 +884,8 @@ void SMESHDS_Mesh::SetNodeInVolume(SMDS_MeshNode * aNode, void SMESHDS_Mesh::SetNodeInVolume(SMDS_MeshNode * aNode, const TopoDS_Solid & S) { - SetNodeInVolume( aNode, myIndexToShape.FindIndex(S) ); + if ( add( aNode, getSubmesh(S) )) + const_cast( aNode->GetPosition().get() )->SetShapeId( myCurSubID ); } //======================================================================= @@ -756,7 +897,8 @@ void SMESHDS_Mesh::SetNodeOnFace(SMDS_MeshNode * aNode, double u, double v) { - SetNodeOnFace( aNode, myIndexToShape.FindIndex(S), u, v ); + if ( add( aNode, getSubmesh(S) )) + aNode->SetPosition(SMDS_PositionPtr(new SMDS_FacePosition(myCurSubID, u, v))); } //======================================================================= @@ -767,7 +909,8 @@ void SMESHDS_Mesh::SetNodeOnEdge(SMDS_MeshNode * aNode, const TopoDS_Edge & S, double u) { - SetNodeOnEdge( aNode, myIndexToShape.FindIndex(S), u ); + if ( add( aNode, getSubmesh(S) )) + aNode->SetPosition(SMDS_PositionPtr(new SMDS_EdgePosition(myCurSubID, u))); } //======================================================================= @@ -777,7 +920,8 @@ void SMESHDS_Mesh::SetNodeOnEdge(SMDS_MeshNode * aNode, void SMESHDS_Mesh::SetNodeOnVertex(SMDS_MeshNode * aNode, const TopoDS_Vertex & S) { - SetNodeOnVertex( aNode, myIndexToShape.FindIndex(S)); + if ( add( aNode, getSubmesh(S) )) + aNode->SetPosition(SMDS_PositionPtr(new SMDS_VertexPosition(myCurSubID))); } //======================================================================= @@ -786,7 +930,12 @@ void SMESHDS_Mesh::SetNodeOnVertex(SMDS_MeshNode * aNode, //======================================================================= void SMESHDS_Mesh::UnSetNodeOnShape(const SMDS_MeshNode* aNode) { - MESSAGE("not implemented"); + if ( aNode && aNode->GetPosition() ) { + map::iterator it = + myShapeIndexToSubMesh.find( aNode->GetPosition()->GetShapeId() ); + if ( it != myShapeIndexToSubMesh.end() ) + it->second->RemoveNode( aNode ); + } } //======================================================================= @@ -794,32 +943,26 @@ void SMESHDS_Mesh::UnSetNodeOnShape(const SMDS_MeshNode* aNode) //purpose : //======================================================================= void SMESHDS_Mesh::SetMeshElementOnShape(const SMDS_MeshElement * anElement, - const TopoDS_Shape & S) + const TopoDS_Shape & S) { - if (myShape.IsNull()) MESSAGE("myShape is NULL"); - - int Index = myIndexToShape.FindIndex(S); - - if (myShapeIndexToSubMesh.find(Index)==myShapeIndexToSubMesh.end()) - myShapeIndexToSubMesh[Index]=new SMESHDS_SubMesh(); - - myShapeIndexToSubMesh[Index]->AddElement(anElement); + add( anElement, getSubmesh(S) ); } //======================================================================= //function : UnSetMeshElementOnShape //purpose : //======================================================================= -void SMESHDS_Mesh:: -UnSetMeshElementOnShape(const SMDS_MeshElement * anElement, - const TopoDS_Shape & S) +void SMESHDS_Mesh::UnSetMeshElementOnShape(const SMDS_MeshElement * elem, + const TopoDS_Shape & S) { - if (myShape.IsNull()) MESSAGE("myShape is NULL"); - - int Index = myIndexToShape.FindIndex(S); + int Index = myIndexToShape.FindIndex(S); - if (myShapeIndexToSubMesh.find(Index)!=myShapeIndexToSubMesh.end()) - myShapeIndexToSubMesh[Index]->RemoveElement(anElement); + map::iterator it = myShapeIndexToSubMesh.find( Index ); + if ( it != myShapeIndexToSubMesh.end() ) + if ( elem->GetType() == SMDSAbs_Node ) + it->second->RemoveNode( static_cast( elem )); + else + it->second->RemoveElement( elem ); } //======================================================================= @@ -857,8 +1000,6 @@ bool SMESHDS_Mesh::IsGroupOfSubShapes (const TopoDS_Shape& theShape) const /////////////////////////////////////////////////////////////////////////////// SMESHDS_SubMesh * SMESHDS_Mesh::MeshElements(const TopoDS_Shape & S) const { - if (myShape.IsNull()) MESSAGE("myShape is NULL"); - int Index = ShapeToIndex(S); TShapeIndexToSubMesh::const_iterator anIter = myShapeIndexToSubMesh.find(Index); if (anIter != myShapeIndexToSubMesh.end()) @@ -872,10 +1013,9 @@ SMESHDS_SubMesh * SMESHDS_Mesh::MeshElements(const TopoDS_Shape & S) const /////////////////////////////////////////////////////////////////////////////// SMESHDS_SubMesh * SMESHDS_Mesh::MeshElements(const int Index) { - if (myShape.IsNull()) MESSAGE("myShape is NULL"); - - if (myShapeIndexToSubMesh.find(Index)!=myShapeIndexToSubMesh.end()) - return myShapeIndexToSubMesh[Index]; + TShapeIndexToSubMesh::const_iterator anIter = myShapeIndexToSubMesh.find(Index); + if (anIter != myShapeIndexToSubMesh.end()) + return anIter->second; else return NULL; } @@ -1005,7 +1145,7 @@ int SMESHDS_Mesh::AddCompoundSubmesh(const TopoDS_Shape& S, //function : IndexToShape //purpose : //======================================================================= -TopoDS_Shape SMESHDS_Mesh::IndexToShape(int ShapeIndex) +const TopoDS_Shape& SMESHDS_Mesh::IndexToShape(int ShapeIndex) const { return myIndexToShape.FindKey(ShapeIndex); } @@ -1030,7 +1170,8 @@ int SMESHDS_Mesh::ShapeToIndex(const TopoDS_Shape & S) const //======================================================================= void SMESHDS_Mesh::SetNodeInVolume(const SMDS_MeshNode* aNode, int Index) { - addNodeToSubmesh( aNode, Index ); + if ( add( aNode, getSubmesh( Index ))) + const_cast( aNode->GetPosition().get() )->SetShapeId( Index ); } //======================================================================= @@ -1040,9 +1181,8 @@ void SMESHDS_Mesh::SetNodeInVolume(const SMDS_MeshNode* aNode, int Index) void SMESHDS_Mesh::SetNodeOnFace(SMDS_MeshNode* aNode, int Index, double u, double v) { //Set Position on Node - aNode->SetPosition(SMDS_PositionPtr(new SMDS_FacePosition(Index, u, v))); - - addNodeToSubmesh( aNode, Index ); + if ( add( aNode, getSubmesh( Index ))) + aNode->SetPosition(SMDS_PositionPtr(new SMDS_FacePosition(Index, u, v))); } //======================================================================= @@ -1054,9 +1194,8 @@ void SMESHDS_Mesh::SetNodeOnEdge(SMDS_MeshNode* aNode, double u) { //Set Position on Node - aNode->SetPosition(SMDS_PositionPtr(new SMDS_EdgePosition(Index, u))); - - addNodeToSubmesh( aNode, Index ); + if ( add( aNode, getSubmesh( Index ))) + aNode->SetPosition(SMDS_PositionPtr(new SMDS_EdgePosition(Index, u))); } //======================================================================= @@ -1066,9 +1205,8 @@ void SMESHDS_Mesh::SetNodeOnEdge(SMDS_MeshNode* aNode, void SMESHDS_Mesh::SetNodeOnVertex(SMDS_MeshNode* aNode, int Index) { //Set Position on Node - aNode->SetPosition(SMDS_PositionPtr(new SMDS_VertexPosition(Index))); - - addNodeToSubmesh( aNode, Index ); + if ( add( aNode, getSubmesh( Index ))) + aNode->SetPosition(SMDS_PositionPtr(new SMDS_VertexPosition(Index))); } //======================================================================= @@ -1076,14 +1214,469 @@ void SMESHDS_Mesh::SetNodeOnVertex(SMDS_MeshNode* aNode, int Index) //purpose : //======================================================================= void SMESHDS_Mesh::SetMeshElementOnShape(const SMDS_MeshElement* anElement, - int Index) + int Index) { - if (myShapeIndexToSubMesh.find(Index)==myShapeIndexToSubMesh.end()) - myShapeIndexToSubMesh[Index]=new SMESHDS_SubMesh(); - - myShapeIndexToSubMesh[Index]->AddElement(anElement); + add( anElement, getSubmesh( Index )); } SMESHDS_Mesh::~SMESHDS_Mesh() { + delete myScript; +} + + + +//******************************************************************** +//******************************************************************** +//******** ********* +//***** Methods for addition of quadratic elements ****** +//******** ********* +//******************************************************************** +//******************************************************************** + +//======================================================================= +//function : AddEdgeWithID +//purpose : +//======================================================================= +SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(int n1, int n2, int n12, int ID) +{ + SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdgeWithID(n1,n2,n12,ID); + if(anElem) myScript->AddEdge(ID,n1,n2,n12); + return anElem; +} + +//======================================================================= +//function : AddEdge +//purpose : +//======================================================================= +SMDS_MeshEdge* SMESHDS_Mesh::AddEdge(const SMDS_MeshNode* n1, + const SMDS_MeshNode* n2, + const SMDS_MeshNode* n12) +{ + SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdge(n1,n2,n12); + if(anElem) myScript->AddEdge(anElem->GetID(), + n1->GetID(), + n2->GetID(), + n12->GetID()); + return anElem; +} + +//======================================================================= +//function : AddEdgeWithID +//purpose : +//======================================================================= +SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n12, + int ID) +{ + return AddEdgeWithID(n1->GetID(), + n2->GetID(), + n12->GetID(), + ID); +} + + +//======================================================================= +//function : AddFace +//purpose : +//======================================================================= +SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31) +{ + SMDS_MeshFace *anElem = SMDS_Mesh::AddFace(n1,n2,n3,n12,n23,n31); + if(anElem) myScript->AddFace(anElem->GetID(), + n1->GetID(), n2->GetID(), n3->GetID(), + n12->GetID(), n23->GetID(), n31->GetID()); + return anElem; +} + +//======================================================================= +//function : AddFaceWithID +//purpose : +//======================================================================= +SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, + int n12,int n23,int n31, int ID) +{ + SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n12,n23,n31,ID); + if(anElem) myScript->AddFace(ID,n1,n2,n3,n12,n23,n31); + return anElem; +} + +//======================================================================= +//function : AddFaceWithID +//purpose : +//======================================================================= +SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + int ID) +{ + return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), + n12->GetID(), n23->GetID(), n31->GetID(), + ID); +} + + +//======================================================================= +//function : AddFace +//purpose : +//======================================================================= +SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41) +{ + SMDS_MeshFace *anElem = SMDS_Mesh::AddFace(n1,n2,n3,n4,n12,n23,n34,n41); + if(anElem) myScript->AddFace(anElem->GetID(), + n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), + n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID()); + return anElem; +} + +//======================================================================= +//function : AddFaceWithID +//purpose : +//======================================================================= +SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4, + int n12,int n23,int n34,int n41, int ID) +{ + SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n4,n12,n23,n34,n41,ID); + if(anElem) myScript->AddFace(ID,n1,n2,n3,n4,n12,n23,n34,n41); + return anElem; +} + +//======================================================================= +//function : AddFaceWithID +//purpose : +//======================================================================= +SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + int ID) +{ + return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), + n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(), + ID); +} + + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n24, + const SMDS_MeshNode * n34) +{ + SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1,n2,n3,n4,n12,n23,n31,n14,n24,n34); + if(anElem) myScript->AddVolume(anElem->GetID(), + n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), + n12->GetID(), n23->GetID(), n31->GetID(), + n14->GetID(), n24->GetID(), n34->GetID()); + return anElem; +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : +//======================================================================= +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, + int n12,int n23,int n31, + int n14,int n24,int n34, int ID) +{ + SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n12,n23, + n31,n14,n24,n34,ID); + if(anElem) myScript->AddVolume(ID,n1,n2,n3,n4,n12,n23,n31,n14,n24,n34); + return anElem; +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : 2d order tetrahedron of 10 nodes +//======================================================================= +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n24, + const SMDS_MeshNode * n34, + int ID) +{ + return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), + n12->GetID(), n23->GetID(), n31->GetID(), + n14->GetID(), n24->GetID(), n34->GetID(), ID); +} + + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n35, + const SMDS_MeshNode * n45) +{ + SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1,n2,n3,n4,n5,n12,n23,n34,n41, + n15,n25,n35,n45); + if(anElem) + myScript->AddVolume(anElem->GetID(), n1->GetID(), n2->GetID(), + n3->GetID(), n4->GetID(), n5->GetID(), + n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(), + n15->GetID(), n25->GetID(), n35->GetID(), n45->GetID()); + return anElem; +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : +//======================================================================= +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, + int n12,int n23,int n34,int n41, + int n15,int n25,int n35,int n45, int ID) +{ + SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5, + n12,n23,n34,n41, + n15,n25,n35,n45,ID); + if(anElem) myScript->AddVolume(ID,n1,n2,n3,n4,n5,n12,n23,n34,n41, + n15,n25,n35,n45); + return anElem; +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : 2d order pyramid of 13 nodes +//======================================================================= +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n35, + const SMDS_MeshNode * n45, + int ID) +{ + return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), + n4->GetID(), n5->GetID(), + n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(), + n15->GetID(), n25->GetID(), n35->GetID(), n45->GetID(), + ID); +} + + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n45, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n64, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n36) +{ + SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1,n2,n3,n4,n5,n6,n12,n23,n31, + n45,n56,n64,n14,n25,n36); + if(anElem) + myScript->AddVolume(anElem->GetID(), n1->GetID(), n2->GetID(), + n3->GetID(), n4->GetID(), n5->GetID(), n6->GetID(), + n12->GetID(), n23->GetID(), n31->GetID(), + n45->GetID(), n56->GetID(), n64->GetID(), + n14->GetID(), n25->GetID(), n36->GetID()); + return anElem; } + +//======================================================================= +//function : AddVolumeWithID +//purpose : +//======================================================================= +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, + int n4, int n5, int n6, + int n12,int n23,int n31, + int n45,int n56,int n64, + int n14,int n25,int n36, int ID) +{ + SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6, + n12,n23,n31, + n45,n56,n64, + n14,n25,n36,ID); + if(anElem) myScript->AddVolume(ID,n1,n2,n3,n4,n5,n6,n12,n23,n31, + n45,n56,n64,n14,n25,n36); + return anElem; +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : 2d order Pentahedron with 15 nodes +//======================================================================= +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n45, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n64, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n36, + int ID) +{ + return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), + n4->GetID(), n5->GetID(), n6->GetID(), + n12->GetID(), n23->GetID(), n31->GetID(), + n45->GetID(), n56->GetID(), n64->GetID(), + n14->GetID(), n25->GetID(), n36->GetID(), + ID); +} + + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n7, + const SMDS_MeshNode * n8, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n67, + const SMDS_MeshNode * n78, + const SMDS_MeshNode * n85, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n26, + const SMDS_MeshNode * n37, + const SMDS_MeshNode * n48) +{ + SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1,n2,n3,n4,n5,n6,n7,n8, + n12,n23,n34,n41, + n56,n67,n78,n85, + n15,n26,n37,n48); + if(anElem) + myScript->AddVolume(anElem->GetID(), n1->GetID(), n2->GetID(), + n3->GetID(), n4->GetID(), n5->GetID(), + n6->GetID(), n7->GetID(), n8->GetID(), + n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(), + n56->GetID(), n67->GetID(), n78->GetID(), n85->GetID(), + n15->GetID(), n26->GetID(), n37->GetID(), n48->GetID()); + return anElem; +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : +//======================================================================= +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, + int n5, int n6, int n7, int n8, + int n12,int n23,int n34,int n41, + int n56,int n67,int n78,int n85, + int n15,int n26,int n37,int n48, int ID) +{ + SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,n7,n8, + n12,n23,n34,n41, + n56,n67,n78,n85, + n15,n26,n37,n48,ID); + if(anElem) myScript->AddVolume(ID,n1,n2,n3,n4,n5,n6,n7,n8,n12,n23,n34,n41, + n56,n67,n78,n85,n15,n26,n37,n48); + return anElem; +} + +//======================================================================= +//function : AddVolumeWithID +//purpose : 2d order Hexahedrons with 20 nodes +//======================================================================= +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n7, + const SMDS_MeshNode * n8, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n67, + const SMDS_MeshNode * n78, + const SMDS_MeshNode * n85, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n26, + const SMDS_MeshNode * n37, + const SMDS_MeshNode * n48, + int ID) +{ + return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), + n5->GetID(), n6->GetID(), n7->GetID(), n8->GetID(), + n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(), + n56->GetID(), n67->GetID(), n78->GetID(), n85->GetID(), + n15->GetID(), n26->GetID(), n37->GetID(), n48->GetID(), + ID); +} + + diff --git a/src/SMESHDS/SMESHDS_Mesh.hxx b/src/SMESHDS/SMESHDS_Mesh.hxx index b6371a482..8f2c16d7a 100644 --- a/src/SMESHDS/SMESHDS_Mesh.hxx +++ b/src/SMESHDS/SMESHDS_Mesh.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -58,7 +58,9 @@ class SMESHDS_GroupBase; class SMESHDS_EXPORT SMESHDS_Mesh:public SMDS_Mesh{ public: - SMESHDS_Mesh(int MeshID); + SMESHDS_Mesh(int theMeshID, bool theIsEmbeddedMode); + bool IsEmbeddedMode(); + void ShapeToMesh(const TopoDS_Shape & S); bool AddHypothesis(const TopoDS_Shape & SS, const SMESHDS_Hypothesis * H); bool RemoveHypothesis(const TopoDS_Shape & S, const SMESHDS_Hypothesis * H); @@ -73,6 +75,16 @@ public: virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2); + // 2d order edge with 3 nodes: n12 - node between n1 and n2 + virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int n12, int ID); + virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n12, + int ID); + virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n12); + virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, @@ -93,6 +105,44 @@ public: const SMDS_MeshNode * n3, const SMDS_MeshNode * n4); + // 2d order triangle of 6 nodes + virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, + int n12,int n23,int n31, int ID); + virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + int ID); + virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31); + + // 2d order quadrangle + virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, + int n12,int n23,int n34,int n41, int ID); + virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + int ID); + virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41); + virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, @@ -151,6 +201,153 @@ public: const SMDS_MeshNode * n7, const SMDS_MeshNode * n8); + // 2d order tetrahedron of 10 nodes + virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, + int n12,int n23,int n31, + int n14,int n24,int n34, int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n24, + const SMDS_MeshNode * n34, + int ID); + virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n24, + const SMDS_MeshNode * n34); + + // 2d order pyramid of 13 nodes + virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, + int n12,int n23,int n34,int n41, + int n15,int n25,int n35,int n45, + int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n35, + const SMDS_MeshNode * n45, + int ID); + virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n35, + const SMDS_MeshNode * n45); + + // 2d order Pentahedron with 15 nodes + virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, + int n4, int n5, int n6, + int n12,int n23,int n31, + int n45,int n56,int n64, + int n14,int n25,int n36, + int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n45, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n64, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n36, + int ID); + virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n45, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n64, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n36); + + // 2d order Hexahedrons with 20 nodes + virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, + int n5, int n6, int n7, int n8, + int n12,int n23,int n34,int n41, + int n56,int n67,int n78,int n85, + int n15,int n26,int n37,int n48, + int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n7, + const SMDS_MeshNode * n8, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n67, + const SMDS_MeshNode * n78, + const SMDS_MeshNode * n85, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n26, + const SMDS_MeshNode * n37, + const SMDS_MeshNode * n48, + int ID); + virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n7, + const SMDS_MeshNode * n8, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n34, + const SMDS_MeshNode * n41, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n67, + const SMDS_MeshNode * n78, + const SMDS_MeshNode * n85, + const SMDS_MeshNode * n15, + const SMDS_MeshNode * n26, + const SMDS_MeshNode * n37, + const SMDS_MeshNode * n48); + virtual SMDS_MeshFace* AddPolygonalFaceWithID (std::vector nodes_ids, const int ID); @@ -176,6 +373,14 @@ public: void MoveNode(const SMDS_MeshNode *, double x, double y, double z); virtual void RemoveNode(const SMDS_MeshNode *); void RemoveElement(const SMDS_MeshElement *); + + /*! Remove only the given element/node and only if it is free. + * Methods do not work for meshes with descendants. + * Implemented for fast cleaning of meshes. + */ + void RemoveFreeNode(const SMDS_MeshNode *, SMESHDS_SubMesh *); + void RemoveFreeElement(const SMDS_MeshElement *, SMESHDS_SubMesh *); + bool ChangeElementNodes(const SMDS_MeshElement * elem, const SMDS_MeshNode * nodes[], const int nbnodes); @@ -209,7 +414,7 @@ public: SMESHDS_Script * GetScript(); void ClearScript(); int ShapeToIndex(const TopoDS_Shape & aShape) const; - TopoDS_Shape IndexToShape(int ShapeIndex); + const TopoDS_Shape& IndexToShape(int ShapeIndex) const; SMESHDS_SubMesh * NewSubMesh(int Index); int AddCompoundSubmesh(const TopoDS_Shape& S, TopAbs_ShapeEnum type = TopAbs_SHAPE); @@ -236,8 +441,8 @@ private: if ( it == myShapeIndexToSubMesh.end() ) it = myShapeIndexToSubMesh.insert( make_pair(Index, new SMESHDS_SubMesh() )).first; it->second->AddNode( aNode ); // add aNode to submesh - } - + } + /*int HashCode( const TopoDS_Shape& S, const Standard_Integer theUpper ) const { return S.HashCode(2147483647); @@ -261,6 +466,16 @@ private: TGroups myGroups; SMESHDS_Script* myScript; + bool myIsEmbeddedMode; + + // optimize addition of nodes/elements to submeshes by, SetNodeInVolume() etc: + // avoid search of submeshes in maps + bool add( const SMDS_MeshElement* elem, SMESHDS_SubMesh* subMesh ); + SMESHDS_SubMesh* getSubmesh( const TopoDS_Shape & shape); + SMESHDS_SubMesh* getSubmesh( const int Index ); + int myCurSubID; + TopoDS_Shape myCurSubShape; + SMESHDS_SubMesh* myCurSubMesh; }; diff --git a/src/SMESHDS/SMESHDS_Script.cxx b/src/SMESHDS/SMESHDS_Script.cxx index 369ab4697..d5eea6ecc 100644 --- a/src/SMESHDS/SMESHDS_Script.cxx +++ b/src/SMESHDS/SMESHDS_Script.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -30,6 +30,35 @@ using namespace std; +//======================================================================= +//function : Constructor +//purpose : +//======================================================================= +SMESHDS_Script::SMESHDS_Script(bool theIsEmbeddedMode): + myIsEmbeddedMode(theIsEmbeddedMode) +{} + +//======================================================================= +//function : Destructor +//purpose : +//======================================================================= +SMESHDS_Script::~SMESHDS_Script() +{ + Clear(); +} + +//======================================================================= +void SMESHDS_Script::SetModified(bool theModified) +{ + myIsModified = theModified; +} + +//======================================================================= +bool SMESHDS_Script::IsModified() +{ + return myIsModified; +} + //======================================================================= //function : getCommand //purpose : @@ -60,6 +89,10 @@ SMESHDS_Command* SMESHDS_Script::getCommand(const SMESHDS_CommandType aType) //======================================================================= void SMESHDS_Script::AddNode(int NewNodeID, double x, double y, double z) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_AddNode)->AddNode(NewNodeID, x, y, z); } @@ -69,6 +102,10 @@ void SMESHDS_Script::AddNode(int NewNodeID, double x, double y, double z) //======================================================================= void SMESHDS_Script::AddEdge(int NewEdgeID, int idnode1, int idnode2) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_AddEdge)->AddEdge(NewEdgeID, idnode1, idnode2); } @@ -79,6 +116,10 @@ void SMESHDS_Script::AddEdge(int NewEdgeID, int idnode1, int idnode2) void SMESHDS_Script::AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_AddTriangle)->AddFace(NewFaceID, idnode1, idnode2, idnode3); } @@ -91,6 +132,10 @@ void SMESHDS_Script::AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3, int idnode4) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_AddQuadrangle)->AddFace(NewFaceID, idnode1, idnode2, idnode3, idnode4); @@ -104,6 +149,10 @@ void SMESHDS_Script::AddVolume(int NewID, int idnode1, int idnode2, int idnode3, int idnode4) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_AddTetrahedron)->AddVolume(NewID, idnode1, idnode2, idnode3, idnode4); @@ -117,6 +166,10 @@ void SMESHDS_Script::AddVolume(int NewID, int idnode1, int idnode2, int idnode3, int idnode4, int idnode5) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_AddPyramid)->AddVolume(NewID, idnode1, idnode2, idnode3, idnode4, idnode5); @@ -130,6 +183,10 @@ void SMESHDS_Script::AddVolume(int NewID, int idnode1, int idnode2, int idnode3, int idnode4, int idnode5, int idnode6) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_AddPrism)->AddVolume(NewID, idnode1, idnode2, idnode3, idnode4, idnode5, idnode6); @@ -143,6 +200,10 @@ void SMESHDS_Script::AddVolume(int NewID, int idnode1, int idnode2, int idnode3, int idnode4, int idnode5, int idnode6, int idnode7, int idnode8) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_AddHexahedron)->AddVolume(NewID, idnode1, idnode2, idnode3, idnode4, idnode5, idnode6, idnode7, idnode8); @@ -154,6 +215,10 @@ void SMESHDS_Script::AddVolume(int NewID, //======================================================================= void SMESHDS_Script::AddPolygonalFace (int NewFaceID, std::vector nodes_ids) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_AddPolygon)->AddPolygonalFace(NewFaceID, nodes_ids); } @@ -165,6 +230,10 @@ void SMESHDS_Script::AddPolyhedralVolume (int NewID, std::vector nodes_ids, std::vector quantities) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_AddPolyhedron)->AddPolyhedralVolume (NewID, nodes_ids, quantities); } @@ -175,6 +244,10 @@ void SMESHDS_Script::AddPolyhedralVolume (int NewID, //======================================================================= void SMESHDS_Script::MoveNode(int NewNodeID, double x, double y, double z) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_MoveNode)->MoveNode(NewNodeID, x, y, z); } @@ -184,6 +257,10 @@ void SMESHDS_Script::MoveNode(int NewNodeID, double x, double y, double z) //======================================================================= void SMESHDS_Script::RemoveNode(int ID) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_RemoveNode)->RemoveNode(ID); } @@ -193,6 +270,10 @@ void SMESHDS_Script::RemoveNode(int ID) //======================================================================= void SMESHDS_Script::RemoveElement(int ElementID) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_RemoveElement)->RemoveElement(ElementID); } @@ -203,6 +284,10 @@ void SMESHDS_Script::RemoveElement(int ElementID) void SMESHDS_Script::ChangeElementNodes(int ElementID, int nodes[], int nbnodes) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_ChangeElementNodes)->ChangeElementNodes( ElementID, nodes, nbnodes ); } @@ -214,6 +299,10 @@ void SMESHDS_Script::ChangePolyhedronNodes (const int ElementID, std::vector nodes_ids, std::vector quantities) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_ChangePolyhedronNodes)->ChangePolyhedronNodes (ElementID, nodes_ids, quantities); } @@ -222,9 +311,12 @@ void SMESHDS_Script::ChangePolyhedronNodes (const int ElementID, //function : Renumber //purpose : //======================================================================= - void SMESHDS_Script::Renumber (const bool isNodes, const int startID, const int deltaID) { + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } getCommand(SMESHDS_Renumber)->Renumber( isNodes, startID, deltaID ); } @@ -234,7 +326,11 @@ void SMESHDS_Script::Renumber (const bool isNodes, const int startID, const int //======================================================================= void SMESHDS_Script::Clear() { - myCommands.clear(); + list::iterator anIt = myCommands.begin(); + for (; anIt != myCommands.end(); anIt++) { + delete (*anIt); + } + myCommands.clear(); } //======================================================================= @@ -243,5 +339,128 @@ void SMESHDS_Script::Clear() //======================================================================= const list& SMESHDS_Script::GetCommands() { - return myCommands; + return myCommands; +} + + +//******************************************************************** +//***** Methods for quadratic elements ****** +//******************************************************************** + +//======================================================================= +//function : AddEdge +//purpose : +//======================================================================= +void SMESHDS_Script::AddEdge(int NewEdgeID, int n1, int n2, int n12) +{ + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } + getCommand(SMESHDS_AddQuadEdge)->AddEdge(NewEdgeID, n1, n2, n12); +} + +//======================================================================= +//function : AddFace +//purpose : +//======================================================================= +void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, + int n12, int n23, int n31) +{ + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } + getCommand(SMESHDS_AddQuadTriangle)->AddFace(NewFaceID, n1, n2, n3, + n12, n23, n31); +} + +//======================================================================= +//function : AddFace +//purpose : +//======================================================================= +void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, int n4, + int n12, int n23, int n34, int n41) +{ + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } + getCommand(SMESHDS_AddQuadQuadrangle)->AddFace(NewFaceID, n1, n2, n3, n4, + n12, n23, n34, n41); +} + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, + int n12, int n23, int n31, + int n14, int n24, int n34) +{ + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } + getCommand(SMESHDS_AddQuadTetrahedron)->AddVolume(NewVolID, n1, n2, n3, n4, + n12, n23, n31, + n14, n24, n34); } + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, + int n5, int n12, int n23, int n34, int n41, + int n15, int n25, int n35, int n45) +{ + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } + getCommand(SMESHDS_AddQuadPyramid)->AddVolume(NewVolID, n1, n2, n3, n4, n5, + n12, n23, n34, n41, + n15, n25, n35, n45); +} + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, + int n5,int n6, int n12, int n23, int n31, + int n45, int n56, int n64, + int n14, int n25, int n36) +{ + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } + getCommand(SMESHDS_AddQuadPentahedron)->AddVolume(NewVolID, n1,n2,n3,n4,n5,n6, + n12, n23, n31, + n45, n56, n64, + n14, n25, n36); +} + +//======================================================================= +//function : AddVolume +//purpose : +//======================================================================= +void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, + int n4, int n5, int n6, int n7, int n8, + int n12, int n23, int n34, int n41, + int n56, int n67, int n78, int n85, + int n15, int n26, int n37, int n48) +{ + if(myIsEmbeddedMode){ + myIsModified = true; + return; + } + getCommand(SMESHDS_AddQuadHexahedron)->AddVolume(NewVolID, n1, n2, n3, n4, + n5, n6, n7, n8, + n12, n23, n34, n41, + n56, n67, n78, n85, + n15, n26, n37, n48); +} + diff --git a/src/SMESHDS/SMESHDS_Script.hxx b/src/SMESHDS/SMESHDS_Script.hxx index c9b66e029..781fc9910 100644 --- a/src/SMESHDS/SMESHDS_Script.hxx +++ b/src/SMESHDS/SMESHDS_Script.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -38,6 +38,12 @@ class SMESHDS_EXPORT SMESHDS_Script { public: + SMESHDS_Script(bool theIsEmbeddedMode); + ~SMESHDS_Script(); + + void SetModified(bool theModified); + bool IsModified(); + void AddNode(int NewNodeID, double x, double y, double z); void AddEdge(int NewEdgeID, int idnode1, int idnode2); void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3); @@ -58,6 +64,27 @@ class SMESHDS_EXPORT SMESHDS_Script std::vector nodes_ids, std::vector quantities); + // special methods for quadratic elements + void AddEdge(int NewEdgeID, int n1, int n2, int n12); + void AddFace(int NewFaceID, int n1, int n2, int n3, + int n12, int n23, int n31); + void AddFace(int NewFaceID, int n1, int n2, int n3, int n4, + int n12, int n23, int n34, int n41); + void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, + int n12, int n23, int n31, int n14, int n24, int n34); + void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, int n5, + int n12, int n23, int n34, int n41, + int n15, int n25, int n35, int n45); + void AddVolume(int NewVolID, int n1, int n2, int n3, + int n4, int n5, int n6, + int n12, int n23, int n31, + int n45, int n56, int n64, + int n14, int n25, int n36); + void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, + int n5, int n6, int n7, int n8, + int n12, int n23, int n34, int n41, + int n56, int n67, int n78, int n85, + int n15, int n26, int n37, int n48); void MoveNode(int NewNodeID, double x, double y, double z); void RemoveNode(int NodeID); void RemoveElement(int ElementID); @@ -68,12 +95,14 @@ class SMESHDS_EXPORT SMESHDS_Script void Renumber (const bool isNodes, const int startID, const int deltaID); void Clear(); const std::list & GetCommands(); - ~SMESHDS_Script(); - + private: SMESHDS_Command* getCommand(const SMESHDS_CommandType aType); std::list myCommands; + + bool myIsEmbeddedMode; + bool myIsModified; }; #endif diff --git a/src/SMESHDS/SMESHDS_SubMesh.cxx b/src/SMESHDS/SMESHDS_SubMesh.cxx index 5bdbfc6a4..262649e86 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.cxx +++ b/src/SMESHDS/SMESHDS_SubMesh.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHDS/SMESHDS_SubMesh.hxx b/src/SMESHDS/SMESHDS_SubMesh.hxx index 4406c282b..1231c490c 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.hxx +++ b/src/SMESHDS/SMESHDS_SubMesh.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHFiltersSelection/Handle_SMESH_TypeFilter.hxx b/src/SMESHFiltersSelection/Handle_SMESH_TypeFilter.hxx index 79db47025..7a825b03d 100644 --- a/src/SMESHFiltersSelection/Handle_SMESH_TypeFilter.hxx +++ b/src/SMESHFiltersSelection/Handle_SMESH_TypeFilter.hxx @@ -1,17 +1,22 @@ -// File generated by CPPExt (Transient) +// SMESH SMDS : implementaion of Salome mesh data structure // -// Copyright (C) 1991,1995 by -// -// MATRA DATAVISION, FRANCE -// -// This software is furnished in accordance with the terms and conditions -// of the contract and with the inclusion of the above copyright notice. -// This software or any other copy thereof may not be provided or otherwise -// be made available to any other person. No title to an ownership of the -// software is hereby transferred. -// -// At the termination of the contract, the software and all copies of this -// software must be deleted. +// Copyright (C) 2003 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 _Handle_SMESH_TypeFilter_HeaderFile #define _Handle_SMESH_TypeFilter_HeaderFile diff --git a/src/SMESHFiltersSelection/Makefile.in b/src/SMESHFiltersSelection/Makefile.in index c438321b7..c1e928244 100644 --- a/src/SMESHFiltersSelection/Makefile.in +++ b/src/SMESHFiltersSelection/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -41,7 +41,8 @@ LIB_SRC = SMESH_TypeFilter.cxx \ SMESH_NumberFilter.cxx \ SMESH_LogicalFilter.cxx -LIB_CLIENT_IDL = SALOME_Exception.idl \ +LIB_CLIENT_IDL = SALOME_Comm.idl \ + SALOME_Exception.idl \ GEOM_Gen.idl \ SMESH_Gen.idl \ SMESH_Mesh.idl \ @@ -53,7 +54,8 @@ LIB_CLIENT_IDL = SALOME_Exception.idl \ SALOME_Component.idl \ SMESH_Filter.idl \ SMESH_Pattern.idl \ - SALOME_GenericObj.idl + SALOME_GenericObj.idl \ + MED.idl # header files EXPORT_HEADERS= SMESH_Type.h \ @@ -63,11 +65,11 @@ EXPORT_HEADERS= SMESH_Type.h \ # additionnal information to compil and link file CPPFLAGS += $(OCC_INCLUDES) $(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) \ - -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \ - -I${GEOM_ROOT_DIR}/include/salome ${BOOST_CPPFLAGS} -CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \ - -I${GEOM_ROOT_DIR}/include/salome -I${BOOSTDIR} -LDFLAGS += $(OCC_KERNEL_LIBS) -L${GUI_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome -lSalomeApp -lsuit + $(KERNEL_CXXFLAGS) $(GUI_CXXFLAGS) \ + $(GEOM_CXXFLAGS) ${BOOST_CPPFLAGS} +CXXFLAGS += $(OCC_CXXFLAGS) $(KERNEL_CXXFLAGS) $(GUI_CXXFLAGS) \ + $(GEOM_CXXFLAGS) -I${BOOSTDIR} +LDFLAGS += $(OCC_KERNEL_LIBS) $(KERNEL_LDFLAGS) -lSalomeDSClient -lSalomeDS $(GUI_LDFLAGS) $(GEOM_LDFLAGS) -lSalomeApp -lsuit # additional file to be cleaned MOSTLYCLEAN = diff --git a/src/SMESHFiltersSelection/SMESH_LogicalFilter.cxx b/src/SMESHFiltersSelection/SMESH_LogicalFilter.cxx index 5033f8e13..57cfea757 100644 --- a/src/SMESHFiltersSelection/SMESH_LogicalFilter.cxx +++ b/src/SMESHFiltersSelection/SMESH_LogicalFilter.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SMESH_LogicalFilter.cxx // Module : SMESH diff --git a/src/SMESHFiltersSelection/SMESH_LogicalFilter.hxx b/src/SMESHFiltersSelection/SMESH_LogicalFilter.hxx index ce12108d7..a6197ab82 100644 --- a/src/SMESHFiltersSelection/SMESH_LogicalFilter.hxx +++ b/src/SMESHFiltersSelection/SMESH_LogicalFilter.hxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SMESH_LogicalFilter.hxx // Module : SMESH diff --git a/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx b/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx index 176cd3fb6..929401562 100644 --- a/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx +++ b/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SMESH_NumberFilter.cxx // Module : SMESH diff --git a/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx b/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx index b8e0932b3..640b8ea02 100644 --- a/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx +++ b/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SMESH_NumberFilter.hxx // Module : SMESH diff --git a/src/SMESHFiltersSelection/SMESH_Type.h b/src/SMESHFiltersSelection/SMESH_Type.h index 25cc4deec..6b765a3fa 100644 --- a/src/SMESHFiltersSelection/SMESH_Type.h +++ b/src/SMESHFiltersSelection/SMESH_Type.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SMESH_Type.h // Created : Mon Jun 03 15:14:15 2002 diff --git a/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx b/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx index bac11fe18..1b2d9ee29 100644 --- a/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx +++ b/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SMESH_TypeFilter.hxx" diff --git a/src/SMESHFiltersSelection/SMESH_TypeFilter.hxx b/src/SMESHFiltersSelection/SMESH_TypeFilter.hxx index 6107a1393..da5ada02e 100644 --- a/src/SMESHFiltersSelection/SMESH_TypeFilter.hxx +++ b/src/SMESHFiltersSelection/SMESH_TypeFilter.hxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SMESH_TypeFilter.hxx // Module : SMESH diff --git a/src/SMESHFiltersSelection/SMESH_TypeFilter.ixx b/src/SMESHFiltersSelection/SMESH_TypeFilter.ixx index a01d02ee0..66c04efb2 100644 --- a/src/SMESHFiltersSelection/SMESH_TypeFilter.ixx +++ b/src/SMESHFiltersSelection/SMESH_TypeFilter.ixx @@ -1,17 +1,23 @@ -// File generated by CPPExt (Transient) -// Copyright (C) 1991,1995 by -// -// MATRA DATAVISION, FRANCE -// -// This software is furnished in accordance with the terms and conditions -// of the contract and with the inclusion of the above copyright notice. -// This software or any other copy thereof may not be provided or otherwise -// be made available to any other person. No title to an ownership of the -// software is hereby transferred. -// -// At the termination of the contract, the software and all copies of this -// software must be deleted. +// SMESH SMDS : implementaion of Salome mesh data structure // +// Copyright (C) 2003 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 "SMESH_TypeFilter.jxx" #ifndef _Standard_TypeMismatch_HeaderFile diff --git a/src/SMESHFiltersSelection/SMESH_TypeFilter.jxx b/src/SMESHFiltersSelection/SMESH_TypeFilter.jxx index 2439074c8..508424ba9 100644 --- a/src/SMESHFiltersSelection/SMESH_TypeFilter.jxx +++ b/src/SMESHFiltersSelection/SMESH_TypeFilter.jxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef _SMESH_TypeFilter_HeaderFile #include "SMESH_TypeFilter.hxx" diff --git a/src/SMESHGUI/Makefile.in b/src/SMESHGUI/Makefile.in index 268d4bc70..234fb038d 100644 --- a/src/SMESHGUI/Makefile.in +++ b/src/SMESHGUI/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -71,8 +71,6 @@ LIB_SRC = SMESHGUI.cxx \ SMESHGUI_Swig.cxx \ SMESHGUI_MoveNodesDlg.cxx \ SMESHGUI_AddMeshElementDlg.cxx \ - SMESHGUI_EditHypothesesDlg.cxx \ - SMESHGUI_CreateHypothesesDlg.cxx \ SMESHGUI_XmlHandler.cxx \ SMESHGUI_Filter.cxx \ SMESHGUI_FilterDlg.cxx \ @@ -99,7 +97,6 @@ LIB_SRC = SMESHGUI.cxx \ SMESHGUI_FilterUtils.cxx \ SMESHGUI_PatternUtils.cxx \ SMESHGUI_HypothesesUtils.cxx \ - SMESHGUI_PrecisionDlg.cxx \ SMESHGUI_VTKUtils.cxx \ SMESHGUI_Selection.cxx \ SMESHGUI_CreatePolyhedralVolumeDlg.cxx \ @@ -110,7 +107,10 @@ LIB_SRC = SMESHGUI.cxx \ SMESHGUI_MeshOp.cxx \ SMESHGUI_Displayer.cxx \ SMESHGUI_Hypotheses.cxx \ - SMESHGUI_ShapeByMeshDlg.cxx + SMESHGUI_ShapeByMeshDlg.cxx \ + SMESHGUI_AddQuadraticElementDlg.cxx \ + SMESHGUI_ConvToQuadDlg.cxx \ + SMESHGUI_ConvToQuadOp.cxx LIB_MOC = \ SMESHGUI.h \ @@ -131,8 +131,6 @@ LIB_MOC = \ SMESHGUI_Preferences_SelectionDlg.h \ SMESHGUI_MoveNodesDlg.h \ SMESHGUI_AddMeshElementDlg.h \ - SMESHGUI_EditHypothesesDlg.h \ - SMESHGUI_CreateHypothesesDlg.h \ SMESHGUI_FilterDlg.h \ SMESHGUI_FilterLibraryDlg.h \ SMESHGUI_SingleEditDlg.h \ @@ -148,7 +146,6 @@ LIB_MOC = \ SMESHGUI_TranslationDlg.h \ SMESHGUI_SymmetryDlg.h \ SMESHGUI_SewingDlg.h \ - SMESHGUI_PrecisionDlg.h \ SMESHGUI_MergeNodesDlg.h \ SMESHGUI_EditMeshDlg.h \ SMESHGUI_CreatePolyhedralVolumeDlg.h \ @@ -158,7 +155,10 @@ LIB_MOC = \ SMESHGUI_MeshDlg.h \ SMESHGUI_MeshOp.h \ SMESHGUI_Hypotheses.h \ - SMESHGUI_ShapeByMeshDlg.h + SMESHGUI_ShapeByMeshDlg.h \ + SMESHGUI_AddQuadraticElementDlg.h \ + SMESHGUI_ConvToQuadDlg.h \ + SMESHGUI_ConvToQuadOp.h LIB_CLIENT_IDL = SALOME_Exception.idl \ @@ -184,17 +184,17 @@ LIB_SERVER_IDL = #BIN = SMESHBin CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) \ - -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \ - -I${GEOM_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) + $(KERNEL_CXXFLAGS) $(GUI_CXXFLAGS) \ + $(GEOM_CXXFLAGS) $(BOOST_CPPFLAGS) -CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \ - -I${GEOM_ROOT_DIR}/include/salome +CXXFLAGS += $(KERNEL_CXXFLAGS) $(GUI_CXXFLAGS) \ + $(GEOM_CXXFLAGS) LDFLAGS += -lSMESHObject -lSMESHFiltersSelection -lSMDS -lSMESHControls -lDlgRef \ - $(OCC_KERNEL_LIBS) -lTKBO -lTKAdvTools -L${KERNEL_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome \ - -lVTKViewer -lSalomeApp -lSalomePrs -lSalomeNS -lSalomeLifeCycleCORBA -lOpUtil -lSalomeObject \ - -lEvent -lSALOMELocalTrace -lSVTK -lOCCViewer -L${GEOM_ROOT_DIR}/lib/salome -lGEOM -lGEOMClient \ - -lGEOMBase -lGEOMObject -lGEOMFiltersSelection + $(OCC_KERNEL_LIBS) -lTKBO -lTKAdvTools $(KERNEL_LDFLAGS) $(GUI_LDFLAGS) \ + -lVTKViewer -lSalomeDSClient -lSalomeDS -lSalomeApp -lSalomePrs -lSalomeNS -lSalomeLifeCycleCORBA -lOpUtil -lSalomeObject \ + -lEvent -lSALOMELocalTrace -lSVTK -lOCCViewer $(GEOM_LDFLAGS) -lGEOM -lGEOMClient \ + -lGEOMBase -lGEOMObject -lGEOMFiltersSelection -lSalomeSession LDFLAGSFORBIN += $(LDFLAGS) diff --git a/src/SMESHGUI/SMESHBin.cxx b/src/SMESHGUI/SMESHBin.cxx index 3f87afeea..26da45734 100644 --- a/src/SMESHGUI/SMESHBin.cxx +++ b/src/SMESHGUI/SMESHBin.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // int main(int argc, char** argv){ return 0; diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index d3f71d170..809a98b2a 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SMESHGUI.cxx // Author : Nicolas REJNERI @@ -26,6 +26,7 @@ #include "SMESHGUI.h" +#include "SMESH_Client.hxx" #include "SMESHGUI_NodesDlg.h" #include "SMESHGUI_TransparencyDlg.h" #include "SMESHGUI_ClippingDlg.h" @@ -40,8 +41,7 @@ #include "SMESHGUI_Hypotheses.h" #include "SMESHGUI_MoveNodesDlg.h" #include "SMESHGUI_AddMeshElementDlg.h" -#include "SMESHGUI_EditHypothesesDlg.h" -#include "SMESHGUI_CreateHypothesesDlg.h" +#include "SMESHGUI_AddQuadraticElementDlg.h" #include "SMESHGUI_FilterDlg.h" #include "SMESHGUI_FilterLibraryDlg.h" #include "SMESHGUI_SingleEditDlg.h" @@ -60,9 +60,9 @@ #include "SMESHGUI_MergeNodesDlg.h" #include "SMESHGUI_EditMeshDlg.h" #include "SMESHGUI_MeshPatternDlg.h" -#include "SMESHGUI_PrecisionDlg.h" #include "SMESHGUI_Selection.h" #include "SMESHGUI_CreatePolyhedralVolumeDlg.h" +#include "SMESHGUI_ConvToQuadOp.h" #include "SMESHGUI_MeshOp.h" #include "SMESHGUI_Displayer.h" @@ -83,13 +83,14 @@ #include "SalomeApp_Study.h" #include "SalomeApp_Application.h" #include "SalomeApp_CheckFileDlg.h" +#include "SalomeApp_ImportOperation.h" + #include "LightApp_DataOwner.h" #include "LightApp_Preferences.h" #include "LightApp_VTKSelector.h" #include "LightApp_Operation.h" #include "LightApp_UpdateFlags.h" - -#include "SalomeApp_ImportOperation.h" +#include "LightApp_NameDlg.h" #include #include @@ -125,7 +126,6 @@ #include #include #include -#include // BOOST Includes #include @@ -146,7 +146,7 @@ using namespace std; namespace{ - // Decalarations + // Declarations //============================================================= void ImportMeshesFromFile(SMESH::SMESH_Gen_ptr theComponentMesh, int theCommandID); @@ -260,30 +260,45 @@ namespace{ switch ( theCommandID ) { case 125: case 122: - aFilterMap.insert( QObject::tr("MED 2.1 (*.med)"), SMESH::MED_V2_1 ); - aFilterMap.insert( QObject::tr("MED 2.2 (*.med)"), SMESH::MED_V2_2 ); + { + if (aMesh->HasDuplicatedGroupNamesMED()) { + int aRet = SUIT_MessageBox::warn2 + (SMESHGUI::desktop(), + QObject::tr("SMESH_WRN_WARNING"), + QObject::tr("SMESH_EXPORT_MED_DUPLICATED_GRP").arg(anIObject->getName()), + QObject::tr("SMESH_BUT_YES"), QObject::tr("SMESH_BUT_NO"), + 0, 1, 0); + if (aRet) + return; + } + + aFilterMap.insert( QObject::tr("MED 2.1 (*.med)"), SMESH::MED_V2_1 ); + aFilterMap.insert( QObject::tr("MED 2.2 (*.med)"), SMESH::MED_V2_2 ); + } break; case 124: case 121: aFilter = QObject::tr("DAT files (*.dat)"); break; case 126: - case 123: { - if(aMesh->NbPyramids()){ - int aRet = SUIT_MessageBox::warn2(SMESHGUI::desktop(), - QObject::tr("SMESH_WRN_WARNING"), - QObject::tr("SMESH_EXPORT_UNV").arg(anIObject->getName()), - QObject::tr("SMESH_BUT_YES"), - QObject::tr("SMESH_BUT_NO"), - 0,1,0); - if(aRet) - return; - } - aFilter = QObject::tr("IDEAS files (*.unv)"); + case 123: + { + if (aMesh->NbPyramids()) { + int aRet = SUIT_MessageBox::warn2 + (SMESHGUI::desktop(), + QObject::tr("SMESH_WRN_WARNING"), + QObject::tr("SMESH_EXPORT_UNV").arg(anIObject->getName()), + QObject::tr("SMESH_BUT_YES"), QObject::tr("SMESH_BUT_NO"), + 0, 1, 0); + if (aRet) + return; + } + aFilter = QObject::tr("IDEAS files (*.unv)"); + } break; default: return; - }} + } QString aFilename; SMESH::MED_VERSION aFormat; @@ -295,41 +310,42 @@ namespace{ if ( theCommandID != 122 && theCommandID != 125 ) aFilename = SUIT_FileDlg::getFileName(SMESHGUI::desktop(), "", aFilter, aTitle, false); - else - { - QStringList filters; - for ( QMap::const_iterator it = aFilterMap.begin(); it != aFilterMap.end(); ++it ) - filters.push_back( it.key() ); - - //SUIT_FileDlg* fd = new SUIT_FileDlg( SMESHGUI::desktop(), false, true, true ); - SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg( SMESHGUI::desktop(), false, QObject::tr("SMESH_AUTO_GROUPS") ,true, true ); - fd->setCaption( aTitle ); - fd->setFilters( filters ); - fd->setSelectedFilter( QObject::tr("MED 2.2 (*.med)") ); - fd->SetChecked(toCreateGroups); - bool is_ok = false; - while(!is_ok){ - fd->exec(); - aFilename = fd->selectedFile(); - aFormat = aFilterMap[fd->selectedFilter()]; - is_ok = true; - if( !aFilename.isEmpty() - && (aMesh->NbPolygons()>0 || aMesh->NbPolyhedrons()>0) - && aFormat==SMESH::MED_V2_1){ - int aRet = SUIT_MessageBox::warn2(SMESHGUI::desktop(), - QObject::tr("SMESH_WRN_WARNING"), - QObject::tr("SMESH_EXPORT_MED_V2_1").arg(anIObject->getName()), - QObject::tr("SMESH_BUT_YES"), - QObject::tr("SMESH_BUT_NO"), - 0,1,0); - if(aRet){ - is_ok = false; - } - } - } - toCreateGroups = fd->IsChecked(); - delete fd; - } + else { + QStringList filters; + QMap::const_iterator it = aFilterMap.begin(); + for ( ; it != aFilterMap.end(); ++it ) + filters.push_back( it.key() ); + + //SUIT_FileDlg* fd = new SUIT_FileDlg( SMESHGUI::desktop(), false, true, true ); + SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg + ( SMESHGUI::desktop(), false, QObject::tr("SMESH_AUTO_GROUPS") ,true, true ); + fd->setCaption( aTitle ); + fd->setFilters( filters ); + fd->setSelectedFilter( QObject::tr("MED 2.2 (*.med)") ); + fd->SetChecked(toCreateGroups); + bool is_ok = false; + while (!is_ok) { + fd->exec(); + aFilename = fd->selectedFile(); + aFormat = aFilterMap[fd->selectedFilter()]; + is_ok = true; + if ( !aFilename.isEmpty() + && (aMesh->NbPolygons()>0 || aMesh->NbPolyhedrons()>0) + && aFormat==SMESH::MED_V2_1) { + int aRet = SUIT_MessageBox::warn2(SMESHGUI::desktop(), + QObject::tr("SMESH_WRN_WARNING"), + QObject::tr("SMESH_EXPORT_MED_V2_1").arg(anIObject->getName()), + QObject::tr("SMESH_BUT_YES"), + QObject::tr("SMESH_BUT_NO"), + 0,1,0); + if (aRet) { + is_ok = false; + } + } + } + toCreateGroups = fd->IsChecked(); + delete fd; + } if ( !aFilename.isEmpty() ) { // Check whether the file already exists and delete it if yes QFile aFile( aFilename ); @@ -442,28 +458,28 @@ namespace{ anActor->SetRepresentation(SMESH_Actor::ePoint); break; case 1132:{ - float color[3]; + vtkFloatingPointType color[3]; anActor->GetSufaceColor(color[0], color[1], color[2]); int c0 = int (color[0] * 255); int c1 = int (color[1] * 255); int c2 = int (color[2] * 255); QColor c(c0, c1, c2); - float edgecolor[3]; + vtkFloatingPointType edgecolor[3]; anActor->GetEdgeColor(edgecolor[0], edgecolor[1], edgecolor[2]); c0 = int (edgecolor[0] * 255); c1 = int (edgecolor[1] * 255); c2 = int (edgecolor[2] * 255); QColor e(c0, c1, c2); - float backfacecolor[3]; + vtkFloatingPointType backfacecolor[3]; anActor->GetBackSufaceColor(backfacecolor[0], backfacecolor[1], backfacecolor[2]); c0 = int (backfacecolor[0] * 255); c1 = int (backfacecolor[1] * 255); c2 = int (backfacecolor[2] * 255); QColor b(c0, c1, c2); - float nodecolor[3]; + vtkFloatingPointType nodecolor[3]; anActor->GetNodeColor(nodecolor[0], nodecolor[1], nodecolor[2]); c0 = int (nodecolor[0] * 255); c1 = int (nodecolor[1] * 255); @@ -474,7 +490,7 @@ namespace{ if(Edgewidth == 0) Edgewidth = 1; int intValue = int(anActor->GetNodeSize()); - float Shrink = anActor->GetShrinkFactor(); + vtkFloatingPointType Shrink = anActor->GetShrinkFactor(); SMESHGUI_Preferences_ColorDlg *aDlg = new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI(), "" ); @@ -491,26 +507,26 @@ namespace{ QColor nodecolor = aDlg->GetColor(3); QColor backfacecolor = aDlg->GetColor(4); /* actor color and backface color */ - anActor->SetSufaceColor(float (color.red()) / 255., - float (color.green()) / 255., - float (color.blue()) / 255.); - anActor->SetBackSufaceColor(float (backfacecolor.red()) / 255., - float (backfacecolor.green()) / 255., - float (backfacecolor.blue()) / 255.); + anActor->SetSufaceColor(vtkFloatingPointType (color.red()) / 255., + vtkFloatingPointType (color.green()) / 255., + vtkFloatingPointType (color.blue()) / 255.); + anActor->SetBackSufaceColor(vtkFloatingPointType (backfacecolor.red()) / 255., + vtkFloatingPointType (backfacecolor.green()) / 255., + vtkFloatingPointType (backfacecolor.blue()) / 255.); /* edge color */ - anActor->SetEdgeColor(float (edgecolor.red()) / 255., - float (edgecolor.green()) / 255., - float (edgecolor.blue()) / 255.); + anActor->SetEdgeColor(vtkFloatingPointType (edgecolor.red()) / 255., + vtkFloatingPointType (edgecolor.green()) / 255., + vtkFloatingPointType (edgecolor.blue()) / 255.); /* Shrink factor and size edges */ anActor->SetShrinkFactor(aDlg->GetIntValue(3) / 100.); anActor->SetLineWidth(aDlg->GetIntValue(1)); /* Nodes color and size */ - anActor->SetNodeColor(float (nodecolor.red()) / 255., - float (nodecolor.green()) / 255., - float (nodecolor.blue()) / 255.); + anActor->SetNodeColor(vtkFloatingPointType (nodecolor.red()) / 255., + vtkFloatingPointType (nodecolor.green()) / 255., + vtkFloatingPointType (nodecolor.blue()) / 255.); anActor->SetNodeSize(aDlg->GetIntValue(2)); delete aDlg; @@ -672,7 +688,7 @@ namespace{ } extern "C" { - Standard_EXPORT CAM_Module* createModule() + SMESHGUI_EXPORT CAM_Module* createModule() { return new SMESHGUI(); } @@ -687,15 +703,15 @@ SMESH::SMESH_Gen_var SMESHGUI::myComponentSMESH = SMESH::SMESH_Gen::_nil(); //============================================================================= SMESHGUI::SMESHGUI() : SalomeApp_Module( "SMESH" ) -{ +{ if ( CORBA::is_nil( myComponentSMESH ) ) { - SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA( getApp()->namingService() ); - Engines::Component_var comp = ls->FindOrLoad_Component( "FactoryServer", "SMESH" ); - myComponentSMESH = SMESH::SMESH_Gen::_narrow( comp ); + CORBA::Boolean anIsEmbeddedMode; + myComponentSMESH = SMESH_Client::GetSMESHGen(getApp()->orb(),anIsEmbeddedMode); } myActiveDialogBox = 0; + myFilterLibraryDlg = 0; myState = -1; myDisplayer = 0; @@ -1269,9 +1285,6 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) else aDlg = new SMESHGUI_CuttingOfQuadsDlg(this); - int x, y ; - DefineDlgPosition( aDlg, x, y ); - aDlg->move( x, y ); aDlg->show(); break; } @@ -1345,6 +1358,20 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } break; } + case 417: // Convert mesh to quadratic + { + startOperation( 417 ); + /* if (checkLock(aStudy)) break; + if (vtkwnd) { + EmitSignalDeactivateDialog(); + new SMESHGUI_ConvToQuadDlg(); + } else { + SUIT_MessageBox::warn1(desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"), + tr("SMESH_BUT_OK")); + }*/ + break; + } case 801: // CREATE GROUP { if ( !vtkwnd ) @@ -1457,8 +1484,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) int nbSelectedGroups = 0; for ( ; It.More(); It.Next() ) { - SMESH::SMESH_Group_var aGroup = - SMESH::IObjectToInterface(It.Value()); + SMESH::SMESH_GroupBase_var aGroup = + SMESH::IObjectToInterface(It.Value()); if (!aGroup->_is_nil()) { nbSelectedGroups++; SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, "", aGroup); @@ -1467,7 +1494,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } if (nbSelectedGroups == 0) { - SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, "", SMESH::SMESH_Group::_nil()); + SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, "", SMESH::SMESH_GroupBase::_nil()); aDlg->show(); } break; @@ -1641,10 +1668,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { aName = anAttr; QString newName = QString(aName->Value().c_str()); - bool ok; - newName = QInputDialog::getText( tr( "Rename" ), tr( "Enter new name:" ), QLineEdit::Normal, - newName, &ok, desktop() ); - if ( ok && !newName.isEmpty() ) + newName = LightApp_NameDlg::getName(desktop(), newName); + if ( !newName.isEmpty() ) { //old source: aStudy->renameIObject( IObject, newName ); aName->SetValue( newName.latin1() ); @@ -1734,6 +1759,46 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } break; } + case 4034: // QUADRATIC EDGE + case 4035: // QUADRATIC TRIANGLE + case 4036: // QUADRATIC QUADRANGLE + case 4037: // QUADRATIC TETRAHEDRON + case 4038: // QUADRATIC PYRAMID + case 4039: // QUADRATIC PENTAHEDRON + case 4040: // QUADRATIC HEXAHEDRON + { + if(checkLock(aStudy)) break; + if ( vtkwnd ) { + EmitSignalDeactivateDialog(); + int type; + + switch (theCommandID) { + case 4034: + type = QUAD_EDGE; break; + case 4035: + type = QUAD_TRIANGLE; break; + case 4036: + type = QUAD_QUADRANGLE; break; + case 4037: + type = QUAD_TETRAHEDRON; break; + case 4038: + type = QUAD_PYRAMID; break; + case 4039: + type = QUAD_PENTAHEDRON; break; + case 4040: + type = QUAD_HEXAHEDRON; + break; + default:; + } + new SMESHGUI_AddQuadraticElementDlg( this, type ); + } + else { + SUIT_MessageBox::warn1(SMESHGUI::desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"), + tr("SMESH_BUT_OK")); + } + break; + } case 4041: // REMOVES NODES { if(checkLock(aStudy)) break; @@ -1890,7 +1955,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) aTypes.append( SMESH::FACE ); aTypes.append( SMESH::VOLUME ); } - new SMESHGUI_FilterLibraryDlg( this, SMESH::GetDesktop( this ), aTypes, SMESHGUI_FilterLibraryDlg::EDIT ); + if (!myFilterLibraryDlg) + myFilterLibraryDlg = new SMESHGUI_FilterLibraryDlg( this, SMESH::GetDesktop( this ), aTypes, SMESHGUI_FilterLibraryDlg::EDIT ); + else if (myFilterLibraryDlg->isHidden()) + myFilterLibraryDlg->Init( aTypes, SMESHGUI_FilterLibraryDlg::EDIT ); + myFilterLibraryDlg->raise(); } break; @@ -2161,6 +2230,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( 414, "REVOLUTION", "ICON_REVOLUTION" ); createSMESHAction( 415, "MAP", "ICON_MAP" ); createSMESHAction( 416, "EXTRUSION_ALONG", "ICON_EXTRUSION_ALONG" ); + createSMESHAction( 417, "CONV_TO_QUAD", "ICON_CONV_TO_QUAD" ); createSMESHAction( 200, "RESET" ); createSMESHAction( 201, "SCALAR_BAR_PROP" ); createSMESHAction( 211, "WIRE", "ICON_WIRE", 0, true ); @@ -2188,6 +2258,13 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( 301, "DISPLAY" ); createSMESHAction( 302, "DISPLAY_ONLY" ); createSMESHAction( 4033, "POLYHEDRON", "ICON_DLG_POLYHEDRON" ); + createSMESHAction( 4034, "QUADRATIC_EDGE", "ICON_DLG_QUADRATIC_EDGE" ); + createSMESHAction( 4035, "QUADRATIC_TRIANGLE", "ICON_DLG_QUADRATIC_TRIANGLE" ); + createSMESHAction( 4036, "QUADRATIC_QUADRANGLE", "ICON_DLG_QUADRATIC_QUADRANGLE" ); + createSMESHAction( 4037, "QUADRATIC_TETRAHEDRON", "ICON_DLG_QUADRATIC_TETRAHEDRON" ); + createSMESHAction( 4038, "QUADRATIC_PYRAMID", "ICON_DLG_QUADRATIC_PYRAMID" ); + createSMESHAction( 4039, "QUADRATIC_PENTAHEDRON", "ICON_DLG_QUADRATIC_PENTAHEDRON" ); + createSMESHAction( 4040, "QUADRATIC_HEXAHEDRON", "ICON_DLG_QUADRATIC_HEXAHEDRON" ); // ----- create menu -------------- int fileId = createMenu( tr( "MEN_FILE" ), -1, 1 ), @@ -2267,6 +2344,14 @@ void SMESHGUI::initialize( CAM_Application* app ) createMenu( 4031, addId, -1 ); createMenu( 4032, addId, -1 ); createMenu( 4033, addId, -1 ); + createMenu( separator(), addId, -1 ); + createMenu( 4034, addId, -1 ); + createMenu( 4035, addId, -1 ); + createMenu( 4036, addId, -1 ); + createMenu( 4037, addId, -1 ); + createMenu( 4038, addId, -1 ); + createMenu( 4039, addId, -1 ); + createMenu( 4040, addId, -1 ); createMenu( 4041, removeId, -1 ); createMenu( 4042, removeId, -1 ); @@ -2292,6 +2377,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createMenu( 416, modifyId, -1 ); createMenu( 414, modifyId, -1 ); createMenu( 415, modifyId, -1 ); + createMenu( 417, modifyId, -1 ); createMenu( 214, viewId, -1 ); @@ -2343,6 +2429,14 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( 4032, addRemTb ); createTool( 4033, addRemTb ); createTool( separator(), addRemTb ); + createTool( 4034, addRemTb ); + createTool( 4035, addRemTb ); + createTool( 4036, addRemTb ); + createTool( 4037, addRemTb ); + createTool( 4038, addRemTb ); + createTool( 4039, addRemTb ); + createTool( 4040, addRemTb ); + createTool( separator(), addRemTb ); createTool( 4041, addRemTb ); createTool( 4042, addRemTb ); createTool( separator(), addRemTb ); @@ -2368,6 +2462,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( 416, modifyTb ); createTool( 414, modifyTb ); createTool( 415, modifyTb ); + createTool( 417, modifyTb ); createTool( 214, dispModeTb ); @@ -2380,12 +2475,13 @@ void SMESHGUI::initialize( CAM_Application* app ) group = pat.arg( SMESHGUI_Selection::typeName( GROUP ) ), hypo = pat.arg( SMESHGUI_Selection::typeName( HYPOTHESIS ) ), algo = pat.arg( SMESHGUI_Selection::typeName( ALGORITHM ) ), - elems = QString( "'%1' '%2' '%3' '%4' '%5'" ). + elems = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ). arg( SMESHGUI_Selection::typeName( SUBMESH_VERTEX ) ). arg( SMESHGUI_Selection::typeName( SUBMESH_EDGE ) ). arg( SMESHGUI_Selection::typeName( SUBMESH_FACE ) ). arg( SMESHGUI_Selection::typeName( SUBMESH_SOLID ) ). - arg( SMESHGUI_Selection::typeName( SUBMESH_COMPOUND ) ), + arg( SMESHGUI_Selection::typeName( SUBMESH_COMPOUND ) ). + arg( SMESHGUI_Selection::typeName( SUBMESH ) ), subMesh = elems, mesh_group = mesh + " " + subMesh + " " + group, hyp_alg = hypo + " " + algo; @@ -2544,7 +2640,7 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->insert( action( 6003 ), anId, -1 ); // FREE_BORDER popupMgr()->setRule( action( 6003 ), aMeshInVtkHasEdges, true ); - popupMgr()->setRule( action( 6003 ), "controlMode = 'eFreeEdges'", false ); + popupMgr()->setRule( action( 6003 ), "controlMode = 'eFreeBorders'", false ); popupMgr()->insert( action( 6001 ), anId, -1 ); // LENGTH popupMgr()->setRule( action( 6001 ), aMeshInVtkHasEdges, true ); @@ -2558,7 +2654,7 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->insert( action( 6002 ), anId, -1 ); // FREE_EDGE popupMgr()->setRule( action( 6002 ), aMeshInVtkHasFaces, true ); - popupMgr()->setRule( action( 6002 ), "controlMode = 'eFreeBorders'", false ); + popupMgr()->setRule( action( 6002 ), "controlMode = 'eFreeEdges'", false ); popupMgr()->insert( action( 6018 ), anId, -1 ); // LENGTH_2D popupMgr()->setRule( action( 6018 ), aMeshInVtkHasFaces, true ); @@ -2640,6 +2736,11 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) setMenuShown( true ); setToolShown( true ); + // Reset actions accelerator keys + action(111)->setAccel(QKeySequence(CTRL + Key_B)); // Import DAT + action(112)->setAccel(QKeySequence(CTRL + Key_U)); // Import UNV + action(113)->setAccel(QKeySequence(CTRL + Key_M)); // Import MED + return res; } @@ -2650,6 +2751,11 @@ bool SMESHGUI::deactivateModule( SUIT_Study* study ) EmitSignalCloseAllDialogs(); + // Unset actions accelerator keys + action(111)->setAccel(QKeySequence()); // Import DAT + action(112)->setAccel(QKeySequence()); // Import UNV + action(113)->setAccel(QKeySequence()); // Import MED + return SalomeApp_Module::deactivateModule( study ); } @@ -2878,11 +2984,8 @@ void SMESHGUI::createPreferences() void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) { if( sect=="SMESH" ){ - float sbX1=0.01, - sbW=0.05, - sbY1=0.01, - sbH=0.5; - + float sbX1,sbY1,sbW,sbH; + float aTol = 1.00000009999999; std::string aWarning; SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this); if( name=="selection_object_color" || name=="selection_element_color" || @@ -2892,7 +2995,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) else if (name == QString("scalar_bar_vertical_x") || name == QString("scalar_bar_vertical_width")){ sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_x", sbX1); sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_width", sbW); - if(sbX1+sbW > 1.0){ + if(sbX1+sbW > aTol){ aWarning = "Origin and Size Vertical: X+Width > 1\n"; aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x", sbX1); aResourceMgr->setValue("SMESH", "scalar_bar_vertical_width", sbW); @@ -2901,7 +3004,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) else if(name == QString("scalar_bar_vertical_y") || name == QString("scalar_bar_vertical_height")){ sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_y", sbY1); sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_height",sbH); - if(sbY1+sbH > 1.0){ + if(sbY1+sbH > aTol){ aWarning = "Origin and Size Vertical: Y+Height > 1\n"; aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y", sbY1); aResourceMgr->setValue("SMESH", "scalar_bar_vertical_height",sbH); @@ -2910,7 +3013,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) else if(name == QString("scalar_bar_horizontal_x") || name == QString("scalar_bar_horizontal_width")){ sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_x", sbX1); sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_width", sbW); - if(sbX1+sbW > 1.0){ + if(sbX1+sbW > aTol){ aWarning = "Origin and Size Horizontal: X+Width > 1\n"; sbX1=0.2; sbW=0.6; @@ -2921,7 +3024,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) else if(name == QString("scalar_bar_horizontal_y") || name == QString("scalar_bar_horizontal_height")){ sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_y", sbY1); sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_height",sbH); - if(sbY1+sbH > 1.0){ + if(sbY1+sbH > aTol){ aWarning = "Origin and Size Horizontal: Y+Height > 1\n"; sbY1=0.01; sbH=0.12; @@ -3012,6 +3115,9 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const case 704: // Edit mesh/sub-mesh op = new SMESHGUI_MeshOp( false ); break; + case 417: //convert to quadratic + op = new SMESHGUI_ConvToQuadOp(); + break; default: break; } @@ -3085,72 +3191,81 @@ void SMESHGUI::OnEditDelete() SALOME_ListIteratorOfListIO It(selected); aStudyBuilder->NewCommand(); // There is a transaction - for(; It.More(); It.Next()){ + for(; It.More(); It.Next()){ // loop on selected IO's Handle(SALOME_InteractiveObject) IObject = It.Value(); - if(IObject->hasEntry()){ - _PTR(SObject) SO = aStudy->FindObjectID(IObject->getEntry()); + if(IObject->hasEntry()) { + _PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry()); // disable removal of "SMESH" component object - if(SO->FindAttribute(anAttr, "AttributeIOR")){ + if(aSO->FindAttribute(anAttr, "AttributeIOR")){ anIOR = anAttr; if ( !strcmp( (char*)anIOR->Value().c_str(), engineIOR().latin1() ) ) continue; } - /* Erase child graphical objects */ - _PTR(ChildIterator) it = aStudy->NewChildIterator(SO); - for(it->InitEx(true); it->More(); it->Next()){ - _PTR(SObject) CSO = it->Value(); - if(CSO->FindAttribute(anAttr, "AttributeIOR")){ - anIOR = anAttr; + // put the whole hierarchy of sub-objects of the selected SO into a list and + // then treat them all starting from the deepest objects (at list back) + + list< _PTR(SObject) > listSO; + listSO.push_back( aSO ); + list< _PTR(SObject) >::iterator itSO = listSO.begin(); + for ( ; itSO != listSO.end(); ++itSO ) { + _PTR(ChildIterator) it = aStudy->NewChildIterator( *itSO ); + for (it->InitEx(false); it->More(); it->Next()) + listSO.push_back( it->Value() ); + } + + // treat SO's in the list starting from the back + + list< _PTR(SObject) >::reverse_iterator ritSO = listSO.rbegin(); + for ( ; ritSO != listSO.rend(); ++ritSO ) { + _PTR(SObject) SO = *ritSO; + if ( !SO ) continue; + string anEntry = SO->GetID(); + /** Erase graphical object **/ + if(SO->FindAttribute(anAttr, "AttributeIOR")){ QPtrVector aViews = vm->getViews(); for(int i = 0; i < nbSf; i++){ SUIT_ViewWindow *sf = aViews[i]; - CORBA::String_var anEntry = CSO->GetID().c_str(); - if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.in())){ + if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){ SMESH::RemoveActor(sf,anActor); } } } - } - /* Erase main graphical object */ - QPtrVector aViews = vm->getViews(); - for(int i = 0; i < nbSf; i++){ - SUIT_ViewWindow *sf = aViews[i]; - if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,IObject->getEntry())){ - SMESH::RemoveActor(sf,anActor); - } - } - - // Remove object(s) from data structures - _PTR(SObject) obj = aStudy->FindObjectID(IObject->getEntry()); - if(obj){ - SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( obj ) ); - SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( obj ) ); - QString objType = CheckTypeObject(IObject); - if ( !aGroup->_is_nil() ) { // DELETE GROUP - SMESH::SMESH_Mesh_var aMesh = aGroup->GetMesh(); - aMesh->RemoveGroup( aGroup ); - } - else if ( !aSubMesh->_is_nil() ) { // DELETE SUBMESH - SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather(); - aMesh->RemoveSubMesh( aSubMesh ); - } - else if ( objType == "Hypothesis" || objType == "Algorithm" ) {// DELETE HYPOTHESIS - SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject); - aStudyBuilder->RemoveObjectWithChildren( obj ); - } - else {// default action: remove SObject from the study - // san - it's no use opening a transaction here until UNDO/REDO is provided in SMESH - //SUIT_Operation *op = new SALOMEGUI_ImportOperation(myActiveStudy); - //op->start(); - aStudyBuilder->RemoveObjectWithChildren( obj ); - //op->finish(); - } - } + /** Remove an object from data structures **/ + SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO )); + SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( SO )); + if ( !aGroup->_is_nil() ) { // DELETE GROUP + SMESH::SMESH_Mesh_var aMesh = aGroup->GetMesh(); + aMesh->RemoveGroup( aGroup ); + } + else if ( !aSubMesh->_is_nil() ) { // DELETE SUBMESH + SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather(); + aMesh->RemoveSubMesh( aSubMesh ); + _PTR(SObject) aMeshSO = SMESH::FindSObject(aMesh); + if (aMeshSO) + SMESH::ModifiedMesh(aMeshSO, false); + } + else { + IObject = new SALOME_InteractiveObject + ( anEntry.c_str(), engineIOR().latin1(), SO->GetName().c_str() ); + QString objType = CheckTypeObject(IObject); + if ( objType == "Hypothesis" || objType == "Algorithm" ) {// DELETE HYPOTHESIS + SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject); + aStudyBuilder->RemoveObjectWithChildren( SO ); + } + else {// default action: remove SObject from the study + // san - it's no use opening a transaction here until UNDO/REDO is provided in SMESH + //SUIT_Operation *op = new SALOMEGUI_ImportOperation(myActiveStudy); + //op->start(); + aStudyBuilder->RemoveObjectWithChildren( SO ); + //op->finish(); + } + } + } /* listSO back loop */ } /* IObject->hasEntry() */ } /* more/next */ aStudyBuilder->CommitCommand(); @@ -3160,4 +3275,4 @@ void SMESHGUI::OnEditDelete() aSel->setSelectedObjects( l1 ); SMESHGUI::GetSMESHGUI()->updateObjBrowser(); - } \ No newline at end of file + } diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index 7b062275b..7dbab6471 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -50,6 +50,8 @@ class LightApp_Operation; class SalomeApp_Study; class LightApp_SelectionMgr; +class SMESHGUI_FilterLibraryDlg; + //================================================================================= // class : SMESHGUI @@ -140,6 +142,8 @@ private : int myState; QMap myRules; LightApp_Displayer* myDisplayer; + + SMESHGUI_FilterLibraryDlg* myFilterLibraryDlg; }; #endif diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx index 7a396fd41..d7b4cb35b 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -39,6 +39,8 @@ #include "SMESH_Actor.h" #include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "LightApp_Application.h" #include "SVTK_Selection.h" #include "SVTK_Selector.h" @@ -119,7 +121,7 @@ namespace SMESH { myPreviewActor->VisibilityOff(); myPreviewActor->SetMapper(myMapper); - float anRGB[3]; + vtkFloatingPointType anRGB[3]; vtkProperty* aProp = vtkProperty::New(); GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) ); aProp->SetColor( anRGB[0], anRGB[1], anRGB[2] ); @@ -243,20 +245,34 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule, } QString elemName; - if (myNbNodes == 2) + if (myNbNodes == 2) { elemName = "EDGE"; - else if (myNbNodes == 3) + myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_edges"; + } + else if (myNbNodes == 3) { elemName = "TRIANGLE"; + myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_triangles"; + } else if (myNbNodes == 4) - if (myElementType == SMDSAbs_Face) + if (myElementType == SMDSAbs_Face) { elemName = "QUADRANGLE"; - else + myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_quadrangles"; + } + else { elemName = "TETRAS"; - else if (myNbNodes == 8) + myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_tetrahedrons"; + } + else if (myNbNodes == 8) { elemName = "HEXAS"; - else if (myElementType == SMDSAbs_Face){ + myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_hexahedrons"; + } + else if (myElementType == SMDSAbs_Face) { elemName = "POLYGON"; myIsPoly = true; + myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_polygons"; + } + else if (myElementType == SMDSAbs_Volume) { + myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_polyhedrons"; } QString iconName = tr(QString("ICON_DLG_%1").arg(elemName)); @@ -326,6 +342,11 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule, buttonOk->setAutoDefault(TRUE); buttonOk->setDefault(TRUE); GroupButtonsLayout->addWidget(buttonOk, 0, 0); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); + SMESHGUI_AddMeshElementDlgLayout->addWidget(GroupButtons, 2, 0); /***************************************************************/ @@ -400,6 +421,7 @@ void SMESHGUI_AddMeshElementDlg::Init() connect(buttonOk, SIGNAL(clicked()), SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp())); connect(SelectButtonC1A1, SIGNAL(clicked()), SLOT(SetEditCurrentArgument())); connect(LineEditC1A1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); @@ -411,10 +433,6 @@ void SMESHGUI_AddMeshElementDlg::Init() if (Reverse) connect(Reverse, SIGNAL(stateChanged(int)), SLOT(CheckBox(int))); - // Move widget on the botton right corner of main widget - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); // displays Dialog // set selection mode @@ -450,8 +468,14 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply() switch (myElementType) { case SMDSAbs_Edge: aMeshEditor->AddEdge(anArrayOfIdeces.inout()); break; - case SMDSAbs_Face: - aMeshEditor->AddFace(anArrayOfIdeces.inout()); break; + case SMDSAbs_Face:{ + if(myIsPoly) + aMeshEditor->AddPolygonalFace(anArrayOfIdeces.inout()); + else + aMeshEditor->AddFace(anArrayOfIdeces.inout()); + break; + + } case SMDSAbs_Volume: aMeshEditor->AddVolume(anArrayOfIdeces.inout()); break; default:; @@ -501,6 +525,23 @@ void SMESHGUI_AddMeshElementDlg::ClickOnCancel() return; } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_AddMeshElementDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : onTextChange() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h index 9b9e71f8f..f7bd8604b 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -108,6 +108,7 @@ private: QPushButton * buttonOk; QPushButton * buttonCancel; QPushButton * buttonApply; + QPushButton * buttonHelp; QGroupBox * GroupC1; QLabel * TextLabelC1A1; QPushButton * SelectButtonC1A1; @@ -115,11 +116,14 @@ private: QCheckBox * Reverse; + QString myHelpFileName; + private slots: void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); void SetEditCurrentArgument() ; void SelectionIntoArgument() ; void DeactivateActiveDialog() ; diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx index 5bac21893..e513577b9 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -37,12 +37,13 @@ #include "SUIT_Session.h" #include "SUIT_OverrideCursor.h" +#include "SUIT_MessageBox.h" #include "SALOME_ListIO.hxx" #include "SALOME_InteractiveObject.hxx" #include "SALOME_ListIteratorOfListIO.hxx" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" #include "SVTK_Selector.h" @@ -158,7 +159,7 @@ protected: myActor->SetInfinitive(true); myActor->SetMapper(myMapper); - float anRGB[3]; + vtkFloatingPointType anRGB[3]; vtkProperty* aProp = vtkProperty::New(); SMESH::GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) ); aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]); @@ -324,6 +325,10 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg (SMESHGUI* theModule, buttonOk->setAutoDefault(TRUE); buttonOk->setDefault(TRUE); GroupButtonsLayout->addWidget(buttonOk, 0, 0); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); SMESHGUI_ClippingDlgLayout->addWidget(GroupPlanes, 0, 0); SMESHGUI_ClippingDlgLayout->addWidget(GroupParameters, 1, 0); @@ -344,6 +349,8 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg (SMESHGUI* theModule, myIsSelectPlane = false; onSelectionChanged(); + myHelpFileName = "clipping.htm"; + // signals and slots connections : connect(ComboBoxPlanes, SIGNAL(activated(int)), this, SLOT(onSelectPlane(int))); connect(buttonNew, SIGNAL(clicked()), this, SLOT(ClickOnNew())); @@ -357,15 +364,12 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg (SMESHGUI* theModule, connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnOk())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged())); /* to close dialog if study frame change */ connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), this, SLOT(ClickOnCancel())); - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); } @@ -391,6 +395,10 @@ void SMESHGUI_ClippingDlg::ClickOnApply() if (SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow(mySMESHGUI)) { SUIT_OverrideCursor wc; + + QWidget *aCurrWid = this->focusWidget(); + aCurrWid->clearFocus(); + aCurrWid->setFocus(); myActor->RemoveAllClippingPlanes(); @@ -425,6 +433,23 @@ void SMESHGUI_ClippingDlg::ClickOnCancel() close(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_ClippingDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : onSelectionChanged() // purpose : Called when selection is changed @@ -631,18 +656,18 @@ void SMESHGUI_ClippingDlg::SetCurrentPlaneParam() OrientedPlane* aPlane = myPlanes[aCurPlaneIndex].GetPointer(); - float aNormal[3]; + vtkFloatingPointType aNormal[3]; SMESH::Orientation anOrientation; - float aDir[3][3] = {{0, 0, 0}, {0, 0, 0}}; + vtkFloatingPointType aDir[3][3] = {{0, 0, 0}, {0, 0, 0}}; { static double aCoeff = vtkMath::Pi()/180.0; - float aRot[2] = {getRotation1(), getRotation2()}; + vtkFloatingPointType aRot[2] = {getRotation1(), getRotation2()}; aPlane->myAngle[0] = aRot[0]; aPlane->myAngle[1] = aRot[1]; - float anU[2] = {cos(aCoeff*aRot[0]), cos(aCoeff*aRot[1])}; - float aV[2] = {sqrt(1.0-anU[0]*anU[0]), sqrt(1.0-anU[1]*anU[1])}; + vtkFloatingPointType anU[2] = {cos(aCoeff*aRot[0]), cos(aCoeff*aRot[1])}; + vtkFloatingPointType aV[2] = {sqrt(1.0-anU[0]*anU[0]), sqrt(1.0-anU[1]*anU[1])}; aV[0] = aRot[0] > 0? aV[0]: -aV[0]; aV[1] = aRot[1] > 0? aV[1]: -aV[1]; @@ -690,37 +715,37 @@ void SMESHGUI_ClippingDlg::SetCurrentPlaneParam() myActor->SetPlaneParam(aNormal, getDistance(), aPlane); vtkDataSet* aDataSet = myActor->GetInput(); - float *aPnt = aDataSet->GetCenter(); + vtkFloatingPointType *aPnt = aDataSet->GetCenter(); - float* anOrigin = aPlane->GetOrigin(); - float aDel = aDataSet->GetLength()/2.0; + vtkFloatingPointType* anOrigin = aPlane->GetOrigin(); + vtkFloatingPointType aDel = aDataSet->GetLength()/2.0; - float 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}}; - float aParam, aPnt0[3], aPnt1[3], aPnt2[3]; + 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}}; + vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3]; - float 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]}; - float aPnt02[3] = {aPnt01[0] + aNormal[0], - aPnt01[1] + aNormal[1], - aPnt01[2] + aNormal[2]}; + 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]}; + vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0], + aPnt01[1] + aNormal[1], + aPnt01[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0); - float 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]}; - float aPnt12[3] = {aPnt11[0] + aNormal[0], - aPnt11[1] + aNormal[1], - aPnt11[2] + aNormal[2]}; + 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]}; + vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0], + aPnt11[1] + aNormal[1], + aPnt11[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1); - float 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]}; - float aPnt22[3] = {aPnt21[0] + aNormal[0], - aPnt21[1] + aNormal[1], - aPnt21[2] + aNormal[2]}; + 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]}; + vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0], + aPnt21[1] + aNormal[1], + aPnt21[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2); vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource; diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.h b/src/SMESHGUI/SMESHGUI_ClippingDlg.h index 463257cc9..c49b5a6cb 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.h +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -113,8 +113,10 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; bool myIsSelectPlane; + QString myHelpFileName; public slots: @@ -128,6 +130,7 @@ public slots: void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); }; #endif // DIALOGBOX_TRANSPARENCYDLG_H diff --git a/src/SMESHGUI/SMESHGUI_CreateHypothesesDlg.cxx b/src/SMESHGUI/SMESHGUI_CreateHypothesesDlg.cxx deleted file mode 100644 index 32e4860ac..000000000 --- a/src/SMESHGUI/SMESHGUI_CreateHypothesesDlg.cxx +++ /dev/null @@ -1,299 +0,0 @@ -// SMESH SMESHGUI : GUI for SMESH component -// -// Copyright (C) 2003 CEA -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org -// -// -// -// File : SMESHGUI_CreateHypothesesDlg.cxx -// Author : Julia DOROVSKIKH -// Module : SMESH -// $Header$ - -#include "SMESHGUI_CreateHypothesesDlg.h" - -#include "SMESHGUI_HypothesesUtils.h" -#include "SMESHGUI_Hypotheses.h" -#include "SMESHGUI_Utils.h" -#include "SMESHGUI.h" - -#include "SUIT_Desktop.h" -#include "SUIT_ResourceMgr.h" - -#include "SALOME_ListIteratorOfListIO.hxx" - -#include "utilities.h" - -// QT Includes -#include -#include -#include -#include -#include -#include - -using namespace std; - -//================================================================================= -// function : SMESHGUI_CreateHypothesesDlg() -// purpose : Constructs a SMESHGUI_CreateHypothesesDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -SMESHGUI_CreateHypothesesDlg::SMESHGUI_CreateHypothesesDlg (SMESHGUI* theModule, - const char* name, - bool modal, - bool isAlgo) - : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | - WStyle_Title | WStyle_SysMenu | WDestructiveClose), - myIsAlgo(isAlgo), - mySMESHGUI( theModule ) -{ - if (!name) - setName("SMESHGUI_CreateHypothesesDlg"); - setCaption(isAlgo ? tr("SMESH_CREATE_ALGORITHMS" ) : tr("SMESH_CREATE_HYPOTHESES" )); - setSizeGripEnabled(TRUE); - - QGridLayout* SMESHGUI_CreateHypothesesDlgLayout = new QGridLayout(this); - SMESHGUI_CreateHypothesesDlgLayout->setSpacing(6); - SMESHGUI_CreateHypothesesDlgLayout->setMargin(11); - - /***************************************************************/ - GroupAlgorithms = new QGroupBox(this, "GroupAlgorithms"); - GroupAlgorithms->setTitle(isAlgo ? tr("SMESH_AVAILABLE_ALGORITHMS") : tr("SMESH_AVAILABLE_HYPOTHESES")); - GroupAlgorithms->setColumnLayout(0, Qt::Vertical); - GroupAlgorithms->layout()->setSpacing(0); - GroupAlgorithms->layout()->setMargin(0); - - QGridLayout* hypLayout = new QGridLayout(GroupAlgorithms->layout()); - hypLayout->setGeometry(QRect(12, 18, 139, 250)); - hypLayout->setAlignment(Qt::AlignTop); - hypLayout->setSpacing(6); - hypLayout->setMargin(11); - - ListAlgoDefinition = new QListView(GroupAlgorithms, "ListAlgoDefinition"); - ListAlgoDefinition->setMinimumSize(400, 200); - ListAlgoDefinition->addColumn(""); - ListAlgoDefinition->header()->hide(); - ListAlgoDefinition->setSelectionMode(QListView::Single); - ListAlgoDefinition->setResizeMode(QListView::AllColumns); - ListAlgoDefinition->setRootIsDecorated(true); - - hypLayout->addWidget(ListAlgoDefinition, 0, 0); - SMESHGUI_CreateHypothesesDlgLayout->addWidget(GroupAlgorithms, 0, 0); - - /***************************************************************/ - GroupButtons = new QGroupBox(this, "GroupButtons"); - GroupButtons->setColumnLayout(0, Qt::Vertical); - GroupButtons->layout()->setSpacing(0); - GroupButtons->layout()->setMargin(0); - QGridLayout* GroupButtonsLayout = new QGridLayout(GroupButtons->layout()); - GroupButtonsLayout->setAlignment(Qt::AlignTop); - GroupButtonsLayout->setSpacing(6); - GroupButtonsLayout->setMargin(11); - - buttonApply = new QPushButton(GroupButtons, "buttonApply"); - buttonApply->setText(tr("SMESH_BUT_CREATE" )); - buttonApply->setAutoDefault(TRUE); - buttonApply->setDefault(FALSE); - buttonApply->setEnabled(FALSE); - GroupButtonsLayout->addWidget(buttonApply, 0, 1); - - QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - GroupButtonsLayout->addItem(spacer_9, 0, 2); - - buttonCancel = new QPushButton(GroupButtons, "buttonCancel"); - buttonCancel->setText(tr("SMESH_BUT_CLOSE" )); - buttonCancel->setAutoDefault(TRUE); - buttonCancel->setDefault(TRUE); - buttonCancel->setEnabled(TRUE); - GroupButtonsLayout->addWidget(buttonCancel, 0, 3); - - SMESHGUI_CreateHypothesesDlgLayout->addWidget(GroupButtons, 1, 0); - /***************************************************************/ - - Init(); -} - -//================================================================================= -// function : ~SMESHGUI_CreateHypothesesDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -SMESHGUI_CreateHypothesesDlg::~SMESHGUI_CreateHypothesesDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void SMESHGUI_CreateHypothesesDlg::Init() -{ - mySMESHGUI->SetActiveDialogBox((QDialog*)this); - - InitAlgoDefinition(); - - /* signals and slots connections */ - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(buttonApply , SIGNAL(clicked()), this, SLOT(ClickOnApply())); - -// connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - - connect(ListAlgoDefinition, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); - connect(ListAlgoDefinition, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(onDoubleClicked(QListViewItem*))); - - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); - this->show(); -} - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void SMESHGUI_CreateHypothesesDlg::ClickOnCancel() -{ - close(); -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -void SMESHGUI_CreateHypothesesDlg::ClickOnApply() -{ - if (mySMESHGUI->isActiveStudyLocked()) - return; - QListViewItem* item = ListAlgoDefinition->selectedItem(); - if (!item) - return; - QString aHypType = item->text(1); - MESSAGE("Apply " << aHypType); - char* sHypType = (char*)aHypType.latin1(); - - HypothesisData* aHypData = SMESH::GetHypothesisData(sHypType); - if (!aHypData) - return; - QString aClientLibName = aHypData->ClientLibName; - MESSAGE("Client lib name = " << aClientLibName); - - if (aClientLibName == "") { - // Call hypothesis creation server method (without GUI) - QString aHypName = aHypData->Label; - SMESH::CreateHypothesis(sHypType, aHypName, myIsAlgo); - } else { - // Get hypotheses creator client (GUI) - SMESHGUI_GenericHypothesisCreator* aCreator = - SMESH::GetHypothesisCreator(sHypType); - - if( aCreator ) - // Create hypothesis/algorithm - aCreator->create( myIsAlgo, this ); - else - { - // report about error - } - } - -// buttonApply->setEnabled(FALSE); - return; -} - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void SMESHGUI_CreateHypothesesDlg::ActivateThisDialog() -{ - mySMESHGUI->EmitSignalDeactivateDialog(); - GroupButtons->setEnabled(true); - return; -} - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void SMESHGUI_CreateHypothesesDlg::enterEvent (QEvent*) -{ - ActivateThisDialog(); - return; -} - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_CreateHypothesesDlg::closeEvent (QCloseEvent* e) -{ - mySMESHGUI->ResetState(); - QDialog::closeEvent(e); -} - -//================================================================================= -// function : onSelectionChanged() -// purpose : -//================================================================================= -void SMESHGUI_CreateHypothesesDlg::onSelectionChanged() -{ - QListViewItem* item = ListAlgoDefinition->selectedItem(); - buttonApply->setEnabled(item && item->depth() > 0); -} - -//================================================================================= -// function : onDoubleClicked() -// purpose : -//================================================================================= -void SMESHGUI_CreateHypothesesDlg::onDoubleClicked (QListViewItem* i) -{ - if (i && i->depth() > 0) - this->ClickOnApply(); -} - -//================================================================================= -// function : InitAlgoDefinition() -// purpose : -//================================================================================= -void SMESHGUI_CreateHypothesesDlg::InitAlgoDefinition() -{ - ListAlgoDefinition->clear(); - QStringList HypList = SMESH::GetAvailableHypotheses(myIsAlgo); - for (int i = 0; i < HypList.count(); ++i) { - HypothesisData* aHypData = SMESH::GetHypothesisData(HypList[i]); - QListViewItem* parentItem = 0; - QListViewItem* childItem = ListAlgoDefinition->firstChild(); - while (childItem) { - if (childItem->text(0) == aHypData->PluginName) { - parentItem = childItem; - break; - } - childItem = childItem->nextSibling(); - } - if (!parentItem) - parentItem = new QListViewItem(ListAlgoDefinition, aHypData->PluginName); - parentItem->setOpen(true); - QListViewItem* aItem = new QListViewItem(parentItem, aHypData->Label, HypList[i]); - QPixmap aPixMap (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr(aHypData->IconId))); - if (!aPixMap.isNull()) - aItem->setPixmap(0, aPixMap); - } -} diff --git a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx index caa762e9e..b7710809f 100755 --- a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx @@ -1,723 +1,746 @@ -// SMESH SMESHGUI : GUI for SMESH component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SMESHGUI_CreatePatternDlg.cxx -// Author : Sergey LITONIN -// Module : SMESH - -#include "SMESHGUI_CreatePatternDlg.h" - -#include "SMESHGUI.h" -#include "SMESHGUI_SpinBox.h" -#include "SMESHGUI_PatternWidget.h" -#include "SMESHGUI_Utils.h" -#include "SMESHGUI_VTKUtils.h" -#include "SMESHGUI_PatternUtils.h" -#include "SMESHGUI_GEOMGenUtils.h" - -#include "SMESH_NumberFilter.hxx" - -#include "SUIT_ResourceMgr.h" -#include "SUIT_Desktop.h" -#include "SUIT_FileDlg.h" - -#include "SalomeApp_Study.h" -#include "LightApp_DataOwner.h" -#include "LightApp_SelectionMgr.h" -#include "SalomeApp_Tools.h" - -#include "SALOMEDS_SObject.hxx" - -#include "SALOME_ListIO.hxx" -#include "SVTK_ViewModel.h" -#include "SVTK_ViewWindow.h" -#include "SVTK_Selector.h" -#include "SVTK_Selection.h" - -// OCCT Includes -#include - -// QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define SPACING 5 -#define MARGIN 10 - -/*! - * Class : SMESHGUI_CreatePatternDlg - * Description : Dialog to specify filters for VTK viewer - */ - -//======================================================================= -// function : SMESHGUI_CreatePatternDlg() -// purpose : Constructor -//======================================================================= -SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI* theModule, - const int theType, - const char* theName) - : QDialog( SMESH::GetDesktop( theModule ), theName, false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), - mySMESHGUI( theModule ), - mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ) -{ - setCaption(tr("CAPTION")); - - QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING); - - QFrame* aMainFrame = createMainFrame (this); - QFrame* aBtnFrame = createButtonFrame(this); - - aDlgLay->addWidget(aMainFrame); - aDlgLay->addWidget(aBtnFrame); - - aDlgLay->setStretchFactor(aMainFrame, 1); - - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - mySelector = aViewWindow->GetSelector(); - - Init(theType); -} - -//======================================================================= -// function : createMainFrame() -// purpose : Create frame containing dialog's input fields -//======================================================================= -QFrame* SMESHGUI_CreatePatternDlg::createMainFrame (QWidget* theParent) -{ - QPixmap iconSlct (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT"))); - QPixmap icon2d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_2d"))); - QPixmap icon3d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_3d"))); - QPixmap iconSample2d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_2D"))); - - QGroupBox* aMainGrp = new QGroupBox(1, Qt::Horizontal, theParent); - aMainGrp->setFrameStyle(QFrame::NoFrame); - aMainGrp->setInsideMargin(0); - - // Pattern type group - - myTypeGrp = new QButtonGroup (1, Qt::Vertical, tr("PATTERN_TYPE"), aMainGrp); - mySwitch2d = new QRadioButton (myTypeGrp); - mySwitch3d = new QRadioButton (myTypeGrp); - mySwitch2d->setPixmap(icon2d); - mySwitch3d->setPixmap(icon3d); - myTypeGrp->insert(mySwitch2d, Type_2d); - myTypeGrp->insert(mySwitch3d, Type_3d); - - QGroupBox* aPatternGrp = new QGroupBox(1, Qt::Horizontal, tr("PATTERN"), aMainGrp); - - // Mesh and pattern name group - - QGroupBox* aMeshGrp = new QGroupBox(1, Qt::Vertical, aPatternGrp); - aMeshGrp->setFrameStyle(QFrame::NoFrame); - aMeshGrp->setInsideMargin(0); - - new QLabel(tr("MESH_OR_SUBMESH"), aMeshGrp); - - QPushButton* aSelBtn = new QPushButton(aMeshGrp); - aSelBtn->setPixmap(iconSlct); - myMeshEdit = new QLineEdit(aMeshGrp); - myMeshEdit->setReadOnly(true); - - QGroupBox* aPattGrp = new QGroupBox(1, Qt::Vertical, aPatternGrp); - aPattGrp->setFrameStyle(QFrame::NoFrame); - aPattGrp->setInsideMargin(0); - - new QLabel(tr("PATTERN_NAME"), aPattGrp); - myName = new QLineEdit(aPattGrp); - - // Picture 2d - - myPicture2d = new SMESHGUI_PatternWidget(aPatternGrp), - myPicture2d->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); - - // Project check box - - myProjectChk = new QCheckBox(tr("PROJECT"), aPatternGrp); - - // Connect signals and slots - - connect(myTypeGrp, SIGNAL(clicked(int) ), SLOT(onTypeChanged(int))); - connect(myProjectChk, SIGNAL(toggled(bool)), SLOT(onProject(bool) )); - connect(aSelBtn, SIGNAL(clicked() ), SLOT(onSelBtnClicked())); - - return aMainGrp; -} - -//======================================================================= -// function : createButtonFrame() -// purpose : Create frame containing buttons -//======================================================================= -QFrame* SMESHGUI_CreatePatternDlg::createButtonFrame (QWidget* theParent) -{ - QFrame* aFrame = new QFrame(theParent); - aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken); - - myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame); - mySaveBtn = new QPushButton(tr("SAVE" ), aFrame); - myCloseBtn = new QPushButton(tr("SMESH_BUT_CANCEL"), aFrame); - - QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); - - QHBoxLayout* aLay = new QHBoxLayout(aFrame, MARGIN, SPACING); - - aLay->addWidget(myOkBtn); - aLay->addWidget(mySaveBtn); - aLay->addItem(aSpacer); - aLay->addWidget(myCloseBtn); - - connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); - connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); - connect(mySaveBtn, SIGNAL(clicked()), SLOT(onSave())); - - return aFrame; -} - -//======================================================================= -// function : ~SMESHGUI_CreatePatternDlg() -// purpose : Destructor -//======================================================================= -SMESHGUI_CreatePatternDlg::~SMESHGUI_CreatePatternDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -//======================================================================= -// function : onProject() -// purpose : SLOT. Called when state of "Project nodes on ther face" -// checkbox is changed -//======================================================================= -void SMESHGUI_CreatePatternDlg::onProject (bool) -{ - loadFromObject(false); - displayPreview(); -} - -//======================================================================= -// function : Init() -// purpose : Init dialog fields, connect signals and slots, show dialog -//======================================================================= -void SMESHGUI_CreatePatternDlg::Init( const int theType ) -{ - myIsLoaded = false; - myType = -1; - myNbPoints = -1; - mySubMesh = SMESH::SMESH_subMesh::_nil(); - myMesh = SMESH::SMESH_Mesh::_nil(); - myGeomObj = GEOM::GEOM_Object::_nil(); - myPattern = SMESH::SMESH_Pattern::_nil(); - - erasePreview(); - - mySMESHGUI->SetActiveDialogBox((QDialog*)this); - - // selection and SMESHGUI - connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); - connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); - - mySwitch2d->setEnabled(theType == Type_2d); - mySwitch3d->setEnabled(theType == Type_3d); - - if (theType == Type_2d) - myProjectChk->show(); - else - myProjectChk->hide(); - - myTypeGrp->setButton(theType); - onTypeChanged(theType); - - myName->setText(getDefaultName()); - myMeshEdit->setText(""); - - setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); - qApp->processEvents(); - updateGeometry(); - myPicture2d->updateGeometry(); - adjustSize(); - resize(minimumSize()); - - activateSelection(); - onSelectionDone(); - - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); - this->show(); -} - -//======================================================================= -// function : SetMesh() -// purpose : Set mesh to dialog -//======================================================================= -void SMESHGUI_CreatePatternDlg::SetMesh (SMESH::SMESH_Mesh_ptr thePtr) -{ - myMesh = SMESH::SMESH_Mesh::_duplicate(thePtr); - mySubMesh = SMESH::SMESH_subMesh::_nil(); - - bool isValidMesh = false; - if (!myMesh->_is_nil()) - { - _PTR(SObject) aSobj = SMESH::FindSObject(myMesh.in()); - //Handle(SALOME_InteractiveObject) anIObj = - // new SALOME_InteractiveObject(aSobj->GetID().c_str(), "SMESH"); - SUIT_DataOwnerPtr anIObj (new LightApp_DataOwner(aSobj->GetID().c_str())); - - isValidMesh = mySelectionMgr->isOk(anIObj); - } - - if (isValidMesh) { - _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in()); - myMeshEdit->setText(aSO->GetName().c_str()); - myGeomObj = SMESH::GetGeom(aSO); - } else { - myMeshEdit->setText(""); - myGeomObj = GEOM::GEOM_Object::_nil(); - } - - if (myType == Type_2d) { - loadFromObject(false); - displayPreview(); - } -} - -//======================================================================= -// function : isValid() -// purpose : Verify validity of entry data -//======================================================================= -bool SMESHGUI_CreatePatternDlg::isValid() -{ - if (myGeomObj->_is_nil()) { - QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ), - tr("SMESH_INSUFFICIENT_DATA"), - tr("SMESHGUI_INVALID_PARAMETERS"), - QMessageBox::Ok); - return false; - } - else - return true; -} - -//======================================================================= -// function : getDefaultName() -// purpose : Get default pattern name -//======================================================================= -QString SMESHGUI_CreatePatternDlg::getDefaultName() const -{ - return myType == Type_2d ? tr("DEFAULT_2D") : tr("DEFAULT_3D"); -} - -//======================================================================= -// function : onSave() -// purpose : SLOT called when "Save" button pressed. Build pattern and -// save it to disk -//======================================================================= -void SMESHGUI_CreatePatternDlg::onSave() -{ - try { - if (!isValid()) - return; - - if (!myIsLoaded) - loadFromObject(true); - - // Load pattern from object - if (!myIsLoaded) - return; - - /////////////////////////////////////////////////////// - SUIT_FileDlg* aDlg = new SUIT_FileDlg (this, false); - aDlg->setCaption(tr("SAVE_PATTERN")); - aDlg->setMode(QFileDialog::AnyFile); - aDlg->setFilters(tr("PATTERN_FILT")); - if (myName->text() != "") - aDlg->setSelection(myName->text()); - - if (aDlg->exec() != Accepted) - return; - - QString fName = aDlg->selectedFile(); - if (fName.isEmpty()) - return; - - if (QFileInfo(fName).extension().isEmpty()) - fName = autoExtension(fName); - - fName = QDir::convertSeparators(fName); - - QString aData (myPattern->GetString()); - long aLen = aData.length(); - - QFile aFile (fName); - aFile.open(IO_WriteOnly); - long aWritten = aFile.writeBlock(aData, aLen); - aFile.close(); - - if (aWritten != aLen) { - QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ), tr("SMESH_ERROR"), - tr("ERROR_OF_SAVING"), QMessageBox::Ok); - } else { - //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); - disconnect(mySelectionMgr, 0, this, 0); - disconnect(mySMESHGUI, 0, this, 0); - mySMESHGUI->ResetState(); - accept(); - emit NewPattern(); - } - } catch (const SALOME::SALOME_Exception& S_ex) { - SalomeApp_Tools::QtCatchCorbaException(S_ex); - } catch (...) { - } -} - -//======================================================================= -// function : GetPatternName() -// purpose : Get name of pattern -//======================================================================= -QString SMESHGUI_CreatePatternDlg::GetPatternName() const -{ - return myName->text(); -} - -//======================================================================= -// function : GetPattern() -// purpose : Get result pattern -//======================================================================= -SMESH::SMESH_Pattern_ptr SMESHGUI_CreatePatternDlg::GetPattern() -{ - return myPattern.in(); -} - -//======================================================================= -// function : onOk() -// purpose : SLOT called when "Ok" button pressed. -//======================================================================= -void SMESHGUI_CreatePatternDlg::onOk() -{ - try { - if (!isValid()) - return; - - if (!myIsLoaded) - loadFromObject(true); - - // Load pattern from object - if (!myIsLoaded) { - return; - } else { - //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); - disconnect(mySelectionMgr, 0, this, 0); - disconnect(mySMESHGUI, 0, this, 0); - mySMESHGUI->ResetState(); - accept(); - emit NewPattern(); - } - } catch (const SALOME::SALOME_Exception& S_ex) { - SalomeApp_Tools::QtCatchCorbaException(S_ex); - } catch (...) { - } -} - -//======================================================================= -// function : onClose() -// purpose : SLOT called when "Close" button pressed. Close dialog -//======================================================================= -void SMESHGUI_CreatePatternDlg::onClose() -{ - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); - disconnect(mySelectionMgr, 0, this, 0); - disconnect(mySMESHGUI, 0, this, 0); - mySMESHGUI->ResetState(); - reject(); - emit Close(); -} - -//======================================================================= -// function : loadFromObject() -// purpose : Load pattern from geom object corresponding to the mesh/submesh -//======================================================================= -bool SMESHGUI_CreatePatternDlg::loadFromObject (const bool theMess) -{ - try { - myIsLoaded = false; - - if (myPattern->_is_nil()) - myPattern = SMESH::GetPattern(); - - if (myMesh->_is_nil() && mySubMesh->_is_nil() || myGeomObj->_is_nil()) - return false; - - SMESH::SMESH_Mesh_ptr aMesh = mySubMesh->_is_nil() ? myMesh.in() : mySubMesh->GetFather(); - - myIsLoaded = myType == Type_2d - ? myPattern->LoadFromFace(aMesh, myGeomObj, myProjectChk->isChecked()) - : myPattern->LoadFrom3DBlock(aMesh, myGeomObj); - - if (!myIsLoaded && theMess) { - QString aMess; - SMESH::SMESH_Pattern::ErrorCode aCode = myPattern->GetErrorCode(); - - if (aCode == SMESH::SMESH_Pattern::ERR_LOAD_EMPTY_SUBMESH ) aMess = tr("ERR_LOAD_EMPTY_SUBMESH"); - else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_NARROW_FACE ) aMess = tr("ERR_LOADF_NARROW_FACE"); - else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_CLOSED_FACE ) aMess = tr("ERR_LOADF_CLOSED_FACE"); - else if (aCode == SMESH::SMESH_Pattern::ERR_LOADV_BAD_SHAPE ) aMess = tr("ERR_LOADV_BAD_SHAPE"); - else if (aCode == SMESH::SMESH_Pattern::ERR_LOADV_COMPUTE_PARAMS) aMess = tr("ERR_LOADV_COMPUTE_PARAMS"); - else aMess = tr("ERROR_OF_CREATION"); - - QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ), - tr("SMESH_ERROR"), aMess, QMessageBox::Ok); - } - } catch (const SALOME::SALOME_Exception& S_ex) { - SalomeApp_Tools::QtCatchCorbaException(S_ex); - } - - return myIsLoaded; -} - -//======================================================================= -// function : onSelectionDone() -// purpose : SLOT called when selection changed -//======================================================================= -void SMESHGUI_CreatePatternDlg::onSelectionDone() -{ - try { - SALOME_ListIO aList; - mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type()); - if (aList.Extent() != 1) - return; - - // Get mesh or sub-mesh from selection - Handle(SALOME_InteractiveObject) anIO = aList.First(); - SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface(anIO); - SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface(anIO); - if (aMesh->_is_nil() && aSubMesh->_is_nil()) - return; - - // Get geom object corresponding to the mesh - _PTR(SObject) aSO; - if (!aMesh->_is_nil()) - aSO = SMESH::FindSObject(aMesh.in()); - else - aSO = SMESH::FindSObject(aSubMesh.in()); - - GEOM::GEOM_Object_var aGeomObj = SMESH::GetGeom(aSO); - if (aGeomObj->_is_nil()) - return; - - myGeomObj = aGeomObj; - - // init class fields - if (!aMesh->_is_nil()) { - myMesh = aMesh; - mySubMesh = SMESH::SMESH_subMesh::_nil(); - } else { - mySubMesh = aSubMesh; - myMesh = SMESH::SMESH_Mesh::_nil(); - } - - QString aName; - SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aName); - myMeshEdit->setText(aName); - - if (myType == Type_2d) { - loadFromObject(true); - displayPreview(); - } - } catch (...) { - myMesh = SMESH::SMESH_Mesh::_nil(); - mySubMesh = SMESH::SMESH_subMesh::_nil(); - myGeomObj = GEOM::GEOM_Object::_nil(); - erasePreview(); - } -} - -//======================================================================= -// function : onDeactivate() -// purpose : SLOT called when dialog must be deativated -//======================================================================= -void SMESHGUI_CreatePatternDlg::onDeactivate() -{ - disconnect(mySelectionMgr, 0, this, 0); - setEnabled(false); -} - -//======================================================================= -// function : enterEvent() -// purpose : Event filter -//======================================================================= -void SMESHGUI_CreatePatternDlg::enterEvent (QEvent*) -{ - // there is a stange problem that enterEvent() comes after onSave() - if ( isVisible () ) { - mySMESHGUI->EmitSignalDeactivateDialog(); - setEnabled(true); - activateSelection(); - connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); - } -} - -//================================================================================= -// function : closeEvent() -// purpose : Close dialog box -//================================================================================= -void SMESHGUI_CreatePatternDlg::closeEvent (QCloseEvent*) -{ - onClose(); -} - -//======================================================================= -// function : onSelBtnClicked() -// purpose : SLOT. Called when -> button clicked. -//======================================================================= -void SMESHGUI_CreatePatternDlg::onSelBtnClicked() -{ - onSelectionDone(); -} - -//================================================================ -// function : autoExtension() -// purpose : Append extension to the file name -//================================================================ -QString SMESHGUI_CreatePatternDlg::autoExtension (const QString& theFileName) const -{ - QString anExt = theFileName.section('.', -1); - return anExt != "smp" && anExt != "SMP" ? theFileName + ".smp" : theFileName; -} - -//======================================================================= -// function : displayPreview() -// purpose : Display preview -//======================================================================= -void SMESHGUI_CreatePatternDlg::displayPreview() -{ - // Redisplay preview in dialog - try { - if (!myIsLoaded) { - erasePreview(); - } else { - SMESH::point_array_var pnts = myPattern->GetPoints(); - SMESH::long_array_var keyPoints = myPattern->GetKeyPoints(); - SMESH::array_of_long_array_var elemPoints = myPattern->GetElementPoints(false); - - if (pnts->length() == 0 || - keyPoints->length() == 0 || - elemPoints->length() == 0) { - myIsLoaded = false; - erasePreview(); - return; - } - - PointVector aPoints (pnts->length()); - QValueVector aKeyPoints (keyPoints->length()); - ConnectivityVector anElemPoints (elemPoints->length()); - - for (int i = 0, n = pnts->length(); i < n; i++) - aPoints[ i ] = pnts[ i ]; - - for (int i2 = 0, n2 = keyPoints->length(); i2 < n2; i2++) - aKeyPoints[ i2 ] = keyPoints[ i2 ]; - - for (int i3 = 0, n3 = elemPoints->length(); i3 < n3; i3++) { - QValueVector aVec (elemPoints[ i3 ].length()); - for (int i4 = 0, n4 = elemPoints[ i3 ].length(); i4 < n4; i4++) - aVec[ i4 ] = elemPoints[ i3 ][ i4 ]; - - anElemPoints[ i3 ] = aVec; - } - - myPicture2d->SetPoints(aPoints, aKeyPoints, anElemPoints); - } - - return; - - } catch (const SALOME::SALOME_Exception& S_ex) { - SalomeApp_Tools::QtCatchCorbaException(S_ex); - } catch (...) { - } - erasePreview(); -} - -//======================================================================= -// function : erasePreview() -// purpose : Erase preview -//======================================================================= -void SMESHGUI_CreatePatternDlg::erasePreview() -{ - // Erase preview in 2D viewer - myPicture2d->SetPoints(PointVector(), QValueVector(), ConnectivityVector()); -} - -//======================================================================= -// function : activateSelection() -// purpose : Activate selection in accordance with current pattern type -//======================================================================= -void SMESHGUI_CreatePatternDlg::activateSelection() -{ - mySelectionMgr->clearFilters(); - //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); - - if (myType == Type_2d) { - mySelectionMgr->installFilter(new SMESH_NumberFilter - ("SMESH", TopAbs_SHAPE, -1, TopAbs_FACE)); - } else { - TColStd_MapOfInteger aTypes; - aTypes.Add(TopAbs_SHELL); - aTypes.Add(TopAbs_SOLID); - mySelectionMgr->installFilter(new SMESH_NumberFilter - ("SMESH", TopAbs_FACE, 6, aTypes, GEOM::GEOM_Object::_nil(), true)); - } -} - -//======================================================================= -// function : onTypeChanged() -// purpose : SLOT. Called when pattern type changed. -// Change dialog's look and feel -//======================================================================= -void SMESHGUI_CreatePatternDlg::onTypeChanged (int theType) -{ - if (myType == theType) - return; - - myType = theType; - - if (theType == Type_2d) - myPicture2d->show(); - else - myPicture2d->hide(); -} +// SMESH SMESHGUI : GUI for SMESH component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : SMESHGUI_CreatePatternDlg.cxx +// Author : Sergey LITONIN +// Module : SMESH + +#include "SMESHGUI_CreatePatternDlg.h" + +#include "SMESHGUI.h" +#include "SMESHGUI_SpinBox.h" +#include "SMESHGUI_PatternWidget.h" +#include "SMESHGUI_Utils.h" +#include "SMESHGUI_VTKUtils.h" +#include "SMESHGUI_PatternUtils.h" +#include "SMESHGUI_GEOMGenUtils.h" + +#include "SMESH_NumberFilter.hxx" + +#include "SUIT_ResourceMgr.h" +#include "SUIT_Desktop.h" +#include "SUIT_FileDlg.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" + +#include "SalomeApp_Study.h" +#include "LightApp_Application.h" +#include "LightApp_DataOwner.h" +#include "LightApp_SelectionMgr.h" +#include "SalomeApp_Tools.h" + +#include "SALOMEDS_SObject.hxx" + +#include "SALOME_ListIO.hxx" +#include "SVTK_ViewModel.h" +#include "SVTK_ViewWindow.h" +#include "SVTK_Selector.h" +#include "SVTK_Selection.h" + +// OCCT Includes +#include + +// QT Includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SPACING 5 +#define MARGIN 10 + +/*! + * Class : SMESHGUI_CreatePatternDlg + * Description : Dialog to specify filters for VTK viewer + */ + +//======================================================================= +// function : SMESHGUI_CreatePatternDlg() +// purpose : Constructor +//======================================================================= +SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI* theModule, + const int theType, + const char* theName) + : QDialog( SMESH::GetDesktop( theModule ), theName, false, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), + mySMESHGUI( theModule ), + mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ) +{ + setCaption(tr("CAPTION")); + + QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING); + + QFrame* aMainFrame = createMainFrame (this); + QFrame* aBtnFrame = createButtonFrame(this); + + aDlgLay->addWidget(aMainFrame); + aDlgLay->addWidget(aBtnFrame); + + aDlgLay->setStretchFactor(aMainFrame, 1); + + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + mySelector = aViewWindow->GetSelector(); + + myHelpFileName = "pattern_mapping.htm"; + + Init(theType); +} + +//======================================================================= +// function : createMainFrame() +// purpose : Create frame containing dialog's input fields +//======================================================================= +QFrame* SMESHGUI_CreatePatternDlg::createMainFrame (QWidget* theParent) +{ + QPixmap iconSlct (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT"))); + QPixmap icon2d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_2d"))); + QPixmap icon3d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_3d"))); + QPixmap iconSample2d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_2D"))); + + QGroupBox* aMainGrp = new QGroupBox(1, Qt::Horizontal, theParent); + aMainGrp->setFrameStyle(QFrame::NoFrame); + aMainGrp->setInsideMargin(0); + + // Pattern type group + + myTypeGrp = new QButtonGroup (1, Qt::Vertical, tr("PATTERN_TYPE"), aMainGrp); + mySwitch2d = new QRadioButton (myTypeGrp); + mySwitch3d = new QRadioButton (myTypeGrp); + mySwitch2d->setPixmap(icon2d); + mySwitch3d->setPixmap(icon3d); + myTypeGrp->insert(mySwitch2d, Type_2d); + myTypeGrp->insert(mySwitch3d, Type_3d); + + QGroupBox* aPatternGrp = new QGroupBox(1, Qt::Horizontal, tr("PATTERN"), aMainGrp); + + // Mesh and pattern name group + + QGroupBox* aMeshGrp = new QGroupBox(1, Qt::Vertical, aPatternGrp); + aMeshGrp->setFrameStyle(QFrame::NoFrame); + aMeshGrp->setInsideMargin(0); + + new QLabel(tr("MESH_OR_SUBMESH"), aMeshGrp); + + QPushButton* aSelBtn = new QPushButton(aMeshGrp); + aSelBtn->setPixmap(iconSlct); + myMeshEdit = new QLineEdit(aMeshGrp); + myMeshEdit->setReadOnly(true); + + QGroupBox* aPattGrp = new QGroupBox(1, Qt::Vertical, aPatternGrp); + aPattGrp->setFrameStyle(QFrame::NoFrame); + aPattGrp->setInsideMargin(0); + + new QLabel(tr("PATTERN_NAME"), aPattGrp); + myName = new QLineEdit(aPattGrp); + + // Picture 2d + + myPicture2d = new SMESHGUI_PatternWidget(aPatternGrp), + myPicture2d->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); + + // Project check box + + myProjectChk = new QCheckBox(tr("PROJECT"), aPatternGrp); + + // Connect signals and slots + + connect(myTypeGrp, SIGNAL(clicked(int) ), SLOT(onTypeChanged(int))); + connect(myProjectChk, SIGNAL(toggled(bool)), SLOT(onProject(bool) )); + connect(aSelBtn, SIGNAL(clicked() ), SLOT(onSelBtnClicked())); + + return aMainGrp; +} + +//======================================================================= +// function : createButtonFrame() +// purpose : Create frame containing buttons +//======================================================================= +QFrame* SMESHGUI_CreatePatternDlg::createButtonFrame (QWidget* theParent) +{ + QFrame* aFrame = new QFrame(theParent); + aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken); + + myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame); + mySaveBtn = new QPushButton(tr("SAVE" ), aFrame); + myCloseBtn = new QPushButton(tr("SMESH_BUT_CANCEL"), aFrame); + myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame); + + QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); + + QHBoxLayout* aLay = new QHBoxLayout(aFrame, MARGIN, SPACING); + + aLay->addWidget(myOkBtn); + aLay->addWidget(mySaveBtn); + aLay->addItem(aSpacer); + aLay->addWidget(myCloseBtn); + aLay->addWidget(myHelpBtn); + + connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); + connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); + connect(mySaveBtn, SIGNAL(clicked()), SLOT(onSave())); + connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); + + return aFrame; +} + +//======================================================================= +// function : ~SMESHGUI_CreatePatternDlg() +// purpose : Destructor +//======================================================================= +SMESHGUI_CreatePatternDlg::~SMESHGUI_CreatePatternDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + +//======================================================================= +// function : onProject() +// purpose : SLOT. Called when state of "Project nodes on ther face" +// checkbox is changed +//======================================================================= +void SMESHGUI_CreatePatternDlg::onProject (bool) +{ + loadFromObject(false); + displayPreview(); +} + +//======================================================================= +// function : Init() +// purpose : Init dialog fields, connect signals and slots, show dialog +//======================================================================= +void SMESHGUI_CreatePatternDlg::Init( const int theType ) +{ + myIsLoaded = false; + myType = -1; + myNbPoints = -1; + mySubMesh = SMESH::SMESH_subMesh::_nil(); + myMesh = SMESH::SMESH_Mesh::_nil(); + myGeomObj = GEOM::GEOM_Object::_nil(); + myPattern = SMESH::SMESH_Pattern::_nil(); + + erasePreview(); + + mySMESHGUI->SetActiveDialogBox((QDialog*)this); + + // selection and SMESHGUI + connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); + connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); + + mySwitch2d->setEnabled(theType == Type_2d); + mySwitch3d->setEnabled(theType == Type_3d); + + if (theType == Type_2d) + myProjectChk->show(); + else + myProjectChk->hide(); + + myTypeGrp->setButton(theType); + onTypeChanged(theType); + + myName->setText(getDefaultName()); + myMeshEdit->setText(""); + + setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); + qApp->processEvents(); + updateGeometry(); + myPicture2d->updateGeometry(); + adjustSize(); + resize(minimumSize()); + + activateSelection(); + onSelectionDone(); + + this->show(); +} + +//======================================================================= +// function : SetMesh() +// purpose : Set mesh to dialog +//======================================================================= +void SMESHGUI_CreatePatternDlg::SetMesh (SMESH::SMESH_Mesh_ptr thePtr) +{ + myMesh = SMESH::SMESH_Mesh::_duplicate(thePtr); + mySubMesh = SMESH::SMESH_subMesh::_nil(); + + bool isValidMesh = false; + if (!myMesh->_is_nil()) + { + _PTR(SObject) aSobj = SMESH::FindSObject(myMesh.in()); + //Handle(SALOME_InteractiveObject) anIObj = + // new SALOME_InteractiveObject(aSobj->GetID().c_str(), "SMESH"); + SUIT_DataOwnerPtr anIObj (new LightApp_DataOwner(aSobj->GetID().c_str())); + + isValidMesh = mySelectionMgr->isOk(anIObj); + } + + if (isValidMesh) { + _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in()); + myMeshEdit->setText(aSO->GetName().c_str()); + myGeomObj = SMESH::GetGeom(aSO); + } else { + myMeshEdit->setText(""); + myGeomObj = GEOM::GEOM_Object::_nil(); + } + + if (myType == Type_2d) { + loadFromObject(false); + displayPreview(); + } +} + +//======================================================================= +// function : isValid() +// purpose : Verify validity of entry data +//======================================================================= +bool SMESHGUI_CreatePatternDlg::isValid() +{ + if (myGeomObj->_is_nil()) { + QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ), + tr("SMESH_INSUFFICIENT_DATA"), + tr("SMESHGUI_INVALID_PARAMETERS"), + QMessageBox::Ok); + return false; + } + else + return true; +} + +//======================================================================= +// function : getDefaultName() +// purpose : Get default pattern name +//======================================================================= +QString SMESHGUI_CreatePatternDlg::getDefaultName() const +{ + return myType == Type_2d ? tr("DEFAULT_2D") : tr("DEFAULT_3D"); +} + +//======================================================================= +// function : onSave() +// purpose : SLOT called when "Save" button pressed. Build pattern and +// save it to disk +//======================================================================= +void SMESHGUI_CreatePatternDlg::onSave() +{ + try { + if (!isValid()) + return; + + if (!myIsLoaded) + loadFromObject(true); + + // Load pattern from object + if (!myIsLoaded) + return; + + /////////////////////////////////////////////////////// + SUIT_FileDlg* aDlg = new SUIT_FileDlg (this, false); + aDlg->setCaption(tr("SAVE_PATTERN")); + aDlg->setMode(QFileDialog::AnyFile); + aDlg->setFilters(tr("PATTERN_FILT")); + if (myName->text() != "") + aDlg->setSelection(myName->text()); + + if (aDlg->exec() != Accepted) + return; + + QString fName = aDlg->selectedFile(); + if (fName.isEmpty()) + return; + + if (QFileInfo(fName).extension().isEmpty()) + fName = autoExtension(fName); + + fName = QDir::convertSeparators(fName); + + QString aData (myPattern->GetString()); + long aLen = aData.length(); + + QFile aFile (fName); + aFile.open(IO_WriteOnly); + long aWritten = aFile.writeBlock(aData, aLen); + aFile.close(); + + if (aWritten != aLen) { + QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ), tr("SMESH_ERROR"), + tr("ERROR_OF_SAVING"), QMessageBox::Ok); + } else { + //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); + disconnect(mySelectionMgr, 0, this, 0); + disconnect(mySMESHGUI, 0, this, 0); + mySMESHGUI->ResetState(); + accept(); + emit NewPattern(); + } + } catch (const SALOME::SALOME_Exception& S_ex) { + SalomeApp_Tools::QtCatchCorbaException(S_ex); + } catch (...) { + } +} + +//======================================================================= +// function : GetPatternName() +// purpose : Get name of pattern +//======================================================================= +QString SMESHGUI_CreatePatternDlg::GetPatternName() const +{ + return myName->text(); +} + +//======================================================================= +// function : GetPattern() +// purpose : Get result pattern +//======================================================================= +SMESH::SMESH_Pattern_ptr SMESHGUI_CreatePatternDlg::GetPattern() +{ + return myPattern.in(); +} + +//======================================================================= +// function : onOk() +// purpose : SLOT called when "Ok" button pressed. +//======================================================================= +void SMESHGUI_CreatePatternDlg::onOk() +{ + try { + if (!isValid()) + return; + + if (!myIsLoaded) + loadFromObject(true); + + // Load pattern from object + if (!myIsLoaded) { + return; + } else { + //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); + disconnect(mySelectionMgr, 0, this, 0); + disconnect(mySMESHGUI, 0, this, 0); + mySMESHGUI->ResetState(); + accept(); + emit NewPattern(); + } + } catch (const SALOME::SALOME_Exception& S_ex) { + SalomeApp_Tools::QtCatchCorbaException(S_ex); + } catch (...) { + } +} + +//======================================================================= +// function : onClose() +// purpose : SLOT called when "Close" button pressed. Close dialog +//======================================================================= +void SMESHGUI_CreatePatternDlg::onClose() +{ + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); + disconnect(mySelectionMgr, 0, this, 0); + disconnect(mySMESHGUI, 0, this, 0); + mySMESHGUI->ResetState(); + reject(); + emit Close(); +} + +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_CreatePatternDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + +//======================================================================= +// function : loadFromObject() +// purpose : Load pattern from geom object corresponding to the mesh/submesh +//======================================================================= +bool SMESHGUI_CreatePatternDlg::loadFromObject (const bool theMess) +{ + try { + myIsLoaded = false; + + if (myPattern->_is_nil()) + myPattern = SMESH::GetPattern(); + + if (myMesh->_is_nil() && mySubMesh->_is_nil() || myGeomObj->_is_nil()) + return false; + + SMESH::SMESH_Mesh_ptr aMesh = mySubMesh->_is_nil() ? myMesh.in() : mySubMesh->GetFather(); + + myIsLoaded = myType == Type_2d + ? myPattern->LoadFromFace(aMesh, myGeomObj, myProjectChk->isChecked()) + : myPattern->LoadFrom3DBlock(aMesh, myGeomObj); + + if (!myIsLoaded && theMess) { + QString aMess; + SMESH::SMESH_Pattern::ErrorCode aCode = myPattern->GetErrorCode(); + + if (aCode == SMESH::SMESH_Pattern::ERR_LOAD_EMPTY_SUBMESH ) aMess = tr("ERR_LOAD_EMPTY_SUBMESH"); + else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_NARROW_FACE ) aMess = tr("ERR_LOADF_NARROW_FACE"); + else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_CLOSED_FACE ) aMess = tr("ERR_LOADF_CLOSED_FACE"); + else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_CANT_PROJECT ) aMess = tr("ERR_LOADF_CANT_PROJECT"); + else if (aCode == SMESH::SMESH_Pattern::ERR_LOADV_BAD_SHAPE ) aMess = tr("ERR_LOADV_BAD_SHAPE"); + else if (aCode == SMESH::SMESH_Pattern::ERR_LOADV_COMPUTE_PARAMS) aMess = tr("ERR_LOADV_COMPUTE_PARAMS"); + else aMess = tr("ERROR_OF_CREATION"); + + QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ), + tr("SMESH_ERROR"), aMess, QMessageBox::Ok); + } + } catch (const SALOME::SALOME_Exception& S_ex) { + SalomeApp_Tools::QtCatchCorbaException(S_ex); + } + + return myIsLoaded; +} + +//======================================================================= +// function : onSelectionDone() +// purpose : SLOT called when selection changed +//======================================================================= +void SMESHGUI_CreatePatternDlg::onSelectionDone() +{ + try { + SALOME_ListIO aList; + mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type()); + if (aList.Extent() != 1) + return; + + // Get mesh or sub-mesh from selection + Handle(SALOME_InteractiveObject) anIO = aList.First(); + SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface(anIO); + SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface(anIO); + if (aMesh->_is_nil() && aSubMesh->_is_nil()) + return; + + // Get geom object corresponding to the mesh + _PTR(SObject) aSO; + if (!aMesh->_is_nil()) + aSO = SMESH::FindSObject(aMesh.in()); + else + aSO = SMESH::FindSObject(aSubMesh.in()); + + GEOM::GEOM_Object_var aGeomObj = SMESH::GetGeom(aSO); + if (aGeomObj->_is_nil()) + return; + + myGeomObj = aGeomObj; + + // init class fields + if (!aMesh->_is_nil()) { + myMesh = aMesh; + mySubMesh = SMESH::SMESH_subMesh::_nil(); + } else { + mySubMesh = aSubMesh; + myMesh = SMESH::SMESH_Mesh::_nil(); + } + + QString aName; + SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aName); + myMeshEdit->setText(aName); + + if (myType == Type_2d) { + loadFromObject(true); + displayPreview(); + } + } catch (...) { + myMesh = SMESH::SMESH_Mesh::_nil(); + mySubMesh = SMESH::SMESH_subMesh::_nil(); + myGeomObj = GEOM::GEOM_Object::_nil(); + erasePreview(); + } +} + +//======================================================================= +// function : onDeactivate() +// purpose : SLOT called when dialog must be deativated +//======================================================================= +void SMESHGUI_CreatePatternDlg::onDeactivate() +{ + disconnect(mySelectionMgr, 0, this, 0); + setEnabled(false); +} + +//======================================================================= +// function : enterEvent() +// purpose : Event filter +//======================================================================= +void SMESHGUI_CreatePatternDlg::enterEvent (QEvent*) +{ + // there is a stange problem that enterEvent() comes after onSave() + if ( isVisible () ) { + mySMESHGUI->EmitSignalDeactivateDialog(); + setEnabled(true); + activateSelection(); + connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); + } +} + +//================================================================================= +// function : closeEvent() +// purpose : Close dialog box +//================================================================================= +void SMESHGUI_CreatePatternDlg::closeEvent (QCloseEvent*) +{ + onClose(); +} + +//======================================================================= +// function : onSelBtnClicked() +// purpose : SLOT. Called when -> button clicked. +//======================================================================= +void SMESHGUI_CreatePatternDlg::onSelBtnClicked() +{ + onSelectionDone(); +} + +//================================================================ +// function : autoExtension() +// purpose : Append extension to the file name +//================================================================ +QString SMESHGUI_CreatePatternDlg::autoExtension (const QString& theFileName) const +{ + QString anExt = theFileName.section('.', -1); + return anExt != "smp" && anExt != "SMP" ? theFileName + ".smp" : theFileName; +} + +//======================================================================= +// function : displayPreview() +// purpose : Display preview +//======================================================================= +void SMESHGUI_CreatePatternDlg::displayPreview() +{ + // Redisplay preview in dialog + try { + if (!myIsLoaded) { + erasePreview(); + } else { + SMESH::point_array_var pnts = myPattern->GetPoints(); + SMESH::long_array_var keyPoints = myPattern->GetKeyPoints(); + SMESH::array_of_long_array_var elemPoints = myPattern->GetElementPoints(false); + + if (pnts->length() == 0 || + keyPoints->length() == 0 || + elemPoints->length() == 0) { + myIsLoaded = false; + erasePreview(); + return; + } + + PointVector aPoints (pnts->length()); + QValueVector aKeyPoints (keyPoints->length()); + ConnectivityVector anElemPoints (elemPoints->length()); + + for (int i = 0, n = pnts->length(); i < n; i++) + aPoints[ i ] = pnts[ i ]; + + for (int i2 = 0, n2 = keyPoints->length(); i2 < n2; i2++) + aKeyPoints[ i2 ] = keyPoints[ i2 ]; + + for (int i3 = 0, n3 = elemPoints->length(); i3 < n3; i3++) { + QValueVector aVec (elemPoints[ i3 ].length()); + for (int i4 = 0, n4 = elemPoints[ i3 ].length(); i4 < n4; i4++) + aVec[ i4 ] = elemPoints[ i3 ][ i4 ]; + + anElemPoints[ i3 ] = aVec; + } + + myPicture2d->SetPoints(aPoints, aKeyPoints, anElemPoints); + } + + return; + + } catch (const SALOME::SALOME_Exception& S_ex) { + SalomeApp_Tools::QtCatchCorbaException(S_ex); + } catch (...) { + } + erasePreview(); +} + +//======================================================================= +// function : erasePreview() +// purpose : Erase preview +//======================================================================= +void SMESHGUI_CreatePatternDlg::erasePreview() +{ + // Erase preview in 2D viewer + myPicture2d->SetPoints(PointVector(), QValueVector(), ConnectivityVector()); +} + +//======================================================================= +// function : activateSelection() +// purpose : Activate selection in accordance with current pattern type +//======================================================================= +void SMESHGUI_CreatePatternDlg::activateSelection() +{ + mySelectionMgr->clearFilters(); + //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); + + if (myType == Type_2d) { + mySelectionMgr->installFilter(new SMESH_NumberFilter + ("SMESH", TopAbs_SHAPE, -1, TopAbs_FACE)); + } else { + TColStd_MapOfInteger aTypes; + aTypes.Add(TopAbs_SHELL); + aTypes.Add(TopAbs_SOLID); + mySelectionMgr->installFilter(new SMESH_NumberFilter + ("SMESH", TopAbs_FACE, 6, aTypes, GEOM::GEOM_Object::_nil(), true)); + } +} + +//======================================================================= +// function : onTypeChanged() +// purpose : SLOT. Called when pattern type changed. +// Change dialog's look and feel +//======================================================================= +void SMESHGUI_CreatePatternDlg::onTypeChanged (int theType) +{ + if (myType == theType) + return; + + myType = theType; + + if (theType == Type_2d) + myPicture2d->show(); + else + myPicture2d->hide(); +} diff --git a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h index cc16c162b..154b85a9f 100755 --- a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h +++ b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -92,6 +92,7 @@ private slots: void onOk(); void onSave(); void onClose(); + void onHelp(); void onDeactivate(); @@ -118,6 +119,7 @@ private: QPushButton* myOkBtn; QPushButton* mySaveBtn; QPushButton* myCloseBtn; + QPushButton* myHelpBtn; QButtonGroup* myTypeGrp; QRadioButton* mySwitch2d; @@ -143,6 +145,8 @@ private: SMESH::SMESH_Pattern_var myPattern; bool myIsLoaded; + + QString myHelpFileName; }; #endif diff --git a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx index abced02c6..7b0da5d83 100644 --- a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -40,11 +40,14 @@ #include "SMDS_Mesh.hxx" #include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" #include "SalomeApp_Application.h" #include "SalomeApp_Study.h" #include "SUIT_Desktop.h" #include "SUIT_MessageBox.h" +#include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" #include "utilities.h" @@ -112,21 +115,19 @@ class TPolySimulation{ myPreviewActor->SetMapper( myMapper ); myPreviewActor->SetRepresentation( 3 ); - float anRGB[3]; + vtkFloatingPointType anRGB[3]; vtkProperty* aProp = vtkProperty::New(); - GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) ); + GetColor( "SMESH", "selection_element_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) ); aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]); myPreviewActor->SetProperty( aProp ); + vtkFloatingPointType aFactor,aUnits; + myPreviewActor->SetResolveCoincidentTopology(true); + myPreviewActor->GetPolygonOffsetParameters(aFactor,aUnits); + myPreviewActor->SetPolygonOffsetParameters(aFactor,0.2*aUnits); aProp->Delete(); - vtkProperty* aBackProp = vtkProperty::New(); - GetColor( "SMESH", "backface_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 0, 255 ) ); - aBackProp->SetColor(anRGB[0],anRGB[1],anRGB[2]); - myPreviewActor->SetBackfaceProperty( aBackProp ); - aBackProp->Delete(); - myViewWindow->AddActor( myPreviewActor ); - + } @@ -139,7 +140,7 @@ class TPolySimulation{ vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid(); myGrid->SetPoints(aGrid->GetPoints()); - if (theReset) ResetGrid(theReset); + ResetGrid(theReset); vtkIdList *anIds = vtkIdList::New(); @@ -251,6 +252,11 @@ SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI buttonOk->setAutoDefault( TRUE ); buttonOk->setDefault( TRUE ); GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); + SMESHGUI_CreatePolyhedralVolumeDlgLayout->addWidget( GroupButtons, 2, 0 ); /***************************************************************/ @@ -317,6 +323,8 @@ SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI RadioButton1->setChecked( TRUE ); mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ; + + myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_polyhedrons?"; Init(); } @@ -350,6 +358,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init() connect(buttonOk, SIGNAL( clicked() ), SLOT( ClickOnOk() ) ); connect(buttonCancel, SIGNAL( clicked() ), SLOT( ClickOnCancel() ) ) ; connect(buttonApply, SIGNAL( clicked() ), SLOT(ClickOnApply() ) ); + connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp() ) ); connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) ); connect(SelectElementsButton, SIGNAL( clicked() ), SLOT( SetEditCurrentArgument() ) ) ; @@ -365,10 +374,6 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init() /* to close dialog if study change */ connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; - /* Move widget on the botton right corner of main widget */ - int x, y ; - mySMESHGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; this->show() ; /* displays Dialog */ ConstructorsClicked(0); @@ -458,6 +463,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply() { if ( myNbOkElements>0 && !mySMESHGUI->isActiveStudyLocked()) { + if(checkEditLine(false) == -1) {return;} busy = true; if (GetConstructorId() == 0) { @@ -530,7 +536,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply() unsigned int anEntityMode = myActor->GetEntityMode(); myActor->SetEntityMode(SMESH_Actor::eVolumes | anEntityMode); } - ConstructorsClicked( GetConstructorId() ); + //ConstructorsClicked( GetConstructorId() ); busy = false; } } @@ -541,6 +547,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply() //================================================================================= void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnOk() { + if(checkEditLine(false) == -1) {return;} ClickOnApply() ; ClickOnCancel() ; } @@ -564,6 +571,23 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel() reject() ; } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= //function : onTextChange //purpose : @@ -572,6 +596,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel() void SMESHGUI_CreatePolyhedralVolumeDlg::onTextChange(const QString& theNewText) { if ( busy ) return; + if (checkEditLine() == -1) return; busy = true; mySimulation->SetVisibility(false); @@ -706,6 +731,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::SelectionIntoArgument() } busy = true; myEditCurrentArgument->setText( aString ); + if (checkEditLine() == -1) {busy = false;return;} busy = false; break; } @@ -721,6 +747,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::SelectionIntoArgument() } busy = true; myEditCurrentArgument->setText( aString ); + if (checkEditLine() == -1) {busy = false;return;} busy = false; // OK @@ -733,6 +760,82 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::SelectionIntoArgument() displaySimulation(); } +/*\brief int SMESHGUI_CreatePolyhedralVolumeDlg::checkEditLine() + * Checking of indices in edit line. + * If incorecct indices in edit line warning message appear and myEditCurrentArgument remove last index. + * \retval 1 - if all ok(or no indices in edit line), -1 - if there are incorrect indices. + */ +int SMESHGUI_CreatePolyhedralVolumeDlg::checkEditLine(bool checkLast) +{ + QString aString = ""; + SMDS_Mesh* aMesh = 0; + + if(myMesh->_is_nil()) return 1; + if(!myActor){ + myActor = SMESH::FindActorByObject(myMesh); + if(!myActor) + return 1; + } + + aMesh = myActor->GetObject()->GetMesh(); + + // checking for nodes + if (checkLast && myEditCurrentArgument->text().right(1) != QString(" ") ) return 1; + QStringList aListId = QStringList::split( " ", myEditCurrentArgument->text() ); + for ( int i = 0; i < aListId.count(); i++ ){ + switch (GetConstructorId()){ + case 0:{ // nodes + const SMDS_MeshNode * aNode = aMesh->FindNode( aListId[ i ].toInt() ); + if( !aNode ){ + std::string aWarning; + aWarning = "The incorrect indices of nodes!"; + SUIT_MessageBox::warn1(SMESHGUI::desktop(), + QObject::tr("SMESH_POLYEDRE_CREATE_ERROR"), + QObject::tr(aWarning.c_str()), + QObject::tr("SMESH_BUT_OK")); + + myEditCurrentArgument->clear(); + myEditCurrentArgument->setText( aString ); + return -1; + } + + break; + } + case 1:{ // faces + bool aElemIsOK = true; + const SMDS_MeshElement * aElem = aMesh->FindElement( aListId[ i ].toInt() ); + if (!aElem) + { + aElemIsOK = false; + } + else + { + SMDSAbs_ElementType aType = aMesh->GetElementType( aElem->GetID(),true ); + if (aType != SMDSAbs_Face){ + aElemIsOK = false; + } + } + if (!aElemIsOK){ + std::string aWarning; + aWarning = "The incorrect indices of faces!"; + SUIT_MessageBox::warn1(SMESHGUI::desktop(), + QObject::tr("SMESH_POLYEDRE_CREATE_ERROR"), + QObject::tr(aWarning.c_str()), + QObject::tr("SMESH_BUT_OK")); + + myEditCurrentArgument->clear(); + myEditCurrentArgument->setText( aString ); + return -1; + } + break; + } + } + aString += aListId[ i ] + " "; + } + + return 1; +} + //======================================================================= //function : displaySimulation //purpose : @@ -743,7 +846,11 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::displaySimulation() { SMESH::TPolySimulation::TVTKIds aVTKIds; vtkIdType aType = VTK_CONVEX_POINT_SET ; - if (GetConstructorId() == 0){ + SMDS_Mesh* aMesh = 0; + if ( myActor ){ + aMesh = myActor->GetObject()->GetMesh(); + } + if (GetConstructorId() == 0 && aMesh){ if (!AddButton->isEnabled()){ QListBoxItem* anItem; mySimulation->ResetGrid(true); @@ -751,6 +858,8 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::displaySimulation() QStringList anIds = QStringList::split(" ", anItem->text()); SMESH::TPolySimulation::TVTKIds aVTKIds_faces; for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it){ + const SMDS_MeshNode * aNode = aMesh->FindNode( (*it).toInt() ); + if (!aNode) continue; vtkIdType aId = myActor->GetObject()->GetNodeVTKId( (*it).toInt() ) ; aVTKIds.push_back(aId); aVTKIds_faces.push_back(aId); @@ -776,35 +885,30 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::displaySimulation() aType = VTK_POLYGON; mySimulation->SetPosition(myActor, aType, aVTKIds); } - }else if(GetConstructorId() == 1){ - SMDS_Mesh* aMesh = 0; - if ( myActor ){ - aMesh = myActor->GetObject()->GetMesh(); - } - if ( aMesh ) { - QStringList aListId = QStringList::split( " ", myEditCurrentArgument->text(), false); - for ( int i = 0; i < aListId.count(); i++ ) - { - const SMDS_MeshElement * anElem = aMesh->FindElement( aListId[ i ].toInt() ); - if ( !anElem ) - return; + }else if(GetConstructorId() == 1 && aMesh){ + QStringList aListId = QStringList::split( " ", myEditCurrentArgument->text(), false); + for ( int i = 0; i < aListId.count(); i++ ) + { + const SMDS_MeshElement * anElem = aMesh->FindElement( aListId[ i ].toInt() ); + if ( !anElem ) continue; + SMDSAbs_ElementType aFaceType = aMesh->GetElementType( anElem->GetID(),true ); + if (aFaceType != SMDSAbs_Face) continue; - SMDS_ElemIteratorPtr anIter = anElem->nodesIterator(); - SMESH::TPolySimulation::TVTKIds aVTKIds_faces; - while( anIter->more() ) + SMDS_ElemIteratorPtr anIter = anElem->nodesIterator(); + SMESH::TPolySimulation::TVTKIds aVTKIds_faces; + while( anIter->more() ) if ( const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next() ){ vtkIdType aId = myActor->GetObject()->GetNodeVTKId( aNode->GetID() ) ; aVTKIds.push_back(aId); aVTKIds_faces.push_back(aId); } - if(!Preview->isChecked()){ - aType = VTK_POLYGON; - mySimulation->SetPosition(myActor, aType, aVTKIds_faces); - } + if(!Preview->isChecked()){ + aType = VTK_POLYGON; + mySimulation->SetPosition(myActor, aType, aVTKIds_faces); } - if(Preview->isChecked()) - mySimulation->SetPosition(myActor, aType, aVTKIds); - } + } + if(Preview->isChecked()) + mySimulation->SetPosition(myActor, aType, aVTKIds); } SMESH::UpdateView(); } @@ -917,9 +1021,10 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onAdd() mySelectionMgr->selectedObjects( selected ); int aNbSel = selected.Extent(); if (aNbSel == 0 || !myActor || myMesh->_is_nil()) return; + + if (this->checkEditLine(false) == -1) return; busy = true; - if ( !(myEditCurrentArgument->text().isEmpty()) ) { myFacesByNodes->insertItem(myEditCurrentArgument->text()); diff --git a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h index b495c3290..f6dba660f 100644 --- a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h +++ b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -78,6 +78,8 @@ private: int GetConstructorId(); void displaySimulation(); + int checkEditLine(bool checkLast=true); /*! Checking for indices, return 1 if all ok, esle -1*/ + SMESHGUI* mySMESHGUI ; /* Current SMESHGUI object */ LightApp_SelectionMgr* mySelectionMgr ; /* User shape selection */ SVTK_Selector* mySelector; @@ -98,6 +100,7 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; QGroupBox* GroupContent; QLabel* TextLabelIds; QPushButton* SelectElementsButton; @@ -106,6 +109,8 @@ private: QLabel* myFacesByNodesLabel; QPushButton* AddButton; QPushButton* RemoveButton; + + QString myHelpFileName; public slots: @@ -119,6 +124,7 @@ private: void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); void SetEditCurrentArgument() ; void SelectionIntoArgument() ; void DeactivateActiveDialog() ; diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx index 90f42d96a..9e02ccc4a 100644 --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -34,8 +34,11 @@ #include "SMESH_TypeFilter.hxx" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" #include "SalomeApp_Study.h" +#include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" #include "SALOME_ListIO.hxx" @@ -90,6 +93,8 @@ SMESHGUI_DeleteGroupDlg::SMESHGUI_DeleteGroupDlg (SMESHGUI* theModule): aDlgLay->setStretchFactor(aMainFrame, 1); + myHelpFileName = "deleting_groups.htm"; + Init(); } @@ -122,6 +127,7 @@ QFrame* SMESHGUI_DeleteGroupDlg::createButtonFrame (QWidget* theParent) myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame); myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame); myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame); + myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame); QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); @@ -131,11 +137,13 @@ QFrame* SMESHGUI_DeleteGroupDlg::createButtonFrame (QWidget* theParent) aLay->addWidget(myApplyBtn); aLay->addItem(aSpacer); aLay->addWidget(myCloseBtn); + aLay->addWidget(myHelpBtn); // connect signals and slots connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); + connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); return aFrame; } @@ -162,9 +170,6 @@ void SMESHGUI_DeleteGroupDlg::Init () connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); // set selection mode @@ -244,6 +249,23 @@ void SMESHGUI_DeleteGroupDlg::onClose() reject(); } +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_DeleteGroupDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : onSelectionDone() // purpose : SLOT called when selection changed diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h index e0b6738aa..12445a4bf 100644 --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -69,6 +69,7 @@ private slots: void onOk(); bool onApply(); void onClose(); + void onHelp(); void onDeactivate(); @@ -85,6 +86,7 @@ private: QPushButton* myOkBtn; QPushButton* myApplyBtn; QPushButton* myCloseBtn; + QPushButton* myHelpBtn; QListBox* myListBox; SMESHGUI* mySMESHGUI; @@ -92,6 +94,8 @@ private: QValueList myListGrp; bool myBlockSelection; + + QString myHelpFileName; }; #endif diff --git a/src/SMESHGUI/SMESHGUI_Dialog.cxx b/src/SMESHGUI/SMESHGUI_Dialog.cxx index a3277e0a7..6736a5890 100644 --- a/src/SMESHGUI/SMESHGUI_Dialog.cxx +++ b/src/SMESHGUI/SMESHGUI_Dialog.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -62,10 +62,6 @@ SMESHGUI_Dialog::~SMESHGUI_Dialog() void SMESHGUI_Dialog::show() { adjustSize(); - SUIT_Desktop *PP = desktop(); - int x = abs( PP->x() + PP->size().width() - size().width() - 10 ), - y = abs( PP->y() + PP->size().height() - size().height() - 10 ); - move(x, y); LightApp_Dialog::show(); } diff --git a/src/SMESHGUI/SMESHGUI_Dialog.h b/src/SMESHGUI/SMESHGUI_Dialog.h index 1a04adbd0..676b601a4 100644 --- a/src/SMESHGUI/SMESHGUI_Dialog.h +++ b/src/SMESHGUI/SMESHGUI_Dialog.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -46,7 +46,7 @@ class SMESHGUI_EXPORT SMESHGUI_Dialog : public LightApp_Dialog Q_OBJECT public: - SMESHGUI_Dialog( QWidget* = 0, const bool = false, const bool = false, const int = OK | Close | Apply ); + SMESHGUI_Dialog( QWidget* = 0, const bool = false, const bool = false, const int = OK | Close | Apply | Help ); virtual ~SMESHGUI_Dialog(); virtual void show(); diff --git a/src/SMESHGUI/SMESHGUI_Displayer.cxx b/src/SMESHGUI/SMESHGUI_Displayer.cxx index 4f1a2457e..e039e1311 100644 --- a/src/SMESHGUI/SMESHGUI_Displayer.cxx +++ b/src/SMESHGUI/SMESHGUI_Displayer.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESHGUI_Displayer.h b/src/SMESHGUI/SMESHGUI_Displayer.h index 4c1aa5d79..dc2df5f8b 100644 --- a/src/SMESHGUI/SMESHGUI_Displayer.h +++ b/src/SMESHGUI/SMESHGUI_Displayer.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESHGUI_EditHypothesesDlg.cxx b/src/SMESHGUI/SMESHGUI_EditHypothesesDlg.cxx deleted file mode 100644 index c2d0185b6..000000000 --- a/src/SMESHGUI/SMESHGUI_EditHypothesesDlg.cxx +++ /dev/null @@ -1,963 +0,0 @@ -// SMESH SMESHGUI : GUI for SMESH component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SMESHGUI_EditHypothesesDlg.cxx -// Author : Nicolas REJNERI -// Module : SMESH -// $Header$ - -#include "SMESHGUI_EditHypothesesDlg.h" - -#include "SMESHGUI.h" -#include "SMESHGUI_Utils.h" -#include "SMESHGUI_GEOMGenUtils.h" -#include "SMESHGUI_HypothesesUtils.h" - -#include "SMESH_TypeFilter.hxx" -#include "SMESH_NumberFilter.hxx" - -#include "SALOME_ListIO.hxx" -#include "SALOME_ListIteratorOfListIO.hxx" - -#include "SALOMEDSClient_Study.hxx" -#include "SALOMEDSClient_AttributeIOR.hxx" -#include "SALOMEDSClient_AttributeName.hxx" - -#include "SUIT_Session.h" -#include "SUIT_OverrideCursor.h" -#include "SUIT_Operation.h" -#include "SUIT_Desktop.h" - -#include "utilities.h" - -#include "SVTK_ViewModel.h" - -// QT Includes -#include -#include -#include -#include -#include -#include - -using namespace std; - -//VRV: porting on Qt 3.0.5 -#if QT_VERSION >= 0x030005 -#include -#endif -//VRV: porting on Qt 3.0.5 - -class ListBoxIOR : public QListBoxText -{ -public: - enum { RTTI_IOR = 1000 }; - -public: - ListBoxIOR (QListBox* listbox, - const char* ior, - const QString& text = QString::null) - : QListBoxText(listbox, text), myIOR(ior) {} - virtual ~ListBoxIOR() {}; - virtual int rtti() const { return RTTI_IOR; } - const char* GetIOR() { return myIOR.c_str(); } - -private: - string myIOR; -}; - -#define ALLOW_CHANGE_SHAPE 0 - -int findItem (QListBox* listBox, const string& ior) -{ - for (int i = 0; i < listBox->count(); i++) { - if (listBox->item(i)->rtti() == ListBoxIOR::RTTI_IOR) { - ListBoxIOR* anItem = (ListBoxIOR*)(listBox->item(i)); - if (anItem && ior == string(anItem->GetIOR())) - return i; - } - } - return -1; -} - -//================================================================================= -// function : SMESHGUI_EditHypothesesDlg() -// purpose : Constructs a SMESHGUI_EditHypothesesDlg which is a child of 'parent', with the -// name 'name' and widget flags set to 'f'. -// The dialog will by default be modeless, unless you set 'modal' to -// TRUE to construct a modal dialog. -//================================================================================= -SMESHGUI_EditHypothesesDlg::SMESHGUI_EditHypothesesDlg (SMESHGUI* theModule, const char* name, - bool modal, WFlags fl) - : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | - WStyle_Title | WStyle_SysMenu | WDestructiveClose), - myImportedMesh(false), - mySMESHGUI( theModule ), - mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ) -{ - QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT"))); - if (!name) - setName("SMESHGUI_EditHypothesesDlg"); - setCaption(tr("SMESH_EDIT_HYPOTHESES")); - setSizeGripEnabled(TRUE); - QGridLayout* SMESHGUI_EditHypothesesDlgLayout = new QGridLayout(this); - SMESHGUI_EditHypothesesDlgLayout->setSpacing(6); - SMESHGUI_EditHypothesesDlgLayout->setMargin(11); - - /***************************************************************/ - GroupC1 = new QGroupBox(tr("SMESH_ARGUMENTS"), this, "GroupC1"); - GroupC1->setColumnLayout(0, Qt::Vertical); - GroupC1->layout()->setSpacing(0); - GroupC1->layout()->setMargin(0); - QGridLayout* GroupC1Layout = new QGridLayout(GroupC1->layout()); - GroupC1Layout->setAlignment(Qt::AlignTop); - GroupC1Layout->setSpacing(6); - GroupC1Layout->setMargin(11); - - TextLabelC1A1 = new QLabel(tr("SMESH_OBJECT_MESHorSUBMESH"), GroupC1, "TextLabelC1A1"); - GroupC1Layout->addWidget(TextLabelC1A1, 0, 0); - SelectButtonC1A1 = new QPushButton(GroupC1, "SelectButtonC1A1"); - SelectButtonC1A1->setPixmap(image0); - GroupC1Layout->addWidget(SelectButtonC1A1, 0, 1); - LineEditC1A1 = new QLineEdit(GroupC1, "LineEditC1A1"); - LineEditC1A1->setReadOnly(true); - GroupC1Layout->addWidget(LineEditC1A1, 0, 2); - - TextLabelC1A2 = new QLabel(tr("SMESH_OBJECT_GEOM"), GroupC1, "TextLabelC1A2"); - GroupC1Layout->addWidget(TextLabelC1A2, 1, 0); - SelectButtonC1A2 = new QPushButton(GroupC1, "SelectButtonC1A2"); - SelectButtonC1A2->setPixmap(image0); - SelectButtonC1A2->setToggleButton(FALSE); - GroupC1Layout->addWidget(SelectButtonC1A2, 1, 1); - LineEditC1A2 = new QLineEdit(GroupC1, "LineEditC1A2"); - LineEditC1A2->setReadOnly(true); - GroupC1Layout->addWidget(LineEditC1A2, 1, 2); - - SMESHGUI_EditHypothesesDlgLayout->addWidget(GroupC1, 0, 0); - - /***************************************************************/ - GroupHypotheses = new QGroupBox(tr("SMESH_HYPOTHESES"), this, "GroupHypotheses"); - GroupHypotheses->setColumnLayout(0, Qt::Vertical); - GroupHypotheses->layout()->setSpacing(0); - GroupHypotheses->layout()->setMargin(0); - QGridLayout* grid_3 = new QGridLayout(GroupHypotheses->layout()); - grid_3->setAlignment(Qt::AlignTop); - grid_3->setSpacing(6); - grid_3->setMargin(11); - - TextHypDefinition = new QLabel(tr("SMESH_AVAILABLE"), GroupHypotheses, "TextHypDefinition"); - grid_3->addWidget(TextHypDefinition, 0, 0); - - ListHypDefinition = new QListBox(GroupHypotheses, "ListHypDefinition"); - ListHypDefinition->setMinimumSize(100, 100); - grid_3->addWidget(ListHypDefinition, 1, 0); - - TextHypAssignation = new QLabel(tr("SMESH_EDIT_USED"), GroupHypotheses, "TextHypAssignation"); - grid_3->addWidget(TextHypAssignation, 0, 1); - - ListHypAssignation = new QListBox(GroupHypotheses, "ListHypAssignation"); - ListHypAssignation->setMinimumSize(100, 100); - grid_3->addWidget(ListHypAssignation, 1, 1); - - SMESHGUI_EditHypothesesDlgLayout->addWidget(GroupHypotheses, 1, 0); - - /***************************************************************/ - GroupAlgorithms = new QGroupBox(tr("SMESH_ADD_ALGORITHM"), this, "GroupAlgorithms"); - GroupAlgorithms->setColumnLayout(0, Qt::Vertical); - GroupAlgorithms->layout()->setSpacing(0); - GroupAlgorithms->layout()->setMargin(0); - QGridLayout* grid_4 = new QGridLayout(GroupAlgorithms->layout()); - grid_4->setAlignment(Qt::AlignTop); - grid_4->setSpacing(6); - grid_4->setMargin(11); - - TextAlgoDefinition = new QLabel(tr("SMESH_AVAILABLE"), GroupAlgorithms, "TextAlgoDefinition"); - grid_4->addWidget(TextAlgoDefinition, 0, 0); - - ListAlgoDefinition = new QListBox(GroupAlgorithms, "ListAlgoDefinition"); - ListAlgoDefinition->setMinimumSize(100, 100); - grid_4->addWidget(ListAlgoDefinition, 1, 0); - - TextAlgoAssignation = new QLabel(tr("SMESH_EDIT_USED"), GroupAlgorithms, "TextAlgoAssignation"); - grid_4->addWidget(TextAlgoAssignation, 0, 1); - - ListAlgoAssignation = new QListBox(GroupAlgorithms, "ListAlgoAssignation"); - ListAlgoAssignation ->setMinimumSize(100, 100); - grid_4->addWidget(ListAlgoAssignation, 1, 1); - - SMESHGUI_EditHypothesesDlgLayout->addWidget(GroupAlgorithms, 2, 0); - - /***************************************************************/ - GroupButtons = new QGroupBox(this, "GroupButtons"); - GroupButtons->setColumnLayout(0, Qt::Vertical); - GroupButtons->layout()->setSpacing(0); - GroupButtons->layout()->setMargin(0); - QGridLayout* GroupButtonsLayout = new QGridLayout(GroupButtons->layout()); - GroupButtonsLayout->setAlignment(Qt::AlignTop); - GroupButtonsLayout->setSpacing(6); - GroupButtonsLayout->setMargin(11); - - buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons, "buttonOk"); - buttonOk->setAutoDefault(TRUE); - buttonOk->setDefault(FALSE); - GroupButtonsLayout->addWidget(buttonOk, 0, 0); - - buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons, "buttonApply"); - buttonApply->setAutoDefault(TRUE); - buttonApply->setDefault(FALSE); - GroupButtonsLayout->addWidget(buttonApply, 0, 1); - - GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2); - - buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons, "buttonCancel"); - buttonCancel->setAutoDefault(TRUE); - buttonCancel->setDefault(TRUE); - buttonCancel->setEnabled(TRUE); - GroupButtonsLayout->addWidget(buttonCancel, 0, 3); - - SMESHGUI_EditHypothesesDlgLayout->addWidget(GroupButtons, 4, 0); - - /***************************************************************/ - Init(); -} - -//================================================================================= -// function : ~SMESHGUI_EditHypothesesDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -SMESHGUI_EditHypothesesDlg::~SMESHGUI_EditHypothesesDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::Init() -{ - mySMESHGUI->SetActiveDialogBox((QDialog*)this); - - InitHypDefinition(); - InitAlgoDefinition(); - - //myGeomFilter = new SALOME_TypeFilter ("GEOM"); - TColStd_MapOfInteger allTypesMap; - for (int i = 0; i < 10; i++) - allTypesMap.Add(i); - myGeomFilter = new SMESH_NumberFilter ("GEOM", TopAbs_SHAPE, 0, allTypesMap); - myMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH); - - myGeomShape = GEOM::GEOM_Object::_nil(); - myMesh = SMESH::SMESH_Mesh::_nil(); - mySubMesh = SMESH::SMESH_subMesh::_nil(); - - /* signals and slots connections */ - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - - connect(SelectButtonC1A1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); - connect(SelectButtonC1A2, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); - - connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - - connect(ListHypAssignation, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(removeItem(QListBoxItem*))); - connect(ListAlgoAssignation, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(removeItem(QListBoxItem*))); - - connect(ListHypDefinition, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(addItem(QListBoxItem*))); - connect(ListAlgoDefinition, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(addItem(QListBoxItem*))); - - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); - this->show(); - - LineEditC1A1->setFocus(); - myEditCurrentArgument = LineEditC1A1; - mySelectionMgr->clearFilters(); - mySelectionMgr->installFilter(myMeshOrSubMeshFilter); - - SelectionIntoArgument(); - - UpdateControlState(); -} - -//================================================================================= -// function : ClickOnOk() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::ClickOnOk() -{ - if (ClickOnApply()) - ClickOnCancel(); -} - -//================================================================================= -// function : ClickOnApply() -// purpose : -//================================================================================= -bool SMESHGUI_EditHypothesesDlg::ClickOnApply() -{ - if (mySMESHGUI->isActiveStudyLocked()) - return false; - - bool aRes = false; - - SUIT_OverrideCursor wc; - - SUIT_Operation* op = new SUIT_Operation - (SUIT_Session::session()->activeApplication()); - - // start transaction - op->start(); - - if (!myMesh->_is_nil()) - aRes = StoreMesh(); - else if (!mySubMesh->_is_nil()) - aRes = StoreSubMesh(); - - if (true/*aRes*/) { // abort desynchronizes contents of a Study and a mesh on server - // commit transaction - op->commit(); - InitHypAssignation(); - InitAlgoAssignation(); - } else { - // abort transaction - op->abort(); - } - - UpdateControlState(); - mySMESHGUI->updateObjBrowser(); - - return aRes; -} - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::ClickOnCancel() -{ - close(); -} - -//================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed or other case -//================================================================================= -void SMESHGUI_EditHypothesesDlg::SelectionIntoArgument() -{ - QString aString = ""; - - SALOME_ListIO aList; - mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type()); - - int nbSel = SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString); - - if (myEditCurrentArgument == LineEditC1A1) { - if (nbSel != 1) { - myMesh = SMESH::SMESH_Mesh::_nil(); - mySubMesh = SMESH::SMESH_subMesh::_nil(); - aString = ""; - } else { - Handle(SALOME_InteractiveObject) IO = aList.First(); - myMesh = SMESH::IObjectToInterface(IO); - if (myMesh->_is_nil()) { - mySubMesh = SMESH::IObjectToInterface(IO); - if (mySubMesh->_is_nil()) { - aString = ""; - } - } - } - myEditCurrentArgument->setText(aString); - - // InitGeom() will try to retrieve a shape from myMesh or mySubMesh - myGeomShape = GEOM::GEOM_Object::_nil(); - InitGeom(); - - myImportedMesh = myGeomShape->_is_nil(); - - InitHypAssignation(); - InitAlgoAssignation(); - - } else if (myEditCurrentArgument == LineEditC1A2) { - if (nbSel != 1) { - myGeomShape = GEOM::GEOM_Object::_nil(); - } else { - Handle(SALOME_InteractiveObject) IO = aList.First(); - myGeomShape = SMESH::IObjectToInterface(IO); - } - InitGeom(); - } - - UpdateControlState(); -} - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::SetEditCurrentArgument() -{ - QPushButton* send = (QPushButton*)sender(); - if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus(); - myEditCurrentArgument = LineEditC1A1; - mySelectionMgr->clearFilters(); - mySelectionMgr->installFilter(myMeshOrSubMeshFilter); - } else if (send == SelectButtonC1A2) { - LineEditC1A2->setFocus(); - myEditCurrentArgument = LineEditC1A2; - mySelectionMgr->clearFilters(); - mySelectionMgr->installFilter(myGeomFilter); - } - SelectionIntoArgument(); -} - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::DeactivateActiveDialog() -{ - if (GroupC1->isEnabled()) { - disconnect(mySelectionMgr, 0, this, 0); - GroupC1->setEnabled(false); - GroupButtons->setEnabled(false); - } -} - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::ActivateThisDialog() -{ - mySMESHGUI->EmitSignalDeactivateDialog(); - GroupC1->setEnabled(true); - GroupButtons->setEnabled(true); - connect (mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); -} - -//================================================================================= -// function : enterEvent() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::enterEvent (QEvent*) -{ - if (!GroupC1->isEnabled()) - ActivateThisDialog(); -} - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::closeEvent (QCloseEvent* e) -{ - disconnect(mySelectionMgr, 0, this, 0); - mySMESHGUI->ResetState(); - mySelectionMgr->clearFilters(); - QDialog::closeEvent(e); -} - -//======================================================================= -// function : IsOld() -// purpose : -//======================================================================= -bool SMESHGUI_EditHypothesesDlg::IsOld (QListBoxItem* hypItem) -{ - if (hypItem->rtti() == ListBoxIOR::RTTI_IOR) { - ListBoxIOR* hyp = (ListBoxIOR*) hypItem; - return (myMapOldHypos.find(hyp->GetIOR()) != myMapOldHypos.end() || - myMapOldAlgos.find(hyp->GetIOR()) != myMapOldAlgos.end()); - } - - return false; -} - -//================================================================================= -// function : removeItem() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::removeItem (QListBoxItem* item) -{ - const QObject* aSender = sender(); - - if (!item) return; - - if (aSender == ListHypAssignation) { - myNbModification += IsOld(item) ? 1 : -1; - ListHypAssignation->removeItem(ListHypAssignation->index(item)); - } - else if (aSender == ListAlgoAssignation) { - myNbModification += IsOld(item) ? 1 : -1; - ListAlgoAssignation->removeItem(ListAlgoAssignation->index(item)); - } - - UpdateControlState(); -} - -//================================================================================= -// function : addItem() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::addItem (QListBoxItem* item) -{ - const QObject* aSender = sender(); - - if (!item) return; - - ListBoxIOR* i = 0; - if (item->rtti() == ListBoxIOR::RTTI_IOR) - i = (ListBoxIOR*)item; - if (!i) return; - - bool isFound = false; - - ListBoxIOR* anItem; - if (aSender == ListHypDefinition) { - for (int j = 0, n = ListHypAssignation->count(); !isFound && j < n; j++) { - if (ListHypAssignation->item(j)->rtti() == ListBoxIOR::RTTI_IOR) { - anItem = (ListBoxIOR*)ListHypAssignation->item(j); - isFound = !strcmp(anItem->GetIOR(), i->GetIOR()); - } - } - if (!isFound) - anItem = new ListBoxIOR (ListHypAssignation, - CORBA::string_dup(i->GetIOR()), - CORBA::string_dup(i->text().latin1())); - - } else if (aSender == ListAlgoDefinition) { - for (int j = 0, n = ListAlgoAssignation->count(); !isFound && j < n; j++) { - if (ListAlgoAssignation->item(j)->rtti() == ListBoxIOR::RTTI_IOR) { - anItem = (ListBoxIOR*)ListAlgoAssignation->item(j); - isFound = !strcmp(anItem->GetIOR(), i->GetIOR()); - } - } - if (!isFound) - anItem = new ListBoxIOR (ListAlgoAssignation, - CORBA::string_dup(i->GetIOR()), - CORBA::string_dup(i->text().latin1())); - } else { - } - - if (!isFound) - myNbModification += IsOld(item) ? -1 : 1; - - UpdateControlState(); -} - -//================================================================================= -// function : InitHypDefinition() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::InitHypDefinition() -{ - ListHypDefinition->clear(); - - _PTR(SComponent) father = SMESH::GetActiveStudyDocument()->FindComponent("SMESH"); - if (!father) - return; - - _PTR(SObject) HypothesisRoot; - _PTR(GenericAttribute) anAttr; - _PTR(AttributeName) aName; - _PTR(AttributeIOR) anIOR; - - //int Tag_HypothesisRoot = 1; - if (father->FindSubObject(1, HypothesisRoot)) { - _PTR(ChildIterator) it = - SMESH::GetActiveStudyDocument()->NewChildIterator(HypothesisRoot); - ListBoxIOR* anItem; - for (; it->More();it->Next()) { - _PTR(SObject) Obj = it->Value(); - if (Obj->FindAttribute(anAttr, "AttributeName")) { - aName = anAttr; - if (Obj->FindAttribute(anAttr, "AttributeIOR")) { - anIOR = anAttr; - anItem = new ListBoxIOR (ListHypDefinition, - anIOR->Value().c_str(), - aName->Value().c_str()); - } - } - } - } -} - -//================================================================================= -// function : InitHypAssignation() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::InitHypAssignation() -{ - myNbModification = 0; - - myMapOldHypos.clear(); - ListHypAssignation->clear(); - if (myImportedMesh) - return; - - _PTR(SObject) aMorSM, AHR, aRef; - _PTR(GenericAttribute) anAttr; - _PTR(AttributeName) aName; - _PTR(AttributeIOR) anIOR; - - if (!myMesh->_is_nil()) - aMorSM = SMESH::FindSObject(myMesh); - else if (!mySubMesh->_is_nil()) - aMorSM = SMESH::FindSObject(mySubMesh); - - if (aMorSM && aMorSM->FindSubObject(2, AHR)) { - _PTR(ChildIterator) it = - SMESH::GetActiveStudyDocument()->NewChildIterator(AHR); - for (; it->More();it->Next()) { - _PTR(SObject) Obj = it->Value(); - if (Obj->ReferencedObject(aRef)) { - if (aRef->FindAttribute(anAttr, "AttributeName")) { - aName = anAttr; - if (aRef->FindAttribute(anAttr, "AttributeIOR")) { - anIOR = anAttr; - ListBoxIOR* anItem = new ListBoxIOR (ListHypAssignation, - anIOR->Value().c_str(), - aName->Value().c_str()); - myMapOldHypos[ anIOR->Value() ] = ListHypAssignation->index(anItem); - } - } - } - } - } -} - -//================================================================================= -// function : InitAlgoDefinition() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::InitAlgoDefinition() -{ - ListAlgoDefinition->clear(); - - _PTR(SComponent) father = SMESH::GetActiveStudyDocument()->FindComponent("SMESH"); - if (!father) - return; - - _PTR(SObject) AlgorithmsRoot; - _PTR(GenericAttribute) anAttr; - _PTR(AttributeName) aName; - _PTR(AttributeIOR) anIOR; - - if (father->FindSubObject (2, AlgorithmsRoot)) { - _PTR(ChildIterator) it = - SMESH::GetActiveStudyDocument()->NewChildIterator(AlgorithmsRoot); - ListBoxIOR* anItem; - for (; it->More();it->Next()) { - _PTR(SObject) Obj = it->Value(); - if (Obj->FindAttribute(anAttr, "AttributeName")) { - aName = anAttr; - if (Obj->FindAttribute(anAttr, "AttributeIOR")) { - anIOR = anAttr; - anItem = new ListBoxIOR (ListAlgoDefinition, - anIOR->Value().c_str(), - aName->Value().c_str()); - } - } - } - } -} - -//================================================================================= -// function : InitAlgoAssignation() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::InitAlgoAssignation() -{ - myMapOldAlgos.clear(); - ListAlgoAssignation->clear(); - if (myImportedMesh) - return; - - _PTR(SObject) aMorSM, AHR, aRef; - _PTR(GenericAttribute) anAttr; - _PTR(AttributeName) aName; - _PTR(AttributeIOR) anIOR; - - if (!myMesh->_is_nil()) - aMorSM = SMESH::FindSObject(myMesh); - else if (!mySubMesh->_is_nil()) - aMorSM = SMESH::FindSObject(mySubMesh); - - if (aMorSM && aMorSM->FindSubObject(3, AHR)) { - _PTR(ChildIterator) it = - SMESH::GetActiveStudyDocument()->NewChildIterator(AHR); - for (; it->More();it->Next()) { - _PTR(SObject) Obj = it->Value(); - if (Obj->ReferencedObject(aRef)) { - if (aRef->FindAttribute(anAttr, "AttributeName")) { - aName = anAttr; - if (aRef->FindAttribute(anAttr, "AttributeIOR")) { - anIOR = anAttr; - ListBoxIOR* anItem = new ListBoxIOR (ListAlgoAssignation, - anIOR->Value().c_str(), - aName->Value().c_str()); - myMapOldAlgos[ anIOR->Value() ] = ListAlgoAssignation->index(anItem); - } - } - } - } - } -} - -//================================================================================= -// function : InitGeom() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::InitGeom() -{ - LineEditC1A2->setText(""); - - if (myGeomShape->_is_nil() && !myMesh->_is_nil()) { - _PTR(SObject) aMesh = SMESH::FindSObject(myMesh); - if (aMesh) - myGeomShape = SMESH::GetShapeOnMeshOrSubMesh(aMesh); - } - if (myGeomShape->_is_nil() && !mySubMesh->_is_nil()) { - _PTR(SObject) aSubMesh = SMESH::FindSObject(mySubMesh); - if (aSubMesh) - myGeomShape = SMESH::GetShapeOnMeshOrSubMesh(aSubMesh); - } - - _PTR(GenericAttribute) anAttr; - _PTR(AttributeName) aName; - if (!myGeomShape->_is_nil() && (!myMesh->_is_nil() || !mySubMesh->_is_nil())) { - _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); - //_PTR(SObject) aSO = aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomShape)); - _PTR(SObject) aSO = aStudy->FindObjectID(myGeomShape->GetStudyEntry()); - if (aSO) { - if (aSO->FindAttribute(anAttr, "AttributeName")) { - aName = anAttr; - LineEditC1A2->setText(QString(aName->Value().c_str())); - } - } - } -} - -//================================================================================= -// function : UpdateControlState() -// purpose : -//================================================================================= -void SMESHGUI_EditHypothesesDlg::UpdateControlState() -{ - // asl the check of "count" is commented because of PAL9787 - bool isEnabled = (!myMesh->_is_nil() && !myGeomShape->_is_nil() /*&& - ListHypAssignation->count() && ListAlgoAssignation->count()*/ ) - || - (!mySubMesh->_is_nil() && !myGeomShape->_is_nil() /*&& - (ListHypAssignation->count() || ListAlgoAssignation->count())*/); - - buttonOk ->setEnabled(myNbModification && isEnabled && !myImportedMesh); - buttonApply->setEnabled(myNbModification && isEnabled && !myImportedMesh); - - SelectButtonC1A2 ->setEnabled(ALLOW_CHANGE_SHAPE && !myImportedMesh); - LineEditC1A2 ->setEnabled(ALLOW_CHANGE_SHAPE && !myImportedMesh); - ListHypDefinition ->setEnabled(!myImportedMesh); - ListHypAssignation ->setEnabled(!myImportedMesh); - ListAlgoDefinition ->setEnabled(!myImportedMesh); - ListAlgoAssignation->setEnabled(!myImportedMesh); -} - -//================================================================================= -// function : StoreMesh() -// purpose : -//================================================================================= -bool SMESHGUI_EditHypothesesDlg::StoreMesh() -{ - MapIOR anOldHypos, aNewHypos; - if (myGeomShape->_is_nil()) - return false; - - // 1. Check whether the geometric shape has changed - _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh); - GEOM::GEOM_Object_var aIniGeomShape = SMESH::GetShapeOnMeshOrSubMesh(aMeshSO); - bool bShapeChanged = aIniGeomShape->_is_nil() || - !aIniGeomShape->_is_equivalent(myGeomShape); - if (bShapeChanged) { - // VSR : TODO : Set new shape - not supported yet by SMESH engine - // 1. remove all old hypotheses and algorithms and also submeshes - // 2. set new shape - } - - int nbFail = 0; - MapIOR::iterator it; - - // 2. remove not used hypotheses from the mesh - for (it = myMapOldHypos.begin(); it != myMapOldHypos.end(); ++it) { - string ior = it->first; - int index = findItem(ListHypAssignation, ior); - if (index < 0) { - SMESH::SMESH_Hypothesis_var aHyp = - SMESH::IORToInterface(ior.c_str()); - if (!aHyp->_is_nil()) { - if (!SMESH::RemoveHypothesisOrAlgorithmOnMesh(aMeshSO, aHyp)) - nbFail++; - } - } - } - - // 3. remove not used algorithms from the mesh - for (it = myMapOldAlgos.begin(); it != myMapOldAlgos.end(); ++it) { - string ior = it->first; - int index = findItem(ListAlgoAssignation, ior); - if (index < 0) { - SMESH::SMESH_Hypothesis_var aHyp = - SMESH::IORToInterface(ior.c_str()); - if (!aHyp->_is_nil()) { - if (!SMESH::RemoveHypothesisOrAlgorithmOnMesh(aMeshSO, aHyp)) - nbFail++; - } - } - } - - // 4. Add new algorithms - for (int i = 0; i < ListAlgoAssignation->count(); i++) { - if (ListAlgoAssignation->item(i)->rtti() == ListBoxIOR::RTTI_IOR) { - ListBoxIOR* anItem = (ListBoxIOR*)(ListAlgoAssignation->item(i)); - if (anItem) { - string ior = anItem->GetIOR(); - if (myMapOldAlgos.find(ior) == myMapOldAlgos.end()) { - SMESH::SMESH_Hypothesis_var aHyp = - SMESH::IORToInterface(ior.c_str()); - if (!aHyp->_is_nil()) { - if (!SMESH::AddHypothesisOnMesh(myMesh, aHyp)) - nbFail++; - } - } - } - } - } - - // 5. Add new hypotheses - for (int i = 0; i < ListHypAssignation->count(); i++) { - if (ListHypAssignation->item(i)->rtti() == ListBoxIOR::RTTI_IOR) { - ListBoxIOR* anItem = (ListBoxIOR*)(ListHypAssignation->item(i)); - if (anItem) { - string ior = anItem->GetIOR(); - if (myMapOldHypos.find(ior) == myMapOldHypos.end()) { - SMESH::SMESH_Hypothesis_var aHyp = - SMESH::IORToInterface(ior.c_str()); - if (!aHyp->_is_nil()) { - if (!SMESH::AddHypothesisOnMesh(myMesh, aHyp)) - nbFail++; - } - } - } - } - } - return (nbFail == 0); -} - -//================================================================================= -// function : StoreSubMesh() -// purpose : -//================================================================================= -bool SMESHGUI_EditHypothesesDlg::StoreSubMesh() -{ - MapIOR anOldHypos, aNewHypos; - if (myGeomShape->_is_nil()) - return false; - - // 1. Check whether the geometric shape has changed - _PTR(SObject) aSubMeshSO = SMESH::FindSObject(mySubMesh); - GEOM::GEOM_Object_var aIniGeomShape = SMESH::GetShapeOnMeshOrSubMesh(aSubMeshSO); - bool bShapeChanged = aIniGeomShape->_is_nil() || !aIniGeomShape->_is_equivalent(myGeomShape); - if (bShapeChanged) { - // VSR : TODO : Set new shape - not supported yet by engine - // 1. remove all old hypotheses and algorithms - // 2. set new shape - } - int nbFail = 0; - MapIOR::iterator it; - - // 2. remove not used hypotheses from the submesh - for (it = myMapOldHypos.begin(); it != myMapOldHypos.end(); ++it) { - string ior = it->first; - int index = findItem(ListHypAssignation, ior); - if (index < 0) { - SMESH::SMESH_Hypothesis_var aHyp = SMESH::IORToInterface(ior.c_str()); - if (!aHyp->_is_nil()) { - if (!SMESH::RemoveHypothesisOrAlgorithmOnMesh(aSubMeshSO, aHyp)) - nbFail++; - } - } - } - - // 3. remove not used algorithms from the submesh - for (it = myMapOldAlgos.begin(); it != myMapOldAlgos.end(); ++it) { - string ior = it->first; - int index = findItem(ListAlgoAssignation, ior); - if (index < 0) { - SMESH::SMESH_Hypothesis_var aHyp = SMESH::IORToInterface(ior.c_str()); - if (!aHyp->_is_nil()){ - if (!SMESH::RemoveHypothesisOrAlgorithmOnMesh(aSubMeshSO, aHyp)) - nbFail++; - } - } - } - - // 4. Add new algorithms - for (int i = 0; i < ListAlgoAssignation->count(); i++) { - if (ListAlgoAssignation->item(i)->rtti() == ListBoxIOR::RTTI_IOR) { - ListBoxIOR* anItem = (ListBoxIOR*)(ListAlgoAssignation->item(i)); - if (anItem) { - string ior = anItem->GetIOR(); - if (myMapOldAlgos.find(ior) == myMapOldAlgos.end()) { - SMESH::SMESH_Hypothesis_var aHyp = SMESH::IORToInterface(ior.c_str()); - if (!aHyp->_is_nil()){ - if (!SMESH::AddHypothesisOnSubMesh(mySubMesh, aHyp)) - nbFail++; - } - } - } - } - } - - // 5. Add new hypotheses - for (int i = 0; i < ListHypAssignation->count(); i++) { - if (ListHypAssignation->item(i)->rtti() == ListBoxIOR::RTTI_IOR) { - ListBoxIOR* anItem = (ListBoxIOR*)(ListHypAssignation->item(i)); - if (anItem) { - string ior = anItem->GetIOR(); - if (myMapOldHypos.find(ior) == myMapOldHypos.end()) { - SMESH::SMESH_Hypothesis_var aHyp = SMESH::IORToInterface(ior.c_str()); - if (!aHyp->_is_nil()){ - if (!SMESH::AddHypothesisOnSubMesh(mySubMesh, aHyp)) - nbFail++; - } - } - } - } - } - return (nbFail == 0); -} diff --git a/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx index f99e00ac0..28401a22a 100644 --- a/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SMESHGUI_EditMeshDlg.h" @@ -28,6 +28,9 @@ #include "SUIT_Desktop.h" #include "SUIT_Session.h" +#include "SUIT_MessageBox.h" + +#include "LightApp_Application.h" #include "SALOME_ListIO.hxx" @@ -103,6 +106,10 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule, GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton (GroupButtons, "buttonCancel"); buttonCancel->setText(tr("SMESH_BUT_CLOSE" )); buttonCancel->setAutoDefault(TRUE); @@ -149,6 +156,8 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule, GroupMeshLayout->addWidget(LineEditMesh, 0, 2); DlgLayout->addWidget(GroupMesh, 1, 0); + myHelpFileName = "merge_elements.htm"; + Init(); // Initialisations } @@ -178,6 +187,7 @@ void SMESHGUI_EditMeshDlg::Init() connect(buttonOk , SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply , SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(SelectButton, SIGNAL(clicked()), this, SLOT(SelectionIntoArgument())); @@ -186,10 +196,6 @@ void SMESHGUI_EditMeshDlg::Init() connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()) , this, SLOT(ClickOnCancel())); - // Move widget on the bottom right corner of main widget - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); // displays Dialog LineEditMesh->setFocus(); @@ -246,6 +252,23 @@ void SMESHGUI_EditMeshDlg::ClickOnCancel() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_EditMeshDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection as changed or other case diff --git a/src/SMESHGUI/SMESHGUI_EditMeshDlg.h b/src/SMESHGUI/SMESHGUI_EditMeshDlg.h index eeddcfd82..a1386effc 100644 --- a/src/SMESHGUI/SMESHGUI_EditMeshDlg.h +++ b/src/SMESHGUI/SMESHGUI_EditMeshDlg.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef DIALOGBOX_GETMESH_H @@ -82,6 +82,7 @@ class SMESHGUI_EXPORT SMESHGUI_EditMeshDlg : public QDialog QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; QGroupBox* GroupMesh; QLabel* TextLabelMesh; @@ -94,10 +95,13 @@ class SMESHGUI_EXPORT SMESHGUI_EditMeshDlg : public QDialog QGridLayout* GroupButtonsLayout; QGridLayout* GroupMeshLayout; + QString myHelpFileName; + private slots: void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); void SelectionIntoArgument(); void DeactivateActiveDialog(); void ActivateThisDialog(); diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx index 7b68e4817..f8a3903a5 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -48,6 +48,9 @@ #include "SUIT_OverrideCursor.h" #include "SUIT_Desktop.h" #include "SUIT_MessageBox.h" +#include "SUIT_Session.h" + +#include "LightApp_Application.h" #include "SVTK_ViewModel.h" #include "SVTK_ViewWindow.h" @@ -295,10 +298,14 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod CloseButton = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons); CloseButton->setAutoDefault(true); + HelpButton = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons); + HelpButton->setAutoDefault(true); + // layouting GroupButtonsLayout->addWidget(OkButton, 0, 0); GroupButtonsLayout->addWidget(ApplyButton, 0, 1); GroupButtonsLayout->addWidget(CloseButton, 0, 3); + GroupButtonsLayout->addWidget(HelpButton, 0, 4); GroupButtonsLayout->addColSpacing(2, 10); GroupButtonsLayout->setColStretch(2, 10); @@ -330,6 +337,8 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod myElementsFilter = new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR); myPathMeshFilter = new SMESH_TypeFilter (MESH); + myHelpFileName = "extrusion_along_a_path.htm"; + Init(); /***************************************************************/ @@ -337,6 +346,7 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod connect(OkButton, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(CloseButton, SIGNAL(clicked()), this, SLOT(reject())); connect(ApplyButton, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(HelpButton, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(AddAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleAdded())); connect(RemoveAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleRemoved())); @@ -370,10 +380,7 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod ZSpin->editor()->installEventFilter(this); /***************************************************************/ - // set position and show dialog box - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); + this->show(); // displays Dialog } @@ -657,6 +664,23 @@ void SMESHGUI_ExtrusionAlongPathDlg::ClickOnOk() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_ExtrusionAlongPathDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : reject() // purpose : Called when dialog box is closed diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h index 7b1e34961..73bc229c3 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -144,6 +144,9 @@ private: QPushButton* OkButton; QPushButton* ApplyButton; QPushButton* CloseButton; + QPushButton* HelpButton; + + QString myHelpFileName; protected slots: void reject(); @@ -152,6 +155,7 @@ private slots: void ConstructorsClicked (int); void ClickOnOk(); bool ClickOnApply(); + void ClickOnHelp(); void SetEditCurrentArgument(); void SelectionIntoArgument(); void DeactivateActiveDialog(); diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx index 848370451..70fa135ad 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -46,6 +46,9 @@ #include "SUIT_OverrideCursor.h" #include "SUIT_Desktop.h" #include "SUIT_MessageBox.h" +#include "SUIT_Session.h" + +#include "LightApp_Application.h" #include "SVTK_ViewModel.h" #include "SVTK_ViewWindow.h" @@ -134,6 +137,10 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule, GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton(GroupButtons, "buttonCancel"); buttonCancel->setText(tr("SMESH_BUT_CLOSE" )); buttonCancel->setAutoDefault(TRUE); @@ -246,6 +253,8 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule, myMeshOrSubMeshOrGroupFilter = new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR); + myHelpFileName = "extrusion.htm"; + Init(); /***************************************************************/ @@ -253,8 +262,14 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule, connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); - connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int))); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); + // to update state of the Ok & Apply buttons + connect(SpinBox_Dx, SIGNAL(valueChanged(double)), SLOT(CheckIsEnable())); + connect(SpinBox_Dy, SIGNAL(valueChanged(double)), SLOT(CheckIsEnable())); + connect(SpinBox_Dz, SIGNAL(valueChanged(double)), SLOT(CheckIsEnable())); + + connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int))); connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); @@ -264,10 +279,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule, connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); /***************************************************************/ - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); + this->show(); // displays Dialog ConstructorsClicked(0); @@ -295,9 +307,6 @@ void SMESHGUI_ExtrusionDlg::Init (bool ResetControls) myElementsId = ""; myNbOkElements = 0; - buttonOk->setEnabled(false); - buttonApply->setEnabled(false); - myActor = 0; myMesh = SMESH::SMESH_Mesh::_nil(); @@ -310,6 +319,25 @@ void SMESHGUI_ExtrusionDlg::Init (bool ResetControls) CheckBoxMesh->setChecked(false); onSelectMesh(false); } + + CheckIsEnable(); +} + +//================================================================================= +// function : CheckIsEnable() +// purpose : Check whether the Ok and Apply buttons should be enabled or not +//================================================================================= +void SMESHGUI_ExtrusionDlg::CheckIsEnable() +{ + double aX = SpinBox_Dx->GetValue(); + double aY = SpinBox_Dy->GetValue(); + double aZ = SpinBox_Dz->GetValue(); + double aModule = sqrt(aX*aX + aY*aY + aZ*aZ); + + bool anIsEnable = myNbOkElements > 0 && aModule > 1.0E-38; + + buttonOk->setEnabled(anIsEnable); + buttonApply->setEnabled(anIsEnable); } //================================================================================= @@ -420,6 +448,23 @@ void SMESHGUI_ExtrusionDlg::ClickOnCancel() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_ExtrusionDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : onTextChange() // purpose : @@ -437,9 +482,6 @@ void SMESHGUI_ExtrusionDlg::onTextChange (const QString& theNewText) if (send == LineEditElements) myNbOkElements = 0; - buttonOk->setEnabled(false); - buttonApply->setEnabled(false); - // hilight entered elements/nodes SMDS_Mesh* aMesh = 0; if (myActor) @@ -464,10 +506,7 @@ void SMESHGUI_ExtrusionDlg::onTextChange (const QString& theNewText) } } - if (myNbOkElements) { - buttonOk->setEnabled(true); - buttonApply->setEnabled(true); - } + CheckIsEnable(); myBusy = false; } @@ -493,8 +532,6 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument() myEditCurrentArgument->setText(aString); myNbOkElements = 0; - buttonOk->setEnabled(false); - buttonApply->setEnabled(false); myBusy = false; // get selected mesh @@ -596,10 +633,7 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument() myBusy = false; // OK - if (myNbOkElements) { - buttonOk->setEnabled(true); - buttonApply->setEnabled(true); - } + CheckIsEnable(); } //================================================================================= diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h index 9b8a3705e..8bbce01a2 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -113,12 +113,17 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; + + QString myHelpFileName; private slots: void ConstructorsClicked (int); + void CheckIsEnable(); void ClickOnOk(); bool ClickOnApply(); void ClickOnCancel(); + void ClickOnHelp(); void SetEditCurrentArgument(); void SelectionIntoArgument(); void DeactivateActiveDialog(); diff --git a/src/SMESHGUI/SMESHGUI_Filter.cxx b/src/SMESHGUI/SMESHGUI_Filter.cxx index 19b3fcb1a..bb0905239 100755 --- a/src/SMESHGUI/SMESHGUI_Filter.cxx +++ b/src/SMESHGUI/SMESHGUI_Filter.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -225,7 +225,8 @@ bool SMESHGUI_QuadrangleFilter::IsValid( const int theCellId ) const SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); const SMDS_MeshElement* anElem = aMesh->FindElement( anActor->GetElemObjId( theCellId ) ); - return anElem && anElem->GetType() == SMDSAbs_Face && anElem->NbNodes() == 4; + return anElem && anElem->GetType() == SMDSAbs_Face && + ( anElem->NbNodes() == ( anElem->IsQuadratic() ? 8 : 4 )); } //======================================================================= @@ -244,7 +245,8 @@ bool SMESHGUI_QuadrangleFilter::IsObjValid( const int theObjId ) const SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); const SMDS_MeshElement* anElem = aMesh->FindElement( theObjId ); - return anElem && anElem->GetType() == SMDSAbs_Face && anElem->NbNodes() == 4; + return anElem && anElem->GetType() == SMDSAbs_Face && + ( anElem->NbNodes() == ( anElem->IsQuadratic() ? 8 : 4 )); } //======================================================================= @@ -302,7 +304,8 @@ bool SMESHGUI_TriangleFilter::IsValid( const int theCellId ) const SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); const SMDS_MeshElement* anElem = aMesh->FindElement( anActor->GetElemObjId( theCellId ) ); - return anElem && anElem->GetType() == SMDSAbs_Face && anElem->NbNodes() == 3; + return anElem && anElem->GetType() == SMDSAbs_Face && + ( anElem->NbNodes() == ( anElem->IsQuadratic() ? 6 : 3 )); } //======================================================================= @@ -321,7 +324,8 @@ bool SMESHGUI_TriangleFilter::IsObjValid( const int theObjId ) const SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); const SMDS_MeshElement* anElem = aMesh->FindElement( theObjId ); - return anElem && anElem->GetType() == SMDSAbs_Face && anElem->NbNodes() == 3; + return anElem && anElem->GetType() == SMDSAbs_Face && + ( anElem->NbNodes() == ( anElem->IsQuadratic() ? 6 : 3 )); } //======================================================================= diff --git a/src/SMESHGUI/SMESHGUI_Filter.h b/src/SMESHGUI/SMESHGUI_Filter.h index 466b30cc5..4f912cdb8 100755 --- a/src/SMESHGUI/SMESHGUI_Filter.h +++ b/src/SMESHGUI/SMESHGUI_Filter.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index 6c01f45a2..c519986c9 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -44,8 +44,10 @@ #include "SUIT_Desktop.h" #include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "SalomeApp_Tools.h" #include "SalomeApp_Study.h" @@ -1695,6 +1697,8 @@ void SMESHGUI_FilterDlg::construct (const QValueList& theTypes) aDlgLay->setStretchFactor(myMainFrame, 1); + myHelpFileName = "selection_filter_library.htm"; + Init(myTypes); } @@ -1790,11 +1794,13 @@ QFrame* SMESHGUI_FilterDlg::createButtonFrame (QWidget* theParent) myButtons[ BTN_Cancel ] = new QPushButton(tr("SMESH_BUT_CANCEL"), aGrp); myButtons[ BTN_Close ] = new QPushButton(tr("SMESH_BUT_CLOSE"), aGrp); + myButtons[ BTN_Help ] = new QPushButton(tr("SMESH_BUT_HELP"), aGrp); connect(myButtons[ BTN_OK ], SIGNAL(clicked()), SLOT(onOk())); connect(myButtons[ BTN_Cancel ], SIGNAL(clicked()), SLOT(onClose())); connect(myButtons[ BTN_Close ], SIGNAL(clicked()), SLOT(onClose())); connect(myButtons[ BTN_Apply ], SIGNAL(clicked()), SLOT(onApply())); + connect(myButtons[ BTN_Help ], SIGNAL(clicked()), SLOT(onHelp())); updateMainButtons(); @@ -1855,11 +1861,7 @@ void SMESHGUI_FilterDlg::Init (const QValueList& theTypes) connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); - - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); - + updateMainButtons(); updateSelection(); @@ -1943,6 +1945,23 @@ void SMESHGUI_FilterDlg::onClose() return; } +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_FilterDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= // name : SMESHGUI_FilterDlg::onDeactivate // Purpose : SLOT called when dialog must be deativated diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.h b/src/SMESHGUI/SMESHGUI_FilterDlg.h index bdfbd8047..ca43229ae 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.h +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -223,7 +223,7 @@ class SMESHGUI_FilterDlg : public QDialog enum { Mesh, Selection, Dialog, None }; // Buttons - enum { BTN_OK, BTN_Cancel, BTN_Apply, BTN_Close }; + enum { BTN_OK, BTN_Cancel, BTN_Apply, BTN_Close, BTN_Help }; public: SMESHGUI_FilterDlg( SMESHGUI*, @@ -253,6 +253,7 @@ private slots: void onOk(); bool onApply(); void onClose(); + void onHelp(); void onDeactivate(); void onSelectionDone(); void onCriterionChanged (const int, const int); @@ -311,6 +312,8 @@ private: QMap< int, SMESH::Filter_var > myFilter; QMap< int, bool > myInsertState; QMap< int, int > myApplyToState; + + QString myHelpFileName; }; #endif diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx index a6e560ffa..a131436a9 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -34,6 +34,9 @@ #include "SUIT_Session.h" #include "SUIT_Desktop.h" #include "SUIT_FileDlg.h" +#include "SUIT_MessageBox.h" + +#include "LightApp_Application.h" // QT Includes #include @@ -99,7 +102,7 @@ SMESHGUI_FilterLibraryDlg::SMESHGUI_FilterLibraryDlg (SMESHGUI* theModule, const QValueList& theTypes, const int theMode, const char* theName) - : QDialog( parent, theName, true, WStyle_Customize | + : QDialog( parent, theName, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ), mySMESHGUI( theModule ) { @@ -144,6 +147,8 @@ void SMESHGUI_FilterLibraryDlg::construct (const QValueList& theTypes, aDlgLay->setStretchFactor(myMainFrame, 1); + myHelpFileName = "selection_filter_library.htm"; + Init(myTypes, myMode); } @@ -244,11 +249,13 @@ QFrame* SMESHGUI_FilterLibraryDlg::createButtonFrame (QWidget* theParent) myButtons[ BTN_Cancel ] = new QPushButton(tr("SMESH_BUT_CANCEL"), aGrp); myButtons[ BTN_Close ] = new QPushButton(tr("SMESH_BUT_CLOSE"), aGrp); + myButtons[ BTN_Help ] = new QPushButton(tr("SMESH_BUT_HELP"), aGrp); connect(myButtons[ BTN_OK ], SIGNAL(clicked()), SLOT(onOk())); connect(myButtons[ BTN_Cancel ], SIGNAL(clicked()), SLOT(onClose())); connect(myButtons[ BTN_Close ], SIGNAL(clicked()), SLOT(onClose())); connect(myButtons[ BTN_Apply ], SIGNAL(clicked()), SLOT(onApply())); + connect(myButtons[ BTN_Help ], SIGNAL(clicked()), SLOT(onHelp())); QMap::iterator anIter; for (anIter = myButtons.begin(); anIter != myButtons.end(); ++anIter) @@ -343,10 +350,6 @@ void SMESHGUI_FilterLibraryDlg::Init (const QValueList& theTypes, myListBox->setCurrentItem(0); } - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); - this->show(); updateMainButtons(); @@ -465,6 +468,23 @@ void SMESHGUI_FilterLibraryDlg::onClose() reject(); } +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_FilterLibraryDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= // name : SMESHGUI_FilterLibraryDlg::onDeactivate // Purpose : SLOT called when dialog must be deativated diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h index 867801101..427ff712c 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -55,7 +55,7 @@ class SMESHGUI_EXPORT SMESHGUI_FilterLibraryDlg : public QDialog Q_OBJECT // Buttons - enum { BTN_OK, BTN_Cancel, BTN_Apply, BTN_Close }; + enum { BTN_OK, BTN_Cancel, BTN_Apply, BTN_Close, BTN_Help }; class Dialog; @@ -96,6 +96,7 @@ private slots: void onOk(); bool onApply(); void onClose(); + void onHelp(); void onDeactivate(); @@ -154,6 +155,7 @@ private: QString myCurrFilterName; int myCurrFilter; + QString myHelpFileName; }; #endif diff --git a/src/SMESHGUI/SMESHGUI_FilterUtils.cxx b/src/SMESHGUI/SMESHGUI_FilterUtils.cxx index e5c529f16..c0e08a0cb 100644 --- a/src/SMESHGUI/SMESHGUI_FilterUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterUtils.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "SMESHGUI_FilterUtils.h" diff --git a/src/SMESHGUI/SMESHGUI_FilterUtils.h b/src/SMESHGUI/SMESHGUI_FilterUtils.h index 501bad2d9..22d65870e 100644 --- a/src/SMESHGUI/SMESHGUI_FilterUtils.h +++ b/src/SMESHGUI/SMESHGUI_FilterUtils.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef SMESHGUI_FilterUtils_HeaderFile #define SMESHGUI_FilterUtils_HeaderFile diff --git a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx index 4ea7e9180..520499301 100644 --- a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include diff --git a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h index ecdbc4bf8..9e0762d13 100644 --- a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h +++ b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef SMESHGUI_GEOMGenUtils_HeaderFile #define SMESHGUI_GEOMGenUtils_HeaderFile diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index b9396313b..872d98a15 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -43,8 +43,11 @@ #include "SUIT_Desktop.h" #include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" #include "SalomeApp_Tools.h" +#include "LightApp_Application.h" #include "SALOMEDSClient_Study.hxx" #include "SALOME_ListIO.hxx" #include "SALOME_ListIteratorOfListIO.hxx" @@ -73,6 +76,8 @@ #include #include +#include + // STL includes #include #include @@ -103,12 +108,6 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name, myGeomGroupBtn->setEnabled(false); myGeomGroupLine->setEnabled(false); } - - - /* Move widget on the botton right corner of main widget */ - int x, y ; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); } //================================================================================= @@ -116,7 +115,7 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name, // purpose : //================================================================================= SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name, - SMESH::SMESH_Group_ptr theGroup, bool modal, WFlags fl) + SMESH::SMESH_GroupBase_ptr theGroup, bool modal, WFlags fl) : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose), mySMESHGUI( theModule ), @@ -136,11 +135,6 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name, myCurrentLineEdit = myMeshGroupLine; setSelectionMode(5); } - - /* Move widget on the botton right corner of main widget */ - int x, y ; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); } //================================================================================= @@ -155,10 +149,14 @@ void SMESHGUI_GroupDlg::initDialog(bool create) QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT"))); - if (create) + if (create) { setCaption(tr("SMESH_CREATE_GROUP_TITLE")); - else + myHelpFileName = "/files/creating_groups.htm"; + } + else { setCaption(tr("SMESH_EDIT_GROUP_TITLE")); + myHelpFileName = "/files/editing_groups.htm"; + } setSizeGripEnabled(TRUE); @@ -270,7 +268,7 @@ void SMESHGUI_GroupDlg::initDialog(bool create) myGroupLine = new QLineEdit(aSelectBox, "group line"); myGroupLine->setReadOnly(true); onSelectGroup(false); - + /***************************************************************/ QGridLayout* wg1Layout = new QGridLayout( wg1, 3, 1, 0, 6 ); wg1Layout->addWidget(aContentBox, 0, 0); @@ -287,6 +285,12 @@ void SMESHGUI_GroupDlg::initDialog(bool create) myGeomGroupLine->setReadOnly(true); //VSR ??? onSelectGeomGroup(false); + if (!create) + { + myGeomGroupBtn->setEnabled(false); + myGeomGroupLine->setEnabled(false); + } + /***************************************************************/ QGridLayout* wg2Layout = new QGridLayout( wg2, 2, 3, 0, 6 ); wg2Layout->addWidget(geomObject, 0, 0); @@ -302,6 +306,21 @@ void SMESHGUI_GroupDlg::initDialog(bool create) myWGStack->addWidget( wg2, myGrpTypeGroup->id(rb2) ); /***************************************************************/ + QGroupBox* aColorBox = new QGroupBox(2, Qt::Horizontal, this, "color box"); + aColorBox->setTitle(tr("SMESH_SET_COLOR")); + + mySelectColorGroup = new QCheckBox(aColorBox, "color checkbox"); + mySelectColorGroup->setText(tr("SMESH_CHECK_COLOR")); + + myColorSpinBox = new QtxIntSpinBox( aColorBox ); + myColorSpinBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); + myColorSpinBox->setMinValue( 0 ); + myColorSpinBox->setMaxValue( 9999 ); + + onSelectColorGroup(false); + + /***************************************************************/ + QFrame* aButtons = new QFrame(this, "button box"); aButtons->setFrameStyle(QFrame::Box | QFrame::Sunken); QHBoxLayout* aBtnLayout = new QHBoxLayout(aButtons, 11, 6); @@ -317,11 +336,15 @@ void SMESHGUI_GroupDlg::initDialog(bool create) QPushButton* aCloseBtn = new QPushButton(aButtons, "close"); aCloseBtn->setText(tr("SMESH_BUT_CLOSE")); aCloseBtn->setAutoDefault(true); + QPushButton* aHelpBtn = new QPushButton(aButtons, "help"); + aHelpBtn->setText(tr("SMESH_BUT_HELP")); + aHelpBtn->setAutoDefault(true); aBtnLayout->addWidget(aOKBtn); aBtnLayout->addWidget(aApplyBtn); aBtnLayout->addStretch(); aBtnLayout->addWidget(aCloseBtn); + aBtnLayout->addWidget(aHelpBtn); /***************************************************************/ aMainLayout->addWidget(meshGroupLab, 0, 0); @@ -333,7 +356,8 @@ void SMESHGUI_GroupDlg::initDialog(bool create) aMainLayout->addMultiCellWidget(myGrpTypeGroup, 3, 3, 0, 2); aMainLayout->addMultiCellWidget(myWGStack, 4, 4, 0, 2); aMainLayout->setRowStretch( 5, 5 ); - aMainLayout->addMultiCellWidget(aButtons, 6, 6, 0, 2); + aMainLayout->addMultiCellWidget(aColorBox, 6, 6, 0, 2); + aMainLayout->addMultiCellWidget(aButtons, 7, 7, 0, 2); /* signals and slots connections */ connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); @@ -355,10 +379,13 @@ void SMESHGUI_GroupDlg::initDialog(bool create) connect(mySubMeshBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); connect(myGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); connect(myGeomGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); - + connect(mySelectColorGroup, SIGNAL(toggled(bool)), this, SLOT(onSelectColorGroup(bool))); + connect(myColorSpinBox, SIGNAL(valueChanged(const QString&)), this, SLOT(onNbColorsChanged(const QString&))); + connect(aOKBtn, SIGNAL(clicked()), this, SLOT(onOK())); connect(aApplyBtn, SIGNAL(clicked()), this, SLOT(onApply())); connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(onClose())); + connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); /* Init selection */ mySMESHGUI->SetActiveDialogBox(this); @@ -407,6 +434,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_Mesh_ptr theMesh) /* init data from current selection */ myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh); myGroup = SMESH::SMESH_Group::_nil(); + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); myActor = SMESH::FindActorByObject(myMesh); SMESH::SetPickable(myActor); @@ -430,15 +458,16 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_Mesh_ptr theMesh) // function : Init() // purpose : //================================================================================= -void SMESHGUI_GroupDlg::init (SMESH::SMESH_Group_ptr theGroup) +void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup) { myMesh = theGroup->GetMesh(); - myGroup = SMESH::SMESH_Group::_duplicate(theGroup); + + myName->setText(theGroup->GetName()); + myName->home(false); - myActor = SMESH::FindActorByObject(myMesh); - if ( !myActor ) - myActor = SMESH::FindActorByObject(myGroup); - SMESH::SetPickable(myActor); + myColorSpinBox->setValue( theGroup->GetColorNumber() ); + + myMeshGroupLine->setText(theGroup->GetName()); int aType = 0; switch(theGroup->GetType()) { @@ -447,27 +476,61 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_Group_ptr theGroup) case SMESH::FACE: aType = 2; break; case SMESH::VOLUME: aType = 3; break; } + myTypeGroup->setButton(aType); + + myGroup = SMESH::SMESH_Group::_narrow( theGroup ); - myName->setText(myGroup->GetName()); - myName->home(false); - myMeshGroupLine->setText(myGroup->GetName()); + if ( !myGroup->_is_nil() ) + { + myGrpTypeGroup->setButton(0); + onGrpTypeChanged(0); - myCurrentLineEdit = 0; - myTypeGroup->setButton(aType); - myElements->clear(); - setSelectionMode(aType); - myTypeId = aType; - - myIdList.clear(); - if (!theGroup->IsEmpty()) { - SMESH::long_array_var anElements = myGroup->GetListOfID(); - int k = anElements->length(); - for (int i = 0; i < k; i++) { - myIdList.append(anElements[i]); - myElements->insertItem(QString::number(anElements[i])); + myActor = SMESH::FindActorByObject(myMesh); + if ( !myActor ) + myActor = SMESH::FindActorByObject(myGroup); + SMESH::SetPickable(myActor); + + myCurrentLineEdit = 0; + myElements->clear(); + setSelectionMode(aType); + myTypeId = aType; + + myIdList.clear(); + if (!myGroup->IsEmpty()) { + SMESH::long_array_var anElements = myGroup->GetListOfID(); + int k = anElements->length(); + for (int i = 0; i < k; i++) { + myIdList.append(anElements[i]); + myElements->insertItem(QString::number(anElements[i])); + } + myElements->selectAll(true); + } + } + else + { + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_narrow( theGroup ); + + if ( !myGroupOnGeom->_is_nil() ) + { + myGrpTypeGroup->setButton(1); + onGrpTypeChanged(1); + + myActor = SMESH::FindActorByObject(myMesh); + if ( !myActor ) + myActor = SMESH::FindActorByObject(myGroup); + SMESH::SetPickable(myActor); + + QString aShapeName(""); + _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); + GEOM::GEOM_Object_var aGroupShape = myGroupOnGeom->GetShape(); + if (!aGroupShape->_is_nil()) + { + _PTR(SObject) aGroupShapeSO = aStudy->FindObjectID(aGroupShape->GetStudyEntry()); + aShapeName = aGroupShapeSO->GetName().c_str(); + } + myGeomGroupLine->setText( aShapeName ); + } } - myElements->selectAll(true); - } } //================================================================================= @@ -481,7 +544,10 @@ void SMESHGUI_GroupDlg::updateButtons() if (myGrpTypeId == 0) enable = !myName->text().stripWhiteSpace().isEmpty() && myElements->count() > 0; else if (myGrpTypeId == 1) - enable = !myName->text().stripWhiteSpace().isEmpty() && !CORBA::is_nil( myGeomGroup ); + { + bool isEditMode = !CORBA::is_nil( myGroupOnGeom ); + enable = !myName->text().stripWhiteSpace().isEmpty() && (!CORBA::is_nil( myGeomGroup ) || isEditMode); + } QPushButton* aBtn; aBtn = (QPushButton*) child("ok", "QPushButton"); if (aBtn) aBtn->setEnabled(enable); @@ -498,6 +564,15 @@ void SMESHGUI_GroupDlg::onNameChanged (const QString& text) updateButtons(); } +//================================================================================= +// function : onNbColorsChanged() +// purpose : +//================================================================================= +void SMESHGUI_GroupDlg::onNbColorsChanged (const QString& text) +{ + updateButtons(); +} + //================================================================================= // function : onTypeChanged() // purpose : Group elements type radio button management @@ -606,14 +681,27 @@ bool SMESHGUI_GroupDlg::onApply() myGroup = SMESH::AddGroup(myMesh, aType, myName->text()); myGroup->Add(anIdList.inout()); - + + int aColorNumber = myColorSpinBox->value(); + myGroup->SetColorNumber(aColorNumber); + + _PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup); + + SMESH::setFileName ( aMeshGroupSO, QString::number(myColorSpinBox->value()) ); + + SMESH::setFileType ( aMeshGroupSO,"COULEURGROUP" ); + /* init for next operation */ myName->setText(""); + myColorSpinBox->setValue(0); myElements->clear(); myGroup = SMESH::SMESH_Group::_nil(); } else { myGroup->SetName(myName->text()); + + int aColorNumber = myColorSpinBox->value(); + myGroup->SetColorNumber(aColorNumber); QValueList aAddList; QValueList::iterator anIt; @@ -654,30 +742,50 @@ bool SMESHGUI_GroupDlg::onApply() return true; } else if (myGrpTypeId == 1 && !myName->text().stripWhiteSpace().isEmpty() && - !CORBA::is_nil(myGeomGroup)) + (!CORBA::is_nil(myGeomGroup) || !CORBA::is_nil(myGroupOnGeom))) { - SMESH::ElementType aType = SMESH::ALL; - switch (myTypeId) { - case 0: aType = SMESH::NODE; break; - case 1: aType = SMESH::EDGE; break; - case 2: aType = SMESH::FACE; break; - case 3: aType = SMESH::VOLUME; break; + if (myGroupOnGeom->_is_nil()) { + SMESH::ElementType aType = SMESH::ALL; + switch (myTypeId) { + case 0: aType = SMESH::NODE; break; + case 1: aType = SMESH::EDGE; break; + case 2: aType = SMESH::FACE; break; + case 3: aType = SMESH::VOLUME; break; + } + + _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); + GEOM::GEOM_IGroupOperations_var aGroupOp = + SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId()); + + myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, myName->text(),myGeomGroup); + + int aColorNumber = myColorSpinBox->value(); + myGroupOnGeom->SetColorNumber(aColorNumber); + + _PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom); + + SMESH::setFileName ( aMeshGroupSO, QString::number(myColorSpinBox->value()) ); + + SMESH::setFileType ( aMeshGroupSO,"COULEURGROUP" ); + + /* init for next operation */ + myName->setText(""); + myColorSpinBox->setValue(0); + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); } - - _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); - GEOM::GEOM_IGroupOperations_var aGroupOp = - SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId()); - - SMESH::SMESH_GroupOnGeom_var aGroupOnGeom = - myMesh->CreateGroupFromGEOM(aType, myName->text(),myGeomGroup); - + else + { + myGroupOnGeom->SetName(myName->text()); + + int aColorNumber = myColorSpinBox->value(); + myGroupOnGeom->SetColorNumber(aColorNumber); + } + mySMESHGUI->updateObjBrowser(true); mySelectionMgr->clearSelected(); - /* init for next operation */ - myName->setText(""); return true; } - + return false; } @@ -754,6 +862,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() if (aNbSel != 1 ) { myGroup = SMESH::SMESH_Group::_nil(); + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); myMesh = SMESH::SMESH_Mesh::_nil(); myIsBusy = false; return; @@ -782,7 +891,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() myGeomGroupLine->setEnabled(true); updateButtons(); } else { - SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface(IO); + SMESH::SMESH_GroupBase_var aGroup = SMESH::IObjectToInterface(IO); if (aGroup->_is_nil()) { myIsBusy = false; @@ -790,12 +899,14 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() } myIsBusy = false; myCurrentLineEdit = 0; + + myGroup = SMESH::SMESH_Group::_nil(); + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); + init(aGroup); myIsBusy = true; mySelectSubMesh->setEnabled(true); mySelectGroup->setEnabled(true); - myGeomGroupBtn->setEnabled(true); - myGeomGroupLine->setEnabled(true); } myCurrentLineEdit = 0; myIsBusy = false; @@ -915,6 +1026,8 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() if (!myActor) { if (!myGroup->_is_nil()) myActor = SMESH::FindActorByObject(myGroup); + else if(!myGroupOnGeom->_is_nil()) + myActor = SMESH::FindActorByObject(myGroupOnGeom); else myActor = SMESH::FindActorByObject(myMesh); } @@ -997,6 +1110,17 @@ void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on) } } +//================================================================================= +// function : (onSelectColorGroup) +// purpose : Called when setting a color on group +//================================================================================= +void SMESHGUI_GroupDlg::onSelectColorGroup(bool on) +{ + if (!on) + myColorSpinBox->setValue(0); + + myColorSpinBox->setEnabled(on); +} //================================================================================= // function : setCurrentSelection() @@ -1422,6 +1546,23 @@ void SMESHGUI_GroupDlg::onClose() reject(); } +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_GroupDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : SMESHGUI_GroupDlg::onDeactivate // purpose : SLOT called when dialog must be deativated diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.h b/src/SMESHGUI/SMESHGUI_GroupDlg.h index 66c6c31ad..464aea4cb 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.h +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.h @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -50,6 +50,7 @@ class QListBox; class QPushButton; class QCheckBox; class QWidgetStack; +class QtxIntSpinBox; class SMESHGUI; class SMESH_Actor; class SMESHGUI_FilterDlg; @@ -71,7 +72,7 @@ public: bool modal = FALSE, WFlags fl = 0 ); SMESHGUI_GroupDlg( SMESHGUI*, const char* name, - SMESH::SMESH_Group_ptr theGroup, + SMESH::SMESH_GroupBase_ptr theGroup, bool modal = FALSE, WFlags fl = 0 ); ~SMESHGUI_GroupDlg(); @@ -89,6 +90,7 @@ private slots: void onOK(); void onClose(); bool onApply(); + void onHelp(); void onDeactivate(); void onListSelectionChanged(); @@ -97,18 +99,20 @@ private slots: void onSelectSubMesh(bool on); void onSelectGroup(bool on); void onSelectGeomGroup(bool on); + void onSelectColorGroup(bool on); void setCurrentSelection(); void setFilters(); void onSort(); void onNameChanged(const QString& text); + void onNbColorsChanged(const QString& text); void onFilterAccepted(); private: void initDialog(bool create); void init(SMESH::SMESH_Mesh_ptr theMesh); - void init(SMESH::SMESH_Group_ptr theGroup); + void init(SMESH::SMESH_GroupBase_ptr theGroup); void closeEvent(QCloseEvent* e); void enterEvent (QEvent*); void hideEvent (QHideEvent*); /* ESC key */ @@ -143,12 +147,16 @@ private: QPushButton* myGroupBtn; QLineEdit* myGroupLine; + QCheckBox* mySelectColorGroup; + QtxIntSpinBox* myColorSpinBox; + QCheckBox* mySelectGeomGroup; QPushButton* myGeomGroupBtn; QLineEdit* myGeomGroupLine; SMESH::SMESH_Mesh_var myMesh; SMESH::SMESH_Group_var myGroup; + SMESH::SMESH_GroupOnGeom_var myGroupOnGeom; QValueList myIdList; GEOM::GEOM_Object_var myGeomGroup; @@ -163,6 +171,8 @@ private: SMESHGUI_FilterDlg* myFilterDlg; bool myCreate, myIsBusy; + + QString myHelpFileName; }; #endif // DIALOGBOX_GROUP_H diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx index cdefc1e42..8ec058c01 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -35,6 +35,10 @@ #include "SUIT_ResourceMgr.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" + +#include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" #include "SVTK_Selection.h" @@ -72,9 +76,18 @@ SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg( SMESHGUI* theModule, const int theMode { myMode = theMode; - if (myMode == UNION) setCaption(tr("UNION_OF_TWO_GROUPS")); - else if (myMode == INTERSECT) setCaption(tr("INTERSECTION_OF_TWO_GROUPS")); - else setCaption(tr("CUT_OF_TWO_GROUPS")); + if (myMode == UNION) { + setCaption(tr("UNION_OF_TWO_GROUPS")); + myHelpFileName = "/files/using_operations_on_groups.htm#Union"; + } + else if (myMode == INTERSECT) { + setCaption(tr("INTERSECTION_OF_TWO_GROUPS")); + myHelpFileName = "/files/using_operations_on_groups.htm#Intersection"; + } + else { + setCaption(tr("CUT_OF_TWO_GROUPS")); + myHelpFileName = "/files/using_operations_on_groups.htm#Cut"; + } mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector(); @@ -139,6 +152,7 @@ QFrame* SMESHGUI_GroupOpDlg::createButtonFrame (QWidget* theParent) myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame); myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame); myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame); + myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame); QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); @@ -148,11 +162,13 @@ QFrame* SMESHGUI_GroupOpDlg::createButtonFrame (QWidget* theParent) aLay->addWidget(myApplyBtn); aLay->addItem(aSpacer); aLay->addWidget(myCloseBtn); + aLay->addWidget(myHelpBtn); // connect signals and slots connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); + connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); return aFrame; } @@ -185,9 +201,6 @@ void SMESHGUI_GroupOpDlg::Init() connect(myBtn1, SIGNAL(clicked()), this, SLOT(onFocusChanged())); connect(myBtn2, SIGNAL(clicked()), this, SLOT(onFocusChanged())); - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); // set selection mode @@ -294,6 +307,23 @@ void SMESHGUI_GroupOpDlg::onClose() reject(); } +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_GroupOpDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= // name : SMESHGUI_GroupOpDlg::onSelectionDone // Purpose : SLOT called when selection changed diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.h b/src/SMESHGUI/SMESHGUI_GroupOpDlg.h index 256cdfb91..be5bfa296 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.h +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -72,6 +72,7 @@ private slots: void onOk(); bool onApply(); void onClose(); + void onHelp(); void onDeactivate(); void onSelectionDone(); @@ -89,6 +90,7 @@ private: QPushButton* myOkBtn; QPushButton* myApplyBtn; QPushButton* myCloseBtn; + QPushButton* myHelpBtn; QLineEdit* myNameEdit; QLineEdit* myEdit1; @@ -106,6 +108,8 @@ private: SMESH::SMESH_GroupBase_var myGroup1; SMESH::SMESH_GroupBase_var myGroup2; + QString myHelpFileName; + }; #endif diff --git a/src/SMESHGUI/SMESHGUI_GroupUtils.cxx b/src/SMESHGUI/SMESHGUI_GroupUtils.cxx index d2aa17f3a..86063b09c 100644 --- a/src/SMESHGUI/SMESHGUI_GroupUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupUtils.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "SMESHGUI_GroupUtils.h" diff --git a/src/SMESHGUI/SMESHGUI_GroupUtils.h b/src/SMESHGUI/SMESHGUI_GroupUtils.h index 554bac9cd..f6ceabef6 100644 --- a/src/SMESHGUI/SMESHGUI_GroupUtils.h +++ b/src/SMESHGUI/SMESHGUI_GroupUtils.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef SMESHGUI_GroupUtils_HeaderFile #define SMESHGUI_GroupUtils_HeaderFile diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index 6926df448..6e90a7093 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -1,3 +1,22 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 "SMESHGUI_Hypotheses.h" #include "SMESHGUI.h" @@ -8,8 +27,15 @@ #include #include +#include + #include +#include +#include + +#include + #include #include #include @@ -344,7 +370,7 @@ bool SMESHGUI_GenericHypothesisCreator::getParamFromCustomWidget( StdParam& , QW SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreator* creator, QWidget* parent ) -: QtxDialog( parent, "", true, true, QtxDialog::OKCancel ), +: QtxDialog( parent, "", true, true ), myCreator( creator ) { setMinimumSize( 300, height() ); @@ -366,6 +392,29 @@ SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreato titLay->addStretch( 1 ); myLayout->addWidget( titFrame, 0 ); + + QString aHypType = creator->hypType(); + if ( aHypType == "LocalLength" ) + myHelpFileName = "/files/arithmetic_1d.htm#Average_length"; + else if ( aHypType == "Arithmetic1D") + myHelpFileName = "/files/arithmetic_1d.htm#arithmetic_1D"; + else if ( aHypType == "MaxElementArea") + myHelpFileName = "/files/max._element_area_hypothesis.htm"; + else if ( aHypType == "MaxElementVolume") + myHelpFileName = "/files/max._element_volume_hypothsis.htm"; + else if ( aHypType == "StartEndLength") + myHelpFileName = "/files/arithmetic_1d.htm#start_and_end_length"; + else if ( aHypType == "Deflection1D") + myHelpFileName = "/files/arithmetic_1d.htm#deflection_1D"; + else if ( aHypType == "AutomaticLength") + myHelpFileName = "/files/arithmetic_1d.htm#automatic_length"; + else if ( aHypType == "NumberOfSegments") + myHelpFileName = "/files/arithmetic_1d.htm#Number_of_elements"; + else + myHelpFileName = ""; + + connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) ); + } SMESHGUI_HypothesisDlg::~SMESHGUI_HypothesisDlg() @@ -387,6 +436,21 @@ void SMESHGUI_HypothesisDlg::accept() QtxDialog::accept(); } +void SMESHGUI_HypothesisDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + SMESHGUI* aSMESHGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aSMESHGUI ? app->moduleName(aSMESHGUI->moduleName()) : QString(""), myHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + void SMESHGUI_HypothesisDlg::setHIcon( const QPixmap& p ) { myIconLabel->setPixmap( p ); diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.h b/src/SMESHGUI/SMESHGUI_Hypotheses.h index 80caf54e5..1fb2cd8f9 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.h +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.h @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -115,11 +115,13 @@ public: protected slots: virtual void accept(); + void onHelp(); private: SMESHGUI_GenericHypothesisCreator* myCreator; QVBoxLayout* myLayout; QLabel *myIconLabel, *myTypeLabel; + QString myHelpFileName; }; /*! @@ -128,22 +130,31 @@ private: class HypothesisData { public: - HypothesisData( const QString& thePluginName, + HypothesisData( const QString& theTypeName, + const QString& thePluginName, const QString& theServerLibName, const QString& theClientLibName, const QString& theLabel, const QString& theIconId, const QValueList& theDim, - const bool theIsAux ) -: PluginName( thePluginName ), - ServerLibName( theServerLibName ), - ClientLibName( theClientLibName ), - Label( theLabel ), - IconId( theIconId ), - Dim( theDim ), - IsAux( theIsAux ) - {}; - + const bool theIsAux, + const QStringList& theNeededHypos, + const QStringList& theOptionalHypos, + const QStringList& theInputTypes, + const QStringList& theOutputTypes) + : TypeName( theTypeName ), + PluginName( thePluginName ), + ServerLibName( theServerLibName ), + ClientLibName( theClientLibName ), + Label( theLabel ), + IconId( theIconId ), + Dim( theDim ), + IsAux( theIsAux ), + NeededHypos( theNeededHypos ), OptionalHypos( theOptionalHypos ), + InputTypes( theInputTypes ), OutputTypes( theOutputTypes ) + {}; + + QString TypeName; //!< hypothesis type name QString PluginName; //!< plugin name QString ServerLibName; //!< server library name QString ClientLibName; //!< client library name @@ -151,6 +162,12 @@ class HypothesisData QString IconId; //!< icon identifier QValueList Dim; //!< list of supported dimensions (see SMESH::Dimension enumeration) bool IsAux; //!< TRUE if given hypothesis is auxiliary one, FALSE otherwise + + // for algorithm only: dependencies algo <-> algo and algo -> hypos + QStringList NeededHypos; //!< list of obligatory hypotheses + QStringList OptionalHypos;//!< list of optional hypotheses + QStringList InputTypes; //!< list of element types required as a prerequisite + QStringList OutputTypes; //!< list of types of generated elements }; /*! diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index c0a6460d1..f918fbc39 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "SMESHGUI_HypothesesUtils.h" @@ -266,17 +266,50 @@ namespace SMESH{ // Init list of available hypotheses, if needed InitAvailableHypotheses(); - if (myHypothesesMap.find(aHypType) == myHypothesesMap.end()) { - if (myAlgorithmsMap.find(aHypType) != myAlgorithmsMap.end()) { - aHypData = myAlgorithmsMap[aHypType]; - } + THypothesisDataMap::iterator type_data = myHypothesesMap.find(aHypType); + if (type_data != myHypothesesMap.end()) { + aHypData = type_data->second; } else { - aHypData = myHypothesesMap[aHypType]; + type_data = myAlgorithmsMap.find(aHypType); + if (type_data != myAlgorithmsMap.end()) + aHypData = type_data->second; } return aHypData; } + bool IsAvailableHypothesis(const HypothesisData* algoData, + const QString& hypType, + bool& isAuxiliary) + { + isAuxiliary = false; + if ( !algoData ) + return false; + if ( algoData->NeededHypos.contains( hypType )) + return true; + if ( algoData->OptionalHypos.contains( hypType)) { + isAuxiliary = true; + return true; + } + return false; + } + + bool IsCompatibleAlgorithm(const HypothesisData* algo1Data, + const HypothesisData* algo2Data) + { + if ( !algo1Data || !algo2Data ) + return false; + const HypothesisData* algoIn = algo1Data, *algoMain = algo2Data; + if ( algoIn->Dim.first() > algoMain->Dim.first() ) { + algoIn = algo2Data; algoMain = algo1Data; + } + // look for any output type of algoIn between input types of algoMain + QStringList::const_iterator inElemType = algoIn->OutputTypes.begin(); + for ( ; inElemType != algoIn->OutputTypes.end(); ++inElemType ) + if ( algoMain->InputTypes.contains( *inElemType )) + return true; + return false; + } SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator(const char* aHypType) { @@ -398,8 +431,8 @@ namespace SMESH{ try { res = aMesh->AddHypothesis(aShapeObject, aHyp); if (res < SMESH::HYP_UNKNOWN_FATAL) { - _PTR(SObject) SH = SMESH::FindSObject(aHyp); - if (SM && SH) { + _PTR(SObject) aSH = SMESH::FindSObject(aHyp); + if (SM && aSH) { SMESH::ModifiedMesh(SM, false); } } diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.h b/src/SMESHGUI/SMESHGUI_HypothesesUtils.h index d710a91e6..f62b14da2 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.h +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.h @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -51,7 +51,8 @@ class algo_error_array; namespace SMESH{ - SMESHGUI_EXPORT void InitAvailableHypotheses(); + SMESHGUI_EXPORT + void InitAvailableHypotheses(); SMESHGUI_EXPORT QStringList GetAvailableHypotheses( const bool isAlgo, @@ -66,6 +67,15 @@ namespace SMESH{ SMESHGUI_EXPORT HypothesisData* GetHypothesisData(const char* aHypType); + SMESHGUI_EXPORT + bool IsAvailableHypothesis(const HypothesisData* algoData, + const QString& hypType, + bool& isOptional); + + SMESHGUI_EXPORT + bool IsCompatibleAlgorithm(const HypothesisData* algo1Data, + const HypothesisData* algo2Data); + SMESHGUI_EXPORT SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator(const char* aHypType); diff --git a/src/SMESHGUI/SMESHGUI_IdValidator.h b/src/SMESHGUI/SMESHGUI_IdValidator.h index 35e64f59f..d5c5c8060 100644 --- a/src/SMESHGUI/SMESHGUI_IdValidator.h +++ b/src/SMESHGUI/SMESHGUI_IdValidator.h @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx index af1a68a57..13e0a4b71 100644 --- a/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -41,6 +41,10 @@ #include "GEOMBase.h" #include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" + +#include "LightApp_Application.h" #include "SVTK_ViewModel.h" #include "SVTK_ViewWindow.h" @@ -129,6 +133,10 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char* GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton(GroupButtons, "buttonCancel"); buttonCancel->setText(tr("SMESH_BUT_CLOSE" )); buttonCancel->setAutoDefault(TRUE); @@ -257,6 +265,7 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char* connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(SelectMeshButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); connect(DetectButton, SIGNAL (clicked()), this, SLOT(onDetect())); @@ -273,10 +282,6 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char* /* to close dialog if study change */ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); /* displays Dialog */ resize(0,0); @@ -285,6 +290,8 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char* // Init Mesh field from selection SelectionIntoArgument(); + + myHelpFileName = "/files/merging_nodes.htm"; } //================================================================================= @@ -368,6 +375,23 @@ void SMESHGUI_MergeNodesDlg::ClickOnCancel() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_MergeNodesDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : onEditNodesGroup() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_MergeNodesDlg.h b/src/SMESHGUI/SMESHGUI_MergeNodesDlg.h index eb4767619..e8e1b9c88 100644 --- a/src/SMESHGUI/SMESHGUI_MergeNodesDlg.h +++ b/src/SMESHGUI/SMESHGUI_MergeNodesDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -100,6 +100,7 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; QGroupBox* GroupMesh; QGroupBox* GroupCoincident; QGroupBox* GroupEdit; @@ -114,12 +115,15 @@ private: QListView* ListCoincident; QListBox* ListEdit; SMESHGUI_SpinBox* SpinBoxTolerance; + + QString myHelpFileName; private slots: void ClickOnOk(); void ClickOnCancel(); bool ClickOnApply(); + void ClickOnHelp(); void updateControls(); void onDetect(); void onSelectNodesGroup(); diff --git a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx index a9dbbcaa1..3d19a1278 100644 --- a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // /** * SMESH SMESHGUI @@ -115,6 +115,7 @@ SMESHGUI_MeshTab::SMESHGUI_MeshTab( QWidget* theParent ) connect( myEditHyp[ i ], SIGNAL( clicked() ), SLOT( onEditHyp() ) ); connect( myHyp[ i ], SIGNAL( activated( int ) ), SLOT( onHyp( int ) ) ); } + connect( myHyp[ Algo ], SIGNAL( activated( int ) ), SLOT( onHyp( int ) ) ); // Initialize controls @@ -141,6 +142,8 @@ SMESHGUI_MeshTab::~SMESHGUI_MeshTab() void SMESHGUI_MeshTab::setAvailableHyps( const int theId, const QStringList& theHyps ) { myAvailableHyps[ theId ] = theHyps; + + bool enable = ! theHyps.isEmpty(); if ( theId == Algo ) { myHyp[ Algo ]->clear(); @@ -148,6 +151,11 @@ void SMESHGUI_MeshTab::setAvailableHyps( const int theId, const QStringList& the myHyp[ Algo ]->insertStringList( theHyps ); myHyp[ Algo ]->setCurrentItem( 0 ); } + else { + myCreateHyp[ theId ]->setEnabled( enable ); + myEditHyp[ theId ]->setEnabled( false ); + } + myHyp[ theId ]->setEnabled( enable ); } //================================================================================ @@ -167,6 +175,7 @@ void SMESHGUI_MeshTab::setExistingHyps( const int theId, const QStringList& theH myHyp[ theId ]->insertItem( tr( "NONE" ) ); myHyp[ theId ]->insertStringList( theHyps ); myHyp[ theId ]->setCurrentItem( 0 ); + myHyp[ theId ]->setEnabled( !theHyps.isEmpty() ); myEditHyp[ theId ]->setEnabled( false ); } } @@ -186,6 +195,7 @@ void SMESHGUI_MeshTab::addHyp( const int theId, const QString& theHyp ) myHyp[ theId ]->insertItem( theHyp ); myHyp[ theId ]->setCurrentItem( myHyp[ theId ]->count() - 1 ); myEditHyp[ theId ]->setEnabled( true ); + myHyp[ theId ]->setEnabled( true ); } //================================================================================ @@ -288,22 +298,27 @@ void SMESHGUI_MeshTab::onEditHyp() { const QObject* aSender = sender(); int aHypType = aSender == myEditHyp[ MainHyp ] ? MainHyp : AddHyp; - emit editHyp( aHypType, myHyp[ aHypType ]->currentItem() ); + emit editHyp( aHypType, myHyp[ aHypType ]->currentItem() - 1 ); // - 1 because there is NONE on the top } //================================================================================ /*! * \brief Updates "Edit hypothesis" button state * - * SLOT called when current hypothesis changed disables "Edit hypothesis" button - * if current hypothesis is , enables otherwise + * SLOT called when current hypothesis changed. Disables "Edit hypothesis" button + * if current hypothesis is , enables otherwise. + * If an algorithm changed, emits selectAlgo( theIndex ) signal */ //================================================================================ void SMESHGUI_MeshTab::onHyp( int theIndex ) { const QObject* aSender = sender(); - int anIndex = aSender == myHyp[ MainHyp ] ? MainHyp : AddHyp; - myEditHyp[ anIndex ]->setEnabled( theIndex > 0 ); + if ( aSender == myHyp[ Algo ] ) + emit selectAlgo( theIndex - 1 ); // - 1 because there is NONE on the top + else { + int anIndex = aSender == myHyp[ MainHyp ] ? MainHyp : AddHyp; + myEditHyp[ anIndex ]->setEnabled( theIndex > 0 ); + } } //================================================================================ @@ -379,9 +394,9 @@ SMESHGUI_MeshDlg::SMESHGUI_MeshDlg( const bool theToCreate, const bool theIsMesh myTabs[ Dim1D ] = new SMESHGUI_MeshTab( myTabWg ); myTabs[ Dim2D ] = new SMESHGUI_MeshTab( myTabWg ); myTabs[ Dim3D ] = new SMESHGUI_MeshTab( myTabWg ); - myTabWg->addTab( myTabs[ Dim1D ], tr( "DIM_1D" ) ); - myTabWg->addTab( myTabs[ Dim2D ], tr( "DIM_2D" ) ); myTabWg->addTab( myTabs[ Dim3D ], tr( "DIM_3D" ) ); + myTabWg->addTab( myTabs[ Dim2D ], tr( "DIM_2D" ) ); + myTabWg->addTab( myTabs[ Dim1D ], tr( "DIM_1D" ) ); // Hypotheses Sets myHypoSetPopup = new QPopupMenu(); @@ -462,7 +477,7 @@ void SMESHGUI_MeshDlg::reset() //================================================================================ void SMESHGUI_MeshDlg::setCurrentTab( const int theId ) { - myTabWg->setCurrentPage( theId ); + myTabWg->setCurrentPage( Dim3D - theId ); } //================================================================================ @@ -474,13 +489,16 @@ void SMESHGUI_MeshDlg::setCurrentTab( const int theId ) void SMESHGUI_MeshDlg::setMaxHypoDim( const int maxDim ) { - for ( int i = Dim1D; i <= Dim3D; ++i ) { - int dim = i + 1; - bool enable = ( dim <= maxDim ); + const int DIM = maxDim - 1; + for ( int dim = Dim1D; dim <= Dim3D; ++dim ) { + bool enable = ( dim <= DIM ); if ( !enable ) - myTabs[ i ]->reset(); - myTabWg->setTabEnabled( myTabs[ i ], enable ); + myTabs[ dim ]->reset(); + myTabWg->setTabEnabled( myTabs[ dim ], enable ); } + // deselect desabled tab + if ( !myTabWg->isTabEnabled( myTabWg->currentPage() )) + setCurrentTab( DIM - 1 ); } //================================================================================ diff --git a/src/SMESHGUI/SMESHGUI_MeshDlg.h b/src/SMESHGUI/SMESHGUI_MeshDlg.h index 3c3624b25..0429403a4 100644 --- a/src/SMESHGUI/SMESHGUI_MeshDlg.h +++ b/src/SMESHGUI/SMESHGUI_MeshDlg.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // /** * SMESH SMESHGUI @@ -131,6 +131,8 @@ signals: //!< Emited when "Create hypothesis" button clicked void editHyp( const int theHypType, const int theIndex ); //!< Emited when "Edit hypothesis" button clicked + void selectAlgo( const int theIndex ); + //!< Emited when an algorithm is selected private slots: @@ -152,7 +154,3 @@ private: }; #endif - - - - diff --git a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx index 58fc13179..3b03a0256 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -34,8 +34,11 @@ #include "SUIT_Desktop.h" #include "SUIT_ResourceMgr.h" #include "SUIT_OverrideCursor.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" #include "LightApp_SelectionMgr.h" +#include "LightApp_Application.h" #include "SALOMEDSClient_Study.hxx" #include "SALOME_ListIO.hxx" @@ -131,10 +134,23 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, myMeshNbNodes = new QLabel(myMeshWidget, "myMeshNbNodes"); myMeshNbNodes->setMinimumWidth(100); + // --> header with orders + QLabel* myMeshOrder0Lab = new QLabel(tr("SMESH_MESHINFO_ORDER0"), myMeshWidget, "myMeshOrder0Lab"); + QLabel* myMeshOrder1Lab = new QLabel(tr("SMESH_MESHINFO_ORDER1"), myMeshWidget, "myMeshOrder1Lab"); + QLabel* myMeshOrder2Lab = new QLabel(tr("SMESH_MESHINFO_ORDER2"), myMeshWidget, "myMeshOrder2Lab"); + QFont fnti = myMeshOrder0Lab->font(); fnti.setItalic(true); + myMeshOrder0Lab->setFont(fnti); + myMeshOrder1Lab->setFont(fnti); + myMeshOrder2Lab->setFont(fnti); + // --> edges QLabel* myMeshNbEdgesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), myMeshWidget, "myMeshNbEdgesLab"); myMeshNbEdges = new QLabel(myMeshWidget, "myMeshNbEdges"); myMeshNbEdges->setMinimumWidth(100); + myMeshNbEdges1 = new QLabel(myMeshWidget, "myMeshNbEdges1"); + myMeshNbEdges1->setMinimumWidth(100); + myMeshNbEdges2 = new QLabel(myMeshWidget, "myMeshNbEdges2"); + myMeshNbEdges2->setMinimumWidth(100); // --> faces myMeshFacesGroup = new QGroupBox(tr("SMESH_MESHINFO_FACES"), myMeshWidget, "myMeshFacesGroup"); @@ -150,16 +166,30 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, myMeshNbFaces = new QLabel(myMeshFacesGroup, "myMeshNbFaces"); myMeshNbFaces->setMinimumWidth(100); myMeshNbFaces->setFont(fnt); + myMeshNbFaces1 = new QLabel(myMeshFacesGroup, "myMeshNbFaces1"); + myMeshNbFaces1->setMinimumWidth(100); + myMeshNbFaces1->setFont(fnt); + myMeshNbFaces2 = new QLabel(myMeshFacesGroup, "myMeshNbFaces2"); + myMeshNbFaces2->setMinimumWidth(100); + myMeshNbFaces2->setFont(fnt); // --> faces --> triangles QLabel* myMeshNbTrianglesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TRIANGLES")), myMeshFacesGroup, "myMeshNbTrianglesLab"); myMeshNbTriangles = new QLabel(myMeshFacesGroup, "myMeshNbTriangles"); myMeshNbTriangles->setMinimumWidth(100); + myMeshNbTriangles1 = new QLabel(myMeshFacesGroup, "myMeshNbTriangles1"); + myMeshNbTriangles1->setMinimumWidth(100); + myMeshNbTriangles2 = new QLabel(myMeshFacesGroup, "myMeshNbTriangles2"); + myMeshNbTriangles2->setMinimumWidth(100); // --> faces --> quadrangles QLabel* myMeshNbQuadranglesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_QUADRANGLES")), myMeshFacesGroup, "myMeshNbQuadranglesLab"); myMeshNbQuadrangles = new QLabel(myMeshFacesGroup, "myMeshNbQuadrangles"); myMeshNbQuadrangles->setMinimumWidth(100); + myMeshNbQuadrangles1 = new QLabel(myMeshFacesGroup, "myMeshNbQuadrangles1"); + myMeshNbQuadrangles1->setMinimumWidth(100); + myMeshNbQuadrangles2 = new QLabel(myMeshFacesGroup, "myMeshNbQuadrangles2"); + myMeshNbQuadrangles2->setMinimumWidth(100); // --> faces --> polygons QLabel* myMeshNbPolygonesLab = new QLabel( COLONIZE( tr( "SMESH_MESHINFO_POLYGONES" ) ), myMeshFacesGroup, "myMeshNbPolygonesLab" ); @@ -168,10 +198,16 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, myMeshFacesGroupLayout->addWidget(myMeshNbFacesLab, 0, 0); myMeshFacesGroupLayout->addWidget(myMeshNbFaces, 0, 1); + myMeshFacesGroupLayout->addWidget(myMeshNbFaces1, 0, 2); + myMeshFacesGroupLayout->addWidget(myMeshNbFaces2, 0, 3); myMeshFacesGroupLayout->addWidget(myMeshNbTrianglesLab, 1, 0); myMeshFacesGroupLayout->addWidget(myMeshNbTriangles, 1, 1); + myMeshFacesGroupLayout->addWidget(myMeshNbTriangles1, 1, 2); + myMeshFacesGroupLayout->addWidget(myMeshNbTriangles2, 1, 3); myMeshFacesGroupLayout->addWidget(myMeshNbQuadranglesLab, 2, 0); myMeshFacesGroupLayout->addWidget(myMeshNbQuadrangles, 2, 1); + myMeshFacesGroupLayout->addWidget(myMeshNbQuadrangles1, 2, 2); + myMeshFacesGroupLayout->addWidget(myMeshNbQuadrangles2, 2, 3); myMeshFacesGroupLayout->addWidget( myMeshNbPolygonesLab, 3, 0 ); myMeshFacesGroupLayout->addWidget( myMeshNbPolygones, 3, 1 ); @@ -189,26 +225,48 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, myMeshNbVolumes = new QLabel(myMeshVolumesGroup, "myMeshNbVolumes"); myMeshNbVolumes->setMinimumWidth(100); myMeshNbVolumes->setFont(fnt); + myMeshNbVolumes1 = new QLabel(myMeshVolumesGroup, "myMeshNbVolumes1"); + myMeshNbVolumes1->setMinimumWidth(100); + myMeshNbVolumes1->setFont(fnt); + myMeshNbVolumes2 = new QLabel(myMeshVolumesGroup, "myMeshNbVolumes2"); + myMeshNbVolumes2->setMinimumWidth(100); + myMeshNbVolumes2->setFont(fnt); // --> volumes --> tetrahedrons QLabel* myMeshNbTetraLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TETRAS")), myMeshVolumesGroup, "myMeshNbTetraLab"); myMeshNbTetra = new QLabel(myMeshVolumesGroup, "myMeshNbTetra"); myMeshNbTetra->setMinimumWidth(100); + myMeshNbTetra1 = new QLabel(myMeshVolumesGroup, "myMeshNbTetra1"); + myMeshNbTetra1->setMinimumWidth(100); + myMeshNbTetra2 = new QLabel(myMeshVolumesGroup, "myMeshNbTetra2"); + myMeshNbTetra2->setMinimumWidth(100); // --> volumes --> hexahedrons QLabel* myMeshNbHexaLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_HEXAS")), myMeshVolumesGroup, "myMeshNbHexaLab"); myMeshNbHexa = new QLabel(myMeshVolumesGroup, "myMeshNbHexa"); - myMeshNbHexaLab->setMinimumWidth(100); + myMeshNbHexa->setMinimumWidth(100); + myMeshNbHexa1 = new QLabel(myMeshVolumesGroup, "myMeshNbHexa1"); + myMeshNbHexa1->setMinimumWidth(100); + myMeshNbHexa2 = new QLabel(myMeshVolumesGroup, "myMeshNbHexa2"); + myMeshNbHexa2->setMinimumWidth(100); // --> volumes --> prisms QLabel* myMeshNbPrismLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PRISMS")), myMeshVolumesGroup, "myMeshNbPrismLab"); myMeshNbPrism = new QLabel(myMeshVolumesGroup, "myMeshNbPrism"); myMeshNbPrism->setMinimumWidth(100); + myMeshNbPrism1 = new QLabel(myMeshVolumesGroup, "myMeshNbPrism1"); + myMeshNbPrism1->setMinimumWidth(100); + myMeshNbPrism2 = new QLabel(myMeshVolumesGroup, "myMeshNbPrism2"); + myMeshNbPrism2->setMinimumWidth(100); // --> volumes --> pyramids QLabel* myMeshNbPyraLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PYRAS")), myMeshVolumesGroup, "myMeshNbPyraLab"); myMeshNbPyra = new QLabel(myMeshVolumesGroup, "myMeshNbPyra"); myMeshNbPyra->setMinimumWidth(100); + myMeshNbPyra1 = new QLabel(myMeshVolumesGroup, "myMeshNbPyra1"); + myMeshNbPyra1->setMinimumWidth(100); + myMeshNbPyra2 = new QLabel(myMeshVolumesGroup, "myMeshNbPyra2"); + myMeshNbPyra2->setMinimumWidth(100); // --> volumes --> polyherones QLabel* myMeshNbPolyhedronesLab = new QLabel( COLONIZE( tr( "SMESH_MESHINFO_POLYEDRES" ) ), myMeshVolumesGroup, "myMeshNbPolyhedronLab" ); @@ -217,14 +275,24 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, myMeshVolumesGroupLayout->addWidget(myMeshNbVolumesLab, 0, 0); myMeshVolumesGroupLayout->addWidget(myMeshNbVolumes, 0, 1); + myMeshVolumesGroupLayout->addWidget(myMeshNbVolumes1, 0, 2); + myMeshVolumesGroupLayout->addWidget(myMeshNbVolumes2, 0, 3); myMeshVolumesGroupLayout->addWidget(myMeshNbTetraLab, 1, 0); myMeshVolumesGroupLayout->addWidget(myMeshNbTetra, 1, 1); + myMeshVolumesGroupLayout->addWidget(myMeshNbTetra1, 1, 2); + myMeshVolumesGroupLayout->addWidget(myMeshNbTetra2, 1, 3); myMeshVolumesGroupLayout->addWidget(myMeshNbHexaLab, 2, 0); myMeshVolumesGroupLayout->addWidget(myMeshNbHexa, 2, 1); + myMeshVolumesGroupLayout->addWidget(myMeshNbHexa1, 2, 2); + myMeshVolumesGroupLayout->addWidget(myMeshNbHexa2, 2, 3); myMeshVolumesGroupLayout->addWidget(myMeshNbPrismLab, 3, 0); myMeshVolumesGroupLayout->addWidget(myMeshNbPrism, 3, 1); + myMeshVolumesGroupLayout->addWidget(myMeshNbPrism1, 3, 2); + myMeshVolumesGroupLayout->addWidget(myMeshNbPrism2, 3, 3); myMeshVolumesGroupLayout->addWidget(myMeshNbPyraLab, 4, 0); myMeshVolumesGroupLayout->addWidget(myMeshNbPyra, 4, 1); + myMeshVolumesGroupLayout->addWidget(myMeshNbPyra1, 4, 2); + myMeshVolumesGroupLayout->addWidget(myMeshNbPyra2, 4, 3); myMeshVolumesGroupLayout->addWidget( myMeshNbPolyhedronesLab, 5, 0 ); myMeshVolumesGroupLayout->addWidget( myMeshNbPolyhedrones, 5, 1 ); @@ -233,11 +301,16 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, aMeshLayout->addMultiCellWidget(line1, 1, 1, 0, 1); aMeshLayout->addWidget(myMeshNbNodesLab, 2, 0); aMeshLayout->addWidget(myMeshNbNodes, 2, 1); - aMeshLayout->addWidget(myMeshNbEdgesLab, 3, 0); - aMeshLayout->addWidget(myMeshNbEdges, 3, 1); - aMeshLayout->addMultiCellWidget(myMeshFacesGroup, 4, 4, 0, 1); - aMeshLayout->addMultiCellWidget(myMeshVolumesGroup, 5, 5, 0, 1); - aMeshLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Expanding), 6, 0); + aMeshLayout->addWidget(myMeshOrder0Lab, 3, 1); + aMeshLayout->addWidget(myMeshOrder1Lab, 3, 2); + aMeshLayout->addWidget(myMeshOrder2Lab, 3, 3); + aMeshLayout->addWidget(myMeshNbEdgesLab, 4, 0); + aMeshLayout->addWidget(myMeshNbEdges, 4, 1); + aMeshLayout->addWidget(myMeshNbEdges1, 4, 2); + aMeshLayout->addWidget(myMeshNbEdges2, 4, 3); + aMeshLayout->addMultiCellWidget(myMeshFacesGroup, 5, 5, 0, 3); + aMeshLayout->addMultiCellWidget(myMeshVolumesGroup, 6, 6, 0, 3); + aMeshLayout->addItem(new QSpacerItem(6, 6, QSizePolicy::Minimum, QSizePolicy::Expanding), 7, 0); // submesh mySubMeshWidget = new QWidget(myWGStack); @@ -344,12 +417,15 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, myButtonsGroupLayout->setAlignment(Qt::AlignTop); myButtonsGroupLayout->setSpacing(6); myButtonsGroupLayout->setMargin(11); - // buttons --> OK button + // buttons --> OK and Help buttons myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), myButtonsGroup, "myOkBtn"); myOkBtn->setAutoDefault(TRUE); myOkBtn->setDefault(TRUE); - myButtonsGroupLayout->addStretch(); + myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP" ), myButtonsGroup, "myHelpBtn"); + myHelpBtn->setAutoDefault(TRUE); + myButtonsGroupLayout->addWidget(myOkBtn); myButtonsGroupLayout->addStretch(); + myButtonsGroupLayout->addWidget(myHelpBtn); aTopLayout->addLayout(aSelectLayout); aTopLayout->addWidget(myWGStack); @@ -359,19 +435,18 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, // connect signals connect(myOkBtn, SIGNAL(clicked()), this, SLOT(close())); + connect( myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); connect(mySelectBtn, SIGNAL(clicked()), this, SLOT(onStartSelection())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(close())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged())); - // resize and move dialog, then show - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); // init dialog with current selection onSelectionChanged(); + + myHelpFileName = "/files/viewing_mesh_info.htm#advanced_infos"; } //================================================================================= @@ -410,15 +485,33 @@ void SMESHGUI_MeshInfosDlg::DumpMeshInfos() myMeshName->setText(aSO->GetName().c_str()); myMeshNbNodes->setNum((int)aMesh->NbNodes()); myMeshNbEdges->setNum((int)aMesh->NbEdges()); + myMeshNbEdges1->setNum((int)aMesh->NbEdgesOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbEdges2->setNum((int)aMesh->NbEdgesOfOrder(SMESH::ORDER_QUADRATIC)); myMeshNbFaces->setNum((int)aMesh->NbFaces()); + myMeshNbFaces1->setNum((int)aMesh->NbFacesOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbFaces2->setNum((int)aMesh->NbFacesOfOrder(SMESH::ORDER_QUADRATIC)); myMeshNbTriangles->setNum((int)aMesh->NbTriangles()); + myMeshNbTriangles1->setNum((int)aMesh->NbTrianglesOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbTriangles2->setNum((int)aMesh->NbTrianglesOfOrder(SMESH::ORDER_QUADRATIC)); myMeshNbQuadrangles->setNum((int)aMesh->NbQuadrangles()); + myMeshNbQuadrangles1->setNum((int)aMesh->NbQuadranglesOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbQuadrangles2->setNum((int)aMesh->NbQuadranglesOfOrder(SMESH::ORDER_QUADRATIC)); myMeshNbPolygones->setNum( (int)aMesh->NbPolygons() ); myMeshNbVolumes->setNum((int)aMesh->NbVolumes()); + myMeshNbVolumes1->setNum((int)aMesh->NbVolumesOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbVolumes2->setNum((int)aMesh->NbVolumesOfOrder(SMESH::ORDER_QUADRATIC)); myMeshNbTetra->setNum((int)aMesh->NbTetras()); + myMeshNbTetra1->setNum((int)aMesh->NbTetrasOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbTetra2->setNum((int)aMesh->NbTetrasOfOrder(SMESH::ORDER_QUADRATIC)); myMeshNbHexa->setNum((int)aMesh->NbHexas()); + myMeshNbHexa1->setNum((int)aMesh->NbHexasOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbHexa2->setNum((int)aMesh->NbHexasOfOrder(SMESH::ORDER_QUADRATIC)); myMeshNbPrism->setNum((int)aMesh->NbPrisms()); + myMeshNbPrism1->setNum((int)aMesh->NbPrismsOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbPrism2->setNum((int)aMesh->NbPrismsOfOrder(SMESH::ORDER_QUADRATIC)); myMeshNbPyra->setNum((int)aMesh->NbPyramids()); + myMeshNbPyra1->setNum((int)aMesh->NbPyramidsOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbPyra2->setNum((int)aMesh->NbPyramidsOfOrder(SMESH::ORDER_QUADRATIC)); myMeshNbPolyhedrones->setNum( (int)aMesh->NbPolyhedrons() ); return; } @@ -528,3 +621,20 @@ void SMESHGUI_MeshInfosDlg::onStartSelection() myStartSelection = true; mySelectLab->setText(tr("INF_SELECT_OBJECT")); } + +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_MeshInfosDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.h b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.h index e8e4bd9ed..2dbb62897 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.h +++ b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -63,6 +63,7 @@ private slots: void DeactivateActiveDialog() ; void ActivateThisDialog(); void onStartSelection(); + void onHelp(); private: SMESHGUI* mySMESHGUI; @@ -79,17 +80,35 @@ private: QLabel* myMeshName; QLabel* myMeshNbNodes; QLabel* myMeshNbEdges; + QLabel* myMeshNbEdges1; + QLabel* myMeshNbEdges2; QGroupBox* myMeshFacesGroup; QLabel* myMeshNbFaces; + QLabel* myMeshNbFaces1; + QLabel* myMeshNbFaces2; QLabel* myMeshNbTriangles; + QLabel* myMeshNbTriangles1; + QLabel* myMeshNbTriangles2; QLabel* myMeshNbQuadrangles; + QLabel* myMeshNbQuadrangles1; + QLabel* myMeshNbQuadrangles2; QLabel* myMeshNbPolygones; QGroupBox* myMeshVolumesGroup; QLabel* myMeshNbVolumes; + QLabel* myMeshNbVolumes1; + QLabel* myMeshNbVolumes2; QLabel* myMeshNbTetra; + QLabel* myMeshNbTetra1; + QLabel* myMeshNbTetra2; QLabel* myMeshNbHexa; + QLabel* myMeshNbHexa1; + QLabel* myMeshNbHexa2; QLabel* myMeshNbPyra; + QLabel* myMeshNbPyra1; + QLabel* myMeshNbPyra2; QLabel* myMeshNbPrism; + QLabel* myMeshNbPrism1; + QLabel* myMeshNbPrism2; QLabel* myMeshNbPolyhedrones; QWidget* mySubMeshWidget; @@ -106,8 +125,11 @@ private: QLabel* myGroupType; QLabel* myGroupNb; - QGroupBox* myButtonsGroup; - QPushButton* myOkBtn; + QGroupBox* myButtonsGroup; + QPushButton* myOkBtn; + QPushButton* myHelpBtn; + + QString myHelpFileName; }; #endif // SMESHGUI_MESHINFOSDLG_H diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index 1bf664dfd..d325f77b2 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // /** * SMESH SMESHGUI @@ -96,7 +96,7 @@ SMESHGUI_MeshOp::SMESHGUI_MeshOp( const bool theToCreate, const bool theIsMesh ) myToCreate( theToCreate ), myIsMesh( theIsMesh ), myDlg( 0 ), - myShapeByMeshDlg( 0 ) + myShapeByMeshOp( 0 ) { if ( GeometryGUI::GetGeomGen()->_is_nil() )// check that GEOM_Gen exists GeometryGUI::InitGeomGen(); @@ -141,6 +141,7 @@ bool SMESHGUI_MeshOp::onApply() QString aMess; if ( !isValid( aMess ) ) { + dlg()->show(); if ( aMess != "" ) SUIT_MessageBox::warn1( myDlg, tr( "SMESH_WRN_WARNING" ), aMess, tr( "SMESH_BUT_OK" ) ); @@ -202,31 +203,39 @@ void SMESHGUI_MeshOp::startOperation() for ( int i = SMESH::DIM_1D; i <= SMESH::DIM_3D; i++ ) { connect( myDlg->tab( i ), SIGNAL( createHyp( const int, const int ) ), - this, SLOT( onCreateHyp( const int, const int) ) ); + this, SLOT( onCreateHyp( const int, const int ) ) ); connect( myDlg->tab( i ), SIGNAL( editHyp( const int, const int ) ), - this, SLOT( onEditHyp( const int, const int) ) ); + this, SLOT( onEditHyp( const int, const int ) ) ); + connect( myDlg->tab( i ), SIGNAL( selectAlgo( const int ) ), + this, SLOT( onAlgoSelected( const int ) ) ); } connect( myDlg, SIGNAL( hypoSet( const QString& )), SLOT( onHypoSet( const QString& ))); connect( myDlg, SIGNAL( geomSelectionByMesh( bool )), SLOT( onGeomSelectionByMesh( bool ))); + + if ( myToCreate ) + if ( myIsMesh ) myHelpFileName = "/files/constructing_meshes.htm"; + else myHelpFileName = "/files/constructing_submeshes.htm"; + else myHelpFileName = "files/reassigning_hypotheses_and_algorithms.htm"; } SMESHGUI_SelectionOp::startOperation(); - // iterate through dimensions and get available and existing algoritms and hypotheses, + // iterate through dimensions and get available algoritms, // set them to the dialog - int i, j; _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" ); - for ( i = SMESH::DIM_1D; i <= SMESH::DIM_3D; i++ ) + for ( int i = SMESH::DIM_1D; i <= SMESH::DIM_3D; i++ ) { SMESHGUI_MeshTab* aTab = myDlg->tab( i ); - QStringList anAvailable, anExisting; - for ( j = Algo; j <= AddHyp; j++ ) - { - availableHyps( i, j, anAvailable ); - existingHyps( i, j, aFather, anExisting, myExistingHyps[ i ][ j ] ); - - aTab->setAvailableHyps( j, anAvailable ); - aTab->setExistingHyps( j, anExisting ); - } + QStringList hypList; + // clear available hypotheses + aTab->setAvailableHyps( MainHyp, hypList ); + aTab->setAvailableHyps( AddHyp, hypList ); + aTab->setExistingHyps( MainHyp, hypList ); + aTab->setExistingHyps( AddHyp, hypList ); + myExistingHyps[ i ][ MainHyp ].clear(); + myExistingHyps[ i ][ AddHyp ].clear(); + // set algos + availableHyps( i, Algo, hypList, myAvailableHypData[i][Algo] ); + aTab->setAvailableHyps( Algo, hypList ); } if ( myToCreate ) { @@ -238,10 +247,12 @@ void SMESHGUI_MeshOp::startOperation() myDlg->setHypoSets( SMESH::GetHypothesesSets() ); + myDlg->setCurrentTab( SMESH::DIM_3D ); + myDlg->show(); + selectionDone(); - myDlg->setCurrentTab( SMESH::DIM_1D ); - myDlg->show(); + myIgnoreAlgoSelection = false; } //================================================================================ @@ -348,6 +359,7 @@ _PTR(SObject) SMESHGUI_MeshOp::getSubmeshByGeom() const case GEOM::COMPOUND: tag = SUBMESH_ON_COMPOUND_TAG; break; default:; } + _PTR(GenericAttribute) anAttr; _PTR(SObject) aSubmeshRoot; _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); if ( pMesh->FindSubObject( tag, aSubmeshRoot ) ) @@ -356,6 +368,8 @@ _PTR(SObject) SMESHGUI_MeshOp::getSubmeshByGeom() const for (; smIter->More(); smIter->Next() ) { _PTR(SObject) aSmObj = smIter->Value(); + if ( ! aSmObj->FindAttribute( anAttr, "AttributeIOR" )) + continue; _PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSmObj); for (; anIter1->More(); anIter1->Next()) { _PTR(SObject) pGeom2 = anIter1->Value(); @@ -379,7 +393,7 @@ _PTR(SObject) SMESHGUI_MeshOp::getSubmeshByGeom() const //================================================================================ void SMESHGUI_MeshOp::selectionDone() { - if ( myShapeByMeshDlg && myShapeByMeshDlg->isShown() ) + if ( !dlg()->isShown() ) return; SMESHGUI_SelectionOp::selectionDone(); @@ -427,6 +441,7 @@ void SMESHGUI_MeshOp::selectionDone() } myDlg->setMaxHypoDim( shapeDim ); + if ( !myToCreate ) // edition: read hypotheses { QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ); @@ -465,8 +480,9 @@ void SMESHGUI_MeshOp::selectionDone() } else { - selectObject( _PTR(SObject)() ); myDlg->selectObject( "", SMESHGUI_MeshDlg::Geom, "" ); + selectObject( _PTR(SObject)() ); + selectionDone(); } } @@ -477,7 +493,7 @@ void SMESHGUI_MeshOp::selectionDone() SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface( pMesh ); if ( !mesh->_is_nil() ) enable = ( shapeDim > 1 ) && ( mesh->NbEdges() > 0 ); - } + } myDlg->setGeomPopupEnabled( enable ); } } @@ -574,6 +590,31 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const return true; } +//================================================================================ +/*! + * \brief check compatibility of the algorithm and another algorithm or hypothesis + * \param theAlgoData - algorithm data + * \param theHypData - hypothesis data + * \param theHypType - hypothesis type + * \param theHypTypeName - hypothesis type name, must be provided if 2-nd arg is not algo + * \retval bool - check result + */ +//================================================================================ + +static bool isCompatible(const HypothesisData* theAlgoData, + const HypothesisData* theHypData, + const int theHypType) +{ + if ( !theAlgoData ) + return true; + + if ( theHypType == SMESHGUI_MeshOp::Algo ) + return SMESH::IsCompatibleAlgorithm( theAlgoData, theHypData ); + + bool isOptional; + return ( SMESH::IsAvailableHypothesis( theAlgoData, theHypData->TypeName, isOptional )); +} + //================================================================================ /*! * \brief Gets available hypotheses or algorithms @@ -581,22 +622,31 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const * \param theHypType - specifies whether algorims or hypotheses or additional ones * are retrieved (possible values are in HypType enumeration) * \param theHyps - Output list of hypotheses' names + * \param theAlgoData - to select hypos able to be used by this algo (optional) * * Gets available hypotheses or algorithm in accordance with input parameters */ //================================================================================ -void SMESHGUI_MeshOp::availableHyps( const int theDim, - const int theHypType, - QStringList& theHyps ) const +void SMESHGUI_MeshOp::availableHyps( const int theDim, + const int theHypType, + QStringList& theHyps, + THypDataList& theDataList, + HypothesisData* theAlgoData ) const { + theDataList.clear(); theHyps.clear(); - QStringList aHypTypeNameList = SMESH::GetAvailableHypotheses( - theHypType == Algo , theDim, theHypType == AddHyp ); + bool isAlgo = ( theHypType == Algo ); + bool isAux = ( theHypType == AddHyp ); + QStringList aHypTypeNameList = SMESH::GetAvailableHypotheses( isAlgo, theDim, isAux ); + QStringList::const_iterator anIter; for ( anIter = aHypTypeNameList.begin(); anIter != aHypTypeNameList.end(); ++anIter ) { HypothesisData* aData = SMESH::GetHypothesisData( *anIter ); - theHyps.append( aData->Label ); + if ( isCompatible ( theAlgoData, aData, theHypType )) { + theDataList.append( aData ); + theHyps.append( aData->Label ); + } } } @@ -607,8 +657,10 @@ void SMESHGUI_MeshOp::availableHyps( const int theDim, * \param theHypType - specifies whether algorims or hypotheses or additional ones * are retrieved (possible values are in HypType enumeration) * \param theFather - start object for finding ( may be component, mesh, or sub-mesh ) + * \param theDataList - output list of hypotheses data * \param theHyps - output list of names. * \param theHypVars - output list of variables. + * \param theAlgoData - to select hypos able to be used by this algo (optional) * * Gets existing (i.e. already created) hypotheses or algorithm in accordance with * input parameters @@ -618,7 +670,8 @@ void SMESHGUI_MeshOp::existingHyps( const int theDim, const int theHypType, _PTR(SObject) theFather, QStringList& theHyps, - QValueList& theHypVars ) + QValueList& theHypVars, + HypothesisData* theAlgoData) { // Clear hypoheses list theHyps.clear(); @@ -627,6 +680,8 @@ void SMESHGUI_MeshOp::existingHyps( const int theDim, if ( !theFather ) return; + const bool isAux = ( theHypType == AddHyp ); + _PTR(SObject) aHypRoot; _PTR(GenericAttribute) anAttr; _PTR(AttributeName) aName; @@ -666,8 +721,10 @@ void SMESHGUI_MeshOp::existingHyps( const int theDim, QString aHypType( aHypVar->GetName() ); HypothesisData* aData = SMESH::GetHypothesisData( aHypType ); if ( ( theDim == -1 || aData->Dim.contains( theDim ) ) && - ( theHypType == AddHyp ) == aData->IsAux ) + ( isCompatible ( theAlgoData, aData, theHypType )) && + ( isAux == aData->IsAux )) { + //theDataList.append( aData ); theHyps.append( aName->Value().c_str() ); theHypVars.append( aHypVar ); } @@ -740,78 +797,96 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType, //================================================================================ /*! - * \brief Calls plugin methods for hypothesis creation - * \param theHypType - specifies whether main hypotheses or additional ones - * are created + * \Brief Returns tab dimention + * \param tab - the tab in the dlg + * \param dlg - my dialogue + * \retval int - dimention + */ +//================================================================================ + +static int getTabDim (const QObject* tab, SMESHGUI_MeshDlg* dlg ) +{ + int aDim = -1; + for (int i = SMESH::DIM_1D; i <= SMESH::DIM_3D; i++) + if (tab == dlg->tab(i)) + aDim = i; + return aDim; +} + +//================================================================================ +/*! + * \brief Create hypothesis + * \param theHypType - hypothesis category (main or additional) * \param theIndex - index of type of hypothesis to be cerated * - * Speicfies dimension of hypothesis to be created (using sender() method), specifies - * its type and calls plugin methods for hypothesis creation + * Specifies dimension of hypothesis to be created (using sender() method), + * specifies its type and calls method for hypothesis creation */ //================================================================================ void SMESHGUI_MeshOp::onCreateHyp( const int theHypType, const int theIndex ) { - // Speicfies dimension of hypothesis to be created - const QObject* aSender = sender(); - int aDim = -1; - for ( int i = SMESH::DIM_1D; i <= SMESH::DIM_3D; i++ ) - if ( aSender == myDlg->tab( i ) ) - aDim = i; - if ( aDim == -1 ) + // Specifies dimension of hypothesis to be created + int aDim = getTabDim( sender(), myDlg ); + if (aDim == -1) return; - // Speicfies type of hypothesis to be created - QStringList aHypTypeNames = SMESH::GetAvailableHypotheses( false , aDim, theHypType == AddHyp ); - if ( theIndex < 0 || theIndex >= aHypTypeNames.count() ) + // Specifies type of hypothesis to be created + THypDataList& dataList = myAvailableHypData[ aDim ][ theHypType ]; + if (theIndex < 0 || theIndex >= dataList.count()) return; + QString aHypTypeName = dataList[ theIndex ]->TypeName; - QString aHypTypeName = aHypTypeNames[ theIndex ]; - HypothesisData* aData = SMESH::GetHypothesisData( aHypTypeName.latin1() ); - if ( aData == 0 ) + // Create hypothesis + createHypothesis(aDim, theHypType, aHypTypeName); +} + +//================================================================================ +/*! + * Create hypothesis and update dialog. + * \param theDim - dimension of hypothesis to be created + * \param theType - hypothesis category (algorithm, hypothesis, additional hypothesis) + * \param theTypeName - specifies hypothesis to be created + */ +//================================================================================ +void SMESHGUI_MeshOp::createHypothesis (const int theDim, + const int theType, + const QString& theTypeName) +{ + HypothesisData* aData = SMESH::GetHypothesisData(theTypeName.latin1()); + if (!aData) return; - QString aClientLibName = aData->ClientLibName; - QStringList anOldHyps; - _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" ); - existingHyps( aDim, theHypType, aFather, anOldHyps, myExistingHyps[ aDim ][ theHypType ] ); + // existing hypos + int nbHyp = myExistingHyps[theDim][theType].count(); - if ( aClientLibName == "" ) - { + QString aClientLibName = aData->ClientLibName; + if (aClientLibName == "") { // Call hypothesis creation server method (without GUI) - QString aHypName = aData->Label; - SMESH::CreateHypothesis( aHypTypeName, aHypName, false ); - } - else - { + SMESH::CreateHypothesis(theTypeName, aData->Label, false); + } else { // Get hypotheses creator client (GUI) - SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator( aHypTypeName ); + SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(theTypeName); // Create hypothesis - if ( aCreator ) - { + if (aCreator) { // When create or edit a submesh, try to initialize a new hypothesis // with values used to mesh a subshape SMESH::SMESH_Hypothesis_var initParamHyp = - getInitParamsHypothesis( aHypTypeName, aData->ServerLibName ); - - if ( initParamHyp->_is_nil() ) - aCreator->create( false, myDlg ); - else - aCreator->create( initParamHyp, myDlg ); - } - else - { - SMESH::CreateHypothesis( aHypTypeName, aData->Label, false ); + getInitParamsHypothesis(theTypeName, aData->ServerLibName); + aCreator->create(initParamHyp, myDlg); + } else { + SMESH::CreateHypothesis(theTypeName, aData->Label, false); } } + _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent("SMESH"); + + HypothesisData* algoData = hypData( theDim, Algo, currentHyp( theDim, Algo )); QStringList aNewHyps; - aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" ); - existingHyps( aDim, theHypType, aFather, aNewHyps, myExistingHyps[ aDim ][ theHypType ] ); - if ( aNewHyps.count() > anOldHyps.count() ) - { - for ( int i = anOldHyps.count(); i < aNewHyps.count(); i++ ) - myDlg->tab( aDim )->addHyp( theHypType, aNewHyps[ i ] ); + existingHyps(theDim, theType, aFather, aNewHyps, myExistingHyps[theDim][theType], algoData); + if (aNewHyps.count() > nbHyp) { + for (int i = nbHyp; i < aNewHyps.count(); i++) + myDlg->tab(theDim)->addHyp(theType, aNewHyps[i]); } } @@ -828,16 +903,14 @@ void SMESHGUI_MeshOp::onCreateHyp( const int theHypType, const int theIndex ) void SMESHGUI_MeshOp::onEditHyp( const int theHypType, const int theIndex ) { // Speicfies dimension of hypothesis to be created - const QObject* aSender = sender(); - int aDim = -1; - for ( int i = SMESH::DIM_1D; i <= SMESH::DIM_3D; i++ ) - if ( aSender == myDlg->tab( i ) ) - aDim = i; - if ( aDim == -1 ) + int aDim = getTabDim( sender(), myDlg ); + if (aDim == -1) return; QValueList aList = myExistingHyps[ aDim ][ theHypType ]; - SMESH::SMESH_Hypothesis_var aHyp = aList[ theIndex - 1 ]; + if ( theIndex < 0 || theIndex >= aList.count() ) + return; + SMESH::SMESH_Hypothesis_var aHyp = aList[ theIndex ]; if ( aHyp->_is_nil() ) return; @@ -849,96 +922,238 @@ void SMESHGUI_MeshOp::onEditHyp( const int theHypType, const int theIndex ) //================================================================================ /*! - * \brief Creates and selects hypothesis of hypotheses set - * \param theSetName - The name of hypotheses set + * \brief access to hypothesis data + * \param theDim - hyp dimension + * \param theHypType - hyp type (Algo,MainHyp or AddHyp) + * \param theIndex - index in the list + * \retval HypothesisData* - result data, may be 0 */ //================================================================================ -void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName ) +HypothesisData* SMESHGUI_MeshOp::hypData( const int theDim, + const int theHypType, + const int theIndex) { - HypothesesSet* aHypoSet = SMESH::GetHypothesesSet( theSetName ); - if ( !aHypoSet ) return; + if ( theDim > -1 && theDim < 3 && + theHypType > -1 && theHypType < NbHypTypes && + theIndex > -1 && theIndex < myAvailableHypData[ theDim ][ theHypType ].count() ) + return myAvailableHypData[ theDim ][ theHypType ][ theIndex ]; + return 0; +} + +//================================================================================ +/*! + * \brief Set available algos and hypos according to the selected algorithm + * \param theIndex - algorithm index + */ +//================================================================================ + +void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex, + const int theDim ) +{ + if ( myIgnoreAlgoSelection ) + return; - for ( int aHypType = Algo; aHypType < AddHyp; aHypType++ ) + int aDim = theDim < 0 ? getTabDim( sender(), myDlg ): theDim; + if (aDim == -1) + return; + + // find highest available dimension, all algos of this dimension are available for choice + int aTopDim = -1; + for (int i = SMESH::DIM_1D; i <= SMESH::DIM_3D; i++) + if (isAccessibleDim( i )) + aTopDim = i; + if (aTopDim == -1) + return; + + const bool isSubmesh = ( myToCreate ? !myIsMesh : myDlg->isObjectShown( SMESHGUI_MeshDlg::Mesh )); + + HypothesisData* algoData = hypData( aDim, Algo, theIndex ); + HypothesisData* algoByDim[3]; + algoByDim[ aDim ] = algoData; + + QStringList anAvailable; + if ( !algoData ) { // all algos becomes available + availableHyps( aDim, Algo, anAvailable, myAvailableHypData[ aDim ][ Algo ]); + myDlg->tab( aDim )->setAvailableHyps( Algo, anAvailable ); + } + + // check that algorithms of other dimentions are compatible with + // the selected one + + // 2 loops: backward and forward from algo dimension + for ( int forward = false; forward <= true; ++forward ) { - bool isAlgo = (aHypType == Algo); + int dim = aDim + 1, lastDim = SMESH::DIM_3D, dir = 1; + if ( !forward ) { + dim = aDim - 1; lastDim = SMESH::DIM_1D; dir = -1; + } + HypothesisData* prevAlgo = algoData; + bool noCompatible = false; + for ( ; dim * dir <= lastDim * dir ; dim += dir ) + { + if ( !isAccessibleDim( dim )) + continue; + if ( noCompatible ) { // the selected algo has no compatible ones + anAvailable.clear(); + myDlg->tab( dim )->setAvailableHyps( Algo, anAvailable ); + myAvailableHypData[dim][Algo].clear(); + algoByDim[ dim ] = 0; + continue; + } + // get currently selected algo + int algoIndex = currentHyp( dim, Algo ); + HypothesisData* curAlgo = hypData( dim, Algo, algoIndex ); + if ( curAlgo ) { // some algo selected + if ( !isCompatible( prevAlgo, curAlgo, Algo )) + curAlgo = 0; + } + // set new available algoritms + availableHyps( dim, Algo, anAvailable, myAvailableHypData[dim][Algo], prevAlgo ); + HypothesisData* soleCompatible = 0; + if ( anAvailable.count() == 1 ) + soleCompatible = myAvailableHypData[dim][Algo][0]; + if ( dim == aTopDim && prevAlgo ) // all available algoritms should be selectable any way + availableHyps( dim, Algo, anAvailable, myAvailableHypData[dim][Algo], 0 ); + myDlg->tab( dim )->setAvailableHyps( Algo, anAvailable ); + noCompatible = anAvailable.isEmpty(); + + // restore previously selected algo + algoIndex = myAvailableHypData[dim][Algo].findIndex( curAlgo ); + if ( !isSubmesh && algoIndex < 0 && soleCompatible ) + // select the sole compatible algo + algoIndex = myAvailableHypData[dim][Algo].findIndex( soleCompatible ); + setCurrentHyp( dim, Algo, algoIndex ); + + // remember current algo + prevAlgo = algoByDim[ dim ] = hypData( dim, Algo, algoIndex ); + } + } - // clear all hyps - for ( int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++ ) - setCurrentHyp( dim, aHypType, -1 ); + // set hypotheses corresponding to the found algoritms - // set hyps from the set - - QStringList* aHypoList = isAlgo ? & aHypoSet->AlgoList : & aHypoSet->HypoList; - for ( int i = 0, n = aHypoList->count(); i < n; i++ ) + _PTR(SObject) pObj = SMESH::GetActiveStudyDocument()->FindComponent("SMESH"); + + for ( int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++ ) + { + if ( !isAccessibleDim( dim )) + continue; + for ( int type = MainHyp; type < NbHypTypes; type++ ) { + myAvailableHypData[ dim ][ type ].clear(); + QStringList anAvailable, anExisting; + + HypothesisData* curAlgo = algoByDim[ dim ]; + int hypIndex = currentHyp( dim, type ); + + SMESH::SMESH_Hypothesis_var curHyp; + if ( hypIndex >= 0 && hypIndex < myExistingHyps[ dim ][ type ].count() ) + curHyp = myExistingHyps[ dim ][ type ][ hypIndex ]; + + if ( !myToCreate && !curAlgo && !curHyp->_is_nil() ) { // edition, algo not selected + // try to find algo by selected hypothesis in order to keep it selected + bool algoDeselectedByUser = ( theDim < 0 && aDim == dim ); + QString curHypType = curHyp->GetName(); + if ( !algoDeselectedByUser && + myObjHyps[ dim ][ type ].count() > 0 && + curHypType == myObjHyps[ dim ][ type ][ 0 ]->GetName()) + { + HypothesisData* hypData = SMESH::GetHypothesisData( curHyp->GetName() ); + for ( int i = 0 ; i < myAvailableHypData[ dim ][ Algo ].count(); ++i ) { + curAlgo = myAvailableHypData[ dim ][ Algo ][ i ]; + if ( curAlgo && hypData && isCompatible( curAlgo, hypData, type )) + break; + else + curAlgo = 0; + } + } + } + // get hyps compatible with curAlgo + if ( curAlgo ) + { + // check if a selected hyp is compatible with the curAlgo + if ( !curHyp->_is_nil() ) { + HypothesisData* hypData = SMESH::GetHypothesisData( curHyp->GetName() ); + if ( !isCompatible( curAlgo, hypData, type )) + curHyp = SMESH::SMESH_Hypothesis::_nil(); + } + existingHyps( dim, type, pObj, anExisting, myExistingHyps[ dim ][ type ], curAlgo); + availableHyps( dim, type, anAvailable, myAvailableHypData[ dim ][ type ], curAlgo); + } + // set list of hypotheses + myDlg->tab( dim )->setAvailableHyps( type, anAvailable ); + myDlg->tab( dim )->setExistingHyps( type, anExisting ); + + // set current existing hypothesis + if ( !curHyp->_is_nil() && !anExisting.isEmpty() ) + hypIndex = this->find( curHyp, myExistingHyps[ dim ][ type ]); + else + hypIndex = -1; + if ( !isSubmesh && hypIndex < 0 && anExisting.count() == 1 ) { + // none is yet selected => select the sole existing if it is not optional + QString hypTypeName = myExistingHyps[ dim ][ type ][ 0 ]->GetName(); + bool isOptional = true; + if ( algoByDim[ dim ] && + SMESH::IsAvailableHypothesis( algoByDim[ dim ], hypTypeName, isOptional ) && + !isOptional ) + hypIndex = 0; + } + setCurrentHyp( dim, type, hypIndex ); + } + } +} + +//================================================================================ +/*! + * \brief Creates and selects hypothesis of hypotheses set + * \param theSetName - The name of hypotheses set + */ +//================================================================================ +void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName ) +{ + HypothesesSet* aHypoSet = SMESH::GetHypothesesSet(theSetName); + if (!aHypoSet) return; + + // clear all hyps + for (int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++) { + setCurrentHyp(dim, Algo, -1); + setCurrentHyp(dim, AddHyp, -1); + setCurrentHyp(dim, MainHyp, -1); + } + + for (int aHypType = Algo; aHypType < AddHyp; aHypType++) { + bool isAlgo = (aHypType == Algo); + + // set hyps from the set + QStringList* aHypoList = isAlgo ? &aHypoSet->AlgoList : &aHypoSet->HypoList; + for (int i = 0, n = aHypoList->count(); i < n; i++) { const QString& aHypoTypeName = (*aHypoList)[ i ]; - HypothesisData* aHypData = SMESH::GetHypothesisData( aHypoTypeName ); - if ( !aHypData ) + HypothesisData* aHypData = SMESH::GetHypothesisData(aHypoTypeName); + if (!aHypData) continue; int aDim = aHypData->Dim[0]; // create or/and set - int index = -1; - if ( isAlgo ) - { - QStringList aHypTypeNameList = SMESH::GetAvailableHypotheses( isAlgo, aDim ); - index = aHypTypeNameList.findIndex( aHypoTypeName ); - if ( index < 0 ) continue; - setCurrentHyp ( aDim, aHypType, index ); - } - else - { - // try to find an existing hypo - QValueList & aList = myExistingHyps[ aDim ][ aHypType ]; - int /*iHyp = 0,*/ nbHyp = aList.count(); -// for ( ; iHyp < nbHyp; ++iHyp ) -// { -// SMESH::SMESH_Hypothesis_var aHyp = aList[ iHyp ]; -// if ( !aHyp->_is_nil() && aHypoTypeName == aHyp->GetName() ) { -// index = iHyp; -// break; -// } -// } - if ( index >= 0 ) // found - { - // select the found hypothesis - setCurrentHyp ( aDim, aHypType, index ); + if (isAlgo) { + int index = myAvailableHypData[aDim][Algo].findIndex( aHypData ); + if ( index < 0 ) { + QStringList anAvailable; + availableHyps( aDim, Algo, anAvailable, myAvailableHypData[aDim][Algo] ); + myDlg->tab( aDim )->setAvailableHyps( Algo, anAvailable ); + index = myAvailableHypData[aDim][Algo].findIndex( aHypData ); } - else - { - // create a hypothesis - QString aClientLibName = aHypData->ClientLibName; - if ( aClientLibName == "" ) { - // Call hypothesis creation server method (without GUI) - SMESH::CreateHypothesis( aHypoTypeName, aHypData->Label, isAlgo ); - } - else { - // Get hypotheses creator client (GUI) - SMESHGUI_GenericHypothesisCreator* aCreator = - SMESH::GetHypothesisCreator( aHypoTypeName ); - if ( aCreator ) - { - // When create or edit a submesh, try to initialize a new hypothesis - // with values used to mesh a subshape - SMESH::SMESH_Hypothesis_var initParamHyp = - getInitParamsHypothesis( aHypoTypeName, aHypData->ServerLibName ); - aCreator->create( initParamHyp, myDlg ); - } - else - { - SMESH::CreateHypothesis( aHypoTypeName, aHypData->Label, isAlgo ); - } - } - QStringList aNewHyps; - _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" ); - existingHyps( aDim, aHypType, aFather, aNewHyps, aList ); - if ( aList.count() > nbHyp ) - { - for ( int i = nbHyp; i < aNewHyps.count(); i++ ) - myDlg->tab( aDim )->addHyp( aHypType, aNewHyps[ i ] ); - } + setCurrentHyp( aDim, Algo, index ); + onAlgoSelected( index, aDim ); + } + else { + bool mainHyp = true; + int index = myAvailableHypData[aDim][MainHyp].findIndex( aHypData ); + if ( index < 0 ) { + mainHyp = false; + index = myAvailableHypData[aDim][AddHyp].findIndex( aHypData ); } + if (index >= 0) + createHypothesis(aDim, mainHyp ? MainHyp : AddHyp, aHypoTypeName); } } // loop on hypos in the set } // loop on algo/hypo @@ -1055,6 +1270,12 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess ) } } } + + // deselect geometry: next submesh sould be created on other subshape + myDlg->selectObject( "", SMESHGUI_MeshDlg::Geom, "" ); + selectObject( _PTR(SObject)() ); + selectionDone(); + return true; } @@ -1080,7 +1301,7 @@ int SMESHGUI_MeshOp::currentHyp( const int theDim, const int theHypType ) const * \retval bool - result */ //================================================================================ -bool SMESHGUI_MeshOp::isAccessibleDim( const int theDim) const +bool SMESHGUI_MeshOp::isAccessibleDim( const int theDim ) const { return myDlg->tab( theDim )->isEnabled(); } @@ -1099,7 +1320,9 @@ void SMESHGUI_MeshOp::setCurrentHyp( const int theDim, const int theHypType, const int theIndex ) { + myIgnoreAlgoSelection = true; myDlg->tab( theDim )->setCurrentHyp( theHypType, theIndex + 1 ); + myIgnoreAlgoSelection = false; } //================================================================================ @@ -1141,11 +1364,20 @@ void SMESHGUI_MeshOp::setDefaultName() const SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim ) { SMESH::SMESH_Hypothesis_var anAlgoVar; + + // get type of the selected algo int aHypIndex = currentHyp( theDim, Algo ); - QStringList aHypTypeNameList = SMESH::GetAvailableHypotheses( true, theDim, false ); - if ( aHypIndex < 0 || aHypIndex >= aHypTypeNameList.count() ) + THypDataList& dataList = myAvailableHypData[ theDim ][ Algo ]; + if ( aHypIndex < 0 || aHypIndex >= dataList.count()) return anAlgoVar; - QString aHypName = aHypTypeNameList[ aHypIndex ]; + QString aHypName = dataList[ aHypIndex ]->TypeName; + + // get existing algoritms + _PTR(SObject) pObj = SMESH::GetActiveStudyDocument()->FindComponent("SMESH"); + QStringList tmp; + existingHyps( theDim, Algo, pObj, tmp, myExistingHyps[ theDim ][ Algo ]); + + // look for anexisting algo of such a type QValueList& aHypVarList = myExistingHyps[ theDim ][ Algo ]; QValueList::iterator anIter; for ( anIter = aHypVarList.begin(); anIter != aHypVarList.end(); anIter++ ) @@ -1157,20 +1389,23 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim ) break; } } - if ( anAlgoVar->_is_nil() ) - { + + if (anAlgoVar->_is_nil()) { HypothesisData* aHypData = SMESH::GetHypothesisData( aHypName ); - if ( aHypData ) - { + if (aHypData) { QString aClientLibName = aHypData->ClientLibName; - if ( aClientLibName == "" ) - SMESH::CreateHypothesis( aHypName, aHypData->Label, true ); - else - { - SMESHGUI_GenericHypothesisCreator* aCreator = - SMESH::GetHypothesisCreator( aHypName ); - if ( aCreator ) - aCreator->create( true, myDlg ); + if (aClientLibName == "") { + // Call hypothesis creation server method (without GUI) + SMESH::CreateHypothesis(aHypName, aHypData->Label, true); + } else { + // Get hypotheses creator client (GUI) + SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypName); + + // Create algorithm + if (aCreator) + aCreator->create(true, myDlg); + else + SMESH::CreateHypothesis(aHypName, aHypData->Label, true); } QStringList tmpList; _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" ); @@ -1231,41 +1466,60 @@ void SMESHGUI_MeshOp::readMesh() } // Get hypotheses and algorithms assigned to the mesh/sub-mesh + QStringList anExisting; for ( int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++ ) { // get algorithm - QStringList anExisting; - int aHypIndex = -1; existingHyps( dim, Algo, pObj, anExisting, myObjHyps[ dim ][ Algo ] ); + // find algo index among available ones + int aHypIndex = -1; if ( myObjHyps[ dim ][ Algo ].count() > 0 ) { SMESH::SMESH_Hypothesis_var aVar = myObjHyps[ dim ][ Algo ].first(); QString aHypTypeName = aVar->GetName(); - - QStringList aHypTypeNameList = SMESH::GetAvailableHypotheses( true , dim, false ); - for ( int i = 0, n = aHypTypeNameList.count(); i < n; i++ ) - if ( aHypTypeName == aHypTypeNameList[ i ] ) - { - aHypIndex = i; - break; - } + HypothesisData* algoData = SMESH::GetHypothesisData( aHypTypeName ); + aHypIndex = myAvailableHypData[ dim ][ Algo ].findIndex ( algoData ); +// if ( aHypIndex < 0 && algoData ) { +// // assigned algo is incompatible with other algorithms +// myAvailableHypData[ dim ][ Algo ].push_back( algoData ); +// aHypIndex = myAvailableHypData[ dim ][ hypType ].count() - 1; +// } } setCurrentHyp( dim, Algo, aHypIndex ); + // set existing and available hypothesis according to the selected algo + onAlgoSelected( aHypIndex, dim ); + } - // get hypotheses + // get hypotheses + bool hypWithoutAlgo = false; + for ( int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++ ) + { for ( int hypType = MainHyp; hypType <= AddHyp; hypType++ ) { // get hypotheses existingHyps( dim, hypType, pObj, anExisting, myObjHyps[ dim ][ hypType ] ); - // find index of requered hypothesis among existing ones for this dimension - // and hyp types + // find index of requered hypothesis among existing ones for this dimension and type int aHypIndex = -1; - if ( myObjHyps[ dim ][ hypType ].count() > 0 ) + if ( myObjHyps[ dim ][ hypType ].count() > 0 ) { aHypIndex = find( myObjHyps[ dim ][ hypType ].first(), myExistingHyps[ dim ][ hypType ] ); + if ( aHypIndex < 0 ) { + // assigned hypothesis is incompatible with the algorithm + if ( currentHyp( dim, Algo ) < 0 ) + { // none algo selected; it is edition for sure, of submesh maybe + hypWithoutAlgo = true; + myExistingHyps[ dim ][ hypType ].push_back( myObjHyps[ dim ][ hypType ].first() ); + aHypIndex = myExistingHyps[ dim ][ hypType ].count() - 1; + myDlg->tab( dim )->setExistingHyps( hypType, anExisting ); + } + } + } setCurrentHyp( dim, hypType, aHypIndex ); } } + // make available other hyps of same type as one without algo + if ( hypWithoutAlgo ) + onAlgoSelected( currentHyp( 0, Algo ), 0 ); } //================================================================================ @@ -1375,9 +1629,10 @@ bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess ) } } // remove old algorithm - if ( toDelete ) - SMESH::RemoveHypothesisOrAlgorithmOnMesh - ( pObj, myObjHyps[ dim ][ Algo ].first() ); + if ( toDelete ) { + SMESH::RemoveHypothesisOrAlgorithmOnMesh ( pObj, myObjHyps[ dim ][ Algo ].first() ); + myObjHyps[ dim ][ Algo ].clear(); + } // assign new algorithm if ( toAdd ) { @@ -1392,6 +1647,7 @@ bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess ) if ( !aVar->_is_nil() ) SMESH::AddHypothesisOnSubMesh( aVar, anAlgoVar ); } + myObjHyps[ dim ][ Algo ].append( anAlgoVar ); } // assign hypotheses @@ -1405,9 +1661,11 @@ bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess ) if ( aNewHypIndex != anOldHypIndex ) { // remove old hypotheses - if ( anOldHypIndex >= 0 ) + if ( anOldHypIndex >= 0 ) { SMESH::RemoveHypothesisOrAlgorithmOnMesh( pObj, myExistingHyps[ dim ][ hypType ][ anOldHypIndex ] ); + myObjHyps[ dim ][ hypType ].clear(); + } // assign new hypotheses if ( aNewHypIndex != -1 ) @@ -1466,22 +1724,24 @@ bool SMESHGUI_MeshOp::isValid( SUIT_Operation* theOp ) const void SMESHGUI_MeshOp::onGeomSelectionByMesh( bool theByMesh ) { if ( theByMesh ) { - if ( !myShapeByMeshDlg ) { - myShapeByMeshDlg = new SMESHGUI_ShapeByMeshDlg( SMESHGUI::GetSMESHGUI(), "ShapeByMeshDlg"); - connect(myShapeByMeshDlg, SIGNAL(PublishShape()), SLOT(onPublishShapeByMeshDlg())); - connect(myShapeByMeshDlg, SIGNAL(Close()), SLOT(onCloseShapeByMeshDlg())); + if ( !myShapeByMeshOp ) { + myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(); + connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)), + SLOT(onPublishShapeByMeshDlg(SUIT_Operation*))); + connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)), + SLOT(onCloseShapeByMeshDlg(SUIT_Operation*))); } - // set mesh object to dlg + // set mesh object to SMESHGUI_ShapeByMeshOp and start it QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh ); if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.latin1() )) { SMESH::SMESH_Mesh_var aMeshVar = SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() ); if ( !aMeshVar->_is_nil() ) { - myDlg->hide(); - myDlg->activateObject( SMESHGUI_MeshDlg::Mesh ); - myShapeByMeshDlg->Init(); - myShapeByMeshDlg->SetMesh( aMeshVar ); - myShapeByMeshDlg->show(); + myDlg->hide(); // stop processing selection + myShapeByMeshOp->setModule( getSMESHGUI() ); + myShapeByMeshOp->setStudy( 0 ); // it's really necessary + myShapeByMeshOp->SetMesh( aMeshVar ); + myShapeByMeshOp->start(); } } } @@ -1493,32 +1753,21 @@ void SMESHGUI_MeshOp::onGeomSelectionByMesh( bool theByMesh ) */ //================================================================================ -void SMESHGUI_MeshOp::onPublishShapeByMeshDlg() +void SMESHGUI_MeshOp::onPublishShapeByMeshDlg(SUIT_Operation* op) { - if ( myShapeByMeshDlg ) { + if ( myShapeByMeshOp == op ) { + myDlg->show(); // Select a found geometry object - GEOM::GEOM_Object_var aGeomVar = myShapeByMeshDlg->GetShape(); + GEOM::GEOM_Object_var aGeomVar = myShapeByMeshOp->GetShape(); if ( !aGeomVar->_is_nil() ) { QString ID = aGeomVar->GetStudyEntry(); - if ( _PTR(SObject) aGeomSO = studyDS()->FindObjectID( ID )) { - SMESH::SMESH_Mesh_ptr aMeshPtr = myShapeByMeshDlg->GetMesh(); - if ( !CORBA::is_nil( aMeshPtr )) { - if (_PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshPtr )) { - myDlg->activateObject( SMESHGUI_MeshDlg::Mesh ); - myDlg->selectObject( aMeshSO->GetName(), SMESHGUI_MeshDlg::Mesh, aMeshSO->GetID() ); - } - } - myDlg->activateObject( SMESHGUI_MeshDlg::Geom ); + if ( _PTR(SObject) aGeomSO = studyDS()->FindObjectID( ID.latin1() )) { selectObject( aGeomSO ); - //selectionDone(); + selectionDone(); } } - else { - onCloseShapeByMeshDlg(); - } } - myDlg->show(); } //================================================================================ @@ -1527,12 +1776,10 @@ void SMESHGUI_MeshOp::onPublishShapeByMeshDlg() */ //================================================================================ -void SMESHGUI_MeshOp::onCloseShapeByMeshDlg() +void SMESHGUI_MeshOp::onCloseShapeByMeshDlg(SUIT_Operation* op) { - if ( myDlg ) { + if ( myShapeByMeshOp == op && myDlg ) { myDlg->show(); - myDlg->activateObject( SMESHGUI_MeshDlg::Geom ); - myDlg->selectObject( "", SMESHGUI_MeshDlg::Geom, "" ); } } diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.h b/src/SMESHGUI/SMESHGUI_MeshOp.h index 865a2fc53..3155a52cc 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.h +++ b/src/SMESHGUI/SMESHGUI_MeshOp.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // /** * SMESH SMESHGUI @@ -42,7 +42,8 @@ #include CORBA_SERVER_HEADER(SMESH_Mesh) class SMESHGUI_MeshDlg; -class SMESHGUI_ShapeByMeshDlg; +class SMESHGUI_ShapeByMeshOp; +class HypothesisData; /*! * \brief Operation for mech creation or editing @@ -53,9 +54,10 @@ class SMESHGUI_EXPORT SMESHGUI_MeshOp : public SMESHGUI_SelectionOp { Q_OBJECT - enum HypType{ Algo = 0, MainHyp, AddHyp }; - public: + + enum HypType{ Algo = 0, MainHyp, AddHyp, NbHypTypes }; + SMESHGUI_MeshOp( const bool theToCreate, const bool theIsMesh = true ); virtual ~SMESHGUI_MeshOp(); @@ -73,24 +75,38 @@ protected slots: void onEditHyp( const int theHypType, const int theIndex ); void onHypoSet( const QString& theSetName ); void onGeomSelectionByMesh( bool ); - void onPublishShapeByMeshDlg(); - void onCloseShapeByMeshDlg(); + void onPublishShapeByMeshDlg(SUIT_Operation*); + void onCloseShapeByMeshDlg(SUIT_Operation*); + void onAlgoSelected( const int theIndex, + const int theDim = -1); private: + + typedef QValueList THypDataList; // typedef: list of hypothesis data + bool isValid( QString& ) const; - void availableHyps( const int theDim, - const int theHypType, - QStringList& theHyps ) const; - void existingHyps( const int theDim, - const int theHypType, + void availableHyps( const int theDim, + const int theHypType, + QStringList& theHyps, + THypDataList& theDataList, + HypothesisData* theAlgoData = 0 ) const; + void existingHyps( const int theDim, + const int theHypType, _PTR(SObject) theFather, - QStringList& theHyps, - QValueList& theHypVars ); - + QStringList& theHyps, + QValueList& theHypVars, + HypothesisData* theAlgoData = 0); + HypothesisData* hypData( const int theDim, + const int theHypType, + const int theIndex); // access to myAvailableHypData + + void createHypothesis(const int theDim, const int theType, + const QString& theTypeName); + bool createMesh( QString& ); bool createSubMesh( QString& ); bool editMeshOrSubMesh( QString& ); - + int currentHyp( const int, const int ) const; bool isAccessibleDim( const int ) const; void setCurrentHyp( const int, const int, const int ); @@ -109,15 +125,20 @@ private: private: typedef QMap< int, QValueList > IdToHypListMap; typedef QMap< int, IdToHypListMap > DimToHypMap; - + SMESHGUI_MeshDlg* myDlg; - SMESHGUI_ShapeByMeshDlg* myShapeByMeshDlg; + SMESHGUI_ShapeByMeshOp* myShapeByMeshOp; bool myToCreate; bool myIsMesh; - + DimToHypMap myExistingHyps; //!< all hypothesis of SMESH module DimToHypMap myObjHyps; //!< hypothesis assigned to the current // edited mesh/sub-mesh + + // hypdata corresponding to hypotheses present in myDlg + THypDataList myAvailableHypData[3][NbHypTypes]; + + bool myIgnoreAlgoSelection; }; #endif diff --git a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx index c7ceb4bb9..e9557f934 100755 --- a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -46,10 +46,13 @@ #include "SUIT_ResourceMgr.h" #include "SUIT_Desktop.h" #include "SUIT_FileDlg.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" #include "LightApp_SelectionMgr.h" #include "SalomeApp_Tools.h" #include "SalomeApp_Study.h" +#include "LightApp_Application.h" #include "SALOMEDS_SObject.hxx" @@ -59,6 +62,7 @@ #include "SVTK_ViewModel.h" #include "SVTK_Selector.h" #include "SVTK_ViewWindow.h" +#include "VTKViewer_CellLocationsArray.h" // OCCT Includes #include @@ -86,7 +90,6 @@ // VTK Includes #include #include -#include #include #include #include @@ -129,6 +132,8 @@ SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI* theModule, mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector(); + myHelpFileName = "pattern_mapping.htm"; + Init(); } @@ -290,6 +295,7 @@ QFrame* SMESHGUI_MeshPatternDlg::createButtonFrame (QWidget* theParent) myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame); myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame); myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame); + myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame); QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); @@ -299,10 +305,12 @@ QFrame* SMESHGUI_MeshPatternDlg::createButtonFrame (QWidget* theParent) aLay->addWidget(myApplyBtn); aLay->addItem(aSpacer); aLay->addWidget(myCloseBtn); + aLay->addWidget(myHelpBtn); connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); + connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); return aFrame; } @@ -351,9 +359,6 @@ void SMESHGUI_MeshPatternDlg::Init() activateSelection(); onSelectionDone(); - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); } @@ -428,9 +433,13 @@ bool SMESHGUI_MeshPatternDlg::onApply() } } } + mySelectionMgr->clearSelected(); SMESH::UpdateView(); mySMESHGUI->updateObjBrowser(true); + + mySelEdit[ Ids ]->setText(""); + return true; } else { QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), @@ -472,6 +481,23 @@ void SMESHGUI_MeshPatternDlg::onClose() reject(); } +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_MeshPatternDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= // name : SMESHGUI_MeshPatternDlg::onSelectionDone // Purpose : SLOT called when selection changed @@ -1200,7 +1226,7 @@ vtkUnstructuredGrid* SMESHGUI_MeshPatternDlg::getGrid() else aCellTypesArray->InsertNextValue(VTK_EMPTY_CELL); } - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbCells); diff --git a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.h b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.h index bdaa10d08..93b07f7cf 100755 --- a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.h +++ b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -84,6 +84,7 @@ private slots: void onOk(); bool onApply(); void onClose(); + void onHelp(); void onDeactivate(); @@ -127,6 +128,7 @@ private: QPushButton* myOkBtn; QPushButton* myApplyBtn; QPushButton* myCloseBtn; + QPushButton* myHelpBtn; QButtonGroup* myTypeGrp; QRadioButton* mySwitch2d; @@ -173,6 +175,8 @@ private: SMESHGUI_CreatePatternDlg* myCreationDlg; SMESH::SMESH_Pattern_var myPattern; SALOME_Actor* myPreviewActor; + + QString myHelpFileName; }; #endif diff --git a/src/SMESHGUI/SMESHGUI_MeshUtils.cxx b/src/SMESHGUI/SMESHGUI_MeshUtils.cxx index 9c8d313c6..b8e5c3055 100644 --- a/src/SMESHGUI/SMESHGUI_MeshUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshUtils.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "SMESHGUI_MeshUtils.h" diff --git a/src/SMESHGUI/SMESHGUI_MeshUtils.h b/src/SMESHGUI/SMESHGUI_MeshUtils.h index e943ac1e0..81cdb67c1 100644 --- a/src/SMESHGUI/SMESHGUI_MeshUtils.h +++ b/src/SMESHGUI/SMESHGUI_MeshUtils.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef SMESHGUI_MeshUtils_HeaderFile #define SMESHGUI_MeshUtils_HeaderFile diff --git a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx index 1f8dbe539..9c396ade8 100644 --- a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -40,8 +40,11 @@ #include "SMDS_MeshNode.hxx" #include "LightApp_SelectionMgr.h" +#include "LightApp_Application.h" #include "SUIT_ResourceMgr.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" #include "SVTK_Selector.h" #include "SVTK_ViewModel.h" @@ -49,6 +52,7 @@ #include "SALOME_ListIO.hxx" #include "SVTK_ViewWindow.h" +#include "VTKViewer_CellLocationsArray.h" #include "utilities.h" @@ -58,7 +62,6 @@ // VTK includes #include #include -#include #include #include #include @@ -114,6 +117,8 @@ SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg (SMESHGUI* theModule, mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector(); + myHelpFileName = "/files/displacing_nodes.htm"; + Init(); } @@ -129,6 +134,7 @@ QFrame* SMESHGUI_MoveNodesDlg::createButtonFrame (QWidget* theParent) myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame); myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame); myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame); + myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame); QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); @@ -138,10 +144,12 @@ QFrame* SMESHGUI_MoveNodesDlg::createButtonFrame (QWidget* theParent) aLay->addWidget(myApplyBtn); aLay->addItem(aSpacer); aLay->addWidget(myCloseBtn); + aLay->addWidget(myHelpBtn); connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); + connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); return aFrame; } @@ -224,9 +232,6 @@ void SMESHGUI_MoveNodesDlg::Init() reset(); setEnabled(true); - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); // set selection mode @@ -334,6 +339,23 @@ void SMESHGUI_MoveNodesDlg::onClose() reject(); } +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_MoveNodesDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= // name : SMESHGUI_MoveNodesDlg::onTextChange // Purpose : @@ -525,7 +547,7 @@ void SMESHGUI_MoveNodesDlg::redisplayPreview() aCellTypesArray->InsertNextValue(VTK_VERTEX); anIdList->Delete(); - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(1); diff --git a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.h b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.h index 976aa6d05..c9fead03f 100644 --- a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.h +++ b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -68,6 +68,7 @@ private slots: void onOk(); bool onApply(); void onClose(); + void onHelp(); void onDeactivate(); @@ -92,6 +93,7 @@ private: QPushButton* myOkBtn; QPushButton* myApplyBtn; QPushButton* myCloseBtn; + QPushButton* myHelpBtn; QLineEdit* myId; SMESHGUI_SpinBox* myX; @@ -105,6 +107,8 @@ private: SALOME_Actor* myPreviewActor; SMESH_Actor* myMeshActor; bool myBusy; + + QString myHelpFileName; }; #endif // DIALOGBOX_MOVE_NODES_H diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index 74ad155bd..045ae5a17 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -43,14 +43,18 @@ #include "SUIT_ResourceMgr.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" #include "LightApp_SelectionMgr.h" +#include "LightApp_Application.h" #include "SALOME_ListIO.hxx" #include "SALOME_ListIteratorOfListIO.hxx" #include "SVTK_Selector.h" #include "SVTK_ViewModel.h" #include "SVTK_ViewWindow.h" +#include "VTKViewer_CellLocationsArray.h" // OCCT Includes #include @@ -65,7 +69,6 @@ #include #include #include -#include #include #include #include @@ -233,6 +236,7 @@ QFrame* SMESHGUI_MultiEditDlg::createButtonFrame (QWidget* theParent) myOkBtn = new QPushButton (tr("SMESH_BUT_OK" ), aFrame); myApplyBtn = new QPushButton (tr("SMESH_BUT_APPLY"), aFrame); myCloseBtn = new QPushButton (tr("SMESH_BUT_CLOSE"), aFrame); + myHelpBtn = new QPushButton (tr("SMESH_BUT_HELP"), aFrame); QSpacerItem* aSpacer = new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); @@ -242,6 +246,7 @@ QFrame* SMESHGUI_MultiEditDlg::createButtonFrame (QWidget* theParent) aLay->addWidget(myApplyBtn); aLay->addItem(aSpacer); aLay->addWidget(myCloseBtn); + aLay->addWidget(myHelpBtn); return aFrame; } @@ -333,6 +338,7 @@ void SMESHGUI_MultiEditDlg::Init() connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); + connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); // selection and SMESHGUI connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); @@ -388,6 +394,35 @@ SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds() anActor = myActor; if (anActor != 0) { + // skl 07.02.2006 + SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh(); + if( myFilterType == SMESHGUI_TriaFilter || + myFilterType == SMESHGUI_QuadFilter || + myFilterType == SMESHGUI_FaceFilter ) { + SMDS_FaceIteratorPtr it = aMesh->facesIterator(); + while(it->more()) { + const SMDS_MeshFace* f = it->next(); + if(myFilterType == SMESHGUI_FaceFilter) { + myIds.Add(f->GetID()); + } + else if( myFilterType==SMESHGUI_TriaFilter && + ( f->NbNodes()==3 || f->NbNodes()==6 ) ) { + myIds.Add(f->GetID()); + } + else if( myFilterType==SMESHGUI_QuadFilter && + ( f->NbNodes()==4 || f->NbNodes()==8 ) ) { + myIds.Add(f->GetID()); + } + } + } + else if(myFilterType == SMESHGUI_VolumeFilter) { + SMDS_VolumeIteratorPtr it = aMesh->volumesIterator(); + while(it->more()) { + const SMDS_MeshVolume* f = it->next(); + myIds.Add(f->GetID()); + } + } + /* commented by skl 07.02.2006 TVisualObjPtr aVisualObj = anActor->GetObject(); vtkUnstructuredGrid* aGrid = aVisualObj->GetUnstructuredGrid(); if (aGrid != 0) { @@ -411,6 +446,7 @@ SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds() } } } + */ } } @@ -444,6 +480,23 @@ void SMESHGUI_MultiEditDlg::onClose() reject(); } +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_MultiEditDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= // name : SMESHGUI_MultiEditDlg::onSelectionDone // Purpose : SLOT called when selection changed @@ -1004,6 +1057,7 @@ SMESHGUI_ChangeOrientationDlg SMESHGUI_MultiEditDlg(theModule, SMESHGUI_FaceFilter, true, theName) { setCaption(tr("CAPTION")); + myHelpFileName = "/files/changing_orientation_of_elements.htm"; } SMESHGUI_ChangeOrientationDlg::~SMESHGUI_ChangeOrientationDlg() @@ -1042,6 +1096,8 @@ SMESHGUI_UnionOfTrianglesDlg myMaxAngleSpin->SetValue(30.0); myCriterionGrp->show(); + + myHelpFileName = "/files/uniting_a_set_of_triangles.htm"; } SMESHGUI_UnionOfTrianglesDlg::~SMESHGUI_UnionOfTrianglesDlg() @@ -1080,6 +1136,8 @@ SMESHGUI_CuttingOfQuadsDlg connect(myGroupChoice , SIGNAL(clicked(int)) , this, SLOT(onCriterionRB())); connect(myComboBoxFunctor, SIGNAL(activated(int)) , this, SLOT(onPreviewChk())); connect(this , SIGNAL(ListContensChanged()), this, SLOT(onPreviewChk())); + + myHelpFileName = "/files/cutting_quadrangles.htm"; } SMESHGUI_CuttingOfQuadsDlg::~SMESHGUI_CuttingOfQuadsDlg() @@ -1262,7 +1320,7 @@ void SMESHGUI_CuttingOfQuadsDlg::displayPreview() } } - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbCells); diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h index 81c31d632..dcd54c04f 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -88,6 +88,7 @@ protected slots: void onOk(); virtual bool onApply(); virtual void onClose(); + void onHelp(); void onDeactivate(); void onSelectionDone(); @@ -123,6 +124,7 @@ protected: QPushButton* myOkBtn; QPushButton* myApplyBtn; QPushButton* myCloseBtn; + QPushButton* myHelpBtn; SMESH_Actor* myActor; SMESH::SMESH_Mesh_var myMesh; @@ -158,6 +160,8 @@ protected: int myFilterType; bool myBusy; int myEntityType; + + QString myHelpFileName; }; /*! diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx index 4018e63fc..98348feca 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -49,10 +49,12 @@ #include "SUIT_Desktop.h" #include "SalomeApp_Study.h" +#include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" #include "SVTK_Selector.h" #include "SVTK_ViewWindow.h" +#include "VTKViewer_CellLocationsArray.h" #include "SALOME_Actor.h" #include "SALOME_ListIO.hxx" @@ -62,7 +64,6 @@ // VTK Includes #include #include -#include #include #include #include @@ -147,7 +148,7 @@ namespace SMESH { aCells->InsertNextCell(anIdList); aCellTypesArray->InsertNextValue(VTK_VERTEX); - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(1); @@ -178,11 +179,11 @@ namespace SMESH { vtkProperty* aProp = vtkProperty::New(); aProp->SetRepresentationToPoints(); - float anRGB[3]; + vtkFloatingPointType anRGB[3]; GetColor( "SMESH", "node_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 0 ) ); aProp->SetColor( anRGB[0], anRGB[1], anRGB[2] ); - float aPointSize = GetFloat( "SMESH:node_size", 3 ); + vtkFloatingPointType aPointSize = GetFloat( "SMESH:node_size", 3 ); aProp->SetPointSize( aPointSize ); myPreviewActor->SetProperty( aProp ); @@ -256,6 +257,10 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg (SMESHGUI* theModule, GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton(GroupButtons, "buttonCancel"); buttonCancel->setText(tr("SMESH_BUT_CLOSE" )); buttonCancel->setAutoDefault(TRUE); @@ -325,6 +330,8 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg (SMESHGUI* theModule, SMESHGUI_NodesDlgLayout->addWidget(GroupCoordinates, 1, 0); + myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_nodes"; + /* Initialisation and display */ Init(); } @@ -364,6 +371,7 @@ void SMESHGUI_NodesDlg::Init () connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(SpinBox_X, SIGNAL (valueChanged(double)), SLOT(ValueChangedInSpinBox(double))); connect(SpinBox_Y, SIGNAL (valueChanged(double)), SLOT(ValueChangedInSpinBox(double))); @@ -374,10 +382,6 @@ void SMESHGUI_NodesDlg::Init () /* to close dialog if study frame change */ connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel())); - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); // set selection mode @@ -479,6 +483,23 @@ void SMESHGUI_NodesDlg::ClickOnCancel() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_NodesDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection as changed or other case diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.h b/src/SMESHGUI/SMESHGUI_NodesDlg.h index a3339ce8c..924d39237 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.h +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -103,12 +103,16 @@ private: QPushButton* buttonApply; QPushButton* buttonOk; QPushButton* buttonCancel; + QPushButton* buttonHelp; + + QString myHelpFileName; private slots: void ClickOnOk(); void ClickOnCancel(); bool ClickOnApply(); + void ClickOnHelp(); void DeactivateActiveDialog() ; void ActivateThisDialog() ; void SelectionIntoArgument() ; diff --git a/src/SMESHGUI/SMESHGUI_Operation.cxx b/src/SMESHGUI/SMESHGUI_Operation.cxx index 562f4da80..8b62c6323 100755 --- a/src/SMESHGUI/SMESHGUI_Operation.cxx +++ b/src/SMESHGUI/SMESHGUI_Operation.cxx @@ -1,8 +1,22 @@ -// SALOME SMESHGUI -// -// Copyright (C) 2005 CEA/DEN, EDF R&D -// +// SMESH SMDS : implementaion of Salome mesh data structure // +// Copyright (C) 2003 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 : SMESHGUI_Operation.h // Author : Sergey LITONIN @@ -13,7 +27,9 @@ #include #include +#include +#include #include #include @@ -31,6 +47,7 @@ SMESHGUI_Operation::SMESHGUI_Operation() : LightApp_Operation() { + myHelpFileName = ""; } //======================================================================= @@ -62,6 +79,7 @@ void SMESHGUI_Operation::startOperation() disconnect( dlg(), SIGNAL( dlgApply() ), this, SLOT( onApply() ) ); disconnect( dlg(), SIGNAL( dlgCancel() ), this, SLOT( onCancel() ) ); disconnect( dlg(), SIGNAL( dlgClose() ), this, SLOT( onCancel() ) ); + disconnect( dlg(), SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) ); if( dlg()->testButtonFlags( QtxDialog::OK ) ) connect( dlg(), SIGNAL( dlgOk() ), this, SLOT( onOk() ) ); @@ -71,6 +89,9 @@ void SMESHGUI_Operation::startOperation() if( dlg()->testButtonFlags( QtxDialog::Cancel ) ) connect( dlg(), SIGNAL( dlgCancel() ), this, SLOT( onCancel() ) ); + + if( dlg()->testButtonFlags( QtxDialog::Help ) ) + connect( dlg(), SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) ); //if( dlg()->testButtonFlags( QtxDialog::Close ) ) //if dialog hasn't close, cancel, no and etc buttons, dlgClose will be emitted when dialog is closed not by OK @@ -134,8 +155,8 @@ void SMESHGUI_Operation::onOk() { if( onApply() ) commit(); - else - abort(); + //else + // abort(); } //======================================================================= @@ -156,6 +177,23 @@ void SMESHGUI_Operation::onCancel() abort(); } +//======================================================================= +// name : onHelp +// Purpose : +//======================================================================= +void SMESHGUI_Operation::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(getSMESHGUI() ? app->moduleName(getSMESHGUI()->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= // name : initDialog // Purpose : diff --git a/src/SMESHGUI/SMESHGUI_Operation.h b/src/SMESHGUI/SMESHGUI_Operation.h index cf8ce7f0e..4b3aeaf96 100755 --- a/src/SMESHGUI/SMESHGUI_Operation.h +++ b/src/SMESHGUI/SMESHGUI_Operation.h @@ -1,8 +1,22 @@ -// SALOME SMESHGUI -// -// Copyright (C) 2005 CEA/DEN, EDF R&D -// +// SMESH SMDS : implementaion of Salome mesh data structure // +// Copyright (C) 2003 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 : SMESHGUI_Operation.h // Author : Sergey LITONIN @@ -49,10 +63,13 @@ protected: virtual bool isValid( SUIT_Operation* ) const; + QString myHelpFileName; + protected slots: virtual void onOk(); virtual bool onApply(); virtual void onCancel(); + void onHelp(); }; #endif diff --git a/src/SMESHGUI/SMESHGUI_PatternUtils.cxx b/src/SMESHGUI/SMESHGUI_PatternUtils.cxx index 718162f2b..9a63ae39a 100644 --- a/src/SMESHGUI/SMESHGUI_PatternUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_PatternUtils.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "SMESHGUI_PatternUtils.h" diff --git a/src/SMESHGUI/SMESHGUI_PatternUtils.h b/src/SMESHGUI/SMESHGUI_PatternUtils.h index f3bc58c09..b466a4b47 100644 --- a/src/SMESHGUI/SMESHGUI_PatternUtils.h +++ b/src/SMESHGUI/SMESHGUI_PatternUtils.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef SMESHGUI_PatternUtils_HeaderFile #define SMESHGUI_PatternUtils_HeaderFile diff --git a/src/SMESHGUI/SMESHGUI_PatternWidget.cxx b/src/SMESHGUI/SMESHGUI_PatternWidget.cxx index 178800a62..8deafd0eb 100644 --- a/src/SMESHGUI/SMESHGUI_PatternWidget.cxx +++ b/src/SMESHGUI/SMESHGUI_PatternWidget.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESHGUI_PatternWidget.h b/src/SMESHGUI/SMESHGUI_PatternWidget.h index 2319d2f18..69e66917b 100644 --- a/src/SMESHGUI/SMESHGUI_PatternWidget.h +++ b/src/SMESHGUI/SMESHGUI_PatternWidget.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESHGUI_PrecisionDlg.cxx b/src/SMESHGUI/SMESHGUI_PrecisionDlg.cxx deleted file mode 100755 index b589e15d3..000000000 --- a/src/SMESHGUI/SMESHGUI_PrecisionDlg.cxx +++ /dev/null @@ -1,202 +0,0 @@ -// SMESH SMESHGUI : GUI for SMESH component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SMESHGUI_PrecisionDlg.cxx -// Author : Sergey LITONIN -// Module : SMESH - -#include "SMESHGUI_PrecisionDlg.h" - -#include "SMESHGUI.h" -#include "SMESHGUI_VTKUtils.h" -#include "SMESHGUI_Utils.h" - -#include "SUIT_Desktop.h" -#include "SUIT_ResourceMgr.h" - -#include -#include -#include -#include -#include -#include - -#define SPACING 5 -#define MARGIN 10 -#define DEFAULT_VAL 10 -#define RANGE 128 - -/*! - * Class : SMESHGUI_PrecisionDlg - * Description : Dialog to specify precision of mesh quality controls - */ - -//======================================================================= -// name : SMESHGUI_PrecisionDlg::SMESHGUI_PrecisionDlg -// Purpose : Constructor -//======================================================================= -SMESHGUI_PrecisionDlg::SMESHGUI_PrecisionDlg ( SMESHGUI* theModule ) - : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_PrecisionDlg", true, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ), - mySMESHGUI( theModule ) -{ - setCaption(tr("CAPTION")); - - QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING); - - QFrame* aMainFrame = createMainFrame (this); - QFrame* aBtnFrame = createButtonFrame(this); - - aDlgLay->addWidget(aMainFrame); - aDlgLay->addWidget(aBtnFrame); - - aDlgLay->setStretchFactor(aMainFrame, 1); - - setMinimumWidth((int)(QFontMetrics(font()).width(tr("CAPTION")) * 1.5)); - - Init(); -} - -//======================================================================= -// name : SMESHGUI_PrecisionDlg::~SMESHGUI_PrecisionDlg -// Purpose : Destructor -//======================================================================= -SMESHGUI_PrecisionDlg::~SMESHGUI_PrecisionDlg() -{ -} - -//======================================================================= -// name : SMESHGUI_PrecisionDlg::createButtonFrame -// Purpose : Create frame containing buttons -//======================================================================= -QFrame* SMESHGUI_PrecisionDlg::createButtonFrame (QWidget* theParent) -{ - QGroupBox* aGrp = new QGroupBox (1, Qt::Vertical, theParent); - aGrp->setFrameStyle(QFrame::NoFrame); - aGrp->setInsideMargin(0); - - myOKBtn = new QPushButton (tr("SMESH_BUT_OK"), aGrp); - - QLabel* aLbl = new QLabel (aGrp); - aLbl->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - - myCancelBtn = new QPushButton (tr("SMESH_BUT_CANCEL"), aGrp); - - connect(myOKBtn, SIGNAL(clicked()), SLOT(onOk())); - connect(myCancelBtn, SIGNAL(clicked()), SLOT(onClose())); - - return aGrp; -} - -//======================================================================= -// name : SMESHGUI_PrecisionDlg:: createMainFrame -// Purpose : Create frame containing dialog's input fields -//======================================================================= -QFrame* SMESHGUI_PrecisionDlg::createMainFrame (QWidget* theParent) -{ - QGroupBox* aGrp = new QGroupBox(2, Qt::Horizontal, theParent); - new QLabel (tr("PRECISION"), aGrp); - mySpinBox = new QSpinBox (0, RANGE, 1, aGrp); - myNotUseChk = new QCheckBox (tr("NOT_USE"), aGrp); - - connect(myNotUseChk, SIGNAL(toggled(bool)), SLOT(onNotUse())); - - return aGrp; -} - -//======================================================================= -// name : SMESHGUI_PrecisionDlg::Init -// Purpose : Initialize dialog fields -//======================================================================= -void SMESHGUI_PrecisionDlg::Init() -{ - bool isOk = false; - int aVal = DEFAULT_VAL; - SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); - if (mgr && mgr->hasValue("SMESH", "controls_precision")) { - QString aStr = mgr->stringValue("SMESH", "controls_precision"); - aVal = aStr.toInt(&isOk); - } - - mySpinBox->setValue(isOk ? aVal : DEFAULT_VAL); - myNotUseChk->setChecked(!isOk); - - onNotUse(); - - mySMESHGUI->SetActiveDialogBox((QDialog*)this); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); -} - -//======================================================================= -// name : SMESHGUI_PrecisionDlg::onOk -// Purpose : SLOT. Called when OK button pressed -//======================================================================= -void SMESHGUI_PrecisionDlg::onOk() -{ - SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); - if (myNotUseChk->isChecked()) { - if (mgr) { - mgr->remove("SMESH", "controls_precision"); - } - SMESH::SetControlsPrecision(-1); - } else { - mySpinBox->clearFocus(); - int aVal = mySpinBox->value(); - if (mgr) { - mgr->setValue("SMESH", "controls_precision", QString("%1").arg(aVal)); - } - SMESH::SetControlsPrecision(aVal); - } - - disconnect(mySMESHGUI, 0, this, 0); - mySMESHGUI->ResetState() ; - accept(); -} - -//======================================================================= -// name : SMESHGUI_PrecisionDlg::onClose -// Purpose : SLOT. Called when "Cancel" button pressed -//======================================================================= -void SMESHGUI_PrecisionDlg::onClose() -{ - disconnect( mySMESHGUI, 0, this, 0); - reject(); -} - -//======================================================================= -// name : SMESHGUI_PrecisionDlg::closeEvent -// Purpose : -//======================================================================= -void SMESHGUI_PrecisionDlg::closeEvent (QCloseEvent*) -{ - onClose(); -} - -//======================================================================= -// name : SMESHGUI_PrecisionDlg::onNotUse -// Purpose : SLOT. Called when state of "Do not use" check box changed -//======================================================================= -void SMESHGUI_PrecisionDlg::onNotUse() -{ - mySpinBox->setEnabled(!myNotUseChk->isChecked()); -} diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx b/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx index d51137871..5028ed064 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -199,11 +199,6 @@ void SMESHGUI_Preferences_ColorDlg::Init() connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); /* to close dialog if study change */ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); } //================================================================================= diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h b/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h index 51d5c759b..850dde89a 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h +++ b/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx index e06f880b9..b17a523eb 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -58,21 +58,12 @@ #include #include -#include +#include #define MINIMUM_WIDTH 70 #define MARGIN_SIZE 11 #define SPACING_SIZE 6 -#define DEF_VER_X 0.01 -#define DEF_VER_Y 0.10 -#define DEF_VER_H 0.80 -#define DEF_VER_W 0.10 -#define DEF_HOR_X 0.20 -#define DEF_HOR_Y 0.01 -#define DEF_HOR_H 0.12 -#define DEF_HOR_W 0.60 - using namespace std; // Only one instance is allowed @@ -125,6 +116,14 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI* mySMESHGUI( theModule ), mySelectionMgr( property ? SMESH::GetSelectionMgr( theModule ) : 0 ) { + DEF_VER_X = 0.01; + DEF_VER_Y = 0.10; + DEF_VER_H = 0.80; + DEF_VER_W = 0.10; + DEF_HOR_X = 0.20; + DEF_HOR_Y = 0.01; + DEF_HOR_H = 0.12; + DEF_HOR_W = 0.60; setName("SMESHGUI_Preferences_ScalarBarDlg"); setCaption( property ? tr("SMESH_PROPERTIES_SCALARBAR") : tr("SMESH_PREFERENCES_SCALARBAR")); setSizeGripEnabled(TRUE); @@ -521,7 +520,11 @@ bool SMESHGUI_Preferences_ScalarBarDlg::onApply() double aMin = myMinEdit->text().toDouble(); double aMax = myMaxEdit->text().toDouble(); - myScalarBarActor->GetLookupTable()->SetRange( aMin, aMax ); + vtkLookupTable* myLookupTable = + static_cast(myScalarBarActor->GetLookupTable()); + myLookupTable->SetRange( aMin, aMax ); + myLookupTable->SetNumberOfTableValues(myColorsSpin->value()); + myLookupTable->Build(); SMESH::RepaintCurrentView(); } else { // Scalar Bar preferences @@ -637,13 +640,13 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged() vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor(); if ( myScalarBarActor->GetLookupTable() ) { - float *range = myScalarBarActor->GetLookupTable()->GetRange(); - myMinEdit->setText( QString::number( range[0] ) ); - myMaxEdit->setText( QString::number( range[1] ) ); + vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange(); + myMinEdit->setText( QString::number( range[0],'g',12 ) ); + myMaxEdit->setText( QString::number( range[1],'g',12 ) ); } vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty(); - float aTColor[3]; + vtkFloatingPointType aTColor[3]; aTitleTextPrp->GetColor( aTColor ); myTitleColorBtn->setPaletteBackgroundColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) ); myTitleFontCombo->setCurrentItem( aTitleTextPrp->GetFontFamily() ); @@ -652,7 +655,7 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged() myTitleShadowCheck->setChecked( aTitleTextPrp->GetShadow() ); vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty(); - float aLColor[3]; + vtkFloatingPointType aLColor[3]; aLabelsTextPrp->GetColor( aLColor ); myLabelsColorBtn->setPaletteBackgroundColor( QColor( (int)( aLColor[0]*255 ), (int)( aLColor[1]*255 ), (int)( aLColor[2]*255 ) ) ); myLabelsFontCombo->setCurrentItem( aLabelsTextPrp->GetFontFamily() ); @@ -756,6 +759,8 @@ void SMESHGUI_Preferences_ScalarBarDlg::setOriginAndSize( const double x, //================================================================================================= void SMESHGUI_Preferences_ScalarBarDlg::onOrientationChanged() { + this->initScalarBarFromResources(); + int aOrientation = myVertRadioBtn->isChecked(); if ( aOrientation == myIniOrientation ) setOriginAndSize( myIniX, myIniY, myIniW, myIniH ); @@ -765,3 +770,41 @@ void SMESHGUI_Preferences_ScalarBarDlg::onOrientationChanged() aOrientation ? DEF_VER_W : DEF_HOR_W, aOrientation ? DEF_VER_H : DEF_HOR_H ); } + +//================================================================================================= +/*! + * SMESHGUI_Preferences_ScalarBarDlg::initScalarBarFromResources() + * + * Rereading vertical and horizontal default positions from resources. + */ +//================================================================================================= +void SMESHGUI_Preferences_ScalarBarDlg::initScalarBarFromResources() +{ + SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); + QString name; + if (mgr){ + // initialize from resoources + + // horizontal + name = QString("scalar_bar_horizontal_%1"); + if (mgr->hasValue("SMESH", name.arg( "x" ))) + DEF_HOR_X = mgr->doubleValue("SMESH", name.arg( "x" )); + if (mgr->hasValue("SMESH", name.arg( "y" ))) + DEF_HOR_Y = mgr->doubleValue("SMESH", name.arg( "y" )); + if (mgr->hasValue("SMESH", name.arg( "width" ))) + DEF_HOR_W = mgr->doubleValue("SMESH", name.arg( "width" )); + if (mgr->hasValue("SMESH", name.arg( "height" ))) + DEF_HOR_H = mgr->doubleValue("SMESH", name.arg( "height" )); + + // vertical + name = QString("scalar_bar_vertical_%1"); + if (mgr->hasValue("SMESH", name.arg( "x" ))) + DEF_VER_X = mgr->doubleValue("SMESH", name.arg( "x" )); + if (mgr->hasValue("SMESH", name.arg( "y" ))) + DEF_VER_Y = mgr->doubleValue("SMESH", name.arg( "y" )); + if (mgr->hasValue("SMESH", name.arg( "width" ))) + DEF_VER_W = mgr->doubleValue("SMESH", name.arg( "width" )); + if (mgr->hasValue("SMESH", name.arg( "height" ))) + DEF_VER_H = mgr->doubleValue("SMESH", name.arg( "height" )); + } +} diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h index e20dd2be7..78950f7cd 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h +++ b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -65,6 +65,7 @@ protected: static SMESHGUI_Preferences_ScalarBarDlg* myDlg; void closeEvent( QCloseEvent* e ); void setOriginAndSize( const double x, const double y, const double w, const double h ); + void initScalarBarFromResources(); protected slots: void onOk(); @@ -82,6 +83,8 @@ private: SMESH_Actor* myActor; double myIniX, myIniY, myIniW, myIniH; int myIniOrientation; + double DEF_VER_X,DEF_VER_Y,DEF_VER_H,DEF_VER_W; + double DEF_HOR_X,DEF_HOR_Y,DEF_HOR_H,DEF_HOR_W; QGroupBox* myRangeGrp; QLineEdit* myMinEdit; diff --git a/src/SMESHGUI/SMESHGUI_Preferences_SelectionDlg.cxx b/src/SMESHGUI/SMESHGUI_Preferences_SelectionDlg.cxx index 7606ccf2b..41d96be2d 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_SelectionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Preferences_SelectionDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -205,11 +205,6 @@ SMESHGUI_Preferences_SelectionDlg::SMESHGUI_Preferences_SelectionDlg( SMESHGUI* connect(aOKBtn, SIGNAL(clicked()), this, SLOT(accept())); connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(reject())); - - /* Move widget on the botton right corner of main widget */ - int x, y ; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); } //================================================================================= diff --git a/src/SMESHGUI/SMESHGUI_Preferences_SelectionDlg.h b/src/SMESHGUI/SMESHGUI_Preferences_SelectionDlg.h index b1556d114..96715d782 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_SelectionDlg.h +++ b/src/SMESHGUI/SMESHGUI_Preferences_SelectionDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platorm.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx index ef6dfa0d2..400d47add 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -39,6 +39,8 @@ #include "SUIT_ResourceMgr.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" #include "SVTK_Selector.h" #include "SVTK_ViewModel.h" @@ -46,6 +48,7 @@ #include "SALOME_ListIO.hxx" #include "SalomeApp_Tools.h" +#include "LightApp_Application.h" #include "utilities.h" // OCCT Includes @@ -131,6 +134,10 @@ SMESHGUI_RemoveElementsDlg GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton(GroupButtons, "buttonCancel"); buttonCancel->setText(tr("SMESH_BUT_CLOSE" )); buttonCancel->setAutoDefault(TRUE); @@ -177,6 +184,8 @@ SMESHGUI_RemoveElementsDlg GroupC1Layout->addWidget(LineEditC1A1, 0, 2); SMESHGUI_RemoveElementsDlgLayout->addWidget(GroupC1, 1, 0); + myHelpFileName = "/files/removing_nodes_and_elements.htm#remove_an_element"; + Init(); /* Initialisations */ } @@ -209,6 +218,7 @@ void SMESHGUI_RemoveElementsDlg::Init() connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int))); connect(SelectButtonC1A1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); @@ -219,10 +229,6 @@ void SMESHGUI_RemoveElementsDlg::Init() connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); /* displays Dialog */ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) @@ -300,6 +306,23 @@ void SMESHGUI_RemoveElementsDlg::ClickOnCancel() return; } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_RemoveElementsDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= //function : onTextChange //purpose : diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h index 89d42292a..11aa09ea5 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -96,17 +96,21 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; QGroupBox* GroupC1; QLabel* TextLabelC1A1; QPushButton* SelectButtonC1A1; QLineEdit* LineEditC1A1; + QString myHelpFileName; + private slots: void ConstructorsClicked(int constructorId); void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); void SetEditCurrentArgument() ; void SelectionIntoArgument() ; void DeactivateActiveDialog() ; diff --git a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx index 775bff01a..db0d13e6c 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -39,6 +39,10 @@ #include "SUIT_ResourceMgr.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" + +#include "LightApp_Application.h" #include "SVTK_Selector.h" #include "SVTK_ViewModel.h" @@ -130,6 +134,10 @@ SMESHGUI_RemoveNodesDlg GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton(GroupButtons, "buttonCancel"); buttonCancel->setText(tr("SMESH_BUT_CLOSE" )); buttonCancel->setAutoDefault(TRUE); @@ -176,6 +184,8 @@ SMESHGUI_RemoveNodesDlg GroupC1Layout->addWidget(LineEditC1A1, 0, 2); SMESHGUI_RemoveNodesDlgLayout->addWidget(GroupC1, 1, 0); + myHelpFileName = "/files/removing_nodes_and_elements.htm#remove_a_node"; + Init(); /* Initialisations */ } @@ -208,6 +218,7 @@ void SMESHGUI_RemoveNodesDlg::Init() connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int))); connect(SelectButtonC1A1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); @@ -218,10 +229,6 @@ void SMESHGUI_RemoveNodesDlg::Init() connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); /* displays Dialog */ SMESH::SetPointRepresentation(true); @@ -298,6 +305,23 @@ void SMESHGUI_RemoveNodesDlg::ClickOnCancel() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_RemoveNodesDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= //function : onTextChange //purpose : diff --git a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h index 363be9f63..343d22721 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h +++ b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -99,17 +99,21 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; QGroupBox* GroupC1; QLabel* TextLabelC1A1; QPushButton* SelectButtonC1A1; QLineEdit* LineEditC1A1; + QString myHelpFileName; + private slots: void ConstructorsClicked(int constructorId); void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); void SetEditCurrentArgument() ; void SelectionIntoArgument() ; void DeactivateActiveDialog() ; diff --git a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx index fcecbbef2..4e4f75a83 100644 --- a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -38,6 +38,9 @@ #include "SUIT_Desktop.h" #include "SUIT_Session.h" +#include "SUIT_MessageBox.h" + +#include "LightApp_Application.h" #include "SALOME_ListIO.hxx" @@ -92,10 +95,14 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const cha /***************************************************************/ GroupConstructors = new QButtonGroup(this, "GroupConstructors"); - if (unit == 0) + if (unit == 0) { GroupConstructors->setTitle(tr("SMESH_NODES" )); - else if (unit == 1) + myHelpFileName = "/files/renumbering_nodes_and_elements.htm#renumber_nodes"; + } + else if (unit == 1) { GroupConstructors->setTitle(tr("SMESH_ELEMENTS" )); + myHelpFileName = "/files/renumbering_nodes_and_elements.htm#renumber_elements"; + } GroupConstructors->setExclusive(TRUE); GroupConstructors->setColumnLayout(0, Qt::Vertical); GroupConstructors->layout()->setSpacing(0); @@ -126,6 +133,10 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const cha GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton(GroupButtons, "buttonCancel"); buttonCancel->setText(tr("SMESH_BUT_CLOSE" )); buttonCancel->setAutoDefault(TRUE); @@ -203,6 +214,7 @@ void SMESHGUI_RenumberingDlg::Init() connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int))); connect(SelectButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); @@ -211,10 +223,6 @@ void SMESHGUI_RenumberingDlg::Init() /* to close dialog if study change */ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); /* displays Dialog */ myEditCurrentArgument = LineEditMesh; @@ -302,6 +310,23 @@ void SMESHGUI_RenumberingDlg::ClickOnCancel() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_RenumberingDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection as changed or other case diff --git a/src/SMESHGUI/SMESHGUI_RenumberingDlg.h b/src/SMESHGUI/SMESHGUI_RenumberingDlg.h index 241e7a22c..a60ec6fc2 100644 --- a/src/SMESHGUI/SMESHGUI_RenumberingDlg.h +++ b/src/SMESHGUI/SMESHGUI_RenumberingDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -91,10 +91,13 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; QGroupBox* GroupMesh; QLabel* TextLabelMesh; QPushButton* SelectButton; QLineEdit* LineEditMesh; + + QString myHelpFileName; private slots: @@ -102,6 +105,7 @@ private slots: void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); void SetEditCurrentArgument() ; void SelectionIntoArgument() ; void DeactivateActiveDialog() ; diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index 2722e4f40..46e23659e 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -41,6 +41,10 @@ #include "SMDS_Mesh.hxx" #include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" + +#include "LightApp_Application.h" #include "SVTK_ViewModel.h" #include "SVTK_ViewWindow.h" @@ -131,6 +135,10 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule, const char* GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton(GroupButtons, "buttonCancel"); buttonCancel->setText(tr("SMESH_BUT_CLOSE" )); buttonCancel->setAutoDefault(TRUE); @@ -311,12 +319,15 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule, const char* myMeshOrSubMeshOrGroupFilter = new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR); + myHelpFileName = "revolution.htm"; + Init(); /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int))); connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); @@ -334,10 +345,6 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule, const char* connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); /* displays Dialog */ ConstructorsClicked(0); @@ -503,6 +510,23 @@ void SMESHGUI_RevolutionDlg::ClickOnCancel() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_RevolutionDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= // function : onTextChange() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.h b/src/SMESHGUI/SMESHGUI_RevolutionDlg.h index 77639c8b5..8dd89fcab 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.h +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -102,6 +102,7 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; QGroupBox* GroupArguments; QGroupBox* GroupAxis; QLabel* TextLabelElements; @@ -133,12 +134,15 @@ private: QLabel* TextLabelTolerance; SMESHGUI_SpinBox* SpinBox_Tolerance; + QString myHelpFileName; + private slots: void ConstructorsClicked (int constructorId); void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); void SetEditCurrentArgument(); void SelectionIntoArgument(); void DeactivateActiveDialog(); diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index baf1359ce..34efe7fc6 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -42,6 +42,9 @@ #include "SUIT_Desktop.h" #include "SUIT_Session.h" +#include "SUIT_MessageBox.h" + +#include "LightApp_Application.h" #include "SVTK_ViewModel.h" #include "SVTK_ViewWindow.h" @@ -136,6 +139,10 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule, const char* nam GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton(GroupButtons, "buttonCancel"); buttonCancel->setText(tr("SMESH_BUT_CLOSE")); buttonCancel->setAutoDefault(TRUE); @@ -300,12 +307,15 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule, const char* nam myMeshOrSubMeshOrGroupFilter = new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR); + myHelpFileName = "/files/rotation.htm"; + Init(); /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int))); connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); @@ -323,10 +333,6 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule, const char* nam connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); /* displays Dialog */ ConstructorsClicked(0); @@ -456,6 +462,23 @@ void SMESHGUI_RotationDlg::ClickOnCancel() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_RotationDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= // function : onTextChange() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.h b/src/SMESHGUI/SMESHGUI_RotationDlg.h index 2ba7fd42f..95cd97688 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.h +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -100,6 +100,7 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; QGroupBox* GroupArguments; QGroupBox* GroupAxis; QLabel* TextLabelElements; @@ -128,12 +129,15 @@ private: SMESHGUI_SpinBox* SpinBox_Angle; QCheckBox* CheckBoxCopy; + QString myHelpFileName; + private slots: void ConstructorsClicked (int constructorId); void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); void SetEditCurrentArgument(); void SelectionIntoArgument(); void DeactivateActiveDialog(); diff --git a/src/SMESHGUI/SMESHGUI_SMESHGenUtils.cxx b/src/SMESHGUI/SMESHGUI_SMESHGenUtils.cxx index ddfe9fbd8..b215ee1d7 100644 --- a/src/SMESHGUI/SMESHGUI_SMESHGenUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_SMESHGenUtils.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "QAD_Desktop.h" diff --git a/src/SMESHGUI/SMESHGUI_SMESHGenUtils.h b/src/SMESHGUI/SMESHGUI_SMESHGenUtils.h index 54a8d4374..8f7c2a075 100644 --- a/src/SMESHGUI/SMESHGUI_SMESHGenUtils.h +++ b/src/SMESHGUI/SMESHGUI_SMESHGenUtils.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef SMESHGUI_SMESHGenUtils_HeaderFile #define SMESHGUI_SMESHGenUtils_HeaderFile diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index 88d44c541..7602c410b 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SMESHGUI_Selection.h" @@ -110,7 +110,7 @@ QtxValue SMESHGUI_Selection::param( const int ind, const QString& p ) const else if ( p=="hasReference" ) val = QtxValue( hasReference( ind ) ); // else if ( p=="isVisible" ) val = QtxValue( isVisible( ind ) ); - // printf( "--> param() : [%s] = %s (%s)\n", p.latin1(), val.toString().latin1(), val.typeName() ); + // printf( "--> param() : [%s] = %s (%s)\n", p.latin1(), val.toString().latin1(), val.typeName() ); //if ( val.type() == QVariant::List ) //cout << "size: " << val.toList().count() << endl; @@ -293,7 +293,7 @@ QVariant SMESHGUI_Selection::isComputable( int ind ) const if ( !io.IsNull() ) { SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io) ; // m,sm,gr->m if ( !mesh->_is_nil() ) {*/ - _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ) ); + _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).latin1() ); //FindSObject( mesh ); if ( so ) { GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so ); @@ -401,6 +401,8 @@ int SMESHGUI_Selection::type( const QString& entry, _PTR(Study) study ) } if( aFTag>10 ) res = GROUP; + else + res = SUBMESH; break; } diff --git a/src/SMESHGUI/SMESHGUI_Selection.h b/src/SMESHGUI/SMESHGUI_Selection.h index bc22d7240..6dd5bc271 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.h +++ b/src/SMESHGUI/SMESHGUI_Selection.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx index 1111be407..2e620f71c 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx +++ b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -67,11 +67,7 @@ SMESHGUI_SelectionOp::SMESHGUI_SelectionOp( const Selection_Mode mode ) //================================================================================= SMESHGUI_SelectionOp::~SMESHGUI_SelectionOp() { - Filters::const_iterator anIt = myFilters.begin(), - aLast = myFilters.end(); - for( ; anIt!=aLast; anIt++ ) - if( anIt.data() ) - delete anIt.data(); + removeCustomFilters(); } //================================================================================= @@ -80,6 +76,9 @@ SMESHGUI_SelectionOp::~SMESHGUI_SelectionOp() //================================================================================= void SMESHGUI_SelectionOp::startOperation() { + myOldSelectionMode = selectionMode(); + setSelectionMode( myDefSelectionMode ); + SMESHGUI_Operation::startOperation(); if( dlg() ) { @@ -90,26 +89,27 @@ void SMESHGUI_SelectionOp::startOperation() connect( dlg(), SIGNAL( objectDeactivated( int ) ), this, SLOT( onDeactivateObject( int ) ) ); connect( dlg(), SIGNAL( selectionChanged( int ) ), this, SLOT( onSelectionChanged( int ) ) ); } - - myOldSelectionMode = selectionMode(); - setSelectionMode( myDefSelectionMode ); } //================================================================================= // name : removeCustomFilters // purpose : //================================================================================= -void SMESHGUI_SelectionOp::removeCustomFilters() const +void SMESHGUI_SelectionOp::removeCustomFilters() { - LightApp_SelectionMgr* mgr = selectionMgr(); - if( !mgr ) - return; - - Filters::const_iterator anIt = myFilters.begin(), - aLast = myFilters.end(); - for( ; anIt!=aLast; anIt++ ) - if( anIt.data() ) - mgr->removeFilter( anIt.data() ); + if (myFilters.count() > 0) { + LightApp_SelectionMgr* mgr = selectionMgr(); + Filters::const_iterator anIt = myFilters.begin(), + aLast = myFilters.end(); + for (; anIt != aLast; anIt++) { + if (anIt.data()) { + if (mgr) mgr->removeFilter(anIt.data()); + delete anIt.data(); + } + } + + myFilters.clear(); + } } //================================================================================= @@ -118,9 +118,9 @@ void SMESHGUI_SelectionOp::removeCustomFilters() const //================================================================================= void SMESHGUI_SelectionOp::commitOperation() { + SMESHGUI_Operation::commitOperation(); removeCustomFilters(); setSelectionMode( myOldSelectionMode ); - SMESHGUI_Operation::commitOperation(); } //================================================================================= @@ -129,9 +129,9 @@ void SMESHGUI_SelectionOp::commitOperation() //================================================================================= void SMESHGUI_SelectionOp::abortOperation() { + SMESHGUI_Operation::abortOperation(); removeCustomFilters(); setSelectionMode( myOldSelectionMode ); - SMESHGUI_Operation::abortOperation(); } //================================================================================= @@ -195,9 +195,7 @@ void SMESHGUI_SelectionOp::onActivateObject( int id ) //================================================================================= void SMESHGUI_SelectionOp::onDeactivateObject( int id ) { - LightApp_SelectionMgr* mgr = selectionMgr(); - if( mgr && myFilters.contains( id ) && myFilters[ id ] ) - mgr->removeFilter( myFilters[ id ] ); + removeCustomFilters(); } //================================================================================= diff --git a/src/SMESHGUI/SMESHGUI_SelectionOp.h b/src/SMESHGUI/SMESHGUI_SelectionOp.h index ebc16d78f..2165d14f7 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionOp.h +++ b/src/SMESHGUI/SMESHGUI_SelectionOp.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -92,7 +92,7 @@ protected: virtual SUIT_SelectionFilter* createFilter( const int ) const; //! Remove only filters set by this operation (they are in map myFilters ) - void removeCustomFilters() const; + void removeCustomFilters(); //! Return what selection mode is set in VTK viewer Selection_Mode selectionMode() const; diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx index eed4a15ac..67f2e0c8d 100644 --- a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -36,10 +36,13 @@ #include "SMESH_Actor.h" #include "SMDS_Mesh.hxx" +#include "SUIT_Session.h" #include "SUIT_ResourceMgr.h" #include "SUIT_Desktop.h" #include "SUIT_MessageBox.h" +#include "LightApp_Application.h" + #include "SVTK_ViewModel.h" #include "SVTK_ViewWindow.h" #include "SVTK_Selector.h" @@ -141,6 +144,10 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule, const char* name, GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton(GroupButtons, "buttonCancel"); buttonCancel->setText(tr("SMESH_BUT_CLOSE")); buttonCancel->setAutoDefault(TRUE); @@ -286,12 +293,15 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule, const char* name, mySMESHGUI->SetActiveDialogBox((QDialog*)this); + myHelpFileName = "/files/sewing_meshes.htm"; + Init(); /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int))); connect(SelectButton1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); @@ -313,10 +323,6 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule, const char* name, connect(LineEdit5, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(LineEdit6, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); /* displays Dialog */ ConstructorsClicked(0); @@ -605,6 +611,23 @@ void SMESHGUI_SewingDlg::ClickOnCancel() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_SewingDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= //function : onTextChange //purpose : diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.h b/src/SMESHGUI/SMESHGUI_SewingDlg.h index 8340eb134..9e92a38f6 100644 --- a/src/SMESHGUI/SMESHGUI_SewingDlg.h +++ b/src/SMESHGUI/SMESHGUI_SewingDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -96,6 +96,7 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; QGroupBox* GroupArguments; QGroupBox* SubGroup1; QGroupBox* SubGroup2; @@ -121,12 +122,15 @@ private: QCheckBox* CheckBoxPolygons; QCheckBox* CheckBoxPolyedrs; + QString myHelpFileName; + private slots: void ConstructorsClicked(int constructorId); void ClickOnOk(); void ClickOnCancel(); bool ClickOnApply(); + void ClickOnHelp(); void SetEditCurrentArgument() ; void SelectionIntoArgument(bool isSelectionChanged = true) ; void DeactivateActiveDialog() ; diff --git a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx index d437ee1ef..ba0778195 100644 --- a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -76,28 +76,18 @@ enum { EDGE = 0, FACE, VOLUME }; * \brief Dialog to publish a sub-shape of the mesh main shape * by selecting mesh elements */ -SMESHGUI_ShapeByMeshDlg::SMESHGUI_ShapeByMeshDlg( SMESHGUI* theModule, - const char* theName) - : QDialog( SMESH::GetDesktop( theModule ), theName, false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), - mySMESHGUI( theModule ), - mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ) +SMESHGUI_ShapeByMeshDlg::SMESHGUI_ShapeByMeshDlg() + : SMESHGUI_Dialog( 0, false, true, OK | Close ) { setCaption(tr("CAPTION")); - QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING); + QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame(), MARGIN, SPACING); - QFrame* aMainFrame = createMainFrame (this); - QFrame* aBtnFrame = createButtonFrame(this); + QFrame* aMainFrame = createMainFrame (mainFrame()); aDlgLay->addWidget(aMainFrame); - aDlgLay->addWidget(aBtnFrame); aDlgLay->setStretchFactor(aMainFrame, 1); - - myViewWindow = SMESH::GetViewWindow( mySMESHGUI ); - - Init(); } //======================================================================= @@ -137,38 +127,9 @@ QFrame* SMESHGUI_ShapeByMeshDlg::createMainFrame (QWidget* theParent) aLayout->addWidget(aNameLabel, 2, 0); aLayout->addWidget(myGeomName, 2, 1); - connect(myElemTypeGroup, SIGNAL(clicked(int)), SLOT(onTypeChanged(int))); - connect(myElementId, SIGNAL(textChanged(const QString&)), SLOT(onElemIdChanged(const QString&))); - return aMainGrp; } -//======================================================================= -// function : createButtonFrame() -// purpose : Create frame containing buttons -//======================================================================= -QFrame* SMESHGUI_ShapeByMeshDlg::createButtonFrame (QWidget* theParent) -{ - QFrame* aFrame = new QFrame(theParent); - aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken); - - myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame); - myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame); - - QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); - - QHBoxLayout* aLay = new QHBoxLayout(aFrame, MARGIN, SPACING); - - aLay->addWidget(myOkBtn); - aLay->addItem(aSpacer); - aLay->addWidget(myCloseBtn); - - connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); - connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); - - return aFrame; -} - //======================================================================= // function : ~SMESHGUI_ShapeByMeshDlg() // purpose : Destructor @@ -178,36 +139,73 @@ SMESHGUI_ShapeByMeshDlg::~SMESHGUI_ShapeByMeshDlg() // no need to delete child widgets, Qt does it all for us } +//================================================================================ +/*! + * \brief Constructor + * \param theToCreate - if this parameter is true then operation is used for creation, + * for editing otherwise + * + * Initialize operation +*/ +//================================================================================ +SMESHGUI_ShapeByMeshOp::SMESHGUI_ShapeByMeshOp() +{ + if ( GeometryGUI::GetGeomGen()->_is_nil() )// check that GEOM_Gen exists + GeometryGUI::InitGeomGen(); + + myDlg = new SMESHGUI_ShapeByMeshDlg; + + connect(myDlg->myElemTypeGroup, SIGNAL(clicked(int)), SLOT(onTypeChanged(int))); + connect(myDlg->myElementId, SIGNAL(textChanged(const QString&)), SLOT(onElemIdChanged(const QString&))); +} + + //======================================================================= -// function : Init() +// function : startOperation() // purpose : Init dialog fields, connect signals and slots, show dialog //======================================================================= -void SMESHGUI_ShapeByMeshDlg::Init() +void SMESHGUI_ShapeByMeshOp::startOperation() { - SetMesh( SMESH::SMESH_Mesh::_nil() ); + //SetMesh( SMESH::SMESH_Mesh::_nil() ); myIsManualIdEnter = false; - //erasePreview(); + SMESHGUI_SelectionOp::startOperation(); - mySMESHGUI->SetActiveDialogBox((QDialog*)this); + //activateSelection(); // set filters + onSelectionDone(); // desable/enable [ OK ] - // selection and SMESHGUI - connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); + myDlg->show(); +} - setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); - qApp->processEvents(); - updateGeometry(); - adjustSize(); - resize(minimumSize()); +//================================================================================ +/*! + * \brief Destructor +*/ +//================================================================================ +SMESHGUI_ShapeByMeshOp::~SMESHGUI_ShapeByMeshOp() +{ + if ( myDlg ) + delete myDlg; +} - activateSelection(); - onSelectionDone(); +//================================================================================ +/*! + * \brief Gets dialog of this operation + * \retval LightApp_Dialog* - pointer to dialog of this operation +*/ +//================================================================================ +LightApp_Dialog* SMESHGUI_ShapeByMeshOp::dlg() const +{ + return myDlg; +} - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); - this->show(); +//======================================================================= +// function : GetShape() +// purpose : Get published sub-shape +//======================================================================= +GEOM::GEOM_Object_ptr SMESHGUI_ShapeByMeshOp::GetShape() +{ + return myGeomObj.in(); } //======================================================================= @@ -215,28 +213,26 @@ void SMESHGUI_ShapeByMeshDlg::Init() // purpose : Set mesh to dialog //======================================================================= -void SMESHGUI_ShapeByMeshDlg::SetMesh (SMESH::SMESH_Mesh_ptr thePtr) +void SMESHGUI_ShapeByMeshOp::SetMesh (SMESH::SMESH_Mesh_ptr thePtr) { myMesh = SMESH::SMESH_Mesh::_duplicate(thePtr); myGeomObj = GEOM::GEOM_Object::_nil(); myHasSolids = false; - vector< bool > hasElement (myElemTypeGroup->count(), false); - if (!myMesh->_is_nil() && myViewWindow ) + vector< bool > hasElement (myDlg->myElemTypeGroup->count(), false); + if (!myMesh->_is_nil() ) { - _PTR(SObject) aSobj = SMESH::FindSObject(myMesh.in()); - SUIT_DataOwnerPtr anIObj (new LightApp_DataOwner(aSobj->GetID().c_str())); +// _PTR(SObject) aSobj = SMESH::FindSObject(myMesh.in()); +// SUIT_DataOwnerPtr anIObj (new LightApp_DataOwner(aSobj->GetID().c_str())); vector< int > nbShapes( TopAbs_SHAPE, 0 ); int shapeDim = 0; // max dim with several shapes - if ( mySelectionMgr->isOk(anIObj) ) // check that the mesh has a valid shape + //if ( /*mySelectionMgr*/ selectionMgr()->isOk(anIObj) ) // check that the mesh has a valid shape { _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in()); GEOM::GEOM_Object_var mainShape = SMESH::GetGeom(aSO); if ( !mainShape->_is_nil() ) { - if ( GeometryGUI::GetGeomGen()->_is_nil() )// check that GEOM_Gen exists - GeometryGUI::InitGeomGen(); TopoDS_Shape aShape; if ( GEOMBase::GetShape(mainShape, aShape)) { @@ -262,86 +258,54 @@ void SMESHGUI_ShapeByMeshDlg::SetMesh (SMESH::SMESH_Mesh_ptr thePtr) hasElement[ EDGE ] = shapeDim > 0 && myMesh->NbEdges() ; hasElement[ FACE ] = shapeDim > 1 && myMesh->NbFaces() ; hasElement[ VOLUME ] = shapeDim > 2 && myMesh->NbVolumes(); - - if ( hasElement[ EDGE ] && myViewWindow->GetSelector() ) - { - connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); - } } myHasSolids = nbShapes[ TopAbs_SOLID ]; } // disable inexistant elem types - for ( int i = 0; i < myElemTypeGroup->count(); ++i ) { - if ( QButton* button = myElemTypeGroup->find( i ) ) + for ( int i = 0; i < myDlg->myElemTypeGroup->count(); ++i ) { + if ( QButton* button = myDlg->myElemTypeGroup->find( i ) ) button->setEnabled( hasElement[ i ] ); } - myElementId->setEnabled( hasElement[ EDGE ] ); - myGeomName-> setEnabled( hasElement[ EDGE ] ); + myDlg->myElementId->setEnabled( hasElement[ EDGE ] ); + myDlg->myGeomName-> setEnabled( hasElement[ EDGE ] ); setElementID(""); } //======================================================================= -// function : GetShape() -// purpose : Get published sub-shape +// function : commitOperation() +// purpose : called when "Ok" button pressed. //======================================================================= -GEOM::GEOM_Object_ptr SMESHGUI_ShapeByMeshDlg::GetShape() -{ - return myGeomObj.in(); -} -//======================================================================= -// function : onOk() -// purpose : SLOT called when "Ok" button pressed. -//======================================================================= -void SMESHGUI_ShapeByMeshDlg::onOk() +void SMESHGUI_ShapeByMeshOp::commitOperation() { + SMESHGUI_SelectionOp::commitOperation(); try { - int elemID = myElementId->text().toInt(); + int elemID = myDlg->myElementId->text().toInt(); myGeomObj = SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement - ( myMesh.in(), elemID, myGeomName->text().latin1()); - - accept(); - emit PublishShape(); + ( myMesh.in(), elemID, myDlg->myGeomName->text().latin1()); } catch (const SALOME::SALOME_Exception& S_ex) { SalomeApp_Tools::QtCatchCorbaException(S_ex); } catch (...) { } - myViewWindow->SetSelectionMode( ActorSelection ); - disconnect(mySelectionMgr, 0, this, 0); - disconnect(mySMESHGUI, 0, this, 0); - mySMESHGUI->ResetState(); -} -//======================================================================= -// function : onClose() -// purpose : SLOT called when "Close" button pressed. Close dialog -//======================================================================= -void SMESHGUI_ShapeByMeshDlg::onClose() -{ - myViewWindow->SetSelectionMode( ActorSelection ); - disconnect(mySelectionMgr, 0, this, 0); - disconnect(mySMESHGUI, 0, this, 0); - mySMESHGUI->ResetState(); - reject(); - emit Close(); } //======================================================================= // function : onSelectionDone() -// purpose : SLOT called when selection changed +// purpose : SLOT called when selection changed. Enable/desable [ OK ] //======================================================================= -void SMESHGUI_ShapeByMeshDlg::onSelectionDone() +void SMESHGUI_ShapeByMeshOp::onSelectionDone() { - myOkBtn->setEnabled( false ); + myDlg->setButtonEnabled( false, QtxDialog::OK ); setElementID(""); try { SALOME_ListIO aList; - mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type()); + selectionMgr()->selectedObjects(aList, SVTK_Viewer::Type()); if (aList.Extent() != 1) return; @@ -350,82 +314,42 @@ void SMESHGUI_ShapeByMeshDlg::onSelectionDone() return; QString aString; - int nbElems = SMESH::GetNameOfSelectedElements(myViewWindow->GetSelector(), + int nbElems = SMESH::GetNameOfSelectedElements(selector(),//myViewWindow->GetSelector(), aList.First(), aString); if ( nbElems == 1 ) { setElementID( aString ); - myOkBtn->setEnabled( true ); + myDlg->setButtonEnabled( true, QtxDialog::OK ); } } catch (...) { } } -//======================================================================= -// function : onDeactivate() -// purpose : SLOT called when dialog must be deativated -//======================================================================= -void SMESHGUI_ShapeByMeshDlg::onDeactivate() -{ - if ( isEnabled() ) { - //disconnect(mySelectionMgr, 0, this, 0); - myViewWindow->SetSelectionMode( ActorSelection ); - setEnabled(false); - } -} - -//======================================================================= -// function : enterEvent() -// purpose : Event filter -//======================================================================= -void SMESHGUI_ShapeByMeshDlg::enterEvent (QEvent*) -{ - // there is a stange problem that enterEvent() comes after onSave() - if ( isVisible () && !isEnabled() ) { - mySMESHGUI->EmitSignalDeactivateDialog(); - setEnabled(true); - activateSelection(); - //connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); - } -} - -//================================================================================= -// function : closeEvent() -// purpose : Close dialog box -//================================================================================= -void SMESHGUI_ShapeByMeshDlg::closeEvent (QCloseEvent*) -{ - onClose(); -} - //======================================================================= // function : activateSelection() // purpose : Activate selection in accordance with current pattern type //======================================================================= -void SMESHGUI_ShapeByMeshDlg::activateSelection() +void SMESHGUI_ShapeByMeshOp::activateSelection() { - mySelectionMgr->clearFilters(); - SMESH::SetPointRepresentation(false); - - myGeomName->setText(""); - - if ( myViewWindow ) - { - QString geomName; - Selection_Mode mode = EdgeSelection; - switch ( myElemTypeGroup->id( myElemTypeGroup->selected() )) { - case EDGE : - mode = EdgeSelection; geomName = tr("GEOM_EDGE"); break; - case FACE : - mode = FaceSelection; geomName = tr("GEOM_FACE"); break; - case VOLUME: - mode = VolumeSelection; geomName = tr(myHasSolids ? "GEOM_SOLID" : "GEOM_SHELL"); break; - default: return; - } - if ( myViewWindow->SelectionMode() != mode ) - myViewWindow->SetSelectionMode( mode ); - - myGeomName->setText( GEOMBase::GetDefaultName( geomName )); + selectionMgr()->clearFilters(); + //SMESH::SetPointRepresentation(false); + + myDlg->myGeomName->setText(""); + + QString geomName; + Selection_Mode mode = EdgeSelection; + switch ( myDlg->myElemTypeGroup->id( myDlg->myElemTypeGroup->selected() )) { + case EDGE : + mode = EdgeSelection; geomName = tr("GEOM_EDGE"); break; + case FACE : + mode = FaceSelection; geomName = tr("GEOM_FACE"); break; + case VOLUME: + mode = VolumeSelection; geomName = tr(myHasSolids ? "GEOM_SOLID" : "GEOM_SHELL"); break; + default: return; } + if ( selectionMode() != mode ) + setSelectionMode( mode ); + + myDlg->myGeomName->setText( GEOMBase::GetDefaultName( geomName )); } //======================================================================= @@ -433,7 +357,7 @@ void SMESHGUI_ShapeByMeshDlg::activateSelection() //purpose : SLOT. Called when element type changed. //======================================================================= -void SMESHGUI_ShapeByMeshDlg::onTypeChanged (int theType) +void SMESHGUI_ShapeByMeshOp::onTypeChanged (int theType) { setElementID(""); activateSelection(); @@ -445,16 +369,16 @@ void SMESHGUI_ShapeByMeshDlg::onTypeChanged (int theType) // Highlight the element whose Ids the user entered manually //======================================================================= -void SMESHGUI_ShapeByMeshDlg::onElemIdChanged(const QString& theNewText) +void SMESHGUI_ShapeByMeshOp::onElemIdChanged(const QString& theNewText) { - myOkBtn->setEnabled( false ); + myDlg->setButtonEnabled( false, QtxDialog::OK ); - if ( myIsManualIdEnter && !myMesh->_is_nil() && myViewWindow ) + if ( myIsManualIdEnter && !myMesh->_is_nil() ) if ( SMESH_Actor* actor = SMESH::FindActorByObject(myMesh) ) if ( SMDS_Mesh* aMesh = actor->GetObject()->GetMesh() ) { SMDSAbs_ElementType type = SMDSAbs_Edge; - switch ( myElemTypeGroup->id( myElemTypeGroup->selected() )) { + switch ( myDlg->myElemTypeGroup->id( myDlg->myElemTypeGroup->selected() )) { case EDGE : type = SMDSAbs_Edge; break; case FACE : type = SMDSAbs_Face; break; case VOLUME: type = SMDSAbs_Volume; break; @@ -469,10 +393,10 @@ void SMESHGUI_ShapeByMeshDlg::onElemIdChanged(const QString& theNewText) } if ( !newIndices.IsEmpty() && newIndices.Extent() == 1 ) - if ( SVTK_Selector* s = myViewWindow->GetSelector() ) { + if ( SVTK_Selector* s = selector() ) { s->AddOrRemoveIndex( actor->getIO(), newIndices, false ); - myViewWindow->highlight( actor->getIO(), true, true ); - myOkBtn->setEnabled( true ); + viewWindow()->highlight( actor->getIO(), true, true ); + myDlg->setButtonEnabled( true, QtxDialog::OK ); } } } @@ -482,9 +406,9 @@ void SMESHGUI_ShapeByMeshDlg::onElemIdChanged(const QString& theNewText) //purpose : programmatically set element id //======================================================================= -void SMESHGUI_ShapeByMeshDlg::setElementID(const QString& theText) +void SMESHGUI_ShapeByMeshOp::setElementID(const QString& theText) { myIsManualIdEnter = false; - myElementId->setText(theText); + myDlg->myElementId->setText(theText); myIsManualIdEnter = true; } diff --git a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.h b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.h index 09dec6c30..96bd13d33 100644 --- a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.h +++ b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -29,7 +29,8 @@ #include "SMESH_SMESHGUI.hxx" -#include +#include "SMESHGUI_Dialog.h" +#include "SMESHGUI_SelectionOp.h" // IDL Headers #include @@ -50,36 +51,88 @@ class SMESHGUI; * by selecting mesh elements */ -class SMESHGUI_EXPORT SMESHGUI_ShapeByMeshDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_ShapeByMeshDlg : public SMESHGUI_Dialog { Q_OBJECT public: - SMESHGUI_ShapeByMeshDlg( SMESHGUI* theModule, - const char* theName = 0); + SMESHGUI_ShapeByMeshDlg(); virtual ~SMESHGUI_ShapeByMeshDlg(); +private: + +// void closeEvent (QCloseEvent* e); +// void enterEvent (QEvent*); + +private: + + //QFrame* createButtonFrame (QWidget*); + QFrame* createMainFrame (QWidget*); + //void displayPreview(); + //void erasePreview(); +private: + + QButtonGroup* myElemTypeGroup; + QLineEdit* myElementId; + QLineEdit* myGeomName; + +// QPushButton* myOkBtn; +// QPushButton* myCloseBtn; + +// SMESHGUI* mySMESHGUI; +// LightApp_SelectionMgr* mySelectionMgr; +// SVTK_ViewWindow* myViewWindow; + + friend class SMESHGUI_ShapeByMeshOp; +}; + +class SMESHGUI_ShapeByMeshOp: public SMESHGUI_SelectionOp +{ + Q_OBJECT + +public: + SMESHGUI_ShapeByMeshOp(); + virtual ~SMESHGUI_ShapeByMeshOp(); + + virtual LightApp_Dialog* dlg() const; + void Init(); void SetMesh (SMESH::SMESH_Mesh_ptr); SMESH::SMESH_Mesh_ptr GetMesh () { return myMesh; } GEOM::GEOM_Object_ptr GetShape(); -signals: +protected: - void PublishShape(); - void Close(); + virtual void commitOperation(); + virtual void startOperation(); + //virtual void selectionDone(); + //virtual SUIT_SelectionFilter* createFilter( const int ) const; + //virtual bool isValid( SUIT_Operation* ) const; -private: + void activateSelection(); + void setElementID(const QString&); + +/* signals: */ - void closeEvent (QCloseEvent* e); - void enterEvent (QEvent*); +/* void PublishShape(); */ +/* void Close(); */ + +protected slots: + + virtual bool onApply() { return true; } +/* void onCreateHyp( const int theHypType, const int theIndex ); */ +/* void onEditHyp( const int theHypType, const int theIndex ); */ +/* void onHypoSet( const QString& theSetName ); */ +/* void onGeomSelectionByMesh( bool ); */ +/* void onPublishShapeByMeshDlg(); */ +/* void onCloseShapeByMeshDlg(); */ private slots: - void onOk(); - void onClose(); +// void onOk(); +// void onClose(); - void onDeactivate(); +// void onDeactivate(); void onSelectionDone(); void onTypeChanged (int); @@ -87,26 +140,7 @@ private slots: private: - QFrame* createButtonFrame (QWidget*); - QFrame* createMainFrame (QWidget*); - //void displayPreview(); - //void erasePreview(); - void activateSelection(); - void setElementID(const QString&); - -private: - - QButtonGroup* myElemTypeGroup; - QLineEdit* myElementId; - QLineEdit* myGeomName; - - QPushButton* myOkBtn; - QPushButton* myCloseBtn; - - SMESHGUI* mySMESHGUI; - LightApp_SelectionMgr* mySelectionMgr; - SVTK_ViewWindow* myViewWindow; - + SMESHGUI_ShapeByMeshDlg* myDlg; SMESH::SMESH_Mesh_var myMesh; GEOM::GEOM_Object_var myGeomObj; diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx index 754232f6a..ab28af483 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -37,9 +37,11 @@ #include "SMDS_Mesh.hxx" #include "LightApp_SelectionMgr.h" +#include "LightApp_Application.h" #include "SUIT_ResourceMgr.h" #include "SUIT_MessageBox.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" #include "SVTK_Selector.h" #include "SVTK_ViewWindow.h" @@ -158,6 +160,7 @@ QFrame* SMESHGUI_SingleEditDlg::createButtonFrame (QWidget* theParent) myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame); myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame); myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame); + myHelpBtn = new QPushButton (tr("SMESH_BUT_HELP"), aFrame); QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); @@ -167,6 +170,7 @@ QFrame* SMESHGUI_SingleEditDlg::createButtonFrame (QWidget* theParent) aLay->addWidget(myApplyBtn); aLay->addItem(aSpacer); aLay->addWidget(myCloseBtn); + aLay->addWidget(myHelpBtn); return aFrame; } @@ -222,6 +226,7 @@ void SMESHGUI_SingleEditDlg::Init() connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); + connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); // selection and SMESHGUI connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); @@ -233,9 +238,6 @@ void SMESHGUI_SingleEditDlg::Init() myApplyBtn->setEnabled(false); setEnabled(true); - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); // set selection mode @@ -271,6 +273,23 @@ void SMESHGUI_SingleEditDlg::onClose() reject(); } +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_SingleEditDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= //function : findTriangles() //purpose : find triangles sharing theNode1-theNode2 link @@ -528,6 +547,7 @@ SMESHGUI_TrianglesInversionDlg : SMESHGUI_SingleEditDlg(theModule,theName) { setCaption(tr("CAPTION")); + myHelpFileName = "/files/diagonal_iversion_of_elements.htm"; } SMESHGUI_TrianglesInversionDlg::~SMESHGUI_TrianglesInversionDlg() @@ -552,6 +572,7 @@ SMESHGUI_UnionOfTwoTrianglesDlg : SMESHGUI_SingleEditDlg(theModule,theName) { setCaption(tr("CAPTION")); + myHelpFileName = "/files/uniting_two_triangles.htm"; } SMESHGUI_UnionOfTwoTrianglesDlg::~SMESHGUI_UnionOfTwoTrianglesDlg() diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.h b/src/SMESHGUI/SMESHGUI_SingleEditDlg.h index f19a2b9ee..e52fbed43 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.h +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -66,6 +66,7 @@ protected slots: void onOk(); virtual bool onApply(); void onClose(); + void onHelp(); void onDeactivate(); @@ -87,12 +88,15 @@ protected: QPushButton* myOkBtn; QPushButton* myApplyBtn; QPushButton* myCloseBtn; + QPushButton* myHelpBtn; QLineEdit* myEdge; SMESH_Actor* myActor; LightApp_SelectionMgr* mySelectionMgr; SVTK_Selector* mySelector; SMESHGUI* mySMESHGUI; + + QString myHelpFileName; }; /*! diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index c2a8b1312..541f63475 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -45,8 +45,11 @@ #include "SUIT_ResourceMgr.h" #include "SUIT_OverrideCursor.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" #include "SUIT_MessageBox.h" +#include "LightApp_Application.h" + #include "SVTK_ViewModel.h" #include "SVTK_Selector.h" #include "SVTK_ViewWindow.h" @@ -138,6 +141,10 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule, const char* n GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton(GroupButtons, "buttonCancel"); buttonCancel->setText(tr("SMESH_BUT_CLOSE" )); buttonCancel->setAutoDefault(TRUE); @@ -267,6 +274,8 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule, const char* n myMeshOrSubMeshOrGroupFilter = new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR); + myHelpFileName = "/files/smoothing.htm"; + Init(); /***************************************************************/ @@ -274,6 +283,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule, const char* n connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int))); connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); @@ -290,10 +300,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule, const char* n SLOT(onSelectMesh(bool))); /***************************************************************/ - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); + this->show(); // displays Dialog } @@ -430,6 +437,23 @@ void SMESHGUI_SmoothingDlg::ClickOnCancel() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_SmoothingDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= // function : onTextChange() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.h b/src/SMESHGUI/SMESHGUI_SmoothingDlg.h index 71455f077..970cd89e6 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.h +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -102,6 +102,7 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; QGroupBox* GroupArguments; QLabel* TextLabelElements; QPushButton* SelectElementsButton; @@ -117,6 +118,8 @@ private: QLabel* TextLabelAspectRatio; SMESHGUI_SpinBox* SpinBox_AspectRatio; QCheckBox * CheckBoxParametric; + + QString myHelpFileName; private slots: @@ -124,6 +127,7 @@ private slots: void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); void SetEditCurrentArgument() ; void SelectionIntoArgument() ; void DeactivateActiveDialog() ; diff --git a/src/SMESHGUI/SMESHGUI_SpinBox.cxx b/src/SMESHGUI/SMESHGUI_SpinBox.cxx index 54c247a80..772a6d166 100644 --- a/src/SMESHGUI/SMESHGUI_SpinBox.cxx +++ b/src/SMESHGUI/SMESHGUI_SpinBox.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESHGUI_SpinBox.h b/src/SMESHGUI/SMESHGUI_SpinBox.h index 8f7444e75..9d46be239 100644 --- a/src/SMESHGUI/SMESHGUI_SpinBox.h +++ b/src/SMESHGUI/SMESHGUI_SpinBox.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx b/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx index 30b5eb0ea..d05a1d472 100644 --- a/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -41,6 +41,9 @@ #include "SUIT_Desktop.h" #include "SUIT_Session.h" #include "SUIT_OverrideCursor.h" +#include "SUIT_MessageBox.h" + +#include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" #include "SALOME_ListIO.hxx" @@ -144,12 +147,15 @@ SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg( SMESHGUI* theModul myButtonsGroupLayout->setAlignment(Qt::AlignTop); myButtonsGroupLayout->setSpacing(6); myButtonsGroupLayout->setMargin(11); - // buttons --> OK button + // buttons --> OK and Help buttons myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), myButtonsGroup, "myOkBtn"); myOkBtn->setAutoDefault(TRUE); myOkBtn->setDefault(TRUE); - myButtonsGroupLayout->addStretch(); + myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP" ), myButtonsGroup, "myHelpBtn"); + myHelpBtn->setAutoDefault(TRUE); + myButtonsGroupLayout->addWidget(myOkBtn); myButtonsGroupLayout->addStretch(); + myButtonsGroupLayout->addWidget(myHelpBtn); aDlgLayout->addWidget(myButtonsGroup, 2, 0); @@ -157,6 +163,7 @@ SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg( SMESHGUI* theModul // connect signals connect( myOkBtn, SIGNAL(clicked()), this, SLOT(close())); + connect( myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); connect( mySelectBtn, SIGNAL(clicked()), this, SLOT(onStartSelection())); connect( mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(close())); connect( mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); @@ -164,15 +171,14 @@ SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg( SMESHGUI* theModul // resize and move dialog, then show this->setMinimumSize(270, 428); - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); // init dialog with current selection myMeshFilter = new SMESH_TypeFilter (MESH); mySelectionMgr->installFilter(myMeshFilter); onSelectionChanged(); + + myHelpFileName = "/files/viewing_mesh_info.htm#standard_infos"; } //================================================================================= @@ -444,3 +450,20 @@ void SMESHGUI_StandardMeshInfosDlg::onStartSelection() onSelectionChanged(); myStartSelection = true; } + +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_StandardMeshInfosDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.h b/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.h index cd53455d6..8bb0b37ba 100644 --- a/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.h +++ b/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -64,6 +64,7 @@ private slots: void DeactivateActiveDialog() ; void ActivateThisDialog(); void onStartSelection(); + void onHelp(); private: SMESHGUI* mySMESHGUI; @@ -85,6 +86,9 @@ private: QGroupBox* myButtonsGroup; QPushButton* myOkBtn; + QPushButton* myHelpBtn; + + QString myHelpFileName; }; #endif // SMESHGUI_STANDARDMESHINFOSDLG_H diff --git a/src/SMESHGUI/SMESHGUI_Swig.cxx b/src/SMESHGUI/SMESHGUI_Swig.cxx index 258bbf3a1..219b409a7 100644 --- a/src/SMESHGUI/SMESHGUI_Swig.cxx +++ b/src/SMESHGUI/SMESHGUI_Swig.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -39,9 +39,10 @@ #include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" -#include "SALOMEDS_SObject.hxx" - +#include "SALOME_Event.hxx" +#include "SALOME_NamingService.hxx" #include "SalomeApp_Application.h" +#include "SALOMEDSClient_ClientFactory.hxx" #include "utilities.h" @@ -56,384 +57,522 @@ using namespace std; -static CORBA::ORB_var _orb; +static CORBA::ORB_var anORB; -static CORBA::Object_ptr StringToObject (const char* ior) -{ - return _orb->string_to_object(ior); -} +// Tags definition +static long Tag_HypothesisRoot = 1; +static long Tag_AlgorithmsRoot = 2; + +static long Tag_RefOnShape = 1; +static long Tag_RefOnAppliedHypothesis = 2; +static long Tag_RefOnAppliedAlgorithms = 3; -SMESH_Swig::SMESH_Swig() -{ - MESSAGE("Constructeur"); - setOrb(); -} +static long Tag_SubMeshOnVertex = 4; +static long Tag_SubMeshOnEdge = 5; +static long Tag_SubMeshOnFace = 6; +static long Tag_SubMeshOnSolid = 7; +static long Tag_SubMeshOnCompound = 8; -void SMESH_Swig::Init(int studyID) +namespace { - MESSAGE("Init"); - SMESH::SMESH_Gen_var CompMesh = SMESHGUI::GetSMESHGen(); - GEOM::GEOM_Gen_var CompGeom = SMESH::GetGEOMGen(); - - SUIT_ResourceMgr* resMgr = SMESHGUI::resourceMgr(); - if ( resMgr ) { - resMgr->loadLanguage( QString::null, "en" ); - /*QString msg; - if (!resMgr->loadResources( "SMESH", msg )) - MESSAGE ( msg )*/ + //--------------------------------------------------------------- + inline + CORBA::Object_var + StringToObject(const std::string& theIOR) + { + return anORB->string_to_object(theIOR.c_str()); } - SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ); - if( !app ) - return; - CORBA::Object_var obj = app->namingService()->Resolve("/myStudyManager"); - SALOMEDS::StudyManager_var myStudyMgr = SALOMEDS::StudyManager::_narrow(obj); - myStudy = myStudyMgr->GetStudyByID(studyID); + //--------------------------------------------------------------- + inline + SALOMEDS::SObject_var + GetDomainRoot(const SALOMEDS::SComponent_var& theSComponentMesh, + const SALOMEDS::StudyBuilder_var& theStudyBuilder, + CORBA::Long theDomainRootTag, + const QString& theName, + const QString& thePixmap) + { + SALOMEDS::SObject_var aDomainRoot; + if (!theSComponentMesh->FindSubObject(theDomainRootTag,aDomainRoot)) { + aDomainRoot = theStudyBuilder->NewObjectToTag(theSComponentMesh,theDomainRootTag); + SALOMEDS::GenericAttribute_var anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributeName"); + SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); + aName->SetValue(theName.latin1()); + anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributePixMap"); + SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); + aPixmap->SetPixMap(thePixmap.latin1()); + anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributeSelectable"); + SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr); + aSelAttr->SetSelectable(false); + } - CompMesh->SetCurrentStudy( myStudy.in() ); + return aDomainRoot; + } - myStudyBuilder = myStudy->NewBuilder(); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - SALOMEDS::AttributePixMap_var aPixmap; - // See return value of SMESH::SMESH_Gen::ComponentDataType() - SALOMEDS::SComponent_var father = myStudy->FindComponent("SMESH"); + //--------------------------------------------------------------- + inline + SALOMEDS::SObject_var + GetHypothesisRoot(const SALOMEDS::SComponent_var& theSComponentMesh, + const SALOMEDS::StudyBuilder_var& theStudyBuilder) + { + return GetDomainRoot(theSComponentMesh, + theStudyBuilder, + Tag_HypothesisRoot, + QObject::tr("SMESH_MEN_HYPOTHESIS"), + "ICON_SMESH_TREE_HYPO"); + } + - if (father->_is_nil()) { - bool aLocked = myStudy->GetProperties()->IsLocked(); - if (aLocked) myStudy->GetProperties()->SetLocked(false); - father = myStudyBuilder->NewComponent("SMESH"); - anAttr = myStudyBuilder->FindOrCreateAttribute(father, "AttributeName"); - aName = SALOMEDS::AttributeName::_narrow(anAttr); - //NRI aName->SetValue(QObject::tr("SMESH_MEN_COMPONENT")); - SMESHGUI* gui = SMESHGUI::GetSMESHGUI(); //SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded - if(!gui) { - SalomeApp_Application* app = dynamic_cast(SUIT_Session::session()->activeApplication()); - if(app) { - CAM_Module* module = app->module( "Mesh" ); - if(!module) module = app->loadModule("Mesh"); - gui = dynamic_cast( module ); - } - else { - MESSAGE("Can't find the application"); + //--------------------------------------------------------------- + inline + SALOMEDS::SObject_var + GetAlgorithmsRoot(const SALOMEDS::SComponent_var& theSComponentMesh, + const SALOMEDS::StudyBuilder_var& theStudyBuilder) + { + return GetDomainRoot(theSComponentMesh, + theStudyBuilder, + Tag_AlgorithmsRoot, + QObject::tr("SMESH_MEN_ALGORITHMS"), + "ICON_SMESH_TREE_ALGO"); + } + + + //--------------------------------------------------------------- + inline + SALOMEDS::SObject_var + AddToDomain(const std::string& theIOR, + const SALOMEDS::SComponent_var& theSComponentMesh, + const SALOMEDS::StudyBuilder_var& theStudyBuilder, + CORBA::Long theDomainRootTag, + const QString& theDomainName, + const QString& theDomainPixmap) + { + SALOMEDS::SObject_var aDomain = GetDomainRoot(theSComponentMesh, + theStudyBuilder, + Tag_AlgorithmsRoot, + theDomainName, + theDomainPixmap); + // Add New Hypothesis + SALOMEDS::SObject_var aSObject = theStudyBuilder->NewObject(aDomain); + SALOMEDS::GenericAttribute_var anAttr = theStudyBuilder->FindOrCreateAttribute(aSObject,"AttributePixMap"); + SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); + CORBA::Object_var anObject = StringToObject(theIOR); + SMESH::SMESH_Hypothesis_var aDomainItem = SMESH::SMESH_Hypothesis::_narrow(anObject.in()); + CORBA::String_var aType = aDomainItem->GetName(); + QString aPixmapName = theDomainPixmap + "_" + aType.in(); + aPixmap->SetPixMap(aPixmapName.latin1()); + anAttr = theStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeIOR"); + SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); + anIOR->SetValue(theIOR.c_str()); + + return aSObject; + } + + + //--------------------------------------------------------------- + SALOMEDS::SObject_var + AddHypothesis(const std::string& theIOR, + const SALOMEDS::SComponent_var& theSComponentMesh, + const SALOMEDS::StudyBuilder_var& theStudyBuilder) + { + return AddToDomain(theIOR, + theSComponentMesh, + theStudyBuilder, + Tag_HypothesisRoot, + QObject::tr("SMESH_MEN_HYPOTHESIS"), + "ICON_SMESH_TREE_HYPO"); + } + + + //--------------------------------------------------------------- + SALOMEDS::SObject_var + AddAlgorithms(const std::string& theIOR, + const SALOMEDS::SComponent_var& theSComponentMesh, + const SALOMEDS::StudyBuilder_var& theStudyBuilder) + { + return AddToDomain(theIOR, + theSComponentMesh, + theStudyBuilder, + Tag_AlgorithmsRoot, + QObject::tr("SMESH_MEN_ALGORITHMS"), + "ICON_SMESH_TREE_ALGO"); + } + + + //--------------------------------------------------------------- + void + SetDomain(const char* theMeshOrSubMeshEntry, + const char* theDomainEntry, + const SALOMEDS::Study_var& theStudy, + const SALOMEDS::StudyBuilder_var& theStudyBuilder, + long theRefOnAppliedDomainTag, + const QString& theAppliedDomainMEN, + const QString& theAppliedDomainICON) + { + SALOMEDS::SObject_var aMeshOrSubMeshSO = theStudy->FindObjectID(theMeshOrSubMeshEntry); + SALOMEDS::SObject_var aHypothesisSO = theStudy->FindObjectID(theDomainEntry); + + if(!aMeshOrSubMeshSO->_is_nil() && !aHypothesisSO->_is_nil()){ + //Find or Create Applied Hypothesis root + SALOMEDS::SObject_var anAppliedDomainSO; + if(!aMeshOrSubMeshSO->FindSubObject(theRefOnAppliedDomainTag,anAppliedDomainSO)){ + anAppliedDomainSO = theStudyBuilder->NewObjectToTag(aMeshOrSubMeshSO,theRefOnAppliedDomainTag); + SALOMEDS::GenericAttribute_var anAttr = + theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeName"); + SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); + aName->SetValue(theAppliedDomainMEN.latin1()); + anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeSelectable"); + SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr); + aSelAttr->SetSelectable(false); + anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributePixMap"); + SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); + aPixmap->SetPixMap(theAppliedDomainICON.latin1()); } - } //SRN: BugID IPAL9186: end of a fix - aName->SetValue( gui->moduleName() ); - anAttr = myStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap"); - aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" ); - myStudyBuilder->DefineComponentInstance(father, CompMesh ); - if (aLocked) myStudy->GetProperties()->SetLocked(true); + SALOMEDS::SObject_var aSObject = theStudyBuilder->NewObject(anAppliedDomainSO); + theStudyBuilder->Addreference(aSObject,aHypothesisSO); + } } - mySComponentMesh = SALOMEDS::SComponent::_narrow( father ); - // Tags definition - Tag_HypothesisRoot = 1; - Tag_AlgorithmsRoot = 2; - - Tag_RefOnShape = 1; - Tag_RefOnAppliedHypothesis = 2; - Tag_RefOnAppliedAlgorithms = 3; - - Tag_SubMeshOnVertex = 4; - Tag_SubMeshOnEdge = 5; - Tag_SubMeshOnFace = 6; - Tag_SubMeshOnSolid = 7; - Tag_SubMeshOnCompound = 8; + + //--------------------------------------------------------------- + void + SetHypothesis(const char* theMeshOrSubMeshEntry, + const char* theDomainEntry, + const SALOMEDS::Study_var& theStudy, + const SALOMEDS::StudyBuilder_var& theStudyBuilder) + { + SetDomain(theMeshOrSubMeshEntry, + theDomainEntry, + theStudy, + theStudyBuilder, + Tag_RefOnAppliedHypothesis, + QObject::tr("SMESH_MEN_APPLIED_HYPOTHESIS"), + "ICON_SMESH_TREE_HYPO"); + } + + + //--------------------------------------------------------------- + void + SetAlgorithms(const char* theMeshOrSubMeshEntry, + const char* theDomainEntry, + const SALOMEDS::Study_var& theStudy, + const SALOMEDS::StudyBuilder_var& theStudyBuilder) + { + SetDomain(theMeshOrSubMeshEntry, + theDomainEntry, + theStudy, + theStudyBuilder, + Tag_RefOnAppliedAlgorithms, + QObject::tr("SMESH_MEN_APPLIED_ALGORIHTMS"), + "ICON_SMESH_TREE_ALGO"); + } +} + + +//=============================================================== +SMESH_Swig::SMESH_Swig() +{ + class TEvent: public SALOME_Event + { + CORBA::ORB_var& myORB; + public: + + TEvent(CORBA::ORB_var& theORB): + myORB(theORB) + {} + + virtual + void + Execute() + { + try { + ORB_INIT &anORBInit = *SINGLETON_::Instance(); + ASSERT(SINGLETON_::IsAlreadyExisting()); + myORB = anORBInit( 0 , 0 ); + } catch (...) { + INFOS("internal error : orb not found"); + } + } + }; + + MESSAGE("Constructeur"); + + if(CORBA::is_nil(anORB)) + ProcessVoidEvent(new TEvent(anORB)); + + ASSERT(!CORBA::is_nil(anORB)); +} + + +//=============================================================== +void +SMESH_Swig::Init(int theStudyID) +{ + class TEvent: public SALOME_Event + { + int myStudyID; + SALOMEDS::Study_var& myStudy; + SALOMEDS::StudyBuilder_var& myStudyBuilder; + SALOMEDS::SComponent_var& mySComponentMesh; + public: + TEvent(int theStudyID, + SALOMEDS::Study_var& theStudy, + SALOMEDS::StudyBuilder_var& theStudyBuilder, + SALOMEDS::SComponent_var& theSComponentMesh): + myStudyID(theStudyID), + myStudy(theStudy), + myStudyBuilder(theStudyBuilder), + mySComponentMesh(theSComponentMesh) + {} + + virtual + void + Execute() + { + SUIT_Session* aSession = SUIT_Session::session(); + SUIT_Application* anApplication = aSession->activeApplication(); + SalomeApp_Application* anApp = dynamic_cast(anApplication); + + SALOME_NamingService* aNamingService = anApp->namingService(); + CORBA::Object_var anObject = aNamingService->Resolve("/myStudyManager"); + SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject); + myStudy = aStudyMgr->GetStudyByID(myStudyID); + + SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen(); + aSMESHGen->SetCurrentStudy( myStudy.in() ); + + myStudyBuilder = myStudy->NewBuilder(); + + SALOMEDS::GenericAttribute_var anAttr; + SALOMEDS::AttributeName_var aName; + SALOMEDS::AttributePixMap_var aPixmap; + + SALOMEDS::SComponent_var aSComponent = myStudy->FindComponent("SMESH"); + if(aSComponent->_is_nil()){ + bool aLocked = myStudy->GetProperties()->IsLocked(); + if (aLocked) + myStudy->GetProperties()->SetLocked(false); + + aSComponent = myStudyBuilder->NewComponent("SMESH"); + anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributeName"); + aName = SALOMEDS::AttributeName::_narrow(anAttr); + + SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI(); //SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded + if(!aSMESHGUI){ + CAM_Module* aModule = anApp->module("Mesh"); + if(!aModule) + aModule = anApp->loadModule("Mesh"); + aSMESHGUI = dynamic_cast(aModule); + } //SRN: BugID IPAL9186: end of a fix + aName->SetValue(aSMESHGUI->moduleName()); + anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributePixMap"); + aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); + aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" ); + myStudyBuilder->DefineComponentInstance(aSComponent,aSMESHGen); + if(aLocked) + myStudy->GetProperties()->SetLocked(true); + } + + mySComponentMesh = SALOMEDS::SComponent::_narrow(aSComponent); + } + }; + + MESSAGE("Init"); + + ProcessVoidEvent(new TEvent(theStudyID, + myStudy, + myStudyBuilder, + mySComponentMesh)); } + +//=============================================================== SMESH_Swig::~SMESH_Swig() { MESSAGE("Destructeur"); } -const char* SMESH_Swig::AddNewMesh(const char* IOR) + +//=============================================================== +const char* +SMESH_Swig::AddNewMesh(const char* theIOR) { MESSAGE("AddNewMesh"); // VSR: added temporarily - to be removed - objects are published automatically by engine - SALOMEDS::SObject_var SO = myStudy->FindObjectIOR( IOR ); - if ( !SO->_is_nil() ) - return SO->GetID(); - - //Find or Create Hypothesis root - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - SALOMEDS::AttributeIOR_var anIOR; - SALOMEDS::AttributeSelectable_var aSelAttr; - SALOMEDS::AttributePixMap_var aPixmap; - - SALOMEDS::SObject_var HypothesisRoot; - if (!mySComponentMesh->FindSubObject (Tag_HypothesisRoot, HypothesisRoot)) { - HypothesisRoot = myStudyBuilder->NewObjectToTag (mySComponentMesh, Tag_HypothesisRoot); - anAttr = myStudyBuilder->FindOrCreateAttribute(HypothesisRoot, "AttributeName"); - aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue(QObject::tr("SMESH_MEN_HYPOTHESIS")); - anAttr = myStudyBuilder->FindOrCreateAttribute(HypothesisRoot, "AttributePixMap"); - aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - aPixmap->SetPixMap( "ICON_SMESH_TREE_HYPO" ); - anAttr = myStudyBuilder->FindOrCreateAttribute(HypothesisRoot, "AttributeSelectable"); - aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr); - aSelAttr->SetSelectable(false); + SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(theIOR); + if(aSObject->_is_nil()){ + //Find or Create Hypothesis root + GetHypothesisRoot(mySComponentMesh,myStudyBuilder); + GetAlgorithmsRoot(mySComponentMesh,myStudyBuilder); + + // Add New Mesh + aSObject = myStudyBuilder->NewObject(mySComponentMesh); + SALOMEDS::GenericAttribute_var anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject,"AttributePixMap"); + SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); + aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH" ); + anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeIOR"); + SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); + anIOR->SetValue(theIOR); } - SALOMEDS::SObject_var AlgorithmsRoot; - if (!mySComponentMesh->FindSubObject (Tag_AlgorithmsRoot, AlgorithmsRoot)) { - AlgorithmsRoot = myStudyBuilder->NewObjectToTag (mySComponentMesh, Tag_AlgorithmsRoot); - anAttr = myStudyBuilder->FindOrCreateAttribute(AlgorithmsRoot, "AttributeName"); - aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue(QObject::tr("SMESH_MEN_ALGORITHMS")); - anAttr = myStudyBuilder->FindOrCreateAttribute(AlgorithmsRoot, "AttributePixMap"); - aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - aPixmap->SetPixMap( "ICON_SMESH_TREE_ALGO" ); - anAttr = myStudyBuilder->FindOrCreateAttribute(AlgorithmsRoot, "AttributeSelectable"); - aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr); - aSelAttr->SetSelectable(false); - } + CORBA::String_var anEntry = aSObject->GetID(); - // Add New Mesh - SALOMEDS::SObject_var newMesh = myStudyBuilder->NewObject(mySComponentMesh); - anAttr = myStudyBuilder->FindOrCreateAttribute(newMesh, "AttributePixMap"); - aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH" ); - anAttr = myStudyBuilder->FindOrCreateAttribute(newMesh, "AttributeIOR"); - anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - anIOR->SetValue(IOR); - return SALOMEDS::SObject::_narrow( newMesh )->GetID(); + return anEntry._retn(); } -const char* SMESH_Swig::AddNewHypothesis(const char* IOR) + +//=============================================================== +const char* +SMESH_Swig::AddNewHypothesis(const char* theIOR) { - MESSAGE("AddNewHypothesis"); - // VSR: added temporarily - to be removed - objects are published automatically by engine - SALOMEDS::SObject_var SO = myStudy->FindObjectIOR( IOR ); - if ( !SO->_is_nil() ) - return SO->GetID(); - - //Find or Create Hypothesis root - SALOMEDS::SObject_var HypothesisRoot; - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - SALOMEDS::AttributeIOR_var anIOR; - SALOMEDS::AttributeSelectable_var aSelAttr; - SALOMEDS::AttributePixMap_var aPixmap; - - if (!mySComponentMesh->FindSubObject (Tag_HypothesisRoot, HypothesisRoot)) { - HypothesisRoot = myStudyBuilder->NewObjectToTag (mySComponentMesh, Tag_HypothesisRoot); - anAttr = myStudyBuilder->FindOrCreateAttribute(HypothesisRoot, "AttributeName"); - aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue(QObject::tr("SMESH_MEN_HYPOTHESIS")); - anAttr = myStudyBuilder->FindOrCreateAttribute(HypothesisRoot, "AttributeSelectable"); - aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr); - aSelAttr->SetSelectable(false); - anAttr = myStudyBuilder->FindOrCreateAttribute(HypothesisRoot, "AttributePixMap"); - aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - aPixmap->SetPixMap( "ICON_SMESH_TREE_HYPO" ); - } - // Add New Hypothesis - SALOMEDS::SObject_var newHypo = myStudyBuilder->NewObject(HypothesisRoot); - anAttr = myStudyBuilder->FindOrCreateAttribute(newHypo, "AttributePixMap"); - aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - SMESH::SMESH_Hypothesis_var H = SMESH::SMESH_Hypothesis::_narrow( StringToObject(IOR) ); - QString aType = H->GetName(); - aPixmap->SetPixMap( "ICON_SMESH_TREE_HYPO_" + aType ); -// if ( aType.compare("LocalLength") == 0 ) -// aPixmap->SetPixMap( "ICON_SMESH_TREE_HYPO_LENGTH" ); -// else if ( aType.compare("NumberOfSegments") == 0 ) -// aPixmap->SetPixMap( "ICON_SMESH_TREE_HYPO_SEGMENT" ); -// else if ( aType.compare("MaxElementArea") == 0 ) -// aPixmap->SetPixMap( "ICON_SMESH_TREE_HYPO_AREA" ); -// else if ( aType.compare("MaxElementVolume") == 0 ) -// aPixmap->SetPixMap( "ICON_SMESH_TREE_HYPO_VOLUME" ); - anAttr = myStudyBuilder->FindOrCreateAttribute(newHypo, "AttributeIOR"); - anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - anIOR->SetValue(IOR); - return SALOMEDS::SObject::_narrow(newHypo)->GetID(); + MESSAGE("AddNewHypothesis"); + + SALOMEDS::SObject_var aSObject = ::AddHypothesis(theIOR, + mySComponentMesh, + myStudyBuilder); + CORBA::String_var anEntry = aSObject->GetID(); + return anEntry._retn(); } -const char* SMESH_Swig::AddNewAlgorithms(const char* IOR) + +//=============================================================== +const char* +SMESH_Swig::AddNewAlgorithms(const char* theIOR) { MESSAGE("AddNewAlgorithms"); - - // VSR: added temporarily - to be removed - objects are published automatically by engine - SALOMEDS::SObject_var SO = myStudy->FindObjectIOR( IOR ); - if ( !SO->_is_nil() ) - return SO->GetID(); - - //Find or Create Algorithms root - SALOMEDS::SObject_var AlgorithmsRoot; - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - SALOMEDS::AttributeIOR_var anIOR; - SALOMEDS::AttributeSelectable_var aSelAttr; - SALOMEDS::AttributePixMap_var aPixmap; - - if (!mySComponentMesh->FindSubObject (Tag_AlgorithmsRoot, AlgorithmsRoot)) { - AlgorithmsRoot = myStudyBuilder->NewObjectToTag (mySComponentMesh, Tag_AlgorithmsRoot); - anAttr = myStudyBuilder->FindOrCreateAttribute(AlgorithmsRoot, "AttributeName"); - aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue(QObject::tr("SMESH_MEN_ALGORITHMS")); - anAttr = myStudyBuilder->FindOrCreateAttribute(AlgorithmsRoot, "AttributeSelectable"); - aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr); - aSelAttr->SetSelectable(false); - anAttr = myStudyBuilder->FindOrCreateAttribute(AlgorithmsRoot, "AttributePixMap"); - aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - aPixmap->SetPixMap( "ICON_SMESH_TREE_ALGO" ); - } - // Add New Algorithms - SALOMEDS::SObject_var newHypo = myStudyBuilder->NewObject(AlgorithmsRoot); - anAttr = myStudyBuilder->FindOrCreateAttribute(newHypo, "AttributePixMap"); - aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - SMESH::SMESH_Hypothesis_var H = SMESH::SMESH_Hypothesis::_narrow( StringToObject(IOR) ); - QString aType = H->GetName(); - aPixmap->SetPixMap( "ICON_SMESH_TREE_ALGO_" + aType ); -// if ( aType.compare("Regular_1D") == 0 ) -// aPixmap->SetPixMap( "ICON_SMESH_TREE_ALGO_REGULAR" ); -// else if ( aType.compare("MEFISTO_2D") == 0 ) -// aPixmap->SetPixMap( "ICON_SMESH_TREE_ALGO_MEFISTO" ); -// else if ( aType.compare("Quadrangle_2D") == 0 ) -// aPixmap->SetPixMap( "ICON_SMESH_TREE_ALGO_QUAD" ); -// else if ( aType.compare("Hexa_3D") == 0 ) -// aPixmap->SetPixMap( "ICON_SMESH_TREE_ALGO_HEXA" ); - anAttr = myStudyBuilder->FindOrCreateAttribute(newHypo, "AttributeIOR"); - anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - anIOR->SetValue(IOR); - return SALOMEDS::SObject::_narrow(newHypo)->GetID(); + + SALOMEDS::SObject_var aSObject = ::AddAlgorithms(theIOR, + mySComponentMesh, + myStudyBuilder); + CORBA::String_var anEntry = aSObject->GetID(); + return anEntry._retn(); } -void SMESH_Swig::SetShape(const char* ShapeEntry, const char* MeshEntry) -{ - SALOMEDS::SObject_var SO_MorSM = myStudy->FindObjectID( MeshEntry ); - SALOMEDS::SObject_var SO_GeomShape = myStudy->FindObjectID( ShapeEntry ); - if ( !SO_MorSM->_is_nil() && !SO_GeomShape->_is_nil() ) { - SALOMEDS::SObject_var SO = myStudyBuilder->NewObjectToTag (SO_MorSM, Tag_RefOnShape); - myStudyBuilder->Addreference (SO,SO_GeomShape); +//=============================================================== +void +SMESH_Swig::SetShape(const char* theShapeEntry, + const char* theMeshEntry) +{ + SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID( theMeshEntry ); + SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID( theShapeEntry ); + + if(!aMeshSO->_is_nil() && !aGeomShapeSO->_is_nil()){ + SALOMEDS::SObject_var aSObject = myStudyBuilder->NewObjectToTag(aMeshSO,Tag_RefOnShape); + myStudyBuilder->Addreference(aSObject,aGeomShapeSO); } } -void SMESH_Swig::SetHypothesis(const char* Mesh_Or_SubMesh_Entry, const char* Hypothesis_Entry) + +//=============================================================== +void +SMESH_Swig::SetHypothesis(const char* theMeshOrSubMeshEntry, + const char* theDomainEntry) { - SALOMEDS::SObject_var SO_MorSM = myStudy->FindObjectID( Mesh_Or_SubMesh_Entry ); - SALOMEDS::SObject_var SO_Hypothesis = myStudy->FindObjectID( Hypothesis_Entry ); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - SALOMEDS::AttributeSelectable_var aSelAttr; - SALOMEDS::AttributePixMap_var aPixmap; - - if ( !SO_MorSM->_is_nil() && !SO_Hypothesis->_is_nil() ) { - - //Find or Create Applied Hypothesis root - SALOMEDS::SObject_var AHR; - if (!SO_MorSM->FindSubObject (Tag_RefOnAppliedHypothesis, AHR)) { - AHR = myStudyBuilder->NewObjectToTag (SO_MorSM, Tag_RefOnAppliedHypothesis); - anAttr = myStudyBuilder->FindOrCreateAttribute(AHR, "AttributeName"); - aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue(QObject::tr("SMESH_MEN_APPLIED_HYPOTHESIS")); - anAttr = myStudyBuilder->FindOrCreateAttribute(AHR, "AttributeSelectable"); - aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr); - aSelAttr->SetSelectable(false); - anAttr = myStudyBuilder->FindOrCreateAttribute(AHR, "AttributePixMap"); - aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - aPixmap->SetPixMap( "ICON_SMESH_TREE_HYPO" ); - } - SALOMEDS::SObject_var SO = myStudyBuilder->NewObject(AHR); - myStudyBuilder->Addreference (SO,SO_Hypothesis); - } + ::SetHypothesis(theMeshOrSubMeshEntry, + theDomainEntry, + myStudy, + myStudyBuilder); } -void SMESH_Swig::SetAlgorithms(const char* Mesh_Or_SubMesh_Entry, const char* Algorithms_Entry) + +//=============================================================== +void +SMESH_Swig::SetAlgorithms(const char* theMeshOrSubMeshEntry, + const char* theDomainEntry) { - SALOMEDS::SObject_var SO_MorSM = myStudy->FindObjectID( Mesh_Or_SubMesh_Entry ); - SALOMEDS::SObject_var SO_Algorithms = myStudy->FindObjectID( Algorithms_Entry ); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - SALOMEDS::AttributeSelectable_var aSelAttr; - SALOMEDS::AttributePixMap_var aPixmap; - - if ( !SO_MorSM->_is_nil() && !SO_Algorithms->_is_nil() ) { - //Find or Create Applied Algorithms root - SALOMEDS::SObject_var AHR; - if (!SO_MorSM->FindSubObject (Tag_RefOnAppliedAlgorithms, AHR)) { - AHR = myStudyBuilder->NewObjectToTag (SO_MorSM, Tag_RefOnAppliedAlgorithms); - anAttr = myStudyBuilder->FindOrCreateAttribute(AHR, "AttributeName"); - aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue(QObject::tr("SMESH_MEN_APPLIED_ALGORIHTMS")); - anAttr = myStudyBuilder->FindOrCreateAttribute(AHR, "AttributeSelectable"); - aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr); - aSelAttr->SetSelectable(false); - anAttr = myStudyBuilder->FindOrCreateAttribute(AHR, "AttributePixMap"); - aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - aPixmap->SetPixMap( "ICON_SMESH_TREE_ALGO" ); - } - SALOMEDS::SObject_var SO = myStudyBuilder->NewObject(AHR); - myStudyBuilder->Addreference (SO,SO_Algorithms); - } + ::SetAlgorithms(theMeshOrSubMeshEntry, + theDomainEntry, + myStudy, + myStudyBuilder); } -void SMESH_Swig::UnSetHypothesis(const char* Applied_Hypothesis_Entry ) + +//=============================================================== +void +SMESH_Swig::UnSetHypothesis(const char* theDomainEntry) { - SALOMEDS::SObject_var SO_Applied_Hypothesis = myStudy->FindObjectID( Applied_Hypothesis_Entry ); - if ( !SO_Applied_Hypothesis->_is_nil() ) - myStudyBuilder->RemoveObject(SO_Applied_Hypothesis); + SALOMEDS::SObject_var aDomainSO = myStudy->FindObjectID(theDomainEntry); + if(!aDomainSO->_is_nil()) + myStudyBuilder->RemoveObject(aDomainSO); } -const char* SMESH_Swig::AddSubMesh(const char* SO_Mesh_Entry, const char* SM_IOR, int ST) +const char* +SMESH_Swig::AddSubMesh(const char* theMeshEntry, + const char* theSubMeshIOR, + int theShapeType) { - SALOMEDS::SObject_var SO_Mesh = myStudy->FindObjectID( SO_Mesh_Entry ); - if ( !SO_Mesh->_is_nil() ) { - - long Tag_Shape ; - Standard_CString Name; - - if (ST == TopAbs_SOLID) {Tag_Shape = Tag_SubMeshOnSolid; Name = strdup(QObject::tr("SMESH_MEN_SubMeshesOnSolid"));} - else if (ST == TopAbs_FACE) {Tag_Shape = Tag_SubMeshOnFace; Name = strdup(QObject::tr("SMESH_MEN_SubMeshesOnFace"));} - else if (ST == TopAbs_EDGE) {Tag_Shape = Tag_SubMeshOnEdge; Name = strdup(QObject::tr("SMESH_MEN_SubMeshesOnEdge"));} - else if (ST == TopAbs_VERTEX){Tag_Shape = Tag_SubMeshOnVertex; Name = strdup(QObject::tr("SMESH_MEN_SubMeshesOnVertex"));} - else { - Tag_Shape = Tag_SubMeshOnCompound; Name = strdup(QObject::tr("SMESH_MEN_SubMeshesOnCompound")); + SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(theMeshEntry); + if(!aMeshSO->_is_nil()){ + long aShapeTag; + QString aSubMeshName; + switch(theShapeType){ + case TopAbs_SOLID: + aShapeTag = Tag_SubMeshOnSolid; + aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnSolid"); + break; + case TopAbs_FACE: + aShapeTag = Tag_SubMeshOnFace; + aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnFace"); + break; + case TopAbs_EDGE: + aShapeTag = Tag_SubMeshOnEdge; + aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnEdge"); + break; + case TopAbs_VERTEX: + aShapeTag = Tag_SubMeshOnVertex; + aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnVertex"); + break; + default: + aShapeTag = Tag_SubMeshOnCompound; + aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnCompound"); } - SALOMEDS::SObject_var SubmeshesRoot; - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - SALOMEDS::AttributeIOR_var anIOR; - SALOMEDS::AttributeSelectable_var aSelAttr; - if (!SO_Mesh->FindSubObject (Tag_Shape,SubmeshesRoot )) { - SubmeshesRoot = myStudyBuilder->NewObjectToTag (SO_Mesh, Tag_Shape); - anAttr = myStudyBuilder->FindOrCreateAttribute(SubmeshesRoot, "AttributeName"); - aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue(Name); - anAttr = myStudyBuilder->FindOrCreateAttribute(SubmeshesRoot, "AttributeSelectable"); - aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr); + + SALOMEDS::SObject_var aSubMeshesRoot; + SALOMEDS::GenericAttribute_var anAttr; + if(!aMeshSO->FindSubObject(aShapeTag,aSubMeshesRoot)){ + aSubMeshesRoot = myStudyBuilder->NewObjectToTag(aMeshSO,aShapeTag); + anAttr = myStudyBuilder->FindOrCreateAttribute(aSubMeshesRoot,"AttributeName"); + SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); + aName->SetValue(aSubMeshName.latin1()); + anAttr = myStudyBuilder->FindOrCreateAttribute(aSubMeshesRoot,"AttributeSelectable"); + SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr); aSelAttr->SetSelectable(false); } - free(Name); + SALOMEDS::SObject_var aSObject = myStudyBuilder->NewObject(aSubMeshesRoot); + anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeIOR"); + SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); + anIOR->SetValue(theSubMeshIOR); - SALOMEDS::SObject_var SO = myStudyBuilder->NewObject (SubmeshesRoot); - anAttr = myStudyBuilder->FindOrCreateAttribute(SO, "AttributeIOR"); - anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - anIOR->SetValue(SM_IOR); - return SALOMEDS::SObject::_narrow( SO )->GetID(); + CORBA::String_var aString = aSObject->GetID(); + return aString._retn(); } + return ""; } -const char* SMESH_Swig::AddSubMeshOnShape(const char* Mesh_Entry, const char* GeomShape_Entry, - const char* SM_IOR, int ST) +const char* +SMESH_Swig::AddSubMeshOnShape(const char* theMeshEntry, + const char* theGeomShapeEntry, + const char* theSubMeshIOR, + int ShapeType) { - SALOMEDS::SObject_var SO_GeomShape = myStudy->FindObjectID( GeomShape_Entry ); - if ( !SO_GeomShape->_is_nil() ) { - const char * SM_Entry = AddSubMesh (Mesh_Entry,SM_IOR,ST); - SALOMEDS::SObject_var SO_SM = myStudy->FindObjectID( SM_Entry ); - if ( !SO_SM->_is_nil() ) { - SetShape (GeomShape_Entry, SM_Entry); - return SALOMEDS::SObject::_narrow( SO_SM )->GetID(); + SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID(theGeomShapeEntry); + if(!aGeomShapeSO->_is_nil()){ + const char * aSubMeshEntry = AddSubMesh(theMeshEntry,theSubMeshIOR,ShapeType); + SALOMEDS::SObject_var aSubMeshSO = myStudy->FindObjectID(aSubMeshEntry); + if(!aSubMeshSO->_is_nil()){ + SetShape(theGeomShapeEntry,aSubMeshEntry); + CORBA::String_var aString = aSubMeshSO->GetID(); + return aString._retn(); } } + return ""; } @@ -442,29 +581,18 @@ void SMESH_Swig::CreateAndDisplayActor( const char* Mesh_Entry ) // SMESH_Actor* Mesh = smeshGUI->ReadScript(aM); } -void SMESH_Swig::SetName(const char* Entry, const char* Name) +void +SMESH_Swig::SetName(const char* theEntry, + const char* theName) { - SALOMEDS::SObject_var SO = myStudy->FindObjectID( Entry ); + SALOMEDS::SObject_var aSObject = myStudy->FindObjectID(theEntry); SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - if ( !SO->_is_nil() ) { - anAttr = myStudyBuilder->FindOrCreateAttribute(SO, "AttributeName"); + SALOMEDS::AttributeName_var aName; + if(!aSObject->_is_nil()){ + anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeName"); aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue(Name); - } -} - -void SMESH_Swig::setOrb() -{ - try { - ORB_INIT &init = *SINGLETON_::Instance(); - ASSERT(SINGLETON_::IsAlreadyExisting()); - _orb = init( 0 , 0 ); - } catch (...) { - INFOS("internal error : orb not found"); - _orb = 0; + aName->SetValue(theName); } - ASSERT(! CORBA::is_nil(_orb)); } //================================================================================ @@ -475,12 +603,35 @@ void SMESH_Swig::setOrb() */ //================================================================================ -void SMESH_Swig::SetMeshIcon(const char* Mesh_Entry, const bool isComputed) +void SMESH_Swig::SetMeshIcon(const char* theMeshEntry, + const bool theIsComputed) { - SALOMEDS::SObject_var mesh_var = myStudy->FindObjectID( Mesh_Entry ); - if ( !mesh_var->_is_nil() ) { - _PTR(SObject) mesh = _PTR(SObject)(new SALOMEDS_SObject( mesh_var )); - if ( mesh ) - SMESH::ModifiedMesh( mesh, isComputed ); - } + class TEvent: public SALOME_Event + { + SALOMEDS::Study_var myStudy; + std::string myMeshEntry; + bool myIsComputed; + public: + TEvent(const SALOMEDS::Study_var& theStudy, + const std::string& theMeshEntry, + const bool theIsComputed): + myStudy(theStudy), + myMeshEntry(theMeshEntry), + myIsComputed(theIsComputed) + {} + + virtual + void + Execute() + { + SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(myMeshEntry.c_str()); + if(!aMeshSO->_is_nil()) + if(_PTR(SObject) aMesh = ClientFactory::SObject(aMeshSO)) + SMESH::ModifiedMesh(aMesh,myIsComputed); + } + }; + + ProcessVoidEvent(new TEvent(myStudy, + theMeshEntry, + theIsComputed)); } diff --git a/src/SMESHGUI/SMESHGUI_Swig.hxx b/src/SMESHGUI/SMESHGUI_Swig.hxx index 3fe481828..3b7e69e73 100644 --- a/src/SMESHGUI/SMESHGUI_Swig.hxx +++ b/src/SMESHGUI/SMESHGUI_Swig.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -42,8 +42,6 @@ public: SMESH_Swig(); ~SMESH_Swig(); - static void setOrb(); - void Init(int studyID); const char* AddNewMesh(const char* IOR); @@ -76,20 +74,6 @@ private: SALOMEDS::Study_var myStudy; SALOMEDS::StudyBuilder_var myStudyBuilder; SALOMEDS::SComponent_var mySComponentMesh; - - // Tags definition - long Tag_HypothesisRoot; - long Tag_AlgorithmsRoot; - - long Tag_RefOnShape; - long Tag_RefOnAppliedHypothesis; - long Tag_RefOnAppliedAlgorithms; - - long Tag_SubMeshOnVertex; - long Tag_SubMeshOnEdge; - long Tag_SubMeshOnFace; - long Tag_SubMeshOnSolid; - long Tag_SubMeshOnCompound; }; diff --git a/src/SMESHGUI/SMESHGUI_Swig.i b/src/SMESHGUI/SMESHGUI_Swig.i index 2a99fe192..eadd476e4 100644 --- a/src/SMESHGUI/SMESHGUI_Swig.i +++ b/src/SMESHGUI/SMESHGUI_Swig.i @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 1137ec4ec..f0689d5d8 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -42,6 +42,10 @@ #include "SUIT_Desktop.h" #include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" + +#include "LightApp_Application.h" #include "SVTK_ViewModel.h" #include "SVTK_ViewWindow.h" @@ -142,6 +146,10 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule, const char* nam GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton(GroupButtons, "buttonCancel"); buttonCancel->setText(tr("SMESH_BUT_CLOSE" )); buttonCancel->setAutoDefault(TRUE); @@ -294,12 +302,15 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule, const char* nam myMeshOrSubMeshOrGroupFilter = new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR); + myHelpFileName = "/files/symmetry.htm"; + Init(); /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int))); connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); @@ -317,10 +328,6 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule, const char* nam connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); /* displays Dialog */ ConstructorsClicked(0); @@ -519,6 +526,23 @@ void SMESHGUI_SymmetryDlg::ClickOnCancel() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_SymmetryDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= // function : onTextChange() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.h b/src/SMESHGUI/SMESHGUI_SymmetryDlg.h index f5efd5e10..4714ac0b5 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.h +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -102,6 +102,7 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; QGroupBox* GroupArguments; QGroupBox* GroupMirror; QLabel* TextLabelElements; @@ -127,6 +128,8 @@ private: SMESHGUI_SpinBox* SpinBox_DZ; QCheckBox* CheckBoxCopy; + + QString myHelpFileName; private slots: @@ -134,6 +137,7 @@ private: void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); void SetEditCurrentArgument() ; void SelectionIntoArgument() ; void DeactivateActiveDialog() ; diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index c6c58b328..48e6fafb5 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -42,6 +42,10 @@ #include "SUIT_Desktop.h" #include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" + +#include "LightApp_Application.h" #include "SVTK_ViewModel.h" #include "SVTK_Selection.h" @@ -132,6 +136,10 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP" )); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton(GroupButtons, "buttonCancel"); buttonCancel->setText(tr("SMESH_BUT_CLOSE" )); buttonCancel->setAutoDefault(TRUE); @@ -274,12 +282,15 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha myMeshOrSubMeshOrGroupFilter = new SMESH_LogicalFilter(aListOfFilters, SMESH_LogicalFilter::LO_OR); + myHelpFileName = "/files/translation.htm"; + Init(); /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int))); connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument())); @@ -293,10 +304,6 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); /* displays Dialog */ ConstructorsClicked(0); @@ -481,6 +488,23 @@ void SMESHGUI_TranslationDlg::ClickOnCancel() reject(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_TranslationDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= // function : onTextChange() // purpose : @@ -653,7 +677,7 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument() if (myEditCurrentArgument == (QWidget*)SpinBox1_1) { SpinBox1_1->SetValue(x); SpinBox1_2->SetValue(y); - SpinBox2_3->SetValue(z); + SpinBox1_3->SetValue(z); } else if (myEditCurrentArgument == (QWidget*)SpinBox2_1) { SpinBox2_1->SetValue(x); SpinBox2_2->SetValue(y); diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.h b/src/SMESHGUI/SMESHGUI_TranslationDlg.h index fbbb19ae4..6459dce48 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.h +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -100,6 +100,7 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; QGroupBox* GroupArguments; QLabel* TextLabelElements; QPushButton* SelectElementsButton; @@ -122,6 +123,8 @@ private: QLabel* TextLabel2_3; SMESHGUI_SpinBox* SpinBox2_3; QCheckBox* CheckBoxCopy; + + QString myHelpFileName; private slots: @@ -129,6 +132,7 @@ private: void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); void SetEditCurrentArgument() ; void SelectionIntoArgument() ; void DeactivateActiveDialog() ; diff --git a/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx b/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx index b390e717a..6e1872311 100644 --- a/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -35,12 +35,15 @@ #include "SUIT_Desktop.h" #include "SUIT_OverrideCursor.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" #include "SALOME_ListIO.hxx" #include "SALOME_ListIteratorOfListIO.hxx" #include "SALOME_InteractiveObject.hxx" #include "SalomeApp_Study.h" +#include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" #include "SVTK_ViewWindow.h" @@ -129,9 +132,15 @@ SMESHGUI_TransparencyDlg::SMESHGUI_TransparencyDlg( SMESHGUI* theModule, buttonOk->setText(tr("SMESH_BUT_CLOSE")); buttonOk->setAutoDefault(TRUE); buttonOk->setDefault(TRUE); - GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 0); - GroupButtonsLayout->addWidget(buttonOk, 0, 1); - GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2); + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("SMESH_BUT_HELP")); + buttonHelp->setAutoDefault(TRUE); + + //GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 0); + GroupButtonsLayout->addWidget(buttonOk, 0, 0); + GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1); + GroupButtonsLayout->addWidget(buttonHelp, 0, 2); + //GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2); SMESHGUI_TransparencyDlgLayout->addWidget(GroupC1, 0, 0); SMESHGUI_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0); @@ -141,15 +150,14 @@ SMESHGUI_TransparencyDlg::SMESHGUI_TransparencyDlg( SMESHGUI* theModule, // signals and slots connections : after ValueHasChanged() connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(Slider1, SIGNAL(valueChanged(int)), this, SLOT(SetTransparency())); connect(Slider1, SIGNAL(sliderMoved(int)), this, SLOT(ValueHasChanged())); connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnOk())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged())); - /* Move widget on the botton right corner of main widget */ - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); + myHelpFileName = "transparency.htm"; + this->show(); } @@ -171,6 +179,23 @@ void SMESHGUI_TransparencyDlg::ClickOnOk() close(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_TransparencyDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : SetTransparency() // purpose : Called when value of slider change diff --git a/src/SMESHGUI/SMESHGUI_TransparencyDlg.h b/src/SMESHGUI/SMESHGUI_TransparencyDlg.h index 1e182404c..7909ae9ea 100644 --- a/src/SMESHGUI/SMESHGUI_TransparencyDlg.h +++ b/src/SMESHGUI/SMESHGUI_TransparencyDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -65,14 +65,18 @@ private : SVTK_ViewWindow* myViewWindow; QPushButton* buttonOk; + QPushButton* buttonHelp; QLabel* TextLabelOpaque; QLabel* ValueLab; QLabel* TextLabelTransparent; QSlider* Slider1; + QString myHelpFileName; + public slots: void ClickOnOk(); + void ClickOnHelp(); void ValueHasChanged(); void SetTransparency(); void onSelectionChanged(); diff --git a/src/SMESHGUI/SMESHGUI_Utils.cxx b/src/SMESHGUI/SMESHGUI_Utils.cxx index 94714bcd7..04ae86959 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.cxx +++ b/src/SMESHGUI/SMESHGUI_Utils.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include @@ -153,6 +153,32 @@ namespace SMESH{ if (aComment) aComment->SetValue(theValue); } + + void setFileName (_PTR(SObject) theSObject, const char* theValue) + { + _PTR(Study) aStudy = GetActiveStudyDocument(); + if (aStudy->GetProperties()->IsLocked()) + return; + _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); + _PTR(GenericAttribute) anAttr = + aBuilder->FindOrCreateAttribute(theSObject, "AttributeExternalFileDef"); + _PTR(AttributeExternalFileDef) aFileName = anAttr; + if (aFileName) + aFileName->SetValue(theValue); + } + + void setFileType (_PTR(SObject) theSObject, const char* theValue) + { + _PTR(Study) aStudy = GetActiveStudyDocument(); + if (aStudy->GetProperties()->IsLocked()) + return; + _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); + _PTR(GenericAttribute) anAttr = + aBuilder->FindOrCreateAttribute(theSObject, "AttributeFileType"); + _PTR(AttributeFileType) aFileType = anAttr; + if (aFileType) + aFileType->SetValue(theValue); + } CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject, _PTR(Study) theStudy) diff --git a/src/SMESHGUI/SMESHGUI_Utils.h b/src/SMESHGUI/SMESHGUI_Utils.h index 0ab0529c5..d4c973f14 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.h +++ b/src/SMESHGUI/SMESHGUI_Utils.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef SMESHGUI_Utils_HeaderFile #define SMESHGUI_Utils_HeaderFile @@ -96,6 +96,8 @@ SMESHGUI_EXPORT SMESHGUI_EXPORT void SetValue (_PTR(SObject) theSObject, const char* theValue); + void setFileType (_PTR(SObject) theSObject, const char* theValue); + void setFileName (_PTR(SObject) theSObject, const char* theValue); SMESHGUI_EXPORT CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject, diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index 76a8cb1a6..4e5c883c1 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "SMESHGUI_VTKUtils.h" diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.h b/src/SMESHGUI/SMESHGUI_VTKUtils.h index 5c12a857a..74b383c71 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.h +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef SMESHGUI_VTKUtils_HeaderFile #define SMESHGUI_VTKUtils_HeaderFile diff --git a/src/SMESHGUI/SMESHGUI_XmlHandler.cxx b/src/SMESHGUI/SMESHGUI_XmlHandler.cxx index 6210f6500..2c6065cee 100644 --- a/src/SMESHGUI/SMESHGUI_XmlHandler.cxx +++ b/src/SMESHGUI/SMESHGUI_XmlHandler.cxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -143,10 +143,23 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&, if ( isOk ) aDim.append( aVal - 1 ); } + + // for algo + enum { HYPOS = 0, OPT_HYPOS, INPUT, OUTPUT, NB_ATTRIBUTES }; + const char* name [NB_ATTRIBUTES] = { "hypos", "opt-hypos", "input", "output" }; + QStringList attr [NB_ATTRIBUTES]; + for ( int i = 0; i < NB_ATTRIBUTES; ++i ) { + QString aStr = atts.value( name[i] ); + if ( !aStr.isEmpty() ) { + aStr.remove( ' ' ); + attr[ i ] = QStringList::split( ',', aStr ); + } + } HypothesisData* aHypLibNames = - new HypothesisData (myPluginName, myServerLib, myClientLib, - aLabel, anIcon, aDim, isAux ); + new HypothesisData (aHypAlType, myPluginName, myServerLib, myClientLib, + aLabel, anIcon, aDim, isAux, + attr[ HYPOS ], attr[ OPT_HYPOS ], attr[ INPUT ], attr[ OUTPUT ]); if (qName == "algorithm") { diff --git a/src/SMESHGUI/SMESHGUI_XmlHandler.h b/src/SMESHGUI/SMESHGUI_XmlHandler.h index c653c473d..b71f59e58 100644 --- a/src/SMESHGUI/SMESHGUI_XmlHandler.h +++ b/src/SMESHGUI/SMESHGUI_XmlHandler.h @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESHGUI_aParameter.h b/src/SMESHGUI/SMESHGUI_aParameter.h index d8933731e..5bb79a04a 100644 --- a/src/SMESHGUI/SMESHGUI_aParameter.h +++ b/src/SMESHGUI/SMESHGUI_aParameter.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESHGUI/SMESH_icons.po b/src/SMESHGUI/SMESH_icons.po index 60dff5a19..889e4031b 100644 --- a/src/SMESHGUI/SMESH_icons.po +++ b/src/SMESHGUI/SMESH_icons.po @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # This is a Qt message file in .po format. Each msgid starts with # a scope. This scope should *NOT* be translated - eg. "Foo::Bar" # would be translated to "Pub", not "Foo::Pub". @@ -155,7 +174,33 @@ msgstr "mesh_tetra.png" msgid "ICON_DLG_HEXAS" msgstr "mesh_hexa.png" +#Quadratic Edge +msgid "ICON_DLG_QUADRATIC_EDGE" +msgstr "mesh_quad_edge.png" + +#Quadratic Triangle +msgid "ICON_DLG_QUADRATIC_TRIANGLE" +msgstr "mesh_quad_triangle.png" + +#Quadratic Quadrangle +msgid "ICON_DLG_QUADRATIC_QUADRANGLE" +msgstr "mesh_quad_quadrangle.png" + +#Quadratic Tetrahedron +msgid "ICON_DLG_QUADRATIC_TETRAHEDRON" +msgstr "mesh_quad_tetrahedron.png" + +#Quadratic Pyramid +msgid "ICON_DLG_QUADRATIC_PYRAMID" +msgstr "mesh_quad_pyramid.png" + +#Quadratic Pentahedron +msgid "ICON_DLG_QUADRATIC_PENTAHEDRON" +msgstr "mesh_quad_pentahedron.png" +#Quadratic Hexahedron +msgid "ICON_DLG_QUADRATIC_HEXAHEDRON" +msgstr "mesh_quad_hexahedron.png" #----------------------------------------------------------- # ObjectBrowser #----------------------------------------------------------- diff --git a/src/SMESHGUI/SMESH_images.po b/src/SMESHGUI/SMESH_images.po index 2825f19a8..37378d9d4 100644 --- a/src/SMESHGUI/SMESH_images.po +++ b/src/SMESHGUI/SMESH_images.po @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # This is a Qt message file in .po format. Each msgid starts with # a scope. This scope should *NOT* be translated - eg. "Foo::Bar" # would be translated to "Pub", not "Foo::Pub". @@ -170,6 +189,35 @@ msgstr "mesh_hexa.png" #Polyhedre msgid "ICON_DLG_POLYHEDRON" msgstr "mesh_polyhedron.png" + +#Quadratic Edge +msgid "ICON_DLG_QUADRATIC_EDGE" +msgstr "mesh_quad_edge.png" + +#Quadratic Triangle +msgid "ICON_DLG_QUADRATIC_TRIANGLE" +msgstr "mesh_quad_triangle.png" + +#Quadratic Quadrangle +msgid "ICON_DLG_QUADRATIC_QUADRANGLE" +msgstr "mesh_quad_quadrangle.png" + +#Quadratic Tetrahedron +msgid "ICON_DLG_QUADRATIC_TETRAHEDRON" +msgstr "mesh_quad_tetrahedron.png" + +#Quadratic Pyramid +msgid "ICON_DLG_QUADRATIC_PYRAMID" +msgstr "mesh_quad_pyramid.png" + +#Quadratic Pentahedron +msgid "ICON_DLG_QUADRATIC_PENTAHEDRON" +msgstr "mesh_quad_pentahedron.png" + +#Quadratic Hexahedron +msgid "ICON_DLG_QUADRATIC_HEXAHEDRON" +msgstr "mesh_quad_hexahedron.png" + #----------------------------------------------------------- # ObjectBrowser #----------------------------------------------------------- @@ -339,3 +387,6 @@ msgstr "mesh_pattern.png" msgid "ICON_FILE_OPEN" msgstr "open.png" + +msgid "ICON_CONV_TO_QUAD" +msgstr "mesh_conv_to_quad.png" \ No newline at end of file diff --git a/src/SMESHGUI/SMESH_msg_en.po b/src/SMESHGUI/SMESH_msg_en.po index c6134226f..846b785cb 100644 --- a/src/SMESHGUI/SMESH_msg_en.po +++ b/src/SMESHGUI/SMESH_msg_en.po @@ -1,8 +1,25 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Free Software Foundation, Inc. -# FIRST AUTHOR , YEAR. +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # -#, fuzzy +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# This is a Qt message file in .po format. Each msgid starts with +# a scope. This scope should *NOT* be translated - eg. "Foo::Bar" +# would be translated to "Pub", not "Foo::Pub". msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" @@ -39,6 +56,10 @@ msgstr "&No" msgid "SMESH_BUT_CANCEL" msgstr "&Cancel" +#Help +msgid "SMESH_BUT_HELP" +msgstr "&Help" + #Add msgid "SMESH_BUT_ADD" msgstr "A&dd" @@ -131,6 +152,10 @@ msgstr "Activate Link Selection Mode" msgid "SMESH_WRN_EMPTY_NAME" msgstr "Empty name is not valid" +#Smesh polyedre cretion error +msgid "SMESH_POLYEDRE_CREATE_ERROR" +msgstr "Polyedron creation error" + #------------------------------------------------------------------------- # MEN #------------------------------------------------------------------------- @@ -743,7 +768,17 @@ msgstr "Standard Mesh Infos" msgid "SMESH_MESHINFO_NAME" msgstr "Name" -#Faces : +#Order : +msgid "SMESH_MESHINFO_ORDER0" +msgstr "Total" + +msgid "SMESH_MESHINFO_ORDER1" +msgstr "Linear" + +msgid "SMESH_MESHINFO_ORDER2" +msgstr "Quadratic" + +#Elements : msgid "SMESH_MESHINFO_ELEMENTS" msgstr "Elements" @@ -901,6 +936,14 @@ msgstr "Group on geometry" msgid "SMESH_GEOM_GROUP" msgstr "Geometry group" +#Color group +msgid "SMESH_SET_COLOR" +msgstr "Color group" + +#Check color group +msgid "SMESH_CHECK_COLOR" +msgstr "Color number" + #%1 SubMeshes msgid "SMESH_SUBMESH_SELECTED" msgstr "%1 SubMeshes" @@ -1206,6 +1249,9 @@ msgstr "Such dimention hypothesis is already assigned to the shape" msgid "SMESH_HYP_8" msgstr "Hypothesis and submesh dimensions mismatch" +msgid "SMESH_HYP_9" +msgstr "Shape is neither the main one, nor its subshape, nor a valid group" + msgid "MISSING_ALGO" msgstr "%3 %2D algorithm is missing" @@ -1244,6 +1290,13 @@ msgid "SMESH_EXPORT_UNV" msgstr "During export mesh with name - \"%1\" to UNV\n" " pyramid's elements will be missed" +msgid "SMESH_EXPORT_MED_DUPLICATED_GRP" +msgstr "There are duplicated group names in mesh \"%1\".\n" + "You can cancel exporting and rename them,\n" + "otherwise some group names in the resulting MED file\n" + "will not match ones in the study.\n" + "Do you want to continue ?" + msgid "SMESH_EXPORT_MED_V2_1" msgstr "During export mesh with name - \"%1\" to MED 2.1\n" "polygons and polyhedrons elements will be missed\n" @@ -1776,6 +1829,9 @@ msgstr "Faces by nodes" msgid "SMESHGUI_CreatePolyhedralVolumeDlg::SMESH_POLYEDRE_PREVIEW" msgstr "Polyhedron preview" +msgid "SMESHGUI_CreatePolyhedralVolumeDlg::SMESH_POLYEDRE_CREATE_ERROR" +msgstr "Polyhedron creation error." + msgid "SMESH_CREATE_POLYHEDRAL_VOLUME_TITLE" msgstr "Create polyhedral volume" @@ -1788,6 +1844,80 @@ msgstr "Polygon" msgid "SMESH_ADD_POLYGON" msgstr "Add polygon" +msgid "SMESH_ADD_QUADRATIC_EDGE_TITLE" +msgstr "Add Quadratic Edge" + +msgid "SMESH_ADD_QUADRATIC_TRIANGLE_TITLE" +msgstr "Add Quadratic Triangle" + +msgid "SMESH_ADD_QUADRATIC_QUADRANGLE_TITLE" +msgstr "Add Quadratic Quadrangle" + +msgid "SMESH_ADD_QUADRATIC_TETRAHEDRON_TITLE" +msgstr "Add Quadratic Tetrahedron" + +msgid "SMESH_ADD_QUADRATIC_PYRAMID_TITLE" +msgstr "Add Quadratic Pyramid" + +msgid "SMESH_ADD_QUADRATIC_PENTAHEDRON_TITLE" +msgstr "Add Quadratic Pentahedron" + +msgid "SMESH_ADD_QUADRATIC_HEXAHEDRON_TITLE" +msgstr "Add Quadratic Hexahedron" + +msgid "SMESH_QUADRATIC_EDGE" +msgstr "Quadratic Edge" + +msgid "SMESH_QUADRATIC_TRIANGLE" +msgstr "Quadratic Triangle" + +msgid "SMESH_QUADRATIC_QUADRANGLE" +msgstr "Quadratic Quadrangle" + +msgid "SMESH_QUADRATIC_TETRAHEDRON" +msgstr "Quadratic Tetrahedron" + +msgid "SMESH_QUADRATIC_PYRAMID" +msgstr "Quadratic Pyramid" + +msgid "SMESH_QUADRATIC_PENTAHEDRON" +msgstr "Quadratic Pentahedron" + +msgid "SMESH_QUADRATIC_HEXAHEDRON" +msgstr "Quadratic Hexahedron" + +msgid "SMESHGUI_AddQuadraticElementDlg::SMESH_CORNER_NODES" +msgstr "Corner Nodes:" + +msgid "SMESHGUI_AddQuadraticElementDlg::SMESH_ADD_QUADRATIC_EDGE" +msgstr "Add Quadratic Edge" + +msgid "SMESHGUI_AddQuadraticElementDlg::SMESH_ADD_QUADRATIC_TRIANGLE" +msgstr "Add Quadratic Triangle" + +msgid "SMESHGUI_AddQuadraticElementDlg::SMESH_ADD_QUADRATIC_QUADRANGLE" +msgstr "Add Quadratic Quadrangle" + +msgid "SMESHGUI_AddQuadraticElementDlg::SMESH_ADD_QUADRATIC_TETRAHEDRON" +msgstr "Add Quadratic Tetrahedron" + +msgid "SMESHGUI_AddQuadraticElementDlg::SMESH_ADD_QUADRATIC_PYRAMID" +msgstr "Add Quadratic Pyramid" + +msgid "SMESHGUI_AddQuadraticElementDlg::SMESH_ADD_QUADRATIC_PENTAHEDRON" +msgstr "Add Quadratic Pentahedron" + +msgid "SMESHGUI_AddQuadraticElementDlg::SMESH_ADD_QUADRATIC_HEXAHEDRON" +msgstr "Add Quadratic Hexahedron" + +msgid "SMESHGUI_AddQuadraticElementDlg::SMESH_FIRST" +msgstr "First" + +msgid "SMESHGUI_AddQuadraticElementDlg::SMESH_MIDDLE" +msgstr "Middle" + +msgid "SMESHGUI_AddQuadraticElementDlg::SMESH_LAST" +msgstr "Last" #---------------------------------------------------- msgid "SMESHGUI_CreatePatternDlg::CAPTION" @@ -1838,6 +1968,9 @@ msgstr "It is impossible to create pattern from narrow face" msgid "SMESHGUI_CreatePatternDlg::ERR_LOADF_CLOSED_FACE" msgstr "It is impossible to create pattern from face having seam edge" +msgid "SMESHGUI_CreatePatternDlg::ERR_LOADF_CANT_PROJECT" +msgstr "Impossible to perform projection of nodes to the face" + msgid "SMESHGUI_CreatePatternDlg::ERR_LOADV_BAD_SHAPE" msgstr "Pattern can be created from closed shell or solid with 6 faces only" @@ -2002,6 +2135,27 @@ msgstr "Polygon" msgid "MEN_POLYHEDRON" msgstr "Polyhedron" +msgid "MEN_QUADRATIC_EDGE" +msgstr "Quadratic Edge" + +msgid "MEN_QUADRATIC_TRIANGLE" +msgstr "Quadratic Triangle" + +msgid "MEN_QUADRATIC_QUADRANGLE" +msgstr "Quadratic Quadrangle" + +msgid "MEN_QUADRATIC_TETRAHEDRON" +msgstr "Quadratic Tetrahedron" + +msgid "MEN_QUADRATIC_PYRAMID" +msgstr "Quadratic Pyramid" + +msgid "MEN_QUADRATIC_PENTAHEDRON" +msgstr "Quadratic Pentahedron" + +msgid "MEN_QUADRATIC_HEXAHEDRON" +msgstr "Quadratic Hexahedron" + msgid "MEN_NODES" msgstr "Nodes" @@ -2065,6 +2219,9 @@ msgstr "Revolution" msgid "MEN_MAP" msgstr "Pattern mapping" +msgid "MEN_CONV_TO_QUAD" +msgstr "Convert to/from quadratic" + msgid "MEN_EXTRUSION_ALONG" msgstr "Extrusion along a path" @@ -2331,6 +2488,27 @@ msgstr "Polygon" msgid "TOP_POLYHEDRON" msgstr "Polyhedron" +msgid "TOP_QUADRATIC_EDGE" +msgstr "Quadratic Edge" + +msgid "TOP_QUADRATIC_TRIANGLE" +msgstr "Quadratic Triangle" + +msgid "TOP_QUADRATIC_QUADRANGLE" +msgstr "Quadratic Quadrangle" + +msgid "TOP_QUADRATIC_TETRAHEDRON" +msgstr "Quadratic Tetrahedron" + +msgid "TOP_QUADRATIC_PYRAMID" +msgstr "Quadratic Pyramid" + +msgid "TOP_QUADRATIC_PENTAHEDRON" +msgstr "Quadratic Pentahedron" + +msgid "TOP_QUADRATIC_HEXAHEDRON" +msgstr "Quadratic Hexahedron" + msgid "TOP_NODES" msgstr "Nodes" @@ -2394,6 +2572,9 @@ msgstr "Revolution" msgid "TOP_MAP" msgstr "Pattern mapping" +msgid "TOP_CONV_TO_QUAD" +msgstr "Convert to/from quadratic" + msgid "TOP_EXTRUSION_ALONG" msgstr "Extrusion along a path" @@ -2611,6 +2792,27 @@ msgstr "Polygon" msgid "STB_POLYHEDRON" msgstr "Polyhedron" +msgid "STB_QUADRATIC_EDGE" +msgstr "Quadratic Edge" + +msgid "STB_QUADRATIC_TRIANGLE" +msgstr "Quadratic Triangle" + +msgid "STB_QUADRATIC_QUADRANGLE" +msgstr "Quadratic Quadrangle" + +msgid "STB_QUADRATIC_TETRAHEDRON" +msgstr "Quadratic Tetrahedron" + +msgid "STB_QUADRATIC_PYRAMID" +msgstr "Quadratic Pyramid" + +msgid "STB_QUADRATIC_PENTAHEDRON" +msgstr "Quadratic Pentahedron" + +msgid "STB_QUADRATIC_HEXAHEDRON" +msgstr "Quadratic Hexahedron" + msgid "STB_NODES" msgstr "Nodes" @@ -2674,6 +2876,9 @@ msgstr "Revolution" msgid "STB_MAP" msgstr "Pattern mapping" +msgid "STB_CONV_TO_QUAD" +msgstr "Convert to/from quadratic" + msgid "STB_EXTRUSION_ALONG" msgstr "Extrusion along a path" @@ -2971,3 +3176,27 @@ msgstr "Geometry object is not a subshape of the shape to mesh" msgid "SMESHGUI_MeshOp::MESH_IS_NOT_DEFINED" msgstr "Mesh is not defined\nPlease specify it and try again" + + +#----------------------------------------------------------- + +msgid "SMESHGUI_ConvToQuadDlg::CAPTION" +msgstr "Convert to/from quadratic" + +msgid "SMESHGUI_ConvToQuadDlg::MESH" +msgstr "Mesh" + +msgid "SMESHGUI_ConvToQuadDlg::MEDIUMNDS" +msgstr "Medium nodes on geometry" + +msgid "SMESHGUI_ConvToQuadDlg::RADIOBTN_1" +msgstr "Convert to quadratic" + +msgid "SMESHGUI_ConvToQuadDlg::RADIOBTN_2" +msgstr "Convert from quadratic" + +msgid "SMESHGUI_ConvToQuadOp::MESH_IS_NOT_SELECTED" +msgstr "Mesh is not selected\nPlease specify it and try again" + +msgid "SMESHGUI_ConvToQuadOp::REF_IS_NULL" +msgstr "No valid mesh object selected" diff --git a/src/SMESH_I/Makefile.in b/src/SMESH_I/Makefile.in index 179743728..2558e560f 100644 --- a/src/SMESH_I/Makefile.in +++ b/src/SMESH_I/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -60,48 +60,114 @@ LIB_SRC = \ SMESH_DumpPython.cxx \ SMESH_Mesh_i.cxx \ SMESH_MEDMesh_i.cxx \ - SMESH_MEDFamily_i.cxx \ + SMESH_MEDFamily_i.cxx \ SMESH_MEDSupport_i.cxx \ - SMESH_subMesh_i.cxx \ - SMESH_MeshEditor_i.cxx \ - SMESH_Hypothesis_i.cxx \ - SMESH_Algo_i.cxx \ - SMESH_1D_Algo_i.cxx \ - SMESH_2D_Algo_i.cxx \ - SMESH_3D_Algo_i.cxx \ + SMESH_subMesh_i.cxx \ + SMESH_MeshEditor_i.cxx \ + SMESH_Hypothesis_i.cxx \ + SMESH_Algo_i.cxx \ + SMESH_1D_Algo_i.cxx \ + SMESH_2D_Algo_i.cxx \ + SMESH_3D_Algo_i.cxx \ SMESH_Filter_i.cxx \ SMESH_Group_i.cxx \ SMESH_Pattern_i.cxx \ SMESH_2smeshpy.cxx -LIB_SERVER_IDL = SMESH_Gen.idl SMESH_Hypothesis.idl SMESH_Mesh.idl \ - SALOME_Component.idl SALOME_Exception.idl \ - SMESH_Filter.idl SMESH_Group.idl SMESH_Pattern.idl - -LIB_CLIENT_IDL = SALOMEDS.idl GEOM_Gen.idl MED.idl SALOMEDS_Attributes.idl SALOME_GenericObj.idl SALOME_Comm.idl +LIB_SERVER_IDL = \ + SMESH_Gen.idl \ + SMESH_Hypothesis.idl \ + SMESH_Mesh.idl \ + SALOME_Component.idl \ + SALOME_Exception.idl \ + SMESH_Filter.idl \ + SMESH_Group.idl \ + SMESH_Pattern.idl + +LIB_CLIENT_IDL = \ + SALOMEDS.idl \ + GEOM_Gen.idl \ + MED.idl \ + SALOMEDS_Attributes.idl \ + SALOME_GenericObj.idl \ + SALOME_Comm.idl # Executables targets BIN = SMESHEngine BIN_SRC = # additionnal information to compil and link file -CPPFLAGS+= $(OCC_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \ - -I${MED_ROOT_DIR}/include/salome -I${GEOM_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) -CXXFLAGS+= $(OCC_CXXFLAGS) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \ - -I${MED_ROOT_DIR}/include/salome -I${GEOM_ROOT_DIR}/include/salome - -LDFLAGS+= -L${KERNEL_ROOT_DIR}/lib/salome -lSalomeContainer -lSalomeNS -lRegistry -lSalomeHDFPersist -lSalomeLifeCycleCORBA -lTOOLSDS -lSalomeGenericObj \ - -L${GEOM_ROOT_DIR}/lib/salome -lGEOMClient -lSMESHimpl -lSMESHControls \ - $(OCC_LDPATH) -lTKCDF -lTKBO - - -LDFLAGSFORBIN += -lSMDS -lSMESHDS \ - -L${MED_ROOT_DIR}/lib/salome -lMEDWrapper -lMEDWrapperBase -lMEDWrapper_V2_1 -lMEDWrapper_V2_2 -lmed_V2_1 \ - -lMeshDriver -lMeshDriverMED -lMeshDriverUNV -lMeshDriverDAT -lMeshDriverSTL \ - -L${KERNEL_ROOT_DIR}/lib/salome -lSalomeContainer -lSalomeNS -lRegistry -lSalomeResourcesManager \ - -lOpUtil -lSALOMELocalTrace -lSALOMEBasics -lSalomeNotification -lCASCatch \ - -lSalomeHDFPersist -lSalomeLifeCycleCORBA -lTOOLSDS -lSalomeGenericObj \ - -L${GEOM_ROOT_DIR}/lib/salome -lGEOMClient -lSMESHimpl -lSMESHControls -lNMTTools -lNMTDS \ - $(OCC_LDPATH) -lTKCDF -lTKBO -lTKMath +CPPFLAGS+= \ + $(OCC_INCLUDES) \ + $(HDF5_INCLUDES) \ + $(BOOST_CPPFLAGS) \ + $(KERNEL_CXXFLAGS) \ + $(MED_CXXFLAGS) \ + $(GEOM_CXXFLAGS) + +CXXFLAGS+= \ + $(OCC_INCLUDES) \ + $(OCC_CXXFLAGS) \ + $(HDF5_INCLUDES) \ + $(KERNEL_CXXFLAGS) \ + $(MED_CXXFLAGS) \ + $(GEOM_CXXFLAGS) + +LDFLAGS+= \ + $(KERNEL_LDFLAGS) \ + -lSalomeContainer \ + -lSalomeNS \ + -lRegistry \ + -lSalomeHDFPersist \ + -lSalomeLifeCycleCORBA \ + -lTOOLSDS \ + -lSalomeGenericObj \ + $(GEOM_LDFLAGS) \ + -lGEOMClient \ + -lSMESHimpl \ + -lSMESHControls \ + $(OCC_LDPATH) \ + -lTKCDF \ + -lTKBO \ + -lTKShHealing + +LDFLAGSFORBIN+= \ + -lSMDS \ + -lSMESHDS \ + $(MED_LDFLAGS) \ + -lMEDWrapper \ + -lMEDWrapperBase \ + -lMEDWrapper_V2_1 \ + -lMEDWrapper_V2_2 \ + -lmed_V2_1 \ + -lMeshDriver \ + -lMeshDriverMED \ + -lMeshDriverUNV \ + -lMeshDriverDAT \ + -lMeshDriverSTL \ + $(KERNEL_LDFLAGS) \ + -lSalomeContainer \ + -lSalomeNS \ + -lRegistry \ + -lSalomeResourcesManager \ + -lOpUtil \ + -lSALOMELocalTrace \ + -lSALOMEBasics \ + -lSalomeNotification \ + -lSalomeHDFPersist \ + -lSalomeLifeCycleCORBA \ + -lTOOLSDS \ + -lSalomeGenericObj \ + $(GEOM_LDFLAGS) \ + -lGEOMClient \ + -lSMESHimpl \ + -lSMESHControls \ + -lNMTTools \ + -lNMTDS \ + $(OCC_LDPATH) \ + -lTKCDF \ + -lTKBO \ + -lTKMath \ + -lTKShHealing @CONCLUDE@ diff --git a/src/SMESH_I/SMESH.hxx b/src/SMESH_I/SMESH.hxx index 2c6361815..3025f693b 100644 --- a/src/SMESH_I/SMESH.hxx +++ b/src/SMESH_I/SMESH.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/SMESHEngine.cxx b/src/SMESH_I/SMESHEngine.cxx index fc1bd440b..732aeb23c 100644 --- a/src/SMESH_I/SMESHEngine.cxx +++ b/src/SMESH_I/SMESHEngine.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com int main(int argc, char** argv) { diff --git a/src/SMESH_I/SMESH_1D_Algo_i.cxx b/src/SMESH_I/SMESH_1D_Algo_i.cxx index aaec199ec..56cb13fa9 100644 --- a/src/SMESH_I/SMESH_1D_Algo_i.cxx +++ b/src/SMESH_I/SMESH_1D_Algo_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/SMESH_1D_Algo_i.hxx b/src/SMESH_I/SMESH_1D_Algo_i.hxx index 5d085c925..14bc77ca5 100644 --- a/src/SMESH_I/SMESH_1D_Algo_i.hxx +++ b/src/SMESH_I/SMESH_1D_Algo_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/SMESH_2D_Algo_i.cxx b/src/SMESH_I/SMESH_2D_Algo_i.cxx index f6e42c029..8c10ffa17 100644 --- a/src/SMESH_I/SMESH_2D_Algo_i.cxx +++ b/src/SMESH_I/SMESH_2D_Algo_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/SMESH_2D_Algo_i.hxx b/src/SMESH_I/SMESH_2D_Algo_i.hxx index be4ebdf7a..b0e535bfa 100644 --- a/src/SMESH_I/SMESH_2D_Algo_i.hxx +++ b/src/SMESH_I/SMESH_2D_Algo_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index d1a64b6c7..906599be8 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -1,3 +1,31 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// +// File : SMESH_2D_Algo_i.hxx +// Author : Paul RASCLE, EDF +// Module : SMESH +// $Header$ + // File : SMESH_2smeshpy.cxx // Created : Fri Nov 18 13:20:10 2005 // Author : Edward AGAPOV (eap) @@ -77,10 +105,20 @@ SMESH_2smeshpy::ConvertScript(const TCollection_AsciiString& theScript, #ifdef DUMP_CONVERSION cout << endl << " ######## RESULT ######## " << endl<< endl; #endif + // reorder commands after conversion + list< Handle(_pyCommand) >::iterator cmd; + bool orderChanges; + do { + orderChanges = false; + for ( cmd = theGen->GetCommands().begin(); cmd != theGen->GetCommands().end(); ++cmd ) + if ( (*cmd)->SetDependentCmdsAfter() ) + orderChanges = true; + } while ( orderChanges ); + // concat commands back into a script TCollection_AsciiString aScript; - list< Handle(_pyCommand) >::iterator cmd = theGen->GetCommands().begin(); - for ( ; cmd != theGen->GetCommands().end(); ++cmd ) { + for ( cmd = theGen->GetCommands().begin(); cmd != theGen->GetCommands().end(); ++cmd ) + { #ifdef DUMP_CONVERSION cout << "## COM " << (*cmd)->GetOrderNb() << ": "<< (*cmd)->GetString() << endl; #endif @@ -107,6 +145,7 @@ _pyGen::_pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod myID2AccessorMethod( theEntry2AccessorMethod ) { myNbCommands = 0; + myHasPattern = false; // make that GetID() to return TPythonDump::SMESHGenName() GetCreationCmd()->GetString() += "="; } @@ -115,7 +154,6 @@ _pyGen::_pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod /*! * \brief Convert a command using a specific converter * \param theCommand - the command to convert - * \retval bool - convertion result */ //================================================================================ @@ -145,19 +183,44 @@ void _pyGen::AddCommand( const TCollection_AsciiString& theCommand) id_mesh->second->Process( aCommand ); return; } - // SMESH_Hypothesis method + // SMESH_Hypothesis method? list< Handle(_pyHypothesis) >::iterator hyp = myHypos.begin(); for ( ; hyp != myHypos.end(); ++hyp ) - if ( !(*hyp)->IsAlgo() && objID == (*hyp)->GetID() ) + if ( !(*hyp)->IsAlgo() && objID == (*hyp)->GetID() ) { (*hyp)->Process( aCommand ); + return; + } - // Mesh provides SMESH_IDSource interface used in SMESH_MeshEditor. - // Add access to wrapped mesh - if ( objID == TPythonDump::MeshEditorName() ) { - // in all SMESH_MeshEditor's commands, a SMESH_IDSource is the first arg - id_mesh = myMeshes.find( aCommand->GetArg( 1 )); - if ( id_mesh != myMeshes.end() ) - aCommand->SetArg( 1 , aCommand->GetArg( 1 ) + ".GetMesh()" ); + // Add access to a wrapped mesh + for ( id_mesh = myMeshes.begin(); id_mesh != myMeshes.end(); ++id_mesh ) { + if ( aCommand->AddAccessorMethod( id_mesh->first, id_mesh->second->AccessorMethod() )) + break; + } + + // Add access to a wrapped algorithm + for ( hyp = myHypos.begin(); hyp != myHypos.end(); ++hyp ) { + if ( (*hyp)->IsAlgo() && + aCommand->AddAccessorMethod( (*hyp)->GetID(), (*hyp)->AccessorMethod() )) + break; + } + + // PAL12227. PythonDump was not updated at proper time; result is + // aCriteria.append(SMESH.Filter.Criterion(17,26,0,'L1',26,25,1e-07,SMESH.EDGE,-1)) + // TypeError: __init__() takes exactly 11 arguments (10 given) + char wrongCommand[] = "SMESH.Filter.Criterion("; + if ( int beg = theCommand.Location( wrongCommand, 1, theCommand.Length() )) + { + _pyCommand tmpCmd( theCommand.SubString( beg, theCommand.Length() ), -1); + // there must be 10 arguments, 5-th arg ThresholdID is missing, + const int wrongNbArgs = 9, missingArg = 5; + if ( tmpCmd.GetNbArgs() == wrongNbArgs ) + { + for ( int i = wrongNbArgs; i > missingArg; --i ) + tmpCmd.SetArg( i + 1, tmpCmd.GetArg( i )); + tmpCmd.SetArg( missingArg, "''"); + aCommand->GetString().Trunc( beg - 1 ); + aCommand->GetString() += tmpCmd.GetString(); + } } } @@ -202,6 +265,15 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand ) } } + // leave only one smeshgen.GetPattern() in the script + if ( theCommand->GetMethod() == "GetPattern" ) { + if ( myHasPattern ) { + theCommand->Clear(); + return; + } + myHasPattern = true; + } + // smeshgen.Method() --> smesh.smesh.Method() theCommand->SetObject( SMESH_2smeshpy::GenName() ); } @@ -224,7 +296,7 @@ void _pyGen::Flush() if ( !hyp->IsNull() ) { (*hyp)->Flush(); // smeshgen.CreateHypothesis() --> smesh.smesh.CreateHypothesis() - if ( !(*hyp)->GetCreationCmd()->IsEmpty() ) + if ( !(*hyp)->IsWrapped() ) (*hyp)->GetCreationCmd()->SetObject( SMESH_2smeshpy::GenName() ); } } @@ -291,7 +363,10 @@ void _pyGen::ExchangeCommands( Handle(_pyCommand) theCmd1, Handle(_pyCommand) th int nb1 = theCmd1->GetOrderNb(); theCmd1->SetOrderNb( theCmd2->GetOrderNb() ); theCmd2->SetOrderNb( nb1 ); +// cout << "BECOME " << theCmd1->GetOrderNb() << "\t" << theCmd1->GetString() << endl +// << "BECOME " << theCmd2->GetOrderNb() << "\t" << theCmd2->GetString() << endl << endl; } + //================================================================================ /*! * \brief Set one command after the other @@ -302,6 +377,7 @@ void _pyGen::ExchangeCommands( Handle(_pyCommand) theCmd1, Handle(_pyCommand) th void _pyGen::SetCommandAfter( Handle(_pyCommand) theCmd, Handle(_pyCommand) theAfterCmd ) { +// cout << "SET\t" << theCmd->GetString() << endl << "AFTER\t" << theAfterCmd->GetString() << endl << endl; list< Handle(_pyCommand) >::iterator pos; pos = find( myCommands.begin(), myCommands.end(), theCmd ); myCommands.erase( pos ); @@ -394,7 +470,8 @@ static bool sameGroupType( const _pyID& grpID, */ //================================================================================ -_pyMesh::_pyMesh(const Handle(_pyCommand) theCreationCmd): _pyObject(theCreationCmd) +_pyMesh::_pyMesh(const Handle(_pyCommand) theCreationCmd): + _pyObject(theCreationCmd), myHasEditor(false) { // convert my creation command Handle(_pyCommand) creationCmd = GetCreationCmd(); @@ -406,8 +483,7 @@ _pyMesh::_pyMesh(const Handle(_pyCommand) theCreationCmd): _pyObject(theCreation //================================================================================ /*! - case brief: - default: + * \brief Convert a IDL API command of SMESH::Mesh to a method call of python Mesh * \param theCommand - Engine method called for this mesh */ //================================================================================ @@ -442,8 +518,11 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand ) // set mesh to hypo const _pyID& hypID = theCommand->GetArg( 2 ); Handle(_pyHypothesis) hyp = theGen->FindHyp( hypID ); - if ( !hyp.IsNull() && hyp->GetMesh().IsEmpty() ) - hyp->SetMesh( this->GetID() ); + if ( !hyp.IsNull() ) { + myHypos.push_back( hyp ); + if ( hyp->GetMesh().IsEmpty() ) + hyp->SetMesh( this->GetID() ); + } } else if ( method == "CreateGroupFromGEOM" ) {// (type, name, grp) _pyID grp = theCommand->GetArg( 3 ); @@ -473,7 +552,7 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand ) while ( cmd != myAddHypCmds.end() ) { // AddHypothesis(geom, hyp) - if ( hypID == (*cmd)->GetArg( 2 )) { // erase both commands + if ( hypID == (*cmd)->GetArg( 2 )) { // erase both (add and remove) commands theCommand->Clear(); (*cmd)->Clear(); cmd = myAddHypCmds.erase( cmd ); @@ -483,16 +562,31 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand ) ++cmd; } } - if ( ! hasAddCmd ) { + Handle(_pyHypothesis) hyp = theGen->FindHyp( hypID ); + if ( ! hasAddCmd ) { // hypo addition already wrapped // access to wrapped mesh AddMeshAccess( theCommand ); // access to wrapped algo - Handle(_pyHypothesis) hyp = theGen->FindHyp( hypID ); if ( !hyp.IsNull() && hyp->IsAlgo() && hyp->IsWrapped() ) theCommand->SetArg( 2, theCommand->GetArg( 2 ) + ".GetAlgorithm()" ); } + // remove hyp from myHypos + myHypos.remove( hyp ); + } + + // leave only one " mesh_editor_ = mesh.GetMeshEditor()" + else if ( theCommand->GetMethod() == "GetMeshEditor") + { + if ( myHasEditor ) + theCommand->Clear(); + else + AddMeshAccess( theCommand ); + myHasEditor = true; } - else { // apply theCommand to the mesh wrapped by smeshpy mesh + + // apply theCommand to the mesh wrapped by smeshpy mesh + else + { AddMeshAccess( theCommand ); } } @@ -506,7 +600,6 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand ) void _pyMesh::Flush() { list < Handle(_pyCommand) >::iterator cmd, cmd2; - map< _pyID, Handle(_pyCommand) > algo2additionCmd; // try to convert algo addition like this: // mesh.AddHypothesis(geom, ALGO ) --> ALGO = mesh.Algo() @@ -521,7 +614,8 @@ void _pyMesh::Flush() _pyID geom = addCmd->GetArg( 1 ); if ( algo->Addition2Creation( addCmd, this->GetID() )) // OK { - algo2additionCmd[ algo->GetID() ] = addCmd; + // wrapped algo is created atfer mesh creation + GetCreationCmd()->AddDependantCmd( addCmd ); if ( geom != GetGeom() ) // local algo { @@ -534,8 +628,7 @@ void _pyMesh::Flush() if ( geom == subCmd->GetArg( 1 )) { subCmd->SetObject( algo->GetID() ); subCmd->RemoveArgs(); - if ( addCmd->GetOrderNb() > subCmd->GetOrderNb() ) - theGen->SetCommandAfter( subCmd, addCmd ); + addCmd->AddDependantCmd( subCmd ); } } } @@ -566,10 +659,7 @@ void _pyMesh::Flush() if ( !algo.IsNull() && hyp->Addition2Creation( addCmd, this->GetID() )) // OK { addCmd->SetObject( algo->GetID() ); - Handle(_pyCommand) algoCmd = algo2additionCmd[ algo->GetID() ]; - if ( !algoCmd.IsNull() && algoCmd->GetOrderNb() > addCmd->GetOrderNb() ) - // algo was created later than hyp - theGen->ExchangeCommands( algoCmd, addCmd ); + algo->GetCreationCmd()->AddDependantCmd( addCmd ); } else { @@ -585,6 +675,11 @@ void _pyMesh::Flush() } myAddHypCmds.clear(); mySubmeshes.clear(); + + // flush hypotheses + list< Handle(_pyHypothesis) >::iterator hyp = myHypos.begin(); + for ( ; hyp != myHypos.end(); ++hyp ) + (*hyp)->Flush(); } //================================================================================ @@ -668,6 +763,11 @@ Handle(_pyHypothesis) _pyHypothesis::NewHypothesis( const Handle(_pyCommand)& th hyp->myCreationMethod = "Propagation"; hyp->myType = "Regular_1D"; } + else if ( hypType == "QuadraticMesh" ) { + hyp->myDim = 1; + hyp->myCreationMethod = "QuadraticMesh"; + hyp->myType = "Regular_1D"; + } else if ( hypType == "AutomaticLength" ) { hyp->myDim = 1; hyp->myCreationMethod = "AutomaticLength"; @@ -774,6 +874,9 @@ bool _pyHypothesis::Addition2Creation( const Handle(_pyCommand)& theCmd, else theCmd->SetArg( i, "[]"); } + // set a new creation command + GetCreationCmd()->Clear(); + SetCreationCmd( theCmd ); // clear commands setting arg values list < Handle(_pyCommand) >::iterator argCmd = myArgCommands.begin(); @@ -793,13 +896,8 @@ bool _pyHypothesis::Addition2Creation( const Handle(_pyCommand)& theCmd, Handle(_pyCommand) afterCmd = myIsWrapped ? theCmd : GetCreationCmd(); list::iterator cmd = myUnknownCommands.begin(); for ( ; cmd != myUnknownCommands.end(); ++cmd ) { - if ( !(*cmd)->IsEmpty() && afterCmd->GetOrderNb() > (*cmd)->GetOrderNb() ) { - theGen->SetCommandAfter( *cmd, afterCmd ); - afterCmd = *cmd; - } + afterCmd->AddDependantCmd( *cmd ); } - myArgCommands.clear(); - myUnknownCommands.clear(); return myIsWrapped; } @@ -835,8 +933,11 @@ void _pyHypothesis::Process( const Handle(_pyCommand)& theCommand) void _pyHypothesis::Flush() { - if ( IsWrapped() ) - GetCreationCmd()->Clear(); + if ( IsWrapped() ) { + // forget previous hypothesis modifications + myArgCommands.clear(); + myUnknownCommands.clear(); + } } //================================================================================ @@ -872,20 +973,53 @@ bool _pyNumberOfSegmentsHyp::Addition2Creation( const Handle(_pyCommand)& theCmd const _pyID& theMesh) { if ( IsWrappable( theMesh ) && myArgs.Length() > 1 ) { - list::iterator cmd = myUnknownCommands.begin(); - for ( ; cmd != myUnknownCommands.end(); ++cmd ) { - // clear SetDistrType() - if ( (*cmd)->GetString().Location( "SetDistrType", 1, (*cmd)->Length() )) - (*cmd)->Clear(); + // scale factor (2-nd arg) is provided: clear SetDistrType(1) command + bool scaleDistrType = false; + list::reverse_iterator cmd = myUnknownCommands.rbegin(); + for ( ; cmd != myUnknownCommands.rend(); ++cmd ) { + if ( (*cmd)->GetMethod() == "SetDistrType" ) { + if ( (*cmd)->GetArg( 1 ) == "1" ) { + scaleDistrType = true; + (*cmd)->Clear(); + } + else if ( !scaleDistrType ) { + // distribution type changed: remove scale factor from args + myArgs.Remove( 2, myArgs.Length() ); + break; + } + } } } return _pyHypothesis::Addition2Creation( theCmd, theMesh ); } +//================================================================================ +/*! + * \brief remove repeated commands defining distribution + */ +//================================================================================ + +void _pyNumberOfSegmentsHyp::Flush() +{ + const int nbCmdLists = 2; + list * cmds[nbCmdLists] = { &myArgCommands, &myUnknownCommands }; + for ( int i = 0; i < nbCmdLists; ++i ) { + set uniqueMethods; + list & cmdList = *cmds[i]; + list::reverse_iterator cmd = cmdList.rbegin(); + for ( ; cmd != cmdList.rend(); ++cmd ) { + bool isNewInSet = uniqueMethods.insert( (*cmd)->GetMethod() ).second; + if ( ! isNewInSet ) + (*cmd)->Clear(); + } + cmdList.clear(); + } +} + //================================================================================ /*! * \brief _pyAlgorithm constructor - * \param theCreationCmd - The command like "algo = smeshgen.CreateHypothesis(type,lib)" + * \param theCreationCmd - The command like "algo = smeshgen.CreateHypothesis(type,lib)" */ //================================================================================ @@ -1199,10 +1333,17 @@ void _pyCommand::SetArg( int index, const TCollection_AsciiString& theArg) if ( pos < 1 ) // no index-th arg exist, append inexistent args { // find a closing parenthesis - pos = Length(); - while ( pos > 0 && myString.Value( pos ) != ')' ) - --pos; - if ( pos == 0 ) { // no parentheses at all + if ( int lastArgInd = GetNbArgs() ) { + pos = GetBegPos( ARG1_IND + lastArgInd - 1 ) + GetArg( lastArgInd ).Length(); + while ( pos > 0 && pos <= Length() && myString.Value( pos ) != ')' ) + ++pos; + } + else { + pos = Length(); + while ( pos > 0 && myString.Value( pos ) != ')' ) + --pos; + } + if ( pos < 1 || myString.Value( pos ) != ')' ) { // no parentheses at all myString += "()"; pos = Length(); } @@ -1233,3 +1374,75 @@ void _pyCommand::RemoveArgs() if ( myBegPos.Length() >= ARG1_IND ) myBegPos.Remove( ARG1_IND, myBegPos.Length() ); } + +//================================================================================ +/*! + * \brief Set dependent commands after this one + */ +//================================================================================ + +bool _pyCommand::SetDependentCmdsAfter() const +{ + bool orderChanged = false; + list< Handle(_pyCommand)>::const_reverse_iterator cmd = myDependentCmds.rbegin(); + for ( ; cmd != myDependentCmds.rend(); ++cmd ) { + if ( (*cmd)->GetOrderNb() < GetOrderNb() ) { + orderChanged = true; + theGen->SetCommandAfter( *cmd, this ); + (*cmd)->SetDependentCmdsAfter(); + } + } + return orderChanged; +} +//================================================================================ +/*! + * \brief Insert accessor method after theObjectID + * \param theObjectID - id of the accessed object + * \param theAcsMethod - name of the method giving access to the object + * \retval bool - false if theObjectID is not found in the command string + */ +//================================================================================ + +bool _pyCommand::AddAccessorMethod( _pyID theObjectID, const char* theAcsMethod ) +{ + if ( !theAcsMethod ) + return false; + // start object search from the object, i.e. ignore result + GetObject(); + int beg = GetBegPos( OBJECT_IND ); + if ( beg < 1 || beg > Length() ) + return false; + while (( beg = myString.Location( theObjectID, beg, Length() ))) + { + // check that theObjectID is not just a part of a longer ID + int afterEnd = beg + theObjectID.Length(); + Standard_Character c = myString.Value( afterEnd ); + if ( !isalnum( c ) && c != ':' ) { + // insertion + int oldLen = Length(); + myString.Insert( afterEnd, (char*) theAcsMethod ); + myString.Insert( afterEnd, "." ); + // update starting positions of the parts following the modified one + int posDelta = Length() - oldLen; + for ( int i = 1; i <= myBegPos.Length(); ++i ) { + if ( myBegPos( i ) > afterEnd ) + myBegPos( i ) += posDelta; + } + return true; + } + beg = afterEnd; // is a part - next search + } + return false; +} + +//================================================================================ +/*! + * \brief Return method name giving access to an interaface object wrapped by python class + * \retval const char* - method name + */ +//================================================================================ + +const char* _pyObject::AccessorMethod() const +{ + return 0; +} diff --git a/src/SMESH_I/SMESH_2smeshpy.hxx b/src/SMESH_I/SMESH_2smeshpy.hxx index ac92276c3..5319af279 100644 --- a/src/SMESH_I/SMESH_2smeshpy.hxx +++ b/src/SMESH_I/SMESH_2smeshpy.hxx @@ -1,3 +1,22 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : SMESH_smesh.hxx // Created : Fri Nov 18 12:05:18 2005 // Author : Edward AGAPOV (eap) @@ -73,23 +92,31 @@ DEFINE_STANDARD_HANDLE (_pyMesh ,_pyObject); DEFINE_STANDARD_HANDLE (_pyHypothesis,_pyObject); DEFINE_STANDARD_HANDLE (_pyAlgorithm ,_pyHypothesis); +typedef TCollection_AsciiString _pyID; + +// =========================================================== /*! * \brief Class operating on a command string looking like * ResultValue = Object.Method( Arg1, Arg2,...) */ +// =========================================================== + class _pyCommand: public Standard_Transient { - int myOrderNb; // position within the script - TCollection_AsciiString myString; - TCollection_AsciiString myRes, myObj, myMeth; - TColStd_SequenceOfAsciiString myArgs; - TColStd_SequenceOfInteger myBegPos; //!< where myRes, myObj, ... begin + int myOrderNb; //!< position within the script + TCollection_AsciiString myString; //!< command text + TCollection_AsciiString myRes, myObj, myMeth; //!< found parts of command + TColStd_SequenceOfAsciiString myArgs; //!< found arguments + TColStd_SequenceOfInteger myBegPos; //!< where myRes, myObj, ... begin + std::list< Handle(_pyCommand) > myDependentCmds; //!< commands that sould follow me in the script + enum { UNKNOWN=-1, EMPTY=0, RESULT_IND, OBJECT_IND, METHOD_IND, ARG1_IND }; int GetBegPos( int thePartIndex ); void SetBegPos( int thePartIndex, int thePosition ); void SetPart( int thePartIndex, const TCollection_AsciiString& theNewPart, TCollection_AsciiString& theOldPart); void FindAllArgs() { GetArg(1); } + public: _pyCommand() {}; _pyCommand( const TCollection_AsciiString& theString, int theNb ) @@ -118,24 +145,31 @@ public: static TCollection_AsciiString GetWord( const TCollection_AsciiString & theSring, int & theStartPos, const bool theForward, const bool dotIsWord = false); + void AddDependantCmd( Handle(_pyCommand) cmd) + { return myDependentCmds.push_back( cmd ); } + bool SetDependentCmdsAfter() const; + + bool AddAccessorMethod( _pyID theObjectID, const char* theAcsMethod ); + DEFINE_STANDARD_RTTI (_pyCommand) }; /*! * \brief Root of all objects */ -typedef TCollection_AsciiString _pyID; class _pyObject: public Standard_Transient { - Handle(_pyCommand) myCreationCmd; + Handle(_pyCommand) myCreationCmd; public: _pyObject(const Handle(_pyCommand)& theCreationCmd): myCreationCmd(theCreationCmd) {} const _pyID& GetID() { return myCreationCmd->GetResultValue(); } const Handle(_pyCommand)& GetCreationCmd() { return myCreationCmd; } + void SetCreationCmd( Handle(_pyCommand) cmd ) { myCreationCmd = cmd; } int GetCommandNb() { return myCreationCmd->GetOrderNb(); } virtual void Process(const Handle(_pyCommand) & theCommand) = 0; virtual void Flush() = 0; + virtual const char* AccessorMethod() const; DEFINE_STANDARD_RTTI (_pyObject) }; @@ -159,11 +193,13 @@ public: void SetCommandAfter( Handle(_pyCommand) theCmd, Handle(_pyCommand) theAfterCmd ); std::list< Handle(_pyCommand) >& GetCommands() { return myCommands; } void SetAccessorMethod(const _pyID& theID, const char* theMethod ); + const char* AccessorMethod() const { return SMESH_2smeshpy::GenName(); } private: std::map< _pyID, Handle(_pyMesh) > myMeshes; std::list< Handle(_pyHypothesis) > myHypos; std::list< Handle(_pyCommand) > myCommands; int myNbCommands; + bool myHasPattern; Resource_DataMapOfAsciiStringAsciiString& myID2AccessorMethod; DEFINE_STANDARD_RTTI (_pyGen) @@ -172,21 +208,26 @@ private: /*! * \brief Contains commands concerning mesh substructures */ +#define _pyMesh_ACCESS_METHOD "GetMesh()" class _pyMesh: public _pyObject { + std::list< Handle(_pyHypothesis) > myHypos; std::list< Handle(_pyCommand) > myAddHypCmds; - std::list< Handle(_pyCommand) > mySubmeshes; + std::list< Handle(_pyCommand) > mySubmeshes; + bool myHasEditor; public: _pyMesh(const Handle(_pyCommand) theCreationCmd); const _pyID& GetGeom() { return GetCreationCmd()->GetArg(1); } void Process( const Handle(_pyCommand)& theCommand); void Flush(); + const char* AccessorMethod() const { return _pyMesh_ACCESS_METHOD; } private: static void AddMeshAccess( const Handle(_pyCommand)& theCommand ) - { theCommand->SetObject( theCommand->GetObject() + ".GetMesh()" ); } + { theCommand->SetObject( theCommand->GetObject() + "." _pyMesh_ACCESS_METHOD ); } DEFINE_STANDARD_RTTI (_pyMesh) }; +#undef _pyMesh_ACCESS_METHOD /*! * \brief Root class for hypothesis @@ -260,6 +301,7 @@ public: _pyNumberOfSegmentsHyp(const Handle(_pyCommand)& theCrCmd): _pyHypothesis(theCrCmd) {} virtual bool Addition2Creation( const Handle(_pyCommand)& theAdditionCmd, const _pyID& theMesh); + void Flush(); DEFINE_STANDARD_RTTI (_pyNumberOfSegmentsHyp) }; @@ -274,6 +316,7 @@ public: _pyAlgorithm(const Handle(_pyCommand)& theCreationCmd); virtual bool Addition2Creation( const Handle(_pyCommand)& theAdditionCmd, const _pyID& theMesh); + const char* AccessorMethod() const { return "GetAlgorithm()"; } DEFINE_STANDARD_RTTI (_pyAlgorithm) }; diff --git a/src/SMESH_I/SMESH_3D_Algo_i.cxx b/src/SMESH_I/SMESH_3D_Algo_i.cxx index 875557d88..6cd59106c 100644 --- a/src/SMESH_I/SMESH_3D_Algo_i.cxx +++ b/src/SMESH_I/SMESH_3D_Algo_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/SMESH_3D_Algo_i.hxx b/src/SMESH_I/SMESH_3D_Algo_i.hxx index 41cf9c3b0..30a708a1c 100644 --- a/src/SMESH_I/SMESH_3D_Algo_i.hxx +++ b/src/SMESH_I/SMESH_3D_Algo_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/SMESH_Algo_i.cxx b/src/SMESH_I/SMESH_Algo_i.cxx index 71b4f961c..cfa8dc555 100644 --- a/src/SMESH_I/SMESH_Algo_i.cxx +++ b/src/SMESH_I/SMESH_Algo_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/SMESH_Algo_i.hxx b/src/SMESH_I/SMESH_Algo_i.hxx index 99719e9c2..2ee94ae9d 100644 --- a/src/SMESH_I/SMESH_Algo_i.hxx +++ b/src/SMESH_I/SMESH_Algo_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/SMESH_DumpPython.cxx b/src/SMESH_I/SMESH_DumpPython.cxx index 97e49b2a1..e0ecf8fcd 100644 --- a/src/SMESH_I/SMESH_DumpPython.cxx +++ b/src/SMESH_I/SMESH_DumpPython.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SMESH_Gen_i_DumpPython.cxx // Created : Thu Mar 24 17:17:59 2005 @@ -26,6 +26,7 @@ #include "SMESH_PythonDump.hxx" #include "SMESH_Gen_i.hxx" #include "SMESH_Filter_i.hxx" +#include "SMESH_MeshEditor_i.hxx" #include "SMESH_2smeshpy.hxx" #include @@ -174,7 +175,7 @@ namespace SMESH myStream << aSObject->GetID(); } else if ( !CORBA::is_nil(theArg)) { if ( aSMESHGen->CanPublishInStudy( theArg )) // not published SMESH object - myStream << "smeshObj_" << (int) theArg; + myStream << "smeshObj_" << size_t(theArg); else myStream << NotPublishedObjectName(); } @@ -253,7 +254,7 @@ namespace SMESH TPythonDump& TPythonDump::operator<<(SMESH_MeshEditor_i* theArg) { - myStream << MeshEditorName(); return *this; + myStream << MeshEditorName() << "_" << ( theArg ? theArg->GetMeshId() : -1 ); return *this; } TPythonDump& TPythonDump::operator<<(const TCollection_AsciiString & theStr) @@ -293,6 +294,100 @@ namespace SMESH << P.z << " ))"; return *this; } + + TCollection_AsciiString myLongStringStart( "TPythonDump::LongStringStart" ); + TCollection_AsciiString myLongStringEnd ( "TPythonDump::LongStringEnd" ); + + //================================================================================ + /*! + * \brief Return marker of long string literal beginning + * \param type - a name of functionality producing the string literal + * \retval TCollection_AsciiString - the marker string to be written into + * a raw python script + */ + //================================================================================ + + TCollection_AsciiString TPythonDump::LongStringStart(const char* type) + { + return + myLongStringStart + + (Standard_Integer) strlen(type) + + " " + + (char*) type; + } + + //================================================================================ + /*! + * \brief Return marker of long string literal end + * \retval TCollection_AsciiString - the marker string to be written into + * a raw python script + */ + //================================================================================ + + TCollection_AsciiString TPythonDump::LongStringEnd() + { + return myLongStringEnd; + } + + //================================================================================ + /*! + * \brief Cut out a long string literal from a string + * \param theText - text possibly containing string literals + * \param theFrom - position in the text to search from + * \param theLongString - the retrieved literal + * \param theStringType - a name of functionality produced the literal + * \retval bool - true if a string literal found + * + * The literal is removed from theText; theFrom points position right after + * the removed literal + */ + //================================================================================ + + bool TPythonDump::CutoutLongString( TCollection_AsciiString & theText, + int & theFrom, + TCollection_AsciiString & theLongString, + TCollection_AsciiString & theStringType) + { + if ( theFrom < 1 || theFrom > theText.Length() ) + return false; + + // ...script \ beg marker \ \ type \ literal \ end marker \ script... + // "theText myLongStringStart7 Pattern!!! SALOME Mesh Pattern file myLongStringEndtextEnd" + // 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 + // 0 1 2 3 4 5 6 7 8 + + theFrom = theText.Location( myLongStringStart, theFrom, theText.Length() ); // = 09 + if ( !theFrom ) + return false; + + // find where literal begins + int literalBeg = theFrom + myLongStringStart.Length(); // = 26 + char* typeLenStr = theText.ToCString() + literalBeg - 1; // = "7 Pattern!!! SALO...." + int typeLen = atoi ( typeLenStr ); // = 7 + while ( *typeLenStr != ' ' ) { // look for ' ' after typeLen + literalBeg++; // 26 -> 27 + typeLenStr++; + } + literalBeg += typeLen + 1; // = 35 + if ( literalBeg > theText.Length() ) + return false; + + // where literal ends (i.e. end marker begins) + int literalEnd = theText.Location( myLongStringEnd, literalBeg, theText.Length() ); // = 64 + if ( !literalEnd ) + literalEnd = theText.Length(); + + // literal + theLongString = theText.SubString( literalBeg, literalEnd - 1); // "!!! SALOME Mesh Pattern file " + // type + theStringType = theText.SubString( literalBeg - typeLen, literalBeg - 1 ); // "Pattern" + // cut off literal + literalEnd += myLongStringEnd.Length(); // = 79 + TCollection_AsciiString textEnd = theText.SubString( literalEnd, theText.Length() ); // "textE..." + theText = theText.SubString( 1, theFrom - 1 ) + textEnd; + + return true; + } } //======================================================================= @@ -463,6 +558,39 @@ Handle(TColStd_HSequenceOfInteger) FindEntries (TCollection_AsciiString& theStri return aSeq; } +namespace { + + //================================================================================ + /*! + * \brief Make a string be a valid python name + * \param aName - a string to fix + * \retval bool - true if aName was not modified + */ + //================================================================================ + + bool fixPythonName(TCollection_AsciiString & aName ) + { + const TCollection_AsciiString allowedChars = + "qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM0987654321_"; + bool isValidName = true; + int p=1; // replace not allowed chars with underscore + while (p <= aName.Length() && + (p = aName.FirstLocationNotInSet(allowedChars, p, aName.Length()))) + { + if ( p == 1 || p == aName.Length() || aName.Value(p-1) == '_') + aName.Remove( p, 1 ); // remove double _ and from the start and the end + else + aName.SetValue(p, '_'); + isValidName = false; + } + if ( aName.IsIntegerValue() ) { // aName must not start with a digit + aName.Insert( 1, 'a' ); + isValidName = false; + } + return isValidName; + } +} + //============================================================================= /*! * DumpPython @@ -489,6 +617,16 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl else aScript += aSMESHGen + ".SetCurrentStudy(None)"; + // import python files corresponding to plugins + set moduleNameSet; + map::iterator hyp_creator = myHypCreatorMap.begin(); + for ( ; hyp_creator != myHypCreatorMap.end(); ++hyp_creator ) { + string moduleName = hyp_creator->second->GetModuleName(); + bool newModule = moduleNameSet.insert( moduleName ).second; + if ( newModule ) + aScript += helper + "\n\t" + "import " + (char*) moduleName.c_str(); + } + // Dump trace of restored study if (theSavedTrace.Length() > 0) { // For the convertion of IDL API calls -> smesh.py API, "smesh" standing for SMESH_Gen @@ -502,8 +640,8 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl int beg, end = aSavedTrace.Length(), from = 1; while ( from < end && ( beg = aSavedTrace.Location( aSmeshCall, from, end ))) { char charBefore = ( beg == 1 ) ? ' ' : aSavedTrace.Value( beg - 1 ); - if ( isspace( charBefore ) || charBefore == '=' ) { - aSavedTrace.Insert( beg + aSmeshCall.Length() - 1, gen ); + if ( isspace( charBefore ) || charBefore == '=' ) { // "smesh." is not a part of a long word + aSavedTrace.Insert( beg + aSmeshCall.Length() - 1, gen );// "smesh" -> "smeshgen" end += gen.Length(); } from = beg + aSmeshCall.Length(); @@ -539,8 +677,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl TColStd_SequenceOfAsciiString seqRemoved; Resource_DataMapOfAsciiStringAsciiString mapRemoved; Standard_Integer objectCounter = 0, aStart = 1, aScriptLength = aScript.Length(); - TCollection_AsciiString anUpdatedScript, anEntry, aName, aBaseName("smeshObj_"), - allowedChars ("qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM0987654321_"); + TCollection_AsciiString anUpdatedScript, anEntry, aName, aBaseName("smeshObj_"); // Collect names of GEOM objects to exclude same names for SMESH objects GEOM::string_array_var aGeomNames = geom->GetAllDumpNames(); @@ -562,21 +699,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl // The Object is in Study aName = theObjectNames.Find(anEntry); // check validity of aName - bool isValidName = true; - int p=1; // replace not allowed chars with underscore - while (p <= aName.Length() && - (p = aName.FirstLocationNotInSet(allowedChars, p, aName.Length()))) - { - if ( p == 1 || p == aName.Length() || aName.Value(p-1) == '_') - aName.Remove( p, 1 ); // remove double _ and from the start and the end - else - aName.SetValue(p, '_'); - isValidName = false; - } - if ( aName.IsIntegerValue() ) { // aName must not start with a digit - aName.Insert( 1, 'a' ); - isValidName = false; - } + bool isValidName = fixPythonName( aName ); if (theObjectNames.IsBound(aName) && anEntry != theObjectNames(aName)) { // diff objects have same name - make a new name by appending a digit TCollection_AsciiString aName2; @@ -633,6 +756,10 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl for (int ir = 1; ir <= seqRemoved.Length(); ir++) { anUpdatedScript += "\n\tSO = theStudy.FindObjectIOR(theStudy.ConvertObjectToIOR("; anUpdatedScript += seqRemoved.Value(ir); + // for object wrapped by class of smesh.py + anEntry = theObjectNames( seqRemoved.Value(ir) ); + if ( anEntry2AccessorMethod.IsBound( anEntry ) ) + anUpdatedScript += helper + "." + anEntry2AccessorMethod( anEntry ); anUpdatedScript += "))\n\tif SO is not None: aStudyBuilder.RemoveObjectWithChildren(SO)"; } @@ -668,6 +795,49 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl anUpdatedScript += "\n\n\tpass\n"; + // ----------------------------------------------------------------- + // put string literals describing patterns into separate functions + // ----------------------------------------------------------------- + + TCollection_AsciiString aLongString, aFunctionType; + int where = 1; + set< string > functionNameSet; + while ( SMESH::TPythonDump::CutoutLongString( anUpdatedScript, where, aLongString, aFunctionType )) + { + // make a python string literal + aLongString.Prepend(":\n\treturn '''\n"); + aLongString += "\n\t'''\n\tpass\n"; + + TCollection_AsciiString functionName; + + // check if the function returning this literal is already defined + int posAlready = anUpdatedScript.Location( aLongString, where, anUpdatedScript.Length() ); + if ( posAlready ) // already defined + { + // find the function name + int functBeg = posAlready; + char* script = anUpdatedScript.ToCString() + posAlready - 1; // look at ":" after "def fuction()" + while ( *script != ' ' ) { + script--; + functBeg--; + } + functBeg++; // do not take ' ' + posAlready--; // do not take ':' + functionName = anUpdatedScript.SubString( functBeg, posAlready ); + } + else // not defined yet + { + // find a unique function name + fixPythonName( aFunctionType ); + Standard_Integer nb = 0; + do functionName = aFunctionType + "_" + ( nb++ ) + "()"; + while ( !functionNameSet.insert( functionName.ToCString() ).second ); + + anUpdatedScript += helper + "\n\ndef " + functionName + aLongString; // define function + } + anUpdatedScript.InsertBefore( where, functionName ); // call function + } + aValidScript = true; return anUpdatedScript; diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index cc5876cdf..917732d62 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -458,7 +458,7 @@ Functor_i::Functor_i(): Functor_i::~Functor_i() { - TPythonDump()<length(iEnd); SMESH::Controls::FreeEdges::TBorders::const_iterator anIter; for ( anIter = aBorders.begin() ; anIter != aBorders.end(); anIter++, i++ ) @@ -1423,7 +1424,7 @@ FilterManager_i::FilterManager_i() FilterManager_i::~FilterManager_i() { - TPythonDump()<Destroy(); - TPythonDump()<length(); i < n; i++ ) { LDOM_Element aCriterionItem = theDoc.createElement( "criterion" ); - - aCriterionItem.setAttribute( ATTR_TYPE , toString( aCriteria[ i ].Type ) ); - aCriterionItem.setAttribute( ATTR_COMPARE , toString( aCriteria[ i ].Compare ) ); - aCriterionItem.setAttribute( ATTR_THRESHOLD , toString( aCriteria[ i ].Threshold ) ); - aCriterionItem.setAttribute( ATTR_UNARY , toString( aCriteria[ i ].UnaryOp ) ); - aCriterionItem.setAttribute( ATTR_BINARY , toString( aCriteria[ i ].BinaryOp ) ); + + aCriterionItem.setAttribute( ATTR_TYPE , toString( aCriteria[ i ].Type) ); + aCriterionItem.setAttribute( ATTR_COMPARE , toString( aCriteria[ i ].Compare ) ); + aCriterionItem.setAttribute( ATTR_THRESHOLD , toString( aCriteria[ i ].Threshold ) ); + aCriterionItem.setAttribute( ATTR_UNARY , toString( aCriteria[ i ].UnaryOp ) ); + aCriterionItem.setAttribute( ATTR_BINARY , toString( aCriteria[ i ].BinaryOp ) ); aCriterionItem.setAttribute( ATTR_THRESHOLD_STR, (const char*)aCriteria[ i ].ThresholdStr ); aCriterionItem.setAttribute( ATTR_TOLERANCE , toString( aCriteria[ i ].Tolerance ) ); @@ -2575,7 +2576,7 @@ FilterLibrary_i::FilterLibrary_i() FilterLibrary_i::~FilterLibrary_i() { delete myFileName; - TPythonDump()< #include #include +#include #include "Utils_CorbaException.hxx" @@ -109,7 +110,6 @@ #include "Utils_ExceptHandlers.hxx" #include -#include using namespace std; using SMESH::TPythonDump; @@ -261,8 +261,12 @@ SMESH_Gen_i::SMESH_Gen_i( CORBA::ORB_ptr orb, _thisObj = this ; _id = myPoa->activate_object( _thisObj ); + myIsEmbeddedMode = false; myShapeReader = NULL; // shape reader mySMESHGen = this; + + // set it in standalone mode only + //OSD::SetSignal( true ); } //============================================================================= @@ -421,7 +425,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::createMesh() // create a new mesh object servant, store it in a map in study context SMESH_Mesh_i* meshServant = new SMESH_Mesh_i( GetPOA(), this, GetCurrentStudyID() ); // create a new mesh object - meshServant->SetImpl( myGen.CreateMesh( GetCurrentStudyID() )); + meshServant->SetImpl( myGen.CreateMesh( GetCurrentStudyID(), myIsEmbeddedMode )); // activate the CORBA servant of Mesh SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( meshServant->_this() ); @@ -451,6 +455,46 @@ GEOM_Client* SMESH_Gen_i::GetShapeReader() return myShapeReader; } +//============================================================================= +/*! + * SMESH_Gen_i::SetEmbeddedMode + * + * Set current mode + */ +//============================================================================= + +void SMESH_Gen_i::SetEmbeddedMode( CORBA::Boolean theMode ) +{ + myIsEmbeddedMode = theMode; + + if ( !myIsEmbeddedMode ) { + bool raiseFPE; +#ifdef _DEBUG_ + raiseFPE = true; + char* envDisableFPE = getenv("DISABLE_FPE"); + if (envDisableFPE && atoi(envDisableFPE)) + raiseFPE = false; +#else + raiseFPE = false; +#endif + OSD::SetSignal( raiseFPE ); + } + // else OSD::SetSignal() is called in GUI +} + +//============================================================================= +/*! + * SMESH_Gen_i::IsEmbeddedMode + * + * Get current mode + */ +//============================================================================= + +CORBA::Boolean SMESH_Gen_i::IsEmbeddedMode() +{ + return myIsEmbeddedMode; +} + //============================================================================= /*! * SMESH_Gen_i::SetCurrentStudy @@ -471,13 +515,16 @@ void SMESH_Gen_i::SetCurrentStudy( SALOMEDS::Study_ptr theStudy ) myStudyContextMap[ studyId ] = new StudyContext; } - SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); - if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() ) - aStudyBuilder->LoadWith( myCurrentStudy->FindComponent( "GEOM" ), GetGeomEngine() ); + // myCurrentStudy may be nil + if ( !CORBA::is_nil( myCurrentStudy ) ) { + SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); + if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() ) + aStudyBuilder->LoadWith( myCurrentStudy->FindComponent( "GEOM" ), GetGeomEngine() ); // set current study for geom engine //if ( !CORBA::is_nil( GetGeomEngine() ) ) // GetGeomEngine()->GetCurrentStudy( myCurrentStudy->StudyId() ); + } } //============================================================================= @@ -652,6 +699,37 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMesh( GEOM::GEOM_Object_ptr theShapeObj return mesh._retn(); } +//============================================================================= +/*! + * SMESH_Gen_i::CreateEmptyMesh + * + * Create empty mesh + */ +//============================================================================= + +SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateEmptyMesh() + throw ( SALOME::SALOME_Exception ) +{ + Unexpect aCatch(SALOME_SalomeException); + if(MYDEBUG) MESSAGE( "SMESH_Gen_i::CreateMesh" ); + // create mesh + SMESH::SMESH_Mesh_var mesh = this->createMesh(); + + // publish mesh in the study + if ( CanPublishInStudy( mesh ) ) { + SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); + aStudyBuilder->NewCommand(); // There is a transaction + SALOMEDS::SObject_var aSO = PublishMesh( myCurrentStudy, mesh.in() ); + aStudyBuilder->CommitCommand(); + if ( !aSO->_is_nil() ) { + // Update Python script + TPythonDump() << aSO << " = " << this << ".CreateEmptyMesh()"; + } + } + + return mesh._retn(); +} + //============================================================================= /*! * SMESH_Gen_i::CreateMeshFromUNV @@ -667,7 +745,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMeshesFromUNV( const char* theFileName if(MYDEBUG) MESSAGE( "SMESH_Gen_i::CreateMeshesFromUNV" ); SMESH::SMESH_Mesh_var aMesh = createMesh(); - string aFileName; // = boost::filesystem::path(theFileName).leaf(); + string aFileName; // publish mesh in the study if ( CanPublishInStudy( aMesh ) ) { SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); @@ -683,6 +761,10 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMeshesFromUNV( const char* theFileName SMESH_Mesh_i* aServant = dynamic_cast( GetServant( aMesh ).in() ); ASSERT( aServant ); aServant->ImportUNVFile( theFileName ); + + // Dump creation of groups + aServant->GetGroups(); + return aMesh._retn(); } @@ -701,11 +783,6 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMED( const char* theFileName, Unexpect aCatch(SALOME_SalomeException); if(MYDEBUG) MESSAGE( "SMESH_Gen_i::CreateMeshFromMED" ); - // Python Dump - TPythonDump aPythonDump; - aPythonDump << "(["; - //TCollection_AsciiString aStr ("(["); - // Retrieve mesh names from the file DriverMED_R_SMESHDS_Mesh myReader; myReader.SetFile( theFileName ); @@ -714,6 +791,14 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMED( const char* theFileName, list aNames = myReader.GetMeshNames(aStatus); SMESH::mesh_array_var aResult = new SMESH::mesh_array(); theStatus = (SMESH::DriverMED_ReadStatus)aStatus; + + { // open a new scope to make aPythonDump die before PythonDump in SMESH_Mesh::GetGroups() + + // Python Dump + TPythonDump aPythonDump; + aPythonDump << "(["; + //TCollection_AsciiString aStr ("(["); + if (theStatus == SMESH::DRS_OK) { SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); aStudyBuilder->NewCommand(); // There is a transaction @@ -759,6 +844,10 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMED( const char* theFileName, // Update Python script aPythonDump << "], status) = " << this << ".CreateMeshesFromMED('" << theFileName << "')"; + } + // Dump creation of groups + for ( int i = 0; i < aResult->length(); ++i ) + aResult[ i ]->GetGroups(); return aResult._retn(); } @@ -778,7 +867,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMeshesFromSTL( const char* theFileName if(MYDEBUG) MESSAGE( "SMESH_Gen_i::CreateMeshesFromSTL" ); SMESH::SMESH_Mesh_var aMesh = createMesh(); - string aFileName; // = boost::filesystem::path(theFileName).leaf(); + string aFileName; // publish mesh in the study if ( CanPublishInStudy( aMesh ) ) { SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index a1ac46b78..67751519c 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -168,6 +168,11 @@ public: // Interface methods // ***************************************** + // Set current study + void SetEmbeddedMode( CORBA::Boolean theMode ); + // Get current study + CORBA::Boolean IsEmbeddedMode(); + // Set current study void SetCurrentStudy( SALOMEDS::Study_ptr theStudy ); // Get current study @@ -189,6 +194,10 @@ public: SMESH::SMESH_Mesh_ptr CreateMesh( GEOM::GEOM_Object_ptr theShapeObject ) throw ( SALOME::SALOME_Exception ); + // Create empty mesh + SMESH::SMESH_Mesh_ptr CreateEmptyMesh() + throw ( SALOME::SALOME_Exception ); + // Create mesh(es) and import data from UNV file SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName ) throw ( SALOME::SALOME_Exception ); @@ -419,6 +428,7 @@ private: GEOM_Client* myShapeReader; // Shape reader SALOMEDS::Study_var myCurrentStudy; // Current study + CORBA::Boolean myIsEmbeddedMode; // Current mode // Dump Python: trace of API methods calls std::map < int, Handle(TColStd_HSequenceOfAsciiString) > myPythonScripts; diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index d3c645941..2021f22e2 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // File : SMESH_Gen_i_1.cxx @@ -309,23 +309,30 @@ static void addReference (SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder(); SALOMEDS::SObject_var aReferenceSO; if ( !theTag ) { + // check if the reference to theToObject already exists + // and find a free label for the reference object bool isReferred = false; + int tag = 1; SALOMEDS::ChildIterator_var anIter = theStudy->NewChildIterator( theSObject ); - for ( ; !isReferred && anIter->More(); anIter->Next() ) { - if ( anIter->Value()->ReferencedObject( aReferenceSO ) && - strcmp( aReferenceSO->GetID(), aToObjSO->GetID() ) == 0 ) - isReferred = true; + for ( ; !isReferred && anIter->More(); anIter->Next(), ++tag ) { + if ( anIter->Value()->ReferencedObject( aReferenceSO )) { + if ( strcmp( aReferenceSO->GetID(), aToObjSO->GetID() ) == 0 ) + isReferred = true; + } + else if ( !theTag ) { + SALOMEDS::GenericAttribute_var anAttr; + if ( !anIter->Value()->FindAttribute( anAttr, "AttributeIOR" )) + theTag = tag; + } } - if ( !isReferred ) { - aReferenceSO = aStudyBuilder->NewObject( theSObject ); - aStudyBuilder->Addreference( aReferenceSO, aToObjSO ); - } - } - else { - if ( !theSObject->FindSubObject( theTag, aReferenceSO )) - aReferenceSO = aStudyBuilder->NewObjectToTag( theSObject, theTag ); - aStudyBuilder->Addreference( aReferenceSO, aToObjSO ); + if ( isReferred ) + return; + if ( !theTag ) + theTag = tag; } + if ( !theSObject->FindSubObject( theTag, aReferenceSO )) + aReferenceSO = aStudyBuilder->NewObjectToTag( theSObject, theTag ); + aStudyBuilder->Addreference( aReferenceSO, aToObjSO ); } } diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index 2720a60f5..7a75b310b 100644 --- a/src/SMESH_I/SMESH_Group_i.cxx +++ b/src/SMESH_I/SMESH_Group_i.cxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -419,3 +419,33 @@ GEOM::GEOM_Object_ptr SMESH_GroupOnGeom_i::GetShape() return aGeomObj._retn(); } +//============================================================================= +/*! + * + */ +//============================================================================= +CORBA::Long SMESH_GroupBase_i::GetColorNumber() +{ + SMESHDS_GroupBase* aGroupDS = GetGroupDS(); + if (aGroupDS) + return aGroupDS->GetColorGroup(); + MESSAGE("get color number of a vague group"); + return 0; +} + +//============================================================================= +/*! + * + */ +//============================================================================= +void SMESH_GroupBase_i::SetColorNumber(CORBA::Long color) +{ + SMESHDS_GroupBase* aGroupDS = GetGroupDS(); + if (aGroupDS) + return aGroupDS->SetColorGroup(color); + MESSAGE("set color number of a vague group"); + return ; +} + + + diff --git a/src/SMESH_I/SMESH_Group_i.hxx b/src/SMESH_I/SMESH_Group_i.hxx index 5ecdc7d43..e6b181377 100644 --- a/src/SMESH_I/SMESH_Group_i.hxx +++ b/src/SMESH_I/SMESH_Group_i.hxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -75,6 +75,9 @@ class SMESH_I_EXPORT SMESH_GroupBase_i: SMESH_Group* GetSmeshGroup() const; SMESHDS_GroupBase* GetGroupDS() const; + void SetColorNumber(CORBA::Long color); + CORBA::Long GetColorNumber(); + private: SMESH_Mesh_i* myMeshServant; int myLocalID; diff --git a/src/SMESH_I/SMESH_Hypothesis_i.cxx b/src/SMESH_I/SMESH_Hypothesis_i.cxx index 707023af0..1ece6c6f1 100644 --- a/src/SMESH_I/SMESH_Hypothesis_i.cxx +++ b/src/SMESH_I/SMESH_Hypothesis_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -90,7 +90,7 @@ SMESH_Hypothesis_i::~SMESH_Hypothesis_i() char* SMESH_Hypothesis_i::GetName() { - MESSAGE( "SMESH_Hypothesis_i::GetName" ); + //MESSAGE( "SMESH_Hypothesis_i::GetName" ); return CORBA::string_dup( myBaseImpl->GetName() ); }; diff --git a/src/SMESH_I/SMESH_Hypothesis_i.hxx b/src/SMESH_I/SMESH_Hypothesis_i.hxx index 8bf6beaa1..fed1426c2 100644 --- a/src/SMESH_I/SMESH_Hypothesis_i.hxx +++ b/src/SMESH_I/SMESH_Hypothesis_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -94,6 +94,8 @@ public: virtual SMESH_Hypothesis_i* Create(PortableServer::POA_ptr thePOA, int theStudyId, ::SMESH_Gen* theGenImpl) = 0; + // return the name of IDL module + virtual std::string GetModuleName() = 0; }; //============================================================================= @@ -108,7 +110,7 @@ template class HypothesisCreator_i: public GenericHypothesisCreator_i public: virtual SMESH_Hypothesis_i* Create (PortableServer::POA_ptr thePOA, int theStudyId, - ::SMESH_Gen* theGenImpl) + ::SMESH_Gen* theGenImpl) { return new T (thePOA, theStudyId, theGenImpl); }; diff --git a/src/SMESH_I/SMESH_MEDFamily_i.cxx b/src/SMESH_I/SMESH_MEDFamily_i.cxx index 1dfe803ef..94b63e575 100644 --- a/src/SMESH_I/SMESH_MEDFamily_i.cxx +++ b/src/SMESH_I/SMESH_MEDFamily_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/SMESH_MEDFamily_i.hxx b/src/SMESH_I/SMESH_MEDFamily_i.hxx index d5b70f6f2..4dd63f3a1 100644 --- a/src/SMESH_I/SMESH_MEDFamily_i.hxx +++ b/src/SMESH_I/SMESH_MEDFamily_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -63,7 +63,7 @@ public : // IDL Methods void setProtocol(SALOME::TypeOfCommunication typ) {} void release() {} - SALOME::SenderInt_ptr getSenderForNumber(long int) {return SALOME::SenderInt::_nil();} + SALOME::SenderInt_ptr getSenderForNumber(SALOME_MED::medGeometryElement) {return SALOME::SenderInt::_nil();} SALOME::SenderInt_ptr getSenderForNumberIndex() {return SALOME::SenderInt::_nil();} CORBA::Long getIdentifier() diff --git a/src/SMESH_I/SMESH_MEDMesh_i.cxx b/src/SMESH_I/SMESH_MEDMesh_i.cxx index 221fc13c3..3840b27fa 100644 --- a/src/SMESH_I/SMESH_MEDMesh_i.cxx +++ b/src/SMESH_I/SMESH_MEDMesh_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -1081,7 +1081,7 @@ void SMESH_MEDMesh_i::calculeNbElts() throw(SALOME::SALOME_Exception) int nb_of_nodes = elem->NbNodes(); medElement = SALOME_MED::MED_HEXA8; - ASSERT(nb_of_nodes = 8); + ASSERT(nb_of_nodes == 8); if (trouveHexa8 == 0) { @@ -1121,7 +1121,7 @@ void SMESH_MEDMesh_i::createFamilies() throw(SALOME::SALOME_Exception) if (_creeFamily == false) { _creeFamily = true; - SMESH_subMesh_i *subMeshServant; + //SMESH_subMesh_i *subMeshServant; map < int, SMESH_subMesh_i * >::iterator it; for (it = _mesh_i->_mapSubMesh_i.begin(); diff --git a/src/SMESH_I/SMESH_MEDMesh_i.hxx b/src/SMESH_I/SMESH_MEDMesh_i.hxx index 0f154e8d6..6b4b358b7 100644 --- a/src/SMESH_I/SMESH_MEDMesh_i.hxx +++ b/src/SMESH_I/SMESH_MEDMesh_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -49,193 +49,203 @@ class SMESH_Mesh_i; class SMESH_I_EXPORT SMESH_MEDMesh_i: public virtual POA_SALOME_MED::MESH, public virtual SALOME::GenericObj_i { - public: private: protected: - // C++ object containing values - ::SMESH_Mesh_i * _mesh_i; - SMESHDS_Mesh *_meshDS; - - string _meshId; - bool _compte; - bool _creeFamily; - int _indexElts; - int _indexEnts; - int _famIdent; - - map < SALOME_MED::medGeometryElement, int >_mapIndToSeqElts; - SALOME_MED::long_array_var _seq_elemId[MED_NBR_GEOMETRIE_MAILLE]; - - map < SALOME_MED::medEntityMesh, int >_mapNbTypes; - map < SALOME_MED::medEntityMesh, int >_mapIndToVectTypes; - vector < SALOME_MED::medGeometryElement > - _TypesId[MED_NBR_GEOMETRIE_MAILLE]; - - vector < SALOME_MED::FAMILY_ptr > _families; - public: - - // Constructors and associated internal methods - SMESH_MEDMesh_i(); - SMESH_MEDMesh_i(SMESH_Mesh_i * m); - ~SMESH_MEDMesh_i(); - - // IDL Methods - void setProtocol(SALOME::TypeOfCommunication typ) {} - void release() {} - SALOME::SenderDouble_ptr getSenderForCoordinates(long int) {return SALOME::SenderDouble::_nil();} - SALOME::SenderInt_ptr getSenderForConnectivity(long int, long int, long int, long int) {return SALOME::SenderInt::_nil();} - SALOME::SenderInt_ptr getSenderForPolygonsConnectivity(SALOME_MED::medConnectivity, SALOME_MED::medEntityMesh) {return SALOME::SenderInt::_nil();} - SALOME::SenderInt_ptr getSenderForPolygonsConnectivityIndex(SALOME_MED::medConnectivity, SALOME_MED::medEntityMesh) {return SALOME::SenderInt::_nil();} - SALOME::SenderInt_ptr getSenderForPolyhedronConnectivity(SALOME_MED::medConnectivity) {return SALOME::SenderInt::_nil();} - SALOME::SenderInt_ptr getSenderForPolyhedronIndex(SALOME_MED::medConnectivity) {return SALOME::SenderInt::_nil();} - SALOME::SenderInt_ptr getSenderForPolyhedronFacesIndex() {return SALOME::SenderInt::_nil();} - - char *getName() throw(SALOME::SALOME_Exception); - CORBA::Long getSpaceDimension() throw(SALOME::SALOME_Exception); - - CORBA::Long getMeshDimension() throw(SALOME::SALOME_Exception); - - CORBA::Boolean getIsAGrid() throw (SALOME::SALOME_Exception); - - CORBA::Boolean - existConnectivity(SALOME_MED::medConnectivity connectivityType, - SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - - char *getCoordinatesSystem() throw(SALOME::SALOME_Exception); - - CORBA::Double getCoordinate(CORBA::Long Number, CORBA::Long Axis) - throw (SALOME::SALOME_Exception); - - SALOME_MED::double_array * getCoordinates(SALOME_MED::medModeSwitch typeSwitch) - throw(SALOME::SALOME_Exception); - - SALOME_MED::string_array * getCoordinatesNames() - throw(SALOME::SALOME_Exception); - - SALOME_MED::string_array * getCoordinatesUnits() - throw(SALOME::SALOME_Exception); - - CORBA::Long getNumberOfNodes() throw(SALOME::SALOME_Exception); - - CORBA::Long getNumberOfTypes(SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception); - - SALOME_MED::medGeometryElement_array * - getTypes(SALOME_MED::medEntityMesh entity) throw(SALOME:: - SALOME_Exception); - - SALOME_MED::medGeometryElement - getElementType(SALOME_MED::medEntityMesh entity, - CORBA::Long number) - throw (SALOME::SALOME_Exception); - - CORBA::Long getNumberOfElements(SALOME_MED::medEntityMesh entity, - SALOME_MED::medGeometryElement geomElement) - throw(SALOME::SALOME_Exception); - - SALOME_MED::long_array * - getConnectivity(SALOME_MED::medModeSwitch typeSwitch, - SALOME_MED::medConnectivity mode, - SALOME_MED::medEntityMesh entity, - SALOME_MED::medGeometryElement geomElement) - throw(SALOME::SALOME_Exception); - - SALOME_MED::long_array * - getConnectivityIndex(SALOME_MED::medConnectivity mode, - SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception); - - SALOME_MED::long_array* - getGlobalNumberingIndex(SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - - CORBA::Long getElementNumber(SALOME_MED::medConnectivity mode, - SALOME_MED::medEntityMesh entity, - SALOME_MED::medGeometryElement type, - const SALOME_MED::long_array & connectivity) - throw(SALOME::SALOME_Exception); - - SALOME_MED::long_array * - getReverseConnectivity(SALOME_MED::medConnectivity mode) - throw(SALOME::SALOME_Exception); - - SALOME_MED::long_array * - getReverseConnectivityIndex(SALOME_MED:: - medConnectivity mode) throw(SALOME::SALOME_Exception); - - // Family and Group - CORBA::Long getNumberOfFamilies(SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception); - - CORBA::Long getNumberOfGroups(SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception); - - SALOME_MED::Family_array * - getFamilies(SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception); - - SALOME_MED::FAMILY_ptr getFamily(SALOME_MED::medEntityMesh entity, - CORBA::Long i) throw(SALOME::SALOME_Exception); - - SALOME_MED::Group_array * getGroups(SALOME_MED::medEntityMesh entity) - throw(SALOME::SALOME_Exception); - - SALOME_MED::GROUP_ptr getGroup(SALOME_MED::medEntityMesh entity, - CORBA::Long i) throw(SALOME::SALOME_Exception); - - SALOME_MED::SUPPORT_ptr - getBoundaryElements(SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - - SALOME_MED::SUPPORT_ptr getSkin(SALOME_MED::SUPPORT_ptr mySupport3D) - throw (SALOME::SALOME_Exception); - - SALOME_MED::FIELD_ptr getVolume(SALOME_MED::SUPPORT_ptr mySupport) - throw(SALOME::SALOME_Exception); - - SALOME_MED::FIELD_ptr getArea(SALOME_MED::SUPPORT_ptr mySupport) - throw(SALOME::SALOME_Exception); - - SALOME_MED::FIELD_ptr getLength(SALOME_MED::SUPPORT_ptr mySupport) - throw(SALOME::SALOME_Exception); - - SALOME_MED::FIELD_ptr getNormal(SALOME_MED::SUPPORT_ptr mySupport) - throw(SALOME::SALOME_Exception); - - SALOME_MED::FIELD_ptr getBarycenter(SALOME_MED::SUPPORT_ptr mySupport) - throw(SALOME::SALOME_Exception); - - SALOME_MED::FIELD_ptr getNeighbourhood(SALOME_MED::SUPPORT_ptr mySupport) - throw(SALOME::SALOME_Exception); - - // Others - void addInStudy(SALOMEDS::Study_ptr myStudy, - SALOME_MED::MESH_ptr myIor) throw(SALOME::SALOME_Exception); - CORBA::Long addDriver(SALOME_MED::medDriverTypes driverType, - const char *fileName, const char *meshName) - throw(SALOME::SALOME_Exception); - void rmDriver(CORBA::Long i) throw(SALOME::SALOME_Exception); - void read(CORBA::Long i) throw(SALOME::SALOME_Exception); - void write(CORBA::Long i, const char *driverMeshName) - throw(SALOME::SALOME_Exception); - - // Cuisine interne - CORBA::Long getCorbaIndex() throw(SALOME::SALOME_Exception); - - SALOME_MED::MESH::meshInfos * getMeshGlobal() - throw (SALOME::SALOME_Exception); - - bool areEquals(SALOME_MED::MESH_ptr other) { return false;}; - - SALOME_MED::MESH::coordinateInfos * getCoordGlobal() - throw (SALOME::SALOME_Exception); - - SALOME_MED::MESH::connectivityInfos * - getConnectGlobal(SALOME_MED::medEntityMesh entity) - throw (SALOME::SALOME_Exception); - - // - void calculeNbElts() throw(SALOME::SALOME_Exception); - void createFamilies() throw(SALOME::SALOME_Exception); +protected: + // C++ object containing values + ::SMESH_Mesh_i * _mesh_i; + SMESHDS_Mesh *_meshDS; + + string _meshId; + bool _compte; + bool _creeFamily; + int _indexElts; + int _indexEnts; + int _famIdent; + + map < SALOME_MED::medGeometryElement, int >_mapIndToSeqElts; + SALOME_MED::long_array_var _seq_elemId[MED_NBR_GEOMETRIE_MAILLE]; + + map < SALOME_MED::medEntityMesh, int >_mapNbTypes; + map < SALOME_MED::medEntityMesh, int >_mapIndToVectTypes; + vector < SALOME_MED::medGeometryElement > + _TypesId[MED_NBR_GEOMETRIE_MAILLE]; + + vector < SALOME_MED::FAMILY_ptr > _families; +public: + + // Constructors and associated internal methods + SMESH_MEDMesh_i(); + SMESH_MEDMesh_i(SMESH_Mesh_i * m); + ~SMESH_MEDMesh_i(); + + // IDL Methods + void setProtocol(SALOME::TypeOfCommunication typ) {} + void release() {} + SALOME::SenderDouble_ptr getSenderForCoordinates(SALOME_MED::medModeSwitch) {return SALOME::SenderDouble::_nil();} + SALOME::SenderInt_ptr getSenderForConnectivity(SALOME_MED::medModeSwitch, + SALOME_MED::medConnectivity, + SALOME_MED::medEntityMesh, + SALOME_MED::medGeometryElement) + { + return SALOME::SenderInt::_nil(); + } + SALOME::SenderInt_ptr getSenderForPolygonsConnectivity(SALOME_MED::medConnectivity, SALOME_MED::medEntityMesh) {return SALOME::SenderInt::_nil();} + SALOME::SenderInt_ptr getSenderForPolygonsConnectivityIndex(SALOME_MED::medConnectivity, SALOME_MED::medEntityMesh) {return SALOME::SenderInt::_nil();} + SALOME::SenderInt_ptr getSenderForPolyhedronConnectivity(SALOME_MED::medConnectivity) {return SALOME::SenderInt::_nil();} + SALOME::SenderInt_ptr getSenderForPolyhedronIndex(SALOME_MED::medConnectivity) {return SALOME::SenderInt::_nil();} + SALOME::SenderInt_ptr getSenderForPolyhedronFacesIndex() {return SALOME::SenderInt::_nil();} + + char *getName() throw(SALOME::SALOME_Exception); + CORBA::Long getSpaceDimension() throw(SALOME::SALOME_Exception); + + CORBA::Long getMeshDimension() throw(SALOME::SALOME_Exception); + + CORBA::Boolean getIsAGrid() throw (SALOME::SALOME_Exception); + + CORBA::Boolean + existConnectivity(SALOME_MED::medConnectivity connectivityType, + SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + + char *getCoordinatesSystem() throw(SALOME::SALOME_Exception); + + CORBA::Double getCoordinate(CORBA::Long Number, CORBA::Long Axis) + throw (SALOME::SALOME_Exception); + + SALOME_MED::double_array * getCoordinates(SALOME_MED::medModeSwitch typeSwitch) + throw(SALOME::SALOME_Exception); + + SALOME_MED::string_array * getCoordinatesNames() + throw(SALOME::SALOME_Exception); + + SALOME_MED::string_array * getCoordinatesUnits() + throw(SALOME::SALOME_Exception); + + CORBA::Long getNumberOfNodes() throw(SALOME::SALOME_Exception); + + CORBA::Long getNumberOfTypes(SALOME_MED::medEntityMesh entity) + throw(SALOME::SALOME_Exception); + + SALOME_MED::medGeometryElement_array * + getTypes(SALOME_MED::medEntityMesh entity) throw(SALOME:: + SALOME_Exception); + + SALOME_MED::medGeometryElement + getElementType(SALOME_MED::medEntityMesh entity, + CORBA::Long number) + throw (SALOME::SALOME_Exception); + + CORBA::Long getNumberOfElements(SALOME_MED::medEntityMesh entity, + SALOME_MED::medGeometryElement geomElement) + throw(SALOME::SALOME_Exception); + + SALOME_MED::long_array * + getConnectivity(SALOME_MED::medModeSwitch typeSwitch, + SALOME_MED::medConnectivity mode, + SALOME_MED::medEntityMesh entity, + SALOME_MED::medGeometryElement geomElement) + throw(SALOME::SALOME_Exception); + + SALOME_MED::long_array * + getConnectivityIndex(SALOME_MED::medConnectivity mode, + SALOME_MED::medEntityMesh entity) + throw(SALOME::SALOME_Exception); + + SALOME_MED::long_array* + getGlobalNumberingIndex(SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + + CORBA::Long getElementNumber(SALOME_MED::medConnectivity mode, + SALOME_MED::medEntityMesh entity, + SALOME_MED::medGeometryElement type, + const SALOME_MED::long_array & connectivity) + throw(SALOME::SALOME_Exception); + + SALOME_MED::long_array * + getReverseConnectivity(SALOME_MED::medConnectivity mode) + throw(SALOME::SALOME_Exception); + + SALOME_MED::long_array * + getReverseConnectivityIndex(SALOME_MED::medConnectivity mode) + throw(SALOME::SALOME_Exception); + + // Family and Group + CORBA::Long getNumberOfFamilies(SALOME_MED::medEntityMesh entity) + throw(SALOME::SALOME_Exception); + + CORBA::Long getNumberOfGroups(SALOME_MED::medEntityMesh entity) + throw(SALOME::SALOME_Exception); + + SALOME_MED::Family_array * + getFamilies(SALOME_MED::medEntityMesh entity) + throw(SALOME::SALOME_Exception); + + SALOME_MED::FAMILY_ptr getFamily(SALOME_MED::medEntityMesh entity, + CORBA::Long i) + throw(SALOME::SALOME_Exception); + + SALOME_MED::Group_array * getGroups(SALOME_MED::medEntityMesh entity) + throw(SALOME::SALOME_Exception); + + SALOME_MED::GROUP_ptr getGroup(SALOME_MED::medEntityMesh entity, + CORBA::Long i) + throw(SALOME::SALOME_Exception); + + SALOME_MED::SUPPORT_ptr + getBoundaryElements(SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + + SALOME_MED::SUPPORT_ptr getSkin(SALOME_MED::SUPPORT_ptr mySupport3D) + throw (SALOME::SALOME_Exception); + + SALOME_MED::FIELD_ptr getVolume(SALOME_MED::SUPPORT_ptr mySupport) + throw(SALOME::SALOME_Exception); + + SALOME_MED::FIELD_ptr getArea(SALOME_MED::SUPPORT_ptr mySupport) + throw(SALOME::SALOME_Exception); + + SALOME_MED::FIELD_ptr getLength(SALOME_MED::SUPPORT_ptr mySupport) + throw(SALOME::SALOME_Exception); + + SALOME_MED::FIELD_ptr getNormal(SALOME_MED::SUPPORT_ptr mySupport) + throw(SALOME::SALOME_Exception); + + SALOME_MED::FIELD_ptr getBarycenter(SALOME_MED::SUPPORT_ptr mySupport) + throw(SALOME::SALOME_Exception); + + SALOME_MED::FIELD_ptr getNeighbourhood(SALOME_MED::SUPPORT_ptr mySupport) + throw(SALOME::SALOME_Exception); + + // Others + void addInStudy(SALOMEDS::Study_ptr myStudy, + SALOME_MED::MESH_ptr myIor) + throw(SALOME::SALOME_Exception); + CORBA::Long addDriver(SALOME_MED::medDriverTypes driverType, + const char *fileName, const char *meshName) + throw(SALOME::SALOME_Exception); + void rmDriver(CORBA::Long i) throw(SALOME::SALOME_Exception); + void read(CORBA::Long i) throw(SALOME::SALOME_Exception); + void write(CORBA::Long i, const char *driverMeshName) + throw(SALOME::SALOME_Exception); + + // Cuisine interne + CORBA::Long getCorbaIndex() + throw(SALOME::SALOME_Exception); + + SALOME_MED::MESH::meshInfos * getMeshGlobal() + throw (SALOME::SALOME_Exception); + + bool areEquals(SALOME_MED::MESH_ptr other) { return false;}; + + SALOME_MED::MESH::coordinateInfos * getCoordGlobal() + throw (SALOME::SALOME_Exception); + + SALOME_MED::MESH::connectivityInfos * + getConnectGlobal(SALOME_MED::medEntityMesh entity) + throw (SALOME::SALOME_Exception); + + // + void calculeNbElts() throw(SALOME::SALOME_Exception); + void createFamilies() throw(SALOME::SALOME_Exception); }; #endif /* _MED_MESH_I_HXX_ */ diff --git a/src/SMESH_I/SMESH_MEDSupport_i.cxx b/src/SMESH_I/SMESH_MEDSupport_i.cxx index b66601bbc..a0e519602 100644 --- a/src/SMESH_I/SMESH_MEDSupport_i.cxx +++ b/src/SMESH_I/SMESH_MEDSupport_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/SMESH_MEDSupport_i.hxx b/src/SMESH_I/SMESH_MEDSupport_i.hxx index 0eb3949ab..c9ddaf83d 100644 --- a/src/SMESH_I/SMESH_MEDSupport_i.hxx +++ b/src/SMESH_I/SMESH_MEDSupport_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index b9ab3cd48..79617b615 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -37,6 +37,7 @@ #include "SMESH_Gen_i.hxx" #include "SMESH_Filter_i.hxx" #include "SMESH_PythonDump.hxx" +#include "CASCatch.hxx" #include "utilities.h" @@ -61,7 +62,7 @@ using SMESH::TPythonDump; SMESH_MeshEditor_i::SMESH_MeshEditor_i(SMESH_Mesh* theMesh) { _myMesh = theMesh; -}; +} //============================================================================= /*! @@ -72,6 +73,9 @@ SMESH_MeshEditor_i::SMESH_MeshEditor_i(SMESH_Mesh* theMesh) CORBA::Boolean SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array & IDsOfElements) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + ::SMESH_MeshEditor anEditor( _myMesh ); list< int > IdList; @@ -85,7 +89,7 @@ CORBA::Boolean #endif // Remove Elements return anEditor.Remove( IdList, false ); -}; +} //============================================================================= /*! @@ -95,6 +99,9 @@ CORBA::Boolean CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array & IDsOfNodes) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + ::SMESH_MeshEditor anEditor( _myMesh ); list< int > IdList; for (int i = 0; i < IDsOfNodes.length(); i++) @@ -107,7 +114,7 @@ CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array & IDsOfNo #endif return anEditor.Remove( IdList, true ); -}; +} //============================================================================= /*! @@ -115,20 +122,39 @@ CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array & IDsOfNo */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::AddEdge(const SMESH::long_array & IDsOfNodes) +CORBA::Long SMESH_MeshEditor_i::AddEdge(const SMESH::long_array & IDsOfNodes) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + int NbNodes = IDsOfNodes.length(); + SMDS_MeshElement* elem = 0; if (NbNodes == 2) { CORBA::Long index1 = IDsOfNodes[0]; CORBA::Long index2 = IDsOfNodes[1]; - GetMeshDS()->AddEdge(GetMeshDS()->FindNode(index1), GetMeshDS()->FindNode(index2)); + elem = GetMeshDS()->AddEdge(GetMeshDS()->FindNode(index1), GetMeshDS()->FindNode(index2)); // Update Python script - TPythonDump() << "isDone = " << this << ".AddEdge([ " + TPythonDump() << "edge = " << this << ".AddEdge([ " << index1 << ", " << index2 <<" ])"; } - return true; + if (NbNodes == 3) { + CORBA::Long n1 = IDsOfNodes[0]; + CORBA::Long n2 = IDsOfNodes[1]; + CORBA::Long n12 = IDsOfNodes[2]; + elem = GetMeshDS()->AddEdge(GetMeshDS()->FindNode(n1), + GetMeshDS()->FindNode(n2), + GetMeshDS()->FindNode(n12)); + // Update Python script + TPythonDump() << "edgeID = " << this << ".AddEdge([ " + <GetID(); + + return 0; } //============================================================================= @@ -137,16 +163,19 @@ CORBA::Boolean SMESH_MeshEditor_i::AddEdge(const SMESH::long_array & IDsOfNodes) */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::AddNode(CORBA::Double x, - CORBA::Double y, CORBA::Double z) +CORBA::Long SMESH_MeshEditor_i::AddNode(CORBA::Double x, + CORBA::Double y, CORBA::Double z) { - GetMeshDS()->AddNode(x, y, z); + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + + const SMDS_MeshNode* N = GetMeshDS()->AddNode(x, y, z); // Update Python script - TPythonDump() << "isDone = " << this << ".AddNode( " + TPythonDump() << "nodeID = " << this << ".AddNode( " << x << ", " << y << ", " << z << " )"; - return true; + return N->GetID(); } //============================================================================= @@ -155,8 +184,11 @@ CORBA::Boolean SMESH_MeshEditor_i::AddNode(CORBA::Double x, */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes) +CORBA::Long SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + int NbNodes = IDsOfNodes.length(); if (NbNodes < 3) { @@ -167,27 +199,60 @@ CORBA::Boolean SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes) for (int i = 0; i < NbNodes; i++) nodes[i] = GetMeshDS()->FindNode(IDsOfNodes[i]); - if (NbNodes == 3) - { - GetMeshDS()->AddFace(nodes[0], nodes[1], nodes[2]); + SMDS_MeshElement* elem = 0; + if (NbNodes == 3) { + elem = GetMeshDS()->AddFace(nodes[0], nodes[1], nodes[2]); } - else if (NbNodes == 4) - { - GetMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3]); + else if (NbNodes == 4) { + elem = GetMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3]); } - else - { - GetMeshDS()->AddPolygonalFace(nodes); + else if (NbNodes == 6) { + elem = GetMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3], + nodes[4], nodes[5]); } + else if (NbNodes == 8) { + elem = GetMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3], + nodes[4], nodes[5], nodes[6], nodes[7]); + } + + // Update Python script + TPythonDump() << "faceID = " << this << ".AddFace( " << IDsOfNodes << " )"; + + if(elem) + return elem->GetID(); + + return 0; +} + +//============================================================================= +/*! + * AddPolygonalFace + */ +//============================================================================= +CORBA::Long SMESH_MeshEditor_i::AddPolygonalFace + (const SMESH::long_array & IDsOfNodes) +{ + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + int NbNodes = IDsOfNodes.length(); + std::vector nodes (NbNodes); + for (int i = 0; i < NbNodes; i++) + nodes[i] = GetMeshDS()->FindNode(IDsOfNodes[i]); + + const SMDS_MeshElement* elem = GetMeshDS()->AddPolygonalFace(nodes); + // Update Python script - TPythonDump() << "isDone = " << this << ".AddFace( " << IDsOfNodes << " )"; + TPythonDump() <<"faceID = "<GetID(); + + return 0; +} //============================================================================= /*! @@ -195,38 +260,62 @@ CORBA::Boolean SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes) */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::AddVolume(const SMESH::long_array & IDsOfNodes) +CORBA::Long SMESH_MeshEditor_i::AddVolume(const SMESH::long_array & IDsOfNodes) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + int NbNodes = IDsOfNodes.length(); vector< const SMDS_MeshNode*> n(NbNodes); for(int i=0;iFindNode(IDsOfNodes[i]); + SMDS_MeshElement* elem = 0; switch(NbNodes) { - case 4:GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3]); break; - case 5:GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4]); break; - case 6:GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5]); break; - case 8:GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]); break; + case 4 :elem = GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3]); break; + case 5 :elem = GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4]); break; + case 6 :elem = GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5]); break; + case 8 :elem = GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]); break; + case 10:elem = GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5], + n[6],n[7],n[8],n[9]); + break; + case 13:elem = GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5],n[6], + n[7],n[8],n[9],n[10],n[11],n[12]); + break; + case 15:elem = GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8], + n[9],n[10],n[11],n[12],n[13],n[14]); + break; + case 20:elem = GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7], + n[8],n[9],n[10],n[11],n[12],n[13],n[14], + n[15],n[16],n[17],n[18],n[19]); + break; } + // Update Python script - TPythonDump() << "isDone = " << this << ".AddVolume( " << IDsOfNodes << " )"; + TPythonDump() << "volID = " << this << ".AddVolume( " << IDsOfNodes << " )"; #ifdef _DEBUG_ - TPythonDump() << "print 'AddVolume: ', isDone"; + TPythonDump() << "print 'AddVolume: ', volID"; #endif - return true; -}; + if(elem) + return elem->GetID(); + + return 0; +} //============================================================================= /*! * AddPolyhedralVolume */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::AddPolyhedralVolume +CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolume (const SMESH::long_array & IDsOfNodes, const SMESH::long_array & Quantities) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + int NbNodes = IDsOfNodes.length(); std::vector n (NbNodes); for (int i = 0; i < NbNodes; i++) @@ -237,26 +326,32 @@ CORBA::Boolean SMESH_MeshEditor_i::AddPolyhedralVolume for (int j = 0; j < NbFaces; j++) q[j] = Quantities[j]; - GetMeshDS()->AddPolyhedralVolume(n, q); + const SMDS_MeshElement* elem = GetMeshDS()->AddPolyhedralVolume(n, q); // Update Python script - TPythonDump() << "isDone = " << this << ".AddPolyhedralVolume( " + TPythonDump() << "volID = " << this << ".AddPolyhedralVolume( " << IDsOfNodes << ", " << Quantities << " )"; #ifdef _DEBUG_ - TPythonDump() << "print 'AddPolyhedralVolume: ', isDone"; + TPythonDump() << "print 'AddPolyhedralVolume: ', volID"; #endif - return true; -}; + if(elem) + return elem->GetID(); + + return 0; +} //============================================================================= /*! * AddPolyhedralVolumeByFaces */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::AddPolyhedralVolumeByFaces +CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolumeByFaces (const SMESH::long_array & IdsOfFaces) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + int NbFaces = IdsOfFaces.length(); std::vector poly_nodes; std::vector quantities (NbFaces); @@ -271,17 +366,20 @@ CORBA::Boolean SMESH_MeshEditor_i::AddPolyhedralVolumeByFaces } } - GetMeshDS()->AddPolyhedralVolume(poly_nodes, quantities); + const SMDS_MeshElement* elem = GetMeshDS()->AddPolyhedralVolume(poly_nodes, quantities); // Update Python script - TPythonDump() << "isDone = " << this << ".AddPolyhedralVolumeByFaces( " + TPythonDump() << "volID = " << this << ".AddPolyhedralVolumeByFaces( " << IdsOfFaces << " )"; #ifdef _DEBUG_ - TPythonDump() << "print 'AddPolyhedralVolume: ', isDone"; + TPythonDump() << "print 'AddPolyhedralVolume: ', volID"; #endif - return true; -}; + if(elem) + return elem->GetID(); + + return 0; +} //============================================================================= /*! @@ -294,6 +392,9 @@ CORBA::Boolean SMESH_MeshEditor_i::MoveNode(CORBA::Long NodeID, CORBA::Double y, CORBA::Double z) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + const SMDS_MeshNode * node = GetMeshDS()->FindNode( NodeID ); if ( !node ) return false; @@ -316,6 +417,9 @@ CORBA::Boolean SMESH_MeshEditor_i::MoveNode(CORBA::Long NodeID, CORBA::Boolean SMESH_MeshEditor_i::InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + const SMDS_MeshNode * n1 = GetMeshDS()->FindNode( NodeID1 ); const SMDS_MeshNode * n2 = GetMeshDS()->FindNode( NodeID2 ); if ( !n1 || !n2 ) @@ -338,6 +442,9 @@ CORBA::Boolean SMESH_MeshEditor_i::InverseDiag(CORBA::Long NodeID1, CORBA::Boolean SMESH_MeshEditor_i::DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + const SMDS_MeshNode * n1 = GetMeshDS()->FindNode( NodeID1 ); const SMDS_MeshNode * n2 = GetMeshDS()->FindNode( NodeID2 ); if ( !n1 || !n2 ) @@ -348,7 +455,12 @@ CORBA::Boolean SMESH_MeshEditor_i::DeleteDiag(CORBA::Long NodeID1, << NodeID1 << ", " << NodeID2 << " )"; ::SMESH_MeshEditor aMeshEditor( _myMesh ); - return aMeshEditor.DeleteDiag ( n1, n2 ); + + bool stat = aMeshEditor.DeleteDiag ( n1, n2 ); + + UpdateLastResult(aMeshEditor); + + return stat; } //============================================================================= @@ -359,6 +471,9 @@ CORBA::Boolean SMESH_MeshEditor_i::DeleteDiag(CORBA::Long NodeID1, CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::long_array & IDsOfElements) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + ::SMESH_MeshEditor anEditor( _myMesh ); for (int i = 0; i < IDsOfElements.length(); i++) { @@ -382,6 +497,9 @@ CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::long_array & IDsOfEleme CORBA::Boolean SMESH_MeshEditor_i::ReorientObject(SMESH::SMESH_IDSource_ptr theObject) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESH::long_array_var anElementsId = theObject->GetIDs(); CORBA::Boolean isDone = Reorient(anElementsId); @@ -395,6 +513,29 @@ CORBA::Boolean SMESH_MeshEditor_i::ReorientObject(SMESH::SMESH_IDSource_ptr theO return isDone; } + +//======================================================================= +//function : ToMap +//purpose : auxilary function for conversion long_array to std::map<> +// which is used in some methods +//======================================================================= +static void ToMap(const SMESH::long_array & IDs, + const SMESHDS_Mesh* aMesh, + std::map& aMap, + const SMDSAbs_ElementType aType = SMDSAbs_All ) +{ + for (int i=0; i::iterator It = aMap.find(ind); + if(It==aMap.end()) { + const SMDS_MeshElement * elem = aMesh->FindElement(ind); + if ( elem && ( aType == SMDSAbs_All || elem->GetType() == aType )) + aMap.insert( make_pair( elem->GetID(), elem )); + } + } +} + + //============================================================================= /*! * @@ -404,14 +545,13 @@ CORBA::Boolean SMESH_MeshEditor_i::TriToQuad (const SMESH::long_array & IDsOfE SMESH::NumericalFunctor_ptr Criterion, CORBA::Double MaxAngle) { - set faces; - for (int i = 0; i < IDsOfElements.length(); i++) - { - CORBA::Long index = IDsOfElements[i]; - const SMDS_MeshElement * elem = GetMeshDS()->FindElement(index); - if ( elem && elem->GetType() == SMDSAbs_Face) - faces.insert( elem ); - } + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + + SMESHDS_Mesh* aMesh = GetMeshDS(); + map faces; + ToMap(IDsOfElements, aMesh, faces, SMDSAbs_Face); + SMESH::NumericalFunctor_i* aNumericalFunctor = dynamic_cast( SMESH_Gen_i::GetServant( Criterion ).in() ); SMESH::Controls::NumericalFunctorPtr aCrit; @@ -422,15 +562,21 @@ CORBA::Boolean SMESH_MeshEditor_i::TriToQuad (const SMESH::long_array & IDsOfE // Update Python script TPythonDump() << "isDone = " << this << ".TriToQuad( " - << IDsOfElements << ", None, " << MaxAngle << " )"; + << IDsOfElements << ", " << aNumericalFunctor << ", " << MaxAngle << " )"; #ifdef _DEBUG_ TPythonDump() << "print 'TriToQuad: ', isDone"; #endif ::SMESH_MeshEditor anEditor( _myMesh ); - return anEditor.TriToQuad( faces, aCrit, MaxAngle ); + + bool stat = anEditor.TriToQuad( faces, aCrit, MaxAngle ); + + UpdateLastResult(anEditor); + + return stat; } + //============================================================================= /*! * @@ -440,6 +586,9 @@ CORBA::Boolean SMESH_MeshEditor_i::TriToQuadObject (SMESH::SMESH_IDSource_ptr SMESH::NumericalFunctor_ptr Criterion, CORBA::Double MaxAngle) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESH::long_array_var anElementsId = theObject->GetIDs(); CORBA::Boolean isDone = TriToQuad(anElementsId, Criterion, MaxAngle); @@ -450,9 +599,12 @@ CORBA::Boolean SMESH_MeshEditor_i::TriToQuadObject (SMESH::SMESH_IDSource_ptr aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID()); #endif + SMESH::NumericalFunctor_i* aNumericalFunctor = + SMESH::DownCast( Criterion ); + // Update Python script TPythonDump() << "isDone = " << this << ".TriToQuadObject(" - << theObject << ", None, " << MaxAngle << " )"; + << theObject << ", " << aNumericalFunctor << ", " << MaxAngle << " )"; #ifdef _DEBUG_ TPythonDump() << "print 'TriToQuadObject: ', isDone"; #endif @@ -460,6 +612,7 @@ CORBA::Boolean SMESH_MeshEditor_i::TriToQuadObject (SMESH::SMESH_IDSource_ptr return isDone; } + //============================================================================= /*! * @@ -468,14 +621,13 @@ CORBA::Boolean SMESH_MeshEditor_i::TriToQuadObject (SMESH::SMESH_IDSource_ptr CORBA::Boolean SMESH_MeshEditor_i::QuadToTri (const SMESH::long_array & IDsOfElements, SMESH::NumericalFunctor_ptr Criterion) { - set faces; - for (int i = 0; i < IDsOfElements.length(); i++) - { - CORBA::Long index = IDsOfElements[i]; - const SMDS_MeshElement * elem = GetMeshDS()->FindElement(index); - if ( elem && elem->GetType() == SMDSAbs_Face) - faces.insert( elem ); - } + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + + SMESHDS_Mesh* aMesh = GetMeshDS(); + map faces; + ToMap(IDsOfElements, aMesh, faces, SMDSAbs_Face); + SMESH::NumericalFunctor_i* aNumericalFunctor = dynamic_cast( SMESH_Gen_i::GetServant( Criterion ).in() ); SMESH::Controls::NumericalFunctorPtr aCrit; @@ -486,15 +638,20 @@ CORBA::Boolean SMESH_MeshEditor_i::QuadToTri (const SMESH::long_array & IDsOfE // Update Python script - TPythonDump() << "isDone = " << this << ".QuadToTri( " << IDsOfElements << ", None )"; + TPythonDump() << "isDone = " << this << ".QuadToTri( " << IDsOfElements << ", " << aNumericalFunctor << " )"; #ifdef _DEBUG_ TPythonDump() << "print 'QuadToTri: ', isDone"; #endif ::SMESH_MeshEditor anEditor( _myMesh ); - return anEditor.QuadToTri( faces, aCrit ); + CORBA::Boolean stat = anEditor.QuadToTri( faces, aCrit ); + + UpdateLastResult(anEditor); + + return stat; } + //============================================================================= /*! * @@ -503,6 +660,9 @@ CORBA::Boolean SMESH_MeshEditor_i::QuadToTri (const SMESH::long_array & IDsOfE CORBA::Boolean SMESH_MeshEditor_i::QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject, SMESH::NumericalFunctor_ptr Criterion) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESH::long_array_var anElementsId = theObject->GetIDs(); CORBA::Boolean isDone = QuadToTri(anElementsId, Criterion); @@ -513,8 +673,11 @@ CORBA::Boolean SMESH_MeshEditor_i::QuadToTriObject (SMESH::SMESH_IDSource_ptr aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID()); #endif + SMESH::NumericalFunctor_i* aNumericalFunctor = + SMESH::DownCast( Criterion ); + // Update Python script - TPythonDump() << "isDone = " << this << ".QuadToTriObject(" << theObject << ", None )"; + TPythonDump() << "isDone = " << this << ".QuadToTriObject( " << theObject << ", " << aNumericalFunctor << " )"; #ifdef _DEBUG_ TPythonDump() << "print 'QuadToTriObject: ', isDone"; #endif @@ -522,6 +685,7 @@ CORBA::Boolean SMESH_MeshEditor_i::QuadToTriObject (SMESH::SMESH_IDSource_ptr return isDone; } + //============================================================================= /*! * @@ -530,14 +694,12 @@ CORBA::Boolean SMESH_MeshEditor_i::QuadToTriObject (SMESH::SMESH_IDSource_ptr CORBA::Boolean SMESH_MeshEditor_i::SplitQuad (const SMESH::long_array & IDsOfElements, CORBA::Boolean Diag13) { - set faces; - for (int i = 0; i < IDsOfElements.length(); i++) - { - CORBA::Long index = IDsOfElements[i]; - const SMDS_MeshElement * elem = GetMeshDS()->FindElement(index); - if ( elem && elem->GetType() == SMDSAbs_Face) - faces.insert( elem ); - } + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + + SMESHDS_Mesh* aMesh = GetMeshDS(); + map faces; + ToMap(IDsOfElements, aMesh, faces, SMDSAbs_Face); // Update Python script TPythonDump() << "isDone = " << this << ".SplitQuad( " @@ -547,9 +709,14 @@ CORBA::Boolean SMESH_MeshEditor_i::SplitQuad (const SMESH::long_array & IDsOfEle #endif ::SMESH_MeshEditor anEditor( _myMesh ); - return anEditor.QuadToTri( faces, Diag13 ); + CORBA::Boolean stat = anEditor.QuadToTri( faces, Diag13 ); + + UpdateLastResult(anEditor); + + return stat; } + //============================================================================= /*! * @@ -558,6 +725,9 @@ CORBA::Boolean SMESH_MeshEditor_i::SplitQuad (const SMESH::long_array & IDsOfEle CORBA::Boolean SMESH_MeshEditor_i::SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject, CORBA::Boolean Diag13) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESH::long_array_var anElementsId = theObject->GetIDs(); CORBA::Boolean isDone = SplitQuad(anElementsId, Diag13); @@ -578,6 +748,7 @@ CORBA::Boolean SMESH_MeshEditor_i::SplitQuadObject (SMESH::SMESH_IDSource_ptr th return isDone; } + //============================================================================= /*! * BestSplit @@ -603,6 +774,7 @@ CORBA::Long SMESH_MeshEditor_i::BestSplit (CORBA::Long IDOfQuad, return -1; } + //======================================================================= //function : Smooth //purpose : @@ -619,6 +791,7 @@ CORBA::Boolean MaxAspectRatio, Method, false ); } + //======================================================================= //function : SmoothParametric //purpose : @@ -635,6 +808,7 @@ CORBA::Boolean MaxAspectRatio, Method, true ); } + //======================================================================= //function : SmoothObject //purpose : @@ -651,6 +825,7 @@ CORBA::Boolean MaxAspectRatio, Method, false); } + //======================================================================= //function : SmoothParametricObject //purpose : @@ -667,6 +842,7 @@ CORBA::Boolean MaxAspectRatio, Method, true); } + //============================================================================= /*! * @@ -681,20 +857,16 @@ CORBA::Boolean SMESH::SMESH_MeshEditor::Smooth_Method Method, bool IsParametric) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); - set elements; - for (int i = 0; i < IDsOfElements.length(); i++) - { - CORBA::Long index = IDsOfElements[i]; - const SMDS_MeshElement * elem = aMesh->FindElement(index); - if ( elem && elem->GetType() == SMDSAbs_Face) - elements.insert( elem ); - } + map elements; + ToMap(IDsOfElements, aMesh, elements, SMDSAbs_Face); set fixedNodes; - for (int i = 0; i < IDsOfFixedNodes.length(); i++) - { + for (int i = 0; i < IDsOfFixedNodes.length(); i++) { CORBA::Long index = IDsOfFixedNodes[i]; const SMDS_MeshNode * node = aMesh->FindNode(index); if ( node ) @@ -708,6 +880,8 @@ CORBA::Boolean anEditor.Smooth(elements, fixedNodes, method, MaxNbOfIterations, MaxAspectRatio, IsParametric ); + UpdateLastResult(anEditor); + // Update Python script TPythonDump() << "isDone = " << this << "." << (IsParametric ? "SmoothParametric( " : "Smooth( ") @@ -723,6 +897,7 @@ CORBA::Boolean return true; } + //============================================================================= /*! * @@ -737,6 +912,9 @@ SMESH_MeshEditor_i::smoothObject(SMESH::SMESH_IDSource_ptr theObjec SMESH::SMESH_MeshEditor::Smooth_Method Method, bool IsParametric) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESH::long_array_var anElementsId = theObject->GetIDs(); CORBA::Boolean isDone = smooth (anElementsId, IDsOfFixedNodes, MaxNbOfIterations, MaxAspectRatio, Method, IsParametric); @@ -763,6 +941,7 @@ SMESH_MeshEditor_i::smoothObject(SMESH::SMESH_IDSource_ptr theObjec return isDone; } + //============================================================================= /*! * @@ -777,6 +956,7 @@ void SMESH_MeshEditor_i::RenumberNodes() GetMeshDS()->Renumber( true ); } + //============================================================================= /*! * @@ -791,6 +971,7 @@ void SMESH_MeshEditor_i::RenumberElements() GetMeshDS()->Renumber( false ); } + //======================================================================= //function : RotationSweep //purpose : @@ -802,16 +983,14 @@ void SMESH_MeshEditor_i::RotationSweep(const SMESH::long_array & theIDsOfElement CORBA::Long theNbOfSteps, CORBA::Double theTolerance) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); - set elements; - for (int i = 0; i < theIDsOfElements.length(); i++) - { - CORBA::Long index = theIDsOfElements[i]; - const SMDS_MeshElement * elem = aMesh->FindElement(index); - if ( elem ) - elements.insert( elem ); - } + map elements; + ToMap(theIDsOfElements, aMesh, elements); + gp_Ax1 Ax1 (gp_Pnt( theAxis.x, theAxis.y, theAxis.z ), gp_Vec( theAxis.vx, theAxis.vy, theAxis.vz )); @@ -819,6 +998,8 @@ void SMESH_MeshEditor_i::RotationSweep(const SMESH::long_array & theIDsOfElement anEditor.RotationSweep (elements, Ax1, theAngleInRadians, theNbOfSteps, theTolerance); + UpdateLastResult(anEditor); + // Update Python script TPythonDump() << "axis = " << theAxis; TPythonDump() << this << ".RotationSweep( " @@ -840,6 +1021,9 @@ void SMESH_MeshEditor_i::RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject CORBA::Long theNbOfSteps, CORBA::Double theTolerance) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESH::long_array_var anElementsId = theObject->GetIDs(); RotationSweep(anElementsId, theAxis, theAngleInRadians, theNbOfSteps, theTolerance); @@ -865,28 +1049,34 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen const SMESH::DirStruct & theStepVector, CORBA::Long theNbOfSteps) { - SMESHDS_Mesh* aMesh = GetMeshDS(); + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); - set elements; - for (int i = 0; i < theIDsOfElements.length(); i++) - { - CORBA::Long index = theIDsOfElements[i]; - const SMDS_MeshElement * elem = aMesh->FindElement(index); - if ( elem ) - elements.insert( elem ); - } - const SMESH::PointStruct * P = &theStepVector.PS; - gp_Vec stepVec( P->x, P->y, P->z ); + CASCatch_TRY { + SMESHDS_Mesh* aMesh = GetMeshDS(); + + map elements; + ToMap(theIDsOfElements, aMesh, elements); - ::SMESH_MeshEditor anEditor( _myMesh ); - //anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps); - TElemOfElemListMap aHystory; - anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory); + const SMESH::PointStruct * P = &theStepVector.PS; + gp_Vec stepVec( P->x, P->y, P->z ); + + TElemOfElemListMap aHystory; + ::SMESH_MeshEditor anEditor( _myMesh ); + anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory); - // Update Python script - TPythonDump() << "stepVector = " << theStepVector; - TPythonDump() << this << ".ExtrusionSweep( " - << theIDsOfElements << ", stepVector, " << theNbOfSteps << " )"; + UpdateLastResult(anEditor); + + // Update Python script + TPythonDump() << "stepVector = " << theStepVector; + TPythonDump() << this << ".ExtrusionSweep( " + << theIDsOfElements << ", stepVector, " << theNbOfSteps << " )"; + + } + CASCatch_CATCH(Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + INFOS( "SMESH_MeshEditor_i::ExtrusionSweep fails - "<< aFail->GetMessageString() ); + } } @@ -899,6 +1089,9 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObjec const SMESH::DirStruct & theStepVector, CORBA::Long theNbOfSteps) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESH::long_array_var anElementsId = theObject->GetIDs(); ExtrusionSweep(anElementsId, theStepVector, theNbOfSteps); @@ -920,18 +1113,16 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObj const SMESH::DirStruct & theStepVector, CORBA::Long theNbOfSteps) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); SMESH::long_array_var allElementsId = theObject->GetIDs(); - set elements; - for (int i = 0; i < allElementsId->length(); i++) - { - CORBA::Long index = allElementsId[i]; - const SMDS_MeshElement * elem = aMesh->FindElement(index); - if ( elem && elem->GetType() == SMDSAbs_Edge ) - elements.insert( elem ); - } + map elements; + ToMap(allElementsId, aMesh, elements); + const SMESH::PointStruct * P = &theStepVector.PS; gp_Vec stepVec( P->x, P->y, P->z ); @@ -940,6 +1131,8 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObj TElemOfElemListMap aHystory; anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory); + UpdateLastResult(anEditor); + // Update Python script TPythonDump() << "stepVector = " << theStepVector; TPythonDump() << this << ".ExtrusionSweepObject1D( " @@ -955,18 +1148,16 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObj const SMESH::DirStruct & theStepVector, CORBA::Long theNbOfSteps) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); SMESH::long_array_var allElementsId = theObject->GetIDs(); - set elements; - for (int i = 0; i < allElementsId->length(); i++) - { - CORBA::Long index = allElementsId[i]; - const SMDS_MeshElement * elem = aMesh->FindElement(index); - if ( elem && elem->GetType() == SMDSAbs_Face ) - elements.insert( elem ); - } + map elements; + ToMap(allElementsId, aMesh, elements); + const SMESH::PointStruct * P = &theStepVector.PS; gp_Vec stepVec( P->x, P->y, P->z ); @@ -975,6 +1166,8 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObj TElemOfElemListMap aHystory; anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory); + UpdateLastResult(anEditor); + // Update Python script TPythonDump() << "stepVector = " << theStepVector; TPythonDump() << this << ".ExtrusionSweepObject2D( " @@ -993,16 +1186,14 @@ void SMESH_MeshEditor_i::AdvancedExtrusion(const SMESH::long_array & theIDsOfEle CORBA::Long theExtrFlags, CORBA::Double theSewTolerance) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); - set elements; - for (int i = 0; i < theIDsOfElements.length(); i++) - { - CORBA::Long index = theIDsOfElements[i]; - const SMDS_MeshElement * elem = aMesh->FindElement(index); - if ( elem ) - elements.insert( elem ); - } + map elements; + ToMap(theIDsOfElements, aMesh, elements); + const SMESH::PointStruct * P = &theStepVector.PS; gp_Vec stepVec( P->x, P->y, P->z ); @@ -1011,6 +1202,8 @@ void SMESH_MeshEditor_i::AdvancedExtrusion(const SMESH::long_array & theIDsOfEle anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory, theExtrFlags, theSewTolerance); + UpdateLastResult(anEditor); + // Update Python script TPythonDump() << "stepVector = " << theStepVector; TPythonDump() << this << ".AdvancedExtrusion(" @@ -1053,6 +1246,9 @@ SMESH::SMESH_MeshEditor::Extrusion_Error CORBA::Boolean theHasRefPoint, const SMESH::PointStruct & theRefPoint) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); if ( thePathMesh->_is_nil() || thePathShape->_is_nil() ) @@ -1062,25 +1258,18 @@ SMESH::SMESH_MeshEditor::Extrusion_Error TopoDS_Shape aShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( thePathShape ); SMESH_subMesh* aSubMesh = aMeshImp->GetImpl().GetSubMesh( aShape ); - if ( !aSubMesh ) + if ( !aSubMesh || !aSubMesh->GetSubMeshDS()) return SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE; SMDS_MeshNode* nodeStart = (SMDS_MeshNode*)aMeshImp->GetImpl().GetMeshDS()->FindNode(theNodeStart); if ( !nodeStart ) return SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE; - set elements; - for (int i = 0; i < theIDsOfElements.length(); i++) - { - CORBA::Long index = theIDsOfElements[i]; - const SMDS_MeshElement * elem = aMesh->FindElement(index); - if ( elem ) - elements.insert( elem ); - } + map elements; + ToMap(theIDsOfElements, aMesh, elements); list angles; - for (int i = 0; i < theAngles.length(); i++) - { + for (int i = 0; i < theAngles.length(); i++) { angles.push_back( theAngles[i] ); } @@ -1101,9 +1290,14 @@ SMESH::SMESH_MeshEditor::Extrusion_Error << theHasRefPoint << ", refPoint )"; ::SMESH_MeshEditor anEditor( _myMesh ); - return convExtrError( anEditor.ExtrusionAlongTrack( elements, aSubMesh, nodeStart, - theHasAngles, angles, - theHasRefPoint, refPnt ) ); + SMESH::SMESH_MeshEditor::Extrusion_Error error = + convExtrError( anEditor.ExtrusionAlongTrack( elements, aSubMesh, nodeStart, + theHasAngles, angles, + theHasRefPoint, refPnt ) ); + + UpdateLastResult(anEditor); + + return error; } //======================================================================= @@ -1121,6 +1315,9 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObje CORBA::Boolean theHasRefPoint, const SMESH::PointStruct & theRefPoint) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESH::long_array_var anElementsId = theObject->GetIDs(); SMESH::SMESH_MeshEditor::Extrusion_Error error = ExtrusionAlongPath (anElementsId, thePathMesh, thePathShape, theNodeStart, @@ -1153,16 +1350,14 @@ void SMESH_MeshEditor_i::Mirror(const SMESH::long_array & theIDsOfElem SMESH::SMESH_MeshEditor::MirrorType theMirrorType, CORBA::Boolean theCopy) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); - set elements; - for (int i = 0; i < theIDsOfElements.length(); i++) - { - CORBA::Long index = theIDsOfElements[i]; - const SMDS_MeshElement * elem = aMesh->FindElement(index); - if ( elem ) - elements.insert( elem ); - } + map elements; + ToMap(theIDsOfElements, aMesh, elements); + gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z ); gp_Vec V ( theAxis.vx, theAxis.vy, theAxis.vz ); @@ -1191,8 +1386,13 @@ void SMESH_MeshEditor_i::Mirror(const SMESH::long_array & theIDsOfElem ::SMESH_MeshEditor anEditor( _myMesh ); anEditor.Transform (elements, aTrsf, theCopy); + + if(theCopy) { + UpdateLastResult(anEditor); + } } + //======================================================================= //function : MirrorObject //purpose : @@ -1203,6 +1403,9 @@ void SMESH_MeshEditor_i::MirrorObject(SMESH::SMESH_IDSource_ptr theObj SMESH::SMESH_MeshEditor::MirrorType theMirrorType, CORBA::Boolean theCopy) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESH::long_array_var anElementsId = theObject->GetIDs(); Mirror(anElementsId, theAxis, theMirrorType, theCopy); @@ -1239,16 +1442,14 @@ void SMESH_MeshEditor_i::Translate(const SMESH::long_array & theIDsOfElements, const SMESH::DirStruct & theVector, CORBA::Boolean theCopy) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); - set elements; - for (int i = 0; i < theIDsOfElements.length(); i++) - { - CORBA::Long index = theIDsOfElements[i]; - const SMDS_MeshElement * elem = aMesh->FindElement(index); - if ( elem ) - elements.insert( elem ); - } + map elements; + ToMap(theIDsOfElements, aMesh, elements); + gp_Trsf aTrsf; const SMESH::PointStruct * P = &theVector.PS; aTrsf.SetTranslation( gp_Vec( P->x, P->y, P->z )); @@ -1256,6 +1457,10 @@ void SMESH_MeshEditor_i::Translate(const SMESH::long_array & theIDsOfElements, ::SMESH_MeshEditor anEditor( _myMesh ); anEditor.Transform (elements, aTrsf, theCopy); + if(theCopy) { + UpdateLastResult(anEditor); + } + // Update Python script TPythonDump() << "vector = " << theVector; TPythonDump() << this << ".Translate( " @@ -1273,6 +1478,9 @@ void SMESH_MeshEditor_i::TranslateObject(SMESH::SMESH_IDSource_ptr theObject, const SMESH::DirStruct & theVector, CORBA::Boolean theCopy) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESH::long_array_var anElementsId = theObject->GetIDs(); Translate(anElementsId, theVector, theCopy); @@ -1297,16 +1505,14 @@ void SMESH_MeshEditor_i::Rotate(const SMESH::long_array & theIDsOfElements, CORBA::Double theAngle, CORBA::Boolean theCopy) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); - set elements; - for (int i = 0; i < theIDsOfElements.length(); i++) - { - CORBA::Long index = theIDsOfElements[i]; - const SMDS_MeshElement * elem = aMesh->FindElement(index); - if ( elem ) - elements.insert( elem ); - } + map elements; + ToMap(theIDsOfElements, aMesh, elements); + gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z ); gp_Vec V ( theAxis.vx, theAxis.vy, theAxis.vz ); @@ -1316,6 +1522,10 @@ void SMESH_MeshEditor_i::Rotate(const SMESH::long_array & theIDsOfElements, ::SMESH_MeshEditor anEditor( _myMesh ); anEditor.Transform (elements, aTrsf, theCopy); + if(theCopy) { + UpdateLastResult(anEditor); + } + // Update Python script TPythonDump() << "axis = " << theAxis; TPythonDump() << this << ".Rotate( " @@ -1335,6 +1545,9 @@ void SMESH_MeshEditor_i::RotateObject(SMESH::SMESH_IDSource_ptr theObject, CORBA::Double theAngle, CORBA::Boolean theCopy) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESH::long_array_var anElementsId = theObject->GetIDs(); Rotate(anElementsId, theAxis, theAngle, theCopy); @@ -1358,6 +1571,9 @@ void SMESH_MeshEditor_i::RotateObject(SMESH::SMESH_IDSource_ptr theObject, void SMESH_MeshEditor_i::FindCoincidentNodes (CORBA::Double Tolerance, SMESH::array_of_long_array_out GroupsOfNodes) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + ::SMESH_MeshEditor::TListOfListOfNodes aListOfListOfNodes; ::SMESH_MeshEditor anEditor( _myMesh ); set nodes; // no input nodes @@ -1366,8 +1582,7 @@ void SMESH_MeshEditor_i::FindCoincidentNodes (CORBA::Double Tol GroupsOfNodes = new SMESH::array_of_long_array; GroupsOfNodes->length( aListOfListOfNodes.size() ); ::SMESH_MeshEditor::TListOfListOfNodes::iterator llIt = aListOfListOfNodes.begin(); - for ( CORBA::Long i = 0; llIt != aListOfListOfNodes.end(); llIt++, i++ ) - { + for ( CORBA::Long i = 0; llIt != aListOfListOfNodes.end(); llIt++, i++ ) { list< const SMDS_MeshNode* >& aListOfNodes = *llIt; list< const SMDS_MeshNode* >::iterator lIt = aListOfNodes.begin();; SMESH::long_array& aGroup = (*GroupsOfNodes)[i]; @@ -1387,6 +1602,9 @@ void SMESH_MeshEditor_i::FindCoincidentNodes (CORBA::Double Tol void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); TPythonDump aTPythonDump; @@ -1424,6 +1642,9 @@ void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfN void SMESH_MeshEditor_i::MergeEqualElements() { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + ::SMESH_MeshEditor anEditor( _myMesh ); anEditor.MergeEqualElements(); @@ -1470,6 +1691,9 @@ SMESH::SMESH_MeshEditor::Sew_Error CORBA::Boolean CreatePolygons, CORBA::Boolean CreatePolyedrs) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); const SMDS_MeshNode* aBorderFirstNode = aMesh->FindNode( FirstNodeID1 ); @@ -1500,17 +1724,23 @@ SMESH::SMESH_MeshEditor::Sew_Error << CreatePolyedrs<< " )"; ::SMESH_MeshEditor anEditor( _myMesh ); - return convError( anEditor.SewFreeBorder (aBorderFirstNode, - aBorderSecondNode, - aBorderLastNode, - aSide2FirstNode, - aSide2SecondNode, - aSide2ThirdNode, - true, - CreatePolygons, - CreatePolyedrs) ); + SMESH::SMESH_MeshEditor::Sew_Error error = + convError( anEditor.SewFreeBorder (aBorderFirstNode, + aBorderSecondNode, + aBorderLastNode, + aSide2FirstNode, + aSide2SecondNode, + aSide2ThirdNode, + true, + CreatePolygons, + CreatePolyedrs) ); + + UpdateLastResult(anEditor); + + return error; } + //======================================================================= //function : SewConformFreeBorders //purpose : @@ -1523,6 +1753,9 @@ SMESH_MeshEditor_i::SewConformFreeBorders(CORBA::Long FirstNodeID1, CORBA::Long FirstNodeID2, CORBA::Long SecondNodeID2) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); const SMDS_MeshNode* aBorderFirstNode = aMesh->FindNode( FirstNodeID1 ); @@ -1549,16 +1782,22 @@ SMESH_MeshEditor_i::SewConformFreeBorders(CORBA::Long FirstNodeID1, << SecondNodeID2 << " )"; ::SMESH_MeshEditor anEditor( _myMesh ); - return convError( anEditor.SewFreeBorder (aBorderFirstNode, - aBorderSecondNode, - aBorderLastNode, - aSide2FirstNode, - aSide2SecondNode, - aSide2ThirdNode, - true, - false, false) ); + SMESH::SMESH_MeshEditor::Sew_Error error = + convError( anEditor.SewFreeBorder (aBorderFirstNode, + aBorderSecondNode, + aBorderLastNode, + aSide2FirstNode, + aSide2SecondNode, + aSide2ThirdNode, + true, + false, false) ); + + UpdateLastResult(anEditor); + + return error; } + //======================================================================= //function : SewBorderToSide //purpose : @@ -1573,6 +1812,9 @@ SMESH_MeshEditor_i::SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder, CORBA::Boolean CreatePolygons, CORBA::Boolean CreatePolyedrs) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); const SMDS_MeshNode* aBorderFirstNode = aMesh->FindNode( FirstNodeIDOnFreeBorder ); @@ -1601,17 +1843,23 @@ SMESH_MeshEditor_i::SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder, << CreatePolyedrs << ") "; ::SMESH_MeshEditor anEditor( _myMesh ); - return convError( anEditor.SewFreeBorder (aBorderFirstNode, - aBorderSecondNode, - aBorderLastNode, - aSide2FirstNode, - aSide2SecondNode, - aSide2ThirdNode, - false, - CreatePolygons, - CreatePolyedrs) ); + SMESH::SMESH_MeshEditor::Sew_Error error = + convError( anEditor.SewFreeBorder (aBorderFirstNode, + aBorderSecondNode, + aBorderLastNode, + aSide2FirstNode, + aSide2SecondNode, + aSide2ThirdNode, + false, + CreatePolygons, + CreatePolyedrs) ); + + UpdateLastResult(anEditor); + + return error; } + //======================================================================= //function : SewSideElements //purpose : @@ -1625,6 +1873,9 @@ SMESH_MeshEditor_i::SewSideElements(const SMESH::long_array& IDsOfSide1Elements, CORBA::Long NodeID2OfSide1ToMerge, CORBA::Long NodeID2OfSide2ToMerge) { + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + SMESHDS_Mesh* aMesh = GetMeshDS(); const SMDS_MeshNode* aFirstNode1ToMerge = aMesh->FindNode( NodeID1OfSide1ToMerge ); @@ -1639,21 +1890,10 @@ SMESH_MeshEditor_i::SewSideElements(const SMESH::long_array& IDsOfSide1Elements, !aSecondNode2ToMerge) return SMESH::SMESH_MeshEditor::SEW_BAD_SIDE2_NODES; - set aSide1Elems, aSide2Elems; - for (int i = 0; i < IDsOfSide1Elements.length(); i++) - { - CORBA::Long index = IDsOfSide1Elements[i]; - const SMDS_MeshElement * elem = aMesh->FindElement(index); - if ( elem ) - aSide1Elems.insert( elem ); - } - for (int i = 0; i < IDsOfSide2Elements.length(); i++) - { - CORBA::Long index = IDsOfSide2Elements[i]; - const SMDS_MeshElement * elem = aMesh->FindElement(index); - if ( elem ) - aSide2Elems.insert( elem ); - } + map aSide1Elems, aSide2Elems; + ToMap(IDsOfSide1Elements, aMesh, aSide1Elems); + ToMap(IDsOfSide2Elements, aMesh, aSide2Elems); + // Update Python script TPythonDump() << "error = " << this << ".SewSideElements( " << IDsOfSide1Elements << ", " @@ -1664,9 +1904,135 @@ SMESH_MeshEditor_i::SewSideElements(const SMESH::long_array& IDsOfSide1Elements, << NodeID2OfSide2ToMerge << ")"; ::SMESH_MeshEditor anEditor( _myMesh ); - return convError( anEditor.SewSideElements (aSide1Elems, aSide2Elems, - aFirstNode1ToMerge, - aFirstNode2ToMerge, - aSecondNode1ToMerge, - aSecondNode2ToMerge)); + SMESH::SMESH_MeshEditor::Sew_Error error = + convError( anEditor.SewSideElements (aSide1Elems, aSide2Elems, + aFirstNode1ToMerge, + aFirstNode2ToMerge, + aSecondNode1ToMerge, + aSecondNode2ToMerge)); + + UpdateLastResult(anEditor); + + return error; +} + +//================================================================================ +/*! + * \brief Set new nodes for given element + * \param ide - element id + * \param newIDs - new node ids + * \retval CORBA::Boolean - true if result is OK + */ +//================================================================================ + +CORBA::Boolean SMESH_MeshEditor_i::ChangeElemNodes(CORBA::Long ide, + const SMESH::long_array& newIDs) +{ + myLastCreatedElems = new SMESH::long_array(); + myLastCreatedNodes = new SMESH::long_array(); + + const SMDS_MeshElement* elem = GetMeshDS()->FindElement(ide); + if(!elem) return false; + + int nbn = newIDs.length(); + int i=0; + vector aNodes (nbn); + int nbn1=-1; + for(; iFindNode(newIDs[i]); + if(aNode) { + nbn1++; + aNodes[nbn1] = aNode; + } + } + // Update Python script + TPythonDump() << "isDone = " << this << ".ChangeElemNodes( " + << ide << ", " << newIDs << " )"; +#ifdef _DEBUG_ + TPythonDump() << "print 'ChangeElemNodes: ', isDone"; +#endif + + return GetMeshDS()->ChangeElementNodes( elem, &aNodes[0], nbn1+1 ); +} + +//================================================================================ +/*! + * \brief Update myLastCreatedNodes and myLastCreatedElems + * \param anEditor - it contains last modification results + */ +//================================================================================ + +void SMESH_MeshEditor_i::UpdateLastResult(::SMESH_MeshEditor& anEditor) +{ + // add new elements into myLastCreatedNodes + SMESH_SequenceOfElemPtr aSeq = anEditor.GetLastCreatedNodes(); + SMESH::long_array_var aResult = new SMESH::long_array; + aResult->length(aSeq.Length()); + int i=0; + for(; iGetID(); + } + myLastCreatedNodes = aResult._retn(); + // add new elements into myLastCreatedElems + aSeq = anEditor.GetLastCreatedElems(); + aResult = new SMESH::long_array; + aResult->length(aSeq.Length()); + i=0; + for(; iGetID(); + } + myLastCreatedElems = aResult._retn(); +} + +//================================================================================ +/*! + * \brief Returns list of it's IDs of created nodes + * \retval SMESH::long_array* - list of node ID + */ +//================================================================================ + +SMESH::long_array* SMESH_MeshEditor_i::GetLastCreatedNodes() +{ + return myLastCreatedNodes; +} + +//================================================================================ +/*! + * \brief Returns list of it's IDs of created elements + * \retval SMESH::long_array* - list of elements' ID + */ +//================================================================================ + +SMESH::long_array* SMESH_MeshEditor_i::GetLastCreatedElems() +{ + return myLastCreatedElems; +} + + +//======================================================================= +//function : ConvertToQuadratic +//purpose : +//======================================================================= + +void SMESH_MeshEditor_i::ConvertToQuadratic(CORBA::Boolean theForce3d) +{ + ::SMESH_MeshEditor anEditor( _myMesh ); + anEditor.ConvertToQuadratic(theForce3d); + // Update Python script + TPythonDump() << this << ".ConvertToQuadratic( " + << theForce3d << " )"; +} + +//======================================================================= +//function : ConvertFromQuadratic +//purpose : +//======================================================================= + +CORBA::Boolean SMESH_MeshEditor_i::ConvertFromQuadratic() +{ + ::SMESH_MeshEditor anEditor( _myMesh ); + CORBA::Boolean isDone = anEditor.ConvertFromQuadratic(); + // Update Python script + TPythonDump() << this << ".ConvertFromQuadratic()"; + return isDone; } diff --git a/src/SMESH_I/SMESH_MeshEditor_i.hxx b/src/SMESH_I/SMESH_MeshEditor_i.hxx index b72bd738c..6433d9162 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.hxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -36,6 +36,8 @@ #include "SMESH_Mesh.hxx" +class SMESH_MeshEditor; + class SMESH_I_EXPORT SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor { public: @@ -49,14 +51,18 @@ class SMESH_I_EXPORT SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements); CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes); - CORBA::Boolean AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z); - CORBA::Boolean AddEdge(const SMESH::long_array & IDsOfNodes); - CORBA::Boolean AddFace(const SMESH::long_array & IDsOfNodes); - CORBA::Boolean AddVolume(const SMESH::long_array & IDsOfNodes); - - CORBA::Boolean AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes, - const SMESH::long_array & Quantities); - CORBA::Boolean AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces); + /*! + * Methods for creation new elements. + * Returns ID of created element or 0 if element not created + */ + CORBA::Long AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z); + CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes); + CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes); + CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes); + CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes); + CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes, + const SMESH::long_array & Quantities); + CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces); CORBA::Boolean MoveNode(CORBA::Long NodeID, CORBA::Double x, CORBA::Double y, CORBA::Double z); @@ -117,6 +123,10 @@ class SMESH_I_EXPORT SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor SMESH::SMESH_MeshEditor::Smooth_Method Method, bool IsParametric); + + void ConvertToQuadratic(CORBA::Boolean Force3d); + CORBA::Boolean ConvertFromQuadratic(); + void RenumberNodes(); void RenumberElements(); @@ -197,6 +207,7 @@ class SMESH_I_EXPORT SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes); void MergeEqualElements(); + SMESH::SMESH_MeshEditor::Sew_Error SewFreeBorders(CORBA::Long FirstNodeID1, CORBA::Long SecondNodeID1, @@ -228,9 +239,48 @@ class SMESH_I_EXPORT SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor CORBA::Long NodeID2OfSide1ToMerge, CORBA::Long NodeID2OfSide2ToMerge); + /*! + * Set new nodes for given element. + * If number of nodes is not corresponded to type of + * element - returns false + */ + CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs); + + /*! + * If during last operation of MeshEditor some nodes were + * created this method returns list of it's IDs, if new nodes + * not creared - returns empty list + */ + SMESH::long_array* GetLastCreatedNodes(); + + /*! + * If during last operation of MeshEditor some elements were + * created this method returns list of it's IDs, if new elements + * not creared - returns empty list + */ + SMESH::long_array* GetLastCreatedElems(); + + // + // Internal methods + // + + /*! + * \brief Update myLastCreatedNodes and myLastCreatedElems + * \param anEditor - it contains edition results + */ + void UpdateLastResult(::SMESH_MeshEditor& anEditor); + + /*! + * \brief Return edited mesh ID + * \retval int - mesh ID + */ + int GetMeshId() const { return _myMesh->GetId(); } + private: SMESHDS_Mesh * GetMeshDS() { return _myMesh->GetMeshDS(); } SMESH_Mesh *_myMesh; + SMESH::long_array* myLastCreatedElems; + SMESH::long_array* myLastCreatedNodes; }; #endif diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index c56c56918..367eda450 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -46,6 +46,9 @@ #include "SMESH_MeshEditor_i.hxx" #include "SMESH_Gen_i.hxx" #include "DriverMED_R_SMESHDS_Mesh.h" +//#include "SMDS_ElemIterator.hxx" +#include "SMDS_VolumeTool.hxx" +#include "SMESH_MesherHelper.hxx" // OCCT Includes #include @@ -73,6 +76,8 @@ using SMESH::TPythonDump; int SMESH_Mesh_i::myIdGenerator = 0; + + //============================================================================= /*! * Constructor @@ -235,6 +240,18 @@ int SMESH_Mesh_i::ImportUNVFile( const char* theFileName ) // Read mesh with name = into SMESH_Mesh _impl->UNVToMesh( theFileName ); + CreateGroupServants(); + + SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy(); + if ( !aStudy->_is_nil() ) { + // publishing of the groups in the study (sub-meshes are out of scope of UNV import) + map::iterator it = _mapGroups.begin(); + for (; it != _mapGroups.end(); it++ ) { + SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_duplicate( it->second ); + _gen_i->PublishGroup( aStudy, _this(), aGroup, + GEOM::GEOM_Object::_nil(), aGroup->GetName()); + } + } return 1; } @@ -266,24 +283,7 @@ int SMESH_Mesh_i::importMEDFile( const char* theFileName, const char* theMeshNam { // Read mesh with name = and all its groups into SMESH_Mesh int status = _impl->MEDToMesh( theFileName, theMeshName ); - - // Create group servants, if any groups were imported - list aGroupIds = _impl->GetGroupIds(); - for ( list::iterator it = aGroupIds.begin(); it != aGroupIds.end(); it++ ) { - SMESH_Group_i* aGroupImpl = new SMESH_Group_i( SMESH_Gen_i::GetPOA(), this, *it ); - - // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i - SMESH_Gen_i::GetPOA()->activate_object( aGroupImpl ); - aGroupImpl->Register(); - // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i - - SMESH::SMESH_Group_var aGroup = SMESH::SMESH_Group::_narrow( aGroupImpl->_this() ); - _mapGroups[*it] = SMESH::SMESH_Group::_duplicate( aGroup ); - - // register CORBA object for persistence - int nextId = _gen_i->RegisterObject( aGroup ); - if(MYDEBUG) MESSAGE( "Add group to map with id = "<< nextId); - } + CreateGroupServants(); return status; } @@ -316,6 +316,8 @@ static SMESH::Hypothesis_Status ConvertHypothesisStatus res = SMESH::HYP_ALREADY_EXIST; break; case SMESH_Hypothesis::HYP_BAD_DIM: res = SMESH::HYP_BAD_DIM; break; + case SMESH_Hypothesis::HYP_BAD_SUBSHAPE: + res = SMESH::HYP_BAD_SUBSHAPE; break; default: res = SMESH::HYP_UNKNOWN_FATAL; } @@ -726,6 +728,47 @@ void SMESH_Mesh_i::RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup _gen_i->RemoveLastFromPythonScript(_gen_i->GetCurrentStudy()->StudyId()); } + +//================================================================================ +/*! + * \brief Get the list of groups existing in the mesh + * \retval SMESH::ListOfGroups * - list of groups + */ +//================================================================================ + +SMESH::ListOfGroups * SMESH_Mesh_i::GetGroups() throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + if (MYDEBUG) MESSAGE("GetGroups"); + + SMESH::ListOfGroups_var aList = new SMESH::ListOfGroups(); + // Python Dump + TPythonDump aPythonDump; + aPythonDump << "[ "; + + try { + aList->length( _mapGroups.size() ); + int i = 0; + map::iterator it = _mapGroups.begin(); + for ( ; it != _mapGroups.end(); it++ ) { + if ( CORBA::is_nil( it->second )) continue; + aList[i++] = SMESH::SMESH_GroupBase::_duplicate( it->second ); + // Python Dump + if (i > 1) aPythonDump << ", "; + aPythonDump << it->second; + } + aList->length( i ); + } + catch(SALOME_Exception & S_ex) { + THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM); + } + + // Update Python script + aPythonDump << " ] = " << _this() << ".GetGroups()"; + + return aList._retn(); +} + //============================================================================= /*! UnionGroups * New group is created. All mesh elements that are @@ -1167,6 +1210,11 @@ SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor() */ //============================================================================= +CORBA::Boolean SMESH_Mesh_i::HasDuplicatedGroupNamesMED() +{ + return _impl->HasDuplicatedGroupNamesMED(); +} + static void PrepareForWriting (const char* file) { TCollection_AsciiString aFullName ((char*)file); @@ -1345,6 +1393,13 @@ CORBA::Long SMESH_Mesh_i::NbEdges()throw(SALOME::SALOME_Exception) return _impl->NbEdges(); } +CORBA::Long SMESH_Mesh_i::NbEdgesOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbEdges( (::SMESH_Mesh::ElementOrder) order); +} + //============================================================================= /*! * @@ -1374,6 +1429,27 @@ CORBA::Long SMESH_Mesh_i::NbPolygons()throw(SALOME::SALOME_Exception) return _impl->NbPolygons(); } +CORBA::Long SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbFaces( (::SMESH_Mesh::ElementOrder) order); +} + +CORBA::Long SMESH_Mesh_i::NbTrianglesOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbTriangles( (::SMESH_Mesh::ElementOrder) order); +} + +CORBA::Long SMESH_Mesh_i::NbQuadranglesOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbQuadrangles( (::SMESH_Mesh::ElementOrder) order); +} + //============================================================================= /*! * @@ -1415,6 +1491,41 @@ CORBA::Long SMESH_Mesh_i::NbPolyhedrons()throw(SALOME::SALOME_Exception) return _impl->NbPolyhedrons(); } +CORBA::Long SMESH_Mesh_i::NbVolumesOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbVolumes( (::SMESH_Mesh::ElementOrder) order); +} + +CORBA::Long SMESH_Mesh_i::NbTetrasOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbTetras( (::SMESH_Mesh::ElementOrder) order); +} + +CORBA::Long SMESH_Mesh_i::NbHexasOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbHexas( (::SMESH_Mesh::ElementOrder) order); +} + +CORBA::Long SMESH_Mesh_i::NbPyramidsOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbPyramids( (::SMESH_Mesh::ElementOrder) order); +} + +CORBA::Long SMESH_Mesh_i::NbPrismsOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbPrisms( (::SMESH_Mesh::ElementOrder) order); +} + //============================================================================= /*! * @@ -1445,17 +1556,19 @@ char* SMESH_Mesh_i::Dump() //============================================================================= SMESH::long_array* SMESH_Mesh_i::GetIDs() { - SMESH::long_array_var aResult = new SMESH::long_array(); - SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); - int aMinId = aSMESHDS_Mesh->MinElementID(); - int aMaxId = aSMESHDS_Mesh->MaxElementID(); +// SMESH::long_array_var aResult = new SMESH::long_array(); +// SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); +// int aMinId = aSMESHDS_Mesh->MinElementID(); +// int aMaxId = aSMESHDS_Mesh->MaxElementID(); - aResult->length(aMaxId - aMinId + 1); +// aResult->length(aMaxId - aMinId + 1); - for (int i = 0, id = aMinId; id <= aMaxId; id++ ) - aResult[i++] = id; +// for (int i = 0, id = aMinId; id <= aMaxId; id++ ) +// aResult[i++] = id; - return aResult._retn(); +// return aResult._retn(); + // PAL12398 + return GetElementsId(); } //============================================================================= @@ -1563,3 +1676,449 @@ SMESH::ElementType SMESH_Mesh_i::GetElementType( const CORBA::Long id, const boo { return ( SMESH::ElementType )_impl->GetElementType( id, iselem ); } + + +//============================================================================= +/*! + * Returns ID of elements for given submesh + */ +//============================================================================= +SMESH::long_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID) + throw (SALOME::SALOME_Exception) +{ + SMESH::long_array_var aResult = new SMESH::long_array(); + + SMESH_subMesh* SM = _impl->GetSubMeshContaining(ShapeID); + if(!SM) return aResult._retn(); + + SMESHDS_SubMesh* SDSM = SM->GetSubMeshDS(); + if(!SDSM) return aResult._retn(); + + aResult->length(SDSM->NbElements()); + + SMDS_ElemIteratorPtr eIt = SDSM->GetElements(); + int i = 0; + while ( eIt->more() ) { + aResult[i++] = eIt->next()->GetID(); + } + + return aResult._retn(); +} + + +//============================================================================= +/*! + * Returns ID of nodes for given submesh + * If param all==true - returns all nodes, else - + * returns only nodes on shapes. + */ +//============================================================================= +SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, CORBA::Boolean all) + throw (SALOME::SALOME_Exception) +{ + SMESH::long_array_var aResult = new SMESH::long_array(); + + SMESH_subMesh* SM = _impl->GetSubMeshContaining(ShapeID); + if(!SM) return aResult._retn(); + + SMESHDS_SubMesh* SDSM = SM->GetSubMeshDS(); + if(!SDSM) return aResult._retn(); + + map theElems; + if( !all || (SDSM->NbElements()==0 && SDSM->NbNodes()==1) ) { + SMDS_NodeIteratorPtr nIt = SDSM->GetNodes(); + while ( nIt->more() ) { + const SMDS_MeshNode* elem = nIt->next(); + theElems.insert( make_pair(elem->GetID(),elem) ); + } + } + else { // all nodes of submesh elements + SMDS_ElemIteratorPtr eIt = SDSM->GetElements(); + while ( eIt->more() ) { + const SMDS_MeshElement* anElem = eIt->next(); + SMDS_ElemIteratorPtr nIt = anElem->nodesIterator(); + while ( nIt->more() ) { + const SMDS_MeshElement* elem = nIt->next(); + theElems.insert( make_pair(elem->GetID(),elem) ); + } + } + } + + aResult->length(theElems.size()); + map::iterator itElem; + int i = 0; + for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) + aResult[i++] = (*itElem).first; + + return aResult._retn(); +} + + +//============================================================================= +/*! + * Returns type of elements for given submesh + */ +//============================================================================= +SMESH::ElementType SMESH_Mesh_i::GetSubMeshElementType(const CORBA::Long ShapeID) + throw (SALOME::SALOME_Exception) +{ + SMESH_subMesh* SM = _impl->GetSubMeshContaining(ShapeID); + if(!SM) return SMESH::ALL; + + SMESHDS_SubMesh* SDSM = SM->GetSubMeshDS(); + if(!SDSM) return SMESH::ALL; + + if(SDSM->NbElements()==0) + return (SM->GetSubShape().ShapeType() == TopAbs_VERTEX) ? SMESH::NODE : SMESH::ALL; + + SMDS_ElemIteratorPtr eIt = SDSM->GetElements(); + const SMDS_MeshElement* anElem = eIt->next(); + return ( SMESH::ElementType ) anElem->GetType(); +} + + +//============================================================================= +/*! + * + */ +//============================================================================= + +CORBA::Long SMESH_Mesh_i::GetMeshPtr() +{ + return CORBA::Long(size_t(_impl)); +} + + +//============================================================================= +/*! + * Get XYZ coordinates of node as list of double + * If there is not node for given ID - returns empty list + */ +//============================================================================= + +SMESH::double_array* SMESH_Mesh_i::GetNodeXYZ(const CORBA::Long id) +{ + SMESH::double_array_var aResult = new SMESH::double_array(); + SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); + if ( aSMESHDS_Mesh == NULL ) + return aResult._retn(); + + // find node + const SMDS_MeshNode* aNode = aSMESHDS_Mesh->FindNode(id); + if(!aNode) + return aResult._retn(); + + // add coordinates + aResult->length(3); + aResult[0] = aNode->X(); + aResult[1] = aNode->Y(); + aResult[2] = aNode->Z(); + return aResult._retn(); +} + + +//============================================================================= +/*! + * For given node returns list of IDs of inverse elements + * If there is not node for given ID - returns empty list + */ +//============================================================================= + +SMESH::long_array* SMESH_Mesh_i::GetNodeInverseElements(const CORBA::Long id) +{ + SMESH::long_array_var aResult = new SMESH::long_array(); + SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); + if ( aSMESHDS_Mesh == NULL ) + return aResult._retn(); + + // find node + const SMDS_MeshNode* aNode = aSMESHDS_Mesh->FindNode(id); + if(!aNode) + return aResult._retn(); + + // find inverse elements + SMDS_ElemIteratorPtr eIt = aNode->GetInverseElementIterator(); + TColStd_SequenceOfInteger IDs; + while(eIt->more()) { + const SMDS_MeshElement* elem = eIt->next(); + IDs.Append(elem->GetID()); + } + if(IDs.Length()>0) { + aResult->length(IDs.Length()); + int i = 1; + for(; i<=IDs.Length(); i++) { + aResult[i-1] = IDs.Value(i); + } + } + return aResult._retn(); +} + + +//============================================================================= +/*! + * If given element is node returns IDs of shape from position + * else - return ID of result shape after ::FindShape() + * from SMESH_MeshEditor + * If there is not element for given ID - returns -1 + */ +//============================================================================= + +CORBA::Long SMESH_Mesh_i::GetShapeID(const CORBA::Long id) +{ + SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); + if ( aSMESHDS_Mesh == NULL ) + return -1; + + // try to find node + const SMDS_MeshNode* aNode = aSMESHDS_Mesh->FindNode(id); + if(aNode) { + SMDS_PositionPtr pos = aNode->GetPosition(); + if(!pos) + return -1; + else + return pos->GetShapeId(); + } + + // try to find element + const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id); + if(!elem) + return -1; + + // need implementation??????????????????????????????????????????????? + return -1; +} + + +//============================================================================= +/*! + * Returns number of nodes for given element + * If there is not element for given ID - returns -1 + */ +//============================================================================= + +CORBA::Long SMESH_Mesh_i::GetElemNbNodes(const CORBA::Long id) +{ + SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); + if ( aSMESHDS_Mesh == NULL ) return -1; + // try to find element + const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id); + if(!elem) return -1; + return elem->NbNodes(); +} + + +//============================================================================= +/*! + * Returns ID of node by given index for given element + * If there is not element for given ID - returns -1 + * If there is not node for given index - returns -2 + */ +//============================================================================= + +CORBA::Long SMESH_Mesh_i::GetElemNode(const CORBA::Long id, const CORBA::Long index) +{ + SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); + if ( aSMESHDS_Mesh == NULL ) return -1; + const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id); + if(!elem) return -1; + if( index>=elem->NbNodes() || index<0 ) return -1; + return elem->GetNode(index)->GetID(); +} + + +//============================================================================= +/*! + * Returns true if given node is medium node + * in given quadratic element + */ +//============================================================================= + +CORBA::Boolean SMESH_Mesh_i::IsMediumNode(const CORBA::Long ide, const CORBA::Long idn) +{ + SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); + if ( aSMESHDS_Mesh == NULL ) return false; + // try to find node + const SMDS_MeshNode* aNode = aSMESHDS_Mesh->FindNode(idn); + if(!aNode) return false; + // try to find element + const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(ide); + if(!elem) return false; + + return elem->IsMediumNode(aNode); +} + + +//============================================================================= +/*! + * Returns true if given node is medium node + * in one of quadratic elements + */ +//============================================================================= + +CORBA::Boolean SMESH_Mesh_i::IsMediumNodeOfAnyElem(const CORBA::Long idn, + SMESH::ElementType theElemType) +{ + SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); + if ( aSMESHDS_Mesh == NULL ) return false; + + // try to find node + const SMDS_MeshNode* aNode = aSMESHDS_Mesh->FindNode(idn); + if(!aNode) return false; + + SMESH_MesherHelper aHelper( *(_impl) ); + + SMDSAbs_ElementType aType; + if(theElemType==SMESH::EDGE) aType = SMDSAbs_Edge; + else if(theElemType==SMESH::FACE) aType = SMDSAbs_Face; + else if(theElemType==SMESH::VOLUME) aType = SMDSAbs_Volume; + else aType = SMDSAbs_All; + + return aHelper.IsMedium(aNode,aType); +} + + +//============================================================================= +/*! + * Returns number of edges for given element + */ +//============================================================================= + +CORBA::Long SMESH_Mesh_i::ElemNbEdges(const CORBA::Long id) +{ + SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); + if ( aSMESHDS_Mesh == NULL ) return -1; + const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id); + if(!elem) return -1; + return elem->NbEdges(); +} + + +//============================================================================= +/*! + * Returns number of faces for given element + */ +//============================================================================= + +CORBA::Long SMESH_Mesh_i::ElemNbFaces(const CORBA::Long id) +{ + SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); + if ( aSMESHDS_Mesh == NULL ) return -1; + const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id); + if(!elem) return -1; + return elem->NbFaces(); +} + + +//============================================================================= +/*! + * Returns true if given element is polygon + */ +//============================================================================= + +CORBA::Boolean SMESH_Mesh_i::IsPoly(const CORBA::Long id) +{ + SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); + if ( aSMESHDS_Mesh == NULL ) return false; + const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id); + if(!elem) return false; + return elem->IsPoly(); +} + + +//============================================================================= +/*! + * Returns true if given element is quadratic + */ +//============================================================================= + +CORBA::Boolean SMESH_Mesh_i::IsQuadratic(const CORBA::Long id) +{ + SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); + if ( aSMESHDS_Mesh == NULL ) return false; + const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id); + if(!elem) return false; + return elem->IsQuadratic(); +} + + +//============================================================================= +/*! + * Returns bary center for given element + */ +//============================================================================= + +SMESH::double_array* SMESH_Mesh_i::BaryCenter(const CORBA::Long id) +{ + SMESH::double_array_var aResult = new SMESH::double_array(); + SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); + if ( aSMESHDS_Mesh == NULL ) + return aResult._retn(); + + const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id); + if(!elem) + return aResult._retn(); + + if(elem->GetType()==SMDSAbs_Volume) { + // use SMDS_VolumeTool + SMDS_VolumeTool aTool; + if(aTool.Set(elem)) { + double x=0., y=0., z=0.; + if(aTool.GetBaryCenter(x,y,z)) { + // add coordinates + aResult->length(3); + aResult[0] = x; + aResult[1] = y; + aResult[2] = z; + } + } + } + else { + SMDS_ElemIteratorPtr anIt = elem->nodesIterator(); + int nbn = 0; + double x=0., y=0., z=0.; + for(; anIt->more(); ) { + nbn++; + const SMDS_MeshNode* aNode = static_cast(anIt->next()); + x += aNode->X(); + y += aNode->Y(); + z += aNode->Z(); + } + if(nbn>0) { + // add coordinates + aResult->length(3); + aResult[0] = x/nbn; + aResult[1] = y/nbn; + aResult[2] = z/nbn; + } + } + + return aResult._retn(); +} + + +//============================================================================= +/*! + * + */ +//============================================================================= +void SMESH_Mesh_i::CreateGroupServants() +{ + // Create group servants, if any groups were imported + list aGroupIds = _impl->GetGroupIds(); + for ( list::iterator it = aGroupIds.begin(); it != aGroupIds.end(); it++ ) { + SMESH_Group_i* aGroupImpl = new SMESH_Group_i( SMESH_Gen_i::GetPOA(), this, *it ); + + // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i + SMESH_Gen_i::GetPOA()->activate_object( aGroupImpl ); + aGroupImpl->Register(); + // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i + + SMESH::SMESH_Group_var aGroup = SMESH::SMESH_Group::_narrow( aGroupImpl->_this() ); + _mapGroups[*it] = SMESH::SMESH_Group::_duplicate( aGroup ); + + // register CORBA object for persistence + int nextId = _gen_i->RegisterObject( aGroup ); + if(MYDEBUG) MESSAGE( "Add group to map with id = "<< nextId); + } +} + diff --git a/src/SMESH_I/SMESH_Mesh_i.hxx b/src/SMESH_I/SMESH_Mesh_i.hxx index 82a44605c..be52708c7 100644 --- a/src/SMESH_I/SMESH_Mesh_i.hxx +++ b/src/SMESH_I/SMESH_Mesh_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -101,6 +101,9 @@ public: void RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup ) throw (SALOME::SALOME_Exception); + SMESH::ListOfGroups* GetGroups() + throw (SALOME::SALOME_Exception); + SMESH::SMESH_Group_ptr UnionGroups( SMESH::SMESH_GroupBase_ptr theGroup1, SMESH::SMESH_GroupBase_ptr theGroup2, const char* theName ) @@ -134,12 +137,11 @@ public: throw (SALOME::SALOME_Exception); // --- C++ interface - void SetImpl(::SMESH_Mesh* impl); ::SMESH_Mesh& GetImpl(); // :: force no namespace here SMESH_Gen_i* GetGen() { return _gen_i; } - + int ImportUNVFile( const char* theFileName ) throw (SALOME::SALOME_Exception); @@ -152,6 +154,11 @@ public: SMESH::DriverMED_ReadStatus ImportMEDFile( const char* theFileName, const char* theMeshName ) throw (SALOME::SALOME_Exception); + /*! Check group names for duplications. + * Consider maximum group name length stored in MED file. + */ + CORBA::Boolean HasDuplicatedGroupNamesMED(); + void ExportToMED( const char* file, CORBA::Boolean auto_groups, SMESH::MED_VERSION theVersion ) throw (SALOME::SALOME_Exception); void ExportMED( const char* file, CORBA::Boolean auto_groups ) @@ -176,33 +183,60 @@ public: CORBA::Long NbEdges() throw (SALOME::SALOME_Exception); + CORBA::Long NbEdgesOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbFaces() throw (SALOME::SALOME_Exception); + CORBA::Long NbFacesOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbTriangles() throw (SALOME::SALOME_Exception); + CORBA::Long NbTrianglesOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbQuadrangles() throw (SALOME::SALOME_Exception); + CORBA::Long NbQuadranglesOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbPolygons() throw (SALOME::SALOME_Exception); CORBA::Long NbVolumes() throw (SALOME::SALOME_Exception); + CORBA::Long NbVolumesOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbTetras() throw (SALOME::SALOME_Exception); + CORBA::Long NbTetrasOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbHexas() throw (SALOME::SALOME_Exception); + CORBA::Long NbHexasOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbPyramids() throw (SALOME::SALOME_Exception); + CORBA::Long NbPyramidsOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbPrisms() throw (SALOME::SALOME_Exception); + CORBA::Long NbPrismsOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbPolyhedrons() throw (SALOME::SALOME_Exception); @@ -221,6 +255,26 @@ public: SMESH::ElementType GetElementType( CORBA::Long id, bool iselem ) throw (SALOME::SALOME_Exception); + /*! + * Returns ID of elements for given submesh + */ + SMESH::long_array* GetSubMeshElementsId( CORBA::Long ShapeID) + throw (SALOME::SALOME_Exception); + + /*! + * Returns ID of nodes for given submesh + * If param all==true - returns all nodes, else - + * returns only nodes on shapes. + */ + SMESH::long_array* GetSubMeshNodesId( CORBA::Long ShapeID, CORBA::Boolean all) + throw (SALOME::SALOME_Exception); + + /*! + * Returns type of elements for given submesh + */ + SMESH::ElementType GetSubMeshElementType( CORBA::Long ShapeID) + throw (SALOME::SALOME_Exception); + char* Dump(); // Internal methods not available through CORBA @@ -252,10 +306,87 @@ public: virtual SMESH::long_array* GetIDs(); + CORBA::Long GetMeshPtr(); + + + /*! + * Get XYZ coordinates of node as list of double + * If there is not node for given ID - returns empty list + */ + SMESH::double_array* GetNodeXYZ( CORBA::Long id); + + /*! + * For given node returns list of IDs of inverse elements + * If there is not node for given ID - returns empty list + */ + SMESH::long_array* GetNodeInverseElements( CORBA::Long id); + + /*! + * If given element is node returns IDs of shape from position + * else - return ID of result shape after ::FindShape() + * from SMESH_MeshEditor + * If there is not element for given ID - returns -1 + */ + CORBA::Long GetShapeID( CORBA::Long id); + + /*! + * Returns number of nodes for given element + * If there is not element for given ID - returns -1 + */ + CORBA::Long GetElemNbNodes( CORBA::Long id); + + /*! + * Returns ID of node by given index for given element + * If there is not element for given ID - returns -1 + * If there is not node for given index - returns -2 + */ + CORBA::Long GetElemNode( CORBA::Long id, CORBA::Long index); + + /*! + * Returns true if given node is medium node + * in given quadratic element + */ + CORBA::Boolean IsMediumNode( CORBA::Long ide, CORBA::Long idn); + + /*! + * Returns true if given node is medium node + * in one of quadratic elements + */ + CORBA::Boolean IsMediumNodeOfAnyElem( CORBA::Long idn, + SMESH::ElementType theElemType); + + /*! + * Returns number of edges for given element + */ + CORBA::Long ElemNbEdges( CORBA::Long id); + + /*! + * Returns number of faces for given element + */ + CORBA::Long ElemNbFaces( CORBA::Long id); + + /*! + * Returns true if given element is polygon + */ + CORBA::Boolean IsPoly( CORBA::Long id); + + /*! + * Returns true if given element is quadratic + */ + CORBA::Boolean IsQuadratic( CORBA::Long id); + + /*! + * Returns bary center for given element + */ + SMESH::double_array* BaryCenter( CORBA::Long id); + + map _mapSubMesh_i; //NRI map _mapSubMesh; //NRI private: + void CreateGroupServants(); + static int myIdGenerator; ::SMESH_Mesh* _impl; // :: force no namespace here SMESH_Gen_i* _gen_i; diff --git a/src/SMESH_I/SMESH_Pattern_i.cxx b/src/SMESH_I/SMESH_Pattern_i.cxx index f48a6fab3..13ed3ac89 100644 --- a/src/SMESH_I/SMESH_Pattern_i.cxx +++ b/src/SMESH_I/SMESH_Pattern_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -106,8 +106,21 @@ SMESH_Pattern_i::SMESH_Pattern_i( SMESH_Gen_i* theGen_i ): CORBA::Boolean SMESH_Pattern_i::LoadFromFile(const char* theFileContents) { + // remove some gabage from the end + TCollection_AsciiString patternDescription = (char*) theFileContents; + int pos = patternDescription.Length(); + while (! isdigit( patternDescription.Value( pos ))) + pos--; + if ( pos != patternDescription.Length() ) { + patternDescription.Trunc( pos ); + } + // Update Python script - TPythonDump() << "isDone = pattern.LoadFromFile(" << theFileContents << ")"; + TPythonDump() << "isDone = pattern.LoadFromFile(" + << TPythonDump::LongStringStart("Pattern") + << patternDescription + << TPythonDump::LongStringEnd() + << ")"; addErrorCode( "LoadFromFile" ); return myPattern.Load( theFileContents ); @@ -470,6 +483,7 @@ SMESH::SMESH_Pattern::ErrorCode SMESH_Pattern_i::GetErrorCode() RETCASE( ERR_LOAD_EMPTY_SUBMESH ); RETCASE( ERR_LOADF_NARROW_FACE ); RETCASE( ERR_LOADF_CLOSED_FACE ); + RETCASE( ERR_LOADF_CANT_PROJECT ); RETCASE( ERR_LOADV_BAD_SHAPE ); RETCASE( ERR_LOADV_COMPUTE_PARAMS ); RETCASE( ERR_APPL_NOT_LOADED ); diff --git a/src/SMESH_I/SMESH_Pattern_i.hxx b/src/SMESH_I/SMESH_Pattern_i.hxx index 537d7b015..7a5a92cbf 100644 --- a/src/SMESH_I/SMESH_Pattern_i.hxx +++ b/src/SMESH_I/SMESH_Pattern_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/SMESH_PythonDump.hxx b/src/SMESH_I/SMESH_PythonDump.hxx index 57a7cf826..6e65a3d41 100644 --- a/src/SMESH_I/SMESH_PythonDump.hxx +++ b/src/SMESH_I/SMESH_PythonDump.hxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef _SMESH_PYTHONDUMP_HXX_ #define _SMESH_PYTHONDUMP_HXX_ @@ -112,6 +112,35 @@ namespace SMESH static char* SMESHGenName() { return "smeshgen"; } static char* MeshEditorName() { return "mesh_editor"; } + + /*! + * \brief Return marker of long string literal beginning + * \param type - a name of functionality producing the string literal + * \retval TCollection_AsciiString - the marker string to be written into + * a raw python script + */ + static TCollection_AsciiString LongStringStart(const char* type); + /*! + * \brief Return marker of long string literal end + * \retval TCollection_AsciiString - the marker string to be written into + * a raw python script + */ + static TCollection_AsciiString LongStringEnd(); + /*! + * \brief Cut out a long string literal from a string + * \param theText - text possibly containing string literals + * \param theFrom - position in the text to search from + * \param theLongString - the retrieved literal + * \param theStringType - a name of functionality produced the literal + * \retval bool - true if a string literal found + * + * The literal is removed from theText; theFrom points position right after + * the removed literal + */ + static bool CutoutLongString( TCollection_AsciiString & theText, + int & theFrom, + TCollection_AsciiString & theLongString, + TCollection_AsciiString & theStringType); }; } diff --git a/src/SMESH_I/SMESH_subMesh_i.cxx b/src/SMESH_I/SMESH_subMesh_i.cxx index 650d44765..d8f5c2bb8 100644 --- a/src/SMESH_I/SMESH_subMesh_i.cxx +++ b/src/SMESH_I/SMESH_subMesh_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -129,9 +129,8 @@ bool getSubMeshes(::SMESH_subMesh* theSubMesh, list::iterator sh = shapeList.begin(); for ( ; sh != shapeList.end(); ++sh ) { for ( TopoDS_Iterator it( *sh ); it.More(); it.Next() ) { - ::SMESH_subMesh* aSubMesh = aMesh->GetSubMeshContaining( it.Value() ); - if ( aSubMesh ) - getSubMeshes( aSubMesh, theSubMeshList ); + if ( ::SMESH_subMesh* aSubMesh = aMesh->GetSubMeshContaining( it.Value() )) + getSubMeshes( aSubMesh, theSubMeshList ); // add found submesh or explore deeper else // no submesh for a compound inside compound shapeList.push_back( it.Value() ); @@ -148,6 +147,9 @@ bool getSubMeshes(::SMESH_subMesh* theSubMesh, } break; } + default: + if ( aSubMeshDS ) + theSubMeshList.push_back( aSubMeshDS ); } return size < theSubMeshList.size(); } @@ -275,7 +277,7 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsId() for ( int i = 0; sm != smList.end(); sm++ ) { SMDS_ElemIteratorPtr anIt = (*sm)->GetElements(); - for ( int n = aSubMeshDS->NbElements(); i < n && anIt->more(); i++ ) + for ( ; i < nbElems && anIt->more(); i++ ) aResult[i] = anIt->next()->GetID(); } } diff --git a/src/SMESH_I/SMESH_subMesh_i.hxx b/src/SMESH_I/SMESH_subMesh_i.hxx index 42861f04e..808b07cb6 100644 --- a/src/SMESH_I/SMESH_subMesh_i.hxx +++ b/src/SMESH_I/SMESH_subMesh_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_I/smeshpy.py b/src/SMESH_I/smeshpy.py index 9fb4709e7..f7f36fca8 100644 --- a/src/SMESH_I/smeshpy.py +++ b/src/SMESH_I/smeshpy.py @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/Makefile.in b/src/SMESH_SWIG/Makefile.in index df7e19a17..ce5a54fd3 100644 --- a/src/SMESH_SWIG/Makefile.in +++ b/src/SMESH_SWIG/Makefile.in @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -72,9 +72,11 @@ EXPORT_PYSCRIPTS = libSMESH_Swig.py \ SMESH_mechanic.py \ SMESH_mechanic_tetra.py \ SMESH_mechanic_editor.py \ + SMESH_mechanic_netgen.py \ SMESH_fixation.py \ SMESH_fixation_hexa.py \ SMESH_fixation_tetra.py \ + SMESH_fixation_netgen.py \ SMESH_box_tetra.py \ SMESH_box2_tetra.py \ SMESH_box3_tetra.py \ @@ -113,8 +115,8 @@ LIB_CLIENT_IDL = SALOMEDS.idl \ EXPORT_SHAREDPYSCRIPTS=SMESH_shared_modules.py -CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome -DHAVE_CONFIG_H +CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(KERNEL_CXXFLAGS) -DHAVE_CONFIG_H LIBS+= $(PYTHON_LIBS) -LDFLAGS+= -lSMESH -L${KERNEL_ROOT_DIR}/lib/salome -lSalomeGenericObj +LDFLAGS+= -lSMESH $(KERNEL_LDFLAGS) -lSalomeGenericObj @CONCLUDE@ diff --git a/src/SMESH_SWIG/PAL_MESH_041_mesh.py b/src/SMESH_SWIG/PAL_MESH_041_mesh.py index d097bcd48..3ed627077 100755 --- a/src/SMESH_SWIG/PAL_MESH_041_mesh.py +++ b/src/SMESH_SWIG/PAL_MESH_041_mesh.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# import geompy import salome diff --git a/src/SMESH_SWIG/PAL_MESH_043_2D.py b/src/SMESH_SWIG/PAL_MESH_043_2D.py index 4cfeac36b..9ba022303 100755 --- a/src/SMESH_SWIG/PAL_MESH_043_2D.py +++ b/src/SMESH_SWIG/PAL_MESH_043_2D.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/PAL_MESH_043_3D.py b/src/SMESH_SWIG/PAL_MESH_043_3D.py index 73b211e8b..b7bd92337 100755 --- a/src/SMESH_SWIG/PAL_MESH_043_3D.py +++ b/src/SMESH_SWIG/PAL_MESH_043_3D.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_BelongToGeom.py b/src/SMESH_SWIG/SMESH_BelongToGeom.py index c4ee39dcd..482bd3b56 100644 --- a/src/SMESH_SWIG/SMESH_BelongToGeom.py +++ b/src/SMESH_SWIG/SMESH_BelongToGeom.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# import SMESH from SMESH_test1 import * diff --git a/src/SMESH_SWIG/SMESH_GroupFromGeom.py b/src/SMESH_SWIG/SMESH_GroupFromGeom.py index 3647c77d2..0faad0ab0 100644 --- a/src/SMESH_SWIG/SMESH_GroupFromGeom.py +++ b/src/SMESH_SWIG/SMESH_GroupFromGeom.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_GroupFromGeom2.py b/src/SMESH_SWIG/SMESH_GroupFromGeom2.py index 37f333d88..5364365e3 100755 --- a/src/SMESH_SWIG/SMESH_GroupFromGeom2.py +++ b/src/SMESH_SWIG/SMESH_GroupFromGeom2.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# #============================================================================== # Info. # Bug (from script, bug) : SMESH_GroupFromGeom.py, PAL6945 diff --git a/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py b/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py index 6a4533ea7..a3cf9298c 100644 --- a/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py +++ b/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# 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 smesh import * def BuildGroupLyingOn(theMesh, theElemType, theName, theShape): @@ -15,9 +34,9 @@ def BuildGroupLyingOn(theMesh, theElemType, theName, theShape): aGroup.Add(anIds) #Example -## from SMESH_test1 import * +from SMESH_test1 import * -## smesh.Compute(mesh, box) -## BuildGroupLyingOn(mesh, SMESH.FACE, "Group of faces lying on edge", edge ) +smesh.Compute(mesh, box) +BuildGroupLyingOn(mesh, SMESH.FACE, "Group of faces lying on edge", edge ) -## salome.sg.updateObjBrowser(1); +salome.sg.updateObjBrowser(1); diff --git a/src/SMESH_SWIG/SMESH_Nut.py b/src/SMESH_SWIG/SMESH_Nut.py index a3d6311ed..45835da21 100755 --- a/src/SMESH_SWIG/SMESH_Nut.py +++ b/src/SMESH_SWIG/SMESH_Nut.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# ##################################################################### #Created :17/02/2005 #Auhtor :MASLOV Eugeny, KOVALTCHUK Alexey diff --git a/src/SMESH_SWIG/SMESH_Partition1_tetra.py b/src/SMESH_SWIG/SMESH_Partition1_tetra.py index 515e1fe10..72ca25f2e 100644 --- a/src/SMESH_SWIG/SMESH_Partition1_tetra.py +++ b/src/SMESH_SWIG/SMESH_Partition1_tetra.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # # Tetrahedrization of the geometry generated by the Python script GEOM_Partition1.py # Hypothesis and algorithms for the mesh generation are global diff --git a/src/SMESH_SWIG/SMESH_Sphere.py b/src/SMESH_SWIG/SMESH_Sphere.py index 893e5441f..45306bed5 100644 --- a/src/SMESH_SWIG/SMESH_Sphere.py +++ b/src/SMESH_SWIG/SMESH_Sphere.py @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_blocks.py b/src/SMESH_SWIG/SMESH_blocks.py index 0430867fb..0b8d46cc2 100644 --- a/src/SMESH_SWIG/SMESH_blocks.py +++ b/src/SMESH_SWIG/SMESH_blocks.py @@ -16,7 +16,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_box.py b/src/SMESH_SWIG/SMESH_box.py index 5fc7f2969..49b1784c3 100755 --- a/src/SMESH_SWIG/SMESH_box.py +++ b/src/SMESH_SWIG/SMESH_box.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# #============================================================================== # Info. # Bug (from script, bug) : box.py, PAL5223 diff --git a/src/SMESH_SWIG/SMESH_box2_tetra.py b/src/SMESH_SWIG/SMESH_box2_tetra.py index 1c7aa8a39..fe3a942f4 100644 --- a/src/SMESH_SWIG/SMESH_box2_tetra.py +++ b/src/SMESH_SWIG/SMESH_box2_tetra.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # # Tetrahedrization of the geometry union of 2 boxes having a face in common # Hypothesis and algorithms for the mesh generation are global diff --git a/src/SMESH_SWIG/SMESH_box3_tetra.py b/src/SMESH_SWIG/SMESH_box3_tetra.py index c4cbf5c88..852cc9d1d 100644 --- a/src/SMESH_SWIG/SMESH_box3_tetra.py +++ b/src/SMESH_SWIG/SMESH_box3_tetra.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # # Tetrahedrization of the geometry union of 3 boxes aligned where the middle # one has a race in common with the two others. diff --git a/src/SMESH_SWIG/SMESH_box_tetra.py b/src/SMESH_SWIG/SMESH_box_tetra.py index 982ec6053..67e4dbef8 100644 --- a/src/SMESH_SWIG/SMESH_box_tetra.py +++ b/src/SMESH_SWIG/SMESH_box_tetra.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # # Tetrahedrization of a simple box. Hypothesis and algorithms for # the mesh generation are global diff --git a/src/SMESH_SWIG/SMESH_controls.py b/src/SMESH_SWIG/SMESH_controls.py index 1d5080d87..9266516c9 100644 --- a/src/SMESH_SWIG/SMESH_controls.py +++ b/src/SMESH_SWIG/SMESH_controls.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py b/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py index 68e299187..6fb4aef02 100755 --- a/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py +++ b/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# #============================================================================== # Info. # Bug (from script, bug) : SMESH_demo_hexa2_upd.py, PAL6781 diff --git a/src/SMESH_SWIG/SMESH_fixation.py b/src/SMESH_SWIG/SMESH_fixation.py index b10fcc81f..f5d1035ab 100644 --- a/src/SMESH_SWIG/SMESH_fixation.py +++ b/src/SMESH_SWIG/SMESH_fixation.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_fixation_hexa.py b/src/SMESH_SWIG/SMESH_fixation_hexa.py index 22db40f5d..d8ee0a2d4 100644 --- a/src/SMESH_SWIG/SMESH_fixation_hexa.py +++ b/src/SMESH_SWIG/SMESH_fixation_hexa.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # # Hexahedrization of the geometry generated by the Python script # SMESH_fixation.py diff --git a/src/SMESH_SWIG/SMESH_fixation_tetra.py b/src/SMESH_SWIG/SMESH_fixation_tetra.py index 0163b0127..e88d917c5 100644 --- a/src/SMESH_SWIG/SMESH_fixation_tetra.py +++ b/src/SMESH_SWIG/SMESH_fixation_tetra.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # # Tetrahedrization of the geometry generated by the Python script # SMESH_fixation.py diff --git a/src/SMESH_SWIG/SMESH_flight_skin.py b/src/SMESH_SWIG/SMESH_flight_skin.py index 7969df995..52d892935 100644 --- a/src/SMESH_SWIG/SMESH_flight_skin.py +++ b/src/SMESH_SWIG/SMESH_flight_skin.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # # Triangulation of the skin of the geometry from a Brep representing a plane # This geometry is from EADS diff --git a/src/SMESH_SWIG/SMESH_freebord.py b/src/SMESH_SWIG/SMESH_freebord.py index c6881c825..0af6b113d 100644 --- a/src/SMESH_SWIG/SMESH_freebord.py +++ b/src/SMESH_SWIG/SMESH_freebord.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# import salome import geompy import SMESH diff --git a/src/SMESH_SWIG/SMESH_hexaedre.py b/src/SMESH_SWIG/SMESH_hexaedre.py index 0bee28c32..d6b1ac905 100755 --- a/src/SMESH_SWIG/SMESH_hexaedre.py +++ b/src/SMESH_SWIG/SMESH_hexaedre.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# #============================================================================== # Info. # Bug (from script, bug) : hexaedre_modified.py, PAL6194, PAL7153 diff --git a/src/SMESH_SWIG/SMESH_mechanic.py b/src/SMESH_SWIG/SMESH_mechanic.py index 7beb5eece..8a634f261 100644 --- a/src/SMESH_SWIG/SMESH_mechanic.py +++ b/src/SMESH_SWIG/SMESH_mechanic.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_mechanic_editor.py b/src/SMESH_SWIG/SMESH_mechanic_editor.py index 25599d75d..c1c2840b6 100644 --- a/src/SMESH_SWIG/SMESH_mechanic_editor.py +++ b/src/SMESH_SWIG/SMESH_mechanic_editor.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_mechanic_tetra.py b/src/SMESH_SWIG/SMESH_mechanic_tetra.py index 51946b306..08acaed85 100644 --- a/src/SMESH_SWIG/SMESH_mechanic_tetra.py +++ b/src/SMESH_SWIG/SMESH_mechanic_tetra.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_reg.py b/src/SMESH_SWIG/SMESH_reg.py index ed5455d44..dde1c5c5a 100644 --- a/src/SMESH_SWIG/SMESH_reg.py +++ b/src/SMESH_SWIG/SMESH_reg.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_shared_modules.py b/src/SMESH_SWIG/SMESH_shared_modules.py index e40362fff..22c2a0de6 100644 --- a/src/SMESH_SWIG/SMESH_shared_modules.py +++ b/src/SMESH_SWIG/SMESH_shared_modules.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# """ """ diff --git a/src/SMESH_SWIG/SMESH_test.py b/src/SMESH_SWIG/SMESH_test.py index cdaae7eb6..ad4efa46b 100644 --- a/src/SMESH_SWIG/SMESH_test.py +++ b/src/SMESH_SWIG/SMESH_test.py @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_test0.py b/src/SMESH_SWIG/SMESH_test0.py index a7a5282a5..64794e623 100644 --- a/src/SMESH_SWIG/SMESH_test0.py +++ b/src/SMESH_SWIG/SMESH_test0.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -25,7 +25,6 @@ import salome import geompy from geompy import geom -from geompy import gg import SMESH diff --git a/src/SMESH_SWIG/SMESH_test1.py b/src/SMESH_SWIG/SMESH_test1.py index 96792bf55..8383318b5 100644 --- a/src/SMESH_SWIG/SMESH_test1.py +++ b/src/SMESH_SWIG/SMESH_test1.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_test2.py b/src/SMESH_SWIG/SMESH_test2.py index b552a1490..622f84a77 100644 --- a/src/SMESH_SWIG/SMESH_test2.py +++ b/src/SMESH_SWIG/SMESH_test2.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_test3.py b/src/SMESH_SWIG/SMESH_test3.py index e10501858..93ab33aa9 100644 --- a/src/SMESH_SWIG/SMESH_test3.py +++ b/src/SMESH_SWIG/SMESH_test3.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/SMESH_test4.py b/src/SMESH_SWIG/SMESH_test4.py index fe50f9fbe..6cccd394c 100755 --- a/src/SMESH_SWIG/SMESH_test4.py +++ b/src/SMESH_SWIG/SMESH_test4.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# import salome import geompy import SMESH diff --git a/src/SMESH_SWIG/SMESH_test5.py b/src/SMESH_SWIG/SMESH_test5.py index 4b31dcbc3..74a28c6ba 100644 --- a/src/SMESH_SWIG/SMESH_test5.py +++ b/src/SMESH_SWIG/SMESH_test5.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/SMESH_SWIG/batchmode_mefisto.py b/src/SMESH_SWIG/batchmode_mefisto.py index 2166077f5..54d57bf63 100644 --- a/src/SMESH_SWIG/batchmode_mefisto.py +++ b/src/SMESH_SWIG/batchmode_mefisto.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# import os import re diff --git a/src/SMESH_SWIG/batchmode_smesh.py b/src/SMESH_SWIG/batchmode_smesh.py index 4964c8b0c..1d44f4360 100644 --- a/src/SMESH_SWIG/batchmode_smesh.py +++ b/src/SMESH_SWIG/batchmode_smesh.py @@ -1,6 +1,21 @@ -# Copyright (C) 2003 CEA/DEN, EDF R&D +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. # +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# 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 : batchmode_smesh.py # Author : Oksana TCHEBANOVA diff --git a/src/SMESH_SWIG/ex00_all.py b/src/SMESH_SWIG/ex00_all.py index b1aa726b2..8e490d7be 100644 --- a/src/SMESH_SWIG/ex00_all.py +++ b/src/SMESH_SWIG/ex00_all.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2005, Francis KLOSS (OCC) # ================================== diff --git a/src/SMESH_SWIG/ex01_cube2build.py b/src/SMESH_SWIG/ex01_cube2build.py index 02b5b1506..4493b6f32 100644 --- a/src/SMESH_SWIG/ex01_cube2build.py +++ b/src/SMESH_SWIG/ex01_cube2build.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex02_cube2primitive.py b/src/SMESH_SWIG/ex02_cube2primitive.py index 747507211..e82ee605d 100644 --- a/src/SMESH_SWIG/ex02_cube2primitive.py +++ b/src/SMESH_SWIG/ex02_cube2primitive.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex03_cube2partition.py b/src/SMESH_SWIG/ex03_cube2partition.py index cc566893c..4772e6375 100644 --- a/src/SMESH_SWIG/ex03_cube2partition.py +++ b/src/SMESH_SWIG/ex03_cube2partition.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex04_cube5tetraHexa.py b/src/SMESH_SWIG/ex04_cube5tetraHexa.py index 5bb4a1c89..6d5ef4aa5 100644 --- a/src/SMESH_SWIG/ex04_cube5tetraHexa.py +++ b/src/SMESH_SWIG/ex04_cube5tetraHexa.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex05_hole1build.py b/src/SMESH_SWIG/ex05_hole1build.py index ecaa211f4..7ec3af89e 100644 --- a/src/SMESH_SWIG/ex05_hole1build.py +++ b/src/SMESH_SWIG/ex05_hole1build.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex06_hole1boolean.py b/src/SMESH_SWIG/ex06_hole1boolean.py index 5e461e466..a10ea7af8 100644 --- a/src/SMESH_SWIG/ex06_hole1boolean.py +++ b/src/SMESH_SWIG/ex06_hole1boolean.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex07_hole1partition.py b/src/SMESH_SWIG/ex07_hole1partition.py index 592e5f833..b5a4168b8 100644 --- a/src/SMESH_SWIG/ex07_hole1partition.py +++ b/src/SMESH_SWIG/ex07_hole1partition.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex08_hole2build.py b/src/SMESH_SWIG/ex08_hole2build.py index ab23cb703..1682968f1 100644 --- a/src/SMESH_SWIG/ex08_hole2build.py +++ b/src/SMESH_SWIG/ex08_hole2build.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex09_grid4build.py b/src/SMESH_SWIG/ex09_grid4build.py index 681a31f90..26505515a 100644 --- a/src/SMESH_SWIG/ex09_grid4build.py +++ b/src/SMESH_SWIG/ex09_grid4build.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex10_grid4geometry.py b/src/SMESH_SWIG/ex10_grid4geometry.py index bcd56372a..67cb9efd5 100644 --- a/src/SMESH_SWIG/ex10_grid4geometry.py +++ b/src/SMESH_SWIG/ex10_grid4geometry.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex11_grid3partition.py b/src/SMESH_SWIG/ex11_grid3partition.py index 4327775f0..806b8e4f9 100644 --- a/src/SMESH_SWIG/ex11_grid3partition.py +++ b/src/SMESH_SWIG/ex11_grid3partition.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex12_grid17partition.py b/src/SMESH_SWIG/ex12_grid17partition.py index f83de144a..a0f037195 100644 --- a/src/SMESH_SWIG/ex12_grid17partition.py +++ b/src/SMESH_SWIG/ex12_grid17partition.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex13_hole1partial.py b/src/SMESH_SWIG/ex13_hole1partial.py index c97ccb8d8..d16b6c51f 100644 --- a/src/SMESH_SWIG/ex13_hole1partial.py +++ b/src/SMESH_SWIG/ex13_hole1partial.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2005, Francis KLOSS (OCC) # ================================== diff --git a/src/SMESH_SWIG/ex14_cyl1holed.py b/src/SMESH_SWIG/ex14_cyl1holed.py index 6a2127a00..bbfca409e 100644 --- a/src/SMESH_SWIG/ex14_cyl1holed.py +++ b/src/SMESH_SWIG/ex14_cyl1holed.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex15_cyl2geometry.py b/src/SMESH_SWIG/ex15_cyl2geometry.py index c7de68814..554620152 100644 --- a/src/SMESH_SWIG/ex15_cyl2geometry.py +++ b/src/SMESH_SWIG/ex15_cyl2geometry.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex16_cyl2complementary.py b/src/SMESH_SWIG/ex16_cyl2complementary.py index e38aba291..3dee7b588 100644 --- a/src/SMESH_SWIG/ex16_cyl2complementary.py +++ b/src/SMESH_SWIG/ex16_cyl2complementary.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex17_dome1.py b/src/SMESH_SWIG/ex17_dome1.py index 5064a9315..d3239e2fa 100644 --- a/src/SMESH_SWIG/ex17_dome1.py +++ b/src/SMESH_SWIG/ex17_dome1.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex18_dome2.py b/src/SMESH_SWIG/ex18_dome2.py index 96d8738bf..e1c270eaf 100644 --- a/src/SMESH_SWIG/ex18_dome2.py +++ b/src/SMESH_SWIG/ex18_dome2.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2004-2005, Francis KLOSS (OCC) # ======================================= diff --git a/src/SMESH_SWIG/ex19_sphereINcube.py b/src/SMESH_SWIG/ex19_sphereINcube.py index 295a95f56..02357b0f4 100644 --- a/src/SMESH_SWIG/ex19_sphereINcube.py +++ b/src/SMESH_SWIG/ex19_sphereINcube.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # CEA/LGLS 2005, Francis KLOSS (OCC) # ================================== diff --git a/src/SMESH_SWIG/libSMESH_Swig.i b/src/SMESH_SWIG/libSMESH_Swig.i index 7caf23381..247c0fc39 100644 --- a/src/SMESH_SWIG/libSMESH_Swig.i +++ b/src/SMESH_SWIG/libSMESH_Swig.i @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SMESH_SWIG/smesh.py b/src/SMESH_SWIG/smesh.py index b0113f3a0..c02fca725 100644 --- a/src/SMESH_SWIG/smesh.py +++ b/src/SMESH_SWIG/smesh.py @@ -15,7 +15,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # File : smesh.py # Author : Francis KLOSS, OCC @@ -31,8 +31,6 @@ import geompy import StdMeshers import SMESH -# Public variables -# ---------------- REGULAR = 1 PYTHON = 2 @@ -43,8 +41,6 @@ GHS3D = 4 smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") smesh.SetCurrentStudy(salome.myStudy) -# Private functions -# ----------------- NO_NAME = "NoName" @@ -60,42 +56,67 @@ def GetName(obj): def SetName(obj, name): ior = salome.orb.object_to_string(obj) sobj = salome.myStudy.FindObjectIOR(ior) - attr = sobj.FindAttribute("AttributeName")[1] - attr.SetValue(name) - -# Algorithms and hypothesis -# ========================= - -# Private class: Mesh_Algorithm -# ----------------------------- + if not sobj is None: + attr = sobj.FindAttribute("AttributeName")[1] + attr.SetValue(name) +## Mother class to define algorithm, recommended to don't use directly. +# +# More details. class Mesh_Algorithm: - """ - Mother class to define algorithm, recommended to don't use directly - """ + # @class Mesh_Algorithm + # @brief Class Mesh_Algorithm mesh = 0 geom = 0 subm = 0 algo = 0 + ## If the algorithm is global, return 0 + # \fn else return the submesh associated to this algorithm. + # + # More details. def GetSubMesh(self): - """ - If the algorithm is global, return 0 - else return the submesh associated to this algorithm - """ return self.subm + ## Return the wrapped mesher. def GetAlgorithm(self): - """ - Return the wrapped mesher - """ return self.algo + ## Private method. Print error message if a hypothesis was not assigned. + def TreatHypoStatus(self, status, hypName, geomName, isAlgo): + if isAlgo: + hypType = "algorithm" + else: + hypType = "hypothesis" + if status == SMESH.HYP_UNKNOWN_FATAL : + reason = "for unknown reason" + elif status == SMESH.HYP_INCOMPATIBLE : + reason = "this hypothesis mismatches algorithm" + elif status == SMESH.HYP_NOTCONFORM : + reason = "not conform mesh would be built" + elif status == SMESH.HYP_ALREADY_EXIST : + reason = hypType + " of the same dimension already assigned to this shape" + elif status == SMESH.HYP_BAD_DIM : + reason = hypType + " mismatches shape" + elif status == SMESH.HYP_CONCURENT : + reason = "there are concurrent hypotheses on sub-shapes" + elif status == SMESH.HYP_BAD_SUBSHAPE : + reason = "shape is neither the main one, nor its subshape, nor a valid group" + else: + return + hypName = '"' + hypName + '"' + geomName= '"' + geomName+ '"' + if status < SMESH.HYP_UNKNOWN_FATAL: + print hypName, "was assigned to", geomName,"but", reason + else: + print hypName, "was not assigned to",geomName,":", reason + pass + + ## Private method. def Create(self, mesh, geom, hypo, so="StdMeshersEngine"): - """ - Private method - """ + if geom is None: + raise RuntimeError, "Attemp to create " + hypo + " algoritm on None shape" self.mesh = mesh piece = mesh.geom if geom==0: @@ -111,12 +132,11 @@ class Mesh_Algorithm: self.algo = smesh.CreateHypothesis(hypo, so) SetName(self.algo, name + "/" + hypo) - mesh.mesh.AddHypothesis(self.geom, self.algo) + status = mesh.mesh.AddHypothesis(self.geom, self.algo) + self.TreatHypoStatus( status, hypo, name, 1 ) + ## Private method def Hypothesis(self, hyp, args=[], so="StdMeshersEngine"): - """ - Private method - """ hypo = smesh.CreateHypothesis(hyp, so) a = "" s = "=" @@ -126,39 +146,35 @@ class Mesh_Algorithm: a = a + s + str(args[i]) s = "," i = i + 1 - SetName(hypo, GetName(self.geom) + "/" + hyp + a) - self.mesh.mesh.AddHypothesis(self.geom, hypo) + name = GetName(self.geom) + SetName(hypo, name + "/" + hyp + a) + status = self.mesh.mesh.AddHypothesis(self.geom, hypo) + self.TreatHypoStatus( status, hyp, name, 0 ) return hypo # Public class: Mesh_Segment # -------------------------- +## Class to define a segment 1D algorithm for discretization +# +# More details. class Mesh_Segment(Mesh_Algorithm): - """ - Class to define a segment 1D algorithm for discretization - """ + ## Private constructor. def __init__(self, mesh, geom=0): - """ - Private constructor - """ self.Create(mesh, geom, "Regular_1D") + ## Define "LocalLength" hypothesis to cut an edge in several segments with the same length + # @param l for the length of segments that cut an edge def LocalLength(self, l): - """ - Define "LocalLength" hypothesis to cut an edge in several segments with the same length - \param l for the length of segments that cut an edge - """ hyp = self.Hypothesis("LocalLength", [l]) hyp.SetLength(l) return hyp + ## Define "NumberOfSegments" hypothesis to cut an edge in several fixed number of segments + # @param n for the number of segments that cut an edge + # @param s for the scale factor (optional) def NumberOfSegments(self, n, s=[]): - """ - Define "NumberOfSegments" hypothesis to cut an edge in several fixed number of segments - \param n for the number of segments that cut an edge - \param s for the scale factor (optional) - """ if s == []: hyp = self.Hypothesis("NumberOfSegments", [n]) else: @@ -168,74 +184,70 @@ class Mesh_Segment(Mesh_Algorithm): hyp.SetNumberOfSegments(n) return hyp + ## Define "Arithmetic1D" hypothesis to cut an edge in several segments with arithmetic length increasing + # @param start for the length of the first segment + # @param end for the length of the last segment def Arithmetic1D(self, start, end): - """ - Define "Arithmetic1D" hypothesis to cut an edge in several segments with arithmetic length increasing - \param start for the length of the first segment - \param end for the length of the last segment - """ hyp = self.Hypothesis("Arithmetic1D", [start, end]) hyp.SetLength(start, 1) hyp.SetLength(end , 0) return hyp + ## Define "StartEndLength" hypothesis to cut an edge in several segments with geometric length increasing + # @param start for the length of the first segment + # @param end for the length of the last segment def StartEndLength(self, start, end): - """ - Define "StartEndLength" hypothesis to cut an edge in several segments with geometric length increasing - \param start for the length of the first segment - \param end for the length of the last segment - """ hyp = self.Hypothesis("StartEndLength", [start, end]) hyp.SetLength(start, 1) hyp.SetLength(end , 0) return hyp + ## Define "Deflection1D" hypothesis + # @param d for the deflection def Deflection1D(self, d): - """ - Define "Deflection1D" hypothesis - \param d for the deflection - """ hyp = self.Hypothesis("Deflection1D", [d]) hyp.SetDeflection(d) return hyp + ## Define "Propagation" hypothesis that propagate all other hypothesis on all others edges that are in + # the opposite side in the case of quadrangular faces def Propagation(self): - """ - Define "Propagation" hypothesis that propagate all other hypothesis on all others edges that are in - the opposite side in the case of quadrangular faces - """ return self.Hypothesis("Propagation") - def AutomaticLength(self, fineness): - """ - Define "AutomaticLength" hypothesis - \param fineness for the fineness [0-1] - """ + ## Define "AutomaticLength" hypothesis + # @param fineness for the fineness [0-1] + def AutomaticLength(self, fineness=0): hyp = self.Hypothesis("AutomaticLength") hyp.SetFineness( fineness ) return hyp + ## Define "QuadraticMesh" hypothesis, forcing construction of quadratic edges. + # If the 2D mesher sees that all boundary edges are quadratic ones, + # it generates quadratic faces, else it generates linear faces using + # medium nodes as if they were vertex ones. + # The 3D mesher generates quadratic volumes only if all boundary faces + # are quadratic ones, else it fails. + def QuadraticMesh(self): + hyp = self.Hypothesis("QuadraticMesh") + return hyp + # Public class: Mesh_Segment_Python # --------------------------------- +## Class to define a segment 1D algorithm for discretization with python function +# +# More details. class Mesh_Segment_Python(Mesh_Segment): - """ - Class to define a segment 1D algorithm for discretization with python function - """ + ## Private constructor. def __init__(self, mesh, geom=0): - """ - Private constructor - """ import Python1dPlugin self.Create(mesh, geom, "Python_1D", "Python1dEngine") + ## Define "PythonSplit1D" hypothesis based on the Erwan Adam patch, awaiting equivalent SALOME functionality + # @param n for the number of segments that cut an edge + # @param func for the python function that calculate the length of all segments def PythonSplit1D(self, n, func): - """ - Define "PythonSplit1D" hypothesis based on the Erwan Adam patch, awaiting equivalent SALOME functionality - \param n for the number of segments that cut an edge - \param func for the python function that calculate the length of all segments - """ hyp = self.Hypothesis("PythonSplit1D", [n], "Python1dEngine") hyp.SetNumberOfSegments(n) hyp.SetPythonLog10RatioFunction(func) @@ -244,78 +256,64 @@ class Mesh_Segment_Python(Mesh_Segment): # Public class: Mesh_Triangle # --------------------------- +## Class to define a triangle 2D algorithm +# +# More details. class Mesh_Triangle(Mesh_Algorithm): - """ - Class to define a triangle 2D algorithm - """ + ## Private constructor. def __init__(self, mesh, geom=0): - """ - Private constructor - """ self.Create(mesh, geom, "MEFISTO_2D") + ## Define "MaxElementArea" hypothesis to give the maximun area of each triangles + # @param area for the maximum area of each triangles def MaxElementArea(self, area): - """ - Define "MaxElementArea" hypothesis to give the maximun area of each triangles - \param area for the maximum area of each triangles - """ hyp = self.Hypothesis("MaxElementArea", [area]) hyp.SetMaxElementArea(area) return hyp + ## Define "LengthFromEdges" hypothesis to build triangles based on the length of the edges taken from the wire def LengthFromEdges(self): - """ - Define "LengthFromEdges" hypothesis to build triangles based on the length of the edges taken from the wire - """ return self.Hypothesis("LengthFromEdges") # Public class: Mesh_Quadrangle # ----------------------------- +## Class to define a quadrangle 2D algorithm +# +# More details. class Mesh_Quadrangle(Mesh_Algorithm): - """ - Class to define a quadrangle 2D algorithm - """ + ## Private constructor. def __init__(self, mesh, geom=0): - """ - Private constructor - """ self.Create(mesh, geom, "Quadrangle_2D") + ## Define "QuadranglePreference" hypothesis, forcing construction + # of quadrangles if the number of nodes on opposite edges is not the same + # in the case where the global number of nodes on edges is even def QuadranglePreference(self): - """ - Define "QuadranglePreference" hypothesis, forcing construction - of quadrangles if the number of nodes on opposite edges is not the same - in the case where the global number of nodes on edges is even - """ hyp = self.Hypothesis("QuadranglePreference") return hyp # Public class: Mesh_Tetrahedron # ------------------------------ +## Class to define a tetrahedron 3D algorithm +# +# More details. class Mesh_Tetrahedron(Mesh_Algorithm): - """ - Class to define a tetrahedron 3D algorithm - """ + ## Private constructor. def __init__(self, mesh, algo, geom=0): - """ - Private constructor - """ if algo == NETGEN: self.Create(mesh, geom, "NETGEN_3D", "NETGENEngine") elif algo == GHS3D: import GHS3DPlugin self.Create(mesh, geom, "GHS3D_3D" , "GHS3DEngine") + ## Define "MaxElementVolume" hypothesis to give the maximun volume of each tetrahedral + # @param vol for the maximum volume of each tetrahedral def MaxElementVolume(self, vol): - """ - Define "MaxElementVolume" hypothesis to give the maximun volume of each tetrahedral - \param vol for the maximum volume of each tetrahedral - """ hyp = self.Hypothesis("MaxElementVolume", [vol]) hyp.SetMaxElementVolume(vol) return hyp @@ -323,37 +321,60 @@ class Mesh_Tetrahedron(Mesh_Algorithm): # Public class: Mesh_Hexahedron # ------------------------------ +## Class to define a hexahedron 3D algorithm +# +# More details. class Mesh_Hexahedron(Mesh_Algorithm): - """ - Class to define a hexahedron 3D algorithm - """ + ## Private constructor. def __init__(self, mesh, geom=0): - """ - Private constructor - """ self.Create(mesh, geom, "Hexa_3D") +# Public class: Mesh_Netgen +# ------------------------------ + +## Class to define a NETGEN-based 2D or 3D algorithm +# that need no discrete boundary (i.e. independent) +# +# More details. +class Mesh_Netgen(Mesh_Algorithm): + + is3D = 0 + + ## Private constructor. + def __init__(self, mesh, is3D, geom=0): + self.is3D = is3D + if is3D: + self.Create(mesh, geom, "NETGEN_2D3D", "NETGENEngine") + else: + self.Create(mesh, geom, "NETGEN_2D", "NETGENEngine") + + ## Define hypothesis containing parameters of the algorithm + def Parameters(self): + if self.is3D: + hyp = self.Hypothesis("NETGEN_Parameters", [], "NETGENEngine") + else: + hyp = self.Hypothesis("NETGEN_Parameters_2D", [], "NETGENEngine") + return hyp + # Public class: Mesh # ================== +## Class to define a mesh +# +# More details. class Mesh: - """ - Class to define a mesh - """ geom = 0 mesh = 0 + ## Constructor + # + # Creates mesh on the shape \a geom, + # sets GUI name of this mesh to \a name. + # @param geom Shape to be meshed + # @param name Study name of the mesh def __init__(self, geom, name=0): - """ - Constructor - - Creates mesh on the shape \a geom, - sets GUI name of this mesh to \a name. - \param geom Shape to be meshed - \param name Study name of the mesh - """ self.geom = geom self.mesh = smesh.CreateMesh(geom) if name == 0: @@ -361,22 +382,16 @@ class Mesh: else: SetName(self.mesh, name) + ## Method that returns the mesh def GetMesh(self): - """ - Method that returns the mesh - """ return self.mesh + ## Method that returns the shape associated to the mesh def GetShape(self): - """ - Method that returns the shape associated to the mesh - """ return self.geom + ## Returns mesh dimension depending on shape one def MeshDimension(self): - """ - Returns mesh dimension depending on shape one - """ shells = geompy.SubShapeAllIDs( self.geom, geompy.ShapeType["SHELL"] ) if len( shells ) > 0 : return 3 @@ -388,15 +403,13 @@ class Mesh: return 0; pass + ## Creates a segment discretization 1D algorithm. + # If the optional \a algo parameter is not sets, this algorithm is REGULAR. + # If the optional \a geom parameter is not sets, this algorithm is global. + # Otherwise, this algorithm define a submesh based on \a geom subshape. + # @param algo values are smesh.REGULAR or smesh.PYTHON for discretization via python function + # @param geom If defined, subshape to be meshed def Segment(self, algo=REGULAR, geom=0): - """ - Creates a segment discretization 1D algorithm. - If the optional \a algo parameter is not sets, this algorithm is REGULAR. - If the optional \a geom parameter is not sets, this algorithm is global. - Otherwise, this algorithm define a submesh based on \a geom subshape. - \param algo values are smesh.REGULAR or smesh.PYTHON for discretization via python function - \param geom If defined, subshape to be meshed - """ ## if Segment(geom) is called by mistake if ( isinstance( algo, geompy.GEOM._objref_GEOM_Object)): algo, geom = geom, algo @@ -408,68 +421,95 @@ class Mesh: else: return Mesh_Segment(self, geom) + ## Creates a triangle 2D algorithm for faces. + # If the optional \a geom parameter is not sets, this algorithm is global. + # Otherwise, this algorithm define a submesh based on \a geom subshape. + # @param geom If defined, subshape to be meshed def Triangle(self, geom=0): - """ - Creates a triangle 2D algorithm for faces. - If the optional \a geom parameter is not sets, this algorithm is global. - Otherwise, this algorithm define a submesh based on \a geom subshape. - \param geom If defined, subshape to be meshed - """ return Mesh_Triangle(self, geom) + ## Creates a quadrangle 2D algorithm for faces. + # If the optional \a geom parameter is not sets, this algorithm is global. + # Otherwise, this algorithm define a submesh based on \a geom subshape. + # @param geom If defined, subshape to be meshed def Quadrangle(self, geom=0): - """ - Creates a quadrangle 2D algorithm for faces. - If the optional \a geom parameter is not sets, this algorithm is global. - Otherwise, this algorithm define a submesh based on \a geom subshape. - \param geom If defined, subshape to be meshed - """ return Mesh_Quadrangle(self, geom) + ## Creates a tetrahedron 3D algorithm for solids. + # The parameter \a algo permits to choice the algorithm: NETGEN or GHS3D + # If the optional \a geom parameter is not sets, this algorithm is global. + # Otherwise, this algorithm define a submesh based on \a geom subshape. + # @param algo values are: smesh.NETGEN, smesh.GHS3D + # @param geom If defined, subshape to be meshed def Tetrahedron(self, algo, geom=0): - """ - Creates a tetrahedron 3D algorithm for solids. - The parameter \a algo permits to choice the algorithm: NETGEN or GHS3D - If the optional \a geom parameter is not sets, this algorithm is global. - Otherwise, this algorithm define a submesh based on \a geom subshape. - \param algo values are: smesh.NETGEN, smesh.GHS3D - \param geom If defined, subshape to be meshed - """ ## if Tetrahedron(geom) is called by mistake if ( isinstance( algo, geompy.GEOM._objref_GEOM_Object)): algo, geom = geom, algo pass return Mesh_Tetrahedron(self, algo, geom) + ## Creates a hexahedron 3D algorithm for solids. + # If the optional \a geom parameter is not sets, this algorithm is global. + # Otherwise, this algorithm define a submesh based on \a geom subshape. + # @param geom If defined, subshape to be meshed def Hexahedron(self, geom=0): - """ - Creates a hexahedron 3D algorithm for solids. - If the optional \a geom parameter is not sets, this algorithm is global. - Otherwise, this algorithm define a submesh based on \a geom subshape. - \param geom If defined, subshape to be meshed - """ return Mesh_Hexahedron(self, geom) + ## Creates a NETGEN-based 2D or 3D independent algorithm (i.e. needs no + # discrete boundary). + # If the optional \a geom parameter is not sets, this algorithm is global. + # Otherwise, this algorithm defines a submesh based on \a geom subshape. + # @param is3D If 0 then algorithm is 2D, otherwise 3D + # @param geom If defined, subshape to be meshed + def Netgen(self, is3D, geom=0): + return Mesh_Netgen(self, is3D, geom) + + ## Compute the mesh and return the status of the computation def Compute(self): - """ - Compute the mesh and return the status of the computation - """ - b = smesh.Compute(self.mesh, self.geom) + ok = smesh.Compute(self.mesh, self.geom) + if not ok: + errors = smesh.GetAlgoState( self.mesh, self.geom ) + allReasons = "" + for err in errors: + if err.isGlobalAlgo: + glob = " global " + else: + glob = " local " + pass + dim = str(err.algoDim) + if err.name == SMESH.MISSING_ALGO: + reason = glob + dim + "D algorithm is missing" + elif err.name == SMESH.MISSING_HYPO: + name = '"' + err.algoName + '"' + reason = glob + dim + "D algorithm " + name + " misses " + dim + "D hypothesis" + else: + reason = "Global \"Not Conform mesh allowed\" hypothesis is missing" + pass + if allReasons != "": + allReasons += "\n" + pass + allReasons += reason + pass + if allReasons != "": + print '"' + GetName(self.mesh) + '"',"not computed:" + print allReasons + pass + pass if salome.sg.hasDesktop(): smeshgui = salome.ImportComponentGUI("SMESH") smeshgui.Init(salome.myStudyId) - smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), b ) + smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), ok ) salome.sg.updateObjBrowser(1) - return b + pass + return ok - def AutomaticTetrahedralization(self): - """ - Compute tetrahedral mesh using AutomaticLength + MEFISTO + NETGEN - """ + ## Compute tetrahedral mesh using AutomaticLength + MEFISTO + NETGEN + # The parameter \a fineness [0.-1.] defines mesh fineness + def AutomaticTetrahedralization(self, fineness=0): dim = self.MeshDimension() # assign hypotheses self.RemoveGlobalHypotheses() - self.Segment().AutomaticLength() + self.Segment().AutomaticLength(fineness) if dim > 1 : self.Triangle().LengthFromEdges() pass @@ -478,14 +518,13 @@ class Mesh: pass return self.Compute() - def AutomaticHexahedralization(self): - """ - Compute hexahedral mesh using AutomaticLength + Quadrangle + Hexahedron - """ + ## Compute hexahedral mesh using AutomaticLength + Quadrangle + Hexahedron + # The parameter \a fineness [0.-1.] defines mesh fineness + def AutomaticHexahedralization(self, fineness=0): dim = self.MeshDimension() # assign hypotheses self.RemoveGlobalHypotheses() - self.Segment().AutomaticLength() + self.Segment().AutomaticLength(fineness) if dim > 1 : self.Quadrangle() pass @@ -494,24 +533,20 @@ class Mesh: pass return self.Compute() + ## Removes all global hypotheses def RemoveGlobalHypotheses(self): - """ - Removes all global hypotheses - """ current_hyps = self.mesh.GetHypothesisList( self.geom ) for hyp in current_hyps: self.mesh.RemoveHypothesis( self.geom, hyp ) pass pass + ## Create a mesh group based on geometric object \a grp + # and give a \a name, if this parameter is not defined + # the name is the same as the geometric group name + # @param grp is a geometric group, a vertex, an edge, a face or a solid + # @param name is the name of the mesh group def Group(self, grp, name=""): - """ - Create a mesh group based on geometric object \a grp - and give a \a name, if this parameter is not defined - the name is the same as the geometric group name - \param grp is a geometric group, a vertex, an edge, a face or a solid - \param name is the name of the mesh group - """ if name == "": name = grp.GetName() @@ -528,6 +563,9 @@ class Mesh: elif tgeo == "SHELL": type = SMESH.VOLUME elif tgeo == "COMPOUND": + if len( geompy.GetObjectIDs( grp )) == 0: + print "Mesh.Group: empty geometric group", GetName( grp ) + return 0 tgeo = geompy.GetType(grp) if tgeo == geompy.ShapeType["VERTEX"]: type = SMESH.NODE @@ -544,39 +582,29 @@ class Mesh: else: return self.mesh.CreateGroupFromGEOM(type, name, grp) + ## Export the mesh in a file with the MED format and choice the \a version of MED format + # @param f is the file name + # @param version values are SMESH.MED_V2_1, SMESH.MED_V2_2 def ExportToMED(self, f, version, opt=0): - """ - Export the mesh in a file with the MED format and choice the \a version of MED format - \param f is the file name - \param version values are smesh.MED_V2_1, smesh.MED_V2_2 - """ self.mesh.ExportToMED(f, opt, version) + ## Export the mesh in a file with the MED format + # @param f is the file name def ExportMED(self, f, opt=0): - """ - Export the mesh in a file with the MED format - \param f is the file name - """ self.mesh.ExportMED(f, opt) + ## Export the mesh in a file with the DAT format + # @param f is the file name def ExportDAT(self, f): - """ - Export the mesh in a file with the DAT format - \param f is the file name - """ self.mesh.ExportDAT(f) + ## Export the mesh in a file with the UNV format + # @param f is the file name def ExportUNV(self, f): - """ - Export the mesh in a file with the UNV format - \param f is the file name - """ self.mesh.ExportUNV(f) + ## Export the mesh in a file with the STL format + # @param f is the file name + # @param ascii defined the kind of file contents def ExportSTL(self, f, ascii=1): - """ - Export the mesh in a file with the STL format - \param f is the file name - \param ascii defined the kind of file contents - """ self.mesh.ExportSTL(f, ascii) diff --git a/src/StdMeshers/Makefile.in b/src/StdMeshers/Makefile.in index 544e5d5a8..64c12cec8 100644 --- a/src/StdMeshers/Makefile.in +++ b/src/StdMeshers/Makefile.in @@ -16,7 +16,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -51,6 +51,7 @@ EXPORT_HEADERS = \ StdMeshers_AutomaticLength.hxx \ StdMeshers_Distribution.hxx \ StdMeshers_QuadranglePreference.hxx \ + StdMeshers_QuadraticMesh.hxx \ SMESH_StdMeshers.hxx EXPORT_PYSCRIPTS = @@ -77,7 +78,8 @@ LIB_SRC = \ StdMeshers_Hexa_3D.cxx \ StdMeshers_AutomaticLength.cxx \ StdMeshers_Distribution.cxx \ - StdMeshers_QuadranglePreference.cxx + StdMeshers_QuadranglePreference.cxx \ + StdMeshers_QuadraticMesh.cxx LIB_SERVER_IDL = @@ -88,10 +90,22 @@ BIN = BIN_SRC = # additionnal information to compil and link file -CPPFLAGS+= $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) -CXXFLAGS+= $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome -I${GEOM_ROOT_DIR}/include/salome +CPPFLAGS+= \ + $(OCC_INCLUDES) \ + $(BOOST_CPPFLAGS) \ + $(KERNEL_CXXFLAGS) -LDFLAGS+= -lSMESHimpl -lMEFISTO2D $(OCC_LDPATH) -lTKAdvTools -L${KERNEL_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome \ - -lCASCatch +CXXFLAGS+= \ + $(OCC_CXXFLAGS) \ + $(KERNEL_CXXFLAGS) \ + $(GEOM_CXXFLAGS) + +LDFLAGS+= \ + -lSMESHimpl \ + -lMEFISTO2D \ + $(OCC_LDPATH) \ + -lTKAdvTools \ + $(KERNEL_LDFLAGS) \ + $(GEOM_LDFLAGS) @CONCLUDE@ diff --git a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx index b4953a35a..ea72ca004 100644 --- a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx +++ b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_Arithmetic1D.hxx b/src/StdMeshers/StdMeshers_Arithmetic1D.hxx index 683ce0c3e..09b7edd15 100644 --- a/src/StdMeshers/StdMeshers_Arithmetic1D.hxx +++ b/src/StdMeshers/StdMeshers_Arithmetic1D.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_AutomaticLength.cxx b/src/StdMeshers/StdMeshers_AutomaticLength.cxx index fa74a7dc5..a91ccebb8 100644 --- a/src/StdMeshers/StdMeshers_AutomaticLength.cxx +++ b/src/StdMeshers/StdMeshers_AutomaticLength.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -300,7 +300,10 @@ bool StdMeshers_AutomaticLength::SetParametersByMesh(const SMESH_Mesh* theMesh SMESHDS_SubMesh * eSubMesh = aMeshDS->MeshElements( edge ); if ( !eSubMesh ) return false; - double segLen = L / eSubMesh->NbElements(); + int nbSeg = eSubMesh->NbElements(); + if ( nbSeg < 1 ) + continue; + double segLen = L / nbSeg; // get segment length from _TShapeToLength map::iterator tshape_length = diff --git a/src/StdMeshers/StdMeshers_AutomaticLength.hxx b/src/StdMeshers/StdMeshers_AutomaticLength.hxx index d3f91e203..a9194dce7 100644 --- a/src/StdMeshers/StdMeshers_AutomaticLength.hxx +++ b/src/StdMeshers/StdMeshers_AutomaticLength.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_Deflection1D.cxx b/src/StdMeshers/StdMeshers_Deflection1D.cxx index 974ed2b08..de3d52778 100644 --- a/src/StdMeshers/StdMeshers_Deflection1D.cxx +++ b/src/StdMeshers/StdMeshers_Deflection1D.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_Deflection1D.hxx b/src/StdMeshers/StdMeshers_Deflection1D.hxx index 3334f5b6b..f321c83d5 100644 --- a/src/StdMeshers/StdMeshers_Deflection1D.hxx +++ b/src/StdMeshers/StdMeshers_Deflection1D.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_Distribution.cxx b/src/StdMeshers/StdMeshers_Distribution.cxx index a4465879f..34d0df853 100644 --- a/src/StdMeshers/StdMeshers_Distribution.cxx +++ b/src/StdMeshers/StdMeshers_Distribution.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -27,10 +27,8 @@ // $Header$ #include "StdMeshers_Distribution.hxx" -#include -#include -#include -#include +#include "CASCatch.hxx" + #include #include @@ -45,9 +43,6 @@ Function::~Function() bool Function::value( const double, double& f ) const { - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - bool ok = true; if( myConv==0 ) { @@ -55,10 +50,9 @@ bool Function::value( const double, double& f ) const { f = pow( 10., f ); } - CASCatch_CATCH(CASCatch_Failure) + CASCatch_CATCH(Standard_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); f = 0.0; ok = false; } @@ -128,10 +122,11 @@ double FunctionTable::integral( const int i ) const double FunctionTable::integral( const int i, const double d ) const { - double f, res = 0.0; - if( value( myData[2*i]+d, f ) ) - res = ( myData[2*i+1] + f ) / 2.0 * d; - + double f1,f2, res = 0.0; + if( value( myData[2*i]+d, f1 ) ) + if(!value(myData[2*i], f2)) + f2 = myData[2*i+1]; + res = (f2+f1) * d / 2.0; return res; } @@ -174,22 +169,17 @@ FunctionExpr::FunctionExpr( const char* str, const int conv ) myVars( 1, 1 ), myValues( 1, 1 ) { - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - bool ok = true; CASCatch_TRY { myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString )str ); } - CASCatch_CATCH(CASCatch_Failure) + CASCatch_CATCH(Standard_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); ok = false; } - aCatchSignals.Deactivate(); if( !ok || !myExpr->IsDone() ) myExpr.Nullify(); @@ -214,23 +204,17 @@ bool FunctionExpr::value( const double t, double& f ) const if( myExpr.IsNull() ) return false; - OSD::SetSignal( true ); - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - ( ( TColStd_Array1OfReal& )myValues ).ChangeValue( 1 ) = t; bool ok = true; CASCatch_TRY { f = myExpr->Expression()->Evaluate( myVars, myValues ); } - CASCatch_CATCH(CASCatch_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); + CASCatch_CATCH(Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); f = 0.0; ok = false; } - aCatchSignals.Deactivate(); ok = Function::value( t, f ) && ok; return ok; } @@ -244,7 +228,7 @@ double FunctionExpr::integral( const double a, const double b ) const if( _int.IsDone() ) res = _int.Value(); } - CASCatch_CATCH(CASCatch_Failure) + CASCatch_CATCH(Standard_Failure) { res = 0.0; MESSAGE( "Exception in integral calculating" ); diff --git a/src/StdMeshers/StdMeshers_Distribution.hxx b/src/StdMeshers/StdMeshers_Distribution.hxx index 6fa336342..2dafda44b 100644 --- a/src/StdMeshers/StdMeshers_Distribution.hxx +++ b/src/StdMeshers/StdMeshers_Distribution.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx index 8186f0256..ccb6c4a5a 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -71,15 +72,11 @@ static bool ComputePentahedralMesh(SMESH_Mesh & aMesh, const TopoDS_Shape & aSha //============================================================================= StdMeshers_Hexa_3D::StdMeshers_Hexa_3D(int hypId, int studyId, - SMESH_Gen * gen):SMESH_3D_Algo(hypId, studyId, gen) + SMESH_Gen * gen):SMESH_3D_Algo(hypId, studyId, gen) { - MESSAGE("StdMeshers_Hexa_3D::StdMeshers_Hexa_3D"); - _name = "Hexa_3D"; -// _shapeType = TopAbs_SOLID; - _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit /shape type -// MESSAGE("_shapeType octal " << oct << _shapeType); - for (int i = 0; i < 6; i++) - _quads[i] = 0; + MESSAGE("StdMeshers_Hexa_3D::StdMeshers_Hexa_3D"); + _name = "Hexa_3D"; + _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit /shape type } //============================================================================= @@ -90,11 +87,27 @@ StdMeshers_Hexa_3D::StdMeshers_Hexa_3D(int hypId, int studyId, StdMeshers_Hexa_3D::~StdMeshers_Hexa_3D() { - MESSAGE("StdMeshers_Hexa_3D::~StdMeshers_Hexa_3D"); - for (int i = 0; i < 6; i++) - StdMeshers_Quadrangle_2D::QuadDelete(_quads[i]); + MESSAGE("StdMeshers_Hexa_3D::~StdMeshers_Hexa_3D"); } +//================================================================================ +/*! + * \brief Clear fields and return the argument + * \param res - the value to return + * \retval bool - the argument value + */ +//================================================================================ + +bool StdMeshers_Hexa_3D::ClearAndReturn(FaceQuadStruct* theQuads[6], const bool res) +{ + for (int i = 0; i < 6; i++) { + StdMeshers_Quadrangle_2D::QuadDelete(theQuads[i]); + theQuads[i] = NULL; + } + return res; +} + + //============================================================================= /*! * @@ -147,6 +160,7 @@ static bool findIJ (const SMDS_MeshNode* node, const FaceQuadStruct * quad, int& return true; } + //============================================================================= /*! * Hexahedron mesh on hexaedron like form @@ -164,534 +178,540 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape)throw(SALOME_Exception) { Unexpect aCatch(SalomeException); - MESSAGE("StdMeshers_Hexa_3D::Compute"); - //bool isOk = false; - SMESHDS_Mesh * meshDS = aMesh.GetMeshDS(); - //SMESH_subMesh *theSubMesh = aMesh.GetSubMesh(aShape); - //const SMESHDS_SubMesh *& subMeshDS = theSubMesh->GetSubMeshDS(); - - // 0. - shape and face mesh verification - // 0.1 - shape must be a solid (or a shell) with 6 faces - //MESSAGE("---"); - - vector < SMESH_subMesh * >meshFaces; - for (TopExp_Explorer exp(aShape, TopAbs_FACE); exp.More(); exp.Next()) - { - SMESH_subMesh *aSubMesh = aMesh.GetSubMeshContaining(exp.Current()); - ASSERT(aSubMesh); - meshFaces.push_back(aSubMesh); - } - if (meshFaces.size() != 6) - { - SCRUTE(meshFaces.size()); -// ASSERT(0); - return false; - } - - // 0.2 - is each face meshed with Quadrangle_2D? (so, with a wire of 4 edges) - //MESSAGE("---"); - - for (int i = 0; i < 6; i++) - { - TopoDS_Shape aFace = meshFaces[i]->GetSubShape(); - SMESH_Algo *algo = _gen->GetAlgo(aMesh, aFace); - string algoName = algo->GetName(); - bool isAllQuad = false; - if (algoName == "Quadrangle_2D") { - SMESHDS_SubMesh * sm = meshDS->MeshElements( aFace ); - if ( sm ) { - isAllQuad = true; - SMDS_ElemIteratorPtr eIt = sm->GetElements(); - while ( isAllQuad && eIt->more() ) - isAllQuad = ( eIt->next()->NbNodes() == 4 ); - } - } - if ( ! isAllQuad ) { - //modified by NIZNHY-PKV Wed Nov 17 15:31:37 2004 f - bool bIsOk; - // - bIsOk=ComputePentahedralMesh(aMesh, aShape); - if (bIsOk) { - return true; - } - //modified by NIZNHY-PKV Wed Nov 17 15:31:42 2004 t - SCRUTE(algoName); - // ASSERT(0); - return false; - } - StdMeshers_Quadrangle_2D *quadAlgo = - dynamic_cast < StdMeshers_Quadrangle_2D * >(algo); - ASSERT(quadAlgo); - try - { - _quads[i] = quadAlgo->CheckAnd2Dcompute(aMesh, aFace); - // *** to delete after usage - } - catch(SALOME_Exception & S_ex) - { - // *** delete _quads - // *** throw exception - // ASSERT(0); - return false; - } - - // 0.2.1 - number of points on the opposite edges must be the same - if (_quads[i]->nbPts[0] != _quads[i]->nbPts[2] || - _quads[i]->nbPts[1] != _quads[i]->nbPts[3]) - { - MESSAGE("different number of points on the opposite edges of face " << i); - // ASSERT(0); - return false; - } - } - - // 1. - identify faces and vertices of the "cube" - // 1.1 - ancestor maps vertex->edges in the cube - //MESSAGE("---"); - - TopTools_IndexedDataMapOfShapeListOfShape MS; - TopExp::MapShapesAndAncestors(aShape, TopAbs_VERTEX, TopAbs_EDGE, MS); - - // 1.2 - first face is choosen as face Y=0 of the unit cube - //MESSAGE("---"); - - const TopoDS_Shape & aFace = meshFaces[0]->GetSubShape(); - const TopoDS_Face & F = TopoDS::Face(aFace); - - // 1.3 - identify the 4 vertices of the face Y=0: V000, V100, V101, V001 - //MESSAGE("---"); - - int i = 0; - TopoDS_Edge E = _quads[0]->edge[i]; //edge will be Y=0,Z=0 on unit cube - double f, l; - Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l); - TopoDS_Vertex VFirst, VLast; - TopExp::Vertices(E, VFirst, VLast); // corresponds to f and l - bool isForward = - (((l - f) * (_quads[0]->last[i] - _quads[0]->first[i])) > 0); - - if (isForward) - { - _cube.V000 = VFirst; // will be (0,0,0) on the unit cube - _cube.V100 = VLast; // will be (1,0,0) on the unit cube - } - else - { - _cube.V000 = VLast; - _cube.V100 = VFirst; - } - - i = 1; - E = _quads[0]->edge[i]; - C2d = BRep_Tool::CurveOnSurface(E, F, f, l); - TopExp::Vertices(E, VFirst, VLast); - isForward = (((l - f) * (_quads[0]->last[i] - _quads[0]->first[i])) > 0); - if (isForward) - _cube.V101 = VLast; // will be (1,0,1) on the unit cube - else - _cube.V101 = VFirst; + MESSAGE("StdMeshers_Hexa_3D::Compute"); + SMESHDS_Mesh * meshDS = aMesh.GetMeshDS(); + + // 0. - shape and face mesh verification + // 0.1 - shape must be a solid (or a shell) with 6 faces + //MESSAGE("---"); + + vector < SMESH_subMesh * >meshFaces; + for (TopExp_Explorer exp(aShape, TopAbs_FACE); exp.More(); exp.Next()) { + SMESH_subMesh *aSubMesh = aMesh.GetSubMeshContaining(exp.Current()); + ASSERT(aSubMesh); + meshFaces.push_back(aSubMesh); + } + if (meshFaces.size() != 6) { + SCRUTE(meshFaces.size()); + return false; + } - i = 2; - E = _quads[0]->edge[i]; - C2d = BRep_Tool::CurveOnSurface(E, F, f, l); - TopExp::Vertices(E, VFirst, VLast); - isForward = (((l - f) * (_quads[0]->last[i] - _quads[0]->first[i])) > 0); - if (isForward) - _cube.V001 = VLast; // will be (0,0,1) on the unit cube - else - _cube.V001 = VFirst; + // 0.2 - is each face meshed with Quadrangle_2D? (so, with a wire of 4 edges) + //MESSAGE("---"); + + // tool for working with quadratic elements + SMESH_MesherHelper aTool (aMesh); + _quadraticMesh = aTool.IsQuadraticSubMesh(aShape); + + // cube structure + typedef struct cubeStruct + { + TopoDS_Vertex V000; + TopoDS_Vertex V001; + TopoDS_Vertex V010; + TopoDS_Vertex V011; + TopoDS_Vertex V100; + TopoDS_Vertex V101; + TopoDS_Vertex V110; + TopoDS_Vertex V111; + faceQuadStruct* quad_X0; + faceQuadStruct* quad_X1; + faceQuadStruct* quad_Y0; + faceQuadStruct* quad_Y1; + faceQuadStruct* quad_Z0; + faceQuadStruct* quad_Z1; + Point3DStruct* np; // normalised 3D coordinates + } CubeStruct; + + CubeStruct aCube; + + // bounding faces + FaceQuadStruct* aQuads[6]; + for (int i = 0; i < 6; i++) + aQuads[i] = 0; + + for (int i = 0; i < 6; i++) { + TopoDS_Shape aFace = meshFaces[i]->GetSubShape(); + SMESH_Algo *algo = _gen->GetAlgo(aMesh, aFace); + string algoName = algo->GetName(); + bool isAllQuad = false; + if (algoName == "Quadrangle_2D") { + SMESHDS_SubMesh * sm = meshDS->MeshElements( aFace ); + if ( sm ) { + isAllQuad = true; + SMDS_ElemIteratorPtr eIt = sm->GetElements(); + while ( isAllQuad && eIt->more() ) { + const SMDS_MeshElement* elem = eIt->next(); + isAllQuad = ( elem->NbNodes()==4 ||(_quadraticMesh && elem->NbNodes()==8) ); + } + } + } + if ( ! isAllQuad ) { + //modified by NIZNHY-PKV Wed Nov 17 15:31:37 2004 f + bool bIsOk = ComputePentahedralMesh(aMesh, aShape); + return ClearAndReturn( aQuads, bIsOk ); + } + StdMeshers_Quadrangle_2D *quadAlgo = + dynamic_cast < StdMeshers_Quadrangle_2D * >(algo); + ASSERT(quadAlgo); + try { + aQuads[i] = quadAlgo->CheckAnd2Dcompute(aMesh, aFace, _quadraticMesh); + } + catch(SALOME_Exception & S_ex) { + return ClearAndReturn( aQuads, false ); + } - // 1.4 - find edge X=0, Z=0 (ancestor of V000 not in face Y=0) - // - find edge X=1, Z=0 (ancestor of V100 not in face Y=0) - // - find edge X=1, Z=1 (ancestor of V101 not in face Y=0) - // - find edge X=0, Z=1 (ancestor of V001 not in face Y=0) - //MESSAGE("---"); + // 0.2.1 - number of points on the opposite edges must be the same + if (aQuads[i]->nbPts[0] != aQuads[i]->nbPts[2] || + aQuads[i]->nbPts[1] != aQuads[i]->nbPts[3]) { + MESSAGE("different number of points on the opposite edges of face " << i); + // ASSERT(0); + // \begin{E.A.} + // Try to go into penta algorithm 'cause it has been improved. + // return ClearAndReturn( aQuads, false ); + bool bIsOk = ComputePentahedralMesh(aMesh, aShape); + return ClearAndReturn( aQuads, bIsOk ); + // \end{E.A.} + } + } - TopoDS_Edge E_0Y0 = EdgeNotInFace(aMesh, aShape, F, _cube.V000, MS); - ASSERT(!E_0Y0.IsNull()); + // 1. - identify faces and vertices of the "cube" + // 1.1 - ancestor maps vertex->edges in the cube + //MESSAGE("---"); - TopoDS_Edge E_1Y0 = EdgeNotInFace(aMesh, aShape, F, _cube.V100, MS); - ASSERT(!E_1Y0.IsNull()); + TopTools_IndexedDataMapOfShapeListOfShape MS; + TopExp::MapShapesAndAncestors(aShape, TopAbs_VERTEX, TopAbs_EDGE, MS); - TopoDS_Edge E_1Y1 = EdgeNotInFace(aMesh, aShape, F, _cube.V101, MS); - ASSERT(!E_1Y1.IsNull()); + // 1.2 - first face is choosen as face Y=0 of the unit cube + //MESSAGE("---"); - TopoDS_Edge E_0Y1 = EdgeNotInFace(aMesh, aShape, F, _cube.V001, MS); - ASSERT(!E_0Y1.IsNull()); + const TopoDS_Shape & aFace = meshFaces[0]->GetSubShape(); + const TopoDS_Face & F = TopoDS::Face(aFace); - // 1.5 - identify the 4 vertices in face Y=1: V010, V110, V111, V011 - //MESSAGE("---"); + // 1.3 - identify the 4 vertices of the face Y=0: V000, V100, V101, V001 + //MESSAGE("---"); - TopExp::Vertices(E_0Y0, VFirst, VLast); - if (VFirst.IsSame(_cube.V000)) - _cube.V010 = VLast; - else - _cube.V010 = VFirst; + int i = 0; + TopoDS_Edge E = aQuads[0]->edge[i]; //edge will be Y=0,Z=0 on unit cube + double f, l; + Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l); + TopoDS_Vertex VFirst, VLast; + TopExp::Vertices(E, VFirst, VLast); // corresponds to f and l + bool isForward = (((l - f) * (aQuads[0]->last[i] - aQuads[0]->first[i])) > 0); - TopExp::Vertices(E_1Y0, VFirst, VLast); - if (VFirst.IsSame(_cube.V100)) - _cube.V110 = VLast; - else - _cube.V110 = VFirst; - - TopExp::Vertices(E_1Y1, VFirst, VLast); - if (VFirst.IsSame(_cube.V101)) - _cube.V111 = VLast; - else - _cube.V111 = VFirst; + if (isForward) { + aCube.V000 = VFirst; // will be (0,0,0) on the unit cube + aCube.V100 = VLast; // will be (1,0,0) on the unit cube + } + else { + aCube.V000 = VLast; + aCube.V100 = VFirst; + } - TopExp::Vertices(E_0Y1, VFirst, VLast); - if (VFirst.IsSame(_cube.V001)) - _cube.V011 = VLast; - else - _cube.V011 = VFirst; - - // 1.6 - find remaining faces given 4 vertices - //MESSAGE("---"); - - _indY0 = 0; - _cube.quad_Y0 = _quads[_indY0]; - - _indY1 = GetFaceIndex(aMesh, aShape, meshFaces, - _cube.V010, _cube.V011, _cube.V110, _cube.V111); - _cube.quad_Y1 = _quads[_indY1]; - - _indZ0 = GetFaceIndex(aMesh, aShape, meshFaces, - _cube.V000, _cube.V010, _cube.V100, _cube.V110); - _cube.quad_Z0 = _quads[_indZ0]; - - _indZ1 = GetFaceIndex(aMesh, aShape, meshFaces, - _cube.V001, _cube.V011, _cube.V101, _cube.V111); - _cube.quad_Z1 = _quads[_indZ1]; - - _indX0 = GetFaceIndex(aMesh, aShape, meshFaces, - _cube.V000, _cube.V001, _cube.V010, _cube.V011); - _cube.quad_X0 = _quads[_indX0]; - - _indX1 = GetFaceIndex(aMesh, aShape, meshFaces, - _cube.V100, _cube.V101, _cube.V110, _cube.V111); - _cube.quad_X1 = _quads[_indX1]; - - //MESSAGE("---"); - - // 1.7 - get convertion coefs from face 2D normalized to 3D normalized - - Conv2DStruct cx0; // for face X=0 - Conv2DStruct cx1; // for face X=1 - Conv2DStruct cy0; - Conv2DStruct cy1; - Conv2DStruct cz0; - Conv2DStruct cz1; - - GetConv2DCoefs(*_cube.quad_X0, meshFaces[_indX0]->GetSubShape(), - _cube.V000, _cube.V010, _cube.V011, _cube.V001, cx0); - GetConv2DCoefs(*_cube.quad_X1, meshFaces[_indX1]->GetSubShape(), - _cube.V100, _cube.V110, _cube.V111, _cube.V101, cx1); - GetConv2DCoefs(*_cube.quad_Y0, meshFaces[_indY0]->GetSubShape(), - _cube.V000, _cube.V100, _cube.V101, _cube.V001, cy0); - GetConv2DCoefs(*_cube.quad_Y1, meshFaces[_indY1]->GetSubShape(), - _cube.V010, _cube.V110, _cube.V111, _cube.V011, cy1); - GetConv2DCoefs(*_cube.quad_Z0, meshFaces[_indZ0]->GetSubShape(), - _cube.V000, _cube.V100, _cube.V110, _cube.V010, cz0); - GetConv2DCoefs(*_cube.quad_Z1, meshFaces[_indZ1]->GetSubShape(), - _cube.V001, _cube.V101, _cube.V111, _cube.V011, cz1); - - // 1.8 - create a 3D structure for normalized values - - //MESSAGE("---"); - int nbx = _cube.quad_Z0->nbPts[0]; - if (cz0.a1 == 0.) nbx = _cube.quad_Z0->nbPts[1]; + i = 1; + E = aQuads[0]->edge[i]; + C2d = BRep_Tool::CurveOnSurface(E, F, f, l); + TopExp::Vertices(E, VFirst, VLast); + isForward = (((l - f) * (aQuads[0]->last[i] - aQuads[0]->first[i])) > 0); + if (isForward) + aCube.V101 = VLast; // will be (1,0,1) on the unit cube + else + aCube.V101 = VFirst; + + i = 2; + E = aQuads[0]->edge[i]; + C2d = BRep_Tool::CurveOnSurface(E, F, f, l); + TopExp::Vertices(E, VFirst, VLast); + isForward = (((l - f) * (aQuads[0]->last[i] - aQuads[0]->first[i])) > 0); + if (isForward) + aCube.V001 = VLast; // will be (0,0,1) on the unit cube + else + aCube.V001 = VFirst; + + // 1.4 - find edge X=0, Z=0 (ancestor of V000 not in face Y=0) + // - find edge X=1, Z=0 (ancestor of V100 not in face Y=0) + // - find edge X=1, Z=1 (ancestor of V101 not in face Y=0) + // - find edge X=0, Z=1 (ancestor of V001 not in face Y=0) + //MESSAGE("---"); + + TopoDS_Edge E_0Y0 = EdgeNotInFace(aMesh, aShape, F, aCube.V000, MS); + ASSERT(!E_0Y0.IsNull()); + + TopoDS_Edge E_1Y0 = EdgeNotInFace(aMesh, aShape, F, aCube.V100, MS); + ASSERT(!E_1Y0.IsNull()); + + TopoDS_Edge E_1Y1 = EdgeNotInFace(aMesh, aShape, F, aCube.V101, MS); + ASSERT(!E_1Y1.IsNull()); + + TopoDS_Edge E_0Y1 = EdgeNotInFace(aMesh, aShape, F, aCube.V001, MS); + ASSERT(!E_0Y1.IsNull()); + + // 1.5 - identify the 4 vertices in face Y=1: V010, V110, V111, V011 + //MESSAGE("---"); + + TopExp::Vertices(E_0Y0, VFirst, VLast); + if (VFirst.IsSame(aCube.V000)) + aCube.V010 = VLast; + else + aCube.V010 = VFirst; + + TopExp::Vertices(E_1Y0, VFirst, VLast); + if (VFirst.IsSame(aCube.V100)) + aCube.V110 = VLast; + else + aCube.V110 = VFirst; + + TopExp::Vertices(E_1Y1, VFirst, VLast); + if (VFirst.IsSame(aCube.V101)) + aCube.V111 = VLast; + else + aCube.V111 = VFirst; + + TopExp::Vertices(E_0Y1, VFirst, VLast); + if (VFirst.IsSame(aCube.V001)) + aCube.V011 = VLast; + else + aCube.V011 = VFirst; + + // 1.6 - find remaining faces given 4 vertices + //MESSAGE("---"); + + int _indY0 = 0; + aCube.quad_Y0 = aQuads[_indY0]; + + int _indY1 = GetFaceIndex(aMesh, aShape, meshFaces, + aCube.V010, aCube.V011, aCube.V110, aCube.V111); + aCube.quad_Y1 = aQuads[_indY1]; + + int _indZ0 = GetFaceIndex(aMesh, aShape, meshFaces, + aCube.V000, aCube.V010, aCube.V100, aCube.V110); + aCube.quad_Z0 = aQuads[_indZ0]; + + int _indZ1 = GetFaceIndex(aMesh, aShape, meshFaces, + aCube.V001, aCube.V011, aCube.V101, aCube.V111); + aCube.quad_Z1 = aQuads[_indZ1]; + + int _indX0 = GetFaceIndex(aMesh, aShape, meshFaces, + aCube.V000, aCube.V001, aCube.V010, aCube.V011); + aCube.quad_X0 = aQuads[_indX0]; + + int _indX1 = GetFaceIndex(aMesh, aShape, meshFaces, + aCube.V100, aCube.V101, aCube.V110, aCube.V111); + aCube.quad_X1 = aQuads[_indX1]; + + //MESSAGE("---"); + + // 1.7 - get convertion coefs from face 2D normalized to 3D normalized + + Conv2DStruct cx0; // for face X=0 + Conv2DStruct cx1; // for face X=1 + Conv2DStruct cy0; + Conv2DStruct cy1; + Conv2DStruct cz0; + Conv2DStruct cz1; + + GetConv2DCoefs(*aCube.quad_X0, meshFaces[_indX0]->GetSubShape(), + aCube.V000, aCube.V010, aCube.V011, aCube.V001, cx0); + GetConv2DCoefs(*aCube.quad_X1, meshFaces[_indX1]->GetSubShape(), + aCube.V100, aCube.V110, aCube.V111, aCube.V101, cx1); + GetConv2DCoefs(*aCube.quad_Y0, meshFaces[_indY0]->GetSubShape(), + aCube.V000, aCube.V100, aCube.V101, aCube.V001, cy0); + GetConv2DCoefs(*aCube.quad_Y1, meshFaces[_indY1]->GetSubShape(), + aCube.V010, aCube.V110, aCube.V111, aCube.V011, cy1); + GetConv2DCoefs(*aCube.quad_Z0, meshFaces[_indZ0]->GetSubShape(), + aCube.V000, aCube.V100, aCube.V110, aCube.V010, cz0); + GetConv2DCoefs(*aCube.quad_Z1, meshFaces[_indZ1]->GetSubShape(), + aCube.V001, aCube.V101, aCube.V111, aCube.V011, cz1); + + // 1.8 - create a 3D structure for normalized values + + //MESSAGE("---"); + int nbx = aCube.quad_Z0->nbPts[0]; + if (cz0.a1 == 0.) nbx = aCube.quad_Z0->nbPts[1]; - int nby = _cube.quad_X0->nbPts[0]; - if (cx0.a1 == 0.) nby = _cube.quad_X0->nbPts[1]; + int nby = aCube.quad_X0->nbPts[0]; + if (cx0.a1 == 0.) nby = aCube.quad_X0->nbPts[1]; - int nbz = _cube.quad_Y0->nbPts[0]; - if (cy0.a1 != 0.) nbz = _cube.quad_Y0->nbPts[1]; + int nbz = aCube.quad_Y0->nbPts[0]; + if (cy0.a1 != 0.) nbz = aCube.quad_Y0->nbPts[1]; - int i1, j1, nbxyz = nbx * nby * nbz; - Point3DStruct *np = new Point3DStruct[nbxyz]; + int i1, j1, nbxyz = nbx * nby * nbz; + Point3DStruct *np = new Point3DStruct[nbxyz]; - // 1.9 - store node indexes of faces + // 1.9 - store node indexes of faces - { - const TopoDS_Face & F = TopoDS::Face(meshFaces[_indX0]->GetSubShape()); - - faceQuadStruct *quad = _cube.quad_X0; - int i = 0; // j = x/face , k = y/face - int nbdown = quad->nbPts[0]; - int nbright = quad->nbPts[1]; + { + const TopoDS_Face & F = TopoDS::Face(meshFaces[_indX0]->GetSubShape()); + faceQuadStruct *quad = aCube.quad_X0; + int i = 0; // j = x/face , k = y/face + int nbdown = quad->nbPts[0]; + int nbright = quad->nbPts[1]; - SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes(); + SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes(); - while(itf->more()) - { - const SMDS_MeshNode * node = itf->next(); - findIJ( node, quad, i1, j1 ); - int ij1 = j1 * nbdown + i1; - quad->uv_grid[ij1].node = node; - } - - for (int i1 = 0; i1 < nbdown; i1++) - for (int j1 = 0; j1 < nbright; j1++) - { - int ij1 = j1 * nbdown + i1; - int j = cx0.ia * i1 + cx0.ib * j1 + cx0.ic; // j = x/face - int k = cx0.ja * i1 + cx0.jb * j1 + cx0.jc; // k = y/face - int ijk = k * nbx * nby + j * nbx + i; - //MESSAGE(" "<uv_grid[ij1].node; - //SCRUTE(np[ijk].nodeId); - } - } + while(itf->more()) { + const SMDS_MeshNode * node = itf->next(); + if(aTool.IsMedium(node)) + continue; + findIJ( node, quad, i1, j1 ); + int ij1 = j1 * nbdown + i1; + quad->uv_grid[ij1].node = node; + } - { - const TopoDS_Face & F = TopoDS::Face(meshFaces[_indX1]->GetSubShape()); + for (int i1 = 0; i1 < nbdown; i1++) + for (int j1 = 0; j1 < nbright; j1++) { + int ij1 = j1 * nbdown + i1; + int j = cx0.ia * i1 + cx0.ib * j1 + cx0.ic; // j = x/face + int k = cx0.ja * i1 + cx0.jb * j1 + cx0.jc; // k = y/face + int ijk = k * nbx * nby + j * nbx + i; + //MESSAGE(" "<uv_grid[ij1].node; + //SCRUTE(np[ijk].nodeId); + } + } - SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes(); + { + const TopoDS_Face & F = TopoDS::Face(meshFaces[_indX1]->GetSubShape()); - faceQuadStruct *quad = _cube.quad_X1; - int i = nbx - 1; // j = x/face , k = y/face - int nbdown = quad->nbPts[0]; - int nbright = quad->nbPts[1]; + SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes(); - while(itf->more()) - { - const SMDS_MeshNode * node = itf->next(); - findIJ( node, quad, i1, j1 ); - int ij1 = j1 * nbdown + i1; - quad->uv_grid[ij1].node = node; - } + faceQuadStruct *quad = aCube.quad_X1; + int i = nbx - 1; // j = x/face , k = y/face + int nbdown = quad->nbPts[0]; + int nbright = quad->nbPts[1]; - for (int i1 = 0; i1 < nbdown; i1++) - for (int j1 = 0; j1 < nbright; j1++) - { - int ij1 = j1 * nbdown + i1; - int j = cx1.ia * i1 + cx1.ib * j1 + cx1.ic; // j = x/face - int k = cx1.ja * i1 + cx1.jb * j1 + cx1.jc; // k = y/face - int ijk = k * nbx * nby + j * nbx + i; - //MESSAGE(" "<uv_grid[ij1].node; - //SCRUTE(np[ijk].nodeId); - } - } + while(itf->more()) { + const SMDS_MeshNode * node = itf->next(); + if(aTool.IsMedium(node)) + continue; + findIJ( node, quad, i1, j1 ); + int ij1 = j1 * nbdown + i1; + quad->uv_grid[ij1].node = node; + } - { - const TopoDS_Face & F = TopoDS::Face(meshFaces[_indY0]->GetSubShape()); + for (int i1 = 0; i1 < nbdown; i1++) + for (int j1 = 0; j1 < nbright; j1++) { + int ij1 = j1 * nbdown + i1; + int j = cx1.ia * i1 + cx1.ib * j1 + cx1.ic; // j = x/face + int k = cx1.ja * i1 + cx1.jb * j1 + cx1.jc; // k = y/face + int ijk = k * nbx * nby + j * nbx + i; + //MESSAGE(" "<uv_grid[ij1].node; + //SCRUTE(np[ijk].nodeId); + } + } - SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes(); + { + const TopoDS_Face & F = TopoDS::Face(meshFaces[_indY0]->GetSubShape()); - faceQuadStruct *quad = _cube.quad_Y0; - int j = 0; // i = x/face , k = y/face - int nbdown = quad->nbPts[0]; - int nbright = quad->nbPts[1]; + SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes(); - while(itf->more()) - { - const SMDS_MeshNode * node = itf->next(); - findIJ( node, quad, i1, j1 ); - int ij1 = j1 * nbdown + i1; - quad->uv_grid[ij1].node = node; - } + faceQuadStruct *quad = aCube.quad_Y0; + int j = 0; // i = x/face , k = y/face + int nbdown = quad->nbPts[0]; + int nbright = quad->nbPts[1]; - for (int i1 = 0; i1 < nbdown; i1++) - for (int j1 = 0; j1 < nbright; j1++) - { - int ij1 = j1 * nbdown + i1; - int i = cy0.ia * i1 + cy0.ib * j1 + cy0.ic; // i = x/face - int k = cy0.ja * i1 + cy0.jb * j1 + cy0.jc; // k = y/face - int ijk = k * nbx * nby + j * nbx + i; - //MESSAGE(" "<uv_grid[ij1].node; - //SCRUTE(np[ijk].nodeId); - } - } + while(itf->more()) { + const SMDS_MeshNode * node = itf->next(); + if(aTool.IsMedium(node)) + continue; + findIJ( node, quad, i1, j1 ); + int ij1 = j1 * nbdown + i1; + quad->uv_grid[ij1].node = node; + } - { - const TopoDS_Face & F = TopoDS::Face(meshFaces[_indY1]->GetSubShape()); + for (int i1 = 0; i1 < nbdown; i1++) + for (int j1 = 0; j1 < nbright; j1++) { + int ij1 = j1 * nbdown + i1; + int i = cy0.ia * i1 + cy0.ib * j1 + cy0.ic; // i = x/face + int k = cy0.ja * i1 + cy0.jb * j1 + cy0.jc; // k = y/face + int ijk = k * nbx * nby + j * nbx + i; + //MESSAGE(" "<uv_grid[ij1].node; + //SCRUTE(np[ijk].nodeId); + } + } - SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes(); + { + const TopoDS_Face & F = TopoDS::Face(meshFaces[_indY1]->GetSubShape()); - faceQuadStruct *quad = _cube.quad_Y1; - int j = nby - 1; // i = x/face , k = y/face - int nbdown = quad->nbPts[0]; - int nbright = quad->nbPts[1]; + SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes(); - while(itf->more()) - { - const SMDS_MeshNode * node = itf->next(); - findIJ( node, quad, i1, j1 ); - int ij1 = j1 * nbdown + i1; - quad->uv_grid[ij1].node = node; - } + faceQuadStruct *quad = aCube.quad_Y1; + int j = nby - 1; // i = x/face , k = y/face + int nbdown = quad->nbPts[0]; + int nbright = quad->nbPts[1]; - for (int i1 = 0; i1 < nbdown; i1++) - for (int j1 = 0; j1 < nbright; j1++) - { - int ij1 = j1 * nbdown + i1; - int i = cy1.ia * i1 + cy1.ib * j1 + cy1.ic; // i = x/face - int k = cy1.ja * i1 + cy1.jb * j1 + cy1.jc; // k = y/face - int ijk = k * nbx * nby + j * nbx + i; - //MESSAGE(" "<uv_grid[ij1].node; - //SCRUTE(np[ijk].nodeId); - } - } + while(itf->more()) { + const SMDS_MeshNode * node = itf->next(); + if(aTool.IsMedium(node)) + continue; + findIJ( node, quad, i1, j1 ); + int ij1 = j1 * nbdown + i1; + quad->uv_grid[ij1].node = node; + } - { - const TopoDS_Face & F = TopoDS::Face(meshFaces[_indZ0]->GetSubShape()); + for (int i1 = 0; i1 < nbdown; i1++) + for (int j1 = 0; j1 < nbright; j1++) { + int ij1 = j1 * nbdown + i1; + int i = cy1.ia * i1 + cy1.ib * j1 + cy1.ic; // i = x/face + int k = cy1.ja * i1 + cy1.jb * j1 + cy1.jc; // k = y/face + int ijk = k * nbx * nby + j * nbx + i; + //MESSAGE(" "<uv_grid[ij1].node; + //SCRUTE(np[ijk].nodeId); + } + } - SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes(); + { + const TopoDS_Face & F = TopoDS::Face(meshFaces[_indZ0]->GetSubShape()); - faceQuadStruct *quad = _cube.quad_Z0; - int k = 0; // i = x/face , j = y/face - int nbdown = quad->nbPts[0]; - int nbright = quad->nbPts[1]; + SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes(); - while(itf->more()) - { - const SMDS_MeshNode * node = itf->next(); - findIJ( node, quad, i1, j1 ); - int ij1 = j1 * nbdown + i1; - quad->uv_grid[ij1].node = node; - } + faceQuadStruct *quad = aCube.quad_Z0; + int k = 0; // i = x/face , j = y/face + int nbdown = quad->nbPts[0]; + int nbright = quad->nbPts[1]; - for (int i1 = 0; i1 < nbdown; i1++) - for (int j1 = 0; j1 < nbright; j1++) - { - int ij1 = j1 * nbdown + i1; - int i = cz0.ia * i1 + cz0.ib * j1 + cz0.ic; // i = x/face - int j = cz0.ja * i1 + cz0.jb * j1 + cz0.jc; // j = y/face - int ijk = k * nbx * nby + j * nbx + i; - //MESSAGE(" "<uv_grid[ij1].node; - //SCRUTE(np[ijk].nodeId); - } - } - - { - const TopoDS_Face & F = TopoDS::Face(meshFaces[_indZ1]->GetSubShape()); - - SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes(); + while(itf->more()) { + const SMDS_MeshNode * node = itf->next(); + if(aTool.IsMedium(node)) + continue; + findIJ( node, quad, i1, j1 ); + int ij1 = j1 * nbdown + i1; + quad->uv_grid[ij1].node = node; + } - faceQuadStruct *quad = _cube.quad_Z1; - int k = nbz - 1; // i = x/face , j = y/face - int nbdown = quad->nbPts[0]; - int nbright = quad->nbPts[1]; + for (int i1 = 0; i1 < nbdown; i1++) + for (int j1 = 0; j1 < nbright; j1++) { + int ij1 = j1 * nbdown + i1; + int i = cz0.ia * i1 + cz0.ib * j1 + cz0.ic; // i = x/face + int j = cz0.ja * i1 + cz0.jb * j1 + cz0.jc; // j = y/face + int ijk = k * nbx * nby + j * nbx + i; + //MESSAGE(" "<uv_grid[ij1].node; + //SCRUTE(np[ijk].nodeId); + } + } - while(itf->more()) - { - const SMDS_MeshNode * node = itf->next(); - findIJ( node, quad, i1, j1 ); - int ij1 = j1 * nbdown + i1; - quad->uv_grid[ij1].node = node; - } + { + const TopoDS_Face & F = TopoDS::Face(meshFaces[_indZ1]->GetSubShape()); + + SMDS_NodeIteratorPtr itf= aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes(); + + faceQuadStruct *quad = aCube.quad_Z1; + int k = nbz - 1; // i = x/face , j = y/face + int nbdown = quad->nbPts[0]; + int nbright = quad->nbPts[1]; + + while(itf->more()) { + const SMDS_MeshNode * node = itf->next(); + if(aTool.IsMedium(node)) + continue; + findIJ( node, quad, i1, j1 ); + int ij1 = j1 * nbdown + i1; + quad->uv_grid[ij1].node = node; + } - for (int i1 = 0; i1 < nbdown; i1++) - for (int j1 = 0; j1 < nbright; j1++) - { - int ij1 = j1 * nbdown + i1; - int i = cz1.ia * i1 + cz1.ib * j1 + cz1.ic; // i = x/face - int j = cz1.ja * i1 + cz1.jb * j1 + cz1.jc; // j = y/face - int ijk = k * nbx * nby + j * nbx + i; - //MESSAGE(" "<uv_grid[ij1].node; - //SCRUTE(np[ijk].nodeId); - } - } + for (int i1 = 0; i1 < nbdown; i1++) + for (int j1 = 0; j1 < nbright; j1++) { + int ij1 = j1 * nbdown + i1; + int i = cz1.ia * i1 + cz1.ib * j1 + cz1.ic; // i = x/face + int j = cz1.ja * i1 + cz1.jb * j1 + cz1.jc; // j = y/face + int ijk = k * nbx * nby + j * nbx + i; + //MESSAGE(" "<uv_grid[ij1].node; + //SCRUTE(np[ijk].nodeId); + } + } - // 2.0 - for each node of the cube: - // - get the 8 points 3D = 8 vertices of the cube - // - get the 12 points 3D on the 12 edges of the cube - // - get the 6 points 3D on the 6 faces with their ID - // - compute the point 3D - // - store the point 3D in SMESHDS, store its ID in 3D structure - - int shapeID = meshDS->ShapeToIndex( aShape ); - - Pt3 p000, p001, p010, p011, p100, p101, p110, p111; - Pt3 px00, px01, px10, px11; - Pt3 p0y0, p0y1, p1y0, p1y1; - Pt3 p00z, p01z, p10z, p11z; - Pt3 pxy0, pxy1, px0z, px1z, p0yz, p1yz; - - GetPoint(p000, 0, 0, 0, nbx, nby, nbz, np, meshDS); - GetPoint(p001, 0, 0, nbz - 1, nbx, nby, nbz, np, meshDS); - GetPoint(p010, 0, nby - 1, 0, nbx, nby, nbz, np, meshDS); - GetPoint(p011, 0, nby - 1, nbz - 1, nbx, nby, nbz, np, meshDS); - GetPoint(p100, nbx - 1, 0, 0, nbx, nby, nbz, np, meshDS); - GetPoint(p101, nbx - 1, 0, nbz - 1, nbx, nby, nbz, np, meshDS); - GetPoint(p110, nbx - 1, nby - 1, 0, nbx, nby, nbz, np, meshDS); - GetPoint(p111, nbx - 1, nby - 1, nbz - 1, nbx, nby, nbz, np, meshDS); - - for (int i = 1; i < nbx - 1; i++) - { - for (int j = 1; j < nby - 1; j++) - { - for (int k = 1; k < nbz - 1; k++) - { - // *** seulement maillage regulier - // 12 points on edges - GetPoint(px00, i, 0, 0, nbx, nby, nbz, np, meshDS); - GetPoint(px01, i, 0, nbz - 1, nbx, nby, nbz, np, meshDS); - GetPoint(px10, i, nby - 1, 0, nbx, nby, nbz, np, meshDS); - GetPoint(px11, i, nby - 1, nbz - 1, nbx, nby, nbz, np, meshDS); - - GetPoint(p0y0, 0, j, 0, nbx, nby, nbz, np, meshDS); - GetPoint(p0y1, 0, j, nbz - 1, nbx, nby, nbz, np, meshDS); - GetPoint(p1y0, nbx - 1, j, 0, nbx, nby, nbz, np, meshDS); - GetPoint(p1y1, nbx - 1, j, nbz - 1, nbx, nby, nbz, np, meshDS); - - GetPoint(p00z, 0, 0, k, nbx, nby, nbz, np, meshDS); - GetPoint(p01z, 0, nby - 1, k, nbx, nby, nbz, np, meshDS); - GetPoint(p10z, nbx - 1, 0, k, nbx, nby, nbz, np, meshDS); - GetPoint(p11z, nbx - 1, nby - 1, k, nbx, nby, nbz, np, meshDS); - - // 12 points on faces - GetPoint(pxy0, i, j, 0, nbx, nby, nbz, np, meshDS); - GetPoint(pxy1, i, j, nbz - 1, nbx, nby, nbz, np, meshDS); - GetPoint(px0z, i, 0, k, nbx, nby, nbz, np, meshDS); - GetPoint(px1z, i, nby - 1, k, nbx, nby, nbz, np, meshDS); - GetPoint(p0yz, 0, j, k, nbx, nby, nbz, np, meshDS); - GetPoint(p1yz, nbx - 1, j, k, nbx, nby, nbz, np, meshDS); - - int ijk = k * nbx * nby + j * nbx + i; - double x = double (i) / double (nbx - 1); // *** seulement - double y = double (j) / double (nby - 1); // *** maillage - double z = double (k) / double (nbz - 1); // *** regulier - - Pt3 X; - for (int i = 0; i < 3; i++) - { - X[i] = - (1 - x) * p0yz[i] + x * p1yz[i] - + (1 - y) * px0z[i] + y * px1z[i] - + (1 - z) * pxy0[i] + z * pxy1[i] - - (1 - x) * ((1 - y) * p00z[i] + y * p01z[i]) - - x * ((1 - y) * p10z[i] + y * p11z[i]) - - (1 - y) * ((1 - z) * px00[i] + z * px01[i]) - - y * ((1 - z) * px10[i] + z * px11[i]) - - (1 - z) * ((1 - x) * p0y0[i] + x * p1y0[i]) - - z * ((1 - x) * p0y1[i] + x * p1y1[i]) - + (1 - x) * ((1 - y) * ((1 - z) * p000[i] + z * p001[i]) - + y * ((1 - z) * p010[i] + z * p011[i])) - + x * ((1 - y) * ((1 - z) * p100[i] + z * p101[i]) - + y * ((1 - z) * p110[i] + z * p111[i])); - } - - SMDS_MeshNode * node = meshDS->AddNode(X[0], X[1], X[2]); - np[ijk].node = node; - meshDS->SetNodeInVolume(node, shapeID); - } - } - } + // 2.0 - for each node of the cube: + // - get the 8 points 3D = 8 vertices of the cube + // - get the 12 points 3D on the 12 edges of the cube + // - get the 6 points 3D on the 6 faces with their ID + // - compute the point 3D + // - store the point 3D in SMESHDS, store its ID in 3D structure + + int shapeID = meshDS->ShapeToIndex( aShape ); + + Pt3 p000, p001, p010, p011, p100, p101, p110, p111; + Pt3 px00, px01, px10, px11; + Pt3 p0y0, p0y1, p1y0, p1y1; + Pt3 p00z, p01z, p10z, p11z; + Pt3 pxy0, pxy1, px0z, px1z, p0yz, p1yz; + + GetPoint(p000, 0, 0, 0, nbx, nby, nbz, np, meshDS); + GetPoint(p001, 0, 0, nbz - 1, nbx, nby, nbz, np, meshDS); + GetPoint(p010, 0, nby - 1, 0, nbx, nby, nbz, np, meshDS); + GetPoint(p011, 0, nby - 1, nbz - 1, nbx, nby, nbz, np, meshDS); + GetPoint(p100, nbx - 1, 0, 0, nbx, nby, nbz, np, meshDS); + GetPoint(p101, nbx - 1, 0, nbz - 1, nbx, nby, nbz, np, meshDS); + GetPoint(p110, nbx - 1, nby - 1, 0, nbx, nby, nbz, np, meshDS); + GetPoint(p111, nbx - 1, nby - 1, nbz - 1, nbx, nby, nbz, np, meshDS); + + for (int i = 1; i < nbx - 1; i++) { + for (int j = 1; j < nby - 1; j++) { + for (int k = 1; k < nbz - 1; k++) { + // *** seulement maillage regulier + // 12 points on edges + GetPoint(px00, i, 0, 0, nbx, nby, nbz, np, meshDS); + GetPoint(px01, i, 0, nbz - 1, nbx, nby, nbz, np, meshDS); + GetPoint(px10, i, nby - 1, 0, nbx, nby, nbz, np, meshDS); + GetPoint(px11, i, nby - 1, nbz - 1, nbx, nby, nbz, np, meshDS); + + GetPoint(p0y0, 0, j, 0, nbx, nby, nbz, np, meshDS); + GetPoint(p0y1, 0, j, nbz - 1, nbx, nby, nbz, np, meshDS); + GetPoint(p1y0, nbx - 1, j, 0, nbx, nby, nbz, np, meshDS); + GetPoint(p1y1, nbx - 1, j, nbz - 1, nbx, nby, nbz, np, meshDS); + + GetPoint(p00z, 0, 0, k, nbx, nby, nbz, np, meshDS); + GetPoint(p01z, 0, nby - 1, k, nbx, nby, nbz, np, meshDS); + GetPoint(p10z, nbx - 1, 0, k, nbx, nby, nbz, np, meshDS); + GetPoint(p11z, nbx - 1, nby - 1, k, nbx, nby, nbz, np, meshDS); + + // 12 points on faces + GetPoint(pxy0, i, j, 0, nbx, nby, nbz, np, meshDS); + GetPoint(pxy1, i, j, nbz - 1, nbx, nby, nbz, np, meshDS); + GetPoint(px0z, i, 0, k, nbx, nby, nbz, np, meshDS); + GetPoint(px1z, i, nby - 1, k, nbx, nby, nbz, np, meshDS); + GetPoint(p0yz, 0, j, k, nbx, nby, nbz, np, meshDS); + GetPoint(p1yz, nbx - 1, j, k, nbx, nby, nbz, np, meshDS); + + int ijk = k * nbx * nby + j * nbx + i; + double x = double (i) / double (nbx - 1); // *** seulement + double y = double (j) / double (nby - 1); // *** maillage + double z = double (k) / double (nbz - 1); // *** regulier + + Pt3 X; + for (int i = 0; i < 3; i++) { + X[i] = (1 - x) * p0yz[i] + x * p1yz[i] + + (1 - y) * px0z[i] + y * px1z[i] + + (1 - z) * pxy0[i] + z * pxy1[i] + - (1 - x) * ((1 - y) * p00z[i] + y * p01z[i]) + - x * ((1 - y) * p10z[i] + y * p11z[i]) + - (1 - y) * ((1 - z) * px00[i] + z * px01[i]) + - y * ((1 - z) * px10[i] + z * px11[i]) + - (1 - z) * ((1 - x) * p0y0[i] + x * p1y0[i]) + - z * ((1 - x) * p0y1[i] + x * p1y1[i]) + + (1 - x) * ((1 - y) * ((1 - z) * p000[i] + z * p001[i]) + + y * ((1 - z) * p010[i] + z * p011[i])) + + x * ((1 - y) * ((1 - z) * p100[i] + z * p101[i]) + + y * ((1 - z) * p110[i] + z * p111[i])); + } + + SMDS_MeshNode * node = meshDS->AddNode(X[0], X[1], X[2]); + np[ijk].node = node; + meshDS->SetNodeInVolume(node, shapeID); + } + } + } // find orientation of furute volumes according to MED convention vector< bool > forward( nbx * nby ); SMDS_VolumeTool vTool; - for (int i = 0; i < nbx - 1; i++) - for (int j = 0; j < nby - 1; j++) - { + for (int i = 0; i < nbx - 1; i++) { + for (int j = 0; j < nby - 1; j++) { int n1 = j * nbx + i; int n2 = j * nbx + i + 1; int n3 = (j + 1) * nbx + i + 1; @@ -706,51 +726,53 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, vTool.Set( &tmpVol ); forward[ n1 ] = vTool.IsForward(); } + } - //2.1 - for each node of the cube (less 3 *1 Faces): - // - store hexahedron in SMESHDS - MESSAGE("Storing hexahedron into the DS"); - for (int i = 0; i < nbx - 1; i++) - for (int j = 0; j < nby - 1; j++) - { - bool isForw = forward.at( j * nbx + i ); - for (int k = 0; k < nbz - 1; k++) - { - int n1 = k * nbx * nby + j * nbx + i; - int n2 = k * nbx * nby + j * nbx + i + 1; - int n3 = k * nbx * nby + (j + 1) * nbx + i + 1; - int n4 = k * nbx * nby + (j + 1) * nbx + i; - int n5 = (k + 1) * nbx * nby + j * nbx + i; - int n6 = (k + 1) * nbx * nby + j * nbx + i + 1; - int n7 = (k + 1) * nbx * nby + (j + 1) * nbx + i + 1; - int n8 = (k + 1) * nbx * nby + (j + 1) * nbx + i; - - SMDS_MeshVolume * elt; - if ( isForw ) - elt = meshDS->AddVolume(np[n1].node, - np[n2].node, - np[n3].node, - np[n4].node, - np[n5].node, - np[n6].node, - np[n7].node, - np[n8].node); - else - elt = meshDS->AddVolume(np[n1].node, - np[n4].node, - np[n3].node, - np[n2].node, - np[n5].node, - np[n8].node, - np[n7].node, - np[n6].node); - - meshDS->SetMeshElementOnShape(elt, shapeID); - } - } + //2.1 - for each node of the cube (less 3 *1 Faces): + // - store hexahedron in SMESHDS + MESSAGE("Storing hexahedron into the DS"); + for (int i = 0; i < nbx - 1; i++) { + for (int j = 0; j < nby - 1; j++) { + bool isForw = forward.at( j * nbx + i ); + for (int k = 0; k < nbz - 1; k++) { + int n1 = k * nbx * nby + j * nbx + i; + int n2 = k * nbx * nby + j * nbx + i + 1; + int n3 = k * nbx * nby + (j + 1) * nbx + i + 1; + int n4 = k * nbx * nby + (j + 1) * nbx + i; + int n5 = (k + 1) * nbx * nby + j * nbx + i; + int n6 = (k + 1) * nbx * nby + j * nbx + i + 1; + int n7 = (k + 1) * nbx * nby + (j + 1) * nbx + i + 1; + int n8 = (k + 1) * nbx * nby + (j + 1) * nbx + i; + + SMDS_MeshVolume * elt; + if ( isForw ) { + //elt = meshDS->AddVolume(np[n1].node, np[n2].node, + // np[n3].node, np[n4].node, + // np[n5].node, np[n6].node, + // np[n7].node, np[n8].node); + elt = aTool.AddVolume(np[n1].node, np[n2].node, + np[n3].node, np[n4].node, + np[n5].node, np[n6].node, + np[n7].node, np[n8].node); + } + else { + //elt = meshDS->AddVolume(np[n1].node, np[n4].node, + // np[n3].node, np[n2].node, + // np[n5].node, np[n8].node, + // np[n7].node, np[n6].node); + elt = aTool.AddVolume(np[n1].node, np[n4].node, + np[n3].node, np[n2].node, + np[n5].node, np[n8].node, + np[n7].node, np[n6].node); + } + + meshDS->SetMeshElementOnShape(elt, shapeID); + } + } + } if ( np ) delete [] np; - //MESSAGE("End of StdMeshers_Hexa_3D::Compute()"); - return true; + //MESSAGE("End of StdMeshers_Hexa_3D::Compute()"); + return ClearAndReturn( aQuads, true ); } //============================================================================= @@ -1067,3 +1089,4 @@ bool ComputePentahedralMesh(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) return bOK; } + diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.hxx b/src/StdMeshers/StdMeshers_Hexa_3D.hxx index 66d0c61ca..4fa9311c7 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.hxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -25,7 +25,6 @@ // Moved here from SMESH_Hexa_3D.hxx // Author : Paul RASCLE, EDF // Module : SMESH -// $Header$ #ifndef _SMESH_HEXA_3D_HXX_ #define _SMESH_HEXA_3D_HXX_ @@ -37,9 +36,11 @@ #include "StdMeshers_Quadrangle_2D.hxx" #include "Utils_SALOME_Exception.hxx" +#include "SMESH_MesherHelper.hxx" + typedef struct point3Dstruct { - const SMDS_MeshNode * node; + const SMDS_MeshNode * node; } Point3DStruct; typedef double Pt3[3]; @@ -60,25 +61,6 @@ typedef struct conv2dstruct int jc; } Conv2DStruct; -typedef struct cubeStruct -{ - TopoDS_Vertex V000; - TopoDS_Vertex V001; - TopoDS_Vertex V010; - TopoDS_Vertex V011; - TopoDS_Vertex V100; - TopoDS_Vertex V101; - TopoDS_Vertex V110; - TopoDS_Vertex V111; - faceQuadStruct* quad_X0; - faceQuadStruct* quad_X1; - faceQuadStruct* quad_Y0; - faceQuadStruct* quad_Y1; - faceQuadStruct* quad_Z0; - faceQuadStruct* quad_Z1; - Point3DStruct* np; // normalised 3D coordinates -} CubeStruct; - class STDMESHERS_EXPORT StdMeshers_Hexa_3D: public SMESH_3D_Algo { @@ -129,14 +111,7 @@ protected: Point3DStruct *np, const SMESHDS_Mesh* meshDS); - CubeStruct _cube; - FaceQuadStruct* _quads[6]; - int _indX0; - int _indX1; - int _indY0; - int _indY1; - int _indZ0; - int _indZ1; + bool ClearAndReturn(FaceQuadStruct* theQuads[6], const bool res); }; #endif diff --git a/src/StdMeshers/StdMeshers_LengthFromEdges.cxx b/src/StdMeshers/StdMeshers_LengthFromEdges.cxx index 55adccca7..e055a9247 100644 --- a/src/StdMeshers/StdMeshers_LengthFromEdges.cxx +++ b/src/StdMeshers/StdMeshers_LengthFromEdges.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_LengthFromEdges.hxx b/src/StdMeshers/StdMeshers_LengthFromEdges.hxx index de55cab86..7fa99ee5e 100644 --- a/src/StdMeshers/StdMeshers_LengthFromEdges.hxx +++ b/src/StdMeshers/StdMeshers_LengthFromEdges.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_LocalLength.cxx b/src/StdMeshers/StdMeshers_LocalLength.cxx index 90010a213..6fd6bbcf7 100644 --- a/src/StdMeshers/StdMeshers_LocalLength.cxx +++ b/src/StdMeshers/StdMeshers_LocalLength.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_LocalLength.hxx b/src/StdMeshers/StdMeshers_LocalLength.hxx index ce30c3440..79a85df7f 100644 --- a/src/StdMeshers/StdMeshers_LocalLength.hxx +++ b/src/StdMeshers/StdMeshers_LocalLength.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx index dbda4d1ca..49ac4365d 100644 --- a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx +++ b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -61,11 +61,6 @@ #include #include -#include - -using namespace std; -//#include - //============================================================================= /*! * @@ -73,19 +68,19 @@ using namespace std; //============================================================================= StdMeshers_MEFISTO_2D::StdMeshers_MEFISTO_2D(int hypId, int studyId, - SMESH_Gen * gen):SMESH_2D_Algo(hypId, studyId, gen) + SMESH_Gen * gen):SMESH_2D_Algo(hypId, studyId, gen) { - MESSAGE("StdMeshers_MEFISTO_2D::StdMeshers_MEFISTO_2D"); - _name = "MEFISTO_2D"; -// _shapeType = TopAbs_FACE; - _shapeType = (1 << TopAbs_FACE); - _compatibleHypothesis.push_back("MaxElementArea"); - _compatibleHypothesis.push_back("LengthFromEdges"); - - _edgeLength = 0; - _maxElementArea = 0; - _hypMaxElementArea = NULL; - _hypLengthFromEdges = NULL; + MESSAGE("StdMeshers_MEFISTO_2D::StdMeshers_MEFISTO_2D"); + _name = "MEFISTO_2D"; + _shapeType = (1 << TopAbs_FACE); + _compatibleHypothesis.push_back("MaxElementArea"); + _compatibleHypothesis.push_back("LengthFromEdges"); + + _edgeLength = 0; + _maxElementArea = 0; + _hypMaxElementArea = NULL; + _hypLengthFromEdges = NULL; + myTool = 0; } //============================================================================= @@ -96,7 +91,7 @@ StdMeshers_MEFISTO_2D::StdMeshers_MEFISTO_2D(int hypId, int studyId, StdMeshers_MEFISTO_2D::~StdMeshers_MEFISTO_2D() { - MESSAGE("StdMeshers_MEFISTO_2D::~StdMeshers_MEFISTO_2D"); + MESSAGE("StdMeshers_MEFISTO_2D::~StdMeshers_MEFISTO_2D"); } //============================================================================= @@ -185,112 +180,124 @@ bool StdMeshers_MEFISTO_2D::CheckHypothesis bool StdMeshers_MEFISTO_2D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) { - MESSAGE("StdMeshers_MEFISTO_2D::Compute"); + MESSAGE("StdMeshers_MEFISTO_2D::Compute"); - if (_hypLengthFromEdges) - _edgeLength = ComputeEdgeElementLength(aMesh, aShape); + if (_hypLengthFromEdges) + _edgeLength = ComputeEdgeElementLength(aMesh, aShape); + + bool isOk = false; + //const SMESHDS_Mesh * meshDS = aMesh.GetMeshDS(); + //SMESH_subMesh *theSubMesh = aMesh.GetSubMesh(aShape); - bool isOk = false; - //const SMESHDS_Mesh * meshDS = aMesh.GetMeshDS(); - //SMESH_subMesh *theSubMesh = aMesh.GetSubMesh(aShape); - - const TopoDS_Face & FF = TopoDS::Face(aShape); - bool faceIsForward = (FF.Orientation() == TopAbs_FORWARD); - TopoDS_Face F = TopoDS::Face(FF.Oriented(TopAbs_FORWARD)); - - Z nblf; //nombre de lignes fermees (enveloppe en tete) - Z *nudslf = NULL; //numero du dernier sommet de chaque ligne fermee - R2 *uvslf = NULL; - Z nbpti = 0; //nombre points internes futurs sommets de la triangulation - R2 *uvpti = NULL; - - Z nbst; - R2 *uvst = NULL; - Z nbt; - Z *nust = NULL; - Z ierr = 0; - - Z nutysu = 1; // 1: il existe un fonction areteideale_() - // Z nutysu=0; // 0: on utilise aretmx - R aretmx = _edgeLength; // longueur max aretes future triangulation - - nblf = NumberOfWires(F); - - nudslf = new Z[1 + nblf]; - nudslf[0] = 0; - int iw = 1; - int nbpnt = 0; - - myOuterWire = BRepTools::OuterWire(F); - nbpnt += NumberOfPoints(aMesh, myOuterWire); - if ( nbpnt < 3 ) // ex: a circle with 2 segments - return false; - nudslf[iw++] = nbpnt; - - for (TopExp_Explorer exp(F, TopAbs_WIRE); exp.More(); exp.Next()) - { - const TopoDS_Wire & W = TopoDS::Wire(exp.Current()); - if (!myOuterWire.IsSame(W)) - { - nbpnt += NumberOfPoints(aMesh, W); - nudslf[iw++] = nbpnt; - } - } + const TopoDS_Face & FF = TopoDS::Face(aShape); + bool faceIsForward = (FF.Orientation() == TopAbs_FORWARD); + TopoDS_Face F = TopoDS::Face(FF.Oriented(TopAbs_FORWARD)); - // avoid passing same uv points for a vertex common to 2 wires - TopTools_IndexedDataMapOfShapeListOfShape VWMap; - if ( iw - 1 > 1 ) // nbofWires > 1 - TopExp::MapShapesAndAncestors( F , TopAbs_VERTEX, TopAbs_WIRE, VWMap ); + Z nblf; //nombre de lignes fermees (enveloppe en tete) + Z *nudslf = NULL; //numero du dernier sommet de chaque ligne fermee + R2 *uvslf = NULL; + Z nbpti = 0; //nombre points internes futurs sommets de la triangulation + R2 *uvpti = NULL; + + Z nbst; + R2 *uvst = NULL; + Z nbt; + Z *nust = NULL; + Z ierr = 0; + + Z nutysu = 1; // 1: il existe un fonction areteideale_() + // Z nutysu=0; // 0: on utilise aretmx + R aretmx = _edgeLength; // longueur max aretes future triangulation + + nblf = NumberOfWires(F); + + nudslf = new Z[1 + nblf]; + nudslf[0] = 0; + int iw = 1; + int nbpnt = 0; + + myTool = new SMESH_MesherHelper(aMesh); + _quadraticMesh = myTool->IsQuadraticSubMesh(aShape); + + if ( _quadraticMesh && _hypLengthFromEdges ) + aretmx *= 2.; + + myOuterWire = BRepTools::OuterWire(F); + nbpnt += NumberOfPoints(aMesh, myOuterWire); + if ( nbpnt < 3 ) { // ex: a circle with 2 segments + delete myTool; myTool = 0; + return false; + } + nudslf[iw++] = nbpnt; - uvslf = new R2[nudslf[nblf]]; - int m = 0; + for (TopExp_Explorer exp(F, TopAbs_WIRE); exp.More(); exp.Next()) { + const TopoDS_Wire & W = TopoDS::Wire(exp.Current()); + if (!myOuterWire.IsSame(W)) { + nbpnt += NumberOfPoints(aMesh, W); + nudslf[iw++] = nbpnt; + } + } - double scalex, scaley; - ComputeScaleOnFace(aMesh, F, scalex, scaley); + // avoid passing same uv points for a vertex common to 2 wires + TopTools_IndexedDataMapOfShapeListOfShape VWMap; + if ( iw - 1 > 1 ) // nbofWires > 1 + TopExp::MapShapesAndAncestors( F , TopAbs_VERTEX, TopAbs_WIRE, VWMap ); - map mefistoToDS; // correspondence mefisto index--> points IDNodes - if ( !LoadPoints(aMesh, F, myOuterWire, uvslf, m, - mefistoToDS, scalex, scaley, VWMap)) - return false; + uvslf = new R2[nudslf[nblf]]; + int m = 0; - for (TopExp_Explorer exp(F, TopAbs_WIRE); exp.More(); exp.Next()) - { - const TopoDS_Wire & W = TopoDS::Wire(exp.Current()); - if (!myOuterWire.IsSame(W)) - { - if (! LoadPoints(aMesh, F, W, uvslf, m, - mefistoToDS, scalex, scaley, VWMap )) - return false; - } - } + double scalex, scaley; + ComputeScaleOnFace(aMesh, F, scalex, scaley); - uvst = NULL; - nust = NULL; - aptrte(nutysu, aretmx, - nblf, nudslf, uvslf, nbpti, uvpti, nbst, uvst, nbt, nust, ierr); - - if (ierr == 0) - { - MESSAGE("... End Triangulation Generated Triangle Number " << nbt); - MESSAGE(" Node Number " << nbst); - StoreResult(aMesh, nbst, uvst, nbt, nust, F, - faceIsForward, mefistoToDS, scalex, scaley); - isOk = true; - } - else - { - MESSAGE("Error in Triangulation"); - isOk = false; - } - if (nudslf != NULL) - delete[]nudslf; - if (uvslf != NULL) - delete[]uvslf; - if (uvst != NULL) - delete[]uvst; - if (nust != NULL) - delete[]nust; - return isOk; + map mefistoToDS; // correspondence mefisto index--> points IDNodes + if ( !LoadPoints(aMesh, F, myOuterWire, uvslf, m, + mefistoToDS, scalex, scaley, VWMap) ) { + delete myTool; myTool = 0; + return false; + } + + for (TopExp_Explorer exp(F, TopAbs_WIRE); exp.More(); exp.Next()) + { + const TopoDS_Wire & W = TopoDS::Wire(exp.Current()); + if (!myOuterWire.IsSame(W)) + { + if (! LoadPoints(aMesh, F, W, uvslf, m, + mefistoToDS, scalex, scaley, VWMap )) { + delete myTool; myTool = 0; + return false; + } + } + } + + uvst = NULL; + nust = NULL; + aptrte(nutysu, aretmx, + nblf, nudslf, uvslf, nbpti, uvpti, nbst, uvst, nbt, nust, ierr); + + if (ierr == 0) + { + MESSAGE("... End Triangulation Generated Triangle Number " << nbt); + MESSAGE(" Node Number " << nbst); + StoreResult(aMesh, nbst, uvst, nbt, nust, F, + faceIsForward, mefistoToDS, scalex, scaley); + isOk = true; + } + else + { + MESSAGE("Error in Triangulation"); + isOk = false; + } + if (nudslf != NULL) + delete[]nudslf; + if (uvslf != NULL) + delete[]uvslf; + if (uvst != NULL) + delete[]uvst; + if (nust != NULL) + delete[]nust; + delete myTool; myTool = 0; + + return isOk; } //======================================================================= @@ -355,7 +362,8 @@ static bool fixCommonVertexUV (gp_Pnt2d & theUV, const TopoDS_Wire& theOW, const TopoDS_Face& theF, const TopTools_IndexedDataMapOfShapeListOfShape & theVWMap, - SMESH_Mesh & theMesh) + SMESH_Mesh & theMesh, + bool CreateQuadratic) { if( theW.IsSame( theOW ) || !theVWMap.Contains( theV )) return false; @@ -418,10 +426,12 @@ static bool fixCommonVertexUV (gp_Pnt2d & theUV, umin = l; umax = f; } - else - { + else { while ( nIt->more() ) { const SMDS_MeshNode* node = nIt->next(); + // check if node is medium + if ( CreateQuadratic && SMESH_MesherHelper::IsMedium( node, SMDSAbs_Edge )) + continue; const SMDS_EdgePosition* epos = static_cast(node->GetPosition().get()); double u = epos->GetUParameter(); @@ -516,15 +526,17 @@ bool StdMeshers_MEFISTO_2D::LoadPoints(SMESH_Mesh & aMesh, while ( nodeIt->more() ) { node = nodeIt->next(); + if ( _quadraticMesh && SMESH_MesherHelper::IsMedium( node, SMDSAbs_Edge )) + continue; const SMDS_EdgePosition* epos = static_cast(node->GetPosition().get()); - params[ epos->GetUParameter() ] = node; - } - int nbPoints = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes(); - if ( nbPoints != params.size()) - { - MESSAGE( "BAD NODE ON EDGE POSITIONS" ); - return false; + double param = epos->GetUParameter(); + if ( !isForward ) param = -param; + if ( !params.insert( make_pair( param, node )).second ) + { + MESSAGE( "BAD NODE ON EDGE POSITIONS" ); + return false; + } } // --- load 2D values into MEFISTO structure, @@ -536,7 +548,7 @@ bool StdMeshers_MEFISTO_2D::LoadPoints(SMESH_Mesh & aMesh, // vertex node gp_Pnt2d p = C2d->Value( uFirst ).XY().Multiplied( scale ); - if ( fixCommonVertexUV( p, V, W, myOuterWire, F, VWMap, aMesh )) + if ( fixCommonVertexUV( p, V, W, myOuterWire, F, VWMap, aMesh, _quadraticMesh )) myNodesOnCommonV.push_back( idFirst ); mOnVertex.push_back( m ); uvslf[m].x = p.X(); @@ -548,22 +560,13 @@ bool StdMeshers_MEFISTO_2D::LoadPoints(SMESH_Mesh & aMesh, // internal nodes map::iterator u_n = params.begin(); - map::reverse_iterator u_n_rev = params.rbegin(); - for ( int i = 0; i < nbPoints; ++i ) + for ( int i = 0; u_n != params.end(); ++u_n, ++i ) { - if ( isForward ) { - u = u_n->first; - node = u_n->second; - ++u_n; - } else { - u = u_n_rev->first; - node = u_n_rev->second; - ++u_n_rev; - } + u = isForward ? u_n->first : - u_n->first; gp_Pnt2d p = C2d->Value( u ).XY().Multiplied( scale ); uvslf[m].x = p.X(); uvslf[m].y = p.Y(); - mefistoToDS[m + 1] = node; + mefistoToDS[m + 1] = u_n->second; //MESSAGE(" "<AddFace(n1, n2, n3); + //elt = meshDS->AddFace(n1, n2, n3); + elt = myTool->AddFace(n1, n2, n3); else - elt = meshDS->AddFace(n1, n3, n2); + //elt = meshDS->AddFace(n1, n3, n2); + elt = myTool->AddFace(n1, n3, n2); meshDS->SetMeshElementOnShape(elt, faceID); m++; } - // remove bad elements build on vertices shared by wires + // remove bad elements built on vertices shared by wires list::iterator itN = myNodesOnCommonV.begin(); for ( ; itN != myNodesOnCommonV.end(); itN++ ) @@ -780,17 +777,14 @@ double StdMeshers_MEFISTO_2D::ComputeEdgeElementLength(SMESH_Mesh & aMesh, //MESSAGE("StdMeshers_MEFISTO_2D::ComputeEdgeElementLength"); // **** a mettre dans SMESH_2D_Algo ? - const TopoDS_Face & FF = TopoDS::Face(aShape); + //const TopoDS_Face & FF = TopoDS::Face(aShape); //bool faceIsForward = (FF.Orientation() == TopAbs_FORWARD); - TopoDS_Face F = TopoDS::Face(FF.Oriented(TopAbs_FORWARD)); + //TopoDS_Face F = TopoDS::Face(FF.Oriented(TopAbs_FORWARD)); double meanElementLength = 100; double wireLength = 0; int wireElementsNumber = 0; - for (TopExp_Explorer exp(F, TopAbs_WIRE); exp.More(); exp.Next()) - { - const TopoDS_Wire & W = TopoDS::Wire(exp.Current()); - for (TopExp_Explorer expe(W, TopAbs_EDGE); expe.More(); expe.Next()) + for (TopExp_Explorer expe(aShape, TopAbs_EDGE); expe.More(); expe.Next()) { const TopoDS_Edge & E = TopoDS::Edge(expe.Current()); int nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes(); @@ -798,7 +792,6 @@ double StdMeshers_MEFISTO_2D::ComputeEdgeElementLength(SMESH_Mesh & aMesh, wireLength += length; wireElementsNumber += nb; } - } if (wireElementsNumber) meanElementLength = wireLength / wireElementsNumber; //SCRUTE(meanElementLength); diff --git a/src/StdMeshers/StdMeshers_MEFISTO_2D.hxx b/src/StdMeshers/StdMeshers_MEFISTO_2D.hxx index 7ffad59c7..f9601490f 100644 --- a/src/StdMeshers/StdMeshers_MEFISTO_2D.hxx +++ b/src/StdMeshers/StdMeshers_MEFISTO_2D.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -35,6 +35,8 @@ #include "SMESH_2D_Algo.hxx" #include +#include "SMESH_MesherHelper.hxx" + class SMDS_MeshNode; class TopTools_IndexedDataMapOfShapeListOfShape; class TopoDS_Face; @@ -97,6 +99,8 @@ protected: TopoDS_Wire myOuterWire; std::list myNodesOnCommonV; + + SMESH_MesherHelper* myTool; // toll for working with quadratic elements }; #endif diff --git a/src/StdMeshers/StdMeshers_MaxElementArea.cxx b/src/StdMeshers/StdMeshers_MaxElementArea.cxx index 08c69e68b..f02d21e9e 100644 --- a/src/StdMeshers/StdMeshers_MaxElementArea.cxx +++ b/src/StdMeshers/StdMeshers_MaxElementArea.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_MaxElementArea.hxx b/src/StdMeshers/StdMeshers_MaxElementArea.hxx index c5e18996f..e8e33aa1a 100644 --- a/src/StdMeshers/StdMeshers_MaxElementArea.hxx +++ b/src/StdMeshers/StdMeshers_MaxElementArea.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_MaxElementVolume.cxx b/src/StdMeshers/StdMeshers_MaxElementVolume.cxx index 679ccb4c5..42b8b469e 100644 --- a/src/StdMeshers/StdMeshers_MaxElementVolume.cxx +++ b/src/StdMeshers/StdMeshers_MaxElementVolume.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_MaxElementVolume.hxx b/src/StdMeshers/StdMeshers_MaxElementVolume.hxx index 7def314df..16dc5a604 100644 --- a/src/StdMeshers/StdMeshers_MaxElementVolume.hxx +++ b/src/StdMeshers/StdMeshers_MaxElementVolume.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_NotConformAllowed.cxx b/src/StdMeshers/StdMeshers_NotConformAllowed.cxx index 4448ef4ca..7e0bd11cb 100644 --- a/src/StdMeshers/StdMeshers_NotConformAllowed.cxx +++ b/src/StdMeshers/StdMeshers_NotConformAllowed.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_NotConformAllowed.hxx b/src/StdMeshers/StdMeshers_NotConformAllowed.hxx index 2d5fc7608..5cbbb4265 100644 --- a/src/StdMeshers/StdMeshers_NotConformAllowed.hxx +++ b/src/StdMeshers/StdMeshers_NotConformAllowed.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx index 139ea22e6..76cd67965 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -33,20 +33,16 @@ #include "SMESHDS_SubMesh.hxx" #include "SMESH_Mesh.hxx" -#include -#include -#include +#include "CASCatch.hxx" + #include #include #include -#include #include #include #include #include -#include - using namespace std; const double PRECISION = 1e-7; @@ -174,8 +170,8 @@ void StdMeshers_NumberOfSegments::SetScaleFactor(double scaleFactor) throw SALOME_Exception(LOCALIZED("not a scale distribution")); if (scaleFactor < PRECISION) throw SALOME_Exception(LOCALIZED("scale factor must be positive")); - if (fabs(scaleFactor - 1.0) < PRECISION) - throw SALOME_Exception(LOCALIZED("scale factor must not be equal to 1")); + //if (fabs(scaleFactor - 1.0) < PRECISION) + // throw SALOME_Exception(LOCALIZED("scale factor must not be equal to 1")); if (fabs(_scaleFactor - scaleFactor) > PRECISION) { @@ -216,10 +212,6 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const std::vector& ta double prev = -PRECISION; bool isSame = table.size() == _table.size(); - OSD::SetSignal( true ); - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - bool pos = false; for (i=0; i < table.size()/2; i++) { double par = table[i*2]; @@ -230,10 +222,9 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const std::vector& ta { val = pow( 10.0, val ); } - CASCatch_CATCH(CASCatch_Failure) + CASCatch_CATCH(Standard_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); throw SALOME_Exception( LOCALIZED( "invalid value")); return; } @@ -258,7 +249,6 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const std::vector& ta } prev = par; } - aCatchSignals.Deactivate(); if( !pos ) throw SALOME_Exception(LOCALIZED("value of table function is not positive")); @@ -320,10 +310,6 @@ bool process( const TCollection_AsciiString& str, int convMode, bool& non_neg, bool& non_zero, bool& singulars, double& sing_point ) { - OSD::SetSignal( true ); - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - bool parsed_ok = true; Handle( ExprIntrp_GenExp ) myExpr; CASCatch_TRY @@ -331,13 +317,11 @@ bool process( const TCollection_AsciiString& str, int convMode, myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( str.ToCString() ); } - CASCatch_CATCH(CASCatch_Failure) + CASCatch_CATCH(Standard_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); parsed_ok = false; } - aCatchSignals.Deactivate(); syntax = false; args = false; diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.hxx b/src/StdMeshers/StdMeshers_NumberOfSegments.hxx index 664bf13da..b967dc933 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.hxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_Penta_3D.cxx b/src/StdMeshers/StdMeshers_Penta_3D.cxx index ad6ebc831..ec2755317 100644 --- a/src/StdMeshers/StdMeshers_Penta_3D.cxx +++ b/src/StdMeshers/StdMeshers_Penta_3D.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -51,6 +51,9 @@ #include #include #include +#include +#include +#include #include #include @@ -70,7 +73,20 @@ StdMeshers_Penta_3D::StdMeshers_Penta_3D() myTol3D=0.1; myWallNodesMaps.resize( SMESH_Block::NbFaces() ); myShapeXYZ.resize( SMESH_Block::NbSubShapes() ); + myTool = 0; } + +//======================================================================= +//function : ~StdMeshers_Penta_3D +//purpose : +//======================================================================= + +StdMeshers_Penta_3D::~StdMeshers_Penta_3D() +{ + if ( myTool ) + delete myTool; +} + //======================================================================= //function : Compute //purpose : @@ -91,33 +107,43 @@ bool StdMeshers_Penta_3D::Compute(SMESH_Mesh& aMesh, if (myErrorStatus){ return bOK; } + + myTool = new SMESH_MesherHelper(aMesh); + myCreateQuadratic = myTool->IsQuadraticSubMesh(aShape); + // MakeBlock(); - if (myErrorStatus){ + if (myErrorStatus){ + delete myTool; myTool = 0; + return bOK; + } + // + ClearMeshOnFxy1(); + if (myErrorStatus) { + delete myTool; myTool = 0; return bOK; } // MakeNodes(); if (myErrorStatus){ + delete myTool; myTool = 0; return bOK; } // MakeConnectingMap(); // - ClearMeshOnFxy1(); - if (myErrorStatus) { - return bOK; - } - // MakeMeshOnFxy1(); if (myErrorStatus) { + delete myTool; myTool = 0; return bOK; } // MakeVolumeMesh(); // + delete myTool; myTool = 0; return !bOK; } + //======================================================================= //function : MakeNodes //purpose : @@ -144,12 +170,24 @@ void StdMeshers_Penta_3D::MakeNodes() // 1.1 Horizontal size myJSize=0; for (i=0; iGetSubMeshContaining(aS); ASSERT(aSubMesh); - SMESHDS_SubMesh *aSM=aSubMesh->GetSubMeshDS(); - iNbN=aSM->NbNodes(); - myJSize+=iNbN; + SMESHDS_SubMesh *aSM = aSubMesh->GetSubMeshDS(); + if(!myCreateQuadratic) { + iNbN = aSM->NbNodes(); + } + else { + iNbN = 0; + SMDS_NodeIteratorPtr itn = aSM->GetNodes(); + while(itn->more()) { + const SMDS_MeshNode* aNode = itn->next(); + if(myTool->IsMedium(aNode)) + continue; + iNbN++; + } + } + myJSize += iNbN; } //printf("*** Horizontal: number of nodes summary=%d\n", myJSize); // @@ -159,9 +197,21 @@ void StdMeshers_Penta_3D::MakeNodes() const TopoDS_Shape& aS=myBlock.Shape(SMESH_Block::ID_E00z); SMESH_subMesh *aSubMesh = pMesh->GetSubMeshContaining(aS); ASSERT(aSubMesh); - SMESHDS_SubMesh *aSM=aSubMesh->GetSubMeshDS(); - iNbN=aSM->NbNodes(); - myISize+=iNbN; + SMESHDS_SubMesh *aSM = aSubMesh->GetSubMeshDS(); + if(!myCreateQuadratic) { + iNbN = aSM->NbNodes(); + } + else { + iNbN = 0; + SMDS_NodeIteratorPtr itn = aSM->GetNodes(); + while(itn->more()) { + const SMDS_MeshNode* aNode = itn->next(); + if(myTool->IsMedium(aNode)) + continue; + iNbN++; + } + } + myISize += iNbN; } //printf("*** Vertical: number of nodes on edges and vertices=%d\n", myISize); // @@ -177,18 +227,19 @@ void StdMeshers_Penta_3D::MakeNodes() // vertices for (k=0; kGetSubMeshContaining(aS)->GetSubMeshDS()->GetNodes(); + const TopoDS_Shape& aS = myBlock.Shape(aSID); + SMDS_NodeIteratorPtr ite = pMesh->GetSubMeshContaining(aS)->GetSubMeshDS()->GetNodes(); while(ite->more()) { const SMDS_MeshNode* aNode = ite->next(); + if(myTool->IsMedium(aNode)) + continue; aNodeID=aNode->GetID(); // aTNode.SetNode(aNode); aTNode.SetShapeSupportID(aSID); aTNode.SetBaseNodeID(aNodeID); // - if ( SMESH_Block::IsEdgeID (aSID)) - { + if ( SMESH_Block::IsEdgeID (aSID)) { const SMDS_EdgePosition* epos = static_cast(aNode->GetPosition().get()); myBlock.ComputeParameters( epos->GetUParameter(), aS, aCoords ); @@ -200,7 +251,7 @@ void StdMeshers_Penta_3D::MakeNodes() aP3D.SetCoord(aX, aY, aZ); myBlock.ComputeParameters(aP3D, aS, aCoords); } - iErr=myBlock.ErrorStatus(); + iErr = myBlock.ErrorStatus(); if (iErr) { MESSAGE("StdMeshers_Penta_3D::MakeNodes()," << "SMESHBlock: ComputeParameters operation failed"); @@ -325,8 +376,7 @@ void StdMeshers_Penta_3D::MakeNodes() // 3.3 set XYZ of vertices, and initialize of the rest SMESHDS_Mesh* aMesh = GetMesh()->GetMeshDS(); - for ( int id = SMESH_Block::ID_V000; id < SMESH_Block::ID_Shell; ++id ) - { + for ( int id = SMESH_Block::ID_V000; id < SMESH_Block::ID_Shell; ++id ) { if ( SMESH_Block::IsVertexID( id )) { TopoDS_Shape V = myBlock.Shape( id ); SMESHDS_SubMesh* sm = aMesh->MeshElements( V ); @@ -344,23 +394,46 @@ void StdMeshers_Penta_3D::MakeNodes() SMESH_Block::TShapeID aSSID, aBNSSID; StdMeshers_TNode aTN; // - for (j=0; jGetMeshDS(); + int topfaceID = meshDS->ShapeToIndex(TopFace); + const TopoDS_Vertex& v001 = TopoDS::Vertex(myBlock.Shape(SMESH_Block::ID_V001)); + SMDS_NodeIteratorPtr itn = pMesh->GetSubMeshContaining(v001)->GetSubMeshDS()->GetNodes(); + const SMDS_MeshNode* N = itn->next(); + gp_XY UV001 = myTool->GetNodeUV(TopFace,N); + const TopoDS_Vertex& v101 = TopoDS::Vertex(myBlock.Shape(SMESH_Block::ID_V101)); + itn = pMesh->GetSubMeshContaining(v101)->GetSubMeshDS()->GetNodes(); + N = itn->next(); + gp_XY UV101 = myTool->GetNodeUV(TopFace,N); + const TopoDS_Vertex& v011 = TopoDS::Vertex(myBlock.Shape(SMESH_Block::ID_V011)); + itn = pMesh->GetSubMeshContaining(v011)->GetSubMeshDS()->GetNodes(); + N = itn->next(); + gp_XY UV011 = myTool->GetNodeUV(TopFace,N); + const TopoDS_Vertex& v111 = TopoDS::Vertex(myBlock.Shape(SMESH_Block::ID_V111)); + itn = pMesh->GetSubMeshContaining(v111)->GetSubMeshDS()->GetNodes(); + N = itn->next(); + gp_XY UV111 = myTool->GetNodeUV(TopFace,N); + + for (j=0; j* nColumns[8]; double ratio[4]; // base node position between columns [0.-1.] - if ( createNode ) - for ( k = 0; k < 4; ++k ) + if ( createNode ) { + for ( k = 0; k < 4; ++k ) { ratio[ k ] = SetHorizEdgeXYZ (aBNXYZ, wallFaceID[ k ], nColumns[k*2], nColumns[k*2+1]); + } + } // // XYZ on the bottom and top faces const SMDS_MeshNode* n = aBN.Node(); @@ -368,8 +441,9 @@ void StdMeshers_Penta_3D::MakeNodes() myShapeXYZ[ SMESH_Block::ID_Fxy1 ].SetCoord( 0., 0., 0. ); // // first create or find a top node, then the rest ones in a column - for (i=myISize-1; i>0; --i) - { + for (i=myISize-1; i>0; --i) { + bIsUpperLayer = (i==(myISize-1)); + gp_XY UV_Ex01, UV_Ex11, UV_E0y1, UV_E1y1; if ( createNode ) { // set XYZ on vertical edges and faces for ( k = 0; k < 4; ++k ) { @@ -377,11 +451,28 @@ void StdMeshers_Penta_3D::MakeNodes() myShapeXYZ[ verticEdgeID[ k ] ].SetCoord( n->X(), n->Y(), n->Z() ); // n = (*nColumns[k*2]) [ i ]; + gp_XY tmp1; + if( i==myISize-1 ) { + tmp1 = myTool->GetNodeUV(TopFace,n); + tmp1 = ( 1. - ratio[ k ]) * tmp1; + } gp_XYZ xyz( n->X(), n->Y(), n->Z() ); myShapeXYZ[ wallFaceID[ k ]] = ( 1. - ratio[ k ]) * xyz; n = (*nColumns[k*2+1]) [ i ]; xyz.SetCoord( n->X(), n->Y(), n->Z() ); myShapeXYZ[ wallFaceID[ k ]] += ratio[ k ] * xyz; + if( i==myISize-1 ) { + gp_XY tmp2 = myTool->GetNodeUV(TopFace,n); + tmp1 += ratio[ k ] * tmp2; + if( k==0 ) + UV_Ex01 = tmp1; + else if( k==1 ) + UV_Ex11 = tmp1; + else if( k==2 ) + UV_E0y1 = tmp1; + else + UV_E1y1 = tmp1; + } } } // fill current node info @@ -395,7 +486,6 @@ void StdMeshers_Penta_3D::MakeNodes() aCoords.SetCoord(aX, aY, aZ); // // suporting shape ID - bIsUpperLayer=(i==(myISize-1)); ShapeSupportID(bIsUpperLayer, aBNSSID, aSSID); if (myErrorStatus) { MESSAGE("StdMeshers_Penta_3D::MakeNodes() "); @@ -418,6 +508,30 @@ void StdMeshers_Penta_3D::MakeNodes() if ( bIsUpperLayer ) { const SMDS_MeshNode* n = aTN.Node(); myShapeXYZ[ SMESH_Block::ID_Fxy1 ].SetCoord( n->X(), n->Y(), n->Z() ); + // set node on top face: + // find UV parameter for this node + // UV_Ex11 + // UV011+-----+----------+UV111 + // | | + // | | + // UV_E0y1+ +node +UV_E1y1 + // | | + // | | + // | | + // UV001+-----+----------+UV101 + // UV_Ex01 + gp_Pnt2d aP; + double u = aCoords.X(), v = aCoords.Y(); + double u1 = ( 1. - u ), v1 = ( 1. - v ); + aP.ChangeCoord() = UV_Ex01 * v1; + aP.ChangeCoord() += UV_Ex11 * v; + aP.ChangeCoord() += UV_E0y1 * u1; + aP.ChangeCoord() += UV_E1y1 * u; + aP.ChangeCoord() -= UV001 * u1 * v1; + aP.ChangeCoord() -= UV101 * u * v1; + aP.ChangeCoord() -= UV011 * u1 * v; + aP.ChangeCoord() -= UV111 * u * v; + meshDS->SetNodeOnFace((SMDS_MeshNode*)n, topfaceID, aP.X(), aP.Y()); } } if (myErrorStatus) { @@ -456,10 +570,13 @@ void StdMeshers_Penta_3D::MakeNodes() */ //DEB t } + + //======================================================================= //function : FindNodeOnShape //purpose : //======================================================================= + void StdMeshers_Penta_3D::FindNodeOnShape(const TopoDS_Shape& aS, const gp_XYZ& aParams, const int z, @@ -470,14 +587,13 @@ void StdMeshers_Penta_3D::FindNodeOnShape(const TopoDS_Shape& aS, double aX, aY, aZ, aD, aTol2, minD; gp_Pnt aP1, aP2; // - SMESH_Mesh* pMesh=GetMesh(); - aTol2=myTol3D*myTol3D; + SMESH_Mesh* pMesh = GetMesh(); + aTol2 = myTol3D*myTol3D; minD = 1.e100; - SMDS_MeshNode* pNode=NULL; + SMDS_MeshNode* pNode = NULL; // if ( aS.ShapeType() == TopAbs_FACE || - aS.ShapeType() == TopAbs_EDGE ) - { + aS.ShapeType() == TopAbs_EDGE ) { // find a face ID to which aTN belongs to int faceID; if ( aS.ShapeType() == TopAbs_FACE ) @@ -492,13 +608,13 @@ void StdMeshers_Penta_3D::FindNodeOnShape(const TopoDS_Shape& aS, } ASSERT( SMESH_Block::IsFaceID( faceID )); int fIndex = SMESH_Block::ShapeIndex( faceID ); - StdMeshers_IJNodeMap & ijNodes= myWallNodesMaps[ fIndex ]; + StdMeshers_IJNodeMap & ijNodes = myWallNodesMaps[ fIndex ]; // look for a base node in ijNodes const SMDS_MeshNode* baseNode = pMesh->GetMeshDS()->FindNode( aTN.BaseNodeID() ); StdMeshers_IJNodeMap::const_iterator par_nVec = ijNodes.begin(); for ( ; par_nVec != ijNodes.end(); par_nVec++ ) if ( par_nVec->second[ 0 ] == baseNode ) { - pNode=(SMDS_MeshNode*)par_nVec->second.at( z ); + pNode = (SMDS_MeshNode*)par_nVec->second.at( z ); aTN.SetNode(pNode); return; } @@ -510,6 +626,8 @@ void StdMeshers_Penta_3D::FindNodeOnShape(const TopoDS_Shape& aS, pMesh->GetSubMeshContaining(aS)->GetSubMeshDS()->GetNodes(); while(ite->more()) { const SMDS_MeshNode* aNode = ite->next(); + if(myTool->IsMedium(aNode)) + continue; aX=aNode->X(); aY=aNode->Y(); aZ=aNode->Z(); @@ -532,6 +650,7 @@ void StdMeshers_Penta_3D::FindNodeOnShape(const TopoDS_Shape& aS, //myErrorStatus=11; // can not find the node; } + //======================================================================= //function : SetHorizEdgeXYZ //purpose : @@ -583,6 +702,7 @@ double StdMeshers_Penta_3D::SetHorizEdgeXYZ(const gp_XYZ& aBase return r; } + //======================================================================= //function : MakeVolumeMesh //purpose : @@ -593,20 +713,20 @@ void StdMeshers_Penta_3D::MakeVolumeMesh() // int i, j, ij, ik, i1, i2, aSSID; // - SMESH_Mesh* pMesh =GetMesh(); - SMESHDS_Mesh* meshDS=pMesh->GetMeshDS(); + SMESH_Mesh* pMesh = GetMesh(); + SMESHDS_Mesh* meshDS = pMesh->GetMeshDS(); // int shapeID = meshDS->ShapeToIndex( myShape ); // // 1. Set Node In Volume - ik=myISize-1; + ik = myISize-1; for (i=1; iSetNodeInVolume(aNode, shapeID); } } @@ -621,22 +741,28 @@ void StdMeshers_Penta_3D::MakeVolumeMesh() const TopoDS_Face& aFxy0= TopoDS::Face(myBlock.Shape(SMESH_Block::ID_Fxy0)); SMESH_subMesh *aSubMesh0 = pMesh->GetSubMeshContaining(aFxy0); - SMESHDS_SubMesh *aSM0=aSubMesh0->GetSubMeshDS(); + SMESHDS_SubMesh *aSM0 = aSubMesh0->GetSubMeshDS(); // - itf=aSM0->GetElements(); + itf = aSM0->GetElements(); while(itf->more()) { - const SMDS_MeshElement* pE0=itf->next(); + const SMDS_MeshElement* pE0 = itf->next(); // int nbFaceNodes = pE0->NbNodes(); + if(myCreateQuadratic) + nbFaceNodes = nbFaceNodes/2; if ( aN.size() < nbFaceNodes * 2 ) aN.resize( nbFaceNodes * 2 ); // k=0; aItNodes=pE0->nodesIterator(); while (aItNodes->more()) { - const SMDS_MeshElement* pNode=aItNodes->next(); - aID0=pNode->GetID(); - aJ[k]=GetIndexOnLayer(aID0); + //const SMDS_MeshElement* pNode = aItNodes->next(); + const SMDS_MeshNode* pNode = + static_cast (aItNodes->next()); + if(myTool->IsMedium(pNode)) + continue; + aID0 = pNode->GetID(); + aJ[k] = GetIndexOnLayer(aID0); if (myErrorStatus) { MESSAGE("StdMeshers_Penta_3D::MakeVolumeMesh"); return; @@ -646,19 +772,19 @@ void StdMeshers_Penta_3D::MakeVolumeMesh() } // bool forward = true; - for (i=0; iAddVolume(aN[0], aN[1], aN[2], - aN[3], aN[4], aN[5]); - else - aV = meshDS->AddVolume(aN[0], aN[2], aN[1], - aN[3], aN[5], aN[4]); + if ( forward ) { + //aV = meshDS->AddVolume(aN[0], aN[1], aN[2], + // aN[3], aN[4], aN[5]); + aV = myTool->AddVolume(aN[0], aN[1], aN[2], aN[3], aN[4], aN[5]); + } + else { + //aV = meshDS->AddVolume(aN[0], aN[2], aN[1], + // aN[3], aN[5], aN[4]); + aV = myTool->AddVolume(aN[0], aN[2], aN[1], aN[3], aN[5], aN[4]); + } break; case 4: - if ( forward ) - aV = meshDS->AddVolume(aN[0], aN[1], aN[2], aN[3], + if ( forward ) { + //aV = meshDS->AddVolume(aN[0], aN[1], aN[2], aN[3], + // aN[4], aN[5], aN[6], aN[7]); + aV = myTool->AddVolume(aN[0], aN[1], aN[2], aN[3], aN[4], aN[5], aN[6], aN[7]); - else - aV = meshDS->AddVolume(aN[0], aN[3], aN[2], aN[1], + } + else { + //aV = meshDS->AddVolume(aN[0], aN[3], aN[2], aN[1], + // aN[4], aN[7], aN[6], aN[5]); + aV = myTool->AddVolume(aN[0], aN[3], aN[2], aN[1], aN[4], aN[7], aN[6], aN[5]); + } break; default: continue; @@ -727,74 +863,68 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1() const TopoDS_Face& aFxy1= TopoDS::Face(myBlock.Shape(SMESH_Block::ID_Fxy1)); // - SMESH_Mesh* pMesh=GetMesh(); + SMESH_Mesh* pMesh = GetMesh(); SMESHDS_Mesh * meshDS = pMesh->GetMeshDS(); // SMESH_subMesh *aSubMesh0 = pMesh->GetSubMeshContaining(aFxy0); - SMESHDS_SubMesh *aSM0=aSubMesh0->GetSubMeshDS(); + SMESHDS_SubMesh *aSM0 = aSubMesh0->GetSubMeshDS(); // // set nodes on aFxy1 - aLevel=myISize-1; - itn=aSM0->GetNodes(); - aNbNodes=aSM0->NbNodes(); + aLevel = myISize-1; + itn = aSM0->GetNodes(); + aNbNodes = aSM0->NbNodes(); //printf("** aNbNodes=%d\n", aNbNodes); - while(itn->more()) { - const SMDS_MeshNode* aN0=itn->next(); - aID0=aN0->GetID(); - aJ=GetIndexOnLayer(aID0); - if (myErrorStatus) { - MESSAGE("StdMeshers_Penta_3D::MakeMeshOnFxy1() "); - return; - } - // - ij=aLevel*myJSize+aJ; - const StdMeshers_TNode& aTN1=myTNodes[ij]; - SMDS_MeshNode* aN1=(SMDS_MeshNode*)aTN1.Node(); - // - meshDS->SetNodeOnFace(aN1, aFxy1); - } + // // set elements on aFxy1 vector aNodes1; // - itf=aSM0->GetElements(); + itf = aSM0->GetElements(); while(itf->more()) { - const SMDS_MeshElement * pE0=itf->next(); - aElementType=pE0->GetType(); + const SMDS_MeshElement* pE0 = itf->next(); + aElementType = pE0->GetType(); if (!aElementType==SMDSAbs_Face) { continue; } - aNbNodes=pE0->NbNodes(); + aNbNodes = pE0->NbNodes(); + if(myCreateQuadratic) + aNbNodes = aNbNodes/2; // if (aNbNodes!=3) { // continue; // } if ( aNodes1.size() < aNbNodes ) aNodes1.resize( aNbNodes ); // - k=aNbNodes-1; // reverse a face - aItNodes=pE0->nodesIterator(); + k = aNbNodes-1; // reverse a face + aItNodes = pE0->nodesIterator(); while (aItNodes->more()) { - const SMDS_MeshElement* pNode=aItNodes->next(); - aID0=pNode->GetID(); - aJ=GetIndexOnLayer(aID0); + //const SMDS_MeshElement* pNode = aItNodes->next(); + const SMDS_MeshNode* pNode = + static_cast (aItNodes->next()); + if(myTool->IsMedium(pNode)) + continue; + aID0 = pNode->GetID(); + aJ = GetIndexOnLayer(aID0); if (myErrorStatus) { MESSAGE("StdMeshers_Penta_3D::MakeMeshOnFxy1() "); return; } // - ij=aLevel*myJSize+aJ; - const StdMeshers_TNode& aTN1=myTNodes[ij]; - const SMDS_MeshNode* aN1=aTN1.Node(); - aNodes1[k]=aN1; + ij = aLevel*myJSize + aJ; + const StdMeshers_TNode& aTN1 = myTNodes[ij]; + const SMDS_MeshNode* aN1 = aTN1.Node(); + aNodes1[k] = aN1; --k; } SMDS_MeshFace * face = 0; switch ( aNbNodes ) { case 3: - face = meshDS->AddFace(aNodes1[0], aNodes1[1], aNodes1[2]); + //face = meshDS->AddFace(aNodes1[0], aNodes1[1], aNodes1[2]); + face = myTool->AddFace(aNodes1[0], aNodes1[1], aNodes1[2]); break; case 4: - face = meshDS->AddFace(aNodes1[0], aNodes1[1], aNodes1[2], aNodes1[3]); + //face = meshDS->AddFace(aNodes1[0], aNodes1[1], aNodes1[2], aNodes1[3]); + face = myTool->AddFace(aNodes1[0], aNodes1[1], aNodes1[2], aNodes1[3]); break; default: continue; @@ -802,6 +932,7 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1() meshDS->SetMeshElementOnShape(face, aFxy1); } } + //======================================================================= //function : ClearMeshOnFxy1 //purpose : @@ -838,6 +969,7 @@ int StdMeshers_Penta_3D::GetIndexOnLayer(const int aID) j=(*aMapIt).second; return j; } + //======================================================================= //function : MakeConnectingMap //purpose : @@ -852,6 +984,7 @@ void StdMeshers_Penta_3D::MakeConnectingMap() myConnectingMap[aBNID]=j; } } + //======================================================================= //function : CreateNode //purpose : @@ -879,8 +1012,7 @@ void StdMeshers_Penta_3D::CreateNode(const bool bIsUpperLayer, // // point inside solid // myBlock.Point(aParams, aP); // } - if (bIsUpperLayer) - { + if (bIsUpperLayer) { double u = aParams.X(), v = aParams.Y(); double u1 = ( 1. - u ), v1 = ( 1. - v ); aP.ChangeCoord() = myShapeXYZ[ SMESH_Block::ID_Ex01 ] * v1; @@ -893,8 +1025,7 @@ void StdMeshers_Penta_3D::CreateNode(const bool bIsUpperLayer, aP.ChangeCoord() -= myShapeXYZ[ SMESH_Block::ID_V011 ] * u1 * v; aP.ChangeCoord() -= myShapeXYZ[ SMESH_Block::ID_V111 ] * u * v; } - else - { + else { SMESH_Block::ShellPoint( aParams, myShapeXYZ, aP.ChangeCoord() ); } // @@ -906,12 +1037,14 @@ void StdMeshers_Penta_3D::CreateNode(const bool bIsUpperLayer, // aX=aP.X(); aY=aP.Y(); aZ=aP.Z(); // - SMESH_Mesh* pMesh=GetMesh(); - SMESHDS_Mesh* pMeshDS=pMesh->GetMeshDS(); + SMESH_Mesh* pMesh = GetMesh(); + SMESHDS_Mesh* pMeshDS = pMesh->GetMeshDS(); // pNode = pMeshDS->AddNode(aX, aY, aZ); + aTN.SetNode(pNode); } + //======================================================================= //function : ShapeSupportID //purpose : @@ -980,32 +1113,192 @@ void StdMeshers_Penta_3D::MakeBlock() SMDSAbs_ElementType aElementType; SMESH_Mesh* pMesh=GetMesh(); // - iCnt=0; - iNbF=aM.Extent(); + iCnt = 0; + iNbF = aM.Extent(); for (i=1; i<=iNbF; ++i) { - const TopoDS_Shape& aF=aM(i); + const TopoDS_Shape& aF = aM(i); SMESH_subMesh *aSubMesh = pMesh->GetSubMeshContaining(aF); ASSERT(aSubMesh); - SMESHDS_SubMesh *aSM=aSubMesh->GetSubMeshDS(); - SMDS_ElemIteratorPtr itf=aSM->GetElements(); + SMESHDS_SubMesh *aSM = aSubMesh->GetSubMeshDS(); + SMDS_ElemIteratorPtr itf = aSM->GetElements(); while(itf->more()) { - const SMDS_MeshElement * pElement=itf->next(); - aElementType=pElement->GetType(); + const SMDS_MeshElement * pElement = itf->next(); + aElementType = pElement->GetType(); if (aElementType==SMDSAbs_Face) { - iNbNodes=pElement->NbNodes(); - if (iNbNodes==3) { - aFTr=aF; + iNbNodes = pElement->NbNodes(); + if ( iNbNodes==3 || (myCreateQuadratic && iNbNodes==6) ) { + aFTr = aF; ++iCnt; if (iCnt>1) { - MESSAGE("StdMeshers_Penta_3D::MakeBlock() "); - myErrorStatus=5; // more than one face has triangulation - return; + // \begin{E.A.} + // The current algorithm fails if there is more that one + // face wich contains triangles ... + // In that case, replace return by break to try another + // method (coded in "if (iCnt != 1) { ... }") + // + // MESSAGE("StdMeshers_Penta_3D::MakeBlock() "); + // myErrorStatus=5; // more than one face has triangulation + // return; + break; + // \end{E.A.} } break; // next face } } } } + // + // \begin{E.A.} + // The current algorithm fails if "iCnt != 1", the case "iCnt == 0" + // was not reached 'cause it was not called from Hexa_3D ... Now it + // can occurs and in my opinion, it is the most common case. + // + if (iCnt != 1) { + // The suggested algorithm is the following : + // + // o Check that nb_of_faces == 6 and nb_of_edges == 12 + // then the shape is tologically equivalent to a box + // o In a box, there are three set of four // edges ... + // In the cascade notation, it seems to be the edges + // numbered : + // - 1, 3, 5, 7 + // - 2, 4, 6, 8 + // - 9, 10, 11, 12 + // o For each one of this set, check if the four edges + // have the same number of element. + // o If so, check if the "corresponding" // faces contains + // only quads. It's the faces numbered: + // - 1, 2, 3, 4 + // - 1, 2, 5, 6 + // - 3, 4, 5, 6 + // o If so, check if the opposite edges of each // faces + // have the same number of elements. It is the edges + // numbered : + // - 2 and 4, 6 and 8, 9 and 10, 11 and 12 + // - 1 and 3, 5 and 7, 9 and 11, 10 and 12 + // - 1 and 5, 3 and 7, 4 and 8, 2 and 6 + // o If so, check if the two other faces have the same + // number of elements. It is the faces numbered: + // - 5, 6 + // - 3, 4 + // - 1, 2 + // This test should be improved to test if the nodes + // of the two faces are really "en face". + // o If so, one of the two faces is a candidate to an extrusion, + // It is the faces numbered : + // - 5 + // - 3 + // - 1 + // o Finally, if there is only one candidate, let do the + // extrusion job for the corresponding face + // + int isOK = 0; + // + int iNbF = aM.Extent(); + if (iNbF == 6) { + // + int nb_f1 = pMesh->GetSubMeshContaining(aM(1))->GetSubMeshDS()->NbElements(); + int nb_f2 = pMesh->GetSubMeshContaining(aM(2))->GetSubMeshDS()->NbElements(); + int nb_f3 = pMesh->GetSubMeshContaining(aM(3))->GetSubMeshDS()->NbElements(); + int nb_f4 = pMesh->GetSubMeshContaining(aM(4))->GetSubMeshDS()->NbElements(); + int nb_f5 = pMesh->GetSubMeshContaining(aM(5))->GetSubMeshDS()->NbElements(); + int nb_f6 = pMesh->GetSubMeshContaining(aM(6))->GetSubMeshDS()->NbElements(); + // + int has_only_quad_f1 = 1; + int has_only_quad_f2 = 1; + int has_only_quad_f3 = 1; + int has_only_quad_f4 = 1; + int has_only_quad_f5 = 1; + int has_only_quad_f6 = 1; + // + for (i=1; i<=iNbF; ++i) { + int ok = 1; + const TopoDS_Shape& aF = aM(i); + SMESH_subMesh *aSubMesh = pMesh->GetSubMeshContaining(aF); + SMESHDS_SubMesh *aSM = aSubMesh->GetSubMeshDS(); + SMDS_ElemIteratorPtr itf = aSM->GetElements(); + while(itf->more()) { + const SMDS_MeshElement * pElement = itf->next(); + aElementType = pElement->GetType(); + if (aElementType==SMDSAbs_Face) { + iNbNodes = pElement->NbNodes(); + if ( iNbNodes!=4 ) { + ok = 0; + break ; + } + } + } + if (i==1) has_only_quad_f1 = ok ; + if (i==2) has_only_quad_f2 = ok ; + if (i==3) has_only_quad_f3 = ok ; + if (i==4) has_only_quad_f4 = ok ; + if (i==5) has_only_quad_f5 = ok ; + if (i==6) has_only_quad_f6 = ok ; + } + // + TopTools_IndexedMapOfShape aE; + TopExp::MapShapes(myShape, TopAbs_EDGE, aE); + int iNbE = aE.Extent(); + if (iNbE == 12) { + // + int nb_e01 = pMesh->GetSubMeshContaining(aE(1))->GetSubMeshDS()->NbElements(); + int nb_e02 = pMesh->GetSubMeshContaining(aE(2))->GetSubMeshDS()->NbElements(); + int nb_e03 = pMesh->GetSubMeshContaining(aE(3))->GetSubMeshDS()->NbElements(); + int nb_e04 = pMesh->GetSubMeshContaining(aE(4))->GetSubMeshDS()->NbElements(); + int nb_e05 = pMesh->GetSubMeshContaining(aE(5))->GetSubMeshDS()->NbElements(); + int nb_e06 = pMesh->GetSubMeshContaining(aE(6))->GetSubMeshDS()->NbElements(); + int nb_e07 = pMesh->GetSubMeshContaining(aE(7))->GetSubMeshDS()->NbElements(); + int nb_e08 = pMesh->GetSubMeshContaining(aE(8))->GetSubMeshDS()->NbElements(); + int nb_e09 = pMesh->GetSubMeshContaining(aE(9))->GetSubMeshDS()->NbElements(); + int nb_e10 = pMesh->GetSubMeshContaining(aE(10))->GetSubMeshDS()->NbElements(); + int nb_e11 = pMesh->GetSubMeshContaining(aE(11))->GetSubMeshDS()->NbElements(); + int nb_e12 = pMesh->GetSubMeshContaining(aE(12))->GetSubMeshDS()->NbElements(); + // + int nb_ok = 0 ; + // + if ( (nb_e01==nb_e03) && (nb_e03==nb_e05) && (nb_e05==nb_e07) ) { + if ( has_only_quad_f1 && has_only_quad_f2 && has_only_quad_f3 && has_only_quad_f4 ) { + if ( (nb_e09==nb_e10) && (nb_e08==nb_e06) && (nb_e11==nb_e12) && (nb_e04==nb_e02) ) { + if (nb_f5==nb_f6) { + nb_ok += 1; + aFTr = aM(5); + } + } + } + } + if ( (nb_e02==nb_e04) && (nb_e04==nb_e06) && (nb_e06==nb_e08) ) { + if ( has_only_quad_f1 && has_only_quad_f2 && has_only_quad_f5 && has_only_quad_f6 ) { + if ( (nb_e01==nb_e03) && (nb_e10==nb_e12) && (nb_e05==nb_e07) && (nb_e09==nb_e11) ) { + if (nb_f3==nb_f4) { + nb_ok += 1; + aFTr = aM(3); + } + } + } + } + if ( (nb_e09==nb_e10) && (nb_e10==nb_e11) && (nb_e11==nb_e12) ) { + if ( has_only_quad_f3 && has_only_quad_f4 && has_only_quad_f5 && has_only_quad_f6 ) { + if ( (nb_e01==nb_e05) && (nb_e02==nb_e06) && (nb_e03==nb_e07) && (nb_e04==nb_e08) ) { + if (nb_f1==nb_f2) { + nb_ok += 1; + aFTr = aM(1); + } + } + } + } + // + if ( nb_ok == 1 ) { + isOK = 1; + } + // + } + } + if (!isOK) { + myErrorStatus=5; // more than one face has triangulation + return; + } + } + // \end{E.A.} // // 1. Vetrices V00, V001; // @@ -1013,7 +1306,7 @@ void StdMeshers_Penta_3D::MakeBlock() TopExp::MapShapesAndAncestors(myShape, TopAbs_VERTEX, TopAbs_EDGE, aMVES); // // 1.1 Base vertex V000 - iNbE=aME.Extent(); + iNbE = aME.Extent(); if (iNbE!=4){ MESSAGE("StdMeshers_Penta_3D::MakeBlock() "); myErrorStatus=7; // too few edges are in base face aFTr @@ -1080,7 +1373,7 @@ void StdMeshers_Penta_3D::MakeBlock() // 2. Load Block const TopoDS_Shell& aShell=TopoDS::Shell(aME(1)); myBlock.Load(aShell, aV000, aV001); - iErr=myBlock.ErrorStatus(); + iErr = myBlock.ErrorStatus(); if (iErr) { MESSAGE("StdMeshers_Penta_3D::MakeBlock() "); myErrorStatus=100; // SMESHBlock: Load operation failed @@ -1154,10 +1447,10 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, bool rev1, CumOri = false; TopExp_Explorer exp( theFace, TopAbs_EDGE ); int nbEdges = 0; - for ( ; exp.More(); exp.Next() ) - { - if ( ++nbEdges > 4 ) + for ( ; exp.More(); exp.Next() ) { + if ( ++nbEdges > 4 ) { return false; // more than 4 edges in theFace + } TopoDS_Edge e = TopoDS::Edge( exp.Current() ); if ( theBaseEdge.IsSame( e )) continue; @@ -1174,8 +1467,9 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, else e2 = e; } - if ( nbEdges < 4 ) - return false; // lass than 4 edges in theFace + if ( nbEdges < 4 ) { + return false; // less than 4 edges in theFace + } // submeshes corresponding to shapes SMESHDS_SubMesh* smFace = theMesh->MeshElements( theFace ); @@ -1200,13 +1494,32 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, return false; } if ( sm1->NbNodes() * smb->NbNodes() != smFace->NbNodes() ) { - MESSAGE( "Wrong nb face nodes: " << - sm1->NbNodes()<<" "<NbNodes()<<" "<NbNodes()); - return false; + // check quadratic case + if ( myCreateQuadratic ) { + int n1 = sm1->NbNodes()/2; + int n2 = smb->NbNodes()/2; + int n3 = sm1->NbNodes() - n1; + int n4 = smb->NbNodes() - n2; + int nf = sm1->NbNodes()*smb->NbNodes() - n3*n4; + if( nf != smFace->NbNodes() ) { + MESSAGE( "Wrong nb face nodes: " << + sm1->NbNodes()<<" "<NbNodes()<<" "<NbNodes()); + return false; + } + } + else { + MESSAGE( "Wrong nb face nodes: " << + sm1->NbNodes()<<" "<NbNodes()<<" "<NbNodes()); + return false; + } } // IJ size int vsize = sm1->NbNodes() + 2; int hsize = smb->NbNodes() + 2; + if(myCreateQuadratic) { + vsize = vsize - sm1->NbNodes()/2 -1; + hsize = hsize - smb->NbNodes()/2 -1; + } // load nodes from theBaseEdge @@ -1226,12 +1539,15 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, double range = l - f; SMDS_NodeIteratorPtr nIt = smb->GetNodes(); const SMDS_MeshNode* node; - while ( nIt->more() ) - { + while ( nIt->more() ) { node = nIt->next(); + if(myTool->IsMedium(node)) + continue; const SMDS_EdgePosition* pos = dynamic_cast( node->GetPosition().get() ); - if ( !pos ) return false; + if ( !pos ) { + return false; + } double u = ( pos->GetUParameter() - f ) / range; vector & nVec = theIJNodes[ u ]; nVec.resize( vsize, nullNode ); @@ -1246,19 +1562,21 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, map< double, const SMDS_MeshNode*> sortedNodes; // sort by param on edge nIt = sm1->GetNodes(); - while ( nIt->more() ) - { + while ( nIt->more() ) { node = nIt->next(); + if(myTool->IsMedium(node)) + continue; const SMDS_EdgePosition* pos = dynamic_cast( node->GetPosition().get() ); - if ( !pos ) return false; + if ( !pos ) { + return false; + } sortedNodes.insert( make_pair( pos->GetUParameter(), node )); } loadedNodes.insert( nVecf[ vsize - 1 ] = smVft->GetNodes()->next() ); map< double, const SMDS_MeshNode*>::iterator u_n = sortedNodes.begin(); int row = rev1 ? vsize - 1 : 0; - for ( ; u_n != sortedNodes.end(); u_n++ ) - { + for ( ; u_n != sortedNodes.end(); u_n++ ) { if ( rev1 ) row--; else row++; loadedNodes.insert( nVecf[ row ] = u_n->second ); @@ -1267,12 +1585,12 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, // try to load the rest nodes // get all faces from theFace - set allFaces, foundFaces; + map allFaces, foundFaces; SMDS_ElemIteratorPtr eIt = smFace->GetElements(); while ( eIt->more() ) { const SMDS_MeshElement* e = eIt->next(); if ( e->GetType() == SMDSAbs_Face ) - allFaces.insert( e ); + allFaces.insert( make_pair(e->GetID(),e) ); } // Starting from 2 neighbour nodes on theBaseEdge, look for a face // the nodes belong to, and between the nodes of the found face, @@ -1285,8 +1603,7 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, StdMeshers_IJNodeMap::iterator par_nVec_2 = par_nVec_1; // loop on columns int col = 0; - for ( par_nVec_2++; par_nVec_2 != theIJNodes.end(); par_nVec_1++, par_nVec_2++ ) - { + for ( par_nVec_2++; par_nVec_2 != theIJNodes.end(); par_nVec_1++, par_nVec_2++ ) { col++; row = 0; const SMDS_MeshNode* n1 = par_nVec_1->second[ row ]; @@ -1295,10 +1612,10 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, do { // look for a face by 2 nodes face = SMESH_MeshEditor::FindFaceInSet( n1, n2, allFaces, foundFaces ); - if ( face ) - { + if ( face ) { int nbFaceNodes = face->NbNodes(); - if ( nbFaceNodes > 4 ) { + if ( (!myCreateQuadratic && nbFaceNodes>4) || + (myCreateQuadratic && nbFaceNodes>8) ) { MESSAGE(" Too many nodes in a face: " << nbFaceNodes ); return false; } @@ -1308,6 +1625,8 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, eIt = face->nodesIterator() ; while ( !found && eIt->more() ) { node = static_cast( eIt->next() ); + if(myTool->IsMedium(node)) + continue; found = loadedNodes.insert( node ).second; if ( !found && node != n1 && node != n2 ) n3 = node; @@ -1318,20 +1637,23 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, return false; } par_nVec_2->second[ row ] = node; - foundFaces.insert( face ); + foundFaces.insert( make_pair(face->GetID(),face) ); n2 = node; - if ( nbFaceNodes == 4 ) + if ( nbFaceNodes==4 || (myCreateQuadratic && nbFaceNodes==8) ) { n1 = par_nVec_1->second[ row ]; + } } - else if (nbFaceNodes == 3 && - n3 == par_nVec_1->second[ row ] ) + else if ( (nbFaceNodes==3 || (myCreateQuadratic && nbFaceNodes==6) ) && + n3 == par_nVec_1->second[ row ] ) { n1 = n3; + } else { MESSAGE( "Not quad mesh, column "<< col ); return false; } } - } while ( face && n1 && n2 ); + } + while ( face && n1 && n2 ); if ( row < vsize - 1 ) { MESSAGE( "Too few nodes in column "<< col <<": "<< row+1); @@ -1390,17 +1712,18 @@ int StdMeshers_SMESHBlock::ErrorStatus() const { return myErrorStatus; } + //======================================================================= //function : Load //purpose : //======================================================================= void StdMeshers_SMESHBlock::Load(const TopoDS_Shell& theShell) { - TopoDS_Vertex aV000, aV001; // Load(theShell, aV000, aV001); } + //======================================================================= //function : Load //purpose : @@ -1416,12 +1739,13 @@ void StdMeshers_SMESHBlock::Load(const TopoDS_Shell& theShell, bool bOk; // myShapeIDMap.Clear(); - bOk=myTBlock.LoadBlockShapes(myShell, theV000, theV001, myShapeIDMap); + bOk = myTBlock.LoadBlockShapes(myShell, theV000, theV001, myShapeIDMap); if (!bOk) { myErrorStatus=2; return; } } + //======================================================================= //function : ComputeParameters //purpose : @@ -1431,24 +1755,25 @@ void StdMeshers_SMESHBlock::ComputeParameters(const gp_Pnt& thePnt, { ComputeParameters(thePnt, myShell, theXYZ); } + //======================================================================= //function : ComputeParameters //purpose : //======================================================================= void StdMeshers_SMESHBlock::ComputeParameters(const gp_Pnt& thePnt, const TopoDS_Shape& theShape, - gp_XYZ& theXYZ) + gp_XYZ& theXYZ) { myErrorStatus=0; // int aID; bool bOk; // - aID=ShapeID(theShape); + aID = ShapeID(theShape); if (myErrorStatus) { return; } - bOk=myTBlock.ComputeParameters(thePnt, theXYZ, aID); + bOk = myTBlock.ComputeParameters(thePnt, theXYZ, aID); if (!bOk) { myErrorStatus=4; // problems with computation Parameters return; @@ -1469,12 +1794,12 @@ void StdMeshers_SMESHBlock::ComputeParameters(const double& theU, int aID; bool bOk=false; // - aID=ShapeID(theShape); + aID = ShapeID(theShape); if (myErrorStatus) { return; } if ( SMESH_Block::IsEdgeID( aID )) - bOk=myTBlock.EdgeParameters( aID, theU, theXYZ ); + bOk = myTBlock.EdgeParameters( aID, theU, theXYZ ); if (!bOk) { myErrorStatus=4; // problems with computation Parameters return; @@ -1492,6 +1817,7 @@ void StdMeshers_SMESHBlock::ComputeParameters(const double& theU, // Point(theParams, aS, aP3D); } + //======================================================================= //function : Point //purpose : @@ -1500,15 +1826,15 @@ void StdMeshers_SMESHBlock::ComputeParameters(const double& theU, const TopoDS_Shape& theShape, gp_Pnt& aP3D) { - myErrorStatus=0; + myErrorStatus = 0; // int aID; - bool bOk=false; + bool bOk = false; gp_XYZ aXYZ(99.,99.,99.); aP3D.SetXYZ(aXYZ); // if (theShape.IsNull()) { - bOk=myTBlock.ShellPoint(theParams, aXYZ); + bOk = myTBlock.ShellPoint(theParams, aXYZ); } // else { @@ -1518,14 +1844,14 @@ void StdMeshers_SMESHBlock::ComputeParameters(const double& theU, } // if (SMESH_Block::IsVertexID(aID)) { - bOk=myTBlock.VertexPoint(aID, aXYZ); + bOk = myTBlock.VertexPoint(aID, aXYZ); } else if (SMESH_Block::IsEdgeID(aID)) { - bOk=myTBlock.EdgePoint(aID, theParams, aXYZ); + bOk = myTBlock.EdgePoint(aID, theParams, aXYZ); } // else if (SMESH_Block::IsFaceID(aID)) { - bOk=myTBlock.FacePoint(aID, theParams, aXYZ); + bOk = myTBlock.FacePoint(aID, theParams, aXYZ); } } if (!bOk) { @@ -1534,6 +1860,7 @@ void StdMeshers_SMESHBlock::ComputeParameters(const double& theU, } aP3D.SetXYZ(aXYZ); } + //======================================================================= //function : ShapeID //purpose : @@ -1561,6 +1888,7 @@ int StdMeshers_SMESHBlock::ShapeID(const TopoDS_Shape& theShape) myErrorStatus=2; // unknown shape; return aID; } + //======================================================================= //function : Shape //purpose : @@ -1580,3 +1908,5 @@ const TopoDS_Shape& StdMeshers_SMESHBlock::Shape(const int theID) const TopoDS_Shape& aS=myShapeIDMap.FindKey(theID); return aS; } + + diff --git a/src/StdMeshers/StdMeshers_Penta_3D.hxx b/src/StdMeshers/StdMeshers_Penta_3D.hxx index fdc189bbd..18787686c 100644 --- a/src/StdMeshers/StdMeshers_Penta_3D.hxx +++ b/src/StdMeshers/StdMeshers_Penta_3D.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -41,9 +41,12 @@ #include #include #include +#include #include "SMESH_Block.hxx" +#include "SMESH_MesherHelper.hxx" + typedef std::map< double, std::vector > StdMeshers_IJNodeMap; class STDMESHERS_EXPORT StdMeshers_SMESHBlock { @@ -167,7 +170,7 @@ class STDMESHERS_EXPORT StdMeshers_Penta_3D { public: // methods StdMeshers_Penta_3D(); - //~StdMeshers_Penta_3D(); + ~StdMeshers_Penta_3D(); bool Compute(SMESH_Mesh& , const TopoDS_Shape& ); @@ -183,10 +186,10 @@ class STDMESHERS_EXPORT StdMeshers_Penta_3D { return myTol3D; } - static bool LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, - const TopoDS_Face& theFace, - const TopoDS_Edge& theBaseEdge, - SMESHDS_Mesh* theMesh); + bool LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, + const TopoDS_Face& theFace, + const TopoDS_Edge& theBaseEdge, + SMESHDS_Mesh* theMesh); // Load nodes bound to theFace into column (vectors) and rows // of theIJNodes. // The value of theIJNodes map is a vector of ordered nodes so @@ -253,6 +256,9 @@ class STDMESHERS_EXPORT StdMeshers_Penta_3D { // vector myWallNodesMaps; // nodes on a face vector myShapeXYZ; // point on each sub-shape + + bool myCreateQuadratic; + SMESH_MesherHelper* myTool; // toll for working with quadratic elements }; #endif diff --git a/src/StdMeshers/StdMeshers_Propagation.cxx b/src/StdMeshers/StdMeshers_Propagation.cxx index 6672e2565..2591d309d 100644 --- a/src/StdMeshers/StdMeshers_Propagation.cxx +++ b/src/StdMeshers/StdMeshers_Propagation.cxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -40,7 +40,7 @@ StdMeshers_Propagation::StdMeshers_Propagation (int hypId, int studyId, : SMESH_Hypothesis(hypId, studyId, gen) { _name = GetName(); - _param_algo_dim = -2; + _param_algo_dim = -1; // 1D auxiliary } //============================================================================= diff --git a/src/StdMeshers/StdMeshers_Propagation.hxx b/src/StdMeshers/StdMeshers_Propagation.hxx index 7f255e116..3f6fb714a 100644 --- a/src/StdMeshers/StdMeshers_Propagation.hxx +++ b/src/StdMeshers/StdMeshers_Propagation.hxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_QuadranglePreference.cxx b/src/StdMeshers/StdMeshers_QuadranglePreference.cxx index 60dc49499..b16eeb58e 100644 --- a/src/StdMeshers/StdMeshers_QuadranglePreference.cxx +++ b/src/StdMeshers/StdMeshers_QuadranglePreference.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_QuadranglePreference.hxx b/src/StdMeshers/StdMeshers_QuadranglePreference.hxx index 3102422b8..3d00d7acd 100644 --- a/src/StdMeshers/StdMeshers_QuadranglePreference.hxx +++ b/src/StdMeshers/StdMeshers_QuadranglePreference.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx index 93bbc2e5f..5d330d585 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -80,6 +81,7 @@ StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D (int hypId, int studyId, SMES _name = "Quadrangle_2D"; _shapeType = (1 << TopAbs_FACE); _compatibleHypothesis.push_back("QuadranglePreference"); + myTool = 0; } //============================================================================= @@ -91,6 +93,8 @@ StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D (int hypId, int studyId, SMES StdMeshers_Quadrangle_2D::~StdMeshers_Quadrangle_2D() { MESSAGE("StdMeshers_Quadrangle_2D::~StdMeshers_Quadrangle_2D"); + if ( myTool ) + delete myTool; } //============================================================================= @@ -128,11 +132,17 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, SMESHDS_Mesh * meshDS = aMesh.GetMeshDS(); aMesh.GetSubMesh(aShape); + if ( !myTool ) + myTool = new SMESH_MesherHelper(aMesh); + _quadraticMesh = myTool->IsQuadraticSubMesh(aShape); + //FaceQuadStruct *quad = CheckAnd2Dcompute(aMesh, aShape); FaceQuadStruct* quad = CheckNbEdges(aMesh, aShape); - if (!quad) + if (!quad) { + delete myTool; myTool = 0; return false; + } if(myQuadranglePreference) { int n1 = quad->nbPts[0]; @@ -144,14 +154,18 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, ntmp = ntmp*2; if( nfull==ntmp && ( (n1!=n3) || (n2!=n4) ) ) { // special path for using only quandrangle faces - return ComputeQuadPref(aMesh, aShape, quad); + bool ok = ComputeQuadPref(aMesh, aShape, quad); + delete myTool; myTool = 0; + return ok; } } // set normalized grid on unit square in parametric domain SetNormalizedGrid(aMesh, aShape, quad); - if (!quad) + if (!quad) { + delete myTool; myTool = 0; return false; + } // --- compute 3D values on points, store points & quadrangles @@ -180,7 +194,7 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, quad->uv_grid[ij].node = node; } } - + // mesh faces // [2] @@ -194,16 +208,16 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, // 0 > > > > > > > > nbhoriz // i // [0] - + i = 0; int ilow = 0; int iup = nbhoriz - 1; if (quad->isEdgeOut[3]) { ilow++; } else { if (quad->isEdgeOut[1]) iup--; } - + int jlow = 0; int jup = nbvertic - 1; if (quad->isEdgeOut[0]) { jlow++; } else { if (quad->isEdgeOut[2]) jup--; } - + // regular quadrangles for (i = ilow; i < iup; i++) { for (j = jlow; j < jup; j++) { @@ -212,11 +226,12 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, b = quad->uv_grid[j * nbhoriz + i + 1].node; c = quad->uv_grid[(j + 1) * nbhoriz + i + 1].node; d = quad->uv_grid[(j + 1) * nbhoriz + i].node; - SMDS_MeshFace * face = meshDS->AddFace(a, b, c, d); + //SMDS_MeshFace * face = meshDS->AddFace(a, b, c, d); + SMDS_MeshFace* face = myTool->AddFace(a, b, c, d); meshDS->SetMeshElementOnShape(face, geomFaceID); } } - + UVPtStruct *uv_e0 = quad->uv_edges[0]; UVPtStruct *uv_e1 = quad->uv_edges[1]; UVPtStruct *uv_e2 = quad->uv_edges[2]; @@ -225,7 +240,7 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, double eps = Precision::Confusion(); // Boundary quadrangles - + if (quad->isEdgeOut[0]) { // Down edge is out // @@ -237,14 +252,14 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, // . . . . . . . . . __ down edge nodes // // >->->->->->->->->->->->-> -- direction of processing - + int g = 0; // number of last processed node in the regular grid - + // number of last node of the down edge to be processed int stop = nbdown - 1; // if right edge is out, we will stop at a node, previous to the last one if (quad->isEdgeOut[1]) stop--; - + // for each node of the down edge find nearest node // in the first row of the regular grid and link them for (i = 0; i < stop; i++) { @@ -252,18 +267,19 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, a = uv_e0[i].node; b = uv_e0[i + 1].node; gp_Pnt pb (b->X(), b->Y(), b->Z()); - + // find node c in the regular grid, which will be linked with node b int near = g; if (i == stop - 1) { // right bound reached, link with the rightmost node near = iup; c = quad->uv_grid[nbhoriz + iup].node; - } else { + } + else { // find in the grid node c, nearest to the b double mind = RealLast(); for (int k = g; k <= iup; k++) { - + const SMDS_MeshNode *nk; if (k < ilow) // this can be, if left edge is out nk = uv_e3[1].node; // get node from the left edge @@ -283,14 +299,17 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, } if (near == g) { // make triangle - SMDS_MeshFace* face = meshDS->AddFace(a, b, c); + //SMDS_MeshFace* face = meshDS->AddFace(a, b, c); + SMDS_MeshFace* face = myTool->AddFace(a, b, c); meshDS->SetMeshElementOnShape(face, geomFaceID); - } else { // make quadrangle + } + else { // make quadrangle if (near - 1 < ilow) d = uv_e3[1].node; else d = quad->uv_grid[nbhoriz + near - 1].node; - SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d); + //SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d); + SMDS_MeshFace* face = myTool->AddFace(a, b, c, d); meshDS->SetMeshElementOnShape(face, geomFaceID); // if node d is not at position g - make additional triangles @@ -301,7 +320,8 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, d = uv_e3[1].node; else d = quad->uv_grid[nbhoriz + k - 1].node; - SMDS_MeshFace* face = meshDS->AddFace(a, c, d); + //SMDS_MeshFace* face = meshDS->AddFace(a, c, d); + SMDS_MeshFace* face = myTool->AddFace(a, c, d); meshDS->SetMeshElementOnShape(face, geomFaceID); } } @@ -363,14 +383,17 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, } if (near == g) { // make triangle - SMDS_MeshFace* face = meshDS->AddFace(a, b, c); + //SMDS_MeshFace* face = meshDS->AddFace(a, b, c); + SMDS_MeshFace* face = myTool->AddFace(a, b, c); meshDS->SetMeshElementOnShape(face, geomFaceID); - } else { // make quadrangle + } + else { // make quadrangle if (near + 1 > iup) d = uv_e1[nbright - 2].node; else d = quad->uv_grid[nbhoriz*(nbvertic - 2) + near + 1].node; - SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d); + //SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d); + SMDS_MeshFace* face = myTool->AddFace(a, b, c, d); meshDS->SetMeshElementOnShape(face, geomFaceID); if (near + 1 < g) { // if d not is at g - make additional triangles @@ -380,7 +403,8 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, d = uv_e1[nbright - 2].node; else d = quad->uv_grid[nbhoriz*(nbvertic - 2) + k + 1].node; - SMDS_MeshFace* face = meshDS->AddFace(a, c, d); + //SMDS_MeshFace* face = meshDS->AddFace(a, c, d); + SMDS_MeshFace* face = myTool->AddFace(a, c, d); meshDS->SetMeshElementOnShape(face, geomFaceID); } } @@ -428,14 +452,17 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, } if (near == g) { // make triangle - SMDS_MeshFace* face = meshDS->AddFace(a, b, c); + //SMDS_MeshFace* face = meshDS->AddFace(a, b, c); + SMDS_MeshFace* face = myTool->AddFace(a, b, c); meshDS->SetMeshElementOnShape(face, geomFaceID); - } else { // make quadrangle + } + else { // make quadrangle if (near - 1 < jlow) d = uv_e0[nbdown - 2].node; else d = quad->uv_grid[nbhoriz*near - 2].node; - SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d); + //SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d); + SMDS_MeshFace* face = myTool->AddFace(a, b, c, d); meshDS->SetMeshElementOnShape(face, geomFaceID); if (near - 1 > g) { // if d not is at g - make additional triangles @@ -445,7 +472,8 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, d = uv_e0[nbdown - 2].node; else d = quad->uv_grid[nbhoriz*k - 2].node; - SMDS_MeshFace* face = meshDS->AddFace(a, c, d); + //SMDS_MeshFace* face = meshDS->AddFace(a, c, d); + SMDS_MeshFace* face = myTool->AddFace(a, c, d); meshDS->SetMeshElementOnShape(face, geomFaceID); } } @@ -490,14 +518,17 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, } if (near == g) { // make triangle - SMDS_MeshFace* face = meshDS->AddFace(a, b, c); + //SMDS_MeshFace* face = meshDS->AddFace(a, b, c); + SMDS_MeshFace* face = myTool->AddFace(a, b, c); meshDS->SetMeshElementOnShape(face, geomFaceID); - } else { // make quadrangle + } + else { // make quadrangle if (near + 1 > jup) d = uv_e2[1].node; else d = quad->uv_grid[nbhoriz*(near + 1) + 1].node; - SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d); + //SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d); + SMDS_MeshFace* face = myTool->AddFace(a, b, c, d); meshDS->SetMeshElementOnShape(face, geomFaceID); if (near + 1 < g) { // if d not is at g - make additional triangles @@ -507,7 +538,8 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, d = uv_e2[1].node; else d = quad->uv_grid[nbhoriz*(k + 1) + 1].node; - SMDS_MeshFace* face = meshDS->AddFace(a, c, d); + //SMDS_MeshFace* face = meshDS->AddFace(a, c, d); + SMDS_MeshFace* face = myTool->AddFace(a, c, d); meshDS->SetMeshElementOnShape(face, geomFaceID); } } @@ -518,6 +550,8 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, } QuadDelete(quad); + delete myTool; myTool = 0; + bool isOk = true; return isOk; } @@ -557,7 +591,13 @@ FaceQuadStruct* StdMeshers_Quadrangle_2D::CheckNbEdges(SMESH_Mesh & aMesh, int nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes(); if (nbEdges < 4) { quad->edge[nbEdges] = E; - quad->nbPts[nbEdges] = nb + 2; // internal points + 2 extrema + if(!_quadraticMesh) { + quad->nbPts[nbEdges] = nb + 2; // internal points + 2 extrema + } + else { + int tmp = nb/2; + quad->nbPts[nbEdges] = tmp + 2; // internal not medium points + 2 extrema + } } nbEdges++; } @@ -571,18 +611,21 @@ FaceQuadStruct* StdMeshers_Quadrangle_2D::CheckNbEdges(SMESH_Mesh & aMesh, return quad; } - //============================================================================= /*! - * + * CheckAnd2Dcompute */ //============================================================================= FaceQuadStruct *StdMeshers_Quadrangle_2D::CheckAnd2Dcompute - (SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) throw(SALOME_Exception) + (SMESH_Mesh & aMesh, + const TopoDS_Shape & aShape, + const bool CreateQuadratic) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); + _quadraticMesh = CreateQuadratic; + FaceQuadStruct *quad = CheckNbEdges(aMesh, aShape); if(!quad) return 0; @@ -1185,13 +1228,13 @@ bool StdMeshers_Quadrangle_2D::ComputeQuadPref for(j=1; jAddFace(NodesL.Value(i,j), NodesL.Value(i+1,j), + myTool->AddFace(NodesL.Value(i,j), NodesL.Value(i+1,j), NodesL.Value(i+1,j+1), NodesL.Value(i,j+1)); meshDS->SetMeshElementOnShape(F, geomFaceID); } else { SMDS_MeshFace* F = - meshDS->AddFace(NodesL.Value(i,j), NodesL.Value(i,j+1), + myTool->AddFace(NodesL.Value(i,j), NodesL.Value(i,j+1), NodesL.Value(i+1,j+1), NodesL.Value(i+1,j)); meshDS->SetMeshElementOnShape(F, geomFaceID); } @@ -1252,13 +1295,13 @@ bool StdMeshers_Quadrangle_2D::ComputeQuadPref for(j=1; jAddFace(NodesR.Value(i,j), NodesR.Value(i+1,j), + myTool->AddFace(NodesR.Value(i,j), NodesR.Value(i+1,j), NodesR.Value(i+1,j+1), NodesR.Value(i,j+1)); meshDS->SetMeshElementOnShape(F, geomFaceID); } else { SMDS_MeshFace* F = - meshDS->AddFace(NodesR.Value(i,j), NodesR.Value(i,j+1), + myTool->AddFace(NodesR.Value(i,j), NodesR.Value(i,j+1), NodesR.Value(i+1,j+1), NodesR.Value(i+1,j)); meshDS->SetMeshElementOnShape(F, geomFaceID); } @@ -1335,13 +1378,13 @@ bool StdMeshers_Quadrangle_2D::ComputeQuadPref for(j=1; jAddFace(NodesC.Value(i,j), NodesC.Value(i+1,j), + myTool->AddFace(NodesC.Value(i,j), NodesC.Value(i+1,j), NodesC.Value(i+1,j+1), NodesC.Value(i,j+1)); meshDS->SetMeshElementOnShape(F, geomFaceID); } else { SMDS_MeshFace* F = - meshDS->AddFace(NodesC.Value(i,j), NodesC.Value(i,j+1), + myTool->AddFace(NodesC.Value(i,j), NodesC.Value(i,j+1), NodesC.Value(i+1,j+1), NodesC.Value(i+1,j)); meshDS->SetMeshElementOnShape(F, geomFaceID); } @@ -1389,16 +1432,47 @@ UVPtStruct* StdMeshers_Quadrangle_2D::LoadEdgePoints2 (SMESH_Mesh & aMesh, map params; SMDS_NodeIteratorPtr ite = aMesh.GetSubMesh(E)->GetSubMeshDS()->GetNodes(); + int nbPoints = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes(); - while(ite->more()) { - const SMDS_MeshNode* node = ite->next(); - const SMDS_EdgePosition* epos = - static_cast(node->GetPosition().get()); - double param = epos->GetUParameter(); - params[param] = node; + if(!_quadraticMesh) { + while(ite->more()) { + const SMDS_MeshNode* node = ite->next(); + const SMDS_EdgePosition* epos = + static_cast(node->GetPosition().get()); + double param = epos->GetUParameter(); + params[param] = node; + } + } + else { + vector nodes(nbPoints+2); + nodes[0] = idFirst; + nodes[nbPoints+1] = idLast; + nbPoints = nbPoints/2; + int nn = 1; + while(ite->more()) { + const SMDS_MeshNode* node = ite->next(); + nodes[nn++] = node; + // check if node is medium + bool IsMedium = false; + SMDS_ElemIteratorPtr itn = node->GetInverseElementIterator(); + while (itn->more()) { + const SMDS_MeshElement* elem = itn->next(); + if ( elem->GetType() != SMDSAbs_Edge ) + continue; + if(elem->IsMediumNode(node)) { + IsMedium = true; + break; + } + } + if(IsMedium) + continue; + const SMDS_EdgePosition* epos = + static_cast(node->GetPosition().get()); + double param = epos->GetUParameter(); + params[param] = node; + } } - int nbPoints = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes(); if (nbPoints != params.size()) { MESSAGE( "BAD NODE ON EDGE POSITIONS" ); return 0; @@ -1523,21 +1597,60 @@ UVPtStruct* StdMeshers_Quadrangle_2D::LoadEdgePoints (SMESH_Mesh & aMesh, // --- edge internal IDNodes (relies on good order storage, not checked) +// if(_quadraticMesh) { + // fill myNLinkNodeMap +// SMDS_ElemIteratorPtr iter = aMesh.GetSubMesh(E)->GetSubMeshDS()->GetElements(); +// while(iter->more()) { +// const SMDS_MeshElement* elem = iter->next(); +// SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator(); +// const SMDS_MeshNode* n1 = static_cast( nodeIt->next() ); +// const SMDS_MeshNode* n2 = static_cast( nodeIt->next() ); +// const SMDS_MeshNode* n3 = static_cast( nodeIt->next() ); +// NLink link(( n1 < n2 ? n1 : n2 ), ( n1 < n2 ? n2 : n1 )); +// myNLinkNodeMap.insert(NLinkNodeMap::value_type(link,n3)); +// myNLinkNodeMap[link] = n3; +// } +// } + map params; SMDS_NodeIteratorPtr ite = aMesh.GetSubMesh(E)->GetSubMeshDS()->GetNodes(); + int nbPoints = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes(); - while(ite->more()) - { - const SMDS_MeshNode* node = ite->next(); - const SMDS_EdgePosition* epos = - static_cast(node->GetPosition().get()); - double param = epos->GetUParameter(); - params[param] = node; + if(!_quadraticMesh) { + while(ite->more()) { + const SMDS_MeshNode* node = ite->next(); + const SMDS_EdgePosition* epos = + static_cast(node->GetPosition().get()); + double param = epos->GetUParameter(); + params[param] = node; + } + } + else { + nbPoints = nbPoints/2; + while(ite->more()) { + const SMDS_MeshNode* node = ite->next(); + // check if node is medium + bool IsMedium = false; + SMDS_ElemIteratorPtr itn = node->GetInverseElementIterator(); + while (itn->more()) { + const SMDS_MeshElement* elem = itn->next(); + if ( elem->GetType() != SMDSAbs_Edge ) + continue; + if(elem->IsMediumNode(node)) { + IsMedium = true; + break; + } + } + if(IsMedium) + continue; + const SMDS_EdgePosition* epos = + static_cast(node->GetPosition().get()); + double param = epos->GetUParameter(); + params[param] = node; + } } - int nbPoints = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes(); - if (nbPoints != params.size()) - { + if (nbPoints != params.size()) { MESSAGE( "BAD NODE ON EDGE POSITIONS" ); return 0; } diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx index 5d117fd52..ac7e63108 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -36,7 +36,11 @@ #include "SMESH_Mesh.hxx" #include "Utils_SALOME_Exception.hxx" -class SMDS_MeshNode; +#include "gp_XY.hxx" + +#include "SMESH_MesherHelper.hxx" + +//class SMDS_MeshNode; typedef struct uvPtStruct { @@ -77,11 +81,17 @@ public: throw (SALOME_Exception); FaceQuadStruct* CheckAnd2Dcompute(SMESH_Mesh& aMesh, - const TopoDS_Shape& aShape) + const TopoDS_Shape& aShape, + const bool CreateQuadratic) throw (SALOME_Exception); static void QuadDelete(FaceQuadStruct* quad); + /** + * Returns NLinkNodeMap from myTool + */ + const NLinkNodeMap& GetNLinkNodeMap() { return myTool->GetNLinkNodeMap(); } + ostream & SaveTo(ostream & save); istream & LoadFrom(istream & load); friend ostream & operator << (ostream & save, StdMeshers_Quadrangle_2D & hyp); @@ -122,6 +132,8 @@ protected: // construction of quadrangles if the number of nodes on opposite edges // is not the same in the case where the global number of nodes on edges is even bool myQuadranglePreference; + + SMESH_MesherHelper* myTool; // toll for working with quadratic elements }; #endif diff --git a/src/StdMeshers/StdMeshers_QuadraticMesh.hxx b/src/StdMeshers/StdMeshers_QuadraticMesh.hxx index db601eec8..f6146f8b6 100644 --- a/src/StdMeshers/StdMeshers_QuadraticMesh.hxx +++ b/src/StdMeshers/StdMeshers_QuadraticMesh.hxx @@ -28,6 +28,8 @@ #ifndef _StdMeshers_QuadraticMesh_HXX_ #define _StdMeshers_QuadraticMesh_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" @@ -39,7 +41,7 @@ * The 3D mesher generates quadratic volumes only if all boundary faces * are quadratic ones, else it fails. */ -class StdMeshers_QuadraticMesh:public SMESH_Hypothesis +class STDMESHERS_EXPORT StdMeshers_QuadraticMesh:public SMESH_Hypothesis { public: StdMeshers_QuadraticMesh(int hypId, int studyId, SMESH_Gen * gen); diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 1723d6549..9e76b7ba9 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -31,6 +31,8 @@ #include "StdMeshers_Distribution.hxx" #include "SMESH_Gen.hxx" #include "SMESH_Mesh.hxx" +#include "SMESH_HypoFilter.hxx" +#include "SMESH_subMesh.hxx" #include "StdMeshers_LocalLength.hxx" #include "StdMeshers_NumberOfSegments.hxx" @@ -42,7 +44,6 @@ #include "SMDS_MeshElement.hxx" #include "SMDS_MeshNode.hxx" #include "SMDS_EdgePosition.hxx" -#include "SMESH_subMesh.hxx" #include "Utils_SALOME_Exception.hxx" #include "utilities.h" @@ -88,6 +89,8 @@ StdMeshers_Regular_1D::StdMeshers_Regular_1D(int hypId, int studyId, _compatibleHypothesis.push_back("Deflection1D"); _compatibleHypothesis.push_back("Arithmetic1D"); _compatibleHypothesis.push_back("AutomaticLength"); + + _compatibleHypothesis.push_back("QuadraticMesh"); // auxiliary !!! } //============================================================================= @@ -107,22 +110,37 @@ StdMeshers_Regular_1D::~StdMeshers_Regular_1D() //============================================================================= bool StdMeshers_Regular_1D::CheckHypothesis - (SMESH_Mesh& aMesh, - const TopoDS_Shape& aShape, + (SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, SMESH_Hypothesis::Hypothesis_Status& aStatus) { _hypType = NONE; + _quadraticMesh = false; + + const bool ignoreAuxiliaryHyps = false; + const list & hyps = + GetUsedHypothesis(aMesh, aShape, ignoreAuxiliaryHyps); + + // find non-auxiliary hypothesis + const SMESHDS_Hypothesis *theHyp = 0; + list ::const_iterator h = hyps.begin(); + for ( ; h != hyps.end(); ++h ) { + if ( static_cast(*h)->IsAuxiliary() ) { + if ( strcmp( "QuadraticMesh", (*h)->GetName() ) == 0 ) + _quadraticMesh = true; + } + else { + if ( !theHyp ) + theHyp = *h; // use only the first non-auxiliary hypothesis + } + } - const list &hyps = GetUsedHypothesis(aMesh, aShape); - if (hyps.size() == 0) + if ( !theHyp ) { aStatus = SMESH_Hypothesis::HYP_MISSING; return false; // can't work without a hypothesis } - // use only the first hypothesis - const SMESHDS_Hypothesis *theHyp = hyps.front(); - string hypName = theHyp->GetName(); if (hypName == "LocalLength") @@ -267,7 +285,8 @@ static bool computeParamByFunc(Adaptor3d_Curve& C3d, double first, double last, int nbSeg, Function& func, list& theParams) { - OSD::SetSignal( true ); + // never do this way + //OSD::SetSignal( true ); if( nbSeg<=0 ) return false; @@ -327,7 +346,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(const TopoDS_Edge& theEdge double f, l; Handle(Geom_Curve) Curve = BRep_Tool::Curve(theEdge, f, l); - GeomAdaptor_Curve C3d(Curve); + GeomAdaptor_Curve C3d (Curve, f, l); double length = EdgeLength(theEdge); @@ -348,21 +367,34 @@ bool StdMeshers_Regular_1D::computeInternalParameters(const TopoDS_Edge& theEdge else { // Number Of Segments hypothesis + int NbSegm = _ivalue[ NB_SEGMENTS_IND ]; + if ( NbSegm < 1 ) return false; + if ( NbSegm == 1 ) return true; + switch (_ivalue[ DISTR_TYPE_IND ]) { case StdMeshers_NumberOfSegments::DT_Scale: { double scale = _value[ SCALE_FACTOR_IND ]; - if ( theReverse ) - scale = 1. / scale; - double alpha = pow( scale , 1.0 / (_ivalue[ NB_SEGMENTS_IND ] - 1)); - double factor = (l - f) / (1 - pow( alpha,_ivalue[ NB_SEGMENTS_IND ])); - - int i, NbPoints = 1 + _ivalue[ NB_SEGMENTS_IND ]; - for ( i = 2; i < NbPoints; i++ ) - { - double param = f + factor * (1 - pow(alpha, i - 1)); - theParams.push_back( param ); + + if (fabs(scale - 1.0) < Precision::Confusion()) { + // special case to avoid division on zero + for (int i = 1; i < NbSegm; i++) { + double param = f + (l - f) * i / NbSegm; + theParams.push_back( param ); + } + } else { + // general case of scale distribution + if ( theReverse ) + scale = 1.0 / scale; + + double alpha = pow(scale, 1.0 / (NbSegm - 1)); + double factor = (l - f) / (1.0 - pow(alpha, NbSegm)); + + for (int i = 1; i < NbSegm; i++) { + double param = f + factor * (1.0 - pow(alpha, i)); + theParams.push_back( param ); + } } return true; } @@ -390,7 +422,6 @@ bool StdMeshers_Regular_1D::computeInternalParameters(const TopoDS_Edge& theEdge return false; } } - GCPnts_UniformAbscissa Discret(C3d, eltSize, f, l); if ( !Discret.IsDone() ) return false; @@ -470,7 +501,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(const TopoDS_Edge& theEdge case DEFLECTION: { - GCPnts_UniformDeflection Discret(C3d, _value[ DEFLECTION_IND ], true); + GCPnts_UniformDeflection Discret(C3d, _value[ DEFLECTION_IND ], f, l, true); if ( !Discret.IsDone() ) return false; @@ -527,24 +558,25 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aSh ASSERT(!VLast.IsNull()); lid=aMesh.GetSubMesh(VLast)->GetSubMeshDS()->GetNodes(); - if (!lid->more()) - { + if (!lid->more()) { MESSAGE (" NO NODE BUILT ON VERTEX "); return false; } const SMDS_MeshNode * idLast = lid->next(); - if (!Curve.IsNull()) - { + if (!Curve.IsNull()) { list< double > params; bool reversed = false; if ( !_mainEdge.IsNull() ) reversed = aMesh.IsReversedInChain( EE, _mainEdge ); try { - if ( ! computeInternalParameters( E, params, reversed )) + if ( ! computeInternalParameters( E, params, reversed )) { + //cout << "computeInternalParameters() failed" <::iterator itU = params.begin(); itU != params.end(); itU++) - { + for (list::iterator itU = params.begin(); itU != params.end(); itU++) { double param = *itU; gp_Pnt P = Curve->Value(param); @@ -562,17 +599,39 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aSh SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z()); meshDS->SetNodeOnEdge(node, shapeID, param); - SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, node); - meshDS->SetMeshElementOnShape(edge, shapeID); + if(_quadraticMesh) { + // create medium node + double prm = ( parPrev + param )/2; + gp_Pnt PM = Curve->Value(prm); + SMDS_MeshNode * NM = meshDS->AddNode(PM.X(), PM.Y(), PM.Z()); + meshDS->SetNodeOnEdge(NM, shapeID, prm); + SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, node, NM); + meshDS->SetMeshElementOnShape(edge, shapeID); + } + else { + SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, node); + meshDS->SetMeshElementOnShape(edge, shapeID); + } + idPrev = node; + parPrev = param; + } + if(_quadraticMesh) { + double prm = ( parPrev + parLast )/2; + gp_Pnt PM = Curve->Value(prm); + SMDS_MeshNode * NM = meshDS->AddNode(PM.X(), PM.Y(), PM.Z()); + meshDS->SetNodeOnEdge(NM, shapeID, prm); + SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, idLast, NM); + meshDS->SetMeshElementOnShape(edge, shapeID); + } + else { + SMDS_MeshEdge* edge = meshDS->AddEdge(idPrev, idLast); + meshDS->SetMeshElementOnShape(edge, shapeID); } - SMDS_MeshEdge* edge = meshDS->AddEdge(idPrev, idLast); - meshDS->SetMeshElementOnShape(edge, shapeID); } - else - { + else { // Edge is a degenerated Edge : We put n = 5 points on the edge. - int NbPoints = 5; + const int NbPoints = 5; BRep_Tool::Range(E, f, l); double du = (l - f) / (NbPoints - 1); //MESSAGE("************* Degenerated edge! *****************"); @@ -582,18 +641,36 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aSh gp_Pnt P = BRep_Tool::Pnt(V1); const SMDS_MeshNode * idPrev = idFirst; - for (int i = 2; i < NbPoints; i++) - { + for (int i = 2; i < NbPoints; i++) { double param = f + (i - 1) * du; SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z()); + if(_quadraticMesh) { + // create medium node + double prm = param - du/2.; + SMDS_MeshNode * NM = meshDS->AddNode(P.X(), P.Y(), P.Z()); + meshDS->SetNodeOnEdge(NM, shapeID, prm); + SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, node, NM); + meshDS->SetMeshElementOnShape(edge, shapeID); + } + else { + SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, node); + meshDS->SetMeshElementOnShape(edge, shapeID); + } meshDS->SetNodeOnEdge(node, shapeID, param); - - SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, node); - meshDS->SetMeshElementOnShape(edge, shapeID); idPrev = node; } - SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, idLast); - meshDS->SetMeshElementOnShape(edge, shapeID); + if(_quadraticMesh) { + // create medium node + double prm = l - du/2.; + SMDS_MeshNode * NM = meshDS->AddNode(P.X(), P.Y(), P.Z()); + meshDS->SetNodeOnEdge(NM, shapeID, prm); + SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, idLast, NM); + meshDS->SetMeshElementOnShape(edge, shapeID); + } + else { + SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, idLast); + meshDS->SetMeshElementOnShape(edge, shapeID); + } } return true; } @@ -604,40 +681,47 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aSh */ //============================================================================= -const list & StdMeshers_Regular_1D::GetUsedHypothesis( - SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) +const list & +StdMeshers_Regular_1D::GetUsedHypothesis(SMESH_Mesh & aMesh, + const TopoDS_Shape & aShape, + const bool ignoreAuxiliary) { _usedHypList.clear(); - _usedHypList = GetAppliedHypothesis(aMesh, aShape); // copy - int nbHyp = _usedHypList.size(); _mainEdge.Nullify(); + + SMESH_HypoFilter auxiliaryFilter, compatibleFilter; + auxiliaryFilter.Init( SMESH_HypoFilter::IsAuxiliary() ); + const bool ignoreAux = true; + InitCompatibleHypoFilter( compatibleFilter, ignoreAux ); + + // get non-auxiliary assigned to aShape + int nbHyp = aMesh.GetHypotheses( aShape, compatibleFilter, _usedHypList, false ); + if (nbHyp == 0) { // Check, if propagated from some other edge if (aShape.ShapeType() == TopAbs_EDGE && aMesh.IsPropagatedHypothesis(aShape, _mainEdge)) { - // Propagation of 1D hypothesis from on this edge - //_usedHypList = GetAppliedHypothesis(aMesh, _mainEdge); // copy - // use a general method in order not to nullify _mainEdge - _usedHypList = SMESH_Algo::GetUsedHypothesis(aMesh, _mainEdge); // copy - nbHyp = _usedHypList.size(); + // Propagation of 1D hypothesis from on this edge; + // get non-auxiliary assigned to _mainEdge + nbHyp = aMesh.GetHypotheses( _mainEdge, compatibleFilter, _usedHypList, true ); } } - if (nbHyp == 0) + + if (nbHyp == 0) // nothing propagated nor assigned to aShape { - TopTools_ListIteratorOfListOfShape ancIt( aMesh.GetAncestors( aShape )); - for (; ancIt.More(); ancIt.Next()) - { - const TopoDS_Shape& ancestor = ancIt.Value(); - _usedHypList = GetAppliedHypothesis(aMesh, ancestor); // copy - nbHyp = _usedHypList.size(); - if (nbHyp == 1) - break; - } + SMESH_Algo::GetUsedHypothesis( aMesh, aShape, ignoreAuxiliary ); + nbHyp = _usedHypList.size(); } - if (nbHyp > 1) - _usedHypList.clear(); //only one compatible hypothesis allowed + else + { + // get auxiliary hyps from aShape + aMesh.GetHypotheses( aShape, auxiliaryFilter, _usedHypList, true ); + } + if ( nbHyp > 1 && ignoreAuxiliary ) + _usedHypList.clear(); //only one compatible non-auxiliary hypothesis allowed + return _usedHypList; } diff --git a/src/StdMeshers/StdMeshers_Regular_1D.hxx b/src/StdMeshers/StdMeshers_Regular_1D.hxx index 7bdd3cc01..c8a856d0b 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.hxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -51,7 +51,7 @@ public: const TopoDS_Shape& aShape); virtual const std::list & - GetUsedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape); + GetUsedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, const bool=true); ostream & SaveTo(ostream & save); istream & LoadFrom(istream & load); diff --git a/src/StdMeshers/StdMeshers_StartEndLength.cxx b/src/StdMeshers/StdMeshers_StartEndLength.cxx index 46320768f..14563332d 100644 --- a/src/StdMeshers/StdMeshers_StartEndLength.cxx +++ b/src/StdMeshers/StdMeshers_StartEndLength.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers/StdMeshers_StartEndLength.hxx b/src/StdMeshers/StdMeshers_StartEndLength.hxx index d3bae0aaa..c680b9802 100644 --- a/src/StdMeshers/StdMeshers_StartEndLength.hxx +++ b/src/StdMeshers/StdMeshers_StartEndLength.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshersGUI/Makefile.in b/src/StdMeshersGUI/Makefile.in index def734a2c..5d7689351 100644 --- a/src/StdMeshersGUI/Makefile.in +++ b/src/StdMeshersGUI/Makefile.in @@ -16,7 +16,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -52,7 +52,7 @@ LIB_MOC = \ StdMeshersGUI_DistrTable.h \ StdMeshersGUI_NbSegmentsCreator.h -EXPORT_HEADERS = +EXPORT_HEADERS = StdMeshersGUI_StdHypothesisCreator.h LIB_CLIENT_IDL = \ SALOME_Exception.idl \ @@ -62,24 +62,26 @@ LIB_CLIENT_IDL = \ ## pb in dependencies search LIB_CLIENT_IDL += \ + SALOME_Comm.idl \ SALOMEDS.idl \ SALOME_GenericObj.idl \ SALOME_ContainerManager.idl \ SALOME_Component.idl \ - GEOM_Gen.idl + GEOM_Gen.idl \ + MED.idl LIB_SERVER_IDL = # additionnal information to compil and link file CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) \ - -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome -I${GEOM_ROOT_DIR}/include/salome \ + $(KERNEL_CXXFLAGS) $(GUI_CXXFLAGS) $(GEOM_CXXFLAGS) \ $(BOOST_CPPFLAGS) $(QWT_INCLUDES) -CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome -I${GEOM_ROOT_DIR}/include/salome +CXXFLAGS += $(KERNEL_CXXFLAGS) $(GUI_CXXFLAGS) $(GEOM_CXXFLAGS) LDFLAGS += -lSMESH -lVTKViewer -lSalomeApp -lSMESHObject -lSMESHFiltersSelection $(OCC_KERNEL_LIBS) \ - -lTKBO -L${KERNEL_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome \ + -lTKBO $(KERNEL_LDFLAGS) $(GEOM_LDFLAGS) $(GUI_LDFLAGS) \ $(QWT_LIBS) @CONCLUDE@ diff --git a/src/StdMeshersGUI/StdMeshersGUI.cxx b/src/StdMeshersGUI/StdMeshersGUI.cxx index 50904baa9..589a487df 100644 --- a/src/StdMeshersGUI/StdMeshersGUI.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI.cxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -25,8 +25,6 @@ // Module : SMESH // $Header$ -#include "SMESH_StdMeshersGUI.hxx" - #include "StdMeshersGUI_StdHypothesisCreator.h" #include "StdMeshersGUI_NbSegmentsCreator.h" diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx index 0d66dc53a..e1a410cba 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx @@ -1,11 +1,28 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 "StdMeshersGUI_DistrPreview.h" +#include "CASCatch.hxx" + #include #include -#include -#include -#include -#include StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h ) : QwtPlot( p ), @@ -223,20 +240,14 @@ void StdMeshersGUI_DistrPreview::update() delete[] y; x = y = 0; - OSD::SetSignal( true ); - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - CASCatch_TRY { replot(); } - CASCatch_CATCH(CASCatch_Failure) + CASCatch_CATCH(Standard_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); } - aCatchSignals.Deactivate(); } void StdMeshersGUI_DistrPreview::showError() @@ -273,22 +284,17 @@ bool isCorrectArg( const Handle( Expr_GeneralExpression )& expr ) bool StdMeshersGUI_DistrPreview::init( const QString& str ) { - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - bool parsed_ok = true; CASCatch_TRY { myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString ) str.latin1() ); } - CASCatch_CATCH(CASCatch_Failure) + CASCatch_CATCH(Standard_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); parsed_ok = false; } - aCatchSignals.Deactivate(); bool syntax = false, args = false; if( parsed_ok && myExpr->IsDone() ) @@ -318,23 +324,18 @@ double StdMeshersGUI_DistrPreview::funcValue( const double t, bool& ok ) double StdMeshersGUI_DistrPreview::calc( bool& ok ) { - OSD::SetSignal( true ); double res = 0.0; - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - ok = true; CASCatch_TRY { res = myExpr->Expression()->Evaluate( myVars, myValues ); } - CASCatch_CATCH(CASCatch_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); + CASCatch_CATCH(Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); ok = false; res = 0.0; } - aCatchSignals.Deactivate(); + return res; } @@ -345,9 +346,6 @@ bool StdMeshersGUI_DistrPreview::isDone() const bool StdMeshersGUI_DistrPreview::convert( double& v ) const { - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - bool ok = true; switch( myConv ) { @@ -355,12 +353,15 @@ bool StdMeshersGUI_DistrPreview::convert( double& v ) const { CASCatch_TRY { + // in StdMeshers_NumberOfSegments.cc + // const double PRECISION = 1e-7; + // + if(v < -7) v = -7.0; v = pow( 10.0, v ); } - CASCatch_CATCH(CASCatch_Failure) + CASCatch_CATCH(Standard_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); v = 0.0; ok = false; } @@ -372,6 +373,6 @@ bool StdMeshersGUI_DistrPreview::convert( double& v ) const v = 0; break; } - aCatchSignals.Deactivate(); + return ok; } diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.h b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.h index 88768a8a0..ef230ccb3 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.h +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.h @@ -1,3 +1,22 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 STD_MESHERS_GUI_DISTR_PREVIEW_HEADER #define STD_MESHERS_GUI_DISTR_PREVIEW_HEADER diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx index 31eeae6fe..3d0d2ae44 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.h b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.h index 32e336e2e..a61db1577 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.h +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx index f190fb2ca..02bb83a35 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx @@ -1,3 +1,22 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 "StdMeshersGUI_NbSegmentsCreator.h" #include "StdMeshersGUI_DistrTable.h" @@ -173,6 +192,7 @@ void StdMeshersGUI_NbSegmentsCreator::retrieveParams() const myDistr->setCurrentItem( data.myDistrType ); myScale->setValue( data.myScale ); myConv->setButton( data.myConv ); + myTable->table()->funcValidator()->setBottom(myConv->id( myConv->selected() )==0 ? -1E20 : 0); myTable->table()->setData( data.myTable ); myExpr->setText( data.myExpr ); } diff --git a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.h b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.h index df7989c4e..7002e032e 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.h +++ b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.h @@ -1,3 +1,22 @@ +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 NB_SEGMENTS_CREATOR_HEADER #define NB_SEGMENTS_CREATOR_HEADER diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx index 33abb0698..e90634cf7 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -261,6 +261,10 @@ void StdMeshersGUI_StdHypothesisCreator::attuneStdWidget( QWidget* w, const int { sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 ); } + else if ( sb ) // default validator for possible ancestors + { + sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 ); + } } QString StdMeshersGUI_StdHypothesisCreator::caption() const diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h index 752ba403f..92767007e 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -57,8 +57,7 @@ protected: virtual QWidget* getCustomWidget( const StdParam&, QWidget* ) const; virtual bool getParamFromCustomWidget( StdParam& , QWidget* ) const; -private: - QString hypTypeName( const QString& ) const; + virtual QString hypTypeName( const QString& ) const; }; #endif diff --git a/src/StdMeshersGUI/StdMeshers_images.po b/src/StdMeshersGUI/StdMeshers_images.po index c5978633b..c7397e2e1 100644 --- a/src/StdMeshersGUI/StdMeshers_images.po +++ b/src/StdMeshersGUI/StdMeshers_images.po @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # This is a Qt message file in .po format. Each msgid starts with # a scope. This scope should *NOT* be translated - eg. "Foo::Bar" # would be translated to "Pub", not "Foo::Pub". @@ -80,10 +99,14 @@ msgstr "mesh_tree_algo_quad.png" msgid "ICON_SMESH_TREE_HYPO_MaxElementArea" msgstr "mesh_tree_hypo_area.png" -#mesh_tree_hypo_area +#mesh_tree_hypo_quadranglepreference msgid "ICON_SMESH_TREE_HYPO_QuadranglePreference" msgstr "mesh_tree_algo_quad.png" +#mesh_tree_hypo_quadraticmesh +msgid "ICON_SMESH_TREE_HYPO_QuadraticMesh" +msgstr "mesh_tree_hypo_length.png" + #mesh_tree_hypo_length msgid "ICON_SMESH_TREE_HYPO_LocalLength" msgstr "mesh_tree_hypo_length.png" diff --git a/src/StdMeshersGUI/StdMeshers_msg_en.po b/src/StdMeshersGUI/StdMeshers_msg_en.po index dc86b0046..b7d2616da 100644 --- a/src/StdMeshersGUI/StdMeshers_msg_en.po +++ b/src/StdMeshersGUI/StdMeshers_msg_en.po @@ -1,3 +1,22 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # This is a Qt message file in .po format. Each msgid starts with # a scope. This scope should *NOT* be translated - eg. "Foo::Bar" # would be translated to "Pub", not "Foo::Pub". diff --git a/src/StdMeshers_I/Makefile.in b/src/StdMeshers_I/Makefile.in index 2a5a9c1c4..ab8e80f03 100644 --- a/src/StdMeshers_I/Makefile.in +++ b/src/StdMeshers_I/Makefile.in @@ -16,7 +16,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -53,6 +53,7 @@ EXPORT_HEADERS = \ StdMeshers_Hexa_3D_i.hxx \ StdMeshers_AutomaticLength_i.hxx \ StdMeshers_QuadranglePreference_i.hxx \ + StdMeshers_QuadraticMesh_i.hxx \ SMESH_StdMeshers_I.hxx # Libraries targets @@ -76,7 +77,8 @@ LIB_SRC = \ StdMeshers_MEFISTO_2D_i.cxx \ StdMeshers_Hexa_3D_i.cxx \ StdMeshers_AutomaticLength_i.cxx \ - StdMeshers_QuadranglePreference_i.cxx + StdMeshers_QuadranglePreference_i.cxx \ + StdMeshers_QuadraticMesh_i.cxx LIB_SERVER_IDL = SMESH_BasicHypothesis.idl @@ -91,13 +93,12 @@ BIN = BIN_SRC = # additionnal information to compil and link file -CPPFLAGS+= $(OCC_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \ - -I${GEOM_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) -CXXFLAGS+= $(OCC_CXXFLAGS) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome -I${GEOM_ROOT_DIR}/include/salome +CPPFLAGS+= $(OCC_INCLUDES) $(HDF5_INCLUDES) $(KERNEL_CXXFLAGS) \ + $(GEOM_CXXFLAGS) $(BOOST_CPPFLAGS) +CXXFLAGS+= $(OCC_CXXFLAGS) $(HDF5_INCLUDES) $(KERNEL_CXXFLAGS) $(GEOM_CXXFLAGS) #IDLCXXFLAGS+= -Wbtp -#LDFLAGS+= $(HDF5_LIBS) -lStdMeshers -lSMESHEngine -lSalomeLifeCycleCORBA -L${KERNEL_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome -lSalomeGenericObj -LDFLAGS+= $(HDF5_LIBS) -lStdMeshers -lSMESHEngine -L${KERNEL_ROOT_DIR}/lib/salome +LDFLAGS+= $(HDF5_LIBS) -lStdMeshers -lSMESHEngine $(KERNEL_LDFLAGS) @CONCLUDE@ diff --git a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx index ecd770cf7..ef47c3f0a 100644 --- a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx index 7a3ffb7fc..8c6ad55cd 100644 --- a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.cxx b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.cxx index b93f6a409..278a70efa 100644 --- a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.cxx +++ b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx index 08185ff1b..b378a1eb5 100644 --- a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx +++ b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx b/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx index d38b7968e..b5b3cff5b 100644 --- a/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx b/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx index 533394dfa..2274345db 100644 --- a/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx index ff362cf0c..8f98cd6e1 100644 --- a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx index 0656a612c..1910da3b1 100644 --- a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx index 75659d265..d96af29ef 100644 --- a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx +++ b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx index 0ec4e95bb..c7ebd3322 100644 --- a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx +++ b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx b/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx index 3a84d59c2..4190c1b8c 100644 --- a/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx +++ b/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx b/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx index cb76262c5..62c73cbc8 100644 --- a/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx +++ b/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx b/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx index eee3c9e89..316ea8d8e 100644 --- a/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx b/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx index 3016118a2..5f7d7ca83 100644 --- a/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx index f8cb90638..a9e7f9f52 100644 --- a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx +++ b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx index 94f9cac8a..f9201c74f 100644 --- a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx +++ b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx index 061148259..c85a005f5 100644 --- a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx +++ b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx index ee1f0529d..f5429359b 100644 --- a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx +++ b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.cxx b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.cxx index af8a23f71..92775c5ff 100644 --- a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.cxx +++ b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx index bf730f257..ef0b1e327 100644 --- a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx +++ b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx index a9579654c..7f164a290 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -79,8 +79,10 @@ StdMeshers_NumberOfSegments_i::~StdMeshers_NumberOfSegments_i() * Builds point distribution according to passed function */ //============================================================================= -SMESH::double_array* StdMeshers_NumberOfSegments_i::BuildDistributionExpr( const char* func, long nbSeg, long conv ) -throw ( SALOME::SALOME_Exception ) +SMESH::double_array* StdMeshers_NumberOfSegments_i::BuildDistributionExpr( const char* func, + CORBA::Long nbSeg, + CORBA::Long conv ) + throw ( SALOME::SALOME_Exception ) { MESSAGE( "StdMeshers_NumberOfSegments_i::BuildDistribution" ); ASSERT( myBaseImpl ); @@ -100,8 +102,9 @@ throw ( SALOME::SALOME_Exception ) } SMESH::double_array* StdMeshers_NumberOfSegments_i::BuildDistributionTab( const SMESH::double_array& func, - long nbSeg, long conv ) -throw ( SALOME::SALOME_Exception ) + CORBA::Long nbSeg, + CORBA::Long conv ) + throw ( SALOME::SALOME_Exception ) { MESSAGE( "StdMeshers_NumberOfSegments_i::BuildDistribution" ); ASSERT( myBaseImpl ); @@ -309,7 +312,7 @@ void StdMeshers_NumberOfSegments_i::SetExpressionFunction(const char* expr) try { this->GetImpl()->SetExpressionFunction( expr ); // Update Python script - SMESH::TPythonDump() << _this() << ".SetExpressionFunction( " << expr << " )"; + SMESH::TPythonDump() << _this() << ".SetExpressionFunction( '" << expr << "' )"; } catch ( SALOME_Exception& S_ex ) { THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx index f84844bdb..a1dda71e4 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_Propagation_i.cxx b/src/StdMeshers_I/StdMeshers_Propagation_i.cxx index f59bfc645..f80085017 100644 --- a/src/StdMeshers_I/StdMeshers_Propagation_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Propagation_i.cxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_Propagation_i.hxx b/src/StdMeshers_I/StdMeshers_Propagation_i.hxx index a9fdfe16a..188b64810 100644 --- a/src/StdMeshers_I/StdMeshers_Propagation_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Propagation_i.hxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.cxx b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.cxx index 35006230d..dc2eb803d 100644 --- a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.cxx +++ b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx index cdc3e8f0c..f4897d680 100644 --- a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx +++ b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx index 8e68d1375..8031a92de 100644 --- a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.hxx b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.hxx index 4cbfa7fd4..3c3054433 100644 --- a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx b/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx index 90c74e3d9..fc901f4e7 100644 --- a/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx +++ b/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_QuadraticMesh_I_HXX_ #define _SMESH_QuadraticMesh_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -41,7 +43,7 @@ class SMESH_Gen; // ====================================================== // Local Length hypothesis // ====================================================== -class StdMeshers_QuadraticMesh_i: +class STDMESHERS_I_EXPORT StdMeshers_QuadraticMesh_i: public virtual POA_StdMeshers::StdMeshers_QuadraticMesh, public virtual SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx b/src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx index 0a75340eb..5ecf5c443 100644 --- a/src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx b/src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx index 42148a9c7..5ecf97ef4 100644 --- a/src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx index d6c4c675b..298f82891 100644 --- a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx +++ b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx b/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx index 5a8c602b7..506bb912c 100644 --- a/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx +++ b/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/StdMeshers_I/StdMeshers_i.cxx b/src/StdMeshers_I/StdMeshers_i.cxx index d44b67017..e9708c506 100644 --- a/src/StdMeshers_I/StdMeshers_i.cxx +++ b/src/StdMeshers_I/StdMeshers_i.cxx @@ -16,7 +16,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -40,6 +40,7 @@ #include "StdMeshers_Propagation_i.hxx" #include "StdMeshers_LengthFromEdges_i.hxx" #include "StdMeshers_QuadranglePreference_i.hxx" +#include "StdMeshers_QuadraticMesh_i.hxx" #include "StdMeshers_MaxElementArea_i.hxx" #include "StdMeshers_MaxElementVolume_i.hxx" #include "StdMeshers_NotConformAllowed_i.hxx" @@ -49,7 +50,11 @@ #include "StdMeshers_Quadrangle_2D_i.hxx" #include "StdMeshers_Hexa_3D_i.hxx" -using namespace std; +template class StdHypothesisCreator_i:public HypothesisCreator_i +{ + // as we have 'module StdMeshers' in SMESH_BasicHypothesis.idl + virtual std::string GetModuleName() { return "StdMeshers"; } +}; //============================================================================= /*! @@ -68,39 +73,41 @@ STDMESHERS_I_EXPORT // Hypotheses if (strcmp(aHypName, "LocalLength") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "NumberOfSegments") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "LengthFromEdges") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "NotConformAllowed") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "Propagation") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "MaxElementArea") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "MaxElementVolume") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "StartEndLength") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "Deflection1D") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "Arithmetic1D") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "AutomaticLength") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "QuadranglePreference") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; + else if (strcmp(aHypName, "QuadraticMesh") == 0) + aCreator = new StdHypothesisCreator_i; // Algorithms else if (strcmp(aHypName, "Regular_1D") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "MEFISTO_2D") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "Quadrangle_2D") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "Hexa_3D") == 0) - aCreator = new HypothesisCreator_i; + aCreator = new StdHypothesisCreator_i; else ; return aCreator;

 See - Also a sample TUI Script of an Extrusion - operation.