-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
+SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
# Find KERNEL
# ===========
LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
INCLUDE(SalomeMacros)
FIND_PACKAGE(SalomeKERNEL REQUIRED)
+ KERNEL_WITH_CORBA() #check whether KERNEL builded with CORBA
ELSE(EXISTS ${KERNEL_ROOT_DIR})
MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
ENDIF(EXISTS ${KERNEL_ROOT_DIR})
-IF(SALOME_LIGHT_ONLY)
- MESSAGE(FATAL_ERROR "SMESH module can't be built in Light mode (without CORBA)")
-ENDIF()
-
# Platform setup
# ==============
INCLUDE(SalomeSetupPlatform) # From KERNEL
IF(EXISTS ${GUI_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
FIND_PACKAGE(SalomeGUI)
-
+ FULL_GUI(TRUE) #check whether GUI builded in full mode and with CORBA
##
## Prerequisites From GUI:
##
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#
###############################################################
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# See http://www.salome-platform.org/ or
-# email : webmaster.salome@opencascade.com
-###############################################################
### Initialisation performed by CONFIGURE_PACKAGE_CONFIG_FILE:
@PACKAGE_INIT@
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#
#########################################################################
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#
IF(NOT SalomeSMESH_FIND_QUIETLY)
MESSAGE(STATUS "Looking for Salome SMESH ...")
-# Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#
#########################################################################
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#
#########################################################################
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#
ADD_SUBDIRECTORY(salome)
-ADD_SUBDIRECTORY(docutils)
+++ /dev/null
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-SALOME_CONFIGURE_FILE(conf.py.in conf.py)
-
-SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} docutils)
-
-# This macro mainly prepares the environment in which sphinx should run:
-# this sets the PYTHONPATH and LD_LIBRARY_PATH to include OMNIORB, DOCUTILS, SETUPTOOLS, etc ...
-SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_cmd_options}")
-
-ADD_CUSTOM_TARGET(html_docs COMMAND ${_cmd})
-
-INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target html_docs)")
-INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docutils DESTINATION ${SALOME_INSTALL_DOC}/tui/SMESH)
-INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/salome/tui/images/head.png ${PROJECT_SOURCE_DIR}/doc/salome/tui/images/smeshscreen.png
- DESTINATION ${SALOME_INSTALL_DOC}/tui/SMESH)
-
-SET(make_clean_files docutils doctrees)
-SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")
+++ /dev/null
-# -*- coding: iso-8859-1 -*-
-#
-# yacs documentation build configuration file, created by
-# sphinx-quickstart on Fri Aug 29 09:57:25 2008.
-#
-# This file is execfile()d with the current directory set to its containing dir.
-#
-# The contents of this file are pickled, so don't put values in the namespace
-# that aren't pickleable (module imports are okay, they're removed automatically).
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import sys, os
-
-# If your extensions are in another directory, add it here. If the directory
-# is relative to the documentation root, use os.path.abspath to make it
-# absolute, like shown here.
-#sys.path.append(os.path.abspath('.'))
-
-# General configuration
-# ---------------------
-
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc']
-
-# Uncomment the following line to build the links with Python documentation
-# (you might need to set http_proxy environment variable for this to work)
-#extensions += ['sphinx.ext.intersphinx']
-
-# Intersphinx mapping to add links to modules and objects in the Python
-# standard library documentation
-intersphinx_mapping = {'http://docs.python.org': None}
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-source_encoding = 'utf-8'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = 'SMESH python packages'
-copyright = '2010 EDF R&D'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = '@SALOMESMESH_VERSION@'
-# The full version, including alpha/beta/rc tags.
-release = '@SALOMESMESH_VERSION@'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-language = 'en'
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of documents that shouldn't be included in the build.
-#unused_docs = []
-
-# List of directories, relative to source directory, that shouldn't be searched
-# for source files.
-exclude_trees = ['.build','ref','images','CVS','.svn']
-
-# The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-
-# Options for HTML output
-# -----------------------
-
-# The theme to use for HTML and HTML Help pages. Major themes that come with
-# Sphinx are currently 'default' and 'sphinxdoc'.
-html_theme = 'default'
-#html_theme = 'nature'
-#html_theme = 'agogo'
-#html_theme = 'sphinxdoc'
-#html_theme = 'omadoc'
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = ['themes']
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-#html_static_path = ['_static']
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-html_use_modindex = False
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, the reST sources are included in the HTML build as _sources/<name>.
-html_copy_source = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = ''
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'smeshpydoc'
-
-
-# Options for LaTeX output
-# ------------------------
-
-# The paper size ('letter' or 'a4').
-latex_paper_size = 'a4'
-
-# The font size ('10pt', '11pt' or '12pt').
-latex_font_size = '10pt'
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, document class [howto/manual]).
-latex_documents = [
- ('index', 'smeshpy.tex', 'Documentation of the SMESH python packages', 'EDF R\&D', 'manual')
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-latex_logo = '@CMAKE_CURRENT_SOURCE_DIR@/../salome/tui/images/head.png'
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = True
-
-# Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-latex_use_modindex = False
+++ /dev/null
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- Documentation of the programming interface (API)
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-This section describes the python packages and modules of the
-``salome.smesh`` python package. The main part is generated from the
-code documentation included in source python files.
-
-:mod:`salome.smesh` -- Package containing the SMESH python utilities
-====================================================================
-
-:mod:`smeshstudytools` -- Tools to access SMESH objects in the study
---------------------------------------------------------------------
-
-.. automodule:: salome.smesh.smeshstudytools
- :members:
+++ /dev/null
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- Documentation of the SMESH python package
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-.. toctree::
- :maxdepth: 3
-
- overview.rst
- docapi.rst
+++ /dev/null
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-General presentation of the SMESH python package
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-The SMESH python package contains (today) helper functions to
-manipulate mesh elements and interact with these elements.
-
-Note that these functions either encapsulate the python programming
-interface of SMESH core (the CORBA or SWIG interface for example) or
-extend existing utilities as the ``smesh.py`` module.
-
-The functions are distributed in the python package
-``salome.smesh``.
-
-The specification of the programming interface of this package is
-detailled in the part :doc:`Documentation of the programming interface
-(API)</docapi>` of this documentation.
-
-.. note::
- The main package ``salome`` contains other sub-packages that are
- distributed with the other SALOME modules. For example, the KERNEL
- module provides the python package ``salome.kernel`` and GEOM the
- package ``salome.geom``.
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
print "nb tetrahedra",mesh.NbTetras()
print "nb polyhedra",mesh.NbPolyhedrons()
print
+
+# Example of customization of dirtections of the grid axes
+
+# make a box with non-orthogonal edges
+xDir = geompy.MakeVectorDXDYDZ( 1.0, 0.1, 0.0, "xDir" )
+yDir = geompy.MakeVectorDXDYDZ(-0.1, 1.0, 0.0, "yDir" )
+zDir = geompy.MakeVectorDXDYDZ( 0.2, 0.3, 1.0, "zDir" )
+face = geompy.MakePrismVecH( xDir, yDir, 1.0 )
+box = geompy.MakePrismVecH( face, zDir, 1.0, theName="box" )
+
+spc = "0.1" # spacing
+
+# default axes
+mesh = smesh.Mesh( box, "custom axes")
+algo = mesh.BodyFitted()
+algo.SetGrid( spc, spc, spc, 10000 )
+mesh.Compute()
+print "Default axes"
+print " nb hex:",mesh.NbHexas()
+
+# set axes using edges of the box
+algo.SetAxesDirs( xDir, [-0.1,1,0], zDir )
+mesh.Compute()
+print "Manual axes"
+print " nb hex:",mesh.NbHexas()
+
+# set optimal orthogonal axes
+algo.SetOptimalAxesDirs( isOrthogonal=True )
+mesh.Compute()
+print "Optimal orthogonal axes"
+print " nb hex:",mesh.NbHexas()
+
+# set optimal non-orthogonal axes
+algo.SetOptimalAxesDirs( isOrthogonal=False )
+mesh.Compute()
+print "Optimal non-orthogonal axes"
+print " nb hex:",mesh.NbHexas()
-# Arithmetic 1D
+# Arithmetic 1D and Geometric Progression
import salome
salome.salome_init()
-import GEOM
+
from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
-import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
algo1D = hexa.Segment()
# optionally reverse node distribution on certain edges
-allEdges = geompy.SubShapeAllSortedIDs( box, geompy.ShapeType["EDGE"])
+allEdges = geompy.SubShapeAllSorted( box, geompy.ShapeType["EDGE"])
reversedEdges = [ allEdges[0], allEdges[4] ]
# define "Arithmetic1D" hypothesis to cut all edges in several segments with increasing arithmetic length
algo1D.Arithmetic1D(1, 4, reversedEdges)
+# define "Geometric Progression" hypothesis on one edge to cut this edge in segments with length increasing by 20% starting from 1
+gpAlgo = hexa.Segment( allEdges[1] )
+gpAlgo.GeometricProgression( 1, 1.2 )
+
+# propagate distribution of nodes computed using "Geometric Progression" to parallel edges
+gpAlgo.PropagationOfDistribution()
+
+
# create a quadrangle 2D algorithm for faces
hexa.Quadrangle()
smesh = smeshBuilder.New(salome.myStudy)
# create a box
-box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
+base = geompy.MakeSketcher("Sketcher:F 0 0:TT 10 0:TT 20 10:TT 0 10:WF", theName="F")
+box = geompy.MakePrismDXDYDZ( base, 0,0,10 )
geompy.addToStudy(box, "Box")
# get one edge of the box to put local hypothesis on
geompy.addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
# create a hexahedral mesh on the box
-hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
+hexa = smesh.Mesh(box, "Propagation of hypothesis")
# set global algorithms and hypotheses
algo1D = hexa.Segment()
hexa.Hexahedron()
algo1D.NumberOfSegments(4)
-# create a sub-mesh with local 1D hypothesis and propagation
+# create a sub-mesh with local 1D hypothesis and "Propagation of 1D Hypothesis"
algo_local = hexa.Segment(EdgeX)
# define "Arithmetic1D" hypothesis to cut an edge in several segments with increasing length
algo_local.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
+# define "Propagation" hypothesis that propagates "Arithmetic1D" hypothesis
+# from 'EdgeX' on opposite sides of all quadilateral faces
algo_local.Propagation()
-# compute the mesh
+# compute the mesh which contains prisms
hexa.Compute()
+
+
+# create another mesh on the box
+mesh = smesh.Mesh(box, "Propagation of distribution of nodes")
+
+# set global algorithms and hypotheses
+algo1D = mesh.Segment()
+mesh.Quadrangle()
+mesh.Hexahedron()
+algo1D.NumberOfSegments(4)
+
+# create a sub-mesh with local 1D hypothesis and "Propagation of Node Distribution"
+algo_local = mesh.Segment(EdgeX)
+algo_local.Arithmetic1D(1, 4)
+
+# define "Propagation Of Distribution" hypothesis that propagates
+# distribution of nodes generated by "Arithmetic1D" hypothesis
+# from 'EdgeX' on opposite sides of all quadilateral faces
+algo_local.PropagationOfDistribution()
+
+# compute the mesh which contains hexahedra only
+mesh.Compute()
-# "Use Existing Elements" example
+# "Import 2D Elements from Another Mesh" example
import salome
salome.salome_init()
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Use existing faces algorithm
+# Usage of "Use Faces to be Created Manually" algorithm
import salome
# compute 2D mesh
mesh.Quadrangle()
-mesh.UseExistingFaces(f1) # UseExistingFaces() allows using my2DMeshing()
-mesh.UseExistingFaces(f2)
+mesh.UseExistingFaces(f1) # UseExistingFaces() allows using my2DMeshing();
+mesh.UseExistingFaces(f2) # assign UseExistingFaces() BEFORE calling my2DMeshing()!
my2DMeshing( f1 )
my2DMeshing( f2 )
assert mesh.Compute()
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
SALOME_ACCUMULATE_ENVIRONMENT(SMESH_MeshersList NOCHECK ${DOC_SMESH_MeshersList})
-SET(_cmd_options ${smesh_file} -d -o tmp/smeshBuilder.py StdMeshers)
+SET(_cmd_options ${smesh_file} -d -o tmp1/smeshBuilder.py StdMeshers)
SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${PYTHON_EXECUTABLE}" "${_cmd_options}")
ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp1
COMMAND ${PYTHON_EXECUTABLE} ${kernel_file} -o tmp2/smeshBuilder.py ${CMAKE_SOURCE_DIR}/src/SMESH_SWIG/smeshBuilder.py
COMMAND ${PYTHON_EXECUTABLE} ${kernel_file} -o tmp2/smesh_algorithm.py ${CMAKE_SOURCE_DIR}/src/SMESH_SWIG/smesh_algorithm.py
COMMAND ${PYTHON_EXECUTABLE} ${kernel_file} -o tmp2/StdMeshersBuilder.py ${CMAKE_SOURCE_DIR}/src/SMESH_SWIG/StdMeshersBuilder.py
+ COMMAND ${PYTHON_EXECUTABLE} ${kernel_file} -o tmp2/smeshstudytools.py ${CMAKE_SOURCE_DIR}/src/SMESH_PY/smeshstudytools.py
COMMAND ${_cmd}
COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py
COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
INPUT = tmp2/smeshBuilder.py \
tmp2/smesh_algorithm.py \
tmp2/StdMeshersBuilder.py \
+ tmp2/smeshstudytools.py \
tmp1/smeshBuilder.py
FILE_PATTERNS =
IMAGE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/images
<ul>
<li>\ref adaptive_1d_anchor "Adaptive"</li>
<li>\ref arithmetic_1d_anchor "Arithmetic 1D"</li>
+<li>\ref geometric_1d_anchor "Geometric Progression"</li>
<li>\ref average_length_anchor "Local Length"</li>
<li>\ref max_length_anchor "Max Size"</li>
<li>\ref deflection_1d_anchor "Deflection 1D"</li>
\image html b-ithmetic1d.png "Arithmetic 1D hypothesis - the size of mesh elements gradually increases"
<b>See Also</b> a sample TUI Script of a
-\ref tui_1d_arithmetic "Defining Arithmetic 1D hypothesis" operation.
+\ref tui_1d_arithmetic "Defining Arithmetic 1D and Geometric Progression hypothesis" operation.
+
+<br>
+\anchor geometric_1d_anchor
+<h2>Geometric Progression hypothesis</h2>
+
+<b>Geometric Progression</b> hypothesis allows to split edges into
+segments with a length that changes in geometric progression (Lk =
+Lk-1 * d) beginning from a given starting length and with a given
+common ratio.
+
+The direction of the splitting is defined by the orientation of the
+underlying geometrical edge. <b>"Reverse Edges"</b> list box allows to
+specify the edges for which the splitting should be made in the
+direction opposing to their orientation. This list box is enabled only
+if the geometry object is selected for the meshing. In this case the
+user can select edges to be reversed either directly picking them in
+the 3D viewer or by selecting the edges or groups of edges in the
+Object Browser.
+
+\image html a-geometric1d.png
+
+<b>See Also</b> a sample TUI Script of a
+\ref tui_1d_arithmetic "Defining Arithmetic 1D and Geometric Progression hypothesis" operation.
<br>
\anchor deflection_1d_anchor
\image html hypo_quad_params_dialog.png "Quadrangle parameters creation/edition dialog"
-<b>Quadrangle parameters</b> is a hypothesis for Quadrangle (Mapping).
+<b>Quadrangle parameters</b> is a hypothesis for Quadrangle (Mapping) algorithm.
-<b>Base vertex</b> parameter allows using Quadrangle (Mapping)
-algorithm for meshing of trilateral faces. In this case it is
-necessary to select the vertex, which will be used as the fourth edge
-(degenerated).
-
-\image html hypo_quad_params_1.png "A face built from 3 edges"
-
-\image html hypo_quad_params_res.png "The resulting mesh"
-
-This parameter can be also used to mesh a segment of a circular face.
-Please, consider that there is a limitation on the selection of the
-vertex for the faces built with the angle > 180 degrees (see the picture).
-
-\image html hypo_quad_params_2.png "3/4 of a circular face"
-
-In this case, selection of a wrong vertex for the <b>Base vertex</b>
-parameter will generate a wrong mesh. The picture below
-shows the good (left) and the bad (right) results of meshing.
-
-\image html hypo_quad_params_res_2.png "The resulting meshes"
-
-<b>Type</b> parameter is used on faces with a different number of
-segments on opposite sides to define the algorithm of transition
-between them. The following types are available:
+<b>Transition</b> tab is used to define the algorithm of transition
+between opposite sides of faces with a different number of
+segments on opposite sides. The following types of transition
+algorithms are available:
- <b>Standard</b> is the default case, when both triangles and quadrangles
are possible in the transition area along the finer meshed sides.
to Nmin segments is log<sub>3</sub>( Nmax / Nmin ). The number of
face rows is equal to the number of segments on each of equally
discretized sides.
- \image html reduce_three_to_one.png "The fastest transition pattern: 3 to 1"
+
+\image html reduce_three_to_one.png "The fastest transition pattern: 3 to 1"
+
+<b>Base vertex</b> tab allows using Quadrangle (Mapping)
+algorithm for meshing of trilateral faces. In this case it is
+necessary to select the vertex, which will be used as the fourth edge
+(degenerated).
+
+\image html hypo_quad_params_dialog_vert.png "Base Vertex tab of Quadrangle parameters creation/edition dialog"
+
+\image html hypo_quad_params_1.png "A face built from 3 edges"
+
+\image html hypo_quad_params_res.png "The resulting mesh"
+
+This parameter can be also used to mesh a segment of a circular face.
+Please, consider that there is a limitation on the selection of the
+vertex for the faces built with the angle > 180 degrees (see the picture).
+
+\image html hypo_quad_params_2.png "3/4 of a circular face"
+
+In this case, selection of a wrong vertex for the <b>Base vertex</b>
+parameter will generate a wrong mesh. The picture below
+shows the good (left) and the bad (right) results of meshing.
+
+\image html hypo_quad_params_res_2.png "The resulting meshes"
+
+\image html hypo_quad_params_dialog_enf.png "Enforced nodes tab of Quadrangle parameters creation/edition dialog"
+
+<b>Enforced nodes</b> tab allows for defining points where the
+algorithm should create nodes. There are two ways to define positions
+of the enforced nodes.
+<ul>
+ <li>\b Vertices group allows to set up shapes whose vertices will
+ define positions of the enforced nodes. Only vertices successfully
+ projected to the meshed face and located close enough to the
+ meshed face will be used to create the enforced nodes.</li>
+ <li> \b Points group allows to explicitly define coordinates of
+ points used to create the enforced nodes. Only points successfully
+ projected to the meshed face and located close enough to the
+ meshed face will be used to create the enforced nodes.</li>
+</ul>
+Algorithm of creation of the enforced nodes is following.
+
+\image html hypo_quad_params_enfnodes_algo.png "Steps of the algorithm of creation of the enforced nodes"
+<ol>
+ <li> Left image: Positions of nodes are computed without taking into
+ account the enforced vertex (yellow point).</li>
+ <li> Middle image: A node closest to the enforced vertex is
+ detected. Extreme nodes of the row and column of the detected node
+ are used to create virtual edges (yellow lines) ending at the
+ enforced vertex. </li>
+ <li> Right image: The meshed face is thus divided by the virtual
+ edges into four quadrilateral sub-domains each of which is meshed
+ as usually: the nodes of the row and column of detected node are
+ moved to the virtual edges and the quadrilateral elements are
+ constructed.
+</ol>
+If there are several enforced vertices, the algorithm is applied
+recursively to the formed sub-domains.
<b>See Also</b> a sample TUI Script of a
\ref tui_quadrangle_parameters "Quadrangle Parameters" hypothesis.
<li>\ref max_length_anchor "Max Size"</li>
<li>\ref adaptive_1d_anchor "Adaptive"</li>
<li>\ref arithmetic_1d_anchor "Arithmetic 1D"</li>
+<li>\ref geometric_1d_anchor "Geometric 1D"</li>
<li>\ref start_and_end_length_anchor "Start and end length"</li>
<li>\ref deflection_1d_anchor "Deflection 1D"</li>
<li>\ref automatic_length_anchor "Automatic Length"</li>
with other hypotheses:
<ul>
<li>\ref propagation_anchor "Propagation of 1D Hypothesis on opposite edges"</li>
+<li>\ref propagofdistribution_anchor "Propagation of Node Distribution on Opposite Edges"</li>
<li>\ref viscous_layers_anchor "Viscous layers"</li>
<li>\ref quadratic_mesh_anchor "Quadratic mesh"</li>
<li>\ref non_conform_allowed_anchor "Non conform mesh allowed"</li>
\n \b MESH represents a discretization of a geometrical CAD model into
a set of entities with a simple topology.
-Meshes are stored in DAT, MED, UNV, STL, CGNS, GMF and SAUVE formats and can be
-\subpage importing_exporting_meshes_page "imported from and exported to"
- the file in these formats.
-
It is possible to \subpage constructing_meshes_page "construct meshes"
on the basis of geometrical shapes produced in the GEOM module.
It is also possible to
\subpage constructing_submeshes_page "construct mesh on a part of the geometrical object",
-for example, a face, with different meshing parameters than the whole mesh.
+for example, a face, with different meshing parameters or using
+another meshing algorithm than the whole mesh.
Several created meshes can be \subpage building_compounds_page "combined into another mesh".
Meshes can be edited using the MESH functions destined for
\ref modifying_meshes_page "modification" of generated meshes.
+Meshes are stored in DAT, MED, UNV, STL, CGNS, GMF and SAUVE formats and can be
+\subpage importing_exporting_meshes_page "imported from and exported to"
+ the file in these formats.
+
The \b topology of a mesh is described by the relationships between its
entities including:
<br><b>See Also</b> a sample TUI Script of a
\ref tui_propagation "Propagation hypothesis" operation
+\anchor propagofdistribution_anchor
+<h2>Propagation of Node Distribution on Opposite Edges</h2>
+
+<b>Propagation of Node Distribution on Opposite Edges</b> allows to propagate
+distribution of nodes 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 number of nodes and the same
+relations between segment lengths, unless another hypothesis
+has been locally defined on the opposite edge.
+
+<br><b>See Also</b> a sample TUI Script of a
+\ref tui_propagation "Propagation hypothesis" operation
+
\anchor quadrangle_preference_anchor
<h2>Quadrangle Preference</h2>
<li><b>Number of layers</b> - defines the number of element layers.</li>
<li><b>Stretch factor</b> - defines the growth factor of element height
from the mesh boundary inwards.</li>
-<li><b>Specified Edges are</b> - defines how the shapes specified by
+<li><b>Specified Faces/Edges are</b> - defines how the shapes specified by
the next parameter are used.
-<li><b>Faces without layers</b> and <b>Edges with/without layers</b> -
- in the 3D case it defines geometrical faces on which element layers
- should not be constructed; in the 2D case it defines geometrical edges
- on which element layers either should be or should not be
- constructed, depending on the value of the previous parameter
- (<b>Specified Edges are</b>).
+<li><b> Faces/Edges with/without layers</b> -
+ defines geometrical faces or edges on which element layers
+ either should be or should not be constructed, depending on the
+ value of the previous parameter (<b>Specified Faces/Edges are</b>).
+ Faces (or edges) can be selected either in the Object Browser or in
+ the VTK Viewer.
\note A mesh shown in the 3D Viewer can prevent selection of faces
and edges, just hide the mesh to avoid this. To avoid a long wait when a
geometry with many faces (or edges) is displayed, the number of faces
(edges) shown at a time is limited by the value of "Sub-shapes
preview chunk size" preference (in Preferences/Mesh/General tab).<br>
- Whatever shapes are specified by this
- parameter, the element layers are not constructed on geometrical
- faces shared by several solids in 3D case and edges shared by
- several faces in 2D case. In other words the element layers can be
- constructed on boundary faces and edges, and are not constructed on
- internal faces and edges. There is an exception to this rule in 2D
- case: if "Viscous Layers 2D" hypothesis is assigned to a sub-mesh,
- the element layers can be constructed on boundary edges of the shape
- of this sub-mesh.
+ If faces/edges without layers are specified, the element layers are
+ not constructed on geometrical faces shared by several solids in 3D
+ case and edges shared by several faces in 2D case. In other words,
+ in this mode the element layers can be constructed on boundary faces
+ and edges only, and are not constructed on internal faces and
+ edges. There is an exception to this rule: if a hypothesis is
+ assigned to a sub-mesh, the element layers can be constructed on
+ boundary faces/edges of the shape of this sub-mesh, at same time
+ possibly being internal faces/edges within the whole model.
\image html viscous_layers_on_submesh.png 2D viscous layers constructed on boundary edges of a sub-mesh on a disk face.
</li>
<br><b>See also</b> a sample TUI script of a \ref tui_viscous_layers
"Viscous layers construction".
-
*/
<li>\subpage prism_3d_algo_page "for meshing prismatic shapes"</li>
<li>\subpage radial_quadrangle_1D2D_algo_page "for meshing special 2d faces (circles and part of circles)"</li>
</ul>
-\ref use_existing_anchor "Use existing edges" and
-\ref use_existing_anchor "Use existing faces" algorithms can be
+\ref use_existing_anchor "Use Edges to be Created Manually" and
+\ref use_existing_anchor "Use Faces to be Created Manually" algorithms can be
used to create a 1D or a 2D mesh in a python script.
\ref constructing_meshes_page "Constructing meshes" page describes in
To apply this algorithm when you define your mesh, select <b>Body
Fitting</b> in the list of 3D algorithms and click <em> "Add
Hypothesis" </em> button and <em>"Body Fitting Parameters"</em>" menu
- item. Dialog of <b>Body Fitting Parameters
+item. Dialog of <b>Body Fitting Parameters
hypothesis</b> will appear.
<br>
This dialog allows to define
<ul>
-<li>\b Name of the algorithm </li>
-<li> Minimal size of a cell truncated by the geometry boundary. If the
- size of a truncated grid cell is \b Threshold times less than a
- initial cell size, then a mesh element is not created. </li>
-<li> Cartesian structured grid. Each grid axis is defined
- individually. <b> Definition mode </b> chooses a way of grid
- definition: <ul>
- <li> You can specify the \b Coordinates of grid nodes. \b Insert button
- inserts a node at distance \b Step (negative or positive) from a
- selected node. \b Delete button removes a selected node. Double
- click on a coordinate in the list enables its edition. A grid
- defined by \b Coordinates should enclose the geometry, else the
- algorithm will fail. </li>
- <li> You can define the \b Spacing of a grid as an algebraic formula
- <em>f(t)</em> where \a t is a position along a grid axis
- normalized at [0.0,1.0]. The whole range of geometry can be
- divided into sub-ranges with their own spacing formulas to apply;
+ <li>\b Name of the algorithm. </li>
+ <li> Minimal size of a cell truncated by the geometry boundary. If the
+ size of a truncated grid cell is \b Threshold times less than a
+ initial cell size, then a mesh element is not created. </li>
+ <li> <b> Implement Edges </b> check-box activates incorporation of
+ geometrical edges in the mesh.
+\image html cartesian_implement_edge.png "'Implement Edges' switched off (left) and on (right)"
+ <li> Cartesian structured grid. Location of nodes along each grid axis
+ is defined individually. <b> Definition mode </b> chooses a way of
+ grid definition:
+ <ul>
+ <li> You can specify the \b Coordinates of grid nodes. \b Insert button
+ inserts a node at distance \b Step (negative or positive) from a
+ selected node. \b Delete button removes a selected node. Double
+ click on a coordinate in the list enables its edition.
+ \b Note that node coordinates are measured along directions of
+ axes that can differ from the directions of the Global Coordinate
+ System.</li>
+ <li> You can define the \b Spacing of a grid as an algebraic formula
+ <em>f(t)</em> where \a t is a position along a grid axis
+ normalized at [0.0,1.0]. The whole range of geometry can be
+ divided into sub-ranges with their own spacing formulas to apply;
\a t varies between 0.0 and 1.0 within each sub-range. \b Insert button
- divides a selected range into two ones. \b Delete button adds the
- selected sub-range to the previous one. Double click on a range in
- the list enables edition of its right boundary. Double click on a
- function in the list enables its edition.
- </li> </ul>
-</li>
+ divides a selected range into two ones. \b Delete button adds the
+ selected sub-range to the previous one. Double click on a range in
+ the list enables edition of its right boundary. Double click on a
+ function in the list enables its edition.
+ </li> </ul>
+ </li>
+ <li> Coordinates of a <b> Fixed Point</b>. They allow to exactly
+ locate a grid node in a direction defined by spacing. If all the three
+ directions are defined by spacing, then there will be a mesh node at
+ the <b> Fixed Point</b>. If two directions are defined by spacing,
+ then there will be at least a link between mesh nodes passing through
+ the <b> Fixed Point</b>. If only one direction is defined by spacing,
+ then there will be at least an element facet passing through
+ the <b> Fixed Point</b>. If no directions are defined by spacing,
+ <b> Fixed Point</b> is disabled.</li>
+ <li> <b> Directions of Axes</b>. You can set up almost any
+ directions of grid axes that can help in generation of as many as
+ possible hexahedral elements.
+ <ul>
+ <li><b> Orthogonal Axes </b> check-box, if activated, keeps the
+ axes orthogonal during their modification. </li>
+ <li> Selection buttons enable snapping corresponding axes to
+ direction of a geometrical edge selected in the Object
+ Browser. Edge direction is defined by coordinates of its end
+ points.</li>
+ <li><b> Optimal Axes</b> button runs an algorithm that tries to
+ set the axes so that a number of generated hexahedra to be
+ maximal.</li>
+ <li><b> Reset </b> button returns the axes in a default position
+ parallel to the axes of the Global Coordinate System.</li>
+ </ul></li>
</ul>
<br>
-<b>See Also</b> a sample TUI Script of a
-\ref tui_cartesian_algo "Usage of Body Fitting algorithm".
+<b>See Also</b> a sample TUI Script of a
+\ref tui_cartesian_algo "Usage of Body Fitting algorithm".
*/
- \b Balls:
- \b Color - color of discrete ball elements.
- \b Size - size of discrete ball elements.
+ - \b Scale - scale factor of discrete ball elements.
- <b>Orientation vectors</b>:
- \b Color - color of orientation vectors.
- \b Scale - size of orientation vectors.
<br>
</li>
<li>Apply \subpage basic_meshing_algos_page "meshing algorithms" and
- \subpage about_hypo_page "hypotheses" which will be used at computation of
+ \subpage about_hypo_page "hypotheses" which will be used to compute
this mesh.
"Create mesh" dialog box contains several tab pages titled \b 3D,
\b 2D, \b 1D and \b 0D. The title of each page reflects the
dimension of the CAD model (geometry) the algorithms listed on
- this page affect. For example, \b 3D page lists the algorithms
- that affect 3D geometrical objects (solids).
+ this page affect and the maximal dimension of elements the algorithms
+ generate. For example, \b 3D page lists the algorithms that affect
+ 3D geometrical objects (solids).
\note
- Some page(s) can be disabled if the source geometrical
<em>"Edit Hypothesis" button</em>
</center>
- Most standard 2D and 3D algorithms can work without hypotheses
- using some default parameters. The use of additional hypotheses
- is optional (i.e. you may leave "None" in this box).
+ Most 2D and 3D algorithms can work without hypotheses using some
+ default meshing parameters. Some algorithms does not require any
+ hypothesis. After selection of an algorithm "Hypothesis" field of
+ the dialog can contain:
+ <ul>
+ <li> <em>\<Default\></em> if the algorithm can work using default
+ parameters.</li>
+ <li> <em>\<None\></em> if the algorithm requires a hypothesis defining
+ its parameters.</li>
+ <li> Nothing if the algorithm has no parameters to tune.</li>
+ </ul>
+ After selection of an algorithm "Add. Hypothesis" field of
+ the dialog can contain:
+ <ul>
+ <li> <em>\<None\></em> if the algorithm can be additionally tuned
+ using an additional hypothesis.</li>
+ <li> Nothing if the algorithm has no additional parameters to tune.</li>
+ </ul>
Proceed in the same way with 2D and 1D Algorithms and Hypotheses that
will be used to mesh faces and edges of your geometry. (Note
<br><br>
\anchor use_existing_anchor
-<h2>"Use existing edges" and "Use existing faces" algorithms</h2>
+<h2>"Use Edges to be Created Manually" and "Use Faces to be Created Manually" algorithms</h2>
It is possible to create a 1D or a 2D mesh in a python script
(using <em>AddNode, AddEdge</em> and <em>AddFace</em> commands) and
then use such sub-meshes in the construction of a 2D or a 3D mesh. For
-this, there exist two algorithms: <b>Use existing edges</b> and <b>Use
- existing faces</b>.
-For example, you want to use standard algorithms to generate 1D and 3D
+this, there exist two algorithms: <b>Use Edges to be Created
+Manually</b> and <b>Use Faces to be Created Manually</b>.
+Imagine, you want to use standard algorithms to generate 1D and 3D
meshes and to create 2D mesh by your python code. Then you
<ol>
<li> create a mesh object, assign a 1D algorithm,</li>
<li> invoke \b Compute command, which computes a 1D mesh,</li>
- <li> assign <b>Use existing faces</b> and a 3D algorithm,</li>
+ <li> assign <b>Use Faces to be Created Manually</b> and a 3D algorithm,</li>
<li> run your python code, which creates a 2D mesh,</li>
<li> invoke \b Compute command, which computes a 3D mesh.</li>
</ol>
+\warning <b>Use Edges to be Created Manually</b> and <b>Use Faces to
+be Created Manually</b> algorithms should be assigned _before_
+mesh generation by the Python code.
Consider trying a sample script demonstrating the usage of
-\ref tui_use_existing_faces "Use existing faces" algorithm for
-construction of a 2D mesh using Python commands.
+\ref tui_use_existing_faces "Use Faces to be Created Manually"
+algorithm for construction of a 2D mesh using Python commands.
\image html use_existing_face_sample_mesh.png
<em> Mesh computed by \ref tui_use_existing_faces "the sample script"
\n This operation allows duplicating mesh nodes or/and elements, which can be useful to emulate a crack in the model.
-Duplication consists in creation of mesh element "equal" to existing ones.
+Duplication consists in creation of mesh elements "equal" to existing ones.
<em>To duplicate nodes or/and elements:</em>
<ol>
<br>
\image html duplicate_nodes.png "Duplicate Nodes or/and Elements button"
</li>
-<li>Check in the dialog box one of three radio buttons corresponding to
+<li>Check in the dialog box one of four radio buttons corresponding to
the type of duplication operation you would like to perform.</li>
<li>Fill the other fields available in the dialog box (depending on
the chosen operation mode).</li>
operation of duplication.</li>
</ol>
-\n "Duplicate Nodes or/and Elements" dialog has three working modes:
+\n "Duplicate Nodes or/and Elements" dialog has four working modes:
<ul>
<li>\ref mode_without_elem_anchor "Duplicate nodes only"</li>
<li>\ref mode_with_elem_anchor "Duplicate nodes and border elements"</li>
<li>\ref mode_elem_only_anchor "Duplicate elements only"</li>
+<li>\ref mode_group_boundary_anchor "Duplicate nodes on group boundaries"</li>
</ul>
<br>
<h2>Duplicate elements only</h2>
This mode duplicates the given elements, i.e. creates new elements with the same nodes as the given elements.
-
<br>
-
\image html duplicate03.png
+Parameters to be defined in this mode:
<ul>
<li><b>Group of elements to duplicate</b> (<em>mandatory</em>): these
elements will be duplicated.</li>
"DoubleElements".</li>
</ul>
+<br>
+\anchor mode_group_boundary_anchor
+<h2>Duplicate nodes on group boundaries</h2>
+
+This mode duplicates nodes located on boundaries between given groups of
+volumes. If required, flat elements are created on the duplicated
+nodes: a triangular facet shared by two volumes of two groups generates
+a flat prism, a quadrangular facet generates a flat hexahedron.
+<br>
+The created flat volumes are stored in groups. These groups are named
+according to the position of the group in the list of groups: group
+"j_n_p" is a group of flat elements that are built between the group \#n
+and the group \#p in the group list. All the flat elements are gathered
+into the group named "joints3D". The flat element of the multiple
+junctions between the simple junction are stored in a group named
+"jointsMultiples".
+
+<br>
+
+\image html duplicate04.png
+
+Parameters to be defined in this mode:
+<ul>
+<li><b>Groups of volumes</b> (<em>mandatory</em>): list of volume
+ groups. These groups should be disjoint, i.e. should not share volumes.</li>
+<li><b>Create joint elements</b> : if checked - the flat elements are created.</li>
+<li><b>On all boundaries</b> : if checked - then the volumes not
+ included into the <b>Groups of volumes</b> are considered as another given
+ group. And thus nodes on boundary between <b>Groups of volumes</b> and the
+ rest mesh are also duplicated.</li>
+</ul>
+
<br><b>See Also</b> a sample TUI Script of a
\ref tui_duplicate_nodes "Duplicate nodes or/and elements" operation.
\n \b MESH module of SALOME is destined for:
<ul>
-<li>\ref importing_exporting_meshes_page "import and export of meshes in various formats";</li>
<li>\subpage about_meshes_page "meshing geometrical models"
previously created or imported by the Geometry component; </li>
+<li>\ref importing_exporting_meshes_page "import and export of meshes in various formats";</li>
<li>\subpage viewing_meshes_overview_page "viewing created meshes" in
the VTK viewer;</li>
<li>\subpage grouping_elements_page "creating groups of mesh elements";</li>
Almost all mesh module functionalities are accessible via
\subpage smeshpy_interface_page "Mesh module Python interface".
-Other functions are available in <a class="el" target="_new" href="../../tui/SMESH/docutils/index.html">salome.smesh python package</a>.
-
\image html image7.jpg "Example of MESH module usage for engineering tasks"
*/
- <b>Size of 0D elements</b> - specifies default size of 0D elements.
- <b>Size of ball elements</b> - specifies default size of discrete
elements (balls).
+ - <b>Scale factor of ball elements</b> - specifies default scale factor of discrete
+ elements (balls).
- <b>Line width</b> - allows to define the width of 1D elements (edges).
- <b>Outline width</b> - allows to define the width of borders of
2D and 3D elements (shown in the Shading mode).
\image html image67.png
<center><em>"Move Node" button</em></center>
-The following dialog box shall appear:
+One of the following dialogs will appear:
-\image html meshtopass.png
+\image html meshtopass1.png "manual method of selecting node"
+\image html meshtopass2.png "automatic method of selecting node"
</li>
+<li>Specify the way of selection of the node: manually (first radio button) or automatically (second radio button).</li>
+<li>If the manual method selected, select the necessary node (X, Y, Z fields show the original coordinates of the node to move) or set the ID node.</li>
<li>Enter the coordinates of the destination point.</li>
-<li>Check in <b>Find closest to destination</b> option or
-select the necessary node manually (X, Y, Z, dX, dY, dZ fields show the original coordinates and displacement of the node to move).
-\b Preview check-box shows the operation results.</li>
-<li> <b>Update Destination</b> button is activated when <b>Find closest to destination</b> option is unchecked. Click <b>Update Destination</b> button to update the coordinates of the destination point.</li>
-<li>Click the \b Apply or <b>Apply and Close</b> button.</li>
+<li>Click <b>Update Destination</b> button to update the coordinates of the destination point.</li>
+<li>Activate \b Preview checkbox to show the result of move in the viewer</li>
+<li>Click the \b Apply or <b>Apply and Close</b> button to confirm the operation.</li>
</ol>
\image html moving_nodes1.png "The initial mesh"
of the selected elements.</li>
<li>\subpage reorient_faces_page "Reorient faces by vector".</li>
<li>\subpage cutting_quadrangles_page "Cut a quadrangle" into two triangles.</li>
-<li>\subpage split_to_tetra_page "Split" volumic elements into tetrahedra.</li>
+<li>\subpage split_to_tetra_page "Split" volumic elements into tetrahedra or prisms.</li>
<li>\subpage smoothing_page "Smooth" elements, reducung distortions in
them by adjusting the locations of element corners.</li>
<li>Create an \subpage extrusion_page "extrusion" along a vector.</li>
\n You may have to modify your scripts generated with SALOME 6 or older versions.
\n Please see \ref smesh_migration_page
+The SMESH python package contains helper functions to manipulate mesh elements and
+interact with these elements.
+
+Note that these functions either encapsulate the python programming interface of SMESH core
+(the CORBA or SWIG interface for example) or extend existing utilities as the smesh.py module.
+
+The functions are distributed in the python package \b salome.smesh.
+
+\note
+The main package \b salome contains other sub-packages that are distributed with the other
+SALOME modules. For example, the KERNEL module provides the python package \b salome.kernel
+and GEOM the package \b salome.geom.
+
Class \ref smeshBuilder.smeshBuilder "smeshBuilder" provides an interface to create and handle
meshes. It can be used to create an empty mesh or to import mesh from the data file.
+Class \ref smeshstudytools.SMeshStudyTools "SMeshStudyTools" provides several methods to manipulate mesh objects in Salome study.
+
As soon as mesh is created, it is possible to manage it via its own
methods, described in class \ref smeshBuilder.Mesh "Mesh" documentation.
/*!
-\page split_to_tetra_page Splitting volumes into tetrahedra
+\page split_to_tetra_page Splitting volumes
-\n This operation allows to split volumic elements into tetrahedra.
-2D mesh is modified accordingly.
+\n This operation allows to split either any volumic elements into
+tetrahedra or hexahedra into prisms. 2D mesh is modified accordingly.
<em>To split volumes:</em>
<ol>
-<li>Display a mesh or a submesh in the 3D viewer.</li>
-<li>In the \b Modification menu select the <b>Split into Tetrahedra</b> item or
-click <em>"Split into Tetrahedra"</em> button in the toolbar.
+<li>Display a mesh, a sub-mesh or a group in the 3D viewer.</li>
+<li>In the \b Modification menu select the <b>Split Volumes</b> item or
+click <em>"Split Volumes"</em> button in the toolbar.
\image html split_into_tetra_icon.png
-<center><em>"Split into Tetrahedra" button</em></center>
+<center><em>"Split Volumes" button</em></center>
The following dialog box will appear:
\image html split_into_tetra.png
-\par
+<br>
+<b>Target element type</b> group of radio-buttons allows to select
+a type of operation. If \b Tetrahedron button is checked, then the
+operation will split volumes of any type into tetrahedra.
+If \b Prism button is checked, then the operation will split hexahedra
+into prisms, and the dialog will look as follows:
+
+\image html split_into_prisms.png
+
<ul>
-<li>The main list contains the list of volumes. You can click on
-a volume in the 3D viewer and it will be highlighted (lock Shift
-keyboard button to select several volumes). Click \b Add button and
-the ID of this volume will be added to the list. To remove the
-selected element or elements from the list click \b Remove button. <b>Sort
-list</b> button allows to sort the list of IDs. \b Filter button allows to
-apply a definite filter to the selection of volumes.
-<br><b>Note:</b> If you split not all adjacent non-tetrahedral volumes, your mesh becomes
-non-conform.</li>
+<li>The main list contains list of volumes to split. You can click on
+ a volume in the 3D viewer and it will be highlighted (lock Shift
+ keyboard button to select several volumes). Click \b Add button and
+ the ID of this volume will be added to the list. To remove the
+ selected element or elements from the list click \b Remove button. <b>Sort
+ list</b> button allows to sort the list of IDs. \b Filter button allows to
+ apply a definite filter to the selection of volumes.
+ <br><b>Note:</b> If you split not all adjacent non-tetrahedral
+ volumes, your mesh becomes non-conform.</li>
<li><b>Apply to all</b> radio button allows to split all
-volumes of the currently displayed mesh or submesh.</li>
+ volumes of the currently selected mesh.</li>
</ul>
<ul>
-<li>\b Split hexahedron
+<li><b> Split hexahedron </b> group allows to specify a method of
+ splitting hexahedra.
<ul>
-<li><b>Into 5 tetrahedra</b>, <b>Into 6 tetrahedra</b> and <b>Into 24 tetrahedra</b> allows to
-specify the number of tetrahedra a hexahedron will be split into. If the specified method does
-not allow to get a conform mesh, a generic solution is applied: an additional node
-is created at the gravity center of a hexahedron, serving an apex of tetrahedra, all quadrangle sides of the hexahedron are split into two triangles each serving a base of a new tetrahedron.</li>
-</ul>
-
+<li><b>Into N tetrahedra/prisms</b> allows to specify the number of
+ tetrahedra or prisms a hexahedron will be split into. If the
+ specified method does not allow to get a conform mesh, a generic
+ solution is applied: an additional node is created at the gravity
+ center of a hexahedron, serving an apex of tetrahedra, all
+ quadrangle sides of the hexahedron are split into two triangles each
+ serving a base of a new tetrahedron.</li>
+<li> <b> Facet to split </b> group allows to specify a side (facet) of a
+ hexahedron to split into triangles when splitting into prisms.
+ The facet to split is defined by specifying a point and a direction
+ close to normal of the facet. The operation finds a hexahedron most
+ close to the specified point and splits a facet whose normal is most
+ close to the specified direction. Then the splitting is propagated
+ from that hexahedron to all adjacent hexahedra.
+ <ul>
+ <li> <b> Hexa location </b> allows to specify a <em> start
+ point </em> by which a first split hexahedron is found. <em>
+ Selection button</em> switches to selection of the element whose
+ barycenter will be used the start point and whose direction will be
+ used as a normal to facet to split into triangles. To return to
+ selection of volumes to split it is necessary to switch this button
+ off. </li>
+ <li> <b> Facet normal </b> allows to specify a direction of the
+ normal to hexahedron facet to split into triangles.</li>
+ </ul>
+<li><b> All domains </b> - if it is off the operation stops as all
+ hehexedra adjacent to the start hexahedron are split into
+ prisms. Else the operation tries to continue splitting starting from
+ another hexahedron closest to the <b> Hexa location</b>. </li>
</li>
+</ul>
-<li><b>Select from</b> a set of fields allows to choose a submesh or an
-existing group whose elements will be automatically added to the
-list.</li>
+<li><b>Select from</b> a set of fields allows to choose a sub-mesh or an
+ existing group whose elements will be added to the list as you ckick
+ \b Add button.</li>
</ul>
<li>Click the \b Apply or <b>Apply and Close</b> button to confirm the operation.</li>
<ul>
<li>\ref tui_1d_adaptive "Adaptive 1D" hypothesis</li>
<li>\ref tui_1d_arithmetic "Arithmetic 1D" hypothesis</li>
+ <li>\ref tui_1d_arithmetic "Geometric Progression" hypothesis</li>
<li>\ref tui_deflection_1d "Deflection 1D and Number of Segments" hypotheses</li>
<li>\ref tui_start_and_end_length "Start and End Length" hypotheses</li>
<li>\ref tui_average_length "Local Length"</li>
<li> \ref tui_quadrangle_parameters "Quadrangle Parameters" hypothesis </li>
</ul>
</li>
-<li>\ref tui_import "Use Existing Elements" algorithm</li>
+<li>\ref tui_import "Import 1D-2D Elements from Another Mesh" algorithm</li>
</ul>
<br>
<br>
\anchor tui_1d_arithmetic
-<h3>Arithmetic 1D</h3>
+<h3>Arithmetic 1D and Geometric Progression</h3>
\tui_script{defining_hypotheses_ex01.py}
<br>
\tui_script{defining_hypotheses_ex15.py}
\anchor tui_import
-<h2>"Use Existing Elements" example </h2>
+<h2>"Import 1D-2D Elements from Another Mesh" example </h2>
\tui_script{defining_hypotheses_ex16.py}
\anchor tui_viscous_layers
/*!
-\page tui_use_existing_faces Use existing faces algorithm
+\page tui_use_existing_faces Usage of "Use Faces to be Created Manually" algorithm
-This sample demonstrates how to use <b>Use existing faces</b> algorithm,
-which is actulally just a stub allowing to use your own 2D algoritm
+This sample demonstrates how to use <b>Use Faces to be Created Manually</b> algorithm,
+which is actually just a stub allowing to use your own 2D algorithm
implemented in Python.
\tui_script{use_existing_faces.py}
/*!
-\page import_algos_page Use Existing Elements Algorithms
+\page import_algos_page "Import Elements from Another Mesh" Algorithms
-\n <em>Use Existing Elements </em>algorithms allow to define the mesh of a geometrical
+\n <em>Import nD Elements from Another Mesh </em>algorithms allow to
+define the mesh of a geometrical
object by importing suitably located mesh elements from another
mesh. The mesh elements to import from the other mesh should be contained in
groups. If several groups are used to mesh the same geometry, validity of
together using these algorithms.
<br>
-<b>Use Existing 1D Elements</b> algorithm allows to define the mesh of
-a geometrical edge (or group of edges)
+<b>Import 1D Elements from Another Mesh</b> algorithm allows to define
+the mesh of a geometrical edge (or group of edges)
by importing mesh edges contained in a group (or groups) from another mesh.
-\n To apply this algorithm select the edge to be meshed (indicated in
+<br>
+To apply this algorithm select the edge to be meshed (indicated in
the field \b Geometry of <b>Create mesh</b> dialog box),
-<b>Use existing 1D elements</b> in the list of 1D algorithms and click the
-<em>"Add Hypothesis"</em> button.
+<b>Import 1D Elements from Another Mesh</b> in the list of 1D
+algorithms and click the <em>"Add Hypothesis"</em> button.
The following dialog box will appear:
\image html hyp_source_edges.png
the same groups as in the imported source mesh.</li>
</ul>
-<b>Use Existing 2D Elements</b> algorithm allows to define the mesh of
-a geometrical face (or group of faces)
+<b>Import 1D-2D Elements from Another Mesh</b> algorithm allows to define
+the mesh of a geometrical face (or group of faces)
by importing mesh faces contained in a group (or groups) from another
(or this) mesh. 1D elements on the boundary of the geometrical face
(if not yet present) are also created by the algorithm in conformity
-with the created 2D elements.
-\n To apply this algorithm select the geometrical face to be meshed (indicated in
+with the created 2D elements.<br>
+To apply this algorithm select the geometrical face to be meshed (indicated in
the field \b Geometry of <b>Create mesh</b> dialog box),
-<b>Use existing 2D elements</b> in the list of 2D algorithms and click the
-<em>"Add Hypothesis"</em> button.
+<b>Import 1D-2D Elements from Another Mesh</b> in the list of 2D
+algorithms and click the <em>"Add Hypothesis"</em> button.
The following dialog box will appear:
\image html hyp_source_faces.png
</ul>
<br><b>See Also</b> a sample TUI Script of a
-\ref tui_import "Use Existing Elements Algorithms".
+\ref tui_import "Import 2D Elements from Another Mesh".
*/
<ul>
$navpath
<li class="footer">
- Copyright © 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+ Copyright © 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE<br>
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
</li>
</ul>
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
<ul>
$navpath
<li class="footer">
- Copyright © 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+ Copyright © 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE<br>
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
</li>
</ul>
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
double GetFineness();
};
+ /*!
+ * Common inteface of 1D hypotheses that can be reversed
+ */
+ interface Reversible1D
+ {
+ /*!
+ * Set list of edges to reverse
+ */
+ void SetReversedEdges( in SMESH::long_array list );
+
+ /*!
+ * Returns list of edges to reverse
+ */
+ SMESH::long_array GetReversedEdges();
+
+ /*!
+ * Set entry of the main object
+ */
+ void SetObjectEntry( in string entry );
+
+ /*!
+ * Get the entry of the main object
+ */
+ string GetObjectEntry();
+ };
+
/*!
* StdMeshers_NumberOfSegments: interface of "Nb. Segments" hypothesis
*/
- interface StdMeshers_NumberOfSegments : SMESH::SMESH_Hypothesis
+ interface StdMeshers_NumberOfSegments : SMESH::SMESH_Hypothesis, Reversible1D
{
/*!
* Builds and returns point distribution according to passed density function
*/
long ConversionMode()
raises (SALOME::SALOME_Exception);
-
- /*!
- * Set list of edges to reverse
- */
- void SetReversedEdges( in SMESH::long_array list );
-
- /*!
- * Returns list of edges to reverse
- */
- SMESH::long_array GetReversedEdges();
-
- /*!
- * Set entry of the main object
- */
- void SetObjectEntry( in string entry );
-
- /*!
- * Get the entry of the main object
- */
- string GetObjectEntry();
};
/*!
* StdMeshers_Arithmetic1D: interface of "Arithmetic 1D" hypothesis
*/
- interface StdMeshers_Arithmetic1D : SMESH::SMESH_Hypothesis
+ interface StdMeshers_Arithmetic1D : SMESH::SMESH_Hypothesis, Reversible1D
{
/*!
* Sets <start segment length> or <end segment length> parameter value
* Returns <start segment length> or <end segment length> parameter value
*/
double GetLength(in boolean isStartLength);
-
+
+ };
+
+ /*!
+ * StdMeshers_Arithmetic1D: interface of "Geometric 1D" hypothesis
+ */
+ interface StdMeshers_Geometric1D : SMESH::SMESH_Hypothesis, Reversible1D
+ {
/*!
- * Set list of edges to reverse
+ * Sets length of the first segment
*/
- void SetReversedEdges( in SMESH::long_array list );
-
+ void SetStartLength(in double length)
+ raises (SALOME::SALOME_Exception);
+
/*!
- * Returns list of edges to reverse
+ * Sets value of Common Ratio
*/
- SMESH::long_array GetReversedEdges();
-
+ void SetCommonRatio(in double factor)
+ raises (SALOME::SALOME_Exception);
+
/*!
- * Set entry of the main object
+ * Returns length of the first segment
*/
- void SetObjectEntry( in string entry );
-
+ double GetStartLength();
+
/*!
- * Get the entry of the main object
+ * Returns value of Common Ratio
*/
- string GetObjectEntry();
+ double GetCommonRatio();
+
};
/*!
/*!
* StdMeshers_StartEndLength: interface of "Start and End Length" hypothesis
*/
- interface StdMeshers_StartEndLength : SMESH::SMESH_Hypothesis
+ interface StdMeshers_StartEndLength : SMESH::SMESH_Hypothesis, Reversible1D
{
/*!
* Sets <start segment length> or <end segment length> parameter value
*/
double GetLength(in boolean isStartLength);
- /*!
- * Set list of edges to reverse
- */
- void SetReversedEdges( in SMESH::long_array list );
-
- /*!
- * Returns list of edges to reverse
- */
- SMESH::long_array GetReversedEdges();
-
- /*!
- * Set entry of the main object
- */
- void SetObjectEntry( in string entry );
-
- /*!
- * Get the entry of the main object
- */
- string GetObjectEntry();
};
/*!
* StdMeshers_FixedPoints1D: interface of "Fixed points 1D" hypothesis
*/
- interface StdMeshers_FixedPoints1D : SMESH::SMESH_Hypothesis
+ interface StdMeshers_FixedPoints1D : SMESH::SMESH_Hypothesis, Reversible1D
{
/*!
* Sets some points on edge using parameter on curve from 0 to 1
* Returns list of numbers of segments
*/
SMESH::long_array GetNbSegments();
-
- /*!
- * Set list of edges to reverse
- */
- void SetReversedEdges( in SMESH::long_array list );
-
- /*!
- * Returns list of edges to reverse
- */
- SMESH::long_array GetReversedEdges();
-
- /*!
- * Set entry of the main object
- */
- void SetObjectEntry( in string entry );
-
- /*!
- * Get the entry of the main object
- */
- string GetObjectEntry();
+
};
/*!
};
/*!
- * StdMeshers_Propagation: interface of "Propagation" hypothesis.
+ * StdMeshers_Propagation: interface of "Propagation of 1D Hyp. on
+ * Opposite Edges" hypothesis.
* Presence of this hypothesis on any edge propagates any other 1D
* hypothesis from this edge on all edges, opposite to it.
* It concerns only edges of quadrangle faces.
{
};
+ /*!
+ * StdMeshers_Propagation: interface of "Propagation of Node
+ * Distribution on Opposite Edges" hypothesis.
+ * Presence of this hypothesis on any edge propagates distribution of nodes
+ * from this edge on all edges, opposite to it.
+ * It concerns only edges of quadrangle faces.
+ */
+ interface StdMeshers_PropagOfDistribution : SMESH::SMESH_Hypothesis
+ {
+ };
+
/*!
* StdMeshers_QuadranglePreference: interface of "QuadranglePreference" hypothesis.
* This hypothesis is used by StdMeshers_Quadrangle_2D algorithm.
* Get the type of quadrangulation
*/
QuadType GetQuadType();
+
+ /*!
+ * Set positions of enforced nodes
+ */
+ void SetEnforcedNodes(in GEOM::ListOfGO vertices, in SMESH::nodes_array points)
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Returns positions of enforced nodes
+ */
+ void GetEnforcedNodes(out GEOM::ListOfGO vertices, out SMESH::nodes_array points);
+
+ /*!
+ * Returns entries of shapes defining enforced nodes
+ */
+ SMESH::string_array GetEnfVertices();
};
/*!
void SetIgnoreFaces(in SMESH::long_array faceIDs) raises (SALOME::SALOME_Exception);
SMESH::long_array GetIgnoreFaces();
+ /*!
+ * Set faces either to exclude from treatment or to make the Viscous Layers on.
+ */
+ void SetFaces(in SMESH::long_array faceIDs,
+ in boolean toIgnore) raises (SALOME::SALOME_Exception);
+ SMESH::long_array GetFaces();
+ boolean GetIsToIgnoreFaces();
+
/*!
* Set total thickness of layers of prisms
*/
/*!
* interface of "Body fitting Parameters" hypothesis.
* This hypothesis specifies
- * - Definition of the Cartesian grid
* - Size threshold
+ * - Definition of the Cartesian grid
+ * - Direction of grid axes
*/
interface StdMeshers_CartesianParameters3D : SMESH::SMESH_Hypothesis
{
/*!
* Set size threshold. A polyhedral cell got by cutting an initial
* hexahedron by geometry boundary is considered small and is removed if
- * it's size is \athreshold times less than the size of the initial hexahedron.
+ * it's size is \a threshold times less than the size of the initial hexahedron.
* threshold must be > 1.0
*/
void SetSizeThreshold(in double threshold) raises (SALOME::SALOME_Exception);
/*!
* Set coordinates of nodes along an axis (countered from zero)
*/
- void SetGrid(in SMESH::double_array coords,
- in short axis) raises (SALOME::SALOME_Exception);
+ void SetGrid(in SMESH::double_array coords,
+ in short axis) raises (SALOME::SALOME_Exception);
SMESH::double_array GetGrid(in short axis) raises (SALOME::SALOME_Exception);
/*!
void GetGridSpacing(out SMESH::string_array spaceFunctions,
out SMESH::double_array internalPoints,
in short axis) raises (SALOME::SALOME_Exception);
+ /*!
+ * Set custom direction of axes
+ */
+ void SetAxesDirs(in SMESH::DirStruct x,
+ in SMESH::DirStruct y,
+ in SMESH::DirStruct z ) raises (SALOME::SALOME_Exception);
+ void GetAxesDirs(out SMESH::DirStruct x,
+ out SMESH::DirStruct y,
+ out SMESH::DirStruct z );
+ /*!
+ * Set/unset a fixed point, at which a node will be created provided that grid
+ * is defined by spacing in all directions
+ */
+ void SetFixedPoint(in SMESH::PointStruct p, in boolean toUnset);
+ boolean GetFixedPoint(out SMESH::PointStruct p);
+
+ /*!
+ * Enables implementation of geometrical edges into the mesh. If this feature
+ * is disabled, sharp edges of the shape are lost ("smoothed") in the mesh if
+ * they don't coincide with the grid lines
+ */
+ void SetToAddEdges(in boolean toAdd);
+ boolean GetToAddEdges();
+
+ /*!
+ * Returns axes at which a number of generated hexahedra is maximal
+ */
+ void ComputeOptimalAxesDirs(in GEOM::GEOM_Object shape,
+ in boolean isOrthogonal,
+ out SMESH::DirStruct x,
+ out SMESH::DirStruct y,
+ out SMESH::DirStruct z )
+ raises (SALOME::SALOME_Exception);
/*!
* \brief Computes node coordinates by spacing functions
* \param x1 - upper coordinate
* \param spaceFuns - space functions
* \param points - internal points
- * \param coords - the computed coordinates
+ * \param axisName - e.g. "X"
+ * \return the computed coordinates
*/
SMESH::double_array ComputeCoordinates(in double x0,
in double x1,
in SMESH::string_array spaceFuns,
in SMESH::double_array points,
- in string axisName ) raises (SALOME::SALOME_Exception);
+ in string axisName )
+ raises (SALOME::SALOME_Exception);
};
/*!
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
void Move( in sobject_list what,
in SALOMEDS::SObject where,
in long row );
+ /*!
+ * Return true if algorithm can be applied
+ */
+ boolean IsApplicable( in string theAlgoType,
+ in string theLibName,
+ in GEOM::GEOM_Object theShapeObject,
+ in boolean toCheckAll );
};
};
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
* - auto_groups : boolean parameter for creating/not creating
* the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
* the typical use is auto_groups=false.
- * - version : define the version of format of MED file, that will be created
+ * - version : defines the version of format of MED file, that will be created
* - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
- * - autoDimension: if @c True (default), a space dimension of a MED mesh can be either
+ * - autoDimension : if @c true, a space dimension of a MED mesh can be either
* - 1D if all mesh nodes lie on OX coordinate axis, or
* - 2D if all mesh nodes lie on XOY coordinate plane, or
* - 3D in the rest cases.
- *
- * If @a autoDimension is @c False, the space dimension is always 3.
+ * If @a autoDimension is @c false, the space dimension is always 3.
*/
void ExportToMEDX( in string file,
in boolean auto_groups,
in MED_VERSION version,
in boolean overwrite,
- in boolean autoDimension ) raises (SALOME::SALOME_Exception);
+ in boolean autoDimension) raises (SALOME::SALOME_Exception);
/*!
- * Export a part of Mesh into a MED file
+ * Export a [part of] Mesh into a MED file
* @params
* - meshPart : a part of mesh to store
* - file : name of the MED file
* - version : define the version of format of MED file, that will be created
* - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
- * - autoDimension: if @c True, a space dimension for export is defined by mesh
+ * - autoDimension : if @c True, a space dimension for export is defined by mesh
* configuration; for example a planar mesh lying on XOY plane
* will be exported as a mesh in 2D space.
* If @a autoDimension == @c False, the space dimension is 3.
- */
- void ExportPartToMED( in SMESH_IDSource meshPart,
- in string file,
- in boolean auto_groups,
- in MED_VERSION version,
- in boolean overwrite,
- in boolean autoDimension ) raises (SALOME::SALOME_Exception);
+ * - fields : list of GEOM fields defined on the shape to mesh.
+ * - geomAssocFields : each character of this string means a need to export a
+ * corresponding field; correspondence between fields and characters is following:
+ * - 'v' stands for _vertices_ field;
+ * - 'e' stands for _edges_ field;
+ * - 'f' stands for _faces_ field;
+ * - 's' stands for _solids_ field.
+ */
+ void ExportPartToMED( in SMESH_IDSource meshPart,
+ in string file,
+ in boolean auto_groups,
+ in MED_VERSION version,
+ in boolean overwrite,
+ in boolean autoDimension,
+ in GEOM::ListOfFields fields,
+ in string geomAssocFields ) raises (SALOME::SALOME_Exception);
/*!
* Export Mesh to a MED Format file
EntityType GetElementGeomType( in long id )
raises (SALOME::SALOME_Exception);
+ GeometryType GetElementShape( in long id )
+ raises (SALOME::SALOME_Exception);
+
long_array GetSubMeshElementsId(in long ShapeID)
raises (SALOME::SALOME_Exception);
* Methods to set meshing order of submeshes
*/
+ /*!
+ * \brief Return \c true if a meshing order not yet set for a concurrent sub-mesh
+ */
+ boolean IsUnorderedSubMesh(in long submeshID);
+
/*!
* \brief Return submesh objects list in meshing order
*/
*/
long_array GetElemFaceNodes(in long elemId, in short faceIndex);
+ /*!
+ * Returns three components of normal of given mesh face (or an empty array in KO case)
+ */
+ double_array GetFaceNormal(in long faceId, in boolean normalized);
+
/*!
* Returns an element based on all given nodes.
*/
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
void SplitVolumesIntoTetra(in SMESH_IDSource elems, in short methodFlags)
raises (SALOME::SALOME_Exception);
+ /*!
+ * \brief Split hexahedra into triangular prisms
+ * \param elems - elements to split
+ * \param startHexPoint - a point used to find a hexahedron for which \a facetToSplitNormal
+ * gives a normal vector defining facets to split into triangles.
+ * \param facetToSplitNormal - normal used to find a facet of hexahedron
+ * to split into triangles.
+ * \param methodFlags - flags passing splitting method:
+ * 1 - split the hexahedron into 2 prisms
+ * 2 - split the hexahedron into 4 prisms
+ * \param allDomains - if \c False, only hexahedra adjacent to one closest
+ * to \a facetToSplitNormal location are split, else \a facetToSplitNormal
+ * is used to find the facet to split in all domains present in \a elems.
+ */
+ void SplitHexahedraIntoPrisms(in SMESH_IDSource elems,
+ in SMESH::PointStruct startHexPoint,
+ in SMESH::DirStruct facetToSplitNormal,
+ in short methodFlags,
+ in boolean allDomains)
+ raises (SALOME::SALOME_Exception);
+
enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
* Triangles are transformed in prisms, and quadrangles in hexahedrons.
* \param theDomains - list of groups of volumes
* \param createJointElems - if TRUE, create the elements
+ * \param onAllBoundaries - if TRUE, the nodes and elements are also created on
+ * the boundary between \a theDomains and the rest mesh
* \return TRUE if operation has been completed successfully, FALSE otherwise
*/
boolean DoubleNodesOnGroupBoundaries( in ListOfGroups theDomains,
- in boolean createJointElems )
+ in boolean createJointElems,
+ in boolean onAllBoundaries)
raises (SALOME::SALOME_Exception);
/*!
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
mesh_line_n.png
mesh_line.png
mesh_move_node.png
+ mesh_move_without_node.png
mesh_octahedron.png
mesh_orientation.png
mesh.png
mesh_duplicate_nodes.png
mesh_duplicate_nodes_with_elem.png
mesh_duplicate_elem_only.png
+ mesh_duplicate_group_boundary.png
mesh_bounding_box.png
mesh_hypo_viscous_layers.png
mesh_tree_hypo_viscous_layers.png
<?xml version='1.0' encoding='us-ascii' ?>
<!--
- Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
- version 2.1 of the License.
+ version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
<!--
- Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
- version 2.1 of the License.
+ version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
<parameter name="marker_scale" value="9" />
<parameter name="elem0d_size" value="5" />
<parameter name="ball_elem_size" value="10" />
+ <parameter name="ball_elem_scale" value="1" />
<parameter name="element_width" value="1" />
<parameter name="outline_width" value="1" />
<parameter name="shrink_coeff" value="75"/>
<parameter name="User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/index.html"/>
<parameter name="Plug-ins/MGSurfOpt plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/yams/index.html"/>
<parameter name="Plug-ins/MGCleaner plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/MGCleaner/index.html"/>
+ <parameter name="Plug-ins/MacMesh plugin" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/MacMesh/index.html"/>
<parameter name="Developer's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/tui/SMESH/index.html"/>
</section>
<section name="resources">
</section>
<section name="windows_geometry">
- <parameter value="#00 #00 #00 #FF #00 #00 #00 #00 #FD #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #02 #44 #FC #02 #00 #00 #00 #01 #FC #00 #00 #00 #7B #00 #00 #02 #44 #00 #00 #00 #97 #01 #00 #00 #14 #FA #00 #00 #00 #01 #02 #00 #00 #00 #02 #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #82 #00 #FF #FF #FF #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #53 #00 #FF #FF #FF #00 #00 #00 #03 #00 #00 #05 #40 #00 #00 #00 #53 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #00 #00 #00 #05 #40 #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #04 #38 #00 #00 #02 #44 #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #08 #00 #00 #00 #08 #FC #00 #00 #00 #05 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #CE #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #07 #00 #00 #00 #2A #00 #4E #00 #6F #00 #64 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #02 #01 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #2A #00 #45 #00 #64 #00 #67 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #02 #4D #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #2A #00 #46 #00 #61 #00 #63 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #02 #F6 #00 #00 #02 #4A #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #18 #00 #4D #00 #65 #00 #73 #00 #68 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #26 #00 #41 #00 #64 #00 #64 #00 #20 #00 #45 #00 #6C #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #01 #2B #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #3C #00 #41 #00 #64 #00 #64 #00 #20 #00 #4E #00 #6F #00 #6E #00 #20 #00 #4C #00 #69 #00 #6E #00 #65 #00 #61 #00 #72 #00 #20 #00 #45 #00 #6C #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #02 #EB #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1A #00 #47 #00 #72 #00 #6F #00 #75 #00 #70 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #04 #2F #00 #00 #01 #3E #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #01 #00 #00 #00 #2E #00 #56 #00 #6F #00 #6C #00 #75 #00 #6D #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #07 #00 #00 #00 #1C #00 #52 #00 #65 #00 #6D #00 #6F #00 #76 #00 #65 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #2C #00 #54 #00 #72 #00 #61 #00 #6E #00 #73 #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #8A #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #28 #00 #4D #00 #6F #00 #64 #00 #69 #00 #66 #00 #69 #00 #63 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #01 #90 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #26 #00 #49 #00 #6E #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #03 #6F #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #26 #00 #52 #00 #65 #00 #6E #00 #75 #00 #6D #00 #62 #00 #65 #00 #72 #00 #69 #00 #6E #00 #67 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #03 #BB #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #28 #00 #4D #00 #65 #00 #61 #00 #73 #00 #75 #00 #72 #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #04 #07 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #28 #00 #44 #00 #69 #00 #73 #00 #70 #00 #6C #00 #61 #00 #79 #00 #20 #00 #4D #00 #6F #00 #64 #00 #65 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #04 #34 #00 #00 #01 #0C #00 #00 #00 #00 #00 #00 #00 #00" name="SMESH"/>
+ <parameter value="#00 #00 #00 #FF #00 #00 #00 #00 #FD #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #02 #44 #FC #02 #00 #00 #00 #01 #FC #00 #00 #00 #7B #00 #00 #02 #44 #00 #00 #00 #97 #01 #00 #00 #14 #FA #00 #00 #00 #00 #01 #00 #00 #00 #02 #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #46 #00 #FF #FF #FF #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #00 #C0 #00 #FF #FF #FF #00 #00 #00 #03 #00 #00 #05 #40 #00 #00 #00 #53 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #00 #00 #00 #05 #40 #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #04 #38 #00 #00 #02 #44 #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #08 #00 #00 #00 #08 #FC #00 #00 #00 #05 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #CE #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #07 #00 #00 #00 #2A #00 #4E #00 #6F #00 #64 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #02 #01 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #2A #00 #45 #00 #64 #00 #67 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #02 #4D #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #2A #00 #46 #00 #61 #00 #63 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #02 #F6 #00 #00 #02 #4A #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #18 #00 #4D #00 #65 #00 #73 #00 #68 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #26 #00 #41 #00 #64 #00 #64 #00 #20 #00 #45 #00 #6C #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #01 #2B #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #3C #00 #41 #00 #64 #00 #64 #00 #20 #00 #4E #00 #6F #00 #6E #00 #20 #00 #4C #00 #69 #00 #6E #00 #65 #00 #61 #00 #72 #00 #20 #00 #45 #00 #6C #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #02 #EB #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1A #00 #47 #00 #72 #00 #6F #00 #75 #00 #70 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #04 #2F #00 #00 #01 #3E #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #01 #00 #00 #00 #2E #00 #56 #00 #6F #00 #6C #00 #75 #00 #6D #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #07 #00 #00 #00 #1C #00 #52 #00 #65 #00 #6D #00 #6F #00 #76 #00 #65 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #2C #00 #54 #00 #72 #00 #61 #00 #6E #00 #73 #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #8A #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #28 #00 #4D #00 #6F #00 #64 #00 #69 #00 #66 #00 #69 #00 #63 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #01 #90 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #26 #00 #49 #00 #6E #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #03 #6F #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #26 #00 #52 #00 #65 #00 #6E #00 #75 #00 #6D #00 #62 #00 #65 #00 #72 #00 #69 #00 #6E #00 #67 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #03 #BB #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #28 #00 #4D #00 #65 #00 #61 #00 #73 #00 #75 #00 #72 #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #04 #07 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #28 #00 #44 #00 #69 #00 #73 #00 #70 #00 #6C #00 #61 #00 #79 #00 #20 #00 #4D #00 #6F #00 #64 #00 #65 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #04 #34 #00 #00 #01 #0C #00 #00 #00 #00 #00 #00 #00 #00" name="SMESH"/>
</section>
<section name="windows_visibility">
- <parameter value="#00 #00 #00 #00 #13 #00 #00 #00 #26 #00 #41 #00 #64 #00 #64 #00 #20 #00 #45 #00 #6C #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #3C #00 #41 #00 #64 #00 #64 #00 #20 #00 #4E #00 #6F #00 #6E #00 #20 #00 #4C #00 #69 #00 #6E #00 #65 #00 #61 #00 #72 #00 #20 #00 #45 #00 #6C #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #28 #00 #44 #00 #69 #00 #73 #00 #70 #00 #6C #00 #61 #00 #79 #00 #20 #00 #4D #00 #6F #00 #64 #00 #65 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #2A #00 #45 #00 #64 #00 #67 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #2A #00 #46 #00 #61 #00 #63 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #1A #00 #47 #00 #72 #00 #6F #00 #75 #00 #70 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #26 #00 #49 #00 #6E #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #28 #00 #4D #00 #65 #00 #61 #00 #73 #00 #75 #00 #72 #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #18 #00 #4D #00 #65 #00 #73 #00 #68 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #28 #00 #4D #00 #6F #00 #64 #00 #69 #00 #66 #00 #69 #00 #63 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #2A #00 #4E #00 #6F #00 #64 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #28 #00 #52 #00 #65 #00 #63 #00 #6F #00 #72 #00 #64 #00 #69 #00 #6E #00 #67 #00 #20 #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #1C #00 #52 #00 #65 #00 #6D #00 #6F #00 #76 #00 #65 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #26 #00 #52 #00 #65 #00 #6E #00 #75 #00 #6D #00 #62 #00 #65 #00 #72 #00 #69 #00 #6E #00 #67 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #2C #00 #54 #00 #72 #00 #61 #00 #6E #00 #73 #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #1E #00 #56 #00 #69 #00 #65 #00 #77 #00 #20 #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #2E #00 #56 #00 #6F #00 #6C #00 #75 #00 #6D #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #01 #00 #00 #00 #03 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01" name="SMESH"/>
+ <parameter value="#00 #00 #00 #00 #15 #FF #FF #FF #FF #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #02 #44 #FC #02 #00 #00 #00 #01 #FC #00 #00 #00 #7B #00 #00 #02 #44 #00 #00 #00 #97 #01 #00 #00 #14 #FA #00 #00 #00 #00 #01 #00 #00 #00 #02 #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #46 #00 #FF #FF #FF #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #00 #C0 #00 #FF #FF #FF #00 #00 #00 #03 #00 #00 #05 #40 #00 #00 #00 #53 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #00 #00 #00 #05 #40 #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #04 #38 #00 #00 #02 #44 #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #08 #00 #00 #00 #08 #FC #00 #00 #00 #05 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #CE #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #07 #00 #00 #00 #2A #00 #4E #00 #6F #00 #64 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #02 #01 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #2A #00 #45 #00 #64 #00 #67 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #02 #4D #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #2A #00 #46 #00 #61 #00 #63 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #02 #F6 #00 #00 #02 #4A #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #18 #00 #4D #00 #65 #00 #73 #00 #68 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #00 #00 #26 #00 #41 #00 #64 #00 #64 #00 #20 #00 #45 #00 #6C #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #3C #00 #41 #00 #64 #00 #64 #00 #20 #00 #4E #00 #6F #00 #6E #00 #20 #00 #4C #00 #69 #00 #6E #00 #65 #00 #61 #00 #72 #00 #20 #00 #45 #00 #6C #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #28 #00 #44 #00 #69 #00 #73 #00 #70 #00 #6C #00 #61 #00 #79 #00 #20 #00 #4D #00 #6F #00 #64 #00 #65 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #2A #00 #45 #00 #64 #00 #67 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #2A #00 #46 #00 #61 #00 #63 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #1A #00 #47 #00 #72 #00 #6F #00 #75 #00 #70 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #26 #00 #49 #00 #6E #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #28 #00 #4D #00 #65 #00 #61 #00 #73 #00 #75 #00 #72 #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #18 #00 #4D #00 #65 #00 #73 #00 #68 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #28 #00 #4D #00 #6F #00 #64 #00 #69 #00 #66 #00 #69 #00 #63 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #2A #00 #4E #00 #6F #00 #64 #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #00 #00 #00 #28 #00 #52 #00 #65 #00 #63 #00 #6F #00 #72 #00 #64 #00 #69 #00 #6E #00 #67 #00 #20 #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #1C #00 #52 #00 #65 #00 #6D #00 #6F #00 #76 #00 #65 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #26 #00 #52 #00 #65 #00 #6E #00 #75 #00 #6D #00 #62 #00 #65 #00 #72 #00 #69 #00 #6E #00 #67 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #2C #00 #54 #00 #72 #00 #61 #00 #6E #00 #73 #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #1E #00 #56 #00 #69 #00 #65 #00 #77 #00 #20 #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #2E #00 #56 #00 #6F #00 #6C #00 #75 #00 #6D #00 #65 #00 #20 #00 #43 #00 #6F #00 #6E #00 #74 #00 #72 #00 #6F #00 #6C #00 #73 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #00 #01 #00 #00 #00 #03 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01" name="SMESH"/>
</section>
</document>
<?xml version='1.0' encoding='us-ascii'?>
<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
<!--
- Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
- version 2.1 of the License.
+ version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
icon-id ="mesh_hypo_length.png"
dim ="1"/>
+ <hypothesis type ="GeometricProgression"
+ label-id ="Geometric Progression"
+ icon-id ="mesh_hypo_length.png"
+ dim ="1"/>
+
<hypothesis type ="FixedPoints1D"
label-id ="Fixed Points 1D"
icon-id ="mesh_hypo_length.png"
label-id ="Propagation of 1D Hyp. on Opposite Edges"
icon-id ="mesh_hypo_length.png"
dim ="1"
+ context ="LOCAL"
+ auxiliary="true"/>
+
+ <hypothesis type ="PropagOfDistribution"
+ label-id ="Propagation of Node Distribution on Opposite Edges"
+ icon-id ="mesh_hypo_length.png"
+ dim ="1"
+ context ="LOCAL"
auxiliary="true"/>
<hypothesis type ="AutomaticLength"
label-id ="Quadratic Mesh"
icon-id ="mesh_algo_quad.png"
dim ="1"
+ context ="GLOBAL"
auxiliary="true"/>
<hypothesis type ="MaxElementArea"
label-id ="Not Conform Mesh Allowed"
icon-id ="mesh_hypo_length.png"
dim ="1,2,3"
+ context ="GLOBAL"
auxiliary="true"/>
<hypothesis type ="MaxElementVolume"
<hypothesis type ="CartesianParameters3D"
label-id ="Body Fitting Parameters"
icon-id ="mesh_hypo_length.png"
+ context ="GLOBAL"
dim ="3"/>
</hypotheses>
icon-id ="mesh_algo_regular.png"
hypos ="SegmentLengthAroundVertex"
output ="VERTEX"
+ need-hyp ="true"
dim ="0"/>
<algorithm type ="Regular_1D"
label-id ="Wire Discretisation"
icon-id ="mesh_algo_regular.png"
- hypos ="Adaptive1D,LocalLength,MaxLength,Arithmetic1D,StartEndLength,NumberOfSegments,Deflection1D,AutomaticLength,FixedPoints1D"
- opt-hypos="Propagation,QuadraticMesh"
+ hypos ="Adaptive1D,LocalLength,MaxLength,Arithmetic1D,GeometricProgression,StartEndLength,NumberOfSegments,Deflection1D,AutomaticLength,FixedPoints1D"
+ opt-hypos="Propagation,PropagOfDistribution,QuadraticMesh"
input ="VERTEX"
output ="EDGE"
+ need-hyp ="true"
dim ="1">
<python-wrap>
<algo>Regular_1D=Segment()</algo>
<hypo>LocalLength=LocalLength(SetLength(1),,SetPrecision(1))</hypo>
<hypo>MaxLength=MaxSize(SetLength(1))</hypo>
<hypo>Arithmetic1D=Arithmetic1D(SetStartLength(),SetEndLength(),SetReversedEdges())</hypo>
+ <hypo>GeometricProgression=GeometricProgression(SetStartLength(),SetCommonRatio(),SetReversedEdges())</hypo>
<hypo>StartEndLength=StartEndLength(SetStartLength(),SetEndLength(),SetReversedEdges())</hypo>
<hypo>Deflection1D=Deflection1D(SetDeflection())</hypo>
<hypo>Adaptive1D=Adaptive(SetMinSize(),SetMaxSize(),SetDeflection())</hypo>
<hypo>AutomaticLength=AutomaticLength(SetFineness())</hypo>
<hypo>FixedPoints1D=FixedPoints1D(SetPoints(),SetNbSegments(),SetReversedEdges())</hypo>
<hypo>Propagation=Propagation()</hypo>
+ <hypo>PropagOfDistribution=PropagationOfDistribution()</hypo>
<hypo>QuadraticMesh=QuadraticMesh()</hypo>
</python-wrap>
</algorithm>
<algorithm type ="CompositeSegment_1D"
label-id ="Composite Side Discretisation"
icon-id ="mesh_algo_regular.png"
- hypos ="Adaptive1D,LocalLength,MaxLength,Arithmetic1D,StartEndLength,NumberOfSegments,Deflection1D,AutomaticLength,FixedPoints1D"
- opt-hypos="Propagation,QuadraticMesh"
+ hypos ="Adaptive1D,LocalLength,MaxLength,Arithmetic1D,GeometricProgression,StartEndLength,NumberOfSegments,Deflection1D,AutomaticLength,FixedPoints1D"
+ opt-hypos="Propagation,PropagOfDistribution,QuadraticMesh"
input ="VERTEX"
output ="EDGE"
+ need-hyp ="true"
dim ="1">
<python-wrap>
<algo>CompositeSegment_1D=Segment(algo=smeshBuilder.COMPOSITE)</algo>
<hypo>LocalLength=LocalLength(SetLength(), ,SetPrecision())</hypo>
<hypo>MaxLength=MaxSize(SetLength())</hypo>
<hypo>Arithmetic1D=Arithmetic1D(SetStartLength(),SetEndLength(),SetReversedEdges())</hypo>
+ <hypo>GeometricProgression=GeometricProgression(SetStartLength(),SetCommonRatio(),SetReversedEdges())</hypo>
<hypo>StartEndLength=StartEndLength(SetStartLength(),SetEndLength(),SetReversedEdges())</hypo>
<hypo>Deflection1D=Deflection1D(SetDeflection())</hypo>
<hypo>Adaptive1D=Adaptive(SetMinSize(),SetMaxSize(),SetDeflection())</hypo>
<hypo>AutomaticLength=AutomaticLength(SetFineness())</hypo>
<hypo>FixedPoints1D=FixedPoints1D(SetPoints(),SetNbSegments(),SetReversedEdges())</hypo>
<hypo>Propagation=Propagation()</hypo>
+ <hypo>PropagOfDistribution=PropagationOfDistribution()</hypo>
<hypo>QuadraticMesh=QuadraticMesh()</hypo>
</python-wrap>
</algorithm>
dim ="2">
<python-wrap>
<algo>Quadrangle_2D=Quadrangle(algo=smeshBuilder.QUADRANGLE)</algo>
- <hypo>QuadrangleParams=QuadrangleParameters(SetQuadType(),SetTriaVertex())</hypo>
+ <hypo>QuadrangleParams=QuadrangleParameters(SetQuadType(),SetTriaVertex(),SetEnforcedNodes(1),SetEnforcedNodes(2))</hypo>
<hypo>ViscousLayers2D=ViscousLayers2D(SetTotalThickness(),SetNumberLayers(),SetStretchFactor(),SetIgnoreEdges())</hypo>
</python-wrap>
</algorithm>
label-id ="Hexahedron (i,j,k)"
icon-id ="mesh_algo_hexa.png"
input ="QUAD"
+ output ="HEXA,PENTA"
need-geom="false"
opt-hypos="ViscousLayers"
dim ="3">
icon-id ="mesh_algo_regular.png"
hypos ="ProjectionSource1D"
output ="EDGE"
+ need-hyp="true"
dim ="1">
<python-wrap>
<algo>Projection_1D=Projection1D()</algo>
input ="EDGE"
hypos ="ProjectionSource2D"
output ="QUAD,TRIA"
+ need-hyp="true"
dim ="2">
<python-wrap>
<algo>Projection_2D=Projection2D()</algo>
icon-id ="mesh_algo_quad.png"
hypos ="ProjectionSource2D"
output ="QUAD,TRIA"
+ need-hyp="true"
dim ="2">
<python-wrap>
<algo>Projection_1D2D=Projection1D2D()</algo>
icon-id ="mesh_algo_hexa.png"
hypos ="ProjectionSource3D"
input ="QUAD,TRIA"
+ need-hyp="true"
dim ="3">
<python-wrap>
<algo>Projection_3D=Projection3D()</algo>
</algorithm>
<algorithm type ="Import_1D"
- label-id="Use Existing 1D Elements"
+ label-id="Import 1D Elements from Another Mesh"
icon-id ="mesh_algo_regular.png"
hypos ="ImportSource1D"
output ="EDGE"
+ need-hyp="true"
dim ="1">
<python-wrap>
<algo>Import_1D=UseExisting1DElements()</algo>
</algorithm>
<algorithm type ="Import_1D2D"
- label-id ="Use Existing 2D Elements"
+ label-id ="Import 1D-2D Elements from Another Mesh"
icon-id ="mesh_algo_quad.png"
hypos ="ImportSource2D"
output ="QUAD,TRIA"
support-submeshes="false"
+ need-hyp ="true"
dim ="2">
<python-wrap>
<algo>Import_1D2D=UseExisting2DElements()</algo>
label-id="3D Extrusion"
icon-id ="mesh_algo_hexa.png"
input ="QUAD,TRIA"
+ output ="HEXA,PENTA,OCTA,POLYHEDRON"
dim ="3">
<python-wrap>
<algo>Prism_3D=Prism()</algo>
icon-id ="mesh_algo_hexa.png"
hypos ="NumberOfLayers, LayerDistribution"
input ="QUAD,TRIA"
+ output ="HEXA,PENTA,OCTA,POLYHEDRON"
+ need-hyp="true"
dim ="3">
<python-wrap>
<algo>RadialPrism_3D=Prism('RadialPrism_3D')</algo>
</algorithm>
<algorithm type ="UseExisting_1D"
- label-id="Use Existing Edges"
+ label-id="Use Edges to be Created Manually"
icon-id ="mesh_algo_regular.png"
input ="VERTEX"
output ="EDGE"
</algorithm>
<algorithm type ="UseExisting_2D"
- label-id="Use Existing Faces"
+ label-id="Use Faces to be Created Manually"
icon-id ="mesh_algo_quad.png"
input ="EDGE"
output ="QUAD,TRIA"
icon-id ="mesh_algo_quad.png"
hypos ="NumberOfLayers2D, LayerDistribution2D"
input ="EDGE"
- output ="QUAD,TRIA"
+ output ="QUAD"
dim ="2">
<python-wrap>
<algo>RadialQuadrangle_1D2D=Quadrangle(algo=smeshBuilder.RADIAL_QUAD)</algo>
icon-id ="mesh_algo_hexa.png"
hypos ="CartesianParameters3D"
support-submeshes="false"
+ output ="HEXA"
+ need-hyp ="true"
+ context ="GLOBAL"
dim ="3">
<python-wrap>
<algo>Cartesian_3D=BodyFitted()</algo>
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
DriverMED_R_SMESHDS_Mesh.h
DriverMED_W_SMESHDS_Mesh.h
DriverMED_Family.h
+ DriverMED_W_Field.h
SMESH_DriverMED.hxx
)
DriverMED_R_SMESHDS_Mesh.cxx
DriverMED_W_SMESHDS_Mesh.cxx
DriverMED_Family.cxx
+ DriverMED_W_Field.cxx
)
# --- rules ---
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// Declarations needed for usage of DriverMED
+#include "SMDSAbs_ElementType.hxx"
+#include "SMESH_DriverMED.hxx"
+
#include <boost/shared_ptr.hpp>
class DriverMED_Family;
typedef boost::shared_ptr<DriverMED_Family> DriverMED_FamilyPtr;
+
+namespace DriverMED
+{
+ // Implemetation is in DriverMED_W_Field.cxx
+
+ /*
+ * Returns MED element geom type (MED::EGeometrieElement) by SMDS type
+ */
+ MESHDRIVERMED_EXPORT int GetMedGeoType( SMDSAbs_EntityType smdsType );
+
+ /*
+ * Returns SMDS element geom type by MED type (MED::EGeometrieElement)
+ */
+ MESHDRIVERMED_EXPORT SMDSAbs_EntityType GetSMDSType( int medType );
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// 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 : DriverMED_W_Field.cxx
+// Created : Thu Feb 27 17:45:00 2014
+// Author : eap
+
+#include "DriverMED_W_Field.h"
+
+#include "DriverMED.hxx"
+#include "DriverMED_W_SMESHDS_Mesh.h"
+#include "MED_Factory.hxx"
+#include "MED_Utilities.hxx"
+#include "MED_Wrapper.hxx"
+#include "SMDS_IteratorOnIterators.hxx"
+#include "SMDS_MeshElement.hxx"
+#include "SMDS_PolyhedralVolumeOfNodes.hxx"
+#include "SMDS_SetIterator.hxx"
+#include "SMESHDS_Mesh.hxx"
+
+//================================================================================
+/*!
+ * \brief Constructor
+ */
+//================================================================================
+
+DriverMED_W_Field::DriverMED_W_Field():
+ //_medFileID( -1 ),
+ _elemType( SMDSAbs_All ),
+ _dt( -1 ),
+ _it( -1 )
+{
+}
+
+//================================================================================
+/*!
+ * \brief Sets basic data
+ * \param [in] mesh - supporting mesh
+ * \param [in] fieldName - name of a field
+ * \param [in] type - type of supporting elements
+ * \param [in] nbComps - number of components
+ * \param [in] isIntData - type of data: double or integer
+ */
+//================================================================================
+
+bool DriverMED_W_Field::Set(SMESHDS_Mesh * mesh,
+ const std::string & fieldName,
+ SMDSAbs_ElementType type,
+ const int nbComps,
+ const bool isIntData)
+{
+ _fieldName = fieldName;
+ _compNames.resize( nbComps, "" );
+
+ if ( type == SMDSAbs_All )
+ {
+ if ( mesh->NbVolumes() > 0 )
+ type = SMDSAbs_Volume;
+ else if ( mesh->NbFaces() > 0 )
+ type = SMDSAbs_Face;
+ else if ( mesh->NbEdges() > 0 )
+ type = SMDSAbs_Edge;
+ else
+ type = SMDSAbs_Node;
+ }
+ if ( myMesh != mesh )
+ {
+ _nbElemsByGeom.clear();
+ for ( int iG = 0; iG < SMDSEntity_Last; ++iG )
+ _elemsByGeom[iG].clear();
+ SetMesh( mesh );
+ }
+
+ // find out "MED order" of elements - sort elements by geom type
+ int nbElems;
+ if ( _nbElemsByGeom.empty() || _elemType != type )
+ {
+ _elemType = type;
+ _nbElemsByGeom.resize( 1, make_pair( SMDSEntity_Last, 0 ));
+
+ // count nb of elems of each geometry
+ for ( int iG = 0; iG < SMDSEntity_Last; ++iG )
+ {
+ SMDSAbs_EntityType geom = (SMDSAbs_EntityType) iG;
+ SMDSAbs_ElementType t = SMDS_MeshCell::toSmdsType( geom );
+ if ( t != _elemType ) continue;
+
+ nbElems = mesh->GetMeshInfo().NbElements( geom );
+ if ( nbElems < 1 ) continue;
+
+ _nbElemsByGeom.push_back( make_pair( geom, nbElems + _nbElemsByGeom.back().second ));
+ }
+ // add nodes of missing 0D elements on VERTEXes
+ if ( _addODOnVertices && _elemType == SMDSAbs_0DElement )
+ {
+ std::vector< const SMDS_MeshElement* >& nodes = _elemsByGeom[SMDSEntity_Node];
+ if ( nodes.empty() )
+ DriverMED_W_SMESHDS_Mesh::getNodesOfMissing0DOnVert( myMesh, nodes );
+ if ( !nodes.empty() )
+ {
+ if ( _nbElemsByGeom.size() == 1 )
+ _nbElemsByGeom.push_back( make_pair( SMDSEntity_0D, 0));
+ _nbElemsByGeom.push_back( make_pair( SMDSEntity_Node,
+ nodes.size() + _nbElemsByGeom.back().second ));
+ }
+ }
+
+ // sort elements by their geometry
+ int iGeoType, nbGeomTypes = _nbElemsByGeom.size() - 1;
+ if ( nbGeomTypes > 1 )
+ {
+ for ( size_t iG = 1; iG < _nbElemsByGeom.size(); ++iG )
+ {
+ iGeoType = _nbElemsByGeom[iG].first;
+ nbElems = _nbElemsByGeom[iG].second - _nbElemsByGeom[iG-1].second;
+ _elemsByGeom[ iGeoType ].reserve( nbElems );
+ }
+ iGeoType = _nbElemsByGeom[1].first; // for missing 0D
+ if ( _elemsByGeom[ iGeoType ].empty() )
+ {
+ nbElems = mesh->GetMeshInfo().NbElements( _elemType );
+ SMDS_ElemIteratorPtr eIt = mesh->elementsIterator( _elemType );
+ for ( int iE = 0; iE < nbElems && eIt->more(); ++iE )
+ {
+ const SMDS_MeshElement* e = eIt->next();
+ _elemsByGeom[ e->GetEntityType() ].push_back( e );
+ }
+ }
+ }
+ }
+ _intValues.clear();
+ _dblValues.clear();
+
+ // allocate memory for values
+ nbElems = _nbElemsByGeom.empty() ? 0 : _nbElemsByGeom.back().second;
+ if ( isIntData )
+ _intValues.reserve( nbElems * nbComps );
+ else
+ _dblValues.reserve( nbElems * nbComps );
+
+ return nbElems * nbComps;
+}
+
+//================================================================================
+/*!
+ * \brief Set a name of a component countered from zero
+ */
+//================================================================================
+
+void DriverMED_W_Field::SetCompName(const int iComp, const char* name)
+{
+ if ( _compNames.size() <= iComp )
+ _compNames.resize( iComp + 1 );
+ _compNames[ iComp ] = name;
+}
+
+//================================================================================
+/*!
+ * \brief Sets numdt and numit field features. Call this fun before AddValue()!
+ */
+//================================================================================
+
+void DriverMED_W_Field::SetDtIt(const int dt, const int it)
+{
+ _dt = dt;
+ _it = it;
+ _intValues.clear();
+ _dblValues.clear();
+}
+
+//================================================================================
+/*!
+ * \brief Adds a float field value
+ */
+//================================================================================
+
+void DriverMED_W_Field::AddValue( double val )
+{
+ _dblValues.push_back( val );
+}
+
+//================================================================================
+/*!
+ * \brief Adds an integer field value
+ */
+//================================================================================
+
+void DriverMED_W_Field::AddValue( int val )
+{
+ _intValues.push_back( val );
+}
+
+//================================================================================
+/*!
+ * Returns elements in the order they are written in MED file
+ */
+//================================================================================
+
+SMDS_ElemIteratorPtr DriverMED_W_Field::GetOrderedElems()
+{
+ if ( _nbElemsByGeom.size() < 2 )
+ return SMDS_ElemIteratorPtr();
+
+ if ( _nbElemsByGeom.size() == 2 )
+ // sole geom type of elements
+ return myMesh->elementsIterator( _elemType );
+
+ std::vector< SMDS_ElemIteratorPtr > iterVec( _nbElemsByGeom.size()-1 );
+ for ( size_t iG = 1; iG < _nbElemsByGeom.size(); ++iG )
+ {
+ int iGeoType = _nbElemsByGeom[ iG ].first;
+ iterVec[ iG-1 ] = SMDS_ElemIteratorPtr
+ ( new SMDS_ElementVectorIterator( _elemsByGeom[ iGeoType ].begin(),
+ _elemsByGeom[ iGeoType ].end() ));
+ }
+ typedef SMDS_IteratorOnIterators
+ < const SMDS_MeshElement *, std::vector< SMDS_ElemIteratorPtr > > TItIterator;
+ return SMDS_ElemIteratorPtr( new TItIterator( iterVec ));
+}
+
+//================================================================================
+/*!
+ * Writes a field to the file
+ */
+//================================================================================
+
+Driver_Mesh::Status DriverMED_W_Field::Perform()
+{
+ if ( myFile.empty() )
+ return addMessage("File name not set", /*isFatal=*/true ); // 'fatal' means 'bug'
+ if ( myMeshId < 0 && myMeshName.empty() )
+ return addMessage("Mesh in file not specified", /*isFatal=*/true );
+ if ( _nbElemsByGeom.size() < 2 )
+ return addMessage("No values to write", /*isFatal=*/false );
+ if ( !myMesh )
+ return addMessage("Supporting mesh not set", /*isFatal=*/true );
+
+ MED::PWrapper medFile = MED::CrWrapper( myFile, MED::eV2_2 );
+ MED::PMeshInfo meshInfo;
+ if ( myMeshId > 0 )
+ {
+ meshInfo = medFile->GetPMeshInfo( myMeshId );
+ }
+ else
+ {
+ // look for a mesh by name
+ int aNbMeshes = medFile->GetNbMeshes();
+ for ( int iMesh = aNbMeshes; iMesh > 0 && myMeshId < 1; --iMesh )
+ {
+ meshInfo = medFile->GetPMeshInfo( iMesh );
+ if ( !meshInfo || meshInfo->GetName() != myMeshName )
+ meshInfo.reset();
+ else
+ myMeshId = iMesh;
+ }
+ }
+ if (( !meshInfo ) ||
+ ( !myMeshName.empty() && meshInfo->GetName() != myMeshName ))
+ {
+ myMeshId = -1;
+ return addMessage("Specified mesh not found in the file", /*isFatal=*/true );
+ }
+
+ // create a field
+ MED::ETypeChamp dataType = _dblValues.empty() ? MED::eINT : MED::eFLOAT64;
+ MED::PFieldInfo fieldInfo = medFile->CrFieldInfo( meshInfo,
+ _compNames.size(),
+ dataType );
+ fieldInfo->SetName( _fieldName );
+ for ( size_t iC = 0; iC < _compNames.size(); ++iC )
+ {
+ fieldInfo->SetCompName( iC, _compNames[ iC ]);
+ fieldInfo->SetUnitName( iC, "");
+ }
+ if ( _compNames.size() > 1 )
+ {
+ for ( size_t i = 0; i < fieldInfo->myCompNames.size()-1; ++i )
+ if ( !fieldInfo->myCompNames[i] )
+ fieldInfo->myCompNames[i] = ' ';
+ }
+ medFile->SetFieldInfo( fieldInfo );
+
+ // specific treatment of added 0D elements
+ if ( _nbElemsByGeom.size() == 3 &&
+ _nbElemsByGeom[1].first == SMDSEntity_0D )
+ {
+ _nbElemsByGeom[1].second += _nbElemsByGeom[2].second;
+ _nbElemsByGeom.resize( 2 );
+ }
+
+ // create a time stamp
+ MED::TGeom2Size type2nb;
+ for ( size_t iG = 1; iG < _nbElemsByGeom.size(); ++iG )
+ {
+ SMDSAbs_EntityType smdsType = _nbElemsByGeom[iG].first;
+ MED::EGeometrieElement medType = (MED::EGeometrieElement) DriverMED::GetMedGeoType( smdsType );
+ int nbElems = _nbElemsByGeom[iG].second - _nbElemsByGeom[iG-1].second;
+ type2nb.insert( make_pair( medType, nbElems ));
+ }
+
+ MED::EEntiteMaillage entity = ( _elemType == SMDSAbs_Node ? MED::eNOEUD : MED::eMAILLE );
+ MED::PTimeStampInfo timeStampInfo = medFile->CrTimeStampInfo( fieldInfo, entity, type2nb );
+ timeStampInfo->myNumDt = _dt;
+ timeStampInfo->myNumOrd = _it;
+
+ MED::PTimeStampValueBase timeStampVal = medFile->CrTimeStampValue( timeStampInfo, dataType );
+ MED::PFloatTimeStampValue timeStampFltVal = timeStampVal;
+ MED::PIntTimeStampValue timeStampIntVal = timeStampVal;
+
+ // set values
+ int iVal = 0, i, nbE;
+ MED::TFloat* ptrDbl = 0;
+ MED::TInt* ptrInt = 0;
+ for ( size_t iG = 1; iG < _nbElemsByGeom.size(); ++iG )
+ {
+ SMDSAbs_EntityType smdsType = _nbElemsByGeom[iG].first;
+ MED::EGeometrieElement medType = (MED::EGeometrieElement) DriverMED::GetMedGeoType( smdsType );
+ int nbElems = ( _nbElemsByGeom[iG].second - _nbElemsByGeom[iG-1].second ) * _compNames.size();
+ if ( dataType == MED::eFLOAT64 )
+ {
+ ptrDbl = timeStampFltVal->GetMeshValue( medType ).GetPointer();
+ for ( int i = 0; i < nbElems; ++i, ++iVal )
+ ptrDbl[ i ] = _dblValues[ iVal ];
+ }
+ else
+ {
+ ptrInt = timeStampIntVal->GetMeshValue( medType ).GetPointer();
+ for ( int i = 0; i < nbElems; ++i, ++iVal )
+ ptrInt[ i ] = _intValues[ iVal ];
+ }
+ }
+
+ // write
+ medFile->SetTimeStampValue( timeStampVal );
+
+ _dblValues.clear();
+ _intValues.clear();
+}
+
+namespace DriverMED // Implemetation of fuctions declared in DriverMED.hxx
+{
+ //================================================================================
+ /*!
+ * Returns a vector containing MED::EGeometrieElement for each SMDSAbs_EntityType
+ */
+ //================================================================================
+
+ const std::vector< MED::EGeometrieElement >& getMedTypesVec()
+ {
+ static std::vector< MED::EGeometrieElement > theVec;
+ if ( theVec.empty() )
+ {
+ theVec.resize( SMDSEntity_Last, MED::eAllGeoType );
+ theVec[ SMDSEntity_Node ] = MED::eNONE ;
+ theVec[ SMDSEntity_0D ] = MED::ePOINT1 ;
+ theVec[ SMDSEntity_Edge ] = MED::eSEG2 ;
+ theVec[ SMDSEntity_Quad_Edge ] = MED::eSEG3 ;
+ theVec[ SMDSEntity_Triangle ] = MED::eTRIA3 ;
+ theVec[ SMDSEntity_Quad_Triangle ] = MED::eTRIA6 ;
+ theVec[ SMDSEntity_BiQuad_Triangle ] = MED::eTRIA7 ;
+ theVec[ SMDSEntity_Quadrangle ] = MED::eQUAD4 ;
+ theVec[ SMDSEntity_Quad_Quadrangle ] = MED::eQUAD8 ;
+ theVec[ SMDSEntity_BiQuad_Quadrangle ] = MED::eQUAD9 ;
+ theVec[ SMDSEntity_Polygon ] = MED::ePOLYGONE;
+ //theVec[ SMDSEntity_Quad_Polygon ] = MED::ePOLYGONE; // !!
+ theVec[ SMDSEntity_Tetra ] = MED::eTETRA4 ;
+ theVec[ SMDSEntity_Quad_Tetra ] = MED::eTETRA10 ;
+ theVec[ SMDSEntity_Pyramid ] = MED::ePYRA5 ;
+ theVec[ SMDSEntity_Quad_Pyramid ] = MED::ePYRA13 ;
+ theVec[ SMDSEntity_Hexa ] = MED::eHEXA8 ;
+ theVec[ SMDSEntity_Quad_Hexa ] = MED::eHEXA20 ;
+ theVec[ SMDSEntity_TriQuad_Hexa ] = MED::eHEXA27 ;
+ theVec[ SMDSEntity_Penta ] = MED::ePENTA6 ;
+ theVec[ SMDSEntity_Quad_Penta ] = MED::ePENTA15 ;
+ theVec[ SMDSEntity_Hexagonal_Prism ] = MED::eOCTA12 ;
+ theVec[ SMDSEntity_Polyhedra ] = MED::ePOLYEDRE;
+ //theVec[ SMDSEntity_Quad_Polyhedra ] = MED::ePOLYEDRE; // !!
+ theVec[ SMDSEntity_Ball ] = MED::eBALL ;
+ }
+ return theVec;
+ }
+
+ //================================================================================
+ /*!
+ * Returns MED element geom type (MED::EGeometrieElement) by SMDS type
+ */
+ //================================================================================
+
+ int GetMedGeoType( SMDSAbs_EntityType smdsType )
+ {
+ return getMedTypesVec()[ smdsType ];
+ }
+
+ //================================================================================
+ /*!
+ * Returns SMDS element geom type by MED type (MED::EGeometrieElement)
+ */
+ //================================================================================
+
+ SMDSAbs_EntityType GetSMDSType( int medType )
+ {
+ const std::vector< MED::EGeometrieElement >& theVec = getMedTypesVec();
+
+ std::vector< MED::EGeometrieElement >::const_iterator i =
+ std::find( theVec.begin(), theVec.end(), medType );
+
+ return SMDSAbs_EntityType( std::distance( theVec.begin(), i ));
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH DriverMED : driver to write a field to 'med' file
+// Module : SMESH
+//
+#ifndef _INCLUDE_DriverMED_W_Field
+#define _INCLUDE_DriverMED_W_Field
+
+#include "SMESH_DriverMED.hxx"
+
+#include "Driver_SMESHDS_Mesh.h"
+#include "SMDSAbs_ElementType.hxx"
+#include "SMDS_ElemIterator.hxx"
+
+#include <string>
+#include <vector>
+
+class MESHDRIVERMED_EXPORT DriverMED_W_Field: public Driver_SMESHDS_Mesh
+{
+ public:
+
+ DriverMED_W_Field();
+
+ void AddODOnVertices(bool toAdd) { _addODOnVertices = toAdd; }
+
+ bool Set(SMESHDS_Mesh * mesh,
+ const std::string & fieldName,
+ SMDSAbs_ElementType type,
+ const int nbComps,
+ const bool isIntData);
+
+ void SetCompName(const int iComp, const char* name);
+
+ void SetDtIt(const int dt, const int it);
+
+ void AddValue( double val );
+ void AddValue( int val );
+
+ /*
+ * Returns elements in the order they are written in MED file. Result can be NULL!
+ */
+ SMDS_ElemIteratorPtr GetOrderedElems();
+
+ /*
+ * Add one field to the file
+ */
+ virtual Status Perform();
+
+ private:
+
+ std::string _fieldName;
+ SMDSAbs_ElementType _elemType;
+ std::vector< std::string > _compNames;
+ std::vector< double > _dblValues;
+ std::vector< int > _intValues;
+ int _dt, _it;
+ bool _addODOnVertices;
+
+ std::vector< const SMDS_MeshElement* > _elemsByGeom[SMDSEntity_Last];
+ std::vector< std::pair< SMDSAbs_EntityType, int > > _nbElemsByGeom;
+};
+
+#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "DriverMED_Family.h"
#include "MED_Factory.hxx"
#include "MED_Utilities.hxx"
+#include "SMDS_IteratorOnIterators.hxx"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_PolyhedralVolumeOfNodes.hxx"
+#include "SMDS_SetIterator.hxx"
#include "SMESHDS_Mesh.hxx"
#include <utilities.h>
if (myDoGroupOfBalls && nbBalls) myBallsDefaultFamilyId = REST_BALL_FAMILY;
MESSAGE("Perform - aFamilyInfo");
- //cout << " DriverMED_Family::MakeFamilies() " << endl;
list<DriverMED_FamilyPtr> aFamilies;
if (myAllSubMeshes) {
aFamilies = DriverMED_Family::MakeFamilies
myDoGroupOf0DElems && nb0DElements,
myDoGroupOfBalls && nbBalls);
}
- //cout << " myMed->SetFamilyInfo() " << endl;
list<DriverMED_FamilyPtr>::iterator aFamsIter;
for (aFamsIter = aFamilies.begin(); aFamsIter != aFamilies.end(); aFamsIter++)
{
const EConnectivite theConnMode = eNOD;
TInt aNbNodes = myMesh->NbNodes();
- //cout << " myMed->CrNodeInfo() aNbNodes = " << aNbNodes << endl;
PNodeInfo aNodeInfo = myMed->CrNodeInfo(aMeshInfo, aNbNodes,
theMode, theSystem, theIsElemNum, theIsElemNames);
int aNodeID = aCoordHelperPtr->GetID();
aNodeInfo->SetElemNum( iNode, aNodeID );
#ifdef _EDF_NODE_IDS_
- aNodeIdMap[aNodeID] = iNode+1;
+ aNodeIdMap.insert( aNodeIdMap.end(), make_pair( aNodeID, iNode+1 ));
#endif
// family number
const SMDS_MeshNode* aNode = aCoordHelperPtr->GetNode();
bool polyTypesSupported = myMed->CrPolygoneInfo(aMeshInfo,eMAILLE,ePOLYGONE,0,0);
TInt nbPolygonNodes = 0, nbPolyhedronNodes = 0, nbPolyhedronFaces = 0;
+ // nodes on VERTEXes where 0D elements are absent
+ std::vector<const SMDS_MeshElement*> nodesOf0D;
+ std::vector< SMDS_ElemIteratorPtr > iterVec;
+ SMDS_ElemIteratorPtr iterVecIter;
+ if ( myAddODOnVertices && getNodesOfMissing0DOnVert( myMesh, nodesOf0D ))
+ {
+ iterVec.resize(2);
+ iterVec[0] = myMesh->elementsIterator( SMDSAbs_0DElement );
+ iterVec[1] = SMDS_ElemIteratorPtr
+ ( new SMDS_ElementVectorIterator( nodesOf0D.begin(), nodesOf0D.end() ));
+
+ typedef SMDS_IteratorOnIterators
+ < const SMDS_MeshElement *, std::vector< SMDS_ElemIteratorPtr > > TItIterator;
+ iterVecIter = SMDS_ElemIteratorPtr( new TItIterator( iterVec ));
+ }
+
// collect info on all geom types
list< TElemTypeData > aTElemTypeDatas;
#endif
aTElemTypeDatas.push_back(TElemTypeData(anEntity,
ePOINT1,
- nbElemInfo.Nb0DElements(),
+ nbElemInfo.Nb0DElements() + nodesOf0D.size(),
SMDSAbs_0DElement));
#ifdef _ELEMENTS_BY_DIM_
anEntity = eSTRUCT_ELEMENT;
TInt aNbNodes = MED::GetNbNodes(aElemTypeData->_geomType);
elemIterator = myMesh->elementsIterator( aElemTypeData->_smdsType );
+ if ( aElemTypeData->_smdsType == SMDSAbs_0DElement && ! nodesOf0D.empty() )
+ elemIterator = iterVecIter;
while ( elemIterator->more() )
{
const SMDS_MeshElement* anElem = elemIterator->next();
mySubMeshes.clear();
return aResult;
}
+
+//================================================================================
+/*!
+ * \brief Returns nodes on VERTEXes where 0D elements are absent
+ */
+//================================================================================
+
+bool DriverMED_W_SMESHDS_Mesh::
+getNodesOfMissing0DOnVert(SMESHDS_Mesh* meshDS,
+ std::vector<const SMDS_MeshElement*>& nodes)
+{
+ nodes.clear();
+ for ( int i = 1; i <= meshDS->MaxShapeIndex(); ++i )
+ {
+ if ( meshDS->IndexToShape( i ).ShapeType() != TopAbs_VERTEX )
+ continue;
+ if ( SMESHDS_SubMesh* sm = meshDS->MeshElements(i) ) {
+ SMDS_NodeIteratorPtr nIt= sm->GetNodes();
+ while (nIt->more())
+ {
+ const SMDS_MeshNode* n = nIt->next();
+ if ( n->NbInverseElements( SMDSAbs_0DElement ) == 0 )
+ nodes.push_back( n );
+ }
+ }
+ }
+ return !nodes.empty();
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <string>
#include <list>
#include <map>
+#include <vector>
class SMESHDS_Mesh;
class SMESHDS_GroupBase;
virtual void SetFile(const std::string& theFileName);
void SetFile(const std::string& theFileName, MED::EVersion theId);
void SetAutoDimension(bool toFindOutDimension) { myAutoDimension = toFindOutDimension; }
+
static std::string GetVersionString(const MED::EVersion theVersion, int theNbDigits=2);
- /*! sets file name; only for usage with Add(), not Write()
- */
void AddGroupOfNodes();
void AddGroupOfEdges();
void AddGroupOfFaces();
void AddGroup(SMESHDS_GroupBase * theGroup);
void AddAllSubMeshes();
void AddSubMesh(SMESHDS_SubMesh* theSubMesh, int theID);
+ void AddODOnVertices(bool toAdd) { myAddODOnVertices = toAdd; }
+
+ static bool getNodesOfMissing0DOnVert(SMESHDS_Mesh* mesh,
+ std::vector<const SMDS_MeshElement*>& nodes);
/*! add one mesh
*/
bool myDoGroupOf0DElems;
bool myDoGroupOfBalls;
bool myAutoDimension;
+ bool myAddODOnVertices;
};
#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
${KERNEL_SALOMEBasics}
MeshDriver
SMDS
+ SMESHUtils
)
SET(_link_LIBRARIES_bin
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <stdio.h>
-#include <gp_Pnt.hxx>
-#include <Basics_Utils.hxx>
-
-//=======================================================================
-//function : HashCode
-//purpose :
-//=======================================================================
-inline Standard_Integer HashCode
- (const gp_Pnt& point, Standard_Integer Upper)
-{
- union
- {
- Standard_Real R[3];
- Standard_Integer I[6];
- } U;
+#include "DriverSTL_R_SMDS_Mesh.h"
- point.Coord(U.R[0],U.R[1],U.R[2]);
+#include <Basics_Utils.hxx>
- return ::HashCode(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7,Upper);
-}
-static Standard_Real tab1[3];
-static Standard_Real tab2[3];
-//=======================================================================
-//function : IsEqual
-//purpose :
-//=======================================================================
-inline Standard_Boolean IsEqual
- (const gp_Pnt& point1, const gp_Pnt& point2)
-{
- point1.Coord(tab1[0],tab1[1],tab1[2]);
- point2.Coord(tab2[0],tab2[1],tab2[2]);
- return (memcmp(tab1,tab2,sizeof(tab1)) == 0);
-}
-#include "DriverSTL_R_SMDS_Mesh.h"
+#include <gp_Pnt.hxx>
+#include <NCollection_DataMap.hxx>
+#include <Standard_NoMoreObject.hxx>
#include "SMDS_Mesh.hxx"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
+#include "SMESH_File.hxx"
-#include <OSD_Path.hxx>
-#include <OSD_File.hxx>
-#include <OSD_FromWhere.hxx>
-#include <OSD_Protection.hxx>
-#include <OSD_SingleProtection.hxx>
-#include <Standard_NoMoreObject.hxx>
-
-#include "utilities.h"
-
-static const int HEADER_SIZE = 84;
-static const int SIZEOF_STL_FACET = 50;
-//static const int STL_MIN_FILE_SIZE = 284;
-static const int ASCII_LINES_PER_FACET = 7;
-
+namespace
+{
+ struct Hasher
+ {
+ //=======================================================================
+ //function : HashCode
+ //purpose :
+ //=======================================================================
+ inline static Standard_Integer HashCode
+ (const gp_Pnt& point, Standard_Integer Upper)
+ {
+ union
+ {
+ Standard_Real R[3];
+ Standard_Integer I[6];
+ } U;
-//typedef NCollection_BaseCollection<SMDS_MeshNodePtr> DriverSTL_ColOfNodePtr;
+ point.Coord( U.R[0], U.R[1], U.R[2] );
+ return ::HashCode(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7,Upper);
+ }
+ //=======================================================================
+ //function : IsEqual
+ //purpose :
+ //=======================================================================
+ inline static Standard_Boolean IsEqual
+ (const gp_Pnt& point1, const gp_Pnt& point2)
+ {
+ static Standard_Real tab1[3], tab2[3];
+ point1.Coord(tab1[0],tab1[1],tab1[2]);
+ point2.Coord(tab2[0],tab2[1],tab2[2]);
+ return (memcmp(tab1,tab2,sizeof(tab1)) == 0);
+ }
+ };
+ typedef NCollection_DataMap<gp_Pnt,SMDS_MeshNode*,Hasher> TDataMapOfPntNodePtr;
+
+ const int HEADER_SIZE = 84;
+ const int SIZEOF_STL_FACET = 50;
+ const int ASCII_LINES_PER_FACET = 7;
+ const int SIZE_OF_FLOAT = 4;
+ // const int STL_MIN_FILE_SIZE = 284;
+}
-#include <NCollection_DataMap.hxx>
-typedef NCollection_DataMap<gp_Pnt,SMDS_MeshNode*> DriverSTL_DataMapOfPntNodePtr;
//=======================================================================
//function : DriverSTL_R_SMDS_Mesh
-//purpose :
+//purpose :
//=======================================================================
DriverSTL_R_SMDS_Mesh::DriverSTL_R_SMDS_Mesh()
Status aResult = DRS_OK;
- TCollection_AsciiString aFileName( (char *)myFile.c_str() );
- if ( aFileName.IsEmpty() ) {
+ if ( myFile.empty() ) {
fprintf(stderr, ">> ERREOR : invalid file name \n");
return DRS_FAIL;
}
- filebuf fic;
- Standard_IStream is(&fic);
- if (!fic.open(aFileName.ToCString(),ios::in)) {
- fprintf(stderr, ">> ERROR : cannot open file %s \n", aFileName.ToCString());
+ SMESH_File file( myFile, /*open=*/false );
+ if ( !file.open() ) {
+ fprintf(stderr, ">> ERROR : cannot open file %s \n", myFile.c_str());
return DRS_FAIL;
}
-
- OSD_Path aPath( aFileName );
- OSD_File file = OSD_File( aPath );
- file.Open(OSD_ReadOnly,OSD_Protection(OSD_RWD,OSD_RWD,OSD_RWD,OSD_RWD));
- unsigned char str[128];
- Standard_Integer lread,i;
- Standard_Address ach;
- ach = (Standard_Address)str;
// we skip the header which is in Ascii for both modes
- file.Read(ach,HEADER_SIZE,lread);
+ const char* data = file;
+ data += HEADER_SIZE;
- // we read 128 characters to detect if we have a non-ascii char
- file.Read(ach,sizeof(str),lread);
-
+ // we check 128 characters to detect if we have a non-ascii char
myIsAscii = Standard_True;
- for (i = 0; i < lread; ++i) {
- if (str[i] > '~') {
+ for (int i = 0; i < 128; ++i, ++data) {
+ if ( !isascii( *data ) && data < file.end() ) {
myIsAscii = Standard_False;
break;
}
}
-
- file.Close();
if ( !myMesh ) {
fprintf(stderr, ">> ERREOR : cannot create mesh \n");
}
if ( myIsAscii )
- aResult = readAscii();
+ aResult = readAscii( file );
else
- aResult = readBinary();
+ aResult = readBinary( file );
return aResult;
}
// static methods
-static Standard_Real readFloat(OSD_File& theFile)
+static Standard_Real readFloat(SMESH_File& theFile)
{
union {
- Standard_Boolean i;
+ Standard_Boolean i;
Standard_ShortReal f;
- }u;
+ } u;
- char c[4];
- Standard_Address adr;
- adr = (Standard_Address)c;
- Standard_Integer lread;
- theFile.Read(adr,4,lread);
+ const char* c = theFile;
u.i = c[0] & 0xFF;
u.i |= (c[1] & 0xFF) << 0x08;
u.i |= (c[2] & 0xFF) << 0x10;
u.i |= (c[3] & 0xFF) << 0x18;
+ theFile += SIZE_OF_FLOAT;
return u.f;
}
static SMDS_MeshNode* addNode(const gp_Pnt& P,
- DriverSTL_DataMapOfPntNodePtr& uniqnodes,
+ TDataMapOfPntNodePtr& uniqnodes,
SMDS_Mesh* theMesh)
{
SMDS_MeshNode* node = 0;
}
static SMDS_MeshNode* readNode(FILE* file,
- DriverSTL_DataMapOfPntNodePtr& uniqnodes,
+ TDataMapOfPntNodePtr& uniqnodes,
SMDS_Mesh* theMesh)
{
Standard_ShortReal coord[3];
return addNode( P, uniqnodes, theMesh );
}
-static SMDS_MeshNode* readNode(OSD_File& theFile,
- DriverSTL_DataMapOfPntNodePtr& uniqnodes,
+static SMDS_MeshNode* readNode(SMESH_File& theFile,
+ TDataMapOfPntNodePtr& uniqnodes,
SMDS_Mesh* theMesh)
{
- Standard_ShortReal coord[3];
- coord[0] = readFloat(theFile);
- coord[1] = readFloat(theFile);
- coord[2] = readFloat(theFile);
+ gp_Pnt coord;
+ coord.SetX( readFloat(theFile));
+ coord.SetY( readFloat(theFile));
+ coord.SetZ( readFloat(theFile));
- gp_Pnt P(coord[0],coord[1],coord[2]);
- return addNode( P, uniqnodes, theMesh );
+ return addNode( coord, uniqnodes, theMesh );
}
//=======================================================================
//purpose :
//=======================================================================
-Driver_Mesh::Status DriverSTL_R_SMDS_Mesh::readAscii() const
+Driver_Mesh::Status DriverSTL_R_SMDS_Mesh::readAscii(SMESH_File& theFile) const
{
Status aResult = DRS_OK;
- long ipos;
- Standard_Integer nbLines = 0;
- // Open the file
- TCollection_AsciiString aFileName( (char *)myFile.c_str() );
- FILE* file = fopen(aFileName.ToCString(),"r");
- fseek(file,0L,SEEK_END);
// get the file size
- long filesize = ftell(file);
- fclose(file);
- file = fopen(aFileName.ToCString(),"r");
-
+ long filesize = theFile.size();
+ theFile.close();
+
+ // Open the file
+ FILE* file = fopen( myFile.c_str(),"r");
+
// count the number of lines
- for (ipos = 0; ipos < filesize; ++ipos) {
+ Standard_Integer nbLines = 0;
+ for (long ipos = 0; ipos < filesize; ++ipos) {
if (getc(file) == '\n')
nbLines++;
}
// go back to the beginning of the file
-// fclose(file);
-// file = fopen(aFileName.ToCString(),"r");
rewind(file);
Standard_Integer nbTri = (nbLines / ASCII_LINES_PER_FACET);
- DriverSTL_DataMapOfPntNodePtr uniqnodes;
+ TDataMapOfPntNodePtr uniqnodes;
// skip header
while (getc(file) != '\n');
//purpose :
//=======================================================================
-Driver_Mesh::Status DriverSTL_R_SMDS_Mesh::readBinary() const
+Driver_Mesh::Status DriverSTL_R_SMDS_Mesh::readBinary(SMESH_File& file) const
{
Status aResult = DRS_OK;
- char buftest[5];
- Standard_Address adr;
- adr = (Standard_Address)buftest;
-
- TCollection_AsciiString aFileName( (char *)myFile.c_str() );
- OSD_File aFile = OSD_File(OSD_Path( aFileName ));
- aFile.Open(OSD_ReadOnly,OSD_Protection(OSD_RWD,OSD_RWD,OSD_RWD,OSD_RWD));
-
// the size of the file (minus the header size)
// must be a multiple of SIZEOF_STL_FACET
- // compute file size
- Standard_Integer filesize = aFile.Size();
+ long filesize = file.size();
if ( (filesize - HEADER_SIZE) % SIZEOF_STL_FACET !=0
// Commented to allow reading small files (ex: 1 face)
Standard_Integer nbTri = ((filesize - HEADER_SIZE) / SIZEOF_STL_FACET);
// skip the header
- aFile.Seek(HEADER_SIZE,OSD_FromBeginning);
+ file += HEADER_SIZE;
- DriverSTL_DataMapOfPntNodePtr uniqnodes;
- Standard_Integer lread;
+ TDataMapOfPntNodePtr uniqnodes;
for (Standard_Integer iTri = 0; iTri < nbTri; ++iTri) {
// ignore normals
- readFloat(aFile);
- readFloat(aFile);
- readFloat(aFile);
+ file += 3 * SIZE_OF_FLOAT;
// read vertices
- SMDS_MeshNode* node1 = readNode( aFile, uniqnodes, myMesh );
- SMDS_MeshNode* node2 = readNode( aFile, uniqnodes, myMesh );
- SMDS_MeshNode* node3 = readNode( aFile, uniqnodes, myMesh );
+ SMDS_MeshNode* node1 = readNode( file, uniqnodes, myMesh );
+ SMDS_MeshNode* node2 = readNode( file, uniqnodes, myMesh );
+ SMDS_MeshNode* node3 = readNode( file, uniqnodes, myMesh );
if (myIsCreateFaces)
myMesh->AddFace(node1,node2,node3);
// skip extra bytes
- aFile.Read(adr,2,lread);
+ file += 2;
}
- aFile.Close();
return aResult;
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "Driver_SMDS_Mesh.h"
-#include <Standard_TypeDef.hxx>
+class SMESH_File;
class MESHDRIVERSTL_EXPORT DriverSTL_R_SMDS_Mesh: public Driver_SMDS_Mesh
{
private:
// PRIVATE METHODS
- Status readAscii() const;
- Status readBinary() const;
+ Status readAscii (SMESH_File& file) const;
+ Status readBinary(SMESH_File& file) const;
private:
// PRIVATE FIELDS
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <stdio.h>
-#include <limits>
-
#include "DriverSTL_W_SMDS_Mesh.h"
+#ifdef WIN32
+#define NOMINMAX
+#endif
+
+#include <Basics_Utils.hxx>
+
#include "SMDS_FaceOfNodes.hxx"
#include "SMDS_IteratorOnIterators.hxx"
#include "SMDS_Mesh.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_SetIterator.hxx"
#include "SMDS_VolumeTool.hxx"
+#include "SMESH_File.hxx"
#include "SMESH_TypeDefs.hxx"
-#include <OSD_File.hxx>
-#include <OSD_Path.hxx>
-#include <OSD_Protection.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <gp_XYZ.hxx>
-#include <Basics_Utils.hxx>
+//#include "utilities.h"
+
+#include <limits>
-#include "utilities.h"
// definition des constantes
static const int LABEL_SIZE = 80;
// static methods
-static void writeInteger( const Standard_Integer& theVal, OSD_File& ofile )
+static void writeInteger( const Standard_Integer& theVal, SMESH_File& ofile )
{
union {
Standard_Integer i;
entier |= (u.c[2] & 0xFF) << 0x10;
entier |= (u.c[3] & 0xFF) << 0x18;
- ofile.Write((char *)&entier,sizeof(u.c));
+ ofile.write( entier );
}
-static void writeFloat ( const Standard_ShortReal& theVal,
- OSD_File& ofile)
+static void writeFloat( const Standard_ShortReal& theVal, SMESH_File& ofile)
{
union {
Standard_ShortReal f;
char c[4];
- }u;
+ } u;
u.f = theVal;
entier |= (u.c[2] & 0xFF) << 0x10;
entier |= (u.c[3] & 0xFF) << 0x18;
- ofile.Write((char *)&entier,sizeof(u.c));
+ ofile.write( entier );
}
static gp_XYZ getNormale( const SMDS_MeshNode* n1,
Driver_Mesh::Status DriverSTL_W_SMDS_Mesh::writeAscii() const
{
Status aResult = DRS_OK;
- TCollection_AsciiString aFileName( (char *)myFile.c_str() );
- if ( aFileName.IsEmpty() ) {
+ if ( myFile.empty() ) {
fprintf(stderr, ">> ERREOR : invalid file name \n");
return DRS_FAIL;
}
- OSD_File aFile = OSD_File(OSD_Path(aFileName));
- aFile.Build(OSD_WriteOnly,OSD_Protection());
+ SMESH_File aFile( myFile, /*openForReading=*/false );
+ aFile.openForWriting();
- char sval[16];
- TCollection_AsciiString buf = TCollection_AsciiString ("solid\n");
- aFile.Write (buf,buf.Length());buf.Clear();
+ std::string buf("solid\n");
+ aFile.writeRaw( buf.c_str(), buf.size() );
+ char sval[128];
const SMDS_MeshNode* triaNodes[2048];
SMDS_ElemIteratorPtr itFaces = getFaces();
gp_XYZ normale = getNormale( triaNodes[iN],
triaNodes[iN+1],
triaNodes[iN+2] );
+ sprintf (sval,
+ " facet normal % 12e % 12e % 12e\n"
+ " outer loop\n" ,
+ normale.X(), normale.Y(), normale.Z());
+ aFile.writeRaw ( sval, 70 );
- buf += " facet normal ";
- sprintf (sval,"% 12e",normale.X());
- buf += sval;
- buf += " ";
- sprintf (sval,"% 12e",normale.Y());
- buf += sval;
- buf += " ";
- sprintf (sval,"% 12e",normale.Z());
- buf += sval;
- buf += '\n';
- aFile.Write (buf,buf.Length());buf.Clear();
- buf += " outer loop\n";
- aFile.Write (buf,buf.Length());buf.Clear();
-
- for ( int jN = 0; jN < 3; ++jN, ++iN ) {
- const SMDS_MeshNode* node = triaNodes[iN];
- buf += " vertex ";
- sprintf (sval,"% 12e",node->X());
- buf += sval;
- buf += " ";
- sprintf (sval,"% 12e",node->Y());
- buf += sval;
- buf += " ";
- sprintf (sval,"% 12e",node->Z());
- buf += sval;
- buf += '\n';
- aFile.Write (buf,buf.Length());buf.Clear();
+ for ( int jN = 0; jN < 3; ++jN, ++iN )
+ {
+ SMESH_TNodeXYZ node = triaNodes[iN];
+ sprintf (sval,
+ " vertex % 12e % 12e % 12e\n",
+ node.X(), node.Y(), node.Z() );
+ aFile.writeRaw ( sval, 54 );
}
- buf += " endloop\n";
- aFile.Write (buf,buf.Length());buf.Clear();
- buf += " endfacet\n";
- aFile.Write (buf,buf.Length());buf.Clear();
+ aFile.writeRaw (" endloop\n"
+ " endfacet\n", 21 );
}
}
- buf += "endsolid\n";
- aFile.Write (buf,buf.Length());buf.Clear();
-
- aFile.Close ();
+ aFile.writeRaw ("endsolid\n" , 9 );
return aResult;
}
Driver_Mesh::Status DriverSTL_W_SMDS_Mesh::writeBinary() const
{
Status aResult = DRS_OK;
- TCollection_AsciiString aFileName( (char *)myFile.c_str() );
- if ( aFileName.IsEmpty() ) {
+
+ if ( myFile.empty() ) {
fprintf(stderr, ">> ERREOR : invalid filename \n");
return DRS_FAIL;
}
- OSD_File aFile = OSD_File(OSD_Path(aFileName));
- aFile.Build(OSD_WriteOnly,OSD_Protection());
+ SMESH_File aFile( myFile );
+ aFile.openForWriting();
// we first count the number of triangles
int nbTri = myVolumeTrias.size();
nbTri += getNbTriangles( aFace );
}
}
- // char sval[80]; -- avoid writing not initialized memory
- TCollection_AsciiString sval(LABEL_SIZE-1,' ');
- aFile.Write((Standard_Address)sval.ToCString(),LABEL_SIZE);
+ std::string sval( LABEL_SIZE, ' ' );
+ aFile.write( sval.c_str(), LABEL_SIZE );
// write number of triangles
- writeInteger(nbTri,aFile);
+ writeInteger( nbTri, aFile );
// Loop writing nodes
writeFloat(node->Y(),aFile);
writeFloat(node->Z(),aFile);
}
- aFile.Write (&dum,2);
- }
+ aFile.writeRaw ( &dum, 2 );
+ }
}
- aFile.Close ();
return aResult;
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
#include "MED_Algorithm.hxx"
#include "MED_Wrapper.hxx"
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
#ifndef MED_Algorithm_HeaderFile
#define MED_Algorithm_HeaderFile
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
typedef enum {eFULL_INTERLACE, eNO_INTERLACE} EModeSwitch;
- typedef enum {eFLOAT64=6, eINT=26} ETypeChamp;
+ typedef enum {eFLOAT64=6, eINT=24, eLONG=26 } ETypeChamp;
typedef enum {eNON_STRUCTURE, eSTRUCTURE} EMaillage;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
#include "MED_CoordUtils.hxx"
#include "MED_Utilities.hxx"
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
#ifndef MED_CoordUtils_HeaderFile
#define MED_CoordUtils_HeaderFile
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
#include "MED_GaussUtils.hxx"
#include "MED_Utilities.hxx"
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
#ifndef MED_GaussUtils_HeaderFile
#define MED_GaussUtils_HeaderFile
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
#ifndef MED_SharedPtr_HeaderFile
#define MED_SharedPtr_HeaderFile
//! Construct the class by any specialisation of the class
template<class Y>
SharedPtr(SharedPtr<Y> const & r):
- boost::shared_ptr<T>(r,boost::detail::dynamic_cast_tag())
+ boost::shared_ptr<T>(boost::dynamic_pointer_cast<T,Y>(r))
{}
//! Copy-constructor
SharedPtr&
operator=(SharedPtr<Y> const & r)
{
- boost::shared_ptr<T>(r,boost::detail::dynamic_cast_tag()).swap(*this);
+ SharedPtr<T>(r).swap(*this);
return *this;
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
#ifndef MED_SliceArray_HeaderFile
#define MED_SliceArray_HeaderFile
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
#ifndef MED_TStructures_HeaderFile
#define MED_TStructures_HeaderFile
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
#include "MED_Utilities.hxx"
#include "MED_Common.hxx"
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
#ifndef MED_Utilities_HeaderFile
#define MED_Utilities_HeaderFile
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
#ifndef MED_Vector_HeaderFile
#define MED_Vector_HeaderFile
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
template<class Y>
SharedPtr(SharedPtr<Y> const & r):
- boost::shared_ptr<TWrapper>(r,boost::detail::dynamic_cast_tag())
+ boost::shared_ptr<TWrapper>(boost::dynamic_pointer_cast<TWrapper,Y>(r))
{}
template<class Y>
SharedPtr&
operator=(SharedPtr<Y> const & r)
{
- boost::shared_ptr<TWrapper>(r,boost::detail::dynamic_cast_tag()).swap(*this);
+ SharedPtr<TWrapper>(r).swap(*this);
return *this;
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// 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 "MED_Factory.hxx"
#include "MED_Utilities.hxx"
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// 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 MED_Factory_HeaderFile
#define MED_Factory_HeaderFile
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
#ifndef MED_V2_2_Wrapper_HeaderFile
#define MED_V2_2_Wrapper_HeaderFile
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
// MEFISTO : library to compute 2D triangulation from segmented boundaries
//
-// Copyright (C) 2006-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2006-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MEFISTO2: a library to compute 2D triangulation from segmented boundaries
//
//
-// Copyright (C) 2006-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2006-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// SMESH MEFISTO2 : algorithm for meshing
//
-// Copyright (C) 2006-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2006-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
c MEFISTO : library to compute 2D triangulation from segmented boundaries
c
-c Copyright (C) 2006-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+c Copyright (C) 2006-2014 CEA/DEN, EDF R&D, OPEN CASCADE
c
c This library is free software; you can redistribute it and/or
c modify it under the terms of the GNU Lesser General Public
c License as published by the Free Software Foundation; either
-c version 2.1 of the License.
+c version 2.1 of the License, or (at your option) any later version.
c
c This library is distributed in the hope that it will be useful,
c but WITHOUT ANY WARRANTY; without even the implied warranty of
c MEFISTO2: a library to compute 2D triangulation from segmented boundaries
c
-c Copyright (C) 2006-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+c Copyright (C) 2006-2014 CEA/DEN, EDF R&D, OPEN CASCADE
c
c This library is free software; you can redistribute it and/or
c modify it under the terms of the GNU Lesser General Public
c License as published by the Free Software Foundation; either
-c version 2.1 of the License.
+c version 2.1 of the License, or (at your option) any later version.
c
c This library is distributed in the hope that it will be useful,
c but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
myControlsPrecision = mgr->integerValue( "SMESH", "controls_precision", -1);
- double aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5);
- double aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_size",10);
- double aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
- double aOutlineWidth = SMESH::GetFloat("SMESH:outline_width",1);
+ double aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5);
+ double aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_size",10);
+ double aBallElemScale = SMESH::GetFloat("SMESH:ball_elem_scale",1.0);
+ double aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
+ double aOutlineWidth = SMESH::GetFloat("SMESH:outline_width",1);
SMESH::LabelFont aFamilyNd = SMESH::FntTimes;
bool aBoldNd = true;
#endif
SetBallSize(aBallElemSize);
+ SetBallScale(aBallElemScale);
Set0DSize(aElem0DSize);
}
Modified();
}
-void SMESH_ActorDef::SetShrink(){
+void SMESH_ActorDef::SetShrink() {
if(!myIsShrinkable) return;
myBaseActor->SetShrink();
return myBallProp->GetPointSize();
}
+double SMESH_ActorDef::GetBallScale()
+{
+ return myBallActor->GetBallScale();
+}
+
+void SMESH_ActorDef::SetBallScale( double theVal )
+{
+ myBallActor->SetBallScale( theVal );
+}
+
int SMESH_ActorDef::GetObjDimension( const int theObjId )
{
return myVisualObj->GetElemDimension( theObjId );
my3DExtActor->SetPlaneCollection( myPlaneCollection );
my3DExtActor->SetUnstructuredGrid(myVisualObj->GetUnstructuredGrid());
- Modified();
+ if(IsShrunk())
+ SetShrink();
+ else
+ Modified();
}
void
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
virtual void SetBallSize(double size) = 0;
virtual double GetBallSize() = 0;
+ virtual void SetBallScale(double size) = 0;
+ virtual double GetBallScale() = 0;
+
enum EReperesent { ePoint, eEdge, eSurface};
enum EEntityMode { e0DElements = 0x01, eEdges = 0x02, eFaces = 0x04, eVolumes = 0x08, eBallElem = 0x10, eAllEntity = 0x1f};
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
virtual void SetBallSize(double size);
virtual double GetBallSize();
+ virtual void SetBallScale(double size);
+ virtual double GetBallScale();
+
virtual int GetNodeObjId(int theVtkID);
virtual double* GetNodeCoord(int theObjID);
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
if(MYDEBUG) MESSAGE("~SMESH_DeviceActor - "<<this);
myMapper->Delete();
- myPlaneCollection->Delete();
myProperty->Delete();
myMapper->SetBallEnabled( theBallEnabled );
}
+/*!
+ * Set point marker scale factor
+ * \param theBallScale double value which specifies a scale factor of ball element
+ */
+void SMESH_DeviceActor::SetBallScale( double theBallScale )
+{
+ myMapper->SetBallScale( theBallScale );
+ myMapper->Modified();
+}
+
/*!
* Set standard point marker
* \param theMarkerType type of the marker
return myMapper->GetMarkerTexture();
}
+/*!
+ * Get scale factor of ball element
+ * \return scale factor of ball element
+ */
+double SMESH_DeviceActor::GetBallScale()
+{
+ return myMapper->GetBallScale();
+}
+
void SMESH_DeviceActor::SetCoincident3DAllowed(bool theFlag) {
myGeomFilter->SetAppendCoincident3D(theFlag);
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
void SetMarkerEnabled( bool );
void SetBallEnabled( bool );
+ void SetBallScale( double );
void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
void SetMarkerTexture( int, VTK::MarkerTexture );
VTK::MarkerType GetMarkerType();
VTK::MarkerScale GetMarkerScale();
int GetMarkerTexture();
+ double GetBallScale();
protected:
void Init(TVisualObjPtr theVisualObj, vtkImplicitBoolean* theImplicitBoolean);
VTKViewer_PolyDataMapper *myMapper;
TVisualObjPtr myVisualObj;
- vtkPlaneCollection* myPlaneCollection;
+ vtkSmartPointer<vtkPlaneCollection> myPlaneCollection;
+
vtkProperty *myProperty;
EReperesent myRepresentation;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
};
/*!
- * Enumeration of entity type uses in mesh info array,
- * and should be synchronised with enum in SMDS
+ * Enumeration of entity type used in mesh info array
*/
enum SMDSAbs_EntityType {
SMDSEntity_Node,
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
SMDS_ElemIteratorPtr SMDS_Mesh::elementEntityIterator(SMDSAbs_EntityType type) const
{
+ if ( type == SMDSEntity_Node )
+ {
+ typedef ElemVecIterator<const SMDS_MeshElement*, SMDS_MeshNode*> TIterator;
+ return SMDS_ElemIteratorPtr( new TIterator(myNodes));
+ }
// naturally always sorted by ID
typedef ElemVecIterator
< const SMDS_MeshElement*, SMDS_MeshCell*, SMDS_MeshElement::EntityFilter > TIterator;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//=======================================================================
SMDS_Mesh0DElement::SMDS_Mesh0DElement (const SMDS_MeshNode * node)
{
- MESSAGE("SMDS_Mesh0DElement " << GetID());
myNode = node;
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
virtual SMDSAbs_ElementType GetType() const;
virtual SMDSAbs_EntityType GetEntityType() const { return SMDSEntity_Polygon; }
+ virtual SMDSAbs_GeometryType GetGeomType() const { return SMDSGeom_POLYGON; }
virtual bool IsPoly() const { return true; };
bool ChangeNodes (std::vector<const SMDS_MeshNode *> nodes);
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// / | / |
// N4+----------+N7 |
// | | | | HEXAHEDRON
-// | | | |
-// | | | |
// | N1+------|---+N2
// | / | /
// | / | /
{ 3, 7, 6, 2, 3 },
{ 0, 4, 7, 3, 0 }};
static int Hexa_nbN [] = { 4, 4, 4, 4, 4, 4 };
+static int Hexa_oppF[] = { 1, 0, 4, 5, 2, 3 }; // oppopsite facet indices
/*
// N8 +------+ N9
*/
static int QuadPenta_F [5][9] = { // FORWARD
{ 0, 6, 1, 7, 2, 8, 0, 0, 0 },
- { 3,11, 5, 10,4, 9, 3, 3, 3 },
+ { 3, 11,5, 10,4, 9, 3, 3, 3 },
{ 0, 12,3, 9, 4, 13,1, 6, 0 },
{ 1, 13,4, 10,5, 14,2, 7, 1 },
{ 0, 8, 2, 14,5, 11,3, 12,0 }};
break;
case 20:
case 27:
- if ( faceIndex <= 1 ) // top or bottom
- ind = 1 - faceIndex;
- else {
- const int nbSideFaces = myAllFacesNbNodes[0] / 2;
- ind = ( faceIndex - nbHoriFaces + nbSideFaces/2 ) % nbSideFaces + nbHoriFaces;
- }
+ ind = GetOppFaceIndexOfHex( faceIndex );
break;
default:;
}
return ind;
}
+//=======================================================================
+//function : GetOppFaceIndexOfHex
+//purpose : Return index of the opposite face of the hexahedron
+//=======================================================================
+
+int SMDS_VolumeTool::GetOppFaceIndexOfHex( int faceIndex )
+{
+ return Hexa_oppF[ faceIndex ];
+}
+
//=======================================================================
//function : IsLinked
//purpose : return true if theNode1 is linked with theNode2
//purpose : Return index of a face formed by theFaceNodes
//=======================================================================
-int SMDS_VolumeTool::GetFaceIndex( const set<const SMDS_MeshNode*>& theFaceNodes ) const
+int SMDS_VolumeTool::GetFaceIndex( const set<const SMDS_MeshNode*>& theFaceNodes,
+ const int theFaceIndexHint ) const
{
+ if ( theFaceIndexHint >= 0 )
+ {
+ int nbNodes = NbFaceNodes( theFaceIndexHint );
+ if ( nbNodes == (int) theFaceNodes.size() )
+ {
+ const SMDS_MeshNode** nodes = GetFaceNodes( theFaceIndexHint );
+ while ( nbNodes )
+ if ( theFaceNodes.count( nodes[ nbNodes-1 ]))
+ --nbNodes;
+ else
+ break;
+ if ( nbNodes == 0 )
+ return theFaceIndexHint;
+ }
+ }
for ( int iFace = 0; iFace < myNbFaces; iFace++ )
{
- const int nbNodes = NbFaceNodes( iFace );
+ if ( iFace == theFaceIndexHint )
+ continue;
+ int nbNodes = NbFaceNodes( iFace );
if ( nbNodes == (int) theFaceNodes.size() )
{
const SMDS_MeshNode** nodes = GetFaceNodes( iFace );
- set<const SMDS_MeshNode*> nodeSet( nodes, nodes + nbNodes);
- if ( theFaceNodes == nodeSet )
+ while ( nbNodes )
+ if ( theFaceNodes.count( nodes[ nbNodes-1 ]))
+ --nbNodes;
+ else
+ break;
+ if ( nbNodes == 0 )
return iFace;
}
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
int GetCenterNodeIndex( int faceIndex ) const;
// Return index of the node located at face center of a quadratic element like HEX27
- int GetFaceIndex( const std::set<const SMDS_MeshNode*>& theFaceNodes ) const;
+ int GetFaceIndex( const std::set<const SMDS_MeshNode*>& theFaceNodes,
+ const int theFaceIndexHint=-1) const;
// Return index of a face formed by theFaceNodes.
// Return -1 if a face not found
static int NbCornerNodes(VolumeType type);
// Useful to know nb of corner nodes of a quadratic volume
+ static int GetOppFaceIndexOfHex( int faceIndex );
+ // Return index of the opposite face of the hexahedron
+
private:
bool setFace( int faceIndex ) const;
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
int SMDS_VtkVolume::NbCornerNodes() const
{
vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
- int nbN = grid->GetCell(myVtkID)->GetNumberOfPoints();
vtkIdType aVtkType = grid->GetCellType(myVtkID);
switch (aVtkType)
{
case VTK_TRIQUADRATIC_HEXAHEDRON: return 8;
default:;
}
- return nbN;
+ return NbNodes();
}
SMDSAbs_EntityType SMDS_VtkVolume::GetEntityType() const
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2006-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2006-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
return false;
SMESHDS_SubMesh * eSubMesh = theMesh->MeshElements( theEdge );
- if ( !eSubMesh || !eSubMesh->GetElements()->more() )
+ if ( !eSubMesh || ( eSubMesh->NbElements()==0 && eSubMesh->NbNodes() == 0))
return false; // edge is not meshed
int nbNodes = 0;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESH_TryCatch.hxx" // include after OCCT headers!
#include "Utils_ExceptHandlers.hxx"
-
+#ifndef WIN32
#include <boost/thread/thread.hpp>
#include <boost/bind.hpp>
+#else
+#include <pthread.h>
+#endif
using namespace std;
namespace
{
+#ifndef WIN32
void deleteMeshDS(SMESHDS_Mesh* meshDS)
{
//cout << "deleteMeshDS( " << meshDS << endl;
delete meshDS;
}
+#else
+ static void* deleteMeshDS(void* meshDS)
+ {
+ //cout << "deleteMeshDS( " << meshDS << endl;
+ SMESHDS_Mesh* m = (SMESHDS_Mesh*)meshDS;
+ if(m) {
+ delete m;
+ }
+ return 0;
+ }
+#endif
}
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
_myDocument->RemoveMesh( _id );
_myDocument = 0;
- if ( _myMeshDS )
+ if ( _myMeshDS ) {
// delete _myMeshDS, in a thread in order not to block closing a study with large meshes
+#ifndef WIN32
boost::thread aThread(boost::bind( & deleteMeshDS, _myMeshDS ));
+#else
+ pthread_t thread;
+ int result=pthread_create(&thread, NULL, deleteMeshDS, (void*)_myMeshDS);
+#endif
+ }
}
//================================================================================
//================================================================================
/*!
* \brief Export the mesh to a med file
+ * \param [in] file - name of the MED file
+ * \param [in] theMeshName - name of this mesh
+ * \param [in] theAutoGroups - boolean parameter for creating/not creating
+ * the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
+ * the typical use is auto_groups=false.
+ * \param [in] theVersion - defines the version of format of MED file, that will be created
+ * \param [in] meshPart - mesh data to export
+ * \param [in] theAutoDimension - if \c true, a space dimension of a MED mesh can be either
+ * - 1D if all mesh nodes lie on OX coordinate axis, or
+ * - 2D if all mesh nodes lie on XOY coordinate plane, or
+ * - 3D in the rest cases.
+ * If \a theAutoDimension is \c false, the space dimension is always 3.
+ * \return int - mesh index in the file
*/
//================================================================================
bool theAutoGroups,
int theVersion,
const SMESHDS_Mesh* meshPart,
- bool theAutoDimension)
+ bool theAutoDimension,
+ bool theAddODOnVertices)
throw(SALOME_Exception)
{
SMESH_TRY;
myWriter.SetFile ( file, MED::EVersion(theVersion) );
myWriter.SetMesh ( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS );
myWriter.SetAutoDimension( theAutoDimension );
+ myWriter.AddODOnVertices ( theAddODOnVertices );
if ( !theMeshName )
myWriter.SetMeshId ( _id );
else {
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
bool theAutoGroups = true,
int theVersion = 0,
const SMESHDS_Mesh* theMeshPart = 0,
- bool theAutoDimension = false)
+ bool theAutoDimension = false,
+ bool theAddODOnVertices = false)
throw(SALOME_Exception);
void ExportDAT(const char * file,
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
const int* thePentaTo3[6] = { thePentaTo3_1, thePentaTo3_2, thePentaTo3_3,
thePentaTo3_4, thePentaTo3_5, thePentaTo3_6 };
+ // Methods of splitting hexahedron into prisms
+
+ const int theHexTo4Prisms_BT[6*4+1] = // bottom-top
+ {
+ 0, 1, 8, 4, 5, 9, 1, 2, 8, 5, 6, 9, 2, 3, 8, 6, 7, 9, 3, 0, 8, 7, 4, 9, -1
+ };
+ const int theHexTo4Prisms_LR[6*4+1] = // left-right
+ {
+ 1, 0, 8, 2, 3, 9, 0, 4, 8, 3, 7, 9, 4, 5, 8, 7, 6, 9, 5, 1, 8, 6, 2, 9, -1
+ };
+ const int theHexTo4Prisms_FB[6*4+1] = // front-back
+ {
+ 0, 3, 8, 1, 2, 9, 3, 7, 8, 2, 6, 9, 7, 4, 8, 6, 5, 9, 4, 0, 8, 5, 1, 9, -1
+ };
+
+ const int theHexTo2Prisms_BT_1[6*2+1] =
+ {
+ 0, 1, 3, 4, 5, 7, 1, 2, 3, 5, 6, 7, -1
+ };
+ const int theHexTo2Prisms_BT_2[6*2+1] =
+ {
+ 0, 1, 2, 4, 5, 6, 0, 2, 3, 4, 6, 7, -1
+ };
+ const int* theHexTo2Prisms_BT[2] = { theHexTo2Prisms_BT_1, theHexTo2Prisms_BT_2 };
+
+ const int theHexTo2Prisms_LR_1[6*2+1] =
+ {
+ 1, 0, 4, 2, 3, 7, 1, 4, 5, 2, 7, 6, -1
+ };
+ const int theHexTo2Prisms_LR_2[6*2+1] =
+ {
+ 1, 0, 4, 2, 3, 7, 1, 4, 5, 2, 7, 6, -1
+ };
+ const int* theHexTo2Prisms_LR[2] = { theHexTo2Prisms_LR_1, theHexTo2Prisms_LR_2 };
+
+ const int theHexTo2Prisms_FB_1[6*2+1] =
+ {
+ 0, 3, 4, 1, 2, 5, 3, 7, 4, 2, 6, 5, -1
+ };
+ const int theHexTo2Prisms_FB_2[6*2+1] =
+ {
+ 0, 3, 7, 1, 2, 7, 0, 7, 4, 1, 6, 5, -1
+ };
+ const int* theHexTo2Prisms_FB[2] = { theHexTo2Prisms_FB_1, theHexTo2Prisms_FB_2 };
+
+
struct TTriangleFacet //!< stores indices of three nodes of tetra facet
{
int _n1, _n2, _n3;
TTriangleFacet(int n1, int n2, int n3): _n1(n1), _n2(n2), _n3(n3) {}
bool contains(int n) const { return ( n == _n1 || n == _n2 || n == _n3 ); }
- bool hasAdjacentTetra( const SMDS_MeshElement* elem ) const;
+ bool hasAdjacentVol( const SMDS_MeshElement* elem,
+ const SMDSAbs_GeometryType geom = SMDSGeom_TETRA) const;
};
struct TSplitMethod
{
- int _nbTetra;
+ int _nbSplits;
+ int _nbCorners;
const int* _connectivity; //!< foursomes of tetra connectivy finished by -1
bool _baryNode; //!< additional node is to be created at cell barycenter
bool _ownConn; //!< to delete _connectivity in destructor
map<int, const SMDS_MeshNode*> _faceBaryNode; //!< map face index to node at BC of face
TSplitMethod( int nbTet=0, const int* conn=0, bool addNode=false)
- : _nbTetra(nbTet), _connectivity(conn), _baryNode(addNode), _ownConn(false) {}
+ : _nbSplits(nbTet), _nbCorners(4), _connectivity(conn), _baryNode(addNode), _ownConn(false) {}
~TSplitMethod() { if ( _ownConn ) delete [] _connectivity; _connectivity = 0; }
bool hasFacet( const TTriangleFacet& facet ) const
{
- const int* tetConn = _connectivity;
- for ( ; tetConn[0] >= 0; tetConn += 4 )
- if (( facet.contains( tetConn[0] ) +
- facet.contains( tetConn[1] ) +
- facet.contains( tetConn[2] ) +
- facet.contains( tetConn[3] )) == 3 )
- return true;
+ if ( _nbCorners == 4 )
+ {
+ const int* tetConn = _connectivity;
+ for ( ; tetConn[0] >= 0; tetConn += 4 )
+ if (( facet.contains( tetConn[0] ) +
+ facet.contains( tetConn[1] ) +
+ facet.contains( tetConn[2] ) +
+ facet.contains( tetConn[3] )) == 3 )
+ return true;
+ }
+ else // prism, _nbCorners == 6
+ {
+ const int* prismConn = _connectivity;
+ for ( ; prismConn[0] >= 0; prismConn += 6 )
+ {
+ if (( facet.contains( prismConn[0] ) &&
+ facet.contains( prismConn[1] ) &&
+ facet.contains( prismConn[2] ))
+ ||
+ ( facet.contains( prismConn[3] ) &&
+ facet.contains( prismConn[4] ) &&
+ facet.contains( prismConn[5] )))
+ return true;
+ }
+ }
return false;
}
};
//=======================================================================
/*!
- * \brief return TSplitMethod for the given element
+ * \brief return TSplitMethod for the given element to split into tetrahedra
*/
//=======================================================================
- TSplitMethod getSplitMethod( SMDS_VolumeTool& vol, const int theMethodFlags)
+ TSplitMethod getTetraSplitMethod( SMDS_VolumeTool& vol, const int theMethodFlags)
{
const int iQ = vol.Element()->IsQuadratic() ? 2 : 1;
{
TTriangleFacet t012( nInd[0*iQ], nInd[1*iQ], nInd[2*iQ] );
TTriangleFacet t123( nInd[1*iQ], nInd[2*iQ], nInd[3*iQ] );
- if ( t012.hasAdjacentTetra( vol.Element() )) triaSplits.push_back( t012 );
- else if ( t123.hasAdjacentTetra( vol.Element() )) triaSplits.push_back( t123 );
+ if ( t012.hasAdjacentVol( vol.Element() )) triaSplits.push_back( t012 );
+ else if ( t123.hasAdjacentVol( vol.Element() )) triaSplits.push_back( t123 );
}
else
{
TTriangleFacet t023( nInd[ iQ * ( iCom )],
nInd[ iQ * ( (iCom+2)%nbNodes )],
nInd[ iQ * ( (iCom+3)%nbNodes )]);
- if ( t012.hasAdjacentTetra( vol.Element() ) && t023.hasAdjacentTetra( vol.Element() ))
+ if ( t012.hasAdjacentVol( vol.Element() ) && t023.hasAdjacentVol( vol.Element() ))
{
triaSplits.push_back( t012 );
triaSplits.push_back( t023 );
default:
nbVariants = 0;
}
- for ( int variant = 0; variant < nbVariants && method._nbTetra == 0; ++variant )
+ for ( int variant = 0; variant < nbVariants && method._nbSplits == 0; ++variant )
{
// check method compliancy with adjacent tetras,
// all found splits must be among facets of tetras described by this method
method = TSplitMethod( nbTet, connVariants[variant] );
- if ( hasAdjacentSplits && method._nbTetra > 0 )
+ if ( hasAdjacentSplits && method._nbSplits > 0 )
{
bool facetCreated = true;
for ( int iF = 0; facetCreated && iF < triaSplitsByFace.size(); ++iF )
}
}
}
- if ( method._nbTetra < 1 )
+ if ( method._nbSplits < 1 )
{
// No standard method is applicable, use a generic solution:
// each facet of a volume is split into triangles and
connectivity[ connSize++ ] = baryCenInd;
}
}
- method._nbTetra += nbTet;
+ method._nbSplits += nbTet;
} // loop on volume faces
return method;
}
+ //=======================================================================
+ /*!
+ * \brief return TSplitMethod to split haxhedron into prisms
+ */
+ //=======================================================================
+
+ TSplitMethod getPrismSplitMethod( SMDS_VolumeTool& vol,
+ const int methodFlags,
+ const int facetToSplit)
+ {
+ // order of facets in HEX according to SMDS_VolumeTool::Hexa_F :
+ // B, T, L, B, R, F
+ const int iF = ( facetToSplit < 2 ) ? 0 : 1 + ( facetToSplit-2 ) % 2; // [0,1,2]
+
+ if ( methodFlags == SMESH_MeshEditor::HEXA_TO_4_PRISMS )
+ {
+ static TSplitMethod to4methods[4]; // order BT, LR, FB
+ if ( to4methods[iF]._nbSplits == 0 )
+ {
+ switch ( iF ) {
+ case 0:
+ to4methods[iF]._connectivity = theHexTo4Prisms_BT;
+ to4methods[iF]._faceBaryNode[ 0 ] = 0;
+ to4methods[iF]._faceBaryNode[ 1 ] = 0;
+ break;
+ case 1:
+ to4methods[iF]._connectivity = theHexTo4Prisms_LR;
+ to4methods[iF]._faceBaryNode[ 2 ] = 0;
+ to4methods[iF]._faceBaryNode[ 4 ] = 0;
+ break;
+ case 2:
+ to4methods[iF]._connectivity = theHexTo4Prisms_FB;
+ to4methods[iF]._faceBaryNode[ 3 ] = 0;
+ to4methods[iF]._faceBaryNode[ 5 ] = 0;
+ break;
+ default: return to4methods[3];
+ }
+ to4methods[iF]._nbSplits = 4;
+ to4methods[iF]._nbCorners = 6;
+ }
+ return to4methods[iF];
+ }
+ // else if ( methodFlags == HEXA_TO_2_PRISMS )
+
+ TSplitMethod method;
+
+ const int iQ = vol.Element()->IsQuadratic() ? 2 : 1;
+
+ const int nbVariants = 2, nbSplits = 2;
+ const int** connVariants = 0;
+ switch ( iF ) {
+ case 0: connVariants = theHexTo2Prisms_BT; break;
+ case 1: connVariants = theHexTo2Prisms_LR; break;
+ case 2: connVariants = theHexTo2Prisms_FB; break;
+ default: return method;
+ }
+
+ // look for prisms adjacent via facetToSplit and an opposite one
+ for ( int is2nd = 0; is2nd < 2; ++is2nd )
+ {
+ int iFacet = is2nd ? vol.GetOppFaceIndexOfHex( facetToSplit ) : facetToSplit;
+ int nbNodes = vol.NbFaceNodes( iFacet ) / iQ;
+ if ( nbNodes != 4 ) return method;
+
+ const int* nInd = vol.GetFaceNodesIndices( iFacet );
+ TTriangleFacet t012( nInd[0*iQ], nInd[1*iQ], nInd[2*iQ] );
+ TTriangleFacet t123( nInd[1*iQ], nInd[2*iQ], nInd[3*iQ] );
+ TTriangleFacet* t;
+ if ( t012.hasAdjacentVol( vol.Element(), SMDSGeom_PENTA ))
+ t = &t012;
+ else if ( t123.hasAdjacentVol( vol.Element(), SMDSGeom_PENTA ))
+ t = &t123;
+ else
+ continue;
+
+ // there are adjacent prism
+ for ( int variant = 0; variant < nbVariants; ++variant )
+ {
+ // check method compliancy with adjacent prisms,
+ // the found prism facets must be among facets of prisms described by current method
+ method._nbSplits = nbSplits;
+ method._nbCorners = 6;
+ method._connectivity = connVariants[ variant ];
+ if ( method.hasFacet( *t ))
+ return method;
+ }
+ }
+
+ // No adjacent prisms. Select a variant with a best aspect ratio.
+
+ double badness[2] = { 0, 0 };
+ static SMESH::Controls::NumericalFunctorPtr aspectRatio( new SMESH::Controls::AspectRatio);
+ const SMDS_MeshNode** nodes = vol.GetNodes();
+ for ( int variant = 0; variant < nbVariants; ++variant )
+ for ( int is2nd = 0; is2nd < 2; ++is2nd )
+ {
+ int iFacet = is2nd ? vol.GetOppFaceIndexOfHex( facetToSplit ) : facetToSplit;
+ const int* nInd = vol.GetFaceNodesIndices( iFacet );
+
+ method._connectivity = connVariants[ variant ];
+ TTriangleFacet t012( nInd[0*iQ], nInd[1*iQ], nInd[2*iQ] );
+ TTriangleFacet t123( nInd[1*iQ], nInd[2*iQ], nInd[3*iQ] );
+ TTriangleFacet* t = ( method.hasFacet( t012 )) ? & t012 : & t123;
+
+ SMDS_FaceOfNodes tria ( nodes[ t->_n1 ],
+ nodes[ t->_n2 ],
+ nodes[ t->_n3 ] );
+ badness[ variant ] += getBadRate( &tria, aspectRatio );
+ }
+ const int iBetter = ( badness[1] < badness[0] && badness[0]-badness[1] > 0.1 * badness[0] );
+
+ method._nbSplits = nbSplits;
+ method._nbCorners = 6;
+ method._connectivity = connVariants[ iBetter ];
+
+ return method;
+ }
+
//================================================================================
/*!
* \brief Check if there is a tetraherdon adjacent to the given element via this facet
*/
//================================================================================
- bool TTriangleFacet::hasAdjacentTetra( const SMDS_MeshElement* elem ) const
+ bool TTriangleFacet::hasAdjacentVol( const SMDS_MeshElement* elem,
+ const SMDSAbs_GeometryType geom ) const
{
// find the tetrahedron including the three nodes of facet
const SMDS_MeshNode* n1 = elem->GetNode(_n1);
while ( volIt1->more() )
{
const SMDS_MeshElement* v = volIt1->next();
- SMDSAbs_EntityType type = v->GetEntityType();
- if ( type != SMDSEntity_Tetra && type != SMDSEntity_Quad_Tetra )
+ if ( v->GetGeomType() != geom )
continue;
- if ( type == SMDSEntity_Quad_Tetra && v->GetNodeIndex( n1 ) > 3 )
+ const int lastCornerInd = v->NbCornerNodes() - 1;
+ if ( v->IsQuadratic() && v->GetNodeIndex( n1 ) > lastCornerInd )
continue; // medium node not allowed
const int ind2 = v->GetNodeIndex( n2 );
- if ( ind2 < 0 || 3 < ind2 )
+ if ( ind2 < 0 || lastCornerInd < ind2 )
continue;
const int ind3 = v->GetNodeIndex( n3 );
- if ( ind3 < 0 || 3 < ind3 )
+ if ( ind3 < 0 || lastCornerInd < ind3 )
continue;
return true;
}
} // namespace
//=======================================================================
-//function : SplitVolumesIntoTetra
-//purpose : Split volume elements into tetrahedra.
+//function : SplitVolumes
+//purpose : Split volume elements into tetrahedra or prisms.
+// If facet ID < 0, element is split into tetrahedra,
+// else a hexahedron is split into prisms so that the given facet is
+// split into triangles
//=======================================================================
-void SMESH_MeshEditor::SplitVolumesIntoTetra (const TIDSortedElemSet & theElems,
- const int theMethodFlags)
+void SMESH_MeshEditor::SplitVolumes (const TFacetOfElem & theElems,
+ const int theMethodFlags)
{
// std-like iterator on coordinates of nodes of mesh element
typedef SMDS_StdIterator< SMESH_TNodeXYZ, SMDS_ElemIteratorPtr > NXyzIterator;
NXyzIterator xyzEnd;
SMDS_VolumeTool volTool;
- SMESH_MesherHelper helper( *GetMesh());
+ SMESH_MesherHelper helper( *GetMesh()), fHelper(*GetMesh());
+ fHelper.ToFixNodeParameters( true );
SMESHDS_SubMesh* subMesh = 0;//GetMeshDS()->MeshElements(1);
SMESHDS_SubMesh* fSubMesh = 0;//subMesh;
map< TVolumeFaceKey, const SMDS_MeshNode* > volFace2BaryNode;
double bc[3];
- TIDSortedElemSet::const_iterator elem = theElems.begin();
- for ( ; elem != theElems.end(); ++elem )
+ TFacetOfElem::const_iterator elem2facet = theElems.begin();
+ for ( ; elem2facet != theElems.end(); ++elem2facet )
{
- if ( (*elem)->GetType() != SMDSAbs_Volume )
+ const SMDS_MeshElement* elem = elem2facet->first;
+ const int facetToSplit = elem2facet->second;
+ if ( elem->GetType() != SMDSAbs_Volume )
continue;
- SMDSAbs_EntityType geomType = (*elem)->GetEntityType();
+ const SMDSAbs_EntityType geomType = elem->GetEntityType();
if ( geomType == SMDSEntity_Tetra || geomType == SMDSEntity_Quad_Tetra )
continue;
- if ( !volTool.Set( *elem, /*ignoreCentralNodes=*/false )) continue; // strange...
+ if ( !volTool.Set( elem, /*ignoreCentralNodes=*/false )) continue; // strange...
- TSplitMethod splitMethod = getSplitMethod( volTool, theMethodFlags );
- if ( splitMethod._nbTetra < 1 ) continue;
+ TSplitMethod splitMethod = ( facetToSplit < 0 ?
+ getTetraSplitMethod( volTool, theMethodFlags ) :
+ getPrismSplitMethod( volTool, theMethodFlags, facetToSplit ));
+ if ( splitMethod._nbSplits < 1 ) continue;
// find submesh to add new tetras to
- if ( !subMesh || !subMesh->Contains( *elem ))
+ if ( !subMesh || !subMesh->Contains( elem ))
{
- int shapeID = FindShape( *elem );
+ int shapeID = FindShape( elem );
helper.SetSubShape( shapeID ); // helper will add tetras to the found submesh
subMesh = GetMeshDS()->MeshElements( shapeID );
}
int iQ;
- if ( (*elem)->IsQuadratic() )
+ if ( elem->IsQuadratic() )
{
iQ = 2;
// add quadratic links to the helper
iQ = 1;
helper.SetIsQuadratic( false );
}
- vector<const SMDS_MeshNode*> nodes( (*elem)->begin_nodes(), (*elem)->end_nodes() );
+ vector<const SMDS_MeshNode*> nodes( volTool.GetNodes(),
+ volTool.GetNodes() + elem->NbNodes() );
helper.SetElementsOnShape( true );
if ( splitMethod._baryNode )
{
}
}
- // make tetras
- vector<const SMDS_MeshElement* > tetras( splitMethod._nbTetra ); // splits of a volume
- const int* tetConn = splitMethod._connectivity;
- for ( int i = 0; i < splitMethod._nbTetra; ++i, tetConn += 4 )
- newElems.Append( tetras[ i ] = helper.AddVolume( nodes[ tetConn[0] ],
- nodes[ tetConn[1] ],
- nodes[ tetConn[2] ],
- nodes[ tetConn[3] ]));
+ // make new volumes
+ vector<const SMDS_MeshElement* > splitVols( splitMethod._nbSplits ); // splits of a volume
+ const int* volConn = splitMethod._connectivity;
+ if ( splitMethod._nbCorners == 4 ) // tetra
+ for ( int i = 0; i < splitMethod._nbSplits; ++i, volConn += splitMethod._nbCorners )
+ newElems.Append( splitVols[ i ] = helper.AddVolume( nodes[ volConn[0] ],
+ nodes[ volConn[1] ],
+ nodes[ volConn[2] ],
+ nodes[ volConn[3] ]));
+ else // prisms
+ for ( int i = 0; i < splitMethod._nbSplits; ++i, volConn += splitMethod._nbCorners )
+ newElems.Append( splitVols[ i ] = helper.AddVolume( nodes[ volConn[0] ],
+ nodes[ volConn[1] ],
+ nodes[ volConn[2] ],
+ nodes[ volConn[3] ],
+ nodes[ volConn[4] ],
+ nodes[ volConn[5] ]));
- ReplaceElemInGroups( *elem, tetras, GetMeshDS() );
+ ReplaceElemInGroups( elem, splitVols, GetMeshDS() );
// Split faces on sides of the split volume
map<int, const SMDS_MeshNode*>::iterator iF_n = splitMethod._faceBaryNode.find(iF);
if ( iF_n != splitMethod._faceBaryNode.end() )
{
+ const SMDS_MeshNode *baryNode = iF_n->second;
for ( int iN = 0; iN < nbNodes*iQ; iN += iQ )
{
const SMDS_MeshNode* n1 = fNodes[iN];
const SMDS_MeshNode *n2 = fNodes[(iN+iQ)%(nbNodes*iQ)];
- const SMDS_MeshNode *n3 = iF_n->second;
+ const SMDS_MeshNode *n3 = baryNode;
if ( !volTool.IsFaceExternal( iF ))
swap( n2, n3 );
triangles.push_back( helper.AddFace( n1,n2,n3 ));
-
- if ( fSubMesh && n3->getshapeId() < 1 )
- fSubMesh->AddNode( n3 );
+ }
+ if ( fSubMesh ) // update position of the bary node on geometry
+ {
+ if ( subMesh )
+ subMesh->RemoveNode( baryNode, false );
+ GetMeshDS()->SetNodeOnFace( baryNode, fSubMesh->GetID() );
+ const TopoDS_Shape& s = GetMeshDS()->IndexToShape( fSubMesh->GetID() );
+ if ( !s.IsNull() && s.ShapeType() == TopAbs_FACE )
+ {
+ fHelper.SetSubShape( s );
+ gp_XY uv( 1e100, 1e100 );
+ double distXYZ[4];
+ if ( !fHelper.CheckNodeUV( TopoDS::Face( s ), baryNode,
+ uv, /*tol=*/1e-7, /*force=*/true, distXYZ ) &&
+ uv.X() < 1e100 )
+ {
+ // node is too far from the surface
+ GetMeshDS()->MoveNode( baryNode, distXYZ[1], distXYZ[2], distXYZ[3] );
+ const_cast<SMDS_MeshNode*>( baryNode )->SetPosition
+ ( SMDS_PositionPtr( new SMDS_FacePosition( uv.X(), uv.Y() )));
+ }
+ }
}
}
else
}
}
list< TTriangleFacet >::iterator facet = facets.begin();
+ if ( facet == facets.end() )
+ break;
for ( ; facet != facets.end(); ++facet )
{
if ( !volTool.IsFaceExternal( iF ))
}
ReplaceElemInGroups( face, triangles, GetMeshDS() );
GetMeshDS()->RemoveFreeElement( face, fSubMesh, /*fromGroups=*/false );
- }
+ } // while a face based on facet nodes exists
} // loop on volume faces to split them into triangles
- GetMeshDS()->RemoveFreeElement( *elem, subMesh, /*fromGroups=*/false );
+ GetMeshDS()->RemoveFreeElement( elem, subMesh, /*fromGroups=*/false );
if ( geomType == SMDSEntity_TriQuad_Hexa )
{
myLastCreatedElems = newElems;
}
+//=======================================================================
+//function : GetHexaFacetsToSplit
+//purpose : For hexahedra that will be split into prisms, finds facets to
+// split into triangles. Only hexahedra adjacent to the one closest
+// to theFacetNormal.Location() are returned.
+//param [in,out] theHexas - the hexahedra
+//param [in] theFacetNormal - facet normal
+//param [out] theFacets - the hexahedra and found facet IDs
+//=======================================================================
+
+void SMESH_MeshEditor::GetHexaFacetsToSplit( TIDSortedElemSet& theHexas,
+ const gp_Ax1& theFacetNormal,
+ TFacetOfElem & theFacets)
+{
+ #define THIS_METHOD "SMESH_MeshEditor::GetHexaFacetsToSplit(): "
+
+ // Find a hexa closest to the location of theFacetNormal
+
+ const SMDS_MeshElement* startHex;
+ {
+ // get SMDS_ElemIteratorPtr on theHexas
+ typedef const SMDS_MeshElement* TValue;
+ typedef TIDSortedElemSet::iterator TSetIterator;
+ typedef SMDS::SimpleAccessor<TValue,TSetIterator> TAccesor;
+ typedef SMDS_MeshElement::GeomFilter TFilter;
+ typedef SMDS_SetIterator < TValue, TSetIterator, TAccesor, TFilter > TElemSetIter;
+ SMDS_ElemIteratorPtr elemIt = SMDS_ElemIteratorPtr
+ ( new TElemSetIter( theHexas.begin(),
+ theHexas.end(),
+ SMDS_MeshElement::GeomFilter( SMDSGeom_HEXA )));
+
+ SMESH_ElementSearcher* searcher =
+ SMESH_MeshAlgos::GetElementSearcher( *myMesh->GetMeshDS(), elemIt );
+
+ startHex = searcher->FindClosestTo( theFacetNormal.Location(), SMDSAbs_Volume );
+
+ delete searcher;
+
+ if ( !startHex )
+ throw SALOME_Exception( THIS_METHOD "startHex not found");
+ }
+
+ // Select a facet of startHex by theFacetNormal
+
+ SMDS_VolumeTool vTool( startHex );
+ double norm[3], dot, maxDot = 0;
+ int facetID = -1;
+ for ( int iF = 0; iF < vTool.NbFaces(); ++iF )
+ if ( vTool.GetFaceNormal( iF, norm[0], norm[1], norm[2] ))
+ {
+ dot = Abs( theFacetNormal.Direction().Dot( gp_Dir( norm[0], norm[1], norm[2] )));
+ if ( dot > maxDot )
+ {
+ facetID = iF;
+ maxDot = dot;
+ }
+ }
+ if ( facetID < 0 )
+ throw SALOME_Exception( THIS_METHOD "facet of startHex not found");
+
+ // Fill theFacets starting from facetID of startHex
+
+ // facets used for seach of volumes adjacent to already treated ones
+ typedef pair< TFacetOfElem::iterator, int > TElemFacets;
+ typedef map< TVolumeFaceKey, TElemFacets > TFacetMap;
+ TFacetMap facetsToCheck;
+
+ set<const SMDS_MeshNode*> facetNodes;
+ const SMDS_MeshElement* curHex;
+
+ const bool allHex = ( theHexas.size() == myMesh->NbHexas() );
+
+ while ( startHex )
+ {
+ // move in two directions from startHex via facetID
+ for ( int is2nd = 0; is2nd < 2; ++is2nd )
+ {
+ curHex = startHex;
+ int curFacet = facetID;
+ if ( is2nd ) // do not treat startHex twice
+ {
+ vTool.Set( curHex );
+ if ( vTool.IsFreeFace( curFacet, &curHex ))
+ {
+ curHex = 0;
+ }
+ else
+ {
+ vTool.GetFaceNodes( curFacet, facetNodes );
+ vTool.Set( curHex );
+ curFacet = vTool.GetFaceIndex( facetNodes );
+ }
+ }
+ while ( curHex )
+ {
+ // store a facet to split
+ if ( curHex->GetGeomType() != SMDSGeom_HEXA )
+ {
+ theFacets.insert( make_pair( curHex, -1 ));
+ break;
+ }
+ if ( !allHex && !theHexas.count( curHex ))
+ break;
+
+ pair< TFacetOfElem::iterator, bool > facetIt2isNew =
+ theFacets.insert( make_pair( curHex, curFacet ));
+ if ( !facetIt2isNew.second )
+ break;
+
+ // remember not-to-split facets in facetsToCheck
+ int oppFacet = vTool.GetOppFaceIndexOfHex( curFacet );
+ for ( int iF = 0; iF < vTool.NbFaces(); ++iF )
+ {
+ if ( iF == curFacet && iF == oppFacet )
+ continue;
+ TVolumeFaceKey facetKey ( vTool, iF );
+ TElemFacets elemFacet( facetIt2isNew.first, iF );
+ pair< TFacetMap::iterator, bool > it2isnew =
+ facetsToCheck.insert( make_pair( facetKey, elemFacet ));
+ if ( !it2isnew.second )
+ facetsToCheck.erase( it2isnew.first ); // adjacent hex already checked
+ }
+ // pass to a volume adjacent via oppFacet
+ if ( vTool.IsFreeFace( oppFacet, &curHex ))
+ {
+ curHex = 0;
+ }
+ else
+ {
+ // get a new curFacet
+ vTool.GetFaceNodes( oppFacet, facetNodes );
+ vTool.Set( curHex );
+ curFacet = vTool.GetFaceIndex( facetNodes, /*hint=*/curFacet );
+ }
+ }
+ } // move in two directions from startHex via facetID
+
+ // Find a new startHex by facetsToCheck
+
+ startHex = 0;
+ facetID = -1;
+ TFacetMap::iterator fIt = facetsToCheck.begin();
+ while ( !startHex && fIt != facetsToCheck.end() )
+ {
+ const TElemFacets& elemFacets = fIt->second;
+ const SMDS_MeshElement* hex = elemFacets.first->first;
+ int splitFacet = elemFacets.first->second;
+ int lateralFacet = elemFacets.second;
+ facetsToCheck.erase( fIt );
+ fIt = facetsToCheck.begin();
+
+ vTool.Set( hex );
+ if ( vTool.IsFreeFace( lateralFacet, &curHex ) ||
+ curHex->GetGeomType() != SMDSGeom_HEXA )
+ continue;
+ if ( !allHex && !theHexas.count( curHex ))
+ continue;
+
+ startHex = curHex;
+
+ // find a facet of startHex to split
+
+ set<const SMDS_MeshNode*> lateralNodes;
+ vTool.GetFaceNodes( lateralFacet, lateralNodes );
+ vTool.GetFaceNodes( splitFacet, facetNodes );
+ int oppLateralFacet = vTool.GetOppFaceIndexOfHex( lateralFacet );
+ vTool.Set( startHex );
+ lateralFacet = vTool.GetFaceIndex( lateralNodes, oppLateralFacet );
+
+ // look for a facet of startHex having common nodes with facetNodes
+ // but not lateralFacet
+ for ( int iF = 0; iF < vTool.NbFaces(); ++iF )
+ {
+ if ( iF == lateralFacet )
+ continue;
+ int nbCommonNodes = 0;
+ const SMDS_MeshNode** nn = vTool.GetFaceNodes( iF );
+ for ( int iN = 0, nbN = vTool.NbFaceNodes( iF ); iN < nbN; ++iN )
+ nbCommonNodes += facetNodes.count( nn[ iN ]);
+
+ if ( nbCommonNodes >= 2 )
+ {
+ facetID = iF;
+ break;
+ }
+ }
+ if ( facetID < 0 )
+ throw SALOME_Exception( THIS_METHOD "facet of a new startHex not found");
+ }
+ } // while ( startHex )
+}
+
//=======================================================================
//function : AddToSameGroups
//purpose : add elemToAdd to the groups the elemInGroups belongs to
gp_Vec v2(p0, g2);
gp_Vec n1 = vref.Crossed(v1);
gp_Vec n2 = vref.Crossed(v2);
- return n2.AngleWithRef(n1, vref);
+ try {
+ return n2.AngleWithRef(n1, vref);
+ }
+ catch ( Standard_Failure ) {
+ }
+ return Max( v1.Magnitude(), v2.Magnitude() );
}
/*!
* If there is no shared faces between the group #n and the group #p in the list, the group j_n_p is not created.
* All the flat elements are gathered into the group named "joints3D" (or "joints2D" in 2D situation).
* The flat element of the multiple junctions between the simple junction are stored in a group named "jointsMultiples".
- * @param theElems - list of groups of volumes, where a group of volume is a set of
- * SMDS_MeshElements sorted by Id.
- * @param createJointElems - if TRUE, create the elements
- * @return TRUE if operation has been completed successfully, FALSE otherwise
+ * \param theElems - list of groups of volumes, where a group of volume is a set of
+ * SMDS_MeshElements sorted by Id.
+ * \param createJointElems - if TRUE, create the elements
+ * \param onAllBoundaries - if TRUE, the nodes and elements are also created on
+ * the boundary between \a theDomains and the rest mesh
+ * \return TRUE if operation has been completed successfully, FALSE otherwise
*/
bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSortedElemSet>& theElems,
- bool createJointElems)
+ bool createJointElems,
+ bool onAllBoundaries)
{
MESSAGE("----------------------------------------------");
MESSAGE("SMESH_MeshEditor::doubleNodesOnGroupBoundaries");
MESSAGE(".. Number of domains :"<<theElems.size());
+ TIDSortedElemSet theRestDomElems;
+ const int iRestDom = -1;
+ const int idom0 = onAllBoundaries ? iRestDom : 0;
+ const int nbDomains = theElems.size();
+
// Check if the domains do not share an element
- for (int idom = 0; idom < theElems.size()-1; idom++)
+ for (int idom = 0; idom < nbDomains-1; idom++)
{
// MESSAGE("... Check of domain #" << idom);
const TIDSortedElemSet& domain = theElems[idom];
TIDSortedElemSet::const_iterator elemItr = domain.begin();
for (; elemItr != domain.end(); ++elemItr)
{
- SMDS_MeshElement* anElem = (SMDS_MeshElement*) *elemItr;
+ const SMDS_MeshElement* anElem = *elemItr;
int idombisdeb = idom + 1 ;
for (int idombis = idombisdeb; idombis < theElems.size(); idombis++) // check if the element belongs to a domain further in the list
{
}
}
- for (int idom = 0; idom < theElems.size(); idom++)
+ for (int idom = 0; idom < nbDomains; idom++)
{
// --- build a map (face to duplicate --> volume to modify)
TIDSortedElemSet::const_iterator elemItr = domain.begin();
for (; elemItr != domain.end(); ++elemItr)
{
- SMDS_MeshElement* anElem = (SMDS_MeshElement*) *elemItr;
+ const SMDS_MeshElement* anElem = *elemItr;
if (!anElem)
continue;
int vtkId = anElem->getVtkId();
{
int smdsId = meshDS->fromVtkToSmds(neighborsVtkIds[n]);
const SMDS_MeshElement* elem = meshDS->FindElement(smdsId);
- if (! domain.count(elem)) // neighbor is in another domain : face is shared
+ if (elem && ! domain.count(elem)) // neighbor is in another domain : face is shared
{
bool ok = false ;
- for (int idombis = 0; idombis < theElems.size(); idombis++) // check if the neighbor belongs to another domain of the list
+ for (int idombis = 0; idombis < theElems.size() && !ok; idombis++) // check if the neighbor belongs to another domain of the list
{
// MESSAGE("Domain " << idombis);
const TIDSortedElemSet& domainbis = theElems[idombis];
if ( domainbis.count(elem)) ok = true ; // neighbor is in a correct domain : face is kept
}
- if ( ok ) // the characteristics of the face is stored
+ if ( ok || onAllBoundaries ) // the characteristics of the face is stored
{
DownIdType face(downIds[n], downTypes[n]);
- if (!faceDomains.count(face))
- faceDomains[face] = emptyMap; // create an empty entry for face
if (!faceDomains[face].count(idom))
{
faceDomains[face][idom] = vtkId; // volume associated to face in this domain
celldom[vtkId] = idom;
//MESSAGE(" cell with a border " << vtkId << " domain " << idom);
}
+ if ( !ok )
+ {
+ theRestDomElems.insert( elem );
+ faceDomains[face][iRestDom] = neighborsVtkIds[n];
+ celldom[neighborsVtkIds[n]] = iRestDom;
+ }
}
}
}
// explore the nodes of the face and see if they belong to a cell in the domain,
// which has only a node or an edge on the border (not a shared face)
- for (int idomain = 0; idomain < theElems.size(); idomain++)
+ for (int idomain = idom0; idomain < nbDomains; idomain++)
{
//MESSAGE("Domain " << idomain);
- const TIDSortedElemSet& domain = theElems[idomain];
+ const TIDSortedElemSet& domain = (idomain == iRestDom) ? theRestDomElems : theElems[idomain];
itface = faceDomains.begin();
for (; itface != faceDomains.end(); ++itface)
{
- std::map<int, int> domvol = itface->second;
+ const std::map<int, int>& domvol = itface->second;
if (!domvol.count(idomain))
continue;
DownIdType face = itface->first;
//no cells created after BuildDownWardConnectivity
}
DownIdType aCell(downId, vtkType);
- if (!cellDomains.count(aCell))
- cellDomains[aCell] = emptyMap; // create an empty entry for cell
cellDomains[aCell][idomain] = vtkId;
celldom[vtkId] = idomain;
//MESSAGE(" cell " << vtkId << " domain " << idomain);
std::map<int, std::vector<int> > mutipleNodesToFace; // nodes multi domains with domain order to transform in Face (junction between 3 or more 2D domains)
MESSAGE(".. Duplication of the nodes");
- for (int idomain = 0; idomain < theElems.size(); idomain++)
+ for (int idomain = idom0; idomain < nbDomains; idomain++)
{
itface = faceDomains.begin();
for (; itface != faceDomains.end(); ++itface)
{
- std::map<int, int> domvol = itface->second;
+ const std::map<int, int>& domvol = itface->second;
if (!domvol.count(idomain))
continue;
DownIdType face = itface->first;
for (; itn != oldNodes.end(); ++itn)
{
int oldId = *itn;
- //MESSAGE("-+-+-a node " << oldId);
- if (!nodeDomains.count(oldId))
- nodeDomains[oldId] = emptyMap; // create an empty entry for node
if (nodeDomains[oldId].empty())
{
nodeDomains[oldId][idomain] = oldId; // keep the old node in the first domain
//MESSAGE("-+-+-b oldNode " << oldId << " domain " << idomain);
}
- std::map<int, int>::iterator itdom = domvol.begin();
+ std::map<int, int>::const_iterator itdom = domvol.begin();
for (; itdom != domvol.end(); ++itdom)
{
int idom = itdom->first;
}
MESSAGE(".. Creation of elements");
- for (int idomain = 0; idomain < theElems.size(); idomain++)
+ for (int idomain = idom0; idomain < nbDomains; idomain++)
{
itface = faceDomains.begin();
for (; itface != faceDomains.end(); ++itface)
for (int id=0; id < doms.size(); id++)
{
int idom = doms[id];
+ const TIDSortedElemSet& domain = (idom == iRestDom) ? theRestDomElems : theElems[idom];
for (int ivol=0; ivol<nbvol; ivol++)
{
int smdsId = meshDS->fromVtkToSmds(vtkVolIds[ivol]);
SMDS_MeshElement* elem = (SMDS_MeshElement*)meshDS->FindElement(smdsId);
- if (theElems[idom].count(elem))
+ if (domain.count(elem))
{
SMDS_VtkVolume* svol = dynamic_cast<SMDS_VtkVolume*>(elem);
domvol[idom] = svol;
feDom.clear();
MESSAGE(".. Modification of elements");
- for (int idomain = 0; idomain < theElems.size(); idomain++)
+ for (int idomain = idom0; idomain < nbDomains; idomain++)
{
std::map<int, std::map<int, int> >::const_iterator itnod = nodeDomains.begin();
for (; itnod != nodeDomains.end(); ++itnod)
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
SMESH::Controls::NumericalFunctorPtr theCriterion);
- enum SplitVolumToTetraFlags { HEXA_TO_5 = 1, HEXA_TO_6 = 2, HEXA_TO_24 = 3 };//!<arg of SplitVolumesIntoTetra()
+ typedef std::map < const SMDS_MeshElement*, int, TIDCompare > TFacetOfElem;
+
+ //!<2nd arg of SplitVolumes()
+ enum SplitVolumToTetraFlags { HEXA_TO_5 = 1, // split into tetrahedra
+ HEXA_TO_6,
+ HEXA_TO_24,
+ HEXA_TO_2_PRISMS, // split into prisms
+ HEXA_TO_4_PRISMS };
+ /*!
+ * \brief Split volumic elements into tetrahedra or prisms.
+ * If facet ID < 0, element is split into tetrahedra,
+ * else a hexahedron is split into prisms so that the given facet is
+ * split into triangles
+ */
+ void SplitVolumes (const TFacetOfElem & theElems, const int theMethodFlags);
+
/*!
- * \brief Split volumic elements into tetrahedra.
+ * \brief For hexahedra that will be split into prisms, finds facets to
+ * split into triangles
+ * \param [in,out] theHexas - the hexahedra
+ * \param [in] theFacetNormal - facet normal
+ * \param [out] theFacets - the hexahedra and found facet IDs
*/
- void SplitVolumesIntoTetra (const TIDSortedElemSet & theElems, const int theMethodFlags);
+ void GetHexaFacetsToSplit( TIDSortedElemSet& theHexas,
+ const gp_Ax1& theFacetNormal,
+ TFacetOfElem & theFacets);
enum SmoothMethod { LAPLACIAN = 0, CENTROIDAL };
double OrientedAngle(const gp_Pnt& p0, const gp_Pnt& p1, const gp_Pnt& g1, const gp_Pnt& g2);
bool DoubleNodesOnGroupBoundaries( const std::vector<TIDSortedElemSet>& theElems,
- bool createJointElems);
+ bool createJointElems,
+ bool onAllBoundaries);
bool CreateFlatElementsOnFacesGroups( const std::vector<TIDSortedElemSet>& theElems );
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
TopLoc_Location loc;
Handle(Geom_Surface) surface = BRep_Tool::Surface( face, loc );
- if ( surface->IsUPeriodic() || surface->IsVPeriodic() ||
- surface->IsUClosed() || surface->IsVClosed() )
+ // if ( surface->IsUPeriodic() || surface->IsVPeriodic() ||
+ // surface->IsUClosed() || surface->IsVClosed() )
{
//while ( surface->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface )))
//surface = Handle(Geom_RectangularTrimmedSurface)::DownCast( surface )->BasisSurface();
void SMESH_MesherHelper::setPosOnShapeValidity(int shapeID, bool ok ) const
{
- ((SMESH_MesherHelper*)this)->myNodePosShapesValidity.insert( make_pair( shapeID, ok));
+ std::map< int,bool >::iterator sh_ok =
+ ((SMESH_MesherHelper*)this)->myNodePosShapesValidity.insert( make_pair( shapeID, ok)).first;
+ if ( !ok )
+ sh_ok->second = ok;
}
//=======================================================================
const bool force,
double distXYZ[4]) const
{
- int shapeID = n->getshapeId();
+ int shapeID = n->getshapeId();
bool infinit = ( Precision::IsInfinite( uv.X() ) || Precision::IsInfinite( uv.Y() ));
- if ( force || toCheckPosOnShape( shapeID ) || infinit )
+ bool zero = ( uv.X() == 0. && uv.Y() == 0. );
+ if ( force || toCheckPosOnShape( shapeID ) || infinit || zero )
{
// check that uv is correct
TopLoc_Location loc;
const bool force,
double distXYZ[4]) const
{
- int shapeID = n->getshapeId();
+ int shapeID = n->getshapeId();
bool infinit = Precision::IsInfinite( u );
- if ( force || toCheckPosOnShape( shapeID ) || infinit )
+ bool zero = ( u == 0. );
+ if ( force || toCheckPosOnShape( shapeID ) || infinit || zero )
{
TopLoc_Location loc; double f,l;
Handle(Geom_Curve) curve = BRep_Tool::Curve( E,loc,f,l );
return getMediumNodeOnComposedWire(n1,n2,force3d);
}
E = TopoDS::Edge(meshDS->IndexToShape( edgeID = pos.first ));
- u[0] = GetNodeU(E,n1,n2, force3d ? 0 : &uvOK[0]);
- u[1] = GetNodeU(E,n2,n1, force3d ? 0 : &uvOK[1]);
+ try {
+ u[0] = GetNodeU(E,n1,n2, force3d ? 0 : &uvOK[0]);
+ u[1] = GetNodeU(E,n2,n1, force3d ? 0 : &uvOK[1]);
+ }
+ catch ( Standard_Failure& f )
+ {
+ // issue 22502 / a node is on VERTEX not belonging to E
+ return getMediumNodeOnComposedWire(n1,n2,force3d);
+ }
}
if ( !force3d & uvOK[0] && uvOK[1] )
//=======================================================================
#define __DMP__(txt) \
- //cout << txt
+ // cout << txt
#define MSG(txt) __DMP__(txt<<endl)
#define MSGBEG(txt) __DMP__(txt)
gp_Vec QFace::LinkNorm(const int i, SMESH_MesherHelper* /*uvHelper*/) const
{
- gp_Vec norm, vecOut;
-// if ( uvHelper ) {
-// TopoDS_Face face = TopoDS::Face( uvHelper->GetSubShape());
-// const SMDS_MeshNode* inFaceNode = uvHelper->GetNodeUVneedInFaceNode() ? GetNodeInFace() : 0;
-// gp_XY uv1 = uvHelper->GetNodeUV( face, _sides[i]->node1(), inFaceNode );
-// gp_XY uv2 = uvHelper->GetNodeUV( face, _sides[i]->node2(), inFaceNode );
-// norm.SetCoord( uv1.Y() - uv2.Y(), uv2.X() - uv1.X(), 0 );
-
-// const QLink* otherLink = _sides[(i + 1) % _sides.size()];
-// const SMDS_MeshNode* otherNode =
-// otherLink->node1() == _sides[i]->node1() ? otherLink->node2() : otherLink->node1();
-// gp_XY pIn = uvHelper->GetNodeUV( face, otherNode, inFaceNode );
-// vecOut.SetCoord( uv1.X() - pIn.X(), uv1.Y() - pIn.Y(), 0 );
-// }
-// else {
- norm = _normal ^ gp_Vec( XYZ(_sides[i]->node1()), XYZ(_sides[i]->node2()));
- gp_XYZ pIn = ( XYZ( _sides[0]->node1() ) +
- XYZ( _sides[0]->node2() ) +
- XYZ( _sides[1]->node1() )) / 3.;
- vecOut.SetXYZ( _sides[i]->MiddlePnt() - pIn );
- //}
+ gp_Vec norm = _normal ^ gp_Vec( XYZ(_sides[i]->node1()), XYZ(_sides[i]->node2()));
+ gp_XYZ pIn = ( _sides[ (i+1)%3 ]->MiddlePnt() +
+ _sides[ (i+2)%3 ]->MiddlePnt() ) / 2.;
+ gp_Vec vecOut = ( _sides[i]->MiddlePnt() - pIn );
+
if ( norm * vecOut < 0 )
norm.Reverse();
double mag2 = norm.SquareMagnitude();
int iL1 = (iL + 1) % 3, iL2 = (iL + 2) % 3; // indices of the two other links of triangle
TLinkInSet link1 = theLinks.find( _sides[iL1] );
TLinkInSet link2 = theLinks.find( _sides[iL2] );
- if ( link1 == theLinks.end() || link2 == theLinks.end() )
- return thePrevLen;
- const QFace* f1 = link1->NextFace( this ); // adjacent faces
- const QFace* f2 = link2->NextFace( this );
+
+ const QFace *f1 = 0, *f2 = 0; // adjacent faces
+ bool isBndLink1 = true, isBndLink2 = true;
+ if ( link1 != theLinks.end() && link2 != theLinks.end() )
+ {
+ f1 = link1->NextFace( this );
+ f2 = link2->NextFace( this );
+
+ isBndLink1 = ( theLink->MediumPos() > (*link1)->MediumPos() );
+ isBndLink2 = ( theLink->MediumPos() > (*link2)->MediumPos() );
+ if ( theStep == theFirstStep ) // (issue 22541) quad-dominant mesh
+ {
+ if ( !isBndLink1 && !f1 )
+ f1 = (*link1)->GetContinuesFace( this ); // get a quadrangle face
+ if ( !isBndLink2 && !f2 )
+ f2 = (*link2)->GetContinuesFace( this );
+ }
+ }
+ else if ( _sides.size() < 4 )
+ return thePrevLen;
// propagate to adjacent faces till limit step or boundary
double len1 = thePrevLen + (theLink->MiddlePnt() - _sides[iL1]->MiddlePnt()).Modulus();
gp_Vec linkDir2(0,0,0);
try {
OCC_CATCH_SIGNALS;
- if ( f1 && theLink->MediumPos() <= (*link1)->MediumPos() )
+ if ( f1 && !isBndLink1 )
len1 = f1->MoveByBoundary
( *link1, theRefVec, theLinks, theFaceHelper, len1, theStep-1, &linkDir1, theSign);
else
}
try {
OCC_CATCH_SIGNALS;
- if ( f2 && theLink->MediumPos() <= (*link2)->MediumPos() )
+ if ( f2 && !isBndLink2 )
len2 = f2->MoveByBoundary
( *link2, theRefVec, theLinks, theFaceHelper, len2, theStep-1, &linkDir2, theSign);
else
MSG(string(theStep,'.')<<" Move "<< theLink->_mediumNode->GetID()<<
" by " << refProj * ( 1 - r ) << " following " <<
- (choose1 ? *link1->_qlink : *link2->_qlink));
+ (choose1 ? *link1->_qlink : *link2->_qlink)); // warning: link1 can be invalid
if ( theLinkNorm ) *theLinkNorm = linkNorm;
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
list< const SMDS_MeshNode* > nodes;
list< const SMDS_MeshNode* >::iterator n = nodes.end();
- SMDS_ElemIteratorPtr noIt = theFace->nodesIterator();
+ SMDS_NodeIteratorPtr noIt = theFace->nodeIterator();
int iSub = 0;
while ( noIt->more() && iSub < nbFaceNodes ) {
- const SMDS_MeshNode* node = smdsNode( noIt->next() );
+ const SMDS_MeshNode* node = noIt->next();
nodes.push_back( node );
if ( iSub++ == theNodeIndexOnKeyPoint1 )
n = --nodes.end();
list< gp_XYZ > xyzList;
myOrderedNodes.resize( nbFaceNodes );
for ( iSub = 0, n = nodes.begin(); n != nodes.end(); ++n ) {
- xyzList.push_back( gp_XYZ( (*n)->X(), (*n)->Y(), (*n)->Z() ));
+ xyzList.push_back( SMESH_TNodeXYZ( *n ));
myOrderedNodes[ iSub++] = *n;
}
myXYZ.resize( myPoints.size() * theFaces.size(), undefinedXYZ() );
myElements.reserve( theFaces.size() );
- // to find point index
- map< TPoint*, int > pointIndex;
- for ( int i = 0; i < myPoints.size(); i++ )
- pointIndex.insert( make_pair( & myPoints[ i ], i ));
-
int ind1 = 0; // lowest point index for a face
// meshed geometry
{
list< TPoint* > & linkPoints = getShapePoints( eID++ );
const SMDS_MeshNode* n1 = myOrderedNodes[ i ];
- const SMDS_MeshNode* n2 = myOrderedNodes[ i + 1 == nbNodes ? 0 : i + 1 ];
+ const SMDS_MeshNode* n2 = myOrderedNodes[( i+1 ) % nbNodes ];
// make a link and a node set
TNodeSet linkSet, node1Set;
linkSet.insert( n1 );
list< TPoint* >::iterator p = linkPoints.begin();
{
// map the first link point to n1
- int nId = pointIndex[ *p ] + ind1;
+ int nId = ( *p - &myPoints[0] ) + ind1;
myXYZIdToNodeMap[ nId ] = n1;
list< list< int > >& groups = myIdsOnBoundary[ node1Set ];
groups.push_back(list< int > ());
list< int >& indList = groups.back();
// add points to the map excluding the end points
for ( p++; *p != linkPoints.back(); p++ )
- indList.push_back( pointIndex[ *p ] + ind1 );
+ indList.push_back( ( *p - &myPoints[0] ) + ind1 );
}
ind1 += myPoints.size();
}
Bnd_Box box;
TNodeSet::const_iterator n = nodes.begin();
for ( ; n != nodes.end(); ++n )
- box.Add( gp_Pnt( (*n)->X(), (*n)->Y(), (*n)->Z() ));
+ box.Add( gp_Pnt( SMESH_TNodeXYZ( *n )));
double x, y, z, X, Y, Z;
box.Get( x, y, z, X, Y, Z );
gp_Pnt p( x, y, z ), P( X, Y, Z );
bool unite = ( uniteGroups && nodes.size() == 2 );
map< double, int > distIndMap;
const SMDS_MeshNode* node = *nodes.begin();
- gp_Pnt P( node->X(), node->Y(), node->Z() );
+ gp_Pnt P = SMESH_TNodeXYZ( node );
// compare points, replace indices
myXYZ[ i ].Y(),
myXYZ[ i ].Z());
}
- }
+ if ( theMesh->HasShapeToMesh() )
+ {
+ // set nodes on EDGEs (IMP 22368)
+ SMESH_MesherHelper helper( *theMesh );
+ helper.ToFixNodeParameters( true );
+ map< TNodeSet, list< list< int > > >::iterator idListIt = myIdsOnBoundary.begin();
+ for ( ; idListIt != myIdsOnBoundary.end(); idListIt++ )
+ {
+ list<list< int > >& groups = idListIt->second;
+ const TNodeSet& nodes = idListIt->first;
+ if ( nodes.size() != 2 )
+ continue; // not a link
+ const SMDS_MeshNode* n1 = *nodes.begin();
+ const SMDS_MeshNode* n2 = *nodes.rbegin();
+ TopoDS_Shape S1 = helper.GetSubShapeByNode( n1, aMeshDS );
+ TopoDS_Shape S2 = helper.GetSubShapeByNode( n2, aMeshDS );
+ if ( S1.IsNull() || S1.ShapeType() < TopAbs_EDGE ||
+ S2.IsNull() || S2.ShapeType() < TopAbs_EDGE )
+ continue;
+ TopoDS_Shape S;
+ if ( S1.ShapeType() == TopAbs_EDGE )
+ {
+ if ( S1 == S2 || helper.IsSubShape( S2, S1 ))
+ S = S1;
+ }
+ else if ( S2.ShapeType() == TopAbs_EDGE )
+ {
+ if ( helper.IsSubShape( S1, S2 ))
+ S = S2;
+ }
+ else
+ {
+ S = helper.GetCommonAncestor( S1, S2, *theMesh, TopAbs_EDGE );
+ }
+ if ( S.IsNull() )
+ continue;
+ const TopoDS_Edge & E = TopoDS::Edge( S );
+ helper.SetSubShape( E );
+ list<list< int > >::iterator g = groups.begin();
+ for ( ; g != groups.end(); ++g )
+ {
+ list< int >& ids = *g;
+ list< int >::iterator id = ids.begin();
+ for ( ; id != ids.end(); ++id )
+ if ( nodesVector[ *id ] && nodesVector[ *id ]->getshapeId() < 1 )
+ {
+ double u = 1e100;
+ aMeshDS->SetNodeOnEdge( nodesVector[ *id ], E, u );
+ helper.CheckNodeU( E, nodesVector[ *id ], u, 1e-7, true );
+ }
+ }
+ }
+ }
+ } // if ( onMeshElements )
+
else
{
nodesVector.resize( myPoints.size(), 0 );
- // to find point index
- map< TPoint*, int > pointIndex;
- for ( int i = 0; i < myPoints.size(); i++ )
- pointIndex.insert( make_pair( & myPoints[ i ], i ));
+ // find existing nodes on EDGEs and VERTEXes (IMP 22368)
+ map< int, list< TPoint* > >::iterator idPointIt = myShapeIDToPointsMap.begin();
+ if ( !myShapeIDMap.IsEmpty() && aMeshDS->NbNodes() > 0 )
+
+ for ( ; idPointIt != myShapeIDToPointsMap.end(); idPointIt++ )
+ {
+ const TopoDS_Shape& S = myShapeIDMap( idPointIt->first );
+ list< TPoint* > & points = idPointIt->second;
+ if ( points.empty() )
+ continue;
+
+ switch ( S.ShapeType() )
+ {
+ case TopAbs_VERTEX:
+ {
+ int pIndex = points.back() - &myPoints[0];
+ if ( !nodesVector[ pIndex ] )
+ nodesVector[ pIndex ] = SMESH_Algo::VertexNode( TopoDS::Vertex( S ), aMeshDS );
+ break;
+ }
+ case TopAbs_EDGE:
+ {
+ const TopoDS_Edge& edge = TopoDS::Edge( S );
+ map< double, const SMDS_MeshNode* > paramsOfNodes;
+ if ( !SMESH_Algo::GetSortedNodesOnEdge( aMeshDS, edge,
+ /*ignoreMediumNodes=*/false,
+ paramsOfNodes )
+ || paramsOfNodes.size() < 3 )
+ break;
+ // points on VERTEXes are included with wrong myU
+ list< TPoint* >::reverse_iterator pItR = ++points.rbegin();
+ list< TPoint* >::iterator pItF = ++points.begin();
+ const bool isForward = ( (*pItF)->myU < (*pItR)->myU );
+ map< double, const SMDS_MeshNode* >::iterator u2n = ++paramsOfNodes.begin();
+ map< double, const SMDS_MeshNode* >::iterator u2nEnd = --paramsOfNodes.end();
+ TPoint* p;
+ while ( u2n != u2nEnd && pItF != points.end() )
+ {
+ const double u = u2n->first;
+ const SMDS_MeshNode* n = u2n->second;
+ const double tol = ( (++u2n)->first - u ) / 20;
+ do
+ {
+ p = ( isForward ? *pItF : *pItR );
+ if ( Abs( u - p->myU ) < tol )
+ {
+ int pIndex = p - &myPoints[0];
+ if ( !nodesVector [ pIndex ] )
+ nodesVector [ pIndex ] = n;
+ ++pItF;
+ ++pItR;
+ break;
+ }
+ }
+ while ( p->myU < u && ( ++pItF, ++pItR != points.rend() ));
+ }
+ break;
+ }
+ default:;
+ }
+ } // end of "find existing nodes on EDGEs and VERTEXes"
// loop on sub-shapes of myShape: create nodes
- map< int, list< TPoint* > >::iterator idPointIt = myShapeIDToPointsMap.begin();
+ idPointIt = myShapeIDToPointsMap.begin();
for ( ; idPointIt != myShapeIDToPointsMap.end(); idPointIt++ )
{
TopoDS_Shape S;
- //SMESHDS_SubMesh * subMeshDS = 0;
if ( !myShapeIDMap.IsEmpty() ) {
S = myShapeIDMap( idPointIt->first );
- //subMeshDS = aMeshDS->MeshElements( S );
}
list< TPoint* > & points = idPointIt->second;
list< TPoint* >::iterator pIt = points.begin();
for ( ; pIt != points.end(); pIt++ )
{
TPoint* point = *pIt;
- int pIndex = pointIndex[ point ];
+ //int pIndex = pointIndex[ point ];
+ int pIndex = point - &myPoints[0];
if ( nodesVector [ pIndex ] )
continue;
SMDS_MeshNode* node = aMeshDS->AddNode (point->myXYZ.X(),
SMDS_ElemIteratorPtr noIt = elem->nodesIterator();
while ( noIt->more() ) {
SMDS_MeshNode* node = const_cast<SMDS_MeshNode*>(smdsNode( noIt->next() ));
- if (!node->getshapeId() &&
- shellNodes.find( node ) == shellNodes.end() ) {
+ if ( node->getshapeId() < 1 &&
+ shellNodes.find( node ) == shellNodes.end() )
+ {
if ( S.ShapeType() == TopAbs_FACE )
aMeshDS->SetNodeOnFace( node, shapeID,
Precision::Infinite(),// <- it's a sign that UV is not set
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// all functions assure that shapes are indexed so that first go
// ordered vertices, then ordered edge, then faces and maybe a shell
TopTools_IndexedMapOfOrientedShape myShapeIDMap;
- std::map< int, std::list< TPoint* > > myShapeIDToPointsMap;
+ std::map< int, std::list< TPoint*> > myShapeIDToPointsMap;
// for the 2d case:
// nb of key-points in each of pattern boundaries
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
/*
* This method needed for instance NCollection_DataMap with TopoDS_Shape as key
*/
-
-inline Standard_Boolean IsEqual(const TopoDS_Shape& S1,
- const TopoDS_Shape& S2)
+struct SMESHDS_Hasher
{
- return S1.IsSame(S2);
-}
-
+ static inline Standard_Boolean IsEqual(const TopoDS_Shape& S1,
+ const TopoDS_Shape& S2)
+ {
+ return S1.IsSame(S2);
+ }
+ static inline Standard_Integer HashCode(const TopoDS_Shape& S,
+ const Standard_Integer Upper)
+ {
+ return ::HashCode( S, Upper);
+ }
+};
-#endif
+#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
class SMDS_Mesh0DElement;
class SMDS_BallElement;
-#include <NCollection_DataMap.hxx>
#include <map>
+
/*
* Using of native hash_map isn't portable and don't work on WIN32 platform.
* So this functionality implement on new NCollection_DataMap technology
*/
+#include <NCollection_DataMap.hxx>
#include "SMESHDS_DataMapOfShape.hxx"
+typedef std::list<const SMESHDS_Hypothesis*> THypList;
+typedef NCollection_DataMap< TopoDS_Shape, THypList, SMESHDS_Hasher > ShapeToHypothesis;
class SMESHDS_GroupBase;
class DownIdType;
-class SMESHDS_EXPORT SMESHDS_Mesh:public SMDS_Mesh{
+class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
+{
public:
SMESHDS_Mesh(int theMeshID, bool theIsEmbeddedMode);
bool IsEmbeddedMode();
bool HasHypothesis(const TopoDS_Shape & S);
const std::list<const SMESHDS_Hypothesis*>& GetHypothesis(const TopoDS_Shape & S) const;
bool IsUsedHypothesis(const SMESHDS_Hypothesis * H) const;
+ const ShapeToHypothesis & GetHypotheses() const { return myShapeToHypothesis; }
+
SMESHDS_Script * GetScript();
void ClearScript();
+
int ShapeToIndex(const TopoDS_Shape & aShape) const;
const TopoDS_Shape& IndexToShape(int ShapeIndex) const;
int MaxShapeIndex() const { return myIndexToShape.Extent(); }
it->second->AddNode( aNode ); // add aNode to submesh
}
- /*int HashCode( const TopoDS_Shape& S, const Standard_Integer theUpper ) const
- {
- return S.HashCode(2147483647);
- }*/
-
- typedef std::list<const SMESHDS_Hypothesis*> THypList;
-
- typedef NCollection_DataMap< TopoDS_Shape, THypList > ShapeToHypothesis;
-
ShapeToHypothesis myShapeToHypothesis;
int myMeshID, myPersistentID;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
SMESHGUI_ReorientFacesDlg.h
SMESHGUI_PropertiesDlg.h
SMESHGUI_Add0DElemsOnAllNodesDlg.h
+ SMESHGUI_FieldSelectorWdg.h
)
# header files / no moc processing
SMESHGUI_Filter.cxx
SMESHGUI_MeshEditPreview.cxx
SMESHGUI_FileValidator.cxx
+ SMESHGUI_FieldSelectorWdg.cxx
)
# sources / to compile
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESHGUI_DuplicateNodesDlg.h"
#include "SMESHGUI_ExtrusionAlongPathDlg.h"
#include "SMESHGUI_ExtrusionDlg.h"
+#include "SMESHGUI_FieldSelectorWdg.h"
#include "SMESHGUI_FileInfoDlg.h"
#include "SMESHGUI_FileValidator.h"
#include "SMESHGUI_FilterDlg.h"
// of auto-color picking up
#define SIMPLE_AUTOCOLOR
-//namespace{
+namespace
+{
// Declarations
//=============================================================
void ImportMeshesFromFile(SMESH::SMESH_Gen_ptr theComponentMesh,
void Control( int theCommandID );
-
// Definitions
- //=============================================================
+ //================================================================================
+ /*!
+ * \brief Reads meshes from file
+ */
+ //================================================================================
+
void ImportMeshesFromFile( SMESH::SMESH_Gen_ptr theComponentMesh,
int theCommandID )
{
if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
anInitialPath = QDir::currentPath();
+ QList< QPair< GEOM::ListOfFields_var, QString > > aFieldList;
+
// Get a file name to write in and additional otions
if ( isUNV || isDAT || isGMF ) // Export w/o options
{
QStringList checkBoxes;
checkBoxes << QObject::tr("SMESH_AUTO_GROUPS") << QObject::tr("SMESH_AUTO_DIM");
+ SMESHGUI_FieldSelectorWdg* fieldSelWdg = new SMESHGUI_FieldSelectorWdg();
+ QList< QWidget* > wdgList;
+ if ( fieldSelWdg->GetAllFeilds( aMeshList, aFieldList ))
+ wdgList.append( fieldSelWdg );
+
SalomeApp_CheckFileDlg* fd =
- new SalomeApp_CheckFileDlg ( SMESHGUI::desktop(), false, checkBoxes, true, true );
+ new SalomeApp_CheckFileDlg ( SMESHGUI::desktop(), false, checkBoxes, true, true, wdgList );
fd->setWindowTitle( aTitle );
fd->setNameFilters( filters );
fd->selectNameFilter( aDefaultFilter );
}
toCreateGroups = fd->IsChecked(0);
toFindOutDim = fd->IsChecked(1);
+ fieldSelWdg->GetSelectedFeilds();
+ if ( !fieldSelWdg->parent() )
+ delete fieldSelWdg;
delete fd;
}
else
{
SMESH::SMESH_IDSource_var aMeshOrGroup = (*aMeshIter).first;
SMESH::SMESH_Mesh_var aMeshItem = aMeshOrGroup->GetMesh();
- if ( aMeshOrGroup->_is_equivalent( aMeshItem ))
+ const GEOM::ListOfFields& fields = aFieldList[ aMeshIndex ].first.in();
+ const QString& geoAssFields = aFieldList[ aMeshIndex ].second;
+ const bool hasFields = ( fields.length() || !geoAssFields.isEmpty() );
+ if ( !hasFields && aMeshOrGroup->_is_equivalent( aMeshItem ))
aMeshItem->ExportToMEDX( aFilename.toUtf8().data(), toCreateGroups,
aFormat, toOverwrite && aMeshIndex == 0, toFindOutDim );
else
aMeshItem->ExportPartToMED( aMeshOrGroup, aFilename.toUtf8().data(), toCreateGroups,
- aFormat, toOverwrite && aMeshIndex == 0, toFindOutDim );
+ aFormat, toOverwrite && aMeshIndex == 0, toFindOutDim,
+ fields, geoAssFields.toLatin1().data() );
}
}
else if ( isSAUV )
int deltaF = 0, deltaV = 0;
int elem0dSize = 1;
int ballSize = 1;
+ double ballScale = 1.0;
int edgeWidth = 1;
int outlineWidth = 1;
double shrinkCoef = 0.0;
anActor->GetBallColor( color[0], color[1], color[2] );
ballColor.setRgbF( color[0], color[1], color[2] );
ballSize = qMax( (int)anActor->GetBallSize(), 1 ); // minimum allowed size is 1
+ ballScale = qMax( (double)anActor->GetBallScale(), 1e-2 ); // minimum allowed scale is 1e-2
// outlines: color
anActor->GetOutlineColor( color[0], color[1], color[2] );
outlineColor.setRgbF( color[0], color[1], color[2] );
// balls: color, size
dlg.setBallColor( ballColor );
dlg.setBallSize( ballSize );
+ dlg.setBallScale( ballScale );
// orientation: color, scale, 3d flag
dlg.setOrientationColor( orientationColor );
dlg.setOrientationSize( int( orientationScale * 100. ) );
elem0dSize = dlg.elem0dSize();
ballColor = dlg.ballColor();
ballSize = dlg.ballSize();
+ ballScale = dlg.ballScale();
orientationColor = dlg.orientationColor();
orientationScale = dlg.orientationSize() / 100.;
orientation3d = dlg.orientation3d();
// balls: color, size
anActor->SetBallColor( ballColor.redF(), ballColor.greenF(), ballColor.blueF() );
anActor->SetBallSize( ballSize );
+ anActor->SetBallScale( ballScale );
// orientation: color, scale, 3d flag
anActor->SetFacesOrientationColor( orientationColor.redF(), orientationColor.greenF(), orientationColor.blueF() );
anActor->SetFacesOrientationScale( orientationScale );
QString RefType = CheckTypeObject(selected.First());
SALOME_ListIteratorOfListIO It(selected);
for ( ; It.More(); It.Next())
- {
- Handle(SALOME_InteractiveObject) IObject = It.Value();
- QString Type = CheckTypeObject(IObject);
- if (Type.compare(RefType) != 0)
- return "Heterogeneous Selection";
- }
+ {
+ Handle(SALOME_InteractiveObject) IObject = It.Value();
+ QString Type = CheckTypeObject(IObject);
+ if (Type.compare(RefType) != 0)
+ return "Heterogeneous Selection";
+ }
return RefType;
}
+} //namespace
- void SMESHGUI::OnEditDelete()
- {
- // VSR 17/11/04: check if all objects selected belong to SMESH component --> start
- LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
- SALOME_ListIO selected; aSel->selectedObjects( selected, QString::null, false );
+void SMESHGUI::OnEditDelete()
+{
+ // VSR 17/11/04: check if all objects selected belong to SMESH component --> start
+ LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
+ SALOME_ListIO selected; aSel->selectedObjects( selected, QString::null, false );
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
- _PTR(GenericAttribute) anAttr;
- _PTR(AttributeIOR) anIOR;
-
- int objectCount = 0;
- QString aNameList;
- QString aParentComponent = QString::null;
- Handle(SALOME_InteractiveObject) anIO;
- for( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() )
- {
- anIO = anIt.Value();
- QString cur = anIO->getComponentDataType();
- _PTR(SObject) aSO = aStudy->FindObjectID(anIO->getEntry());
- if (aSO) {
- // check if object is reference
- _PTR(SObject) aRefSObj;
- aNameList.append("\n - ");
- if ( aSO->ReferencedObject( aRefSObj ) ) {
- QString aRefName = QString::fromStdString ( aRefSObj->GetName() );
- aNameList.append( aRefName );
- cur = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() );
- }
- else
- aNameList.append(anIO->getName());
- objectCount++;
- }
+ _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
+ _PTR(GenericAttribute) anAttr;
+ _PTR(AttributeIOR) anIOR;
- if( aParentComponent.isNull() )
- aParentComponent = cur;
- else if( !aParentComponent.isEmpty() && aParentComponent!=cur )
- aParentComponent = "";
+ int objectCount = 0;
+ QString aNameList;
+ QString aParentComponent = QString::null;
+ Handle(SALOME_InteractiveObject) anIO;
+ for( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() )
+ {
+ anIO = anIt.Value();
+ QString cur = anIO->getComponentDataType();
+ _PTR(SObject) aSO = aStudy->FindObjectID(anIO->getEntry());
+ if (aSO) {
+ // check if object is reference
+ _PTR(SObject) aRefSObj;
+ aNameList.append("\n - ");
+ if ( aSO->ReferencedObject( aRefSObj ) ) {
+ QString aRefName = QString::fromStdString ( aRefSObj->GetName() );
+ aNameList.append( aRefName );
+ cur = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() );
+ }
+ else
+ aNameList.append(anIO->getName());
+ objectCount++;
}
- if ( objectCount == 0 )
- return; // No Valid Objects Selected
+ if( aParentComponent.isNull() )
+ aParentComponent = cur;
+ else if( !aParentComponent.isEmpty() && aParentComponent!=cur )
+ aParentComponent = "";
+ }
- if ( aParentComponent != SMESHGUI::GetSMESHGUI()->name() ) {
- SUIT_MessageBox::warning( SMESHGUI::desktop(),
- QObject::tr("ERR_ERROR"),
- QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ) );
- return;
- }
- // VSR 17/11/04: check if all objects selected belong to SMESH component <-- finish
- if (SUIT_MessageBox::warning
- (SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_REALLY_DELETE").arg( objectCount ).arg( aNameList ),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No,
- SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes)
- return;
+ if ( objectCount == 0 )
+ return; // No Valid Objects Selected
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+ if ( aParentComponent != SMESHGUI::GetSMESHGUI()->name() ) {
+ SUIT_MessageBox::warning( SMESHGUI::desktop(),
+ QObject::tr("ERR_ERROR"),
+ QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ) );
+ return;
+ }
+ // VSR 17/11/04: check if all objects selected belong to SMESH component <-- finish
+ if (SUIT_MessageBox::warning
+ (SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_REALLY_DELETE").arg( objectCount ).arg( aNameList ),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+ SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes)
+ return;
- // Put the whole hierarchy of sub-objects of the selected SO's into a list and
- // then treat them all starting from the deepest objects (at list back)
- std::list< _PTR(SObject) > listSO;
- SALOME_ListIteratorOfListIO It(selected);
- for( ; It.More(); It.Next()) // loop on selected IO's
- {
- Handle(SALOME_InteractiveObject) IObject = It.Value();
- if(IObject->hasEntry()) {
- _PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry());
-
- // disable removal of "SMESH" component object
- if(aSO->FindAttribute(anAttr, "AttributeIOR")){
- anIOR = anAttr;
- if ( engineIOR() == anIOR->Value().c_str() )
- continue;
- }
- //Check the referenced object
- _PTR(SObject) aRefSObject;
- if ( aSO && aSO->ReferencedObject( aRefSObject ) )
- aSO = aRefSObject; // Delete main Object instead of reference
-
- listSO.push_back( aSO );
- std::list< _PTR(SObject) >::iterator itSO = --listSO.end();
- for ( ; itSO != listSO.end(); ++itSO ) {
- _PTR(ChildIterator) it = aStudy->NewChildIterator( *itSO );
- for (it->InitEx(false); it->More(); it->Next())
- listSO.push_back( it->Value() );
- }
+ SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+
+ // Put the whole hierarchy of sub-objects of the selected SO's into a list and
+ // then treat them all starting from the deepest objects (at list back)
+ std::list< _PTR(SObject) > listSO;
+ SALOME_ListIteratorOfListIO It(selected);
+ for( ; It.More(); It.Next()) // loop on selected IO's
+ {
+ Handle(SALOME_InteractiveObject) IObject = It.Value();
+ if(IObject->hasEntry()) {
+ _PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry());
+
+ // disable removal of "SMESH" component object
+ if(aSO->FindAttribute(anAttr, "AttributeIOR")){
+ anIOR = anAttr;
+ if ( engineIOR() == anIOR->Value().c_str() )
+ continue;
+ }
+ //Check the referenced object
+ _PTR(SObject) aRefSObject;
+ if ( aSO && aSO->ReferencedObject( aRefSObject ) )
+ aSO = aRefSObject; // Delete main Object instead of reference
+
+ listSO.push_back( aSO );
+ std::list< _PTR(SObject) >::iterator itSO = --listSO.end();
+ for ( ; itSO != listSO.end(); ++itSO ) {
+ _PTR(ChildIterator) it = aStudy->NewChildIterator( *itSO );
+ for (it->InitEx(false); it->More(); it->Next())
+ listSO.push_back( it->Value() );
}
}
- // Check if none of objects to delete is referred from outside
- std::list< _PTR(SObject) >::reverse_iterator ritSO;
- for ( ritSO = listSO.rbegin(); ritSO != listSO.rend(); ++ritSO )
- {
- _PTR(SObject) SO = *ritSO;
- if ( !SO ) continue;
- std::vector<_PTR(SObject)> aReferences = aStudy->FindDependances( *ritSO );
- for (size_t i = 0; i < aReferences.size(); i++) {
- _PTR(SComponent) aComponent = aReferences[i]->GetFatherComponent();
- std::string type = aComponent->ComponentDataType();
- if ( type != "SMESH" )
- {
- SUIT_MessageBox::warning( anApp->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("DEP_OBJECT") );
- return; // outside SMESH, there is an object depending on a SMESH object
- }
+ }
+ // Check if none of objects to delete is referred from outside
+ std::list< _PTR(SObject) >::reverse_iterator ritSO;
+ for ( ritSO = listSO.rbegin(); ritSO != listSO.rend(); ++ritSO )
+ {
+ _PTR(SObject) SO = *ritSO;
+ if ( !SO ) continue;
+ std::vector<_PTR(SObject)> aReferences = aStudy->FindDependances( *ritSO );
+ for (size_t i = 0; i < aReferences.size(); i++) {
+ _PTR(SComponent) aComponent = aReferences[i]->GetFatherComponent();
+ std::string type = aComponent->ComponentDataType();
+ if ( type != "SMESH" )
+ {
+ SUIT_MessageBox::warning( anApp->desktop(),
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("DEP_OBJECT") );
+ return; // outside SMESH, there is an object depending on a SMESH object
}
}
+ }
- // Call mesh->Clear() to prevent loading mesh from file caused by hypotheses removal
- for( It.Initialize( selected ); It.More(); It.Next()) // loop on selected IO's
- {
- Handle(SALOME_InteractiveObject) IObject = It.Value();
- SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface< SMESH::SMESH_Mesh >( IObject );
- if ( !mesh->_is_nil() )
- mesh->Clear();
- }
+ // Call mesh->Clear() to prevent loading mesh from file caused by hypotheses removal
+ for( It.Initialize( selected ); It.More(); It.Next()) // loop on selected IO's
+ {
+ Handle(SALOME_InteractiveObject) IObject = It.Value();
+ SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface< SMESH::SMESH_Mesh >( IObject );
+ if ( !mesh->_is_nil() )
+ mesh->Clear();
+ }
- // Treat SO's in the list starting from the back
- aStudyBuilder->NewCommand(); // There is a transaction
- for ( ritSO = listSO.rbegin(); ritSO != listSO.rend(); ++ritSO )
- {
- _PTR(SObject) SO = *ritSO;
- if ( !SO ) continue;
- std::string anEntry = SO->GetID();
+ // Treat SO's in the list starting from the back
+ aStudyBuilder->NewCommand(); // There is a transaction
+ for ( ritSO = listSO.rbegin(); ritSO != listSO.rend(); ++ritSO )
+ {
+ _PTR(SObject) SO = *ritSO;
+ if ( !SO ) continue;
+ std::string anEntry = SO->GetID();
- /** Erase graphical object and remove all its data **/
- if(SO->FindAttribute(anAttr, "AttributeIOR")) {
- SMESH::RemoveVisualObjectWithActors( anEntry.c_str(), true);
- }
- /** 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 );
+ /** Erase graphical object and remove all its data **/
+ if(SO->FindAttribute(anAttr, "AttributeIOR")) {
+ SMESH::RemoveVisualObjectWithActors( anEntry.c_str(), true);
+ }
+ /** 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, aMesh->NbNodes()==0);
+ _PTR(SObject) aMeshSO = SMESH::FindSObject(aMesh);
+ if (aMeshSO)
+ SMESH::ModifiedMesh(aMeshSO, false, aMesh->NbNodes()==0);
+ }
+ else {
+ Handle(SALOME_InteractiveObject) IObject = new SALOME_InteractiveObject
+ ( anEntry.c_str(), engineIOR().toLatin1().data(), SO->GetName().c_str() );
+ QString objType = CheckTypeObject(IObject);
+ if ( objType == "Hypothesis" || objType == "Algorithm" ) {// DELETE HYPOTHESIS
+ SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
+ aStudyBuilder->RemoveObjectWithChildren( SO );
}
- else {
- Handle(SALOME_InteractiveObject) IObject = new SALOME_InteractiveObject
- ( anEntry.c_str(), engineIOR().toLatin1().data(), 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();
- }
+ 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 */
+ }
+ } /* listSO back loop */
- aStudyBuilder->CommitCommand();
+ aStudyBuilder->CommitCommand();
- /* Clear any previous selection */
- SALOME_ListIO l1;
- aSel->setSelectedObjects( l1 );
+ /* Clear any previous selection */
+ SALOME_ListIO l1;
+ aSel->setSelectedObjects( l1 );
- SMESHGUI::GetSMESHGUI()->updateObjBrowser();
- }
-//} namespace
+ SMESHGUI::GetSMESHGUI()->updateObjBrowser();
+}
extern "C" {
SMESHGUI_EXPORT CAM_Module* createModule()
else if ( theCommandID == 410 )
aDlg = new SMESHGUI_UnionOfTrianglesDlg(this);
else if ( theCommandID == 419 )
- aDlg = new SMESHGUI_CuttingIntoTetraDlg(this);
+ aDlg = new SMESHGUI_SplitVolumesDlg(this);
else
aDlg = new SMESHGUI_CuttingOfQuadsDlg(this);
LightApp_Preferences::IntSpin, "SMESH", "elem0d_size");
int ballSize = addPreference(tr("PREF_BALL_SIZE"), elemGroup,
LightApp_Preferences::IntSpin, "SMESH", "ball_elem_size");
+ double ballScale = addPreference(tr("PREF_BALL_SCALE"), elemGroup,
+ LightApp_Preferences::DblSpin, "SMESH", "ball_elem_scale");
int elemW = addPreference(tr("PREF_WIDTH"), elemGroup,
LightApp_Preferences::IntSpin, "SMESH", "element_width");
int outW = addPreference(tr("PREF_OUTLINE_WIDTH"), elemGroup,
setPreferenceProperty( ballSize, "min", 1 );
setPreferenceProperty( ballSize, "max", 10 );
+ setPreferenceProperty( ballScale, "min", 1e-2 );
+ setPreferenceProperty( ballScale, "max", 1e7 );
+ setPreferenceProperty( ballScale, "step", 0.5 );
+
setPreferenceProperty( elemW, "min", 1 );
setPreferenceProperty( elemW, "max", 5 );
sizeStr << QString::number((int)aSmeshActor->Get0DSize());
sizeStr << "ball";
sizeStr << QString::number((int)aSmeshActor->GetBallSize());
+ sizeStr << QString::number((double)aSmeshActor->GetBallScale());
sizeStr << "shrink";
sizeStr << QString::number(aSmeshActor->GetShrinkFactor());
sizeStr << "orientation";
int outlineWidth = -1;
int elem0dSize = -1;
int ballSize = -1;
+ double ballScale = -1.0;
double shrinkSize = -1;
double orientationSize = -1;
bool orientation3d = false;
i++;
}
else if ( type == "ball" ) {
- // ball size is given as single integer value
- if ( i+1 >= sizes.count() ) break; // format error
- int v = sizes[i+1].toInt( &bOk ); if ( !bOk ) break; // format error
- ballSize = v;
- i++;
+ // balls are specified by two values: size:scale, where
+ // - size - is a integer value specifying size
+ // - scale - is a double value specifying scale factor
+ if ( i+1 >= sizes.count() ) break; // format error
+ int v1 = sizes[i+1].toInt( &bOk ); if ( !bOk ) break; // format error
+ if ( i+2 >= sizes.count() ) break; // format error
+ double v2 = sizes[i+2].toDouble( &bOk ); if ( !bOk ) break; // format error
+ ballSize = v1;
+ ballScale = v2;
+ i += 2;
}
else if ( type == "shrink" ) {
// shrink factor is given as single floating point value
// ball size
if ( ballSize > 0 )
aSmeshActor->SetBallSize( ballSize );
+ // ball scale
+ if ( ballScale > 0.0 )
+ aSmeshActor->SetBallScale( ballScale );
// shrink factor
if ( shrinkSize > 0 )
aSmeshActor->SetShrinkFactor( shrinkSize );
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++){
anIds->InsertId(0,theIds[i]);
vtkIdType anId = myBallPolyData->InsertNextCell(VTK_POLY_VERTEX,anIds);
- double d = theDiameter;
+ double d = theDiameter * theActor->GetBallScale();
aScalars->SetTuple(anId,&d);
anIds->Reset();
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// get selected mesh
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
+ mySelectionMgr->selectedObjects(aList);
if (aList.Extent() != 1)
{
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_SpinBox.h"
+#include <QtxDoubleSpinSlider.h>
+#include <QtxIntSpinSlider.h>
+
#include <SMESH_Actor.h>
#include <SMESH_ActorUtils.h>
CBRelativeOrientation->addItem( tr("ALONG_ZX") );
GroupParametersLayout->addWidget( CBRelativeOrientation, 0, 1 );
- TLValueDistance = new QLabel( GroupParameters );
- TLValueDistance->setObjectName( "TLValueDistance" );
- TLValueDistance->setAlignment( Qt::AlignCenter );
- TLValueDistance->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- QFont fnt = TLValueDistance->font(); fnt.setBold( true ); TLValueDistance->setFont( fnt );
- GroupParametersLayout->addWidget( TLValueDistance, 1, 1 );
-
TextLabelDistance = new QLabel( tr("SMESH_DISTANCE"), GroupParameters );
TextLabelDistance->setObjectName( "TextLabelDistance" );
- GroupParametersLayout->addWidget( TextLabelDistance, 2, 0 );
-
- SliderDistance = new QSlider( Qt::Horizontal, GroupParameters );
- SliderDistance->setObjectName( "SliderDistance" );
- SliderDistance->setMinimumSize( 300, 0 );
- SliderDistance->setMinimum( 0 );
- SliderDistance->setMaximum( 100 );
- SliderDistance->setSingleStep( 1 );
- SliderDistance->setPageStep( 10 );
- SliderDistance->setTracking( false );
- GroupParametersLayout->addWidget( SliderDistance, 2, 1 );
-
- TLValueRotation1 = new QLabel( GroupParameters );
- TLValueRotation1->setObjectName( "TLValueRotation1" );
- TLValueRotation1->setAlignment( Qt::AlignCenter );
- TLValueRotation1->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- TLValueRotation1->setFont( fnt );
- GroupParametersLayout->addWidget( TLValueRotation1, 3, 1 );
+ GroupParametersLayout->addWidget( TextLabelDistance, 1, 0 );
+
+ SpinSliderDistance = new QtxDoubleSpinSlider( 0., 1., 0.01, GroupParameters );
+ SpinSliderDistance->setObjectName( "SpinSliderDistance" );
+ SpinSliderDistance->setPrecision( precision );
+ QFont fnt = SpinSliderDistance->font(); fnt.setBold( true ); SpinSliderDistance->setFont( fnt );
+ GroupParametersLayout->addWidget( SpinSliderDistance, 1, 1 );
+
+ QString aUnitRot = "\xB0";
TextLabelRotation1 = new QLabel( tr("ROTATION_AROUND_X_Y2Z"), GroupParameters );
TextLabelRotation1->setObjectName( "TextLabelRotation1" );
- GroupParametersLayout->addWidget( TextLabelRotation1, 4, 0 );
-
- SliderRotation1 = new QSlider( Qt::Horizontal, GroupParameters );
- SliderRotation1->setObjectName( "SliderRotation1" );
- SliderRotation1->setMinimumSize( 300, 0 );
- SliderRotation1->setMinimum( -180 );
- SliderRotation1->setMaximum( 180 );
- SliderRotation1->setSingleStep( 1 );
- SliderRotation1->setPageStep( 10 );
- SliderRotation1->setTracking(false);
- GroupParametersLayout->addWidget( SliderRotation1, 4, 1 );
-
- TLValueRotation2 = new QLabel( GroupParameters );
- TLValueRotation2->setObjectName( "TLValueRotation2" );
- TLValueRotation2->setAlignment( Qt::AlignCenter );
- TLValueRotation2->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- TLValueRotation2->setFont( fnt );
- GroupParametersLayout->addWidget( TLValueRotation2, 5, 1 );
+ GroupParametersLayout->addWidget( TextLabelRotation1, 2, 0 );
+
+ SpinSliderRotation1 = new QtxIntSpinSlider( -180, 180, 1, GroupParameters );
+ SpinSliderRotation1->setObjectName( "SpinSliderRotation1" );
+ SpinSliderRotation1->setUnit( aUnitRot );
+ SpinSliderRotation1->setFont( fnt );
+ GroupParametersLayout->addWidget( SpinSliderRotation1, 2, 1 );
TextLabelRotation2 = new QLabel(tr("ROTATION_AROUND_Y_X2Z"), GroupParameters);
TextLabelRotation2->setObjectName( "TextLabelRotation2" );
TextLabelRotation2->setObjectName( "TextLabelRotation2" );
- GroupParametersLayout->addWidget( TextLabelRotation2, 6, 0 );
-
- SliderRotation2 = new QSlider( Qt::Horizontal, GroupParameters );
- SliderRotation2->setObjectName( "SliderRotation2" );
- SliderRotation2->setMinimumSize( 300, 0 );
- SliderRotation2->setMinimum( -180 );
- SliderRotation2->setMaximum( 180 );
- SliderRotation2->setSingleStep( 1 );
- SliderRotation2->setPageStep( 10 );
- SliderRotation2->setTracking(false);
- GroupParametersLayout->addWidget( SliderRotation2, 6, 1 );
+ GroupParametersLayout->addWidget( TextLabelRotation2, 3, 0 );
+
+ SpinSliderRotation2 = new QtxIntSpinSlider( -180, 180, 1, GroupParameters );
+ SpinSliderRotation2->setObjectName( "SpinSliderRotation2" );
+ SpinSliderRotation2->setUnit( aUnitRot );
+ SpinSliderRotation2->setFont( fnt );
+ GroupParametersLayout->addWidget( SpinSliderRotation2, 3, 1 );
/***************************************************************/
QWidget* CheckBoxWidget = new QWidget( this );
connect( CBAbsoluteOrientation, SIGNAL ( activated ( int ) ), this, SLOT( onSelectAbsoluteOrientation( int ) ) ) ;
connect( CBRelativeOrientation, SIGNAL( activated( int ) ), this, SLOT( onSelectRelativeOrientation( int ) ) );
- connect( SliderDistance, SIGNAL( sliderMoved( int ) ), this, SLOT( SliderDistanceHasMoved( int ) ) );
- connect( SliderDistance, SIGNAL( valueChanged( int ) ), this, SLOT( SliderDistanceHasMoved( int ) ) );
- connect( SliderRotation1, SIGNAL( sliderMoved( int ) ), this, SLOT( SliderRotation1HasMoved( int ) ) );
- connect( SliderRotation1, SIGNAL( valueChanged( int ) ), this, SLOT( SliderRotation1HasMoved( int ) ) );
- connect( SliderRotation2, SIGNAL( sliderMoved( int ) ), this, SLOT( SliderRotation2HasMoved( int ) ) );
- connect( SliderRotation2, SIGNAL( valueChanged( int ) ), this, SLOT( SliderRotation2HasMoved( int ) ) );
+ connect( SpinSliderDistance, SIGNAL( valueChanged( double ) ), this, SLOT( SetCurrentPlaneParam() ) );
+ connect( SpinSliderRotation1, SIGNAL( valueChanged( int ) ), this, SLOT( SetCurrentPlaneParam() ) );
+ connect( SpinSliderRotation2, SIGNAL( valueChanged( int ) ), this, SLOT( SetCurrentPlaneParam() ) );
connect( PreviewCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( OnPreviewToggle( bool ) ) );
connect( AutoApplyCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( onAutoApply( bool ) ) );
*/
double SMESHGUI_ClippingDlg::getDistance() const
{
- return TLValueDistance->text().toDouble();
+ return SpinSliderDistance->value();
}
/*!
*/
void SMESHGUI_ClippingDlg::setDistance( const double theDistance )
{
- SliderDistance->setValue( theDistance*100 );
+ SpinSliderDistance->setValue( theDistance );
}
/*!
*/
double SMESHGUI_ClippingDlg::getRotation1() const
{
- return TLValueRotation1->text().remove("\xB0").toInt();
+ return SpinSliderRotation1->value();
}
/*!
*/
double SMESHGUI_ClippingDlg::getRotation2() const
{
- return TLValueRotation2->text().remove("\xB0").toInt();
+ return SpinSliderRotation2->value();
}
/*!
*/
void SMESHGUI_ClippingDlg::setRotation (const double theRot1, const double theRot2)
{
- SliderRotation1->setValue( theRot1 );
- SliderRotation2->setValue( theRot2 );
+ SpinSliderRotation1->setValue( int(floor(theRot1)) );
+ SpinSliderRotation2->setValue( int(floor(theRot2)) );
}
/*!
switch ( theOrientation ) {
case 0:
case 1:
- theDir[0][1] = anU[0];
- theDir[0][2] = aV[0];
- theDir[1][0] = anU[1];
- theDir[1][2] = aV[1];
+ theDir[0][1] = anU[0];
+ theDir[0][2] = aV[0];
+ theDir[1][0] = anU[1];
+ theDir[1][2] = aV[1];
break;
case 2:
- theDir[0][2] = anU[0];
- theDir[0][0] = aV[0];
- theDir[1][1] = anU[1];
- theDir[1][0] = aV[1];
+ theDir[0][2] = anU[0];
+ theDir[0][0] = aV[0];
+ theDir[1][1] = anU[1];
+ theDir[1][0] = aV[1];
break;
case 3:
- theDir[0][0] = anU[0];
- theDir[0][1] = aV[0];
- theDir[1][2] = anU[1];
- theDir[1][1] = aV[1];
+ theDir[0][0] = anU[0];
+ theDir[0][1] = aV[0];
+ theDir[1][2] = anU[1];
+ theDir[1][1] = aV[1];
break;
}
int anOrientation;
if ( thePlane->PlaneMode == SMESH::Absolute )
- anOrientation = thePlane->myAbsoluteOrientation;
+ anOrientation = thePlane->myAbsoluteOrientation;
else if ( thePlane->PlaneMode == SMESH::Relative )
- anOrientation = thePlane->myRelativeOrientation + 1;
+ anOrientation = thePlane->myRelativeOrientation + 1;
if ( anOrientation == 0 ) {
- // compute a direction for plane in absolute mode
+ // compute a direction for plane in absolute mode
double znam = sqrt( thePlane->Dx*thePlane->Dx + thePlane->Dy*thePlane->Dy + thePlane->Dz*thePlane->Dz );
double aRotation = acos( thePlane->Dy/znam )/aCoeff;
if ( thePlane->Dy >= 0.0 && thePlane->Dz >= 0.0 ) thePlane->myAngle[0] = 90.0 + aRotation;
for ( ; anIter != theActorList.end(); anIter++ )
if( vtkActor* aVTKActor = *anIter )
if( SMESH_Actor* anActor = SMESH_Actor::SafeDownCast( aVTKActor ) ) {
- if( thePlane->IsOpenGLClipping )
+ if( thePlane->IsOpenGLClipping )
anActor->AddOpenGLClippingPlane( thePlane->InvertPlane() );
- else
- anActor->AddClippingPlane( thePlane );
+ else
+ anActor->AddClippingPlane( thePlane );
}
return true;
CBAbsoluteOrientation->setCurrentIndex(0);
- TLValueDistance->setText( "0.5" );
- TLValueRotation1->setText( "0\xB0" );
- TLValueRotation2->setText( "0\xB0" );
+ SpinSliderDistance->setValue( 0.5 );
+ SpinSliderRotation1->setValue( 0 );
+ SpinSliderRotation2->setValue( 0 );
CBRelativeOrientation->setCurrentIndex( 0 );
- SliderDistance->setValue( 50 );
- SliderRotation1->setValue( 0 );
- SliderRotation2->setValue( 0 );
}
/*!
}
else if ( CurrentMode == SMESH::Relative ) {
CBRelativeOrientation->setEnabled( anIsControlsEnable );
- SliderDistance->setEnabled( anIsControlsEnable );
- SliderRotation1->setEnabled( anIsControlsEnable );
- SliderRotation2->setEnabled( anIsControlsEnable );
+ SpinSliderDistance->setEnabled( anIsControlsEnable );
+ SpinSliderRotation1->setEnabled( anIsControlsEnable );
+ SpinSliderRotation2->setEnabled( anIsControlsEnable );
}
}
else if( theItem->checkState() == Qt::Unchecked && anIsPushed )
anActorList.remove( anActor );
- SMESH::ComputeBounds( anActorList, myBounds );
- myPreviewWidget->PlaceWidget( myBounds[0], myBounds[1], myBounds[2],
- myBounds[3], myBounds[4], myBounds[5] );
+ if( SMESH::ComputeBounds( anActorList, myBounds ) ) {
+ myPreviewWidget->On();
+ myPreviewWidget->PlaceWidget( myBounds[0], myBounds[1], myBounds[2],
+ myBounds[3], myBounds[4], myBounds[5] );
+ }
+ else
+ myPreviewWidget->Off();
}
}
}
bool anIsBlocked = ActorList->blockSignals( true );
- SMESH::ComputeBounds( anActorList, myBounds );
- myPreviewWidget->PlaceWidget( myBounds[0],myBounds[1],myBounds[2],
- myBounds[3],myBounds[4],myBounds[5] );
+ if( SMESH::ComputeBounds( anActorList, myBounds ) ) {
+ myPreviewWidget->On();
+ myPreviewWidget->PlaceWidget( myBounds[0], myBounds[1], myBounds[2],
+ myBounds[3], myBounds[4], myBounds[5] );
+ }
+ else
+ myPreviewWidget->Off();
+
synchronize();
SetCurrentPlaneParam();
}
}
myIsSelectPlane = false;
- SMESH::ComputeBounds( aPlaneData.ActorList, myBounds );
- myPreviewWidget->PlaceWidget( myBounds[0], myBounds[1], myBounds[2],
- myBounds[3], myBounds[4], myBounds[5] );
+
+ if( SMESH::ComputeBounds( aPlaneData.ActorList, myBounds ) ) {
+ myPreviewWidget->On();
+ myPreviewWidget->PlaceWidget( myBounds[0], myBounds[1], myBounds[2],
+ myBounds[3], myBounds[4], myBounds[5] );
+ }
+ else
+ myPreviewWidget->Off();
+
SetCurrentPlaneParam();
// Actors
double aRot[2] = { getRotation1(), getRotation2() };
int anOrient;
if ( aPlane->PlaneMode == SMESH::Absolute )
- anOrient = CBAbsoluteOrientation->currentIndex();
+ anOrient = CBAbsoluteOrientation->currentIndex();
else if ( aPlane->PlaneMode == SMESH::Relative )
- anOrient = CBRelativeOrientation->currentIndex() + 1;
+ anOrient = CBRelativeOrientation->currentIndex() + 1;
if ( aPlane->PlaneMode == SMESH::Relative ) {
aPlane->myAngle[0] = aRot[0];
}
if ( anOrient == 0 ) {
- // compute a direction for plane in absolute mode
+ // compute a direction for plane in absolute mode
double znam = sqrt( aPlane->Dx*aPlane->Dx + aPlane->Dy*aPlane->Dy + aPlane->Dz*aPlane->Dz );
double aRotation = acos( aPlane->Dy/znam )/aCoeff;
if ( aPlane->Dy >= 0.0 && aPlane->Dz >= 0.0 ) aRot[0] = 90.0 + aRotation;
anOrigin[1] = aPlane->Y;
anOrigin[2] = aPlane->Z;
}
-
+
if( anIsOk ) {
aPlane->SetNormal( aNormal );
aPlane->SetOrigin( anOrigin );
if( anOrigin[2] < aBounds[4] ) {
myBounds[4] = anOrigin[2]; isBoundsChanged = true; }
if( anOrigin[2] > aBounds[5] ) {
- myBounds[5] = anOrigin[2]; isBoundsChanged = true; }
+ myBounds[5] = anOrigin[2]; isBoundsChanged = true; }
}
if( isBoundsChanged )
else if( aDirection[0] < 0 && aDirection[1] < 0 && aDirection[2] < 0 && aRot[0] > 0 ) {
aRot[0] = aRotation1 + 270.0; aRot[1] = aRotation2 + 90.0; }
- SliderRotation1HasMoved( qRound( aRot[0] ) );
- SliderRotation1->setValue( qRound( aRot[0] ) );
- SliderRotation2HasMoved( qRound( aRot[1] ) );
- SliderRotation2->setValue( qRound( aRot[1] ) );
+ SpinSliderRotation1->setValue( qRound( aRot[0] ) );
+ SpinSliderRotation2->setValue( qRound( aRot[1] ) );
int aCurPlaneIndex = ComboBoxPlanes->currentIndex();
const SMESH::TPlaneData& aPlaneData = myPlanes[ aCurPlaneIndex ];
else if( aDist < 0.0 )
aDist = 0.0;
- SliderDistanceHasMoved( qRound( aDist*100 ) );
- SliderDistance->setValue( qRound( aDist*100 ) );
+ SpinSliderDistance->setValue( qRound( aDist*100 ) );
return;
}
for( ; anIter3 != anActorList.end(); anIter3++ )
if( vtkActor* aVTKActor = *anIter3 )
if( SMESH_Actor* anActor = SMESH_Actor::SafeDownCast( aVTKActor ) ) {
- if( anOrientedPlane->IsOpenGLClipping )
+ if( anOrientedPlane->IsOpenGLClipping )
anActor->AddOpenGLClippingPlane( anOrientedPlane->InvertPlane() );
- else
- anActor->AddClippingPlane( anOrientedPlane );
+ else
+ anActor->AddClippingPlane( anOrientedPlane );
}
SMESH::ClippingPlaneInfo aClippingPlaneInfo;
aClippingPlaneInfoList.push_back( aClippingPlaneInfo );
}
- SMESH_Actor* anSMESHActor;
anAllActors->InitTraversal();
while( vtkActor* aVTKActor = anAllActors->GetNextActor() )
if( SMESH_Actor* anActor = SMESH_Actor::SafeDownCast( aVTKActor ) ) {
- anSMESHActor = anActor;
anActor->SetOpenGLClippingPlane();
}
}
}
-/*!
- SLOT: Called when value of slider distance change
-*/
-void SMESHGUI_ClippingDlg::SliderDistanceHasMoved( int value )
-{
- double new_value = value/100.;
- TLValueDistance->setText( QString("%1").arg( new_value ) );
- SetCurrentPlaneParam();
-}
-
-/*!
- SLOT: Called when value of slider rotation1 change
-*/
-void SMESHGUI_ClippingDlg::SliderRotation1HasMoved( int value )
-{
- TLValueRotation1->setText( QString("%1\xB0").arg( value ) );
- SetCurrentPlaneParam();
-}
-
-/*!
- SLOT: Called when value of slider rotation2 change
-*/
-void SMESHGUI_ClippingDlg::SliderRotation2HasMoved( int value )
-{
- TLValueRotation2->setText( QString("%1\xB0").arg( value ) );
- SetCurrentPlaneParam();
-}
-
void SMESHGUI_ClippingDlg::onSelectAbsoluteOrientation( int mode )
{
bool isUserMode = (mode==0);
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
class SMESHGUI;
class SMESH_Actor;
class QtxDoubleSpinBox;
+class QtxDoubleSpinSlider;
+class QtxIntSpinSlider;
class vtkActor;
class vtkDataSetMapper;
class vtkPlaneSource;
QLabel* TextLabelDistance;
QLabel* TextLabelRotation1;
QLabel* TextLabelRotation2;
- QLabel* TLValueDistance;
- QLabel* TLValueRotation1;
- QLabel* TLValueRotation2;
- QSlider* SliderDistance;
- QSlider* SliderRotation1;
- QSlider* SliderRotation2;
+ QtxDoubleSpinSlider* SpinSliderDistance;
+ QtxIntSpinSlider* SpinSliderRotation1;
+ QtxIntSpinSlider* SpinSliderRotation2;
QComboBox* CBRelativeOrientation;
QCheckBox* PreviewCheckBox;
void ClickOnApply();
void ClickOnHelp();
- void SliderDistanceHasMoved(int);
- void SliderRotation1HasMoved(int);
- void SliderRotation2HasMoved(int);
void onSelectAbsoluteOrientation( int );
void onSelectRelativeOrientation( int );
void onReset();
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
if ( !geom->_is_nil() ) {
GEOM::ListOfLong_var list = geom->GetSubShapeIndices();
if ( list->length() == 1 && list[0] == subShapeID )
- subSO = it->Value();
+ {
+ GEOM::GEOM_Object_var mainGO = geom->GetMainShape();
+ if ( aMainShape->IsSame( mainGO ))
+ subSO = it->Value();
+ }
}
}
}
QString shapeText(int subShapeID, GEOM::GEOM_Object_var aMainShape )
{
QString text;
- if ( _PTR(SObject) aSO = getSubShapeSO( subShapeID, aMainShape ))
- text = aSO->GetName().c_str();
+ if ( _PTR(SObject) aSO = getSubShapeSO( subShapeID, aMainShape )) {
+ text = aSO->GetName().c_str();
+ text += QString(" (%1)").arg( aSO->GetID().c_str() );
+ }
else {
text = QString("#%1").arg( subShapeID );
GEOM::GEOM_Object_wrap shape = getSubShape( subShapeID, aMainShape );
// add all widgets to aFrame
QVBoxLayout* aLay = new QVBoxLayout(aFrame);
- aLay->setMargin( 0 );
- aLay->setSpacing( 0 );
+ aLay->setMargin( MARGIN );
+ aLay->setSpacing( SPACING );
aLay->addWidget( aPixGrp );
aLay->addWidget( nameBox );
aLay->addWidget( myBriefInfo );
QLabel * nbNodesName = new QLabel(tr("SMESH_MESHINFO_NODES"), this );
QLabel * nbElemsName = new QLabel(tr("SMESH_MESHINFO_ELEMENTS"), this );
- QLabel * freeRAMName = new QLabel(tr("SMESH_FREERAM"), this );
nbNodesLabel = new QLabel("0", this );
nbElemsLabel = new QLabel("0", this );
+#ifndef WIN32
+ QLabel * freeRAMName = new QLabel(tr("SMESH_FREERAM"), this );
freeRAMLabel = new QLabel("", this );
+#endif
progressBar = new QProgressBar(this);
progressBar->setMinimum( 0 );
progressBar->setMaximum( 1000 );
if ( so->_is_nil() ) {
CORBA::String_var name = so->GetName();
CORBA::String_var entry = so->GetID();
- table()->item( r, COL_SHAPE )->setText( name.in() );
+ QString shapeText = QString("%1 (%2)").arg( name.in() ).arg( entry.in() );
+ table()->item( r, COL_SHAPE )->setText( shapeText );
table()->item( r, COL_PUBLISHED )->setText( entry.in() );
}
break;
if ( !so->_is_nil() ) {
CORBA::String_var name = so->GetName();
CORBA::String_var entry = so->GetID();
- table()->item( row, COL_SHAPE )->setText( name.in() );
+ QString shapeText = QString("%1 (%2)").arg( name.in() ).arg( entry.in() );
+ table()->item( row, COL_SHAPE )->setText( shapeText );
table()->item( row, COL_PUBLISHED )->setText( entry.in() );
}
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// get selected mesh
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
+ mySelectionMgr->selectedObjects(aList);
int nbSel = aList.Extent();
if (nbSel != 1)
return;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
: LightApp_Dialog( parent == 0 ? desktop() : parent, "", modal, allowResize, flags )
{
int pr = prefix( "SMESH" );
- typeName( pr + SMESH::MESH ) = tr( "DLG_MESH" );
+ typeName( pr + SMESH::MESH ) = tr( "DLG_MESH" );
typeName( pr + SMESH::HYPOTHESIS ) = tr( "DLG_HYPO" );
- typeName( pr + SMESH::ALGORITHM ) = tr( "DLG_ALGO" );
+ typeName( pr + SMESH::ALGORITHM ) = tr( "DLG_ALGO" );
+ typeName( prefix( "GEOM" ) ) = tr( "DLG_GEOM" );
setButtonText(1, tr("SMESH_BUT_APPLY_AND_CLOSE")); //rename OK to Apply and Close
if ( flags & Close )
setButtonPosition( Right, Close );
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
QPixmap iconWithoutElem (aResMgr->loadPixmap("SMESH", tr("ICON_SMESH_DUPLICATE_NODES")));
QPixmap iconWithElem (aResMgr->loadPixmap("SMESH", tr("ICON_SMESH_DUPLICATE_NODES_WITH_ELEM")));
QPixmap iconElemOnly (aResMgr->loadPixmap("SMESH", tr("ICON_SMESH_DUPLICATE_ELEM_ONLY")));
+ QPixmap iconGrpBoundary (aResMgr->loadPixmap("SMESH", tr("ICON_SMESH_DUPLICATE_GROUP_BOUNDARY")));
QPixmap iconSelect (aResMgr->loadPixmap("SMESH", tr("ICON_SELECT")));
// Main layout
aRadioButton2->setIcon(iconWithElem);
QRadioButton* aRadioButton3 = new QRadioButton(aConstructorsBox);
aRadioButton3->setIcon(iconElemOnly);
+ QRadioButton* aRadioButton4 = new QRadioButton(aConstructorsBox);
+ aRadioButton4->setIcon(iconGrpBoundary);
aConstructorsBoxLayout->addWidget(aRadioButton1);
aConstructorsBoxLayout->addWidget(aRadioButton2);
aConstructorsBoxLayout->addWidget(aRadioButton3);
+ aConstructorsBoxLayout->addWidget(aRadioButton4);
myGroupConstructors->addButton(aRadioButton1, 0);
myGroupConstructors->addButton(aRadioButton2, 1);
myGroupConstructors->addButton(aRadioButton3, 2);
+ myGroupConstructors->addButton(aRadioButton4, 3);
// Arguments
myGroupArguments = new QGroupBox(this);
myLineEdit3 = new QLineEdit(myGroupArguments);
myLineEdit3->setReadOnly(true);
- myCheckBoxNewElemGroup = new QCheckBox(tr("CONSTRUCT_NEW_GROUP_ELEMENTS"), myGroupArguments);
- myCheckBoxNewNodeGroup = new QCheckBox(tr("CONSTRUCT_NEW_GROUP_NODES"), myGroupArguments);
+ myCheckBox1 = new QCheckBox(tr("CONSTRUCT_NEW_GROUP_ELEMENTS"), myGroupArguments);
+ myCheckBox2 = new QCheckBox(tr("CONSTRUCT_NEW_GROUP_NODES"), myGroupArguments);
aGroupArgumentsLayout->addWidget(myTextLabel1, 0, 0);
aGroupArgumentsLayout->addWidget(mySelectButton1, 0, 1);
aGroupArgumentsLayout->addWidget(myTextLabel3, 2, 0);
aGroupArgumentsLayout->addWidget(mySelectButton3, 2, 1);
aGroupArgumentsLayout->addWidget(myLineEdit3, 2, 2);
- aGroupArgumentsLayout->addWidget(myCheckBoxNewElemGroup, 3, 0);
- aGroupArgumentsLayout->addWidget(myCheckBoxNewNodeGroup, 4, 0);
+ aGroupArgumentsLayout->addWidget(myCheckBox1, 3, 0);
+ aGroupArgumentsLayout->addWidget(myCheckBox2, 4, 0);
aGroupArgumentsLayout->setRowStretch(5, 1);
// Buttons
aMainLayout->addWidget(myGroupArguments);
aMainLayout->addWidget(aGroupButtons);
- myCheckBoxNewElemGroup->setChecked(true);
- myCheckBoxNewNodeGroup->setChecked(true);
+ myCheckBox1->setChecked(true);
+ myCheckBox2->setChecked(true);
// Initialize the dialog
Init();
connect(mySelectButton2, SIGNAL (clicked()), this, SLOT(onEditCurrentArgument()));
connect(mySelectButton3, SIGNAL (clicked()), this, SLOT(onEditCurrentArgument()));
+ connect(myCheckBox2, SIGNAL(stateChanged(int)), SLOT(updateButtons()));
+
connect(myButtonOk, SIGNAL(clicked()), this, SLOT(onOk()));
connect(myButtonClose, SIGNAL(clicked()), this, SLOT(reject()));
connect(myButtonApply, SIGNAL(clicked()), this, SLOT(onApply()));
myTextLabel1->setText(tr("GROUP_NODES_TO_DUPLICATE"));
myTextLabel2->setText(tr("GROUP_NODES_TO_REPLACE"));
- myCheckBoxNewElemGroup->hide();
- myCheckBoxNewNodeGroup->show();
+ myCheckBox1->hide();
+ myCheckBox2->show();
+ myCheckBox2->setText( tr("CONSTRUCT_NEW_GROUP_NODES"));
// Hide the third field
myTextLabel2->show();
myTextLabel2->setText(tr("GROUP_NODES_NOT_DUPLICATE"));
myTextLabel3->setText(tr("GROUP_ELEMS_TO_REPLACE"));
- myCheckBoxNewElemGroup->show();
- myCheckBoxNewNodeGroup->show();
+ myCheckBox1->show();
+ myCheckBox2->show();
+ myCheckBox1->setText( tr("CONSTRUCT_NEW_GROUP_ELEMENTS"));
+ myCheckBox2->setText( tr("CONSTRUCT_NEW_GROUP_NODES"));
// Show the third field
myTextLabel2->show();
myGroupArguments->setTitle(tr("DUPLICATION_ONLY_ELEMS"));
myTextLabel1->setText(tr("GROUP_ELEMS_TO_DUPLICATE"));
- myCheckBoxNewElemGroup->show();
- myCheckBoxNewNodeGroup->hide();
+ myCheckBox1->show();
+ myCheckBox1->setText( tr("CONSTRUCT_NEW_GROUP_ELEMENTS"));
+ myCheckBox2->hide();
+
+ // Hide the second and the third field
+ myTextLabel2->hide();
+ mySelectButton2->hide();
+ myLineEdit2->hide();
+ myTextLabel3->hide();
+ mySelectButton3->hide();
+ myLineEdit3->hide();
+
+ break;
+ }
+ case 3:
+ {
+ // Set text to the group of arguments and to all the labels
+ myGroupArguments->setTitle(tr("DUPLICATION_GROUP_BOUNDARY"));
+ myTextLabel1->setText(tr("GROUP_VOLUME_GROUPS"));
+
+ myCheckBox1->show();
+ myCheckBox2->show();
+ myCheckBox1->setText( tr("CREATE_JOINT_ELEMENTS"));
+ myCheckBox2->setText( tr("ON_ALL_BOUNDARIES"));
// Hide the second and the third field
myTextLabel2->hide();
break;
}
}
-
+ myGroupArguments->hide();
+ myGroupArguments->show();
+ this->resize(this->sizeHint().width(), this->minimumSizeHint().height());
// Process selection
onSelectionChanged();
}
BusyLocker lock( myBusy );
- bool toCreateElemGroup = myCheckBoxNewElemGroup->isChecked();
- bool toCreateNodeGroup = myCheckBoxNewNodeGroup->isChecked();
+ bool toCreateElemGroup = myCheckBox1->isChecked();
+ bool toCreateNodeGroup = myCheckBox2->isChecked();
int operationMode = myGroupConstructors->checkedId();
// Apply changes
}
break;
}
+ case 3:
+ {
+ bool createJointElems = myCheckBox1->isChecked();
+ bool onAllBoundaries = myCheckBox2->isChecked();
+
+ SMESH::ListOfGroups_var g1 = new SMESH::ListOfGroups();
+ g1->length( myGroups1.count() );
+ for ( int i = 0; i < myGroups1.count(); i++ )
+ g1[i] = myGroups1[i];
+
+ result = aMeshEditor->DoubleNodesOnGroupBoundaries( g1.in(), createJointElems, onAllBoundaries );
+
+ break;
}
+ } // switch( operationMode )
}
catch (const SALOME::SALOME_Exception& S_ex) {
SalomeApp_Tools::QtCatchCorbaException(S_ex);
}
catch ( const std::exception& exc ) {
INFOS( "Follow exception was cought:\n\t" << exc.what() );
- }
+ }
catch (...) {
INFOS( "Unknown exception was cought !!!" );
}
case 2:
ok = ( aGroupType != SMESH::NODE );
break;
+ case 3:
+ ok = ( aGroupType == SMESH::VOLUME );
+ break;
}
}
if ( ok ) aGroups << aGroup;
else if ( myCurrentLineEdit == myLineEdit3 ) myGroups3.clear();
myCurrentLineEdit->clear();
}
-
// Enable/disable "Apply and Close" and "Apply" buttons
+ updateButtons();
+}
+
+/*!
+ * \brief Enable/disable "Apply and Close" and "Apply" buttons
+ */
+void SMESHGUI_DuplicateNodesDlg::updateButtons()
+{
bool isDataValid = isValid();
myButtonOk->setEnabled( isDataValid );
myButtonApply->setEnabled( isDataValid );
*/
bool SMESHGUI_DuplicateNodesDlg::isValid()
{
- return myGroupConstructors->checkedId() == 1 ?
- ( !myGroups1.isEmpty() && !myGroups3.isEmpty() ) :
- ( !myGroups1.isEmpty() );
+ switch( myGroupConstructors->checkedId() )
+ {
+ case 1: return ( !myGroups1.isEmpty() && !myGroups3.isEmpty() );
+ case 3: return ( myGroups1.count() > ( myCheckBox2->isChecked() ? 0 : 1 ));
+ default: return !myGroups1.isEmpty();
+ }
+ return false;
}
-
/*!
\brief SLOT called when dialog shoud be deativated.
*/
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
void onDeactivate();
+ void updateButtons();
+
private:
QLineEdit* myCurrentLineEdit;
QLineEdit* myLineEdit1;
QLineEdit* myLineEdit2;
QLineEdit* myLineEdit3;
- QCheckBox* myCheckBoxNewElemGroup;
- QCheckBox* myCheckBoxNewNodeGroup;
+ QCheckBox* myCheckBox1;
+ QCheckBox* myCheckBox2;
QPushButton* myButtonOk;
QPushButton* myButtonApply;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
if (CheckBoxMesh->isChecked())
onSelectMesh(true);
+ myEditCurrentArgument->hide();
+ myEditCurrentArgument->show();
+
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
}
}
// get selected mesh
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type());
+ mySelectionMgr->selectedObjects(aList);
int nbSel = SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
if (nbSel != 1)
return;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// 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_FieldSelectorWdg.h"
+
+#include "SMESHGUI_Utils.h"
+#include "SMESHGUI_GEOMGenUtils.h"
+
+#include <SALOMEDSClient_Study.hxx>
+#include <GEOM_wrap.hxx>
+
+#include <QGroupBox>
+#include <QTreeWidget>
+#include <QTreeWidgetItem>
+#include <QTreeWidgetItemIterator>
+#include <QVBoxLayout>
+#include <QLabel>
+#include "SMESHGUI.h"
+
+namespace
+{
+ QTreeWidgetItem* createItem( QTreeWidget* tree,
+ const QString& text,
+ const int index,
+ QTreeWidgetItem* parentItem=0)
+ {
+ QTreeWidgetItem* item;
+ if ( parentItem )
+ item = new QTreeWidgetItem( parentItem );
+ else
+ item = new QTreeWidgetItem( tree );
+ item->setText( 0, text );
+ item->setData( 0, Qt::UserRole, index );
+ item->setFlags( item->flags() | Qt::ItemIsUserCheckable | Qt::ItemIsEditable );
+ item->setCheckState( 0, Qt::Unchecked );
+ item->setExpanded( true );
+ if ( index < 0 )
+ {
+ QFont f = item->font( 0 );
+ f.setItalic( true );
+ item->setFont( 0, f );
+ }
+ return item;
+ }
+}
+
+//--------------------------------------------------------------------------------
+/*!
+ * \brief Constructor of SMESHGUI_FieldSelectorWdg
+ */
+SMESHGUI_FieldSelectorWdg::SMESHGUI_FieldSelectorWdg( QWidget* p )
+ :QGroupBox( tr("FIELDS_TO_EXPORT"), p )
+{
+ setCheckable( true );
+ myTree = new QTreeWidget( this );
+ myTree->setHeaderHidden( true );
+
+ QVBoxLayout* lay = new QVBoxLayout( this );
+ lay->addWidget( myTree );
+
+ connect( myTree, SIGNAL( itemChanged(QTreeWidgetItem*, int)),
+ this, SLOT ( onItemCheck(QTreeWidgetItem*, int)));
+}
+
+//--------------------------------------------------------------------------------
+/*!
+ * \brief Retrieves all fields defined on geometry of given meshes
+ */
+bool SMESHGUI_FieldSelectorWdg::
+GetAllFeilds(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
+ QList< QPair< GEOM::ListOfFields_var, QString > >& fields)
+{
+ myFields = & fields;
+ myTree->clear();
+
+ _PTR(Study) study = SMESH::GetActiveStudyDocument();
+ GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
+ GEOM::GEOM_IFieldOperations_wrap fieldOp = geomGen->GetIFieldOperations( study->StudyId() );
+
+ for ( int iM = 0; iM < meshes.count(); ++iM )
+ {
+ GEOM::ListOfFields_var fields;
+ QString geoAss;
+
+ SMESH::SMESH_Mesh_var mesh = meshes[iM].first->GetMesh();
+ if ( !mesh->_is_nil() && mesh->HasShapeToMesh() )
+ {
+ SMESH::array_of_ElementType_var elemTypes = meshes[iM].first->GetTypes();
+ if ( &elemTypes.in() && elemTypes->length() > 0 )
+ {
+ QTreeWidgetItem* meshItem = createItem( myTree, meshes[iM].second, iM );
+
+ GEOM::GEOM_Object_var shape = mesh->GetShapeToMesh();
+ fields = fieldOp->GetFields( shape );
+ for ( size_t iF = 0; iF < fields->length(); ++iF )
+ {
+ GEOM::field_data_type dataType = fields[ iF ]->GetDataType();
+ if ( dataType == GEOM::FDT_String )
+ continue;
+ GEOM::ListOfLong_var stepIDs = fields[ iF ]->GetSteps();
+ if ( stepIDs->length() < 1 )
+ continue;
+ GEOM::string_array_var comps = fields[ iF ]->GetComponents();
+ if ( comps->length() < 1 )
+ continue;
+ CORBA::Short dim = fields[iF]->GetDimension();
+ if ( dim < 0 )
+ continue; // "whole shape" field ignored
+
+ CORBA::String_var name = fields[iF]->GetName();
+ createItem( myTree, name.in(), iF, meshItem );
+ }
+ QString geoAss;
+ for ( size_t i = 0; i < elemTypes->length(); ++i )
+ {
+ QString name;
+ switch ( elemTypes[i] ) {
+ case SMESH::NODE: name = "_vertices_"; break;
+ case SMESH::EDGE: name = "_edges_" ; break;
+ case SMESH::FACE: name = "_faces_" ; break;
+ case SMESH::VOLUME: name = "_solids_" ; break;
+ default: continue;
+ }
+ geoAss += name[1];
+ createItem( myTree, name, -1, meshItem );
+ }
+ if ( !geoAss.isEmpty() && !geoAss.count('v') )
+ {
+ createItem( myTree, "_vertices_", -1, meshItem );
+ }
+ }
+ } // if ( mesh->HasShapeToMesh() )
+
+ if ( ! &fields.in() )
+ fields = new GEOM::ListOfFields();
+
+ myFields->push_back( qMakePair( fields, QString() ));
+
+ } // loop on meshes
+
+ setChecked( false );
+
+ return myTree->topLevelItemCount();
+}
+
+//--------------------------------------------------------------------------------
+/*!
+ * \brief Filter off not selected fields from myFields
+ */
+bool SMESHGUI_FieldSelectorWdg::GetSelectedFeilds()
+{
+ int nbSelected = 0;
+ if ( myTree->isEnabled() )
+ for ( size_t i = 0; i < myTree->topLevelItemCount(); ++i )
+ {
+ QTreeWidgetItem* meshItem = myTree->topLevelItem( i );
+ int iM = meshItem->data( 0, Qt::UserRole ).toInt();
+
+ GEOM::ListOfFields& fields = (*myFields)[ iM ].first.inout();
+ QString& geoAss = (*myFields)[ iM ].second;
+
+ int nbF = 0;
+ QTreeWidgetItemIterator it ( meshItem, QTreeWidgetItemIterator::Checked );
+ if ( *it == meshItem ) ++it;
+ for ( ; *it ; ++it, ++nbSelected )
+ {
+ if ( !(*it)->parent() )
+ break; // next mesh item
+
+ int iF = (*it)->data( 0, Qt::UserRole ).toInt();
+ if ( iF < 0 )
+ {
+ geoAss += (*it)->text(0)[1];
+ }
+ else
+ {
+ if ( nbF != iF )
+ fields[ nbF ] = fields[ iF ];
+ ++nbF;
+ }
+ }
+ fields.length( nbF );
+ }
+ else
+ {
+ for ( size_t iF = 0; iF < myFields->count(); ++iF )
+ {
+ GEOM::ListOfFields& fields = (*myFields)[ iF ].first.inout();
+ fields.length( 0 );
+ }
+ }
+ return nbSelected;
+}
+
+//--------------------------------------------------------------------------------
+/*!
+ * \brief SLOT called when a tree item is checked
+ */
+void SMESHGUI_FieldSelectorWdg::onItemCheck(QTreeWidgetItem * item, int column)
+{
+ myTree->blockSignals( true );
+ if ( !item->parent() ) // mesh item
+ {
+ Qt::CheckState st = item->checkState(0);
+ QTreeWidgetItemIterator it( item );
+ for ( ++it; *it ; ++it )
+ if ( !(*it)->parent() )
+ break; // next mesh item
+ else
+ (*it)->setCheckState( 0, st );
+ }
+ else // field item
+ {
+ // update CheckState of a parent mesh item
+ QTreeWidgetItem* meshItem = item->parent();
+ Qt::CheckState st = item->checkState(0);
+ QTreeWidgetItemIterator it( meshItem );
+ for ( ++it; *it ; ++it )
+ if ( !(*it)->parent() )
+ {
+ break; // next mesh item
+ }
+ else if ( (*it)->checkState(0) != st )
+ {
+ st = Qt::PartiallyChecked;
+ break;
+ }
+ meshItem->setCheckState( 0, st );
+ }
+ myTree->blockSignals( false );
+}
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// 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 STDMESHERSGUI_FieldSelectorWdg_H
+#define STDMESHERSGUI_FieldSelectorWdg_H
+
+#include "SMESH_SMESHGUI.hxx"
+
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SMESH_Mesh)
+#include CORBA_CLIENT_HEADER(GEOM_Gen)
+
+#include <QGroupBox>
+
+class QTreeWidget;
+class QTreeWidgetItem;
+
+/*!
+ * \brief Widget listing all fields available for export to MED file
+ */
+class SMESHGUI_EXPORT SMESHGUI_FieldSelectorWdg : public QGroupBox
+{
+ Q_OBJECT
+
+ public:
+ SMESHGUI_FieldSelectorWdg( QWidget* = 0 );
+
+ bool GetAllFeilds(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
+ QList< QPair< GEOM::ListOfFields_var, QString > >& fields);
+
+ bool GetSelectedFeilds();
+
+ private slots:
+
+ void onItemCheck(QTreeWidgetItem * item, int column);
+
+ private:
+
+ QList< QPair< GEOM::ListOfFields_var, QString > > * myFields;
+ QTreeWidget* myTree;
+};
+
+#endif // STDMESHERSGUI_FieldSelectorWdg_H
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
IMPLEMENT_STANDARD_HANDLE(SMESHGUI_VolumesFilter, SMESHGUI_Filter)
IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_VolumesFilter, SMESHGUI_Filter)
+IMPLEMENT_STANDARD_HANDLE(SMESHGUI_VolumeShapeFilter, SMESHGUI_Filter)
+IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_VolumeShapeFilter, SMESHGUI_Filter)
+
/*
Class : SMESHGUI_PredicateFilter
Description : Selection filter for VTK viewer. This class aggregate object
{
return false;
}
+
+
+/*
+ Class : SMESHGUI_VolumeShapeFilter
+ Description : Verify whether selected cell is a volume of a certain shape
+*/
+
+
+//=======================================================================
+// name : SMESHGUI_VolumeShapeFilter::SMESHGUI_VolumeShapeFilter
+// Purpose : Constructor
+//=======================================================================
+SMESHGUI_VolumeShapeFilter::SMESHGUI_VolumeShapeFilter(const SMDSAbs_GeometryType shape)
+ : SMESHGUI_Filter(), myGeometryType( shape )
+{
+}
+
+//=======================================================================
+// name : SMESHGUI_VolumeShapeFilter::IsValid
+// Purpose : Verify whether selected cell is a volume of a certain shape
+//=======================================================================
+bool SMESHGUI_VolumeShapeFilter::IsValid( const int theCellId ) const
+{
+ if ( myActor == 0 || theCellId < 1 )
+ return false;
+
+ SMESH_Actor* anActor = dynamic_cast< SMESH_Actor* >( myActor );
+ if ( !anActor || anActor->GetObject() == 0 )
+ return false;
+
+ SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh();
+ const SMDS_MeshElement* anElem = aMesh->FindElement( anActor->GetElemObjId( theCellId ) );
+
+ return anElem && anElem->GetGeomType() == myGeometryType;
+}
+
+//=======================================================================
+// name : SMESHGUI_VolumeShapeFilter::IsValid
+// Purpose : Verify whether selected cell is volume
+//=======================================================================
+bool SMESHGUI_VolumeShapeFilter::IsObjValid( const int theObjId ) const
+{
+ if ( myActor == 0 )
+ return false;
+
+ SMESH_Actor* anActor = dynamic_cast< SMESH_Actor* >( myActor );
+ if ( !anActor || anActor->GetObject() == 0 )
+ return false;
+
+ SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh();
+ const SMDS_MeshElement* anElem = aMesh->FindElement( theObjId );
+
+ return anElem && anElem->GetGeomType() == myGeometryType;
+}
+
+//=======================================================================
+// name : SMESHGUI_VolumeShapeFilter::GetId
+// Purpose : Get ID of the filter. Must return value from SMESHGUI_FilterType
+// enumeration. All filters must have different ids
+//=======================================================================
+int SMESHGUI_VolumeShapeFilter::GetId() const
+{
+ return GetId( myGeometryType );
+}
+
+//=======================================================================
+//function : GetId
+//purpose : Compose filter ID basing on
+//=======================================================================
+
+int SMESHGUI_VolumeShapeFilter::GetId( SMDSAbs_GeometryType shape )
+{
+ return SMESH::FirstGeometryTypeFilter + shape;
+}
+
+//=======================================================================
+// name : SMESHGUI_VolumeShapeFilter::IsNodeFilter
+// Purpose : Returns true if filter is intended for nodes
+//=======================================================================
+bool SMESHGUI_VolumeShapeFilter::IsNodeFilter() const
+{
+ return false;
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// SMESH includes
#include "SMESH_SMESHGUI.hxx"
+#include "SMDSAbs_ElementType.hxx"
// SALOME GUI includes
#include <VTKViewer_Filter.h>
namespace SMESH
{
enum SMESHGUI_FilterType {
- UnknownFilter = -1,
- NodeFilter = 0,
- EdgeFilter = 1,
- FaceFilter = 2,
- VolumeFilter = 3,
- AllElementsFilter = 4,
- QuadFilter = 5,
- TriaFilter = 6,
- LastFilter
+ UnknownFilter = -1,
+ NodeFilter = 0,
+ EdgeFilter = 1,
+ FaceFilter = 2,
+ VolumeFilter = 3,
+ AllElementsFilter = 4,
+ QuadFilter = 5,
+ TriaFilter = 6,
+ FirstGeometryTypeFilter,
+ FirstEntityTypeFilter = FirstGeometryTypeFilter + SMDSGeom_NONE,
+ LastFilter = FirstEntityTypeFilter + SMDSEntity_Last
};
};
Standard_EXPORT virtual bool IsValid( const int ) const;
Standard_EXPORT virtual bool IsObjValid( const int ) const;
Standard_EXPORT virtual int GetId() const;
- Standard_EXPORT virtual bool IsNodeFilter() const;
+ Standard_EXPORT virtual bool IsNodeFilter() const;
public:
DEFINE_STANDARD_RTTI(SMESHGUI_VolumesFilter)
};
+/*
+ Class : SMESHGUI_VolumeShapeFilter
+ Description : Verify whether selected cell is a volume of a certain shape
+*/
+
+DEFINE_STANDARD_HANDLE(SMESHGUI_VolumeShapeFilter, SMESHGUI_Filter)
+
+class SMESHGUI_VolumeShapeFilter : public SMESHGUI_Filter
+{
+ SMDSAbs_GeometryType myGeometryType;
+public:
+ Standard_EXPORT SMESHGUI_VolumeShapeFilter(const SMDSAbs_GeometryType shape);
+
+ Standard_EXPORT virtual bool IsValid( const int ) const;
+ Standard_EXPORT virtual bool IsObjValid( const int ) const;
+ Standard_EXPORT virtual int GetId() const;
+ Standard_EXPORT virtual bool IsNodeFilter() const;
+
+ Standard_EXPORT static int GetId( SMDSAbs_GeometryType geom );
+
+public:
+ DEFINE_STANDARD_RTTI(SMESHGUI_VolumeShapeFilter)
+};
+
#endif // SMESHGUI_FILTER_H
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
if (aTable->text(i, 2).isEmpty())
errMsg = tr( "ERROR" );
}
- else
+ else // check correctness of a numeric value
{
bool aRes = false;
bool isSignalsBlocked = aTable->signalsBlocked();
if (!aRes && aTable->isEditable(i, 2))
errMsg = tr( "ERROR" );
- else if (aType == SMESH::EDGE &&
- GetCriterionType(i, aType) == SMESH::FT_MultiConnection &&
- aThreshold == 1)
- errMsg = tr( "MULTIEDGES_ERROR" );
}
if (!errMsg.isEmpty()) {
case SMESH::FT_EqualVolumes: break;
case SMESH::FT_MultiConnection:
- case SMESH::FT_MultiConnection2D: anIsIntCriterion = true; break;
+ case SMESH::FT_MultiConnection2D: anIsIntCriterion = true; nbCompareSigns = 3; break;
case SMESH::FT_Length:
case SMESH::FT_Length2D: anIsDoubleCriterion = true; break;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
aHelpFileName = "a1d_meshing_hypo_page.html#max_length_anchor";
else if ( aHypType == "Arithmetic1D")
aHelpFileName = "a1d_meshing_hypo_page.html#arithmetic_1d_anchor";
+ else if ( aHypType == "GeometricProgression")
+ aHelpFileName = "a1d_meshing_hypo_page.html#geometric_1d_anchor";
else if ( aHypType == "FixedPoints1D")
aHelpFileName = "a1d_meshing_hypo_page.html#fixed_points_1d_anchor";
else if ( aHypType == "MaxElementArea")
const QString& theClientLibName,
const QString& theLabel,
const QString& theIconId,
+ const QString& theContext,
const QList<int>& theDim,
- const bool theIsAux,
- const QStringList& theNeededHypos,
+ const bool theIsAuxOrNeedHyp,
+ const QStringList& theBasicHypos,
const QStringList& theOptionalHypos,
const QStringList& theInputTypes,
const QStringList& theOutputTypes,
ClientLibName( theClientLibName ),
Label( theLabel ),
IconId( theIconId ),
+ Context( theContext ),
Dim( theDim ),
- IsAux( theIsAux ),
- NeededHypos( theNeededHypos ),
+ IsAuxOrNeedHyp( theIsAuxOrNeedHyp ),
+ BasicHypos( theBasicHypos ),
OptionalHypos( theOptionalHypos ),
InputTypes( theInputTypes ),
OutputTypes( theOutputTypes ),
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
public:
HypothesisData( const QString&, const QString&, const QString&,
const QString&, const QString&, const QString&,
- const QList<int>&, const bool,
+ const QString&, const QList<int>&, const bool,
const QStringList&, const QStringList&,
const QStringList&, const QStringList&,
const bool=true, const bool supportSub=false );
QString ClientLibName; //!< client library name
QString Label; //!< label
QString IconId; //!< icon identifier
+ QString Context; //!< ["GLOBAL","LOCAL","ANY"(default)]
QList<int> Dim; //!< list of supported dimensions (see SMESH::Dimension enumeration)
- bool IsAux; //!< TRUE if given hypothesis is auxiliary one, FALSE otherwise
+ bool IsAuxOrNeedHyp; //!< TRUE if given hypothesis is auxiliary one, FALSE otherwise
+ //!< TRUE if given algorithm can't work w/o hypotheses
bool IsNeedGeometry; //!< TRUE if the algorithm works with shapes only, FALSE otherwise
bool IsSupportSubmeshes; //!< TRUE if the algo building all-dim elems supports submeshes
// for algorithm only: dependencies algo <-> algo and algo -> hypos
- QStringList NeededHypos; //!< list of obligatory hypotheses
+ QStringList BasicHypos; //!< list of basic 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
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
typedef IMap<QString,HypothesisData*> THypothesisDataMap;
THypothesisDataMap myHypothesesMap;
THypothesisDataMap myAlgorithmsMap;
-
+
// BUG 0020378
//typedef QMap<QString,SMESHGUI_GenericHypothesisCreator*> THypCreatorMap;
//THypCreatorMap myHypCreatorMap;
if (ok) {
THypothesisDataMap::ConstIterator it1 = aXmlHandler->myHypothesesMap.begin();
-
+
for( ;it1 != aXmlHandler->myHypothesesMap.end(); it1++)
myHypothesesMap.insert( it1.key(), it1.value() );
-
+
it1 = aXmlHandler->myAlgorithmsMap.begin();
for( ;it1 != aXmlHandler->myAlgorithmsMap.end(); it1++)
myAlgorithmsMap.insert( it1.key(), it1.value() );
-
+
QList<HypothesesSet*>::iterator it;
- for ( it = aXmlHandler->myListOfHypothesesSets.begin();
+ for ( it = aXmlHandler->myListOfHypothesesSets.begin();
it != aXmlHandler->myListOfHypothesesSets.end();
++it )
{
}
- QStringList GetAvailableHypotheses( const bool isAlgo,
- const int theDim,
+ QStringList GetAvailableHypotheses( const bool isAlgo,
+ const int theDim,
const bool isAux,
- const bool isNeedGeometry)
+ const bool isNeedGeometry,
+ const bool isSubMesh)
{
QStringList aHypList;
// Init list of available hypotheses, if needed
InitAvailableHypotheses();
bool checkGeometry = ( !isNeedGeometry && isAlgo );
+ const char* context = isSubMesh ? "LOCAL" : "GLOBAL";
// fill list of hypotheses/algorithms
THypothesisDataMap& pMap = isAlgo ? myAlgorithmsMap : myHypothesesMap;
THypothesisDataMap::ConstIterator anIter;
- for ( anIter = pMap.begin(); anIter != pMap.end(); anIter++ ) {
+ for ( anIter = pMap.begin(); anIter != pMap.end(); anIter++ )
+ {
HypothesisData* aData = anIter.value();
- if(!aData || aData->Label.isEmpty()) continue;
- if ( ( theDim < 0 || aData->Dim.contains( theDim ) ) && aData->IsAux == isAux) {
- if (checkGeometry) {
- if (aData->IsNeedGeometry == isNeedGeometry)
- aHypList.append(anIter.key());
- }
- else {
- aHypList.append(anIter.key());
- }
+ if (( aData && !aData->Label.isEmpty() ) &&
+ ( theDim < 0 || aData->Dim.contains( theDim )) &&
+ ( isAlgo || aData->IsAuxOrNeedHyp == isAux ) &&
+ ( aData->Context == "ANY" || aData->Context == context ) &&
+ ( !checkGeometry || aData->IsNeedGeometry == isNeedGeometry ))
+ {
+ aHypList.append(anIter.key());
}
}
return aHypList;
// Init list of available hypotheses, if needed
InitAvailableHypotheses();
-
QList<HypothesesSet*>::iterator hypoSet;
- for ( hypoSet = myListOfHypothesesSets.begin();
- hypoSet != myListOfHypothesesSets.end();
- ++hypoSet ) {
+ for ( hypoSet = myListOfHypothesesSets.begin();
+ hypoSet != myListOfHypothesesSets.end();
+ ++hypoSet ) {
HypothesesSet* aSet = *hypoSet;
- if ( aSet &&
- ( aSet->count( true ) || aSet->count( false )) &&
- aSet->maxDim() <= maxDim)
+ if ( aSet && ( aSet->count( true ) || aSet->count( false )) &&
+ aSet->maxDim() <= maxDim)
{
aSetNameList.append( mangledHypoSetName( aSet ));
}
QStringList reversedNames;
for ( int i = 0; i < aSetNameList.count(); ++i )
reversedNames.prepend( aSetNameList[i] );
-
+
return reversedNames;
}
{
QString name = demangledHypoSetName( theSetName );
QList<HypothesesSet*>::iterator hypoSet;
- for ( hypoSet = myListOfHypothesesSets.begin();
+ for ( hypoSet = myListOfHypothesesSets.begin();
hypoSet != myListOfHypothesesSets.end();
++hypoSet ) {
HypothesesSet* aSet = *hypoSet;
isAuxiliary = false;
if ( !algoData )
return false;
- if ( algoData->NeededHypos.contains( hypType ))
+ if ( algoData->BasicHypos.contains( hypType ))
return true;
if ( algoData->OptionalHypos.contains( hypType)) {
isAuxiliary = true;
// 2. Get names of plugin libraries
HypothesisData* aHypData = GetHypothesisData(aHypType);
- if (!aHypData)
+ if (!aHypData)
return aCreator;
QString aClientLibName = aHypData->ClientLibName;
#ifdef WIN32
const char* anError = "Can't load client meshers plugin library";
#else
- const char* anError = dlerror();
+ const char* anError = dlerror();
#endif
INFOS(anError); // always display this kind of error !
}
//rnv : This dynamic property of the QObject stores the name of the plugin.
// It is used to obtain plugin root dir environment variable
- // in the SMESHGUI_HypothesisDlg class. Plugin root dir environment
+ // in the SMESHGUI_HypothesisDlg class. Plugin root dir environment
// variable is used to display documentation.
aCreator->setProperty(PLUGIN_NAME,aHypData->PluginName);
}
const QString& aHypName,
const bool isAlgo)
{
- if(MYDEBUG) MESSAGE("Create " << aHypType.toLatin1().data() <<
+ if(MYDEBUG) MESSAGE("Create " << aHypType.toLatin1().data() <<
" with name " << aHypName.toLatin1().data());
HypothesisData* aHypData = GetHypothesisData(aHypType);
QString aServLib = aHypData->ServerLibName;
return SMESH::SMESH_Hypothesis::_nil();
}
+ bool IsApplicable(const QString& aHypType,
+ GEOM::GEOM_Object_ptr theGeomObject,
+ const bool toCheckAll)
+ {
+ HypothesisData* aHypData = GetHypothesisData(aHypType);
+ QString aServLib = aHypData->ServerLibName;
+ return SMESHGUI::GetSMESHGen()->IsApplicable( aHypType.toLatin1().data(),
+ aServLib.toLatin1().data(),
+ theGeomObject,
+ toCheckAll);
+ }
bool AddHypothesisOnMesh (SMESH::SMESH_Mesh_ptr aMesh, SMESH::SMESH_Hypothesis_ptr aHyp)
if (!aSubMesh->_is_nil())
aMesh = aSubMesh->GetFather();
- if (!aMesh->_is_nil()) {
+ if (!aMesh->_is_nil()) {
if (aMesh->HasShapeToMesh() && !aShapeObject->_is_nil()) {
res = aMesh->RemoveHypothesis(aShapeObject, anHyp);
if (res < SMESH::HYP_UNKNOWN_FATAL) {
if (meshSO)
SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
}
-
+
}
else if(!aMesh->HasShapeToMesh()){
res = aMesh->RemoveHypothesis(aShapeObject, anHyp);
if (res < SMESH::HYP_UNKNOWN_FATAL) {
_PTR(SObject) meshSO = SMESH::FindSObject(aMesh);
if (meshSO)
- SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
+ SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
}
}
if (res > SMESH::HYP_OK) {
QString msg;
if ( !hasAlgo )
msg = QObject::tr( "STATE_ALGO_MISSING" );
- else
+ else
switch( error.state ) {
CASE2MESSAGE( HYP_MISSING );
CASE2MESSAGE( HYP_NOTCONFORM );
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
QStringList GetAvailableHypotheses( const bool,
const int = -1,
const bool = false,
- const bool = true);
+ const bool = true,
+ const bool = false);
SMESHGUI_EXPORT
- QStringList GetHypothesesSets( int maxDim );
+ QStringList GetHypothesesSets( int );
SMESHGUI_EXPORT
HypothesesSet* GetHypothesesSet( const QString& );
SMESH::SMESH_Hypothesis_ptr CreateHypothesis( const QString&,
const QString&,
const bool = false );
+ SMESHGUI_EXPORT
+ bool IsApplicable( const QString&,
+ GEOM::GEOM_Object_ptr,
+ const bool = false );
SMESHGUI_EXPORT
bool AddHypothesisOnMesh( SMESH::SMESH_Mesh_ptr, SMESH::SMESH_Hypothesis_ptr );
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <gp_Pnt.hxx>
// Qt includes
+#include <QApplication>
#include <QGroupBox>
#include <QGridLayout>
#include <QHBoxLayout>
QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame());
aDlgLay->setMargin(0);
aDlgLay->setSpacing(SPACING);
+ myMainFrame = createMainFrame(mainFrame());
- QWidget* aMainFrame = createMainFrame (mainFrame());
+ aDlgLay->addWidget(myMainFrame);
- aDlgLay->addWidget(aMainFrame);
-
- aDlgLay->setStretchFactor(aMainFrame, 1);
+ aDlgLay->setStretchFactor(myMainFrame, 1);
}
//=======================================================================
QWidget* aFrame = new QWidget(theParent);
SUIT_ResourceMgr* rm = SMESH::GetResourceMgr( SMESHGUI::GetSMESHGUI() );
- QPixmap iconMoveNode (rm->loadPixmap("SMESH", tr("ICON_DLG_MOVE_NODE")));
- QPixmap iconSelect (rm->loadPixmap("SMESH", tr("ICON_SELECT")));
+ QPixmap iconMoveNode (rm->loadPixmap("SMESH", tr("ICON_DLG_MOVE_NODE")));
+ QPixmap iconMoveWithoutNode (rm->loadPixmap("SMESH", tr("ICON_DLG_MOVE_WITHOUT_NODE")));
+ QPixmap iconSelect (rm->loadPixmap("SMESH", tr("ICON_SELECT")));
// constructor
-
- QGroupBox* aPixGrp = new QGroupBox(tr("MOVE_NODE"), aFrame);
- QButtonGroup* aBtnGrp = new QButtonGroup(this);
+ QGroupBox* aPixGrp = new QGroupBox(tr("MOVE_NODE"), this);
+ aPixGrp->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myButtonGroup = new QButtonGroup(this);
QHBoxLayout* aPixGrpLayout = new QHBoxLayout(aPixGrp);
aPixGrpLayout->setMargin(MARGIN);
aPixGrpLayout->setSpacing(SPACING);
- QRadioButton* aRBut = new QRadioButton(aPixGrp);
- aRBut->setIcon(iconMoveNode);
- aRBut->setChecked(true);
- aPixGrpLayout->addWidget(aRBut);
- aBtnGrp->addButton(aRBut, 0);
-
- // coordinates
-
- QGroupBox* aCoordGrp = new QGroupBox(tr("DESTINATION"), aFrame);
- QHBoxLayout* aCoordGrpLayout = new QHBoxLayout(aCoordGrp);
- aCoordGrpLayout->setMargin(MARGIN);
- aCoordGrpLayout->setSpacing(SPACING);
-
- myCoordBtn = new QPushButton(aCoordGrp);
- myCoordBtn->setIcon(iconSelect);
- myCoordBtn->setCheckable(true);
-
- QLabel* aXLabel = new QLabel(tr("SMESH_X"), aCoordGrp);
- myX = new SMESHGUI_SpinBox(aCoordGrp);
-
- QLabel* aYLabel = new QLabel(tr("SMESH_Y"), aCoordGrp);
- myY = new SMESHGUI_SpinBox(aCoordGrp);
-
- QLabel* aZLabel = new QLabel(tr("SMESH_Z"), aCoordGrp);
- myZ = new SMESHGUI_SpinBox(aCoordGrp);
+ myRButNodeToMove = new QRadioButton(aPixGrp);
+ myRButMoveWithoutNode = new QRadioButton(aPixGrp);
+ myRButNodeToMove->setIcon(iconMoveNode);
+ myRButMoveWithoutNode->setIcon(iconMoveWithoutNode);
+ myRButNodeToMove->setChecked(true);
- myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
- myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
- myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ aPixGrpLayout->addWidget(myRButNodeToMove);
+ aPixGrpLayout->addWidget(myRButMoveWithoutNode);
+ myButtonGroup->addButton(myRButNodeToMove, 0);
+ myButtonGroup->addButton(myRButMoveWithoutNode, 1);
- aCoordGrpLayout->addWidget(myCoordBtn);
- aCoordGrpLayout->addWidget(aXLabel);
- aCoordGrpLayout->addWidget(myX);
- aCoordGrpLayout->addWidget(aYLabel);
- aCoordGrpLayout->addWidget(myY);
- aCoordGrpLayout->addWidget(aZLabel);
- aCoordGrpLayout->addWidget(myZ);
- aCoordGrpLayout->setStretchFactor(myX, 1);
- aCoordGrpLayout->setStretchFactor(myY, 1);
- aCoordGrpLayout->setStretchFactor(myZ, 1);
-
- // node ID
+ // Node to move
myNodeToMoveGrp = new QGroupBox(tr("NODE_2MOVE"), aFrame);
-
+ myNodeToMoveGrp->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
QLabel* idLabel = new QLabel(tr("NODE_2MOVE_ID"), myNodeToMoveGrp);
myIdBtn = new QPushButton(myNodeToMoveGrp);
myIdBtn->setIcon(iconSelect);
myCurrentZ->setButtonSymbols(QAbstractSpinBox::NoButtons);
myCurrentZ->setReadOnly(true);
- QLabel* aDXLabel = new QLabel(tr("SMESH_DX"), aCoordWidget);
- myDX = new SMESHGUI_SpinBox(aCoordWidget);
- myDX->setButtonSymbols(QAbstractSpinBox::NoButtons);
- myDX->setReadOnly(true);
-
- QLabel* aDYLabel = new QLabel(tr("SMESH_DY"), aCoordWidget);
- myDY = new SMESHGUI_SpinBox(aCoordWidget);
- myDY->setButtonSymbols(QAbstractSpinBox::NoButtons);
- myDY->setReadOnly(true);
-
- QLabel* aDZLabel = new QLabel(tr("SMESH_DZ"), aCoordWidget);
- myDZ = new SMESHGUI_SpinBox(aCoordWidget);
- myDZ->setButtonSymbols(QAbstractSpinBox::NoButtons);
- myDZ->setReadOnly(true);
-
myCurrentX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
myCurrentY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
myCurrentZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
- myDX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
- myDY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
- myDZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
QGridLayout* aCoordLayout = new QGridLayout(aCoordWidget);
aCoordLayout->setMargin(0);
aCoordLayout->addWidget(myCurrentY, 0, 3);
aCoordLayout->addWidget(aCurrentZLabel, 0, 4);
aCoordLayout->addWidget(myCurrentZ, 0, 5);
- aCoordLayout->addWidget(aDXLabel, 1, 0);
- aCoordLayout->addWidget(myDX, 1, 1);
- aCoordLayout->addWidget(aDYLabel, 1, 2);
- aCoordLayout->addWidget(myDY, 1, 3);
- aCoordLayout->addWidget(aDZLabel, 1, 4);
- aCoordLayout->addWidget(myDZ, 1, 5);
aCoordLayout->setColumnStretch(1, 1);
aCoordLayout->setColumnStretch(3, 1);
aCoordLayout->setColumnStretch(5, 1);
- myAutoSearchChkBox = new QCheckBox( tr("AUTO_SEARCH"), myNodeToMoveGrp);
- myPreviewChkBox = new QCheckBox( tr("PREVIEW"), myNodeToMoveGrp);
-
QGridLayout* myNodeToMoveGrpLayout = new QGridLayout(myNodeToMoveGrp);
myNodeToMoveGrpLayout->setSpacing(SPACING);
myNodeToMoveGrpLayout->setMargin(MARGIN);
myNodeToMoveGrpLayout->addWidget( myId, 0, 2 );
myNodeToMoveGrpLayout->addWidget( myUpdateBtn, 0, 3 );
myNodeToMoveGrpLayout->addWidget( aCoordWidget, 1, 0, 1, 4 );
- myNodeToMoveGrpLayout->addWidget( myAutoSearchChkBox, 2, 0, 1, 4 );
- myNodeToMoveGrpLayout->addWidget( myPreviewChkBox, 3, 0, 1, 4 );
+
+ // Destination
+
+ myDestinationGrp = new QGroupBox(tr("DESTINATION"), aFrame);
+ myDestinationGrp->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ myDestBtn = new QPushButton(myDestinationGrp);
+ myDestBtn->setIcon(iconSelect);
+ myDestBtn->setCheckable(true);
+
+ QLabel* aDestinationXLabel = new QLabel(tr("SMESH_X"), myDestinationGrp);
+ myDestinationX = new SMESHGUI_SpinBox(myDestinationGrp);
+
+ QLabel* aDestinationYLabel = new QLabel(tr("SMESH_Y"), myDestinationGrp);
+ myDestinationY = new SMESHGUI_SpinBox(myDestinationGrp);
+
+ QLabel* aDestinationZLabel = new QLabel(tr("SMESH_Z"), myDestinationGrp);
+ myDestinationZ = new SMESHGUI_SpinBox(myDestinationGrp);
+
+ myDestDXLabel = new QLabel(tr("SMESH_DX"), myDestinationGrp);
+ myDestDX = new SMESHGUI_SpinBox(myDestinationGrp);
+ myDestDX->setReadOnly(true);
+
+ myDestDYLabel = new QLabel(tr("SMESH_DY"), myDestinationGrp);
+ myDestDY = new SMESHGUI_SpinBox(myDestinationGrp);
+ myDestDY->setReadOnly(true);
+
+ myDestDZLabel = new QLabel(tr("SMESH_DZ"), myDestinationGrp);
+ myDestDZ = new SMESHGUI_SpinBox(myDestinationGrp);
+ myDestDZ->setReadOnly(true);
+
+ myDestinationX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ myDestinationY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ myDestinationZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ myDestDX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ myDestDY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ myDestDZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+
+ QGridLayout* aDestLayout = new QGridLayout(myDestinationGrp);
+ aDestLayout->setMargin(MARGIN);
+ aDestLayout->setSpacing(SPACING);
+ aDestLayout->addWidget(myDestBtn, 0, 0);
+ aDestLayout->addWidget(aDestinationXLabel, 0, 1);
+ aDestLayout->addWidget(myDestinationX, 0, 2);
+ aDestLayout->addWidget(aDestinationYLabel, 0, 3);
+ aDestLayout->addWidget(myDestinationY, 0, 4);
+ aDestLayout->addWidget(aDestinationZLabel, 0, 5);
+ aDestLayout->addWidget(myDestinationZ, 0, 6);
+ aDestLayout->addWidget(myDestDXLabel, 1, 1);
+ aDestLayout->addWidget(myDestDX, 1, 2);
+ aDestLayout->addWidget(myDestDYLabel, 1, 3);
+ aDestLayout->addWidget(myDestDY, 1, 4);
+ aDestLayout->addWidget(myDestDZLabel, 1, 5);
+ aDestLayout->addWidget(myDestDZ, 1, 6);
+ aDestLayout->setColumnStretch(2, 1);
+ aDestLayout->setColumnStretch(4, 1);
+ aDestLayout->setColumnStretch(6, 1);
+
+ // Preview
+
+ myPreviewChkBox = new QCheckBox( tr("PREVIEW"), aFrame);
QVBoxLayout* aLay = new QVBoxLayout(aFrame);
aLay->addWidget(aPixGrp);
- aLay->addWidget(aCoordGrp);
aLay->addWidget(myNodeToMoveGrp);
+ aLay->addWidget(myDestinationGrp);
+ aLay->addWidget(myPreviewChkBox);
- connect(myCoordBtn, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
+ connect(myDestBtn, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
connect(myIdBtn, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
- connect(myAutoSearchChkBox, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
+ connect(myButtonGroup, SIGNAL (buttonClicked(int)), SLOT(ConstructorsClicked(int)));
myIdBtn->setChecked(true);
- myAutoSearchChkBox->setChecked(true);
return aFrame;
}
{
const QObject* aSender = sender();
if ( on ) {
- if ( aSender == myCoordBtn ) // button to set coord by node selection
+ if ( aSender == myDestBtn ) // button to set coord by node selection
{
if ( myIdBtn->isEnabled() )
myIdBtn->setChecked( !on );
}
else if ( aSender == myIdBtn ) // button to select a node to move
{
- myCoordBtn->setChecked( !on );
+ myDestBtn->setChecked( !on );
}
}
- if ( aSender == myAutoSearchChkBox ) // automatic node search
- {
- if ( on ) {
+}
+//================================================================================
+/*!
+ * \brief SLOT called when clicked radio button
+ * \param int - number of the button
+ */
+//================================================================================
+void SMESHGUI_MakeNodeAtPointDlg::ConstructorsClicked (int constructorId)
+{
+ switch (constructorId) {
+ case 0:
+ {
+ myDestDXLabel->show();
+ myDestDYLabel->show();
+ myDestDZLabel->show();
+ myDestDX->show();
+ myDestDY->show();
+ myDestDZ->show();
myCurrentX->SetValue(0);
myCurrentY->SetValue(0);
myCurrentZ->SetValue(0);
- myDX->SetValue(0);
- myDY->SetValue(0);
- myDZ->SetValue(0);
- myId->setText("");
- myId->setReadOnly ( true );
- myIdBtn->setChecked( false );
- myIdBtn->setEnabled( false );
- myCoordBtn->setChecked( true );
- myUpdateBtn->setEnabled( false );
+ if (!myNodeToMoveGrp->isVisible()) myNodeToMoveGrp->show();
+ break;
}
- else {
- myId->setReadOnly ( false );
- myIdBtn->setEnabled( true );
- myUpdateBtn->setEnabled( true );
+ case 1:
+ {
+ myId->setText("");
+ myCurrentX->SetValue(0);
+ myCurrentY->SetValue(0);
+ myCurrentZ->SetValue(0);
+ myDestDXLabel->hide();
+ myDestDYLabel->hide();
+ myDestDZLabel->hide();
+ myDestDX->hide();
+ myDestDY->hide();
+ myDestDZ->hide();
+ if (myNodeToMoveGrp->isVisible()) {myNodeToMoveGrp->hide();}
+ break;
}
}
+ QApplication::instance()->processEvents();
+ myMainFrame->hide();
+ myMainFrame->show();
+ updateGeometry();
+ resize(minimumSizeHint());
}
//================================================================================
myNoPreview = false;
myUpdateDestination = false;
+ myDestCoordChanged = true;
// connect signals and slots
- connect(myDlg->myX, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview()));
- connect(myDlg->myY, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview()));
- connect(myDlg->myZ, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview()));
+ connect(myDlg->myDestinationX, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview()));
+ connect(myDlg->myDestinationY, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview()));
+ connect(myDlg->myDestinationZ, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview()));
+ connect(myDlg->myDestDX, SIGNAL (valueChanged(double)), this, SLOT(onDestCoordChanged()));
+ connect(myDlg->myDestDY, SIGNAL (valueChanged(double)), this, SLOT(onDestCoordChanged()));
+ connect(myDlg->myDestDZ, SIGNAL (valueChanged(double)), this, SLOT(onDestCoordChanged()));
connect(myDlg->myId,SIGNAL (textChanged(const QString&)),SLOT(redisplayPreview()));
connect(myDlg->myPreviewChkBox, SIGNAL (toggled(bool)),SLOT(redisplayPreview()));
- connect(myDlg->myAutoSearchChkBox,SIGNAL (toggled(bool)),SLOT(redisplayPreview()));
// IPAL22913: TC6.5.0: selected in "Move node" dialog box node is not highlighted
// note: this slot seems to be lost together with removed obsolete SMESHGUI_MoveNodesDlg class
myUpdateDestination = false;
}
+void SMESHGUI_MakeNodeAtPointOp::onDestCoordChanged()
+{
+ myDestCoordChanged = false;
+ redisplayPreview();
+ myDestCoordChanged = true;
+}
+
//=======================================================================
// function : startOperation()
// purpose : Init dialog fields, connect signals and slots, show dialog
// IPAL19360
SMESHGUI_SelectionOp::startOperation(); // this method should be called only after filter creation
//activateSelection(); // set filters // called inside of previous statement
-
- myDlg->myX->SetValue(0);
- myDlg->myY->SetValue(0);
- myDlg->myZ->SetValue(0);
+ myDlg->myId->setText("");
+ myDlg->myDestinationX->SetValue(0);
+ myDlg->myDestinationY->SetValue(0);
+ myDlg->myDestinationZ->SetValue(0);
+ myDlg->myDestDX->SetValue(0);
+ myDlg->myDestDY->SetValue(0);
+ myDlg->myDestDZ->SetValue(0);
myDlg->myCurrentX->SetValue(0);
myDlg->myCurrentY->SetValue(0);
myDlg->myCurrentZ->SetValue(0);
- myDlg->myDX->SetValue(0);
- myDlg->myDY->SetValue(0);
- myDlg->myDZ->SetValue(0);
- myDlg->myId->setText("");
+ myDlg->myDestDX->setReadOnly(true);
+ myDlg->myDestDY->setReadOnly(true);
+ myDlg->myDestDZ->setReadOnly(true);
+ myDlg->myRButNodeToMove->setChecked(true);
+
+ myDlg->ConstructorsClicked(GetConstructorId());
+
myDlg->show();
onSelectionDone(); // init myMeshActor
}
}
+//=================================================================================
+// function : GetConstructorId()
+// purpose :
+//=================================================================================
+int SMESHGUI_MakeNodeAtPointOp::GetConstructorId()
+{
+ return myDlg->myButtonGroup->checkedId();
+}
+
//================================================================================
/*!
* \brief Stops operation
}
QStringList aParameters;
- aParameters << myDlg->myX->text();
- aParameters << myDlg->myY->text();
- aParameters << myDlg->myZ->text();
+ aParameters << myDlg->myDestinationX->text();
+ aParameters << myDlg->myDestinationY->text();
+ aParameters << myDlg->myDestinationZ->text();
try {
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
bool ok;
int anId = myDlg->myId->text().toInt( &ok );
if( !ok || anId < 1 )
- anId = aMeshEditor->FindNodeClosestTo(myDlg->myX->GetValue(),
- myDlg->myY->GetValue(),
- myDlg->myZ->GetValue());
+ anId = aMeshEditor->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
+ myDlg->myDestinationY->GetValue(),
+ myDlg->myDestinationZ->GetValue());
int aResult = aMeshEditor->MoveNode(anId,
- myDlg->myX->GetValue(),
- myDlg->myY->GetValue(),
- myDlg->myZ->GetValue() );
+ myDlg->myDestinationX->GetValue(),
+ myDlg->myDestinationY->GetValue(),
+ myDlg->myDestinationZ->GetValue() );
if (aResult)
{
myDlg->myCurrentX->SetValue(0);
myDlg->myCurrentY->SetValue(0);
myDlg->myCurrentZ->SetValue(0);
- myDlg->myDX->SetValue(0);
- myDlg->myDY->SetValue(0);
- myDlg->myDZ->SetValue(0);
- myDlg->myId->setText("");
+ myDlg->myDestDX->SetValue(0);
+ myDlg->myDestDY->SetValue(0);
+ myDlg->myDestDZ->SetValue(0);
SALOME_ListIO aList;
selectionMgr()->setSelectedObjects(aList,false);
bool SMESHGUI_MakeNodeAtPointOp::isValid( QString& msg )
{
bool ok = true;
- if ( myMeshActor &&
- !myDlg->myAutoSearchChkBox->isChecked() )
+ if ( myMeshActor && myDlg->myRButNodeToMove->isChecked() )
{
ok = false;
int id = myDlg->myId->text().toInt();
msg += tr("INVALID_ID") + "\n";
}
- ok = myDlg->myX->isValid( msg, !myNoPreview ) && ok;
- ok = myDlg->myY->isValid( msg, !myNoPreview ) && ok;
- ok = myDlg->myZ->isValid( msg, !myNoPreview ) && ok;
+ ok = myDlg->myDestinationX->isValid( msg, !myNoPreview ) && ok;
+ ok = myDlg->myDestinationY->isValid( msg, !myNoPreview ) && ok;
+ ok = myDlg->myDestinationZ->isValid( msg, !myNoPreview ) && ok;
return ok;
}
SMESH_Actor* aMeshActor = SMESH::FindActorByEntry(anIO->getEntry());
if (!aMeshActor) { // coord by geom
- if ( myDlg->myCoordBtn->isChecked() ) {
+ if ( myDlg->myDestBtn->isChecked() ) {
GEOM::GEOM_Object_var geom = SMESH::IObjectToInterface<GEOM::GEOM_Object>(anIO);
if ( !geom->_is_nil() ) {
TopoDS_Vertex aShape;
aShape.ShapeType() == TopAbs_VERTEX ) {
gp_Pnt P = BRep_Tool::Pnt(aShape);
myNoPreview = true;
- myDlg->myX->SetValue(P.X());
- myDlg->myY->SetValue(P.Y());
- myDlg->myZ->SetValue(P.Z());
+ myDlg->myDestinationX->SetValue(P.X());
+ myDlg->myDestinationY->SetValue(P.Y());
+ myDlg->myDestinationZ->SetValue(P.Z());
myNoPreview = false;
redisplayPreview();
}
if (SMDS_Mesh* aMesh = aMeshActor->GetObject()->GetMesh()) {
if (const SMDS_MeshNode* aNode = aMesh->FindNode(aString.toInt())) {
myNoPreview = true;
- if ( myDlg->myCoordBtn->isChecked() ) { // set coord
- myDlg->myX->SetValue(aNode->X());
- myDlg->myY->SetValue(aNode->Y());
- myDlg->myZ->SetValue(aNode->Z());
+ if ( myDlg->myDestBtn->isChecked() ) { // set coord
+ myDlg->myDestinationX->SetValue(aNode->X());
+ myDlg->myDestinationY->SetValue(aNode->Y());
+ myDlg->myDestinationZ->SetValue(aNode->Z());
myNoPreview = false;
redisplayPreview();
}
double x = aCurrentNode->X();
double y = aCurrentNode->Y();
double z = aCurrentNode->Z();
- double dx = myDlg->myX->GetValue() - x;
- double dy = myDlg->myY->GetValue() - y;
- double dz = myDlg->myZ->GetValue() - z;
+ double dx = myDlg->myDestinationX->GetValue() - x;
+ double dy = myDlg->myDestinationY->GetValue() - y;
+ double dz = myDlg->myDestinationZ->GetValue() - z;
myDlg->myCurrentX->SetValue(x);
myDlg->myCurrentY->SetValue(y);
myDlg->myCurrentZ->SetValue(z);
- myDlg->myDX->SetValue(dx);
- myDlg->myDY->SetValue(dy);
- myDlg->myDZ->SetValue(dz);
+ myDlg->myDestDX->SetValue(dx);
+ myDlg->myDestDY->SetValue(dy);
+ myDlg->myDestDZ->SetValue(dz);
+ myDlg->myDestDX->setReadOnly(false);
+ myDlg->myDestDY->setReadOnly(false);
+ myDlg->myDestDZ->setReadOnly(false);
}
}
}
bool moveShown = false;
if ( myMeshActor)
{
- const bool autoSearch = myDlg->myAutoSearchChkBox->isChecked();
- const bool preview = myDlg->myPreviewChkBox->isChecked();
- if ( autoSearch )
- {
- myDlg->myCurrentX->SetValue(0);
- myDlg->myCurrentY->SetValue(0);
- myDlg->myCurrentZ->SetValue(0);
- myDlg->myDX->SetValue(0);
- myDlg->myDY->SetValue(0);
- myDlg->myDZ->SetValue(0);
- myDlg->myId->setText("");
- }
+ const bool isPreview = myDlg->myPreviewChkBox->isChecked();
+ const bool isMoveNode = myDlg->myRButMoveWithoutNode->isChecked();
QString msg;
- if ( autoSearch || isValid( msg ) )
+ if ( isValid( msg ) )
{
try {
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
{
SUIT_OverrideCursor aWaitCursor;
- int anId = 0;
- if ( autoSearch )
- anId = aPreviewer->FindNodeClosestTo(myDlg->myX->GetValue(),
- myDlg->myY->GetValue(),
- myDlg->myZ->GetValue());
- else
- anId = myDlg->myId->text().toInt();
+ int anId = myDlg->myId->text().toInt();
- // find id and/or just compute preview
- aPreviewer->MoveNode(anId,
- myDlg->myX->GetValue(),
- myDlg->myY->GetValue(),
- myDlg->myZ->GetValue());
- if ( autoSearch ) { // set found id
- QString idTxt("%1");
- if ( anId > 0 )
- idTxt = idTxt.arg( anId );
- else
- idTxt = "";
- myDlg->myId->setText( idTxt );
- }
-
- SMESH::double_array* aXYZ = aMesh->GetNodeXYZ( anId );
- if( aXYZ && aXYZ->length() >= 3 )
+ SMESH::double_array_var aXYZ = aMesh->GetNodeXYZ( anId );
+ if( &aXYZ.in() && aXYZ->length() >= 3 )
{
- double x = aXYZ->operator[](0);
- double y = aXYZ->operator[](1);
- double z = aXYZ->operator[](2);
+ double x = aXYZ[0];
+ double y = aXYZ[1];
+ double z = aXYZ[2];
+ double dx = 0;
+ double dy = 0;
+ double dz = 0;
if ( myUpdateDestination ) {
- myDlg->myX->SetValue(x);
- myDlg->myY->SetValue(y);
- myDlg->myZ->SetValue(z);
+ myDlg->myDestinationX->SetValue(x);
+ myDlg->myDestinationY->SetValue(y);
+ myDlg->myDestinationZ->SetValue(z);
+ }
+ if ( myDestCoordChanged ) {
+ dx = myDlg->myDestinationX->GetValue() - myDlg->myCurrentX->GetValue();
+ dy = myDlg->myDestinationY->GetValue() - myDlg->myCurrentY->GetValue();
+ dz = myDlg->myDestinationZ->GetValue() - myDlg->myCurrentZ->GetValue();
+ myDlg->myDestDX->SetValue(dx);
+ myDlg->myDestDY->SetValue(dy);
+ myDlg->myDestDZ->SetValue(dz);
+ }
+ else {
+ dx = myDlg->myDestDX->GetValue() + myDlg->myCurrentX->GetValue();;
+ dy = myDlg->myDestDY->GetValue() + myDlg->myCurrentY->GetValue();;
+ dz = myDlg->myDestDZ->GetValue() + myDlg->myCurrentZ->GetValue();;
+ myDlg->myDestinationX->SetValue(dx);
+ myDlg->myDestinationY->SetValue(dy);
+ myDlg->myDestinationZ->SetValue(dz);
}
-
- double dx = myDlg->myX->GetValue() - x;
- double dy = myDlg->myY->GetValue() - y;
- double dz = myDlg->myZ->GetValue() - z;
myDlg->myCurrentX->SetValue(x);
myDlg->myCurrentY->SetValue(y);
myDlg->myCurrentZ->SetValue(z);
- myDlg->myDX->SetValue(dx);
- myDlg->myDY->SetValue(dy);
- myDlg->myDZ->SetValue(dz);
+ myDlg->myDestDX->setReadOnly(false);
+ myDlg->myDestDY->setReadOnly(false);
+ myDlg->myDestDZ->setReadOnly(false);
}
+ else {
+ myDlg->myCurrentX->SetValue(0);
+ myDlg->myCurrentY->SetValue(0);
+ myDlg->myCurrentZ->SetValue(0);
+ myDlg->myDestDX->SetValue(0);
+ myDlg->myDestDY->SetValue(0);
+ myDlg->myDestDZ->SetValue(0);
+ myDlg->myDestDX->setReadOnly(true);
+ myDlg->myDestDY->setReadOnly(true);
+ myDlg->myDestDZ->setReadOnly(true);
+ }
+ if ( isPreview && isMoveNode && anId == 0 )
+ anId = aPreviewer->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
+ myDlg->myDestinationY->GetValue(),
+ myDlg->myDestinationZ->GetValue());
+ // find id and/or just compute preview
+ aPreviewer->MoveNode(anId,
+ myDlg->myDestinationX->GetValue(),
+ myDlg->myDestinationY->GetValue(),
+ myDlg->myDestinationZ->GetValue());
- if ( preview ) { // fill preview data
+ if ( isPreview ) { // fill preview data
aMeshPreviewStruct = aPreviewer->GetPreviewData();
moveShown = ( anId > 0 );
}
aMeshPreviewStruct = new SMESH::MeshPreviewStruct();
aMeshPreviewStruct->nodesXYZ.length(1);
- aMeshPreviewStruct->nodesXYZ[0].x = myDlg->myX->GetValue();
- aMeshPreviewStruct->nodesXYZ[0].y = myDlg->myY->GetValue();
- aMeshPreviewStruct->nodesXYZ[0].z = myDlg->myZ->GetValue();
+ aMeshPreviewStruct->nodesXYZ[0].x = myDlg->myDestinationX->GetValue();
+ aMeshPreviewStruct->nodesXYZ[0].y = myDlg->myDestinationY->GetValue();
+ aMeshPreviewStruct->nodesXYZ[0].z = myDlg->myDestinationZ->GetValue();
aMeshPreviewStruct->elementTypes.length(1);
aMeshPreviewStruct->elementTypes[0].SMDS_ElementType = SMESH::NODE;
mySimulation->SetData(aMeshPreviewStruct._retn());
}
else
-{
+ {
mySimulation->SetVisibility(false);
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESHGUI_Dialog.h"
#include "SMESHGUI_SelectionOp.h"
+class QButtonGroup;
+class QCheckBox;
class QGroupBox;
class QLineEdit;
class QPushButton;
-class QCheckBox;
+class QRadioButton;
class SMESHGUI_SpinBox;
class SMESHGUI_MeshEditPreview;
class SMESHGUI_MakeNodeAtPointDlg;
void redisplayPreview();
void onTextChange( const QString& );
void onUpdateDestination();
+ void onDestCoordChanged();
private:
+ int GetConstructorId();
+
SMESHGUI_MakeNodeAtPointDlg* myDlg;
SUIT_SelectionFilter* myFilter;
SMESH_Actor* myMeshActor;
bool myNoPreview;
bool myUpdateDestination;
+ bool myDestCoordChanged;
};
/*!
private:
QWidget* createMainFrame( QWidget* );
- QPushButton* myCoordBtn;
+ QWidget* myMainFrame;
+
+ QButtonGroup* myButtonGroup;
+ QRadioButton* myRButNodeToMove;
+ QRadioButton* myRButMoveWithoutNode;
+ QPushButton* myDestBtn;
QPushButton* myUpdateBtn;
- SMESHGUI_SpinBox* myX;
- SMESHGUI_SpinBox* myY;
- SMESHGUI_SpinBox* myZ;
+ QGroupBox* myDestinationGrp;
QGroupBox* myNodeToMoveGrp;
QPushButton* myIdBtn;
QLineEdit* myId;
SMESHGUI_SpinBox* myCurrentX;
SMESHGUI_SpinBox* myCurrentY;
SMESHGUI_SpinBox* myCurrentZ;
- SMESHGUI_SpinBox* myDX;
- SMESHGUI_SpinBox* myDY;
- SMESHGUI_SpinBox* myDZ;
- QCheckBox* myAutoSearchChkBox;
+ SMESHGUI_SpinBox* myDestinationX;
+ SMESHGUI_SpinBox* myDestinationY;
+ SMESHGUI_SpinBox* myDestinationZ;
+ QLabel* myDestDXLabel;
+ QLabel* myDestDYLabel;
+ QLabel* myDestDZLabel;
+ SMESHGUI_SpinBox* myDestDX;
+ SMESHGUI_SpinBox* myDestDY;
+ SMESHGUI_SpinBox* myDestDZ;
QCheckBox* myPreviewChkBox;
QString myHelpFileName;
private slots:
void ButtonToggled( bool );
+ void ConstructorsClicked( int );
};
#endif // SMESHGUI_MAKENODEATPOINTDLG_H
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
myAvailableHyps[ theId ] = theHyps;
bool enable = ! theHyps.isEmpty();
- if ( theId == Algo )
+ if ( theId == Algo ) // fill list of algos
{
myHyp[ Algo ]->clear();
- myHyp[ Algo ]->addItem( tr( "NONE" ) );
- myHyp[ Algo ]->addItems( theHyps );
- myHyp[ Algo ]->setCurrentIndex( 0 );
+ if ( enable )
+ {
+ myHyp[ Algo ]->addItem( tr( "NONE" ) );
+ myHyp[ Algo ]->addItems( theHyps );
+ myHyp[ Algo ]->setCurrentIndex( 0 );
+ }
}
- else {
+ else // enable buttons
+ {
myCreateHyp[ theId ]->setEnabled( enable );
- myEditHyp[ theId ]->setEnabled( false );
+ myEditHyp [ theId ]->setEnabled( false );
}
myHyp[ theId ]->setEnabled( enable );
}
//================================================================================
/*!
* \brief Sets existing hypothesis
- * \param theId - identifier of hypothesis (main or additional, see HypType enumeration)
- * \param theHyps - list of available hypothesis names
- *
+ * \param theId - identifier of hypothesis (main or additional, see HypType enumeration)
+ * \param theHyps - list of available hypothesis names
+ * \param theDefaultAvlbl - \c true means that the algorithm can with w/o hypothesis
+ * with some default parameters
+ *
* Sets existing main or additional hypothesis for this tab
*/
//================================================================================
-void SMESHGUI_MeshTab::setExistingHyps( const int theId, const QStringList& theHyps )
+void SMESHGUI_MeshTab::setExistingHyps( const int theId,
+ const QStringList& theHyps,
+ bool theDefaultAvlbl)
{
if ( theId != Algo )
{
+ bool enable = ! myAvailableHyps[ theId ].isEmpty();
myHyp[ theId ]->clear();
- myHyp[ theId ]->addItem( tr( "NONE" ) );
- myHyp[ theId ]->addItems( theHyps );
- myHyp[ theId ]->setCurrentIndex( 0 );
- myHyp[ theId ]->setEnabled( !theHyps.isEmpty() );
+ if ( enable )
+ {
+ QString none = tr( theDefaultAvlbl ? "DEFAULT" : ( theId == AddHyp ) ? "NONE" : "NONE" );
+ myHyp[ theId ]->addItem( none );
+ myHyp[ theId ]->addItems( theHyps );
+ myHyp[ theId ]->setCurrentIndex( 0 );
+ }
+ myHyp [ theId ]->setEnabled( enable );
myEditHyp[ theId ]->setEnabled( false );
}
}
//================================================================================
/*!
* \brief Adds hypothesis in combo box of available ones
- * \param theId - identifier of hypothesis (main or additional, see HypType enumeration)
- * \param theHyp - name of hypothesis to be added
- *
+ * \param theId - identifier of hypothesis (main or additional, see HypType enumeration)
+ * \param theHyp - name of hypothesis to be added
+ *
* Adds hypothesis in combo box of available ones. This method is called by operation
* after creation of new hypothesis.
*/
// geometry
createObject( tr( "GEOMETRY" ), mainFrame(), Geom );
myGeomPopup = 0;
+ // mesh type
+ QLabel* anMeshTypeLbl = new QLabel( tr( "MESH_TYPE" ), this );
+ myMeshType = new QComboBox( this );
// Create tab widget
aLay->addWidget( objectWg( Geom, Label ), 2, 0 );
aLay->addWidget( objectWg( Geom, Btn ), 2, 1 );
aLay->addWidget( objectWg( Geom, Control ), 2, 2 );
- aLay->addWidget( myTabWg, 4, 0, 1, 3 );
- aLay->addWidget( myHypoSetButton, 5, 0, 1, 3 );
+ aLay->addWidget( anMeshTypeLbl, 3, 0 );
+ aLay->addWidget( myMeshType, 3, 2 );
+ aLay->addWidget( myTabWg, 5, 0, 1, 3 );
+ aLay->addWidget( myHypoSetButton, 6, 0, 1, 3 );
aLay->setRowMinimumHeight( 3, 20 );
+ myMeshType->clear();
+
+ // Connect signals and slots
+ connect( myMeshType, SIGNAL( activated( int ) ), SLOT( onChangedMeshType( int ) ) );
// Disable controls if necessary
setObjectShown( Mesh, false );
if ( theToCreate )
return i;
return -1;
}
+//================================================================================
+/*!
+ * \brief Sets available types of mesh
+ * \param theTypeMesh - list of available types of mesh
+ */
+//================================================================================
+void SMESHGUI_MeshDlg::setAvailableMeshType( const QStringList& theTypeMesh )
+{
+ myMeshType->clear();
+ myMeshType->addItems(theTypeMesh);
+}
+//================================================================================
+/*!
+ * \brief Emits selectMeshType( const int, const int ) signal
+ *
+ * SLOT is called when a combo box "mesh type" is selected.
+ */
+//================================================================================
+void SMESHGUI_MeshDlg::onChangedMeshType( const int isIndex )
+{
+ emit selectMeshType( Dim3D - myTabWg->currentIndex(), isIndex );
+}
+//================================================================================
+/*!
+ * \brief Get current index types of mesh
+ */
+//================================================================================
+int SMESHGUI_MeshDlg::currentMeshType( )
+{
+ return myMeshType->currentIndex( );
+}
+//================================================================================
+/*!
+ * \brief Set current index types of mesh
+ */
+//================================================================================
+void SMESHGUI_MeshDlg::setCurrentMeshType( const int theIndex )
+{
+ myMeshType->setCurrentIndex( theIndex );
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
void enableTab(const int);
bool isTabEnabled(const int) const;
int getActiveObject();
+ void setAvailableMeshType(const QStringList& );
+ int currentMeshType();
+ void setCurrentMeshType( const int );
signals:
void hypoSet( const QString& );
void geomSelectionByMesh( bool );
+ void selectMeshType( const int, const int );
private slots:
void onHypoSetPopup( QAction* );
void onGeomPopup( QAction* );
void onGeomSelectionButton( bool );
+ void onChangedMeshType( const int );
private:
QMap<int, SMESHGUI_MeshTab*> myTabs;
QTabWidget* myTabWg;
QToolButton* myHypoSetButton;
QMenu* myGeomPopup;
+ QComboBox* myMeshType;
};
/*!
virtual ~SMESHGUI_MeshTab();
void setAvailableHyps( const int, const QStringList& );
- void setExistingHyps( const int, const QStringList& );
+ void setExistingHyps( const int, const QStringList&, bool=false);
void addHyp( const int, const QString& );
void renameHyp( const int, const int, const QString& );
void setCurrentHyp( const int, const int );
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESHGUI_MeshEditPreview.h"
#include "SMESHGUI_VTKUtils.h"
-
-#include <SMESH_Actor.h>
-#include <SMESH_ActorUtils.h>
+#include "SMESH_Actor.h"
+#include "SMESH_ActorUtils.h"
// SALOME GUI includes
-#include <VTKViewer_CellLocationsArray.h>
+#include <SVTK_Renderer.h>
#include <SVTK_ViewWindow.h>
+#include <VTKViewer_CellLocationsArray.h>
// VTK includes
-#include <vtkPoints.h>
-#include <vtkIdList.h>
#include <vtkCellArray.h>
-#include <vtkUnsignedCharArray.h>
-#include <vtkUnstructuredGrid.h>
-#include <vtkUnstructuredGridWriter.h>
+#include <vtkCoordinate.h>
#include <vtkDataSetMapper.h>
+#include <vtkIdList.h>
+#include <vtkPoints.h>
#include <vtkProperty.h>
+#include <vtkRenderer.h>
+#include <vtkTextActor.h>
+#include <vtkTextMapper.h>
+#include <vtkUnsignedCharArray.h>
+#include <vtkUnstructuredGrid.h>
// Qt includes
#include <QColor>
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
+#include <gp_Ax3.hxx>
+
//================================================================================
/*!
* \brief Constructor
aMapper->Delete();
myViewWindow->AddActor(myPreviewActor);
-
}
//================================================================================
{
myGrid->Delete();
+ for ( size_t iA = 0; iA < myLabelActors.size(); ++iA )
+ if ( myLabelActors[iA] )
+ {
+ myPreviewActor->GetRenderer()->RemoveActor( myLabelActors[iA] );
+ myLabelActors[iA]->Delete();
+ }
+
myViewWindow->RemoveActor(myPreviewActor);
myPreviewActor->Delete();
-
}
//================================================================================
SetVisibility(true);
}
+//================================================================================
+/*!
+ * \brief Set shape of an arrow of a unit length and nb of arrows
+ */
+//================================================================================
+
+void SMESHGUI_MeshEditPreview::SetArrowShapeAndNb( int nbArrows,
+ double headLength,
+ double headRadius,
+ double start,
+ const char* labels)
+{
+ const int theNbPoints = 10; // in one arrow
+ myUnitArrowPnts.reserve( theNbPoints );
+ myUnitArrowPnts.clear();
+
+ // unit arrow || OZ
+
+ for ( int i = 0; i < theNbPoints - 2; ++i )
+ {
+ double angle = i * 2 * M_PI / ( theNbPoints - 2 );
+ myUnitArrowPnts.push_back( gp_Pnt( headRadius * Cos( angle ),
+ headRadius * Sin( angle ),
+ 1. - headLength ));
+ }
+ myUnitArrowPnts.push_back( gp_Pnt( 0, 0, start ));
+ myUnitArrowPnts.push_back( gp_Pnt( 0, 0, 1 ));
+
+
+ // nodes of all arrows
+
+ vtkPoints* aPoints = vtkPoints::New();
+ aPoints->SetNumberOfPoints( theNbPoints * nbArrows );
+ for ( int iP = 0, iA = 0; iA < nbArrows; ++iA )
+ for ( int i = 0; i < theNbPoints; ++i, ++iP )
+ aPoints->SetPoint( iP,
+ myUnitArrowPnts[i].X(),
+ myUnitArrowPnts[i].Y(),
+ myUnitArrowPnts[i].Z() );
+ myGrid->SetPoints(aPoints);
+ aPoints->Delete();
+
+ // connectivity of all arrows
+
+ const int theNbCells = ( theNbPoints - 1 ); // in one arrow
+ myGrid->Allocate( theNbCells * nbArrows );
+ for ( int nP = 0, iA = 0; iA < nbArrows; ++iA, nP += theNbPoints )
+ {
+ vtkIdType conn[3] = { theNbPoints - 1 + nP, // arrow end
+ theNbPoints - 3 + nP, // point on a circle
+ nP }; // point on a circle
+ for ( int i = 0; i < theNbCells-1; ++i )
+ {
+ myGrid->InsertNextCell( VTK_TRIANGLE, 3, conn );
+ conn[1] = conn[2];
+ conn[2] = conn[2] + 1;
+ }
+ conn[1] = theNbPoints - 2 + nP;
+ myGrid->InsertNextCell( VTK_LINE, 2, conn );
+ }
+
+ myLabelActors.resize( nbArrows, ( vtkTextActor*) NULL );
+ char label[] = "X";
+ if ( labels )
+ for ( int iP = 0, iA = 0; iA < nbArrows; ++iA )
+ {
+ label[0] = labels[iA];
+ vtkTextMapper* text = vtkTextMapper::New();
+ text->SetInput( label );
+ vtkCoordinate* coord = vtkCoordinate::New();
+
+ myLabelActors[iA] = vtkTextActor::New();
+ //myLabelActors[iA]->SetMapper( text );
+ myLabelActors[iA]->SetInput( label );
+ myLabelActors[iA]->SetTextScaleModeToNone();
+ myLabelActors[iA]->PickableOff();
+ myLabelActors[iA]->GetPositionCoordinate()->SetReferenceCoordinate( coord );
+
+ text->Delete();
+ coord->Delete();
+
+ myPreviewActor->GetRenderer()->AddActor(myLabelActors[iA]);
+ }
+}
+
+//================================================================================
+/*!
+ * \brief Set data to show moved/rotated/scaled arrows
+ * \param [in] axes - location and direction of the arrows
+ * \param [in] length - length of arrows
+ */
+//================================================================================
+
+void SMESHGUI_MeshEditPreview::SetArrows( const gp_Ax1* axes,
+ double length )
+{
+ vtkPoints* aPoints = myGrid->GetPoints();
+
+ for ( int iP = 0, iA = 0; iA < myLabelActors.size(); ++iA )
+ {
+ gp_Trsf trsf;
+ trsf.SetTransformation( gp_Ax3( axes[iA].Location(), axes[iA].Direction() ), gp::XOY() );
+
+ for ( size_t i = 0; i < myUnitArrowPnts.size(); ++i, ++iP )
+ {
+ gp_Pnt p = myUnitArrowPnts[i].Scaled( gp::Origin(), length );
+ p.Transform( trsf );
+ aPoints->SetPoint( iP, p.X(), p.Y(), p.Z() );
+ }
+ if ( myLabelActors[iA] )
+ if ( vtkCoordinate* aCoord =
+ myLabelActors[iA]->GetPositionCoordinate()->GetReferenceCoordinate() )
+ {
+ double p[3];
+ aPoints->GetPoint( iP-1, p );
+ aCoord->SetValue( p );
+ }
+ }
+
+ myGrid->Modified();
+}
+
//================================================================================
/*!
* \brief Set visibility
void SMESHGUI_MeshEditPreview::SetVisibility (bool theVisibility)
{
myPreviewActor->SetVisibility(theVisibility);
+ for ( size_t iA = 0; iA < myLabelActors.size(); ++iA )
+ if ( myLabelActors[iA] )
+ myLabelActors[iA]->SetVisibility(theVisibility);
SMESH::RepaintCurrentView();
}
* \brief Get preview actor
*/
//================================================================================
+
SALOME_Actor* SMESHGUI_MeshEditPreview::GetActor() const
{
return myPreviewActor;
}
+
+//================================================================================
+/*!
+ * \brief Returns the priewed vtkUnstructuredGrid
+ */
+//================================================================================
+
+vtkUnstructuredGrid* SMESHGUI_MeshEditPreview::GetGrid() const
+{
+ return myGrid;
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#ifndef SMESHGUI_MESHEDITPREVIEW_H
#define SMESHGUI_MESHEDITPREVIEW_H
-// SMESH includes
#include "SMESH_SMESHGUI.hxx"
+#include <vector>
+#include <gp_Ax1.hxx>
+#include <gp_Pnt.hxx>
+class SALOME_Actor;
class SVTK_ViewWindow;
+class vtkTextActor;
class vtkUnstructuredGrid;
-class SALOME_Actor;
namespace SMESH
{
vtkUnstructuredGrid* myGrid;
SALOME_Actor* myPreviewActor;
+ std::vector<gp_Pnt> myUnitArrowPnts;
+ std::vector<vtkTextActor*> myLabelActors;
+
public:
SMESHGUI_MeshEditPreview( SVTK_ViewWindow* );
~SMESHGUI_MeshEditPreview();
void SetData( const SMESH::MeshPreviewStruct* );
+
void SetVisibility( bool );
void SetColor( double, double, double );
+
+ void SetArrowShapeAndNb( int nbArrows,
+ double headLength,
+ double headRadius,
+ double start=0.,
+ const char* labels=0);
+ void SetArrows( const gp_Ax1* axes,
+ double length);
+
SALOME_Actor* GetActor() const;
+ vtkUnstructuredGrid* GetGrid() const;
};
#endif // SMESHGUI_MESHEDITPREVIEW_H
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMDS_EdgePosition.hxx"
#include "SMDS_FacePosition.hxx"
#include "SMDS_Mesh.hxx"
+#include "SMDS_VolumeTool.hxx"
#include "SMESHDS_Mesh.hxx"
#include "SMESHGUI.h"
#include "SMESHGUI_FilterUtils.h"
// elements
QWidget* aElemLine = createLine();
- QLabel* aElemLab = new QLabel( tr( "ELEMENTS_LAB" ), this );
- QLabel* aElemTotal = new QLabel( tr( "TOTAL_LAB" ), this );
- QLabel* aElemLin = new QLabel( tr( "LINEAR_LAB" ), this );
- QLabel* aElemQuad = new QLabel( tr( "QUADRATIC_LAB" ), this );
+ QLabel* aElemLab = new QLabel( tr( "ELEMENTS_LAB" ), this );
+ QLabel* aElemTotal = new QLabel( tr( "TOTAL_LAB" ), this );
+ QLabel* aElemLin = new QLabel( tr( "LINEAR_LAB" ), this );
+ QLabel* aElemQuad = new QLabel( tr( "QUADRATIC_LAB" ), this );
+ QLabel* aElemBiQuad = new QLabel( tr( "BI_QUADRATIC_LAB" ), this );
myWidgets[ index++ ] << aElemLine;
- myWidgets[ index++ ] << aElemLab << aElemTotal << aElemLin << aElemQuad;
+ myWidgets[ index++ ] << aElemLab << aElemTotal << aElemLin << aElemQuad << aElemBiQuad;
// ... Number elements
QWidget* aNbLine = createLine();
QLabel* aNbTotal = createField();
QLabel* aNbLin = createField();
QLabel* aNbQuad = createField();
+ QLabel* aNbBiQuad = createField();
myWidgets[ index++ ] << aNbLine;
- myWidgets[ index++ ] << new QLabel( "", this ) << aNbTotal << aNbLin << aNbQuad;
+ myWidgets[ index++ ] << new QLabel( "", this ) << aNbTotal << aNbLin << aNbQuad << aNbBiQuad;
// ... 0D elements
QWidget* a0DLine = createLine();
myWidgets[ index++ ] << a1DLab << a1DTotal << a1DLin << a1DQuad;
// ... 2D elements
- QWidget* a2DLine = createLine();
- QLabel* a2DLab = new QLabel( tr( "2D_LAB" ), this );
- QLabel* a2DTotal = createField();
- QLabel* a2DLin = createField();
- QLabel* a2DQuad = createField();
- QLabel* a2DTriLab = new QLabel( tr( "TRIANGLES_LAB" ), this );
- QLabel* a2DTriTotal = createField();
- QLabel* a2DTriLin = createField();
- QLabel* a2DTriQuad = createField();
- QLabel* a2DQuaLab = new QLabel( tr( "QUADRANGLES_LAB" ), this );
- QLabel* a2DQuaTotal = createField();
- QLabel* a2DQuaLin = createField();
- QLabel* a2DQuaQuad = createField();
- QLabel* a2DPolLab = new QLabel( tr( "POLYGONS_LAB" ), this );
- QLabel* a2DPolTotal = createField();
+ QWidget* a2DLine = createLine();
+ QLabel* a2DLab = new QLabel( tr( "2D_LAB" ), this );
+ QLabel* a2DTotal = createField();
+ QLabel* a2DLin = createField();
+ QLabel* a2DQuad = createField();
+ QLabel* a2DBiQuad = createField();
+ QLabel* a2DTriLab = new QLabel( tr( "TRIANGLES_LAB" ), this );
+ QLabel* a2DTriTotal = createField();
+ QLabel* a2DTriLin = createField();
+ QLabel* a2DTriQuad = createField();
+ QLabel* a2DTriBiQuad = createField();
+ QLabel* a2DQuaLab = new QLabel( tr( "QUADRANGLES_LAB" ), this );
+ QLabel* a2DQuaTotal = createField();
+ QLabel* a2DQuaLin = createField();
+ QLabel* a2DQuaQuad = createField();
+ QLabel* a2DQuaBiQuad = createField();
+ QLabel* a2DPolLab = new QLabel( tr( "POLYGONS_LAB" ), this );
+ QLabel* a2DPolTotal = createField();
myWidgets[ index++ ] << a2DLine;
- myWidgets[ index++ ] << a2DLab << a2DTotal << a2DLin << a2DQuad;
- myWidgets[ index++ ] << a2DTriLab << a2DTriTotal << a2DTriLin << a2DTriQuad;
- myWidgets[ index++ ] << a2DQuaLab << a2DQuaTotal << a2DQuaLin << a2DQuaQuad;
+ myWidgets[ index++ ] << a2DLab << a2DTotal << a2DLin << a2DQuad << a2DBiQuad;
+ myWidgets[ index++ ] << a2DTriLab << a2DTriTotal << a2DTriLin << a2DTriQuad << a2DTriBiQuad;
+ myWidgets[ index++ ] << a2DQuaLab << a2DQuaTotal << a2DQuaLin << a2DQuaQuad << a2DQuaBiQuad;
myWidgets[ index++ ] << a2DPolLab << a2DPolTotal;
// ... 3D elements
- QWidget* a3DLine = createLine();
- QLabel* a3DLab = new QLabel( tr( "3D_LAB" ), this );
- QLabel* a3DTotal = createField();
- QLabel* a3DLin = createField();
- QLabel* a3DQuad = createField();
- QLabel* a3DTetLab = new QLabel( tr( "TETRAHEDRONS_LAB" ), this );
- QLabel* a3DTetTotal = createField();
- QLabel* a3DTetLin = createField();
- QLabel* a3DTetQuad = createField();
- QLabel* a3DHexLab = new QLabel( tr( "HEXAHEDONRS_LAB" ), this );
- QLabel* a3DHexTotal = createField();
- QLabel* a3DHexLin = createField();
- QLabel* a3DHexQuad = createField();
- QLabel* a3DPyrLab = new QLabel( tr( "PYRAMIDS_LAB" ), this );
- QLabel* a3DPyrTotal = createField();
- QLabel* a3DPyrLin = createField();
- QLabel* a3DPyrQuad = createField();
- QLabel* a3DPriLab = new QLabel( tr( "PRISMS_LAB" ), this );
- QLabel* a3DPriTotal = createField();
- QLabel* a3DPriLin = createField();
- QLabel* a3DPriQuad = createField();
+ QWidget* a3DLine = createLine();
+ QLabel* a3DLab = new QLabel( tr( "3D_LAB" ), this );
+ QLabel* a3DTotal = createField();
+ QLabel* a3DLin = createField();
+ QLabel* a3DQuad = createField();
+ QLabel* a3DBiQuad = createField();
+ QLabel* a3DTetLab = new QLabel( tr( "TETRAHEDRONS_LAB" ), this );
+ QLabel* a3DTetTotal = createField();
+ QLabel* a3DTetLin = createField();
+ QLabel* a3DTetQuad = createField();
+ QLabel* a3DHexLab = new QLabel( tr( "HEXAHEDONRS_LAB" ), this );
+ QLabel* a3DHexTotal = createField();
+ QLabel* a3DHexLin = createField();
+ QLabel* a3DHexQuad = createField();
+ QLabel* a3DHexBiQuad = createField();
+ QLabel* a3DPyrLab = new QLabel( tr( "PYRAMIDS_LAB" ), this );
+ QLabel* a3DPyrTotal = createField();
+ QLabel* a3DPyrLin = createField();
+ QLabel* a3DPyrQuad = createField();
+ QLabel* a3DPriLab = new QLabel( tr( "PRISMS_LAB" ), this );
+ QLabel* a3DPriTotal = createField();
+ QLabel* a3DPriLin = createField();
+ QLabel* a3DPriQuad = createField();
QLabel* a3DHexPriLab = new QLabel( tr( "HEX_PRISMS_LAB" ), this );
QLabel* a3DHexPriTotal = createField();
- QLabel* a3DPolLab = new QLabel( tr( "POLYHEDRONS_LAB" ), this );
- QLabel* a3DPolTotal = createField();
+ QLabel* a3DPolLab = new QLabel( tr( "POLYHEDRONS_LAB" ), this );
+ QLabel* a3DPolTotal = createField();
myWidgets[ index++ ] << a3DLine;
- myWidgets[ index++ ] << a3DLab << a3DTotal << a3DLin << a3DQuad;
+ myWidgets[ index++ ] << a3DLab << a3DTotal << a3DLin << a3DQuad << a3DBiQuad;
myWidgets[ index++ ] << a3DTetLab << a3DTetTotal << a3DTetLin << a3DTetQuad;
- myWidgets[ index++ ] << a3DHexLab << a3DHexTotal << a3DHexLin << a3DHexQuad;
+ myWidgets[ index++ ] << a3DHexLab << a3DHexTotal << a3DHexLin << a3DHexQuad << a3DHexBiQuad;
myWidgets[ index++ ] << a3DPyrLab << a3DPyrTotal << a3DPyrLin << a3DPyrQuad;
myWidgets[ index++ ] << a3DPriLab << a3DPriTotal << a3DPriLin << a3DPriQuad;
myWidgets[ index++ ] << a3DHexPriLab << a3DHexPriTotal;
myLoadBtn->setAutoDefault( true );
connect( myLoadBtn, SIGNAL( clicked() ), this, SLOT( loadMesh() ) );
- setFontAttributes( aNameLab, Bold );
- setFontAttributes( aObjLab, Bold );
- setFontAttributes( aNodesLab, Bold );
- setFontAttributes( aElemLab, Bold );
- setFontAttributes( aElemTotal, Italic );
- setFontAttributes( aElemLin, Italic );
- setFontAttributes( aElemQuad, Italic );
- setFontAttributes( a0DLab, Bold );
- setFontAttributes( aBallLab, Bold );
- setFontAttributes( a1DLab, Bold );
- setFontAttributes( a2DLab, Bold );
- setFontAttributes( a3DLab, Bold );
+ setFontAttributes( aNameLab, Bold );
+ setFontAttributes( aObjLab, Bold );
+ setFontAttributes( aNodesLab, Bold );
+ setFontAttributes( aElemLab, Bold );
+ setFontAttributes( aElemTotal, Italic );
+ setFontAttributes( aElemLin, Italic );
+ setFontAttributes( aElemQuad, Italic );
+ setFontAttributes( aElemBiQuad, Italic );
+ setFontAttributes( a0DLab, Bold );
+ setFontAttributes( aBallLab, Bold );
+ setFontAttributes( a1DLab, Bold );
+ setFontAttributes( a2DLab, Bold );
+ setFontAttributes( a3DLab, Bold );
l->addWidget( aNameLab, 0, 0 );
- l->addWidget( aName, 0, 1, 1, 3 );
+ l->addWidget( aName, 0, 1, 1, 4 );
l->addWidget( aObjLab, 1, 0 );
- l->addWidget( aObj, 1, 1, 1, 3 );
- l->addWidget( aNodesLine, 2, 0, 1, 4 );
+ l->addWidget( aObj, 1, 1, 1, 4 );
+ l->addWidget( aNodesLine, 2, 0, 1, 5 );
l->addWidget( aNodesLab, 3, 0 );
l->addWidget( aNodes, 3, 1 );
- l->addWidget( aElemLine, 4, 0, 1, 4 );
+ l->addWidget( aElemLine, 4, 0, 1, 5 );
l->addWidget( aElemLab, 5, 0 );
l->addWidget( aElemTotal, 5, 1 );
l->addWidget( aElemLin, 5, 2 );
l->addWidget( aElemQuad, 5, 3 );
- l->addWidget( aNbLine, 6, 1, 1, 3 );
+ l->addWidget( aElemBiQuad, 5, 4 );
+ l->addWidget( aNbLine, 6, 1, 1, 4 );
l->addWidget( aNbTotal, 7, 1 );
l->addWidget( aNbLin, 7, 2 );
l->addWidget( aNbQuad, 7, 3 );
- l->addWidget( a0DLine, 8, 1, 1, 3 );
+ l->addWidget( aNbBiQuad, 7, 4 );
+ l->addWidget( a0DLine, 8, 1, 1, 4 );
l->addWidget( a0DLab, 9, 0 );
l->addWidget( a0DTotal, 9, 1 );
- l->addWidget( aBallLine, 10, 1, 1, 3 );
+ l->addWidget( aBallLine, 10, 1, 1, 4 );
l->addWidget( aBallLab, 11, 0 );
l->addWidget( aBallTotal, 11, 1 );
- l->addWidget( a1DLine, 12, 1, 1, 3 );
+ l->addWidget( a1DLine, 12, 1, 1, 4 );
l->addWidget( a1DLab, 13, 0 );
l->addWidget( a1DTotal, 13, 1 );
l->addWidget( a1DLin, 13, 2 );
l->addWidget( a1DQuad, 13, 3 );
- l->addWidget( a2DLine, 14, 1, 1, 3 );
- l->addWidget( a2DLab, 15, 0 );
- l->addWidget( a2DTotal, 15, 1 );
- l->addWidget( a2DLin, 15, 2 );
- l->addWidget( a2DQuad, 15, 3 );
- l->addWidget( a2DTriLab, 16, 0 );
- l->addWidget( a2DTriTotal, 16, 1 );
- l->addWidget( a2DTriLin, 16, 2 );
- l->addWidget( a2DTriQuad, 16, 3 );
- l->addWidget( a2DQuaLab, 17, 0 );
- l->addWidget( a2DQuaTotal, 17, 1 );
- l->addWidget( a2DQuaLin, 17, 2 );
- l->addWidget( a2DQuaQuad, 17, 3 );
- l->addWidget( a2DPolLab, 18, 0 );
- l->addWidget( a2DPolTotal, 18, 1 );
- l->addWidget( a3DLine, 19, 1, 1, 3 );
- l->addWidget( a3DLab, 20, 0 );
- l->addWidget( a3DTotal, 20, 1 );
- l->addWidget( a3DLin, 20, 2 );
- l->addWidget( a3DQuad, 20, 3 );
- l->addWidget( a3DTetLab, 21, 0 );
- l->addWidget( a3DTetTotal, 21, 1 );
- l->addWidget( a3DTetLin, 21, 2 );
- l->addWidget( a3DTetQuad, 21, 3 );
- l->addWidget( a3DHexLab, 22, 0 );
- l->addWidget( a3DHexTotal, 22, 1 );
- l->addWidget( a3DHexLin, 22, 2 );
- l->addWidget( a3DHexQuad, 22, 3 );
- l->addWidget( a3DPyrLab, 23, 0 );
- l->addWidget( a3DPyrTotal, 23, 1 );
- l->addWidget( a3DPyrLin, 23, 2 );
- l->addWidget( a3DPyrQuad, 23, 3 );
- l->addWidget( a3DPriLab, 24, 0 );
- l->addWidget( a3DPriTotal, 24, 1 );
- l->addWidget( a3DPriLin, 24, 2 );
- l->addWidget( a3DPriQuad, 24, 3 );
+ l->addWidget( a2DLine, 14, 1, 1, 4 );
+ l->addWidget( a2DLab, 15, 0 );
+ l->addWidget( a2DTotal, 15, 1 );
+ l->addWidget( a2DLin, 15, 2 );
+ l->addWidget( a2DQuad, 15, 3 );
+ l->addWidget( a2DBiQuad, 15, 4 );
+ l->addWidget( a2DTriLab, 16, 0 );
+ l->addWidget( a2DTriTotal, 16, 1 );
+ l->addWidget( a2DTriLin, 16, 2 );
+ l->addWidget( a2DTriQuad, 16, 3 );
+ l->addWidget( a2DTriBiQuad, 16, 4 );
+ l->addWidget( a2DQuaLab, 17, 0 );
+ l->addWidget( a2DQuaTotal, 17, 1 );
+ l->addWidget( a2DQuaLin, 17, 2 );
+ l->addWidget( a2DQuaQuad, 17, 3 );
+ l->addWidget( a2DQuaBiQuad, 17, 4 );
+ l->addWidget( a2DPolLab, 18, 0 );
+ l->addWidget( a2DPolTotal, 18, 1 );
+ l->addWidget( a3DLine, 19, 1, 1, 4 );
+ l->addWidget( a3DLab, 20, 0 );
+ l->addWidget( a3DTotal, 20, 1 );
+ l->addWidget( a3DLin, 20, 2 );
+ l->addWidget( a3DQuad, 20, 3 );
+ l->addWidget( a3DBiQuad, 20, 4 );
+ l->addWidget( a3DTetLab, 21, 0 );
+ l->addWidget( a3DTetTotal, 21, 1 );
+ l->addWidget( a3DTetLin, 21, 2 );
+ l->addWidget( a3DTetQuad, 21, 3 );
+ l->addWidget( a3DHexLab, 22, 0 );
+ l->addWidget( a3DHexTotal, 22, 1 );
+ l->addWidget( a3DHexLin, 22, 2 );
+ l->addWidget( a3DHexQuad, 22, 3 );
+ l->addWidget( a3DHexBiQuad, 22, 4 );
+ l->addWidget( a3DPyrLab, 23, 0 );
+ l->addWidget( a3DPyrTotal, 23, 1 );
+ l->addWidget( a3DPyrLin, 23, 2 );
+ l->addWidget( a3DPyrQuad, 23, 3 );
+ l->addWidget( a3DPriLab, 24, 0 );
+ l->addWidget( a3DPriTotal, 24, 1 );
+ l->addWidget( a3DPriLin, 24, 2 );
+ l->addWidget( a3DPriQuad, 24, 3 );
l->addWidget( a3DHexPriLab, 25, 0 );
l->addWidget( a3DHexPriTotal, 25, 1 );
- l->addWidget( a3DPolLab, 26, 0 );
- l->addWidget( a3DPolTotal, 26, 1 );
- l->addWidget( myLoadBtn, 28, 1, 1, 3 );
+ l->addWidget( a3DPolLab, 26, 0 );
+ l->addWidget( a3DPolTotal, 26, 1 );
+ l->addWidget( myLoadBtn, 28, 1, 1, 4 );
l->setColumnStretch( 0, 0 );
l->setColumnStretch( 1, 5 );
l->setColumnStretch( 2, 5 );
l->setColumnStretch( 3, 5 );
+ l->setColumnStretch( 4, 5 );
l->setRowStretch( 27, 5 );
clear();
myWidgets[i1D][iTotal] ->setProperty( "text", QString::number( nbEdges ) );
myWidgets[i1D][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Edge] ) );
myWidgets[i1D][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Edge] ) );
- long nbTriangles = info[SMDSEntity_Triangle] + info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_BiQuad_Triangle];
- long nbQuadrangles = info[SMDSEntity_Quadrangle] + info[SMDSEntity_Quad_Quadrangle] + info[SMDSEntity_BiQuad_Quadrangle];
- long nb2DLinear = info[SMDSEntity_Triangle] + info[SMDSEntity_Quadrangle] + info[SMDSEntity_Polygon];
- long nb2DQuadratic = info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_BiQuad_Triangle] + info[SMDSEntity_Quad_Quadrangle] + info[SMDSEntity_BiQuad_Quadrangle];
- myWidgets[i2D][iTotal] ->setProperty( "text", QString::number( nb2DLinear + nb2DQuadratic ));
- myWidgets[i2D][iLinear] ->setProperty( "text", QString::number( nb2DLinear ) );
- myWidgets[i2D][iQuadratic] ->setProperty( "text", QString::number( nb2DQuadratic ) );
- myWidgets[i2DTriangles][iTotal] ->setProperty( "text", QString::number( nbTriangles ) );
- myWidgets[i2DTriangles][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Triangle] ) );
- myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_BiQuad_Triangle]) );
- myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", QString::number( nbQuadrangles ) );
- myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Quadrangle] ) );
- myWidgets[i2DQuadrangles][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Quadrangle] + info[SMDSEntity_BiQuad_Quadrangle] ));
- myWidgets[i2DPolygons][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Polygon] ) );
- long nbTetrahedrons = info[SMDSEntity_Tetra] + info[SMDSEntity_Quad_Tetra];
- long nbHexahedrons = info[SMDSEntity_Hexa] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_TriQuad_Hexa];
- long nbPyramids = info[SMDSEntity_Pyramid] + info[SMDSEntity_Quad_Pyramid];
- long nbPrisms = info[SMDSEntity_Penta] + info[SMDSEntity_Quad_Penta];
- long nb3DLinear = info[SMDSEntity_Tetra] + info[SMDSEntity_Hexa] + info[SMDSEntity_Pyramid] + info[SMDSEntity_Penta] + info[SMDSEntity_Polyhedra] + info[SMDSEntity_Hexagonal_Prism];
- long nb3DQuadratic = info[SMDSEntity_Quad_Tetra] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_TriQuad_Hexa] + info[SMDSEntity_Quad_Pyramid] + info[SMDSEntity_Quad_Penta];
- myWidgets[i3D][iTotal] ->setProperty( "text", QString::number( nb3DLinear + nb3DQuadratic ) );
- myWidgets[i3D][iLinear] ->setProperty( "text", QString::number( nb3DLinear ) );
- myWidgets[i3D][iQuadratic] ->setProperty( "text", QString::number( nb3DQuadratic ) );
- myWidgets[i3DTetrahedrons][iTotal] ->setProperty( "text", QString::number( nbTetrahedrons ) );
- myWidgets[i3DTetrahedrons][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Tetra] ) );
- myWidgets[i3DTetrahedrons][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Tetra] ) );
- myWidgets[i3DHexahedrons][iTotal] ->setProperty( "text", QString::number( nbHexahedrons ) );
- myWidgets[i3DHexahedrons][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Hexa] ) );
- myWidgets[i3DHexahedrons][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_TriQuad_Hexa] ) );
- myWidgets[i3DPyramids][iTotal] ->setProperty( "text", QString::number( nbPyramids ) );
- myWidgets[i3DPyramids][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Pyramid] ) );
- myWidgets[i3DPyramids][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Pyramid] ) );
- myWidgets[i3DPrisms][iTotal] ->setProperty( "text", QString::number( nbPrisms ) );
- myWidgets[i3DPrisms][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Penta] ) );
- myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Penta] ) );
- myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Hexagonal_Prism] ) );
- myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Polyhedra] ) );
- long nbElemTotal = info[SMDSEntity_0D] + info[SMDSEntity_Ball] + nbEdges + nb2DLinear + nb2DQuadratic + nb3DLinear + nb3DQuadratic;
- long nbElemLinerial = info[SMDSEntity_Edge] + nb2DLinear + nb3DLinear;
- long nbElemQuadratic = info[SMDSEntity_Quad_Edge] + nb2DQuadratic + nb3DQuadratic;
- myWidgets[iNb][iTotal] ->setProperty( "text", QString::number( nbElemTotal ) );
- myWidgets[iNb][iLinear] ->setProperty( "text", QString::number( nbElemLinerial ) );
- myWidgets[iNb][iQuadratic]->setProperty( "text", QString::number( nbElemQuadratic ) );
+ long nbTriangles = info[SMDSEntity_Triangle] + info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_BiQuad_Triangle];
+ long nbQuadrangles = info[SMDSEntity_Quadrangle] + info[SMDSEntity_Quad_Quadrangle] + info[SMDSEntity_BiQuad_Quadrangle];
+ long nb2DLinear = info[SMDSEntity_Triangle] + info[SMDSEntity_Quadrangle] + info[SMDSEntity_Polygon];
+ long nb2DQuadratic = info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_Quad_Quadrangle];
+ long nb2DBiQuadratic = info[SMDSEntity_BiQuad_Triangle] + info[SMDSEntity_BiQuad_Quadrangle];
+
+ myWidgets[i2D][iTotal] ->setProperty( "text", QString::number( nb2DLinear + nb2DQuadratic ));
+ myWidgets[i2D][iLinear] ->setProperty( "text", QString::number( nb2DLinear ) );
+ myWidgets[i2D][iQuadratic] ->setProperty( "text", QString::number( nb2DQuadratic ) );
+ myWidgets[i2D][iBiQuadratic] ->setProperty( "text", QString::number( nb2DBiQuadratic ) );
+ myWidgets[i2DTriangles][iTotal] ->setProperty( "text", QString::number( nbTriangles ) );
+ myWidgets[i2DTriangles][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Triangle] ) );
+ myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Triangle] ) );
+ myWidgets[i2DTriangles][iBiQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_BiQuad_Triangle] ) );
+ myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", QString::number( nbQuadrangles ) );
+ myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Quadrangle] ) );
+ myWidgets[i2DQuadrangles][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Quadrangle] ) );
+ myWidgets[i2DQuadrangles][iBiQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_BiQuad_Quadrangle] ) );
+ myWidgets[i2DPolygons][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Polygon] ) );
+ long nbTetrahedrons = info[SMDSEntity_Tetra] + info[SMDSEntity_Quad_Tetra];
+ long nbHexahedrons = info[SMDSEntity_Hexa] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_TriQuad_Hexa];
+ long nbPyramids = info[SMDSEntity_Pyramid] + info[SMDSEntity_Quad_Pyramid];
+ long nbPrisms = info[SMDSEntity_Penta] + info[SMDSEntity_Quad_Penta];
+ long nb3DLinear = info[SMDSEntity_Tetra] + info[SMDSEntity_Hexa] + info[SMDSEntity_Pyramid] + info[SMDSEntity_Penta] + info[SMDSEntity_Polyhedra] + info[SMDSEntity_Hexagonal_Prism];
+ long nb3DQuadratic = info[SMDSEntity_Quad_Tetra] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_Quad_Pyramid] + info[SMDSEntity_Quad_Penta];
+ long nb3DBiQuadratic = info[SMDSEntity_TriQuad_Hexa];
+ myWidgets[i3D][iTotal] ->setProperty( "text", QString::number( nb3DLinear + nb3DQuadratic ) );
+ myWidgets[i3D][iLinear] ->setProperty( "text", QString::number( nb3DLinear ) );
+ myWidgets[i3D][iQuadratic] ->setProperty( "text", QString::number( nb3DQuadratic ) );
+ myWidgets[i3D][iBiQuadratic] ->setProperty( "text", QString::number( nb3DBiQuadratic ) );
+ myWidgets[i3DTetrahedrons][iTotal] ->setProperty( "text", QString::number( nbTetrahedrons ) );
+ myWidgets[i3DTetrahedrons][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Tetra] ) );
+ myWidgets[i3DTetrahedrons][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Tetra] ) );
+ myWidgets[i3DHexahedrons][iTotal] ->setProperty( "text", QString::number( nbHexahedrons ) );
+ myWidgets[i3DHexahedrons][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Hexa] ) );
+ myWidgets[i3DHexahedrons][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Hexa] ) );
+ myWidgets[i3DHexahedrons][iBiQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_TriQuad_Hexa] ) );
+ myWidgets[i3DPyramids][iTotal] ->setProperty( "text", QString::number( nbPyramids ) );
+ myWidgets[i3DPyramids][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Pyramid] ) );
+ myWidgets[i3DPyramids][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Pyramid] ) );
+ myWidgets[i3DPrisms][iTotal] ->setProperty( "text", QString::number( nbPrisms ) );
+ myWidgets[i3DPrisms][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Penta] ) );
+ myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Penta] ) );
+ myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Hexagonal_Prism] ) );
+ myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Polyhedra] ) );
+ long nbElemTotal = info[SMDSEntity_0D] + info[SMDSEntity_Ball] + nbEdges + nb2DLinear + nb2DQuadratic + nb2DBiQuadratic + nb3DLinear + nb3DQuadratic + nb3DBiQuadratic;
+ long nbElemLinerial = info[SMDSEntity_Edge] + nb2DLinear + nb3DLinear;
+ long nbElemQuadratic = info[SMDSEntity_Quad_Edge] + nb2DQuadratic + nb3DQuadratic;
+ long nbElemBiQuadratic = nb2DBiQuadratic + nb3DBiQuadratic;
+ myWidgets[iNb][iTotal] ->setProperty( "text", QString::number( nbElemTotal ) );
+ myWidgets[iNb][iLinear] ->setProperty( "text", QString::number( nbElemLinerial ) );
+ myWidgets[iNb][iQuadratic] ->setProperty( "text", QString::number( nbElemQuadratic ) );
+ myWidgets[iNb][iBiQuadratic]->setProperty( "text", QString::number( nbElemBiQuadratic ) );
// before full loading from study file, type of elements in a sub-mesh can't be defined
// in some cases
bool infoOK = obj->IsMeshInfoCorrect();
hasAnyInfo = info[i];
if ( hasAnyInfo ) // believe it is a sub-mesh
{
- if ( nb2DLinear + nb2DQuadratic > 0 )
+ if ( nb2DLinear + nb2DQuadratic + nb2DBiQuadratic > 0 )
{
- myWidgets[i2D][iLinear] ->setProperty( "text", "?" );
- myWidgets[i2D][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i2DTriangles][iTotal] ->setProperty( "text", "?" );
- myWidgets[i2DTriangles][iLinear] ->setProperty( "text", "?" );
- myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", "?" );
- myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", "?" );
- myWidgets[i2DQuadrangles][iQuadratic]->setProperty( "text", "?" );
- myWidgets[i2DPolygons][iTotal] ->setProperty( "text", "?" );
- myWidgets[iNb][iTotal] ->setProperty( "text", "?" );
- myWidgets[iNb][iLinear] ->setProperty( "text", "?" );
- myWidgets[iNb][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2D][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i2D][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2D][iBiQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2DTriangles][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i2DTriangles][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2DTriangles][iBiQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i2DQuadrangles][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2DQuadrangles][iBiQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2DPolygons][iTotal] ->setProperty( "text", "?" );
+ myWidgets[iNb][iTotal] ->setProperty( "text", "?" );
+ myWidgets[iNb][iLinear] ->setProperty( "text", "?" );
+ myWidgets[iNb][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[iNb][iBiQuadratic] ->setProperty( "text", "?" );
}
- else if ( nb3DLinear + nb3DQuadratic > 0 )
+ else if ( nb3DLinear + nb3DQuadratic + nb3DBiQuadratic > 0 )
{
- myWidgets[i3D][iLinear] ->setProperty( "text", "?" );
- myWidgets[i3D][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i3DTetrahedrons][iTotal] ->setProperty( "text", "?" );
- myWidgets[i3DTetrahedrons][iLinear] ->setProperty( "text", "?" );
- myWidgets[i3DTetrahedrons][iQuadratic]->setProperty( "text", "?" );
- myWidgets[i3DHexahedrons][iTotal] ->setProperty( "text", "?" );
- myWidgets[i3DHexahedrons][iLinear] ->setProperty( "text", "?" );
- myWidgets[i3DHexahedrons][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i3DPyramids][iTotal] ->setProperty( "text", "?" );
- myWidgets[i3DPyramids][iLinear] ->setProperty( "text", "?" );
- myWidgets[i3DPyramids][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i3DPrisms][iTotal] ->setProperty( "text", "?" );
- myWidgets[i3DPrisms][iLinear] ->setProperty( "text", "?" );
- myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", "?" );
- myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", "?" );
- myWidgets[iNb][iTotal] ->setProperty( "text", "?" );
- myWidgets[iNb][iLinear] ->setProperty( "text", "?" );
- myWidgets[iNb][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3D][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i3D][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3D][iBiQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3DTetrahedrons][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i3DTetrahedrons][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i3DTetrahedrons][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3DHexahedrons][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i3DHexahedrons][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i3DHexahedrons][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3DHexahedrons][iBiQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3DPyramids][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i3DPyramids][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i3DPyramids][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3DPrisms][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i3DPrisms][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", "?" );
+ myWidgets[iNb][iTotal] ->setProperty( "text", "?" );
+ myWidgets[iNb][iLinear] ->setProperty( "text", "?" );
+ myWidgets[iNb][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[iNb][iBiQuadratic] ->setProperty( "text", "?" );
}
}
else
{
- myWidgets[iNodes][iTotal] ->setProperty( "text", "?" );
- myWidgets[i0D][iTotal] ->setProperty( "text", "?" );
- myWidgets[iBalls][iTotal] ->setProperty( "text", "?" );
- myWidgets[i1D][iTotal] ->setProperty( "text", "?" );
- myWidgets[i1D][iLinear] ->setProperty( "text", "?" );
- myWidgets[i1D][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i2D][iTotal] ->setProperty( "text", "?" );
- myWidgets[i2D][iLinear] ->setProperty( "text", "?" );
- myWidgets[i2D][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i2DTriangles][iTotal] ->setProperty( "text", "?" );
- myWidgets[i2DTriangles][iLinear] ->setProperty( "text", "?" );
- myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", "?" );
- myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", "?" );
- myWidgets[i2DQuadrangles][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i2DPolygons][iTotal] ->setProperty( "text", "?" );
- myWidgets[i3D][iTotal] ->setProperty( "text", "?" );
- myWidgets[i3D][iLinear] ->setProperty( "text", "?" );
- myWidgets[i3D][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i3DTetrahedrons][iTotal] ->setProperty( "text", "?" );
- myWidgets[i3DTetrahedrons][iLinear] ->setProperty( "text", "?" );
- myWidgets[i3DTetrahedrons][iQuadratic]->setProperty( "text", "?" );
- myWidgets[i3DHexahedrons][iTotal] ->setProperty( "text", "?" );
- myWidgets[i3DHexahedrons][iLinear] ->setProperty( "text", "?" );
- myWidgets[i3DHexahedrons][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i3DPyramids][iTotal] ->setProperty( "text", "?" );
- myWidgets[i3DPyramids][iLinear] ->setProperty( "text", "?" );
- myWidgets[i3DPyramids][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i3DPrisms][iTotal] ->setProperty( "text", "?" );
- myWidgets[i3DPrisms][iLinear] ->setProperty( "text", "?" );
- myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", "?" );
- myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", "?" );
- myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", "?" );
- myWidgets[iNb][iTotal] ->setProperty( "text", "?" );
- myWidgets[iNb][iLinear] ->setProperty( "text", "?" );
- myWidgets[iNb][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[iNodes][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i0D][iTotal] ->setProperty( "text", "?" );
+ myWidgets[iBalls][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i1D][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i1D][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i1D][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2D][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i2D][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i2D][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2D][iBiQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2DTriangles][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i2DTriangles][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2DTriangles][iBiQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i2DQuadrangles][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2DQuadrangles][iBiQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i2DPolygons][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i3D][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i3D][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i3D][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3DTetrahedrons][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i3DTetrahedrons][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i3DTetrahedrons][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3DHexahedrons][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i3DHexahedrons][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i3DHexahedrons][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3DHexahedrons][iBiQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3DPyramids][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i3DPyramids][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i3DPyramids][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3DPrisms][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i3DPrisms][iLinear] ->setProperty( "text", "?" );
+ myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", "?" );
+ myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", "?" );
+ myWidgets[iNb][iTotal] ->setProperty( "text", "?" );
+ myWidgets[iNb][iLinear] ->setProperty( "text", "?" );
+ myWidgets[iNb][iQuadratic] ->setProperty( "text", "?" );
+ myWidgets[iNb][iBiQuadratic] ->setProperty( "text", "?" );
}
}
}
*/
void SMESHGUI_MeshInfo::clear()
{
- myWidgets[iName][iSingle] ->setProperty( "text", QString() );
- myWidgets[iObject][iSingle] ->setProperty( "text", QString() );
- myWidgets[iNodes][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i0D][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[iBalls][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i1D][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i1D][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i1D][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2D][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2D][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2D][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DTriangles][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DTriangles][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DQuadrangles][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DPolygons][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3D][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3D][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3D][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DTetrahedrons][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DTetrahedrons][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DTetrahedrons][iQuadratic]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DHexahedrons][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DHexahedrons][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DHexahedrons][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPyramids][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPyramids][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPyramids][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPrisms][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPrisms][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[iNb][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[iNb][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[iNb][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[iName][iSingle] ->setProperty( "text", QString() );
+ myWidgets[iObject][iSingle] ->setProperty( "text", QString() );
+ myWidgets[iNodes][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i0D][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[iBalls][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i1D][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i1D][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i1D][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2D][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2D][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2D][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2D][iBiQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DTriangles][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DTriangles][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DTriangles][iBiQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DQuadrangles][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DQuadrangles][iBiQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DPolygons][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3D][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3D][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3D][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3D][iBiQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DTetrahedrons][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DTetrahedrons][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DTetrahedrons][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DHexahedrons][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DHexahedrons][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DHexahedrons][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DHexahedrons][iBiQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DPyramids][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DPyramids][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DPyramids][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DPrisms][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DPrisms][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[iNb][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[iNb][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[iNb][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[iNb][iBiQuadratic] ->setProperty( "text", QString::number( 0 ) );
}
/*!
out << QString( SPACING_INFO, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[iNb][iTotal]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[iNb][iLinear]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[iNb][iQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[iNb][iBiQuadratic]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO, ' ' ) << tr( "0D_LAB" ) << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i0D][iTotal]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO, ' ' ) << tr( "BALL_LAB" ) << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i2D][iTotal]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i2D][iLinear]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i2D][iQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i2D][iBiQuadratic]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "TRIANGLES_LAB" ) << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i2DTriangles][iTotal]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i2DTriangles][iLinear]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DTriangles][iQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DTriangles][iBiQuadratic]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "QUADRANGLES_LAB" ) << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i2DQuadrangles][iTotal]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i2DQuadrangles][iLinear]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DQuadrangles][iQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DQuadrangles][iBiQuadratic]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "POLYGONS_LAB" ) << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i2DPolygons][iTotal]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO, ' ' ) << tr( "3D_LAB" ) << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3D][iTotal]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3D][iLinear]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i3D][iQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i3D][iBiQuadratic]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "TETRAHEDRONS_LAB" ) << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DTetrahedrons][iTotal]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3DTetrahedrons][iLinear]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DHexahedrons][iTotal]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3DHexahedrons][iLinear]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i3DHexahedrons][iQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i3DHexahedrons][iBiQuadratic]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "PYRAMIDS_LAB" ) << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DPyramids][iTotal]->property( "text" ) ).toString() << "\n";
out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3DPyramids][iLinear]->property( "text" ) ).toString() << "\n";
// connectivity
QTreeWidgetItem* conItem = createItem( elemItem, Bold );
conItem->setText( 0, SMESHGUI_ElemInfo::tr( "CONNECTIVITY" ) );
- SMDS_ElemIteratorPtr nodeIt = e->nodesIterator();
- for ( int idx = 1; nodeIt->more(); idx++ ) {
- const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
- // node number and ID
- QTreeWidgetItem* nodeItem = createItem( conItem, Bold );
- nodeItem->setText( 0, QString( "%1 %2 / %3" ).arg( SMESHGUI_ElemInfo::tr( "NODE" ) ).arg( idx ).arg( e->NbNodes() ) );
- nodeItem->setText( 1, QString( "#%1" ).arg( node->GetID() ) );
- nodeItem->setData( 1, TypeRole, ElemConnectivity );
- nodeItem->setData( 1, IdRole, node->GetID() );
- nodeItem->setExpanded( false );
- // node coordinates
- QTreeWidgetItem* coordItem = createItem( nodeItem );
- coordItem->setText( 0, SMESHGUI_ElemInfo::tr( "COORDINATES" ) );
- QTreeWidgetItem* xItem = createItem( coordItem );
- xItem->setText( 0, "X" );
- xItem->setText( 1, QString::number( node->X(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
- QTreeWidgetItem* yItem = createItem( coordItem );
- yItem->setText( 0, "Y" );
- yItem->setText( 1, QString::number( node->Y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
- QTreeWidgetItem* zItem = createItem( coordItem );
- zItem->setText( 0, "Z" );
- zItem->setText( 1, QString::number( node->Z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
- // node connectivity
- QTreeWidgetItem* nconItem = createItem( nodeItem );
- nconItem->setText( 0, SMESHGUI_ElemInfo::tr( "CONNECTIVITY" ) );
- Connectivity connectivity = nodeConnectivity( node );
- if ( !connectivity.isEmpty() ) {
- QString con = formatConnectivity( connectivity, SMDSAbs_0DElement );
- if ( !con.isEmpty() ) {
- QTreeWidgetItem* i = createItem( nconItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "0D_ELEMENTS" ) );
- i->setText( 1, con );
- }
- con = formatConnectivity( connectivity, SMDSAbs_Edge );
- if ( !con.isEmpty() ) {
- QTreeWidgetItem* i = createItem( nconItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "EDGES" ) );
- i->setText( 1, con );
- i->setData( 1, TypeRole, NodeConnectivity );
- }
- con = formatConnectivity( connectivity, SMDSAbs_Ball );
- if ( !con.isEmpty() ) {
- QTreeWidgetItem* i = createItem( nconItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "BALL_ELEMENTS" ) );
- i->setText( 1, con );
- i->setData( 1, TypeRole, NodeConnectivity );
- }
- con = formatConnectivity( connectivity, SMDSAbs_Face );
- if ( !con.isEmpty() ) {
- QTreeWidgetItem* i = createItem( nconItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "FACES" ) );
- i->setText( 1, con );
- i->setData( 1, TypeRole, NodeConnectivity );
- }
- con = formatConnectivity( connectivity, SMDSAbs_Volume );
- if ( !con.isEmpty() ) {
- QTreeWidgetItem* i = createItem( nconItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "VOLUMES" ) );
- i->setText( 1, con );
- i->setData( 1, TypeRole, NodeConnectivity );
+
+
+ if( e->GetGeomType() != SMDSGeom_POLYHEDRA ) {
+ SMDS_ElemIteratorPtr nodeIt = e->nodesIterator();
+ for ( int idx = 1; nodeIt->more(); idx++ ) {
+ const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
+ nodeInfo( node, idx, e->NbNodes(), conItem );
+ }
+ }
+ else {
+ const SMDS_VtkVolume* aVtkVolume = dynamic_cast<const SMDS_VtkVolume*>(e);
+ SMDS_ElemIteratorPtr nodeIt = aVtkVolume->uniqueNodesIterator();
+ QList<const SMDS_MeshElement*> uniqueNodes;
+ while ( nodeIt->more() )
+ uniqueNodes.append( nodeIt->next() );
+
+ SMDS_VolumeTool vtool( e );
+ const int nbFaces = vtool.NbFaces();
+ for( int face_id = 0; face_id < nbFaces; face_id++ ) {
+ QTreeWidgetItem* faceItem = createItem( conItem, Bold );
+ faceItem->setText( 0, QString( "%1 %2 / %3" ).arg( SMESHGUI_ElemInfo::tr( "FACE" ) ).arg( face_id + 1 ).arg( nbFaces ) );
+ faceItem->setExpanded( true );
+
+ const SMDS_MeshNode** aNodeIds = vtool.GetFaceNodes( face_id );
+ const int nbNodes = vtool.NbFaceNodes( face_id );
+ for( int node_id = 0; node_id < nbNodes; node_id++ ) {
+ const SMDS_MeshNode* node = aNodeIds[node_id];
+ nodeInfo( node, uniqueNodes.indexOf(node) + 1, aVtkVolume->NbUniqueNodes(), faceItem );
}
}
}
}
}
+/*!
+ \brief Show node information
+ \param node mesh node for showing
+ \param index index of current node
+ \param nbNodes number of unique nodes in element
+ \param parentItem parent item of tree
+*/
+void SMESHGUI_TreeElemInfo::nodeInfo( const SMDS_MeshNode* node, int index,
+ int nbNodes, QTreeWidgetItem* parentItem )
+{
+ int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 );
+ // node number and ID
+ QTreeWidgetItem* nodeItem = createItem( parentItem, Bold );
+ nodeItem->setText( 0, QString( "%1 %2 / %3" ).arg( SMESHGUI_ElemInfo::tr( "NODE" ) ).arg( index ).arg( nbNodes ) );
+ nodeItem->setText( 1, QString( "#%1" ).arg( node->GetID() ) );
+ nodeItem->setData( 1, TypeRole, ElemConnectivity );
+ nodeItem->setData( 1, IdRole, node->GetID() );
+ nodeItem->setExpanded( false );
+ // node coordinates
+ QTreeWidgetItem* coordItem = createItem( nodeItem );
+ coordItem->setText( 0, SMESHGUI_ElemInfo::tr( "COORDINATES" ) );
+ QTreeWidgetItem* xItem = createItem( coordItem );
+ xItem->setText( 0, "X" );
+ xItem->setText( 1, QString::number( node->X(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ QTreeWidgetItem* yItem = createItem( coordItem );
+ yItem->setText( 0, "Y" );
+ yItem->setText( 1, QString::number( node->Y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ QTreeWidgetItem* zItem = createItem( coordItem );
+ zItem->setText( 0, "Z" );
+ zItem->setText( 1, QString::number( node->Z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ // node connectivity
+ QTreeWidgetItem* nconItem = createItem( nodeItem );
+ nconItem->setText( 0, SMESHGUI_ElemInfo::tr( "CONNECTIVITY" ) );
+ Connectivity connectivity = nodeConnectivity( node );
+ if ( !connectivity.isEmpty() ) {
+ QString con = formatConnectivity( connectivity, SMDSAbs_0DElement );
+ if ( !con.isEmpty() ) {
+ QTreeWidgetItem* i = createItem( nconItem );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "0D_ELEMENTS" ) );
+ i->setText( 1, con );
+ }
+ con = formatConnectivity( connectivity, SMDSAbs_Edge );
+ if ( !con.isEmpty() ) {
+ QTreeWidgetItem* i = createItem( nconItem );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "EDGES" ) );
+ i->setText( 1, con );
+ i->setData( 1, TypeRole, NodeConnectivity );
+ }
+ con = formatConnectivity( connectivity, SMDSAbs_Ball );
+ if ( !con.isEmpty() ) {
+ QTreeWidgetItem* i = createItem( nconItem );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "BALL_ELEMENTS" ) );
+ i->setText( 1, con );
+ i->setData( 1, TypeRole, NodeConnectivity );
+ }
+ con = formatConnectivity( connectivity, SMDSAbs_Face );
+ if ( !con.isEmpty() ) {
+ QTreeWidgetItem* i = createItem( nconItem );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "FACES" ) );
+ i->setText( 1, con );
+ i->setData( 1, TypeRole, NodeConnectivity );
+ }
+ con = formatConnectivity( connectivity, SMDSAbs_Volume );
+ if ( !con.isEmpty() ) {
+ QTreeWidgetItem* i = createItem( nconItem );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "VOLUMES" ) );
+ i->setText( 1, con );
+ i->setData( 1, TypeRole, NodeConnectivity );
+ }
+ }
+}
/*!
\brief Internal clean-up (reset widget)
*/
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
iSingle = 1,
iTotal = iSingle,
iLinear,
- iQuadratic
+ iQuadratic,
+ iBiQuadratic
};
typedef QList<QWidget*> wlist;
protected:
void contextMenuEvent( QContextMenuEvent* e );
void information( const QList<long>& );
+ void nodeInfo( const SMDS_MeshNode*, int, int, QTreeWidgetItem* );
void clearInternal();
private slots:
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
my0DElem(0),
myBall(0),
myNbEdge(0), myNbLinEdge(0), myNbQuadEdge(0),
- myNbTrai(0), myNbLinTrai(0), myNbQuadTrai(0),
- myNbQuad(0), myNbLinQuad(0), myNbQuadQuad(0),
- myNbFace(0), myNbLinFace(0), myNbQuadFace(0),
+ myNbTrai(0), myNbLinTrai(0), myNbQuadTrai(0), myNbBiQuadTrai(0),
+ myNbQuad(0), myNbLinQuad(0), myNbQuadQuad(0), myNbBiQuadQuad(0),
+ myNbFace(0), myNbLinFace(0), myNbQuadFace(0), myNbBiQuadFace(0),
myNbPolyg(0),
- myNbHexa(0), myNbLinHexa(0), myNbQuadHexa(0),
+ myNbHexa(0), myNbLinHexa(0), myNbQuadHexa(0), myNbBiQuadHexa(0),
myNbTetra(0),myNbLinTetra(0),myNbQuadTetra(0),
myNbPyra(0), myNbLinPyra(0), myNbQuadPyra(0),
myNbPrism(0),myNbLinPrism(0), myNbQuadPrism(0),
- myNbVolum(0), myNbLinVolum(0), myNbQuadVolum(0),
+ myNbVolum(0), myNbLinVolum(0), myNbQuadVolum(0), myNbBiQuadVolum(0),
myNbHexaPrism(0),
myNbPolyh(0)
{
lab = new QLabel(tr("SMESH_MESHINFO_ORDER2"), this );
lab->setMinimumWidth(100); lab->setFont( italic );
l->addWidget( lab, row, 3 );
+ // --
+ lab = new QLabel(tr("SMESH_MESHINFO_ORDER3"), this );
+ lab->setMinimumWidth(100); lab->setFont( italic );
+ l->addWidget( lab, row, 4 );
if ( myFull )
{
// --
lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_FACES")), this);
lab->setFont( bold );
- l->addWidget( lab, row, 0 );
+ l->addWidget( lab, row, 0 );
// --
- myNbFace = new QLabel( this );
- l->addWidget( myNbFace, row, 1 );
+ myNbFace = new QLabel( this );
+ l->addWidget( myNbFace, row, 1 );
// --
- myNbLinFace = new QLabel( this );
- l->addWidget( myNbLinFace, row, 2 );
+ myNbLinFace = new QLabel( this );
+ l->addWidget( myNbLinFace, row, 2 );
// --
- myNbQuadFace = new QLabel( this );
- l->addWidget( myNbQuadFace, row, 3 );
+ myNbQuadFace = new QLabel( this );
+ l->addWidget( myNbQuadFace, row, 3 );
+ // --
+ myNbBiQuadFace = new QLabel( this );
+ l->addWidget( myNbBiQuadFace, row, 4 );
// --
row++; // increment row count
// ... triangles
lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TRIANGLES")), this );
- l->addWidget( lab, row, 0 );
+ l->addWidget( lab, row, 0 );
+ // --
+ myNbTrai = new QLabel( this );
+ l->addWidget( myNbTrai, row, 1 );
// --
- myNbTrai = new QLabel( this );
- l->addWidget( myNbTrai, row, 1 );
+ myNbLinTrai = new QLabel( this );
+ l->addWidget( myNbLinTrai, row, 2 );
// --
- myNbLinTrai = new QLabel( this );
- l->addWidget( myNbLinTrai, row, 2 );
+ myNbQuadTrai = new QLabel( this );
+ l->addWidget( myNbQuadTrai, row, 3 );
// --
- myNbQuadTrai = new QLabel( this );
- l->addWidget( myNbQuadTrai, row, 3 );
+ myNbBiQuadTrai = new QLabel( this );
+ l->addWidget( myNbBiQuadTrai, row, 4 );
// --
row++; // increment row count
// ... quadrangles
lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_QUADRANGLES")), this );
- l->addWidget( lab, row, 0 );
+ l->addWidget( lab, row, 0 );
+ // --
+ myNbQuad = new QLabel( this );
+ l->addWidget( myNbQuad, row, 1 );
// --
- myNbQuad = new QLabel( this );
- l->addWidget( myNbQuad, row, 1 );
+ myNbLinQuad = new QLabel( this );
+ l->addWidget( myNbLinQuad, row, 2 );
// --
- myNbLinQuad = new QLabel( this );
- l->addWidget( myNbLinQuad, row, 2 );
+ myNbQuadQuad = new QLabel( this );
+ l->addWidget( myNbQuadQuad, row, 3 );
// --
- myNbQuadQuad = new QLabel( this );
- l->addWidget( myNbQuadQuad, row, 3 );
+ myNbBiQuadQuad = new QLabel( this );
+ l->addWidget( myNbBiQuadQuad, row, 4 );
// --
row++; // increment row count
// ... poligones
// --
lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_VOLUMES")), this);
lab->setFont( bold );
- l->addWidget( lab, row, 0 );
+ l->addWidget( lab, row, 0 );
// --
- myNbVolum = new QLabel( this );
- l->addWidget( myNbVolum, row, 1 );
+ myNbVolum = new QLabel( this );
+ l->addWidget( myNbVolum, row, 1 );
// --
- myNbLinVolum = new QLabel( this );
- l->addWidget( myNbLinVolum, row, 2 );
+ myNbLinVolum = new QLabel( this );
+ l->addWidget( myNbLinVolum, row, 2 );
// --
- myNbQuadVolum = new QLabel( this );
- l->addWidget( myNbQuadVolum, row, 3 );
+ myNbQuadVolum = new QLabel( this );
+ l->addWidget( myNbQuadVolum, row, 3 );
+ // --
+ myNbBiQuadVolum = new QLabel( this );
+ l->addWidget( myNbBiQuadVolum, row, 4 );
// --
row++; // increment row count
// ... tetras
row++; // increment row count
// ... hexas
lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_HEXAS")), this );
- l->addWidget( lab, row, 0 );
+ l->addWidget( lab, row, 0 );
+ // --
+ myNbHexa = new QLabel( this );
+ l->addWidget( myNbHexa, row, 1 );
// --
- myNbHexa = new QLabel( this );
- l->addWidget( myNbHexa, row, 1 );
+ myNbLinHexa = new QLabel( this );
+ l->addWidget( myNbLinHexa, row, 2 );
// --
- myNbLinHexa = new QLabel( this );
- l->addWidget( myNbLinHexa, row, 2 );
+ myNbQuadHexa = new QLabel( this );
+ l->addWidget( myNbQuadHexa, row, 3 );
// --
- myNbQuadHexa = new QLabel( this );
- l->addWidget( myNbQuadHexa, row, 3 );
+ myNbBiQuadHexa = new QLabel( this );
+ l->addWidget( myNbBiQuadHexa, row, 4 );
// --
row++; // increment row count
// ... pyras
row = l->rowCount(); // retrieve current row count
// --
lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_FACES")), this);
- l->addWidget( lab, row, 0 );
+ l->addWidget( lab, row, 0 );
+ // --
+ myNbFace = new QLabel( this );
+ l->addWidget( myNbFace, row, 1 );
// --
- myNbFace = new QLabel( this );
- l->addWidget( myNbFace, row, 1 );
+ myNbLinFace = new QLabel( this );
+ l->addWidget( myNbLinFace, row, 2 );
// --
- myNbLinFace = new QLabel( this );
- l->addWidget( myNbLinFace, row, 2 );
+ myNbQuadFace = new QLabel( this );
+ l->addWidget( myNbQuadFace, row, 3 );
// --
- myNbQuadFace = new QLabel( this );
- l->addWidget( myNbQuadFace, row, 3 );
+ myNbBiQuadFace = new QLabel( this );
+ l->addWidget( myNbBiQuadFace, row, 4 );
// volumes
row = l->rowCount(); // retrieve current row count
// --
lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_VOLUMES")), this);
- l->addWidget( lab, row, 0 );
+ l->addWidget( lab, row, 0 );
// --
- myNbVolum = new QLabel( this );
- l->addWidget( myNbVolum, row, 1 );
+ myNbVolum = new QLabel( this );
+ l->addWidget( myNbVolum, row, 1 );
// --
- myNbLinVolum = new QLabel( this );
- l->addWidget( myNbLinVolum, row, 2 );
+ myNbLinVolum = new QLabel( this );
+ l->addWidget( myNbLinVolum, row, 2 );
// --
- myNbQuadVolum = new QLabel( this );
- l->addWidget( myNbQuadVolum, row, 3 );
+ myNbQuadVolum = new QLabel( this );
+ l->addWidget( myNbQuadVolum, row, 3 );
+ // --
+ myNbBiQuadVolum = new QLabel( this );
+ l->addWidget( myNbBiQuadVolum, row, 4 );
}
}
void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo)
{
// nodes
- myNbNode ->setText( QString("%1").arg( theInfo[SMDSEntity_Node] ));
+ myNbNode ->setText( QString("%1").arg( theInfo[SMDSEntity_Node] ));
//0D elements
- my0DElem ->setText( QString("%1").arg( theInfo[SMDSEntity_0D] ));
+ my0DElem ->setText( QString("%1").arg( theInfo[SMDSEntity_0D] ));
//balls
- myBall ->setText( QString("%1").arg( theInfo[SMDSEntity_Ball] ));
+ myBall ->setText( QString("%1").arg( theInfo[SMDSEntity_Ball] ));
// edges
- myNbEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] +
- theInfo[SMDSEntity_Quad_Edge] ));
- myNbLinEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] ));
- myNbQuadEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Edge] ));
+ myNbEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] +
+ theInfo[SMDSEntity_Quad_Edge] ));
+ myNbLinEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] ));
+ myNbQuadEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Edge] ));
// faces
- myNbFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
- theInfo[SMDSEntity_Quad_Triangle] +
- theInfo[SMDSEntity_BiQuad_Triangle] +
- theInfo[SMDSEntity_Quadrangle] +
- theInfo[SMDSEntity_Quad_Quadrangle] +
- theInfo[SMDSEntity_BiQuad_Quadrangle] +
- theInfo[SMDSEntity_Polygon] ));
- myNbLinFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
- theInfo[SMDSEntity_Quadrangle] +
- theInfo[SMDSEntity_Polygon] ));
- myNbQuadFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] +
- theInfo[SMDSEntity_Quad_Quadrangle] +
- theInfo[SMDSEntity_BiQuad_Quadrangle] ));
+ myNbFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
+ theInfo[SMDSEntity_Quad_Triangle] +
+ theInfo[SMDSEntity_BiQuad_Triangle] +
+ theInfo[SMDSEntity_Quadrangle] +
+ theInfo[SMDSEntity_Quad_Quadrangle] +
+ theInfo[SMDSEntity_BiQuad_Quadrangle] +
+ theInfo[SMDSEntity_Polygon] ));
+ myNbLinFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
+ theInfo[SMDSEntity_Quadrangle] +
+ theInfo[SMDSEntity_Polygon] ));
+ myNbQuadFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] +
+ theInfo[SMDSEntity_Quad_Quadrangle] ));
+ myNbBiQuadFace ->setText( QString("%1").arg( theInfo[SMDSEntity_BiQuad_Triangle] +
+ theInfo[SMDSEntity_BiQuad_Quadrangle] ));
// volumes
- myNbVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
- theInfo[SMDSEntity_Quad_Tetra] +
- theInfo[SMDSEntity_Pyramid] +
- theInfo[SMDSEntity_Quad_Pyramid] +
- theInfo[SMDSEntity_Hexa] +
- theInfo[SMDSEntity_Quad_Hexa] +
- theInfo[SMDSEntity_TriQuad_Hexa] +
- theInfo[SMDSEntity_Penta] +
- theInfo[SMDSEntity_Quad_Penta] +
- theInfo[SMDSEntity_Hexagonal_Prism] +
- theInfo[SMDSEntity_Polyhedra] ));
- myNbLinVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
- theInfo[SMDSEntity_Pyramid] +
- theInfo[SMDSEntity_Hexa] +
- theInfo[SMDSEntity_Penta] +
- theInfo[SMDSEntity_Polyhedra] ));
- myNbQuadVolum->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] +
- theInfo[SMDSEntity_Quad_Pyramid] +
- theInfo[SMDSEntity_Quad_Hexa] +
- theInfo[SMDSEntity_TriQuad_Hexa] +
- theInfo[SMDSEntity_Quad_Penta] ));
+ myNbVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
+ theInfo[SMDSEntity_Quad_Tetra] +
+ theInfo[SMDSEntity_Pyramid] +
+ theInfo[SMDSEntity_Quad_Pyramid] +
+ theInfo[SMDSEntity_Hexa] +
+ theInfo[SMDSEntity_Quad_Hexa] +
+ theInfo[SMDSEntity_TriQuad_Hexa] +
+ theInfo[SMDSEntity_Penta] +
+ theInfo[SMDSEntity_Quad_Penta] +
+ theInfo[SMDSEntity_Hexagonal_Prism] +
+ theInfo[SMDSEntity_Polyhedra] ));
+ myNbLinVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
+ theInfo[SMDSEntity_Pyramid] +
+ theInfo[SMDSEntity_Hexa] +
+ theInfo[SMDSEntity_Penta] +
+ theInfo[SMDSEntity_Polyhedra] ));
+ myNbQuadVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] +
+ theInfo[SMDSEntity_Quad_Pyramid] +
+ theInfo[SMDSEntity_Quad_Hexa] +
+ theInfo[SMDSEntity_Quad_Penta] ));
+ myNbBiQuadVolum->setText( QString("%1").arg( theInfo[SMDSEntity_TriQuad_Hexa] ));
if ( myFull )
{
// triangles
- myNbTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
- theInfo[SMDSEntity_Quad_Triangle] +
- theInfo[SMDSEntity_BiQuad_Triangle] ));
- myNbLinTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] ));
- myNbQuadTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] +
- theInfo[SMDSEntity_BiQuad_Triangle] ));
+ myNbTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
+ theInfo[SMDSEntity_Quad_Triangle] +
+ theInfo[SMDSEntity_BiQuad_Triangle] ));
+ myNbLinTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] ));
+ myNbQuadTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] ));
+ myNbBiQuadTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_BiQuad_Triangle] ));
// quadrangles
- myNbQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] +
- theInfo[SMDSEntity_Quad_Quadrangle] +
- theInfo[SMDSEntity_BiQuad_Quadrangle] ));
- myNbLinQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] ));
- myNbQuadQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Quadrangle] +
- theInfo[SMDSEntity_BiQuad_Quadrangle]));
+ myNbQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] +
+ theInfo[SMDSEntity_Quad_Quadrangle] +
+ theInfo[SMDSEntity_BiQuad_Quadrangle] ));
+ myNbLinQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] ));
+ myNbQuadQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Quadrangle] ));
+ myNbBiQuadQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_BiQuad_Quadrangle]));
// poligones
- myNbPolyg ->setText( QString("%1").arg( theInfo[SMDSEntity_Polygon] ));
+ myNbPolyg ->setText( QString("%1").arg( theInfo[SMDSEntity_Polygon] ));
// tetras
- myNbTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
- theInfo[SMDSEntity_Quad_Tetra] ));
- myNbLinTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] ));
- myNbQuadTetra->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] ));
+ myNbTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
+ theInfo[SMDSEntity_Quad_Tetra] ));
+ myNbLinTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] ));
+ myNbQuadTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] ));
// hexas
- myNbHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] +
- theInfo[SMDSEntity_TriQuad_Hexa],
- theInfo[SMDSEntity_Quad_Hexa] ));
- myNbLinHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] ));
- myNbQuadHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Hexa] +
- theInfo[SMDSEntity_TriQuad_Hexa] ));
+ myNbHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] +
+ theInfo[SMDSEntity_TriQuad_Hexa] +
+ theInfo[SMDSEntity_Quad_Hexa] ));
+ myNbLinHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] ));
+ myNbQuadHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Hexa] ));
+ myNbBiQuadHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_TriQuad_Hexa] ));
// pyras
myNbPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Pyramid] +
theInfo[SMDSEntity_Quad_Pyramid] ));
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
QLabel* myNbTrai;
QLabel* myNbLinTrai;
QLabel* myNbQuadTrai;
+ QLabel* myNbBiQuadTrai;
QLabel* myNbQuad;
QLabel* myNbLinQuad;
QLabel* myNbQuadQuad;
+ QLabel* myNbBiQuadQuad;
QLabel* myNbFace;
QLabel* myNbLinFace;
QLabel* myNbQuadFace;
+ QLabel* myNbBiQuadFace;
QLabel* myNbPolyg;
QLabel* myNbHexa;
QLabel* myNbLinHexa;
QLabel* myNbQuadHexa;
+ QLabel* myNbBiQuadHexa;
QLabel* myNbTetra;
QLabel* myNbLinTetra;
QLabel* myNbQuadTetra;
QLabel* myNbVolum;
QLabel* myNbLinVolum;
QLabel* myNbQuadVolum;
+ QLabel* myNbBiQuadVolum;
QLabel* myNbHexaPrism;
QLabel* myNbPolyh;
};
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <GEOMBase.h>
#include <GeometryGUI.h>
#include <GEOM_wrap.hxx>
+#include <GEOMImpl_Types.hxx>
// SALOME GUI includes
#include <SalomeApp_Tools.h>
// Qt includes
#include <QStringList>
#include <QLineEdit>
+#include <QApplication>
// OCCT includes
#include <TopoDS.hxx>
if ( GeometryGUI::GetGeomGen()->_is_nil() )// check that GEOM_Gen exists
GeometryGUI::InitGeomGen();
myIsOnGeometry = true;
+ myMaxShapeDim = -1;
}
//================================================================================
}
connect( myDlg, SIGNAL( hypoSet( const QString& )), SLOT( onHypoSet( const QString& )));
connect( myDlg, SIGNAL( geomSelectionByMesh( bool )), SLOT( onGeomSelectionByMesh( bool )));
-
- if ( myToCreate )
+ connect( myDlg, SIGNAL( selectMeshType( const int, const int ) ), SLOT( onAlgoSetByMeshType( const int, const int)));
+ if ( myToCreate ) {
if ( myIsMesh ) myHelpFileName = "constructing_meshes_page.html";
- else myHelpFileName = "constructing_submeshes_page.html";
- else myHelpFileName = "editing_meshes_page.html";
+ else myHelpFileName = "constructing_submeshes_page.html";
+ }
+ else {
+ myHelpFileName = "editing_meshes_page.html";
+ }
}
SMESHGUI_SelectionOp::startOperation();
-
// iterate through dimensions and get available algoritms, set them to the dialog
_PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" );
for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ )
myDlg->activateObject( SMESHGUI_MeshDlg::Obj );
myDlg->setCurrentTab( SMESH::DIM_3D );
+
+ QStringList TypeMeshList;
+ createMeshTypeList( TypeMeshList );
+ setAvailableMeshType( TypeMeshList );
+
myDlg->show();
myDlg->setGeomPopupEnabled(false);
selectionDone();
myIgnoreAlgoSelection = false;
+ myHasConcurrentSubBefore = false;
myObjectToSelect.clear();
}
onAlgoSelected(-1, i);
}
myDlg->setMaxHypoDim( shapeDim );
+ myMaxShapeDim = shapeDim;
myDlg->setHypoSets( SMESH::GetHypothesesSets( shapeDim ));
if (!myToCreate) // edition: read hypotheses
{
if (pObj != 0)
{
- SMESH::SMESH_subMesh_var aVar =
+ SMESH::SMESH_subMesh_var submeshVar =
SMESH::SMESH_subMesh::_narrow( _CAST( SObject,pObj )->GetObject() );
- myDlg->setObjectShown( SMESHGUI_MeshDlg::Mesh, !aVar->_is_nil() );
+ myDlg->setObjectShown( SMESHGUI_MeshDlg::Mesh, !submeshVar->_is_nil() );
myDlg->setObjectShown( SMESHGUI_MeshDlg::Geom, true );
myDlg->objectWg( SMESHGUI_MeshDlg::Mesh, SMESHGUI_MeshDlg::Btn )->hide();
myDlg->objectWg( SMESHGUI_MeshDlg::Geom, SMESHGUI_MeshDlg::Btn )->hide();
myDlg->updateGeometry();
myDlg->adjustSize();
readMesh();
+ myIsMesh = submeshVar->_is_nil();
}
else
myDlg->reset();
for (int i = SMESH::DIM_0D;i < SMESH::DIM_3D; ++i) {
myDlg->disableTab(i);
}
- //Hide labels and fields (Mesh ang Geometry)
+ myMaxShapeDim = -1;
+ //Hide labels and fields (Mesh and Geometry)
myDlg->setObjectShown( SMESHGUI_MeshDlg::Mesh, false );
myDlg->setObjectShown( SMESHGUI_MeshDlg::Geom, false );
myDlg->adjustSize();
readMesh();
}
+ int curIndex = myDlg->currentMeshType( );
+ QStringList TypeMeshList;
+ createMeshTypeList( TypeMeshList );
+ setAvailableMeshType( TypeMeshList );
+ curIndex =( curIndex >= TypeMeshList.count() ) ? 0 : curIndex;
+ myDlg->setCurrentMeshType( curIndex );
+ setFilteredAlgoData( myMaxShapeDim, curIndex);
}
catch ( const SALOME::SALOME_Exception& S_ex )
{
if ( myToCreate )
{
QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
- if ( aGeomEntry == "" )
+ if ( aGeomEntry.isEmpty() )
{
- theMess = tr( "GEOMETRY_OBJECT_IS_NOT_DEFINED" );
+ theMess = tr( myIsMesh ?
+ "GEOMETRY_OBJECT_IS_NOT_DEFINED_MESH" :
+ "GEOMETRY_OBJECT_IS_NOT_DEFINED_SUBMESH");
+ if ( !myIsMesh )
+ return false;
dlg()->show();
if ( SUIT_MessageBox::warning( myDlg, tr( "SMESH_WRN_WARNING" ), theMess,
SUIT_MessageBox::Yes, SUIT_MessageBox::No ) == SUIT_MessageBox::No )
theHyps.clear();
bool isAlgo = ( theHypType == Algo );
bool isAux = ( theHypType == AddHyp );
- QStringList aHypTypeNameList = SMESH::GetAvailableHypotheses( isAlgo, theDim, isAux, myIsOnGeometry );
+ QStringList aHypTypeNameList = SMESH::GetAvailableHypotheses( isAlgo, theDim, isAux, myIsOnGeometry, !myIsMesh );
QStringList::const_iterator anIter;
for ( anIter = aHypTypeNameList.begin(); anIter != aHypTypeNameList.end(); ++anIter )
//================================================================================
/*!
* \brief Gets existing hypotheses or algorithms
- * \param theDim - specifies dimension of returned hypotheses/algorifms
- * \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 theHyps - output list of names.
- * \param theHypVars - output list of variables.
- * \param theAlgoData - to select hypos able to be used by this algo (optional)
+ * \param theDim - specifies dimension of returned hypotheses/algorifms
+ * \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 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
*/
//================================================================================
-void SMESHGUI_MeshOp::existingHyps( const int theDim,
- const int theHypType,
- _PTR(SObject) theFather,
- QStringList& theHyps,
- THypList& theHypList,
+void SMESHGUI_MeshOp::existingHyps( const int theDim,
+ const int theHypType,
+ _PTR(SObject) theFather,
+ QStringList& theHyps,
+ THypList& theHypList,
HypothesisData* theAlgoData)
{
// Clear hypoheses list
if ( !aData) continue;
if ( ( theDim == -1 || aData->Dim.contains( theDim ) ) &&
( isCompatible ( theAlgoData, aData, theHypType )) &&
- ( isAux == aData->IsAux ))
+ ( theHypType == Algo || isAux == aData->IsAuxOrNeedHyp ))
{
std::string aHypName = aName->Value();
theHyps.append( aHypName.c_str() );
const bool isSubmesh = ( myToCreate ? !myIsMesh : myDlg->isObjectShown( SMESHGUI_MeshDlg::Mesh ));
+ // if ( aDim >= SMESH::DIM_2D ) myAvailableHypData[ aDim ][ Algo ] = myFilteredAlgoData[aDim];
HypothesisData* algoData = hypData( aDim, Algo, theIndex );
HypothesisData* algoByDim[4];
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 tab enabled of one less dimension
+ if ( aDim > SMESH::DIM_0D )
+ {
+ if ( isAccessibleDim( aDim - 1 ) )
+ {
+ if (( myDlg->currentMeshType() != MT_ANY ) &&
+ ( !algoData || ( myIsOnGeometry && algoData->InputTypes.isEmpty() )))
+ for (int i = aDim - 1; i >= SMESH::DIM_0D; i--)
+ if ( isAccessibleDim( i ) ) {
+ myDlg->disableTab( i );
+ setCurrentHyp(i, Algo, -1);
+ }
+ }
+ else if ( algoData && myIsOnGeometry && !algoData->InputTypes.isEmpty() )
+ {
+ myDlg->enableTab( aDim - 1 );
+ }
}
// check that algorithms of other dimentions are compatible with
// the selected one
-
- // 2 loops: backward and forward from algo dimension
+ if ( !algoData ) { // all algos becomes available
+ if (myDlg->currentMeshType() == MT_ANY || aDim == SMESH::DIM_1D || aDim == SMESH::DIM_0D)
+ availableHyps( aDim, Algo, anAvailable, myAvailableHypData[ aDim ][ Algo ]);
+ else{
+ anAvailable.clear();
+ for (int i = 0; i < myFilteredAlgoData[aDim].count(); ++i) {
+ HypothesisData* aCurAlgo = myFilteredAlgoData[aDim][ i ];
+ anAvailable.append( aCurAlgo->Label );
+ }
+ }
+ myDlg->tab( aDim )->setAvailableHyps( Algo, anAvailable );
+ }
+ // 2 loops: backward and forward from algo dimension
for ( int forward = false; forward <= true; ++forward )
{
int dim = aDim + 1, lastDim = SMESH::DIM_3D, dir = 1;
curAlgo = 0;
}
// set new available algoritms
- availableHyps( dim, Algo, anAvailable, myAvailableHypData[dim][Algo], prevAlgo );
+ if (myDlg->currentMeshType() == MT_ANY || dim == SMESH::DIM_1D || dim == SMESH::DIM_0D)
+ availableHyps( dim, Algo, anAvailable, myAvailableHypData[dim][Algo], prevAlgo );
+ else{
+ anAvailable.clear();
+ myAvailableHypData[dim][Algo].clear();
+ for (int i = 0; i < myFilteredAlgoData[dim].count(); ++i) {
+ HypothesisData* aCurAlgo = myFilteredAlgoData[dim][ i ];
+ if ( isCompatible ( prevAlgo, aCurAlgo, Algo )) {
+ anAvailable.append( aCurAlgo->Label );
+ myAvailableHypData[dim][Algo].append( aCurAlgo );
+ }
+ }
+ }
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 );
+ if ( dim == aTopDim && prevAlgo ) {// all available algoritms should be selectable any way
+ if (myDlg->currentMeshType() == MT_ANY)
+ availableHyps( dim, Algo, anAvailable, myAvailableHypData[dim][Algo], 0 );
+ }
myDlg->tab( dim )->setAvailableHyps( Algo, anAvailable );
noCompatible = anAvailable.isEmpty();
if ( !isSubmesh && algoIndex < 0 && soleCompatible && !forward && dim != SMESH::DIM_0D)
// select the sole compatible algo
algoIndex = myAvailableHypData[dim][Algo].indexOf( soleCompatible );
- setCurrentHyp( dim, Algo, algoIndex );
+ setCurrentHyp( dim, Algo, algoIndex);
// remember current algo
prevAlgo = algoByDim[ dim ] = hypData( dim, Algo, algoIndex );
bool algoDeselectedByUser = ( theDim < 0 && aDim == dim );
CORBA::String_var curHypType = curHyp->GetName();
if ( !algoDeselectedByUser &&
- myObjHyps[ dim ][ type ].count() > 0 &&
- !strcmp( curHypType, myObjHyps[ dim ][ type ].first().first->GetName()) )
+ myObjHyps[ dim ][ type ].count() > 0 &&
+ !strcmp( curHypType, myObjHyps[ dim ][ type ].first().first->GetName()) )
{
HypothesisData* hypData = SMESH::GetHypothesisData( curHyp->GetName() );
for (int i = 0; i < myAvailableHypData[ dim ][ Algo ].count(); ++i) {
}
}
// get hyps compatible with curAlgo
+ bool defaulHypAvlbl = false;
if ( curAlgo )
{
// check if a selected hyp is compatible with the curAlgo
}
existingHyps( dim, type, pObj, anExisting, myExistingHyps[ dim ][ type ], curAlgo);
availableHyps( dim, type, anAvailable, myAvailableHypData[ dim ][ type ], curAlgo);
+ defaulHypAvlbl = (type == MainHyp && !curAlgo->IsAuxOrNeedHyp );
}
// set list of hypotheses
myDlg->tab( dim )->setAvailableHyps( type, anAvailable );
- myDlg->tab( dim )->setExistingHyps( type, anExisting );
+ myDlg->tab( dim )->setExistingHyps( type, anExisting, defaulHypAvlbl );
// set current existing hypothesis
if ( !curHyp->_is_nil() && !anExisting.isEmpty() )
CORBA::String_var hypTypeName = myExistingHyps[ dim ][ type ].first().first->GetName();
bool isOptional = true;
if ( algoByDim[ dim ] &&
- SMESH::IsAvailableHypothesis( algoByDim[ dim ], hypTypeName.in(), isOptional ) &&
- !isOptional )
+ SMESH::IsAvailableHypothesis( algoByDim[ dim ], hypTypeName.in(), isOptional ) &&
+ !isOptional )
hypIndex = 0;
}
setCurrentHyp( dim, type, hypIndex );
{
theMess = "";
- //QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
- //QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
-
QStringList aList;
myDlg->selectedObject( SMESHGUI_MeshDlg::Geom, aList );
if ( aList.isEmpty() )
}
return true;
}
+ QString namePrefix;
+ if ( aList.count() > 1 )
+ {
+ namePrefix = myDlg->objectText( SMESHGUI_MeshDlg::Obj );
+ int i = namePrefix.length() - 1;
+ while ( i > 0 && namePrefix[i].isDigit() )
+ --i;
+ if ( i < namePrefix.length() - 1 )
+ namePrefix.chop( namePrefix.length() - 1 - i );
+ else
+ namePrefix += "_";
+ }
QStringList::Iterator it = aList.begin();
- for ( ; it!=aList.end(); it++)
+ for ( int i = 0; it!=aList.end(); it++, ++i )
{
QString aGeomEntry = *it;
_PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
return false;
_PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshVar.in() );
if ( aMeshSO ) {
- SMESH::SetName( aMeshSO, myDlg->objectText( SMESHGUI_MeshDlg::Obj ) );
theEntryList.append( aMeshSO->GetID().c_str() );
+ if ( i > 0 ) setDefaultName( namePrefix );
+ SMESH::SetName( aMeshSO, myDlg->objectText( SMESHGUI_MeshDlg::Obj ) );
}
for ( int aDim = SMESH::DIM_0D; aDim <= SMESH::DIM_3D; aDim++ ) {
selectObject( _PTR(SObject)() );
selectionDone();
+ checkSubMeshConcurrency( aMeshVar, aSubMeshVar, /*askUser=*/true );
+
return true;
}
* Generates and sets default mesh/submesh name(Mesh_1, Mesh_2, etc.)
*/
//================================================================================
-void SMESHGUI_MeshOp::setDefaultName() const
+void SMESHGUI_MeshOp::setDefaultName( const QString& thePrefix ) const
{
QString aResName;
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
int i = 1;
- QString aPrefix = tr( myIsMesh ? "SMESH_OBJECT_MESH" : "SMESH_SUBMESH" ) + "_";
+
+ QString aPrefix = thePrefix;
+ if ( aPrefix.isEmpty() )
+ aPrefix = tr( myIsMesh ? "SMESH_OBJECT_MESH" : "SMESH_SUBMESH" ) + "_";
+
_PTR(SObject) anObj;
do
{
//================================================================================
/*!
- * \brief Reads parameters of an edited mesh and assigns them to the dialog
+ * \brief Reads parameters of an edited mesh/sub-mesh and assigns them to the dialog
*
* Called when mesh is edited only.
*/
QString aMeshName = name( aMeshSO );
myDlg->setObjectText( SMESHGUI_MeshDlg::Mesh, aMeshName );
}
+ myHasConcurrentSubBefore = checkSubMeshConcurrency( aMeshVar, aSubMeshVar );
}
// Get name of geometry object
// Get hypotheses and algorithms assigned to the mesh/sub-mesh
QStringList anExisting;
const int lastDim = ( myIsOnGeometry ) ? SMESH::DIM_0D : SMESH::DIM_3D;
+ bool algoFound = false;
for ( int dim = SMESH::DIM_3D; dim >= lastDim; --dim )
{
// get algorithm
// myAvailableHypData[ dim ][ Algo ].push_back( algoData );
// aHypIndex = myAvailableHypData[ dim ][ hypType ].count() - 1;
// }
+ algoFound = ( aHypIndex > -1 );
}
setCurrentHyp( dim, Algo, aHypIndex );
// set existing and available hypothesis according to the selected algo
- onAlgoSelected( aHypIndex, dim );
+ if ( aHypIndex > -1 || !algoFound )
+ onAlgoSelected( aHypIndex, dim );
}
// get hypotheses
}
}
+ SALOMEDS_SObject* aSObject = _CAST(SObject, pObj);
+ CORBA::Object_var anObject = aSObject->GetObject();
+ SMESH::SMESH_Mesh_var aMeshVar = SMESH::SMESH_Mesh::_narrow( anObject );
+ SMESH::SMESH_subMesh_var aSubMeshVar = SMESH::SMESH_subMesh::_narrow( anObject );
+ bool isMesh = !aMeshVar->_is_nil();
+ if ( !isMesh && !aSubMeshVar->_is_nil() )
+ aMeshVar = aSubMeshVar->GetFather();
+
// Assign new algorithms and hypotheses
for ( int dim = aDim; dim <= SMESH::DIM_3D; dim++ )
{
if ( !anAlgoVar->_is_nil() && // some algo selected and
myObjHyps[ dim ][ Algo ].count() == 0 ) // no algo assigned
{
- SALOMEDS_SObject* aSObject = _CAST(SObject, pObj);
- CORBA::Object_var anObject = aSObject->GetObject();
- SMESH::SMESH_Mesh_var aMeshVar = SMESH::SMESH_Mesh::_narrow( anObject );
- bool isMesh = !aMeshVar->_is_nil();
- if ( isMesh ) {
+ if ( isMesh )
SMESH::AddHypothesisOnMesh( aMeshVar, anAlgoVar );
- } else {
- SMESH::SMESH_subMesh_var aVar =
- SMESH::SMESH_subMesh::_narrow( _CAST(SObject,pObj)->GetObject() );
- if ( !aVar->_is_nil() )
- SMESH::AddHypothesisOnSubMesh( aVar, anAlgoVar );
- }
+ else if ( !aSubMeshVar->_is_nil() )
+ SMESH::AddHypothesisOnSubMesh( aSubMeshVar, anAlgoVar );
+
myObjHyps[ dim ][ Algo ].append( THypItem( anAlgoVar, aName) );
}
}
// assign new hypotheses
- if ( aNewHypIndex != anOldHypIndex && aNewHypIndex != -1 )
+ if ( aNewHypIndex != anOldHypIndex && aNewHypIndex > -1 )
{
- SMESH::SMESH_Mesh_var aMeshVar =
- SMESH::SMESH_Mesh::_narrow( _CAST(SObject,pObj)->GetObject() );
- bool isMesh = !aMeshVar->_is_nil();
if ( isMesh )
- {
SMESH::AddHypothesisOnMesh
(aMeshVar, myExistingHyps[ dim ][ hypType ][ aNewHypIndex ].first );
- }
- else
- {
- SMESH::SMESH_subMesh_var aVar =
- SMESH::SMESH_subMesh::_narrow( _CAST(SObject,pObj)->GetObject() );
- if ( !aVar->_is_nil() )
- SMESH::AddHypothesisOnSubMesh
- ( aVar, myExistingHyps[ dim ][ hypType ][ aNewHypIndex ].first );
- }
+ else if ( !aSubMeshVar->_is_nil() )
+ SMESH::AddHypothesisOnSubMesh
+ ( aSubMeshVar, myExistingHyps[ dim ][ hypType ][ aNewHypIndex ].first );
}
// reread all hypotheses of mesh if necessary
QStringList anExisting;
}
}
+ myHasConcurrentSubBefore =
+ checkSubMeshConcurrency( aMeshVar, aSubMeshVar, /*askUser=*/!myHasConcurrentSubBefore );
+
return true;
}
+//================================================================================
+/*!
+ * \brief Checks if a concurrent sub-meshes appear as result of sub-mesh
+ * creation/edition and, if (askUser) , proposes the uses to set up a desired
+ * order of sub-mesh computation.
+ * Returns \c true if a sub-mesh concurrency detected.
+ */
+//================================================================================
+
+bool SMESHGUI_MeshOp::checkSubMeshConcurrency(SMESH::SMESH_Mesh_ptr mesh,
+ SMESH::SMESH_subMesh_ptr submesh,
+ bool askUser)
+{
+ if ( CORBA::is_nil( mesh ) || CORBA::is_nil( submesh ))
+ return false;
+
+ bool isNewConcurrent = mesh->IsUnorderedSubMesh( submesh->GetId() );
+ if ( isNewConcurrent && askUser )
+ {
+ int butID = SUIT_MessageBox::warning( myDlg->parentWidget(), tr( "SMESH_WARNING" ),
+ tr("CONCURRENT_SUBMESH_APPEARS"),
+ tr("SMESH_BUT_YES"), tr("SMESH_BUT_NO"));
+ if ( butID == 0 )
+ {
+ _PTR(SObject) meshSO = SMESH::FindSObject( mesh );
+ LightApp_SelectionMgr* aSelectionMgr = selectionMgr();
+ if ( meshSO && aSelectionMgr )
+ {
+ myDlg->setEnabled( false ); // disactivate selection
+ selectionMgr()->clearFilters();
+ selectObject( meshSO );
+ SMESHGUI::GetSMESHGUI()->OnGUIEvent( 713 ); // MESH_ORDER
+ qApp->processEvents();
+
+ myDlg->setEnabled( true );
+ int obj = myDlg->getActiveObject();
+ onActivateObject( obj ); // restore filter
+ if ( !myToCreate )
+ {
+ selectObject( SMESH::FindSObject( submesh ));
+ selectionDone();
+ }
+ }
+ }
+ }
+
+ return isNewConcurrent;
+}
+
//================================================================================
/*!
* \brief Verifies whether given operator is valid for this one
sm->setSelectedObjects( anIOList, false );
}
}
+//================================================================================
+/*!
+ * \brief Create available list types of mesh
+ * \param theTypeMesh - Output list of available types of mesh
+ */
+//================================================================================
+void SMESHGUI_MeshOp::createMeshTypeList( QStringList& theTypeMesh)
+{
+ theTypeMesh.clear();
+ theTypeMesh.append( tr( "MT_ANY" ) );
+ if ( myMaxShapeDim >= 2 || myMaxShapeDim == -1 )
+ {
+ theTypeMesh.append( tr( "MT_TRIANGULAR" ) );
+ theTypeMesh.append( tr( "MT_QUADRILATERAL" ) );
+ }
+ if ( myMaxShapeDim == 3 || myMaxShapeDim == -1 )
+ {
+ theTypeMesh.append( tr( "MT_TETRAHEDRAL" ) );
+ theTypeMesh.append( tr( "MT_HEXAHEDRAL" ) );
+ }
+
+}
+//================================================================================
+/*!
+ * \brief Set available types of mesh
+ * \param theTypeMesh - List of available types of mesh
+ */
+//================================================================================
+void SMESHGUI_MeshOp::setAvailableMeshType( const QStringList& theTypeMesh )
+{
+ myDlg->setAvailableMeshType( theTypeMesh );
+}
+
+//================================================================================
+/*!
+ * \brief SLOT. Is called when the user select type of mesh
+ * \param theTabIndex - Index of current active tab
+ * \param theIndex - Index of current type of mesh
+ */
+//================================================================================
+void SMESHGUI_MeshOp::onAlgoSetByMeshType( const int theTabIndex, const int theIndex)
+{
+ setFilteredAlgoData( theTabIndex, theIndex);
+}
+
+//================================================================================
+/*!
+ * \brief Set a filtered list of available algorithms by mesh type
+ * \param theTabIndex - Index of current active tab
+ * \param theIndex - Index of current type of mesh
+ */
+//================================================================================
+void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theIndex)
+{
+ int aDim;
+ THypDataList anAvailableAlgsData;
+ QStringList anAvailableAlgs;
+ QString anCompareType = "";
+ bool isAvailableChoiceAlgo = false;
+ int anCurrentAvailableAlgo = 0;
+ bool isNone = true;
+ switch ( theIndex ) {
+ case MT_ANY:
+ anCompareType = "ANY";
+ aDim = SMESH::DIM_3D;
+ break;
+ case MT_TRIANGULAR:
+ aDim = SMESH::DIM_2D;
+ anCompareType = "TRIA";
+ break;
+ case MT_QUADRILATERAL:
+ aDim = SMESH::DIM_2D;
+ anCompareType = "QUAD";
+ break;
+ case MT_TETRAHEDRAL:
+ aDim = SMESH::DIM_3D;
+ anCompareType = "TETRA";
+ break;
+ case MT_HEXAHEDRAL:
+ aDim = SMESH::DIM_3D;
+ anCompareType = "HEXA";
+ break;
+ default:;
+ }
+
+ bool toCheckIsApplicableToAll = !myIsMesh;
+ GEOM::GEOM_Object_var aGeomVar;
+ QString anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
+ if ( _PTR(SObject) so = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
+ {
+ CORBA::Object_var obj = _CAST( SObject,so )->GetObject();
+ aGeomVar = GEOM::GEOM_Object::_narrow( obj );
+ if ( !aGeomVar->_is_nil() && toCheckIsApplicableToAll )
+ toCheckIsApplicableToAll = ( aGeomVar->GetType() == GEOM_GROUP );
+ }
+
+ if ( anCompareType == "ANY" )
+ {
+ for ( int dim = SMESH::DIM_2D; dim <= SMESH::DIM_3D; dim++ )
+ {
+ isNone = currentHyp( dim, Algo ) < 0;
+ isAvailableChoiceAlgo = false;
+ // retrieves a list of available algorithms from resources
+ availableHyps( dim, Algo, anAvailableAlgs, anAvailableAlgsData );
+ //return current algo in current tab and set new algorithm list
+ HypothesisData* algoCur;
+ if ( !isNone && !myAvailableHypData[dim][Algo].empty() ) {
+ algoCur = myAvailableHypData[dim][Algo].at( currentHyp( dim, Algo ) );
+ }
+ myAvailableHypData[dim][Algo].clear();
+ anAvailableAlgs.clear();
+ for (int i = 0 ; i < anAvailableAlgsData.count(); i++)
+ {
+ HypothesisData* curAlgo = anAvailableAlgsData.at(i);
+ if ( aGeomVar->_is_nil() ||
+ SMESH::IsApplicable( curAlgo->TypeName, aGeomVar, toCheckIsApplicableToAll ))
+ {
+ anAvailableAlgs.append( curAlgo->Label );
+ myAvailableHypData[dim][Algo].append( curAlgo );
+ }
+ }
+ if ( !isNone && algoCur ) {
+ for (int i = 0 ; i < myAvailableHypData[dim][Algo].count(); i++)
+ {
+ HypothesisData* algoAny = myAvailableHypData[dim][Algo].at(i);
+ if ( algoAny->Label == algoCur->Label ){
+ isAvailableChoiceAlgo = true;
+ anCurrentAvailableAlgo = i;
+ break;
+ }
+ }
+ }
+ else if ( !isNone ) {
+ isAvailableChoiceAlgo = true;
+ anCurrentAvailableAlgo = currentHyp( dim, Algo );
+ }
+ myDlg->tab( dim )->setAvailableHyps( Algo, anAvailableAlgs );
+ if ( isAvailableChoiceAlgo )
+ setCurrentHyp( dim, Algo, anCurrentAvailableAlgo );
+ }
+ if ( !myIsOnGeometry )
+ for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ ) {
+ if ( i < SMESH::DIM_3D ) myDlg->disableTab( i );
+ else myDlg->enableTab( i );
+ }
+ else
+ for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ ) {
+ if ( i > myMaxShapeDim ) myDlg->disableTab( i );
+ else myDlg->enableTab( i );
+ }
+ myDlg->setCurrentTab( theTabIndex );
+ }
+ else
+ {
+ QString anCurrentAlgo;
+ bool isReqDisBound = true;
+ QString anCurrentCompareType = anCompareType;
+ isNone = currentHyp( aDim, Algo ) < 0;
+ if ( !isNone && !myAvailableHypData[aDim][Algo].empty() &&
+ myAvailableHypData[aDim][Algo].count() != anAvailableAlgsData.count() )
+ isReqDisBound = myAvailableHypData[aDim][Algo].at( currentHyp( aDim, Algo ) )->InputTypes.isEmpty();
+ else if ( !isNone )
+ isReqDisBound = anAvailableAlgsData.at( currentHyp( aDim, Algo ) )->InputTypes.isEmpty();
+ for ( int dim = aDim; dim >= SMESH::DIM_2D; dim-- )
+ {
+ bool isNoneAlg = currentHyp( dim, Algo ) < 0;
+ isAvailableChoiceAlgo = false;
+ // retrieves a list of available algorithms from resources
+ availableHyps( dim, Algo, anAvailableAlgs, anAvailableAlgsData );
+ // finding algorithm which is selected
+ if ( !isNoneAlg && !myAvailableHypData[dim][Algo].empty() &&
+ myAvailableHypData[dim][Algo].count() != anAvailableAlgsData.count() )
+ anCurrentAlgo = myAvailableHypData[dim][Algo].at( currentHyp( dim, Algo ) )->Label;
+ else if ( !isNoneAlg )
+ anCurrentAlgo = anAvailableAlgsData.at( currentHyp( dim, Algo ) )->Label;
+ anAvailableAlgs.clear();
+ myAvailableHypData[dim][Algo].clear();
+ myFilteredAlgoData[dim].clear();
+ // finding and adding algorithm depending on the type mesh
+ for ( int i = 0 ; i < anAvailableAlgsData.count(); i++ )
+ {
+ HypothesisData* algoIn = anAvailableAlgsData.at( i );
+ bool isAvailableAlgo = ( algoIn->OutputTypes.count() == 0 );
+ QStringList::const_iterator inElemType = algoIn->OutputTypes.begin();
+ for ( ; inElemType != algoIn->OutputTypes.end(); inElemType++ )
+ {
+ if ( *inElemType == anCurrentCompareType ) {
+ isAvailableAlgo = true;
+ break;
+ }
+ }
+ if ( isAvailableAlgo || algoIn->OutputTypes.count()==0 ) {
+ if ( aGeomVar->_is_nil() || myMaxShapeDim != dim ||
+ SMESH::IsApplicable( algoIn->TypeName, aGeomVar, toCheckIsApplicableToAll ))
+ {
+ anAvailableAlgs.append( algoIn->Label );
+ myAvailableHypData[dim][Algo].append( algoIn );
+ myFilteredAlgoData[dim].append( algoIn );
+ }
+ }
+ //algorithm will be active, if the chosen algorithm available in the current mesh type
+ if ( !isNoneAlg && isAvailableAlgo && algoIn->Label == anCurrentAlgo ) {
+ isAvailableChoiceAlgo = true;
+ anCurrentAvailableAlgo = anAvailableAlgs.count() - 1 ;
+ }
+ }
+ //set new algorithm list and select the current algorithm
+ myDlg->tab( dim )->setAvailableHyps( Algo, anAvailableAlgs );
+ anCurrentCompareType = ( anCompareType == "HEXA" ) ? "QUAD" : "TRIA";
+ if ( isAvailableChoiceAlgo )
+ setCurrentHyp( dim, Algo, anCurrentAvailableAlgo );
+ else
+ setCurrentHyp( dim, Algo, -1 );
+ }
+
+ if ( isNone || isReqDisBound ) {
+ for ( int i = SMESH::DIM_0D; i <= myMaxShapeDim; i++ ) {
+ if ( aDim != i ) {
+ myDlg->disableTab( i );
+ setCurrentHyp(i, Algo, -1);
+ }
+ }
+ }
+ else if ( !isNone ) {
+ if ( aDim == SMESH::DIM_2D){
+ myDlg->disableTab( SMESH::DIM_3D );
+ setCurrentHyp( SMESH::DIM_3D, Algo, -1);
+ }
+ for ( int i = myMaxShapeDim; i > SMESH::DIM_0D; i-- )
+ {
+ isReqDisBound = ( currentHyp( i, Algo ) < 0 ) ? true :
+ myAvailableHypData[i][Algo].at( currentHyp( i, Algo ) )->InputTypes.isEmpty();
+ if ( isReqDisBound ) {
+ for (int j = i - 1; j >= SMESH::DIM_0D; j--){
+ myDlg->disableTab( j );
+ setCurrentHyp( j , Algo, -1 );
+ }
+ break;
+ }
+ }
+ }
+ myDlg->enableTab( aDim );
+ myDlg->setCurrentTab( aDim );
+ }
+ QStringList aHypothesesSetsList = SMESH::GetHypothesesSets( aDim );
+ QStringList aFilteredHypothesesSetsList;
+ aFilteredHypothesesSetsList.clear();
+ QStringList::const_iterator inHypoSetName = aHypothesesSetsList.begin();
+ for ( ; inHypoSetName != aHypothesesSetsList.end(); ++inHypoSetName )
+ {
+ HypothesesSet* currentHypoSet = SMESH::GetHypothesesSet( *inHypoSetName );
+ bool isAvailable = false;
+ currentHypoSet->init( true );
+ while ( currentHypoSet->next(), currentHypoSet->more() )
+ {
+ isAvailable = false;
+ if ( HypothesisData* algoDataIn = SMESH::GetHypothesisData( currentHypoSet->current() ))
+ {
+ for (int i = SMESH::DIM_0D; i <= myMaxShapeDim; i++)
+ {
+ for (int j = 0; j < myAvailableHypData[i][Algo].count(); ++j) {
+ HypothesisData* aCurAlgo = hypData( i, Algo, j );
+ if ( aCurAlgo->Label == algoDataIn->Label ){
+ isAvailable = true;
+ break;
+ }
+ }
+ if ( isAvailable ) break;
+ }
+ if ( !isAvailable ) break;
+ }
+ }
+ if ( isAvailable )
+ aFilteredHypothesesSetsList.append( *inHypoSetName );
+ }
+ myDlg->setHypoSets( aFilteredHypothesesSetsList );
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
public:
enum HypType{ Algo = 0, MainHyp, AddHyp, NbHypTypes };
+ enum MeshType{ MT_ANY = 0, MT_TRIANGULAR, MT_QUADRILATERAL, MT_TETRAHEDRAL, MT_HEXAHEDRAL };
typedef std::pair<SMESH::SMESH_Hypothesis_var, QString> THypItem;
typedef QList< THypItem > THypList;
void processSet();
void onHypoCreated( int );
void onHypoEdited( int );
+ void onAlgoSetByMeshType( const int, const int );
private:
typedef QList<HypothesisData*> THypDataList; // typedef: list of hypothesis data
bool createMesh( QString&, QStringList& );
bool createSubMesh( QString&, QStringList& );
bool editMeshOrSubMesh( QString& );
+ bool checkSubMeshConcurrency( SMESH::SMESH_Mesh_ptr mesh,
+ SMESH::SMESH_subMesh_ptr submesh,
+ bool askUser=false);
int currentHyp( const int, const int ) const;
bool isAccessibleDim( const int ) const;
void setCurrentHyp( const int, const int, const int );
- void setDefaultName() const;
+ void setDefaultName( const QString& prefix="" ) const;
SMESH::SMESH_Hypothesis_var getAlgo( const int );
void readMesh();
QString name( _PTR(SObject) ) const;
char* isSubmeshIgnored() const;
_PTR(SObject) getSubmeshByGeom() const;
void selectObject( _PTR(SObject) ) const;
-
+ void createMeshTypeList( QStringList& );
+ void setAvailableMeshType( const QStringList& );
+ void setFilteredAlgoData( const int, const int );
private:
SMESHGUI_MeshDlg* myDlg;
SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
bool myToCreate;
bool myIsMesh;
bool myIsOnGeometry; //!< TRUE if edited mesh accotiated with geometrical object
+ bool myHasConcurrentSubBefore;
TDim2Type2HypList myExistingHyps; //!< all hypothesis of SMESH module
TDim2Type2HypList myObjHyps; //!< hypothesis assigned to the current
// edited mesh/sub-mesh
-
// hypdata corresponding to hypotheses present in myDlg
THypDataList myAvailableHypData[4][NbHypTypes];
-
+ THypDataList myFilteredAlgoData[4];
bool myIgnoreAlgoSelection;
HypothesesSet* myHypoSet;
- int myDim, myType;
+ int myDim, myType, myMaxShapeDim;
QString myObjectToSelect;
};
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
_PTR(SObject) aSmObj = smIter->Value();
SMESH::SMESH_subMesh_var sm =
SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( aSmObj );
- mapOfSubMesh[ sm->GetId() ] = SMESH::SMESH_subMesh::_duplicate(sm);
+ if ( !sm->_is_nil() )
+ mapOfSubMesh[ sm->GetId() ] = SMESH::SMESH_subMesh::_duplicate(sm);
}
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
aDlgLay->setMargin( MARGIN );
aDlgLay->setSpacing( SPACING );
- QWidget* aMainFrame = createMainFrame ( this );
+ myMainFrame = createMainFrame ( this );
QWidget* aBtnFrame = createButtonFrame( this );
- aDlgLay->addWidget( aMainFrame );
+ aDlgLay->addWidget( myMainFrame );
aDlgLay->addWidget( aBtnFrame );
- aDlgLay->setStretchFactor( aMainFrame, 1 );
+ aDlgLay->setStretchFactor( myMainFrame, 1 );
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
myNode2Lbl->show();
myNode2 ->show();
}
-
mySelInput = Mesh;
activateSelection();
updateWgState();
displayPreview();
+ myPicture2d->hide();
+ myPicture2d->show();
+ myPicture2d->resize(minimumSizeHint());
+ myMainFrame->hide();
+ myMainFrame->show();
+ resize(minimumSizeHint());
}
//=======================================================================
{
on ? myRefineGrp->show() : myRefineGrp->hide();
on ? myGeomGrp->hide() : myGeomGrp->show();
-
+ myMainFrame->hide();
+ myMainFrame->show();
displayPreview();
+ resize(minimumSizeHint());
}
//=======================================================================
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
QMap<int, QLineEdit*> mySelEdit;
QMap<int, QLabel*> mySelLbl;
+ QWidget* myMainFrame;
+
QLineEdit* myName;
QPushButton* myOpenBtn;
QPushButton* myNewBtn;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_MeshEditPreview.h"
-#include <SMESH_Actor.h>
-#include <SMESH_TypeFilter.hxx>
-#include <SMDS_Mesh.hxx>
+#include "SMDS_Mesh.hxx"
+#include "SMDS_MeshNode.hxx"
+#include "SMDS_VolumeTool.hxx"
+#include "SMESH_Actor.h"
+#include "SMESH_MeshAlgos.hxx"
+#include "SMESH_TypeFilter.hxx"
// SALOME GUI includes
#include <SUIT_Desktop.h>
#include <VTKViewer_CellLocationsArray.h>
// OCCT includes
-#include <TColStd_IndexedMapOfInteger.hxx>
+#include <Bnd_B3d.hxx>
#include <TColStd_DataMapOfIntegerInteger.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <gp_Ax1.hxx>
// VTK includes
#include <vtkIdList.h>
// Purpose : Constructor
//=======================================================================
SMESHGUI_MultiEditDlg
-::SMESHGUI_MultiEditDlg(SMESHGUI* theModule,
- const int theMode,
- const bool the3d2d):
+::SMESHGUI_MultiEditDlg(SMESHGUI* theModule,
+ const int theMode,
+ const bool the3d2d,
+ bool theDoInit):
SMESHGUI_PreviewDlg(theModule),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
aDlgLay->addWidget(aMainFrame);
aDlgLay->addWidget(aBtnFrame);
- Init();
+ if ( theDoInit )
+ Init();
}
//=======================================================================
QRadioButton* aFaceRb = new QRadioButton(tr("SMESH_FACE"), aEntityTypeGrp);
QRadioButton* aVolumeRb = new QRadioButton(tr("SMESH_VOLUME"), aEntityTypeGrp);
+
aEntityLayout->addWidget(aFaceRb);
aEntityLayout->addWidget(aVolumeRb);
myComboBoxFunctor->addItem(tr("ASPECTRATIO_ELEMENTS"));
myComboBoxFunctor->addItem(tr("MINIMUMANGLE_ELEMENTS"));
myComboBoxFunctor->addItem(tr("SKEW_ELEMENTS"));
- //myComboBoxFunctor->addItem(tr("AREA_ELEMENTS"));
- //myComboBoxFunctor->addItem(tr("LENGTH2D_EDGES")); // for existing elements only
- //myComboBoxFunctor->addItem(tr("MULTI2D_BORDERS")); // for existing elements only
myComboBoxFunctor->setCurrentIndex(0);
aCriterionLayout->addWidget(myChoiceWidget);
bool SMESHGUI_MultiEditDlg::isValid (const bool /*theMess*/)
{
return (!myMesh->_is_nil() &&
- (myListBox->count() > 0 || (myToAllChk->isChecked()/* && myActor*/)));
+ (myListBox->count() > 0 || (myToAllChk->isChecked() && nbElemsInMesh() > 0)));
}
//=======================================================================
return theEditor->ReorientObject( obj );
}
+int SMESHGUI_ChangeOrientationDlg::nbElemsInMesh()
+{
+ return ( myFilterType = SMESH::FaceFilter ) ? myMesh->NbFaces() : myMesh->NbVolumes();
+}
+
/*!
* Class : SMESHGUI_UnionOfTrianglesDlg
* Description : Construction of quadrangles by automatic association of triangles
ok = theEditor->TriToQuadObject(obj, aCriterion, aMaxAngle);
return ok;
}
+
+int SMESHGUI_UnionOfTrianglesDlg::nbElemsInMesh()
+{
+ return myMesh->NbTriangles();
+}
void SMESHGUI_UnionOfTrianglesDlg::onDisplaySimulation( bool toDisplayPreview )
{
if ( myPreviewCheckBox->isChecked() && toDisplayPreview ) {
if ( isValid( true ) ) {
try{
- SUIT_OverrideCursor aWaitCursor;
- // get Ids of elements
- SMESH::SMESH_IDSource_var obj;
- SMESH::long_array_var anElemIds = getIds( obj );
+ SUIT_OverrideCursor aWaitCursor;
+ // get Ids of elements
+ SMESH::SMESH_IDSource_var obj;
+ SMESH::long_array_var anElemIds = getIds( obj );
- SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
+ SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
- double aMaxAngle = myMaxAngleSpin->GetValue() * M_PI / 180.0;
+ double aMaxAngle = myMaxAngleSpin->GetValue() * M_PI / 180.0;
- if ( CORBA::is_nil( obj ) )
- aMeshEditor->TriToQuad( anElemIds.inout(), aCriterion, aMaxAngle );
- else
- aMeshEditor->TriToQuadObject( obj, aCriterion, aMaxAngle );
+ if ( CORBA::is_nil( obj ) )
+ aMeshEditor->TriToQuad( anElemIds.inout(), aCriterion, aMaxAngle );
+ else
+ aMeshEditor->TriToQuadObject( obj, aCriterion, aMaxAngle );
- SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
+ SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
- vtkProperty* aProp = vtkProperty::New();
- aProp->SetRepresentationToWireframe();
- aProp->SetColor( 250, 0, 250 );
- aProp->SetLineWidth( SMESH::GetFloat( "SMESH:element_width", 1 ) + 3 );
- mySimulation->GetActor()->SetProperty( aProp );
- aProp->Delete();
+ vtkProperty* aProp = vtkProperty::New();
+ aProp->SetRepresentationToWireframe();
+ aProp->SetColor( 250, 0, 250 );
+ aProp->SetLineWidth( SMESH::GetFloat( "SMESH:element_width", 1 ) + 3 );
+ mySimulation->GetActor()->SetProperty( aProp );
+ aProp->Delete();
- mySimulation->SetData( aMeshPreviewStruct._retn() );
+ mySimulation->SetData( aMeshPreviewStruct._retn() );
} catch ( ... ) {
- hidePreview();
+ hidePreview();
}
} else {
hidePreview();
return hasObj ? theEditor->QuadToTriObject(obj, aCrit) : theEditor->QuadToTri(theIds, aCrit);
}
+int SMESHGUI_CuttingOfQuadsDlg::nbElemsInMesh()
+{
+ return myMesh->NbQuadrangles();
+}
+
+
void SMESHGUI_CuttingOfQuadsDlg::onCriterionRB()
{
if (myGroupChoice->checkedId() == 2) // Use numeric functor
}
/*!
- * Class : SMESHGUI_CuttingIntoTetraDlg
- * Description : Modification of orientation of faces
+ * Class : SMESHGUI_SplitVolumesDlg
+ * Description : Spliter of volumes into tetrahedra or prisms
*/
-SMESHGUI_CuttingIntoTetraDlg::SMESHGUI_CuttingIntoTetraDlg(SMESHGUI* theModule)
- : SMESHGUI_MultiEditDlg(theModule, SMESH::VolumeFilter, false)
+SMESHGUI_SplitVolumesDlg::SMESHGUI_SplitVolumesDlg(SMESHGUI* theModule)
+ : SMESHGUI_MultiEditDlg(theModule, SMESH::VolumeFilter, /*the3d2d=*/true, /*doInit=*/false)
{
setWindowTitle(tr("CAPTION"));
myHelpFileName = "split_to_tetra_page.html";
myEntityType = 1;
+ myCellSize = -1.;
+
+ // Facet selection group
+
+ myFacetSelGrp = new QGroupBox(tr("FACET_TO_SPLIT"), myCriterionGrp->parentWidget());
+ QGridLayout* facetSelLayout = new QGridLayout( myFacetSelGrp );
+ facetSelLayout->setMargin(MARGIN);
+ facetSelLayout->setSpacing(SPACING);
+
+ QLabel* pointLbl = new QLabel( tr("START_POINT"), myFacetSelGrp);
+ QLabel* normalLbl = new QLabel( tr("FACET_NORMAL"), myFacetSelGrp);
+ myFacetSelBtn = new QPushButton( mySubmeshBtn->icon(), "", myFacetSelGrp );
+ myFacetSelBtn->setCheckable( true );
+ QLabel* XLbl = new QLabel( tr("SMESH_X"), myFacetSelGrp);
+ QLabel* YLbl = new QLabel( tr("SMESH_Y"), myFacetSelGrp);
+ QLabel* ZLbl = new QLabel( tr("SMESH_Z"), myFacetSelGrp);
+ QLabel* dXLbl = new QLabel( tr("SMESH_DX"), myFacetSelGrp);
+ QLabel* dYLbl = new QLabel( tr("SMESH_DY"), myFacetSelGrp);
+ QLabel* dZLbl = new QLabel( tr("SMESH_DZ"), myFacetSelGrp);
+ QPushButton* axisBtn[3];
+ for ( int i = 0; i < 3; ++i )
+ {
+ myPointSpin[i] = new SMESHGUI_SpinBox( myFacetSelGrp );
+ myDirSpin [i] = new SMESHGUI_SpinBox( myFacetSelGrp );
+ myPointSpin[i]->RangeStepAndValidator( -1e10, 1e10, 10 );
+ myDirSpin [i]->RangeStepAndValidator( -1., 1., 0.1 );
+ myPointSpin[i]->SetValue(0.);
+ myDirSpin [i]->SetValue(0.);
+ myAxisBtn [i] = new QPushButton( QString("|| O") + char('X'+i ), myFacetSelGrp);
+ }
+ myDirSpin[2]->SetValue(1.);
+
+ myAllDomainsChk = new QCheckBox( tr("ALL_DOMAINS"), mySelGrp );
+
+ facetSelLayout->addWidget( pointLbl, 0, 0 );
+ facetSelLayout->addWidget( myFacetSelBtn, 0, 1 );
+ facetSelLayout->addWidget( XLbl, 0, 2 );
+ facetSelLayout->addWidget( myPointSpin[0],0, 3 );
+ facetSelLayout->addWidget( YLbl, 0, 4 );
+ facetSelLayout->addWidget( myPointSpin[1],0, 5 );
+ facetSelLayout->addWidget( ZLbl, 0, 6 );
+ facetSelLayout->addWidget( myPointSpin[2],0, 7 );
+
+ facetSelLayout->addWidget( normalLbl, 1, 0 );
+ facetSelLayout->addWidget( dXLbl, 1, 2 );
+ facetSelLayout->addWidget( myDirSpin[0], 1, 3 );
+ facetSelLayout->addWidget( dYLbl, 1, 4 );
+ facetSelLayout->addWidget( myDirSpin[1], 1, 5 );
+ facetSelLayout->addWidget( dZLbl, 1, 6 );
+ facetSelLayout->addWidget( myDirSpin[2], 1, 7 );
+
+ facetSelLayout->addWidget( myAxisBtn[0], 2, 2, 1, 2 );
+ facetSelLayout->addWidget( myAxisBtn[1], 2, 4, 1, 2 );
+ facetSelLayout->addWidget( myAxisBtn[2], 2, 6, 1, 2 );
+
+ myCriterionGrp->layout()->addWidget( myFacetSelGrp );
+ myCriterionGrp->layout()->addWidget( myAllDomainsChk );
+ //myChoiceWidget->layout()->addWidget( myAllDomainsChk );
+
+ connect( myFacetSelBtn, SIGNAL(clicked(bool)), SLOT(onFacetSelection(bool)) );
+ for ( int i = 0; i < 3; ++i )
+ {
+ connect( myAxisBtn [i], SIGNAL(clicked()), SLOT(onSetDir()) );
+ connect( myPointSpin[i], SIGNAL(valueChanged (const QString&)),
+ this, SLOT (updateNormalPreview(const QString&)) );
+ connect( myDirSpin [i], SIGNAL(valueChanged (const QString&)),
+ this, SLOT (updateNormalPreview(const QString&)) );
+ }
+ if ( myEntityTypeGrp )
+ {
+ myEntityTypeGrp->button(0)->setText( tr("SMESH_TETRAS"));
+ myEntityTypeGrp->button(1)->setText( tr("SMESH_PRISM"));
+ if ( QGroupBox* gb = qobject_cast< QGroupBox* >( myEntityTypeGrp->button(0)->parent() ))
+ gb->setTitle( tr("TARGET_ELEM_TYPE"));
+ }
myToAllChk->setChecked( true ); //aplly to the whole mesh by default
bool hasHexa = true;//myMesh->_is_nil() ? false : myMesh->NbHexas();
-
if ( hasHexa )
{
- myGroupChoice->button(0)->setText( tr("SPLIT_HEX_TO_5_TETRA"));
- myGroupChoice->button(1)->setText( tr("SPLIT_HEX_TO_6_TETRA"));
- myGroupChoice->button(2)->setText( tr("SPLIT_HEX_TO_24_TETRA"));
-
myCriterionGrp->setTitle( tr("SPLIT_METHOD"));
myCriterionGrp->show();
myComboBoxFunctor->hide();
myChoiceWidget->show();
}
- setSelectionMode();
- updateButtons();
+
+ on3d2dChanged( 0 );
+ Init();
}
-SMESHGUI_CuttingIntoTetraDlg::~SMESHGUI_CuttingIntoTetraDlg()
+SMESHGUI_SplitVolumesDlg::~SMESHGUI_SplitVolumesDlg()
{
}
-bool SMESHGUI_CuttingIntoTetraDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
- const SMESH::long_array& theIds,
- SMESH::SMESH_IDSource_ptr theObj)
+bool SMESHGUI_SplitVolumesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
+ const SMESH::long_array& theIds,
+ SMESH::SMESH_IDSource_ptr theObj)
{
SMESH::SMESH_IDSource_wrap obj = theObj;
if ( CORBA::is_nil( obj ))
- obj = theEditor->MakeIDSource( theIds, myEntityType ? SMESH::VOLUME : SMESH::FACE );
+ obj = theEditor->MakeIDSource( theIds, SMESH::VOLUME );
else
obj->Register();
try {
- theEditor->SplitVolumesIntoTetra( obj, myGroupChoice->checkedId()+1 );
+ if ( isIntoPrisms() )
+ {
+ QStringList aParameters;
+ aParameters << myPointSpin[0]->text();
+ aParameters << myPointSpin[1]->text();
+ aParameters << myPointSpin[2]->text();
+ aParameters << myDirSpin[0]->text();
+ aParameters << myDirSpin[1]->text();
+ aParameters << myDirSpin[2]->text();
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+
+ SMESH::PointStruct_var point = new SMESH::PointStruct;
+ point->x = myPointSpin[0]->GetValue();
+ point->y = myPointSpin[1]->GetValue();
+ point->z = myPointSpin[2]->GetValue();
+ SMESH::DirStruct_var norm = new SMESH::DirStruct;
+ norm->PS.x = myDirSpin[0]->GetValue();
+ norm->PS.y = myDirSpin[1]->GetValue();
+ norm->PS.z = myDirSpin[2]->GetValue();
+
+ theEditor->SplitHexahedraIntoPrisms( obj, point, norm,
+ myGroupChoice->checkedId()+1,
+ myAllDomainsChk->isChecked() );
+ }
+ else
+ {
+ theEditor->SplitVolumesIntoTetra( obj, myGroupChoice->checkedId()+1 );
+ }
}
catch ( const SALOME::SALOME_Exception& S_ex ) {
SalomeApp_Tools::QtCatchCorbaException( S_ex );
}
return true;
}
+
+int SMESHGUI_SplitVolumesDlg::nbElemsInMesh()
+{
+ return isIntoPrisms() ? myMesh->NbHexas() : myMesh->NbVolumes() - myMesh->NbTetras();
+}
+
+bool SMESHGUI_SplitVolumesDlg::isIntoPrisms()
+{
+ return ( myEntityTypeGrp->checkedId() == 1 );
+}
+
+//================================================================================
+/*!
+ * \brief Slot called when a target element type changes
+ */
+//================================================================================
+
+void SMESHGUI_SplitVolumesDlg::on3d2dChanged(int isPrism)
+{
+ if ( isPrism )
+ {
+ myFacetSelGrp->show();
+ myAllDomainsChk->show();
+ myGroupChoice->button(2)->hide();
+ myGroupChoice->button(0)->setText( tr("SPLIT_HEX_TO_2_PRISMS"));
+ myGroupChoice->button(1)->setText( tr("SPLIT_HEX_TO_4_PRISMS"));
+ }
+ else
+ {
+ myFacetSelGrp->hide();
+ myAllDomainsChk->hide();
+ myGroupChoice->button(2)->show();
+ myGroupChoice->button(0)->setText( tr("SPLIT_HEX_TO_5_TETRA"));
+ myGroupChoice->button(1)->setText( tr("SPLIT_HEX_TO_6_TETRA"));
+ myGroupChoice->button(2)->setText( tr("SPLIT_HEX_TO_24_TETRA"));
+ }
+ SMESHGUI_MultiEditDlg::on3d2dChanged( !myEntityType );
+ myEntityType = 1; // == VOLUME
+ myChoiceWidget->hide();
+ myChoiceWidget->show();
+ resize(minimumSizeHint());
+ onSelectionDone();
+}
+
+//================================================================================
+/*!
+ * \brief Set selection mode
+ */
+//================================================================================
+
+void SMESHGUI_SplitVolumesDlg::setSelectionMode()
+{
+ if ( myBusy || !isEnabled() ) return;
+
+ SMESH::RemoveFilters();
+
+ mySelectionMgr->clearFilters();
+
+ if (mySubmeshChk->isChecked()) {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
+ mySelectionMgr->installFilter(new SMESH_TypeFilter(SMESH::SUBMESH));
+ myFacetSelBtn->setChecked( false );
+ }
+ else if (myGroupChk->isChecked()) {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
+ mySelectionMgr->installFilter(new SMESH_TypeFilter(SMESH::GROUP));
+ myFacetSelBtn->setChecked( false );
+ }
+
+ if ( myFacetSelBtn->isChecked() )
+ {
+ // facet selection - select any element
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( CellSelection );
+ myFilterType = SMESH::AllElementsFilter;
+ }
+ else
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( VolumeSelection );
+ if ( isIntoPrisms() )
+ {
+ SMESH::SetFilter(new SMESHGUI_VolumeShapeFilter( SMDSGeom_HEXA ));
+ myFilterType = SMESHGUI_VolumeShapeFilter::GetId( SMDSGeom_HEXA );
+ }
+ else // to tetrahedra
+ {
+ SMESH::SetFilter(new SMESHGUI_VolumesFilter());
+ myFilterType = SMESH::VolumeFilter;
+ }
+ }
+}
+
+//================================================================================
+/*!
+ * \brief SLOT called when selection changed
+ */
+//================================================================================
+
+void SMESHGUI_SplitVolumesDlg::onSelectionDone()
+{
+ if (myBusy || !isEnabled()) return;
+
+ if ( !myFacetSelBtn->isChecked() )
+ {
+ SMESHGUI_MultiEditDlg::onSelectionDone();
+ }
+ else // set point and normal by a selected element
+ {
+ const SALOME_ListIO& aList = mySelector->StoredIObjects();
+ int nbSel = aList.Extent();
+ if (nbSel > 0)
+ {
+ Handle(SALOME_InteractiveObject) anIO = aList.First();
+
+ myActor = SMESH::FindActorByEntry( anIO->getEntry() );
+
+ SMESH::SMESH_Mesh_var aSelMesh = SMESH::GetMeshByIO(anIO);
+ if (!aSelMesh->_is_nil())
+ myMesh = aSelMesh;
+
+ TColStd_IndexedMapOfInteger aMapIndex;
+ mySelector->GetIndex( anIO, aMapIndex );
+ if ( !aMapIndex.IsEmpty() )
+ showFacetByElement( aMapIndex(1) );
+ else if ( myCellSize < 0 )
+ showFacetByElement( 1 );
+ }
+ updateButtons();
+ }
+
+ myCriterionGrp->setEnabled( !myMesh->_is_nil() && nbElemsInMesh() > 0 );
+}
+
+//================================================================================
+/*!
+ * \brief Show facet normal by a selected element
+ */
+//================================================================================
+
+void SMESHGUI_SplitVolumesDlg::showFacetByElement( int elemID )
+{
+ if ( !isIntoPrisms() || !myActor )
+ {
+ mySimulation->SetVisibility( false );
+ return;
+ }
+ SMDS_Mesh* mesh = myActor->GetObject()->GetMesh();
+ const SMDS_MeshElement* elem = mesh->FindElement( elemID );
+ if ( !elem ) return;
+
+ // set point XYZ by the element barycenter
+ gp_XYZ bc( 0,0,0 );
+ Bnd_B3d bbox;
+ SMDS_NodeIteratorPtr nIt = elem->nodeIterator();
+ vector< const SMDS_MeshNode* > nodes;
+ nodes.reserve( elem->NbNodes() );
+ while ( nIt->more() )
+ {
+ nodes.push_back( nIt->next() );
+ gp_XYZ p = SMESH_TNodeXYZ( nodes.back() );
+ bc += p;
+ bbox.Add( p );
+ }
+ bc /= nodes.size();
+
+ myPointSpin[0]->SetValue( bc.X() );
+ myPointSpin[1]->SetValue( bc.Y() );
+ myPointSpin[2]->SetValue( bc.Z() );
+
+ // set size
+ myCellSize = sqrt( bbox.SquareExtent() );
+
+ // set normal and size
+ gp_XYZ norm;
+ switch ( elem->GetType())
+ {
+ case SMDSAbs_Edge:
+ {
+ norm = SMESH_TNodeXYZ( nodes[1] ) - SMESH_TNodeXYZ( nodes[0] );
+ break;
+ }
+ case SMDSAbs_Face:
+ {
+ if ( !SMESH_MeshAlgos::FaceNormal( elem, norm, /*normalized=*/false ))
+ return;
+ break;
+ }
+ case SMDSAbs_Volume:
+ {
+ SMDS_VolumeTool vTool( elem );
+ vTool.SetExternalNormal();
+ bool freeFacetFound = false;
+ double n[3];
+ for ( int i = 0; i < vTool.NbFaces() && !freeFacetFound; ++i )
+ if (( freeFacetFound = vTool.IsFreeFace( i )))
+ vTool.GetFaceNormal( i, n[0], n[1], n[2] );
+ if ( !freeFacetFound )
+ vTool.GetFaceNormal( 0, n[0], n[1], n[2] );
+ norm.SetCoord( n[0], n[1], n[2] );
+ break;
+ }
+ default: return;
+ }
+
+ double size = norm.Modulus();
+ if ( size < 1e-20 )
+ return;
+ norm /= size;
+
+ myDirSpin[0]->SetValue( norm.X() );
+ myDirSpin[1]->SetValue( norm.Y() );
+ myDirSpin[2]->SetValue( norm.Z() );
+
+ if ( myCellSize > 0. )
+ updateNormalPreview();
+}
+
+//================================================================================
+/*!
+ * \brief SLOT called when a point or a normal changes
+ */
+//================================================================================
+
+void SMESHGUI_SplitVolumesDlg::updateNormalPreview(const QString&)
+{
+ if ( myCellSize < 0. )
+ {
+ showFacetByElement( 1 );
+ return;
+ }
+
+ gp_Pnt point ( myPointSpin[0]->GetValue(),
+ myPointSpin[1]->GetValue(),
+ myPointSpin[2]->GetValue() );
+ gp_XYZ norm ( myDirSpin[0]->GetValue(),
+ myDirSpin[1]->GetValue(),
+ myDirSpin[2]->GetValue() );
+ if ( norm.Modulus() < 1e-20 )
+ return;
+
+ vtkUnstructuredGrid* grid = mySimulation->GetGrid();
+
+ // Initialize the preview mesh of an arrow
+ if ( grid->GetNumberOfPoints() == 0 )
+ {
+ mySimulation->SetArrowShapeAndNb( /*nb=*/1, /*hLen=*/0.3, /*R=*/0.1, /*start=*/0 );
+ }
+
+ // Compute new coordinates of the grid according to the dialog controls
+
+ gp_Ax1 axis( point, norm );
+ mySimulation->SetArrows( &axis, 4 * myCellSize );
+ mySimulation->SetVisibility(true);
+}
+
+//================================================================================
+/*!
+ * \brief Slot called when facet selection button is clicked
+ */
+//================================================================================
+
+void SMESHGUI_SplitVolumesDlg::onFacetSelection(bool isFacetSelection)
+{
+ setSelectionMode();
+ onSelectionDone();
+ mySelGrp->setEnabled( !isFacetSelection );
+}
+
+//================================================================================
+/*!
+ * \brief Slot called when an || axis button is clicked
+ */
+//================================================================================
+
+void SMESHGUI_SplitVolumesDlg::onSetDir()
+{
+ myDirSpin[0]->SetValue(0.);
+ myDirSpin[1]->SetValue(0.);
+ myDirSpin[2]->SetValue(0.);
+ int i = 0;
+ for ( ; i < 3; ++i )
+ if ( sender() == myAxisBtn[i] )
+ break;
+ if ( i == 3 )
+ i == 0;
+ myDirSpin[i]->SetValue(1.);
+
+ if ( myActor && !myMesh->_is_nil() && myMesh->NbNodes() > 0 )
+ {
+ double b[6];
+ myActor->GetUnstructuredGrid()->GetBounds(b);
+ gp_XYZ center( 0.5 * ( b[0] + b[1] ),
+ 0.5 * ( b[2] + b[3] ),
+ 0.5 * ( b[4] + b[5] ));
+ gp_XYZ point ( myPointSpin[0]->GetValue(),
+ myPointSpin[1]->GetValue(),
+ myPointSpin[2]->GetValue() );
+ gp_XYZ norm ( myDirSpin[0]->GetValue(),
+ myDirSpin[1]->GetValue(),
+ myDirSpin[2]->GetValue() );
+
+ gp_Vec cp( center, point );
+ if ( cp.Dot( norm ) < 0. )
+ myDirSpin[i]->SetValue(-1.);
+ }
+
+ updateNormalPreview();
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
Q_OBJECT
public:
- SMESHGUI_MultiEditDlg( SMESHGUI*, const int, const bool = false );
+ SMESHGUI_MultiEditDlg( SMESHGUI* theModule,
+ const int theMode,
+ const bool the3d2d = false,
+ bool theDoInit = true );
virtual ~SMESHGUI_MultiEditDlg();
void Init();
void onHelp();
void onDeactivate();
- void onSelectionDone();
+ virtual void onSelectionDone();
void onFilterBtn();
void onAddBtn();
void onGroupChk();
virtual void onToAllChk();
void onFilterAccepted();
- void on3d2dChanged(int);
+ virtual void on3d2dChanged(int);
SMESH::NumericalFunctor_ptr getNumericalFunctor();
virtual bool isValid( const bool );
SMESH::long_array_var getIds(SMESH::SMESH_IDSource_var& obj);
void updateButtons();
- void setSelectionMode();
+ virtual void setSelectionMode();
virtual bool isIdValid( const int ) const;
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
const SMESH::long_array& ,
SMESH::SMESH_IDSource_ptr obj) = 0;
+ virtual int nbElemsInMesh() = 0;
int entityType();
protected:
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
const SMESH::long_array& ,
SMESH::SMESH_IDSource_ptr obj);
+ virtual int nbElemsInMesh();
};
/*!
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
const SMESH::long_array&,
SMESH::SMESH_IDSource_ptr obj );
+ virtual int nbElemsInMesh();
protected slots:
virtual void onDisplaySimulation( bool );
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
const SMESH::long_array& ,
SMESH::SMESH_IDSource_ptr obj);
+ virtual int nbElemsInMesh();
protected slots:
virtual void reject();
};
/*!
- * Class : SMESHGUI_CuttingIntoTetraDlg
+ * Class : SMESHGUI_SplitVolumesDlg
* Description : Split all volumes into tetrahedrons
*/
-class SMESHGUI_CuttingIntoTetraDlg : public SMESHGUI_MultiEditDlg
+class SMESHGUI_SplitVolumesDlg : public SMESHGUI_MultiEditDlg
{
Q_OBJECT
public:
- SMESHGUI_CuttingIntoTetraDlg( SMESHGUI* );
- virtual ~SMESHGUI_CuttingIntoTetraDlg();
+ SMESHGUI_SplitVolumesDlg( SMESHGUI* );
+ virtual ~SMESHGUI_SplitVolumesDlg();
+
+protected slots:
+
+ virtual void on3d2dChanged(int);
+ virtual void onSelectionDone();
+
+ void onFacetSelection(bool);
+ void onSetDir();
+ void updateNormalPreview(const QString& s="");
protected:
+
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
const SMESH::long_array&,
SMESH::SMESH_IDSource_ptr obj );
+ virtual int nbElemsInMesh();
+
+ virtual void setSelectionMode();
+ void showFacetByElement( int id );
+ bool isIntoPrisms();
+
+ QGroupBox* myFacetSelGrp;
+ SMESHGUI_SpinBox* myPointSpin[3];
+ SMESHGUI_SpinBox* myDirSpin [3];
+ QPushButton* myFacetSelBtn;
+ QPushButton* myAxisBtn[3];
+ QCheckBox* myAllDomainsChk;
+
+ double myCellSize;
};
#endif // SMESHGUI_MULTIEDITDLG_H
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
: QFrame( parent )
{
myMinU = myMinV = myMaxU = myMaxV = 0;
- setMinimumHeight( 150 );
+ //setMinimumHeight( 150 );
}
//=================================================================================
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <QtxBiColorTool.h>
#include <QtxColorButton.h>
#include <QtxIntSpinBox.h>
+#include <QtxDoubleSpinBox.h>
#include <VTKViewer_MarkerWidget.h>
#include <SUIT_Session.h>
#include <LightApp_Application.h>
myBallColor = new QtxColorButton( myBallGrp );
QLabel* ballSizeLab = new QLabel( tr( "SIZE" ), myBallGrp );
myBallSize = new QtxIntSpinBox( myBallGrp );
+ QLabel* ballScaleLab = new QLabel( tr( "SCALE_FACTOR" ), myBallGrp );
+ myBallScale = new QtxDoubleSpinBox( 1e-2, 1e7, 0.5, myBallGrp );
hl = new QHBoxLayout( myBallGrp );
hl->setMargin( MARGIN );
hl->setSpacing( SPACING );
hl->addWidget( myBallColor );
hl->addWidget( ballSizeLab );
hl->addWidget( myBallSize );
+ hl->addWidget( ballScaleLab );
+ hl->addWidget( myBallScale );
widthLab1 = qMax( widthLab1, ballColorLab->minimumSizeHint().width() );
widthLab2 = qMax( widthLab2, ballSizeLab->minimumSizeHint().width() );
myOrientationGrp = new QGroupBox( tr( "ORIENTATIONS" ), mainFrame() );
QLabel* orientationColorLab = new QLabel( tr( "COLOR" ), myOrientationGrp );
myOrientationColor = new QtxColorButton( myOrientationGrp );
- QLabel* orientationScaleLab = new QLabel( tr( "ORIENTATION_SCALE" ), myOrientationGrp );
+ QLabel* orientationScaleLab = new QLabel( tr( "SCALE_FACTOR" ), myOrientationGrp );
myOrientationSize = new QtxIntSpinBox( myOrientationGrp );
myOrientationSize->setSuffix( "% ");
myOrientation3d = new QCheckBox( tr("ORIENTATION_3D"), myOrientationGrp );
myOutlineWidth->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myElem0dSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myBallSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myBallScale->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myOrientationSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myShrinkSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
return myBallSize->value();
}
+/*!
+ \brief Set discrete elements (balls) scale factor
+ \param size discrete elements (balls) scale factor
+*/
+void SMESHGUI_PropertiesDlg::setBallScale( double size )
+{
+ myBallScale->setValue( size );
+}
+
+/*!
+ \brief Get discrete elements (balls) scale factor
+ \return current discrete elements (balls) scale factor
+*/
+double SMESHGUI_PropertiesDlg::ballScale() const
+{
+ return myBallScale->value();
+}
+
/*!
\brief Set orientation vectors color
\param color orientation vectors color
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
class QtxColorButton;
class QtxBiColorTool;
class QtxIntSpinBox;
+class QtxDoubleSpinBox;
class VTKViewer_MarkerWidget;
class SMESHGUI_EXPORT SMESHGUI_PropertiesDlg : public SMESHGUI_Dialog
QColor ballColor() const;
void setBallSize( int );
int ballSize() const;
+ void setBallScale( double );
+ double ballScale() const;
void setOrientationColor( const QColor& );
QColor orientationColor() const;
// - balls
QtxColorButton* myBallColor;
QtxIntSpinBox* myBallSize;
+ QtxDoubleSpinBox* myBallScale;
// - orientation vectors
QtxColorButton* myOrientationColor;
QtxIntSpinBox* myOrientationSize;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// get selected mesh
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
+ mySelectionMgr->selectedObjects(aList);
int nbSel = aList.Extent();
if (nbSel == 1) {
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
return;
// get selected mesh
- const SALOME_ListIO& aList = mySelector->StoredIObjects();
-
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects(aList);
int nbSel = aList.Extent();
if (nbSel != 1)
return;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// get selected mesh
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
+ mySelectionMgr->selectedObjects(aList);
int nbSel = aList.Extent();
if (nbSel < 1)
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
QApplication::instance()->processEvents();
+ myEditCurrentArgument->hide();
+ myEditCurrentArgument->show();
updateGeometry();
resize(100,100);
}
// get selected mesh
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
+ mySelectionMgr->selectedObjects(aList);
int nbSel = aList.Extent();
if (nbSel < 1)
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
GEOM::GEOM_Object_var obj = GEOM::GEOM_Object::_narrow(
dynamic_cast<SALOMEDS_SObject*>( sobj.get() )->GetObject() );
if( !CORBA::is_nil( obj ) )
- res = SMESHGUI_Dialog::prefix( "GEOM" ) + obj->GetType();
+ // as decoding of type id is not realized in LightApp_Dialog,
+ //make all GEOM objects have same type id
+ res = SMESHGUI_Dialog::prefix( "GEOM" );// + obj->GetType();
}
}
else
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// get selected mesh
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
+ mySelectionMgr->selectedObjects(aList);
int nbSel = aList.Extent();
if (nbSel != 1)
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
try {
SALOME_ListIO aList;
- selectionMgr()->selectedObjects(aList, SVTK_Viewer::Type());
+ selectionMgr()->selectedObjects(aList);
if (!myIsMultipleAllowed && aList.Extent() != 1)
return;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// get selected mesh
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
+ mySelectionMgr->selectedObjects(aList);
int nbSel = aList.Extent();
if (nbSel != 1)
return;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
onDisplaySimulation(true);
QApplication::instance()->processEvents();
+ myEditCurrentArgument->hide();
+ myEditCurrentArgument->show();
updateGeometry();
resize(100,100);
}
// get selected mesh
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
+ mySelectionMgr->selectedObjects(aList);
int nbSel = aList.Extent();
if (nbSel < 1)
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
onDisplaySimulation(true);
-
+ myEditCurrentArgument->hide();
+ myEditCurrentArgument->show();
QApplication::instance()->processEvents();
updateGeometry();
resize(100,100);
// get selected mesh
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
+ mySelectionMgr->selectedObjects(aList);
int nbSel = aList.Extent();
if (nbSel < 1)
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
Reimplemented from QXmlDefaultHandler.
*/
-bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&,
- const QString& qName,
+bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&,
+ const QString& qName,
const QXmlAttributes& atts)
{
if (qName == "meshers")
}
else if (qName == "meshers-group") // group of hypotheses and algorithms
{
-// if (atts.value("server-lib") != "")
+ // if (atts.value("server-lib") != "")
{
myPluginName = atts.value("name");
myServerLib = atts.value("server-lib");
myClientLib = atts.value("gui-lib");
-/* It's Need to tranlate lib name for WIN32 or X platform
- * (only client lib, because server lib translates in SMESH_Gen_i::createHypothesis
- * for normal work of *.py files )
- */
+ /* It's Need to tranlate lib name for WIN32 or X platform
+ * (only client lib, because server lib translates in SMESH_Gen_i::createHypothesis
+ * for normal work of *.py files )
+ */
if( !myClientLib.isEmpty() )
{
#ifdef WIN32
- //myServerLib += ".dll";
+ //myServerLib += ".dll";
myClientLib += ".dll";
#else
- //myServerLib = "lib" + myServerLib + ".so";
+ //myServerLib = "lib" + myServerLib + ".so";
myClientLib = "lib" + myClientLib + ".so";
#endif
}
if (atts.value("type") != "")
{
QString aHypAlType = atts.value("type");
- QString aLabel = atts.value("label-id");
- QString anIcon = atts.value("icon-id");
- bool isAux = atts.value("auxiliary") == "true";
+ QString aLabel = atts.value("label-id");
+ QString anIcon = atts.value("icon-id");
+ bool isAuxOrNeedHyp = ( qName == "hypothesis" ?
+ atts.value("auxiliary") == "true" :
+ atts.value("need-hyp" ) == "true" );
bool isNeedGeom = true, isSupportSubmeshes = false;
QString aNeedGeom = atts.value("need-geom");
if ( !aNeedGeom.isEmpty() )
QString suppSub = atts.value("support-submeshes");
if ( !suppSub.isEmpty() )
isSupportSubmeshes = (suppSub == "true");
+ QString context = atts.value("context");
+ if ( context.isEmpty() )
+ context = "ANY";
+ else
+ context = context.toUpper();
QString aDimStr = atts.value("dim");
aDimStr = aDimStr.remove( ' ' );
attr[ i ] = aStr.split( ',', QString::SkipEmptyParts );
}
}
-
+
if ( !aHypAlType.contains( BAD_HYP_FLAG ) ) {
HypothesisData* aHypData =
new HypothesisData (aHypAlType, myPluginName, myServerLib, myClientLib,
- aLabel, anIcon, aDim, isAux,
+ aLabel, anIcon, context, aDim, isAuxOrNeedHyp,
attr[ HYPOS ], attr[ OPT_HYPOS ], attr[ INPUT ], attr[ OUTPUT ],
isNeedGeom, isSupportSubmeshes );
bool badSet = hypos.contains( BAD_HYP_FLAG ) || algos.contains( BAD_HYP_FLAG );
if ( !badSet )
- myListOfHypothesesSets.append( new HypothesesSet ( atts.value("name"),
- hypos.split( ',', QString::SkipEmptyParts ),
- algos.split( ',', QString::SkipEmptyParts ) ) );
+ myListOfHypothesesSets.append( new HypothesesSet ( atts.value("name"),
+ hypos.split( ',', QString::SkipEmptyParts ),
+ algos.split( ',', QString::SkipEmptyParts ) ) );
}
}
else if ( qName == "python-wrap" ||
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
<source>ICON_DLG_MOVE_NODE</source>
<translation>mesh_move_node.png</translation>
</message>
+ <message>
+ <source>ICON_DLG_MOVE_WITHOUT_NODE</source>
+ <translation>mesh_move_without_node.png</translation>
+ </message>
<message>
<source>ICON_DLG_NODE</source>
<translation>mesh_vertex.png</translation>
<source>ICON_SMESH_DUPLICATE_NODES_WITH_ELEM</source>
<translation>mesh_duplicate_nodes_with_elem.png</translation>
</message>
- <message>
+ <message>
<source>ICON_SMESH_DUPLICATE_ELEM_ONLY</source>
<translation>mesh_duplicate_elem_only.png</translation>
</message>
+ <message>
+ <source>ICON_SMESH_DUPLICATE_GROUP_BOUNDARY</source>
+ <translation>mesh_duplicate_group_boundary.png</translation>
+ </message>
<message>
<source>ICON_SMESH_TREE_ALGO</source>
<translation>mesh_tree_algo.png</translation>
</message>
<message>
<source>MEN_SPLIT_TO_TETRA</source>
- <translation>Split into Tetrahedra</translation>
+ <translation>Split Volumes</translation>
</message>
<message>
<source>TOP_SPLIT_TO_TETRA</source>
- <translation>Split into Tetrahedra</translation>
+ <translation>Split Volumes</translation>
</message>
<message>
<source>STB_SPLIT_TO_TETRA</source>
- <translation>Split into Tetrahedra</translation>
+ <translation>Split Volumes</translation>
</message>
<message>
<source>MESHERS_FILE_CANT_OPEN</source>
<source>SMESH_MESHINFO_ORDER2</source>
<translation>Quadratic</translation>
</message>
+ <message>
+ <source>SMESH_MESHINFO_ORDER3</source>
+ <translation>Bi-Quadratic</translation>
+ </message>
<message>
<source>SMESH_MESHINFO_HEXAPRISM</source>
<translation>Hexagonal prisms</translation>
<translation>Sort child items</translation>
</message>
</context>
+<context>
+ <name>SMESHGUI_FieldSelectorWdg</name>
+ <message>
+ <source>FIELDS_TO_EXPORT</source>
+ <translation>Export Fields</translation>
+ </message>
+</context>
<context>
<name>SMESHGUI_Dialog</name>
<message>
<source>DLG_MESH</source>
- <translation>meshes</translation>
+ <translation>mesh(s)</translation>
</message>
<message>
<source>DLG_HYPO</source>
- <translation>hypotheses</translation>
+ <translation>hypothesis(s)</translation>
</message>
<message>
<source>DLG_ALGO</source>
- <translation>algorithms</translation>
+ <translation>algorithm(s)</translation>
+ </message>
+ <message>
+ <source>DLG_GEOM</source>
+ <translation>object(s)</translation>
</message>
</context>
<context>
<source>PREF_BALL_SIZE</source>
<translation>Size of ball elements</translation>
</message>
+ <message>
+ <source>PREF_BALL_SCALE</source>
+ <translation>Scale factor of ball elements</translation>
+ </message>
<message>
<source>PREF_WIDTH</source>
<translation>Line width</translation>
<source>MESH</source>
<translation>Mesh</translation>
</message>
+ <message>
+ <source>MESH_TYPE</source>
+ <translation>Mesh type</translation>
+ </message>
<message>
<source>NAME</source>
<translation>Name</translation>
<translation>No sense in creating a submesh ignored by global algorithm "%1"</translation>
</message>
<message>
- <source>GEOMETRY_OBJECT_IS_NOT_DEFINED</source>
+ <source>GEOMETRY_OBJECT_IS_NOT_DEFINED_MESH</source>
<translation>Geometry object is not defined.
Do you want to create an empty mesh
without algorithms and hypotheses? </translation>
+ </message>
+ <message>
+ <source>GEOMETRY_OBJECT_IS_NOT_DEFINED_SUBMESH</source>
+ <translation>Geometry object is not defined.
+Please specify it and try again</translation>
</message>
<message>
<source>GEOMETRY_OBJECT_IS_NULL</source>
<source>MESH_IS_NULL</source>
<translation>Mesh is null</translation>
</message>
+ <message>
+ <source>MT_ANY</source>
+ <translation>Any</translation>
+ </message>
+ <message>
+ <source>MT_HEXAHEDRAL</source>
+ <translation>Hexahedral</translation>
+ </message>
+ <message>
+ <source>MT_TETRAHEDRAL</source>
+ <translation>Tetrahedral</translation>
+ </message>
+ <message>
+ <source>MT_TRIANGULAR</source>
+ <translation>Triangular</translation>
+ </message>
+ <message>
+ <source>MT_QUADRILATERAL</source>
+ <translation>Quadrilateral</translation>
+ </message>
<message>
<source>NAME_OF_MESH_IS_EMPTY</source>
<translation>Name of mesh is empty
<translation>There is no object for editing. Please
select mesh or sub-mesh and try again</translation>
</message>
+ <message>
+ <source>CONCURRENT_SUBMESH_APPEARS</source>
+ <translation>
+The assigned algorithm has the same priority as one assigned to an
+adjacent sub-mesh, hence it's undefined which algorithm to use for
+meshing boundary shared by two sub-meshes. Would you like to set
+the order of sub-mesh computation? </translation>
+ </message>
</context>
<context>
<name>SMESHGUI_MeshPatternDlg</name>
<source>NONE</source>
<translation><None></translation>
</message>
+ <message>
+ <source>DEFAULT</source>
+ <translation><Default></translation>
+ </message>
+ <message>
+ <source>SELECT</source>
+ <translation><Select></translation>
+ </message>
</context>
<context>
<name>SMESHGUI_MultiEditDlg</name>
</message>
</context>
<context>
- <name>SMESHGUI_CuttingIntoTetraDlg</name>
+ <name>SMESHGUI_SplitVolumesDlg</name>
<message>
<source>CAPTION</source>
- <translation>Splitting volumes into tetrahedra</translation>
+ <translation>Splitting volumes</translation>
</message>
<message>
<source>SPLIT_METHOD</source>
<source>SPLIT_HEX_TO_24_TETRA</source>
<translation>Into 24 tetrahedra</translation>
</message>
+ <message>
+ <source>SPLIT_HEX_TO_2_PRISMS</source>
+ <translation>Into 2 prisms</translation>
+ </message>
+ <message>
+ <source>SPLIT_HEX_TO_4_PRISMS</source>
+ <translation>Into 4 Prisms</translation>
+ </message>
+ <message>
+ <source>TARGET_ELEM_TYPE</source>
+ <translation>Target element type</translation>
+ </message>
+ <message>
+ <source>FACET_TO_SPLIT</source>
+ <translation>Facet to split</translation>
+ </message>
+ <message>
+ <source>START_POINT</source>
+ <translation>Hexa location</translation>
+ </message>
+ <message>
+ <source>FACET_NORMAL</source>
+ <translation>Facet normal</translation>
+ </message>
+ <message>
+ <source>ALL_DOMAINS</source>
+ <translation>All domains</translation>
+ </message>
</context>
<context>
<name>SMESHGUI_PrecisionDlg</name>
<source>DUPLICATION_ONLY_ELEMS</source>
<translation>Duplicate elements only</translation>
</message>
+ <message>
+ <source>DUPLICATION_GROUP_BOUNDARY</source>
+ <translation>Duplicate nodes on group boundaries</translation>
+ </message>
<message>
<source>GROUP_ELEMS_TO_DUPLICATE</source>
<translation>Group of elements to duplicate</translation>
<source>GROUP_ELEMS_TO_REPLACE</source>
<translation>Group of elements to replace nodes with new ones</translation>
</message>
+ <message>
+ <source>GROUP_VOLUME_GROUPS</source>
+ <translation>Groups of volumes</translation>
+ </message>
<message>
<source>CONSTRUCT_NEW_GROUP_NODES</source>
<translation>Construct group with newly created nodes</translation>
<source>CONSTRUCT_NEW_GROUP_ELEMENTS</source>
<translation>Construct group with newly created elements</translation>
</message>
+ <message>
+ <source>CREATE_JOINT_ELEMENTS</source>
+ <translation>Create joint elements</translation>
+ </message>
+ <message>
+ <source>ON_ALL_BOUNDARIES</source>
+ <translation>On all boundaries</translation>
+ </message>
</context>
<context>
<name>SMESHGUI_Make2DFrom3DDlg</name>
<source>QUADRATIC_LAB</source>
<translation>Quadratic</translation>
</message>
+ <message>
+ <source>BI_QUADRATIC_LAB</source>
+ <translation>Bi-Quadratic</translation>
+ </message>
<message>
<source>0D_LAB</source>
<translation>0D:</translation>
<translation>Size:</translation>
</message>
<message>
- <source>ORIENTATION_SCALE</source>
+ <source>SCALE_FACTOR</source>
<translation>Scale:</translation>
</message>
<message>
<TS version="2.0" language="fr_FR">
<context>
<name>@default</name>
- <message>
- <source>TB_ADD1D</source>
- <translation type="unfinished">Mesh Toolbar</translation>
- </message>
- <message>
- <source>TB_INFO</source>
- <translation type="unfinished">Information Toolbar</translation>
- </message>
- <message>
- <source>TB_GROUP</source>
- <translation type="unfinished">Group Toolbar</translation>
- </message>
- <message>
- <source>TB_MEASUREM</source>
- <translation type="unfinished">Measurements Toolbar</translation>
- </message>
- <message>
- <source>TB_CTRL3D</source>
- <translation type="unfinished">Volume Controls Toolbar</translation>
- </message>
- <message>
- <source>TB_CTRL2D</source>
- <translation type="unfinished">Face Controls Toolbar</translation>
- </message>
- <message>
- <source>TB_CTRL1D</source>
- <translation type="unfinished">Edge Controls Toolbar</translation>
- </message>
- <message>
- <source>TB_CTRL0D</source>
- <translation type="unfinished">Node Controls Toolbar</translation>
- </message>
- <message>
- <source>TB_TRANSFORM</source>
- <translation type="unfinished">Transformation Toolbar</translation>
- </message>
- <message>
- <source>TB_RENUMBER</source>
- <translation type="unfinished">Renumbering Toolbar</translation>
- </message>
- <message>
- <source>TB_REM</source>
- <translation type="unfinished">Remove Toolbar</translation>
- </message>
- <message>
- <source>TB_ADDNON</source>
- <translation type="unfinished">Add Non Linear Element Toolbar</translation>
- </message>
- <message>
- <source>TB_ADD</source>
- <translation type="unfinished">Add Element Toolbar</translation>
- </message>
- <message>
- <source>COMPERR_BAD_PARMETERS</source>
- <translation type="unfinished">Invalid input parameters</translation>
- </message>
- <message>
- <source>SMESH_GIGABYTE</source>
- <translation type="unfinished">%1 GB</translation>
- </message>
- <message>
- <source>SMESH_FREERAM</source>
- <translation type="unfinished">Free RAM</translation>
- </message>
- <message>
- <source>STB_BIQUADRATIC_TRIANGLE</source>
- <translation type="unfinished">BiQuadratic Triangle</translation>
- </message>
- <message>
- <source>TOP_BIQUADRATIC_TRIANGLE</source>
- <translation type="unfinished">BiQuadratic Triangle</translation>
- </message>
- <message>
- <source>MEN_BIQUADRATIC_TRIANGLE</source>
- <translation type="unfinished">BiQuadratic Triangle</translation>
- </message>
- <message>
- <source>SMESH_BIQUADRATIC_TRIANGLES</source>
- <translation type="unfinished">BiQuadratic Triangles</translation>
- </message>
- <message>
- <source>SMESH_BIQUADRATIC_TRIANGLE</source>
- <translation type="unfinished">BiQuadratic Triangle</translation>
- </message>
- <message>
- <source>SMESH_AUTO_DIM</source>
- <translation type="unfinished">Automatically define space dimension</translation>
- </message>
- <message>
- <source>SMESH_ADD_BIQUADRATIC_TRIANGLE_TITLE</source>
- <translation type="unfinished">Add BiQuadratic Triangle</translation>
- </message>
- <message>
- <source>COMPERR_WARNING</source>
- <translation type="unfinished">Warning</translation>
- </message>
<message>
<source>SMESH_EXPORT_MESH</source>
<translation>Exporter le maillage</translation>
<source>COMPERR_STD_EXCEPTION</source>
<translation>std::exception</translation>
</message>
+ <message>
+ <source>COMPERR_WARNING</source>
+ <translation>Attention</translation>
+ </message>
<message>
<source>COMPERR_UNKNOWN</source>
<translation>Erreur inconnue</translation>
<source>COMPERR_NO_MESH_ON_SHAPE</source>
<translation>Aucun élément n'est associé à une sous-shape</translation>
</message>
+ <message>
+ <source>COMPERR_BAD_PARMETERS</source>
+ <translation>Paramètres d'entrée invalides</translation>
+ </message>
<message>
<source>EDITERR_NO_MEDIUM_ON_GEOM</source>
<translation>Certain noeuds milieux (affichés en magenta) ne sont pas placés
</message>
<message>
<source>MEN_BASIC_PROPERTIES</source>
- <translation type="unfinished">Basic Properties</translation>
+ <translation>Propriétés basiques</translation>
</message>
<message>
<source>MEN_MEASURE_LENGTH</source>
- <translation type="unfinished">Length</translation>
+ <translation>Longueur</translation>
</message>
<message>
<source>STB_MEASURE_LENGTH</source>
- <translation type="unfinished">Calculate sum of length of all 1D elements of the selected object(s)</translation>
+ <translation>Calcul de la somme des longueurs de tous les éléments 1D des objets sélectionnés</translation>
</message>
<message>
<source>TOP_MEASURE_LENGTH</source>
- <translation type="unfinished">Length</translation>
+ <translation>Longueur</translation>
</message>
<message>
<source>MEN_MEASURE_AREA</source>
- <translation type="unfinished">Area</translation>
+ <translation>Surface</translation>
</message>
<message>
<source>STB_MEASURE_AREA</source>
- <translation type="unfinished">Calculate sum of area of all 2D elements of the selected object(s)</translation>
+ <translation>Calcul de la somme des surfaces de tous les éléments 2D des objets sélectionnés</translation>
</message>
<message>
<source>TOP_MEASURE_AREA</source>
- <translation type="unfinished">Area</translation>
+ <translation>Surface</translation>
</message>
<message>
<source>MEN_MEASURE_VOLUME</source>
- <translation type="unfinished">Volume</translation>
+ <translation>Volume</translation>
</message>
<message>
<source>STB_MEASURE_VOLUME</source>
- <translation type="unfinished">Calculate sum of volume of all 3D elements of the selected object(s)</translation>
+ <translation>Calcul de la somme des volumes de tous les éléments 3D des objets sélectionnés</translation>
</message>
<message>
<source>TOP_MEASURE_VOLUME</source>
- <translation type="unfinished">Volume</translation>
+ <translation>Volume</translation>
</message>
<message>
<source>MEN_MOVE</source>
</message>
<message>
<source>MEN_OVERALL_MESH_QUALITY</source>
- <translation type="unfinished">Overall Mesh Quality</translation>
+ <translation>Qualité du maillage global</translation>
</message>
<message>
<source>MEN_DISTRIBUTION_CTRL</source>
<source>SMESH_ADD_QUADRATIC_TRIANGLE_TITLE</source>
<translation>Ajouter un triangle quadratique</translation>
</message>
+ <message>
+ <source>SMESH_ADD_BIQUADRATIC_TRIANGLE_TITLE</source>
+ <translation>Ajouter un triangle biquadratique</translation>
+ </message>
<message>
<source>SMESH_ADD_SUBMESH</source>
<translation>Construction d'un sous-maillage</translation>
<source>SMESH_AUTO_GROUPS</source>
<translation>Créer les groupes automatiquement</translation>
</message>
+ <message>
+ <source>SMESH_AUTO_DIM</source>
+ <translation>Définition automatique des dimensions spatiales</translation>
+ </message>
<message>
<source>SMESH_REQUIRED_GROUPS</source>
<translation>Créer les groupes des types nécessaires</translation>
<source>SMESH_MESHINFO_ORDER2</source>
<translation>Quadratique</translation>
</message>
+ <message>
+ <source>SMESH_MESHINFO_ORDER3</source>
+ <translation type="unfinished">Bi-Quadratic</translation>
+ </message>
<message>
<source>SMESH_MESHINFO_HEXAPRISM</source>
<translation>Prismes hexagonaux</translation>
<source>STB_BIQUADRATIC_QUADRANGLE</source>
<translation>Quadrangle biquadratique</translation>
</message>
+ <message>
+ <source>SMESH_BIQUADRATIC_TRIANGLE</source>
+ <translation>Triangle biquadratique</translation>
+ </message>
+ <message>
+ <source>SMESH_BIQUADRATIC_TRIANGLES</source>
+ <translation>Triangles biquadratiques</translation>
+ </message>
+ <message>
+ <source>MEN_BIQUADRATIC_TRIANGLE</source>
+ <translation>Triangle biquadratique</translation>
+ </message>
+ <message>
+ <source>TOP_BIQUADRATIC_TRIANGLE</source>
+ <translation>Triangle biquadratique</translation>
+ </message>
+ <message>
+ <source>STB_BIQUADRATIC_TRIANGLE</source>
+ <translation>Triangle biquadratique</translation>
+ </message>
<message>
<source>SMESH_QUADRATIC_TETRAHEDRON</source>
<translation>Tétraèdre quadratique</translation>
<translation>Cône</translation>
</message>
<message>
- <source>TB_ADD_REMOVE</source>
- <translation>Ajouter/supprimer la barre d'outils</translation>
+ <source>TB_ADD</source>
+ <translation>Barre d'ajout d'éléments</translation>
+ </message>
+ <message>
+ <source>TB_ADDNON</source>
+ <translation>Barre d'ajout d'éléments non linéaires</translation>
+ </message>
+ <message>
+ <source>TB_REM</source>
+ <translation>Barre de suppression</translation>
+ </message>
+ <message>
+ <source>TB_RENUMBER</source>
+ <translation>Barre de renumérotation</translation>
+ </message>
+ <message>
+ <source>TB_TRANSFORM</source>
+ <translation>Barre des transformations</translation>
+ </message>
+ <message>
+ <source>TB_CTRL0D</source>
+ <translation>Barre des contrôles des nœuds</translation>
+ </message>
+ <message>
+ <source>TB_CTRL1D</source>
+ <translation>Barre des contrôles des arêtes</translation>
+ </message>
+ <message>
+ <source>TB_CTRL2D</source>
+ <translation>Barre des contrôles des faces</translation>
</message>
<message>
- <source>TB_CTRL</source>
- <translation>Barre d'outils des contrôles</translation>
+ <source>TB_CTRL3D</source>
+ <translation>Barre des contrôles des volumes</translation>
+ </message>
+ <message>
+ <source>TB_MEASUREM</source>
+ <translation>Barre des mesures</translation>
</message>
<message>
<source>TB_DISP_MODE</source>
<source>TB_MESH</source>
<translation>Barre de maillage</translation>
</message>
+ <message>
+ <source>TB_GROUP</source>
+ <translation>Barre des groupes</translation>
+ </message>
+ <message>
+ <source>TB_INFO</source>
+ <translation>Barre d'information</translation>
+ </message>
+ <message>
+ <source>TB_ADD1D</source>
+ <translation>Barre de maillage</translation>
+ </message>
<message>
<source>TB_MODIFY</source>
<translation>Barre des modifications</translation>
</message>
<message>
<source>UPDATE_DESTINATION</source>
- <translation type="unfinished">Update Destination</translation>
+ <translation>Mettre à jour la destination</translation>
</message>
<message>
<source>VOLUME_3D_ELEMENTS</source>
<translation>L'objet sélectionné a été utilisé pour en créer un autre.
Il ne peut pas être supprimé.</translation>
</message>
+ <message>
+ <source>SMESH_FREERAM</source>
+ <translation>RAM libre</translation>
+ </message>
+ <message>
+ <source>SMESH_GIGABYTE</source>
+ <translation>%1 GB</translation>
+ </message>
<message>
<source>MEN_SORT_CHILD_ITEMS</source>
- <translation type="unfinished">Sort children</translation>
+ <translation>Trier les enfants</translation>
</message>
<message>
<source>STB_SORT_CHILD_ITEMS</source>
- <translation type="unfinished">Sort child items</translation>
+ <translation>Trier les items enfants</translation>
</message>
</context>
<context>
</context>
<context>
<name>SMESHGUI</name>
- <message>
- <source>PREF_PREVIEW_COLOR</source>
- <translation type="unfinished">Preview color</translation>
- </message>
<message>
<source>NOT_A_VTK_VIEWER</source>
<translation>Cette commande n'est disponible qu'à partir d'une fenêtre VTK.
</message>
<message>
<source>PREF_INCREMENTAL_LIMIT</source>
- <translation type="unfinished">Incremental limit check</translation>
+ <translation>Vérification de la limite incrémentale</translation>
</message>
<message>
<source>PREF_BACKFACE</source>
<source>PREF_FILL</source>
<translation>Remplir</translation>
</message>
+ <message>
+ <source>PREF_PREVIEW_COLOR</source>
+ <translation>Couleur de prévisualisation</translation>
+ </message>
<message>
<source>PREF_NOTIFY_MODE</source>
<translation>Montrer la notification sur le résultat de calcul</translation>
</message>
<message>
<source>PREF_DUMP_CTRL_INFO</source>
- <translation type="unfinished">Dump controls information</translation>
+ <translation>Copier les informations des contrôles</translation>
</message>
<message>
<source>PREF_GPP_NODES_LIMIT</source>
</message>
<message>
<source>PREF_CTRL_LIMIT</source>
- <translation type="unfinished">Automatic controls compute limit</translation>
+ <translation>Contrôle automatique des limites du calcul</translation>
</message>
<message>
<source>SMESH_PREF_GROUP_PRECISION</source>
<source>PREF_BALL_SIZE</source>
<translation>Taille des éléments particulaires</translation>
</message>
+ <message>
+ <source>PREF_BALL_SCALE</source>
+ <translation>Facteur d'échelle des éléments particulaires</translation>
+ </message>
<message>
<source>PREF_WIDTH</source>
<translation>Epaisseur de ligne</translation>
</context>
<context>
<name>SMESHGUI_AddQuadraticElementDlg</name>
- <message>
- <source>SMESH_ADD_BIQUADRATIC_TRIANGLE</source>
- <translation type="unfinished">Add BiQuadratic Triangle</translation>
- </message>
<message>
<source>SMESH_ADD_QUADRATIC_EDGE</source>
<translation>Ajouter une arête quadratique</translation>
<source>SMESH_ADD_QUADRATIC_TRIANGLE</source>
<translation>Ajouter un triangle quadratique</translation>
</message>
+ <message>
+ <source>SMESH_ADD_BIQUADRATIC_TRIANGLE</source>
+ <translation>Ajouter un triangle biquadratique</translation>
+ </message>
<message>
<source>SMESH_CORNER_NODES</source>
<translation>Nœuds angulaires:</translation>
</context>
<context>
<name>SMESHGUI_ComputeDlg</name>
- <message>
- <source>GROUP_OF_BAD_MESH</source>
- <translation type="unfinished">Bad Mesh to Group</translation>
- </message>
<message>
<source>CAPTION</source>
<translation>Le calcul du maillage a échoué</translation>
<source>SHOW_BAD_MESH</source>
<translation>Montrer le maillage incorrect</translation>
</message>
+ <message>
+ <source>GROUP_OF_BAD_MESH</source>
+ <translation>Grouper les mauvais éléments</translation>
+ </message>
+</context>
+<context>
+ <name>SMESHGUI_ComputeDlg_QThreadQDialog</name>
+ <message>
+ <source>CANCEL</source>
+ <translation>Annuler</translation>
+ </message>
+ <message>
+ <source>CANCELING</source>
+ <translation>Annulation...</translation>
+ </message>
+ <message>
+ <source>TITLE</source>
+ <translation>Calcul</translation>
+ </message>
</context>
<context>
<name>SMESHGUI_PrecomputeDlg</name>
</context>
<context>
<name>SMESHGUI_CuttingOfQuadsDlg</name>
- <message>
- <source>TO_4_TRIA</source>
- <translation type="unfinished">Cut into 4 triangles</translation>
- </message>
<message>
<source>CAPTION</source>
<translation>Découpe des quadrangles</translation>
</message>
+ <message>
+ <source>TO_4_TRIA</source>
+ <translation>Découpe en 4 triangles</translation>
+ </message>
</context>
<context>
<name>SMESHGUI_DeleteGroupDlg</name>
</message>
<message>
<source>SHOW_NODES_IDS</source>
- <translation type="unfinished">Show double nodes IDs</translation>
+ <translation>Afficher les IDs des nœuds doubles</translation>
</message>
<message>
<source>SHOW_ELEMS_IDS</source>
- <translation type="unfinished">Show double elements IDs</translation>
+ <translation>Afficher les IDs des éléments doubles</translation>
</message>
<message>
<source>EXCLUDE_GROUPS</source>
</context>
<context>
<name>SMESHGUI_FilterTable</name>
- <message>
- <source>ENTITY_TYPE_24</source>
- <translation type="unfinished">BALL</translation>
- </message>
- <message>
- <source>ENTITY_TYPE_23</source>
- <translation type="unfinished">QPOLYEDRE</translation>
- </message>
- <message>
- <source>ENTITY_TYPE_1</source>
- <translation type="unfinished">POINT1</translation>
- </message>
- <message>
- <source>CONNECTED_ELEMS</source>
- <translation type="unfinished">Elements of a domain</translation>
- </message>
<message>
<source>ADD</source>
<translation>Ajouter</translation>
<source>COPLANAR_FACES</source>
<translation>Faces coplanaires</translation>
</message>
+ <message>
+ <source>CONNECTED_ELEMS</source>
+ <translation>Eléments d'un domaine</translation>
+ </message>
<message>
<source>NUMBEROFNODESINELEMENT</source>
<translation>Nombre de noeuds dans l'élément</translation>
</message>
<message>
<source>ENTITY_TYPE_0</source>
+ <translation>NONE</translation>
+ </message>
+ <message>
+ <source>ENTITY_TYPE_1</source>
<translation>POINT1</translation>
</message>
<message>
</message>
<message>
<source>ENTITY_TYPE_6</source>
- <translation>QUAD4</translation>
+ <translation>TRIA7</translation>
</message>
<message>
<source>ENTITY_TYPE_7</source>
- <translation>QUAD8</translation>
+ <translation>QUAD4</translation>
</message>
<message>
<source>ENTITY_TYPE_8</source>
- <translation>QUAD9</translation>
+ <translation>QUAD8</translation>
</message>
<message>
<source>ENTITY_TYPE_9</source>
- <translation>TETRA4</translation>
+ <translation>QUAD9</translation>
</message>
<message>
<source>ENTITY_TYPE_10</source>
- <translation>TETRA10</translation>
+ <translation>POLYGON</translation>
</message>
<message>
<source>ENTITY_TYPE_11</source>
- <translation>PYRA5</translation>
+ <translation>QPOLYGON</translation>
</message>
<message>
<source>ENTITY_TYPE_12</source>
- <translation>PYRA13</translation>
+ <translation>TETRA4</translation>
</message>
<message>
<source>ENTITY_TYPE_13</source>
- <translation>PENTA6</translation>
+ <translation>TETRA10</translation>
</message>
<message>
<source>ENTITY_TYPE_14</source>
- <translation>PENTA15</translation>
+ <translation>PYRA5</translation>
</message>
<message>
<source>ENTITY_TYPE_15</source>
- <translation>HEXA8</translation>
+ <translation>PYRA13</translation>
</message>
<message>
<source>ENTITY_TYPE_16</source>
- <translation>HEXA20</translation>
+ <translation>HEXA8</translation>
</message>
<message>
<source>ENTITY_TYPE_17</source>
- <translation>HEXA27</translation>
+ <translation>HEXA20</translation>
</message>
<message>
<source>ENTITY_TYPE_18</source>
- <translation>OCTA12</translation>
+ <translation>HEXA27</translation>
</message>
<message>
<source>ENTITY_TYPE_19</source>
- <translation>POLYGONE</translation>
+ <translation>PENTA6</translation>
</message>
<message>
<source>ENTITY_TYPE_20</source>
- <translation>POLYEDRE</translation>
+ <translation>PENTA15</translation>
</message>
<message>
<source>ENTITY_TYPE_21</source>
- <translation>NONE</translation>
+ <translation>OCTA12</translation>
</message>
<message>
<source>ENTITY_TYPE_22</source>
+ <translation>POLYEDRE</translation>
+ </message>
+ <message>
+ <source>ENTITY_TYPE_23</source>
+ <translation>QPOLYEDRE</translation>
+ </message>
+ <message>
+ <source>ENTITY_TYPE_24</source>
<translation>BALL</translation>
</message>
<message>
<source>MESH</source>
<translation>Maillage</translation>
</message>
+ <message>
+ <source>MESH_TYPE</source>
+ <translation>Type de maillage</translation>
+ </message>
<message>
<source>NAME</source>
<translation>Nom</translation>
</message>
<message>
<source>GEOMETRY_OBJECT_IS_NOT_DEFINED</source>
- <translation type="unfinished">Geometry object is not defined.
-Do you want to create an empty mesh
-without algorithms and hypotheses? </translation>
+ <translation>La géométrie n'est pas définie.
+Voulez-vous créer un maillage vide
+sans algorithme ni hypothèse ? </translation>
</message>
<message>
<source>GEOMETRY_OBJECT_IS_NULL</source>
<source>MESH_IS_NULL</source>
<translation>Le maillage est nul</translation>
</message>
+ <message>
+ <source>MT_ANY</source>
+ <translation>Tout type</translation>
+ </message>
+ <message>
+ <source>MT_HEXAHEDRAL</source>
+ <translation>Hexahèdre</translation>
+ </message>
+ <message>
+ <source>MT_TETRAHEDRAL</source>
+ <translation>Tetrahèdre</translation>
+ </message>
+ <message>
+ <source>MT_TRIANGULAR</source>
+ <translation>Triangulaire</translation>
+ </message>
+ <message>
+ <source>MT_QUADRILATERAL</source>
+ <translation>Quadrilatères</translation>
+ </message>
<message>
<source>NAME_OF_MESH_IS_EMPTY</source>
<translation>Le nom du maillage est vide
<source>RELATIVE</source>
<translation>Relative</translation>
</message>
- <message>
- <source>RESET</source>
- <translation>Réinitialiser</translation>
- </message>
- <message>
- <source>INVERT</source>
- <translation>Inverser</translation>
- </message>
<message>
<source>BASE_POINT</source>
<translation>Le point fondamental</translation>
<source>DIRECTION</source>
<translation>Direction</translation>
</message>
+ <message>
+ <source>RESET</source>
+ <translation>Réinitialiser</translation>
+ </message>
+ <message>
+ <source>INVERT</source>
+ <translation>Inverser</translation>
+ </message>
</context>
<context>
<name>SMESHGUI_DuplicateNodesDlg</name>
- <message>
- <source>DUPLICATION_ONLY_ELEMS</source>
- <translation type="unfinished">Duplicate elements only</translation>
- </message>
<message>
<source>DUPLICATION_MODE</source>
<translation>Mode de duplication</translation>
<source>DUPLICATION_WITH_ELEMS</source>
<translation>Avec duplication des éléments de frontière</translation>
</message>
+ <message>
+ <source>DUPLICATION_ONLY_ELEMS</source>
+ <translation>Avec duplication des éléments de frontière seulement</translation>
+ </message>
<message>
<source>GROUP_ELEMS_TO_DUPLICATE</source>
<translation>Groupe des éléments à dupliquer</translation>
<source>QUADRATIC_LAB</source>
<translation>Quadratique</translation>
</message>
+ <message>
+ <source>BI_QUADRATIC_LAB</source>
+ <translation type="unfinished">Bi-Quadratic</translation>
+ </message>
<message>
<source>0D_LAB</source>
<translation>0D:</translation>
</message>
<message>
<source>ELEM_INFO</source>
- <translation>Infos sur les éléments</translation>
+ <translation>Informations sur les éléments</translation>
</message>
<message>
<source>ADDITIONAL_INFO</source>
- <translation>Infos détaillées</translation>
+ <translation>Informations détaillées</translation>
</message>
<message>
<source>CTRL_INFO</source>
- <translation type="unfinished">Quality Info</translation>
+ <translation>Informations sur la qualité</translation>
</message>
<message>
<source>NODE_MODE</source>
<name>SMESHGUI_CtrlInfo</name>
<message>
<source>CTRL_INFO</source>
- <translation type="unfinished">Quality information</translation>
+ <translation>Informations sur la qualité</translation>
</message>
<message>
<source>NAME_LAB</source>
- <translation type="unfinished">Name:</translation>
+ <translation>Nom:</translation>
</message>
<message>
<source>VALUE</source>
- <translation type="unfinished">Value</translation>
+ <translation>Valeur</translation>
</message>
<message>
<source>BUT_COMPUTE</source>
- <translation type="unfinished">Compute</translation>
+ <translation>Calculer</translation>
</message>
<message>
<source>NODES_INFO</source>
- <translation type="unfinished">Nodes Information:</translation>
+ <translation>Informations des nœuds:</translation>
</message>
<message>
<source>NUMBER_OF_THE_FREE_NODES</source>
- <translation type="unfinished">Number of the free nodes</translation>
- </message>
- <message>
- <source>NUMBER_OF_THE_DOUBLE_NODES</source>
- <translation type="unfinished">Number of the double nodes</translation>
+ <translation>Nombre de nœuds libres</translation>
</message>
<message>
<source>DOUBLE_NODES_TOLERANCE</source>
<translation>Tolérance des nœuds doubles</translation>
</message>
+ <message>
+ <source>NUMBER_OF_THE_DOUBLE_NODES</source>
+ <translation>Nombre de nœuds doubles</translation>
+ </message>
<message>
<source>EDGES_INFO</source>
- <translation type="unfinished">Edges Information:</translation>
+ <translation>Informations des arêtes:</translation>
</message>
<message>
<source>NUMBER_OF_THE_DOUBLE_EDGES</source>
- <translation type="unfinished">Number of the double edges</translation>
+ <translation>Nombre d'arêtes doubles</translation>
</message>
<message>
<source>FACES_INFO</source>
- <translation type="unfinished">Faces Information:</translation>
+ <translation>Informations des faces:</translation>
</message>
<message>
<source>NUMBER_OF_THE_DOUBLE_FACES</source>
- <translation type="unfinished">Number of the double faces</translation>
+ <translation>Nombre de faces doubles</translation>
</message>
<message>
<source>ASPECT_RATIO_HISTOGRAM</source>
- <translation type="unfinished">Aspect Ratio histogram</translation>
+ <translation>Histogramme du rapport de forme</translation>
</message>
<message>
<source>VOLUMES_INFO</source>
- <translation type="unfinished">Volumes Information:</translation>
+ <translation>Informations des volumes:</translation>
</message>
<message>
<source>NUMBER_OF_THE_DOUBLE_VOLUMES</source>
- <translation type="unfinished">Number of the double volumes</translation>
+ <translation>Nombre de volumes doubles</translation>
</message>
<message>
<source>NUMBER_OF_THE_OVER_CONSTRAINED</source>
- <translation type="unfinished">Number of the over-constrained</translation>
+ <translation>Nombre de sur-contraintes</translation>
</message>
<message>
<source>ASPECT_RATIO_3D_HISTOGRAM</source>
- <translation type="unfinished">Aspect Ratio 3D histogram</translation>
+ <translation>Histogramme du rapport de forme 3D</translation>
</message>
</context>
<context>
<name>SMESHGUI_CtrlInfoDlg</name>
<message>
- <source>SAVE_INFO</source>
- <translation type="unfinished">Save info</translation>
+ <source>CTRL_INFO</source>
+ <translation>Informations sur la qualité</translation>
</message>
<message>
- <source>TEXT_FILES</source>
- <translation type="unfinished">Text files (*.txt)</translation>
+ <source>BUT_DUMP_MESH</source>
+ <translation>&Dumper</translation>
</message>
<message>
- <source>BUT_DUMP_MESH</source>
- <translation type="unfinished">&Dump</translation>
+ <source>TEXT_FILES</source>
+ <translation>Fichiers texte (*.txt)</translation>
</message>
<message>
- <source>CTRL_INFO</source>
- <translation type="unfinished">Quality Info</translation>
+ <source>SAVE_INFO</source>
+ <translation>Sauvegarder les informations</translation>
</message>
</context>
<context>
<name>SMESHGUI_BasicProperties</name>
<message>
<source>PROPERTY</source>
- <translation type="unfinished">Property</translation>
+ <translation>Propriété</translation>
</message>
<message>
<source>LENGTH</source>
- <translation type="unfinished">Length</translation>
+ <translation>Longueur</translation>
</message>
<message>
<source>AREA</source>
- <translation type="unfinished">Area</translation>
+ <translation>Surface</translation>
</message>
<message>
<source>VOLUME</source>
- <translation type="unfinished">Volume</translation>
+ <translation>Volume</translation>
</message>
<message>
<source>SOURCE_MESH_SUBMESH_GROUP</source>
- <translation type="unfinished">Source (mesh, sub-mesh or group)</translation>
+ <translation>Source (maillage, sous-maillage ou groupe)</translation>
</message>
<message>
<source>COMPUTE</source>
- <translation type="unfinished">Compute</translation>
+ <translation>Calculer</translation>
</message>
</context>
<context>
</message>
<message>
<source>BASIC_PROPERTIES</source>
- <translation type="unfinished">Basic Properties</translation>
+ <translation>Propriétés basiques</translation>
</message>
</context>
<context>
<translation>Taille:</translation>
</message>
<message>
- <source>ORIENTATION_SCALE</source>
+ <source>SCALE_FACTOR</source>
<translation>Echelle:</translation>
</message>
<message>
<translation>Coef de réduction:</translation>
</message>
</context>
-<context>
- <name>SMESHGUI_ComputeDlg_QThreadQDialog</name>
- <message>
- <source>TITLE</source>
- <translation type="unfinished">Compute</translation>
- </message>
- <message>
- <source>CANCELING</source>
- <translation type="unfinished">Canceling...</translation>
- </message>
- <message>
- <source>CANCEL</source>
- <translation type="unfinished">Cancel</translation>
- </message>
-</context>
</TS>
<source>SMESH_MESHINFO_ORDER2</source>
<translation>二次</translation>
</message>
+ <message>
+ <source>SMESH_MESHINFO_ORDER3</source>
+ <translation type="unfinished">Bi-Quadratic</translation>
+ </message>
<message>
<source>SMESH_MESHINFO_HEXAPRISM</source>
<translation>六角形プリズム</translation>
<source>QUADRATIC_LAB</source>
<translation>二次</translation>
</message>
+ <message>
+ <source>BI_QUADRATIC_LAB</source>
+ <translation type="unfinished">Bi-Quadratic</translation>
+ </message>
<message>
<source>0D_LAB</source>
<translation>0D:</translation>
<translation>サイズ</translation>
</message>
<message>
- <source>ORIENTATION_SCALE</source>
+ <source>SCALE_FACTOR</source>
<translation>スケール:</translation>
</message>
<message>
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
${CAS_TKG3d}
${CAS_TKGeomBase}
${CAS_TKGeomAlgo}
+ ${Boost_LIBRARIES}
SMESHDS
)
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
#include "SMESH_Block.hxx"
+#include "SMDS_MeshNode.hxx"
+#include "SMDS_MeshVolume.hxx"
+#include "SMDS_VolumeTool.hxx"
+#include "SMESH_MeshAlgos.hxx"
+
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Curve2d.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <math_Matrix.hxx>
#include <math_Vector.hxx>
-#include "SMDS_MeshNode.hxx"
-#include "SMDS_MeshVolume.hxx"
-#include "SMDS_VolumeTool.hxx"
-#include "utilities.h"
+#include <utilities.h>
#include <list>
#include <limits>
namespace
{
+ inline
bool isPntInTria( const gp_XY& p, const gp_XY& t0, const gp_XY& t1, const gp_XY& t2 )
{
- const double // matrix 2x2
- T11 = t0.X()-t2.X(), T12 = t1.X()-t2.X(),
- T21 = t0.Y()-t2.Y(), T22 = t1.Y()-t2.Y();
- const double Tdet = T11*T22 - T12*T21; // matrix determinant
- if ( Abs( Tdet ) < std::numeric_limits<double>::min() )
- return false;
- // matrix inverse
- const double t11 = T22, t12 = -T12, t21 = -T21, t22 = T11;
- // vector
- const double r11 = p.X()-t2.X(), r12 = p.Y()-t2.Y();
- // barycentric coordinates: mutiply matrix by vector
- const double bc0 = (t11 * r11 + t12 * r12)/Tdet;
- const double bc1 = (t21 * r11 + t22 * r12)/Tdet;
+ double bc0, bc1;
+ SMESH_MeshAlgos::GetBarycentricCoords( p, t0, t1, t2, bc0, bc1 );
return ( bc0 >= 0. && bc1 >= 0. && bc0 + bc1 <= 1. );
}
+ inline
bool isPntInQuad( const gp_XY& p,
const gp_XY& q0, const gp_XY& q1, const gp_XY& q2, const gp_XY& q3 )
{
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// ----------------------------
ID_NONE = 0,
- ID_V000 = 1, ID_V100, ID_V010, ID_V110, ID_V001, ID_V101, ID_V011, ID_V111,
+ ID_V000 = 1, ID_V100, ID_V010, ID_V110, ID_V001, ID_V101, ID_V011, ID_V111, // 1-8
- ID_Ex00, ID_Ex10, ID_Ex01, ID_Ex11,
- ID_E0y0, ID_E1y0, ID_E0y1, ID_E1y1,
- ID_E00z, ID_E10z, ID_E01z, ID_E11z,
+ ID_Ex00, ID_Ex10, ID_Ex01, ID_Ex11, // 9-12
+ ID_E0y0, ID_E1y0, ID_E0y1, ID_E1y1, // 13-16
+ ID_E00z, ID_E10z, ID_E01z, ID_E11z, // 17-20
- ID_Fxy0, ID_Fxy1, ID_Fx0z, ID_Fx1z, ID_F0yz, ID_F1yz,
+ ID_Fxy0, ID_Fxy1, ID_Fx0z, ID_Fx1z, ID_F0yz, ID_F1yz, // 21-26
- ID_Shell
- };
- enum { // to use TShapeID for indexing certain type subshapes
+ ID_Shell, // 27
- ID_FirstV = ID_V000, ID_FirstE = ID_Ex00, ID_FirstF = ID_Fxy0
+ // to use TShapeID for indexing certain type subshapes
+ ID_FirstV = ID_V000, ID_FirstE = ID_Ex00, ID_FirstF = ID_Fxy0
};
std::list< int > & theNbEdgesInWires,
TopoDS_Vertex theFirstVertex=TopoDS_Vertex(),
const bool theShapeAnalysisAlgo=false);
- // Return nb wires and a list of oredered edges.
+ // Return nb wires and a list of ordered edges.
// It is used to assign indices to subshapes.
// theFirstVertex may be NULL.
// Always try to set a seam edge first
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
_case2char(COMPERR_WARNING );
_case2char(COMPERR_CANCELED );
_case2char(COMPERR_NO_MESH_ON_SHAPE);
+ _case2char(COMPERR_BAD_PARMETERS );
default:;
}
return "";
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// Created : Wed Mar 10 11:23:25 2010
// Author : Edward AGAPOV (eap)
//
-#include "SMESH_File.hxx"
-#include "utilities.h"
-#include <OSD_File.hxx>
-#include <OSD_Path.hxx>
-#include <Standard_ProgramError.hxx>
-#include <Standard_ErrorHandler.hxx>
-#include <Standard_Failure.hxx>
+#include "SMESH_File.hxx"
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#endif
+#include <boost/filesystem.hpp>
+
+namespace boofs = boost::filesystem;
+
//================================================================================
/*!
* \brief Creator opening the file for reading by default
_pos = _end = 0;
_size = -1;
}
+ else if ( _file >= 0 )
+ {
+#ifdef WIN32
+ CloseHandle(_file);
+ _file = INVALID_HANDLE_VALUE;
+#else
+ ::close(_file);
+ _file = -1;
+#endif
+ }
}
//================================================================================
bool SMESH_File::remove()
{
close();
- try {
- OSD_Path filePath(TCollection_AsciiString((char*)_name.data()));
- OSD_File(filePath).Remove();
- }
- catch ( Standard_ProgramError ) {
- MESSAGE("Can't remove file: " << _name << " ; file does not exist or permission denied");
- return false;
- }
- return true;
+
+ boost::system::error_code err;
+ boofs::remove( _name, err );
+ _error = err.message();
+
+ return !err;
}
//================================================================================
*/
//================================================================================
-int SMESH_File::size() const
+long SMESH_File::size()
{
- if ( _size >= 0 ) return _size; // size of open file
+ if ( _size >= 0 ) return _size; // size of an open file
- int size = -1;
- int file = ::open( _name.data(), O_RDONLY );
- if ( file > 0 )
- {
- struct stat status;
- int err = fstat( file, &status);
- if ( !err )
- size = status.st_size;
- ::close( file );
- }
- return size;
+ boost::system::error_code err;
+ boost::uintmax_t size = boofs::file_size( _name, err );
+ _error = err.message();
+
+ return err ? -1 : (long) size;
+}
+
+//================================================================================
+/*!
+ * \brief Check existence
+ */
+//================================================================================
+
+bool SMESH_File::exists()
+{
+ boost::system::error_code err;
+ bool res = boofs::exists( _name, err );
+ _error = err.message();
+
+ return err ? false : res;
+}
+
+//================================================================================
+/*!
+ * \brief Check existence
+ */
+//================================================================================
+
+bool SMESH_File::isDirectory()
+{
+ boost::system::error_code err;
+ bool res = boofs::is_directory( _name, err );
+ _error = err.message();
+
+ return err ? false : res;
}
//================================================================================
}
return ( i == ints.size() );
}
+
+//================================================================================
+/*!
+ * \brief Open for binary writing only.
+ */
+//================================================================================
+
+bool SMESH_File::openForWriting()
+{
+#ifdef WIN32
+
+ _file = CreateFile( _name.c_str(), // name of the write
+ GENERIC_WRITE, // open for writing
+ 0, // do not share
+ NULL, // default security
+ OPEN_ALWAYS, // CREATE NEW or OPEN EXISTING
+ FILE_ATTRIBUTE_NORMAL, // normal file
+ NULL); // no attr. template
+ return ( _file != INVALID_HANDLE_VALUE );
+
+#else
+
+ _file = ::open( _name.c_str(),
+ O_WRONLY | O_CREAT,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ); // rw-r--r--
+ return _file >= 0;
+
+#endif
+}
+
+//================================================================================
+/*!
+ * \brief Write binary data
+ */
+//================================================================================
+
+bool SMESH_File::writeRaw(const void* data, size_t size)
+{
+#ifdef WIN32
+
+ DWORD nbWritten = 0;
+ BOOL err = WriteFile( _file, data, size, & nbWritten, NULL);
+
+ return (( err == FALSE ) &&
+ ( nbWritten == (DWORD) size ));
+
+#else
+
+ ssize_t nbWritten = ::write( _file, data, size );
+ return ( nbWritten == size );
+
+#endif
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
{
public:
- SMESH_File(const std::string& name, bool open=true);
+ SMESH_File(const std::string& name, bool openForReading=true);
~SMESH_File();
std::string getName() const { return _name; }
- bool open();
+ const std::string& error() const { return _error; }
void close();
bool remove();
- int size() const;
+ long size();
+
+ bool exists();
+
+ bool isDirectory();
// ------------------------
// Access to file contents
// ------------------------
+ bool open(); // for reading
+
operator const char*() const { return _pos; }
bool operator++() { return ++_pos < _end; }
bool eof() const { return _pos >= _end; }
+ const char* end() const { return _end; }
+
const char* getPos() const { return _pos; }
void setPos(const char* pos);
bool getInts(std::vector<int>& ids);
+ // ------------------------
+ // Writting a binary file
+ // ------------------------
+
+ bool openForWriting(); // binary writing only
+
+ template <typename T>
+ bool write( const T* values, size_t nbTValues )
+ {
+ return writeRaw((const void*) values, nbTValues * sizeof(T));
+ }
+
+ template <typename T>
+ bool write( const T& value )
+ {
+ return writeRaw((const void*) & value, sizeof(T));
+ }
+
+ bool writeRaw(const void* data, size_t size);
+
private:
std::string _name; //!< file name
int _size; //!< file size
+ std::string _error;
#ifdef WIN32
HANDLE _file, _mapObj;
#else
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESH_MeshAlgos.hxx"
+#include "SMDS_FaceOfNodes.hxx"
#include "SMDS_LinearEdge.hxx"
-#include "SMDS_VolumeTool.hxx"
#include "SMDS_Mesh.hxx"
+#include "SMDS_PolygonalFaceOfNodes.hxx"
+#include "SMDS_VolumeTool.hxx"
#include "SMESH_OctreeNode.hxx"
#include <GC_MakeSegment.hxx>
{
const SMDS_MeshElement* closestElem = 0;
- if ( type == SMDSAbs_Face )
+ if ( type == SMDSAbs_Face || type == SMDSAbs_Volume )
{
if ( !_ebbTree || _elementType != type )
{
{
gp_Pnt boxCenter = 0.5 * ( _ebbTree->getBox()->CornerMin() +
_ebbTree->getBox()->CornerMax() );
- double radius;
+ double radius = -1;
if ( _ebbTree->getBox()->IsOut( point.XYZ() ))
radius = point.Distance( boxCenter ) - 0.5 * _ebbTree->maxSize();
- else
+ if ( radius < 0 )
radius = _ebbTree->maxSize() / pow( 2., _ebbTree->getHeight()) / 2;
while ( suspectElems.empty() )
{
TIDSortedElemSet::iterator elem = suspectElems.begin();
for ( ; elem != suspectElems.end(); ++elem )
{
- double dist = SMESH_MeshAlgos::GetDistance( dynamic_cast<const SMDS_MeshFace*>(*elem),
- point );
+ double dist = SMESH_MeshAlgos::GetDistance( *elem, point );
if ( dist < minDist + 1e-10)
{
minDist = dist;
}
}
+//=======================================================================
+/*!
+ * \brief Return minimal distance from a point to an element
+ *
+ * Currently we ignore non-planarity and 2nd order of face
+ */
+//=======================================================================
+
+double SMESH_MeshAlgos::GetDistance( const SMDS_MeshElement* elem,
+ const gp_Pnt& point )
+{
+ switch ( elem->GetType() )
+ {
+ case SMDSAbs_Volume:
+ return GetDistance( dynamic_cast<const SMDS_MeshVolume*>( elem ), point);
+ case SMDSAbs_Face:
+ return GetDistance( dynamic_cast<const SMDS_MeshFace*>( elem ), point);
+ case SMDSAbs_Edge:
+ return GetDistance( dynamic_cast<const SMDS_MeshEdge*>( elem ), point);
+ case SMDSAbs_Node:
+ return point.Distance( SMESH_TNodeXYZ( elem ));
+ }
+ return -1;
+}
+
//=======================================================================
/*!
* \brief Return minimal distance from a point to a face
return badDistance;
}
+//=======================================================================
+/*!
+ * \brief Return minimal distance from a point to an edge
+ */
+//=======================================================================
+
+double SMESH_MeshAlgos::GetDistance( const SMDS_MeshEdge* edge, const gp_Pnt& point )
+{
+ throw SALOME_Exception(LOCALIZED("not implemented so far"));
+}
+
+//=======================================================================
+/*!
+ * \brief Return minimal distance from a point to a volume
+ *
+ * Currently we ignore non-planarity and 2nd order
+ */
+//=======================================================================
+
+double SMESH_MeshAlgos::GetDistance( const SMDS_MeshVolume* volume, const gp_Pnt& point )
+{
+ SMDS_VolumeTool vTool( volume );
+ vTool.SetExternalNormal();
+ const int iQ = volume->IsQuadratic() ? 2 : 1;
+
+ double n[3], bc[3];
+ double minDist = 1e100, dist;
+ for ( int iF = 0; iF < vTool.NbFaces(); ++iF )
+ {
+ // skip a facet with normal not "looking at" the point
+ if ( !vTool.GetFaceNormal( iF, n[0], n[1], n[2] ) ||
+ !vTool.GetFaceBaryCenter( iF, bc[0], bc[1], bc[2] ))
+ continue;
+ gp_XYZ bcp = point.XYZ() - gp_XYZ( bc[0], bc[1], bc[2] );
+ if ( gp_XYZ( n[0], n[1], n[2] ) * bcp < 1e-6 )
+ continue;
+
+ // find distance to a facet
+ const SMDS_MeshNode** nodes = vTool.GetFaceNodes( iF );
+ switch ( vTool.NbFaceNodes( iF ) / iQ ) {
+ case 3:
+ {
+ SMDS_FaceOfNodes tmpFace( nodes[0], nodes[ 1*iQ ], nodes[ 2*iQ ] );
+ dist = GetDistance( &tmpFace, point );
+ break;
+ }
+ case 4:
+ {
+ SMDS_FaceOfNodes tmpFace( nodes[0], nodes[ 1*iQ ], nodes[ 2*iQ ], nodes[ 3*iQ ]);
+ dist = GetDistance( &tmpFace, point );
+ break;
+ }
+ default:
+ vector<const SMDS_MeshNode *> nvec( nodes, nodes + vTool.NbFaceNodes( iF ));
+ SMDS_PolygonalFaceOfNodes tmpFace( nvec );
+ dist = GetDistance( &tmpFace, point );
+ }
+ minDist = Min( minDist, dist );
+ }
+ return minDist;
+}
+
+//================================================================================
+/*!
+ * \brief Returns barycentric coordinates of a point within a triangle.
+ * A not returned bc2 = 1. - bc0 - bc1.
+ * The point lies within the triangle if ( bc0 >= 0 && bc1 >= 0 && bc0+bc1 <= 1 )
+ */
+//================================================================================
+
+void SMESH_MeshAlgos::GetBarycentricCoords( const gp_XY& p,
+ const gp_XY& t0,
+ const gp_XY& t1,
+ const gp_XY& t2,
+ double & bc0,
+ double & bc1)
+{
+ const double // matrix 2x2
+ T11 = t0.X()-t2.X(), T12 = t1.X()-t2.X(),
+ T21 = t0.Y()-t2.Y(), T22 = t1.Y()-t2.Y();
+ const double Tdet = T11*T22 - T12*T21; // matrix determinant
+ if ( Abs( Tdet ) < std::numeric_limits<double>::min() )
+ {
+ bc0 = bc1 = 2.;
+ return;
+ }
+ // matrix inverse
+ const double t11 = T22, t12 = -T12, t21 = -T21, t22 = T11;
+ // vector
+ const double r11 = p.X()-t2.X(), r12 = p.Y()-t2.Y();
+ // barycentric coordinates: mutiply matrix by vector
+ bc0 = (t11 * r11 + t12 * r12)/Tdet;
+ bc1 = (t21 * r11 + t22 * r12)/Tdet;
+}
+
//=======================================================================
//function : FindFaceInSet
//purpose : Return a face having linked nodes n1 and n2 and which is
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
/*!
* \brief Return true if the point is IN or ON of the element
*/
- SMESHUtils_EXPORT bool IsOut( const SMDS_MeshElement* element, const gp_Pnt& point, double tol );
+ SMESHUtils_EXPORT
+ bool IsOut( const SMDS_MeshElement* element, const gp_Pnt& point, double tol );
- SMESHUtils_EXPORT double GetDistance( const SMDS_MeshFace* face, const gp_Pnt& point );
+ SMESHUtils_EXPORT
+ double GetDistance( const SMDS_MeshElement* elem, const gp_Pnt& point );
+
+ SMESHUtils_EXPORT
+ double GetDistance( const SMDS_MeshEdge* edge, const gp_Pnt& point );
+
+ SMESHUtils_EXPORT
+ double GetDistance( const SMDS_MeshFace* face, const gp_Pnt& point );
+
+ SMESHUtils_EXPORT
+ double GetDistance( const SMDS_MeshVolume* volume, const gp_Pnt& point );
+
+ SMESHUtils_EXPORT
+ void GetBarycentricCoords( const gp_XY& point,
+ const gp_XY& t0, const gp_XY& t1, const gp_XY& t2,
+ double & bc0, double & bc1);
/*!
* Return a face having linked nodes n1 and n2 and which is
* - in elemSet provided that !elemSet.empty()
* i1 and i2 optionally returns indices of n1 and n2
*/
- SMESHUtils_EXPORT const SMDS_MeshElement*
- FindFaceInSet(const SMDS_MeshNode* n1,
- const SMDS_MeshNode* n2,
- const TIDSortedElemSet& elemSet,
- const TIDSortedElemSet& avoidSet,
- int* i1=0,
- int* i2=0);
+ SMESHUtils_EXPORT
+ const SMDS_MeshElement* FindFaceInSet(const SMDS_MeshNode* n1,
+ const SMDS_MeshNode* n2,
+ const TIDSortedElemSet& elemSet,
+ const TIDSortedElemSet& avoidSet,
+ int* i1=0,
+ int* i2=0);
/*!
* \brief Calculate normal of a mesh face
*/
- SMESHUtils_EXPORT bool FaceNormal(const SMDS_MeshElement* F, gp_XYZ& normal, bool normalized=true);
+ SMESHUtils_EXPORT
+ bool FaceNormal(const SMDS_MeshElement* F, gp_XYZ& normal, bool normalized=true);
/*!
* \brief Return nodes common to two elements
*/
- SMESHUtils_EXPORT std::vector< const SMDS_MeshNode*> GetCommonNodes(const SMDS_MeshElement* e1,
+ SMESHUtils_EXPORT
+ std::vector< const SMDS_MeshNode*> GetCommonNodes(const SMDS_MeshElement* e1,
const SMDS_MeshElement* e2);
/*!
* \brief Return SMESH_NodeSearcher. The caller is responsible for deleteing it
*/
- SMESHUtils_EXPORT SMESH_NodeSearcher* GetNodeSearcher( SMDS_Mesh& mesh );
+ SMESHUtils_EXPORT
+ SMESH_NodeSearcher* GetNodeSearcher( SMDS_Mesh& mesh );
/*!
* \brief Return SMESH_ElementSearcher. The caller is responsible for deleting it
*/
- SMESHUtils_EXPORT SMESH_ElementSearcher* GetElementSearcher( SMDS_Mesh& mesh );
- SMESHUtils_EXPORT SMESH_ElementSearcher* GetElementSearcher( SMDS_Mesh& mesh,
- SMDS_ElemIteratorPtr elemIt );
+ SMESHUtils_EXPORT
+ SMESH_ElementSearcher* GetElementSearcher( SMDS_Mesh& mesh );
+ SMESHUtils_EXPORT
+ SMESH_ElementSearcher* GetElementSearcher( SMDS_Mesh& mesh,
+ SMDS_ElemIteratorPtr elemIt );
}
#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
}
else if ( NbNodes() > 0 )
{
+ size_t nbFoundBefore = dist2Nodes.size();
double minDist = precision * precision;
gp_Pnt p1 ( node.X(), node.Y(), node.Z() );
TIDSortedNodeSet::iterator nIt = myNodes.begin();
// if ( dist2Nodes.size() > 1 ) // leave only closest node in dist2Nodes
// dist2Nodes.erase( ++dist2Nodes.begin(), dist2Nodes.end());
- return ( sqrt( minDist) <= precision * 1e-12 );
+ return ( nbFoundBefore < dist2Nodes.size() );
}
}
return false;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESH_Utils.hxx"
-#include <SMDS_MeshNode.hxx>
+#include "SMDS_MeshNode.hxx"
#include <gp_XYZ.hxx>
+#include <gp_XY.hxx>
#include <map>
#include <list>
std::list<const SMDS_MeshElement*>, TIDCompare > TElemOfElemListMap;
typedef std::map<const SMDS_MeshElement*,
std::list<const SMDS_MeshNode*>, TIDCompare > TElemOfNodeListMap;
-typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap;
+typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap;
//!< Set of elements sorted by ID, to be used to assure predictability of edition
typedef std::set< const SMDS_MeshElement*, TIDCompare > TIDSortedElemSet;
typedef std::pair< const SMDS_MeshNode*, const SMDS_MeshNode* > NLink;
-struct faceQuadStruct; // defined in StdMeshers_Quadrangle_2D.hxx
-typedef boost::shared_ptr<faceQuadStruct> TFaceQuadStructPtr;
+struct FaceQuadStruct; // defined in StdMeshers_Quadrangle_2D.hxx
+typedef boost::shared_ptr<FaceQuadStruct> TFaceQuadStructPtr;
namespace SMESHUtils
TVECTOR v2( vec );
vec.swap( v2 );
}
+ /*!
+ * \brief Auto pointer
+ */
+ template <typename TOBJ>
+ struct Deleter
+ {
+ TOBJ* _obj;
+ Deleter( TOBJ* obj ): _obj( obj ) {}
+ ~Deleter() { delete _obj; _obj = 0; }
+ private:
+ Deleter( const Deleter& );
+ };
+ /*!
+ * \brief Auto pointer to array
+ */
+ template <typename TOBJ>
+ struct ArrayDeleter
+ {
+ TOBJ* _obj;
+ ArrayDeleter( TOBJ* obj ): _obj( obj ) {}
+ ~ArrayDeleter() { delete [] _obj; _obj = 0; }
+ private:
+ ArrayDeleter( const ArrayDeleter& );
+ };
}
//=======================================================================
double x, y; // 2d parameter, normalized [0,1]
const SMDS_MeshNode * node;
+ uvPtStruct(): node(NULL) {}
+
+ inline gp_XY UV() const { return gp_XY( u, v ); }
+
struct NodeAccessor // accessor to iterate on nodes in UVPtStructVec
{
static const SMDS_MeshNode* value(std::vector< uvPtStruct >::const_iterator it)
DEFINE_SEQUENCE(SMESH_SequenceOfNode,
SMESH_BaseCollectionNodePtr, SMDS_MeshNodePtr)
-// --------------------------------------------------------------------------------
-// #include "SMESHDS_DataMapOfShape.hxx"
-
-// #include <NCollection_DefineIndexedMap.hxx>
-
-// #include <TopoDS_Shape.hxx>
-
-/// Class SMESH_IndexedMapOfShape
-
-// DEFINE_BASECOLLECTION (SMESH_BaseCollectionShape, TopoDS_Shape)
-// DEFINE_INDEXEDMAP (SMESH_IndexedMapOfShape, SMESH_BaseCollectionShape, TopoDS_Shape)
-
-/// Class SMESH_IndexedDataMapOfShapeIndexedMapOfShape
-
-// DEFINE_BASECOLLECTION (SMESH_BaseCollectionIndexedMapOfShape, SMESH_IndexedMapOfShape)
-// DEFINE_INDEXEDDATAMAP (SMESH_IndexedDataMapOfShapeIndexedMapOfShape,
-// SMESH_BaseCollectionIndexedMapOfShape, TopoDS_Shape,
-// SMESH_IndexedMapOfShape)
-
-// --------------------------------------------------------------------------------
-// class SMESH_DataMapOfElemPtrSequenceOfElemPtr
-
-// SMESHUtils_EXPORT
-// inline Standard_Integer HashCode(SMDS_MeshElementPtr theElem,
-// const Standard_Integer theUpper)
-// {
-// void* anElem = (void*) theElem;
-// return HashCode(anElem,theUpper);
-// }
-
-// SMESHUtils_EXPORT
-// inline Standard_Boolean IsEqual(SMDS_MeshElementPtr theOne,
-// SMDS_MeshElementPtr theTwo)
-// {
-// return theOne == theTwo;
-// }
-
-// DEFINE_BASECOLLECTION (SMESH_BaseCollectionSequenceOfElemPtr, SMESH_SequenceOfElemPtr)
-// DEFINE_DATAMAP (SMESH_DataMapOfElemPtrSequenceOfElemPtr,
-// SMESH_BaseCollectionSequenceOfElemPtr,
-// SMDS_MeshElementPtr, SMESH_SequenceOfElemPtr)
-
#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
SMDS
SMESHDS
SMESHControls
+ MeshDriverMED
)
# --- headers ---
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
*/
//================================================================================
- void StructToList( Handle( _pyCommand)& theCommand )
+ void StructToList( Handle( _pyCommand)& theCommand, const bool checkMethod=true )
{
static TStringSet methodsAcceptingList;
if ( methodsAcceptingList.empty() ) {
"ExtrusionSweepObject2D","ExtrusionSweepObject2DMakeGroups",
"Translate","TranslateMakeGroups","TranslateMakeMesh",
"TranslateObject","TranslateObjectMakeGroups", "TranslateObjectMakeMesh",
- "ExtrusionAlongPathX","ExtrusionAlongPathObjX"
+ "ExtrusionAlongPathX","ExtrusionAlongPathObjX","SplitHexahedraIntoPrisms"
,"" }; // <- mark of the end
methodsAcceptingList.Insert( methodNames );
}
- if ( methodsAcceptingList.Contains( theCommand->GetMethod() ))
+ if ( !checkMethod || methodsAcceptingList.Contains( theCommand->GetMethod() ))
{
for ( int i = theCommand->GetNbArgs(); i > 0; --i )
{
TCollection_AsciiString newMethod = method;
newMethod.Remove( 7, 6 );
theCommand->SetMethod( newMethod );
- // make the 1st arg be the last one (or last but one for ExportMED())
+ // make the 1st arg be the last one (or last but three for ExportMED())
_pyID partID = theCommand->GetArg( 1 );
- int nbArgs = theCommand->GetNbArgs() - (newMethod == "ExportMED");
+ int nbArgs = theCommand->GetNbArgs() - 3 * (newMethod == "ExportMED");
for ( int i = 2; i <= nbArgs; ++i )
theCommand->SetArg( i-1, theCommand->GetArg( i ));
theCommand->SetArg( nbArgs, partID );
"GetSubMeshElementsId","GetSubMeshNodesId","GetSubMeshElementType","Dump","GetNodeXYZ",
"GetNodeInverseElements","GetShapeID","GetShapeIDForElem","GetElemNbNodes",
"GetElemNode","IsMediumNode","IsMediumNodeOfAnyElem","ElemNbEdges","ElemNbFaces",
+ "GetElemFaceNodes", "GetFaceNormal", "FindElementByNodes",
"IsPoly","IsQuadratic","BaryCenter","GetHypothesisList", "SetAutoColor", "GetAutoColor",
"Clear", "ConvertToStandalone", "GetMeshOrder", "SetMeshOrder"
,"" }; // <- mark of end
"GetLastCreatedElems",
"MirrorMakeMesh","MirrorObjectMakeMesh","TranslateMakeMesh","TranslateObjectMakeMesh",
"Scale","ScaleMakeMesh","RotateMakeMesh","RotateObjectMakeMesh","MakeBoundaryMesh",
- "MakeBoundaryElements", "SplitVolumesIntoTetra",
+ "MakeBoundaryElements", "SplitVolumesIntoTetra","SplitHexahedraIntoPrisms",
"DoubleElements","DoubleNodes","DoubleNode","DoubleNodeGroup","DoubleNodeGroups",
"DoubleNodeElem","DoubleNodeElemInRegion","DoubleNodeElemGroup",
"DoubleNodeElemGroupInRegion","DoubleNodeElemGroups","DoubleNodeElemGroupsInRegion",
hyp->SetConvMethodAndType( "SetGrid", "Cartesian_3D");
for ( int iArg = 0; iArg < 4; ++iArg )
hyp->setCreationArg( iArg+1, "[]");
+ hyp->AddAccumulativeMethod( "SetGrid" );
+ hyp->AddAccumulativeMethod( "SetGridSpacing" );
}
else
{
{
// CartesianParameters3D hyp
- if ( theCommand->GetMethod() == "SetSizeThreshold" )
+ if ( theCommand->GetMethod() == "SetSizeThreshold" ||
+ theCommand->GetMethod() == "SetToAddEdges" )
{
- setCreationArg( 4, theCommand->GetArg( 1 ));
+ int iEdges = ( theCommand->GetMethod().Value( 4 ) == 'T' );
+ setCreationArg( 4+iEdges, theCommand->GetArg( 1 ));
myArgCommands.push_back( theCommand );
return;
}
myCurCrMethod->myArgs[ iArg ] += "]";
}
myArgCommands.push_back( theCommand );
- rememberCmdOfParameter( theCommand );
+ //rememberCmdOfParameter( theCommand ); -- these commands are marked as
+ // accumulative, else, if the creation
+ // is not converted, commands for axes 1 and 2 are lost
return;
}
}
for ( ; cmd != myUnusedCommands.end(); ++cmd )
if ((*cmd)->GetMethod() == "SetObjectEntry" )
(*cmd)->Clear();
+
+ if ( GetAlgoType() == "Cartesian_3D" )
+ {
+ _pyID algo = myCreationCmd->GetObject();
+ for ( cmd = myProcessedCmds.begin(); cmd != myProcessedCmds.end(); ++cmd )
+ {
+ StructToList( *cmd, /*checkMethod=*/false );
+ (*cmd)->SetObject( algo );
+ }
+ }
}
}
//================================================================================
/*!
* \brief Convert methods of 1D hypotheses to my own methods
- * \param theCommand - The called hypothesis method
+ * \param theCommand - The called hypothesis method
*/
//================================================================================
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
template<class TArray>
void DumpArray(const TArray& theArray, TPythonDump & theStream)
{
- theStream << "[ ";
- for (int i = 1; i <= theArray.length(); i++) {
- theStream << theArray[i-1];
- if ( i < theArray.length() )
- theStream << ", ";
+ if ( theArray.length() == 0 )
+ {
+ theStream << "[]";
+ }
+ else
+ {
+ theStream << "[ ";
+ for (int i = 1; i <= theArray.length(); i++) {
+ theStream << theArray[i-1];
+ if ( i < theArray.length() )
+ theStream << ", ";
+ }
+ theStream << " ]";
}
- theStream << " ]";
}
TPythonDump&
return *this;
}
+ TPythonDump&
+ TPythonDump::operator<<(const SMESH::nodes_array& theArg)
+ {
+ DumpArray( theArg, *this );
+ return *this;
+ }
+
TPythonDump&
TPythonDump::operator<<(const SMESH::string_array& theArray)
{
DumpArray( *theList, *this );
return *this;
}
+ TPythonDump& TPythonDump::operator<<(const GEOM::ListOfGO& theList)
+ {
+ DumpArray( theList, *this );
+ return *this;
+ }
+ TPythonDump& TPythonDump::operator<<(const GEOM::ListOfGBO& theList)
+ {
+ DumpArray( theList, *this );
+ return *this;
+ }
TPythonDump& TPythonDump::operator<<(const SMESH::ListOfIDSources& theList)
{
DumpArray( theList, *this );
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESH_Mesh_i.hxx"
#include "SMESH_PreMeshInfo.hxx"
#include "SMESH_PythonDump.hxx"
-//#include "memoire.h"
+#include "SMESH_TryCatch.hxx" // to include after OCC headers!
#include CORBA_SERVER_HEADER(SMESH_Group)
#include CORBA_SERVER_HEADER(SMESH_Filter)
if ( myShapeReader )
delete myShapeReader;
}
-
//=============================================================================
/*!
- * SMESH_Gen_i::createHypothesis
+ * SMESH_Gen_i::getHypothesisCreator
*
- * Create hypothesis of given type
+ * Get hypothesis creator
*/
//=============================================================================
-SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName,
- const char* theLibName)
+GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHypName,
+ const char* theLibName,
+ std::string& thePlatformLibName)
throw (SALOME::SALOME_Exception)
{
- /* It's Need to tranlate lib name for WIN32 or X platform */
std::string aPlatformLibName;
+ /* It's Need to tranlate lib name for WIN32 or X platform */
if ( theLibName && theLibName[0] != '\0' )
{
int libNameLen = strlen(theLibName);
#endif
}
}
+ thePlatformLibName = aPlatformLibName;
Unexpect aCatch(SALOME_SalomeException);
if(MYDEBUG) MESSAGE( "Create Hypothesis <" << theHypName << "> from " << aPlatformLibName);
- // create a new hypothesis object servant
- SMESH_Hypothesis_i* myHypothesis_i = 0;
- SMESH::SMESH_Hypothesis_var hypothesis_i;
-
+ typedef GenericHypothesisCreator_i* (*GetHypothesisCreator)(const char* );
+ GenericHypothesisCreator_i* aCreator;
try
{
// check, if creator for this hypothesis type already exists
// get method, returning hypothesis creator
if(MYDEBUG) MESSAGE("Find GetHypothesisCreator() method ...");
- typedef GenericHypothesisCreator_i* (*GetHypothesisCreator)(const char* theHypName);
GetHypothesisCreator procHandle =
(GetHypothesisCreator)GetProc( libHandle, "GetHypothesisCreator" );
if (!procHandle)
// get hypothesis creator
if(MYDEBUG) MESSAGE("Get Hypothesis Creator for " << theHypName);
- GenericHypothesisCreator_i* aCreator = procHandle(theHypName);
+ aCreator = procHandle(theHypName);
if (!aCreator)
{
throw(SALOME_Exception(LOCALIZED("no such a hypothesis in this plugin")));
}
-
// map hypothesis creator to a hypothesis name
myHypCreatorMap[string(theHypName)] = aCreator;
+ return aCreator;
+ }
+ else
+ {
+ return myHypCreatorMap[string(theHypName)];
}
-
- // create a new hypothesis object, store its ref. in studyContext
- if(MYDEBUG) MESSAGE("Create Hypothesis " << theHypName);
- myHypothesis_i =
- myHypCreatorMap[string(theHypName)]->Create(myPoa, GetCurrentStudyID(), &myGen);
- myHypothesis_i->SetLibName(aPlatformLibName.c_str()); // for persistency assurance
}
catch (SALOME_Exception& S_ex)
{
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
}
+ return aCreator;
+}
+
+//=============================================================================
+/*!
+ * SMESH_Gen_i::createHypothesis
+ *
+ * Create hypothesis of given type
+ */
+//=============================================================================
+SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName,
+ const char* theLibName)
+{
+ SMESH_Hypothesis_i* myHypothesis_i = 0;
+ SMESH::SMESH_Hypothesis_var hypothesis_i;
+ std::string aPlatformLibName;
+ typedef GenericHypothesisCreator_i* (*GetHypothesisCreator)(const char* );
+ GenericHypothesisCreator_i* aCreator = getHypothesisCreator(theHypName, theLibName, aPlatformLibName);
+ // create a new hypothesis object, store its ref. in studyContext
+ if(MYDEBUG) MESSAGE("Create Hypothesis " << theHypName);
+ myHypothesis_i =
+ myHypCreatorMap[string(theHypName)]->Create(myPoa, GetCurrentStudyID(), &myGen);
+ myHypothesis_i->SetLibName(aPlatformLibName.c_str()); // for persistency assurance
if (!myHypothesis_i)
return hypothesis_i._retn();
SALOMEDS::SObject_wrap so = anIter->Value();
CORBA::Object_var ior = SObjectToObject( so );
if ( SMESH_Mesh_i* mesh = SMESH::DownCast<SMESH_Mesh_i*>( ior ))
- mesh->CheckGeomGroupModif();
+ mesh->CheckGeomModif();
}
}
}
ASSERT( meshServant );
if ( meshServant ) {
// NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation"
- meshServant->CheckGeomGroupModif();
+ meshServant->CheckGeomModif();
// get local TopoDS_Shape
TopoDS_Shape myLocShape;
if(theMesh->HasShapeToMesh())
ASSERT( meshServant );
if ( meshServant ) {
// NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation"
- meshServant->CheckGeomGroupModif();
+ meshServant->CheckGeomModif();
// get local TopoDS_Shape
TopoDS_Shape myLocShape;
if(theMesh->HasShapeToMesh())
ASSERT( meshServant );
if ( meshServant ) {
// NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation"
- meshServant->CheckGeomGroupModif();
+ meshServant->CheckGeomModif();
// get local TopoDS_Shape
TopoDS_Shape myLocShape;
if(theMesh->HasShapeToMesh())
SMESH::array_of_ElementType_var srcElemTypes = meshPart->GetTypes();
if ( SMESH::DownCast<SMESH_Mesh_i*>( meshPart ))
{
+ srcMesh_i->Load();
srcElemIt = srcMeshDS->elementsIterator();
srcNodeIt = srcMeshDS->nodesIterator();
}
const SMDS_MeshElement * newElem;
switch ( elem->GetEntityType() ) {
case SMDSEntity_Polyhedra:
- newElem = editor.GetMeshDS()->
- AddPolyhedralVolumeWithID( nodes,
- static_cast<const SMDS_VtkVolume*>(elem)->GetQuantities(),
- ID);
+ if ( toKeepIDs )
+ newElem = editor.GetMeshDS()->
+ AddPolyhedralVolumeWithID( nodes,
+ static_cast<const SMDS_VtkVolume*>(elem)->GetQuantities(),
+ ID);
+ else
+ newElem = editor.GetMeshDS()->
+ AddPolyhedralVolume( nodes,
+ static_cast<const SMDS_VtkVolume*>(elem)->GetQuantities());
break;
case SMDSEntity_Ball:
newElem = editor.AddElement( nodes, SMDSAbs_Ball, false, ID,
useCaseBuilder->AppendTo( where, sobj ); // append to the end of list
}
}
+//=================================================================================
+// function : IsApplicable
+// purpose : Return true if algorithm can be applied
+//=================================================================================
+CORBA::Boolean SMESH_Gen_i::IsApplicable ( const char* theAlgoType,
+ const char* theLibName,
+ GEOM::GEOM_Object_ptr theGeomObject,
+ CORBA::Boolean toCheckAll)
+{
+ SMESH_TRY;
+
+ std::string aPlatformLibName;
+ typedef GenericHypothesisCreator_i* (*GetHypothesisCreator)(const char*);
+ GenericHypothesisCreator_i* aCreator = getHypothesisCreator(theAlgoType, theLibName, aPlatformLibName);
+ if (aCreator)
+ {
+ TopoDS_Shape shape = GeomObjectToShape( theGeomObject );
+ if ( !shape.IsNull() )
+ return aCreator->IsApplicable( shape, toCheckAll );
+ }
+ else
+ {
+ return false;
+ }
+
+ SMESH_CATCH( SMESH::doNothing );
+ return true;
+}
//=================================================================================
// function : importData
// purpose : imports mesh data file (the med one) into the SMESH internal data structure
//=================================================================================
-Engines::ListOfIdentifiers* SMESH_Gen_i::importData(
- CORBA::Long studyId, Engines::DataContainer_ptr data, const Engines::ListOfOptions& options)
+Engines::ListOfIdentifiers* SMESH_Gen_i::importData(CORBA::Long studyId,
+ Engines::DataContainer_ptr data,
+ const Engines::ListOfOptions& options)
{
Engines::ListOfIdentifiers_var aResultIds = new Engines::ListOfIdentifiers;
list<string> aResultList;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
void Move( const SMESH::sobject_list& what,
SALOMEDS::SObject_ptr where,
CORBA::Long row );
+ CORBA::Boolean IsApplicable ( const char* theAlgoType,
+ const char* theLibName,
+ GEOM::GEOM_Object_ptr theShapeObject,
+ CORBA::Boolean toCheckAll);
private:
+ // Get hypothesis creator
+ GenericHypothesisCreator_i* getHypothesisCreator( const char* theHypName,
+ const char* theLibName,
+ std::string& thePlatformLibName)
+ throw ( SALOME::SALOME_Exception );
// Create hypothesis of given type
SMESH::SMESH_Hypothesis_ptr createHypothesis( const char* theHypName,
- const char* theLibName)
- throw ( SALOME::SALOME_Exception );
-
+ const char* theLibName);
// Create empty mesh on shape
SMESH::SMESH_Mesh_ptr createMesh()
throw ( SALOME::SALOME_Exception );
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
long prevNb = Size();
SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( GetGroupDS() );
if (aGroupDS) {
- SMDS_ElemIteratorPtr elemIt = SMESH_Mesh_i::GetElements( theSource, GetType() );
- while ( elemIt->more() )
- aGroupDS->SMDSGroup().Add( elemIt->next() );
+ if ( SMDS_ElemIteratorPtr elemIt = SMESH_Mesh_i::GetElements( theSource, GetType() ))
+ while ( elemIt->more() )
+ aGroupDS->SMDSGroup().Add( elemIt->next() );
}
// Update Python script
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
::SMESH_Gen* theGenImpl) = 0;
// return the name of IDL module
virtual std::string GetModuleName() = 0;
+ virtual bool IsApplicable( const TopoDS_Shape &S, bool toCheckAll ) {return true;}
};
//=============================================================================
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
{
SMESH_TRY;
initData();
-
prepareIdSource( elems );
- SMESH::long_array_var anElementsId = elems->GetIDs();
- TIDSortedElemSet elemSet;
- arrayToSet( anElementsId, getMeshDS(), elemSet, SMDSAbs_Volume );
- getEditor().SplitVolumesIntoTetra( elemSet, int( methodFlags ));
+ ::SMESH_MeshEditor::TFacetOfElem elemSet;
+ const int noneFacet = -1;
+ SMDS_ElemIteratorPtr volIt = myMesh_i->GetElements( elems, SMESH::VOLUME );
+ while( volIt->more() )
+ elemSet.insert( elemSet.end(), make_pair( volIt->next(), noneFacet ));
+
+ getEditor().SplitVolumes( elemSet, int( methodFlags ));
declareMeshModified( /*isReComputeSafe=*/true ); // it does not influence Compute()
TPythonDump() << this << ".SplitVolumesIntoTetra( "
SMESH_CATCH( SMESH::throwCorbaException );
}
+//================================================================================
+/*!
+ * \brief Split hexahedra into triangular prisms
+ * \param elems - elements to split
+ * \param facetToSplitNormal - normal used to find a facet of hexahedron
+ * to split into triangles
+ * \param methodFlags - flags passing splitting method:
+ * 1 - split the hexahedron into 2 prisms
+ * 2 - split the hexahedron into 4 prisms
+ */
+//================================================================================
+
+void SMESH_MeshEditor_i::SplitHexahedraIntoPrisms (SMESH::SMESH_IDSource_ptr elems,
+ const SMESH::PointStruct & startHexPoint,
+ const SMESH::DirStruct& facetToSplitNormal,
+ CORBA::Short methodFlags,
+ CORBA::Boolean allDomains)
+ throw (SALOME::SALOME_Exception)
+{
+ SMESH_TRY;
+ initData();
+ prepareIdSource( elems );
+
+ gp_Ax1 facetNorm( gp_Pnt( startHexPoint.x,
+ startHexPoint.y,
+ startHexPoint.z ),
+ gp_Dir( facetToSplitNormal.PS.x,
+ facetToSplitNormal.PS.y,
+ facetToSplitNormal.PS.z ));
+ TIDSortedElemSet elemSet;
+ SMESH::long_array_var anElementsId = elems->GetIDs();
+ SMDS_MeshElement::GeomFilter filter( SMDSGeom_HEXA );
+ arrayToSet( anElementsId, getMeshDS(), elemSet, SMDSAbs_Volume, &filter );
+
+ ::SMESH_MeshEditor::TFacetOfElem elemFacets;
+ while ( !elemSet.empty() )
+ {
+ getEditor().GetHexaFacetsToSplit( elemSet, facetNorm, elemFacets );
+ if ( !allDomains )
+ break;
+
+ ::SMESH_MeshEditor::TFacetOfElem::iterator ef = elemFacets.begin();
+ for ( ; ef != elemFacets.end(); ++ef )
+ elemSet.erase( ef->first );
+ }
+
+ if ( methodFlags == 2 )
+ methodFlags = int( ::SMESH_MeshEditor::HEXA_TO_4_PRISMS );
+ else
+ methodFlags = int( ::SMESH_MeshEditor::HEXA_TO_2_PRISMS );
+
+ getEditor().SplitVolumes( elemFacets, int( methodFlags ));
+ declareMeshModified( /*isReComputeSafe=*/true ); // it does not influence Compute()
+
+ TPythonDump() << this << ".SplitHexahedraIntoPrisms( "
+ << elems << ", "
+ << startHexPoint << ", "
+ << facetToSplitNormal<< ", "
+ << methodFlags<< ", "
+ << allDomains << " )";
+
+ SMESH_CATCH( SMESH::throwCorbaException );
+}
+
//=======================================================================
//function : Smooth
//purpose :
for ( int i = 0; i < foundElems.size(); ++i )
res[i] = foundElems[i]->GetID();
- if ( !myIsPreviewMode ) // call from tui
- TPythonDump() << "res = " << this << ".FindElementsByPoint( "
- << x << ", "
- << y << ", "
- << z << ", "
- << type << " )";
-
return res._retn();
SMESH_CATCH( SMESH::throwCorbaException );
for ( int i = 0; i < foundElems.size(); ++i )
res[i] = foundElems[i]->GetID();
- if ( !myIsPreviewMode ) // call from tui
- TPythonDump() << "res = " << this << ".FindAmongElementsByPoint( "
- << elementIDs << ", "
- << x << ", "
- << y << ", "
- << z << ", "
- << type << " )";
-
return res._retn();
SMESH_CATCH( SMESH::throwCorbaException );
* If there is no shared faces between the group #n and the group #p in the list, the group j_n_p is not created.
* All the flat elements are gathered into the group named "joints3D" (or "joints2D" in 2D situation).
* The flat element of the multiple junctions between the simple junction are stored in a group named "jointsMultiples".
- * @param theDomains - list of groups of volumes
- * @param createJointElems - if TRUE, create the elements
- * @return TRUE if operation has been completed successfully, FALSE otherwise
+ * \param theDomains - list of groups of volumes
+ * \param createJointElems - if TRUE, create the elements
+ * \param onAllBoundaries - if TRUE, the nodes and elements are also created on
+ * the boundary between \a theDomains and the rest mesh
+ * \return TRUE if operation has been completed successfully, FALSE otherwise
*/
//================================================================================
CORBA::Boolean
SMESH_MeshEditor_i::DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& theDomains,
- CORBA::Boolean createJointElems )
+ CORBA::Boolean createJointElems,
+ CORBA::Boolean onAllBoundaries )
throw (SALOME::SALOME_Exception)
{
- bool aResult = false;
+ bool isOK = false;
SMESH_TRY;
initData();
SMESHDS_Mesh* aMeshDS = getMeshDS();
// MESSAGE("theDomains.length = "<<theDomains.length());
- if ( theDomains.length() <= 1 )
+ if ( theDomains.length() <= 1 && !onAllBoundaries )
THROW_SALOME_CORBA_EXCEPTION("At least 2 groups are required.", SALOME::BAD_PARAM);
+
vector<TIDSortedElemSet> domains;
- domains.clear();
+ domains.resize( theDomains.length() );
for ( int i = 0, n = theDomains.length(); i < n; i++ )
{
{
// if ( aGrp->GetType() != SMESH::VOLUME )
// THROW_SALOME_CORBA_EXCEPTION("Not a volume group", SALOME::BAD_PARAM);
- TIDSortedElemSet domain;
- domain.clear();
- domains.push_back(domain);
SMESH::long_array_var anIDs = aGrp->GetIDs();
arrayToSet( anIDs, aMeshDS, domains[ i ], SMDSAbs_All );
}
}
- aResult = getEditor().DoubleNodesOnGroupBoundaries( domains, createJointElems );
+ isOK = getEditor().DoubleNodesOnGroupBoundaries( domains, createJointElems, onAllBoundaries );
// TODO publish the groups of flat elements in study
- declareMeshModified( /*isReComputeSafe=*/ !aResult );
+ declareMeshModified( /*isReComputeSafe=*/ !isOK );
// Update Python script
TPythonDump() << "isDone = " << this << ".DoubleNodesOnGroupBoundaries( " << &theDomains
- << ", " << createJointElems << " )";
+ << ", " << createJointElems << ", " << onAllBoundaries << " )";
SMESH_CATCH( SMESH::throwCorbaException );
- return aResult;
+ myMesh_i->CreateGroupServants(); // publish created groups if any
+
+ return isOK;
}
//================================================================================
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
void SplitVolumesIntoTetra(SMESH::SMESH_IDSource_ptr elems,
CORBA::Short methodFlags)
throw (SALOME::SALOME_Exception);
+ void SplitHexahedraIntoPrisms(SMESH::SMESH_IDSource_ptr elems,
+ const SMESH::PointStruct & startHexPoint,
+ const SMESH::DirStruct& facetToSplitNormal,
+ CORBA::Short methodFlags,
+ CORBA::Boolean allDomains)
+ throw (SALOME::SALOME_Exception);
CORBA::Boolean Smooth(const SMESH::long_array & IDsOfElements,
const SMESH::long_array & IDsOfFixedNodes,
* The nodes of the internal faces at the boundaries of the groups are doubled.
* In option, the internal faces are replaced by flat elements.
* Triangles are transformed in prisms, and quadrangles in hexahedrons.
- * @param theDomains - list of groups of volumes
- * @param createJointElems - if TRUE, create the elements
- * @return TRUE if operation has been completed successfully, FALSE otherwise
+ * \param theDomains - list of groups of volumes
+ * \param createJointElems - if TRUE, create the elements
+ * \param onAllBoundaries - if TRUE, the nodes and elements are also create on
+ * the boundary between \a theDomains and the rest mesh
+ * \return TRUE if operation has been completed successfully, FALSE otherwise
*/
CORBA::Boolean DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& theDomains,
- CORBA::Boolean createJointElems )
+ CORBA::Boolean createJointElems,
+ CORBA::Boolean onAllBoundaries )
throw (SALOME::SALOME_Exception);
/*!
* \brief Double nodes on some external faces and create flat elements.
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESH_Mesh_i.hxx"
#include "DriverMED_R_SMESHDS_Mesh.h"
+#include "DriverMED_W_Field.h"
#include "DriverMED_W_SMESHDS_Mesh.h"
#include "MED_Factory.hxx"
#include "SMDS_EdgePosition.hxx"
#include "SMESHDS_Group.hxx"
#include "SMESHDS_GroupOnGeom.hxx"
#include "SMESH_Controls.hxx"
+#include "SMESH_File.hxx"
#include "SMESH_Filter_i.hxx"
#include "SMESH_Gen_i.hxx"
#include "SMESH_Group.hxx"
#include "SMESH_Group_i.hxx"
+#include "SMESH_Mesh.hxx"
+#include "SMESH_MeshAlgos.hxx"
#include "SMESH_MeshEditor.hxx"
#include "SMESH_MeshEditor_i.hxx"
#include "SMESH_MeshPartDS.hxx"
#include "SMESH_PythonDump.hxx"
#include "SMESH_subMesh_i.hxx"
-#include <OpUtil.hxx>
#include <SALOMEDS_Attributes_wrap.hxx>
#include <SALOMEDS_wrap.hxx>
-#include <SALOME_NamingService.hxx>
#include <Utils_ExceptHandlers.hxx>
-#include <Utils_SINGLETON.hxx>
#include <utilities.h>
#include <GEOMImpl_Types.hxx>
// OCCT Includes
#include <BRep_Builder.hxx>
-#include <OSD_Directory.hxx>
-#include <OSD_File.hxx>
-#include <OSD_Path.hxx>
-#include <OSD_Protection.hxx>
-#include <Standard_OutOfMemory.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <Standard_ErrorHandler.hxx>
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_SequenceOfInteger.hxx>
-#include <TCollection_AsciiString.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopoDS_Compound.hxx>
-#include "SMESH_TryCatch.hxx" // include after OCCT headers!
-
// STL Includes
#include <algorithm>
-#include <string>
#include <iostream>
#include <sstream>
-#include <sys/stat.h>
+// to pass CORBA exception through SMESH_TRY
+#define SMY_OWN_CATCH catch( SALOME::SALOME_Exception& se ) { throw se; }
+
+#include "SMESH_TryCatch.hxx" // include after OCCT headers!
#ifdef _DEBUG_
static int MYDEBUG = 0;
_editor = NULL;
_previewEditor = NULL;
_preMeshInfo = NULL;
+ _mainShapeTick = 0;
}
//=============================================================================
// to track changes of GEOM groups
SMESH::SMESH_Mesh_var mesh = _this();
addGeomGroupData( theShapeObject, mesh );
+ if ( !CORBA::is_nil( theShapeObject ))
+ _mainShapeTick = theShapeObject->GetTick();
}
//================================================================================
try {
_impl->Clear();
- CheckGeomGroupModif(); // issue 20145
+ //CheckGeomGroupModif(); // issue 20145
}
catch(SALOME_Exception & S_ex) {
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
_medFileInfo->major = major;
_medFileInfo->minor = minor;
_medFileInfo->release = release;
-#ifdef WIN32
- struct _stati64 d;
- if ( ::_stati64( theFileName, &d ) != -1 )
-#else
- struct stat64 d;
- if ( ::stat64( theFileName, &d ) != -1 )
-#endif
- _medFileInfo->fileSize = d.st_size;
+ _medFileInfo->fileSize = SMESH_File( theFileName ).size();
return ConvertDriverMEDReadStatus(status);
}
if ( aType == SMESH::ALL )
aType = aGrp->GetType();
else if ( aType != aGrp->GetType() )
- THROW_SALOME_CORBA_EXCEPTION("UnionListOfGroups(): different group types",
+ THROW_SALOME_CORBA_EXCEPTION("CutListOfGroups(): different group types",
SALOME::BAD_PARAM);
if ( SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( aGrp ))
if ( SMESHDS_GroupBase* grpDS = grp_i->GetGroupDS() )
if ( CORBA::is_nil( aGrp ) )
continue;
if ( aType != aGrp->GetType() )
- THROW_SALOME_CORBA_EXCEPTION("UnionListOfGroups(): different group types",
+ THROW_SALOME_CORBA_EXCEPTION("CutListOfGroups(): different group types",
SALOME::BAD_PARAM);
if ( SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( aGrp ))
if ( SMESHDS_GroupBase* grpDS = grp_i->GetGroupDS() )
groupData._indices.insert( ids[i] );
// SMESH object
groupData._smeshObject = CORBA::Object::_duplicate( theSmeshObj );
+ // shape index in SMESHDS
+ // TopoDS_Shape shape = _gen_i->GeomObjectToShape( theGeomObj );
+ // groupData._dsID = shape.IsNull() ? 0 : _impl->GetSubMesh( shape )->GetId();
}
//================================================================================
namespace
{
- //=============================================================================
+ //-----------------------------------------------------------------------------
/*!
* \brief Storage of shape and index used in CheckGeomGroupModif()
*/
- //=============================================================================
struct TIndexedShape
{
int _index;
TopoDS_Shape _shape;
TIndexedShape( int i, const TopoDS_Shape& s ):_index(i), _shape(s) {}
};
+ //-----------------------------------------------------------------------------
+ /*!
+ * \brief Data to re-create a group on geometry
+ */
+ struct TGroupOnGeomData
+ {
+ int _oldID;
+ int _shapeID;
+ SMDSAbs_ElementType _type;
+ std::string _name;
+ Quantity_Color _color;
+ };
}
+
+//=============================================================================
+/*!
+ * \brief Update data if geometry changes
+ *
+ * Issue 0022501
+ */
+//=============================================================================
+
+void SMESH_Mesh_i::CheckGeomModif()
+{
+ if ( !_impl->HasShapeToMesh() ) return;
+
+ SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
+ if ( study->_is_nil() ) return;
+
+ GEOM::GEOM_Object_var mainGO = _gen_i->ShapeToGeomObject( _impl->GetShapeToMesh() );
+ if ( mainGO->_is_nil() ) return;
+
+ if ( mainGO->GetType() == GEOM_GROUP ||
+ mainGO->GetTick() == _mainShapeTick )
+ {
+ CheckGeomGroupModif();
+ return;
+ }
+
+ GEOM_Client* geomClient = _gen_i->GetShapeReader();
+ if ( !geomClient ) return;
+ GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine();
+ if ( geomGen->_is_nil() ) return;
+
+ CORBA::String_var ior = geomGen->GetStringFromIOR( mainGO );
+ geomClient->RemoveShapeFromBuffer( ior.in() );
+
+ // Update data taking into account that
+ // all sub-shapes change but IDs of sub-shapes remain (except for geom groups)
+
+ _impl->Clear();
+ TopoDS_Shape newShape = _gen_i->GeomObjectToShape( mainGO );
+ if ( newShape.IsNull() )
+ return;
+
+ _mainShapeTick = mainGO->GetTick();
+
+ SMESHDS_Mesh * meshDS = _impl->GetMeshDS();
+
+ // store data of groups on geometry
+ vector< TGroupOnGeomData > groupsData;
+ const set<SMESHDS_GroupBase*>& groups = meshDS->GetGroups();
+ groupsData.reserve( groups.size() );
+ set<SMESHDS_GroupBase*>::const_iterator g = groups.begin();
+ for ( ; g != groups.end(); ++g )
+ if ( const SMESHDS_GroupOnGeom* group = dynamic_cast< SMESHDS_GroupOnGeom* >( *g ))
+ {
+ TGroupOnGeomData data;
+ data._oldID = group->GetID();
+ data._shapeID = meshDS->ShapeToIndex( group->GetShape() );
+ data._type = group->GetType();
+ data._name = group->GetStoreName();
+ data._color = group->GetColor();
+ groupsData.push_back( data );
+ }
+ // store assigned hypotheses
+ vector< pair< int, THypList > > ids2Hyps;
+ const ShapeToHypothesis & hyps = meshDS->GetHypotheses();
+ for ( ShapeToHypothesis::Iterator s2hyps( hyps ); s2hyps.More(); s2hyps.Next() )
+ {
+ const TopoDS_Shape& s = s2hyps.Key();
+ const THypList& hyps = s2hyps.ChangeValue();
+ ids2Hyps.push_back( make_pair( meshDS->ShapeToIndex( s ), hyps ));
+ }
+
+ // change shape to mesh
+ int oldNbSubShapes = meshDS->MaxShapeIndex();
+ _impl->ShapeToMesh( TopoDS_Shape() );
+ _impl->ShapeToMesh( newShape );
+
+ // re-add shapes of geom groups
+ list<TGeomGroupData>::iterator data = _geomGroupData.begin();
+ for ( ; data != _geomGroupData.end(); ++data )
+ {
+ TopoDS_Shape newShape = newGroupShape( *data );
+ if ( !newShape.IsNull() )
+ {
+ if ( meshDS->ShapeToIndex( newShape ) > 0 ) // a group reduced to one sub-shape
+ {
+ TopoDS_Compound compound;
+ BRep_Builder().MakeCompound( compound );
+ BRep_Builder().Add( compound, newShape );
+ newShape = compound;
+ }
+ _impl->GetSubMesh( newShape );
+ }
+ }
+ if ( oldNbSubShapes != meshDS->MaxShapeIndex() )
+ THROW_SALOME_CORBA_EXCEPTION( "SMESH_Mesh_i::CheckGeomModif() bug",
+ SALOME::INTERNAL_ERROR );
+
+ // re-assign hypotheses
+ for ( size_t i = 0; i < ids2Hyps.size(); ++i )
+ {
+ const TopoDS_Shape& s = meshDS->IndexToShape( ids2Hyps[i].first );
+ const THypList& hyps = ids2Hyps[i].second;
+ THypList::const_iterator h = hyps.begin();
+ for ( ; h != hyps.end(); ++h )
+ _impl->AddHypothesis( s, (*h)->GetID() );
+ }
+
+ // restore groups
+ for ( size_t i = 0; i < groupsData.size(); ++i )
+ {
+ const TGroupOnGeomData& data = groupsData[i];
+
+ map<int, SMESH::SMESH_GroupBase_ptr>::iterator i2g = _mapGroups.find( data._oldID );
+ if ( i2g == _mapGroups.end() ) continue;
+
+ SMESH_GroupBase_i* gr_i = SMESH::DownCast<SMESH_GroupBase_i*>( i2g->second );
+ if ( !gr_i ) continue;
+
+ int id;
+ SMESH_Group* g = _impl->AddGroup( data._type, data._name.c_str(), id,
+ meshDS->IndexToShape( data._shapeID ));
+ if ( !g )
+ {
+ _mapGroups.erase( i2g );
+ }
+ else
+ {
+ g->GetGroupDS()->SetColor( data._color );
+ gr_i->changeLocalId( id );
+ _mapGroups[ id ] = i2g->second;
+ if ( data._oldID != id )
+ _mapGroups.erase( i2g );
+ }
+ }
+
+ // update _mapSubMesh
+ map<int, ::SMESH_subMesh*>::iterator i_sm = _mapSubMesh.begin();
+ for ( ; i_sm != _mapSubMesh.end(); ++i_sm )
+ i_sm->second = _impl->GetSubMesh( meshDS->IndexToShape( i_sm->first ));
+
+}
+
//=============================================================================
/*!
* \brief Update objects depending on changed geom groups
- *
+ *
* NPAL16168: geometrical group edition from a submesh don't modifiy mesh computation
* issue 0020210: Update of a smesh group after modification of the associated geom group
*/
void SMESH_Mesh_i::PrepareForWriting (const char* file, bool overwrite)
{
- TCollection_AsciiString aFullName ((char*)file);
- OSD_Path aPath (aFullName);
- OSD_File aFile (aPath);
- if (aFile.Exists()) {
+ SMESH_File aFile( file );
+ SMESH_Comment msg;
+ if (aFile.exists()) {
// existing filesystem node
- if (aFile.KindOfFile() == OSD_FILE) {
- if (aFile.IsWriteable()) {
- if (overwrite) {
- aFile.Reset();
- aFile.Remove();
- }
- if (aFile.Failed()) {
- TCollection_AsciiString msg ("File ");
- msg += aFullName + " cannot be replaced.";
- THROW_SALOME_CORBA_EXCEPTION(msg.ToCString(), SALOME::BAD_PARAM);
+ if ( !aFile.isDirectory() ) {
+ if ( aFile.openForWriting() ) {
+ if ( overwrite && ! aFile.remove()) {
+ msg << "Can't replace " << aFile.getName();
}
} else {
- TCollection_AsciiString msg ("File ");
- msg += aFullName + " cannot be overwritten.";
- THROW_SALOME_CORBA_EXCEPTION(msg.ToCString(), SALOME::BAD_PARAM);
+ msg << "Can't write into " << aFile.getName();
}
} else {
- TCollection_AsciiString msg ("Location ");
- msg += aFullName + " is not a file.";
- THROW_SALOME_CORBA_EXCEPTION(msg.ToCString(), SALOME::BAD_PARAM);
+ msg << "Location " << aFile.getName() << " is not a file";
}
- } else {
+ }
+ else {
// nonexisting file; check if it can be created
- aFile.Reset();
- aFile.Build(OSD_WriteOnly, OSD_Protection());
- if (aFile.Failed()) {
- TCollection_AsciiString msg ("You cannot create the file ");
- msg += aFullName + ". Check the directory existance and access rights.";
- THROW_SALOME_CORBA_EXCEPTION(msg.ToCString(), SALOME::BAD_PARAM);
- } else {
- aFile.Close();
- aFile.Remove();
+ if ( !aFile.openForWriting() ) {
+ msg << "You cannot create the file "
+ << aFile.getName()
+ << ". Check the directory existance and access rights";
}
+ aFile.remove();
+ }
+
+ if ( !msg.empty() )
+ {
+ msg << ".";
+ THROW_SALOME_CORBA_EXCEPTION(msg.c_str(), SALOME::BAD_PARAM);
}
}
_preMeshInfo->FullLoadFromFile();
string aMeshName = prepareMeshNameAndGroups(file, overwrite);
+ _impl->ExportMED( file, aMeshName.c_str(), auto_groups, theVersion, 0, autoDimension );
+
TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportToMEDX( r'"
<< file << "', " << auto_groups << ", "
<< theVersion << ", " << overwrite << ", "
<< autoDimension << " )";
- _impl->ExportMED( file, aMeshName.c_str(), auto_groups, theVersion, 0, autoDimension );
-
SMESH_CATCH( SMESH::throwCorbaException );
}
*/
//================================================================================
-void SMESH_Mesh_i::ExportPartToMED(::SMESH::SMESH_IDSource_ptr meshPart,
- const char* file,
- CORBA::Boolean auto_groups,
- ::SMESH::MED_VERSION version,
- ::CORBA::Boolean overwrite,
- ::CORBA::Boolean autoDimension)
+void SMESH_Mesh_i::ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
+ const char* file,
+ CORBA::Boolean auto_groups,
+ SMESH::MED_VERSION version,
+ CORBA::Boolean overwrite,
+ CORBA::Boolean autoDimension,
+ const GEOM::ListOfFields& fields,
+ const char* geomAssocFields)
throw (SALOME::SALOME_Exception)
{
- Unexpect aCatch(SALOME_SalomeException);
- TPythonDump pyDump;
+ SMESH_TRY;
+ if ( _preMeshInfo )
+ _preMeshInfo->FullLoadFromFile();
+
+ // check fields
+ bool have0dField = false;
+ if ( fields.length() > 0 )
+ {
+ GEOM::GEOM_Object_var shapeToMesh = GetShapeToMesh();
+ if ( shapeToMesh->_is_nil() )
+ THROW_SALOME_CORBA_EXCEPTION( "No shape to mesh", SALOME::INTERNAL_ERROR );
+
+ for ( size_t i = 0; i < fields.length(); ++i )
+ {
+ if ( fields[i]->GetDataType() == GEOM::FDT_String )
+ THROW_SALOME_CORBA_EXCEPTION
+ ( "Export of string fields is not supported", SALOME::BAD_PARAM);
+ GEOM::GEOM_Object_var fieldShape = fields[i]->GetShape();
+ if ( fieldShape->_is_nil() )
+ THROW_SALOME_CORBA_EXCEPTION( "Null shape under a field", SALOME::INTERNAL_ERROR );
+ if ( !fieldShape->IsSame( shapeToMesh ) )
+ THROW_SALOME_CORBA_EXCEPTION
+ ( "Field defined not on shape", SALOME::BAD_PARAM);
+ if ( fields[i]->GetDimension() == 0 )
+ have0dField = true;
+ }
+ if ( geomAssocFields )
+ for ( int i = 0; geomAssocFields[i]; ++i )
+ switch ( geomAssocFields[i] ) {
+ case 'v':case 'e':case 'f':case 's': break;
+ case 'V':case 'E':case 'F':case 'S': break;
+ default: THROW_SALOME_CORBA_EXCEPTION
+ ( "geomAssocFields can include only [vefs] characters", SALOME::BAD_PARAM);
+ }
+ }
+
+ SMESHDS_Mesh* meshDS = _impl->GetMeshDS();
- if ( SMESH_Mesh_i * mesh = SMESH::DownCast< SMESH_Mesh_i* >( meshPart ))
+ // write mesh
+
+ string aMeshName = "Mesh";
+ SMESHUtils::Deleter< SMESH_MeshPartDS > tmpDSDeleter(0);
+ if ( CORBA::is_nil( meshPart ) ||
+ SMESH::DownCast< SMESH_Mesh_i* >( meshPart ))
{
- mesh->ExportToMEDX( file, auto_groups, version, autoDimension );
+ aMeshName = prepareMeshNameAndGroups(file, overwrite);
+ _impl->ExportMED( file, aMeshName.c_str(), auto_groups,
+ version, 0, autoDimension, /*addODOnVertices=*/have0dField);
+ meshDS = _impl->GetMeshDS();
}
else
{
PrepareForWriting(file, overwrite);
- string aMeshName = "Mesh";
SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
if ( !aStudy->_is_nil() ) {
SALOMEDS::SObject_wrap SO = _gen_i->ObjectToSObject( aStudy, meshPart );
aMeshName = name;
}
}
- SMESH_MeshPartDS partDS( meshPart );
- _impl->ExportMED( file, aMeshName.c_str(), auto_groups, version, &partDS, autoDimension );
+ SMESH_MeshPartDS* partDS = new SMESH_MeshPartDS( meshPart );
+ _impl->ExportMED( file, aMeshName.c_str(), auto_groups,
+ version, partDS, autoDimension, /*addODOnVertices=*/have0dField);
+ meshDS = tmpDSDeleter._obj = partDS;
+ }
+
+ // write fields
+
+ if ( _impl->HasShapeToMesh() )
+ {
+ DriverMED_W_Field fieldWriter;
+ fieldWriter.SetFile( file );
+ fieldWriter.SetMeshName( aMeshName );
+ fieldWriter.AddODOnVertices( have0dField );
+
+ exportMEDFields( fieldWriter, meshDS, fields, geomAssocFields );
}
- pyDump << SMESH::SMESH_Mesh_var(_this()) << ".ExportPartToMED( "
- << meshPart << ", r'" << file << "', "
- << auto_groups << ", " << version << ", " << overwrite << ", "
- << autoDimension << " )";
+
+ // dump
+ GEOM::ListOfGBO_var goList = new GEOM::ListOfGBO;
+ goList->length( fields.length() );
+ for ( size_t i = 0; i < fields.length(); ++i )
+ {
+ GEOM::GEOM_BaseObject_var gbo = GEOM::GEOM_BaseObject::_narrow( fields[i] );
+ goList[i] = gbo;
+ }
+ TPythonDump() << _this() << ".ExportPartToMED( "
+ << meshPart << ", r'" << file << "', "
+ << auto_groups << ", " << version << ", " << overwrite << ", "
+ << autoDimension << ", " << goList
+ << ", '" << ( geomAssocFields ? geomAssocFields : "" ) << "'" << " )";
+
+ SMESH_CATCH( SMESH::throwCorbaException );
+}
+
+//================================================================================
+/*!
+ * Write GEOM fields to MED file
+ */
+//================================================================================
+
+void SMESH_Mesh_i::exportMEDFields( DriverMED_W_Field& fieldWriter,
+ SMESHDS_Mesh* meshDS,
+ const GEOM::ListOfFields& fields,
+ const char* geomAssocFields)
+{
+#define METH "SMESH_Mesh_i::exportMEDFields() "
+
+ if (( fields.length() < 1 ) &&
+ ( !geomAssocFields || !geomAssocFields[0] ))
+ return;
+
+ std::vector< double > dblVals( meshDS->MaxShapeIndex()+1 );
+ std::vector< int > intVals( meshDS->MaxShapeIndex()+1 );
+ std::vector< int > subIdsByDim[ 4 ];
+ const double noneDblValue = 0.;
+ const double noneIntValue = 0;
+
+ for ( size_t iF = 0; iF < fields.length(); ++iF )
+ {
+ // set field data
+
+ int dim = fields[ iF ]->GetDimension();
+ SMDSAbs_ElementType elemType;
+ TopAbs_ShapeEnum shapeType;
+ switch ( dim ) {
+ case 0: elemType = SMDSAbs_0DElement; shapeType = TopAbs_VERTEX; break;
+ case 1: elemType = SMDSAbs_Edge; shapeType = TopAbs_EDGE; break;
+ case 2: elemType = SMDSAbs_Face; shapeType = TopAbs_FACE; break;
+ case 3: elemType = SMDSAbs_Volume; shapeType = TopAbs_SOLID; break;
+ default:
+ continue; // skip fields on whole shape
+ }
+ GEOM::field_data_type dataType = fields[ iF ]->GetDataType();
+ if ( dataType == GEOM::FDT_String )
+ continue;
+ GEOM::ListOfLong_var stepIDs = fields[ iF ]->GetSteps();
+ if ( stepIDs->length() < 1 )
+ continue;
+ GEOM::string_array_var comps = fields[ iF ]->GetComponents();
+ if ( comps->length() < 1 )
+ continue;
+ CORBA::String_var name = fields[ iF ]->GetName();
+
+ if ( !fieldWriter.Set( meshDS,
+ name.in(),
+ elemType,
+ comps->length(),
+ /*isIntData=*/false ))//( dataType == GEOM::FDT_Int )))
+ continue;
+
+ for ( size_t iC = 0; iC < comps->length(); ++iC )
+ fieldWriter.SetCompName( iC, comps[ iC ].in() );
+
+ // find sub-shape IDs
+
+ std::vector< int >& subIds = subIdsByDim[ dim ];
+ if ( subIds.empty() )
+ for ( int id = 1; id <= meshDS->MaxShapeIndex(); ++id )
+ if ( meshDS->IndexToShape( id ).ShapeType() == shapeType )
+ subIds.push_back( id );
+
+ // write steps
+
+ SMDS_ElemIteratorPtr elemIt = fieldWriter.GetOrderedElems();
+ if ( !elemIt )
+ continue;
+
+ for ( size_t iS = 0; iS < stepIDs->length(); ++iS )
+ {
+ GEOM::GEOM_FieldStep_var step = fields[ iF ]->GetStep( stepIDs[ iS ]);
+ if ( step->_is_nil() )
+ continue;
+
+ CORBA::Long stamp = step->GetStamp();
+ CORBA::Long id = step->GetID();
+ fieldWriter.SetDtIt( int( stamp ), int( id ));
+
+ // fill dblVals or intVals
+ switch ( dataType )
+ {
+ case GEOM::FDT_Double:
+ {
+ GEOM::GEOM_DoubleFieldStep_var dblStep = GEOM::GEOM_DoubleFieldStep::_narrow( step );
+ if ( dblStep->_is_nil() ) continue;
+ GEOM::ListOfDouble_var vv = dblStep->GetValues();
+ if ( vv->length() != subIds.size() )
+ THROW_SALOME_CORBA_EXCEPTION( METH "BUG: wrong nb subIds", SALOME::INTERNAL_ERROR );
+ for ( size_t i = 0; i < vv->length(); ++i )
+ dblVals[ subIds[ i ]] = vv[ i ];
+ break;
+ }
+ case GEOM::FDT_Int:
+ {
+ GEOM::GEOM_IntFieldStep_var intStep = GEOM::GEOM_IntFieldStep::_narrow( step );
+ if ( intStep->_is_nil() ) continue;
+ GEOM::ListOfLong_var vv = intStep->GetValues();
+ if ( vv->length() != subIds.size() )
+ THROW_SALOME_CORBA_EXCEPTION( METH "BUG: wrong nb subIds", SALOME::INTERNAL_ERROR );
+ for ( size_t i = 0; i < vv->length(); ++i )
+ intVals[ subIds[ i ]] = (int) vv[ i ];
+ break;
+ }
+ case GEOM::FDT_Bool:
+ {
+ GEOM::GEOM_BoolFieldStep_var boolStep = GEOM::GEOM_BoolFieldStep::_narrow( step );
+ if ( boolStep->_is_nil() ) continue;
+ GEOM::short_array_var vv = boolStep->GetValues();
+ if ( vv->length() != subIds.size() )
+ THROW_SALOME_CORBA_EXCEPTION( METH "BUG: wrong nb subIds", SALOME::INTERNAL_ERROR );
+ for ( size_t i = 0; i < vv->length(); ++i )
+ intVals[ subIds[ i ]] = (int) vv[ i ];
+ break;
+ }
+ default: continue;
+ }
+
+ // pass values to fieldWriter
+ elemIt = fieldWriter.GetOrderedElems();
+ if ( dataType == GEOM::FDT_Double )
+ while ( elemIt->more() )
+ {
+ const SMDS_MeshElement* e = elemIt->next();
+ const int shapeID = e->getshapeId();
+ if ( shapeID < 1 || shapeID >= dblVals.size() )
+ fieldWriter.AddValue( noneDblValue );
+ else
+ fieldWriter.AddValue( dblVals[ shapeID ]);
+ }
+ else
+ while ( elemIt->more() )
+ {
+ const SMDS_MeshElement* e = elemIt->next();
+ const int shapeID = e->getshapeId();
+ if ( shapeID < 1 || shapeID >= intVals.size() )
+ fieldWriter.AddValue( (double) noneIntValue );
+ else
+ fieldWriter.AddValue( (double) intVals[ shapeID ]);
+ }
+
+ // write a step
+ fieldWriter.Perform();
+ SMESH_ComputeErrorPtr res = fieldWriter.GetError();
+ if ( res && res->IsKO() )
+ {
+ if ( res->myComment.empty() )
+ { THROW_SALOME_CORBA_EXCEPTION( METH "Fatal error", SALOME::INTERNAL_ERROR ); }
+ else
+ { THROW_SALOME_CORBA_EXCEPTION( res->myComment.c_str(), SALOME::INTERNAL_ERROR ); }
+ }
+
+ } // loop on steps
+ } // loop on fields
+
+ if ( !geomAssocFields || !geomAssocFields[0] )
+ return;
+
+ // write geomAssocFields
+
+ std::vector< int > shapeDim( TopAbs_SHAPE + 1 );
+ shapeDim[ TopAbs_COMPOUND ] = 3;
+ shapeDim[ TopAbs_COMPSOLID ] = 3;
+ shapeDim[ TopAbs_SOLID ] = 3;
+ shapeDim[ TopAbs_SHELL ] = 2;
+ shapeDim[ TopAbs_FACE ] = 2;
+ shapeDim[ TopAbs_WIRE ] = 1;
+ shapeDim[ TopAbs_EDGE ] = 1;
+ shapeDim[ TopAbs_VERTEX ] = 0;
+ shapeDim[ TopAbs_SHAPE ] = 3;
+
+ for ( int iF = 0; geomAssocFields[ iF ]; ++iF )
+ {
+ std::vector< std::string > compNames;
+ switch ( geomAssocFields[ iF ]) {
+ case 'v': case 'V':
+ fieldWriter.Set( meshDS, "_vertices_", SMDSAbs_Node, /*nbComps=*/2, /*isInt=*/false );
+ compNames.push_back( "dim" );
+ break;
+ case 'e': case 'E':
+ fieldWriter.Set( meshDS, "_edges_", SMDSAbs_Edge, /*nbComps=*/1, /*isInt=*/false );
+ break;
+ case 'f': case 'F':
+ fieldWriter.Set( meshDS, "_faces_", SMDSAbs_Face, /*nbComps=*/1, /*isInt=*/false );
+ break;
+ case 's': case 'S':
+ fieldWriter.Set( meshDS, "_solids_", SMDSAbs_Volume, /*nbComps=*/1, /*isInt=*/false );
+ break;
+ default: continue;
+ }
+ compNames.push_back( "id" );
+ for ( size_t iC = 0; iC < compNames.size(); ++iC )
+ fieldWriter.SetCompName( iC, compNames[ iC ].c_str() );
+
+ fieldWriter.SetDtIt( -1, -1 );
+
+ SMDS_ElemIteratorPtr elemIt = fieldWriter.GetOrderedElems();
+ if ( !elemIt )
+ continue;
+
+ if ( compNames.size() == 2 ) // _vertices_
+ while ( elemIt->more() )
+ {
+ const SMDS_MeshElement* e = elemIt->next();
+ const int shapeID = e->getshapeId();
+ if ( shapeID < 1 )
+ {
+ fieldWriter.AddValue( (double) -1 );
+ fieldWriter.AddValue( (double) -1 );
+ }
+ else
+ {
+ const TopoDS_Shape& S = meshDS->IndexToShape( shapeID );
+ fieldWriter.AddValue( (double) ( S.IsNull() ? -1 : shapeDim[ S.ShapeType() ]));
+ fieldWriter.AddValue( (double) shapeID );
+ }
+ }
+ else
+ while ( elemIt->more() )
+ {
+ const SMDS_MeshElement* e = elemIt->next();
+ const int shapeID = e->getshapeId();
+ if ( shapeID < 1 )
+ fieldWriter.AddValue( (double) -1 );
+ else
+ fieldWriter.AddValue( (double) shapeID );
+ }
+
+ // write a step
+ fieldWriter.Perform();
+ SMESH_ComputeErrorPtr res = fieldWriter.GetError();
+ if ( res && res->IsKO() )
+ {
+ if ( res->myComment.empty() )
+ { THROW_SALOME_CORBA_EXCEPTION( METH "Fatal error", SALOME::INTERNAL_ERROR ); }
+ else
+ { THROW_SALOME_CORBA_EXCEPTION( res->myComment.c_str(), SALOME::INTERNAL_ERROR ); }
+ }
+
+ } // loop on geomAssocFields
+
+#undef METH
}
//================================================================================
return ( SMESH::EntityType ) e->GetEntityType();
}
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+SMESH::GeometryType SMESH_Mesh_i::GetElementShape( const CORBA::Long id )
+ throw (SALOME::SALOME_Exception)
+{
+ if ( _preMeshInfo )
+ _preMeshInfo->FullLoadFromFile();
+
+ const SMDS_MeshElement* e = _impl->GetMeshDS()->FindElement(id);
+ if ( !e )
+ THROW_SALOME_CORBA_EXCEPTION( "invalid element id", SALOME::BAD_PARAM );
+
+ return ( SMESH::GeometryType ) e->GetGeomType();
+}
+
//=============================================================================
/*!
* Returns ID of elements for given submesh
// find inverse elements
SMDS_ElemIteratorPtr eIt = aNode->GetInverseElementIterator();
- TColStd_SequenceOfInteger IDs;
- while(eIt->more()) {
+ aResult->length( aNode->NbInverseElements() );
+ for( int i = 0; eIt->more(); ++i )
+ {
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);
- }
+ aResult[ i ] = elem->GetID();
}
return aResult._retn();
}
return aResult._retn();
}
+//=======================================================================
+//function : GetElemFaceNodes
+//purpose : Returns three components of normal of given mesh face.
+//=======================================================================
+
+SMESH::double_array* SMESH_Mesh_i::GetFaceNormal(CORBA::Long elemId,
+ CORBA::Boolean normalized)
+{
+ if ( _preMeshInfo )
+ _preMeshInfo->FullLoadFromFile();
+
+ SMESH::double_array_var aResult = new SMESH::double_array();
+
+ if ( SMESHDS_Mesh* mesh = _impl->GetMeshDS() )
+ {
+ gp_XYZ normal;
+ if ( SMESH_MeshAlgos::FaceNormal( mesh->FindElement(elemId), normal, normalized ))
+ {
+ aResult->length( 3 );
+ aResult[ 0 ] = normal.X();
+ aResult[ 1 ] = normal.Y();
+ aResult[ 2 ] = normal.Z();
+ }
+ }
+ return aResult._retn();
+}
+
//=======================================================================
//function : FindElementByNodes
//purpose : Returns an element based on all given nodes.
//theCommon.insert( theSubMesh );
}
+//-----------------------------------------------------------------------------
+bool isSubMeshInList ( int smID, const TListOfListOfInt& smLists )
+{
+ TListOfListOfInt::const_iterator listsIt = smLists.begin();
+ for ( ; listsIt != smLists.end(); ++listsIt )
+ {
+ const TListOfInt& smIDs = *listsIt;
+ if ( std::find( smIDs.begin(), smIDs.end(), smID ) != smIDs.end() )
+ return true;
+ }
+ return false;
+}
+
} // namespace
+//=============================================================================
+/*!
+ * \brief Return \c true if a meshing order not yet set for a concurrent sub-mesh
+ */
+//=============================================================================
+
+CORBA::Boolean SMESH_Mesh_i::IsUnorderedSubMesh(CORBA::Long submeshID)
+{
+ TListOfListOfInt anOrder = GetImpl().GetMeshOrder(); // already defined order
+ if ( isSubMeshInList( submeshID, anOrder ))
+ return false;
+
+ TListOfListOfInt allConurrent = findConcurrentSubMeshes();
+ return isSubMeshInList( submeshID, allConurrent );
+}
+
//=============================================================================
/*!
* \brief Return submesh objects list in meshing order
SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS();
if ( !aMeshDS )
return aResult._retn();
-
- ::SMESH_Mesh& mesh = GetImpl();
- TListOfListOfInt anOrder = mesh.GetMeshOrder(); // is there already defined order?
- if ( !anOrder.size() ) {
+ TListOfListOfInt anOrder = GetImpl().GetMeshOrder(); // already defined order
+ TListOfListOfInt allConurrent = findConcurrentSubMeshes();
+ anOrder.splice( anOrder.end(), allConurrent );
+
+ int listIndx = 0;
+ TListOfListOfInt::iterator listIt = anOrder.begin();
+ for(; listIt != anOrder.end(); listIt++, listIndx++ )
+ unionLists( *listIt, anOrder, listIndx + 1 );
+
+ // convert submesh ids into interface instances
+ // and dump command into python
+ convertMeshOrder( anOrder, aResult, false );
+
+ return aResult._retn();
+}
+
+//=============================================================================
+/*!
+ * \brief Finds concurrent sub-meshes
+ */
+//=============================================================================
+
+TListOfListOfInt SMESH_Mesh_i::findConcurrentSubMeshes()
+{
+ TListOfListOfInt anOrder;
+ ::SMESH_Mesh& mesh = GetImpl();
+ {
// collect submeshes and detect concurrent algorithms and hypothesises
TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension
-
+
map<int, ::SMESH_subMesh*>::iterator i_sm = _mapSubMesh.begin();
for ( ; i_sm != _mapSubMesh.end(); i_sm++ ) {
::SMESH_subMesh* sm = (*i_sm).second;
for(; listIt != anOrder.end(); listIt++, listIndx++ )
unionLists( *listIt, anOrder, listIndx + 1 );
}
- // convert submesh ids into interface instances
- // and dump command into python
- convertMeshOrder( anOrder, aResult, false );
- return aResult._retn();
+ return anOrder;
}
//=============================================================================
SMESH::submesh_array_var aResSubSet = new SMESH::submesh_array();
aResSubSet->length(aSubOrder.size());
TListOfInt::const_iterator subIt = aSubOrder.begin();
- for( int j = 0; subIt != aSubOrder.end(); subIt++ ) {
+ int j;
+ for( j = 0; subIt != aSubOrder.end(); subIt++ ) {
if ( _mapSubMeshIor.find(*subIt) == _mapSubMeshIor.end() )
continue;
SMESH::SMESH_subMesh_var subMesh =
}
if ( theIsDump )
aPythonDump << " ]";
- theResOrder[ listIndx++ ] = aResSubSet;
+ if ( j > 1 )
+ theResOrder[ listIndx++ ] = aResSubSet;
}
// correct number of lists
theResOrder.length( listIndx );
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
class SMESH_subMesh_i;
class SMESH_PreMeshInfo;
class SMESH_MeshEditor_i;
+class DriverMED_W_Field;
+class SMESHDS_Mesh;
class SMESH_I_EXPORT SMESH_Mesh_i:
public virtual POA_SMESH::SMESH_Mesh,
CORBA::Boolean auto_groups,
SMESH::MED_VERSION version,
CORBA::Boolean overwrite,
- CORBA::Boolean autoDim=true) throw (SALOME::SALOME_Exception);
+ CORBA::Boolean autoDim,
+ const GEOM::ListOfFields& fields,
+ const char* geomAssocFields) throw (SALOME::SALOME_Exception);
void ExportPartToDAT(SMESH::SMESH_IDSource_ptr meshPart,
const char* file) throw (SALOME::SALOME_Exception);
void ExportPartToUNV(SMESH::SMESH_IDSource_ptr meshPart,
SMESH::EntityType GetElementGeomType( CORBA::Long id )
throw (SALOME::SALOME_Exception);
+ SMESH::GeometryType GetElementShape( CORBA::Long id )
+ throw (SALOME::SALOME_Exception);
+
/*!
* Returns ID of elements for given submesh
*/
void checkMeshLoaded();
+ /*!
+ * \brief Update data if geometry changes
+ *
+ * Issue 0022501
+ */
+ void CheckGeomModif();
/*!
* \brief Update hypotheses assigned to geom groups if the latter change
*
*/
SMESH::long_array* GetElemFaceNodes(CORBA::Long elemId, CORBA::Short faceIndex);
+ /*!
+ * Returns three components of normal of given mesh face (or an empty array in KO case)
+ */
+ SMESH::double_array* GetFaceNormal(CORBA::Long faceId, CORBA::Boolean normalized);
+
/*!
* Returns an element based on all given nodes.
*/
*/
SMESH::string_array* GetLastParameters();
+ /*!
+ * \brief Return \c true if a meshing order not yet set for a concurrent sub-mesh
+ */
+ CORBA::Boolean IsUnorderedSubMesh(CORBA::Long submeshID);
/*!
* \brief Return submesh objects list in meshing order
*/
*/
void checkGroupNames();
+ /*
+ * Write GEOM fields to MED file
+ */
+ void exportMEDFields( DriverMED_W_Field & writer,
+ SMESHDS_Mesh* meshDS,
+ const GEOM::ListOfFields& fields,
+ const char* geomAssocFields);
/*!
* Convert submesh ids into submesh interfaces
*/
SMESH::submesh_array_array& theSubMeshOrder,
const bool theIsDump);
+ /*!
+ * \brief Finds concurrent sub-meshes
+ */
+ TListOfListOfInt findConcurrentSubMeshes();
+
private:
static int _idGenerator;
CORBA::Object_var _smeshObject; // SMESH object depending on GEOM group
};
std::list<TGeomGroupData> _geomGroupData;
+ int _mainShapeTick; // to track modifications of the meshed shape
/*!
* Remember GEOM group data
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESH_PreMeshInfo.hxx"
+#include "DriverMED.hxx"
#include "DriverMED_R_SMESHDS_Mesh.h"
+#include "MED_Factory.hxx"
#include "SMDS_EdgePosition.hxx"
#include "SMDS_FacePosition.hxx"
#include "SMDS_SpacePosition.hxx"
#include "SMESH_Mesh_i.hxx"
#include "SMESH_subMesh_i.hxx"
-#include <MED_Factory.hxx>
-
#include <HDFarray.hxx>
#include <HDFdataset.hxx>
#include <HDFfile.hxx>
static map< MED::EGeometrieElement, SMDSAbs_EntityType> med2smeshTypes;
if ( med2smeshTypes.empty() )
{
- med2smeshTypes[ MED::ePOINT1 ] = SMDSEntity_0D ;
- med2smeshTypes[ MED::eSEG2 ] = SMDSEntity_Edge ;
- med2smeshTypes[ MED::eSEG3 ] = SMDSEntity_Quad_Edge ;
- med2smeshTypes[ MED::eTRIA3 ] = SMDSEntity_Triangle ;
- med2smeshTypes[ MED::eTRIA6 ] = SMDSEntity_Quad_Triangle ;
- med2smeshTypes[ MED::eTRIA7 ] = SMDSEntity_BiQuad_Triangle ;
- med2smeshTypes[ MED::eQUAD4 ] = SMDSEntity_Quadrangle ;
- med2smeshTypes[ MED::eQUAD8 ] = SMDSEntity_Quad_Quadrangle ;
- med2smeshTypes[ MED::eQUAD9 ] = SMDSEntity_BiQuad_Quadrangle ;
- med2smeshTypes[ MED::eTETRA4 ] = SMDSEntity_Tetra ;
- med2smeshTypes[ MED::ePYRA5 ] = SMDSEntity_Pyramid ;
- med2smeshTypes[ MED::ePENTA6 ] = SMDSEntity_Penta ;
- med2smeshTypes[ MED::eHEXA8 ] = SMDSEntity_Hexa ;
- med2smeshTypes[ MED::eOCTA12 ] = SMDSEntity_Hexagonal_Prism ;
- med2smeshTypes[ MED::eTETRA10 ] = SMDSEntity_Quad_Tetra ;
- med2smeshTypes[ MED::ePYRA13 ] = SMDSEntity_Quad_Pyramid ;
- med2smeshTypes[ MED::ePENTA15 ] = SMDSEntity_Quad_Penta ;
- med2smeshTypes[ MED::eHEXA20 ] = SMDSEntity_Quad_Hexa ;
- med2smeshTypes[ MED::eHEXA27 ] = SMDSEntity_TriQuad_Hexa ;
- med2smeshTypes[ MED::ePOLYGONE ] = SMDSEntity_Polygon ;
- med2smeshTypes[ MED::ePOLYEDRE ] = SMDSEntity_Polyhedra ;
- med2smeshTypes[ MED::eNONE ] = SMDSEntity_Node ;
- med2smeshTypes[ MED::eBALL ] = SMDSEntity_Ball ;
+ for ( int iG = 0; iG < SMDSEntity_Last; ++iG )
+ {
+ SMDSAbs_EntityType smdsType = (SMDSAbs_EntityType) iG;
+ MED::EGeometrieElement medType =
+ (MED::EGeometrieElement) DriverMED::GetMedGeoType( smdsType );
+ med2smeshTypes.insert( make_pair( medType, smdsType ));
+ }
}
return med2smeshTypes;
}
- //================================================================================
- /*!
- * \brief Return a vector<MED::EGeometrieElement> intended to retrieve
- * MED::EGeometrieElement by SMDSAbs_EntityType
- */
- //================================================================================
-
- const vector<MED::EGeometrieElement>& mesh2medElemType()
- {
- static vector<MED::EGeometrieElement> mesh2medElemTypes;
- if ( mesh2medElemTypes.empty() )
- {
- mesh2medElemTypes.resize( SMDSEntity_Last + 1 );
- Tmed2smeshElemTypeMap::const_iterator me2sme = med2smeshElemTypeMap().begin();
- Tmed2smeshElemTypeMap::const_iterator me2smeEnd = med2smeshElemTypeMap().end();
- for ( ; me2sme != me2smeEnd; ++me2sme )
- mesh2medElemTypes[ me2sme->second ] = me2sme->first;
- }
- return mesh2medElemTypes;
- }
-
//================================================================================
/*!
* \brief Writes meshInfo into a HDF file
// we use med identification of element (MED::EGeometrieElement) types
// but not enum SMDSAbs_EntityType because values of SMDSAbs_EntityType may
// change at insertion of new items in the middle.
- const vector<MED::EGeometrieElement>& medTypes = mesh2medElemType();
+ //const vector<MED::EGeometrieElement>& medTypes = mesh2medElemType();
vector<int> data;
for ( size_t i = 0; i < meshInfo->length(); ++i )
if ( meshInfo[i] > 0 )
{
- data.push_back( medTypes[ i ] );
+ data.push_back( DriverMED::GetMedGeoType( SMDSAbs_EntityType( i ))); //medTypes[ i ] );
data.push_back( meshInfo[ i ] );
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
+#include CORBA_SERVER_HEADER(GEOM_Gen)
#include CORBA_SERVER_HEADER(SALOMEDS)
#include <TCollection_AsciiString.hxx>
TPythonDump&
operator<<(const SMESH::string_array& theArg);
+ TPythonDump&
+ operator<<(const SMESH::nodes_array& theArg);
+
TPythonDump&
operator<<(SMESH::SMESH_Hypothesis_ptr theArg);
TPythonDump&
operator<<(const SMESH::ListOfGroups * theList);
+ TPythonDump&
+ operator<<(const GEOM::ListOfGO& theList);
+
+ TPythonDump&
+ operator<<(const GEOM::ListOfGBO& theList);
+
TPythonDump&
operator<<(const SMESH::ListOfIDSources& theList);
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2010-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
+## \package smeshstudytools Python API to access SMESH objects in the study.
+
+## \defgroup smeshstudytools Accessing SMESH object in the study
+# \{
+# \details
+# Module \b smeshstudytools provides a new class SMeshStudyTools to facilitate the
+# use of mesh objects in Salome study.
+# \}
+
"""
This module provides a new class :class:`SMeshStudyTools` to facilitate the
use of mesh objects in Salome study.
if not is_called_by_sphinx():
from salome.gui import helper
+## This class provides several methods to manipulate mesh objects in Salome
+# study. The parameter \em studyEditor defines a \b StudyEditor
+# object used to access the study. If \b None, the method returns a
+# \b StudyEditor object on the current study.
+#
+# \b editor
+# This instance attribute contains the underlying \b StudyEditor object.
+# It can be used to access the study but the attribute itself should not be modified.
+# \ingroup smeshstudytools
class SMeshStudyTools:
"""
This class provides several methods to manipulate mesh objects in Salome
self.editor = studyEditor
self.smeshGui = None
+ ## This function updates the tools so that it works on the
+ # specified study.
def updateStudy(self, studyId=None):
"""
This function updates the tools so that it works on the
specified study.
"""
self.editor = getStudyEditor(studyId)
-
+
+ ## Get the mesh item owning the mesh group \em meshGroupItem.
+ # \param meshGroupItem (SObject) mesh group belonging to the searched mesh.
+ # \return The SObject corresponding to the mesh, or None if it was not found.
def getMeshFromGroup(self, meshGroupItem):
"""
Get the mesh item owning the mesh group `meshGroupItem`.
meshItem = salome.ObjectToSObject(meshObj)
return meshItem
-
+ ## Returns the MESH object currently selected in the active study.
def getMeshObjectSelected(self):
- '''
+ """
Returns the MESH object currently selected in the active study.
- '''
+ """
sobject, entry = helper.getSObjectSelected()
meshObject = self.getMeshObjectFromEntry(entry)
return meshObject
+ ## Returns the MESH object associated to the specified entry,
+ # (the entry is the identifier of an item in the objects browser).
def getMeshObjectFromEntry(self, entry):
- '''
+ """
Returns the MESH object associated to the specified entry,
(the entry is the identifier of an item in the objects browser).
- '''
+ """
if entry is None:
return None
import SMESH
meshObject=smesh.IDToObject(entry)
return meshObject
-
+
+ ## Returns the SMESH object associated to the specified \em SObject,
+ # (the SObject is an item in the objects browser).
def getMeshObjectFromSObject(self, sobject):
- '''
+ """
Returns the SMESH object associated to the specified SObject,
(the SObject is an item in the objects browser).
- '''
+ """
if sobject is None:
return None
meshObject = obj._narrow(SMESH.SMESH_Mesh)
return meshObject
+ ## Display the SMESH object associated to the specified \em entry
+ # (the entry is the identifier of an item in the objects browser).
def displayMeshObjectFromEntry(self,entry):
- '''
+ """
Display the SMESH object associated to the specified entry
(the entry is the identifier of an item in the objects browser).
- '''
+ """
if self.smeshGui is None:
self.smeshGui = salome.ImportComponentGUI("SMESH")
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
hyp.SetDeflection(deflection)
return hyp
- ## Defines "Arithmetic1D" hypothesis to cut an edge in several segments with increasing arithmetic length
+ ## Defines "Arithmetic1D" hypothesis to cut an edge in several segments with a length
+ # that changes in arithmetic progression
# @param start defines the length of the first segment
# @param end defines the length of the last segment
# @param reversedEdges is a list of edges to mesh using reversed orientation.
hyp.SetObjectEntry( entry )
return hyp
+ ## Defines "GeometricProgression" hypothesis to cut an edge in several
+ # segments with a length that changes in Geometric progression
+ # @param start defines the length of the first segment
+ # @param ratio defines the common ratio of the geometric progression
+ # @param reversedEdges is a list of edges to mesh using reversed orientation.
+ # A list item can also be a tuple (edge, 1st_vertex_of_edge)
+ # @param UseExisting if ==true - searches for an existing hypothesis created with
+ # the same parameters, else (default) - creates a new one
+ # @return an instance of StdMeshers_Geometric1D hypothesis
+ # @ingroup l3_hypos_1dhyps
+ def GeometricProgression(self, start, ratio, reversedEdges=[], UseExisting=0):
+ reversedEdgeInd = self.ReversedEdgeIndices(reversedEdges)
+ entry = self.MainShapeEntry()
+ from salome.smesh.smeshBuilder import IsEqual
+ compFun = lambda hyp, args: ( IsEqual(hyp.GetLength(1), args[0]) and \
+ IsEqual(hyp.GetLength(0), args[1]) and \
+ hyp.GetReversedEdges() == args[2] and \
+ (not args[2] or hyp.GetObjectEntry() == args[3]))
+ hyp = self.Hypothesis("GeometricProgression", [start, ratio, reversedEdgeInd, entry],
+ UseExisting=UseExisting, CompareMethod=compFun)
+ hyp.SetStartLength( start )
+ hyp.SetCommonRatio( ratio )
+ hyp.SetReversedEdges( reversedEdgeInd )
+ hyp.SetObjectEntry( entry )
+ return hyp
+
## Defines "FixedPoints1D" hypothesis to cut an edge using parameter
# on curve from 0 to 1 (additionally it is neecessary to check
# orientation of edges and create list of reversed edges if it is
# A list item can also be a tuple (edge, 1st_vertex_of_edge)
# @param UseExisting if ==true - searches for an existing hypothesis created with
# the same parameters, else (default) - creates a new one
- # @return an instance of StdMeshers_Arithmetic1D hypothesis
+ # @return an instance of StdMeshers_FixedPoints1D hypothesis
# @ingroup l3_hypos_1dhyps
def FixedPoints1D(self, points, nbSegs=[1], reversedEdges=[], UseExisting=0):
if not isinstance(reversedEdges,list): #old version script, before adding reversedEdges
hyp.SetDeflection(d)
return hyp
- ## Defines "Propagation" hypothesis that propagates all other hypotheses on all other edges that are at
- # the opposite side in case of quadrangular faces
+ ## Defines "Propagation" hypothesis that propagates 1D hypotheses
+ # from an edge where this hypothesis is assigned to
+ # on all other edges that are at the opposite side in case of quadrangular faces
+ # This hypothesis should be assigned to an edge to propagate a hypothesis from.
# @ingroup l3_hypos_additi
def Propagation(self):
return self.Hypothesis("Propagation", UseExisting=1, CompareMethod=self.CompareEqualHyp)
+ ## Defines "Propagation of Node Distribution" hypothesis that propagates
+ # distribution of nodes from an edge where this hypothesis is assigned to,
+ # to opposite edges of quadrangular faces, so that number of segments on all these
+ # edges will be the same, as well as relations between segment lengths.
+ # @ingroup l3_hypos_additi
+ def PropagationOfDistribution(self):
+ return self.Hypothesis("PropagOfDistribution", UseExisting=1,
+ CompareMethod=self.CompareEqualHyp)
+
## Defines "AutomaticLength" hypothesis
# @param fineness for the fineness [0-1]
# @param UseExisting if ==true - searches for an existing hypothesis created with the
# same number of segments, the other pair must have an even difference
# between the numbers of segments on the sides.
# @param triangleVertex: vertex of a trilateral geometrical face, around which triangles
- # will be created while other elements will be quadrangles.
- # Vertex can be either a GEOM_Object or a vertex ID within the
- # shape to mesh
- # @param UseExisting: if ==true - searches for the existing hypothesis created with
- # the same parameters, else (default) - creates a new one
+ # will be created while other elements will be quadrangles.
+ # Vertex can be either a GEOM_Object or a vertex ID within the
+ # shape to mesh
+ # @param enfVertices: list of shapes defining positions where nodes (enforced nodes)
+ # must be created by the mesher. Shapes can be of any type,
+ # vertices of given shapes define positions of enforced nodes.
+ # Only vertices successfully projected to the face are used.
+ # @param enfPoints: list of points giving positions of enforced nodes.
+ # Point can be defined either as SMESH.PointStruct's
+ # ([SMESH.PointStruct(x1,y1,z1), SMESH.PointStruct(x2,y2,z2),...])
+ # or triples of values ([[x1,y1,z1], [x2,y2,z2], ...]).
+ # In the case if the defined QuadrangleParameters() refer to a sole face,
+ # all given points must lie on this face, else the mesher fails.
+ # @param UseExisting: if \c True - searches for the existing hypothesis created with
+ # the same parameters, else (default) - creates a new one
# @ingroup l3_hypos_quad
- def QuadrangleParameters(self, quadType=StdMeshers.QUAD_STANDARD, triangleVertex=0, UseExisting=0):
- import GEOM
+ def QuadrangleParameters(self, quadType=StdMeshers.QUAD_STANDARD, triangleVertex=0,
+ enfVertices=[],enfPoints=[],UseExisting=0):
+ import GEOM, SMESH
vertexID = triangleVertex
if isinstance( triangleVertex, GEOM._objref_GEOM_Object ):
vertexID = self.mesh.geompyD.GetSubShapeID( self.mesh.geom, triangleVertex )
+ if isinstance( enfVertices, int ) and not enfPoints and not UseExisting:
+ # a call of old syntax, before inserting enfVertices and enfPoints before UseExisting
+ UseExisting, enfVertices = enfVertices, []
+ pStructs, xyz = [], []
+ for p in enfPoints:
+ if isinstance( p, SMESH.PointStruct ):
+ xyz.append(( p.x, p.y, p.z ))
+ pStructs.append( p )
+ else:
+ xyz.append(( p[0], p[1], p[2] ))
+ pStructs.append( SMESH.PointStruct( p[0], p[1], p[2] ))
if not self.params:
compFun = lambda hyp,args: \
hyp.GetQuadType() == args[0] and \
- ( hyp.GetTriaVertex()==args[1] or ( hyp.GetTriaVertex()<1 and args[1]<1))
- self.params = self.Hypothesis("QuadrangleParams", [quadType,vertexID],
+ (hyp.GetTriaVertex()==args[1] or ( hyp.GetTriaVertex()<1 and args[1]<1)) and \
+ ((hyp.GetEnforcedNodes()) == (args[2],args[3])) # True w/o enfVertices only
+ entries = [ shape.GetStudyEntry() for shape in enfVertices ]
+ self.params = self.Hypothesis("QuadrangleParams", [quadType,vertexID,entries,xyz],
UseExisting = UseExisting, CompareMethod=compFun)
pass
if self.params.GetQuadType() != quadType:
self.params.SetQuadType(quadType)
if vertexID > 0:
self.params.SetTriaVertex( vertexID )
+ from salome.smesh.smeshBuilder import AssureGeomPublished
+ for v in enfVertices:
+ AssureGeomPublished( self.mesh, v )
+ self.params.SetEnforcedNodes( enfVertices, pStructs )
return self.params
## Defines "QuadrangleParams" hypothesis with a type of quadrangulation that only
return hyp
## Defines "Arithmetic1D" hypothesis, specifying the distribution of segments
- # to build between the inner and the outer shells with a length that changes in arithmetic progression
+ # to build between the inner and the outer shells with a length that changes
+ # in arithmetic progression
# @param start the length of the first segment
# @param end the length of the last segment
def Arithmetic1D(self, start, end ):
hyp.SetLength(end , 0)
return hyp
+ ## Defines "GeometricProgression" hypothesis, specifying the distribution of segments
+ # to build between the inner and the outer shells with a length that changes
+ # in Geometric progression
+ # @param start the length of the first segment
+ # @param ratio the common ratio of the geometric progression
+ def GeometricProgression(self, start, ratio ):
+ if self.algoType != "RadialPrism_3D":
+ print "Prism_3D algorith doesn't support any hyposesis"
+ return None
+ hyp = self.OwnHypothesis("GeometricProgression", [start, ratio])
+ hyp.SetStartLength( start )
+ hyp.SetCommonRatio( ratio )
+ return hyp
+
## Defines "StartEndLength" hypothesis, specifying distribution of segments
# to build between the inner and the outer shells as geometric length increasing
# @param start for the length of the first segment
hyp.SetLength(end , 0)
return hyp
+ ## Defines "GeometricProgression" hypothesis, specifying the distribution of segments
+ # with a length that changes in Geometric progression
+ # @param start the length of the first segment
+ # @param ratio the common ratio of the geometric progression
+ def GeometricProgression(self, start, ratio ):
+ hyp = self.OwnHypothesis("GeometricProgression", [start, ratio])
+ hyp.SetStartLength( start )
+ hyp.SetCommonRatio( ratio )
+ return hyp
+
## Defines "StartEndLength" hypothesis, specifying distribution of segments
# as geometric length increasing
# @param start for the length of the first segment
# Examples:
# - "10.5" - defines a grid with a constant spacing
# - [["1", "1+10*t", "11"] [0.1, 0.6]] - defines different spacing in 3 ranges.
- # @param yGridDef defines the grid along the Y asix the same way as \a xGridDef does
- # @param zGridDef defines the grid along the Z asix the same way as \a xGridDef does
+ # @param yGridDef defines the grid along the Y asix the same way as \a xGridDef does.
+ # @param zGridDef defines the grid along the Z asix the same way as \a xGridDef does.
# @param sizeThreshold (> 1.0) defines a minimal size of a polyhedron so that
- # a polyhedron of size less than hexSize/sizeThreshold is not created
- # @param UseExisting if ==true - searches for the existing hypothesis created with
- # the same parameters, else (default) - creates a new one
- def SetGrid(self, xGridDef, yGridDef, zGridDef, sizeThreshold=4.0, UseExisting=False):
+ # a polyhedron of size less than hexSize/sizeThreshold is not created.
+ # @param implEdges enables implementation of geometrical edges into the mesh.
+ def SetGrid(self, xGridDef, yGridDef, zGridDef, sizeThreshold=4.0, implEdges=False):
if not self.hyp:
compFun = lambda hyp, args: False
self.hyp = self.Hypothesis("CartesianParameters3D",
[xGridDef, yGridDef, zGridDef, sizeThreshold],
- UseExisting=UseExisting, CompareMethod=compFun)
+ UseExisting=False, CompareMethod=compFun)
if not self.mesh.IsUsedHypothesis( self.hyp, self.geom ):
self.mesh.AddHypothesis( self.hyp, self.geom )
- for axis, gridDef in enumerate( [xGridDef, yGridDef, zGridDef]):
+ for axis, gridDef in enumerate( [xGridDef, yGridDef, zGridDef] ):
if not gridDef: raise ValueError, "Empty grid definition"
if isinstance( gridDef, str ):
self.hyp.SetGridSpacing( [gridDef], [], axis )
else:
self.hyp.SetGridSpacing( gridDef[0], gridDef[1], axis )
self.hyp.SetSizeThreshold( sizeThreshold )
+ self.hyp.SetToAddEdges( implEdges )
return self.hyp
+ ## Defines custom directions of axes of the grid
+ # @param xAxis either SMESH.DirStruct or a vector, or 3 vector components
+ # @param yAxis either SMESH.DirStruct or a vector, or 3 vector components
+ # @param zAxis either SMESH.DirStruct or a vector, or 3 vector components
+ def SetAxesDirs( self, xAxis, yAxis, zAxis ):
+ import GEOM
+ if hasattr( xAxis, "__getitem__" ):
+ xAxis = self.mesh.smeshpyD.MakeDirStruct( xAxis[0],xAxis[1],xAxis[2] )
+ elif isinstance( xAxis, GEOM._objref_GEOM_Object ):
+ xAxis = self.mesh.smeshpyD.GetDirStruct( xAxis )
+ if hasattr( yAxis, "__getitem__" ):
+ yAxis = self.mesh.smeshpyD.MakeDirStruct( yAxis[0],yAxis[1],yAxis[2] )
+ elif isinstance( yAxis, GEOM._objref_GEOM_Object ):
+ yAxis = self.mesh.smeshpyD.GetDirStruct( yAxis )
+ if hasattr( zAxis, "__getitem__" ):
+ zAxis = self.mesh.smeshpyD.MakeDirStruct( zAxis[0],zAxis[1],zAxis[2] )
+ elif isinstance( zAxis, GEOM._objref_GEOM_Object ):
+ zAxis = self.mesh.smeshpyD.GetDirStruct( zAxis )
+ if not self.hyp:
+ self.hyp = self.Hypothesis("CartesianParameters3D")
+ if not self.mesh.IsUsedHypothesis( self.hyp, self.geom ):
+ self.mesh.AddHypothesis( self.hyp, self.geom )
+ self.hyp.SetAxesDirs( xAxis, yAxis, zAxis )
+ return self.hyp
+
+ ## Automatically defines directions of axes of the grid at which
+ # a number of generated hexahedra is maximal
+ # @param isOrthogonal defines whether the axes mush be orthogonal
+ def SetOptimalAxesDirs(self, isOrthogonal=True):
+ if not self.hyp:
+ self.hyp = self.Hypothesis("CartesianParameters3D")
+ if not self.mesh.IsUsedHypothesis( self.hyp, self.geom ):
+ self.mesh.AddHypothesis( self.hyp, self.geom )
+ x,y,z = self.hyp.ComputeOptimalAxesDirs( self.geom, isOrthogonal )
+ self.hyp.SetAxesDirs( x,y,z )
+ return self.hyp
+
+ ## Sets/unsets a fixed point. The algorithm makes a plane of the grid pass
+ # through the fixed point in each direction at which the grid is defined
+ # by spacing
+ # @param p coordinates of the fixed point. Either SMESH.PointStruct or
+ # a vertex or 3 components of coordinates.
+ # @param toUnset defines whether the fixed point is defined or removed.
+ def SetFixedPoint( self, p, toUnset=False ):
+ import SMESH, GEOM
+ if toUnset:
+ if not self.hyp: return
+ p = SMESH.PointStruct(0,0,0)
+ elif hasattr( p, "__getitem__" ):
+ p = SMESH.PointStruct( p[0],p[1],p[2] )
+ elif isinstance( p, GEOM._objref_GEOM_Object ):
+ p = self.mesh.smeshpyD.GetPointStruct( p )
+ if not self.hyp:
+ self.hyp = self.Hypothesis("CartesianParameters3D")
+ if not self.mesh.IsUsedHypothesis( self.hyp, self.geom ):
+ self.mesh.AddHypothesis( self.hyp, self.geom )
+ self.hyp.SetFixedPoint( p, toUnset )
+ return self.hyp
+
+
pass # end of StdMeshersBuilder_Cartesian_3D class
## Defines a stub 1D algorithm, which enables "manual" creation of nodes and
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
## @defgroup l2_modif_invdiag Diagonal inversion of elements
## @defgroup l2_modif_unitetri Uniting triangles
## @defgroup l2_modif_changori Changing orientation of elements
-## @defgroup l2_modif_cutquadr Cutting quadrangles
+## @defgroup l2_modif_cutquadr Cutting elements
## @defgroup l2_modif_smooth Smoothing
## @defgroup l2_modif_extrurev Extrusion and Revolution
## @defgroup l2_modif_patterns Pattern mapping
import SALOMEDS
import os
+class MeshMeta(type):
+ def __instancecheck__(cls, inst):
+ """Implement isinstance(inst, cls)."""
+ return any(cls.__subclasscheck__(c)
+ for c in {type(inst), inst.__class__})
+
+ def __subclasscheck__(cls, sub):
+ """Implement issubclass(sub, cls)."""
+ return type.__subclasscheck__(cls, sub) or (cls.__name__ == sub.__name__ and cls.__module__ == sub.__module__)
+
## @addtogroup l1_auxiliary
## @{
[TopAbs_IN, TopAbs_OUT, TopAbs_ON, TopAbs_UNKNOWN] = range(4)
# Methods of splitting a hexahedron into tetrahedra
- Hex_5Tet, Hex_6Tet, Hex_24Tet = 1, 2, 3
+ Hex_5Tet, Hex_6Tet, Hex_24Tet, Hex_2Prisms, Hex_4Prisms = 1, 2, 3, 1, 2
def __new__(cls):
global engine
#print "init_smesh"
self.SetCurrentStudy(theStudy,geompyD)
- ## Creates an empty Mesh. This mesh can have an underlying geometry.
- # @param obj the Geometrical object on which the mesh is built. If not defined,
- # the mesh will have no underlying geometry.
+ ## Creates a mesh. This can be either an empty mesh, possibly having an underlying geometry,
+ # or a mesh wrapping a CORBA mesh given as a parameter.
+ # @param obj either (1) a CORBA mesh (SMESH._objref_SMESH_Mesh) got e.g. by calling
+ # salome.myStudy.FindObjectID("0:1:2:3").GetObject() or
+ # (2) a Geometrical object for meshing or
+ # (3) none.
# @param name the name for the new mesh.
# @return an instance of Mesh class.
# @ingroup l2_construct
## Creates a filter from criteria
# @param criteria a list of criteria
+ # @param binOp binary operator used when binary operator of criteria is undefined
# @return SMESH_Filter
#
# <a href="../tui_filters_page.html#tui_filters">Example of Filters usage</a>
# @ingroup l1_controls
- def GetFilterFromCriteria(self,criteria):
+ def GetFilterFromCriteria(self,criteria, binOp=SMESH.FT_LogicalAND):
+ for i in range( len( criteria ) - 1 ):
+ if criteria[i].BinaryOp == self.EnumToLong( SMESH.FT_Undefined ):
+ criteria[i].BinaryOp = self.EnumToLong( binOp )
aFilterMgr = self.CreateFilterManager()
aFilter = aFilterMgr.CreateFilter()
aFilter.SetCriteria(criteria)
# new nodes and elements and by changing the existing entities), to get information
# about a mesh and to export a mesh into different formats.
class Mesh:
+ __metaclass__ = MeshMeta
geom = 0
mesh = 0
if not geom:
geom = self.mesh.GetShapeToMesh()
pass
- AssureGeomPublished( self, geom, "shape for %s" % hyp.GetName())
- status = self.mesh.AddHypothesis(geom, hyp)
- isAlgo = hyp._narrow( SMESH_Algo )
+ isApplicable = True
+ if self.mesh.HasShapeToMesh():
+ hyp_type = hyp.GetName()
+ lib_name = hyp.GetLibName()
+ checkAll = ( not geom.IsSame( self.mesh.GetShapeToMesh() ))
+ if checkAll and geom:
+ checkAll = geom.GetType() == 37
+ isApplicable = self.smeshpyD.IsApplicable(hyp_type, lib_name, geom, checkAll)
+ if isApplicable:
+ AssureGeomPublished( self, geom, "shape for %s" % hyp.GetName())
+ status = self.mesh.AddHypothesis(geom, hyp)
+ else:
+ status = HYP_BAD_GEOMETRY
hyp_name = GetName( hyp )
geom_name = ""
if geom:
- geom_name = GetName( geom )
+ geom_name = geom.GetName()
+ isAlgo = hyp._narrow( SMESH_Algo )
TreatHypoStatus( status, hyp_name, geom_name, isAlgo )
return status
# - 1D if all mesh nodes lie on OX coordinate axis, or
# - 2D if all mesh nodes lie on XOY coordinate plane, or
# - 3D in the rest cases.
- #
# If @a autoDimension is @c False, the space dimension is always 3.
+ # @param fields : list of GEOM fields defined on the shape to mesh.
+ # @param geomAssocFields : each character of this string means a need to export a
+ # corresponding field; correspondence between fields and characters is following:
+ # - 'v' stands for _vertices_ field;
+ # - 'e' stands for _edges_ field;
+ # - 'f' stands for _faces_ field;
+ # - 's' stands for _solids_ field.
# @ingroup l2_impexp
def ExportMED(self, f, auto_groups=0, version=MED_V2_2,
- overwrite=1, meshPart=None, autoDimension=True):
- if meshPart:
+ overwrite=1, meshPart=None, autoDimension=True, fields=[], geomAssocFields=''):
+ if meshPart or fields or geomAssocFields:
unRegister = genObjUnRegister()
if isinstance( meshPart, list ):
meshPart = self.GetIDSource( meshPart, SMESH.ALL )
unRegister.set( meshPart )
- self.mesh.ExportPartToMED( meshPart, f, auto_groups, version, overwrite, autoDimension)
+ self.mesh.ExportPartToMED( meshPart, f, auto_groups, version, overwrite, autoDimension,
+ fields, geomAssocFields)
else:
self.mesh.ExportToMEDX(f, auto_groups, version, overwrite, autoDimension)
def RemoveGroupWithContents(self, group):
self.mesh.RemoveGroupWithContents(group)
- ## Gets the list of groups existing in the mesh
+ ## Gets the list of groups existing in the mesh in the order of creation (starting from the oldest one)
# @return a sequence of SMESH_GroupBase
# @ingroup l2_grps_create
def GetGroups(self):
def GetElementGeomType(self, id):
return self.mesh.GetElementGeomType(id)
+ ## Returns the shape type of mesh element
+ # @return the value from SMESH::GeometryType enumeration
+ # @ingroup l1_meshinfo
+ def GetElementShape(self, id):
+ return self.mesh.GetElementShape(id)
+
## Returns the list of submesh elements IDs
# @param Shape a geom object(sub-shape) IOR
# Shape must be the sub-shape of a ShapeToMesh()
def GetElemFaceNodes(self,elemId, faceIndex):
return self.mesh.GetElemFaceNodes(elemId, faceIndex)
+ ## Returns three components of normal of given mesh face
+ # (or an empty array in KO case)
+ # @ingroup l1_meshinfo
+ def GetFaceNormal(self, faceId, normalized=False):
+ return self.mesh.GetFaceNormal(faceId,normalized)
+
## Returns an element based on all given nodes.
# @ingroup l1_meshinfo
def FindElementByNodes(self,nodes):
return self.editor.BestSplit(IDOfQuad, self.smeshpyD.GetFunctor(theCriterion))
## Splits volumic elements into tetrahedrons
- # @param elemIDs either list of elements or mesh or group or submesh
- # @param method flags passing splitting method: Hex_5Tet, Hex_6Tet, Hex_24Tet
- # Hex_5Tet - split the hexahedron into 5 tetrahedrons, etc
+ # @param elems either a list of elements or a mesh or a group or a submesh or a filter
+ # @param method flags passing splitting method:
+ # smesh.Hex_5Tet, smesh.Hex_6Tet, smesh.Hex_24Tet.
+ # smesh.Hex_5Tet - to split the hexahedron into 5 tetrahedrons, etc.
+ # @ingroup l2_modif_cutquadr
+ def SplitVolumesIntoTetra(self, elems, method=smeshBuilder.Hex_5Tet ):
+ unRegister = genObjUnRegister()
+ if isinstance( elems, Mesh ):
+ elems = elems.GetMesh()
+ if ( isinstance( elems, list )):
+ elems = self.editor.MakeIDSource(elems, SMESH.VOLUME)
+ unRegister.set( elems )
+ self.editor.SplitVolumesIntoTetra(elems, method)
+
+ ## Splits hexahedra into prisms
+ # @param elems either a list of elements or a mesh or a group or a submesh or a filter
+ # @param startHexPoint a point used to find a hexahedron for which @a facetNormal
+ # gives a normal vector defining facets to split into triangles.
+ # @a startHexPoint can be either a triple of coordinates or a vertex.
+ # @param facetNormal a normal to a facet to split into triangles of a
+ # hexahedron found by @a startHexPoint.
+ # @a facetNormal can be either a triple of coordinates or an edge.
+ # @param method flags passing splitting method: smesh.Hex_2Prisms, smesh.Hex_4Prisms.
+ # smesh.Hex_2Prisms - to split the hexahedron into 2 prisms, etc.
+ # @param allDomains if @c False, only hexahedra adjacent to one closest
+ # to @a startHexPoint are split, else @a startHexPoint
+ # is used to find the facet to split in all domains present in @a elems.
# @ingroup l2_modif_cutquadr
- def SplitVolumesIntoTetra(self, elemIDs, method=smeshBuilder.Hex_5Tet ):
+ def SplitHexahedraIntoPrisms(self, elems, startHexPoint, facetNormal,
+ method=smeshBuilder.Hex_2Prisms, allDomains=False ):
+ # IDSource
unRegister = genObjUnRegister()
- if isinstance( elemIDs, Mesh ):
- elemIDs = elemIDs.GetMesh()
- if ( isinstance( elemIDs, list )):
- elemIDs = self.editor.MakeIDSource(elemIDs, SMESH.VOLUME)
- unRegister.set( elemIDs )
- self.editor.SplitVolumesIntoTetra(elemIDs, method)
+ if isinstance( elems, Mesh ):
+ elems = elems.GetMesh()
+ if ( isinstance( elems, list )):
+ elems = self.editor.MakeIDSource(elems, SMESH.VOLUME)
+ unRegister.set( elems )
+ pass
+ # axis
+ if isinstance( startHexPoint, geomBuilder.GEOM._objref_GEOM_Object):
+ startHexPoint = self.smeshpyD.GetPointStruct( startHexPoint )
+ elif isinstance( startHexPoint, list ):
+ startHexPoint = SMESH.PointStruct( startHexPoint[0],
+ startHexPoint[1],
+ startHexPoint[2])
+ if isinstance( facetNormal, geomBuilder.GEOM._objref_GEOM_Object):
+ facetNormal = self.smeshpyD.GetDirStruct( facetNormal )
+ elif isinstance( facetNormal, list ):
+ facetNormal = self.smeshpyD.MakeDirStruct( facetNormal[0],
+ facetNormal[1],
+ facetNormal[2])
+ self.mesh.SetParameters( startHexPoint.parameters + facetNormal.PS.parameters )
+
+ self.editor.SplitHexahedraIntoPrisms(elems, startHexPoint, facetNormal, method, allDomains)
## Splits quadrangle faces near triangular facets of volumes
#
# Note that nodes built on edges and boundary nodes are always fixed.
# @param MaxNbOfIterations the maximum number of iterations
# @param MaxAspectRatio varies in range [1.0, inf]
- # @param Method is Laplacian(LAPLACIAN_SMOOTH) or Centroidal(CENTROIDAL_SMOOTH)
+ # @param Method is either Laplacian (smesh.LAPLACIAN_SMOOTH)
+ # or Centroidal (smesh.CENTROIDAL_SMOOTH)
# @return TRUE in case of success, FALSE otherwise.
# @ingroup l2_modif_smooth
def Smooth(self, IDsOfElements, IDsOfFixedNodes,
# Note that nodes built on edges and boundary nodes are always fixed.
# @param MaxNbOfIterations the maximum number of iterations
# @param MaxAspectRatio varies in range [1.0, inf]
- # @param Method is Laplacian(LAPLACIAN_SMOOTH) or Centroidal(CENTROIDAL_SMOOTH)
+ # @param Method is either Laplacian (smesh.LAPLACIAN_SMOOTH)
+ # or Centroidal (smesh.CENTROIDAL_SMOOTH)
# @return TRUE in case of success, FALSE otherwise.
# @ingroup l2_modif_smooth
def SmoothObject(self, theObject, IDsOfFixedNodes,
# Note that nodes built on edges and boundary nodes are always fixed.
# @param MaxNbOfIterations the maximum number of iterations
# @param MaxAspectRatio varies in range [1.0, inf]
- # @param Method is Laplacian(LAPLACIAN_SMOOTH) or Centroidal(CENTROIDAL_SMOOTH)
+ # @param Method is either Laplacian (smesh.LAPLACIAN_SMOOTH)
+ # or Centroidal (smesh.CENTROIDAL_SMOOTH)
# @return TRUE in case of success, FALSE otherwise.
# @ingroup l2_modif_smooth
def SmoothParametric(self, IDsOfElements, IDsOfFixedNodes,
# Note that nodes built on edges and boundary nodes are always fixed.
# @param MaxNbOfIterations the maximum number of iterations
# @param MaxAspectRatio varies in range [1.0, inf]
- # @param Method Laplacian(LAPLACIAN_SMOOTH) or Centroidal(CENTROIDAL_SMOOTH)
+ # @param Method is either Laplacian (smesh.LAPLACIAN_SMOOTH)
+ # or Centroidal (smesh.CENTROIDAL_SMOOTH)
# @return TRUE in case of success, FALSE otherwise.
# @ingroup l2_modif_smooth
def SmoothParametricObject(self, theObject, IDsOfFixedNodes,
# Triangles are transformed in prisms, and quadrangles in hexahedrons.
# @param theDomains - list of groups of volumes
# @param createJointElems - if TRUE, create the elements
+ # @param onAllBoundaries - if TRUE, the nodes and elements are also created on
+ # the boundary between \a theDomains and the rest mesh
# @return TRUE if operation has been completed successfully, FALSE otherwise
- def DoubleNodesOnGroupBoundaries(self, theDomains, createJointElems ):
- return self.editor.DoubleNodesOnGroupBoundaries( theDomains, createJointElems )
+ def DoubleNodesOnGroupBoundaries(self, theDomains, createJointElems, onAllBoundaries=False ):
+ return self.editor.DoubleNodesOnGroupBoundaries( theDomains, createJointElems, onAllBoundaries )
## Double nodes on some external faces and create flat elements.
# Flat elements are mainly used by some types of mechanic calculations.
return self._valueFromFunctor(SMESH.FT_Skew, elemId)
pass # end of Mesh class
-
+
## Helper class for wrapping of SMESH.SMESH_Pattern CORBA class
#
class Pattern(SMESH._objref_SMESH_Pattern):
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
if geom is None and mesh.mesh.HasShapeToMesh():
raise RuntimeError, "Attemp to create " + algo + " algoritm on None shape"
self.mesh = mesh
- name = ""
if not geom or geom.IsSame( mesh.geom ):
self.geom = mesh.geom
else:
self.geom = geom
AssureGeomPublished( mesh, geom )
- try:
- name = GetName(geom)
- pass
- except:
- pass
self.subm = mesh.mesh.GetSubMesh(geom, algo.GetName())
self.algo = algo
- status = mesh.mesh.AddHypothesis(self.geom, self.algo)
- TreatHypoStatus( status, algo.GetName(), name, True )
+ status = mesh.AddHypothesis(self.algo, self.geom)
return
def CompareHyp (self, hyp, args):
# @param thickness total thickness of layers of prisms
# @param numberOfLayers number of layers of prisms
# @param stretchFactor factor (>1.0) of growth of layer thickness towards inside of mesh
- # @param ignoreFaces list of geometrical faces (or their ids) not to generate layers on
+ # @param faces list of geometrical faces (or their ids).
+ # Viscous layers are either generated on these faces or not, depending on
+ # the value of \a isFacesToIgnore parameter.
+ # @param isFacesToIgnore if \c True, the Viscous layers are not generated on the
+ # faces specified by the previous parameter (\a faces).
# @ingroup l3_hypos_additi
- def ViscousLayers(self, thickness, numberOfLayers, stretchFactor, ignoreFaces=[]):
+ def ViscousLayers(self, thickness, numberOfLayers, stretchFactor,
+ faces=[], isFacesToIgnore=True ):
if not isinstance(self.algo, SMESH._objref_SMESH_3D_Algo):
raise TypeError, "ViscousLayers are supported by 3D algorithms only"
if not "ViscousLayers" in self.GetCompatibleHypothesis():
raise TypeError, "ViscousLayers are not supported by %s"%self.algo.GetName()
- if ignoreFaces and isinstance( ignoreFaces[0], geomBuilder.GEOM._objref_GEOM_Object ):
- ignoreFaces = [ self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f) for f in ignoreFaces ]
+ if faces and isinstance( faces[0], geomBuilder.GEOM._objref_GEOM_Object ):
+ faces = [ self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f) for f in faces ]
hyp = self.Hypothesis("ViscousLayers",
- [thickness, numberOfLayers, stretchFactor, ignoreFaces])
+ [thickness, numberOfLayers, stretchFactor, faces])
hyp.SetTotalThickness(thickness)
hyp.SetNumberLayers(numberOfLayers)
hyp.SetStretchFactor(stretchFactor)
- hyp.SetIgnoreFaces(ignoreFaces)
+ hyp.SetFaces(faces, isFacesToIgnore)
return hyp
## Defines "ViscousLayers2D" hypothesis to give parameters of layers of quadrilateral
# @param thickness total thickness of layers of quadrilaterals
# @param numberOfLayers number of layers
# @param stretchFactor factor (>1.0) of growth of layer thickness towards inside of mesh
- # @param edges list of geometrical edge (or their ids).
+ # @param edges list of geometrical edges (or their ids).
# Viscous layers are either generated on these edges or not, depending on
- # the values of \a isEdgesToIgnore parameter.
+ # the value of \a isEdgesToIgnore parameter.
# @param isEdgesToIgnore if \c True, the Viscous layers are not generated on the
# edges specified by the previous parameter (\a edges).
# @ingroup l3_hypos_additi
hyp.SetEdges(edges, isEdgesToIgnore)
return hyp
- ## Transform a list of ether edges or tuples (edge, 1st_vertex_of_edge)
+ ## Transform a list of either edges or tuples (edge, 1st_vertex_of_edge)
# into a list acceptable to SetReversedEdges() of some 1D hypotheses
# @ingroup l3_hypos_1dhyps
def ReversedEdgeIndices(self, reverseList):
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
${VTK_INCLUDE_DIRS}
${KERNEL_INCLUDE_DIRS}
${GUI_INCLUDE_DIRS}
+ ${GEOM_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/SMESHUtils
${PROJECT_SOURCE_DIR}/src/SMESH
${PROJECT_SOURCE_DIR}/src/SMESHDS
${CAS_TKAdvTools}
${CAS_TKTopAlgo}
${CAS_TKG3d}
+ ${GEOM_GEOMUtils}
SMESHimpl
SMESHDS
${TBB_LIBS}
# header files / no moc processing
SET(StdMeshers_HEADERS
StdMeshers_LocalLength.hxx
+ StdMeshers_Reversible1D.hxx
StdMeshers_StartEndLength.hxx
StdMeshers_Arithmetic1D.hxx
+ StdMeshers_Geometric1D.hxx
StdMeshers_FixedPoints1D.hxx
StdMeshers_NumberOfSegments.hxx
StdMeshers_Deflection1D.hxx
# sources / static
SET(StdMeshers_SOURCES
StdMeshers_LocalLength.cxx
+ StdMeshers_Reversible1D.cxx
StdMeshers_StartEndLength.cxx
StdMeshers_Arithmetic1D.cxx
+ StdMeshers_Geometric1D.cxx
StdMeshers_FixedPoints1D.cxx
StdMeshers_NumberOfSegments.cxx
StdMeshers_Deflection1D.cxx
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "utilities.h"
-#include <Precision.hxx>
-#include <Bnd_Box.hxx>
-
+#include <map>
#include <limits>
+#include <BRepGProp.hxx>
+#include <BRep_Tool.hxx>
+#include <Bnd_Box.hxx>
+#include <GProp_GProps.hxx>
+#include <GeomLib_IsPlanarSurface.hxx>
+#include <Geom_Surface.hxx>
+#include <Precision.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopLoc_Location.hxx>
+#include <TopTools_MapIteratorOfMapOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Face.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Mat.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Vec.hxx>
+
using namespace std;
//=======================================================================
int studyId,
SMESH_Gen * gen)
: SMESH_Hypothesis(hypId, studyId, gen),
- _sizeThreshold( 4.0 ) // default according to the customer specification
+ _sizeThreshold( 4.0 ), // default according to the customer specification
+ _toAddEdges( false )
{
_name = "CartesianParameters3D"; // used by "Cartesian_3D"
_param_algo_dim = 3; // 3D
+
+ _axisDirs[0] = 1.;
+ _axisDirs[1] = 0.;
+ _axisDirs[2] = 0.;
+
+ _axisDirs[3] = 0.;
+ _axisDirs[4] = 1.;
+ _axisDirs[5] = 0.;
+
+ _axisDirs[6] = 0.;
+ _axisDirs[7] = 0.;
+ _axisDirs[8] = 1.;
+
+ _fixedPoint[0] = 0.;
+ _fixedPoint[1] = 0.;
+ _fixedPoint[2] = 0.;
+ SetFixedPoint( _fixedPoint, /*toUnset=*/true );
}
{
const char* axisName[3] = { "X", "Y", "Z" };
+ typedef std::pair< double, std::pair< double, double > > TCooTriple;
+
+#define gpXYZ( cTriple ) gp_XYZ( (cTriple).first, (cTriple).second.first, (cTriple).second.second )
+
+ //================================================================================
+ /*!
+ * \brief Compare two normals
+ */
+ //================================================================================
+
+ bool sameDir( const TCooTriple& n1, const TCooTriple& n2 )
+ {
+ gp_XYZ xyz1 = gpXYZ( n1 ), xyz2 = gpXYZ( n2 );
+ return ( xyz1 - xyz2 ).Modulus() < 0.01;
+ }
+
//================================================================================
/*!
* \brief Checks validity of an axis index, throws in case of invalidity
NotifySubMeshesHypothesisModification();
}
+//=======================================================================
+//function : SetFixedPoint
+//purpose : * Set/unset a fixed point, at which a node will be created provided that grid
+// * is defined by spacing in all directions
+//=======================================================================
+
+void StdMeshers_CartesianParameters3D::SetFixedPoint(const double p[3], bool toUnset)
+{
+ if ( toUnset != Precision::IsInfinite( _fixedPoint[0] ))
+ NotifySubMeshesHypothesisModification();
+
+ if ( toUnset )
+ _fixedPoint[0] = Precision::Infinite();
+ else
+ std::copy( &p[0], &p[0]+3, &_fixedPoint[0] );
+}
+
+//=======================================================================
+//function : GetFixedPoint
+//purpose : Returns either false or (true + point coordinates)
+//=======================================================================
+
+bool StdMeshers_CartesianParameters3D::GetFixedPoint(double p[3]) const
+{
+ if ( Precision::IsInfinite( _fixedPoint[0] ))
+ return false;
+ std::copy( &_fixedPoint[0], &_fixedPoint[0]+3, &p[0] );
+}
+
+
//=======================================================================
//function : SetSizeThreshold
//purpose : Set size threshold
//purpose : Computes node coordinates by spacing functions
//=======================================================================
-void StdMeshers_CartesianParameters3D::ComputeCoordinates(const double x0,
- const double x1,
- vector<std::string>& spaceFuns,
- vector<double>& points,
- vector<double>& coords,
- const std::string& axis )
+void StdMeshers_CartesianParameters3D::ComputeCoordinates(const double x0,
+ const double x1,
+ vector<string>& theSpaceFuns,
+ vector<double>& thePoints,
+ vector<double>& coords,
+ const string& axis,
+ const double* xForced )
throw ( SALOME_Exception )
{
- checkGridSpacing( spaceFuns, points, axis );
+ checkGridSpacing( theSpaceFuns, thePoints, axis );
+
+ vector<string> spaceFuns = theSpaceFuns;
+ vector<double> points = thePoints;
+
+ bool forced = false;
+ if (( forced = ( xForced && ( x0 < *xForced ) && ( *xForced < x1 ))))
+ {
+ // divide a range at xForced
+
+ // find a range to insert xForced
+ double pos = ( *xForced - x0 ) / ( x1 - x0 );
+ int iR = 1;
+ while ( pos > points[ iR ] ) ++iR;
+
+ // insert xForced
+ vector<double>::iterator pntIt = points.begin() + iR;
+ points.insert( pntIt, pos );
+ vector<string>::iterator funIt = spaceFuns.begin() + iR;
+ spaceFuns.insert( funIt, spaceFuns[ iR-1 ]);
+ }
coords.clear();
for ( size_t i = 0; i < spaceFuns.size(); ++i )
if ( fabs( coords.back() - p1 ) > 0.5 * lastCellLen )
coords.push_back ( p1 );
}
+
+ // correct coords if a forced point is too close to a neighbor node
+ if ( forced )
+ {
+ int iF = 0;
+ double minLen = ( x1 - x0 );
+ for ( size_t i = 1; i < coords.size(); ++i )
+ {
+ if ( !iF && Abs( coords[i] - *xForced ) < 1e-20 )
+ iF = i++; // xForced found
+ else
+ minLen = Min( minLen, coords[i] - coords[i-1] );
+ }
+ const double tol = minLen * 1e-3;
+ int iRem = -1;
+ if (( iF > 1 ) && ( coords[iF] - coords[iF-1] < tol ))
+ iRem = iF-1;
+ else if (( iF < coords.size()-2 ) && ( coords[iF+1] - coords[iF] < tol ))
+ iRem = iF+1;
+ if ( iRem > 0 )
+ coords.erase( coords.begin() + iRem );
+ }
}
//=======================================================================
bndBox.Get(x0,y0,z0, x1,y1,z1);
}
+ double fp[3], *pfp[3] = { NULL, NULL, NULL };
+ if ( GetFixedPoint( fp ))
+ {
+ // convert fp into a basis defined by _axisDirs
+ gp_XYZ axis[3] = { gp_XYZ( _axisDirs[0], _axisDirs[1], _axisDirs[2] ),
+ gp_XYZ( _axisDirs[3], _axisDirs[4], _axisDirs[5] ),
+ gp_XYZ( _axisDirs[6], _axisDirs[7], _axisDirs[8] ) };
+ axis[0].Normalize();
+ axis[1].Normalize();
+ axis[2].Normalize();
+
+ gp_Mat basis( axis[0], axis[1], axis[2] );
+ gp_Mat bi = basis.Inverted();
+
+ gp_XYZ p( fp[0], fp[1], fp[2] );
+ p *= bi;
+ p.Coord( fp[0], fp[1], fp[2] );
+
+ pfp[0] = & fp[0];
+ pfp[1] = & fp[1];
+ pfp[2] = & fp[2];
+ }
+
StdMeshers_CartesianParameters3D* me = const_cast<StdMeshers_CartesianParameters3D*>(this);
if ( IsGridBySpacing(0) )
- ComputeCoordinates( x0, x1, me->_spaceFunctions[0], me->_internalPoints[0], xNodes, "X" );
+ ComputeCoordinates
+ ( x0, x1, me->_spaceFunctions[0], me->_internalPoints[0], xNodes, "X", pfp[0] );
else
xNodes = _coords[0];
if ( IsGridBySpacing(1) )
- ComputeCoordinates( y0, y1, me->_spaceFunctions[1], me->_internalPoints[1], yNodes, "Y" );
+ ComputeCoordinates
+ ( y0, y1, me->_spaceFunctions[1], me->_internalPoints[1], yNodes, "Y", pfp[1] );
else
yNodes = _coords[1];
if ( IsGridBySpacing(2) )
- ComputeCoordinates( z0, z1, me->_spaceFunctions[2], me->_internalPoints[2], zNodes, "Z" );
+ ComputeCoordinates
+ ( z0, z1, me->_spaceFunctions[2], me->_internalPoints[2], zNodes, "Z", pfp[2] );
else
zNodes = _coords[2];
}
+//=======================================================================
+//function : ComputeOptimalAxesDirs
+//purpose : Returns axes at which number of hexahedra is maximal
+//=======================================================================
+
+void StdMeshers_CartesianParameters3D::
+ComputeOptimalAxesDirs(const TopoDS_Shape& shape,
+ const bool isOrthogonal,
+ double dirCoords[9])
+{
+ for ( int i = 0; i < 9; ++i ) dirCoords[i] = 0.;
+ dirCoords[0] = dirCoords[4] = dirCoords[8] = 1.;
+
+ if ( shape.IsNull() ) return;
+
+ TopLoc_Location loc;
+ TopExp_Explorer exp;
+
+ // get external FACEs of the shape
+ TopTools_MapOfShape faceMap;
+ for ( exp.Init( shape, TopAbs_FACE ); exp.More(); exp.Next() )
+ if ( !faceMap.Add( exp.Current() ))
+ faceMap.Remove( exp.Current() );
+
+ // sort areas of planar faces by normal direction
+
+ std::multimap< TCooTriple, double > areasByNormal;
+
+ TopTools_MapIteratorOfMapOfShape fIt ( faceMap );
+ for ( ; fIt.More(); fIt.Next() )
+ {
+ const TopoDS_Face& face = TopoDS::Face( fIt.Key() );
+ Handle(Geom_Surface) surf = BRep_Tool::Surface( face, loc );
+ if ( surf.IsNull() ) continue;
+
+ GeomLib_IsPlanarSurface check( surf, 1e-5 );
+ if ( !check.IsPlanar() ) continue;
+
+ GProp_GProps SProps;
+ BRepGProp::SurfaceProperties( face, SProps );
+ double area = SProps.Mass();
+
+ gp_Pln pln = check.Plan();
+ gp_Dir norm = pln.Axis().Direction().Transformed( loc );
+ if ( norm.X() < -1e-3 ) { // negative X
+ norm.Reverse();
+ } else if ( norm.X() < 1e-3 ) { // zero X
+ if ( norm.Y() < -1e-3 ) { // negative Y
+ norm.Reverse();
+ } else if ( norm.Y() < 1e-3 ) { // zero X && zero Y
+ if ( norm.Y() < -1e-3 ) // negative Z
+ norm.Reverse();
+ }
+ }
+ TCooTriple coo3( norm.X(), make_pair( norm.Y(), norm.Z() ));
+ areasByNormal.insert( make_pair( coo3, area ));
+ }
+
+ // group coplanar normals and sort groups by sum area
+
+ std::multimap< double, vector< const TCooTriple* > > normsByArea;
+ std::multimap< TCooTriple, double >::iterator norm2a = areasByNormal.begin();
+ const TCooTriple* norm1 = 0;
+ double sumArea = 0;
+ vector< const TCooTriple* > norms;
+ for ( int iF = 1; norm2a != areasByNormal.end(); ++norm2a, ++iF )
+ {
+
+ if ( !norm1 || !sameDir( *norm1, norm2a->first ))
+ {
+ if ( !norms.empty() )
+ {
+ normsByArea.insert( make_pair( sumArea, norms ));
+ norms.clear();
+ }
+ norm1 = & norm2a->first;
+ sumArea = norm2a->second;
+ norms.push_back( norm1 );
+ }
+ else
+ {
+ sumArea += norm2a->second;
+ norms.push_back( & norm2a->first );
+ }
+ if ( iF == areasByNormal.size() )
+ normsByArea.insert( make_pair( sumArea, norms ));
+ }
+
+ // try to set dirs by planar faces
+
+ gp_XYZ normDirs[3]; // normals to largest planes
+
+ if ( !normsByArea.empty() )
+ {
+ norm1 = normsByArea.rbegin()->second[0];
+ normDirs[0] = gpXYZ( *norm1 );
+
+ if ( normsByArea.size() == 1 )
+ {
+ normDirs[1] = normDirs[0];
+ if ( Abs( normDirs[0].Y() ) < 1e-100 &&
+ Abs( normDirs[0].Z() ) < 1e-100 ) // normDirs[0] || OX
+ normDirs[1].SetY( normDirs[0].Y() + 1. );
+ else
+ normDirs[1].SetX( normDirs[0].X() + 1. );
+ }
+ else
+ {
+ // look for 2 other directions
+ gp_XYZ testDir = normDirs[0], minDir, maxDir;
+ for ( int is2nd = 0; is2nd < 2; ++is2nd )
+ {
+ double maxMetric = 0, minMetric = 1e100;
+ std::multimap< double, vector< const TCooTriple* > >::iterator a2n;
+ for ( a2n = normsByArea.begin(); a2n != normsByArea.end(); ++a2n )
+ {
+ gp_XYZ n = gpXYZ( *( a2n->second[0]) );
+ double dot = Abs( n * testDir );
+ double metric = ( 1. - dot ) * ( isOrthogonal ? 1 : a2n->first );
+ if ( metric > maxMetric )
+ {
+ maxDir = n;
+ maxMetric = metric;
+ }
+ if ( metric < minMetric )
+ {
+ minDir = n;
+ minMetric = metric;
+ }
+ }
+ if ( is2nd )
+ {
+ normDirs[2] = minDir;
+ }
+ else
+ {
+ normDirs[1] = maxDir;
+ normDirs[2] = normDirs[0] ^ normDirs[1];
+ if ( isOrthogonal || normsByArea.size() < 3 )
+ break;
+ testDir = normDirs[2];
+ }
+ }
+ }
+ if ( isOrthogonal || normsByArea.size() == 1 )
+ {
+ normDirs[2] = normDirs[0] ^ normDirs[1];
+ normDirs[1] = normDirs[2] ^ normDirs[0];
+ }
+ }
+ else
+ {
+ return;
+ }
+
+ gp_XYZ dirs[3];
+ dirs[0] = normDirs[0] ^ normDirs[1];
+ dirs[1] = normDirs[1] ^ normDirs[2];
+ dirs[2] = normDirs[2] ^ normDirs[0];
+
+ dirs[0].Normalize();
+ dirs[1].Normalize();
+ dirs[2].Normalize();
+
+ // Select dirs for X, Y and Z axes
+ int iX = ( Abs( dirs[0].X() ) > Abs( dirs[1].X() )) ? 0 : 1;
+ if ( Abs( dirs[iX].X() ) < Abs( dirs[2].X() ))
+ iX = 2;
+ int iY = ( iX == 0 ) ? 1 : (( Abs( dirs[0].Y() ) > Abs( dirs[1].Y() )) ? 0 : 1 );
+ if ( Abs( dirs[iY].Y() ) < Abs( dirs[2].Y() ) && iX != 2 )
+ iY = 2;
+ int iZ = 3 - iX - iY;
+
+ if ( dirs[iX].X() < 0 ) dirs[iX].Reverse();
+ if ( dirs[iY].Y() < 0 ) dirs[iY].Reverse();
+ gp_XYZ zDir = dirs[iX] ^ dirs[iY];
+ if ( dirs[iZ] * zDir < 0 )
+ dirs[iZ].Reverse();
+
+ dirCoords[0] = dirs[iX].X();
+ dirCoords[1] = dirs[iX].Y();
+ dirCoords[2] = dirs[iX].Z();
+ dirCoords[3] = dirs[iY].X();
+ dirCoords[4] = dirs[iY].Y();
+ dirCoords[5] = dirs[iY].Z();
+ dirCoords[6] = dirs[iZ].X();
+ dirCoords[7] = dirs[iZ].Y();
+ dirCoords[8] = dirs[iZ].Z();
+}
+
+//=======================================================================
+//function : SetAxisDirs
+//purpose : Sets custom direction of axes
+//=======================================================================
+
+void StdMeshers_CartesianParameters3D::SetAxisDirs(const double* the9DirComps)
+ throw ( SALOME_Exception )
+{
+ gp_Vec x( the9DirComps[0],
+ the9DirComps[1],
+ the9DirComps[2] );
+ gp_Vec y( the9DirComps[3],
+ the9DirComps[4],
+ the9DirComps[5] );
+ gp_Vec z( the9DirComps[6],
+ the9DirComps[7],
+ the9DirComps[8] );
+ if ( x.Magnitude() < RealSmall() ||
+ y.Magnitude() < RealSmall() ||
+ z.Magnitude() < RealSmall() )
+ throw SALOME_Exception("Zero magnitude of axis direction");
+
+ if ( x.IsParallel( y, M_PI / 180. ) ||
+ x.IsParallel( z, M_PI / 180. ) ||
+ y.IsParallel( z, M_PI / 180. ))
+ throw SALOME_Exception("Parallel axis directions");
+
+ gp_Vec normXY = x ^ y, normYZ = y ^ z;
+ if ( normXY.IsParallel( normYZ, M_PI / 180. ))
+ throw SALOME_Exception("Axes lie in one plane");
+
+ bool isChanged = false;
+ for ( int i = 0; i < 9; ++i )
+ {
+ if ( Abs( _axisDirs[i] - the9DirComps[i] ) > 1e-7 )
+ isChanged = true;
+ _axisDirs[i] = the9DirComps[i];
+ }
+ if ( isChanged )
+ NotifySubMeshesHypothesisModification();
+}
+
//=======================================================================
//function : GetGrid
//purpose : Return coordinates of node positions along the three axes
return _sizeThreshold;
}
+//=======================================================================
+//function : SetToAddEdges
+//purpose : Enables implementation of geometrical edges into the mesh. If this feature
+// is disabled, sharp edges of the shape are lost ("smoothed") in the mesh if
+// they don't coincide with the grid lines
+//=======================================================================
+
+void StdMeshers_CartesianParameters3D::SetToAddEdges(bool toAdd)
+{
+ if ( _toAddEdges != toAdd )
+ {
+ _toAddEdges = toAdd;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
+//=======================================================================
+//function : GetToAddEdges
+//purpose : Returns true if implementation of geometrical edges into the
+// mesh is enabled
+//=======================================================================
+
+bool StdMeshers_CartesianParameters3D::GetToAddEdges() const
+{
+ return _toAddEdges;
+}
+
//=======================================================================
//function : IsDefined
//purpose : Return true if parameters are well defined
for ( size_t j = 0; j < _spaceFunctions[i].size(); ++j )
save << _spaceFunctions[i][j] << " ";
}
+ save << _toAddEdges << " ";
+
+ save.setf( save.scientific );
+ save.precision( 12 );
+ for ( int i = 0; i < 9; ++i )
+ save << _axisDirs[i] << " ";
+
+ for ( int i = 0; i < 3; ++i )
+ save << _fixedPoint[i] << " ";
return save;
}
{
bool ok;
- ok = (load >> _sizeThreshold );
+ ok = ( load >> _sizeThreshold );
for ( int ax = 0; ax < 3; ++ax )
{
if (ok)
}
}
}
+
+ ok = ( load >> _toAddEdges );
+
+ for ( int i = 0; i < 9 && ok; ++i )
+ ok = ( load >> _axisDirs[i]);
+
+ for ( int i = 0; i < 3 && ok ; ++i )
+ ok = ( load >> _fixedPoint[i]);
+
return load;
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
bool IsGridBySpacing(const int axis) const throw ( SALOME_Exception );
+ /*!
+ * Set/unset a fixed point, at which a node will be created provided that grid
+ * is defined by spacing in all directions
+ */
+ void SetFixedPoint(const double p[3], bool toUnset);
+ bool GetFixedPoint(double p[3]) const;
+
/*!
* \brief Computes node coordinates by spacing functions
* \param x0 - lower coordinate
std::vector<std::string>& spaceFuns,
std::vector<double>& points,
std::vector<double>& coords,
- const std::string& axis ) throw (SALOME_Exception);
+ const std::string& axis,
+ const double* xForced=0) throw (SALOME_Exception);
/*!
* Return coordinates of node positions along the three axes.
* If the grid is defined by spacing functions, the coordinates are computed
std::vector<double>& yNodes,
std::vector<double>& zNodes,
const Bnd_Box& bndBox) const throw ( SALOME_Exception );
+
+ /*!
+ * \brief Set custom direction of axes
+ */
+ void SetAxisDirs(const double* the9DirComps) throw ( SALOME_Exception );
+ const double* GetAxisDirs() const { return _axisDirs; }
+ /*!
+ * \brief Returns axes at which number of hexahedra is maximal
+ */
+ static void ComputeOptimalAxesDirs(const TopoDS_Shape& shape,
+ const bool isOrthogonal,
+ double dirCoords[9]);
/*!
* Set size threshold. A polyhedral cell got by cutting an initial
* hexahedron by geometry boundary is considered small and is removed if
- * it's size is \athreshold times less than the size of the initial hexahedron.
+ * it's size is \athreshold times less than the size of the initial hexahedron.
*/
void SetSizeThreshold(const double threshold) throw ( SALOME_Exception );
/*!
*/
double GetSizeThreshold() const;
+ /*!
+ * \brief Enables implementation of geometrical edges into the mesh. If this feature
+ * is disabled, sharp edges of the shape are lost ("smoothed") in the mesh if
+ * they don't coincide with the grid lines
+ */
+ void SetToAddEdges(bool toAdd);
+ bool GetToAddEdges() const;
+
/*!
* \brief Return true if parameters are well defined
*/
std::vector<std::string> _spaceFunctions[3];
std::vector<double> _internalPoints[3];
+ double _axisDirs [9];
+ double _fixedPoint[3];
+
double _sizeThreshold;
+ bool _toAddEdges;
};
#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESH_subMeshEventListener.hxx"
#include "StdMeshers_CartesianParameters3D.hxx"
-#include "utilities.h"
-#include "Utils_ExceptHandlers.hxx"
+#include <utilities.h>
+#include <Utils_ExceptHandlers.hxx>
#include <Basics_OCCTVersion.hxx>
+#include <GEOMUtils.hxx>
+
+#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepBndLib.hxx>
#include <BRepBuilderAPI_Copy.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepTools.hxx>
+#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
+#include <Bnd_B3d.hxx>
#include <Bnd_Box.hxx>
#include <ElSLib.hxx>
+#include <GCPnts_UniformDeflection.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
+#include <GeomAPI_ProjectPointOnSurf.hxx>
+#include <GeomLib.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_BezierCurve.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopLoc_Location.hxx>
-#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopoDS.hxx>
+#include <TopoDS_Compound.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_TShape.hxx>
#include <gp_Cone.hxx>
#include <gp_Sphere.hxx>
#include <gp_Torus.hxx>
-//#undef WITH_TBB
+#include <limits>
+
+#undef WITH_TBB
#ifdef WITH_TBB
#include <tbb/parallel_for.h>
//#include <tbb/enumerable_thread_specific.h>
namespace
{
+ typedef int TGeomID;
+
//=============================================================================
// Definitions of internal utils
// --------------------------------------------------------------------------
};
// --------------------------------------------------------------------------
/*!
- * \brief Data of intersection between a GridLine and a TopoDS_Face
+ * \brief Common data of any intersection between a Grid and a shape
*/
- struct IntersectionPoint
+ struct B_IntersectPoint
{
- double _paramOnLine;
- mutable Transition _transition;
mutable const SMDS_MeshNode* _node;
- mutable size_t _indexOnLine;
+ mutable vector< TGeomID > _faceIDs;
+
+ B_IntersectPoint(): _node(NULL) {}
+ void Add( const vector< TGeomID >& fIDs, const SMDS_MeshNode* n=0 ) const;
+ int HasCommonFace( const B_IntersectPoint * other, int avoidFace=-1 ) const;
+ bool IsOnFace( int faceID ) const;
+ virtual ~B_IntersectPoint() {}
+ };
+ // --------------------------------------------------------------------------
+ /*!
+ * \brief Data of intersection between a GridLine and a TopoDS_Face
+ */
+ struct F_IntersectPoint : public B_IntersectPoint
+ {
+ double _paramOnLine;
+ mutable Transition _transition;
+ mutable size_t _indexOnLine;
- IntersectionPoint(): _node(0) {}
- bool operator< ( const IntersectionPoint& o ) const { return _paramOnLine < o._paramOnLine; }
+ bool operator< ( const F_IntersectPoint& o ) const { return _paramOnLine < o._paramOnLine; }
+ };
+ // --------------------------------------------------------------------------
+ /*!
+ * \brief Data of intersection between GridPlanes and a TopoDS_EDGE
+ */
+ struct E_IntersectPoint : public B_IntersectPoint
+ {
+ gp_Pnt _point;
+ double _uvw[3];
+ TGeomID _shapeID;
};
// --------------------------------------------------------------------------
/*!
{
gp_Lin _line;
double _length; // line length
- multiset< IntersectionPoint > _intPoints;
+ multiset< F_IntersectPoint > _intPoints;
void RemoveExcessIntPoints( const double tol );
- bool GetIsOutBefore( multiset< IntersectionPoint >::iterator ip, bool prevIsOut );
+ bool GetIsOutBefore( multiset< F_IntersectPoint >::iterator ip, bool prevIsOut );
+ };
+ // --------------------------------------------------------------------------
+ /*!
+ * \brief Planes of the grid used to find intersections of an EDGE with a hexahedron
+ */
+ struct GridPlanes
+ {
+ gp_XYZ _uNorm, _vNorm, _zNorm;
+ vector< gp_XYZ > _origins; // origin points of all planes in one direction
+ vector< double > _zProjs; // projections of origins to _zNorm
};
// --------------------------------------------------------------------------
/*!
struct Grid
{
vector< double > _coords[3]; // coordinates of grid nodes
- vector< GridLine > _lines [3]; // in 3 directions
+ gp_XYZ _axes [3]; // axis directions
+ vector< GridLine > _lines [3]; // in 3 directions
double _tol, _minCellSize;
+ gp_XYZ _origin;
+ gp_Mat _invB; // inverted basis of _axes
+ //bool _isOrthogonalAxes;
+
+ vector< const SMDS_MeshNode* > _nodes; // mesh nodes at grid nodes
+ vector< const F_IntersectPoint* > _gridIntP; // grid node intersection with geometry
- vector< const SMDS_MeshNode* > _nodes; // mesh nodes at grid nodes
- vector< bool > _isBndNode; // is mesh node at intersection with geometry
+ list< E_IntersectPoint > _edgeIntP; // intersections with EDGEs
+ TopTools_IndexedMapOfShape _shapes;
+
+ SMESH_MesherHelper* _helper;
size_t CellIndex( size_t i, size_t j, size_t k ) const
{
void SetCoordinates(const vector<double>& xCoords,
const vector<double>& yCoords,
const vector<double>& zCoords,
- const TopoDS_Shape& shape );
+ const double* axesDirs,
+ const Bnd_Box& bndBox );
+ void ComputeUVW(const gp_XYZ& p, double uvw[3]);
void ComputeNodes(SMESH_MesherHelper& helper);
};
#ifdef ELLIPSOLID_WORKAROUND
struct FaceGridIntersector
{
TopoDS_Face _face;
+ TGeomID _faceID;
Grid* _grid;
Bnd_Box _bndBox;
__IntCurvesFace_Intersector* _surfaceInt;
- vector< std::pair< GridLine*, IntersectionPoint > > _intersections;
+ vector< std::pair< GridLine*, F_IntersectPoint > > _intersections;
FaceGridIntersector(): _grid(0), _surfaceInt(0) {}
void Intersect();
void StoreIntersections()
{
for ( size_t i = 0; i < _intersections.size(); ++i )
- _intersections[i].first->_intPoints.insert( _intersections[i].second );
+ {
+ multiset< F_IntersectPoint >::iterator ip =
+ _intersections[i].first->_intPoints.insert( _intersections[i].second );
+ ip->_faceIDs.reserve( 1 );
+ ip->_faceIDs.push_back( _faceID );
+ }
}
const Bnd_Box& GetFaceBndBox()
{
gp_Torus _torus;
__IntCurvesFace_Intersector* _surfaceInt;
- vector< IntersectionPoint > _intPoints;
+ vector< F_IntersectPoint > _intPoints;
void IntersectWithPlane (const GridLine& gridLine);
void IntersectWithCylinder(const GridLine& gridLine);
struct _Face;
struct _Link;
// --------------------------------------------------------------------------------
- struct _Node //!< node either at a hexahedron corner or at GridLine intersection
+ struct _Node //!< node either at a hexahedron corner or at intersection
{
- const SMDS_MeshNode* _node; // mesh node at hexahedron corner
- const IntersectionPoint* _intPoint;
-
- _Node(const SMDS_MeshNode* n=0, const IntersectionPoint* ip=0):_node(n), _intPoint(ip) {}
- const SMDS_MeshNode* Node() const { return _intPoint ? _intPoint->_node : _node; }
- //bool IsCorner() const { return _node; }
+ const SMDS_MeshNode* _node; // mesh node at hexahedron corner
+ const B_IntersectPoint* _intPoint;
+ const _Face* _usedInFace;
+
+ _Node(const SMDS_MeshNode* n=0, const B_IntersectPoint* ip=0)
+ :_node(n), _intPoint(ip), _usedInFace(0) {}
+ const SMDS_MeshNode* Node() const
+ { return ( _intPoint && _intPoint->_node ) ? _intPoint->_node : _node; }
+ //const F_IntersectPoint* FaceIntPnt() const
+ //{ return static_cast< const F_IntersectPoint* >( _intPoint ); }
+ const E_IntersectPoint* EdgeIntPnt() const
+ { return static_cast< const E_IntersectPoint* >( _intPoint ); }
+ bool IsUsedInFace( const _Face* polygon = 0 )
+ {
+ return polygon ? ( _usedInFace == polygon ) : bool( _usedInFace );
+ }
+ void Add( const E_IntersectPoint* ip )
+ {
+ if ( !_intPoint ) {
+ _intPoint = ip;
+ }
+ else if ( !_intPoint->_node ) {
+ ip->Add( _intPoint->_faceIDs );
+ _intPoint = ip;
+ }
+ else {
+ _intPoint->Add( ip->_faceIDs );
+ }
+ }
+ int IsLinked( const B_IntersectPoint* other,
+ int avoidFace=-1 ) const // returns id of a common face
+ {
+ return _intPoint ? _intPoint->HasCommonFace( other, avoidFace ) : 0;
+ }
+ bool IsOnFace( int faceID ) const // returns true if faceID is found
+ {
+ return _intPoint ? _intPoint->IsOnFace( faceID ) : false;
+ }
+ gp_Pnt Point() const
+ {
+ if ( const SMDS_MeshNode* n = Node() )
+ return SMESH_TNodeXYZ( n );
+ if ( const E_IntersectPoint* eip =
+ dynamic_cast< const E_IntersectPoint* >( _intPoint ))
+ return eip->_point;
+ return gp_Pnt( 1e100, 0, 0 );
+ }
};
// --------------------------------------------------------------------------------
struct _Link // link connecting two _Node's
{
_Node* _nodes[2];
- vector< _Node> _intNodes; // _Node's at GridLine intersections
- vector< _Link > _splits;
- vector< _Face*> _faces;
+ _Face* _faces[2]; // polygons sharing a link
+ vector< const F_IntersectPoint* > _fIntPoints; // GridLine intersections with FACEs
+ vector< _Node* > _fIntNodes; // _Node's at _fIntPoints
+ vector< _Link > _splits;
+ _Link() { _faces[0] = 0; }
};
// --------------------------------------------------------------------------------
struct _OrientedLink
return _OrientedLink(&_link->_splits[_reverse ? NbResultLinks()-i-1 : i],_reverse);
}
_Node* FirstNode() const { return _link->_nodes[ _reverse ]; }
- _Node* LastNode() const { return _link->_nodes[ !_reverse ]; }
+ _Node* LastNode() const { return _link->_nodes[ !_reverse ]; }
+ operator bool() const { return _link; }
+ vector< TGeomID > GetNotUsedFace(const set<TGeomID>& usedIDs ) const // returns supporting FACEs
+ {
+ vector< TGeomID > faces;
+ const B_IntersectPoint *ip0, *ip1;
+ if (( ip0 = _link->_nodes[0]->_intPoint ) &&
+ ( ip1 = _link->_nodes[1]->_intPoint ))
+ {
+ for ( size_t i = 0; i < ip0->_faceIDs.size(); ++i )
+ if ( ip1->IsOnFace ( ip0->_faceIDs[i] ) &&
+ !usedIDs.count( ip0->_faceIDs[i] ) )
+ faces.push_back( ip0->_faceIDs[i] );
+ }
+ return faces;
+ }
+ bool HasEdgeNodes() const
+ {
+ return ( dynamic_cast< const E_IntersectPoint* >( _link->_nodes[0]->_intPoint ) ||
+ dynamic_cast< const E_IntersectPoint* >( _link->_nodes[1]->_intPoint ));
+ }
+ int NbFaces() const
+ {
+ return !_link->_faces[0] ? 0 : 1 + bool( _link->_faces[1] );
+ }
+ void AddFace( _Face* f )
+ {
+ if ( _link->_faces[0] )
+ {
+ _link->_faces[1] = f;
+ }
+ else
+ {
+ _link->_faces[0] = f;
+ _link->_faces[1] = 0;
+ }
+ }
+ void RemoveFace( _Face* f )
+ {
+ if ( !_link->_faces[0] ) return;
+
+ if ( _link->_faces[1] == f )
+ {
+ _link->_faces[1] = 0;
+ }
+ else if ( _link->_faces[0] == f )
+ {
+ _link->_faces[0];
+ if ( _link->_faces[1] )
+ {
+ _link->_faces[0] = _link->_faces[1];
+ _link->_faces[1] = 0;
+ }
+ }
+ }
};
// --------------------------------------------------------------------------------
struct _Face
{
- vector< _OrientedLink > _links;
- vector< _Link > _polyLinks; // links added to close a polygonal face
+ vector< _OrientedLink > _links; // links on GridLine's
+ vector< _Link > _polyLinks; // links added to close a polygonal face
+ vector< _Node* > _eIntNodes; // nodes at intersection with EDGEs
+ bool isPolyLink( const _OrientedLink& ol )
+ {
+ return _polyLinks.empty() ? false :
+ ( &_polyLinks[0] <= ol._link && ol._link <= &_polyLinks.back() );
+ }
};
// --------------------------------------------------------------------------------
struct _volumeDef // holder of nodes of a volume mesh element
{
- vector< const SMDS_MeshNode* > _nodes;
- vector< int > _quantities;
+ vector< _Node* > _nodes;
+ vector< int > _quantities;
typedef boost::shared_ptr<_volumeDef> Ptr;
- void set( const vector< const SMDS_MeshNode* >& nodes,
- const vector< int > quant = vector< int >() )
+ void set( const vector< _Node* >& nodes,
+ const vector< int >& quant = vector< int >() )
{ _nodes = nodes; _quantities = quant; }
- // static Ptr New( const vector< const SMDS_MeshNode* >& nodes,
- // const vector< int > quant = vector< int >() )
- // {
- // _volumeDef* def = new _volumeDef;
- // def->_nodes = nodes;
- // def->_quantities = quant;
- // return Ptr( def );
- // }
};
// topology of a hexahedron
int _nodeShift[8];
- _Node _hexNodes[8];
- _Link _hexLinks[12];
- _Face _hexQuads[6];
+ _Node _hexNodes [8];
+ _Link _hexLinks [12];
+ _Face _hexQuads [6];
// faces resulted from hexahedron intersection
vector< _Face > _polygons;
+ // intresections with EDGEs
+ vector< const E_IntersectPoint* > _eIntPoints;
+
+ // additional nodes created at intersection points
+ vector< _Node > _intNodes;
+
+ // nodes inside the hexahedron (at VERTEXes)
+ vector< _Node* > _vIntNodes;
+
// computed volume elements
//vector< _volumeDef::Ptr > _volumeDefs;
_volumeDef _volumeDefs;
Grid* _grid;
double _sizeThreshold, _sideLength[3];
- int _nbCornerNodes, _nbIntNodes, _nbBndNodes;
+ int _nbCornerNodes, _nbFaceIntNodes, _nbBndNodes;
int _origNodeInd; // index of _hexNodes[0] node within the _grid
size_t _i,_j,_k;
public:
Hexahedron(const double sizeThreshold, Grid* grid);
- int MakeElements(SMESH_MesherHelper& helper);
+ int MakeElements(SMESH_MesherHelper& helper,
+ const map< TGeomID, vector< TGeomID > >& edge2faceIDsMap);
void ComputeElements();
void Init() { init( _i, _j, _k ); }
Hexahedron(const Hexahedron& other );
void init( size_t i, size_t j, size_t k );
void init( size_t i );
+ void addEdges(SMESH_MesherHelper& helper,
+ vector< Hexahedron* >& intersectedHex,
+ const map< TGeomID, vector< TGeomID > >& edge2faceIDsMap);
+ gp_Pnt findIntPoint( double u1, double proj1, double u2, double proj2,
+ double proj, BRepAdaptor_Curve& curve,
+ const gp_XYZ& axis, const gp_XYZ& origin );
+ int getEntity( const E_IntersectPoint* ip, int* facets, int& sub );
+ bool addIntersection( const E_IntersectPoint& ip,
+ vector< Hexahedron* >& hexes,
+ int ijk[], int dIJK[] );
+ bool findChain( _Node* n1, _Node* n2, _Face& quad, vector<_Node*>& chainNodes );
+ bool closePolygon( _Face* polygon, vector<_Node*>& chainNodes ) const;
int addElements(SMESH_MesherHelper& helper);
+ bool is1stNodeOut( _Link& link ) const;
bool isInHole() const;
bool checkPolyhedronSize() const;
bool addHexa ();
bool addTetra();
bool addPenta();
bool addPyra ();
+ bool debugDumpLink( _Link* link );
+ _Node* FindEqualNode( vector< _Node* >& nodes,
+ const E_IntersectPoint* ip,
+ const double tol2 )
+ {
+ for ( size_t i = 0; i < nodes.size(); ++i )
+ if ( nodes[i]->EdgeIntPnt() == ip ||
+ nodes[i]->Point().SquareDistance( ip->_point ) <= tol2 )
+ return nodes[i];
+ return 0;
+ }
};
-
+
#ifdef WITH_TBB
// --------------------------------------------------------------------------
/*!
_faceVec[i].Intersect();
}
};
-
#endif
+
//=============================================================================
// Implementation of internal utils
//=============================================================================
+ /*!
+ * \brief adjust \a i to have \a val between values[i] and values[i+1]
+ */
+ inline void locateValue( int & i, double val, const vector<double>& values,
+ int& di, double tol )
+ {
+ //val += values[0]; // input \a val is measured from 0.
+ if ( i > values.size()-2 )
+ i = values.size()-2;
+ else
+ while ( i+2 < values.size() && val > values[ i+1 ])
+ ++i;
+ while ( i > 0 && val < values[ i ])
+ --i;
+
+ if ( i > 0 && val - values[ i ] < tol )
+ di = -1;
+ else if ( i+2 < values.size() && values[ i+1 ] - val < tol )
+ di = 1;
+ else
+ di = 0;
+ }
+ //=============================================================================
/*
* Remove coincident intersection points
*/
if ( _intPoints.size() < 2 ) return;
set< Transition > tranSet;
- multiset< IntersectionPoint >::iterator ip1, ip2 = _intPoints.begin();
+ multiset< F_IntersectPoint >::iterator ip1, ip2 = _intPoints.begin();
while ( ip2 != _intPoints.end() )
{
tranSet.clear();
ip1 = ip2++;
- while ( ip2->_paramOnLine - ip1->_paramOnLine <= tol && ip2 != _intPoints.end())
+ while ( ip2 != _intPoints.end() && ip2->_paramOnLine - ip1->_paramOnLine <= tol )
{
tranSet.insert( ip1->_transition );
tranSet.insert( ip2->_transition );
+ ip2->Add( ip1->_faceIDs );
_intPoints.erase( ip1 );
ip1 = ip2++;
}
/*
* Return "is OUT" state for nodes before the given intersection point
*/
- bool GridLine::GetIsOutBefore( multiset< IntersectionPoint >::iterator ip, bool prevIsOut )
+ bool GridLine::GetIsOutBefore( multiset< F_IntersectPoint >::iterator ip, bool prevIsOut )
{
if ( ip->_transition == Trans_IN )
return true;
// singularity point (apex of a cone)
if ( _intPoints.size() == 1 || ip == _intPoints.begin() )
return true;
- multiset< IntersectionPoint >::iterator ipBef = ip, ipAft = ++ip;
+ multiset< F_IntersectPoint >::iterator ipBef = ip, ipAft = ++ip;
if ( ipAft == _intPoints.end() )
return false;
--ipBef;
return ( ipBef->_transition == Trans_OUT );
return ( ipBef->_transition != Trans_OUT );
}
- return prevIsOut; // _transition == Trans_TANGENT
+ // _transition == Trans_TANGENT
+ return !prevIsOut;
+ }
+ //================================================================================
+ /*
+ * Adds face IDs
+ */
+ void B_IntersectPoint::Add( const vector< TGeomID >& fIDs,
+ const SMDS_MeshNode* n) const
+ {
+ if ( _faceIDs.empty() )
+ _faceIDs = fIDs;
+ else
+ for ( size_t i = 0; i < fIDs.size(); ++i )
+ {
+ vector< TGeomID >::iterator it =
+ std::find( _faceIDs.begin(), _faceIDs.end(), fIDs[i] );
+ if ( it == _faceIDs.end() )
+ _faceIDs.push_back( fIDs[i] );
+ }
+ if ( !_node )
+ _node = n;
+ }
+ //================================================================================
+ /*
+ * Returns index of a common face if any, else zero
+ */
+ int B_IntersectPoint::HasCommonFace( const B_IntersectPoint * other, int avoidFace ) const
+ {
+ if ( other )
+ for ( size_t i = 0; i < other->_faceIDs.size(); ++i )
+ if ( avoidFace != other->_faceIDs[i] &&
+ IsOnFace ( other->_faceIDs[i] ))
+ return other->_faceIDs[i];
+ return 0;
+ }
+ //================================================================================
+ /*
+ * Returns \c true if \a faceID in in this->_faceIDs
+ */
+ bool B_IntersectPoint::IsOnFace( int faceID ) const // returns true if faceID is found
+ {
+ vector< TGeomID >::const_iterator it =
+ std::find( _faceIDs.begin(), _faceIDs.end(), faceID );
+ return ( it != _faceIDs.end() );
}
//================================================================================
/*
LineIndexer Grid::GetLineIndexer(size_t iDir) const
{
const size_t indices[] = { 1,2,0, 0,2,1, 0,1,2 };
- const string s[] = { "X", "Y", "Z" };
+ const string s [] = { "X", "Y", "Z" };
LineIndexer li( _coords[0].size(), _coords[1].size(), _coords[2].size(),
indices[iDir*3], indices[iDir*3+1], indices[iDir*3+2],
s[indices[iDir*3]], s[indices[iDir*3+1]], s[indices[iDir*3+2]]);
void Grid::SetCoordinates(const vector<double>& xCoords,
const vector<double>& yCoords,
const vector<double>& zCoords,
- const TopoDS_Shape& shape)
+ const double* axesDirs,
+ const Bnd_Box& shapeBox)
{
_coords[0] = xCoords;
_coords[1] = yCoords;
_coords[2] = zCoords;
+ _axes[0].SetCoord( axesDirs[0],
+ axesDirs[1],
+ axesDirs[2]);
+ _axes[1].SetCoord( axesDirs[3],
+ axesDirs[4],
+ axesDirs[5]);
+ _axes[2].SetCoord( axesDirs[6],
+ axesDirs[7],
+ axesDirs[8]);
+ _axes[0].Normalize();
+ _axes[1].Normalize();
+ _axes[2].Normalize();
+
+ _invB.SetCols( _axes[0], _axes[1], _axes[2] );
+ _invB.Invert();
+
+ // _isOrthogonalAxes = ( Abs( _axes[0] * _axes[1] ) < 1e-20 &&
+ // Abs( _axes[1] * _axes[2] ) < 1e-20 &&
+ // Abs( _axes[2] * _axes[0] ) < 1e-20 );
+
// compute tolerance
_minCellSize = Precision::Infinite();
for ( int iDir = 0; iDir < 3; ++iDir ) // loop on 3 line directions
}
if ( _minCellSize < Precision::Confusion() )
throw SMESH_ComputeError (COMPERR_ALGO_FAILED,
- SMESH_Comment("Too small cell size: ") << _tol );
+ SMESH_Comment("Too small cell size: ") << _minCellSize );
_tol = _minCellSize / 1000.;
- // attune grid extremities to shape bounding box computed by vertices
- Bnd_Box shapeBox;
- for ( TopExp_Explorer vExp( shape, TopAbs_VERTEX ); vExp.More(); vExp.Next() )
- shapeBox.Add( BRep_Tool::Pnt( TopoDS::Vertex( vExp.Current() )));
-
+ // attune grid extremities to shape bounding box
+
double sP[6]; // aXmin, aYmin, aZmin, aXmax, aYmax, aZmax
shapeBox.Get(sP[0],sP[1],sP[2],sP[3],sP[4],sP[5]);
double* cP[6] = { &_coords[0].front(), &_coords[1].front(), &_coords[2].front(),
&_coords[0].back(), &_coords[1].back(), &_coords[2].back() };
for ( int i = 0; i < 6; ++i )
if ( fabs( sP[i] - *cP[i] ) < _tol )
- *cP[i] = sP[i] + _tol/1000. * ( i < 3 ? +1 : -1 );
+ *cP[i] = sP[i];// + _tol/1000. * ( i < 3 ? +1 : -1 );
+
+ for ( int iDir = 0; iDir < 3; ++iDir )
+ {
+ if ( _coords[iDir][0] - sP[iDir] > _tol )
+ {
+ _minCellSize = Min( _minCellSize, _coords[iDir][0] - sP[iDir] );
+ _coords[iDir].insert( _coords[iDir].begin(), sP[iDir] + _tol/1000.);
+ }
+ if ( sP[iDir+3] - _coords[iDir].back() > _tol )
+ {
+ _minCellSize = Min( _minCellSize, sP[iDir+3] - _coords[iDir].back() );
+ _coords[iDir].push_back( sP[iDir+3] - _tol/1000.);
+ }
+ }
+ _tol = _minCellSize / 1000.;
+
+ _origin = ( _coords[0][0] * _axes[0] +
+ _coords[1][0] * _axes[1] +
+ _coords[2][0] * _axes[2] );
// create lines
for ( int iDir = 0; iDir < 3; ++iDir ) // loop on 3 line directions
LineIndexer li = GetLineIndexer( iDir );
_lines[iDir].resize( li.NbLines() );
double len = _coords[ iDir ].back() - _coords[iDir].front();
- gp_Vec dir( iDir==0, iDir==1, iDir==2 );
for ( ; li.More(); ++li )
{
GridLine& gl = _lines[iDir][ li.LineIndex() ];
- gl._line.SetLocation(gp_Pnt(_coords[0][li.I()], _coords[1][li.J()], _coords[2][li.K()]));
- gl._line.SetDirection( dir );
+ gl._line.SetLocation( _coords[0][li.I()] * _axes[0] +
+ _coords[1][li.J()] * _axes[1] +
+ _coords[2][li.K()] * _axes[2] );
+ gl._line.SetDirection( _axes[ iDir ]);
gl._length = len;
}
}
}
//================================================================================
+ /*
+ * Computes coordinates of a point in the grid CS
+ */
+ void Grid::ComputeUVW(const gp_XYZ& P, double UVW[3])
+ {
+ // gp_XYZ p = P - _origin;
+ // UVW[ 0 ] = p.X() * _invB( 1, 1 ) + p.Y() * _invB( 1, 2 ) + p.Z() * _invB( 1, 3 );
+ // UVW[ 1 ] = p.X() * _invB( 2, 1 ) + p.Y() * _invB( 2, 2 ) + p.Z() * _invB( 2, 3 );
+ // UVW[ 2 ] = p.X() * _invB( 3, 1 ) + p.Y() * _invB( 3, 2 ) + p.Z() * _invB( 3, 3 );
+ // UVW[ 0 ] += _coords[0][0];
+ // UVW[ 1 ] += _coords[1][0];
+ // UVW[ 2 ] += _coords[2][0];
+ gp_XYZ p = P * _invB;
+ p.Coord( UVW[0], UVW[1], UVW[2] );
+ }
+ //================================================================================
/*
* Creates all nodes
*/
const size_t nbGridNodes = _coords[0].size() * _coords[1].size() * _coords[2].size();
vector< bool > isNodeOut( nbGridNodes, false );
_nodes.resize( nbGridNodes, 0 );
- _isBndNode.resize( nbGridNodes, false );
+ _gridIntP.resize( nbGridNodes, NULL );
for ( int iDir = 0; iDir < 3; ++iDir ) // loop on 3 line directions
{
nIndex0 = NodeIndex( li.I(), li.J(), li.K() );
GridLine& line = _lines[ iDir ][ li.LineIndex() ];
+ const gp_XYZ lineLoc = line._line.Location().XYZ();
+ const gp_XYZ lineDir = line._line.Direction().XYZ();
line.RemoveExcessIntPoints( _tol );
- multiset< IntersectionPoint >& intPnts = _lines[ iDir ][ li.LineIndex() ]._intPoints;
- multiset< IntersectionPoint >::iterator ip = intPnts.begin();
+ multiset< F_IntersectPoint >& intPnts = _lines[ iDir ][ li.LineIndex() ]._intPoints;
+ multiset< F_IntersectPoint >::iterator ip = intPnts.begin();
bool isOut = true;
- const double* nodeCoord = & coords[0], *coord0 = nodeCoord, *coordEnd = coord0 + coords.size();
+ const double* nodeCoord = & coords[0];
+ const double* coord0 = nodeCoord;
+ const double* coordEnd = coord0 + coords.size();
double nodeParam = 0;
for ( ; ip != intPnts.end(); ++ip )
{
// create a mesh node on a GridLine at ip if it does not coincide with a grid node
if ( nodeParam > ip->_paramOnLine + _tol )
{
- li.SetIndexOnLine( 0 );
- double xyz[3] = { _coords[0][ li.I() ], _coords[1][ li.J() ], _coords[2][ li.K() ]};
- xyz[ li._iConst ] += ip->_paramOnLine;
- ip->_node = helper.AddNode( xyz[0], xyz[1], xyz[2] );
+ // li.SetIndexOnLine( 0 );
+ // double xyz[3] = { _coords[0][ li.I() ], _coords[1][ li.J() ], _coords[2][ li.K() ]};
+ // xyz[ li._iConst ] += ip->_paramOnLine;
+ gp_XYZ xyz = lineLoc + ip->_paramOnLine * lineDir;
+ ip->_node = helper.AddNode( xyz.X(), xyz.Y(), xyz.Z() );
ip->_indexOnLine = nodeCoord-coord0-1;
}
// create a mesh node at ip concident with a grid node
else
{
int nodeIndex = nIndex0 + nShift * ( nodeCoord-coord0 );
- if ( ! _nodes[ nodeIndex ] )
+ if ( !_nodes[ nodeIndex ] )
{
- li.SetIndexOnLine( nodeCoord-coord0 );
- double xyz[3] = { _coords[0][ li.I() ], _coords[1][ li.J() ], _coords[2][ li.K() ]};
- _nodes[ nodeIndex ] = helper.AddNode( xyz[0], xyz[1], xyz[2] );
- _isBndNode[ nodeIndex ] = true;
+ //li.SetIndexOnLine( nodeCoord-coord0 );
+ //double xyz[3] = { _coords[0][ li.I() ], _coords[1][ li.J() ], _coords[2][ li.K() ]};
+ gp_XYZ xyz = lineLoc + nodeParam * lineDir;
+ _nodes [ nodeIndex ] = helper.AddNode( xyz.X(), xyz.Y(), xyz.Z() );
+ _gridIntP[ nodeIndex ] = & * ip;
}
- //ip->_node = _nodes[ nodeIndex ];
+ if ( _gridIntP[ nodeIndex ] )
+ _gridIntP[ nodeIndex ]->Add( ip->_faceIDs );
+ else
+ _gridIntP[ nodeIndex ] = & * ip;
+ // ip->_node = _nodes[ nodeIndex ]; -- to differ from ip on links
ip->_indexOnLine = nodeCoord-coord0;
if ( ++nodeCoord < coordEnd )
nodeParam = *nodeCoord - *coord0;
{
size_t nodeIndex = NodeIndex( x, y, z );
if ( !isNodeOut[ nodeIndex ] && !_nodes[ nodeIndex] )
- _nodes[ nodeIndex ] = helper.AddNode( _coords[0][x], _coords[1][y], _coords[2][z] );
+ {
+ //_nodes[ nodeIndex ] = helper.AddNode( _coords[0][x], _coords[1][y], _coords[2][z] );
+ gp_XYZ xyz = ( _coords[0][x] * _axes[0] +
+ _coords[1][y] * _axes[1] +
+ _coords[2][z] * _axes[2] );
+ _nodes[ nodeIndex ] = helper.AddNode( xyz.X(), xyz.Y(), xyz.Z() );
+ }
}
#ifdef _MY_DEBUG_
LineIndexer li = GetLineIndexer( iDir );
for ( ; li.More(); ++li )
{
- multiset< IntersectionPoint >& intPnts = _lines[ iDir ][ li.LineIndex() ]._intPoints;
+ multiset< F_IntersectPoint >& intPnts = _lines[ iDir ][ li.LineIndex() ]._intPoints;
if ( intPnts.empty() ) continue;
if ( intPnts.size() == 1 )
{
*/
bool FaceGridIntersector::IsInGrid(const Bnd_Box& gridBox)
{
- double x0,y0,z0, x1,y1,z1;
- const Bnd_Box& faceBox = GetFaceBndBox();
- faceBox.Get(x0,y0,z0, x1,y1,z1);
-
- if ( !gridBox.IsOut( gp_Pnt( x0,y0,z0 )) &&
- !gridBox.IsOut( gp_Pnt( x1,y1,z1 )))
- return true;
-
- double X0,Y0,Z0, X1,Y1,Z1;
- gridBox.Get(X0,Y0,Z0, X1,Y1,Z1);
- double faceP[6] = { x0,y0,z0, x1,y1,z1 };
- double gridP[6] = { X0,Y0,Z0, X1,Y1,Z1 };
- gp_Dir axes[3] = { gp::DX(), gp::DY(), gp::DZ() };
- for ( int iDir = 0; iDir < 6; ++iDir )
- {
- if ( iDir < 3 && gridP[ iDir ] <= faceP[ iDir ] ) continue;
- if ( iDir >= 3 && gridP[ iDir ] >= faceP[ iDir ] ) continue;
-
- // check if the face intersects a side of a gridBox
-
- gp_Pnt p = iDir < 3 ? gp_Pnt( X0,Y0,Z0 ) : gp_Pnt( X1,Y1,Z1 );
- gp_Ax1 norm( p, axes[ iDir % 3 ] );
- if ( iDir < 3 ) norm.Reverse();
-
- gp_XYZ O = norm.Location().XYZ(), N = norm.Direction().XYZ();
-
- TopLoc_Location loc = _face.Location();
- Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(_face,loc);
- if ( !aPoly.IsNull() )
- {
- if ( !loc.IsIdentity() )
- {
- norm.Transform( loc.Transformation().Inverted() );
- O = norm.Location().XYZ(), N = norm.Direction().XYZ();
- }
- const double deflection = aPoly->Deflection();
-
- const TColgp_Array1OfPnt& nodes = aPoly->Nodes();
- for ( int i = nodes.Lower(); i <= nodes.Upper(); ++i )
- if (( nodes( i ).XYZ() - O ) * N > _grid->_tol + deflection )
- return false;
- }
- else
- {
- BRepAdaptor_Surface surf( _face );
- double u0, u1, v0, v1, du, dv, u, v;
- BRepTools::UVBounds( _face, u0, u1, v0, v1);
- if ( surf.GetType() == GeomAbs_Plane ) {
- du = u1 - u0, dv = v1 - v0;
- }
- else {
- du = surf.UResolution( _grid->_minCellSize / 10. );
- dv = surf.VResolution( _grid->_minCellSize / 10. );
- }
- for ( u = u0, v = v0; u <= u1 && v <= v1; u += du, v += dv )
- {
- gp_Pnt p = surf.Value( u, v );
- if (( p.XYZ() - O ) * N > _grid->_tol )
- {
- TopAbs_State state = GetCurveFaceIntersector()->ClassifyUVPoint(gp_Pnt2d( u, v ));
- if ( state == TopAbs_IN || state == TopAbs_ON )
- return false;
- }
- }
- }
- }
+ // double x0,y0,z0, x1,y1,z1;
+ // const Bnd_Box& faceBox = GetFaceBndBox();
+ // faceBox.Get(x0,y0,z0, x1,y1,z1);
+
+ // if ( !gridBox.IsOut( gp_Pnt( x0,y0,z0 )) &&
+ // !gridBox.IsOut( gp_Pnt( x1,y1,z1 )))
+ // return true;
+
+ // double X0,Y0,Z0, X1,Y1,Z1;
+ // gridBox.Get(X0,Y0,Z0, X1,Y1,Z1);
+ // double faceP[6] = { x0,y0,z0, x1,y1,z1 };
+ // double gridP[6] = { X0,Y0,Z0, X1,Y1,Z1 };
+ // gp_Dir axes[3] = { gp::DX(), gp::DY(), gp::DZ() };
+ // for ( int iDir = 0; iDir < 6; ++iDir )
+ // {
+ // if ( iDir < 3 && gridP[ iDir ] <= faceP[ iDir ] ) continue;
+ // if ( iDir >= 3 && gridP[ iDir ] >= faceP[ iDir ] ) continue;
+
+ // // check if the face intersects a side of a gridBox
+
+ // gp_Pnt p = iDir < 3 ? gp_Pnt( X0,Y0,Z0 ) : gp_Pnt( X1,Y1,Z1 );
+ // gp_Ax1 norm( p, axes[ iDir % 3 ] );
+ // if ( iDir < 3 ) norm.Reverse();
+
+ // gp_XYZ O = norm.Location().XYZ(), N = norm.Direction().XYZ();
+
+ // TopLoc_Location loc = _face.Location();
+ // Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(_face,loc);
+ // if ( !aPoly.IsNull() )
+ // {
+ // if ( !loc.IsIdentity() )
+ // {
+ // norm.Transform( loc.Transformation().Inverted() );
+ // O = norm.Location().XYZ(), N = norm.Direction().XYZ();
+ // }
+ // const double deflection = aPoly->Deflection();
+
+ // const TColgp_Array1OfPnt& nodes = aPoly->Nodes();
+ // for ( int i = nodes.Lower(); i <= nodes.Upper(); ++i )
+ // if (( nodes( i ).XYZ() - O ) * N > _grid->_tol + deflection )
+ // return false;
+ // }
+ // else
+ // {
+ // BRepAdaptor_Surface surf( _face );
+ // double u0, u1, v0, v1, du, dv, u, v;
+ // BRepTools::UVBounds( _face, u0, u1, v0, v1);
+ // if ( surf.GetType() == GeomAbs_Plane ) {
+ // du = u1 - u0, dv = v1 - v0;
+ // }
+ // else {
+ // du = surf.UResolution( _grid->_minCellSize / 10. );
+ // dv = surf.VResolution( _grid->_minCellSize / 10. );
+ // }
+ // for ( u = u0, v = v0; u <= u1 && v <= v1; u += du, v += dv )
+ // {
+ // gp_Pnt p = surf.Value( u, v );
+ // if (( p.XYZ() - O ) * N > _grid->_tol )
+ // {
+ // TopAbs_State state = GetCurveFaceIntersector()->ClassifyUVPoint(gp_Pnt2d( u, v ));
+ // if ( state == TopAbs_IN || state == TopAbs_ON )
+ // return false;
+ // }
+ // }
+ // }
+ // }
return true;
}
//=============================================================================
if ( _bndBox.IsOut( gridLine._line )) continue;
intersector._intPoints.clear();
- (intersector.*interFunction)( gridLine );
+ (intersector.*interFunction)( gridLine ); // <- intersection with gridLine
for ( size_t i = 0; i < intersector._intPoints.size(); ++i )
_intersections.push_back( make_pair( &gridLine, intersector._intPoints[i] ));
}
{
if ( !toClassify || UVIsOnFace() )
{
- IntersectionPoint p;
+ F_IntersectPoint p;
p._paramOnLine = _w;
p._transition = _transition;
_intPoints.push_back( p );
*/
void FaceLineIntersector::IntersectWithCylinder(const GridLine& gridLine)
{
- IntAna_IntConicQuad linCylinder( gridLine._line,_cylinder);
+ IntAna_IntConicQuad linCylinder( gridLine._line, _cylinder );
if ( linCylinder.IsDone() && linCylinder.NbPoints() > 0 )
{
_w = linCylinder.ParamOnConic(1);
* \brief Creates topology of the hexahedron
*/
Hexahedron::Hexahedron(const double sizeThreshold, Grid* grid)
- : _grid( grid ), _sizeThreshold( sizeThreshold ), _nbIntNodes(0)
+ : _grid( grid ), _sizeThreshold( sizeThreshold ), _nbFaceIntNodes(0)
{
_polygons.reserve(100); // to avoid reallocation;
_Link& link = _hexLinks[ SMESH_Block::ShapeIndex( linkID )];
link._nodes[0] = &_hexNodes[ SMESH_Block::ShapeIndex( idVec[0] )];
link._nodes[1] = &_hexNodes[ SMESH_Block::ShapeIndex( idVec[1] )];
- link._intNodes.reserve( 10 ); // to avoid reallocation
- link._splits.reserve( 10 );
}
// set links to faces
* \brief Copy constructor
*/
Hexahedron::Hexahedron( const Hexahedron& other )
- :_grid( other._grid ), _sizeThreshold( other._sizeThreshold ), _nbIntNodes(0)
+ :_grid( other._grid ), _sizeThreshold( other._sizeThreshold ), _nbFaceIntNodes(0)
{
_polygons.reserve(100); // to avoid reallocation;
_Link& tgtLink = this->_hexLinks[ i ];
tgtLink._nodes[0] = _hexNodes + ( srcLink._nodes[0] - other._hexNodes );
tgtLink._nodes[1] = _hexNodes + ( srcLink._nodes[1] - other._hexNodes );
- tgtLink._intNodes.reserve( 10 ); // to avoid reallocation
- tgtLink._splits.reserve( 10 );
}
for ( int i = 0; i < 6; ++i )
_origNodeInd = _grid->NodeIndex( i,j,k );
for ( int iN = 0; iN < 8; ++iN )
{
- _hexNodes[iN]._node = _grid->_nodes[ _origNodeInd + _nodeShift[iN] ];
+ _hexNodes[iN]._node = _grid->_nodes [ _origNodeInd + _nodeShift[iN] ];
+ _hexNodes[iN]._intPoint = _grid->_gridIntP[ _origNodeInd + _nodeShift[iN] ];
_nbCornerNodes += bool( _hexNodes[iN]._node );
- _nbBndNodes += _grid->_isBndNode[ _origNodeInd + _nodeShift[iN] ];
+ _nbBndNodes += bool( _hexNodes[iN]._intPoint );
}
_sideLength[0] = _grid->_coords[0][i+1] - _grid->_coords[0][i];
_sideLength[1] = _grid->_coords[1][j+1] - _grid->_coords[1][j];
_sideLength[2] = _grid->_coords[2][k+1] - _grid->_coords[2][k];
- if ( _nbCornerNodes < 8 && _nbIntNodes + _nbCornerNodes > 3)
+ _intNodes.clear();
+ _vIntNodes.clear();
+
+ if ( _nbFaceIntNodes + _eIntPoints.size() > 0 &&
+ _nbFaceIntNodes + _nbCornerNodes + _eIntPoints.size() > 3)
{
+ _intNodes.reserve( 3 * _nbBndNodes + _nbFaceIntNodes + _eIntPoints.size() );
+
_Link split;
- // create sub-links (_splits) by splitting links with _intNodes
+ // create sub-links (_splits) by splitting links with _fIntPoints
for ( int iLink = 0; iLink < 12; ++iLink )
{
_Link& link = _hexLinks[ iLink ];
+ link._fIntNodes.resize( link._fIntPoints.size() );
+ for ( size_t i = 0; i < link._fIntPoints.size(); ++i )
+ {
+ _intNodes.push_back( _Node( 0, link._fIntPoints[i] ));
+ link._fIntNodes[ i ] = & _intNodes.back();
+ }
+
link._splits.clear();
split._nodes[ 0 ] = link._nodes[0];
- for ( size_t i = 0; i < link._intNodes.size(); ++ i )
+ bool isOut = ( ! link._nodes[0]->Node() ); // is1stNodeOut( iLink );
+ bool checkTransition;
+ for ( size_t i = 0; i < link._fIntNodes.size(); ++i )
+ {
+ if ( link._fIntNodes[i]->Node() ) // intersection non-coinsident with a grid node
+ {
+ if ( split._nodes[ 0 ]->Node() && !isOut )
+ {
+ split._nodes[ 1 ] = link._fIntNodes[i];
+ link._splits.push_back( split );
+ }
+ split._nodes[ 0 ] = link._fIntNodes[i];
+ checkTransition = true;
+ }
+ else // FACE intersection coinsident with a grid node
+ {
+ checkTransition = ( link._nodes[0]->Node() );
+ }
+ if ( checkTransition )
+ {
+ switch ( link._fIntPoints[i]->_transition ) {
+ case Trans_OUT: isOut = true; break;
+ case Trans_IN : isOut = false; break;
+ default:
+ if ( !link._fIntNodes[i]->Node() && i == 0 )
+ isOut = is1stNodeOut( link );
+ else
+ ; // isOut remains the same
+ }
+ }
+ }
+ if ( link._nodes[ 1 ]->Node() && split._nodes[ 0 ]->Node() && !isOut )
+ {
+ split._nodes[ 1 ] = link._nodes[1];
+ link._splits.push_back( split );
+ }
+ }
+
+ // Create _Node's at intersections with EDGEs.
+
+ const double tol2 = _grid->_tol * _grid->_tol;
+ int facets[3], nbFacets, subEntity;
+
+ for ( size_t iP = 0; iP < _eIntPoints.size(); ++iP )
+ {
+ nbFacets = getEntity( _eIntPoints[iP], facets, subEntity );
+ _Node* equalNode = 0;
+ switch( nbFacets ) {
+ case 1: // in a _Face
+ {
+ _Face& quad = _hexQuads[ facets[0] - SMESH_Block::ID_FirstF ];
+ equalNode = FindEqualNode( quad._eIntNodes, _eIntPoints[ iP ], tol2 );
+ if ( equalNode ) {
+ equalNode->Add( _eIntPoints[ iP ] );
+ }
+ else {
+ _intNodes.push_back( _Node( 0, _eIntPoints[ iP ]));
+ quad._eIntNodes.push_back( & _intNodes.back() );
+ }
+ break;
+ }
+ case 2: // on a _Link
+ {
+ _Link& link = _hexLinks[ subEntity - SMESH_Block::ID_FirstE ];
+ if ( link._splits.size() > 0 )
+ {
+ equalNode = FindEqualNode( link._fIntNodes, _eIntPoints[ iP ], tol2 );
+ if ( equalNode )
+ equalNode->Add( _eIntPoints[ iP ] );
+ }
+ else
+ {
+ _intNodes.push_back( _Node( 0, _eIntPoints[ iP ]));
+ for ( int iF = 0; iF < 2; ++iF )
+ {
+ _Face& quad = _hexQuads[ facets[iF] - SMESH_Block::ID_FirstF ];
+ equalNode = FindEqualNode( quad._eIntNodes, _eIntPoints[ iP ], tol2 );
+ if ( equalNode ) {
+ equalNode->Add( _eIntPoints[ iP ] );
+ }
+ else {
+ quad._eIntNodes.push_back( & _intNodes.back() );
+ }
+ }
+ }
+ break;
+ }
+ case 3: // at a corner
{
- if ( split._nodes[ 0 ]->Node() )
+ _Node& node = _hexNodes[ subEntity - SMESH_Block::ID_FirstV ];
+ if ( node.Node() > 0 )
+ {
+ if ( node._intPoint )
+ node._intPoint->Add( _eIntPoints[ iP ]->_faceIDs, _eIntPoints[ iP ]->_node );
+ }
+ else
{
- split._nodes[ 1 ] = &link._intNodes[i];
- link._splits.push_back( split );
+ _intNodes.push_back( _Node( 0, _eIntPoints[ iP ]));
+ for ( int iF = 0; iF < 3; ++iF )
+ {
+ _Face& quad = _hexQuads[ facets[iF] - SMESH_Block::ID_FirstF ];
+ equalNode = FindEqualNode( quad._eIntNodes, _eIntPoints[ iP ], tol2 );
+ if ( equalNode ) {
+ equalNode->Add( _eIntPoints[ iP ] );
+ }
+ else {
+ quad._eIntNodes.push_back( & _intNodes.back() );
+ }
+ }
}
- split._nodes[ 0 ] = &link._intNodes[i];
+ break;
}
- if ( link._nodes[ 1 ]->Node() && split._nodes[ 0 ]->Node() )
+ } // switch( nbFacets )
+
+ if ( nbFacets == 0 ||
+ _grid->_shapes( _eIntPoints[ iP ]->_shapeID ).ShapeType() == TopAbs_VERTEX )
+ {
+ equalNode = FindEqualNode( _vIntNodes, _eIntPoints[ iP ], tol2 );
+ if ( equalNode ) {
+ equalNode->Add( _eIntPoints[ iP ] );
+ }
+ else {
+ if ( _intNodes.empty() || _intNodes.back().EdgeIntPnt() != _eIntPoints[ iP ])
+ _intNodes.push_back( _Node( 0, _eIntPoints[ iP ]));
+ _vIntNodes.push_back( & _intNodes.back() );
+ }
+ }
+ } // loop on _eIntPoints
+ }
+ else if ( 3 < _nbCornerNodes && _nbCornerNodes < 8 ) // _nbFaceIntNodes == 0
+ {
+ _Link split;
+ // create sub-links (_splits) of whole links
+ for ( int iLink = 0; iLink < 12; ++iLink )
+ {
+ _Link& link = _hexLinks[ iLink ];
+ link._splits.clear();
+ if ( link._nodes[ 0 ]->Node() && link._nodes[ 1 ]->Node() )
{
+ split._nodes[ 0 ] = link._nodes[0];
split._nodes[ 1 ] = link._nodes[1];
link._splits.push_back( split );
}
}
}
+
}
//================================================================================
/*!
{
Init();
- if ( _nbCornerNodes + _nbIntNodes < 4 )
+ int nbIntersections = _nbFaceIntNodes + _eIntPoints.size();
+ if ( _nbCornerNodes + nbIntersections < 4 )
return;
- if ( _nbBndNodes == _nbCornerNodes && isInHole() )
+ if ( _nbBndNodes == _nbCornerNodes && nbIntersections == 0 && isInHole() )
return;
_polygons.clear();
+ _polygons.reserve( 20 );
- vector<const SMDS_MeshNode* > polyhedraNodes;
- vector<int> quantities;
-
- // create polygons from quadrangles and get their nodes
+ // Create polygons from quadrangles
+ // --------------------------------
- vector<_Node*> nodes;
- nodes.reserve( _nbCornerNodes + _nbIntNodes );
+ _Link polyLink;
+ vector< _OrientedLink > splits;
+ vector<_Node*> chainNodes, usedEdgeNodes;
+ _Face* coplanarPolyg;
- _Link polyLink;
- polyLink._faces.reserve( 1 );
+ bool hasEdgeIntersections = !_eIntPoints.empty();
for ( int iF = 0; iF < 6; ++iF ) // loop on 6 sides of a hexahedron
{
- const _Face& quad = _hexQuads[ iF ] ;
+ _Face& quad = _hexQuads[ iF ] ;
_polygons.resize( _polygons.size() + 1 );
- _Face& polygon = _polygons.back();
- polygon._links.clear();
- polygon._polyLinks.clear(); polygon._polyLinks.reserve( 10 );
+ _Face* polygon = &_polygons.back();
+ polygon->_polyLinks.reserve( 20 );
- // add splits of a link to a polygon and collect info on nodes
- //int nbIn = 0, nbOut = 0, nbCorners = 0;
- nodes.clear();
+ splits.clear();
for ( int iE = 0; iE < 4; ++iE ) // loop on 4 sides of a quadrangle
+ for ( int iS = 0; iS < quad._links[ iE ].NbResultLinks(); ++iS )
+ splits.push_back( quad._links[ iE ].ResultLink( iS ));
+
+ // add splits of links to a polygon and add _polyLinks to make
+ // polygon's boundary closed
+
+ int nbSplits = splits.size();
+ if ( nbSplits < 2 && quad._eIntNodes.empty() )
+ nbSplits = 0;
+
+#ifdef _DEBUG_
+ for ( size_t iP = 0; iP < quad._eIntNodes.size(); ++iP )
+ if ( quad._eIntNodes[ iP ]->IsUsedInFace( polygon ))
+ quad._eIntNodes[ iP ]->_usedInFace = 0;
+#endif
+ int nbUsedEdgeNodes = 0;
+
+ while ( nbSplits > 0 )
{
- int nbSpits = quad._links[ iE ].NbResultLinks();
- for ( int iS = 0; iS < nbSpits; ++iS )
+ size_t iS = 0;
+ while ( !splits[ iS ] )
+ ++iS;
+
+ if ( !polygon->_links.empty() )
+ {
+ _polygons.resize( _polygons.size() + 1 );
+ polygon = &_polygons.back();
+ polygon->_polyLinks.reserve( 20 );
+ }
+ polygon->_links.push_back( splits[ iS ] );
+ splits[ iS++ ]._link = 0;
+ --nbSplits;
+
+ _Node* nFirst = polygon->_links.back().FirstNode();
+ _Node *n1,*n2 = polygon->_links.back().LastNode();
+ for ( ; nFirst != n2 && iS < splits.size(); ++iS )
{
- _OrientedLink split = quad._links[ iE ].ResultLink( iS );
- _Node* n = split.FirstNode();
- if ( !polygon._links.empty() )
+ _OrientedLink& split = splits[ iS ];
+ if ( !split ) continue;
+
+ n1 = split.FirstNode();
+ if ( n1 != n2 )
{
- _Node* nPrev = polygon._links.back().LastNode();
- if ( nPrev != n )
+ // try to connect to intersections with EDGEs
+ if ( quad._eIntNodes.size() > nbUsedEdgeNodes &&
+ findChain( n2, n1, quad, chainNodes ))
+ {
+ for ( size_t i = 1; i < chainNodes.size(); ++i )
+ {
+ polyLink._nodes[0] = chainNodes[i-1];
+ polyLink._nodes[1] = chainNodes[i];
+ polygon->_polyLinks.push_back( polyLink );
+ polygon->_links.push_back( _OrientedLink( &polygon->_polyLinks.back() ));
+ nbUsedEdgeNodes += ( polyLink._nodes[1]->IsUsedInFace( polygon ));
+ }
+ if ( chainNodes.back() != n1 )
+ {
+ n2 = chainNodes.back();
+ --iS;
+ continue;
+ }
+ }
+ // try to connect to a split ending on the same FACE
+ else
{
- polyLink._nodes[0] = nPrev;
- polyLink._nodes[1] = n;
- polygon._polyLinks.push_back( polyLink );
- polygon._links.push_back( _OrientedLink( &polygon._polyLinks.back() ));
- nodes.push_back( nPrev );
+ _OrientedLink foundSplit;
+ for ( int i = iS; i < splits.size() && !foundSplit; ++i )
+ if (( foundSplit = splits[ i ]) &&
+ ( n2->IsLinked( foundSplit.FirstNode()->_intPoint )))
+ {
+ polyLink._nodes[0] = n2;
+ polyLink._nodes[1] = foundSplit.FirstNode();
+ polygon->_polyLinks.push_back( polyLink );
+ polygon->_links.push_back( _OrientedLink( &polygon->_polyLinks.back() ));
+ iS = i - 1;
+ }
+ else
+ {
+ foundSplit._link = 0;
+ }
+ if ( foundSplit )
+ {
+ n2 = foundSplit.FirstNode();
+ continue;
+ }
+ else
+ {
+ if ( n2->IsLinked( nFirst->_intPoint ))
+ break;
+ polyLink._nodes[0] = n2;
+ polyLink._nodes[1] = n1;
+ polygon->_polyLinks.push_back( polyLink );
+ polygon->_links.push_back( _OrientedLink( &polygon->_polyLinks.back() ));
+ }
}
}
- polygon._links.push_back( split );
- nodes.push_back( n );
+ polygon->_links.push_back( split );
+ split._link = 0;
+ --nbSplits;
+ n2 = polygon->_links.back().LastNode();
+
+ } // loop on splits
+
+ if ( nFirst != n2 ) // close a polygon
+ {
+ if ( !findChain( n2, nFirst, quad, chainNodes ))
+ {
+ if ( !closePolygon( polygon, chainNodes ))
+ chainNodes.push_back( nFirst );
+ }
+ for ( size_t i = 1; i < chainNodes.size(); ++i )
+ {
+ polyLink._nodes[0] = chainNodes[i-1];
+ polyLink._nodes[1] = chainNodes[i];
+ polygon->_polyLinks.push_back( polyLink );
+ polygon->_links.push_back( _OrientedLink( &polygon->_polyLinks.back() ));
+ nbUsedEdgeNodes += bool( polyLink._nodes[1]->IsUsedInFace( polygon ));
+ }
}
- }
- if ( polygon._links.size() > 1 )
- {
- _Node* n1 = polygon._links.back().LastNode();
- _Node* n2 = polygon._links.front().FirstNode();
- if ( n1 != n2 )
+
+ if ( polygon->_links.size() < 3 && nbSplits > 0 )
{
- polyLink._nodes[0] = n1;
- polyLink._nodes[1] = n2;
- polygon._polyLinks.push_back( polyLink );
- polygon._links.push_back( _OrientedLink( &polygon._polyLinks.back() ));
- nodes.push_back( n1 );
+ polygon->_polyLinks.clear();
+ polygon->_links.clear();
}
- // add polygon to its links
- for ( size_t iL = 0; iL < polygon._links.size(); ++iL )
- polygon._links[ iL ]._link->_faces.push_back( &polygon );
- // store polygon nodes
- quantities.push_back( nodes.size() );
- for ( size_t i = 0; i < nodes.size(); ++i )
- polyhedraNodes.push_back( nodes[i]->Node() );
- }
- else
+ } // while ( nbSplits > 0 )
+
+ // if ( quad._eIntNodes.size() > nbUsedEdgeNodes )
+ // {
+ // // make _vIntNodes from not used _eIntNodes
+ // const double tol = 0.05 * Min( Min( _sideLength[0], _sideLength[1] ), _sideLength[0] );
+ // for ( size_t iP = 0; iP < quad._eIntNodes.size(); ++iP )
+ // {
+ // if ( quad._eIntNodes[ iP ]->IsUsedInFace() ) continue;
+ // _Node* equalNode =
+ // FindEqualNode( _vIntNodes, quad._eIntNodes[ iP ].EdgeIntPnt(), tol*tol );
+ // if ( equalNode )
+ // equalNode->Add( quad._eIntNodes[ iP ].EdgeIntPnt() );
+ // else
+ // _vIntNodes.push_back( quad._eIntNodes[ iP ]);
+ // }
+ // }
+
+ if ( polygon->_links.size() < 3 )
{
- _polygons.resize( _polygons.size() - 1 );
+ _polygons.pop_back();
+ //usedEdgeNodes.resize( usedEdgeNodes.size() - nbUsedEdgeNodes );
}
- }
+ } // loop on 6 hexahedron sides
+
+ // Create polygons closing holes in a polyhedron
+ // ----------------------------------------------
- // create polygons closing holes in a polyhedron
+ // clear _usedInFace
+ for ( size_t iN = 0; iN < _intNodes.size(); ++iN )
+ _intNodes[ iN ]._usedInFace = 0;
+ // add polygons to their links and mark used nodes
+ for ( size_t iP = 0; iP < _polygons.size(); ++iP )
+ {
+ _Face& polygon = _polygons[ iP ];
+ for ( size_t iL = 0; iL < polygon._links.size(); ++iL )
+ {
+ polygon._links[ iL ].AddFace( &polygon );
+ polygon._links[ iL ].FirstNode()->_usedInFace = &polygon;
+ }
+ }
// find free links
vector< _OrientedLink* > freeLinks;
+ freeLinks.reserve(20);
for ( size_t iP = 0; iP < _polygons.size(); ++iP )
{
_Face& polygon = _polygons[ iP ];
for ( size_t iL = 0; iL < polygon._links.size(); ++iL )
- if ( polygon._links[ iL ]._link->_faces.size() < 2 )
+ if ( polygon._links[ iL ].NbFaces() < 2 )
+ {
freeLinks.push_back( & polygon._links[ iL ]);
+ freeLinks.back()->FirstNode()->IsUsedInFace() == true;
+ }
}
- // make closed chains of free links
int nbFreeLinks = freeLinks.size();
- if ( 0 < nbFreeLinks && nbFreeLinks < 3 ) return;
+ if ( nbFreeLinks > 0 && nbFreeLinks < 3 ) return;
+
+ // put not used intersection nodes to _vIntNodes
+ int nbVertexNodes = 0; // nb not used vertex nodes
+ {
+ for ( size_t iN = 0; iN < _vIntNodes.size(); ++iN )
+ nbVertexNodes += ( !_vIntNodes[ iN ]->IsUsedInFace() );
+
+ const double tol = 1e-3 * Min( Min( _sideLength[0], _sideLength[1] ), _sideLength[0] );
+ for ( size_t iN = _nbFaceIntNodes; iN < _intNodes.size(); ++iN )
+ {
+ if ( _intNodes[ iN ].IsUsedInFace() ) continue;
+ if ( dynamic_cast< const F_IntersectPoint* >( _intNodes[ iN ]._intPoint )) continue;
+ _Node* equalNode =
+ FindEqualNode( _vIntNodes, _intNodes[ iN ].EdgeIntPnt(), tol*tol );
+ if ( !equalNode /*|| equalNode->IsUsedInFace()*/ )
+ {
+ _vIntNodes.push_back( &_intNodes[ iN ]);
+ ++nbVertexNodes;
+ }
+ }
+ }
+
+ set<TGeomID> usedFaceIDs;
+ TGeomID curFace = 0;
+ const size_t nbQuadPolygons = _polygons.size();
+
+ // create polygons by making closed chains of free links
+ size_t iPolygon = _polygons.size();
while ( nbFreeLinks > 0 )
{
- nodes.clear();
- _polygons.resize( _polygons.size() + 1 );
- _Face& polygon = _polygons.back();
- polygon._links.clear();
+ if ( iPolygon == _polygons.size() )
+ _polygons.resize( _polygons.size() + 1 );
+ _Face& polygon = _polygons[ iPolygon ];
+ polygon._polyLinks.reserve( 20 );
+ polygon._links.reserve( 20 );
- // get a remaining link to start from
_OrientedLink* curLink = 0;
- for ( size_t iL = 0; iL < freeLinks.size() && !curLink; ++iL )
- if (( curLink = freeLinks[ iL ] ))
- freeLinks[ iL ] = 0;
- nodes.push_back( curLink->LastNode() );
- polygon._links.push_back( *curLink );
-
- // find all links connected to curLink
- _Node* curNode = 0;
- do
- {
- curNode = curLink->FirstNode();
- curLink = 0;
+ _Node* curNode;
+ if (( !hasEdgeIntersections ) ||
+ ( nbFreeLinks < 4 && nbVertexNodes == 0 ))
+ {
+ // get a remaining link to start from
for ( size_t iL = 0; iL < freeLinks.size() && !curLink; ++iL )
- if ( freeLinks[ iL ] && freeLinks[ iL ]->LastNode() == curNode )
- {
- curLink = freeLinks[ iL ];
+ if (( curLink = freeLinks[ iL ] ))
freeLinks[ iL ] = 0;
- nodes.push_back( curNode );
- polygon._links.push_back( *curLink );
+ polygon._links.push_back( *curLink );
+ --nbFreeLinks;
+ do
+ {
+ // find all links connected to curLink
+ curNode = curLink->FirstNode();
+ curLink = 0;
+ for ( size_t iL = 0; iL < freeLinks.size() && !curLink; ++iL )
+ if ( freeLinks[ iL ] && freeLinks[ iL ]->LastNode() == curNode )
+ {
+ curLink = freeLinks[ iL ];
+ freeLinks[ iL ] = 0;
+ --nbFreeLinks;
+ polygon._links.push_back( *curLink );
+ }
+ } while ( curLink );
+ }
+ else // there are intersections with EDGEs
+ {
+ // get a remaining link to start from, one lying on minimal
+ // nb of FACEs
+ {
+ vector< pair< TGeomID, int > > facesOfLink[3];
+ pair< TGeomID, int > faceOfLink( -1, -1 );
+ vector< TGeomID > faces;
+ for ( size_t iL = 0; iL < freeLinks.size(); ++iL )
+ if ( freeLinks[ iL ] )
+ {
+ faces = freeLinks[ iL ]->GetNotUsedFace( usedFaceIDs );
+ if ( faces.size() == 1 )
+ {
+ faceOfLink = make_pair( faces[0], iL );
+ if ( !freeLinks[ iL ]->HasEdgeNodes() )
+ break;
+ facesOfLink[0].push_back( faceOfLink );
+ }
+ else if ( facesOfLink[0].empty() )
+ {
+ faceOfLink = make_pair(( faces.empty() ? -1 : faces[0]), iL );
+ facesOfLink[ 1 + faces.empty() ].push_back( faceOfLink );
+ }
+ }
+ for ( int i = 0; faceOfLink.second < 0 && i < 3; ++i )
+ if ( !facesOfLink[i].empty() )
+ faceOfLink = facesOfLink[i][0];
+
+ if ( faceOfLink.first < 0 ) // all faces used
+ {
+ for ( size_t i = 0; i < facesOfLink[2].size() && faceOfLink.first < 1; ++i )
+ {
+ curLink = freeLinks[ facesOfLink[2][i].second ];
+ faceOfLink.first = curLink->FirstNode()->IsLinked( curLink->LastNode()->_intPoint );
+ }
+ usedFaceIDs.clear();
}
- } while ( curLink );
+ curFace = faceOfLink.first;
+ curLink = freeLinks[ faceOfLink.second ];
+ freeLinks[ faceOfLink.second ] = 0;
+ }
+ usedFaceIDs.insert( curFace );
+ polygon._links.push_back( *curLink );
+ --nbFreeLinks;
- nbFreeLinks -= polygon._links.size();
+ // find all links bounding a FACE of curLink
+ do
+ {
+ // go forward from curLink
+ curNode = curLink->LastNode();
+ curLink = 0;
+ for ( size_t iL = 0; iL < freeLinks.size() && !curLink; ++iL )
+ if ( freeLinks[ iL ] &&
+ freeLinks[ iL ]->FirstNode() == curNode &&
+ freeLinks[ iL ]->LastNode()->IsOnFace( curFace ))
+ {
+ curLink = freeLinks[ iL ];
+ freeLinks[ iL ] = 0;
+ polygon._links.push_back( *curLink );
+ --nbFreeLinks;
+ }
+ } while ( curLink );
- if ( curNode != nodes.front() || polygon._links.size() < 3 )
- return; // closed polygon not found -> invalid polyhedron
+ std::reverse( polygon._links.begin(), polygon._links.end() );
- quantities.push_back( nodes.size() );
- for ( size_t i = 0; i < nodes.size(); ++i )
- polyhedraNodes.push_back( nodes[i]->Node() );
+ curLink = & polygon._links.back();
+ do
+ {
+ // go backward from curLink
+ curNode = curLink->FirstNode();
+ curLink = 0;
+ for ( size_t iL = 0; iL < freeLinks.size() && !curLink; ++iL )
+ if ( freeLinks[ iL ] &&
+ freeLinks[ iL ]->LastNode() == curNode &&
+ freeLinks[ iL ]->FirstNode()->IsOnFace( curFace ))
+ {
+ curLink = freeLinks[ iL ];
+ freeLinks[ iL ] = 0;
+ polygon._links.push_back( *curLink );
+ --nbFreeLinks;
+ }
+ } while ( curLink );
+
+ curNode = polygon._links.back().FirstNode();
+
+ if ( polygon._links[0].LastNode() != curNode )
+ {
+ if ( nbVertexNodes > 0 )
+ {
+ // add links with _vIntNodes if not already used
+ for ( size_t iN = 0; iN < _vIntNodes.size(); ++iN )
+ if ( !_vIntNodes[ iN ]->IsUsedInFace() &&
+ _vIntNodes[ iN ]->IsOnFace( curFace ))
+ {
+ _vIntNodes[ iN ]->_usedInFace = &polygon;
+ --nbVertexNodes;
+ polyLink._nodes[0] = _vIntNodes[ iN ];
+ polyLink._nodes[1] = curNode;
+ polygon._polyLinks.push_back( polyLink );
+ polygon._links.push_back( _OrientedLink( &polygon._polyLinks.back() ));
+ freeLinks.push_back( &polygon._links.back() );
+ ++nbFreeLinks;
+ curNode = _vIntNodes[ iN ];
+ // TODO: to reorder _vIntNodes within polygon, if there are several ones
+ }
+ }
+ // if ( polygon._links.size() > 1 )
+ {
+ polyLink._nodes[0] = polygon._links[0].LastNode();
+ polyLink._nodes[1] = curNode;
+ polygon._polyLinks.push_back( polyLink );
+ polygon._links.push_back( _OrientedLink( &polygon._polyLinks.back() ));
+ freeLinks.push_back( &polygon._links.back() );
+ ++nbFreeLinks;
+ }
+ }
+ } // if there are intersections with EDGEs
- // add polygon to its links and reverse links
- for ( size_t i = 0; i < polygon._links.size(); ++i )
+ if ( polygon._links.size() < 2 ||
+ polygon._links[0].LastNode() != polygon._links.back().FirstNode() )
+ return; // closed polygon not found -> invalid polyhedron
+
+ if ( polygon._links.size() == 2 )
{
- polygon._links[i].Reverse();
- polygon._links[i]._link->_faces.push_back( &polygon );
+ if ( freeLinks.back() == &polygon._links.back() )
+ {
+ freeLinks.pop_back();
+ --nbFreeLinks;
+ }
+ if ( polygon._links.front().NbFaces() > 0 )
+ polygon._links.back().AddFace( polygon._links.front()._link->_faces[0] );
+ if ( polygon._links.back().NbFaces() > 0 )
+ polygon._links.front().AddFace( polygon._links.back()._link->_faces[0] );
+
+ _polygons.pop_back();
}
+ else // polygon._links.size() >= 2
+ {
+ // add polygon to its links
+ for ( size_t iL = 0; iL < polygon._links.size(); ++iL )
+ {
+ polygon._links[ iL ].AddFace( &polygon );
+ polygon._links[ iL ].Reverse();
+ }
+ if ( hasEdgeIntersections && iPolygon == _polygons.size() - 1 )
+ {
+ // check that a polygon does not lie in the plane of another polygon
+ coplanarPolyg = 0;
+ for ( size_t iL = 0; iL < polygon._links.size() && !coplanarPolyg; ++iL )
+ {
+ if ( polygon._links[ iL ].NbFaces() < 2 )
+ continue; // it's a just added free link
+ // look for a polygon made on a hexa side and sharing
+ // two or more haxa links
+ size_t iL2;
+ coplanarPolyg = polygon._links[ iL ]._link->_faces[0];
+ for ( iL2 = iL + 1; iL2 < polygon._links.size(); ++iL2 )
+ if ( polygon._links[ iL2 ]._link->_faces[0] == coplanarPolyg &&
+ !coplanarPolyg->isPolyLink( polygon._links[ iL2 ]) &&
+ coplanarPolyg < & _polygons[ nbQuadPolygons ])
+ break;
+ if ( iL2 == polygon._links.size() )
+ coplanarPolyg = 0;
+ }
+ if ( 0 /*coplanarPolyg*/ ) // coplanar polygon found
+ {
+ freeLinks.resize( freeLinks.size() - polygon._polyLinks.size() );
+ nbFreeLinks -= polygon._polyLinks.size();
+
+ // fill freeLinks with links not shared by coplanarPolyg and polygon
+ for ( size_t iL = 0; iL < polygon._links.size(); ++iL )
+ if ( polygon._links[ iL ]._link->_faces[1] &&
+ polygon._links[ iL ]._link->_faces[0] != coplanarPolyg )
+ {
+ _Face* p = polygon._links[ iL ]._link->_faces[0];
+ for ( size_t iL2 = 0; iL2 < p->_links.size(); ++iL2 )
+ if ( p->_links[ iL2 ]._link == polygon._links[ iL ]._link )
+ {
+ freeLinks.push_back( & p->_links[ iL2 ] );
+ ++nbFreeLinks;
+ freeLinks.back()->RemoveFace( &polygon );
+ break;
+ }
+ }
+ for ( size_t iL = 0; iL < coplanarPolyg->_links.size(); ++iL )
+ if ( coplanarPolyg->_links[ iL ]._link->_faces[1] &&
+ coplanarPolyg->_links[ iL ]._link->_faces[1] != &polygon )
+ {
+ _Face* p = coplanarPolyg->_links[ iL ]._link->_faces[0];
+ if ( p == coplanarPolyg )
+ p = coplanarPolyg->_links[ iL ]._link->_faces[1];
+ for ( size_t iL2 = 0; iL2 < p->_links.size(); ++iL2 )
+ if ( p->_links[ iL2 ]._link == coplanarPolyg->_links[ iL ]._link )
+ {
+ freeLinks.push_back( & p->_links[ iL2 ] );
+ ++nbFreeLinks;
+ freeLinks.back()->RemoveFace( coplanarPolyg );
+ break;
+ }
+ }
+ // set coplanarPolyg to be re-created next
+ for ( size_t iP = 0; iP < _polygons.size(); ++iP )
+ if ( coplanarPolyg == & _polygons[ iP ] )
+ {
+ iPolygon = iP;
+ _polygons[ iPolygon ]._links.clear();
+ _polygons[ iPolygon ]._polyLinks.clear();
+ break;
+ }
+ if ( freeLinks.back() == &polygon._links.back() )
+ {
+ freeLinks.pop_back();
+ --nbFreeLinks;
+ }
+ _polygons.pop_back();
+ usedFaceIDs.erase( curFace );
+ continue;
+ } // if ( coplanarPolyg )
+ } // if ( hasEdgeIntersections )
- //const size_t firstPoly = _polygons.size();
- }
+ iPolygon = _polygons.size();
+
+ } // end of case ( polygon._links.size() > 2 )
+ } // while ( nbFreeLinks > 0 )
if ( ! checkPolyhedronSize() )
{
}
// create a classic cell if possible
- const int nbNodes = _nbCornerNodes + _nbIntNodes;
+ const int nbNodes = _nbCornerNodes + nbIntersections;
bool isClassicElem = false;
if ( nbNodes == 8 && _polygons.size() == 6 ) isClassicElem = addHexa();
else if ( nbNodes == 4 && _polygons.size() == 4 ) isClassicElem = addTetra();
else if ( nbNodes == 6 && _polygons.size() == 5 ) isClassicElem = addPenta();
else if ( nbNodes == 5 && _polygons.size() == 5 ) isClassicElem = addPyra ();
if ( !isClassicElem )
- _volumeDefs.set( polyhedraNodes, quantities );
+ {
+ _volumeDefs._nodes.clear();
+ _volumeDefs._quantities.clear();
+
+ for ( size_t iF = 0; iF < _polygons.size(); ++iF )
+ {
+ const size_t nbLinks = _polygons[ iF ]._links.size();
+ _volumeDefs._quantities.push_back( nbLinks );
+ for ( size_t iL = 0; iL < nbLinks; ++iL )
+ _volumeDefs._nodes.push_back( _polygons[ iF ]._links[ iL ].FirstNode() );
+ }
+ }
}
//================================================================================
/*!
* \brief Create elements in the mesh
*/
- int Hexahedron::MakeElements(SMESH_MesherHelper& helper)
+ int Hexahedron::MakeElements(SMESH_MesherHelper& helper,
+ const map< TGeomID, vector< TGeomID > >& edge2faceIDsMap)
{
SMESHDS_Mesh* mesh = helper.GetMeshDS();
size_t nbCells[3] = { _grid->_coords[0].size() - 1,
_grid->_coords[1].size() - 1,
_grid->_coords[2].size() - 1 };
- const size_t nbGridCells = nbCells[0] *nbCells [1] * nbCells[2];
+ const size_t nbGridCells = nbCells[0] * nbCells[1] * nbCells[2];
vector< Hexahedron* > intersectedHex( nbGridCells, 0 );
int nbIntHex = 0;
for ( ; lineInd.More(); ++lineInd )
{
GridLine& line = _grid->_lines[ iDir ][ lineInd.LineIndex() ];
- multiset< IntersectionPoint >::const_iterator ip = line._intPoints.begin();
+ multiset< F_IntersectPoint >::const_iterator ip = line._intPoints.begin();
for ( ; ip != line._intPoints.end(); ++ip )
{
- if ( !ip->_node ) continue;
+ // if ( !ip->_node ) continue; // intersection at a grid node
lineInd.SetIndexOnLine( ip->_indexOnLine );
for ( int iL = 0; iL < 4; ++iL ) // loop on 4 cells sharing a link
{
++nbIntHex;
}
const int iLink = iL + iDir * 4;
- hex->_hexLinks[iLink]._intNodes.push_back( _Node( 0, &(*ip) ));
- hex->_nbIntNodes++;
+ hex->_hexLinks[iLink]._fIntPoints.push_back( &(*ip) );
+ //hex->_hexLinks[iLink]._fIntNodes.push_back( _Node( 0, &(*ip) ));
+ hex->_nbFaceIntNodes += bool( ip->_node );
}
}
}
}
+ // implement geom edges into the mesh
+ addEdges( helper, intersectedHex, edge2faceIDsMap );
+
// add not split hexadrons to the mesh
int nbAdded = 0;
vector<int> intHexInd( nbIntHex );
if ( hex )
{
intHexInd[ nbIntHex++ ] = i;
- if ( hex->_nbIntNodes > 0 ) continue;
- init( hex->_i, hex->_j, hex->_k );
+ if ( hex->_nbFaceIntNodes > 0 || hex->_eIntPoints.size() > 0 )
+ continue; // treat intersected hex later
+ this->init( hex->_i, hex->_j, hex->_k );
}
else
{
- init( i );
+ this->init( i );
}
- if ( _nbCornerNodes == 8 && ( _nbBndNodes < _nbCornerNodes || !isInHole() ))
+ if (( _nbCornerNodes == 8 ) &&
+ ( _nbBndNodes < _nbCornerNodes || !isInHole() ))
{
// order of _hexNodes is defined by enum SMESH_Block::TShapeID
SMDS_MeshElement* el =
{
// all intersection of hex with geometry are at grid nodes
hex = new Hexahedron( *this );
- hex->init( i );
+ //hex->init( i );
+ hex->_i = _i;
+ hex->_j = _j;
+ hex->_k = _k;
intHexInd.push_back(0);
intHexInd[ nbIntHex++ ] = i;
}
return nbAdded;
}
+ //================================================================================
+ /*!
+ * \brief Implements geom edges into the mesh
+ */
+ void Hexahedron::addEdges(SMESH_MesherHelper& helper,
+ vector< Hexahedron* >& hexes,
+ const map< TGeomID, vector< TGeomID > >& edge2faceIDsMap)
+ {
+ if ( edge2faceIDsMap.empty() ) return;
+
+ // Prepare planes for intersecting with EDGEs
+ GridPlanes pln[3];
+ {
+ for ( int iDirZ = 0; iDirZ < 3; ++iDirZ ) // iDirZ gives normal direction to planes
+ {
+ GridPlanes& planes = pln[ iDirZ ];
+ int iDirX = ( iDirZ + 1 ) % 3;
+ int iDirY = ( iDirZ + 2 ) % 3;
+ // planes._uNorm = ( _grid->_axes[ iDirY ] ^ _grid->_axes[ iDirZ ] ).Normalized();
+ // planes._vNorm = ( _grid->_axes[ iDirZ ] ^ _grid->_axes[ iDirX ] ).Normalized();
+ planes._zNorm = ( _grid->_axes[ iDirX ] ^ _grid->_axes[ iDirY ] ).Normalized();
+ planes._zProjs.resize ( _grid->_coords[ iDirZ ].size() );
+ planes._zProjs [0] = 0;
+ const double zFactor = _grid->_axes[ iDirZ ] * planes._zNorm;
+ const vector< double > & u = _grid->_coords[ iDirZ ];
+ for ( int i = 1; i < planes._zProjs.size(); ++i )
+ {
+ planes._zProjs [i] = zFactor * ( u[i] - u[0] );
+ }
+ }
+ }
+ const double deflection = _grid->_minCellSize / 20.;
+ const double tol = _grid->_tol;
+ E_IntersectPoint ip;
+
+ // Intersect EDGEs with the planes
+ map< TGeomID, vector< TGeomID > >::const_iterator e2fIt = edge2faceIDsMap.begin();
+ for ( ; e2fIt != edge2faceIDsMap.end(); ++e2fIt )
+ {
+ const TGeomID edgeID = e2fIt->first;
+ const TopoDS_Edge & E = TopoDS::Edge( _grid->_shapes( edgeID ));
+ BRepAdaptor_Curve curve( E );
+ TopoDS_Vertex v1 = helper.IthVertex( 0, E, false );
+ TopoDS_Vertex v2 = helper.IthVertex( 1, E, false );
+
+ ip._faceIDs = e2fIt->second;
+ ip._shapeID = edgeID;
+
+ // discretize the EGDE
+ GCPnts_UniformDeflection discret( curve, deflection, true );
+ if ( !discret.IsDone() || discret.NbPoints() < 2 )
+ continue;
+
+ // perform intersection
+ for ( int iDirZ = 0; iDirZ < 3; ++iDirZ )
+ {
+ GridPlanes& planes = pln[ iDirZ ];
+ int iDirX = ( iDirZ + 1 ) % 3;
+ int iDirY = ( iDirZ + 2 ) % 3;
+ double xLen = _grid->_coords[ iDirX ].back() - _grid->_coords[ iDirX ][0];
+ double yLen = _grid->_coords[ iDirY ].back() - _grid->_coords[ iDirY ][0];
+ double zLen = _grid->_coords[ iDirZ ].back() - _grid->_coords[ iDirZ ][0];
+ //double zFactor = _grid->_axes[ iDirZ ] * planes._zNorm;
+ int dIJK[3], d000[3] = { 0,0,0 };
+ double o[3] = { _grid->_coords[0][0],
+ _grid->_coords[1][0],
+ _grid->_coords[2][0] };
+
+ // locate the 1st point of a segment within the grid
+ gp_XYZ p1 = discret.Value( 1 ).XYZ();
+ double u1 = discret.Parameter( 1 );
+ double zProj1 = planes._zNorm * ( p1 - _grid->_origin );
+
+ _grid->ComputeUVW( p1, ip._uvw );
+ int iX1 = int(( ip._uvw[iDirX] - o[iDirX]) / xLen * (_grid->_coords[ iDirX ].size() - 1));
+ int iY1 = int(( ip._uvw[iDirY] - o[iDirY]) / yLen * (_grid->_coords[ iDirY ].size() - 1));
+ int iZ1 = int(( ip._uvw[iDirZ] - o[iDirZ]) / zLen * (_grid->_coords[ iDirZ ].size() - 1));
+ locateValue( iX1, ip._uvw[iDirX], _grid->_coords[ iDirX ], dIJK[ iDirX ], tol );
+ locateValue( iY1, ip._uvw[iDirY], _grid->_coords[ iDirY ], dIJK[ iDirY ], tol );
+ locateValue( iZ1, ip._uvw[iDirZ], _grid->_coords[ iDirZ ], dIJK[ iDirZ ], tol );
+
+ int ijk[3]; // grid index where a segment intersect a plane
+ ijk[ iDirX ] = iX1;
+ ijk[ iDirY ] = iY1;
+ ijk[ iDirZ ] = iZ1;
+
+ // add the 1st vertex point to a hexahedron
+ if ( iDirZ == 0 )
+ {
+ ip._point = p1;
+ ip._shapeID = _grid->_shapes.Add( v1 );
+ _grid->_edgeIntP.push_back( ip );
+ if ( !addIntersection( _grid->_edgeIntP.back(), hexes, ijk, d000 ))
+ _grid->_edgeIntP.pop_back();
+ ip._shapeID = edgeID;
+ }
+ for ( int iP = 2; iP <= discret.NbPoints(); ++iP )
+ {
+ // locate the 2nd point of a segment within the grid
+ gp_XYZ p2 = discret.Value( iP ).XYZ();
+ double u2 = discret.Parameter( iP );
+ double zProj2 = planes._zNorm * ( p2 - _grid->_origin );
+ int iZ2 = iZ1;
+ if ( Abs( zProj2 - zProj1 ) <= std::numeric_limits<double>::min() )
+ continue;
+ locateValue( iZ2, zProj2, planes._zProjs, dIJK[ iDirZ ], tol );
+
+ // treat intersections with planes between 2 end points of a segment
+ int dZ = ( iZ1 <= iZ2 ) ? +1 : -1;
+ int iZ = iZ1 + ( iZ1 < iZ2 );
+ for ( int i = 0, nb = Abs( iZ1 - iZ2 ); i < nb; ++i, iZ += dZ )
+ {
+ ip._point = findIntPoint( u1, zProj1, u2, zProj2,
+ planes._zProjs[ iZ ],
+ curve, planes._zNorm, _grid->_origin );
+ _grid->ComputeUVW( ip._point.XYZ(), ip._uvw );
+ locateValue( ijk[iDirX], ip._uvw[iDirX], _grid->_coords[iDirX], dIJK[iDirX], tol );
+ locateValue( ijk[iDirY], ip._uvw[iDirY], _grid->_coords[iDirY], dIJK[iDirY], tol );
+ ijk[ iDirZ ] = iZ;
+
+ // add ip to hex "above" the plane
+ _grid->_edgeIntP.push_back( ip );
+ dIJK[ iDirZ ] = 0;
+ bool added = addIntersection(_grid->_edgeIntP.back(), hexes, ijk, dIJK);
+
+ // add ip to hex "below" the plane
+ ijk[ iDirZ ] = iZ-1;
+ if ( !addIntersection( _grid->_edgeIntP.back(), hexes, ijk, dIJK ) &&
+ !added)
+ _grid->_edgeIntP.pop_back();
+ }
+ iZ1 = iZ2;
+ p1 = p2;
+ u1 = u2;
+ zProj1 = zProj2;
+ }
+ // add the 2nd vertex point to a hexahedron
+ if ( iDirZ == 0 )
+ {
+ ip._shapeID = _grid->_shapes.Add( v2 );
+ ip._point = p1;
+ _grid->ComputeUVW( p1, ip._uvw );
+ locateValue( ijk[iDirX], ip._uvw[iDirX], _grid->_coords[iDirX], dIJK[iDirX], tol );
+ locateValue( ijk[iDirY], ip._uvw[iDirY], _grid->_coords[iDirY], dIJK[iDirY], tol );
+ ijk[ iDirZ ] = iZ1;
+ _grid->_edgeIntP.push_back( ip );
+ if ( !addIntersection( _grid->_edgeIntP.back(), hexes, ijk, d000 ))
+ _grid->_edgeIntP.pop_back();
+ ip._shapeID = edgeID;
+ }
+ } // loop on 3 grid directions
+ } // loop on EDGEs
+
+ // Create nodes at found intersections
+ // const E_IntersectPoint* eip;
+ // for ( size_t i = 0; i < hexes.size(); ++i )
+ // {
+ // Hexahedron* h = hexes[i];
+ // if ( !h ) continue;
+ // for ( int iF = 0; iF < 6; ++iF )
+ // {
+ // _Face& quad = h->_hexQuads[ iF ];
+ // for ( size_t iP = 0; iP < quad._eIntNodes.size(); ++iP )
+ // if ( !quad._eIntNodes[ iP ]._node )
+ // if (( eip = quad._eIntNodes[ iP ].EdgeIntPnt() ))
+ // quad._eIntNodes[ iP ]._intPoint->_node = helper.AddNode( eip->_point.X(),
+ // eip->_point.Y(),
+ // eip->_point.Z() );
+ // }
+ // for ( size_t iP = 0; iP < hexes[i]->_vIntNodes.size(); ++iP )
+ // if (( eip = h->_vIntNodes[ iP ].EdgeIntPnt() ))
+ // h->_vIntNodes[ iP ]._intPoint->_node = helper.AddNode( eip->_point.X(),
+ // eip->_point.Y(),
+ // eip->_point.Z() );
+ // }
+ }
+
+ //================================================================================
+ /*!
+ * \brief Finds intersection of a curve with a plane
+ * \param [in] u1 - parameter of one curve point
+ * \param [in] proj1 - projection of the curve point to the plane normal
+ * \param [in] u2 - parameter of another curve point
+ * \param [in] proj2 - projection of the other curve point to the plane normal
+ * \param [in] proj - projection of a point where the curve intersects the plane
+ * \param [in] curve - the curve
+ * \param [in] axis - the plane normal
+ * \param [in] origin - the plane origin
+ * \return gp_Pnt - the found intersection point
+ */
+ gp_Pnt Hexahedron::findIntPoint( double u1, double proj1,
+ double u2, double proj2,
+ double proj,
+ BRepAdaptor_Curve& curve,
+ const gp_XYZ& axis,
+ const gp_XYZ& origin)
+ {
+ double r = (( proj - proj1 ) / ( proj2 - proj1 ));
+ double u = u1 * ( 1 - r ) + u2 * r;
+ gp_Pnt p = curve.Value( u );
+ double newProj = axis * ( p.XYZ() - origin );
+ if ( Abs( proj - newProj ) > _grid->_tol / 10. )
+ {
+ if ( r > 0.5 )
+ return findIntPoint( u2, proj2, u, newProj, proj, curve, axis, origin );
+ else
+ return findIntPoint( u1, proj2, u, newProj, proj, curve, axis, origin );
+ }
+ return p;
+ }
+
+ //================================================================================
+ /*!
+ * \brief Returns indices of a hexahedron sub-entities holding a point
+ * \param [in] ip - intersection point
+ * \param [out] facets - 0-3 facets holding a point
+ * \param [out] sub - index of a vertex or an edge holding a point
+ * \return int - number of facets holding a point
+ */
+ int Hexahedron::getEntity( const E_IntersectPoint* ip, int* facets, int& sub )
+ {
+ enum { X = 1, Y = 2, Z = 4 }; // == 001, 010, 100
+ int nbFacets = 0;
+ int vertex = 0, egdeMask = 0;
+
+ if ( Abs( _grid->_coords[0][ _i ] - ip->_uvw[0] ) < _grid->_tol ) {
+ facets[ nbFacets++ ] = SMESH_Block::ID_F0yz;
+ egdeMask |= X;
+ }
+ else if ( Abs( _grid->_coords[0][ _i+1 ] - ip->_uvw[0] ) < _grid->_tol ) {
+ facets[ nbFacets++ ] = SMESH_Block::ID_F1yz;
+ vertex |= X;
+ egdeMask |= X;
+ }
+ if ( Abs( _grid->_coords[1][ _j ] - ip->_uvw[1] ) < _grid->_tol ) {
+ facets[ nbFacets++ ] = SMESH_Block::ID_Fx0z;
+ egdeMask |= Y;
+ }
+ else if ( Abs( _grid->_coords[1][ _j+1 ] - ip->_uvw[1] ) < _grid->_tol ) {
+ facets[ nbFacets++ ] = SMESH_Block::ID_Fx1z;
+ vertex |= Y;
+ egdeMask |= Y;
+ }
+ if ( Abs( _grid->_coords[2][ _k ] - ip->_uvw[2] ) < _grid->_tol ) {
+ facets[ nbFacets++ ] = SMESH_Block::ID_Fxy0;
+ egdeMask |= Z;
+ }
+ else if ( Abs( _grid->_coords[2][ _k+1 ] - ip->_uvw[2] ) < _grid->_tol ) {
+ facets[ nbFacets++ ] = SMESH_Block::ID_Fxy1;
+ vertex |= Z;
+ egdeMask |= Z;
+ }
+
+ switch ( nbFacets )
+ {
+ case 0: sub = 0; break;
+ case 1: sub = facets[0]; break;
+ case 2: {
+ const int edge [3][8] = {
+ { SMESH_Block::ID_E00z, SMESH_Block::ID_E10z,
+ SMESH_Block::ID_E01z, SMESH_Block::ID_E11z },
+ { SMESH_Block::ID_E0y0, SMESH_Block::ID_E1y0, 0, 0,
+ SMESH_Block::ID_E0y1, SMESH_Block::ID_E1y1 },
+ { SMESH_Block::ID_Ex00, 0, SMESH_Block::ID_Ex10, 0,
+ SMESH_Block::ID_Ex01, 0, SMESH_Block::ID_Ex11 }
+ };
+ switch ( egdeMask ) {
+ case X | Y: sub = edge[ 0 ][ vertex ]; break;
+ case X | Z: sub = edge[ 1 ][ vertex ]; break;
+ default: sub = edge[ 2 ][ vertex ];
+ }
+ break;
+ }
+ //case 3:
+ default:
+ sub = vertex + SMESH_Block::ID_FirstV;
+ }
+
+ return nbFacets;
+ }
+ //================================================================================
+ /*!
+ * \brief Adds intersection with an EDGE
+ */
+ bool Hexahedron::addIntersection( const E_IntersectPoint& ip,
+ vector< Hexahedron* >& hexes,
+ int ijk[], int dIJK[] )
+ {
+ bool added = false;
+
+ size_t hexIndex[4] = {
+ _grid->CellIndex( ijk[0], ijk[1], ijk[2] ),
+ dIJK[0] ? _grid->CellIndex( ijk[0]+dIJK[0], ijk[1], ijk[2] ) : -1,
+ dIJK[1] ? _grid->CellIndex( ijk[0], ijk[1]+dIJK[1], ijk[2] ) : -1,
+ dIJK[2] ? _grid->CellIndex( ijk[0], ijk[1], ijk[2]+dIJK[2] ) : -1
+ };
+ for ( int i = 0; i < 4; ++i )
+ {
+ if ( /*0 <= hexIndex[i] &&*/ hexIndex[i] < hexes.size() && hexes[ hexIndex[i] ] )
+ {
+ Hexahedron* h = hexes[ hexIndex[i] ];
+ // check if ip is really inside the hex
+#ifdef _DEBUG_
+ if (( _grid->_coords[0][ h->_i ] - _grid->_tol > ip._uvw[0] ) ||
+ ( _grid->_coords[0][ h->_i+1 ] + _grid->_tol < ip._uvw[0] ) ||
+ ( _grid->_coords[1][ h->_j ] - _grid->_tol > ip._uvw[1] ) ||
+ ( _grid->_coords[1][ h->_j+1 ] + _grid->_tol < ip._uvw[1] ) ||
+ ( _grid->_coords[2][ h->_k ] - _grid->_tol > ip._uvw[2] ) ||
+ ( _grid->_coords[2][ h->_k+1 ] + _grid->_tol < ip._uvw[2] ))
+ throw SALOME_Exception("ip outside a hex");
+#endif
+ h->_eIntPoints.push_back( & ip );
+ added = true;
+ }
+ }
+ return added;
+ }
+ //================================================================================
+ /*!
+ * \brief Finds nodes at a path from one node to another via intersections with EDGEs
+ */
+ bool Hexahedron::findChain( _Node* n1,
+ _Node* n2,
+ _Face& quad,
+ vector<_Node*>& chn )
+ {
+ chn.clear();
+ chn.push_back( n1 );
+ for ( size_t iP = 0; iP < quad._eIntNodes.size(); ++iP )
+ if ( !quad._eIntNodes[ iP ]->IsUsedInFace( &quad ) &&
+ n1->IsLinked( quad._eIntNodes[ iP ]->_intPoint ) &&
+ n2->IsLinked( quad._eIntNodes[ iP ]->_intPoint ))
+ {
+ chn.push_back( quad._eIntNodes[ iP ]);
+ chn.push_back( n2 );
+ quad._eIntNodes[ iP ]->_usedInFace = &quad;
+ return true;
+ }
+ bool found;
+ do
+ {
+ found = false;
+ for ( size_t iP = 0; iP < quad._eIntNodes.size(); ++iP )
+ if ( !quad._eIntNodes[ iP ]->IsUsedInFace( &quad ) &&
+ chn.back()->IsLinked( quad._eIntNodes[ iP ]->_intPoint ))
+ {
+ chn.push_back( quad._eIntNodes[ iP ]);
+ found = quad._eIntNodes[ iP ]->_usedInFace = &quad;
+ break;
+ }
+ } while ( found && ! chn.back()->IsLinked( n2->_intPoint ) );
+
+ if ( chn.back() != n2 && chn.back()->IsLinked( n2->_intPoint ))
+ chn.push_back( n2 );
+
+ return chn.size() > 1;
+ }
+ //================================================================================
+ /*!
+ * \brief Try to heal a polygon whose ends are not connected
+ */
+ bool Hexahedron::closePolygon( _Face* polygon, vector<_Node*>& chainNodes ) const
+ {
+ int i = -1, nbLinks = polygon->_links.size();
+ if ( nbLinks < 3 )
+ return false;
+ vector< _OrientedLink > newLinks;
+ // find a node lying on the same FACE as the last one
+ _Node* node = polygon->_links.back().LastNode();
+ int avoidFace = node->IsLinked( polygon->_links.back().FirstNode()->_intPoint );
+ for ( i = nbLinks - 2; i >= 0; --i )
+ if ( node->IsLinked( polygon->_links[i].FirstNode()->_intPoint, avoidFace ))
+ break;
+ if ( i >= 0 )
+ {
+ for ( ; i < nbLinks; ++i )
+ newLinks.push_back( polygon->_links[i] );
+ }
+ else
+ {
+ // find a node lying on the same FACE as the first one
+ node = polygon->_links[0].FirstNode();
+ avoidFace = node->IsLinked( polygon->_links[0].LastNode()->_intPoint );
+ for ( i = 1; i < nbLinks; ++i )
+ if ( node->IsLinked( polygon->_links[i].LastNode()->_intPoint, avoidFace ))
+ break;
+ if ( i < nbLinks )
+ for ( nbLinks = i + 1, i = 0; i < nbLinks; ++i )
+ newLinks.push_back( polygon->_links[i] );
+ }
+ if ( newLinks.size() > 1 )
+ {
+ polygon->_links.swap( newLinks );
+ chainNodes.clear();
+ chainNodes.push_back( polygon->_links.back().LastNode() );
+ chainNodes.push_back( polygon->_links[0].FirstNode() );
+ return true;
+ }
+ return false;
+ }
+ //================================================================================
+ /*!
+ * \brief Checks transition at the 1st node of a link
+ */
+ bool Hexahedron::is1stNodeOut( _Link& link /*int iLink*/ ) const
+ {
+ // new version is for the case: tangent transition at the 1st node
+ bool isOut = false;
+ if ( link._fIntNodes.size() > 1 )
+ {
+ // check transition at the next intersection
+ switch ( link._fIntPoints[1]->_transition ) {
+ case Trans_OUT: return false;
+ case Trans_IN : return true;
+ default: ; // tangent transition
+ }
+ }
+ gp_Pnt p1 = link._nodes[0]->Point();
+ gp_Pnt p2 = link._nodes[1]->Point();
+ gp_Pnt testPnt = 0.8 * p1.XYZ() + 0.2 * p2.XYZ();
+
+ TGeomID faceID = link._fIntPoints[0]->_faceIDs[0];
+ const TopoDS_Face& face = TopoDS::Face( _grid->_shapes( faceID ));
+ TopLoc_Location loc;
+ GeomAPI_ProjectPointOnSurf& proj =
+ _grid->_helper->GetProjector( face, loc, 0.1*_grid->_tol );
+ testPnt.Transform( loc );
+ proj.Perform( testPnt );
+ if ( proj.IsDone() &&
+ proj.NbPoints() > 0 &&
+ proj.LowerDistance() > _grid->_tol )
+ {
+ Quantity_Parameter u,v;
+ proj.LowerDistanceParameters( u,v );
+ gp_Dir normal;
+ if ( GeomLib::NormEstim( BRep_Tool::Surface( face, loc ),
+ gp_Pnt2d( u,v ),
+ 0.1*_grid->_tol,
+ normal ) < 3 )
+ {
+ if ( face.Orientation() == TopAbs_REVERSED )
+ normal.Reverse();
+ gp_Vec v( proj.NearestPoint(), testPnt );
+ return v * normal > 0;
+ }
+ }
+ // if ( !_hexLinks[ iLink ]._nodes[0]->Node() ) // no node
+ // return true;
+ // if ( !_hexLinks[ iLink ]._nodes[0]->_intPoint ) // no intersection with geometry
+ // return false;
+ // switch ( _hexLinks[ iLink ]._nodes[0]->FaceIntPnt()->_transition ) {
+ // case Trans_OUT: return true;
+ // case Trans_IN : return false;
+ // default: ; // tangent transition
+ // }
+
+// // ijk of a GridLine corresponding to the link
+// int iDir = iLink / 4;
+// int indSub = iLink % 4;
+// LineIndexer li = _grid->GetLineIndexer( iDir );
+// li.SetIJK( _i,_j,_k );
+// size_t lineIndex[4] = { li.LineIndex (),
+// li.LineIndex10(),
+// li.LineIndex01(),
+// li.LineIndex11() };
+// GridLine& line = _grid->_lines[ iDir ][ lineIndex[ indSub ]];
+
+// // analyze transition of previous ip
+// bool isOut = true;
+// multiset< F_IntersectPoint >::const_iterator ip = line._intPoints.begin();
+// for ( ; ip != line._intPoints.end(); ++ip )
+// {
+// if ( &(*ip) == _hexLinks[ iLink ]._nodes[0]->_intPoint )
+// break;
+// switch ( ip->_transition ) {
+// case Trans_OUT: isOut = true;
+// case Trans_IN : isOut = false;
+// default:;
+// }
+// }
+// #ifdef _DEBUG_
+// if ( ip == line._intPoints.end() )
+// cout << "BUG: Wrong GridLine. IKJ = ( "<< _i << " " << _j << " " << _k << " )" << endl;
+// #endif
+ return isOut;
+ }
//================================================================================
/*!
* \brief Adds computed elements to the mesh
// add elements resulted from hexahedron intersection
//for ( size_t i = 0; i < _volumeDefs.size(); ++i )
{
- vector< const SMDS_MeshNode* >& nodes = _volumeDefs._nodes;
-
+ vector< const SMDS_MeshNode* > nodes( _volumeDefs._nodes.size() );
+ for ( size_t iN = 0; iN < nodes.size(); ++iN )
+ if ( !( nodes[iN] = _volumeDefs._nodes[iN]->Node() ))
+ {
+ if ( const E_IntersectPoint* eip = _volumeDefs._nodes[iN]->EdgeIntPnt() )
+ nodes[iN] = _volumeDefs._nodes[iN]->_intPoint->_node =
+ helper.AddNode( eip->_point.X(),
+ eip->_point.Y(),
+ eip->_point.Z() );
+ else
+ throw SALOME_Exception("Bug: no node at intersection point");
+ }
+
if ( !_volumeDefs._quantities.empty() )
{
helper.AddPolyhedralVolume( nodes, _volumeDefs._quantities );
*/
bool Hexahedron::isInHole() const
{
+ if ( !_vIntNodes.empty() )
+ return false;
+
const int ijk[3] = { _i, _j, _k };
- IntersectionPoint curIntPnt;
+ F_IntersectPoint curIntPnt;
// consider a cell to be in a hole if all links in any direction
// comes OUT of geometry
{
const _Link& link = _hexLinks[ iL + 4*iDir ];
// check transition of the first node of a link
- const IntersectionPoint* firstIntPnt = 0;
+ const F_IntersectPoint* firstIntPnt = 0;
if ( link._nodes[0]->Node() ) // 1st node is a hexa corner
{
curIntPnt._paramOnLine = coords[ ijk[ iDir ]] - coords[0];
const GridLine& line = _grid->_lines[ iDir ][ lineIndex[ iL ]];
- multiset< IntersectionPoint >::const_iterator ip =
+ multiset< F_IntersectPoint >::const_iterator ip =
line._intPoints.upper_bound( curIntPnt );
--ip;
firstIntPnt = &(*ip);
}
- else if ( !link._intNodes.empty() )
+ else if ( !link._fIntPoints.empty() )
{
- firstIntPnt = link._intNodes[0]._intPoint;
+ firstIntPnt = link._fIntPoints[0];
}
if ( firstIntPnt )
{
const _Face& polygon = _polygons[iP];
gp_XYZ area (0,0,0);
- SMESH_TNodeXYZ p1 ( polygon._links[ 0 ].FirstNode()->Node() );
+ gp_XYZ p1 = polygon._links[ 0 ].FirstNode()->Point().XYZ();
for ( size_t iL = 0; iL < polygon._links.size(); ++iL )
{
- SMESH_TNodeXYZ p2 ( polygon._links[ iL ].LastNode()->Node() );
+ gp_XYZ p2 = polygon._links[ iL ].LastNode()->Point().XYZ();
area += p1 ^ p2;
p1 = p2;
}
_polygons[4]._links.size() != 4 ||
_polygons[5]._links.size() != 4 )
return false;
- const SMDS_MeshNode* nodes[8];
+ _Node* nodes[8];
int nbN = 0;
for ( int iL = 0; iL < 4; ++iL )
{
// a base node
- nodes[iL] = _polygons[0]._links[iL].FirstNode()->Node();
+ nodes[iL] = _polygons[0]._links[iL].FirstNode();
++nbN;
// find a top node above the base node
_Link* link = _polygons[0]._links[iL]._link;
- ASSERT( link->_faces.size() > 1 );
+ //ASSERT( link->_faces.size() > 1 );
+ if ( !link->_faces[0] || !link->_faces[1] )
+ return debugDumpLink( link );
// a quadrangle sharing <link> with _polygons[0]
_Face* quad = link->_faces[ bool( link->_faces[0] == & _polygons[0] )];
for ( int i = 0; i < 4; ++i )
if ( quad->_links[i]._link == link )
{
// 1st node of a link opposite to <link> in <quad>
- nodes[iL+4] = quad->_links[(i+2)%4].FirstNode()->Node();
+ nodes[iL+4] = quad->_links[(i+2)%4].FirstNode();
++nbN;
break;
}
}
if ( nbN == 8 )
- _volumeDefs.set( vector< const SMDS_MeshNode* >( nodes, nodes+8 ));
+ _volumeDefs.set( vector< _Node* >( nodes, nodes+8 ));
return nbN == 8;
}
*/
bool Hexahedron::addTetra()
{
- const SMDS_MeshNode* nodes[4];
- nodes[0] = _polygons[0]._links[0].FirstNode()->Node();
- nodes[1] = _polygons[0]._links[1].FirstNode()->Node();
- nodes[2] = _polygons[0]._links[2].FirstNode()->Node();
+ _Node* nodes[4];
+ nodes[0] = _polygons[0]._links[0].FirstNode();
+ nodes[1] = _polygons[0]._links[1].FirstNode();
+ nodes[2] = _polygons[0]._links[2].FirstNode();
_Link* link = _polygons[0]._links[0]._link;
- ASSERT( link->_faces.size() > 1 );
+ //ASSERT( link->_faces.size() > 1 );
+ if ( !link->_faces[0] || !link->_faces[1] )
+ return debugDumpLink( link );
// a triangle sharing <link> with _polygons[0]
_Face* tria = link->_faces[ bool( link->_faces[0] == & _polygons[0] )];
for ( int i = 0; i < 3; ++i )
if ( tria->_links[i]._link == link )
{
- nodes[3] = tria->_links[(i+1)%3].LastNode()->Node();
- _volumeDefs.set( vector< const SMDS_MeshNode* >( nodes, nodes+4 ));
+ nodes[3] = tria->_links[(i+1)%3].LastNode();
+ _volumeDefs.set( vector< _Node* >( nodes, nodes+4 ));
return true;
}
if ( iTri < 0 ) return false;
// find nodes
- const SMDS_MeshNode* nodes[6];
+ _Node* nodes[6];
int nbN = 0;
for ( int iL = 0; iL < 3; ++iL )
{
// a base node
- nodes[iL] = _polygons[ iTri ]._links[iL].FirstNode()->Node();
+ nodes[iL] = _polygons[ iTri ]._links[iL].FirstNode();
++nbN;
// find a top node above the base node
_Link* link = _polygons[ iTri ]._links[iL]._link;
- ASSERT( link->_faces.size() > 1 );
+ //ASSERT( link->_faces.size() > 1 );
+ if ( !link->_faces[0] || !link->_faces[1] )
+ return debugDumpLink( link );
// a quadrangle sharing <link> with a base triangle
_Face* quad = link->_faces[ bool( link->_faces[0] == & _polygons[ iTri ] )];
if ( quad->_links.size() != 4 ) return false;
if ( quad->_links[i]._link == link )
{
// 1st node of a link opposite to <link> in <quad>
- nodes[iL+3] = quad->_links[(i+2)%4].FirstNode()->Node();
+ nodes[iL+3] = quad->_links[(i+2)%4].FirstNode();
++nbN;
break;
}
}
if ( nbN == 6 )
- _volumeDefs.set( vector< const SMDS_MeshNode* >( nodes, nodes+6 ));
+ _volumeDefs.set( vector< _Node* >( nodes, nodes+6 ));
return ( nbN == 6 );
}
if ( iQuad < 0 ) return false;
// find nodes
- const SMDS_MeshNode* nodes[5];
- nodes[0] = _polygons[iQuad]._links[0].FirstNode()->Node();
- nodes[1] = _polygons[iQuad]._links[1].FirstNode()->Node();
- nodes[2] = _polygons[iQuad]._links[2].FirstNode()->Node();
- nodes[3] = _polygons[iQuad]._links[3].FirstNode()->Node();
+ _Node* nodes[5];
+ nodes[0] = _polygons[iQuad]._links[0].FirstNode();
+ nodes[1] = _polygons[iQuad]._links[1].FirstNode();
+ nodes[2] = _polygons[iQuad]._links[2].FirstNode();
+ nodes[3] = _polygons[iQuad]._links[3].FirstNode();
_Link* link = _polygons[iQuad]._links[0]._link;
- ASSERT( link->_faces.size() > 1 );
+ //ASSERT( link->_faces.size() > 1 );
+ if ( !link->_faces[0] || !link->_faces[1] )
+ return debugDumpLink( link );
// a triangle sharing <link> with a base quadrangle
_Face* tria = link->_faces[ bool( link->_faces[0] == & _polygons[ iQuad ] )];
for ( int i = 0; i < 3; ++i )
if ( tria->_links[i]._link == link )
{
- nodes[4] = tria->_links[(i+1)%3].LastNode()->Node();
- _volumeDefs.set( vector< const SMDS_MeshNode* >( nodes, nodes+5 ));
+ nodes[4] = tria->_links[(i+1)%3].LastNode();
+ _volumeDefs.set( vector< _Node* >( nodes, nodes+5 ));
return true;
}
return false;
}
+ //================================================================================
+ /*!
+ * \brief Dump a link and return \c false
+ */
+ bool Hexahedron::debugDumpLink( Hexahedron::_Link* link )
+ {
+#ifdef _DEBUG_
+ gp_Pnt p1 = link->_nodes[0]->Point(), p2 = link->_nodes[1]->Point();
+ cout << "BUG: not shared link. IKJ = ( "<< _i << " " << _j << " " << _k << " )" << endl
+ << "n1 (" << p1.X() << ", "<< p1.Y() << ", "<< p1.Z() << " )" << endl
+ << "n2 (" << p2.X() << ", "<< p2.Y() << ", "<< p2.Z() << " )" << endl;
+#endif
+ return false;
+ }
+
+ //================================================================================
+ /*!
+ * \brief computes exact bounding box with axes parallel to given ones
+ */
+ //================================================================================
+
+ void getExactBndBox( const vector< TopoDS_Shape >& faceVec,
+ const double* axesDirs,
+ Bnd_Box& shapeBox )
+ {
+ BRep_Builder b;
+ TopoDS_Compound allFacesComp;
+ b.MakeCompound( allFacesComp );
+ for ( size_t iF = 0; iF < faceVec.size(); ++iF )
+ b.Add( allFacesComp, faceVec[ iF ] );
+
+ double sP[6]; // aXmin, aYmin, aZmin, aXmax, aYmax, aZmax
+ shapeBox.Get(sP[0],sP[1],sP[2],sP[3],sP[4],sP[5]);
+ double farDist = 0;
+ for ( int i = 0; i < 6; ++i )
+ farDist = Max( farDist, 10 * sP[i] );
+
+ gp_XYZ axis[3] = { gp_XYZ( axesDirs[0], axesDirs[1], axesDirs[2] ),
+ gp_XYZ( axesDirs[3], axesDirs[4], axesDirs[5] ),
+ gp_XYZ( axesDirs[6], axesDirs[7], axesDirs[8] ) };
+ axis[0].Normalize();
+ axis[1].Normalize();
+ axis[2].Normalize();
+
+ gp_Mat basis( axis[0], axis[1], axis[2] );
+ gp_Mat bi = basis.Inverted();
+
+ gp_Pnt pMin, pMax;
+ for ( int iDir = 0; iDir < 3; ++iDir )
+ {
+ gp_XYZ axis0 = axis[ iDir ];
+ gp_XYZ axis1 = axis[ ( iDir + 1 ) % 3 ];
+ gp_XYZ axis2 = axis[ ( iDir + 2 ) % 3 ];
+ for ( int isMax = 0; isMax < 2; ++isMax )
+ {
+ double shift = isMax ? farDist : -farDist;
+ gp_XYZ orig = shift * axis0;
+ gp_XYZ norm = axis1 ^ axis2;
+ gp_Pln pln( orig, norm );
+ norm = pln.Axis().Direction().XYZ();
+ BRepBuilderAPI_MakeFace plane( pln, -farDist, farDist, -farDist, farDist );
+
+ gp_Pnt& pAxis = isMax ? pMax : pMin;
+ gp_Pnt pPlane, pFaces;
+ double dist = GEOMUtils::GetMinDistance( plane, allFacesComp, pPlane, pFaces );
+ if ( dist < 0 )
+ {
+ Bnd_B3d bb;
+ gp_XYZ corner;
+ for ( int i = 0; i < 2; ++i ) {
+ corner.SetCoord( 1, sP[ i*3 ]);
+ for ( int j = 0; j < 2; ++j ) {
+ corner.SetCoord( 2, sP[ i*3 + 1 ]);
+ for ( int k = 0; k < 2; ++k )
+ {
+ corner.SetCoord( 3, sP[ i*3 + 2 ]);
+ corner *= bi;
+ bb.Add( corner );
+ }
+ }
+ }
+ corner = isMax ? bb.CornerMax() : bb.CornerMin();
+ pAxis.SetCoord( iDir+1, corner.Coord( iDir+1 ));
+ }
+ else
+ {
+ gp_XYZ pf = pFaces.XYZ() * bi;
+ pAxis.SetCoord( iDir+1, pf.Coord( iDir+1 ) );
+ }
+ }
+ } // loop on 3 axes
+
+ shapeBox.SetVoid();
+ shapeBox.Add( pMin );
+ shapeBox.Add( pMax );
+
+ return;
+ }
} // namespace
_computeCanceled = false;
+ SMESH_MesherHelper helper( theMesh );
+
try
{
Grid grid;
+ grid._helper = &helper;
- TopTools_MapOfShape faceMap;
- for ( TopExp_Explorer fExp( theShape, TopAbs_FACE ); fExp.More(); fExp.Next() )
- if ( !faceMap.Add( fExp.Current() ))
- faceMap.Remove( fExp.Current() ); // remove a face shared by two solids
-
+ vector< TopoDS_Shape > faceVec;
+ {
+ TopTools_MapOfShape faceMap;
+ TopExp_Explorer fExp;
+ for ( fExp.Init( theShape, TopAbs_FACE ); fExp.More(); fExp.Next() )
+ if ( !faceMap.Add( fExp.Current() ))
+ faceMap.Remove( fExp.Current() ); // remove a face shared by two solids
+
+ for ( fExp.ReInit(); fExp.More(); fExp.Next() )
+ if ( faceMap.Contains( fExp.Current() ))
+ faceVec.push_back( fExp.Current() );
+ }
+ vector<FaceGridIntersector> facesItersectors( faceVec.size() );
+ map< TGeomID, vector< TGeomID > > edge2faceIDsMap;
+ TopExp_Explorer eExp;
Bnd_Box shapeBox;
- vector<FaceGridIntersector> facesItersectors( faceMap.Extent() );
- TopTools_MapIteratorOfMapOfShape faceMppIt( faceMap );
- for ( int i = 0; faceMppIt.More(); faceMppIt.Next(), ++i )
+ for ( int i = 0; i < faceVec.size(); ++i )
{
- facesItersectors[i]._face = TopoDS::Face( faceMppIt.Key() );
- facesItersectors[i]._grid = &grid;
+ facesItersectors[i]._face = TopoDS::Face ( faceVec[i] );
+ facesItersectors[i]._faceID = grid._shapes.Add( faceVec[i] );
+ facesItersectors[i]._grid = &grid;
shapeBox.Add( facesItersectors[i].GetFaceBndBox() );
+
+ if ( _hyp->GetToAddEdges() )
+ {
+ helper.SetSubShape( faceVec[i] );
+ for ( eExp.Init( faceVec[i], TopAbs_EDGE ); eExp.More(); eExp.Next() )
+ {
+ const TopoDS_Edge& edge = TopoDS::Edge( eExp.Current() );
+ if ( !SMESH_Algo::isDegenerated( edge ) &&
+ !helper.IsRealSeam( edge ))
+ edge2faceIDsMap[ grid._shapes.Add( edge )].push_back( facesItersectors[i]._faceID );
+ }
+ }
}
+ getExactBndBox( faceVec, _hyp->GetAxisDirs(), shapeBox );
+
vector<double> xCoords, yCoords, zCoords;
_hyp->GetCoordinates( xCoords, yCoords, zCoords, shapeBox );
- grid.SetCoordinates( xCoords, yCoords, zCoords, theShape );
-
- // check if the grid encloses the shape
- if ( !_hyp->IsGridBySpacing(0) ||
- !_hyp->IsGridBySpacing(1) ||
- !_hyp->IsGridBySpacing(2) )
- {
- Bnd_Box gridBox;
- gridBox.Add( gp_Pnt( xCoords[0], yCoords[0], zCoords[0] ));
- gridBox.Add( gp_Pnt( xCoords.back(), yCoords.back(), zCoords.back() ));
- double x0,y0,z0, x1,y1,z1;
- shapeBox.Get(x0,y0,z0, x1,y1,z1);
- if ( gridBox.IsOut( gp_Pnt( x0,y0,z0 )) ||
- gridBox.IsOut( gp_Pnt( x1,y1,z1 )))
- for ( size_t i = 0; i < facesItersectors.size(); ++i )
- {
- if ( !facesItersectors[i].IsInGrid( gridBox ))
- return error("The grid doesn't enclose the geometry");
-#ifdef ELLIPSOLID_WORKAROUND
- delete facesItersectors[i]._surfaceInt, facesItersectors[i]._surfaceInt = 0;
-#endif
- }
- }
+ grid.SetCoordinates( xCoords, yCoords, zCoords, _hyp->GetAxisDirs(), shapeBox );
+
if ( _computeCanceled ) return false;
#ifdef WITH_TBB
for ( size_t i = 0; i < facesItersectors.size(); ++i )
facesItersectors[i].StoreIntersections();
- SMESH_MesherHelper helper( theMesh );
TopExp_Explorer solidExp (theShape, TopAbs_SOLID);
helper.SetSubShape( solidExp.Current() );
helper.SetElementsOnShape( true );
// create volume elements
Hexahedron hex( _hyp->GetSizeThreshold(), &grid );
- int nbAdded = hex.MakeElements( helper );
+ int nbAdded = hex.MakeElements( helper, edge2faceIDsMap );
SMESHDS_Mesh* meshDS = theMesh.GetMeshDS();
if ( nbAdded > 0 )
{
- // make all SOLIDS computed
+ // make all SOLIDs computed
if ( SMESHDS_SubMesh* sm1 = meshDS->MeshElements( solidExp.Current()) )
{
SMDS_ElemIteratorPtr volIt = sm1->GetElements();
// remove free nodes
if ( SMESHDS_SubMesh * smDS = meshDS->MeshElements( helper.GetSubShapeID() ))
{
- // intersection nodes
+ TIDSortedNodeSet nodesToRemove;
+ // get intersection nodes
for ( int iDir = 0; iDir < 3; ++iDir )
{
vector< GridLine >& lines = grid._lines[ iDir ];
for ( size_t i = 0; i < lines.size(); ++i )
{
- multiset< IntersectionPoint >::iterator ip = lines[i]._intPoints.begin();
+ multiset< F_IntersectPoint >::iterator ip = lines[i]._intPoints.begin();
for ( ; ip != lines[i]._intPoints.end(); ++ip )
if ( ip->_node && ip->_node->NbInverseElements() == 0 )
- meshDS->RemoveFreeNode( ip->_node, smDS, /*fromGroups=*/false );
+ nodesToRemove.insert( nodesToRemove.end(), ip->_node );
}
}
- // grid nodes
+ // get grid nodes
for ( size_t i = 0; i < grid._nodes.size(); ++i )
- if ( !grid._isBndNode[i] ) // nodes on boundary are already removed
- if ( grid._nodes[i] && grid._nodes[i]->NbInverseElements() == 0 )
- meshDS->RemoveFreeNode( grid._nodes[i], smDS, /*fromGroups=*/false );
+ if ( grid._nodes[i] && grid._nodes[i]->NbInverseElements() == 0 )
+ nodesToRemove.insert( nodesToRemove.end(), grid._nodes[i] );
+
+ // do remove
+ TIDSortedNodeSet::iterator n = nodesToRemove.begin();
+ for ( ; n != nodesToRemove.end(); ++n )
+ meshDS->RemoveFreeNode( *n, smDS, /*fromGroups=*/false );
}
return nbAdded;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
*/
//================================================================================
-StdMeshers_FaceSide::StdMeshers_FaceSide(UVPtStructVec& theSideNodes)
+StdMeshers_FaceSide::StdMeshers_FaceSide(UVPtStructVec& theSideNodes,
+ const TopoDS_Face& theFace)
{
myEdge.resize( 1 );
myEdgeID.resize( 1, -1 );
if ( !myPoints.empty() )
{
myPoints[0].normParam = 0;
- gp_Pnt pPrev = SMESH_TNodeXYZ( myPoints[0].node );
- for ( size_t i = 1; i < myPoints.size(); ++i )
+ if ( myPoints[0].node &&
+ myPoints.back().node &&
+ myPoints[ myNbPonits/2 ].node )
{
- gp_Pnt p = SMESH_TNodeXYZ( myPoints[i].node );
- myLength += ( myPoints[i].normParam = p.Distance( pPrev ));
- pPrev = p;
+ gp_Pnt pPrev = SMESH_TNodeXYZ( myPoints[0].node );
+ for ( size_t i = 1; i < myPoints.size(); ++i )
+ {
+ gp_Pnt p = SMESH_TNodeXYZ( myPoints[i].node );
+ myLength += p.Distance( pPrev );
+ myPoints[i].normParam = myLength;
+ pPrev = p;
+ }
+ }
+ else if ( !theFace.IsNull() )
+ {
+ TopLoc_Location loc;
+ Handle(Geom_Surface) surf = BRep_Tool::Surface( theFace, loc );
+ gp_Pnt pPrev = surf->Value( myPoints[0].u, myPoints[0].v );
+ for ( size_t i = 1; i < myPoints.size(); ++i )
+ {
+ gp_Pnt p = surf->Value( myPoints[i].u, myPoints[i].v );
+ myLength += p.Distance( pPrev );
+ myPoints[i].normParam = myLength;
+ pPrev = p;
+ }
+ }
+ else
+ {
+ gp_Pnt2d pPrev = myPoints[0].UV();
+ for ( size_t i = 1; i < myPoints.size(); ++i )
+ {
+ gp_Pnt2d p = myPoints[i].UV();
+ myLength += p.Distance( pPrev );
+ myPoints[i].normParam = myLength;
+ pPrev = p;
+ }
}
if ( myLength > std::numeric_limits<double>::min() )
for ( size_t i = 1; i < myPoints.size(); ++i )
}
for ( size_t i = 0; i < myEdge.size(); ++i )
{
+ if ( myEdge[i].IsNull() ) continue; // for a side on points only
double fp,lp;
Handle(Geom_Curve) C3d = BRep_Tool::Curve(myEdge[i],fp,lp);
if ( !C3d.IsNull() )
return myC2d[ i ]->Value(par);
}
+ else if ( !myPoints.empty() )
+ {
+ int i = U * double( myPoints.size()-1 );
+ while ( i > 0 && myPoints[ i ].normParam > U )
+ --i;
+ while ( i+1 < myPoints.size() && myPoints[ i+1 ].normParam < U )
+ ++i;
+ double r = (( U - myPoints[ i ].normParam ) /
+ ( myPoints[ i+1 ].normParam - myPoints[ i ].normParam ));
+ return ( myPoints[ i ].UV() * ( 1 - r ) +
+ myPoints[ i+1 ].UV() * r );
+ }
return myDefaultPnt2d;
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <Geom2d_Curve.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
#include <gp_Pnt2d.hxx>
class Adaptor2d_Curve2d;
class Adaptor3d_Curve;
class BRepAdaptor_CompCurve;
-class TopoDS_Face;
struct SMESH_ComputeError;
class StdMeshers_FaceSide;
/*!
* \brief Create a side from an UVPtStructVec
*/
- StdMeshers_FaceSide(UVPtStructVec& theSideNodes);
+ StdMeshers_FaceSide(UVPtStructVec& theSideNodes,
+ const TopoDS_Face& theFace = TopoDS_Face());
+
+ // static "consrtuctors"
+ static StdMeshers_FaceSidePtr New(const TopoDS_Face& Face,
+ const TopoDS_Edge& Edge,
+ SMESH_Mesh* Mesh,
+ const bool IsForward,
+ const bool IgnoreMediumNodes,
+ SMESH_ProxyMesh::Ptr ProxyMesh = SMESH_ProxyMesh::Ptr())
+ { return StdMeshers_FaceSidePtr
+ ( new StdMeshers_FaceSide( Face,Edge,Mesh,IsForward,IgnoreMediumNodes,ProxyMesh ));
+ }
+ static StdMeshers_FaceSidePtr New (const TopoDS_Face& Face,
+ std::list<TopoDS_Edge>& Edges,
+ SMESH_Mesh* Mesh,
+ const bool IsForward,
+ const bool IgnoreMediumNodes,
+ SMESH_ProxyMesh::Ptr ProxyMesh = SMESH_ProxyMesh::Ptr())
+ { return StdMeshers_FaceSidePtr
+ ( new StdMeshers_FaceSide( Face,Edges,Mesh,IsForward,IgnoreMediumNodes,ProxyMesh ));
+ }
+ static StdMeshers_FaceSidePtr New (const StdMeshers_FaceSide* Side,
+ const SMDS_MeshNode* Node,
+ const gp_Pnt2d* Pnt2d1,
+ const gp_Pnt2d* Pnt2d2=NULL,
+ const Handle(Geom2d_Curve)& C2d=NULL,
+ const double UFirst=0.,
+ const double ULast=1.)
+ { return StdMeshers_FaceSidePtr
+ ( new StdMeshers_FaceSide( Side,Node,Pnt2d1,Pnt2d2,C2d,UFirst,ULast ));
+ }
+ static StdMeshers_FaceSidePtr New (UVPtStructVec& theSideNodes,
+ const TopoDS_Face& theFace = TopoDS_Face())
+ {
+ return StdMeshers_FaceSidePtr( new StdMeshers_FaceSide( theSideNodes, theFace ));
+ }
/*!
* \brief Return wires of a face as StdMeshers_FaceSide's
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMESH : implementaion of SMESH idl descriptions
+// File : StdMeshers_Geometric1D.cxx
+// Module : SMESH
+//
+#include "StdMeshers_Geometric1D.hxx"
+
+#include "SMESH_Mesh.hxx"
+
+#include <BRepAdaptor_Curve.hxx>
+#include <GCPnts_AbscissaPoint.hxx>
+#include <SMESH_Algo.hxx>
+#include <TopExp.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+
+//=============================================================================
+/*!
+ * Constructor
+ */
+//=============================================================================
+
+StdMeshers_Geometric1D::StdMeshers_Geometric1D(int hypId, int studyId, SMESH_Gen * gen)
+ :StdMeshers_Reversible1D(hypId, studyId, gen)
+{
+ _begLength = 1.;
+ _ratio = 1.;
+ _name = "GeometricProgression";
+}
+
+//=============================================================================
+/*!
+ * Sets length of the first segment
+ */
+//=============================================================================
+
+void StdMeshers_Geometric1D::SetStartLength(double length)
+ throw(SALOME_Exception)
+{
+ if ( _begLength != length )
+ {
+ if (length <= 0)
+ throw SALOME_Exception(LOCALIZED("length must be positive"));
+ _begLength = length;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
+//=============================================================================
+/*!
+ * Sets value of Common Ratio
+ */
+//=============================================================================
+
+void StdMeshers_Geometric1D::SetCommonRatio(double factor)
+ throw(SALOME_Exception)
+{
+ if ( _ratio != factor )
+ {
+ if (factor == 0)
+ throw SALOME_Exception(LOCALIZED("Zero factor is not allowed"));
+ _ratio = factor;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
+//=============================================================================
+/*!
+ * Returns length of the first segment
+ */
+//=============================================================================
+
+double StdMeshers_Geometric1D::GetStartLength() const
+{
+ return _begLength;
+}
+
+//=============================================================================
+/*!
+ * Returns value of Common Ratio
+ */
+//=============================================================================
+
+double StdMeshers_Geometric1D::GetCommonRatio() const
+{
+ return _ratio;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+ostream & StdMeshers_Geometric1D::SaveTo(ostream & save)
+{
+ save << _begLength << " " << _ratio << " ";
+
+ StdMeshers_Reversible1D::SaveTo( save );
+
+ return save;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+istream & StdMeshers_Geometric1D::LoadFrom(istream & load)
+{
+ bool isOK = true;
+ isOK = (load >> _begLength);
+ isOK = (load >> _ratio);
+
+ if (isOK)
+ StdMeshers_Reversible1D::LoadFrom( load );
+
+ return load;
+}
+
+//================================================================================
+/*!
+ * \brief Initialize start and end length by the mesh built on the geometry
+ * \param theMesh - the built mesh
+ * \param theShape - the geometry of interest
+ * \retval bool - true if parameter values have been successfully defined
+ */
+//================================================================================
+
+bool StdMeshers_Geometric1D::SetParametersByMesh(const SMESH_Mesh* theMesh,
+ const TopoDS_Shape& theShape)
+{
+ if ( !theMesh || theShape.IsNull() )
+ return false;
+
+ _begLength = _ratio = 0.;
+
+ int nbEdges = 0;
+ TopTools_IndexedMapOfShape edgeMap;
+ TopExp::MapShapes( theShape, TopAbs_EDGE, edgeMap );
+ for ( int i = 1; i <= edgeMap.Extent(); ++i )
+ {
+ const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( i ));
+ BRepAdaptor_Curve C( edge );
+
+ vector< double > params;
+ if ( SMESH_Algo::GetNodeParamOnEdge( theMesh->GetMeshDS(), edge, params ))
+ {
+ nbEdges++;
+ double l1 = GCPnts_AbscissaPoint::Length( C, params[0], params[1] );
+ _begLength += l1;
+ if ( params.size() > 2 && l1 > 1e-100 )
+ _ratio += GCPnts_AbscissaPoint::Length( C, params[1], params[2]) / l1;
+ else
+ _ratio += 1;
+ }
+ }
+ if ( nbEdges ) {
+ _begLength /= nbEdges;
+ _ratio /= nbEdges;
+ }
+ else {
+ _begLength = 1;
+ _ratio = 1;
+ }
+ return nbEdges;
+}
+
+//================================================================================
+/*!
+ * \brief Initialize my parameter values by default parameters.
+ * \retval bool - true if parameter values have been successfully defined
+ */
+//================================================================================
+
+bool StdMeshers_Geometric1D::SetParametersByDefaults(const TDefaults& dflts,
+ const SMESH_Mesh* /*mesh*/)
+{
+ return ( _begLength = dflts._elemLength );
+}
+
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMESH : implementaion of SMESH idl descriptions
+// File : StdMeshers_Geometric1D.hxx
+// Module : SMESH
+//
+#ifndef _SMESH_Geometric1D_HXX_
+#define _SMESH_Geometric1D_HXX_
+
+#include "SMESH_StdMeshers.hxx"
+
+#include "StdMeshers_Reversible1D.hxx"
+#include "Utils_SALOME_Exception.hxx"
+
+class STDMESHERS_EXPORT StdMeshers_Geometric1D: public StdMeshers_Reversible1D
+{
+public:
+ StdMeshers_Geometric1D(int hypId, int studyId, SMESH_Gen* gen);
+
+ void SetStartLength(double length) throw(SALOME_Exception);
+ void SetCommonRatio(double factor) throw(SALOME_Exception);
+
+ double GetStartLength() const;
+ double GetCommonRatio() const;
+
+ virtual std::ostream & SaveTo(std::ostream & save);
+ virtual std::istream & LoadFrom(std::istream & load);
+
+ /*!
+ * \brief Initialize start and end length by the mesh built on the geometry
+ * \param theMesh - the built mesh
+ * \param theShape - the geometry of interest
+ * \retval bool - true if parameter values have been successfully defined
+ */
+ virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
+
+ /*!
+ * \brief Initialize my parameter values by default parameters.
+ * \retval bool - true if parameter values have been successfully defined
+ */
+ virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
+
+protected:
+ double _begLength, _ratio;
+};
+
+#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
* \brief Finds FaceQuadStruct having a side equal to a given one and rearranges
* the found FaceQuadStruct::side to have the given side at a Q_BOTTOM place
*/
- FaceQuadStructPtr getQuadWithBottom( StdMeshers_FaceSide* side,
- FaceQuadStructPtr quad[ 6 ])
+ FaceQuadStructPtr getQuadWithBottom( StdMeshers_FaceSidePtr side,
+ FaceQuadStructPtr quad[ 6 ])
{
FaceQuadStructPtr foundQuad;
for ( int i = 1; i < 6; ++i )
if ( !quad[i] ) continue;
for ( unsigned iS = 0; iS < quad[i]->side.size(); ++iS )
{
- const StdMeshers_FaceSide* side2 = quad[i]->side[iS];
+ const StdMeshers_FaceSidePtr side2 = quad[i]->side[iS];
if (( side->FirstVertex().IsSame( side2->FirstVertex() ) ||
side->FirstVertex().IsSame( side2->LastVertex() ))
&&
{
if ( iS != Q_BOTTOM )
{
- vector< StdMeshers_FaceSide*> newSides;
+ vector< FaceQuadStruct::Side > newSides;
for ( unsigned j = iS; j < quad[i]->side.size(); ++j )
newSides.push_back( quad[i]->side[j] );
for ( unsigned j = 0; j < iS; ++j )
//=============================================================================
/*!
* Generates hexahedron mesh on hexaedron like form using algorithm from
- * "Application de l'interpolation transfinie à la création de maillages
+ * "Application de l'interpolation transfinie � la cr�ation de maillages
* C0 ou G1 continus sur des triangles, quadrangles, tetraedres, pentaedres
- * et hexaedres déformés."
+ * et hexaedres d�form�s."
* Alain PERONNET - 8 janvier 1999
*/
//=============================================================================
for ( int i = 0; i < 6; ++i )
{
const TopoDS_Face& F = aCubeSide[i]._quad->face;
- StdMeshers_FaceSide* baseQuadSide = aCubeSide[i]._quad->side[ Q_BOTTOM ];
+ StdMeshers_FaceSidePtr baseQuadSide = aCubeSide[i]._quad->side[ Q_BOTTOM ];
list<TopoDS_Edge> baseEdges( baseQuadSide->Edges().begin(), baseQuadSide->Edges().end() );
// assure correctness of node positions on baseE:
return error( algo->GetComputeError());
}
+//================================================================================
+/*!
+ * \brief Return true if the algorithm can mesh this shape
+ * \param [in] aShape - shape to check
+ * \param [in] toCheckAll - if true, this check returns OK if all shapes are OK,
+ * else, returns OK if at least one shape is OK
+ */
+//================================================================================
+
+bool StdMeshers_Hexa_3D::IsApplicable( const TopoDS_Shape & aShape, bool toCheckAll )
+{
+ TopExp_Explorer exp0( aShape, TopAbs_SOLID );
+ if ( !exp0.More() ) return false;
+
+ for ( ; exp0.More(); exp0.Next() )
+ {
+ int nbFoundShells = 0;
+ TopExp_Explorer exp1( exp0.Current(), TopAbs_SHELL );
+ for ( ; exp1.More(); exp1.Next(), ++nbFoundShells)
+ if ( nbFoundShells == 2 ) break;
+ if ( nbFoundShells != 1 ) {
+ if ( toCheckAll ) return false;
+ continue;
+ }
+ exp1.Init( exp0.Current(), TopAbs_FACE );
+ int nbEdges = SMESH_MesherHelper::Count( exp1.Current(), TopAbs_EDGE, /*ignoreSame=*/true );
+ bool ok = ( nbEdges > 3 );
+ if ( toCheckAll && !ok ) return false;
+ if ( !toCheckAll && ok ) return true;
+ }
+ return toCheckAll;
+};
+
//=======================================================================
//function : ComputePentahedralMesh
//purpose :
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
+ static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
protected:
const StdMeshers_ViscousLayers* _viscousLayersHyp;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
algo->myProxyMesh->GetMesh() != helper->GetMesh() )
algo->myProxyMesh.reset( new SMESH_ProxyMesh( *helper->GetMesh() ));
- algo->myQuadStruct.reset();
+ algo->myQuadList.clear();
if ( helper )
algo->_quadraticMesh = helper->GetIsQuadratic();
//================================================================================
bool setBottomEdge( const TopoDS_Edge& botE,
- faceQuadStruct::Ptr& quad,
+ FaceQuadStruct::Ptr& quad,
const TopoDS_Shape& face)
{
- quad->side[ QUAD_TOP_SIDE ]->Reverse();
- quad->side[ QUAD_LEFT_SIDE ]->Reverse();
+ quad->side[ QUAD_TOP_SIDE ].grid->Reverse();
+ quad->side[ QUAD_LEFT_SIDE ].grid->Reverse();
int edgeIndex = 0;
for ( size_t i = 0; i < quad->side.size(); ++i )
{
- StdMeshers_FaceSide* quadSide = quad->side[i];
+ StdMeshers_FaceSidePtr quadSide = quad->side[i];
for ( int iE = 0; iE < quadSide->NbEdges(); ++iE )
if ( botE.IsSame( quadSide->Edge( iE )))
{
continue; // already computed prism
}
// find a source FACE of the SOLID: it's a FACE sharing a bottom EDGE with wFace
- const TopoDS_Edge& wEdge = (*wQuad)->side[ QUAD_TOP_SIDE ]->Edge(0);
+ const TopoDS_Edge& wEdge = (*wQuad)->side[ QUAD_TOP_SIDE ].grid->Edge(0);
PShapeIteratorPtr faceIt = myHelper->GetAncestors( wEdge, *myHelper->GetMesh(),
TopAbs_FACE);
while ( const TopoDS_Shape* f = faceIt->next() )
int nbKnownFaces;
do {
nbKnownFaces = faceMap.Extent();
- StdMeshers_FaceSide *rightSide, *topSide; // sides of the quad
+ StdMeshers_FaceSidePtr rightSide, topSide; // sides of the quad
for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
{
rightSide = thePrism.myWallQuads[i].back()->side[ QUAD_RIGHT_SIDE ];
{
for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
{
- StdMeshers_FaceSide* topSide = thePrism.myWallQuads[i].back()->side[ QUAD_TOP_SIDE ];
- const TopoDS_Edge & topE = topSide->Edge( 0 );
+ StdMeshers_FaceSidePtr topSide = thePrism.myWallQuads[i].back()->side[ QUAD_TOP_SIDE ];
+ const TopoDS_Edge & topE = topSide->Edge( 0 );
if ( topSide->NbEdges() > 1 )
return toSM( error(COMPERR_BAD_SHAPE, TCom("Side face #") <<
shapeID( thePrism.myWallQuads[i].back()->face )
// Check that the top FACE shares all the top EDGEs
for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
{
- StdMeshers_FaceSide* topSide = thePrism.myWallQuads[i].back()->side[ QUAD_TOP_SIDE ];
- const TopoDS_Edge & topE = topSide->Edge( 0 );
+ StdMeshers_FaceSidePtr topSide = thePrism.myWallQuads[i].back()->side[ QUAD_TOP_SIDE ];
+ const TopoDS_Edge & topE = topSide->Edge( 0 );
if ( !myHelper->IsSubShape( topE, thePrism.myTop ))
return toSM( error( TCom("Wrong source face (#") << shapeID( thePrism.myBottom )));
}
int wgt = 0; // "weight"
for ( ; quad != thePrism.myWallQuads[iW].end(); ++quad )
{
- StdMeshers_FaceSide* lftSide = (*quad)->side[ QUAD_LEFT_SIDE ];
+ StdMeshers_FaceSidePtr lftSide = (*quad)->side[ QUAD_LEFT_SIDE ];
for ( int i = 0; i < lftSide->NbEdges(); ++i )
{
++wgt;
quad = thePrism.myWallQuads[iW].begin();
for ( ; quad != thePrism.myWallQuads[iW].end(); ++quad )
for ( int i = 0; i < NB_QUAD_SIDES; ++i )
- (*quad)->side[ i ]->SetIgnoreMediumNodes( true );
+ (*quad)->side[ i ].grid->SetIgnoreMediumNodes( true );
}
}
Prism_3D::TQuadList::const_iterator quad = quads.begin();
for ( ; quad != quads.end(); ++quad )
{
- StdMeshers_FaceSide* rgtSide = (*quad)->side[ QUAD_RIGHT_SIDE ]; // tgt
- StdMeshers_FaceSide* lftSide = (*quad)->side[ QUAD_LEFT_SIDE ]; // src
+ StdMeshers_FaceSidePtr rgtSide = (*quad)->side[ QUAD_RIGHT_SIDE ]; // tgt
+ StdMeshers_FaceSidePtr lftSide = (*quad)->side[ QUAD_LEFT_SIDE ]; // src
bool swapLeftRight = ( lftSide->NbSegments( /*update=*/true ) == 0 &&
rgtSide->NbSegments( /*update=*/true ) > 0 );
if ( swapLeftRight )
// to compute stuctured quad mesh on wall FACEs
// ---------------------------------------------------
{
- const TopoDS_Edge& botE = (*quad)->side[ QUAD_BOTTOM_SIDE ]->Edge(0);
- const TopoDS_Edge& topE = (*quad)->side[ QUAD_TOP_SIDE ]->Edge(0);
+ const TopoDS_Edge& botE = (*quad)->side[ QUAD_BOTTOM_SIDE ].grid->Edge(0);
+ const TopoDS_Edge& topE = (*quad)->side[ QUAD_TOP_SIDE ].grid->Edge(0);
SMESH_subMesh* botSM = mesh->GetSubMesh( botE );
SMESH_subMesh* topSM = mesh->GetSubMesh( topE );
SMESH_subMesh* srcSM = botSM;
return myHelper->GetMeshDS()->ShapeToIndex( S );
}
+namespace // utils used by StdMeshers_Prism_3D::IsApplicable()
+{
+ struct EdgeWithNeighbors
+ {
+ TopoDS_Edge _edge;
+ int _iL, _iR;
+ EdgeWithNeighbors(const TopoDS_Edge& E, int iE, int nbE, int shift = 0 ):
+ _edge( E ),
+ _iL( SMESH_MesherHelper::WrapIndex( iE-1, nbE ) + shift ),
+ _iR( SMESH_MesherHelper::WrapIndex( iE+1, nbE ) + shift )
+ {
+ }
+ EdgeWithNeighbors() {}
+ };
+ struct PrismSide
+ {
+ TopoDS_Face _face;
+ TopTools_IndexedMapOfShape *_faces; // pointer because its copy constructor is private
+ TopoDS_Edge _topEdge;
+ vector< EdgeWithNeighbors >*_edges;
+ int _iBotEdge;
+ vector< bool > _isCheckedEdge;
+ int _nbCheckedEdges; // nb of EDGEs whose location is defined
+ PrismSide *_leftSide;
+ PrismSide *_rightSide;
+ const TopoDS_Edge& Edge( int i ) const
+ {
+ return (*_edges)[ i ]._edge;
+ }
+ int FindEdge( const TopoDS_Edge& E ) const
+ {
+ for ( size_t i = 0; i < _edges->size(); ++i )
+ if ( E.IsSame( Edge( i ))) return i;
+ return -1;
+ }
+ };
+ //--------------------------------------------------------------------------------
+ /*!
+ * \brief Return ordered edges of a face
+ */
+ bool getEdges( const TopoDS_Face& face,
+ vector< EdgeWithNeighbors > & edges,
+ const bool noHolesAllowed)
+ {
+ list< TopoDS_Edge > ee;
+ list< int > nbEdgesInWires;
+ int nbW = SMESH_Block::GetOrderedEdges( face, ee, nbEdgesInWires );
+ if ( nbW > 1 && noHolesAllowed )
+ return false;
+
+ int iE, nbTot = 0;
+ list< TopoDS_Edge >::iterator e = ee.begin();
+ list< int >::iterator nbE = nbEdgesInWires.begin();
+ for ( ; nbE != nbEdgesInWires.end(); ++nbE )
+ for ( iE = 0; iE < *nbE; ++e, ++iE )
+ if ( SMESH_Algo::isDegenerated( *e ))
+ {
+ ee.erase( e );
+ --(*nbE);
+ --iE;
+ }
+ else
+ {
+ e->Orientation( TopAbs_FORWARD ); // for operator==() to work
+ }
+
+ edges.clear();
+ e = ee.begin();
+ for ( nbE = nbEdgesInWires.begin(); nbE != nbEdgesInWires.end(); ++nbE )
+ {
+ for ( iE = 0; iE < *nbE; ++e, ++iE )
+ edges.push_back( EdgeWithNeighbors( *e, iE, *nbE, nbTot ));
+ nbTot += *nbE;
+ }
+ return edges.size();
+ }
+ //--------------------------------------------------------------------------------
+ /*!
+ * \brief Return another faces sharing an edge
+ */
+ const TopoDS_Shape & getAnotherFace( const TopoDS_Face& face,
+ const TopoDS_Edge& edge,
+ TopTools_IndexedDataMapOfShapeListOfShape& facesOfEdge)
+ {
+ TopTools_ListIteratorOfListOfShape faceIt( facesOfEdge.FindFromKey( edge ));
+ for ( ; faceIt.More(); faceIt.Next() )
+ if ( !face.IsSame( faceIt.Value() ))
+ return faceIt.Value();
+ return face;
+ }
+}
+
+//================================================================================
+/*!
+ * \brief Return true if the algorithm can mesh this shape
+ * \param [in] aShape - shape to check
+ * \param [in] toCheckAll - if true, this check returns OK if all shapes are OK,
+ * else, returns OK if at least one shape is OK
+ */
+//================================================================================
+
+bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckAll)
+{
+ TopExp_Explorer sExp( shape, TopAbs_SOLID );
+ if ( !sExp.More() )
+ return false;
+
+ for ( ; sExp.More(); sExp.Next() )
+ {
+ // check nb shells
+ TopoDS_Shape shell;
+ TopExp_Explorer shExp( sExp.Current(), TopAbs_SHELL );
+ if ( shExp.More() ) {
+ shell = shExp.Current();
+ shExp.Next();
+ if ( shExp.More() )
+ shell.Nullify();
+ }
+ if ( shell.IsNull() ) {
+ if ( toCheckAll ) return false;
+ continue;
+ }
+ // get all faces
+ TopTools_IndexedMapOfShape allFaces;
+ TopExp::MapShapes( shell, TopAbs_FACE, allFaces );
+ if ( allFaces.Extent() < 3 ) {
+ if ( toCheckAll ) return false;
+ continue;
+ }
+ // is a box?
+ if ( allFaces.Extent() == 6 )
+ {
+ TopTools_IndexedMapOfOrientedShape map;
+ bool isBox = SMESH_Block::FindBlockShapes( TopoDS::Shell( shell ),
+ TopoDS_Vertex(), TopoDS_Vertex(), map );
+ if ( isBox ) {
+ if ( !toCheckAll ) return true;
+ continue;
+ }
+ }
+#ifdef _DEBUG_
+ TopTools_IndexedMapOfShape allShapes;
+ TopExp::MapShapes( shape, allShapes );
+#endif
+
+ TopTools_IndexedDataMapOfShapeListOfShape facesOfEdge;
+ TopTools_ListIteratorOfListOfShape faceIt;
+ TopExp::MapShapesAndAncestors( sExp.Current(), TopAbs_EDGE, TopAbs_FACE , facesOfEdge );
+ if ( facesOfEdge.IsEmpty() ) {
+ if ( toCheckAll ) return false;
+ continue;
+ }
+
+ typedef vector< EdgeWithNeighbors > TEdgeWithNeighborsVec;
+ vector< TEdgeWithNeighborsVec > faceEdgesVec( allFaces.Extent() + 1 );
+ TopTools_IndexedMapOfShape* facesOfSide = new TopTools_IndexedMapOfShape[ faceEdgesVec.size() ];
+ SMESHUtils::ArrayDeleter<TopTools_IndexedMapOfShape> delFacesOfSide( facesOfSide );
+
+ // try to use each face as a bottom one
+ bool prismDetected = false;
+ for ( int iF = 1; iF < allFaces.Extent() && !prismDetected; ++iF )
+ {
+ const TopoDS_Face& botF = TopoDS::Face( allFaces( iF ));
+
+ TEdgeWithNeighborsVec& botEdges = faceEdgesVec[ iF ];
+ if ( botEdges.empty() )
+ {
+ if ( !getEdges( botF, botEdges, /*noHoles=*/false ))
+ break;
+ if ( allFaces.Extent()-1 <= (int) botEdges.size() )
+ continue; // all faces are adjacent to botF - no top FACE
+ }
+ // init data of side FACEs
+ vector< PrismSide > sides( botEdges.size() );
+ for ( int iS = 0; iS < botEdges.size(); ++iS )
+ {
+ sides[ iS ]._topEdge = botEdges[ iS ]._edge;
+ sides[ iS ]._face = botF;
+ sides[ iS ]._leftSide = & sides[ botEdges[ iS ]._iR ];
+ sides[ iS ]._rightSide = & sides[ botEdges[ iS ]._iL ];
+ sides[ iS ]._faces = & facesOfSide[ iS ];
+ sides[ iS ]._faces->Clear();
+ }
+
+ bool isOK = true; // ok for a current botF
+ bool isAdvanced = true;
+ int nbFoundSideFaces = 0;
+ for ( int iLoop = 0; isOK && isAdvanced; ++iLoop )
+ {
+ isAdvanced = false;
+ for ( size_t iS = 0; iS < sides.size() && isOK; ++iS )
+ {
+ PrismSide& side = sides[ iS ];
+ if ( side._face.IsNull() )
+ continue;
+ if ( side._topEdge.IsNull() )
+ {
+ // find vertical EDGEs --- EGDEs shared with neighbor side FACEs
+ for ( int is2nd = 0; is2nd < 2 && isOK; ++is2nd ) // 2 adjacent neighbors
+ {
+ int di = is2nd ? 1 : -1;
+ const PrismSide* adjSide = is2nd ? side._rightSide : side._leftSide;
+ for ( size_t i = 1; i < side._edges->size(); ++i )
+ {
+ int iE = SMESH_MesherHelper::WrapIndex( i*di + side._iBotEdge, side._edges->size());
+ if ( side._isCheckedEdge[ iE ] ) continue;
+ const TopoDS_Edge& vertE = side.Edge( iE );
+ const TopoDS_Shape& neighborF = getAnotherFace( side._face, vertE, facesOfEdge );
+ bool isEdgeShared = adjSide->_faces->Contains( neighborF );
+ if ( isEdgeShared )
+ {
+ isAdvanced = true;
+ side._isCheckedEdge[ iE ] = true;
+ side._nbCheckedEdges++;
+ int nbNotCheckedE = side._edges->size() - side._nbCheckedEdges;
+ if ( nbNotCheckedE == 1 )
+ break;
+ }
+ else
+ {
+ if ( i == 1 && iLoop == 0 ) isOK = false;
+ break;
+ }
+ }
+ }
+ // find a top EDGE
+ int nbNotCheckedE = side._edges->size() - side._nbCheckedEdges;
+ if ( nbNotCheckedE == 1 )
+ {
+ vector<bool>::iterator ii = std::find( side._isCheckedEdge.begin(),
+ side._isCheckedEdge.end(), false );
+ if ( ii != side._isCheckedEdge.end() )
+ {
+ size_t iE = std::distance( side._isCheckedEdge.begin(), ii );
+ side._topEdge = side.Edge( iE );
+ }
+ }
+ isOK = ( nbNotCheckedE >= 1 );
+ }
+ else //if ( !side._topEdge.IsNull() )
+ {
+ // get a next face of a side
+ const TopoDS_Shape& f = getAnotherFace( side._face, side._topEdge, facesOfEdge );
+ side._faces->Add( f );
+ bool stop = false;
+ if ( f.IsSame( side._face ) || // _topEdge is a seam
+ SMESH_MesherHelper::Count( f, TopAbs_WIRE, false ) != 1 )
+ {
+ stop = true;
+ }
+ else if ( side._leftSide != & side ) // not closed side face
+ {
+ if ( side._leftSide->_faces->Contains( f ))
+ {
+ stop = true;
+ side._leftSide->_face.Nullify();
+ side._leftSide->_topEdge.Nullify();
+ }
+ if ( side._rightSide->_faces->Contains( f ))
+ {
+ stop = true;
+ side._rightSide->_face.Nullify();
+ side._rightSide->_topEdge.Nullify();
+ }
+ }
+ if ( stop )
+ {
+ side._face.Nullify();
+ side._topEdge.Nullify();
+ continue;
+ }
+ side._face = TopoDS::Face( f );
+ int faceID = allFaces.FindIndex( side._face );
+ side._edges = & faceEdgesVec[ faceID ];
+ if ( side._edges->empty() )
+ if ( !getEdges( side._face, * side._edges, /*noHoles=*/true ))
+ break;
+ const int nbE = side._edges->size();
+ if ( nbE >= 4 )
+ {
+ isAdvanced = true;
+ ++nbFoundSideFaces;
+ side._iBotEdge = side.FindEdge( side._topEdge );
+ side._isCheckedEdge.clear();
+ side._isCheckedEdge.resize( nbE, false );
+ side._isCheckedEdge[ side._iBotEdge ] = true;
+ side._nbCheckedEdges = 1; // bottom EDGE is known
+ }
+ side._topEdge.Nullify();
+ isOK = ( !side._edges->empty() || side._faces->Extent() > 1 );
+
+ } //if ( !side._topEdge.IsNull() )
+
+ } // loop on prism sides
+
+ if ( nbFoundSideFaces > allFaces.Extent() )
+ {
+ isOK = false;
+ }
+ if ( iLoop > allFaces.Extent() * 10 )
+ {
+ isOK = false;
+#ifdef _DEBUG_
+ cerr << "BUG: infinite loop in StdMeshers_Prism_3D::IsApplicable()" << endl;
+#endif
+ }
+ } // while isAdvanced
+
+ if ( isOK && sides[0]._faces->Extent() > 1 )
+ {
+ const int nbFaces = sides[0]._faces->Extent();
+ if ( botEdges.size() == 1 ) // cylinder
+ {
+ prismDetected = ( nbFaces == allFaces.Extent()-1 );
+ }
+ else
+ {
+ const TopoDS_Shape& topFace = sides[0]._faces->FindKey( nbFaces );
+ size_t iS;
+ for ( iS = 1; iS < sides.size(); ++iS )
+ if ( !sides[ iS ]._faces->Contains( topFace ))
+ break;
+ prismDetected = ( iS == sides.size() );
+ }
+ }
+ } // loop on allFaces
+
+ if ( !prismDetected && toCheckAll ) return false;
+ if ( prismDetected && !toCheckAll ) return true;
+
+ } // loop on solids
+
+ return toCheckAll;
+}
+
namespace Prism_3D
{
//================================================================================
Prism_3D::TQuadList::const_iterator quad = thePrism.myWallQuads[ iE ].begin();
for ( ; quad != thePrism.myWallQuads[ iE ].end(); ++quad )
{
- const TopoDS_Edge& quadBot = (*quad)->side[ QUAD_BOTTOM_SIDE ]->Edge( 0 );
+ const TopoDS_Edge& quadBot = (*quad)->side[ QUAD_BOTTOM_SIDE ].grid->Edge( 0 );
if ( !myHelper->LoadNodeColumns( faceColumns, (*quad)->face, quadBot, meshDS ))
return error(COMPERR_BAD_INPUT_MESH, TCom("Can't find regular quadrangle mesh ")
<< "on a side face #" << MeshDS()->ShapeToIndex( (*quad)->face ));
Prism_3D::TQuadList::const_iterator quad = thePrism.myWallQuads[ iE ].begin();
for ( ; quad != thePrism.myWallQuads[ iE ].end(); ++quad )
{
- const TopoDS_Edge& quadBot = (*quad)->side[ QUAD_BOTTOM_SIDE ]->Edge( 0 );
+ const TopoDS_Edge& quadBot = (*quad)->side[ QUAD_BOTTOM_SIDE ].grid->Edge( 0 );
if ( !myHelper->LoadNodeColumns( faceColumns, (*quad)->face, quadBot, meshDS ))
return error(COMPERR_BAD_INPUT_MESH, TCom("Can't find regular quadrangle mesh ")
<< "on a side face #" << MeshDS()->ShapeToIndex( (*quad)->face ));
const int Z = isTop ? sideFace->ColumnHeight() - 1 : 0;
map<double, const SMDS_MeshNode* > u2nodes;
sideFace->GetNodesAtZ( Z, u2nodes );
+ if ( u2nodes.empty() )
+ return;
SMESH_MesherHelper helper( *sideFace->GetMesh() );
helper.SetSubShape( horFace );
map< double, gp_XY >::const_iterator i1 = myUVmap.upper_bound( U );
if ( i1 == myUVmap.end() )
- return myUVmap.rbegin()->second;
+ return myUVmap.empty() ? gp_XY(0,0) : myUVmap.rbegin()->second;
if ( i1 == myUVmap.begin() )
return (*i1).second;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
* \param helper - helper initialized by mesh and shape to add prisms to
*/
static void AddPrisms( std::vector<const TNodeColumn*> & nodeColumns,
- SMESH_MesherHelper* helper);
+ SMESH_MesherHelper* helper);
-private:
+ static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
+
+ private:
/*!
* \brief Analyse shape geometry and mesh.
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
map< double, const SMDS_MeshNode* >::iterator u_oldNode, u_newNode, u_newOnSeam, newEnd;
set< const SMDS_MeshNode* > seamNodes;
- // mapper puts on a seam edge nodes from 2 edges
+ // mapper changed, no more "mapper puts on a seam edge nodes from 2 edges"
if ( isSeam && ! getBoundaryNodes ( sm, tgtFace, u2nodesOnSeam, seamNodes ))
- RETURN_BAD_RESULT("getBoundaryNodes() failed");
+ ;//RETURN_BAD_RESULT("getBoundaryNodes() failed");
SMDS_NodeIteratorPtr nIt = smDS->GetNodes();
while ( nIt->more() )
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
/*!
* \brief Return an edge from which hypotheses are propagated from
*/
- static TopoDS_Edge GetSource(SMESH_subMesh * submesh);
+ static TopoDS_Edge GetSource(SMESH_subMesh * submesh,
+ bool& isPropagOfDistribution);
/*!
* \brief Does it's main job
*/
_name = GetName();
_param_algo_dim = -1; // 1D auxiliary
}
+StdMeshers_PropagOfDistribution::StdMeshers_PropagOfDistribution (int hypId,
+ int studyId,
+ SMESH_Gen * gen)
+ : StdMeshers_Propagation(hypId, studyId, gen) { _name = GetName(); }
StdMeshers_Propagation::~StdMeshers_Propagation() {}
string StdMeshers_Propagation::GetName () { return "Propagation"; }
+string StdMeshers_PropagOfDistribution::GetName () { return "PropagOfDistribution"; }
ostream & StdMeshers_Propagation::SaveTo (ostream & save) { return save; }
istream & StdMeshers_Propagation::LoadFrom (istream & load) { return load; }
-ostream & operator << (ostream & save, StdMeshers_Propagation & hyp) { return hyp.SaveTo(save); }
-istream & operator >> (istream & load, StdMeshers_Propagation & hyp) { return hyp.LoadFrom(load); }
bool StdMeshers_Propagation::SetParametersByMesh(const SMESH_Mesh*,
const TopoDS_Shape& ) { return false; }
bool StdMeshers_Propagation::SetParametersByDefaults(const TDefaults&,const SMESH_Mesh*) { return false; }
void StdMeshers_Propagation::SetPropagationMgr(SMESH_subMesh* subMesh) { PropagationMgr::Set( subMesh ); }
/*!
- * \brief Return an edge from which hypotheses are propagated from
+ * \brief Return an edge from which hypotheses are propagated
*/
-TopoDS_Edge StdMeshers_Propagation::GetPropagationSource(SMESH_Mesh& theMesh,
- const TopoDS_Shape& theEdge)
+TopoDS_Edge StdMeshers_Propagation::GetPropagationSource(SMESH_Mesh& theMesh,
+ const TopoDS_Shape& theEdge,
+ bool& isPropagOfDistribution)
{
- return PropagationMgr::GetSource(theMesh.GetSubMeshContaining( theEdge ));
+ return PropagationMgr::GetSource( theMesh.GetSubMeshContaining( theEdge ),
+ isPropagOfDistribution);
}
//=============================================================================
struct PropagationMgrData : public EventListenerData
{
bool myForward; //!< true if a curve of edge in chain is codirected with one of source edge
+ bool myIsPropagOfDistribution; //!< type of Propagation hyp
PropagationMgrData( SubMeshState state=WAIT_PROPAG_HYP ): EventListenerData(true) {
- myType = state; myForward = true;
+ myType = state; myForward = true; myIsPropagOfDistribution = false;
}
void Init() {
myType = WAIT_PROPAG_HYP; mySubMeshes.clear(); myForward = true;
+ myIsPropagOfDistribution = false;
}
SubMeshState State() const {
return (SubMeshState) myType;
const SMESH_Hypothesis* getProagationHyp (SMESH_Mesh& theMesh,
const TopoDS_Shape& theEdge)
{
- static SMESH_HypoFilter propagHypFilter
- ( SMESH_HypoFilter::HasName( StdMeshers_Propagation::GetName ()));
+ static SMESH_HypoFilter propagHypFilter;
+ if ( propagHypFilter.IsEmpty() )
+ {
+ propagHypFilter.
+ Init( SMESH_HypoFilter::HasName( StdMeshers_Propagation::GetName ())).
+ Or ( SMESH_HypoFilter::HasName( StdMeshers_PropagOfDistribution::GetName ()));
+ }
return theMesh.GetHypothesis( theEdge, propagHypFilter, true );
}
//================================================================================
PropagationMgrData* chainData = getData( theMainSubMesh );
chainData->SetState( HAS_PROPAG_HYP );
+ if ( const SMESH_Hypothesis * propagHyp = getProagationHyp( *mesh, theMainEdge ))
+ chainData->myIsPropagOfDistribution =
+ ( StdMeshers_PropagOfDistribution::GetName() == propagHyp->GetName() );
+
// Edge submeshes, to which the 1D hypothesis will be propagated from theMainEdge
list<SMESH_subMesh*> & chain = chainData->mySubMeshes;
chain.clear();
{
if ( findData( submesh )) return;
DBGMSG( "PropagationMgr::Set() on " << submesh->GetId() );
- EventListenerData* data = new PropagationMgrData();
+ PropagationMgrData* data = new PropagationMgrData();
submesh->SetEventListener( getListener(), data, submesh );
const SMESH_Hypothesis * propagHyp =
getProagationHyp( *submesh->GetFather(), submesh->GetSubShape() );
if ( propagHyp )
+ {
+ data->myIsPropagOfDistribution =
+ ( StdMeshers_PropagOfDistribution::GetName() == propagHyp->GetName() );
getListener()->ProcessEvent( SMESH_subMesh::ADD_HYP,
SMESH_subMesh::ALGO_EVENT,
submesh,
data,
propagHyp);
+ }
}
//================================================================================
/*!
*/
//================================================================================
- TopoDS_Edge PropagationMgr::GetSource(SMESH_subMesh * submesh)
+ TopoDS_Edge PropagationMgr::GetSource(SMESH_subMesh * submesh,
+ bool& isPropagOfDistribution)
{
if ( PropagationMgrData* data = findData( submesh )) {
if ( data->State() == IN_CHAIN ) {
TopoDS_Shape edge = sm->GetSubShape();
edge = edge.Oriented( data->myForward ? TopAbs_FORWARD : TopAbs_REVERSED );
DBGMSG( " GetSource() = edge " << sm->GetId() << " REV = " << (!data->myForward));
+ isPropagOfDistribution = false;
+ if ( PropagationMgrData* data = findData( sm ))
+ isPropagOfDistribution = data->myIsPropagOfDistribution;
if ( edge.ShapeType() == TopAbs_EDGE )
return TopoDS::Edge( edge );
}
*/
//================================================================================
- void PropagationMgr::ProcessEvent(const int event,
- const int eventType,
- SMESH_subMesh* subMesh,
+ void PropagationMgr::ProcessEvent(const int event,
+ const int eventType,
+ SMESH_subMesh* subMesh,
SMESH_subMeshEventListenerData* listenerData,
const SMESH_Hypothesis* hyp)
{
return;
DBGMSG( "PropagationMgr::ProcessEvent() on " << subMesh->GetId() );
- bool isPropagHyp = ( StdMeshers_Propagation::GetName() == hyp->GetName() );
+ bool isPropagHyp = ( StdMeshers_Propagation::GetName() == hyp->GetName() ||
+ StdMeshers_PropagOfDistribution::GetName() == hyp->GetName() );
PropagationMgrData* data = static_cast<PropagationMgrData*>( listenerData );
switch ( data->State() ) {
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
virtual std::ostream & SaveTo(std::ostream & save);
virtual std::istream & LoadFrom(std::istream & load);
- friend std::ostream & operator <<(std::ostream & save, StdMeshers_Propagation & hyp);
- friend std::istream & operator >>(std::istream & load, StdMeshers_Propagation & hyp);
static std::string GetName ();
* \param theEdge - edge to which hypotheses are propagated
* \retval TopoDS_Edge - source edge, also passing orientation
*/
- static TopoDS_Edge GetPropagationSource(SMESH_Mesh& theMesh, const TopoDS_Shape& theEdge);
+ static TopoDS_Edge GetPropagationSource(SMESH_Mesh& theMesh,
+ const TopoDS_Shape& theEdge,
+ bool& isPropagOfDistribution );
/*!
* \brief Initialize my parameter values by the mesh built on the geometry
virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
};
+
+// =======================================================================
+/*!
+ * \brief Propagation Of Distribution hypothesis
+ */
+// =======================================================================
+
+class STDMESHERS_EXPORT StdMeshers_PropagOfDistribution: public StdMeshers_Propagation
+{
+ public:
+ StdMeshers_PropagOfDistribution(int hypId, int studyId, SMESH_Gen * gen);
+
+ static std::string GetName();
+};
+
#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
}
}
+//================================================================================
+/*!
+ * \brief Set positions of enforced nodes
+ */
+//================================================================================
+
+void StdMeshers_QuadrangleParams::
+SetEnforcedNodes( const std::vector< TopoDS_Shape >& shapes,
+ const std::vector< gp_Pnt >& points )
+{
+ bool isChanged = ( shapes != _enforcedVertices ||
+ points.size() != _enforcedPoints.size() );
+ for ( size_t i = 0; i < points.size() && !isChanged; ++i )
+ isChanged = ( _enforcedPoints[ i ].SquareDistance( points[i] ) > 1e-100 );
+
+ if ( isChanged )
+ {
+ _enforcedVertices = shapes;
+ _enforcedPoints = points;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
+//================================================================================
+/*!
+ * \brief Returns positions of enforced nodes
+ */
+//================================================================================
+
+void StdMeshers_QuadrangleParams::
+GetEnforcedNodes( std::vector< TopoDS_Shape >& shapes,
+ std::vector< gp_Pnt >& points ) const
+{
+ shapes = _enforcedVertices;
+ points = _enforcedPoints;
+}
+
//=============================================================================
/*!
*
save << _triaVertexID << " UNDEFINED " << int(_quadType);
else
save << _triaVertexID << " " << _objEntry << " " << int(_quadType);
+
+ save << " " << _enforcedPoints.size();
+ for ( size_t i = 0; i < _enforcedPoints.size(); ++i )
+ save << " " << _enforcedPoints[i].X()
+ << " " << _enforcedPoints[i].Y()
+ << " " << _enforcedPoints[i].Z();
+
return save;
}
if (isOK)
_quadType = StdMeshers_QuadType(type);
+ // _enforcedVertices are loaded at StdMeshers_I level
+ // because GEOM objects are referred by study entry.
+
+ int nbP = 0;
+ double x,y,z;
+ if ( load >> nbP && nbP > 0 )
+ {
+ _enforcedPoints.reserve( nbP );
+ while ( _enforcedPoints.size() < _enforcedPoints.capacity() )
+ if ( load >> x &&
+ load >> y &&
+ load >> z )
+ _enforcedPoints.push_back( gp_Pnt( x,y,z ));
+ else
+ break;
+ }
return load;
}
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-ostream & operator <<(ostream & save, StdMeshers_QuadrangleParams & hyp)
-{
- return hyp.SaveTo( save );
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-istream & operator >>(istream & load, StdMeshers_QuadrangleParams & hyp)
-{
- return hyp.LoadFrom( load );
-}
-
//================================================================================
/*!
* \brief Redifined method
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#define _SMESH_QUADRANGLEPARAMS_HXX_
#include "SMESH_StdMeshers.hxx"
-
#include "SMESH_Hypothesis.hxx"
-#include "Utils_SALOME_Exception.hxx"
+
+#include <gp_Pnt.hxx>
+
+#include <vector>
+#include <string>
enum StdMeshers_QuadType
{
QUAD_NB_TYPES
};
-class STDMESHERS_EXPORT StdMeshers_QuadrangleParams:
- public SMESH_Hypothesis
+class STDMESHERS_EXPORT StdMeshers_QuadrangleParams: public SMESH_Hypothesis
{
public:
StdMeshers_QuadrangleParams(int hypId, int studyId, SMESH_Gen* gen);
void SetQuadType (StdMeshers_QuadType type);
StdMeshers_QuadType GetQuadType() const { return _quadType; }
+ void SetEnforcedNodes( const std::vector< TopoDS_Shape >& shapes,
+ const std::vector< gp_Pnt >& points );
+ void GetEnforcedNodes( std::vector< TopoDS_Shape >& shapes,
+ std::vector< gp_Pnt >& points ) const;
+
virtual std::ostream & SaveTo(std::ostream & save);
virtual std::istream & LoadFrom(std::istream & load);
- friend std::ostream& operator << (std::ostream & save,
- StdMeshers_QuadrangleParams & hyp);
- friend std::istream& operator >> (std::istream & load,
- StdMeshers_QuadrangleParams & hyp);
/*!
* \brief Initialize start and end length by the mesh built on the geometry
const SMESH_Mesh* theMesh=0);
protected:
- int _triaVertexID;
- std::string _objEntry;
- StdMeshers_QuadType _quadType;
+ int _triaVertexID;
+ std::string _objEntry;
+ StdMeshers_QuadType _quadType;
+ std::vector< TopoDS_Shape > _enforcedVertices;
+ std::vector< gp_Pnt > _enforcedPoints;
};
#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESH_Block.hxx"
#include "SMESH_Comment.hxx"
#include "SMESH_Gen.hxx"
+#include "SMESH_HypoFilter.hxx"
#include "SMESH_Mesh.hxx"
+#include "SMESH_MeshAlgos.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
#include "StdMeshers_FaceSide.hxx"
#include "StdMeshers_QuadrangleParams.hxx"
#include "StdMeshers_ViscousLayers2D.hxx"
+#include <BRepBndLib.hxx>
+#include <BRepClass_FaceClassifier.hxx>
#include <BRep_Tool.hxx>
+#include <Bnd_Box.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <Geom_Surface.hxx>
#include <NCollection_DefineArray2.hxx>
myTrianglePreference(false),
myTriaVertexID(-1),
myNeedSmooth(false),
+ myCheckOri(false),
+ myParams( NULL ),
myQuadType(QUAD_STANDARD),
- myHelper( 0 )
+ myHelper( NULL )
{
MESSAGE("StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D");
_name = "Quadrangle_2D";
const TopoDS_Shape& aShape,
SMESH_Hypothesis::Hypothesis_Status& aStatus)
{
- myTriaVertexID = -1;
- myQuadType = QUAD_STANDARD;
+ myTriaVertexID = -1;
+ myQuadType = QUAD_STANDARD;
myQuadranglePreference = false;
- myTrianglePreference = false;
- myQuadStruct.reset();
- myHelper = NULL;
+ myTrianglePreference = false;
+ myHelper = (SMESH_MesherHelper*)NULL;
+ myParams = NULL;
+ myQuadList.clear();
bool isOk = true;
- aStatus = SMESH_Hypothesis::HYP_OK;
+ aStatus = SMESH_Hypothesis::HYP_OK;
const list <const SMESHDS_Hypothesis * >& hyps =
GetUsedHypothesis(aMesh, aShape, false);
// First assigned hypothesis (if any) is processed now
if (hyps.size() > 0) {
aHyp = hyps.front();
- if (strcmp("QuadrangleParams", aHyp->GetName()) == 0) {
- const StdMeshers_QuadrangleParams* aHyp1 =
- (const StdMeshers_QuadrangleParams*)aHyp;
- myTriaVertexID = aHyp1->GetTriaVertex();
- myQuadType = aHyp1->GetQuadType();
+ if (strcmp("QuadrangleParams", aHyp->GetName()) == 0)
+ {
+ myParams = (const StdMeshers_QuadrangleParams*)aHyp;
+ myTriaVertexID = myParams->GetTriaVertex();
+ myQuadType = myParams->GetQuadType();
if (myQuadType == QUAD_QUADRANGLE_PREF ||
myQuadType == QUAD_QUADRANGLE_PREF_REVERSED)
myQuadranglePreference = true;
const TopoDS_Face& F = TopoDS::Face(aShape);
aMesh.GetSubMesh( F );
+ // do not initialize my fields before this as StdMeshers_ViscousLayers2D
+ // can call Compute() recursively
+ SMESH_ProxyMesh::Ptr proxyMesh = StdMeshers_ViscousLayers2D::Compute( aMesh, F );
+ if ( !proxyMesh )
+ return false;
+
+ myProxyMesh = proxyMesh;
+
SMESH_MesherHelper helper (aMesh);
myHelper = &helper;
- myProxyMesh = StdMeshers_ViscousLayers2D::Compute( aMesh, F );
- if ( !myProxyMesh )
- return false;
-
_quadraticMesh = myHelper->IsQuadraticSubMesh(aShape);
myNeedSmooth = false;
+ myCheckOri = false;
FaceQuadStruct::Ptr quad = CheckNbEdges( aMesh, F, /*considerMesh=*/true );
if (!quad)
return false;
- myQuadStruct = quad;
+ myQuadList.clear();
+ myQuadList.push_back( quad );
+
+ if ( !getEnforcedUV() )
+ return false;
updateDegenUV( quad );
+ int n1 = quad->side[0].NbPoints();
+ int n2 = quad->side[1].NbPoints();
+ int n3 = quad->side[2].NbPoints();
+ int n4 = quad->side[3].NbPoints();
+
enum { NOT_COMPUTED = -1, COMPUTE_FAILED = 0, COMPUTE_OK = 1 };
int res = NOT_COMPUTED;
if (myQuadranglePreference)
{
- int n1 = quad->side[0]->NbPoints();
- int n2 = quad->side[1]->NbPoints();
- int n3 = quad->side[2]->NbPoints();
- int n4 = quad->side[3]->NbPoints();
int nfull = n1+n2+n3+n4;
- int ntmp = nfull/2;
- ntmp = ntmp*2;
- if (nfull == ntmp && ((n1 != n3) || (n2 != n4)))
+ if ((nfull % 2) == 0 && ((n1 != n3) || (n2 != n4)))
{
// special path genarating only quandrangle faces
res = computeQuadPref( aMesh, F, quad );
}
else if (myQuadType == QUAD_REDUCED)
{
- int n1 = quad->side[0]->NbPoints();
- int n2 = quad->side[1]->NbPoints();
- int n3 = quad->side[2]->NbPoints();
- int n4 = quad->side[3]->NbPoints();
int n13 = n1 - n3;
int n24 = n2 - n4;
int n13tmp = n13/2; n13tmp = n13tmp*2;
if ( res == NOT_COMPUTED )
{
- res = computeQuadDominant( aMesh, F, quad );
+ if ( n1 != n3 || n2 != n4 )
+ res = computeTriangles( aMesh, F, quad );
+ else
+ res = computeQuadDominant( aMesh, F );
}
if ( res == COMPUTE_OK && myNeedSmooth )
smooth( quad );
+ if ( res == COMPUTE_OK )
+ res = check();
+
return ( res == COMPUTE_OK );
}
+//================================================================================
+/*!
+ * \brief Compute quadrangles and triangles on the quad
+ */
+//================================================================================
+
+bool StdMeshers_Quadrangle_2D::computeTriangles(SMESH_Mesh& aMesh,
+ const TopoDS_Face& aFace,
+ FaceQuadStruct::Ptr quad)
+{
+ int nb = quad->side[0].grid->NbPoints();
+ int nr = quad->side[1].grid->NbPoints();
+ int nt = quad->side[2].grid->NbPoints();
+ int nl = quad->side[3].grid->NbPoints();
+
+ // rotate the quad to have nbNodeOut sides on TOP [and LEFT]
+ if ( nb > nt )
+ quad->shift( nl > nr ? 3 : 2, true );
+ else if ( nr > nl )
+ quad->shift( 1, true );
+ else if ( nl > nr )
+ quad->shift( nt > nb ? 0 : 3, true );
+
+ if ( !setNormalizedGrid( quad ))
+ return false;
+
+ if ( quad->nbNodeOut( QUAD_TOP_SIDE ))
+ {
+ splitQuad( quad, 0, quad->jSize-2 );
+ }
+ if ( quad->nbNodeOut( QUAD_BOTTOM_SIDE )) // this should not happen
+ {
+ splitQuad( quad, 0, 1 );
+ }
+ FaceQuadStruct::Ptr newQuad = myQuadList.back();
+ if ( quad != newQuad ) // split done
+ {
+ {
+ FaceQuadStruct::Ptr botQuad = // a bottom part
+ ( quad->side[ QUAD_LEFT_SIDE ].from == 0 ) ? quad : newQuad;
+ if ( botQuad->nbNodeOut( QUAD_LEFT_SIDE ) > 0 )
+ botQuad->side[ QUAD_LEFT_SIDE ].to += botQuad->nbNodeOut( QUAD_LEFT_SIDE );
+ else if ( botQuad->nbNodeOut( QUAD_RIGHT_SIDE ) > 0 )
+ botQuad->side[ QUAD_RIGHT_SIDE ].to += botQuad->nbNodeOut( QUAD_RIGHT_SIDE );
+ }
+ // make quad be a greatest one
+ if ( quad->side[ QUAD_LEFT_SIDE ].NbPoints() == 2 ||
+ quad->side[ QUAD_RIGHT_SIDE ].NbPoints() == 2 )
+ quad = newQuad;
+ if ( !setNormalizedGrid( quad ))
+ return false;
+ }
+
+ if ( quad->nbNodeOut( QUAD_RIGHT_SIDE ))
+ {
+ splitQuad( quad, quad->iSize-2, 0 );
+ }
+ if ( quad->nbNodeOut( QUAD_LEFT_SIDE ))
+ {
+ splitQuad( quad, 1, 0 );
+ }
+
+ return computeQuadDominant( aMesh, aFace );
+}
+
+//================================================================================
+/*!
+ * \brief Compute quadrangles and possibly triangles on all quads of myQuadList
+ */
+//================================================================================
+
+bool StdMeshers_Quadrangle_2D::computeQuadDominant(SMESH_Mesh& aMesh,
+ const TopoDS_Face& aFace)
+{
+ if ( !addEnforcedNodes() )
+ return false;
+
+ std::list< FaceQuadStruct::Ptr >::iterator quad = myQuadList.begin();
+ for ( ; quad != myQuadList.end(); ++quad )
+ if ( !computeQuadDominant( aMesh, aFace, *quad ))
+ return false;
+
+ return true;
+}
+
//================================================================================
/*!
* \brief Compute quadrangles and possibly triangles
const TopoDS_Face& aFace,
FaceQuadStruct::Ptr quad)
{
- // set normalized grid on unit square in parametric domain
+ // --- set normalized grid on unit square in parametric domain
- if (!setNormalizedGrid(aMesh, aFace, quad))
+ if ( !setNormalizedGrid( quad ))
return false;
- // --- compute 3D values on points, store points & quadrangles
-
- int nbdown = quad->side[0]->NbPoints();
- int nbup = quad->side[2]->NbPoints();
-
- int nbright = quad->side[1]->NbPoints();
- int nbleft = quad->side[3]->NbPoints();
+ // --- create nodes on points, and create quadrangles
- int nbhoriz = Min(nbdown, nbup);
- int nbvertic = Min(nbright, nbleft);
+ int nbhoriz = quad->iSize;
+ int nbvertic = quad->jSize;
// internal mesh nodes
SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
Handle(Geom_Surface) S = BRep_Tool::Surface(aFace);
- int i, j, geomFaceID = meshDS->ShapeToIndex(aFace);
- for (i = 1; i < nbhoriz - 1; i++) {
- for (j = 1; j < nbvertic - 1; j++) {
- int ij = j * nbhoriz + i;
- double u = quad->uv_grid[ij].u;
- double v = quad->uv_grid[ij].v;
- gp_Pnt P = S->Value(u, v);
- SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
- meshDS->SetNodeOnFace(node, geomFaceID, u, v);
- quad->uv_grid[ij].node = node;
+ int i,j, geomFaceID = meshDS->ShapeToIndex(aFace);
+ for (i = 1; i < nbhoriz - 1; i++)
+ for (j = 1; j < nbvertic - 1; j++)
+ {
+ UVPtStruct& uvPnt = quad->UVPt( i, j );
+ gp_Pnt P = S->Value( uvPnt.u, uvPnt.v );
+ uvPnt.node = meshDS->AddNode(P.X(), P.Y(), P.Z());
+ meshDS->SetNodeOnFace( uvPnt.node, geomFaceID, uvPnt.u, uvPnt.v );
}
- }
// mesh faces
// i
// [0]
- i = 0;
int ilow = 0;
int iup = nbhoriz - 1;
- if (quad->isEdgeOut[3]) { ilow++; } else { if (quad->isEdgeOut[1]) iup--; }
+ if (quad->nbNodeOut(3)) { ilow++; } else { if (quad->nbNodeOut(1)) iup--; }
int jlow = 0;
int jup = nbvertic - 1;
- if (quad->isEdgeOut[0]) { jlow++; } else { if (quad->isEdgeOut[2]) jup--; }
+ if (quad->nbNodeOut(0)) { jlow++; } else { if (quad->nbNodeOut(2)) jup--; }
// regular quadrangles
for (i = ilow; i < iup; i++) {
for (j = jlow; j < jup; j++) {
const SMDS_MeshNode *a, *b, *c, *d;
- a = quad->uv_grid[j * nbhoriz + i ].node;
- b = quad->uv_grid[j * nbhoriz + i + 1].node;
+ a = quad->uv_grid[ j * nbhoriz + i ].node;
+ 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 = myHelper->AddFace(a, b, c, d);
}
}
- const vector<UVPtStruct>& uv_e0 = quad->side[0]->GetUVPtStruct(true,0);
- const vector<UVPtStruct>& uv_e1 = quad->side[1]->GetUVPtStruct(false,1);
- const vector<UVPtStruct>& uv_e2 = quad->side[2]->GetUVPtStruct(true,1);
- const vector<UVPtStruct>& uv_e3 = quad->side[3]->GetUVPtStruct(false,0);
+ // Boundary elements (must always be on an outer boundary of the FACE)
+
+ const vector<UVPtStruct>& uv_e0 = quad->side[0].grid->GetUVPtStruct();
+ const vector<UVPtStruct>& uv_e1 = quad->side[1].grid->GetUVPtStruct();
+ const vector<UVPtStruct>& uv_e2 = quad->side[2].grid->GetUVPtStruct();
+ const vector<UVPtStruct>& uv_e3 = quad->side[3].grid->GetUVPtStruct();
if (uv_e0.empty() || uv_e1.empty() || uv_e2.empty() || uv_e3.empty())
return error(COMPERR_BAD_INPUT_MESH);
double eps = Precision::Confusion();
- // Boundary quadrangles
-
- if (quad->isEdgeOut[0]) {
+ int nbdown = (int) uv_e0.size();
+ int nbup = (int) uv_e2.size();
+ int nbright = (int) uv_e1.size();
+ int nbleft = (int) uv_e3.size();
+
+ if (quad->nbNodeOut(0) && nbvertic == 2) // this should not occure
+ {
// Down edge is out
//
// |___|___|___|___|___|___|
// 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--;
-
+ //if (quad->nbNodeOut(1)) stop--;
+ if ( quad->nbNodeOut( QUAD_RIGHT_SIDE ))
+ quad->UVPt( nbhoriz-1, 1 ).node = uv_e1[1].node;
+ if ( quad->nbNodeOut( QUAD_LEFT_SIDE ))
+ quad->UVPt( 0, 1 ).node = uv_e3[1].node;
+
// 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++) {
if (face) meshDS->SetMeshElementOnShape(face, geomFaceID);
}
else {
- splitQuad(meshDS, geomFaceID, a, b, c, d);
+ splitQuadFace(meshDS, geomFaceID, a, b, c, d);
}
// if node d is not at position g - make additional triangles
}
}
} else {
- if (quad->isEdgeOut[2]) {
+ if (quad->nbNodeOut(2) && nbvertic == 2)
+ {
// Up edge is out
//
// <-<-<-<-<-<-<-<-<-<-<-<-< -- direction of processing
int g = nbhoriz - 1; // last processed node in the regular grid
+ ilow = 0;
+ iup = nbhoriz - 1;
+
int stop = 0;
// if left edge is out, we will stop at a second node
- if (quad->isEdgeOut[3]) stop++;
+ //if (quad->nbNodeOut(3)) stop++;
+ if ( quad->nbNodeOut( QUAD_RIGHT_SIDE ))
+ quad->UVPt( nbhoriz-1, 0 ).node = uv_e1[ nbright-2 ].node;
+ if ( quad->nbNodeOut( QUAD_LEFT_SIDE ))
+ quad->UVPt( 0, 0 ).node = uv_e3[ nbleft-2 ].node;
// for each node of the up edge find nearest node
// in the first row of the regular grid and link them
if (face) meshDS->SetMeshElementOnShape(face, geomFaceID);
}
else {
- splitQuad(meshDS, geomFaceID, a, b, c, d);
+ splitQuadFace(meshDS, geomFaceID, a, b, c, d);
}
- if (near + 1 < g) { // if d not is at g - make additional triangles
+ if (near + 1 < g) { // if d is not at g - make additional triangles
for (int k = near + 1; k < g; k++) {
c = quad->uv_grid[nbhoriz*(nbvertic - 2) + k].node;
if (k + 1 > iup)
}
// right or left boundary quadrangles
- if (quad->isEdgeOut[1]) {
-// MESSAGE("right edge is out");
+ if (quad->nbNodeOut( QUAD_RIGHT_SIDE ) && nbhoriz == 2) // this should not occure
+ {
int g = 0; // last processed node in the grid
int stop = nbright - 1;
- if (quad->isEdgeOut[2]) stop--;
- for (i = 0; i < stop; i++) {
+ i = 0;
+ if (quad->side[ QUAD_RIGHT_SIDE ].from != i ) i++;
+ if (quad->side[ QUAD_RIGHT_SIDE ].to != stop ) stop--;
+ for ( ; i < stop; i++) {
const SMDS_MeshNode *a, *b, *c, *d;
a = uv_e1[i].node;
b = uv_e1[i + 1].node;
if (face) meshDS->SetMeshElementOnShape(face, geomFaceID);
}
else {
- splitQuad(meshDS, geomFaceID, a, b, c, d);
+ splitQuadFace(meshDS, geomFaceID, a, b, c, d);
}
if (near - 1 > g) { // if d not is at g - make additional triangles
}
}
} else {
- if (quad->isEdgeOut[3]) {
+ if (quad->nbNodeOut(3) && nbhoriz == 2) {
// MESSAGE("left edge is out");
int g = nbvertic - 1; // last processed node in the grid
int stop = 0;
- if (quad->isEdgeOut[0]) stop++;
- for (i = nbleft - 1; i > stop; i--) {
+ i = quad->side[ QUAD_LEFT_SIDE ].to-1; // nbleft - 1;
+ for (; i > stop; i--) {
const SMDS_MeshNode *a, *b, *c, *d;
a = uv_e3[i].node;
b = uv_e3[i - 1].node;
if (face) meshDS->SetMeshElementOnShape(face, geomFaceID);
}
else {
- splitQuad(meshDS, geomFaceID, a, b, c, d);
+ splitQuadFace(meshDS, geomFaceID, a, b, c, d);
}
if (near + 1 < g) { // if d not is at g - make additional triangles
return true;
}
+//================================================================================
+/*!
+ * \brief Return true if the algorithm can mesh this shape
+ * \param [in] aShape - shape to check
+ * \param [in] toCheckAll - if true, this check returns OK if all shapes are OK,
+ * else, returns OK if at least one shape is OK
+ */
+//================================================================================
+
+bool StdMeshers_Quadrangle_2D::IsApplicable( const TopoDS_Shape & aShape, bool toCheckAll )
+{
+ int nbFoundFaces = 0;
+ for (TopExp_Explorer exp( aShape, TopAbs_FACE ); exp.More(); exp.Next(), ++nbFoundFaces )
+ {
+ const TopoDS_Shape& aFace = exp.Current();
+ int nbWire = SMESH_MesherHelper::Count( aFace, TopAbs_WIRE, false );
+ if ( nbWire != 1 ) {
+ if ( toCheckAll ) return false;
+ continue;
+ }
+
+ int nbNoDegenEdges = 0;
+ TopExp_Explorer eExp( aFace, TopAbs_EDGE );
+ for ( ; eExp.More() && nbNoDegenEdges < 3; eExp.Next() ) {
+ if ( !SMESH_Algo::isDegenerated( TopoDS::Edge( eExp.Current() )))
+ ++nbNoDegenEdges;
+ }
+ if ( toCheckAll && nbNoDegenEdges < 3 ) return false;
+ if ( !toCheckAll && nbNoDegenEdges >= 3 ) return true;
+ }
+ return ( toCheckAll && nbFoundFaces != 0 );
+}
//================================================================================
/*!
const TopoDS_Shape & aShape,
const bool considerMesh)
{
- if ( myQuadStruct && myQuadStruct->face.IsSame( aShape ))
- return myQuadStruct;
+ if ( !myQuadList.empty() && myQuadList.front()->face.IsSame( aShape ))
+ return myQuadList.front();
TopoDS_Face F = TopoDS::Face(aShape);
if ( F.Orientation() >= TopAbs_INTERNAL ) F.Orientation( TopAbs_FORWARD );
const bool ignoreMediumNodes = _quadraticMesh;
- // verify 1 wire only, with 4 edges
+ // verify 1 wire only
list< TopoDS_Edge > edges;
list< int > nbEdgesInWire;
int nbWire = SMESH_Block::GetOrderedEdges (F, edges, nbEdgesInWire);
return FaceQuadStruct::Ptr();
}
FaceQuadStruct::Ptr quad( new FaceQuadStruct );
- quad->uv_grid = 0;
quad->side.reserve(nbEdgesInWire.front());
quad->face = F;
else
sideEdges.push_back( *edgeIt++ );
if ( !sideEdges.empty() )
- quad->side.push_back(new StdMeshers_FaceSide(F, sideEdges, &aMesh, iSide < QUAD_TOP_SIDE,
- ignoreMediumNodes, myProxyMesh));
+ quad->side.push_back( StdMeshers_FaceSide::New(F, sideEdges, &aMesh, iSide < QUAD_TOP_SIDE,
+ ignoreMediumNodes, myProxyMesh));
else
--iSide;
}
- const vector<UVPtStruct>& UVPSleft = quad->side[0]->GetUVPtStruct(true,0);
- /* vector<UVPtStruct>& UVPStop = */quad->side[1]->GetUVPtStruct(false,1);
- /* vector<UVPtStruct>& UVPSright = */quad->side[2]->GetUVPtStruct(true,1);
+ const vector<UVPtStruct>& UVPSleft = quad->side[0].GetUVPtStruct(true,0);
+ /* vector<UVPtStruct>& UVPStop = */quad->side[1].GetUVPtStruct(false,1);
+ /* vector<UVPtStruct>& UVPSright = */quad->side[2].GetUVPtStruct(true,1);
const SMDS_MeshNode* aNode = UVPSleft[0].node;
- gp_Pnt2d aPnt2d(UVPSleft[0].u, UVPSleft[0].v);
- quad->side.push_back(new StdMeshers_FaceSide(quad->side[1], aNode, &aPnt2d));
+ gp_Pnt2d aPnt2d = UVPSleft[0].UV();
+ quad->side.push_back( StdMeshers_FaceSide::New( quad->side[1].grid.get(), aNode, &aPnt2d ));
myNeedSmooth = ( nbDegenEdges > 0 );
return quad;
}
}
if ( !sideEdges.empty() )
{
- quad->side.push_back(new StdMeshers_FaceSide(F, sideEdges, &aMesh, iSide < QUAD_TOP_SIDE,
- ignoreMediumNodes, myProxyMesh));
+ quad->side.push_back( StdMeshers_FaceSide::New( F, sideEdges, &aMesh, iSide < QUAD_TOP_SIDE,
+ ignoreMediumNodes, myProxyMesh ));
++iSide;
}
else if ( !SMESH_Algo::isDegenerated( *edgeIt ) && // closed EDGE
myHelper->IthVertex( 0, *edgeIt ).IsSame( myHelper->IthVertex( 1, *edgeIt )))
{
- quad->side.push_back(new StdMeshers_FaceSide(F, *edgeIt++, &aMesh, iSide < QUAD_TOP_SIDE,
- ignoreMediumNodes, myProxyMesh));
+ quad->side.push_back( StdMeshers_FaceSide::New( F, *edgeIt++, &aMesh, iSide < QUAD_TOP_SIDE,
+ ignoreMediumNodes, myProxyMesh));
++iSide;
}
if ( quad->side.size() == 4 )
if ( quad )
{
// set normalized grid on unit square in parametric domain
- if ( ! setNormalizedGrid( aMesh, TopoDS::Face( aShape ), quad))
+ if ( ! setNormalizedGrid( quad ))
quad.reset();
}
return quad;
}
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-faceQuadStruct::~faceQuadStruct()
-{
- for (size_t i = 0; i < side.size(); i++) {
- if (side[i]) {
- delete side[i];
- for (size_t j = i+1; j < side.size(); j++)
- if ( side[i] == side[j] )
- side[j] = 0;
- }
- }
- side.clear();
-
- if (uv_grid) {
- delete [] uv_grid;
- uv_grid = 0;
- }
-}
-
namespace
{
inline const vector<UVPtStruct>& getUVPtStructIn(FaceQuadStruct::Ptr& quad, int i, int nbSeg)
bool isXConst = (i == QUAD_BOTTOM_SIDE || i == QUAD_TOP_SIDE);
double constValue = (i == QUAD_BOTTOM_SIDE || i == QUAD_LEFT_SIDE) ? 0 : 1;
return
- quad->isEdgeOut[i] ?
- quad->side[i]->SimulateUVPtStruct(nbSeg,isXConst,constValue) :
- quad->side[i]->GetUVPtStruct(isXConst,constValue);
+ quad->nbNodeOut(i) ?
+ quad->side[i].grid->SimulateUVPtStruct(nbSeg,isXConst,constValue) :
+ quad->side[i].grid->GetUVPtStruct (isXConst,constValue);
}
inline gp_UV calcUV(double x, double y,
const gp_UV& a0,const gp_UV& a1,const gp_UV& a2,const gp_UV& a3,
*/
//=============================================================================
-bool StdMeshers_Quadrangle_2D::setNormalizedGrid (SMESH_Mesh & aMesh,
- const TopoDS_Face& aFace,
- FaceQuadStruct::Ptr & quad)
+bool StdMeshers_Quadrangle_2D::setNormalizedGrid (FaceQuadStruct::Ptr quad)
{
+ if ( !quad->uv_grid.empty() )
+ return true;
+
// Algorithme décrit dans "Génération automatique de maillages"
// P.L. GEORGE, MASSON, § 6.4.1 p. 84-85
// traitement dans le domaine paramétrique 2d u,v
// min max 0 x0 1
// =down
//
+ const FaceQuadStruct::Side & bSide = quad->side[0];
+ const FaceQuadStruct::Side & rSide = quad->side[1];
+ const FaceQuadStruct::Side & tSide = quad->side[2];
+ const FaceQuadStruct::Side & lSide = quad->side[3];
- int nbhoriz = Min(quad->side[0]->NbPoints(), quad->side[2]->NbPoints());
- int nbvertic = Min(quad->side[1]->NbPoints(), quad->side[3]->NbPoints());
-
- quad->isEdgeOut[0] = (quad->side[0]->NbPoints() > quad->side[2]->NbPoints());
- quad->isEdgeOut[1] = (quad->side[1]->NbPoints() > quad->side[3]->NbPoints());
- quad->isEdgeOut[2] = (quad->side[2]->NbPoints() > quad->side[0]->NbPoints());
- quad->isEdgeOut[3] = (quad->side[3]->NbPoints() > quad->side[1]->NbPoints());
-
- UVPtStruct *uv_grid = quad->uv_grid = new UVPtStruct[nbvertic * nbhoriz];
-
- const vector<UVPtStruct>& uv_e0 = getUVPtStructIn(quad, 0, nbhoriz - 1);
- const vector<UVPtStruct>& uv_e1 = getUVPtStructIn(quad, 1, nbvertic - 1);
- const vector<UVPtStruct>& uv_e2 = getUVPtStructIn(quad, 2, nbhoriz - 1);
- const vector<UVPtStruct>& uv_e3 = getUVPtStructIn(quad, 3, nbvertic - 1);
+ int nbhoriz = Min( bSide.NbPoints(), tSide.NbPoints() );
+ int nbvertic = Min( rSide.NbPoints(), lSide.NbPoints() );
+ if ( myQuadList.size() == 1 )
+ {
+ // all sub-quads must have NO sides with nbNodeOut > 0
+ quad->nbNodeOut(0) = Max( 0, bSide.grid->NbPoints() - tSide.grid->NbPoints() );
+ quad->nbNodeOut(1) = Max( 0, rSide.grid->NbPoints() - lSide.grid->NbPoints() );
+ quad->nbNodeOut(2) = Max( 0, tSide.grid->NbPoints() - bSide.grid->NbPoints() );
+ quad->nbNodeOut(3) = Max( 0, lSide.grid->NbPoints() - rSide.grid->NbPoints() );
+ }
+ const vector<UVPtStruct>& uv_e0 = bSide.GetUVPtStruct();
+ const vector<UVPtStruct>& uv_e1 = rSide.GetUVPtStruct();
+ const vector<UVPtStruct>& uv_e2 = tSide.GetUVPtStruct();
+ const vector<UVPtStruct>& uv_e3 = lSide.GetUVPtStruct();
if (uv_e0.empty() || uv_e1.empty() || uv_e2.empty() || uv_e3.empty())
//return error("Can't find nodes on sides");
return error(COMPERR_BAD_INPUT_MESH);
+ quad->uv_grid.resize( nbvertic * nbhoriz );
+ quad->iSize = nbhoriz;
+ quad->jSize = nbvertic;
+ UVPtStruct *uv_grid = & quad->uv_grid[0];
+
+ quad->uv_box.Clear();
+
// copy data of face boundary
- {
- const int j = 0;
- for (int i = 0; i < nbhoriz; i++) // down
- uv_grid[ j * nbhoriz + i ] = uv_e0[i];
+
+ FaceQuadStruct::SideIterator sideIter;
+
+ { // BOTTOM
+ const int j = 0;
+ const double x0 = bSide.First().normParam;
+ const double dx = bSide.Last().normParam - bSide.First().normParam;
+ for ( sideIter.Init( bSide ); sideIter.More(); sideIter.Next() ) {
+ sideIter.UVPt().x = ( sideIter.UVPt().normParam - x0 ) / dx;
+ sideIter.UVPt().y = 0.;
+ uv_grid[ j * nbhoriz + sideIter.Count() ] = sideIter.UVPt();
+ quad->uv_box.Add( sideIter.UVPt().UV() );
+ }
}
- {
- const int i = nbhoriz - 1;
- for (int j = 0; j < nbvertic; j++) // right
- uv_grid[ j * nbhoriz + i ] = uv_e1[j];
+ { // RIGHT
+ const int i = nbhoriz - 1;
+ const double y0 = rSide.First().normParam;
+ const double dy = rSide.Last().normParam - rSide.First().normParam;
+ sideIter.Init( rSide );
+ if ( quad->UVPt( i, sideIter.Count() ).node )
+ sideIter.Next(); // avoid copying from a split emulated side
+ for ( ; sideIter.More(); sideIter.Next() ) {
+ sideIter.UVPt().x = 1.;
+ sideIter.UVPt().y = ( sideIter.UVPt().normParam - y0 ) / dy;
+ uv_grid[ sideIter.Count() * nbhoriz + i ] = sideIter.UVPt();
+ quad->uv_box.Add( sideIter.UVPt().UV() );
+ }
}
- {
- const int j = nbvertic - 1;
- for (int i = 0; i < nbhoriz; i++) // up
- uv_grid[ j * nbhoriz + i ] = uv_e2[i];
+ { // TOP
+ const int j = nbvertic - 1;
+ const double x0 = tSide.First().normParam;
+ const double dx = tSide.Last().normParam - tSide.First().normParam;
+ int i = 0, nb = nbhoriz;
+ sideIter.Init( tSide );
+ if ( quad->UVPt( nb-1, j ).node ) --nb; // avoid copying from a split emulated side
+ for ( ; i < nb; i++, sideIter.Next()) {
+ sideIter.UVPt().x = ( sideIter.UVPt().normParam - x0 ) / dx;
+ sideIter.UVPt().y = 1.;
+ uv_grid[ j * nbhoriz + i ] = sideIter.UVPt();
+ quad->uv_box.Add( sideIter.UVPt().UV() );
+ }
}
- {
+ { // LEFT
const int i = 0;
- for (int j = 0; j < nbvertic; j++) // left
- uv_grid[ j * nbhoriz + i ] = uv_e3[j];
+ const double y0 = lSide.First().normParam;
+ const double dy = lSide.Last().normParam - lSide.First().normParam;
+ int j = 0, nb = nbvertic;
+ sideIter.Init( lSide );
+ if ( quad->UVPt( i, j ).node )
+ ++j, sideIter.Next(); // avoid copying from a split emulated side
+ if ( quad->UVPt( i, nb-1 ).node )
+ --nb;
+ for ( ; j < nb; j++, sideIter.Next()) {
+ sideIter.UVPt().x = 0.;
+ sideIter.UVPt().y = ( sideIter.UVPt().normParam - y0 ) / dy;
+ uv_grid[ j * nbhoriz + i ] = sideIter.UVPt();
+ quad->uv_box.Add( sideIter.UVPt().UV() );
+ }
}
// normalized 2d parameters on grid
- for (int i = 0; i < nbhoriz; i++) {
- for (int j = 0; j < nbvertic; j++) {
- int ij = j * nbhoriz + i;
- // --- droite i cste : x = x0 + y(x1-x0)
- double x0 = uv_e0[i].normParam; // bas - sud
- double x1 = uv_e2[i].normParam; // haut - nord
- // --- droite j cste : y = y0 + x(y1-y0)
- double y0 = uv_e3[j].normParam; // gauche - ouest
- double y1 = uv_e1[j].normParam; // droite - est
+ for (int i = 1; i < nbhoriz-1; i++)
+ {
+ const double x0 = quad->UVPt( i, 0 ).x;
+ const double x1 = quad->UVPt( i, nbvertic-1 ).x;
+ for (int j = 1; j < nbvertic-1; j++)
+ {
+ const double y0 = quad->UVPt( 0, j ).y;
+ const double y1 = quad->UVPt( nbhoriz-1, j ).y;
// --- intersection : x=x0+(y0+x(y1-y0))(x1-x0)
double x = (x0 + y0 * (x1 - x0)) / (1 - (y1 - y0) * (x1 - x0));
double y = y0 + x * (y1 - y0);
+ int ij = j * nbhoriz + i;
uv_grid[ij].x = x;
uv_grid[ij].y = y;
+ uv_grid[ij].node = NULL;
}
}
// projection on 2d domain (u,v)
- gp_UV a0 (uv_e0.front().u, uv_e0.front().v);
- gp_UV a1 (uv_e0.back().u, uv_e0.back().v );
- gp_UV a2 (uv_e2.back().u, uv_e2.back().v );
- gp_UV a3 (uv_e2.front().u, uv_e2.front().v);
+ gp_UV a0 = quad->UVPt( 0, 0 ).UV();
+ gp_UV a1 = quad->UVPt( nbhoriz-1, 0 ).UV();
+ gp_UV a2 = quad->UVPt( nbhoriz-1, nbvertic-1 ).UV();
+ gp_UV a3 = quad->UVPt( 0, nbvertic-1 ).UV();
- for (int i = 0; i < nbhoriz; i++)
+ for (int i = 1; i < nbhoriz-1; i++)
{
- gp_UV p0( uv_e0[i].u, uv_e0[i].v );
- gp_UV p2( uv_e2[i].u, uv_e2[i].v );
- for (int j = 0; j < nbvertic; j++)
+ gp_UV p0 = quad->UVPt( i, 0 ).UV();
+ gp_UV p2 = quad->UVPt( i, nbvertic-1 ).UV();
+ for (int j = 1; j < nbvertic-1; j++)
{
- gp_UV p1( uv_e1[j].u, uv_e1[j].v );
- gp_UV p3( uv_e3[j].u, uv_e3[j].v );
+ gp_UV p1 = quad->UVPt( nbhoriz-1, j ).UV();
+ gp_UV p3 = quad->UVPt( 0, j ).UV();
int ij = j * nbhoriz + i;
double x = uv_grid[ij].x;
//purpose : auxilary function for computeQuadPref
//=======================================================================
-static void shiftQuad(FaceQuadStruct::Ptr& quad, const int num)
+void StdMeshers_Quadrangle_2D::shiftQuad(FaceQuadStruct::Ptr& quad, const int num )
{
- quad->shift( num, /*ori=*/true );
+ quad->shift( num, /*ori=*/true, /*keepGrid=*/myQuadList.size() > 1 );
}
//================================================================================
/*!
- * \brief Rotate sides of a quad by nb
+ * \brief Rotate sides of a quad by given nb of quartes
* \param nb - number of rotation quartes
* \param ori - to keep orientation of sides as in an unit quad or not
+ * \param keepGrid - if \c true Side::grid is not changed, Side::from and Side::to
+ * are altered instead
*/
//================================================================================
-void FaceQuadStruct::shift( size_t nb, bool ori )
+void FaceQuadStruct::shift( size_t nb, bool ori, bool keepGrid )
{
if ( nb == 0 ) return;
- StdMeshers_FaceSide* sideArr[4] = { side[0], side[1], side[2], side[3] };
- for (int i = QUAD_BOTTOM_SIDE; i < NB_QUAD_SIDES; ++i) {
+
+ vector< Side > newSides( side.size() );
+ vector< Side* > sidePtrs( side.size() );
+ for (int i = QUAD_BOTTOM_SIDE; i < NB_QUAD_SIDES; ++i)
+ {
int id = (i + nb) % NB_QUAD_SIDES;
- bool wasForward = (i < QUAD_TOP_SIDE);
- bool newForward = (id < QUAD_TOP_SIDE);
- if (ori && wasForward != newForward)
- sideArr[ i ]->Reverse();
- side[ id ] = sideArr[ i ];
+ if ( ori )
+ {
+ bool wasForward = (i < QUAD_TOP_SIDE);
+ bool newForward = (id < QUAD_TOP_SIDE);
+ if ( wasForward != newForward )
+ side[ i ].Reverse( keepGrid );
+ }
+ newSides[ id ] = side[ i ];
+ sidePtrs[ i ] = & side[ i ];
+ }
+ // make newSides refer newSides via Side::Contact's
+ for ( size_t i = 0; i < newSides.size(); ++i )
+ {
+ FaceQuadStruct::Side& ns = newSides[ i ];
+ for ( size_t iC = 0; iC < ns.contacts.size(); ++iC )
+ {
+ FaceQuadStruct::Side* oSide = ns.contacts[iC].other_side;
+ vector< Side* >::iterator sIt = std::find( sidePtrs.begin(), sidePtrs.end(), oSide );
+ if ( sIt != sidePtrs.end() )
+ ns.contacts[iC].other_side = & newSides[ *sIt - sidePtrs[0] ];
+ }
}
+ newSides.swap( side );
+
+ uv_grid.clear();
}
//=======================================================================
double x = (x0 + y0 * (x1 - x0)) / (1 - (y1 - y0) * (x1 - x0));
double y = y0 + x * (y1 - y0);
- gp_UV p0 = quad->side[QUAD_BOTTOM_SIDE]->Value2d(x).XY();
- gp_UV p1 = quad->side[QUAD_RIGHT_SIDE ]->Value2d(y).XY();
- gp_UV p2 = quad->side[QUAD_TOP_SIDE ]->Value2d(x).XY();
- gp_UV p3 = quad->side[QUAD_LEFT_SIDE ]->Value2d(y).XY();
+ gp_UV p0 = quad->side[QUAD_BOTTOM_SIDE].grid->Value2d(x).XY();
+ gp_UV p1 = quad->side[QUAD_RIGHT_SIDE ].grid->Value2d(y).XY();
+ gp_UV p2 = quad->side[QUAD_TOP_SIDE ].grid->Value2d(x).XY();
+ gp_UV p3 = quad->side[QUAD_LEFT_SIDE ].grid->Value2d(y).XY();
gp_UV uv = calcUV(x,y, a0,a1,a2,a3, p0,p1,p2,p3);
const gp_UV& a0, const gp_UV& a1,
const gp_UV& a2, const gp_UV& a3)
{
- gp_UV p0 = quad->side[QUAD_BOTTOM_SIDE]->Value2d(x).XY();
- gp_UV p1 = quad->side[QUAD_RIGHT_SIDE ]->Value2d(y).XY();
- gp_UV p2 = quad->side[QUAD_TOP_SIDE ]->Value2d(x).XY();
- gp_UV p3 = quad->side[QUAD_LEFT_SIDE ]->Value2d(y).XY();
+ gp_UV p0 = quad->side[QUAD_BOTTOM_SIDE].grid->Value2d(x).XY();
+ gp_UV p1 = quad->side[QUAD_RIGHT_SIDE ].grid->Value2d(y).XY();
+ gp_UV p2 = quad->side[QUAD_TOP_SIDE ].grid->Value2d(x).XY();
+ gp_UV p3 = quad->side[QUAD_LEFT_SIDE ].grid->Value2d(y).XY();
gp_UV uv = calcUV(x,y, a0,a1,a2,a3, p0,p1,p2,p3);
const TopoDS_Face& aFace,
FaceQuadStruct::Ptr quad)
{
- // Auxilary key in order to keep old variant
- // of meshing after implementation new variant
- // for bug 0016220 from Mantis.
- bool OldVersion = (myQuadType == QUAD_QUADRANGLE_PREF_REVERSED);
+ const bool OldVersion = (myQuadType == QUAD_QUADRANGLE_PREF_REVERSED);
+ const bool WisF = true;
SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
Handle(Geom_Surface) S = BRep_Tool::Surface(aFace);
- bool WisF = true;
- int i,j,geomFaceID = meshDS->ShapeToIndex(aFace);
+ int i,j, geomFaceID = meshDS->ShapeToIndex(aFace);
- int nb = quad->side[0]->NbPoints();
- int nr = quad->side[1]->NbPoints();
- int nt = quad->side[2]->NbPoints();
- int nl = quad->side[3]->NbPoints();
+ int nb = quad->side[0].NbPoints();
+ int nr = quad->side[1].NbPoints();
+ int nt = quad->side[2].NbPoints();
+ int nl = quad->side[3].NbPoints();
int dh = abs(nb-nt);
int dv = abs(nr-nl);
- // rotate sides to be as in the picture below and to have
- // dh >= dv and nt > nb
- if ( dh >= dv )
- shiftQuad( quad, ( nt > nb ) ? 0 : 2 );
+ if ( myForcedPnts.empty() )
+ {
+ // rotate sides to be as in the picture below and to have
+ // dh >= dv and nt > nb
+ if ( dh >= dv )
+ shiftQuad( quad, ( nt > nb ) ? 0 : 2 );
+ else
+ shiftQuad( quad, ( nr > nl ) ? 1 : 3 );
+ }
else
- shiftQuad( quad, ( nr > nl ) ? 1 : 3 );
+ {
+ // rotate the quad to have nt > nb [and nr > nl]
+ if ( nb > nt )
+ shiftQuad ( quad, nr > nl ? 1 : 2 );
+ else if ( nr > nl )
+ shiftQuad( quad, nb == nt ? 1 : 0 );
+ else if ( nl > nr )
+ shiftQuad( quad, 3 );
+ }
- nb = quad->side[0]->NbPoints();
- nr = quad->side[1]->NbPoints();
- nt = quad->side[2]->NbPoints();
- nl = quad->side[3]->NbPoints();
+ nb = quad->side[0].NbPoints();
+ nr = quad->side[1].NbPoints();
+ nt = quad->side[2].NbPoints();
+ nl = quad->side[3].NbPoints();
dh = abs(nb-nt);
dv = abs(nr-nl);
int nbh = Max(nb,nt);
// 0------------0
// 0 bottom 1
+
+ const int bfrom = quad->side[0].from;
+ const int rfrom = quad->side[1].from;
+ const int tfrom = quad->side[2].from;
+ const int lfrom = quad->side[3].from;
+ {
+ const vector<UVPtStruct>& uv_eb_vec = quad->side[0].GetUVPtStruct(true,0);
+ const vector<UVPtStruct>& uv_er_vec = quad->side[1].GetUVPtStruct(false,1);
+ const vector<UVPtStruct>& uv_et_vec = quad->side[2].GetUVPtStruct(true,1);
+ const vector<UVPtStruct>& uv_el_vec = quad->side[3].GetUVPtStruct(false,0);
+ if (uv_eb_vec.empty() ||
+ uv_er_vec.empty() ||
+ uv_et_vec.empty() ||
+ uv_el_vec.empty())
+ return error(COMPERR_BAD_INPUT_MESH);
+ }
+ FaceQuadStruct::SideIterator uv_eb, uv_er, uv_et, uv_el;
+ uv_eb.Init( quad->side[0] );
+ uv_er.Init( quad->side[1] );
+ uv_et.Init( quad->side[2] );
+ uv_el.Init( quad->side[3] );
+
+ gp_UV a0,a1,a2,a3, p0,p1,p2,p3, uv;
+ double x,y;
+
+ a0 = uv_eb[ 0 ].UV();
+ a1 = uv_er[ 0 ].UV();
+ a2 = uv_er[ nr-1 ].UV();
+ a3 = uv_et[ 0 ].UV();
+
+ if ( !myForcedPnts.empty() )
+ {
+ if ( dv != 0 && dh != 0 ) // here myQuadList.size() == 1
+ {
+ const int dmin = Min( dv, dh );
+
+ // Make a side separating domains L and Cb
+ StdMeshers_FaceSidePtr sideLCb;
+ UVPtStruct p3dom; // a point where 3 domains meat
+ { // dmin
+ vector<UVPtStruct> pointsLCb( dmin+1 ); // 1--------1
+ pointsLCb[0] = uv_eb[0]; // | | |
+ for ( int i = 1; i <= dmin; ++i ) // | |Ct|
+ { // | L | |
+ x = uv_et[ i ].normParam; // | |__|
+ y = uv_er[ i ].normParam; // | / |
+ p0 = quad->side[0].grid->Value2d( x ).XY(); // | / Cb |dmin
+ p1 = uv_er[ i ].UV(); // |/ |
+ p2 = uv_et[ i ].UV(); // 0--------0
+ p3 = quad->side[3].grid->Value2d( y ).XY();
+ uv = calcUV( x,y, a0,a1,a2,a3, p0,p1,p2,p3 );
+ pointsLCb[ i ].u = uv.X();
+ pointsLCb[ i ].v = uv.Y();
+ }
+ sideLCb = StdMeshers_FaceSide::New( pointsLCb, aFace );
+ p3dom = pointsLCb.back();
+ }
+ // Make a side separating domains L and Ct
+ StdMeshers_FaceSidePtr sideLCt;
+ {
+ vector<UVPtStruct> pointsLCt( nl );
+ pointsLCt[0] = p3dom;
+ pointsLCt.back() = uv_et[ dmin ];
+ x = uv_et[ dmin ].normParam;
+ p0 = quad->side[0].grid->Value2d( x ).XY();
+ p2 = uv_et[ dmin ].UV();
+ double y0 = uv_er[ dmin ].normParam;
+ for ( int i = 1; i < nl-1; ++i )
+ {
+ y = y0 + i / ( nl-1. ) * ( 1. - y0 );
+ p1 = quad->side[1].grid->Value2d( y ).XY();
+ p3 = quad->side[3].grid->Value2d( y ).XY();
+ uv = calcUV( x,y, a0,a1,a2,a3, p0,p1,p2,p3 );
+ pointsLCt[ i ].u = uv.X();
+ pointsLCt[ i ].v = uv.Y();
+ }
+ sideLCt = StdMeshers_FaceSide::New( pointsLCt, aFace );
+ }
+ // Make a side separating domains Cb and Ct
+ StdMeshers_FaceSidePtr sideCbCt;
+ {
+ vector<UVPtStruct> pointsCbCt( nb );
+ pointsCbCt[0] = p3dom;
+ pointsCbCt.back() = uv_er[ dmin ];
+ y = uv_er[ dmin ].normParam;
+ p1 = uv_er[ dmin ].UV();
+ p3 = quad->side[3].grid->Value2d( y ).XY();
+ double x0 = uv_et[ dmin ].normParam;
+ for ( int i = 1; i < nb-1; ++i )
+ {
+ x = x0 + i / ( nb-1. ) * ( 1. - x0 );
+ p2 = quad->side[2].grid->Value2d( x ).XY();
+ p0 = quad->side[0].grid->Value2d( x ).XY();
+ uv = calcUV( x,y, a0,a1,a2,a3, p0,p1,p2,p3 );
+ pointsCbCt[ i ].u = uv.X();
+ pointsCbCt[ i ].v = uv.Y();
+ }
+ sideCbCt = StdMeshers_FaceSide::New( pointsCbCt, aFace );
+ }
+ // Make Cb quad
+ FaceQuadStruct* qCb = new FaceQuadStruct( quad->face, "Cb" );
+ myQuadList.push_back( FaceQuadStruct::Ptr( qCb ));
+ qCb->side.resize(4);
+ qCb->side[0] = quad->side[0];
+ qCb->side[1] = quad->side[1];
+ qCb->side[2] = sideCbCt;
+ qCb->side[3] = sideLCb;
+ qCb->side[1].to = dmin+1;
+ // Make L quad
+ FaceQuadStruct* qL = new FaceQuadStruct( quad->face, "L" );
+ myQuadList.push_back( FaceQuadStruct::Ptr( qL ));
+ qL->side.resize(4);
+ qL->side[0] = sideLCb;
+ qL->side[1] = sideLCt;
+ qL->side[2] = quad->side[2];
+ qL->side[3] = quad->side[3];
+ qL->side[2].to = dmin+1;
+ // Make Ct from the main quad
+ FaceQuadStruct::Ptr qCt = quad;
+ qCt->side[0] = sideCbCt;
+ qCt->side[3] = sideLCt;
+ qCt->side[1].from = dmin;
+ qCt->side[2].from = dmin;
+ qCt->uv_grid.clear();
+ qCt->name = "Ct";
+
+ // Connect sides
+ qCb->side[3].AddContact( dmin, & qCb->side[2], 0 );
+ qCb->side[3].AddContact( dmin, & qCt->side[3], 0 );
+ qCt->side[3].AddContact( 0, & qCt->side[0], 0 );
+ qCt->side[0].AddContact( 0, & qL ->side[0], dmin );
+ qL ->side[0].AddContact( dmin, & qL ->side[1], 0 );
+ qL ->side[0].AddContact( dmin, & qCb->side[2], 0 );
+
+ if ( dh == dv )
+ return computeQuadDominant( aMesh, aFace );
+ else
+ return computeQuadPref( aMesh, aFace, qCt );
+
+ } // if ( dv != 0 && dh != 0 )
+
+ const int db = quad->side[0].IsReversed() ? -1 : +1;
+ const int dr = quad->side[1].IsReversed() ? -1 : +1;
+ const int dt = quad->side[2].IsReversed() ? -1 : +1;
+ const int dl = quad->side[3].IsReversed() ? -1 : +1;
+
+ // Case dv == 0, here possibly myQuadList.size() > 1
+ //
+ // lw nb lw = dh/2
+ // +------------+
+ // | | | |
+ // | | Ct | |
+ // | L | | R |
+ // | |____| |
+ // | / \ |
+ // | / Cb \ |
+ // |/ \|
+ // +------------+
+ const int lw = dh/2; // lateral width
+
+ double yCbL, yCbR;
+ {
+ double lL = quad->side[3].Length();
+ double lLwL = quad->side[2].Length( tfrom,
+ tfrom + ( lw ) * dt );
+ yCbL = lLwL / ( lLwL + lL );
+
+ double lR = quad->side[1].Length();
+ double lLwR = quad->side[2].Length( tfrom + ( lw + nb-1 ) * dt,
+ tfrom + ( lw + nb-1 + lw ) * dt);
+ yCbR = lLwR / ( lLwR + lR );
+ }
+ // Make sides separating domains Cb and L and R
+ StdMeshers_FaceSidePtr sideLCb, sideRCb;
+ UVPtStruct pTBL, pTBR; // points where 3 domains meat
+ {
+ vector<UVPtStruct> pointsLCb( lw+1 ), pointsRCb( lw+1 );
+ pointsLCb[0] = uv_eb[ 0 ];
+ pointsRCb[0] = uv_eb[ nb-1 ];
+ for ( int i = 1, i2 = nt-2; i <= lw; ++i, --i2 )
+ {
+ x = quad->side[2].Param( i );
+ y = yCbL * i / lw;
+ p0 = quad->side[0].Value2d( x );
+ p1 = quad->side[1].Value2d( y );
+ p2 = uv_et[ i ].UV();
+ p3 = quad->side[3].Value2d( y );
+ uv = calcUV( x,y, a0,a1,a2,a3, p0,p1,p2,p3 );
+ pointsLCb[ i ].u = uv.X();
+ pointsLCb[ i ].v = uv.Y();
+ pointsLCb[ i ].x = x;
+
+ x = quad->side[2].Param( i2 );
+ y = yCbR * i / lw;
+ p1 = quad->side[1].Value2d( y );
+ p0 = quad->side[0].Value2d( x );
+ p2 = uv_et[ i2 ].UV();
+ p3 = quad->side[3].Value2d( y );
+ uv = calcUV( x,y, a0,a1,a2,a3, p0,p1,p2,p3 );
+ pointsRCb[ i ].u = uv.X();
+ pointsRCb[ i ].v = uv.Y();
+ pointsRCb[ i ].x = x;
+ }
+ sideLCb = StdMeshers_FaceSide::New( pointsLCb, aFace );
+ sideRCb = StdMeshers_FaceSide::New( pointsRCb, aFace );
+ pTBL = pointsLCb.back();
+ pTBR = pointsRCb.back();
+ }
+ // Make sides separating domains Ct and L and R
+ StdMeshers_FaceSidePtr sideLCt, sideRCt;
+ {
+ vector<UVPtStruct> pointsLCt( nl ), pointsRCt( nl );
+ pointsLCt[0] = pTBL;
+ pointsLCt.back() = uv_et[ lw ];
+ pointsRCt[0] = pTBR;
+ pointsRCt.back() = uv_et[ lw + nb - 1 ];
+ x = pTBL.x;
+ p0 = quad->side[0].Value2d( x );
+ p2 = uv_et[ lw ].UV();
+ int iR = lw + nb - 1;
+ double xR = pTBR.x;
+ gp_UV p0R = quad->side[0].Value2d( xR );
+ gp_UV p2R = uv_et[ iR ].UV();
+ for ( int i = 1; i < nl-1; ++i )
+ {
+ y = yCbL + ( 1. - yCbL ) * i / (nl-1.);
+ p1 = quad->side[1].Value2d( y );
+ p3 = quad->side[3].Value2d( y );
+ uv = calcUV( x,y, a0,a1,a2,a3, p0,p1,p2,p3 );
+ pointsLCt[ i ].u = uv.X();
+ pointsLCt[ i ].v = uv.Y();
+
+ y = yCbR + ( 1. - yCbR ) * i / (nl-1.);
+ p1 = quad->side[1].Value2d( y );
+ p3 = quad->side[3].Value2d( y );
+ uv = calcUV( xR,y, a0,a1,a2,a3, p0R,p1,p2R,p3 );
+ pointsRCt[ i ].u = uv.X();
+ pointsRCt[ i ].v = uv.Y();
+ }
+ sideLCt = StdMeshers_FaceSide::New( pointsLCt, aFace );
+ sideRCt = StdMeshers_FaceSide::New( pointsRCt, aFace );
+ }
+ // Make a side separating domains Cb and Ct
+ StdMeshers_FaceSidePtr sideCbCt;
+ {
+ vector<UVPtStruct> pointsCbCt( nb );
+ pointsCbCt[0] = pTBL;
+ pointsCbCt.back() = pTBR;
+ p1 = quad->side[1].Value2d( yCbR );
+ p3 = quad->side[3].Value2d( yCbL );
+ for ( int i = 1; i < nb-1; ++i )
+ {
+ x = quad->side[2].Param( i + lw );
+ y = yCbL + ( yCbR - yCbL ) * i / (nb-1.);
+ p2 = uv_et[ i + lw ].UV();
+ p0 = quad->side[0].Value2d( x );
+ uv = calcUV( x,y, a0,a1,a2,a3, p0,p1,p2,p3 );
+ pointsCbCt[ i ].u = uv.X();
+ pointsCbCt[ i ].v = uv.Y();
+ }
+ sideCbCt = StdMeshers_FaceSide::New( pointsCbCt, aFace );
+ }
+ // Make Cb quad
+ FaceQuadStruct* qCb = new FaceQuadStruct( quad->face, "Cb" );
+ myQuadList.push_back( FaceQuadStruct::Ptr( qCb ));
+ qCb->side.resize(4);
+ qCb->side[0] = quad->side[0];
+ qCb->side[1] = sideRCb;
+ qCb->side[2] = sideCbCt;
+ qCb->side[3] = sideLCb;
+ // Make L quad
+ FaceQuadStruct* qL = new FaceQuadStruct( quad->face, "L" );
+ myQuadList.push_back( FaceQuadStruct::Ptr( qL ));
+ qL->side.resize(4);
+ qL->side[0] = sideLCb;
+ qL->side[1] = sideLCt;
+ qL->side[2] = quad->side[2];
+ qL->side[3] = quad->side[3];
+ qL->side[2].to = ( lw + 1 ) * dt + tfrom;
+ // Make R quad
+ FaceQuadStruct* qR = new FaceQuadStruct( quad->face, "R" );
+ myQuadList.push_back( FaceQuadStruct::Ptr( qR ));
+ qR->side.resize(4);
+ qR->side[0] = sideRCb;
+ qR->side[0].from = lw;
+ qR->side[0].to = -1;
+ qR->side[0].di = -1;
+ qR->side[1] = quad->side[1];
+ qR->side[2] = quad->side[2];
+ qR->side[2].from = ( lw + nb-1 ) * dt + tfrom;
+ qR->side[3] = sideRCt;
+ // Make Ct from the main quad
+ FaceQuadStruct::Ptr qCt = quad;
+ qCt->side[0] = sideCbCt;
+ qCt->side[1] = sideRCt;
+ qCt->side[2].from = ( lw ) * dt + tfrom;
+ qCt->side[2].to = ( lw + nb ) * dt + tfrom;
+ qCt->side[3] = sideLCt;
+ qCt->uv_grid.clear();
+ qCt->name = "Ct";
+
+ // Connect sides
+ qCb->side[3].AddContact( lw, & qCb->side[2], 0 );
+ qCb->side[3].AddContact( lw, & qCt->side[3], 0 );
+ qCt->side[3].AddContact( 0, & qCt->side[0], 0 );
+ qCt->side[0].AddContact( 0, & qL ->side[0], lw );
+ qL ->side[0].AddContact( lw, & qL ->side[1], 0 );
+ qL ->side[0].AddContact( lw, & qCb->side[2], 0 );
+ //
+ qCb->side[1].AddContact( lw, & qCb->side[2], nb-1 );
+ qCb->side[1].AddContact( lw, & qCt->side[1], 0 );
+ qCt->side[0].AddContact( nb-1, & qCt->side[1], 0 );
+ qCt->side[0].AddContact( nb-1, & qR ->side[0], lw );
+ qR ->side[3].AddContact( 0, & qR ->side[0], lw );
+ qR ->side[3].AddContact( 0, & qCb->side[2], nb-1 );
+
+ return computeQuadDominant( aMesh, aFace );
+
+ } // if ( !myForcedPnts.empty() )
+
if ( dh > dv ) {
addv = (dh-dv)/2;
nbv = nbv + addv;
nbh = nbh + addh;
}
- const vector<UVPtStruct>& uv_eb = quad->side[0]->GetUVPtStruct(true,0);
- const vector<UVPtStruct>& uv_er = quad->side[1]->GetUVPtStruct(false,1);
- const vector<UVPtStruct>& uv_et = quad->side[2]->GetUVPtStruct(true,1);
- const vector<UVPtStruct>& uv_el = quad->side[3]->GetUVPtStruct(false,0);
-
- if (uv_eb.size() != nb || uv_er.size() != nr || uv_et.size() != nt || uv_el.size() != nl)
- return error(COMPERR_BAD_INPUT_MESH);
-
- if ( !OldVersion )
- {
- // dh/2, Min(nb,nt), dh - dh/2, dv
- }
-
// arrays for normalized params
TColStd_SequenceOfReal npb, npr, npt, npl;
for (i=0; i<nb; i++) {
npl.InsertAfter(1,npl.Value(2)-dpr);
}
}
-
- gp_XY a0(uv_eb.front().u, uv_eb.front().v);
- gp_XY a1(uv_eb.back().u, uv_eb.back().v);
- gp_XY a2(uv_et.back().u, uv_et.back().v);
- gp_XY a3(uv_et.front().u, uv_et.front().v);
int nnn = Min(nr,nl);
// auxilary sequence of XY for creation nodes
NodesL.SetValue(1,j,uv_el[j-1].node);
if (dl>0) {
// add top nodes
- for (i=1; i<=dl; i++)
+ for (i=1; i<=dl; i++)
NodesL.SetValue(i+1,nl,uv_et[i].node);
// create and add needed nodes
TColgp_SequenceOfXY UVtmp;
if (WisF) {
SMDS_MeshFace* F =
myHelper->AddFace(NodesL.Value(i,j), NodesL.Value(i+1,j),
- NodesL.Value(i+1,j+1), NodesL.Value(i,j+1));
- if (F) meshDS->SetMeshElementOnShape(F, geomFaceID);
- }
- else {
- SMDS_MeshFace* F =
- myHelper->AddFace(NodesL.Value(i,j), NodesL.Value(i,j+1),
- NodesL.Value(i+1,j+1), NodesL.Value(i+1,j));
+ NodesL.Value(i+1,j+1), NodesL.Value(i,j+1));
if (F) meshDS->SetMeshElementOnShape(F, geomFaceID);
}
}
UVL.Append(gp_UV (uv_el[i].u, uv_el[i].v));
}
}
-
+
// step2: create faces for right domain
StdMeshers_Array2OfNode NodesR(1,dr+1,1,nr);
// add right nodes
- for (j=1; j<=nr; j++)
+ for (j=1; j<=nr; j++)
NodesR.SetValue(1,j,uv_er[nr-j].node);
if (dr>0) {
// add top nodes
- for (i=1; i<=dr; i++)
+ for (i=1; i<=dr; i++)
NodesR.SetValue(i+1,1,uv_et[nt-1-i].node);
// create and add needed nodes
TColgp_SequenceOfXY UVtmp;
if (WisF) {
SMDS_MeshFace* F =
myHelper->AddFace(NodesR.Value(i,j), NodesR.Value(i+1,j),
- NodesR.Value(i+1,j+1), NodesR.Value(i,j+1));
- if (F) meshDS->SetMeshElementOnShape(F, geomFaceID);
- }
- else {
- SMDS_MeshFace* F =
- myHelper->AddFace(NodesR.Value(i,j), NodesR.Value(i,j+1),
- NodesR.Value(i+1,j+1), NodesR.Value(i+1,j));
+ NodesR.Value(i+1,j+1), NodesR.Value(i,j+1));
if (F) meshDS->SetMeshElementOnShape(F, geomFaceID);
}
}
UVR.Append(gp_UV(uv_er[i].u, uv_er[i].v));
}
}
-
+
// step3: create faces for central domain
StdMeshers_Array2OfNode NodesC(1,nb,1,nbv);
// add first line using NodesL
for (i=1; i<nr; i++)
NodesC.SetValue(nb,dr+i+1,NodesR(dr+1,nr-i));
// add top nodes (last columns)
- for (i=dl+2; i<nbh-dr; i++)
+ for (i=dl+2; i<nbh-dr; i++)
NodesC.SetValue(i-dl,nbv,uv_et[i-1].node);
// add bottom nodes (first columns)
for (i=2; i<nb; i++)
NodesC.SetValue(i,1,uv_eb[i-1].node);
-
+
// create and add needed nodes
// add linear layers
for (i=2; i<nb; i++) {
if (WisF) {
SMDS_MeshFace* F =
myHelper->AddFace(NodesC.Value(i,j), NodesC.Value(i+1,j),
- NodesC.Value(i+1,j+1), NodesC.Value(i,j+1));
- if (F) meshDS->SetMeshElementOnShape(F, geomFaceID);
- }
- else {
- SMDS_MeshFace* F =
- myHelper->AddFace(NodesC.Value(i,j), NodesC.Value(i,j+1),
- NodesC.Value(i+1,j+1), NodesC.Value(i+1,j));
+ NodesC.Value(i+1,j+1), NodesC.Value(i,j+1));
if (F) meshDS->SetMeshElementOnShape(F, geomFaceID);
}
}
if (WisF) {
SMDS_MeshFace* F =
myHelper->AddFace(NodesBRD.Value(i,j), NodesBRD.Value(i+1,j),
- NodesBRD.Value(i+1,j+1), NodesBRD.Value(i,j+1));
- if (F) meshDS->SetMeshElementOnShape(F, geomFaceID);
- }
- else {
- SMDS_MeshFace* F =
- myHelper->AddFace(NodesBRD.Value(i,j), NodesBRD.Value(i,j+1),
- NodesBRD.Value(i+1,j+1), NodesBRD.Value(i+1,j));
+ NodesBRD.Value(i+1,j+1), NodesBRD.Value(i,j+1));
if (F) meshDS->SetMeshElementOnShape(F, geomFaceID);
}
}
double yy1 = y1 + dy1*i;
double dyy = yy1 - yy0;
for (j=1; j<=nb; j++) {
- double x = npt.Value(i+1+drl) +
+ double x = npt.Value(i+1+drl) +
npb.Value(j) * (npt.Value(nt-i) - npt.Value(i+1+drl));
double y = yy0 + dyy*x;
gp_UV UV = calcUV2(x, y, quad, a0, a1, a2, a3);
double yy1 = y1 + dy1*i;
double dyy = yy1 - yy0;
for (j=1; j<=nb; j++) {
- double x = npt.Value(i+1) +
+ double x = npt.Value(i+1) +
npb.Value(j) * (npt.Value(nt-i-drl) - npt.Value(i+1));
double y = yy0 + dyy*x;
gp_UV UV = calcUV2(x, y, quad, a0, a1, a2, a3);
if (WisF) {
SMDS_MeshFace* F =
myHelper->AddFace(NodesC.Value(i,j), NodesC.Value(i+1,j),
- NodesC.Value(i+1,j+1), NodesC.Value(i,j+1));
- if (F) meshDS->SetMeshElementOnShape(F, geomFaceID);
- }
- else {
- SMDS_MeshFace* F =
- myHelper->AddFace(NodesC.Value(i,j), NodesC.Value(i,j+1),
- NodesC.Value(i+1,j+1), NodesC.Value(i+1,j));
+ NodesC.Value(i+1,j+1), NodesC.Value(i,j+1));
if (F) meshDS->SetMeshElementOnShape(F, geomFaceID);
}
}
if (WisF) {
SMDS_MeshFace* F =
myHelper->AddFace(NodesLast.Value(i,1), NodesLast.Value(i+1,1),
- NodesLast.Value(i+1,2), NodesLast.Value(i,2));
- if (F) meshDS->SetMeshElementOnShape(F, geomFaceID);
- }
- else {
- SMDS_MeshFace* F =
- myHelper->AddFace(NodesLast.Value(i,1), NodesLast.Value(i,2),
- NodesLast.Value(i+1,2), NodesLast.Value(i+1,2));
+ NodesLast.Value(i+1,2), NodesLast.Value(i,2));
if (F) meshDS->SetMeshElementOnShape(F, geomFaceID);
}
}
*/
//=============================================================================
-void StdMeshers_Quadrangle_2D::splitQuad(SMESHDS_Mesh * theMeshDS,
- int theFaceID,
- const SMDS_MeshNode* theNode1,
- const SMDS_MeshNode* theNode2,
- const SMDS_MeshNode* theNode3,
- const SMDS_MeshNode* theNode4)
+void StdMeshers_Quadrangle_2D::splitQuadFace(SMESHDS_Mesh * theMeshDS,
+ int theFaceID,
+ const SMDS_MeshNode* theNode1,
+ const SMDS_MeshNode* theNode2,
+ const SMDS_MeshNode* theNode3,
+ const SMDS_MeshNode* theNode4)
{
SMDS_MeshFace* face;
if ( SMESH_TNodeXYZ( theNode1 ).SquareDistance( theNode3 ) >
SMESH_MesherHelper* helper,
Handle(Geom_Surface) S)
{
- const vector<UVPtStruct>& uv_eb = quad->side[QUAD_BOTTOM_SIDE]->GetUVPtStruct();
- const vector<UVPtStruct>& uv_et = quad->side[QUAD_TOP_SIDE ]->GetUVPtStruct();
+ const vector<UVPtStruct>& uv_eb = quad->side[QUAD_BOTTOM_SIDE].GetUVPtStruct();
+ const vector<UVPtStruct>& uv_et = quad->side[QUAD_TOP_SIDE ].GetUVPtStruct();
double rBot = ( uv_eb.size() - 1 ) * uvPt.normParam;
double rTop = ( uv_et.size() - 1 ) * uvPt.normParam;
int iBot = int( rBot );
gp_UV uv = calcUV(/*x,y=*/x, y,
/*a0,...=*/UVs[UV_A0], UVs[UV_A1], UVs[UV_A2], UVs[UV_A3],
- /*p0=*/quad->side[QUAD_BOTTOM_SIDE]->Value2d( x ).XY(),
+ /*p0=*/quad->side[QUAD_BOTTOM_SIDE].grid->Value2d( x ).XY(),
/*p1=*/UVs[ UV_R ],
- /*p2=*/quad->side[QUAD_TOP_SIDE ]->Value2d( x ).XY(),
+ /*p2=*/quad->side[QUAD_TOP_SIDE ].grid->Value2d( x ).XY(),
/*p3=*/UVs[ UV_L ]);
gp_Pnt P = S->Value( uv.X(), uv.Y() );
uvPt.u = uv.X();
Handle(Geom_Surface) S = BRep_Tool::Surface(aFace);
int i,j,geomFaceID = meshDS->ShapeToIndex(aFace);
- int nb = quad->side[0]->NbPoints(); // bottom
- int nr = quad->side[1]->NbPoints(); // right
- int nt = quad->side[2]->NbPoints(); // top
- int nl = quad->side[3]->NbPoints(); // left
+ int nb = quad->side[0].NbPoints(); // bottom
+ int nr = quad->side[1].NbPoints(); // right
+ int nt = quad->side[2].NbPoints(); // top
+ int nl = quad->side[3].NbPoints(); // left
// Simple Reduce 10->8->6->4 (3 steps) Multiple Reduce 10->4 (1 step)
//
}
}
- nb = quad->side[0]->NbPoints();
- nr = quad->side[1]->NbPoints();
- nt = quad->side[2]->NbPoints();
- nl = quad->side[3]->NbPoints();
+ nb = quad->side[0].NbPoints();
+ nr = quad->side[1].NbPoints();
+ nt = quad->side[2].NbPoints();
+ nl = quad->side[3].NbPoints();
dh = abs(nb-nt);
dv = abs(nr-nl);
int nbh = Max(nb,nt);
nbh = nbh + addh;
}
- const vector<UVPtStruct>& uv_eb = quad->side[0]->GetUVPtStruct(true,0);
- const vector<UVPtStruct>& uv_er = quad->side[1]->GetUVPtStruct(false,1);
- const vector<UVPtStruct>& uv_et = quad->side[2]->GetUVPtStruct(true,1);
- const vector<UVPtStruct>& uv_el = quad->side[3]->GetUVPtStruct(false,0);
+ const vector<UVPtStruct>& uv_eb = quad->side[0].GetUVPtStruct(true,0);
+ const vector<UVPtStruct>& uv_er = quad->side[1].GetUVPtStruct(false,1);
+ const vector<UVPtStruct>& uv_et = quad->side[2].GetUVPtStruct(true,1);
+ const vector<UVPtStruct>& uv_el = quad->side[3].GetUVPtStruct(false,0);
if (uv_eb.size() != nb || uv_er.size() != nr || uv_et.size() != nt || uv_el.size() != nl)
return error(COMPERR_BAD_INPUT_MESH);
}
}
- nb = quad->side[0]->NbPoints();
- nr = quad->side[1]->NbPoints();
- nt = quad->side[2]->NbPoints();
- nl = quad->side[3]->NbPoints();
+ nb = quad->side[0].NbPoints();
+ nr = quad->side[1].NbPoints();
+ nt = quad->side[2].NbPoints();
+ nl = quad->side[3].NbPoints();
// number of rows and columns
int nrows = nr - 1; // and also == nl - 1
}
}
- const vector<UVPtStruct>& uv_eb = quad->side[0]->GetUVPtStruct(true,0);
- const vector<UVPtStruct>& uv_er = quad->side[1]->GetUVPtStruct(false,1);
- const vector<UVPtStruct>& uv_et = quad->side[2]->GetUVPtStruct(true,1);
- const vector<UVPtStruct>& uv_el = quad->side[3]->GetUVPtStruct(false,0);
+ const vector<UVPtStruct>& uv_eb = quad->side[0].GetUVPtStruct(true,0);
+ const vector<UVPtStruct>& uv_er = quad->side[1].GetUVPtStruct(false,1);
+ const vector<UVPtStruct>& uv_et = quad->side[2].GetUVPtStruct(true,1);
+ const vector<UVPtStruct>& uv_el = quad->side[3].GetUVPtStruct(false,0);
if (uv_eb.size() != nb || uv_er.size() != nr || uv_et.size() != nt || uv_el.size() != nl)
return error(COMPERR_BAD_INPUT_MESH);
double d = v1 ^ v2;
return d > 1e-100;
}
+ //================================================================================
+ /*!
+ * \brief Returns area of a triangle
+ */
+ //================================================================================
+
+ double getArea( const gp_UV uv1, const gp_UV uv2, const gp_UV uv3 )
+ {
+ gp_XY v1 = uv1 - uv2, v2 = uv3 - uv2;
+ double a = v2 ^ v1;
+ return a;
+ }
}
//================================================================================
// --------------------------------------------------------------------------
for ( unsigned i = 0; i < quad->side.size(); ++i )
{
- StdMeshers_FaceSide* side = quad->side[i];
- const vector<UVPtStruct>& uvVec = side->GetUVPtStruct();
+ const vector<UVPtStruct>& uvVec = quad->side[i].GetUVPtStruct();
// find which end of the side is on degenerated shape
int degenInd = -1;
if ( i >= QUAD_TOP_SIDE )
isPrev = !isPrev;
int i2 = ( isPrev ? ( i + 3 ) : ( i + 1 )) % 4;
- StdMeshers_FaceSide* side2 = quad->side[ i2 ];
- const vector<UVPtStruct>& uvVec2 = side2->GetUVPtStruct();
+ const vector<UVPtStruct>& uvVec2 = quad->side[ i2 ].GetUVPtStruct();
int degenInd2 = -1;
- if ( uvVec[ degenInd ].node == uvVec2[0].node )
+ if ( uvVec[ degenInd ].node == uvVec2.front().node )
degenInd2 = 0;
else if ( uvVec[ degenInd ].node == uvVec2.back().node )
degenInd2 = uvVec2.size() - 1;
// ----------------------------------------------------------------------------
for ( unsigned i = 0; i < quad->side.size(); ++i )
{
- StdMeshers_FaceSide* degSide = quad->side[i];
+ StdMeshers_FaceSidePtr degSide = quad->side[i];
if ( !myHelper->IsDegenShape( degSide->EdgeID(0) ))
continue;
- StdMeshers_FaceSide* oppSide = quad->side[( i+2 ) % quad->side.size() ];
+ StdMeshers_FaceSidePtr oppSide = quad->side[( i+2 ) % quad->side.size() ];
if ( degSide->NbSegments() == oppSide->NbSegments() )
continue;
const SMDS_MeshNode* n = uvVecDegOld[0].node;
Handle(Geom2d_Curve) c2d = degSide->Curve2d(0);
double f = degSide->FirstU(0), l = degSide->LastU(0);
- gp_Pnt2d p1( uvVecDegOld.front().u, uvVecDegOld.front().v );
- gp_Pnt2d p2( uvVecDegOld.back().u, uvVecDegOld.back().v );
+ gp_Pnt2d p1 = uvVecDegOld.front().UV();
+ gp_Pnt2d p2 = uvVecDegOld.back().UV();
- delete degSide;
- quad->side[i] = new StdMeshers_FaceSide( oppSide, n, &p1, &p2, c2d, f, l );
+ quad->side[i] = StdMeshers_FaceSide::New( oppSide.get(), n, &p1, &p2, c2d, f, l );
}
}
// Get nodes to smooth
+ // TODO: do not smooth fixed nodes
+
typedef map< const SMDS_MeshNode*, TSmoothNode, TIDCompare > TNo2SmooNoMap;
TNo2SmooNoMap smooNoMap;
// set _uv of smooth nodes on FACE boundary
for ( unsigned i = 0; i < quad->side.size(); ++i )
{
- const vector<UVPtStruct>& uvVec = quad->side[i]->GetUVPtStruct();
+ const vector<UVPtStruct>& uvVec = quad->side[i].GetUVPtStruct();
for ( unsigned j = 0; j < uvVec.size(); ++j )
{
TSmoothNode & sNode = smooNoMap[ uvVec[j].node ];
- sNode._uv.SetCoord( uvVec[j].u, uvVec[j].v );
+ sNode._uv = uvVec[j].UV();
sNode._xyz = SMESH_TNodeXYZ( uvVec[j].node );
}
}
}
}
-/*//================================================================================
+//================================================================================
/*!
- * \brief Finds vertices at the most sharp face corners
- * \param [in] theFace - the FACE
- * \param [in,out] theWire - the ordered edges of the face. It can be modified to
- * have the first VERTEX of the first EDGE in \a vertices
- * \param [out] theVertices - the found corner vertices in the order corresponding to
- * the order of EDGEs in \a theWire
- * \param [out] theNbDegenEdges - nb of degenerated EDGEs in theFace
- * \param [in] theConsiderMesh - if \c true, only meshed VERTEXes are considered
- * as possible corners
- * \return int - number of quad sides found: 0, 3 or 4
+ * \brief Checks validity of generated faces
*/
//================================================================================
-int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace,
- SMESH_Mesh & theMesh,
- std::list<TopoDS_Edge>& theWire,
- std::vector<TopoDS_Vertex>& theVertices,
- int & theNbDegenEdges,
- const bool theConsiderMesh)
+bool StdMeshers_Quadrangle_2D::check()
{
- theNbDegenEdges = 0;
+ const bool isOK = true;
+ if ( !myCheckOri || myQuadList.empty() || !myQuadList.front() || !myHelper )
+ return isOK;
- SMESH_MesherHelper helper( theMesh );
+ TopoDS_Face geomFace = TopoDS::Face( myHelper->GetSubShape() );
+ SMESHDS_Mesh* meshDS = myHelper->GetMeshDS();
+ SMESHDS_SubMesh* fSubMesh = meshDS->MeshElements( geomFace );
+ bool toCheckUV;
+ if ( geomFace.Orientation() >= TopAbs_INTERNAL ) geomFace.Orientation( TopAbs_FORWARD );
- // sort theVertices by angle
- multimap<double, TopoDS_Vertex> vertexByAngle;
- TopTools_DataMapOfShapeReal angleByVertex;
- TopoDS_Edge prevE = theWire.back();
- if ( SMESH_Algo::isDegenerated( prevE ))
+ // Get a reference orientation sign
+
+ double okSign;
+ {
+ TError err;
+ TSideVector wireVec =
+ StdMeshers_FaceSide::GetFaceWires( geomFace, *myHelper->GetMesh(), true, err );
+ StdMeshers_FaceSidePtr wire = wireVec[0];
+
+ // find a right angle VERTEX
+ int iVertex;
+ double maxAngle = -1e100;
+ for ( int i = 0; i < wire->NbEdges(); ++i )
+ {
+ int iPrev = myHelper->WrapIndex( i-1, wire->NbEdges() );
+ const TopoDS_Edge& e1 = wire->Edge( iPrev );
+ const TopoDS_Edge& e2 = wire->Edge( i );
+ double angle = myHelper->GetAngle( e1, e2, geomFace );
+ if ( maxAngle < angle && angle < 0.9 * M_PI )
+ {
+ maxAngle = angle;
+ iVertex = i;
+ }
+ }
+ if ( maxAngle < -2*M_PI ) return isOK;
+
+ // get a sign of 2D area of a corner face
+
+ int iPrev = myHelper->WrapIndex( iVertex-1, wire->NbEdges() );
+ const TopoDS_Edge& e1 = wire->Edge( iPrev );
+ const TopoDS_Edge& e2 = wire->Edge( iVertex );
+
+ gp_Vec2d v1, v2; gp_Pnt2d p;
+ double u[2];
+ {
+ bool rev = ( e1.Orientation() == TopAbs_REVERSED );
+ Handle(Geom2d_Curve) c = BRep_Tool::CurveOnSurface( e1, geomFace, u[0], u[1] );
+ c->D1( u[ !rev ], p, v1 );
+ if ( !rev )
+ v1.Reverse();
+ }
+ {
+ bool rev = ( e2.Orientation() == TopAbs_REVERSED );
+ Handle(Geom2d_Curve) c = BRep_Tool::CurveOnSurface( e2, geomFace, u[0], u[1] );
+ c->D1( u[ rev ], p, v2 );
+ if ( rev )
+ v2.Reverse();
+ }
+
+ okSign = v2 ^ v1;
+
+ if ( maxAngle < 0 )
+ okSign *= -1;
+ }
+
+ // Look for incorrectly oriented faces
+
+ std::list<const SMDS_MeshElement*> badFaces;
+
+ const SMDS_MeshNode* nn [ 8 ]; // 8 is just for safety
+ gp_UV uv [ 8 ];
+ SMDS_ElemIteratorPtr fIt = fSubMesh->GetElements();
+ while ( fIt->more() ) // loop on faces bound to a FACE
+ {
+ const SMDS_MeshElement* f = fIt->next();
+
+ const int nbN = f->NbCornerNodes();
+ for ( int i = 0; i < nbN; ++i )
+ nn[ i ] = f->GetNode( i );
+
+ const SMDS_MeshNode* nInFace = 0;
+ if ( myHelper->HasSeam() )
+ for ( int i = 0; i < nbN && !nInFace; ++i )
+ if ( !myHelper->IsSeamShape( nn[i]->getshapeId() ))
+ nInFace = nn[i];
+
+ for ( int i = 0; i < nbN; ++i )
+ uv[ i ] = myHelper->GetNodeUV( geomFace, nn[i], nInFace, &toCheckUV );
+
+ switch ( nbN ) {
+ case 4:
+ {
+ double sign1 = getArea( uv[0], uv[1], uv[2] );
+ double sign2 = getArea( uv[0], uv[2], uv[3] );
+ if ( sign1 * sign2 < 0 )
+ {
+ sign2 = getArea( uv[1], uv[2], uv[3] );
+ sign1 = getArea( uv[1], uv[3], uv[0] );
+ if ( sign1 * sign2 < 0 )
+ continue; // this should not happen
+ }
+ if ( sign1 * okSign < 0 )
+ badFaces.push_back ( f );
+ break;
+ }
+ case 3:
+ {
+ double sign = getArea( uv[0], uv[1], uv[2] );
+ if ( sign * okSign < 0 )
+ badFaces.push_back ( f );
+ break;
+ }
+ default:;
+ }
+ }
+
+ if ( !badFaces.empty() )
+ {
+ SMESH_subMesh* fSM = myHelper->GetMesh()->GetSubMesh( geomFace );
+ SMESH_ComputeErrorPtr& err = fSM->GetComputeError();
+ err.reset ( new SMESH_ComputeError( COMPERR_ALGO_FAILED,
+ "Inverted elements generated"));
+ err->myBadElements.swap( badFaces );
+
+ return !isOK;
+ }
+
+ return isOK;
+}
+
+/*//================================================================================
+/*!
+ * \brief Finds vertices at the most sharp face corners
+ * \param [in] theFace - the FACE
+ * \param [in,out] theWire - the ordered edges of the face. It can be modified to
+ * have the first VERTEX of the first EDGE in \a vertices
+ * \param [out] theVertices - the found corner vertices in the order corresponding to
+ * the order of EDGEs in \a theWire
+ * \param [out] theNbDegenEdges - nb of degenerated EDGEs in theFace
+ * \param [in] theConsiderMesh - if \c true, only meshed VERTEXes are considered
+ * as possible corners
+ * \return int - number of quad sides found: 0, 3 or 4
+ */
+//================================================================================
+
+int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace,
+ SMESH_Mesh & theMesh,
+ std::list<TopoDS_Edge>& theWire,
+ std::vector<TopoDS_Vertex>& theVertices,
+ int & theNbDegenEdges,
+ const bool theConsiderMesh)
+{
+ theNbDegenEdges = 0;
+
+ SMESH_MesherHelper helper( theMesh );
+
+ // sort theVertices by angle
+ multimap<double, TopoDS_Vertex> vertexByAngle;
+ TopTools_DataMapOfShapeReal angleByVertex;
+ TopoDS_Edge prevE = theWire.back();
+ if ( SMESH_Algo::isDegenerated( prevE ))
{
list<TopoDS_Edge>::reverse_iterator edge = ++theWire.rbegin();
while ( SMESH_Algo::isDegenerated( *edge ))
TopoDS_Shape triaVertex = helper.GetMeshDS()->IndexToShape( myTriaVertexID );
if ( !triaVertex.IsNull() &&
triaVertex.ShapeType() == TopAbs_VERTEX &&
- helper.IsSubShape( triaVertex, theFace ))
+ helper.IsSubShape( triaVertex, theFace ) &&
+ ( vertexByAngle.size() != 4 || vertexByAngle.begin()->first < 5 * M_PI/180. ))
nbCorners = 3;
else
triaVertex.Nullify();
isThereVariants = ( lostAngle * 1.1 >= lastAngle );
}
+ myCheckOri = ( vertexByAngle.size() > nbCorners ||
+ vertexByAngle.begin()->first < 5.* M_PI/180 );
+
// make theWire begin from a corner vertex or triaVertex
if ( nbCorners == 3 )
while ( !triaVertex.IsSame( ( helper.IthVertex( 0, theWire.front() ))) ||
return nbCorners;
}
+
+//================================================================================
+/*!
+ * \brief Constructor of a side of quad
+ */
+//================================================================================
+
+FaceQuadStruct::Side::Side(StdMeshers_FaceSidePtr theGrid)
+ : grid(theGrid), nbNodeOut(0), from(0), to(theGrid ? theGrid->NbPoints() : 0 ), di(1)
+{
+}
+
+//=============================================================================
+/*!
+ * \brief Constructor of a quad
+ */
+//=============================================================================
+
+FaceQuadStruct::FaceQuadStruct(const TopoDS_Face& F, const std::string& theName)
+ : face( F ), name( theName )
+{
+ side.reserve(4);
+}
+
+//================================================================================
+/*!
+ * \brief Fills myForcedPnts
+ */
+//================================================================================
+
+bool StdMeshers_Quadrangle_2D::getEnforcedUV()
+{
+ myForcedPnts.clear();
+ if ( !myParams ) return true; // missing hypothesis
+
+ std::vector< TopoDS_Shape > shapes;
+ std::vector< gp_Pnt > points;
+ myParams->GetEnforcedNodes( shapes, points );
+
+ TopTools_IndexedMapOfShape vMap;
+ for ( size_t i = 0; i < shapes.size(); ++i )
+ if ( !shapes[i].IsNull() )
+ TopExp::MapShapes( shapes[i], TopAbs_VERTEX, vMap );
+
+ size_t nbPoints = points.size();
+ for ( int i = 1; i <= vMap.Extent(); ++i )
+ points.push_back( BRep_Tool::Pnt( TopoDS::Vertex( vMap( i ))));
+
+ // find out if all points must be in the FACE, which is so if
+ // myParams is a local hypothesis on the FACE being meshed
+ bool isStrictCheck = false;
+ {
+ SMESH_HypoFilter paramFilter( SMESH_HypoFilter::Is( myParams ));
+ TopoDS_Shape assignedTo;
+ if ( myHelper->GetMesh()->GetHypothesis( myHelper->GetSubShape(),
+ paramFilter,
+ /*ancestors=*/true,
+ &assignedTo ))
+ isStrictCheck = ( assignedTo.IsSame( myHelper->GetSubShape() ));
+ }
+
+ multimap< double, ForcedPoint > sortedFP; // sort points by distance from EDGEs
+
+ Standard_Real u1,u2,v1,v2;
+ const TopoDS_Face& face = TopoDS::Face( myHelper->GetSubShape() );
+ const double tol = BRep_Tool::Tolerance( face );
+ Handle(Geom_Surface) surf = BRep_Tool::Surface( face );
+ surf->Bounds( u1,u2,v1,v2 );
+ GeomAPI_ProjectPointOnSurf project;
+ project.Init(surf, u1,u2, v1,v2, tol );
+ Bnd_Box bbox;
+ BRepBndLib::Add( face, bbox );
+ double farTol = 0.01 * sqrt( bbox.SquareExtent() );
+
+ for ( size_t iP = 0; iP < points.size(); ++iP )
+ {
+ project.Perform( points[ iP ]);
+ if ( !project.IsDone() )
+ {
+ if ( isStrictCheck && iP < nbPoints )
+ return error
+ (TComm("Projection of an enforced point to the face failed - (")
+ << points[ iP ].X() << ", "<< points[ iP ].Y() << ", "<< points[ iP ].Z() << " )");
+ continue;
+ }
+ if ( project.LowerDistance() > farTol )
+ {
+ if ( isStrictCheck && iP < nbPoints )
+ return error
+ (COMPERR_BAD_PARMETERS, TComm("An enforced point is too far from the face, dist = ")
+ << project.LowerDistance() << " - ("
+ << points[ iP ].X() << ", "<< points[ iP ].Y() << ", "<< points[ iP ].Z() << " )");
+ continue;
+ }
+ Quantity_Parameter u, v;
+ project.LowerDistanceParameters(u, v);
+ gp_Pnt2d uv( u, v );
+ BRepClass_FaceClassifier clsf ( face, uv, tol );
+ switch ( clsf.State() ) {
+ case TopAbs_IN:
+ {
+ double edgeDist = ( Min( Abs( u - u1 ), Abs( u - u2 )) +
+ Min( Abs( v - v1 ), Abs( v - v2 )));
+ ForcedPoint fp;
+ fp.uv = uv.XY();
+ fp.xyz = points[ iP ].XYZ();
+ if ( iP >= nbPoints )
+ fp.vertex = TopoDS::Vertex( vMap( iP - nbPoints + 1 ));
+
+ sortedFP.insert( make_pair( edgeDist, fp ));
+ break;
+ }
+ case TopAbs_OUT:
+ {
+ if ( isStrictCheck && iP < nbPoints )
+ return error
+ (COMPERR_BAD_PARMETERS, TComm("An enforced point is out of the face boundary - ")
+ << points[ iP ].X() << ", "<< points[ iP ].Y() << ", "<< points[ iP ].Z() << " )");
+ break;
+ }
+ case TopAbs_ON:
+ {
+ if ( isStrictCheck && iP < nbPoints )
+ return error
+ (COMPERR_BAD_PARMETERS, TComm("An enforced point is on the face boundary - ")
+ << points[ iP ].X() << ", "<< points[ iP ].Y() << ", "<< points[ iP ].Z() << " )");
+ break;
+ }
+ default:
+ {
+ if ( isStrictCheck && iP < nbPoints )
+ return error
+ (TComm("Classification of an enforced point ralative to the face boundary failed - ")
+ << points[ iP ].X() << ", "<< points[ iP ].Y() << ", "<< points[ iP ].Z() << " )");
+ }
+ }
+ }
+
+ multimap< double, ForcedPoint >::iterator d2uv = sortedFP.begin();
+ for ( ; d2uv != sortedFP.end(); ++d2uv )
+ myForcedPnts.push_back( (*d2uv).second );
+
+ return true;
+}
+
+//================================================================================
+/*!
+ * \brief Splits quads by adding points of enforced nodes and create nodes on
+ * the sides shared by quads
+ */
+//================================================================================
+
+bool StdMeshers_Quadrangle_2D::addEnforcedNodes()
+{
+ // if ( myForcedPnts.empty() )
+ // return true;
+
+ // make a map of quads sharing a side
+ map< StdMeshers_FaceSidePtr, vector< FaceQuadStruct::Ptr > > quadsBySide;
+ list< FaceQuadStruct::Ptr >::iterator quadIt = myQuadList.begin();
+ for ( ; quadIt != myQuadList.end(); ++quadIt )
+ for ( size_t iSide = 0; iSide < (*quadIt)->side.size(); ++iSide )
+ {
+ if ( !setNormalizedGrid( *quadIt ))
+ return false;
+ quadsBySide[ (*quadIt)->side[iSide] ].push_back( *quadIt );
+ }
+
+ SMESH_Mesh* mesh = myHelper->GetMesh();
+ SMESHDS_Mesh* meshDS = myHelper->GetMeshDS();
+ const TopoDS_Face& face = TopoDS::Face( myHelper->GetSubShape() );
+ Handle(Geom_Surface) surf = BRep_Tool::Surface( face );
+
+ for ( size_t iFP = 0; iFP < myForcedPnts.size(); ++iFP )
+ {
+ bool isNodeEnforced = false;
+
+ // look for a quad enclosing a enforced point
+ for ( quadIt = myQuadList.begin(); quadIt != myQuadList.end(); ++quadIt )
+ {
+ FaceQuadStruct::Ptr quad = *quadIt;
+ if ( !setNormalizedGrid( *quadIt ))
+ return false;
+ int i,j;
+ if ( !quad->findCell( myForcedPnts[ iFP ], i, j ))
+ continue;
+
+ // a grid cell is found, select a node of the cell to move
+ // to the enforced point to and to split the quad at
+ multimap< double, pair< int, int > > ijByDist;
+ for ( int di = 0; di < 2; ++di )
+ for ( int dj = 0; dj < 2; ++dj )
+ {
+ double dist2 = ( myForcedPnts[ iFP ].uv - quad->UVPt( i+di,j+dj ).UV() ).SquareModulus();
+ ijByDist.insert( make_pair( dist2, make_pair( di,dj )));
+ }
+ // try all nodes starting from the closest one
+ set< FaceQuadStruct::Ptr > changedQuads;
+ multimap< double, pair< int, int > >::iterator d2ij = ijByDist.begin();
+ for ( ; !isNodeEnforced && d2ij != ijByDist.end(); ++d2ij )
+ {
+ int di = d2ij->second.first;
+ int dj = d2ij->second.second;
+
+ // check if a node is at a side
+ int iSide = -1;
+ if ( dj== 0 && j == 0 )
+ iSide = QUAD_BOTTOM_SIDE;
+ else if ( dj == 1 && j+2 == quad->jSize )
+ iSide = QUAD_TOP_SIDE;
+ else if ( di == 0 && i == 0 )
+ iSide = QUAD_LEFT_SIDE;
+ else if ( di == 1 && i+2 == quad->iSize )
+ iSide = QUAD_RIGHT_SIDE;
+
+ if ( iSide > -1 ) // ----- node is at a side
+ {
+ FaceQuadStruct::Side& side = quad->side[ iSide ];
+ // check if this node can be moved
+ if ( quadsBySide[ side ].size() < 2 )
+ continue; // its a face boundary -> can't move the node
+
+ int quadNodeIndex = ( iSide % 2 ) ? j : i;
+ int sideNodeIndex = side.ToSideIndex( quadNodeIndex );
+ if ( side.IsForced( sideNodeIndex ))
+ {
+ // the node is already moved to another enforced point
+ isNodeEnforced = quad->isEqual( myForcedPnts[ iFP ], i, j );
+ continue;
+ }
+ // make a node of a side forced
+ vector<UVPtStruct>& points = (vector<UVPtStruct>&) side.GetUVPtStruct();
+ points[ sideNodeIndex ].u = myForcedPnts[ iFP ].U();
+ points[ sideNodeIndex ].v = myForcedPnts[ iFP ].V();
+
+ updateSideUV( side, sideNodeIndex, quadsBySide );
+
+ // update adjacent sides
+ set< StdMeshers_FaceSidePtr > updatedSides;
+ updatedSides.insert( side );
+ for ( size_t i = 0; i < side.contacts.size(); ++i )
+ if ( side.contacts[i].point == sideNodeIndex )
+ {
+ const vector< FaceQuadStruct::Ptr >& adjQuads =
+ quadsBySide[ *side.contacts[i].other_side ];
+ if ( adjQuads.size() > 1 &&
+ updatedSides.insert( * side.contacts[i].other_side ).second )
+ {
+ updateSideUV( *side.contacts[i].other_side,
+ side.contacts[i].other_point,
+ quadsBySide );
+ }
+ changedQuads.insert( adjQuads.begin(), adjQuads.end() );
+ }
+ const vector< FaceQuadStruct::Ptr >& adjQuads = quadsBySide[ side ];
+ changedQuads.insert( adjQuads.begin(), adjQuads.end() );
+
+ isNodeEnforced = true;
+ }
+ else // ------------------ node is inside the quad
+ {
+ i += di;
+ j += dj;
+ // make a new side passing through IJ node and split the quad
+ int indForced, iNewSide;
+ if ( quad->iSize < quad->jSize ) // split vertically
+ {
+ quad->updateUV( myForcedPnts[ iFP ].uv, i, j, /*isVert=*/true );
+ indForced = j;
+ iNewSide = splitQuad( quad, i, 0 );
+ }
+ else
+ {
+ quad->updateUV( myForcedPnts[ iFP ].uv, i, j, /*isVert=*/false );
+ indForced = i;
+ iNewSide = splitQuad( quad, 0, j );
+ }
+ FaceQuadStruct::Ptr newQuad = myQuadList.back();
+ FaceQuadStruct::Side& newSide = newQuad->side[ iNewSide ];
+
+ newSide.forced_nodes.insert( indForced );
+ quad->side[( iNewSide+2 ) % 4 ].forced_nodes.insert( indForced );
+
+ quadsBySide[ newSide ].push_back( quad );
+ quadsBySide[ newQuad->side[0] ].push_back( newQuad );
+ quadsBySide[ newQuad->side[1] ].push_back( newQuad );
+ quadsBySide[ newQuad->side[2] ].push_back( newQuad );
+ quadsBySide[ newQuad->side[3] ].push_back( newQuad );
+
+ isNodeEnforced = true;
+
+ } // end of "node is inside the quad"
+
+ } // loop on nodes of the cell
+
+ // remove out-of-date uv grid of changedQuads
+ set< FaceQuadStruct::Ptr >::iterator qIt = changedQuads.begin();
+ for ( ; qIt != changedQuads.end(); ++qIt )
+ (*qIt)->uv_grid.clear();
+
+ if ( isNodeEnforced )
+ break;
+
+ } // loop on quads
+
+ if ( !isNodeEnforced )
+ {
+ if ( !myForcedPnts[ iFP ].vertex.IsNull() )
+ return error(TComm("Unable to move any node to vertex #")
+ <<myHelper->GetMeshDS()->ShapeToIndex( myForcedPnts[ iFP ].vertex ));
+ else
+ return error(TComm("Unable to move any node to point ( ")
+ << myForcedPnts[iFP].xyz.X() << ", "
+ << myForcedPnts[iFP].xyz.Y() << ", "
+ << myForcedPnts[iFP].xyz.Z() << " )");
+ }
+
+ } // loop on enforced points
+
+ // Compute nodes on all sides, where not yet present
+
+ for ( quadIt = myQuadList.begin(); quadIt != myQuadList.end(); ++quadIt )
+ {
+ FaceQuadStruct::Ptr quad = *quadIt;
+ for ( int iSide = 0; iSide < 4; ++iSide )
+ {
+ FaceQuadStruct::Side & side = quad->side[ iSide ];
+ if ( side.nbNodeOut > 0 )
+ continue; // emulated side
+ vector< FaceQuadStruct::Ptr >& quadVec = quadsBySide[ side ];
+ if ( quadVec.size() <= 1 )
+ continue; // outer side
+
+ bool missedNodesOnSide = false;
+ const vector<UVPtStruct>& points = side.grid->GetUVPtStruct();
+ for ( size_t iC = 0; iC < side.contacts.size(); ++iC )
+ {
+ const vector<UVPtStruct>& oGrid = side.contacts[iC].other_side->grid->GetUVPtStruct();
+ const UVPtStruct& uvPt = points[ side.contacts[iC].point ];
+ if ( side.contacts[iC].other_point >= oGrid.size() ||
+ side.contacts[iC].point >= points.size() )
+ throw SALOME_Exception( "StdMeshers_Quadrangle_2D::addEnforcedNodes(): wrong contact" );
+ if ( oGrid[ side.contacts[iC].other_point ].node )
+ (( UVPtStruct& ) uvPt).node = oGrid[ side.contacts[iC].other_point ].node;
+ }
+ for ( size_t iP = 0; iP < points.size(); ++iP )
+ if ( !points[ iP ].node )
+ {
+ UVPtStruct& uvPnt = ( UVPtStruct& ) points[ iP ];
+ gp_Pnt P = surf->Value( uvPnt.u, uvPnt.v );
+ uvPnt.node = meshDS->AddNode(P.X(), P.Y(), P.Z());
+ meshDS->SetNodeOnFace( uvPnt.node, myHelper->GetSubShapeID(), uvPnt.u, uvPnt.v );
+ missedNodesOnSide = true;
+ }
+ if ( missedNodesOnSide )
+ {
+ // clear uv_grid where nodes are missing
+ for ( size_t iQ = 0; iQ < quadVec.size(); ++iQ )
+ quadVec[ iQ ]->uv_grid.clear();
+ }
+ }
+ }
+
+ return true;
+}
+
+//================================================================================
+/*!
+ * \brief Splits a quad at I or J. Returns an index of a new side in the new quad
+ */
+//================================================================================
+
+int StdMeshers_Quadrangle_2D::splitQuad(FaceQuadStruct::Ptr quad, int I, int J)
+{
+ FaceQuadStruct* newQuad = new FaceQuadStruct( quad->face );
+ myQuadList.push_back( FaceQuadStruct::Ptr( newQuad ));
+
+ vector<UVPtStruct> points;
+ if ( I > 0 )
+ {
+ points.reserve( quad->jSize );
+ for ( int jP = 0; jP < quad->jSize; ++jP )
+ points.push_back( quad->UVPt( I, jP ));
+
+ newQuad->side.resize( 4 );
+ newQuad->side[ QUAD_BOTTOM_SIDE ] = quad->side[ QUAD_BOTTOM_SIDE ];
+ newQuad->side[ QUAD_RIGHT_SIDE ] = quad->side[ QUAD_RIGHT_SIDE ];
+ newQuad->side[ QUAD_TOP_SIDE ] = quad->side[ QUAD_TOP_SIDE ];
+ newQuad->side[ QUAD_LEFT_SIDE ] = StdMeshers_FaceSide::New( points, quad->face );
+
+ FaceQuadStruct::Side& newSide = newQuad->side[ QUAD_LEFT_SIDE ];
+ FaceQuadStruct::Side& newSide2 = quad->side [ QUAD_RIGHT_SIDE ];
+
+ quad->side[ QUAD_RIGHT_SIDE ] = newSide;
+
+ int iBot = quad->side[ QUAD_BOTTOM_SIDE ].ToSideIndex( I );
+ int iTop = quad->side[ QUAD_TOP_SIDE ].ToSideIndex( I );
+
+ newSide.AddContact ( 0, & quad->side[ QUAD_BOTTOM_SIDE ], iBot );
+ newSide2.AddContact( 0, & quad->side[ QUAD_BOTTOM_SIDE ], iBot );
+ newSide.AddContact ( quad->jSize - 1, & quad->side[ QUAD_TOP_SIDE ], iTop );
+ newSide2.AddContact( quad->jSize - 1, & quad->side[ QUAD_TOP_SIDE ], iTop );
+ // cout << "Contact: L " << &newSide << " "<< newSide.NbPoints()
+ // << " R " << &newSide2 << " "<< newSide2.NbPoints()
+ // << " B " << &quad->side[ QUAD_BOTTOM_SIDE ] << " "<< quad->side[ QUAD_BOTTOM_SIDE].NbPoints()
+ // << " T " << &quad->side[ QUAD_TOP_SIDE ] << " "<< quad->side[ QUAD_TOP_SIDE].NbPoints()<< endl;
+
+ newQuad->side[ QUAD_BOTTOM_SIDE ].from = iBot;
+ newQuad->side[ QUAD_TOP_SIDE ].from = iTop;
+ newQuad->name = ( TComm("Right of I=") << I );
+
+ quad->side[ QUAD_BOTTOM_SIDE ].to = iBot + 1;
+ quad->side[ QUAD_TOP_SIDE ].to = iTop + 1;
+ quad->uv_grid.clear();
+
+ return QUAD_LEFT_SIDE;
+ }
+ else if ( J > 0 ) //// split horizontally, a new quad is below an old one
+ {
+ points.reserve( quad->iSize );
+ for ( int iP = 0; iP < quad->iSize; ++iP )
+ points.push_back( quad->UVPt( iP, J ));
+
+ newQuad->side.resize( 4 );
+ newQuad->side[ QUAD_BOTTOM_SIDE ] = quad->side[ QUAD_BOTTOM_SIDE ];
+ newQuad->side[ QUAD_RIGHT_SIDE ] = quad->side[ QUAD_RIGHT_SIDE ];
+ newQuad->side[ QUAD_TOP_SIDE ] = StdMeshers_FaceSide::New( points, quad->face );
+ newQuad->side[ QUAD_LEFT_SIDE ] = quad->side[ QUAD_LEFT_SIDE ];
+
+ FaceQuadStruct::Side& newSide = newQuad->side[ QUAD_TOP_SIDE ];
+ FaceQuadStruct::Side& newSide2 = quad->side [ QUAD_BOTTOM_SIDE ];
+
+ quad->side[ QUAD_BOTTOM_SIDE ] = newSide;
+
+ int iLft = quad->side[ QUAD_LEFT_SIDE ].ToSideIndex( J );
+ int iRgt = quad->side[ QUAD_RIGHT_SIDE ].ToSideIndex( J );
+
+ newSide.AddContact ( 0, & quad->side[ QUAD_LEFT_SIDE ], iLft );
+ newSide2.AddContact( 0, & quad->side[ QUAD_LEFT_SIDE ], iLft );
+ newSide.AddContact ( quad->iSize - 1, & quad->side[ QUAD_RIGHT_SIDE ], iRgt );
+ newSide2.AddContact( quad->iSize - 1, & quad->side[ QUAD_RIGHT_SIDE ], iRgt );
+ // cout << "Contact: T " << &newSide << " "<< newSide.NbPoints()
+ // << " B " << &newSide2 << " "<< newSide2.NbPoints()
+ // << " L " << &quad->side[ QUAD_LEFT_SIDE ] << " "<< quad->side[ QUAD_LEFT_SIDE].NbPoints()
+ // << " R " << &quad->side[ QUAD_RIGHT_SIDE ] << " "<< quad->side[ QUAD_RIGHT_SIDE].NbPoints()<< endl;
+
+ newQuad->side[ QUAD_RIGHT_SIDE ].to = iRgt+1;
+ newQuad->side[ QUAD_LEFT_SIDE ].to = iLft+1;
+ newQuad->name = ( TComm("Below J=") << J );
+
+ quad->side[ QUAD_RIGHT_SIDE ].from = iRgt;
+ quad->side[ QUAD_LEFT_SIDE ].from = iLft;
+ quad->uv_grid.clear();
+
+ return QUAD_TOP_SIDE;
+ }
+
+ myQuadList.pop_back();
+ return -1;
+}
+
+//================================================================================
+/*!
+ * \brief Updates UV of a side after moving its node
+ */
+//================================================================================
+
+void StdMeshers_Quadrangle_2D::updateSideUV( FaceQuadStruct::Side& side,
+ int iForced,
+ const TQuadsBySide& quadsBySide,
+ int * iNext)
+{
+ if ( !iNext )
+ {
+ side.forced_nodes.insert( iForced );
+
+ // update parts of the side before and after iForced
+
+ set<int>::iterator iIt = side.forced_nodes.upper_bound( iForced );
+ int iEnd = Min( side.NbPoints()-1, ( iIt == side.forced_nodes.end() ) ? int(1e7) : *iIt );
+ if ( iForced + 1 < iEnd )
+ updateSideUV( side, iForced, quadsBySide, &iEnd );
+
+ iIt = side.forced_nodes.lower_bound( iForced );
+ int iBeg = Max( 0, ( iIt == side.forced_nodes.begin() ) ? 0 : *--iIt );
+ if ( iForced - 1 > iBeg )
+ updateSideUV( side, iForced, quadsBySide, &iBeg );
+
+ return;
+ }
+
+ const int iFrom = Min ( iForced, *iNext );
+ const int iTo = Max ( iForced, *iNext ) + 1;
+ const int sideSize = iTo - iFrom;
+
+ vector<UVPtStruct> points[4]; // side points of a temporary quad
+
+ // from the quads get grid points adjacent to the side
+ // to make two sides of a temporary quad
+ vector< FaceQuadStruct::Ptr > quads = quadsBySide.find( side )->second; // copy!
+ for ( int is2nd = 0; is2nd < 2; ++is2nd )
+ {
+ points[ is2nd ].reserve( sideSize );
+ int nbLoops = 0;
+ while ( points[is2nd].size() < sideSize )
+ {
+ int iCur = iFrom + points[is2nd].size() - int( !points[is2nd].empty() );
+
+ // look for a quad adjacent to iCur-th point of the side
+ for ( size_t iQ = 0; iQ < quads.size(); ++iQ )
+ {
+ FaceQuadStruct::Ptr q = quads[ iQ ];
+ if ( !q )
+ continue;
+ size_t iS;
+ for ( iS = 0; iS < q->side.size(); ++iS )
+ if ( side.grid == q->side[ iS ].grid )
+ break;
+ bool isOut;
+ if ( !q->side[ iS ].IsReversed() )
+ isOut = ( q->side[ iS ].from > iCur || q->side[ iS ].to-1 <= iCur );
+ else
+ isOut = ( q->side[ iS ].to >= iCur || q->side[ iS ].from <= iCur );
+ if ( isOut )
+ continue;
+ if ( !setNormalizedGrid( q ))
+ continue;
+
+ // found - copy points
+ int i,j,di,dj,nb;
+ if ( iS % 2 ) // right or left
+ {
+ i = ( iS == QUAD_LEFT_SIDE ) ? 1 : q->iSize-2;
+ j = q->side[ iS ].ToQuadIndex( iCur );
+ di = 0;
+ dj = ( q->side[ iS ].IsReversed() ) ? -1 : +1;
+ nb = ( q->side[ iS ].IsReversed() ) ? j+1 : q->jSize-j;
+ }
+ else // bottom or top
+ {
+ i = q->side[ iS ].ToQuadIndex( iCur );
+ j = ( iS == QUAD_BOTTOM_SIDE ) ? 1 : q->jSize-2;
+ di = ( q->side[ iS ].IsReversed() ) ? -1 : +1;
+ dj = 0;
+ nb = ( q->side[ iS ].IsReversed() ) ? i+1 : q->iSize-i;
+ }
+ if ( !points[is2nd].empty() )
+ {
+ gp_UV lastUV = points[is2nd].back().UV();
+ gp_UV quadUV = q->UVPt( i, j ).UV();
+ if ( ( lastUV - quadUV ).SquareModulus() > 1e-10 )
+ continue; // quad is on the other side of the side
+ i += di; j += dj; --nb;
+ }
+ for ( ; nb > 0 ; --nb )
+ {
+ points[ is2nd ].push_back( q->UVPt( i, j ));
+ if ( points[is2nd].size() >= sideSize )
+ break;
+ i += di; j += dj;
+ }
+ quads[ iQ ].reset(); // not to use this quad anymore
+
+ if ( points[is2nd].size() >= sideSize )
+ break;
+ } // loop on quads
+
+ if ( nbLoops++ > quads.size() )
+ throw SALOME_Exception( "StdMeshers_Quadrangle_2D::updateSideUV() bug: infinite loop" );
+
+ } // while ( points[is2nd].size() < sideSize )
+ } // two loops to fill points[0] and points[1]
+
+ // points for other pair of opposite sides of the temporary quad
+
+ enum { L,R,B,T }; // side index of points[]
+
+ points[B].push_back( points[L].front() );
+ points[B].push_back( side.GetUVPtStruct()[ iFrom ]);
+ points[B].push_back( points[R].front() );
+
+ points[T].push_back( points[L].back() );
+ points[T].push_back( side.GetUVPtStruct()[ iTo-1 ]);
+ points[T].push_back( points[R].back() );
+
+ // make the temporary quad
+ FaceQuadStruct::Ptr tmpQuad
+ ( new FaceQuadStruct( TopoDS::Face( myHelper->GetSubShape() ), "tmpQuad"));
+ tmpQuad->side.push_back( StdMeshers_FaceSide::New( points[B] )); // bottom
+ tmpQuad->side.push_back( StdMeshers_FaceSide::New( points[R] )); // right
+ tmpQuad->side.push_back( StdMeshers_FaceSide::New( points[T] ));
+ tmpQuad->side.push_back( StdMeshers_FaceSide::New( points[L] ));
+
+ // compute new UV of the side
+ setNormalizedGrid( tmpQuad );
+ gp_UV uv = tmpQuad->UVPt(1,0).UV();
+ tmpQuad->updateUV( uv, 1,0, /*isVertical=*/true );
+
+ // update UV of the side
+ vector<UVPtStruct>& sidePoints = (vector<UVPtStruct>&) side.GetUVPtStruct();
+ for ( int i = iFrom; i < iTo; ++i )
+ {
+ const uvPtStruct& uvPt = tmpQuad->UVPt( 1, i-iFrom );
+ sidePoints[ i ].u = uvPt.u;
+ sidePoints[ i ].v = uvPt.v;
+ }
+}
+
+//================================================================================
+/*!
+ * \brief Finds indices of a grid quad enclosing the given enforced UV
+ */
+//================================================================================
+
+bool FaceQuadStruct::findCell( const gp_XY& UV, int & I, int & J )
+{
+ // setNormalizedGrid() must be called before!
+ if ( uv_box.IsOut( UV ))
+ return false;
+
+ // find an approximate position
+ double x = 0.5, y = 0.5;
+ gp_XY t0 = UVPt( iSize - 1, 0 ).UV();
+ gp_XY t1 = UVPt( 0, jSize - 1 ).UV();
+ gp_XY t2 = UVPt( 0, 0 ).UV();
+ SMESH_MeshAlgos::GetBarycentricCoords( UV, t0, t1, t2, x, y );
+ x = Min( 1., Max( 0., x ));
+ y = Min( 1., Max( 0., y ));
+
+ // precise the position
+ normPa2IJ( x,y, I,J );
+ if ( !isNear( UV, I,J ))
+ {
+ // look for the most close IJ by traversing uv_grid in the middle
+ double dist2, minDist2 = ( UV - UVPt( I,J ).UV() ).SquareModulus();
+ for ( int isU = 0; isU < 2; ++isU )
+ {
+ int ind1 = isU ? 0 : iSize / 2;
+ int ind2 = isU ? jSize / 2 : 0;
+ int di1 = isU ? Max( 2, iSize / 20 ) : 0;
+ int di2 = isU ? 0 : Max( 2, jSize / 20 );
+ int i,nb = isU ? iSize / di1 : jSize / di2;
+ for ( i = 0; i < nb; ++i, ind1 += di1, ind2 += di2 )
+ if (( dist2 = ( UV - UVPt( ind1,ind2 ).UV() ).SquareModulus() ) < minDist2 )
+ {
+ I = ind1;
+ J = ind2;
+ if ( isNear( UV, I,J ))
+ return true;
+ minDist2 = ( UV - UVPt( I,J ).UV() ).SquareModulus();
+ }
+ }
+ if ( !isNear( UV, I,J, Max( iSize, jSize ) /2 ))
+ return false;
+ }
+ return true;
+}
+
+//================================================================================
+/*!
+ * \brief Find indices (i,j) of a point in uv_grid by normalized parameters (x,y)
+ */
+//================================================================================
+
+void FaceQuadStruct::normPa2IJ(double X, double Y, int & I, int & J )
+{
+
+ I = Min( int ( iSize * X ), iSize - 2 );
+ J = Min( int ( jSize * Y ), jSize - 2 );
+
+ int oldI, oldJ;
+ do
+ {
+ oldI = I, oldJ = J;
+ while ( X <= UVPt( I,J ).x && I != 0 )
+ --I;
+ while ( X > UVPt( I+1,J ).x && I+2 < iSize )
+ ++I;
+ while ( Y <= UVPt( I,J ).y && J != 0 )
+ --J;
+ while ( Y > UVPt( I,J+1 ).y && J+2 < jSize )
+ ++J;
+ } while ( oldI != I || oldJ != J );
+}
+
+//================================================================================
+/*!
+ * \brief Looks for UV in quads around a given (I,J) and precise (I,J)
+ */
+//================================================================================
+
+bool FaceQuadStruct::isNear( const gp_XY& UV, int & I, int & J, int nbLoops )
+{
+ if ( I+1 >= iSize ) I = iSize - 2;
+ if ( J+1 >= jSize ) J = jSize - 2;
+
+ double bcI, bcJ;
+ gp_XY uvI, uvJ, uv0, uv1;
+ for ( int iLoop = 0; iLoop < nbLoops; ++iLoop )
+ {
+ int oldI = I, oldJ = J;
+
+ uvI = UVPt( I+1, J ).UV();
+ uvJ = UVPt( I, J+1 ).UV();
+ uv0 = UVPt( I, J ).UV();
+ SMESH_MeshAlgos::GetBarycentricCoords( UV, uvI, uvJ, uv0, bcI, bcJ );
+ if ( bcI >= 0. && bcJ >= 0. && bcI + bcJ <= 1.)
+ return true;
+
+ if ( I > 0 && bcI < 0. ) --I;
+ if ( I+2 < iSize && bcI > 1. ) ++I;
+ if ( J > 0 && bcJ < 0. ) --J;
+ if ( J+2 < jSize && bcJ > 1. ) ++J;
+
+ uv1 = UVPt( I+1,J+1).UV();
+ if ( I != oldI || J != oldJ )
+ {
+ uvI = UVPt( I+1, J ).UV();
+ uvJ = UVPt( I, J+1 ).UV();
+ }
+ SMESH_MeshAlgos::GetBarycentricCoords( UV, uvI, uvJ, uv1, bcI, bcJ );
+ if ( bcI >= 0. && bcJ >= 0. && bcI + bcJ <= 1.)
+ return true;
+
+ if ( I > 0 && bcI > 1. ) --I;
+ if ( I+2 < iSize && bcI < 0. ) ++I;
+ if ( J > 0 && bcJ > 1. ) --J;
+ if ( J+2 < jSize && bcJ < 0. ) ++J;
+
+ if ( I == oldI && J == oldJ )
+ return false;
+
+ if ( iLoop+1 == nbLoops )
+ {
+ uvI = UVPt( I+1, J ).UV();
+ uvJ = UVPt( I, J+1 ).UV();
+ uv0 = UVPt( I, J ).UV();
+ SMESH_MeshAlgos::GetBarycentricCoords( UV, uvI, uvJ, uv0, bcI, bcJ );
+ if ( bcI >= 0. && bcJ >= 0. && bcI + bcJ <= 1.)
+ return true;
+
+ uv1 = UVPt( I+1,J+1).UV();
+ SMESH_MeshAlgos::GetBarycentricCoords( UV, uvI, uvJ, uv1, bcI, bcJ );
+ if ( bcI >= 0. && bcJ >= 0. && bcI + bcJ <= 1.)
+ return true;
+ }
+ }
+ return false;
+}
+
+//================================================================================
+/*!
+ * \brief Checks if a given UV is equal to a given grid point
+ */
+//================================================================================
+
+bool FaceQuadStruct::isEqual( const gp_XY& UV, int I, int J )
+{
+ TopLoc_Location loc;
+ Handle(Geom_Surface) surf = BRep_Tool::Surface( face, loc );
+ gp_Pnt p1 = surf->Value( UV.X(), UV.Y() );
+ gp_Pnt p2 = surf->Value( UVPt( I,J ).u, UVPt( I,J ).v );
+
+ double dist2 = 1e100;
+ for ( int di = -1; di < 2; di += 2 )
+ {
+ int i = I + di;
+ if ( i < 0 || i+1 >= iSize ) continue;
+ for ( int dj = -1; dj < 2; dj += 2 )
+ {
+ int j = J + dj;
+ if ( j < 0 || j+1 >= jSize ) continue;
+
+ dist2 = Min( dist2,
+ p2.SquareDistance( surf->Value( UVPt( i,j ).u, UVPt( i,j ).v )));
+ }
+ }
+ double tol2 = dist2 / 1000.;
+ return p1.SquareDistance( p2 ) < tol2;
+}
+
+//================================================================================
+/*!
+ * \brief Recompute UV of grid points around a moved point in one direction
+ */
+//================================================================================
+
+void FaceQuadStruct::updateUV( const gp_XY& UV, int I, int J, bool isVertical )
+{
+ UVPt( I, J ).u = UV.X();
+ UVPt( I, J ).v = UV.Y();
+
+ if ( isVertical )
+ {
+ // above J
+ if ( J+1 < jSize-1 )
+ {
+ gp_UV a0 = UVPt( 0, J ).UV();
+ gp_UV a1 = UVPt( iSize-1, J ).UV();
+ gp_UV a2 = UVPt( iSize-1, jSize-1 ).UV();
+ gp_UV a3 = UVPt( 0, jSize-1 ).UV();
+
+ gp_UV p0 = UVPt( I, J ).UV();
+ gp_UV p2 = UVPt( I, jSize-1 ).UV();
+ const double y0 = UVPt( I, J ).y, dy = 1. - y0;
+ for (int j = J+1; j < jSize-1; j++)
+ {
+ gp_UV p1 = UVPt( iSize-1, j ).UV();
+ gp_UV p3 = UVPt( 0, j ).UV();
+
+ UVPtStruct& uvPt = UVPt( I, j );
+ gp_UV uv = calcUV( uvPt.x, ( uvPt.y - y0 ) / dy, a0,a1,a2,a3, p0,p1,p2,p3);
+ uvPt.u = uv.X();
+ uvPt.v = uv.Y();
+ }
+ }
+ // under J
+ if ( J-1 > 0 )
+ {
+ gp_UV a0 = UVPt( 0, 0 ).UV();
+ gp_UV a1 = UVPt( iSize-1, 0 ).UV();
+ gp_UV a2 = UVPt( iSize-1, J ).UV();
+ gp_UV a3 = UVPt( 0, J ).UV();
+
+ gp_UV p0 = UVPt( I, 0 ).UV();
+ gp_UV p2 = UVPt( I, J ).UV();
+ const double y0 = 0., dy = UVPt( I, J ).y - y0;
+ for (int j = 1; j < J; j++)
+ {
+ gp_UV p1 = UVPt( iSize-1, j ).UV();
+ gp_UV p3 = UVPt( 0, j ).UV();
+
+ UVPtStruct& uvPt = UVPt( I, j );
+ gp_UV uv = calcUV( uvPt.x, ( uvPt.y - y0 ) / dy, a0,a1,a2,a3, p0,p1,p2,p3);
+ uvPt.u = uv.X();
+ uvPt.v = uv.Y();
+ }
+ }
+ }
+ else // horizontally
+ {
+ // before I
+ if ( I-1 > 0 )
+ {
+ gp_UV a0 = UVPt( 0, 0 ).UV();
+ gp_UV a1 = UVPt( I, 0 ).UV();
+ gp_UV a2 = UVPt( I, jSize-1 ).UV();
+ gp_UV a3 = UVPt( 0, jSize-1 ).UV();
+
+ gp_UV p1 = UVPt( I, J ).UV();
+ gp_UV p3 = UVPt( 0, J ).UV();
+ const double x0 = 0., dx = UVPt( I, J ).x - x0;
+ for (int i = 1; i < I; i++)
+ {
+ gp_UV p0 = UVPt( i, 0 ).UV();
+ gp_UV p2 = UVPt( i, jSize-1 ).UV();
+
+ UVPtStruct& uvPt = UVPt( i, J );
+ gp_UV uv = calcUV(( uvPt.x - x0 ) / dx , uvPt.y, a0,a1,a2,a3, p0,p1,p2,p3);
+ uvPt.u = uv.X();
+ uvPt.v = uv.Y();
+ }
+ }
+ // after I
+ if ( I+1 < iSize-1 )
+ {
+ gp_UV a0 = UVPt( I, 0 ).UV();
+ gp_UV a1 = UVPt( iSize-1, 0 ).UV();
+ gp_UV a2 = UVPt( iSize-1, jSize-1 ).UV();
+ gp_UV a3 = UVPt( I, jSize-1 ).UV();
+
+ gp_UV p1 = UVPt( iSize-1, J ).UV();
+ gp_UV p3 = UVPt( I, J ).UV();
+ const double x0 = UVPt( I, J ).x, dx = 1. - x0;
+ for (int i = I+1; i < iSize-1; i++)
+ {
+ gp_UV p0 = UVPt( i, 0 ).UV();
+ gp_UV p2 = UVPt( i, jSize-1 ).UV();
+
+ UVPtStruct& uvPt = UVPt( i, J );
+ gp_UV uv = calcUV(( uvPt.x - x0 ) / dx , uvPt.y, a0,a1,a2,a3, p0,p1,p2,p3);
+ uvPt.u = uv.X();
+ uvPt.v = uv.Y();
+ }
+ }
+ }
+}
+
+//================================================================================
+/*!
+ * \brief Side copying
+ */
+//================================================================================
+
+FaceQuadStruct::Side& FaceQuadStruct::Side::operator=(const Side& otherSide)
+{
+ grid = otherSide.grid;
+ from = otherSide.from;
+ to = otherSide.to;
+ di = otherSide.di;
+ forced_nodes = otherSide.forced_nodes;
+ contacts = otherSide.contacts;
+ nbNodeOut = otherSide.nbNodeOut;
+
+ for ( size_t iC = 0; iC < contacts.size(); ++iC )
+ {
+ FaceQuadStruct::Side* oSide = contacts[iC].other_side;
+ for ( size_t iOC = 0; iOC < oSide->contacts.size(); ++iOC )
+ if ( oSide->contacts[iOC].other_side == & otherSide )
+ {
+ // cout << "SHIFT old " << &otherSide << " " << otherSide.NbPoints()
+ // << " -> new " << this << " " << this->NbPoints() << endl;
+ oSide->contacts[iOC].other_side = this;
+ }
+ }
+ return *this;
+}
+
+//================================================================================
+/*!
+ * \brief Converts node index of a quad to node index of this side
+ */
+//================================================================================
+
+int FaceQuadStruct::Side::ToSideIndex( int quadNodeIndex ) const
+{
+ return from + di * quadNodeIndex;
+}
+
+//================================================================================
+/*!
+ * \brief Converts node index of this side to node index of a quad
+ */
+//================================================================================
+
+int FaceQuadStruct::Side::ToQuadIndex( int sideNodeIndex ) const
+{
+ return ( sideNodeIndex - from ) * di;
+}
+
+//================================================================================
+/*!
+ * \brief Reverse the side
+ */
+//================================================================================
+
+bool FaceQuadStruct::Side::Reverse(bool keepGrid)
+{
+ if ( grid )
+ {
+ if ( keepGrid )
+ {
+ from -= di;
+ to -= di;
+ std::swap( from, to );
+ di *= -1;
+ }
+ else
+ {
+ grid->Reverse();
+ }
+ }
+ return (bool)grid;
+}
+
+//================================================================================
+/*!
+ * \brief Checks if a node is enforced
+ * \param [in] nodeIndex - an index of a node in a size
+ * \return bool - \c true if the node is forced
+ */
+//================================================================================
+
+bool FaceQuadStruct::Side::IsForced( int nodeIndex ) const
+{
+ if ( nodeIndex < 0 || nodeIndex >= grid->NbPoints() )
+ throw SALOME_Exception( " FaceQuadStruct::Side::IsForced(): wrong index" );
+
+ if ( forced_nodes.count( nodeIndex ) )
+ return true;
+
+ for ( size_t i = 0; i < this->contacts.size(); ++i )
+ if ( contacts[ i ].point == nodeIndex &&
+ contacts[ i ].other_side->forced_nodes.count( contacts[ i ].other_point ))
+ return true;
+
+ return false;
+}
+
+//================================================================================
+/*!
+ * \brief Sets up a contact between this and another side
+ */
+//================================================================================
+
+void FaceQuadStruct::Side::AddContact( int ip, Side* side, int iop )
+{
+ if ( ip >= GetUVPtStruct().size() ||
+ iop >= side->GetUVPtStruct().size() )
+ throw SALOME_Exception( "FaceQuadStruct::Side::AddContact(): wrong point" );
+ {
+ contacts.resize( contacts.size() + 1 );
+ Contact& c = contacts.back();
+ c.point = ip;
+ c.other_side = side;
+ c.other_point = iop;
+ }
+ {
+ side->contacts.resize( side->contacts.size() + 1 );
+ Contact& c = side->contacts.back();
+ c.point = iop;
+ c.other_side = this;
+ c.other_point = ip;
+ }
+}
+
+//================================================================================
+/*!
+ * \brief Returns a normalized parameter of a point indexed within a quadrangle
+ */
+//================================================================================
+
+double FaceQuadStruct::Side::Param( int i ) const
+{
+ const vector<UVPtStruct>& points = GetUVPtStruct();
+ return (( points[ from + i * di ].normParam - points[ from ].normParam ) /
+ ( points[ to - 1 * di ].normParam - points[ from ].normParam ));
+}
+
+//================================================================================
+/*!
+ * \brief Returns UV by a parameter normalized within a quadrangle
+ */
+//================================================================================
+
+gp_XY FaceQuadStruct::Side::Value2d( double x ) const
+{
+ const vector<UVPtStruct>& points = GetUVPtStruct();
+ double u = ( points[ from ].normParam +
+ x * ( points[ to-di ].normParam - points[ from ].normParam ));
+ return grid->Value2d( u ).XY();
+}
+
+//================================================================================
+/*!
+ * \brief Returns side length
+ */
+//================================================================================
+
+double FaceQuadStruct::Side::Length(int theFrom, int theTo) const
+{
+ if ( IsReversed() != ( theTo < theFrom ))
+ std::swap( theTo, theFrom );
+
+ const vector<UVPtStruct>& points = GetUVPtStruct();
+ double r;
+ if ( theFrom == theTo && theTo == -1 )
+ r = Abs( First().normParam -
+ Last ().normParam );
+ else if ( IsReversed() )
+ r = Abs( points[ Max( to, theTo+1 ) ].normParam -
+ points[ Min( from, theFrom ) ].normParam );
+ else
+ r = Abs( points[ Min( to, theTo-1 ) ].normParam -
+ points[ Max( from, theFrom ) ].normParam );
+ return r * grid->Length();
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESH_Algo.hxx"
#include "SMESH_ProxyMesh.hxx"
#include "SMESH_StdMeshers.hxx"
+#include "StdMeshers_FaceSide.hxx"
#include "StdMeshers_QuadrangleParams.hxx"
#include <TopoDS_Face.hxx>
+#include <Bnd_B2d.hxx>
class SMDS_MeshNode;
class SMESH_Mesh;
class SMESH_MesherHelper;
class SMESH_ProxyMesh;
-class StdMeshers_FaceSide;
struct uvPtStruct;
enum TSideID { QUAD_BOTTOM_SIDE=0, QUAD_RIGHT_SIDE, QUAD_TOP_SIDE, QUAD_LEFT_SIDE, NB_QUAD_SIDES };
typedef uvPtStruct UVPtStruct;
-typedef struct faceQuadStruct
+struct FaceQuadStruct
{
- std::vector< StdMeshers_FaceSide*> side;
- bool isEdgeOut[4]; // true, if an EDGE has more nodes, than an opposite one
- UVPtStruct* uv_grid;
- TopoDS_Face face;
- ~faceQuadStruct();
- void shift( size_t nb, bool keepUnitOri );
- typedef boost::shared_ptr<faceQuadStruct> Ptr;
-} FaceQuadStruct;
+ struct Side // a side of FaceQuadStruct
+ {
+ struct Contact // contact of two sides
+ {
+ int point; // index of a grid point of this side where two sides meat
+ Side* other_side;
+ int other_point;
+ };
+ StdMeshers_FaceSidePtr grid;
+ int from, to; // indices of grid points used by the quad
+ int di; // +1 or -1 depending on IsReversed()
+ std::set<int> forced_nodes; // indices of forced grid points
+ std::vector<Contact> contacts; // contacts with sides of other quads
+ int nbNodeOut; // nb of missing nodes on an opposite shorter side
+
+ Side(StdMeshers_FaceSidePtr theGrid = StdMeshers_FaceSidePtr());
+ Side& operator=(const Side& otherSide);
+ operator StdMeshers_FaceSidePtr() { return grid; }
+ operator const StdMeshers_FaceSidePtr() const { return grid; }
+ void AddContact( int ip, Side* side, int iop );
+ int ToSideIndex( int quadNodeIndex ) const;
+ int ToQuadIndex( int sideNodeIndex ) const;
+ bool IsForced( int nodeIndex ) const;
+ bool IsReversed() const { return nbNodeOut ? false : to < from; }
+ bool Reverse(bool keepGrid);
+ int NbPoints() const { return Abs( to - from ); }
+ double Param( int nodeIndex ) const;
+ double Length( int from=-1, int to=-1) const;
+ gp_XY Value2d( double x ) const;
+ const UVPtStruct& First() const { return GetUVPtStruct()[ from ]; }
+ const UVPtStruct& Last() const {
+ return GetUVPtStruct()[ to-nbNodeOut-(IsReversed() ? -1 : +1)];
+ }
+ // some sortcuts
+ const vector<UVPtStruct>& GetUVPtStruct(bool isXConst=0, double constValue=0) const
+ { return nbNodeOut ?
+ grid->SimulateUVPtStruct( NbPoints()-nbNodeOut-1, isXConst, constValue ) :
+ grid->GetUVPtStruct( isXConst, constValue );
+ }
+ };
+ struct SideIterator // iterator on UVPtStruct of a Side
+ {
+ const UVPtStruct *uvPtr, *uvEnd;
+ int dPtr, counter;
+ SideIterator(): uvPtr(0), uvEnd(0), dPtr(0), counter(0) {}
+ void Init( const Side& side ) {
+ dPtr = counter = 0;
+ uvPtr = uvEnd = 0;
+ if ( side.NbPoints() > 0 ) {
+ uvPtr = & side.First();
+ uvEnd = & side.Last();
+ dPtr = ( uvEnd > uvPtr ) ? +1 : -1;
+ uvEnd += dPtr;
+ }
+ }
+ bool More() const { return uvPtr != uvEnd; }
+ void Next() { uvPtr += dPtr; ++counter; }
+ UVPtStruct& UVPt() const { return (UVPtStruct&) *uvPtr; }
+ UVPtStruct& operator[](int i) { return (UVPtStruct&) uvPtr[ i*dPtr]; }
+ int Count() const { return counter; }
+ };
+
+ std::vector< Side > side;
+ std::vector< UVPtStruct> uv_grid;
+ int iSize, jSize;
+ TopoDS_Face face;
+ Bnd_B2d uv_box;
+ std::string name; // to ease debugging
+
+ FaceQuadStruct ( const TopoDS_Face& F = TopoDS_Face(), const std::string& nm="main" );
+ UVPtStruct& UVPt( int i, int j ) { return uv_grid[ i + j * iSize ]; }
+ void shift ( size_t nb, bool keepUnitOri, bool keepGrid=false );
+ int & nbNodeOut( int iSide ) { return side[ iSide ].nbNodeOut; }
+ bool findCell ( const gp_XY& uv, int & i, int & j );
+ bool isNear ( const gp_XY& uv, int & i, int & j, int nbLoops=1 );
+ bool isEqual ( const gp_XY& uv, int i, int j );
+ void normPa2IJ( double x, double y, int & i, int & j );
+ void updateUV ( const gp_XY& uv, int i, int j, bool isVertical );
+
+ typedef boost::shared_ptr<FaceQuadStruct> Ptr;
+};
class STDMESHERS_EXPORT StdMeshers_Quadrangle_2D: public SMESH_2D_Algo
{
-public:
+ public:
StdMeshers_Quadrangle_2D(int hypId, int studyId, SMESH_Gen* gen);
virtual ~StdMeshers_Quadrangle_2D();
const TopoDS_Shape& aShape,
const bool considerMesh=false);
-protected:
+ static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
+
+ protected:
bool checkNbEdgesForEvaluate(SMESH_Mesh& aMesh,
const TopoDS_Shape & aShape,
std::vector<int>& aNbNodes,
bool& IsQuadratic);
- bool setNormalizedGrid(SMESH_Mesh& aMesh,
- const TopoDS_Face& aFace,
- FaceQuadStruct::Ptr& quad);
-
- void splitQuad(SMESHDS_Mesh *theMeshDS,
- const int theFaceID,
- const SMDS_MeshNode* theNode1,
- const SMDS_MeshNode* theNode2,
- const SMDS_MeshNode* theNode3,
- const SMDS_MeshNode* theNode4);
+ bool setNormalizedGrid(FaceQuadStruct::Ptr quad);
+
+ void splitQuadFace(SMESHDS_Mesh * theMeshDS,
+ const int theFaceID,
+ const SMDS_MeshNode* theNode1,
+ const SMDS_MeshNode* theNode2,
+ const SMDS_MeshNode* theNode3,
+ const SMDS_MeshNode* theNode4);
+
+ bool computeQuadDominant(SMESH_Mesh& aMesh,
+ const TopoDS_Face& aFace);
bool computeQuadDominant(SMESH_Mesh& aMesh,
const TopoDS_Face& aFace,
const TopoDS_Face& aFace,
FaceQuadStruct::Ptr quad);
+ bool computeTriangles(SMESH_Mesh& aMesh,
+ const TopoDS_Face& aFace,
+ FaceQuadStruct::Ptr quad);
+
bool evaluateQuadPref(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
std::vector<int>& aNbNodes,
void smooth (FaceQuadStruct::Ptr quad);
+ bool check();
+
int getCorners(const TopoDS_Face& theFace,
SMESH_Mesh & theMesh,
std::list<TopoDS_Edge>& theWire,
int & theNbDegenEdges,
const bool considerMesh);
+ bool getEnforcedUV();
+
+ bool addEnforcedNodes();
+
+ int splitQuad(FaceQuadStruct::Ptr quad, int i, int j);
+
+ void shiftQuad(FaceQuadStruct::Ptr& quad, const int num );
+
+ typedef std::map< StdMeshers_FaceSidePtr, std::vector< FaceQuadStruct::Ptr > > TQuadsBySide;
+ void updateSideUV( FaceQuadStruct::Side& side,
+ int iForced,
+ const TQuadsBySide& quads,
+ int * iNext=NULL);
+
+
+ protected: // Fields
- // true if QuadranglePreference hypothesis is assigned that forces
- // 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;
bool myTrianglePreference;
int myTriaVertexID;
- bool myNeedSmooth;
+ bool myNeedSmooth, myCheckOri;
+ const StdMeshers_QuadrangleParams* myParams;
+ StdMeshers_QuadType myQuadType;
+
+ SMESH_MesherHelper* myHelper;
+ SMESH_ProxyMesh::Ptr myProxyMesh;
+ std::list< FaceQuadStruct::Ptr > myQuadList;
+
+ struct ForcedPoint
+ {
+ gp_XY uv;
+ gp_XYZ xyz;
+ TopoDS_Vertex vertex;
- StdMeshers_QuadType myQuadType;
- SMESH_MesherHelper* myHelper; // tool for working with quadratic elements
- SMESH_ProxyMesh::Ptr myProxyMesh;
- FaceQuadStruct::Ptr myQuadStruct;
+ double U() const { return uv.X(); }
+ double V() const { return uv.Y(); }
+ operator const gp_XY& () { return uv; }
+ };
+ std::vector< ForcedPoint > myForcedPnts;
};
#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
return true;
}
+
+//================================================================================
+/*!
+ * \brief Return true if the algorithm can mesh this shape
+ * \param [in] aShape - shape to check
+ * \param [in] toCheckAll - if true, this check returns OK if all shapes are OK,
+ * else, returns OK if at least one shape is OK
+ */
+//================================================================================
+
+bool StdMeshers_RadialPrism_3D::IsApplicable( const TopoDS_Shape & aShape, bool toCheckAll )
+{
+ bool isCurShellApp;
+ int nbFoundSolids = 0;
+ for (TopExp_Explorer exp( aShape, TopAbs_SOLID ); exp.More(); exp.Next(), ++nbFoundSolids )
+ {
+ TopoDS_Shape shell[2];
+ int nbShells = 0;
+ for ( TopoDS_Iterator It (exp.Current()); It.More(); It.Next() )
+ {
+ nbShells++;
+ if ( nbShells > 2 ) {
+ if ( toCheckAll ) return false;
+ break;
+ }
+ shell[ nbShells-1 ] = It.Value();
+ }
+ if ( nbShells != 2 ) {
+ if ( toCheckAll ) return false;
+ continue;
+ }
+
+ int nbFaces1 = SMESH_MesherHelper:: Count( shell[0], TopAbs_FACE, 0 );
+ int nbFaces2 = SMESH_MesherHelper:: Count( shell[1], TopAbs_FACE, 0 );
+ if ( nbFaces1 != nbFaces2 ){
+ if( toCheckAll ) return false;
+ continue;
+ }
+ int nbEdges1 = SMESH_MesherHelper:: Count( shell[0], TopAbs_EDGE, 0 );
+ int nbEdges2 = SMESH_MesherHelper:: Count( shell[1], TopAbs_EDGE, 0 );
+ if ( nbEdges1 != nbEdges2 ){
+ if( toCheckAll ) return false;
+ continue;
+ }
+ int nbVertices1 = SMESH_MesherHelper:: Count( shell[0], TopAbs_VERTEX, 0 );
+ int nbVertices2 = SMESH_MesherHelper:: Count( shell[1], TopAbs_VERTEX, 0 );
+ if ( nbVertices1 != nbVertices2 ){
+ if( toCheckAll ) return false;
+ continue;
+ }
+ if ( !toCheckAll ) return true;
+ }
+ return ( toCheckAll && nbFoundSolids != 0);
+};
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
+ static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
+
protected:
typedef std::vector<const SMDS_MeshNode* > TNodeColumn;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
return false;
}
+
+//================================================================================
+/*!
+ * \brief Return true if applied compute mesh on this shape
+ */
+//================================================================================
+
+bool StdMeshers_RadialQuadrangle_1D2D::IsApplicable( const TopoDS_Shape & aShape, bool toCheckAll )
+{
+ int nbFoundFaces = 0;
+ for (TopExp_Explorer exp( aShape, TopAbs_FACE ); exp.More(); exp.Next(), ++nbFoundFaces ){
+ TopoDS_Edge CircEdge, LinEdge1, LinEdge2;
+ int nbe = analyseFace( exp.Current(), CircEdge, LinEdge1, LinEdge2 );
+ Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast( getCurve( CircEdge ));
+ bool ok = ( nbe <= 3 && nbe >= 1 && !aCirc.IsNull() );
+ if( toCheckAll && !ok ) return false;
+ if( !toCheckAll && ok ) return true;
+ }
+ if( toCheckAll && nbFoundFaces != 0 ) return true;
+ return false;
+};
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
*/
virtual void SubmeshRestored(SMESH_subMesh* subMesh);
+ static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
+
protected:
bool computeLayerPositions(const gp_Pnt& p1,
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESH_subMeshEventListener.hxx"
#include "StdMeshers_Adaptive1D.hxx"
#include "StdMeshers_Arithmetic1D.hxx"
+#include "StdMeshers_Geometric1D.hxx"
#include "StdMeshers_AutomaticLength.hxx"
#include "StdMeshers_Deflection1D.hxx"
#include "StdMeshers_Distribution.hxx"
_compatibleHypothesis.push_back("StartEndLength");
_compatibleHypothesis.push_back("Deflection1D");
_compatibleHypothesis.push_back("Arithmetic1D");
+ _compatibleHypothesis.push_back("GeometricProgression");
_compatibleHypothesis.push_back("FixedPoints1D");
_compatibleHypothesis.push_back("AutomaticLength");
_compatibleHypothesis.push_back("Adaptive1D");
-
- _compatibleHypothesis.push_back("QuadraticMesh"); // auxiliary !!!
- _compatibleHypothesis.push_back("Propagation"); // auxiliary !!!
+ // auxiliary:
+ _compatibleHypothesis.push_back("QuadraticMesh");
+ _compatibleHypothesis.push_back("Propagation");
+ _compatibleHypothesis.push_back("PropagOfDistribution");
}
//=============================================================================
aStatus = SMESH_Hypothesis::HYP_OK;
}
+ else if (hypName == "GeometricProgression")
+ {
+ const StdMeshers_Geometric1D * hyp =
+ dynamic_cast <const StdMeshers_Geometric1D * >(theHyp);
+ ASSERT(hyp);
+ _value[ BEG_LENGTH_IND ] = hyp->GetStartLength();
+ _value[ END_LENGTH_IND ] = hyp->GetCommonRatio();
+ ASSERT( _value[ BEG_LENGTH_IND ] > 0 && _value[ END_LENGTH_IND ] > 0 );
+ _hypType = GEOMETRIC_1D;
+
+ _revEdgesIDs = hyp->GetReversedEdges();
+
+ aStatus = SMESH_Hypothesis::HYP_OK;
+ }
+
else if (hypName == "FixedPoints1D") {
_fpHyp = dynamic_cast <const StdMeshers_FixedPoints1D*>(theHyp);
ASSERT(_fpHyp);
double f = theFirstU, l = theLastU;
+ // Propagation Of Distribution
+ //
+ if ( !_mainEdge.IsNull() && _isPropagOfDistribution )
+ {
+ TopoDS_Edge mainEdge = TopoDS::Edge( _mainEdge ); // should not be a reference!
+ _gen->Compute( theMesh, mainEdge, /*aShapeOnly=*/true, /*anUpward=*/true);
+
+ SMESHDS_SubMesh* smDS = theMesh.GetMeshDS()->MeshElements( mainEdge );
+ if ( !smDS )
+ return error("No mesh on the source edge of Propagation Of Distribution");
+ if ( smDS->NbNodes() < 1 )
+ return true; // 1 segment
+
+ vector< double > mainEdgeParams;
+ if ( ! SMESH_Algo::GetNodeParamOnEdge( theMesh.GetMeshDS(), mainEdge, mainEdgeParams ))
+ return error("Bad node parameters on the source edge of Propagation Of Distribution");
+
+ vector< double > segLen( mainEdgeParams.size() - 1 );
+ double totalLen = 0;
+ BRepAdaptor_Curve mainEdgeCurve( mainEdge );
+ for ( size_t i = 1; i < mainEdgeParams.size(); ++i )
+ {
+ segLen[ i-1 ] = GCPnts_AbscissaPoint::Length( mainEdgeCurve,
+ mainEdgeParams[i-1],
+ mainEdgeParams[i]);
+ totalLen += segLen[ i-1 ];
+ }
+ for ( size_t i = 0; i < segLen.size(); ++i )
+ segLen[ i ] *= theLength / totalLen;
+
+ size_t iSeg = theReverse ? segLen.size()-1 : 0;
+ size_t dSeg = theReverse ? -1 : +1;
+ double param = theFirstU;
+ int nbParams = 0;
+ for ( int i = 0, nb = segLen.size()-1; i < nb; ++i, iSeg += dSeg )
+ {
+ GCPnts_AbscissaPoint Discret( theC3d, segLen[ iSeg ], param );
+ if ( !Discret.IsDone() ) break;
+ param = Discret.Parameter();
+ theParams.push_back( param );
+ ++nbParams;
+ }
+ if ( nbParams != segLen.size()-1 )
+ return error( SMESH_Comment("Can't divide into ") << segLen.size() << " segements");
+
+ compensateError( segLen[ theReverse ? segLen.size()-1 : 0 ],
+ segLen[ theReverse ? 0 : segLen.size()-1 ],
+ f, l, theLength, theC3d, theParams, true );
+ return true;
+ }
+
+
switch( _hypType )
{
case LOCAL_LENGTH:
return true;
}
+ case GEOMETRIC_1D: {
+
+ double a1 = _value[ BEG_LENGTH_IND ], an;
+ double q = _value[ END_LENGTH_IND ];
+
+ double U1 = theReverse ? l : f;
+ double Un = theReverse ? f : l;
+ double param = U1;
+ double eltSize = a1;
+ if ( theReverse )
+ eltSize = -eltSize;
+
+ int nbParams = 0;
+ while ( true ) {
+ // computes a point on a curve <theC3d> at the distance <eltSize>
+ // from the point of parameter <param>.
+ GCPnts_AbscissaPoint Discret( theC3d, eltSize, param );
+ if ( !Discret.IsDone() ) break;
+ param = Discret.Parameter();
+ if ( f < param && param < l )
+ theParams.push_back( param );
+ else
+ break;
+ an = eltSize;
+ eltSize *= q;
+ ++nbParams;
+ }
+ if ( nbParams > 1 )
+ {
+ if ( Abs( param - Un ) < 0.2 * Abs( param - theParams.back() ))
+ {
+ compensateError( a1, eltSize, U1, Un, theLength, theC3d, theParams );
+ }
+ else if ( Abs( Un - theParams.back() ) <
+ 0.2 * Abs( theParams.back() - *(--theParams.rbegin())))
+ {
+ theParams.pop_back();
+ compensateError( a1, an, U1, Un, theLength, theC3d, theParams );
+ }
+ }
+ if (theReverse) theParams.reverse(); // NPAL18025
+
+ return true;
+ }
+
case FIXED_POINTS_1D: {
const std::vector<double>& aPnts = _fpHyp->GetPoints();
- const std::vector<int>& nbsegs = _fpHyp->GetNbSegments();
+ const std::vector<int>& nbsegs = _fpHyp->GetNbSegments();
int i = 0;
TColStd_SequenceOfReal Params;
for(; i<aPnts.size(); i++) {
if (nbHyp == 0 && aShape.ShapeType() == TopAbs_EDGE)
{
// Check, if propagated from some other edge
- _mainEdge = StdMeshers_Propagation::GetPropagationSource( aMesh, aShape );
+ _mainEdge = StdMeshers_Propagation::GetPropagationSource( aMesh, aShape,
+ _isPropagOfDistribution );
if ( !_mainEdge.IsNull() )
{
// Propagation of 1D hypothesis from <aMainEdge> on this edge;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
StdMeshers_SegmentLengthAroundVertex* getVertexHyp(SMESH_Mesh & theMesh,
const TopoDS_Vertex & theV);
- enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, FIXED_POINTS_1D, ADAPTIVE, NONE };
+ enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, FIXED_POINTS_1D, ADAPTIVE, GEOMETRIC_1D, NONE };
enum ValueIndex {
SCALE_FACTOR_IND = 0,
// a source of propagated hypothesis, is set by CheckHypothesis()
// always called before Compute()
TopoDS_Shape _mainEdge;
+ bool _isPropagOfDistribution;
};
#endif
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMESH : implementaion of SMESH idl descriptions
+// File : StdMeshers_Reversible1D.cxx
+// Module : SMESH
+//
+
+#include "StdMeshers_Reversible1D.hxx"
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+StdMeshers_Reversible1D::StdMeshers_Reversible1D(int hypId, int studyId, SMESH_Gen * gen)
+ :SMESH_Hypothesis(hypId, studyId, gen)
+{
+ _param_algo_dim = 1;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+void StdMeshers_Reversible1D::SetReversedEdges( const std::vector<int>& ids )
+{
+ if ( ids != _edgeIDs )
+ {
+ _edgeIDs = ids;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+std::ostream & StdMeshers_Reversible1D::SaveTo(std::ostream & save)
+{
+ save << " " << _edgeIDs.size() << " ";
+
+ if ( !_edgeIDs.empty() )
+ {
+ for ( size_t i = 0; i < _edgeIDs.size(); i++)
+ save << " " << _edgeIDs[i];
+ save << " " << _objEntry << " ";
+ }
+
+ return save;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+std::istream & StdMeshers_Reversible1D::LoadFrom(std::istream & load)
+{
+ bool isOK;
+ int intVal;
+
+ isOK = (load >> intVal);
+ if (isOK && intVal > 0) {
+ _edgeIDs.reserve( intVal );
+ for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
+ isOK = (load >> intVal);
+ if ( isOK ) _edgeIDs.push_back( intVal );
+ }
+ isOK = (load >> _objEntry);
+ }
+
+ return load;
+}
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMESH : implementaion of SMESH idl descriptions
+// File : StdMeshers_Reversible1D.hxx
+// Module : SMESH
+//
+#ifndef _SMESH_Reversible1D_HXX_
+#define _SMESH_Reversible1D_HXX_
+
+#include "SMESH_StdMeshers.hxx"
+#include "SMESH_Hypothesis.hxx"
+
+#include <vector>
+
+/*!
+ * \brief A base of reversible 1D hypotheses
+ */
+class STDMESHERS_EXPORT StdMeshers_Reversible1D : public SMESH_Hypothesis
+{
+public:
+ StdMeshers_Reversible1D(int hypId, int studyId, SMESH_Gen* gen);
+
+ void SetReversedEdges( const std::vector<int>& ids);
+
+ void SetObjectEntry( const char* entry ) { _objEntry = entry; }
+
+ const char* GetObjectEntry() { return _objEntry.c_str(); }
+
+ const std::vector<int>& GetReversedEdges() const { return _edgeIDs; }
+
+ virtual std::ostream & SaveTo(std::ostream & save);
+ virtual std::istream & LoadFrom(std::istream & load);
+
+protected:
+ std::vector<int> _edgeIDs;
+ std::string _objEntry;
+};
+
+#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
#include "StdMeshers_UseExisting_1D2D.hxx"
+#include "SMESH_Mesh.hxx"
+#include "SMESH_subMesh.hxx"
+
//=======================================================================
//function : StdMeshers_UseExisting_1D
//purpose :
//purpose :
//=======================================================================
-bool StdMeshers_UseExisting_1D::Compute(SMESH_Mesh&, const TopoDS_Shape&)
+bool StdMeshers_UseExisting_1D::Compute(SMESH_Mesh& mesh, const TopoDS_Shape& edge)
{
// This algorithm exists to allow mesh generation by mesh
// edition functions in TUI mode
+ mesh.GetSubMesh( edge )->SetIsAlwaysComputed( true );
return true;
}
//purpose :
//=======================================================================
-bool StdMeshers_UseExisting_2D::Compute(SMESH_Mesh&, const TopoDS_Shape&)
+bool StdMeshers_UseExisting_2D::Compute(SMESH_Mesh& mesh, const TopoDS_Shape& face)
{
// This algorithm exists to allow mesh generation by mesh edition
// functions in TUI mode
+ mesh.GetSubMesh( face )->SetIsAlwaysComputed( true );
return true;
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESH_ControlsDef.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_Group.hxx"
+#include "SMESH_HypoFilter.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_MeshAlgos.hxx"
#include "SMESH_MesherHelper.hxx"
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
{
TopoDS_Shape _solid;
const StdMeshers_ViscousLayers* _hyp;
+ TopoDS_Shape _hypShape;
_MeshOfSolid* _proxyMesh;
set<TGeomID> _reversedFaceIds;
+ set<TGeomID> _ignoreFaceIds;
double _stepSize, _stepSizeCoeff;
const SMDS_MeshNode* _stepSizeNodes[2];
// iteration over the map is 5 time longer than over the vector
vector< _LayerEdge* > _edges;
- // key: an id of shape (EDGE or VERTEX) shared by a FACE with
- // layers and a FACE w/o layers
+ // key: an id of shape (EDGE or VERTEX) shared by a FACE with
+ // layers and a FACE w/o layers
// value: the shape (FACE or EDGE) to shrink mesh on.
- // _LayerEdge's basing on nodes on key shape are inflated along the value shape
+ // _LayerEdge's basing on nodes on key shape are inflated along the value shape
map< TGeomID, TopoDS_Shape > _shrinkShape2Shape;
// FACE's WOL, srink on which is forbiden due to algo on the adjacent SOLID
_SolidData(const TopoDS_Shape& s=TopoDS_Shape(),
const StdMeshers_ViscousLayers* h=0,
- _MeshOfSolid* m=0) :_solid(s), _hyp(h), _proxyMesh(m) {}
+ const TopoDS_Shape& hs=TopoDS_Shape(),
+ _MeshOfSolid* m=0)
+ :_solid(s), _hyp(h), _hypShape(hs), _proxyMesh(m) {}
~_SolidData();
Handle(Geom_Curve) CurveForSmooth( const TopoDS_Edge& E,
SMESH_ComputeErrorPtr _error;
vector< _SolidData > _sdVec;
- set<TGeomID> _ignoreShapeIds;
int _tmpFaceID;
};
//--------------------------------------------------------------------------------
//
StdMeshers_ViscousLayers::StdMeshers_ViscousLayers(int hypId, int studyId, SMESH_Gen* gen)
:SMESH_Hypothesis(hypId, studyId, gen),
- _isToIgnoreShapes(18), _nbLayers(1), _thickness(1), _stretchFactor(1)
+ _isToIgnoreShapes(1), _nbLayers(1), _thickness(1), _stretchFactor(1)
{
_name = StdMeshers_ViscousLayers::GetHypType();
_param_algo_dim = -3; // auxiliary hyp used by 3D algos
<< " " << _thickness
<< " " << _stretchFactor
<< " " << _shapeIds.size();
- for ( unsigned i = 0; i < _shapeIds.size(); ++i )
+ for ( size_t i = 0; i < _shapeIds.size(); ++i )
save << " " << _shapeIds[i];
save << " " << !_isToIgnoreShapes; // negate to keep the behavior in old studies.
return save;
// get average dir of edges going fromV
gp_XYZ edgeDir;
//if ( edges.size() > 1 )
- for ( unsigned i = 0; i < edges.size(); ++i )
+ for ( size_t i = 0; i < edges.size(); ++i )
{
edgeDir = getEdgeDir( edges[i], fromV );
double size2 = edgeDir.SquareModulus();
py = new ofstream(fname);
*py << "import SMESH" << endl
<< "from salome.smesh import smeshBuilder" << endl
- << "smesh = smeshBuilder.New(salome.myStudy)" << endl
+ << "smesh = smeshBuilder.New(salome.myStudy)" << endl
<< "meshSO = smesh.GetCurrentStudy().FindObjectID('0:1:2:3')" << endl
- << "mesh = smesh.Mesh( meshSO.GetObject() )"<<endl;
+ << "mesh = smesh.Mesh( meshSO.GetObject() )"<<endl;
}
void Finish() {
if (py)
if ( !findFacesWithLayers() )
return _error;
- for ( unsigned i = 0; i < _sdVec.size(); ++i )
+ for ( size_t i = 0; i < _sdVec.size(); ++i )
{
if ( ! makeLayer(_sdVec[i]) )
return _error;
_sdVec.reserve( allSolids.Extent());
SMESH_Gen* gen = _mesh->GetGen();
+ SMESH_HypoFilter filter;
for ( int i = 1; i <= allSolids.Extent(); ++i )
{
// find StdMeshers_ViscousLayers hyp assigned to the i-th solid
viscHyp = dynamic_cast<const StdMeshers_ViscousLayers*>( *hyp );
if ( viscHyp )
{
+ TopoDS_Shape hypShape;
+ filter.Init( filter.Is( viscHyp ));
+ _mesh->GetHypothesis( allSolids(i), filter, true, &hypShape );
+
_MeshOfSolid* proxyMesh = _ViscousListener::GetSolidMesh( _mesh,
allSolids(i),
/*toCreate=*/true);
- _sdVec.push_back( _SolidData( allSolids(i), viscHyp, proxyMesh ));
+ _sdVec.push_back( _SolidData( allSolids(i), viscHyp, hypShape, proxyMesh ));
_sdVec.back()._index = getMeshDS()->ShapeToIndex( allSolids(i));
}
}
bool _ViscousBuilder::findFacesWithLayers()
{
+ SMESH_MesherHelper helper( *_mesh );
+ TopExp_Explorer exp;
+ TopTools_IndexedMapOfShape solids;
+
// collect all faces to ignore defined by hyp
- vector<TopoDS_Shape> ignoreFaces;
- for ( unsigned i = 0; i < _sdVec.size(); ++i )
+ for ( size_t i = 0; i < _sdVec.size(); ++i )
{
+ solids.Add( _sdVec[i]._solid );
+
vector<TGeomID> ids = _sdVec[i]._hyp->GetBndShapes();
- for ( unsigned i = 0; i < ids.size(); ++i )
+ if ( _sdVec[i]._hyp->IsToIgnoreShapes() ) // FACEs to ignore are given
{
- const TopoDS_Shape& s = getMeshDS()->IndexToShape( ids[i] );
- if ( !s.IsNull() && s.ShapeType() == TopAbs_FACE )
+ for ( size_t ii = 0; ii < ids.size(); ++ii )
{
- _ignoreShapeIds.insert( ids[i] );
- ignoreFaces.push_back( s );
+ const TopoDS_Shape& s = getMeshDS()->IndexToShape( ids[ii] );
+ if ( !s.IsNull() && s.ShapeType() == TopAbs_FACE )
+ _sdVec[i]._ignoreFaceIds.insert( ids[ii] );
+ }
+ }
+ else // FACEs with layers are given
+ {
+ exp.Init( _sdVec[i]._solid, TopAbs_FACE );
+ for ( ; exp.More(); exp.Next() )
+ {
+ TGeomID faceInd = getMeshDS()->ShapeToIndex( exp.Current() );
+ if ( find( ids.begin(), ids.end(), faceInd ) == ids.end() )
+ _sdVec[i]._ignoreFaceIds.insert( faceInd );
}
}
- }
- // ignore internal faces
- SMESH_MesherHelper helper( *_mesh );
- TopExp_Explorer exp;
- for ( unsigned i = 0; i < _sdVec.size(); ++i )
- {
- exp.Init( _sdVec[i]._solid.Oriented( TopAbs_FORWARD ), TopAbs_FACE );
- for ( ; exp.More(); exp.Next() )
+ // ignore internal FACEs if inlets and outlets are specified
{
- TGeomID faceInd = getMeshDS()->ShapeToIndex( exp.Current() );
- if ( helper.NbAncestors( exp.Current(), *_mesh, TopAbs_SOLID ) > 1 )
- {
- _ignoreShapeIds.insert( faceInd );
- ignoreFaces.push_back( exp.Current() );
- if ( helper.IsReversedSubMesh( TopoDS::Face( exp.Current() )))
+ TopTools_IndexedDataMapOfShapeListOfShape solidsOfFace;
+ if ( _sdVec[i]._hyp->IsToIgnoreShapes() )
+ TopExp::MapShapesAndAncestors( _sdVec[i]._hypShape,
+ TopAbs_FACE, TopAbs_SOLID, solidsOfFace);
+
+ exp.Init( _sdVec[i]._solid.Oriented( TopAbs_FORWARD ), TopAbs_FACE );
+ for ( ; exp.More(); exp.Next() )
+ {
+ const TopoDS_Face& face = TopoDS::Face( exp.Current() );
+ if ( helper.NbAncestors( face, *_mesh, TopAbs_SOLID ) < 2 )
+ continue;
+
+ const TGeomID faceInd = getMeshDS()->ShapeToIndex( face );
+ if ( _sdVec[i]._hyp->IsToIgnoreShapes() )
+ {
+ int nbSolids = solidsOfFace.FindFromKey( face ).Extent();
+ if ( nbSolids > 1 )
+ _sdVec[i]._ignoreFaceIds.insert( faceInd );
+ }
+
+ if ( helper.IsReversedSubMesh( face ))
+ {
_sdVec[i]._reversedFaceIds.insert( faceInd );
+ }
}
}
}
// Find faces to shrink mesh on (solution 2 in issue 0020832);
TopTools_IndexedMapOfShape shapes;
- for ( unsigned i = 0; i < _sdVec.size(); ++i )
+ for ( size_t i = 0; i < _sdVec.size(); ++i )
{
shapes.Clear();
TopExp::MapShapes(_sdVec[i]._solid, TopAbs_EDGE, shapes);
// check presence of layers on them
int ignore[2];
for ( int j = 0; j < 2; ++j )
- ignore[j] = _ignoreShapeIds.count ( getMeshDS()->ShapeToIndex( FF[j] ));
- if ( ignore[0] == ignore[1] ) continue; // nothing interesting
+ ignore[j] = _sdVec[i]._ignoreFaceIds.count ( getMeshDS()->ShapeToIndex( FF[j] ));
+ if ( ignore[0] == ignore[1] )
+ continue; // nothing interesting
TopoDS_Shape fWOL = FF[ ignore[0] ? 0 : 1 ];
+ // check presence of layers on fWOL within an adjacent SOLID
+ PShapeIteratorPtr sIt = helper.GetAncestors( fWOL, *_mesh, TopAbs_SOLID );
+ while ( const TopoDS_Shape* solid = sIt->next() )
+ if ( !solid->IsSame( _sdVec[i]._solid ))
+ {
+ int iSolid = solids.FindIndex( *solid );
+ int iFace = getMeshDS()->ShapeToIndex( fWOL );
+ if ( iSolid > 0 && !_sdVec[ iSolid-1 ]._ignoreFaceIds.count( iFace ))
+ {
+ _sdVec[i]._noShrinkFaces.insert( iFace );
+ fWOL.Nullify();
+ }
+ }
// add edge to maps
- TGeomID edgeInd = getMeshDS()->ShapeToIndex( edge );
- _sdVec[i]._shrinkShape2Shape.insert( make_pair( edgeInd, fWOL ));
+ if ( !fWOL.IsNull())
+ {
+ TGeomID edgeInd = getMeshDS()->ShapeToIndex( edge );
+ _sdVec[i]._shrinkShape2Shape.insert( make_pair( edgeInd, fWOL ));
+ }
}
}
// Exclude from _shrinkShape2Shape FACE's that can't be shrinked since
// the algo of the SOLID sharing the FACE does not support it
set< string > notSupportAlgos; notSupportAlgos.insert("Hexa_3D");
- for ( unsigned i = 0; i < _sdVec.size(); ++i )
+ for ( size_t i = 0; i < _sdVec.size(); ++i )
{
TopTools_MapOfShape noShrinkVertices;
map< TGeomID, TopoDS_Shape >::iterator e2f = _sdVec[i]._shrinkShape2Shape.begin();
SMESH_Algo* algo = _mesh->GetGen()->GetAlgo( *_mesh, *solid );
if ( !algo || !notSupportAlgos.count( algo->GetName() )) continue;
notShrinkFace = true;
- for ( unsigned j = 0; j < _sdVec.size(); ++j )
+ for ( size_t j = 0; j < _sdVec.size(); ++j )
{
if ( _sdVec[j]._solid.IsSame( *solid ) )
if ( _sdVec[j]._shrinkShape2Shape.count( edgeID ))
}
}
}
-
+
// Find the SHAPE along which to inflate _LayerEdge based on VERTEX
- for ( unsigned i = 0; i < _sdVec.size(); ++i )
+ for ( size_t i = 0; i < _sdVec.size(); ++i )
{
shapes.Clear();
TopExp::MapShapes(_sdVec[i]._solid, TopAbs_VERTEX, shapes);
while ( fIt->more())
{
const TopoDS_Shape* f = fIt->next();
- const int fID = getMeshDS()->ShapeToIndex( *f );
if ( helper.IsSubShape( *f, _sdVec[i]._solid ) )
{
totalNbFaces++;
- if ( _ignoreShapeIds.count ( fID ) && ! _sdVec[i]._noShrinkFaces.count( fID ))
+ const int fID = getMeshDS()->ShapeToIndex( *f );
+ if ( _sdVec[i]._ignoreFaceIds.count ( fID ) &&
+ !_sdVec[i]._noShrinkFaces.count( fID ))
facesWOL.push_back( *f );
}
}
switch ( facesWOL.size() )
{
case 1:
+ {
+ helper.SetSubShape( facesWOL[0] );
+ if ( helper.IsRealSeam( vInd )) // inflate along a seam edge?
{
- helper.SetSubShape( facesWOL[0] );
- if ( helper.IsRealSeam( vInd )) // inflate along a seam edge?
+ TopoDS_Shape seamEdge;
+ PShapeIteratorPtr eIt = helper.GetAncestors(vertex, *_mesh, TopAbs_EDGE);
+ while ( eIt->more() && seamEdge.IsNull() )
{
- TopoDS_Shape seamEdge;
- PShapeIteratorPtr eIt = helper.GetAncestors(vertex, *_mesh, TopAbs_EDGE);
- while ( eIt->more() && seamEdge.IsNull() )
- {
- const TopoDS_Shape* e = eIt->next();
- if ( helper.IsRealSeam( *e ) )
- seamEdge = *e;
- }
- if ( !seamEdge.IsNull() )
- {
- _sdVec[i]._shrinkShape2Shape.insert( make_pair( vInd, seamEdge ));
- break;
- }
+ const TopoDS_Shape* e = eIt->next();
+ if ( helper.IsRealSeam( *e ) )
+ seamEdge = *e;
+ }
+ if ( !seamEdge.IsNull() )
+ {
+ _sdVec[i]._shrinkShape2Shape.insert( make_pair( vInd, seamEdge ));
+ break;
}
- _sdVec[i]._shrinkShape2Shape.insert( make_pair( vInd, facesWOL[0] ));
- break;
}
+ _sdVec[i]._shrinkShape2Shape.insert( make_pair( vInd, facesWOL[0] ));
+ break;
+ }
case 2:
+ {
+ // find an edge shared by 2 faces
+ PShapeIteratorPtr eIt = helper.GetAncestors(vertex, *_mesh, TopAbs_EDGE);
+ while ( eIt->more())
{
- // find an edge shared by 2 faces
- PShapeIteratorPtr eIt = helper.GetAncestors(vertex, *_mesh, TopAbs_EDGE);
- while ( eIt->more())
+ const TopoDS_Shape* e = eIt->next();
+ if ( helper.IsSubShape( *e, facesWOL[0]) &&
+ helper.IsSubShape( *e, facesWOL[1]))
{
- const TopoDS_Shape* e = eIt->next();
- if ( helper.IsSubShape( *e, facesWOL[0]) &&
- helper.IsSubShape( *e, facesWOL[1]))
- {
- _sdVec[i]._shrinkShape2Shape.insert( make_pair( vInd, *e )); break;
- }
+ _sdVec[i]._shrinkShape2Shape.insert( make_pair( vInd, *e )); break;
}
- break;
}
+ break;
+ }
default:
return error("Not yet supported case", _sdVec[i]._index);
}
subIds = data._noShrinkFaces;
TopExp_Explorer exp( data._solid, TopAbs_FACE );
for ( ; exp.More(); exp.Next() )
- if ( ! _ignoreShapeIds.count( getMeshDS()->ShapeToIndex( exp.Current() )))
{
SMESH_subMesh* fSubM = _mesh->GetSubMesh( exp.Current() );
- faceIds.insert( fSubM->GetId() );
+ if ( ! data._ignoreFaceIds.count( getMeshDS()->ShapeToIndex( exp.Current() )))
+ faceIds.insert( fSubM->GetId() );
SMESH_subMeshIteratorPtr subIt =
fSubM->getDependsOnIterator(/*includeSelf=*/true, /*complexShapeFirst=*/false);
while ( subIt->more() )
for (; s2s != data._shrinkShape2Shape.end(); ++s2s )
{
TGeomID shapeInd = s2s->first;
- for ( unsigned i = 0; i < _sdVec.size(); ++i )
+ for ( size_t i = 0; i < _sdVec.size(); ++i )
{
if ( _sdVec[i]._index == data._index ) continue;
map< TGeomID, TopoDS_Shape >::iterator s2s2 = _sdVec[i]._shrinkShape2Shape.find( shapeInd );
// Set target nodes into _Simplex and _2NearEdges
TNode2Edge::iterator n2e;
- for ( unsigned i = 0; i < data._edges.size(); ++i )
+ for ( size_t i = 0; i < data._edges.size(); ++i )
{
if ( data._edges[i]->IsOnEdge())
for ( int j = 0; j < 2; ++j )
data._edges[i]->_2neibors->_edges[j] = n2e->second;
}
else
- for ( unsigned j = 0; j < data._edges[i]->_simplices.size(); ++j )
+ for ( size_t j = 0; j < data._edges[i]->_simplices.size(); ++j )
{
_Simplex& s = data._edges[i]->_simplices[j];
s._nNext = data._n2eMap[ s._nNext ]->_nodes.back();
SMESH_MesherHelper helper( *_mesh );
bool ok = true;
- for ( unsigned iS = 0; iS < edgesByGeom.size(); ++iS )
+ for ( size_t iS = 0; iS < edgesByGeom.size(); ++iS )
{
vector<_LayerEdge*>& eS = edgesByGeom[iS];
if ( eS.empty() ) continue;
if ( eE.empty() ) continue;
if ( eE[0]->_sWOL.IsNull() )
{
- for ( unsigned i = 0; i < eE.size() && !needSmooth; ++i )
+ for ( size_t i = 0; i < eE.size() && !needSmooth; ++i )
needSmooth = ( eE[i]->_cosin > 0.1 );
}
else
const TopoDS_Face& F1 = TopoDS::Face( S );
const TopoDS_Face& F2 = TopoDS::Face( eE[0]->_sWOL );
const TopoDS_Edge& E = TopoDS::Edge( eExp.Current() );
- for ( unsigned i = 0; i < eE.size() && !needSmooth; ++i )
+ for ( size_t i = 0; i < eE.size() && !needSmooth; ++i )
{
gp_Vec dir1 = getFaceDir( F1, E, eE[i]->_nodes[0], helper, ok );
gp_Vec dir2 = getFaceDir( F2, E, eE[i]->_nodes[0], helper, ok );
}
// then the rest _LayerEdge's
- for ( unsigned iS = 0; iS < edgesByGeom.size(); ++iS )
+ for ( size_t iS = 0; iS < edgesByGeom.size(); ++iS )
{
vector<_LayerEdge*>& eVec = edgesByGeom[iS];
data._edges.insert( data._edges.end(), eVec.begin(), eVec.end() );
if ( posType == SMDS_TOP_FACE )
{
- getSimplices( node, edge._simplices, _ignoreShapeIds, &data );
+ getSimplices( node, edge._simplices, data._ignoreFaceIds, &data );
double avgNormProj = 0, avgLen = 0;
- for ( unsigned i = 0; i < edge._simplices.size(); ++i )
+ for ( size_t i = 0; i < edge._simplices.size(); ++i )
{
gp_XYZ vec = edge._pos.back() - SMESH_TNodeXYZ( edge._simplices[i]._nPrev );
avgNormProj += edge._normal * vec;
void _ViscousBuilder::makeGroupOfLE()
{
#ifdef _DEBUG_
- for ( unsigned i = 0 ; i < _sdVec.size(); ++i )
+ for ( size_t i = 0 ; i < _sdVec.size(); ++i )
{
if ( _sdVec[i]._edges.empty() ) continue;
// string name = SMESH_Comment("_LayerEdge's_") << i;
// SMESHDS_Mesh* mDS = _mesh->GetMeshDS();
dumpFunction( SMESH_Comment("make_LayerEdge_") << i );
- for ( unsigned j = 0 ; j < _sdVec[i]._edges.size(); ++j )
+ for ( size_t j = 0 ; j < _sdVec[i]._edges.size(); ++j )
{
_LayerEdge* le = _sdVec[i]._edges[j];
- for ( unsigned iN = 1; iN < le->_nodes.size(); ++iN )
+ for ( size_t iN = 1; iN < le->_nodes.size(); ++iN )
dumpCmd(SMESH_Comment("mesh.AddEdge([ ") <<le->_nodes[iN-1]->GetID()
<< ", " << le->_nodes[iN]->GetID() <<"])");
//gDS->SMDSGroup().Add( mDS->AddEdge( le->_nodes[iN-1], le->_nodes[iN]));
dumpFunctionEnd();
dumpFunction( SMESH_Comment("makeNormals") << i );
- for ( unsigned j = 0 ; j < _sdVec[i]._edges.size(); ++j )
+ for ( size_t j = 0 ; j < _sdVec[i]._edges.size(); ++j )
{
_LayerEdge& edge = *_sdVec[i]._edges[j];
SMESH_TNodeXYZ nXYZ( edge._nodes[0] );
auto_ptr<SMESH_ElementSearcher> searcher
( SMESH_MeshAlgos::GetElementSearcher( *getMeshDS(),
data._proxyMesh->GetFaces( data._solid )) );
- for ( unsigned i = 0; i < data._edges.size(); ++i )
+ for ( size_t i = 0; i < data._edges.size(); ++i )
{
if ( data._edges[i]->IsOnEdge() ) continue;
data._edges[i]->FindIntersection( *searcher, intersecDist, data._epsilon );
// Elongate _LayerEdge's
dumpFunction(SMESH_Comment("inflate")<<data._index<<"_step"<<nbSteps); // debug
- for ( unsigned i = 0; i < data._edges.size(); ++i )
+ for ( size_t i = 0; i < data._edges.size(); ++i )
{
data._edges[i]->SetNewLength( curThick, helper );
}
if ( nbSteps > 0 )
{
dumpFunction(SMESH_Comment("invalidate")<<data._index<<"_step"<<nbSteps); // debug
- for ( unsigned i = 0; i < data._edges.size(); ++i )
+ for ( size_t i = 0; i < data._edges.size(); ++i )
{
data._edges[i]->InvalidateStep( nbSteps+1 );
}
// Evaluate achieved thickness
avgThick = 0;
- for ( unsigned i = 0; i < data._edges.size(); ++i )
+ for ( size_t i = 0; i < data._edges.size(); ++i )
avgThick += data._edges[i]->_len;
avgThick /= data._edges.size();
#ifdef __myDEBUG
TopoDS_Face F;
int iBeg, iEnd = 0;
- for ( unsigned iS = 0; iS < data._endEdgeToSmooth.size(); ++iS )
+ for ( size_t iS = 0; iS < data._endEdgeToSmooth.size(); ++iS )
{
iBeg = iEnd;
iEnd = data._endEdgeToSmooth[ iS ];
{
_LayerEdge* edge = data._edges[i];
SMESH_TNodeXYZ tgtXYZ( edge->_nodes.back() );
- for ( unsigned j = 0; j < edge->_simplices.size(); ++j )
+ for ( size_t j = 0; j < edge->_simplices.size(); ++j )
if ( !edge->_simplices[j].IsForward( edge->_nodes[0], &tgtXYZ ))
{
cout << "Bad simplex ( " << edge->_nodes[0]->GetID()<< " "<< tgtXYZ._node->GetID()
const SMDS_MeshElement* closestFace = 0;
int iLE = 0;
#endif
- for ( unsigned i = 0; i < data._edges.size(); ++i )
+ for ( size_t i = 0; i < data._edges.size(); ++i )
{
if ( data._edges[i]->FindIntersection( *searcher, dist, data._epsilon, &intFace ))
return false;
vector< const SMDS_MeshNode*> nodes(4); // of a tmp mesh face
dumpFunction(SMESH_Comment("makeTmpFacesOnEdges")<<data._index);
- for ( unsigned i = 0; i < data._edges.size(); ++i )
+ for ( size_t i = 0; i < data._edges.size(); ++i )
{
_LayerEdge* edge = data._edges[i];
if ( !edge->IsOnEdge() || !edge->_sWOL.IsNull() ) continue;
}
// look for a _LayerEdge containg tgt2
// _LayerEdge* neiborEdge = 0;
-// unsigned di = 0; // check _edges[i+di] and _edges[i-di]
+// size_t di = 0; // check _edges[i+di] and _edges[i-di]
// while ( !neiborEdge && ++di <= data._edges.size() )
// {
// if ( i+di < data._edges.size() && data._edges[i+di]->_nodes.back() == tgt2 )
TLEdge2LEdgeSet edge2CloseEdge;
const double eps = data._epsilon * data._epsilon;
- for ( unsigned i = 0; i < data._edges.size(); ++i )
+ for ( size_t i = 0; i < data._edges.size(); ++i )
{
_LayerEdge* edge = data._edges[i];
if ( !edge->IsOnEdge() || !edge->_sWOL.IsNull() ) continue;
// 2) Check absence of intersections
// TODO?
- for ( unsigned i = 0 ; i < tmpFaces.size(); ++i )
+ for ( size_t i = 0 ; i < tmpFaces.size(); ++i )
delete tmpFaces[i];
return true;
bool segmentIntersected = false;
distance = Precision::Infinite();
int iFace = -1; // intersected face
- for ( unsigned j = 0 ; j < suspectFaces.size() && !segmentIntersected; ++j )
+ for ( size_t j = 0 ; j < suspectFaces.size() && !segmentIntersected; ++j )
{
const SMDS_MeshElement* face = suspectFaces[j];
if ( face->GetNodeIndex( _nodes.back() ) >= 0 ||
// compute new position for the last _pos
gp_XYZ newPos (0,0,0);
- for ( unsigned i = 0; i < _simplices.size(); ++i )
+ for ( size_t i = 0; i < _simplices.size(); ++i )
newPos += SMESH_TNodeXYZ( _simplices[i]._nPrev );
newPos /= _simplices.size();
// count quality metrics (orientation) of tetras around _tgtNode
int nbOkBefore = 0;
SMESH_TNodeXYZ tgtXYZ( _nodes.back() );
- for ( unsigned i = 0; i < _simplices.size(); ++i )
+ for ( size_t i = 0; i < _simplices.size(); ++i )
nbOkBefore += _simplices[i].IsForward( _nodes[0], &tgtXYZ );
int nbOkAfter = 0;
- for ( unsigned i = 0; i < _simplices.size(); ++i )
+ for ( size_t i = 0; i < _simplices.size(); ++i )
nbOkAfter += _simplices[i].IsForward( _nodes[0], &newPos );
if ( nbOkAfter < nbOkBefore )
gp_XY uv;
bool isOnEdge;
- for ( unsigned i = 0; i < data._edges.size(); ++i )
+ for ( size_t i = 0; i < data._edges.size(); ++i )
{
_LayerEdge& edge = *data._edges[i];
// get accumulated length of segments
vector< double > segLen( edge._pos.size() );
segLen[0] = 0.0;
- for ( unsigned j = 1; j < edge._pos.size(); ++j )
+ for ( size_t j = 1; j < edge._pos.size(); ++j )
segLen[j] = segLen[j-1] + (edge._pos[j-1] - edge._pos[j] ).Modulus();
// allocate memory for new nodes if it is not yet refined
// create intermediate nodes
double hSum = 0, hi = h0/f;
- unsigned iSeg = 1;
- for ( unsigned iStep = 1; iStep < edge._nodes.size(); ++iStep )
+ size_t iSeg = 1;
+ for ( size_t iStep = 1; iStep < edge._nodes.size(); ++iStep )
{
// compute an intermediate position
hi *= f;
if ( !getMeshDS()->IsEmbeddedMode() )
// Log node movement
- for ( unsigned i = 0; i < data._edges.size(); ++i )
+ for ( size_t i = 0; i < data._edges.size(); ++i )
{
_LayerEdge& edge = *data._edges[i];
SMESH_TNodeXYZ p ( edge._nodes.back() );
TopExp_Explorer exp( data._solid, TopAbs_FACE );
for ( ; exp.More(); exp.Next() )
{
- if ( _ignoreShapeIds.count( getMeshDS()->ShapeToIndex( exp.Current() )))
+ if ( data._ignoreFaceIds.count( getMeshDS()->ShapeToIndex( exp.Current() )))
continue;
SMESHDS_SubMesh* fSubM = getMeshDS()->MeshElements( exp.Current() );
SMDS_ElemIteratorPtr fIt = fSubM->GetElements();
// make map of (ids of FACEs to shrink mesh on) to (_SolidData containing _LayerEdge's
// inflated along FACE or EDGE)
map< TGeomID, _SolidData* > f2sdMap;
- for ( unsigned i = 0 ; i < _sdVec.size(); ++i )
+ for ( size_t i = 0 ; i < _sdVec.size(); ++i )
{
_SolidData& data = _sdVec[i];
TopTools_MapOfShape FFMap;
// Replace source nodes by target nodes in mesh faces to shrink
const SMDS_MeshNode* nodes[20];
- for ( unsigned i = 0; i < lEdges.size(); ++i )
+ for ( size_t i = 0; i < lEdges.size(); ++i )
{
_LayerEdge& edge = *lEdges[i];
const SMDS_MeshNode* srcNode = edge._nodes[0];
vector< _SmoothNode > nodesToSmooth( smoothNodes.size() );
{
const bool sortSimplices = isConcaveFace;
- for ( unsigned i = 0; i < smoothNodes.size(); ++i )
+ for ( size_t i = 0; i < smoothNodes.size(); ++i )
{
const SMDS_MeshNode* n = smoothNodes[i];
nodesToSmooth[ i ]._node = n;
// Find EDGE's to shrink and set simpices to LayerEdge's
set< _Shrinker1D* > eShri1D;
{
- for ( unsigned i = 0; i < lEdges.size(); ++i )
+ for ( size_t i = 0; i < lEdges.size(); ++i )
{
_LayerEdge* edge = lEdges[i];
if ( edge->_sWOL.ShapeType() == TopAbs_EDGE )
int oldBadNb = badNb;
badNb = 0;
moved = false;
- for ( unsigned i = 0; i < nodesToSmooth.size(); ++i )
+ for ( size_t i = 0; i < nodesToSmooth.size(); ++i )
{
moved |= nodesToSmooth[i].Smooth( badNb,surface,helper,refSign,
smoothType, /*set3D=*/isConcaveFace);
case 3: smoothType = _SmoothNode::ANGULAR; break;
}
dumpFunction(SMESH_Comment("shrinkFace")<<f2sd->first<<"_st"<<++smooStep); // debug
- for ( unsigned i = 0; i < nodesToSmooth.size(); ++i )
+ for ( size_t i = 0; i < nodesToSmooth.size(); ++i )
{
nodesToSmooth[i].Smooth( badNb,surface,helper,refSign,
smoothType,/*set3D=*/st==1 );
if ( !getMeshDS()->IsEmbeddedMode() )
// Log node movement
- for ( unsigned i = 0; i < nodesToSmooth.size(); ++i )
+ for ( size_t i = 0; i < nodesToSmooth.size(); ++i )
{
SMESH_TNodeXYZ p ( nodesToSmooth[i]._node );
getMeshDS()->MoveNode( nodesToSmooth[i]._node, p.X(), p.Y(), p.Z() );
// if ( faceSubMesh->Contains( f ))
// faces.push_back( f );
// }
- // for ( unsigned i = 0; i < faces.size(); ++i )
+ // for ( size_t i = 0; i < faces.size(); ++i )
// {
// const int nbNodes = faces[i]->NbCornerNodes();
// for ( int j = 0; j < nbNodes; ++j )
// count quality metrics (orientation) of triangles around the node
int nbOkBefore = 0;
gp_XY tgtUV = helper.GetNodeUV( face, _node );
- for ( unsigned i = 0; i < _simplices.size(); ++i )
+ for ( size_t i = 0; i < _simplices.size(); ++i )
nbOkBefore += _simplices[i].IsForward( tgtUV, _node, face, helper, refSign );
int nbOkAfter = 0;
- for ( unsigned i = 0; i < _simplices.size(); ++i )
+ for ( size_t i = 0; i < _simplices.size(); ++i )
nbOkAfter += _simplices[i].IsForward( newPos, _node, face, helper, refSign );
if ( nbOkAfter < nbOkBefore )
_SolidData::~_SolidData()
{
- for ( unsigned i = 0; i < _edges.size(); ++i )
+ for ( size_t i = 0; i < _edges.size(); ++i )
{
if ( _edges[i] && _edges[i]->_2neibors )
delete _edges[i]->_2neibors;
{
// remove target node of the _LayerEdge from _nodes
int nbFound = 0;
- for ( unsigned i = 0; i < _nodes.size(); ++i )
+ for ( size_t i = 0; i < _nodes.size(); ++i )
if ( !_nodes[i] || _nodes[i] == tgtNode0 || _nodes[i] == tgtNode1 )
_nodes[i] = 0, nbFound++;
if ( nbFound == _nodes.size() )
l = helper.GetNodeU( E, _edges[1]->_nodes.back(), _nodes.back() );
double totLen = GCPnts_AbscissaPoint::Length( aCurve, f, l );
- for ( unsigned i = 0; i < _nodes.size(); ++i )
+ for ( size_t i = 0; i < _nodes.size(); ++i )
{
if ( !_nodes[i] ) continue;
double len = totLen * _normPar[i];
if ( _edges[1] )
l = helper.GetNodeU( E, _edges[1]->_nodes.back(), _nodes.back() );
- for ( unsigned i = 0; i < _nodes.size(); ++i )
+ for ( size_t i = 0; i < _nodes.size(); ++i )
{
if ( !_nodes[i] ) continue;
double u = f * ( 1-_normPar[i] ) + l * _normPar[i];
void _Shrinker1D::RestoreParams()
{
if ( _done )
- for ( unsigned i = 0; i < _nodes.size(); ++i )
+ for ( size_t i = 0; i < _nodes.size(); ++i )
{
if ( !_nodes[i] ) continue;
SMDS_EdgePosition* pos = static_cast<SMDS_EdgePosition*>( _nodes[i]->GetPosition() );
{
SMESH_MesherHelper helper( *_mesh );
- for ( unsigned i = 0; i < _sdVec.size(); ++i )
+ for ( size_t i = 0; i < _sdVec.size(); ++i )
{
_SolidData& data = _sdVec[i];
TopTools_IndexedMapOfShape geomEdges;
{
const TopoDS_Shape* pF = fIt->next();
if ( helper.IsSubShape( *pF, data._solid) &&
- !_ignoreShapeIds.count( e2f->first ))
+ !data._ignoreFaceIds.count( e2f->first ))
F = *pF;
}
}
// Make faces
const int dj1 = reverse ? 0 : 1;
const int dj2 = reverse ? 1 : 0;
- for ( unsigned j = 1; j < ledges.size(); ++j )
+ for ( size_t j = 1; j < ledges.size(); ++j )
{
vector< const SMDS_MeshNode*>& nn1 = ledges[j-dj1]->_nodes;
vector< const SMDS_MeshNode*>& nn2 = ledges[j-dj2]->_nodes;
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
TSideVector _faceSideVec; // wires (StdMeshers_FaceSide) of _face
vector<_PolyLine> _polyLineVec; // fronts to advance
bool _is2DIsotropic; // is same U and V resoulution of _face
+ vector<TopoDS_Face> _clearedFaces; // FACEs whose mesh was removed by shrink()
double _fPowN; // to compute thickness of layers
double _thickness; // required or possible layers thickness
// collect all EDGEs to ignore defined by hyp
int nbMyEdgesIgnored = getEdgesToIgnore( _hyp, _face, getMeshDS(), _ignoreShapeIds );
- // check all EDGEs of the _face
- int totalNbEdges = 0;
+ // get all shared EDGEs
+ TopTools_MapOfShape sharedEdges;
TopTools_IndexedDataMapOfShapeListOfShape facesOfEdgeMap;
TopExp::MapShapesAndAncestors( theShapeHypAssignedTo,
TopAbs_EDGE, TopAbs_FACE, facesOfEdgeMap);
+ for ( int iE = 1; iE <= facesOfEdgeMap.Extent(); ++iE )
+ if ( facesOfEdgeMap( iE ).Extent() > 1 )
+ sharedEdges.Add( facesOfEdgeMap.FindKey( iE ));
+
+ // check all EDGEs of the _face
+ int totalNbEdges = 0;
for ( size_t iWire = 0; iWire < _faceSideVec.size(); ++iWire )
{
StdMeshers_FaceSidePtr wire = _faceSideVec[ iWire ];
totalNbEdges += wire->NbEdges();
for ( int iE = 0; iE < wire->NbEdges(); ++iE )
{
- const TopTools_ListOfShape& faceList = facesOfEdgeMap.FindFromKey( wire->Edge( iE ));
- if ( faceList.Extent() > 1 )
+ if ( sharedEdges.Contains( wire->Edge( iE )))
{
// ignore internal EDGEs (shared by several FACEs)
const TGeomID edgeID = wire->EdgeID( iE );
_ignoreShapeIds.insert( edgeID );
// check if ends of an EDGE are to be added to _noShrinkVert
+ const TopTools_ListOfShape& faceList = facesOfEdgeMap.FindFromKey( wire->Edge( iE ));
TopTools_ListIteratorOfListOfShape faceIt( faceList );
for ( ; faceIt.More(); faceIt.Next() )
{
while ( const TopoDS_Shape* edge = edgeIt->next() )
if ( !edge->IsSame( wire->Edge( iE )) &&
_helper.IsSubShape( *edge, neighbourFace ) &&
- neighbourIgnoreEdges.count( getMeshDS()->ShapeToIndex( *edge )))
+ ( neighbourIgnoreEdges.count( getMeshDS()->ShapeToIndex( *edge )) ||
+ sharedEdges.Contains( *edge )))
{
_noShrinkVert.insert( getMeshDS()->ShapeToIndex( vertex ));
break;
if ( nbAdvancable == 0 )
continue;
- const TopoDS_Edge& E = L._wire->Edge ( L._edgeInd );
- const int edgeID = L._wire->EdgeID ( L._edgeInd );
- const double edgeLen = L._wire->EdgeLength( L._edgeInd );
- Handle(Geom2d_Curve) pcurve = L._wire->Curve2d ( L._edgeInd );
+ const TopoDS_Vertex& V1 = L._wire->FirstVertex( L._edgeInd );
+ const TopoDS_Vertex& V2 = L._wire->LastVertex ( L._edgeInd );
+ const int v1ID = getMeshDS()->ShapeToIndex( V1 );
+ const int v2ID = getMeshDS()->ShapeToIndex( V2 );
+ const bool isShrinkableL = ! _noShrinkVert.count( v1ID ) && L._leftLine->_advancable;
+ const bool isShrinkableR = ! _noShrinkVert.count( v2ID ) && L._rightLine->_advancable;
+ if ( !isShrinkableL && !isShrinkableR )
+ continue;
+
+ const TopoDS_Edge& E = L._wire->Edge ( L._edgeInd );
+ const int edgeID = L._wire->EdgeID ( L._edgeInd );
+ const double edgeLen = L._wire->EdgeLength ( L._edgeInd );
+ Handle(Geom2d_Curve) pcurve = L._wire->Curve2d ( L._edgeInd );
const bool edgeReversed = ( E.Orientation() == TopAbs_REVERSED );
SMESH_MesherHelper helper( *_mesh ); // to create nodes and edges on E
{
adjFace = TopoDS::Face( *f );
SMESH_ProxyMesh::Ptr pm = _ProxyMeshHolder::FindProxyMeshOfFace( adjFace, *_mesh );
- if ( !pm || pm->NbProxySubMeshes() == 0 )
+ if ( !pm || pm->NbProxySubMeshes() == 0 /*|| !pm->GetProxySubMesh( E )*/)
{
// There are no viscous layers on an adjacent FACE, clear it's 2D mesh
removeMeshFaces( adjFace );
+ // if ( removeMeshFaces( adjFace ))
+ // _clearedFaces.push_back( adjFace ); // to re-compute after all
}
else
{
//
const vector<UVPtStruct>& points = L._wire->GetUVPtStruct();
int iPFrom = L._firstPntInd, iPTo = L._lastPntInd;
- if ( L._leftLine->_advancable )
+ if ( isShrinkableL )
{
vector<gp_XY>& uvVec = L._lEdges.front()._uvRefined;
for ( int i = 0; i < _hyp->GetNumberLayers(); ++i ) {
uvVec.push_back ( pcurve->Value( uvPt.param ).XY() );
}
}
- if ( L._rightLine->_advancable )
+ if ( isShrinkableR )
{
vector<gp_XY>& uvVec = L._lEdges.back()._uvRefined;
for ( int i = 0; i < _hyp->GetNumberLayers(); ++i ) {
}
// make proxy sub-mesh data of present nodes
//
- if ( L._leftLine->_advancable ) iPFrom += _hyp->GetNumberLayers();
- if ( L._rightLine->_advancable ) iPTo -= _hyp->GetNumberLayers();
+ if ( isShrinkableL ) iPFrom += _hyp->GetNumberLayers();
+ if ( isShrinkableR ) iPTo -= _hyp->GetNumberLayers();
UVPtStructVec nodeDataVec( & points[ iPFrom ], & points[ iPTo + 1 ]);
double normSize = nodeDataVec.back().normParam - nodeDataVec.front().normParam;
if ( !L2->_advancable &&
!toShrinkForAdjacent( adjFace, E, L._wire->FirstVertex( L._edgeInd + isR )))
continue;
+ if ( isR ? !isShrinkableR : !isShrinkableL )
+ continue;
double & u = isR ? u2 : u1; // param to move
double u0 = isR ? ul : uf; // init value of the param to move
length1D = Abs( u - curveInt.Point( 1 ).ParamOnFirst() );
double maxDist2d = 2 * L2->_lEdges[ iLSeg2 ]._length2D;
isConvex = ( length1D < maxDist2d * len1dTo2dRatio );
- /* |L seg2
- * | o---o---
- * | / |
- * |/ | L2
- * x------x--- */
+ /* |L seg2
+ * | o---o---
+ * | / |
+ * |/ | L2
+ * x------x--- */
}
- if ( !isConvex ) { /* concave VERTEX */ /* o-----o---
- * \ |
+ if ( !isConvex ) { /* concave VERTEX */ /* o-----o---
+ * \ |
* \ | L2
- * x--x---
- * /
+ * x--x---
+ * /
* L / */
length2D = L2->_lEdges[ iFSeg2 ]._length2D;
//if ( L2->_advancable ) continue;
{
const SMDS_MeshElement* segment = segIt->next();
if ( segment->getshapeId() != edgeID ) continue;
-
+
const int nbNodes = segment->NbNodes();
for ( int i = 0; i < nbNodes; ++i )
{
}
// concatenate nodeDataVec and nodeDataForAdjacent
nodeDataVec.insert(( isRShrinkedForAdjacent ? nodeDataVec.end() : nodeDataVec.begin() ),
- nodeDataForAdjacent.begin(), nodeDataForAdjacent.end() );
+ nodeDataForAdjacent.begin(), nodeDataForAdjacent.end() );
}
// Extend nodeDataVec by a node located at the end of not shared _LayerEdge
/* n - to add to nodeDataVec
- * o-----o---
- * |\ |
+ * o-----o---
+ * |\ |
* | o---o---
* | |x--x--- L2
- * | /
+ * | /
* |/ L
* x
* / */
nodeDataVec.insert(( isR ? nodeDataVec.end() : nodeDataVec.begin() ), ptOfNode );
// recompute normParam of nodes in nodeDataVec
- newLength = GCPnts_AbscissaPoint::Length( curve,
+ newLength = GCPnts_AbscissaPoint::Length( curve,
nodeDataVec.front().param,
nodeDataVec.back().param);
for ( size_t iP = 1; iP < nodeDataVec.size(); ++iP )
const TopoDS_Edge& E,
const TopoDS_Vertex& V)
{
+ if ( _noShrinkVert.count( getMeshDS()->ShapeToIndex( V )))
+ return false;
+
TopoDS_Shape hypAssignedTo;
if ( const StdMeshers_ViscousLayers2D* vlHyp = findHyp( *_mesh, adjFace, &hypAssignedTo ))
{
if ( !L._advancable ) continue;
// replace an inactive (1st) _LayerEdge with an active one of a neighbour _PolyLine
- size_t iLE = 0, nbLE = L._lEdges.size();
+ //size_t iLE = 0, nbLE = L._lEdges.size();
const bool leftEdgeShared = L.IsCommonEdgeShared( *L._leftLine );
const bool rightEdgeShared = L.IsCommonEdgeShared( *L._rightLine );
if ( /*!L._leftLine->_advancable &&*/ leftEdgeShared )
{
L._lEdges[0] = L._leftLine->_lEdges.back();
- iLE += int( !L._leftLine->_advancable );
+ //iLE += int( !L._leftLine->_advancable );
}
if ( !L._rightLine->_advancable && rightEdgeShared )
{
L._lEdges.back() = L._rightLine->_lEdges[0];
- --nbLE;
+ //--nbLE;
}
// limit length of neighbour _LayerEdge's to avoid sharp change of layers thickness
// cerr << "import smesh" << endl << "mesh = smesh.Mesh()"<< endl;
// calculate intermediate UV on _LayerEdge's ( _LayerEdge::_uvRefined )
+ size_t iLE = 0, nbLE = L._lEdges.size();
+ if ( ! L._lEdges[0]._uvRefined.empty() ) ++iLE;
+ if ( ! L._lEdges.back()._uvRefined.empty() ) --nbLE;
for ( ; iLE < nbLE; ++iLE )
{
_LayerEdge& LE = L._lEdges[iLE];
// Create layers of faces
+ const TopoDS_Vertex& V1 = L._wire->FirstVertex( L._edgeInd );
+ const TopoDS_Vertex& V2 = L._wire->LastVertex ( L._edgeInd );
+ const int v1ID = getMeshDS()->ShapeToIndex( V1 );
+ const int v2ID = getMeshDS()->ShapeToIndex( V2 );
+ const bool isShrinkableL = ! _noShrinkVert.count( v1ID );
+ const bool isShrinkableR = ! _noShrinkVert.count( v2ID );
+
bool hasLeftNode = ( !L._leftLine->_rightNodes.empty() && leftEdgeShared );
bool hasRightNode = ( !L._rightLine->_leftNodes.empty() && rightEdgeShared );
bool hasOwnLeftNode = ( !L._leftNodes.empty() );
bool hasOwnRightNode = ( !L._rightNodes.empty() );
bool isClosedEdge = ( outerNodes.front() == outerNodes.back() );
size_t iS,
- iN0 = ( hasLeftNode || hasOwnLeftNode || isClosedEdge ),
- nbN = innerNodes.size() - ( hasRightNode || hasOwnRightNode );
+ iN0 = ( hasLeftNode || hasOwnLeftNode || isClosedEdge || !isShrinkableL ),
+ nbN = innerNodes.size() - ( hasRightNode || hasOwnRightNode || !isShrinkableR);
L._leftNodes .reserve( _hyp->GetNumberLayers() );
L._rightNodes.reserve( _hyp->GetNumberLayers() );
int cur = 0, prev = -1; // to take into account orientation of _face
if ( hasOwnRightNode ) innerNodes.back() = L._rightNodes[ iF ];
else if ( hasRightNode ) innerNodes.back() = L._rightLine->_leftNodes[ iF ];
if ( isClosedEdge ) innerNodes.front() = innerNodes.back(); // circle
- if ( !hasOwnLeftNode ) L._leftNodes.push_back( innerNodes.front() );
- if ( !hasOwnRightNode ) L._rightNodes.push_back( innerNodes.back() );
+ if ( !isShrinkableL ) innerNodes.front() = outerNodes.front();
+ if ( !isShrinkableR ) innerNodes.back() = outerNodes.back();
+ if ( !hasOwnLeftNode ) L._leftNodes.push_back( innerNodes.front() );
+ if ( !hasOwnRightNode ) L._rightNodes.push_back( innerNodes.back() );
// create faces
for ( size_t i = 1; i < innerNodes.size(); ++i )
} // loop on _PolyLine's
+ // re-compute FACEs whose mesh was removed by shrink()
+ for ( size_t i = 0; i < _clearedFaces.size(); ++i )
+ {
+ SMESH_subMesh* sm = _mesh->GetSubMesh( _clearedFaces[i] );
+ if ( sm->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE )
+ sm->ComputeStateEngine( SMESH_subMesh::COMPUTE );
+ }
+
return true;
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "StdMeshersGUI_StdHypothesisCreator.h"
#include "StdMeshersGUI_NbSegmentsCreator.h"
#include "StdMeshersGUI_CartesianParamCreator.h"
+#include "StdMeshersGUI_QuadrangleParamWdg.h"
//=============================================================================
/*! GetHypothesisCreator
return new StdMeshersGUI_NbSegmentsCreator();
else if ( aHypType=="CartesianParameters3D" )
return new StdMeshersGUI_CartesianParamCreator( aHypType );
+ else if ( aHypType=="QuadrangleParams" )
+ return new StdMeshersGUI_QuadrangleParamCreator( aHypType );
else
return new StdMeshersGUI_StdHypothesisCreator( aHypType );
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// SMESH includes
#include "StdMeshersGUI_CartesianParamCreator.h"
-#include <SMESHGUI.h>
-#include <SMESHGUI_Utils.h>
-#include <SMESHGUI_HypothesesUtils.h>
-#include <SMESHGUI_SpinBox.h>
+#include "SMESHGUI.h"
+#include "SMESHGUI_Utils.h"
+#include "SMESHGUI_VTKUtils.h"
+#include "SMESHGUI_HypothesesUtils.h"
+#include "SMESHGUI_SpinBox.h"
+#include "SMESHGUI_MeshEditPreview.h"
// IDL includes
#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
// SALOME GUI includes
-#include <SalomeApp_Tools.h>
-#include <SalomeApp_IntSpinBox.h>
+#include <LightApp_SelectionMgr.h>
#include <QtxComboBox.h>
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SUIT_ResourceMgr.h>
+#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_Tools.h>
+
+#include <GEOMBase.h>
+
+#include <BRepBndLib.hxx>
+#include <Bnd_Box.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <TopoDS_Shape.hxx>
+#include <gp_Pnt.hxx>
// Qt includes
#include <QAbstractItemModel>
#include <QApplication>
#include <QButtonGroup>
+#include <QCheckBox>
#include <QGridLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QLineEdit>
#include <QListWidget>
#include <QModelIndex>
+#include <QPushButton>
#include <QRadioButton>
#include <QString>
#include <QStyleOptionViewItem>
+#include <QTabWidget>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QVBoxLayout>
-#include <QPushButton>
-#include <QTabWidget>
#define SPACING 6
#define MARGIN 11
myStepSpin->SetValue( myStep = 1. );
// 3) Coodrinates/Spacing group
- QFrame* csFrame = new QFrame( this );
+ QFrame* csFrame = new QFrame( this );
QVBoxLayout* scLay = new QVBoxLayout( csFrame );
scLay->setMargin( 0 );
scLay->setSpacing( SPACING );
connect( myInsertBtn, SIGNAL( clicked() ), SLOT( onInsert() ));
connect( myDeleteBtn, SIGNAL( clicked() ), SLOT( onDelete() ));
connect( myModeGroup, SIGNAL( buttonClicked ( int )), SLOT( onMode(int)));
+ connect( myModeGroup, SIGNAL( buttonClicked ( int )), SIGNAL( gridModeChanged(int)));
connect( mySpacingTreeWdg, SIGNAL( itemSelectionChanged()), SLOT( updateButtons() ));
connect( myCoordList, SIGNAL( itemSelectionChanged()), SLOT( updateButtons() ));
connect( myStepSpin, SIGNAL( valueChanged(double)), SLOT( onStepChange() ));
}
+ //================================================================================
+ /*!
+ * \brief SLOT onInsert
+ */
+ //================================================================================
+
void GridAxisTab::onInsert()
{
if ( isGridBySpacing() )
updateButtons();
}
+ //================================================================================
+ /*!
+ * \brief SLOT onDelete
+ */
+ //================================================================================
+
void GridAxisTab::onDelete()
{
if ( isGridBySpacing() )
updateButtons();
}
+ //================================================================================
+ /*!
+ * \brief SLOT onMode
+ */
+ //================================================================================
+
void GridAxisTab::onMode(int isSpacing)
{
mySpacingTreeWdg->setShown( isSpacing );
updateButtons();
}
+ //================================================================================
+ /*!
+ * \brief SLOT onStepChange
+ */
+ //================================================================================
+
void GridAxisTab::onStepChange()
{
if ( fabs( myStepSpin->GetValue() ) < 1e-100 )
myStep = myStepSpin->GetValue();
}
+ //================================================================================
+ /*!
+ * \brief Enables/disables buttons
+ */
+ //================================================================================
+
void GridAxisTab::updateButtons()
{
bool insertEnable = false, deleteEnable = false;
myDeleteBtn->setEnabled( deleteEnable );
}
+ //================================================================================
+ /*!
+ * \brief Inserts coordinates into myCoordList
+ */
+ //================================================================================
+
void GridAxisTab::setCoordinates( SMESH::double_array_var coords )
{
myCoordList->clear();
onMode( COORD_BUT );
}
+ //================================================================================
+ /*!
+ * \brief Sets spacing got from hypothesis
+ */
+ //================================================================================
+
void GridAxisTab::setSpacing( SMESH::string_array_var funs, SMESH::double_array_var points )
{
mySpacingTreeWdg->clear();
onMode( SPACING_BUT );
}
+ //================================================================================
+ /*!
+ * \brief Checks grid definintion mode
+ */
+ //================================================================================
+
bool GridAxisTab::isGridBySpacing() const
{
return ( myModeGroup->checkedId() == SPACING_BUT );
}
+ //================================================================================
+ /*!
+ * \brief Returns coordinates to set to a hypothesis
+ */
+ //================================================================================
+
SMESH::double_array* GridAxisTab::getCoordinates()
{
SMESH::double_array_var coords = new SMESH::double_array;
return coords._retn();
}
+ //================================================================================
+ /*!
+ * \brief Returms spacing to set to a hypothesis
+ */
+ //================================================================================
+
void GridAxisTab::getSpacing(SMESH::string_array_out funs,
SMESH::double_array_out points) const
{
}
+ //================================================================================
+ /*!
+ * \brief Verifies parameters
+ */
+ //================================================================================
+
bool GridAxisTab::checkParams(QString& msg, SMESH::SMESH_Hypothesis_var& hyp) const
{
if ( isGridBySpacing() )
return true;
}
+ //================================================================================
+ /*!
+ * \brief LineDelegate constructor
+ */
+ //================================================================================
+
LineDelegate::LineDelegate( QWidget* parent ):
QItemDelegate( parent ),
mySpacingTreeWdg( qobject_cast<QTreeWidget*>( parent )),
{
}
+ //================================================================================
+ /*!
+ * \brief Creates an editor depending on a current item
+ */
+ //================================================================================
+
QWidget* LineDelegate::createEditor( QWidget* parent,
const QStyleOptionViewItem& opt,
const QModelIndex& index) const
return w;
}
+ //================================================================================
+ /*!
+ * \brief Limit value range in the spin of a neighbor range
+ */
+ //================================================================================
+
void LineDelegate::setEditorData ( QWidget * editor, const QModelIndex & index ) const
{
if ( mySpacingTreeWdg && index.column() == 0 )
QItemDelegate::setEditorData( editor, index );
}
}
+
+ //================================================================================
+ /*!
+ * \brief
+ */
+ //================================================================================
+
void LineDelegate::setModelData( QWidget* editor,
QAbstractItemModel* model,
const QModelIndex& index ) const
} // namespace StdMeshersGUI
+namespace
+{
+ const double theAngTol = M_PI / 180.;
+
+ //================================================================================
+ /*!
+ * \brief Set variables to groups of spin boxes
+ */
+ //================================================================================
+
+ void setText( const QString& vars, SMESHGUI_SpinBox** spins )
+ {
+ QStringList varList = vars.split( ':' );
+ for ( int i = 0; i < 3 && i < varList.count(); ++i )
+ if ( !varList[i].isEmpty() )
+ spins[i]->setText( varList[i] );
+ }
+
+ //================================================================================
+ /*!
+ * \brief Computes more 2 axes by one
+ * \param [in] iOk - index of a given axis
+ * \param [in,out] dirs - directions of 3 axes
+ */
+ //================================================================================
+
+ void get3Dirs( int iOk, gp_XYZ dirs[3] )
+ {
+ dirs[ ( iOk+1 ) % 3 ] = dirs[ iOk ];
+
+ if ( Abs( dirs[ iOk ].Y() ) < 1e-100 &&
+ Abs( dirs[ iOk ].Z() ) < 1e-100 )
+ // dirs[ iOk ] || OX
+ dirs[ ( iOk+1 ) % 3 ].SetY( dirs[ iOk ].Y() + 1. );
+ else
+ dirs[ ( iOk+1 ) % 3 ].SetX( dirs[ iOk ].X() + 1. );
+
+ dirs[( iOk+2 ) % 3] = dirs[ iOk ] ^ dirs[ ( iOk+1 ) % 3 ];
+ dirs[( iOk+1 ) % 3] = dirs[ ( iOk+2 ) % 3 ] ^ dirs[ iOk ];
+ }
+}
+
+//================================================================================
+/*!
+ * \brief StdMeshersGUI_CartesianParamCreator constructor
+ */
+//================================================================================
StdMeshersGUI_CartesianParamCreator::StdMeshersGUI_CartesianParamCreator(const QString& aHypType)
: StdMeshersGUI_StdHypothesisCreator( aHypType ),
myAxisTabs[0] = 0;
myAxisTabs[1] = 0;
myAxisTabs[2] = 0;
+
+ myAxesPreview = new SMESHGUI_MeshEditPreview( SMESH::GetViewWindow( SMESHGUI::GetSMESHGUI() ));
+ myAxesPreview->SetArrowShapeAndNb( /*nbArrows=*/3,
+ /*headLength=*/0.1,
+ /*headRadius=*/0.01,
+ /*start=*/0.,
+ /*labels=*/"XYZ");
+
+ myDirTic[0] = myDirTic[1] = myDirTic[2] = 0;
}
+//================================================================================
+/*!
+ * \brief StdMeshersGUI_CartesianParamCreator destructor
+ */
+//================================================================================
+
StdMeshersGUI_CartesianParamCreator::~StdMeshersGUI_CartesianParamCreator()
{
if ( myAxisTabs[0] ) delete myAxisTabs[0];
myAxisTabs[0] = 0;
myAxisTabs[1] = 0;
myAxisTabs[2] = 0;
+
+ delete myAxesPreview;
}
+//================================================================================
+/*!
+ * \brief Validate parameters
+ */
+//================================================================================
+
bool StdMeshersGUI_CartesianParamCreator::checkParams( QString& msg ) const
{
if( !SMESHGUI_GenericHypothesisCreator::checkParams( msg ) )
if ( !myAxisTabs[1]->checkParams( msg, hyp )) return false;
if ( !myAxisTabs[2]->checkParams( msg, hyp )) return false;
+ StdMeshersGUI_CartesianParamCreator* me = (StdMeshersGUI_CartesianParamCreator*) this;
+ if ( !me->updateAxesPreview() )
+ {
+ msg = tr("INVALID_AXES_DIR");
+ return false;
+ }
+
return true;
}
+//================================================================================
+/*!
+ * \brief Create widgets
+ */
+//================================================================================
+
QFrame* StdMeshersGUI_CartesianParamCreator::buildFrame()
{
QFrame* fr = new QFrame();
argGroupLayout->addWidget( myThreshold, row, 1 );
row++;
- // 2) Grid definition
+ // 2) "Implement edges"
+ myAddEdges = new QCheckBox( tr("ADD_EDGES"), GroupC1 );
+ argGroupLayout->addWidget( myAddEdges, row, 0, 1, 2 );
+ row++;
+
+ // 3) Grid definition
QTabWidget* tabWdg = new QTabWidget( fr );
myAxisTabs[ 0 ] = new StdMeshersGUI::GridAxisTab( tabWdg, 0 );
myAxisTabs[ 1 ] = new StdMeshersGUI::GridAxisTab( tabWdg, 1 );
tabWdg->addTab( myAxisTabs[ 1 ], tr( "AXIS_Y" ) );
tabWdg->addTab( myAxisTabs[ 2 ], tr( "AXIS_Z" ) );
argGroupLayout->addWidget( tabWdg, row, 0, 1, 2 );
+ row++;
+
+ QPixmap aPix = SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT"));
+
+ // 4) Fixed point
+ myFixedPointGrp = new QGroupBox( tr("FIXED_POINT"), fr );
+ myFixedPointGrp->setCheckable( true );
+ //QPushButton* pointBtn = new QPushButton( QIcon(aPix), "", myFixedPointGrp );
+ QLabel* pXLbl = new QLabel( tr("SMESH_X"), myFixedPointGrp );
+ QLabel* pYLbl = new QLabel( tr("SMESH_Y"), myFixedPointGrp );
+ QLabel* pZLbl = new QLabel( tr("SMESH_Z"), myFixedPointGrp );
+ for ( int i = 0; i < 3; ++i )
+ {
+ myPointSpin[i] = new SMESHGUI_SpinBox( myFixedPointGrp );
+ myPointSpin[i]->RangeStepAndValidator( -1e20, 1e20, 10 );
+ myPointSpin[i]->SetValue( 0. );
+ }
+ QHBoxLayout* aFixedPointLay = new QHBoxLayout( myFixedPointGrp );
+ aFixedPointLay->addWidget( pXLbl, 0, Qt::AlignRight );
+ aFixedPointLay->addWidget( myPointSpin[0], 1 );
+ aFixedPointLay->addWidget( pYLbl, 0, Qt::AlignRight );
+ aFixedPointLay->addWidget( myPointSpin[1], 1 );
+ aFixedPointLay->addWidget( pZLbl, 0, Qt::AlignRight );
+ aFixedPointLay->addWidget( myPointSpin[2], 1 );
+ argGroupLayout->addWidget( myFixedPointGrp, row, 0, 1, 2 );
+ row++;
+
+ // 5) Axes direction
+ QGroupBox* axesDirGrp = new QGroupBox( tr("AXES_DIRECTION"), fr );
+ QGridLayout* axisDirLay = new QGridLayout( axesDirGrp );
+ axisDirLay->setSpacing( SPACING );
+ axisDirLay->setMargin( MARGIN );
+ axisDirLay->setColumnStretch( 0, 2 );
+ // is orthogonal
+ myOrthogonalChk = new QCheckBox( tr("ORTHOGONAL_AXES"), axesDirGrp );
+ axisDirLay->addWidget( myOrthogonalChk, 0, 0, 1, 7 );
+ // axes
+ QLabel* axisLbl[3];
+ axisLbl[0] = new QLabel( tr( "AXIS_X"), axesDirGrp );
+ axisLbl[1] = new QLabel( tr( "AXIS_Y"), axesDirGrp );
+ axisLbl[2] = new QLabel( tr( "AXIS_Z"), axesDirGrp );
+ QLabel* dLbl[3];
+ myAxisBtnGrp = new QButtonGroup( axesDirGrp );
+ SMESHGUI_SpinBox** spins[3] = { &myXDirSpin[0], &myYDirSpin[0], &myZDirSpin[0] };
+ for ( int i = 0; i < 3; ++i )
+ {
+ QPushButton* axisBtn = new QPushButton( QIcon(aPix), "", axesDirGrp );
+ axisBtn->setCheckable( true );
+ myAxisBtnGrp->addButton( axisBtn, i );
+ myXDirSpin[i] = new SMESHGUI_SpinBox( axesDirGrp );
+ myYDirSpin[i] = new SMESHGUI_SpinBox( axesDirGrp );
+ myZDirSpin[i] = new SMESHGUI_SpinBox( axesDirGrp );
+ myXDirSpin[i]->RangeStepAndValidator( -1, 1, 0.1, "len_tol_precision" );
+ myYDirSpin[i]->RangeStepAndValidator( -1, 1, 0.1, "len_tol_precision" );
+ myZDirSpin[i]->RangeStepAndValidator( -1, 1, 0.1, "len_tol_precision" );
+ dLbl[0] = new QLabel( tr("SMESH_DX"), axesDirGrp );
+ dLbl[1] = new QLabel( tr("SMESH_DY"), axesDirGrp );
+ dLbl[2] = new QLabel( tr("SMESH_DZ"), axesDirGrp );
+ axisDirLay->addWidget( axisLbl[i], i+1, 0 );
+ axisDirLay->addWidget( axisBtn, i+1, 1 );
+ axisDirLay->addWidget( dLbl[0], i+1, 2 );
+ axisDirLay->addWidget( dLbl[1], i+1, 4 );
+ axisDirLay->addWidget( dLbl[2], i+1, 6 );
+ axisDirLay->addWidget( myXDirSpin[i], 1, 3+i*2 );
+ axisDirLay->addWidget( myYDirSpin[i], 2, 3+i*2 );
+ axisDirLay->addWidget( myZDirSpin[i], 3, 3+i*2 );
+ }
+ axisDirLay->setColumnStretch( 3, 10 );
+ axisDirLay->setColumnStretch( 5, 10 );
+ axisDirLay->setColumnStretch( 7, 10 );
+
+ // set optimal axes
+ QPushButton* optimBtn = new QPushButton( tr("OPTIMAL_AXES"), axesDirGrp );
+ QPushButton* resetBtn = new QPushButton( tr("RESET_AXES"), axesDirGrp );
+ axisDirLay->addWidget( optimBtn, 4, 0, 1, 4 );
+ axisDirLay->addWidget( resetBtn, 4, 4, 1, 4 );
+
+ argGroupLayout->addWidget( axesDirGrp, row, 0, 1, 2 );
+ row++;
+
+ // Signals
+
+ LightApp_SelectionMgr* selMgr = SMESH::GetSelectionMgr( SMESHGUI::GetSMESHGUI() );
+
+ connect( selMgr, SIGNAL( currentSelectionChanged()), SLOT( onSelectionChange()));
+ connect( myOrthogonalChk, SIGNAL( toggled(bool)), SLOT( onOrthogonalAxes(bool)));
+ connect( optimBtn, SIGNAL( clicked(bool)), SLOT( onOptimalAxes(bool)));
+ connect( resetBtn, SIGNAL( clicked(bool)), SLOT( onResetAxes(bool)));
+ for ( int i = 0; i < 3; ++i )
+ {
+ connect( myXDirSpin[i], SIGNAL(valueChanged (const QString&)),
+ this, SLOT (onAxisDirChange(const QString&)) );
+ connect( myYDirSpin[i], SIGNAL(valueChanged (const QString&)),
+ this, SLOT (onAxisDirChange(const QString&)) );
+ connect( myZDirSpin[i], SIGNAL(valueChanged (const QString&)),
+ this, SLOT (onAxisDirChange(const QString&)) );
+ connect( myAxisTabs[i], SIGNAL(gridModeChanged(int)),
+ this, SLOT (onGridModeChanged(int)));
+ }
+
+ // Show axes
+ myAxesLen = 120; // default trihedron size is 100
+ myOrigin[0] = myOrigin[1] = myOrigin[2] = 0.;
+ TopoDS_Shape shape;
+ QString shapeEntry = getMainShapeEntry();
+ if ( !shapeEntry.isEmpty() )
+ {
+ // find origin
+ Handle(SALOME_InteractiveObject) io =
+ new SALOME_InteractiveObject( shapeEntry.toStdString().c_str(), "GEOM" );
+ GEOM::GEOM_Object_var geomObj = SMESH::IObjectToInterface<GEOM::GEOM_Object>( io );
+ if ( GEOMBase::GetShape( geomObj, shape ) && !shape.IsNull())
+ {
+ Bnd_Box box;
+ BRepBndLib::Add( shape, box );
+ double max[3];
+ if ( !box.IsVoid() )
+ {
+ box.Get( myOrigin[0], myOrigin[1], myOrigin[2], max[0], max[1], max[2] );
+ gp_Pnt o( myOrigin[0], myOrigin[1], myOrigin[2] );
+ gp_Pnt x( max[0], max[1], max[2] );
+ myAxesLen = o.Distance( x );
+
+ double step = 1e20;
+ while ( step > myAxesLen / 5 )
+ step /= 10;
+ myPointSpin[0]->SetStep( step );
+ myPointSpin[1]->SetStep( step );
+ myPointSpin[2]->SetStep( step );
+ }
+ }
+ }
+ myAxisBtnGrp->button(0)->setEnabled( !shape.IsNull() );
+ myAxisBtnGrp->button(1)->setEnabled( !shape.IsNull() );
+ myAxisBtnGrp->button(2)->setEnabled( !shape.IsNull() );
+ optimBtn->setEnabled( !shape.IsNull() );
+
+ updateAxesPreview();
return fr;
}
+//================================================================================
+/*!
+ * \brief Tranfer parameters from hypothesis to widgets
+ */
+//================================================================================
+
void StdMeshersGUI_CartesianParamCreator::retrieveParams() const
{
StdMeshers::StdMeshers_CartesianParameters3D_var h =
else
myThreshold->setText( varName );
+ myAddEdges->setChecked( h->GetToAddEdges() );
+
+ // grid definition
for ( int ax = 0; ax < 3; ++ax )
{
if ( h->IsGridBySpacing( ax ))
myAxisTabs[ax]->setCoordinates( coords );
}
}
+
+ // fixed point
+ SMESH::PointStruct fp;
+ StdMeshersGUI_CartesianParamCreator* me = (StdMeshersGUI_CartesianParamCreator*) this;
+ if ( h->GetFixedPoint( fp ))
+ {
+ me->myPointSpin[0]->SetValue( fp.x );
+ me->myPointSpin[1]->SetValue( fp.y );
+ me->myPointSpin[2]->SetValue( fp.z );
+ setText( getVariableName("GetFixedPoint"), &me->myPointSpin[0] );
+ myFixedPointGrp->setChecked( true );
+ }
+ else
+ {
+ myFixedPointGrp->setChecked( false );
+ }
+
+ // axes directions
+ SMESHGUI_SpinBox** spins[3] = { &me->myXDirSpin[0], &me->myYDirSpin[0], &me->myZDirSpin[0] };
+ SMESH::DirStruct axisDir[3];
+ h->GetAxesDirs( axisDir[0],
+ axisDir[1],
+ axisDir[2]);
+ QString vars = getVariableName("GetAxesDirs");
+ for ( int i = 0; i < 3; ++i )
+ {
+ spins[i][0]->SetValue( axisDir[i].PS.x );
+ spins[i][1]->SetValue( axisDir[i].PS.y );
+ spins[i][2]->SetValue( axisDir[i].PS.z );
+ setText( vars, spins[i] );
+
+ // cut off 3 used vars
+ if ( !vars.isEmpty() )
+ {
+ int ind = -1;
+ for ( int j = 0; j < 3; ++j )
+ if (( ind = vars.indexOf(':', ind+1 )) < 0 )
+ break;
+ if ( ind < 0 )
+ vars.clear();
+ else
+ vars.remove( 0, ind+1 );
+ }
+ }
+
if ( dlg() )
- dlg()->setMinimumSize( dlg()->minimumSizeHint().width(), dlg()->minimumSizeHint().height() );
+ dlg()->setMinimumSize( dlg()->minimumSizeHint().width(),
+ dlg()->minimumSizeHint().height() );
}
+//================================================================================
+/*!
+ * \brief Tranfer parameters from widgets to hypothesis
+ */
+//================================================================================
+
QString StdMeshersGUI_CartesianParamCreator::storeParams() const
{
StdMeshers::StdMeshers_CartesianParameters3D_var h =
if( isCreation() )
SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().constData() );
+ // threshold
h->SetVarParameter( myThreshold->text().toLatin1().constData(), "SetSizeThreshold" );
h->SetSizeThreshold( myThreshold->text().toDouble() );
+ h->SetToAddEdges( myAddEdges->isChecked() );
+ // grid
for ( int ax = 0; ax < 3; ++ax )
{
if ( myAxisTabs[ax]->isGridBySpacing())
h->SetGrid( coords, ax );
}
}
+
+ // fixed point
+ QStringList params;
+ params << myPointSpin[0]->text();
+ params << myPointSpin[1]->text();
+ params << myPointSpin[2]->text();
+ h->SetVarParameter( params.join(":").toLatin1().constData(), "SetFixedPoint" );
+ params.clear();
+
+ SMESH::PointStruct ps;
+ ps.x = myPointSpin[0]->GetValue();
+ ps.y = myPointSpin[1]->GetValue();
+ ps.z = myPointSpin[2]->GetValue();
+ h->SetFixedPoint( ps, !myFixedPointGrp->isEnabled() || !myFixedPointGrp->isChecked() );
+
+ // axes directions
+ SMESHGUI_SpinBox* const * spins[3] = { &myXDirSpin[0], &myYDirSpin[0], &myZDirSpin[0] };
+ for ( int ax = 0; ax < 3; ++ax )
+ {
+ params << spins[ax][0]->text();
+ params << spins[ax][1]->text();
+ params << spins[ax][2]->text();
+ }
+ h->SetVarParameter( params.join(":").toLatin1().constData(), "SetAxesDirs" );
+
+ SMESH::DirStruct axDir[3];
+ for ( int ax = 0; ax < 3; ++ax )
+ {
+ axDir[ax].PS.x = spins[ax][0]->GetValue();
+ axDir[ax].PS.y = spins[ax][1]->GetValue();
+ axDir[ax].PS.z = spins[ax][2]->GetValue();
+ }
+ h->SetAxesDirs( axDir[0], axDir[1], axDir[2] );
+
}
catch(const SALOME::SALOME_Exception& ex)
{
return "";
}
+//================================================================================
+/*!
+ * \brief Returns a name of help page
+ */
+//================================================================================
+
QString StdMeshersGUI_CartesianParamCreator::helpPage() const
{
return "cartesian_algo_page.html#cartesian_hyp_anchor";
}
+
+//================================================================================
+/*!
+ * \brief Show axes if they are OK
+ */
+//================================================================================
+
+bool StdMeshersGUI_CartesianParamCreator::updateAxesPreview()
+{
+ bool isOk = true;
+ gp_Ax1 axes[3];
+ SMESHGUI_SpinBox** spins[3] = { &myXDirSpin[0], &myYDirSpin[0], &myZDirSpin[0] };
+ for ( int i = 0; i < 3 && isOk; ++i )
+ {
+ gp_XYZ dir( spins[i][0]->GetValue(),
+ spins[i][1]->GetValue(),
+ spins[i][2]->GetValue());
+ if (( isOk = ( dir.Modulus() > 1e-100 )))
+ axes[i].SetDirection( gp_Dir( dir ));
+
+ axes[i].SetLocation ( gp_Pnt( myOrigin[0],
+ myOrigin[1],
+ myOrigin[2]));
+ }
+ gp_Vec norm01 = axes[0].Direction().XYZ() ^ axes[1].Direction().XYZ();
+ gp_Vec norm12 = axes[1].Direction().XYZ() ^ axes[2].Direction().XYZ();
+ if ( isOk )
+ isOk = ( !axes[0].Direction().IsParallel( axes[1].Direction(), theAngTol ) &&
+ !axes[1].Direction().IsParallel( axes[2].Direction(), theAngTol ) &&
+ !axes[2].Direction().IsParallel( axes[0].Direction(), theAngTol ) &&
+ !norm01.IsParallel( norm12, theAngTol ) );
+ if ( isOk )
+ myAxesPreview->SetArrows( axes, myAxesLen );
+
+ myAxesPreview->SetVisibility( isOk );
+
+ return isOk;
+}
+
+//================================================================================
+/*!
+ * \brief Makes axes orthogonal if necessary
+ */
+//================================================================================
+
+void StdMeshersGUI_CartesianParamCreator::onOrthogonalAxes(bool isOrtho)
+{
+ if ( !isOrtho )
+ {
+ updateAxesPreview();
+ return;
+ }
+
+ std::multimap< int, int > ageOfAxis;
+ gp_XYZ dirs[3];
+ SMESHGUI_SpinBox** spins[3] = { &myXDirSpin[0], &myYDirSpin[0], &myZDirSpin[0] };
+ int nbOk = 0, isOk;
+ for ( int iAx = 0; iAx < 3; ++iAx )
+ {
+ dirs[iAx].SetCoord( spins[iAx][0]->GetValue(),
+ spins[iAx][1]->GetValue(),
+ spins[iAx][2]->GetValue());
+ if (( isOk = ( dirs[iAx].Modulus() > 1e-100 )))
+ ageOfAxis.insert( std::make_pair( myDirTic[iAx], iAx ));
+ else
+ ageOfAxis.insert( std::make_pair( -1, iAx ));
+ nbOk += isOk;
+ }
+ switch ( nbOk )
+ {
+ case 0:
+ {
+ dirs[0].SetCoord( 1, 0, 0 );
+ dirs[1].SetCoord( 0, 1, 0 );
+ dirs[2].SetCoord( 0, 0, 1 );
+ break;
+ }
+ case 1:
+ {
+ int iOk = ageOfAxis.rbegin()->second;
+ get3Dirs( iOk, dirs );
+ break;
+ }
+ default:
+ std::multimap< int, int >::reverse_iterator ag2ax = ageOfAxis.rbegin();
+ int iOk1 = ag2ax->second;
+ int iOk2 = (++ag2ax)->second;
+ int iKo = (++ag2ax)->second;
+ if ( gp_Vec( dirs[ iOk1 ]).IsParallel( gp_Vec( dirs[ iOk2 ]), theAngTol ))
+ std::swap( iOk2, iKo );
+ if ( gp_Vec( dirs[ iOk1 ]).IsParallel( gp_Vec( dirs[ iOk2 ]), theAngTol ))
+ {
+ get3Dirs( iOk1, dirs );
+ }
+ else
+ {
+ dirs[ iKo ] = dirs[ iOk1 ] ^ dirs[ iOk2 ];
+ dirs[ iOk2 ] = dirs[ iKo ] ^ dirs[ iOk1 ];
+ if ( ( iOk1+1 ) % 3 != iOk2 )
+ dirs[ iKo ].Reverse();
+ }
+ }
+
+ for ( int iAx = 0; iAx < 3; ++iAx )
+ {
+ double size = dirs[iAx].Modulus();
+ if ( size > 1e-100 )
+ dirs[iAx] /= size;
+ for (int i = 0; i < 3; ++i )
+ {
+ bool isBlocked = spins[iAx][i]->blockSignals( true );
+ spins[iAx][i]->SetValue( dirs[iAx].Coord( i+1 ));
+ spins[iAx][i]->blockSignals( isBlocked );
+ }
+ }
+
+ updateAxesPreview();
+}
+
+//================================================================================
+/*!
+ * \brief Increment myDirTic and update the preview of axes
+ */
+//================================================================================
+
+void StdMeshersGUI_CartesianParamCreator::onAxisDirChange(const QString&)
+{
+ QObject* changedSpin = sender();
+ SMESHGUI_SpinBox** spins[3] = { &myXDirSpin[0], &myYDirSpin[0], &myZDirSpin[0] };
+ for ( int iAx = 0; iAx < 3; ++iAx )
+ if ( spins[iAx][0] == changedSpin ||
+ spins[iAx][1] == changedSpin ||
+ spins[iAx][2] == changedSpin )
+ {
+ myDirTic[ iAx ] = 1 + Max( Max( myDirTic[0], myDirTic[1] ), myDirTic[2] );
+ break;
+ }
+
+ onOrthogonalAxes( myOrthogonalChk->isChecked() );
+}
+
+//================================================================================
+/*!
+ * \brief Sets axis direction by a selected EDGE
+ */
+//================================================================================
+
+void StdMeshersGUI_CartesianParamCreator::onSelectionChange()
+{
+ int iAxis = myAxisBtnGrp->checkedId();
+ if ( iAxis < 0 )
+ return;
+
+ SALOME_ListIO aList;
+ SMESHGUI::GetSMESHGUI()->selectionMgr()->selectedObjects(aList);
+
+ TopoDS_Shape edge, shape;
+ for( SALOME_ListIteratorOfListIO anIt( aList ); anIt.More(); anIt.Next() )
+ {
+ GEOM::GEOM_Object_var go = SMESH::IObjectToInterface<GEOM::GEOM_Object>( anIt.Value() );
+ if ( GEOMBase::GetShape( go, shape ) && shape.ShapeType() == TopAbs_EDGE )
+ {
+ if ( !edge.IsNull() )
+ return; // several EDGEs selected
+ edge = shape;
+ }
+ }
+ if ( edge.IsNull() )
+ return;
+
+ TopoDS_Shape vv[2];
+ TopoDS_Iterator vIt( edge );
+ for ( ; vIt.More() && vv[1].IsNull(); vIt.Next() )
+ vv[ !vv[0].IsNull() ] = vIt.Value();
+
+ gp_Pnt pp[2];
+ if ( !GEOMBase::VertexToPoint( vv[0], pp[0] ) ||
+ !GEOMBase::VertexToPoint( vv[1], pp[1] ))
+ return;
+
+ SMESHGUI_SpinBox** spins[3] = { &myXDirSpin[0], &myYDirSpin[0], &myZDirSpin[0] };
+
+ gp_Vec newDir( pp[0], pp[1] );
+ gp_Vec curDir( spins[iAxis][0]->GetValue(),
+ spins[iAxis][1]->GetValue(),
+ spins[iAxis][2]->GetValue());
+ if ( newDir * curDir < 0 )
+ newDir.Reverse();
+
+ double size = newDir.Magnitude();
+ if ( size < 1e-100 )
+ return;
+ newDir /= size;
+
+ for (int i = 0; i < 3; ++i )
+ {
+ bool isBlocked = spins[iAxis][i]->blockSignals( true );
+ spins[iAxis][i]->SetValue( newDir.Coord( i+1 ));
+ spins[iAxis][i]->blockSignals( isBlocked );
+ }
+ myDirTic[ iAxis ] = 1 + Max( Max( myDirTic[0], myDirTic[1] ), myDirTic[2] );
+
+ onOrthogonalAxes( myOrthogonalChk->isChecked() );
+}
+
+//================================================================================
+/*!
+ * \brief Sets axes at which number of hexahedra is maximal
+ */
+//================================================================================
+
+void StdMeshersGUI_CartesianParamCreator::onOptimalAxes(bool)
+{
+ StdMeshers::StdMeshers_CartesianParameters3D_var h =
+ StdMeshers::StdMeshers_CartesianParameters3D::_narrow( hypothesis() );
+ if ( h->_is_nil() )
+ return;
+
+ QString shapeEntry = getMainShapeEntry();
+ if ( shapeEntry.isEmpty() )
+ return;
+
+ Handle(SALOME_InteractiveObject) io =
+ new SALOME_InteractiveObject( shapeEntry.toStdString().c_str(), "GEOM" );
+ GEOM::GEOM_Object_var geomObj = SMESH::IObjectToInterface<GEOM::GEOM_Object>( io );
+ if ( geomObj->_is_nil() )
+ return;
+
+ SMESH::DirStruct axDirs[3];
+ h->ComputeOptimalAxesDirs( geomObj,
+ myOrthogonalChk->isChecked(),
+ axDirs[0],
+ axDirs[1],
+ axDirs[2]);
+
+ SMESHGUI_SpinBox** spins[3] = { &myXDirSpin[0], &myYDirSpin[0], &myZDirSpin[0] };
+ for ( int iAx = 0; iAx < 3; ++iAx )
+ {
+ double coords[3] = { axDirs[iAx].PS.x, axDirs[iAx].PS.y, axDirs[iAx].PS.z };
+ for (int i = 0; i < 3; ++i )
+ {
+ bool isBlocked = spins[iAx][i]->blockSignals( true );
+ spins[iAx][i]->SetValue( coords[ i ]);
+ spins[iAx][i]->blockSignals( isBlocked );
+ }
+ }
+ updateAxesPreview();
+}
+
+//================================================================================
+/*!
+ * \brief Sets axes || to the axes of global CS
+ */
+//================================================================================
+
+void StdMeshersGUI_CartesianParamCreator::onResetAxes(bool)
+{
+ SMESHGUI_SpinBox** spins[3] = { &myXDirSpin[0], &myYDirSpin[0], &myZDirSpin[0] };
+ for ( int iAx = 0; iAx < 3; ++iAx )
+ {
+ for (int i = 0; i < 3; ++i )
+ {
+ bool isBlocked = spins[iAx][i]->blockSignals( true );
+ spins[iAx][i]->SetValue( iAx == i ? 1. : 0. );
+ spins[iAx][i]->blockSignals( isBlocked );
+ }
+ myDirTic[iAx] = 0;
+ }
+ updateAxesPreview();
+}
+
+//================================================================================
+/*!
+ * \brief SLOT called when the grid definintion mode changes
+ */
+//================================================================================
+
+void StdMeshersGUI_CartesianParamCreator::onGridModeChanged(int)
+{
+ bool haveSpacing = ( myAxisTabs[0]->isGridBySpacing() ||
+ myAxisTabs[1]->isGridBySpacing() ||
+ myAxisTabs[2]->isGridBySpacing() );
+
+ myFixedPointGrp->setEnabled( haveSpacing );
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <QFrame>
#include <QItemDelegate>
-class SMESHGUI_SpinBox;
-class QLineEdit;
+class QAbstractItemModel;
class QButtonGroup;
-class QTreeWidgetItem;
-class QString;
-class QWidget;
-class QTreeWidget;
+class QCheckBox;
+class QGroupBox;
+class QLineEdit;
class QListWidget;
-class QStyleOptionViewItem;
-class QModelIndex;
-class QAbstractItemModel;
class QListWidgetItem;
+class QModelIndex;
+class QString;
+class QStyleOptionViewItem;
+class QTreeWidget;
+class QTreeWidgetItem;
+class QWidget;
+class SMESHGUI_MeshEditPreview;
+class SMESHGUI_SpinBox;
namespace StdMeshersGUI
{
SMESH::double_array* getCoordinates();
void getSpacing(SMESH::string_array_out funs, SMESH::double_array_out points) const;
+ signals:
+ void gridModeChanged(int);
+
private slots:
void onInsert();
void onDelete();
StdMeshersGUI_CartesianParamCreator( const QString& aHypType );
virtual ~StdMeshersGUI_CartesianParamCreator();
- virtual bool checkParams( QString& ) const;
- virtual QString helpPage() const;
+ virtual bool checkParams( QString& ) const;
+ virtual QString helpPage() const;
protected:
virtual QFrame* buildFrame();
virtual void retrieveParams() const;
virtual QString storeParams() const;
+private slots:
+ bool updateAxesPreview();
+ void onOrthogonalAxes(bool);
+ void onAxisDirChange(const QString&);
+ void onSelectionChange();
+ void onOptimalAxes(bool);
+ void onResetAxes(bool);
+ void onGridModeChanged(int);
+
private:
QLineEdit* myName;
SMESHGUI_SpinBox* myThreshold;
+ QCheckBox* myAddEdges;
+
StdMeshersGUI::GridAxisTab* myAxisTabs[3];
+ QGroupBox* myFixedPointGrp;
+ SMESHGUI_SpinBox* myPointSpin[3];
+ QCheckBox* myOrthogonalChk;
+ QButtonGroup* myAxisBtnGrp;
+ SMESHGUI_SpinBox* myXDirSpin[3];
+ SMESHGUI_SpinBox* myYDirSpin[3];
+ SMESHGUI_SpinBox* myZDirSpin[3];
+ SMESHGUI_MeshEditPreview* myAxesPreview;
+ double myOrigin[3];
+ double myAxesLen;
+ int myDirTic[3];
};
#endif // STDMESHERSGUI_CartesianParamCreator_H
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "StdMeshersGUI_QuadrangleParamWdg.h"
#include "SMESHGUI.h"
+#include "SMESHGUI_SpinBox.h"
+#include "StdMeshersGUI_SubShapeSelectorWdg.h"
-#include "SUIT_ResourceMgr.h"
+#include <GEOMBase.h>
+#include <LightApp_SelectionMgr.h>
+#include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SUIT_ResourceMgr.h>
// Qt includes
#include <QButtonGroup>
-#include <QRadioButton>
-#include <QLabel>
+#include <QFrame>
#include <QGridLayout>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QListWidget>
+#include <QListWidgetItem>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QTreeWidget>
+#include <QVBoxLayout>
// IDL includes
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SMESH_BasicHypothesis)
+#include CORBA_CLIENT_HEADER(GEOM_Gen)
+
#define SPACING 6
-#define MARGIN 0
+#define MARGIN 11
+
+enum { TAB_TRANSITION, TAB_VERTEX, TAB_ENF_POINTS };
+
+//================================================================================
+// function : Constructor
+// purpose :
+//================================================================================
+
+StdMeshersGUI_QuadrangleParamCreator::StdMeshersGUI_QuadrangleParamCreator(const QString& aHypType)
+ : StdMeshersGUI_StdHypothesisCreator( aHypType )
+{
+}
+
+//=======================================================================
+//function : helpPage
+//purpose :
+//=======================================================================
+
+QString StdMeshersGUI_QuadrangleParamCreator::helpPage() const
+{
+ return "a2d_meshing_hypo_page.html#hypo_quad_params_anchor";
+}
+
+//=======================================================================
+//function : buildFrame
+//purpose :
+//=======================================================================
+
+QFrame* StdMeshersGUI_QuadrangleParamCreator::buildFrame()
+{
+ QFrame* fr = new QFrame();
+
+ QGridLayout* lay = new QGridLayout( fr );
+ lay->setMargin( MARGIN );
+ lay->setSpacing( SPACING );
+ int row = 0;
+
+ myName = 0;
+ if ( isCreation() )
+ {
+ myName = new QLineEdit( fr );
+ QLabel* nameLab = new QLabel( tr("SMESH_NAME"));
+ lay->addWidget( nameLab, row, 0 );
+ lay->addWidget( myName, row, 1 );
+ ++row;
+ }
+
+ // Transition type
+
+ myTypeWdg = new StdMeshersGUI_QuadrangleParamWdg( fr );
+
+ // Vertexes
+
+ myVertexSelWdg = new StdMeshersGUI_SubShapeSelectorWdg( fr, TopAbs_VERTEX );
+ myVertexSelWdg->layout()->setMargin( MARGIN );
+
+ // Enforced Points
+
+ QWidget* pointsFrame = new QWidget( fr );
+ QVBoxLayout* pointsLay = new QVBoxLayout( pointsFrame );
+ pointsLay->setMargin(MARGIN);
+ pointsLay->setSpacing(SPACING);
+
+ // shapes
+ QGroupBox* shapesGroup = new QGroupBox( tr("SHAPES"), pointsFrame );
+ myShapesList = new QListWidget( shapesGroup );
+ myAddShapeBut = new QPushButton( tr("SMESH_BUT_ADD"), shapesGroup );
+ QPushButton* remShapeBut = new QPushButton( tr("SMESH_BUT_REMOVE"), shapesGroup );
+ //
+ QGridLayout* shapesLay = new QGridLayout( shapesGroup );
+ shapesLay->setMargin(MARGIN);
+ shapesLay->setSpacing(SPACING);
+ shapesLay->addWidget( myShapesList, 0, 0, 3, 2 );
+ shapesLay->addWidget( myAddShapeBut, 0, 2 );
+ shapesLay->addWidget( remShapeBut, 1, 2 );
+ shapesLay->setColumnStretch( 0, 1 );
+ shapesLay->setRowStretch ( 2, 1 );
+
+ // coords
+ QGroupBox* coordsGroup = new QGroupBox( tr("POINTS"), pointsFrame );
+ myCoordsTreeWdg = new QTreeWidget( coordsGroup );
+ myCoordsTreeWdg->setColumnCount ( 3 );
+ myCoordsTreeWdg->setHeaderLabels( QStringList() << "X" << "Y" << "Z" );
+ myCoordsTreeWdg->setItemDelegate( new ItemDelegate( myCoordsTreeWdg ));
+ QPushButton* addCoordBut = new QPushButton( tr("SMESH_BUT_ADD"), coordsGroup );
+ QPushButton* remCoordBut = new QPushButton( tr("SMESH_BUT_REMOVE"), coordsGroup );
+ //
+ QGridLayout* coordsLay = new QGridLayout( coordsGroup );
+ coordsLay->setMargin(MARGIN);
+ coordsLay->setSpacing(SPACING);
+ coordsLay->addWidget( myCoordsTreeWdg, 0, 0, 3, 2 );
+ coordsLay->addWidget( addCoordBut, 0, 2 );
+ coordsLay->addWidget( remCoordBut, 1, 2 );
+ coordsLay->setColumnStretch( 0, 1 );
+ coordsLay->setRowStretch ( 2, 1 );
+
+ pointsLay->addWidget( shapesGroup );
+ pointsLay->addWidget( coordsGroup );
+
+ // Tabs
+ myTabs = new QTabWidget( fr );
+ myTabs->addTab( myTypeWdg, tr("TRANSITION"));
+ myTabs->addTab( myVertexSelWdg, tr("SMESH_BASE_VERTEX"));
+ myTabs->addTab( pointsFrame, tr("ENF_NODES"));
+
+ lay->addWidget( myTabs, row, 0, 2, 3 );
+
+ // signals
+ connect( myTypeWdg, SIGNAL( typeChanged(int)), SLOT( onTypeChanged(int)));
+ connect( myAddShapeBut, SIGNAL( clicked()), SLOT( onAddShape() ));
+ connect( remShapeBut, SIGNAL( clicked()), SLOT( onRemoveShape() ));
+ connect( addCoordBut, SIGNAL( clicked()), SLOT( onAddPoint() ));
+ connect( remCoordBut, SIGNAL( clicked()), SLOT( onRemovePoint() ));
+ connect( myTabs, SIGNAL( currentChanged(int)),SLOT( onTabChanged(int)));
+
+ LightApp_SelectionMgr* selMgr = SMESHGUI::GetSMESHGUI()->selectionMgr();
+ connect( selMgr, SIGNAL(currentSelectionChanged()), SLOT( onSelectionChanged()));
+
+ return fr;
+}
+
+//=======================================================================
+//function : retrieveParams
+//purpose :
+//=======================================================================
+
+void StdMeshersGUI_QuadrangleParamCreator::retrieveParams() const
+{
+ StdMeshers::StdMeshers_QuadrangleParams_var h =
+ StdMeshers::StdMeshers_QuadrangleParams::_narrow( initParamsHypothesis() );
+
+ // name
+ if( myName )
+ myName->setText( hypName() );
+
+ // main shape
+ myVertexSelWdg->SetMaxSize(1);
+ QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+ QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
+ if ( anEntry.isEmpty() )
+ anEntry = h->GetObjectEntry();
+ myVertexSelWdg->SetGeomShapeEntry(anEntry);
+ myVertexSelWdg->SetMainShapeEntry(aMainEntry);
+
+ if ( !isCreation())
+ {
+ // type
+ myTypeWdg->SetType(int(h->GetQuadType()));
+
+ // vertex
+ int vertID = h->GetTriaVertex();
+ if (vertID > 0) {
+ SMESH::long_array_var aVec = new SMESH::long_array;
+ aVec->length(1);
+ aVec[0] = vertID;
+ myVertexSelWdg->SetListOfIDs(aVec);
+ }
+
+ // enforced nodes
+ GEOM::ListOfGO_var shapes;
+ SMESH::nodes_array_var points;
+ h->GetEnforcedNodes( shapes, points );
+ for ( int i = 0; i < shapes->length(); ++i )
+ {
+ CORBA::String_var name = shapes[i]->GetName();
+ CORBA::String_var entry = shapes[i]->GetStudyEntry();
+ QListWidgetItem* item = new QListWidgetItem( name.in() );
+ item->setData( Qt::UserRole, entry.in() );
+ myShapesList->addItem( item );
+ }
+ for ( int i = 0; i < points->length(); ++i )
+ {
+ QTreeWidgetItem* item = new QTreeWidgetItem
+ ( QStringList()
+ << QString::number( points[i].x )
+ << QString::number( points[i].y )
+ << QString::number( points[i].z ));
+ item->setFlags( item->flags() | Qt::ItemIsEditable );
+ myCoordsTreeWdg->addTopLevelItem( item );
+ }
+ }
+ ((StdMeshersGUI_QuadrangleParamCreator*) this)->onSelectionChanged();
+}
+
+//=======================================================================
+//function : storeParams
+//purpose :
+//=======================================================================
+
+QString StdMeshersGUI_QuadrangleParamCreator::storeParams() const
+{
+ StdMeshers::StdMeshers_QuadrangleParams_var h =
+ StdMeshers::StdMeshers_QuadrangleParams::_narrow( hypothesis() );
+
+ // name
+ if( myName )
+ SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().constData() );
+
+ // transition
+ h->SetQuadType( StdMeshers::QuadType( myTypeWdg->GetType()) );
+
+ // vertex
+ if ( myVertexSelWdg->GetListSize() > 0 )
+ {
+ h->SetTriaVertex( myVertexSelWdg->GetListOfIDs()[0] ); // getlist must be called once
+ h->SetObjectEntry( myVertexSelWdg->GetMainShapeEntry() );
+ }
+ else
+ {
+ h->SetTriaVertex( -1 );
+ }
+
+ // enfored nodes
+
+ GEOM::ListOfGO_var goList = new GEOM::ListOfGO;
+ int nbShapes = 0;
+ goList->length( myShapesList->count() );
+ for ( int i = 0; i < myShapesList->count(); ++i )
+ {
+ QListWidgetItem* item = myShapesList->item(i);
+ QString entry = item->data( Qt::UserRole ).toString();
+ Handle(SALOME_InteractiveObject) io =
+ new SALOME_InteractiveObject( entry.toStdString().c_str(), "GEOM" );
+ GEOM::GEOM_Object_var go = GEOMBase::ConvertIOinGEOMObject( io );
+ if ( !go->_is_nil() )
+ goList[ nbShapes++ ] = go;
+ }
+ goList->length( nbShapes );
+
+ SMESH::nodes_array_var points = new SMESH::nodes_array;
+ points->length( myCoordsTreeWdg->topLevelItemCount() );
+ for ( int i = 0; i < myCoordsTreeWdg->topLevelItemCount(); ++i )
+ {
+ QTreeWidgetItem* item = myCoordsTreeWdg->topLevelItem( i );
+ points[i].x = item->text(0).toInt();
+ points[i].y = item->text(1).toInt();
+ points[i].z = item->text(2).toInt();
+ }
+ h->SetEnforcedNodes( goList, points );
+
+ return "";
+}
+
+//=======================================================================
+//function : onTypeChanged
+//purpose :
+//=======================================================================
+
+void StdMeshersGUI_QuadrangleParamCreator::onTypeChanged(int type)
+{
+ myTabs->setTabEnabled( TAB_ENF_POINTS, ( type != StdMeshers::QUAD_REDUCED ));
+}
+
+//=======================================================================
+//function : onAddShape
+//purpose :
+//=======================================================================
+
+void StdMeshersGUI_QuadrangleParamCreator::onAddShape()
+{
+ if ( !mySelectedShapeIO.IsNull() )
+ {
+ QListWidgetItem* item = new QListWidgetItem( mySelectedShapeIO->getName() );
+ item->setData( Qt::UserRole, mySelectedShapeIO->getEntry() );
+ myShapesList->addItem( item );
+ mySelectedShapeIO.Nullify();
+ myAddShapeBut->setEnabled( false );
+ }
+}
+
+//=======================================================================
+//function : onRemoveShape
+//purpose :
+//=======================================================================
+
+void StdMeshersGUI_QuadrangleParamCreator::onRemoveShape()
+{
+ if ( QListWidgetItem * item = myShapesList->currentItem() )
+ delete item;
+ onSelectionChanged();
+}
+
+//=======================================================================
+//function : onAddPoint
+//purpose :
+//=======================================================================
+
+void StdMeshersGUI_QuadrangleParamCreator::onAddPoint()
+{
+ QTreeWidgetItem* item = new QTreeWidgetItem( QStringList() << "0" << "0" << "0" );
+ item->setFlags( item->flags() | Qt::ItemIsEditable );
+ myCoordsTreeWdg->addTopLevelItem( item );
+}
+
+//=======================================================================
+//function : onRemovePoint
+//purpose :
+//=======================================================================
+
+void StdMeshersGUI_QuadrangleParamCreator::onRemovePoint()
+{
+ if ( myCoordsTreeWdg->topLevelItemCount() )
+ delete myCoordsTreeWdg->currentItem();
+}
+
+//=======================================================================
+//function : onSelectionChanged
+//purpose :
+//=======================================================================
+
+void StdMeshersGUI_QuadrangleParamCreator::onSelectionChanged()
+{
+ mySelectedShapeIO.Nullify();
+
+ // find a sole selected geometry
+ LightApp_SelectionMgr* selMgr = SMESHGUI::GetSMESHGUI()->selectionMgr();
+ SALOME_ListIO selList;
+ selMgr->selectedObjects( selList );
+ SALOME_ListIteratorOfListIO selIt( selList );
+ for ( ; selIt.More(); selIt.Next() )
+ {
+ GEOM::GEOM_Object_var go = GEOMBase::ConvertIOinGEOMObject( selIt.Value() );
+ if ( !go->_is_nil() )
+ {
+ if ( !mySelectedShapeIO.IsNull() )
+ {
+ mySelectedShapeIO.Nullify();
+ break;
+ }
+ mySelectedShapeIO = selIt.Value();
+ if ( !mySelectedShapeIO->getName() || !mySelectedShapeIO->getName()[0] )
+ mySelectedShapeIO.Nullify();
+ }
+ }
+ // check if a selected geometry is not already in myShapesList
+ if ( !mySelectedShapeIO.IsNull() )
+ {
+ for ( int i = 0; i < myShapesList->count(); ++i )
+ if ( myShapesList->item(i)->data( Qt::UserRole ) == mySelectedShapeIO->getEntry() )
+ {
+ mySelectedShapeIO.Nullify();
+ break;
+ }
+ }
+ myAddShapeBut->setEnabled( !mySelectedShapeIO.IsNull() );
+}
+
+//=======================================================================
+//function : onTabChanged
+//purpose :
+//=======================================================================
+
+void StdMeshersGUI_QuadrangleParamCreator::onTabChanged(int i)
+{
+ myVertexSelWdg->showPreview( i == TAB_VERTEX );
+}
//================================================================================
// function : Constructor
// purpose :
//================================================================================
+
StdMeshersGUI_QuadrangleParamWdg::StdMeshersGUI_QuadrangleParamWdg (QWidget * parent)
- : QWidget(parent),
- myType(0)
+ : QWidget(parent), myType(0)
{
myType = new QButtonGroup (this);
setLayout(typeLay);
setMinimumWidth(300);
+
+ connect( myType, SIGNAL( buttonClicked(int)), this, SIGNAL( typeChanged(int)));
}
//================================================================================
{
return myType->checkedId();
}
+
+//================================================================================
+/*!
+ \brief Constructor
+*/
+StdMeshersGUI_QuadrangleParamCreator::
+ItemDelegate::ItemDelegate( QObject* parent ) : QItemDelegate( parent )
+{
+}
+//================================================================================
+/*!
+ \brief Create item editor widget
+*/
+QWidget* StdMeshersGUI_QuadrangleParamCreator::
+ItemDelegate::createEditor( QWidget* parent,
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index ) const
+{
+ SMESHGUI_SpinBox* sb = new SMESHGUI_SpinBox( parent );
+ sb->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10 );
+ return sb;
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// SMESH includes
#include "SMESH_StdMeshersGUI.hxx"
+#include "StdMeshersGUI_StdHypothesisCreator.h"
+
+#include <SALOME_InteractiveObject.hxx>
// Qt includes
#include <QWidget>
+#include <QItemDelegate>
+
class QButtonGroup;
+class QLineEdit;
+class QListWidget;
+class QPushButton;
+class QTabWidget;
+class QTreeWidget;
+class StdMeshersGUI_QuadrangleParamWdg;
+class StdMeshersGUI_SubShapeSelectorWdg;
+
+//================================================================================
+/*!
+ * \brief Quadrangle Parameters Creator
+ */
+class STDMESHERSGUI_EXPORT StdMeshersGUI_QuadrangleParamCreator : public StdMeshersGUI_StdHypothesisCreator
+{
+ Q_OBJECT
+
+ class ItemDelegate;
+
+ public:
+ StdMeshersGUI_QuadrangleParamCreator( const QString& aHypType );
+
+ //virtual bool checkParams( QString& ) const;
+ virtual QString helpPage() const;
+
+ protected:
+ virtual QFrame* buildFrame();
+ virtual void retrieveParams() const;
+ virtual QString storeParams() const;
+
+ private slots:
+
+ void onTypeChanged(int type);
+ void onAddShape();
+ void onRemoveShape();
+ void onAddPoint();
+ void onRemovePoint();
+ void onSelectionChanged();
+ void onTabChanged(int);
+
+ private:
+ QLineEdit* myName;
+ StdMeshersGUI_QuadrangleParamWdg* myTypeWdg;
+ StdMeshersGUI_SubShapeSelectorWdg* myVertexSelWdg;
+ QListWidget* myShapesList;
+ QPushButton* myAddShapeBut;
+ QTreeWidget* myCoordsTreeWdg;
+ QTabWidget* myTabs;
+ Handle(SALOME_InteractiveObject) mySelectedShapeIO;
+};
+
+//================================================================================
+/*!
+ * \brief Transition type widget
+ */
class STDMESHERSGUI_EXPORT StdMeshersGUI_QuadrangleParamWdg : public QWidget
{
Q_OBJECT
-public:
+ public:
StdMeshersGUI_QuadrangleParamWdg (QWidget* parent = 0);
~StdMeshersGUI_QuadrangleParamWdg();
void SetType (int theType);
int GetType ();
-private:
- // Quadranle preference, Triangle preference, Reduced
- QButtonGroup* myType;
+ GEOM::ListOfGO* GetShapes();
+ SMESH::nodes_array* GetPoints();
+ void Set( GEOM::ListOfGO_var shapes, SMESH::nodes_array_var points );
+
+ signals:
+
+ void typeChanged(int);
+
+ private:
+ QButtonGroup* myType; // Quadranle preference, Triangle preference, Reduced
+};
+
+//================================================================================
+/*!
+ * \brief Item delegate for a tree widget
+ */
+class StdMeshersGUI_QuadrangleParamCreator::ItemDelegate : public QItemDelegate
+{
+ Q_OBJECT
+public:
+ ItemDelegate( QObject* );
+ QWidget* createEditor( QWidget*, const QStyleOptionViewItem&, const QModelIndex& ) const;
};
#endif // STDMESHERSGUI_QUADRANGLEPARAMWDG_H
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
h->SetObjectEntry( w->GetMainShapeEntry() );
}
}
+ else if( hypType()=="GeometricProgression" )
+ {
+ StdMeshers::StdMeshers_Geometric1D_var h =
+ StdMeshers::StdMeshers_Geometric1D::_narrow( hypothesis() );
+
+ StdMeshersGUI_SubShapeSelectorWdg* w =
+ widget< StdMeshersGUI_SubShapeSelectorWdg >( 2 );
+
+ h->SetVarParameter( params[0].text(), "SetStartLength" );
+ h->SetStartLength( params[0].myValue.toDouble() );
+ h->SetVarParameter( params[1].text(), "SetCommonRatio" );
+ h->SetCommonRatio( params[1].myValue.toDouble() );
+ if (w) {
+ h->SetReversedEdges( w->GetListOfIDs() );
+ h->SetObjectEntry( w->GetMainShapeEntry() );
+ }
+ }
else if( hypType()=="FixedPoints1D" )
{
StdMeshers::StdMeshers_FixedPoints1D_var h =
h->SetStretchFactor ( params[2].myValue.toDouble() );
if ( StdMeshersGUI_SubShapeSelectorWdg* idsWg =
- widget< StdMeshersGUI_SubShapeSelectorWdg >( 3 ))
+ widget< StdMeshersGUI_SubShapeSelectorWdg >( 4 ))
{
- h->SetIgnoreFaces( idsWg->GetListOfIDs() );
+ h->SetFaces( idsWg->GetListOfIDs(), params[3].myValue.toInt() );
}
}
else if( hypType()=="ViscousLayers2D" )
h->SetEdges( idsWg->GetListOfIDs(), params[3].myValue.toInt() );
}
}
- else if( hypType()=="QuadrangleParams" )
- {
- StdMeshers::StdMeshers_QuadrangleParams_var h =
- StdMeshers::StdMeshers_QuadrangleParams::_narrow( hypothesis() );
- StdMeshersGUI_SubShapeSelectorWdg* w1 =
- widget< StdMeshersGUI_SubShapeSelectorWdg >( 0 );
- StdMeshersGUI_QuadrangleParamWdg* w2 =
- widget< StdMeshersGUI_QuadrangleParamWdg >( 1 );
- if (w1 && w2) {
- if (w1->GetListSize() > 0) {
- h->SetTriaVertex(w1->GetListOfIDs()[0]); // getlist must be called once
- const char * entry = w1->GetMainShapeEntry();
- h->SetObjectEntry(entry);
- }
- h->SetQuadType(StdMeshers::QuadType(w2->GetType()));
- }
- }
+ // else if( hypType()=="QuadrangleParams" )
+ // {
+ // StdMeshers::StdMeshers_QuadrangleParams_var h =
+ // StdMeshers::StdMeshers_QuadrangleParams::_narrow( hypothesis() );
+ // StdMeshersGUI_SubShapeSelectorWdg* w1 =
+ // widget< StdMeshersGUI_SubShapeSelectorWdg >( 0 );
+ // StdMeshersGUI_QuadrangleParamWdg* w2 =
+ // widget< StdMeshersGUI_QuadrangleParamWdg >( 1 );
+ // if (w1 && w2) {
+ // if (w1->GetListSize() > 0) {
+ // h->SetTriaVertex(w1->GetListOfIDs()[0]); // getlist must be called once
+ // const char * entry = w1->GetMainShapeEntry();
+ // h->SetObjectEntry(entry);
+ // }
+ // h->SetQuadType(StdMeshers::QuadType(w2->GetType()));
+ // }
+ // }
}
return valueStr;
}
customWidgets()->append ( aDirectionWidget );
}
+ else if( hypType()=="GeometricProgression" )
+ {
+ StdMeshers::StdMeshers_Geometric1D_var h =
+ StdMeshers::StdMeshers_Geometric1D::_narrow( hyp );
+
+ item.myName = tr( "SMESH_START_LENGTH_PARAM" );
+ if(!initVariableName( hyp, item, "SetStartLength" ))
+ item.myValue = h->GetStartLength();
+ p.append( item );
+
+ customWidgets()->append (0);
+
+ item.myName = tr( "SMESH_COMMON_RATIO" );
+ if(!initVariableName( hyp, item, "SetCommonRatio" ))
+ item.myValue = h->GetCommonRatio();
+ p.append( item );
+
+ customWidgets()->append (0);
+
+ item.myName = tr( "SMESH_REVERSED_EDGES" );
+ p.append( item );
+
+ StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget =
+ new StdMeshersGUI_SubShapeSelectorWdg();
+ QString aGeomEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+ QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
+ if ( aGeomEntry == "" )
+ aGeomEntry = h->GetObjectEntry();
+
+ aDirectionWidget->SetGeomShapeEntry( aGeomEntry );
+ aDirectionWidget->SetMainShapeEntry( aMainEntry );
+ aDirectionWidget->SetListOfIDs( h->GetReversedEdges() );
+ aDirectionWidget->showPreview( true );
+ customWidgets()->append ( aDirectionWidget );
+ }
else if( hypType()=="FixedPoints1D" )
{
customWidgets()->append (0);
QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
+ QString aSubEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
if ( !aMainEntry.isEmpty() )
{
- item.myName = tr( "SMESH_FACES_WO_LAYERS" );
+ item.myName = tr( "TO_IGNORE_FACES_OR_NOT" );
+ p.append( item );
+
+ StdMeshersGUI_RadioButtonsGrpWdg* ignoreWdg = new StdMeshersGUI_RadioButtonsGrpWdg("");
+ ignoreWdg->setButtonLabels ( QStringList()
+ << tr("NOT_TO_IGNORE_FACES")
+ << tr("TO_IGNORE_FACES") );
+ ignoreWdg->setChecked( h->GetIsToIgnoreFaces() );
+ connect(ignoreWdg->getButtonGroup(),SIGNAL(buttonClicked(int)),this,SLOT(onValueChanged()));
+ customWidgets()->append( ignoreWdg );
+
+ item.myName =
+ tr( h->GetIsToIgnoreFaces() ? "SMESH_FACES_WO_LAYERS" : "SMESH_FACES_WITH_LAYERS" );
p.append( item );
StdMeshersGUI_SubShapeSelectorWdg* idsWg =
new StdMeshersGUI_SubShapeSelectorWdg(0,TopAbs_FACE);
- idsWg->SetGeomShapeEntry( aMainEntry );
idsWg->SetMainShapeEntry( aMainEntry );
- idsWg->SetListOfIDs( h->GetIgnoreFaces() );
+ idsWg->SetGeomShapeEntry( aSubEntry.isEmpty() ? aMainEntry : aSubEntry );
+ idsWg->SetListOfIDs( h->GetFaces() );
idsWg->showPreview( true );
customWidgets()->append ( idsWg );
}
customWidgets()->append (0);
QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
+ QString aSubEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
if ( !aMainEntry.isEmpty() )
{
item.myName = tr("TO_IGNORE_EDGES_OR_NOT");
StdMeshersGUI_SubShapeSelectorWdg* idsWg =
new StdMeshersGUI_SubShapeSelectorWdg(0,TopAbs_EDGE);
- idsWg->SetGeomShapeEntry( aMainEntry );
idsWg->SetMainShapeEntry( aMainEntry );
+ idsWg->SetGeomShapeEntry( aSubEntry.isEmpty() ? aMainEntry : aSubEntry );
idsWg->SetListOfIDs( h->GetEdges() );
idsWg->showPreview( true );
customWidgets()->append ( idsWg );
}
}
- else if (hypType() == "QuadrangleParams")
- {
- StdMeshers::StdMeshers_QuadrangleParams_var h =
- StdMeshers::StdMeshers_QuadrangleParams::_narrow(hyp);
-
- item.myName = tr("SMESH_BASE_VERTEX");
- p.append(item);
-
- StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget =
- new StdMeshersGUI_SubShapeSelectorWdg(0, TopAbs_VERTEX);
- aDirectionWidget->SetMaxSize(1);
- QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
- QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
- if (anEntry == "")
- anEntry = h->GetObjectEntry();
- aDirectionWidget->SetGeomShapeEntry(anEntry);
- aDirectionWidget->SetMainShapeEntry(aMainEntry);
- if (!isCreation()) {
- SMESH::long_array_var aVec = new SMESH::long_array;
- int vertID = h->GetTriaVertex();
- if (vertID > 0) {
- aVec->length(1);
- aVec[0] = vertID;
- aDirectionWidget->SetListOfIDs(aVec);
- }
- }
- aDirectionWidget->showPreview(true);
-
- item.myName = tr("SMESH_QUAD_TYPE");
- p.append(item);
-
- StdMeshersGUI_QuadrangleParamWdg* aTypeWidget =
- new StdMeshersGUI_QuadrangleParamWdg();
- if (!isCreation()) {
- aTypeWidget->SetType(int(h->GetQuadType()));
- }
-
- customWidgets()->append(aDirectionWidget);
- customWidgets()->append(aTypeWidget);
- }
+ // else if (hypType() == "QuadrangleParams")
+ // {
+ // StdMeshers::StdMeshers_QuadrangleParams_var h =
+ // StdMeshers::StdMeshers_QuadrangleParams::_narrow(hyp);
+
+ // item.myName = tr("SMESH_BASE_VERTEX");
+ // p.append(item);
+
+ // StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget =
+ // new StdMeshersGUI_SubShapeSelectorWdg(0, TopAbs_VERTEX);
+ // aDirectionWidget->SetMaxSize(1);
+ // QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+ // QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
+ // if (anEntry == "")
+ // anEntry = h->GetObjectEntry();
+ // aDirectionWidget->SetGeomShapeEntry(anEntry);
+ // aDirectionWidget->SetMainShapeEntry(aMainEntry);
+ // if (!isCreation()) {
+ // SMESH::long_array_var aVec = new SMESH::long_array;
+ // int vertID = h->GetTriaVertex();
+ // if (vertID > 0) {
+ // aVec->length(1);
+ // aVec[0] = vertID;
+ // aDirectionWidget->SetListOfIDs(aVec);
+ // }
+ // }
+ // aDirectionWidget->showPreview(true);
+
+ // item.myName = tr("SMESH_QUAD_TYPE");
+ // p.append(item);
+
+ // StdMeshersGUI_QuadrangleParamWdg* aTypeWidget =
+ // new StdMeshersGUI_QuadrangleParamWdg();
+ // if (!isCreation()) {
+ // aTypeWidget->SetType(int(h->GetQuadType()));
+ // }
+
+ // customWidgets()->append(aDirectionWidget);
+ // customWidgets()->append(aTypeWidget);
+ // }
else
res = false;
return res;
{
sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "parametric_precision" );
}
+ else if( hypType()=="GeometricProgression" )
+ {
+ if (sb->objectName() == tr("SMESH_START_LENGTH_PARAM"))
+ sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
+ else if (sb->objectName() == tr("SMESH_COMMON_RATIO"))
+ sb->RangeStepAndValidator( -VALUE_MAX, VALUE_MAX, 0.5, "len_tol_precision" );
+ }
else if( hypType()=="MaxLength" )
{
sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
types.insert( "Deflection1D", "DEFLECTION1D" );
types.insert( "Adaptive1D", "ADAPTIVE1D" );
types.insert( "Arithmetic1D", "ARITHMETIC_1D" );
+ types.insert( "GeometricProgression", "GEOMETRIC_1D" );
types.insert( "FixedPoints1D", "FIXED_POINTS_1D" );
types.insert( "AutomaticLength", "AUTOMATIC_LENGTH" );
types.insert( "ProjectionSource1D", "PROJECTION_SOURCE_1D" );
param.myValue = w->GetValue();
return true;
}
- if ( widget->inherits( "StdMeshersGUI_QuadrangleParamWdg" ))
- {
- //const StdMeshersGUI_QuadrangleParamWdg * w =
- // static_cast<const StdMeshersGUI_QuadrangleParamWdg*>( widget );
- param.myValue = "QuadType";
- return true;
- }
+ // if ( widget->inherits( "StdMeshersGUI_QuadrangleParamWdg" ))
+ // {
+ // param.myValue = "QuadType";
+ // return true;
+ // }
if ( widget->inherits( "StdMeshersGUI_FixedPointsParamWdg" ))
{
const StdMeshersGUI_FixedPointsParamWdg * w =
toCopyGroups->setEnabled( true );
}
}
- else if ( hypType() == "ViscousLayers2D" && paramWidget->inherits("QButtonGroup"))
+ else if ( hypType().startsWith( "ViscousLayers" ) && paramWidget->inherits("QButtonGroup"))
{
if ( QLabel* label = getLabel(4) )
{
bool toIgnore = widget< StdMeshersGUI_RadioButtonsGrpWdg >( 3 )->checkedId();
- label->setText( tr( toIgnore ? "SMESH_EDGES_WO_LAYERS" : "SMESH_EDGES_WITH_LAYERS" ));
+ if ( hypType() == "ViscousLayers2D" )
+ label->setText( tr( toIgnore ? "SMESH_EDGES_WO_LAYERS" : "SMESH_EDGES_WITH_LAYERS" ));
+ else
+ label->setText( tr( toIgnore ? "SMESH_FACES_WO_LAYERS" : "SMESH_FACES_WITH_LAYERS" ));
}
}
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
<source>ICON_DLG_ARITHMETIC_1D</source>
<translation>mesh_hypo_length.png</translation>
</message>
+ <message>
+ <source>ICON_DLG_GEOMETRIC_1D</source>
+ <translation>mesh_hypo_length.png</translation>
+ </message>
<message>
<source>ICON_DLG_FIXED_POINTS_1D</source>
<translation>mesh_hypo_length.png</translation>
<source>ICON_DLG_ADAPTIVE1D</source>
<translation>mesh_hypo_length.png</translation>
</message>
- <message>
- <source>ICON_DLG_GEOMETRIC_1D</source>
- <translation>mesh_hypo_length.png</translation>
- </message>
<message>
<source>ICON_DLG_LAYER_DISTRIBUTION</source>
<translation>mesh_hypo_layer_distribution.png</translation>
<source>ICON_SMESH_TREE_HYPO_Arithmetic1D</source>
<translation>mesh_tree_hypo_length.png</translation>
</message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_Geometric1D</source>
+ <translation>mesh_tree_hypo_length.png</translation>
+ </message>
<message>
<source>ICON_SMESH_TREE_HYPO_AutomaticLength</source>
<translation>mesh_tree_hypo_length.png</translation>
<source>ICON_SMESH_TREE_HYPO_Propagation</source>
<translation>mesh_tree_hypo_length.png</translation>
</message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_PropagOfDistribution</source>
+ <translation>mesh_tree_hypo_length.png</translation>
+ </message>
<message>
<source>ICON_SMESH_TREE_HYPO_QuadranglePreference</source>
<translation>mesh_tree_algo_quad.png</translation>
<source>TO_IGNORE_EDGES</source>
<translation>Edges without layers (inlets and oulets)</translation>
</message>
+ <message>
+ <source>TO_IGNORE_FACES_OR_NOT</source>
+ <translation>Specified faces are</translation>
+ </message>
+ <message>
+ <source>NOT_TO_IGNORE_FACES</source>
+ <translation>Faces with layers (walls)</translation>
+ </message>
+ <message>
+ <source>TO_IGNORE_FACES</source>
+ <translation>Faces without layers (inlets and oulets)</translation>
+ </message>
</context>
<context>
<name>@default</name>
<translation>Arithmetic 1D</translation>
</message>
<message>
- <source>SMESH_ARITHMETIC_1D_PARAM</source>
- <translation>Arithmetic Reason</translation>
+ <source>SMESH_ARITHMETIC_1D_TITLE</source>
+ <translation>Hypothesis Construction</translation>
</message>
<message>
- <source>SMESH_ARITHMETIC_1D_TITLE</source>
+ <source>SMESH_GEOMETRIC_1D_HYPOTHESIS</source>
+ <translation>Geometric Progression</translation>
+ </message>
+ <message>
+ <source>SMESH_GEOMETRIC_1D_TITLE</source>
<translation>Hypothesis Construction</translation>
</message>
+ <message>
+ <source>SMESH_COMMON_RATIO</source>
+ <translation>Common Ratio</translation>
+ </message>
<message>
<source>SMESH_AUTOMATIC_LENGTH_HYPOTHESIS</source>
<translation>Automatic Length</translation>
<translation>Reduced</translation>
</message>
</context>
+<context>
+ <name>StdMeshersGUI_QuadrangleParamCreator</name>
+ <message>
+ <source>POINTS</source>
+ <translation>Points</translation>
+ </message>
+ <message>
+ <source>SHAPES</source>
+ <translation>Vertices</translation>
+ </message>
+ <message>
+ <source>TRANSITION</source>
+ <translation>Transition</translation>
+ </message>
+ <message>
+ <source>ENF_NODES</source>
+ <translation>Enforced nodes</translation>
+ </message>
+ <message>
+ <source></source>
+ <translation></translation>
+ </message>
+</context>
<context>
<name>StdMeshersGUI_LayerDistributionParamWdg</name>
<message>
<source>THRESHOLD</source>
<translation>Threshold</translation>
</message>
+ <message>
+ <source>ADD_EDGES</source>
+ <translation>Implement Edges</translation>
+ </message>
<message>
<source>AXIS_X</source>
<translation>Axis X</translation>
<source>AXIS_Z</source>
<translation>Axis Z</translation>
</message>
+ <message>
+ <source>INVALID_AXES_DIR</source>
+ <translation>Invalid directions of axes</translation>
+ </message>
+ <message>
+ <source>FIXED_POINT</source>
+ <translation>Fixed Point</translation>
+ </message>
+ <message>
+ <source>AXES_DIRECTION</source>
+ <translation>Directions of Axes</translation>
+ </message>
+ <message>
+ <source>ORTHOGONAL_AXES</source>
+ <translation>Orthogonal Axes</translation>
+ </message>
+ <message>
+ <source>OPTIMAL_AXES</source>
+ <translation>Optimal Axes</translation>
+ </message>
+ <message>
+ <source>RESET_AXES</source>
+ <translation>Reset</translation>
+ </message>
</context>
<context>
<name>StdMeshersGUI::GridAxisTab</name>
<TS version="2.0" language="fr_FR">
<context>
<name>@default</name>
+ <message>
+ <source>SMESH_COMMON_RATIO</source>
+ <translation type="unfinished">Common Ratio</translation>
+ </message>
+ <message>
+ <source>SMESH_GEOMETRIC_1D_TITLE</source>
+ <translation type="unfinished">Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_GEOMETRIC_1D_HYPOTHESIS</source>
+ <translation type="unfinished">Geometric Progression</translation>
+ </message>
<message>
<source>SMESH_EDGES_WITH_LAYERS</source>
<translation type="unfinished">Edges with layers</translation>
</context>
<context>
<name>StdMeshersGUI_CartesianParamCreator</name>
+ <message>
+ <source>ADD_EDGES</source>
+ <translation type="unfinished">Implement Edges</translation>
+ </message>
<message>
<source>THRESHOLD</source>
<translation>Seuil</translation>
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
SET(StdMeshersEngine_SOURCES
StdMeshers_i.cxx
StdMeshers_LocalLength_i.cxx
+ StdMeshers_Reversible1D_i.cxx
StdMeshers_StartEndLength_i.cxx
StdMeshers_Arithmetic1D_i.cxx
+ StdMeshers_Geometric1D_i.cxx
StdMeshers_FixedPoints1D_i.cxx
StdMeshers_NumberOfSegments_i.cxx
StdMeshers_Deflection1D_i.cxx
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
}
}
+//=======================================================================
+//function : SetAxesDirs
+//purpose : Set custom direction of axes
+//=======================================================================
+
+void StdMeshers_CartesianParameters3D_i::SetAxesDirs(const SMESH::DirStruct& xDir,
+ const SMESH::DirStruct& yDir,
+ const SMESH::DirStruct& zDir)
+ throw (SALOME::SALOME_Exception)
+{
+ double coords[9];
+ coords[0] = xDir.PS.x;
+ coords[1] = xDir.PS.y;
+ coords[2] = xDir.PS.z;
+ coords[3] = yDir.PS.x;
+ coords[4] = yDir.PS.y;
+ coords[5] = yDir.PS.z;
+ coords[6] = zDir.PS.x;
+ coords[7] = zDir.PS.y;
+ coords[8] = zDir.PS.z;
+ try {
+ this->GetImpl()->SetAxisDirs(coords);
+
+ SMESH::TPythonDump() << _this() << ".SetAxesDirs( "
+ << xDir << ", "
+ << yDir << ", "
+ << zDir << " )";
+ }
+ catch ( SALOME_Exception& S_ex ) {
+ THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
+ }
+}
+
+//=======================================================================
+//function : GetAxesDirs
+//purpose : Returns direction of axes
+//=======================================================================
+
+void StdMeshers_CartesianParameters3D_i::GetAxesDirs(SMESH::DirStruct& xDir,
+ SMESH::DirStruct& yDir,
+ SMESH::DirStruct& zDir)
+{
+ const double* coords = GetImpl()->GetAxisDirs();
+ xDir.PS.x = coords[0];
+ xDir.PS.y = coords[1];
+ xDir.PS.z = coords[2];
+ yDir.PS.x = coords[3];
+ yDir.PS.y = coords[4];
+ yDir.PS.z = coords[5];
+ zDir.PS.x = coords[6];
+ zDir.PS.y = coords[7];
+ zDir.PS.z = coords[8];
+}
+
+//=======================================================================
+//function : SetFixedPoint
+//purpose : * Set/unset a fixed point, at which a node will be created provided that grid
+// * is defined by spacing in all directions
+//=======================================================================
+
+void StdMeshers_CartesianParameters3D_i::SetFixedPoint(const SMESH::PointStruct& ps,
+ CORBA::Boolean toUnset)
+{
+ double p[3] = { ps.x, ps.y, ps.z };
+ GetImpl()->SetFixedPoint( p, toUnset );
+
+ SMESH::TPythonDump() << _this() << ".SetFixedPoint( " << ps << ", " << toUnset << " )";
+}
+
+//=======================================================================
+//function : GetFixedPoint
+//purpose : Returns a fixed point
+//=======================================================================
+
+CORBA::Boolean StdMeshers_CartesianParameters3D_i::GetFixedPoint(SMESH::PointStruct& ps)
+{
+ double p[3];
+ if ( GetImpl()->GetFixedPoint( p ) )
+ {
+ ps.x = p[0];
+ ps.y = p[1];
+ ps.z = p[2];
+ return true;
+ }
+ else
+ {
+ ps.x = 0.;
+ ps.y = 0.;
+ ps.z = 0.;
+ }
+ return false;
+}
+
+//=======================================================================
+//function : SetToAddEdges
+//purpose : Enables implementation of geometrical edges into the mesh.
+//=======================================================================
+
+void StdMeshers_CartesianParameters3D_i::SetToAddEdges(CORBA::Boolean toAdd)
+{
+ GetImpl()->SetToAddEdges( toAdd );
+ SMESH::TPythonDump() << _this() << ".SetToAddEdges( " << toAdd << " )";
+}
+
+//=======================================================================
+//function : GetToAddEdges
+//purpose : Returns true if implementation of geometrical edges into the
+// mesh is enabled
+//=======================================================================
+
+CORBA::Boolean StdMeshers_CartesianParameters3D_i::GetToAddEdges()
+{
+ return GetImpl()->GetToAddEdges();
+}
+
//=======================================================================
//function : IsGridBySpacing
-//purpose : Return true if the grid is defined by spacing functions and
+//purpose : Return true if the grid is defined by spacing functions and
// not by node coordinates
//=======================================================================
return this->GetImpl()->IsGridBySpacing(axis);
}
+//=======================================================================
+//function : ComputeOptimalAxesDirs
+//purpose : Returns axes at which number of hexahedra is maximal
+//=======================================================================
+
+void StdMeshers_CartesianParameters3D_i::
+ComputeOptimalAxesDirs(GEOM::GEOM_Object_ptr go,
+ CORBA::Boolean isOrthogonal,
+ SMESH::DirStruct& xDir,
+ SMESH::DirStruct& yDir,
+ SMESH::DirStruct& zDir)
+ throw (SALOME::SALOME_Exception)
+{
+ TopoDS_Shape shape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( go );
+ if ( shape.IsNull() )
+ THROW_SALOME_CORBA_EXCEPTION( "Null shape", SALOME::BAD_PARAM );
+
+ double c[9];
+ ::StdMeshers_CartesianParameters3D::ComputeOptimalAxesDirs( shape, isOrthogonal, c );
+
+ xDir.PS.x = c[0];
+ xDir.PS.y = c[1];
+ xDir.PS.z = c[2];
+ yDir.PS.x = c[3];
+ yDir.PS.y = c[4];
+ yDir.PS.z = c[5];
+ zDir.PS.x = c[6];
+ zDir.PS.y = c[7];
+ zDir.PS.z = c[8];
+}
+
//=======================================================================
//function : ComputeCoordinates
//purpose : Computes node coordinates by spacing functions
const SMESH::string_array& spaceFuns,
const SMESH::double_array& points,
const char* axisName )
- throw (SALOME::SALOME_Exception)
+ throw (SALOME::SALOME_Exception)
{
vector<string> xFuns;
vector<double> xPoints, coords;
_array2vec( spaceFuns, xFuns, (const char*) );
_array2vec( points, xPoints, );
-
+
try {
this->GetImpl()->ComputeCoordinates( x0, x1, xFuns, xPoints, coords, axisName );
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
void GetGridSpacing(SMESH::string_array_out xSpaceFunctions,
SMESH::double_array_out xInternalPoints,
CORBA::Short axis) throw (SALOME::SALOME_Exception);
+ /*!
+ * Set custom direction of axes
+ */
+ void SetAxesDirs(const SMESH::DirStruct& x,
+ const SMESH::DirStruct& y,
+ const SMESH::DirStruct& z) throw (SALOME::SALOME_Exception);
+ void GetAxesDirs(SMESH::DirStruct& x,
+ SMESH::DirStruct& y,
+ SMESH::DirStruct& z);
+ /*!
+ * Set/unset a fixed point, at which a node will be created provided that grid
+ * is defined by spacing in all directions
+ */
+ void SetFixedPoint(const ::SMESH::PointStruct& p, CORBA::Boolean toUnset);
+ CORBA::Boolean GetFixedPoint(::SMESH::PointStruct& p);
+
+
+ /*!
+ * \brief Enables implementation of geometrical edges into the mesh. If this feature
+ * is disabled, sharp edges of the shape are lost ("smoothed") in the mesh if
+ * they don't coincide with the grid lines
+ */
+ void SetToAddEdges(CORBA::Boolean toAdd);
+ CORBA::Boolean GetToAddEdges();
/*!
* \brief Return true if the grid is defined by spacing functions and
*/
CORBA::Boolean IsGridBySpacing(CORBA::Short axis);
+ /*!
+ * Returns axes at which number of hexahedra is maximal
+ */
+ void ComputeOptimalAxesDirs(GEOM::GEOM_Object_ptr shape,
+ CORBA::Boolean isOrthogonal,
+ SMESH::DirStruct& x,
+ SMESH::DirStruct& y,
+ SMESH::DirStruct& z) throw (SALOME::SALOME_Exception);
/*!
* \brief Computes node coordinates by spacing functions
* \param x0 - lower coordinate
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
+// File : StdMeshers_Geometric1D_i.cxx
+// Module : SMESH
+//
+#include "StdMeshers_Geometric1D_i.hxx"
+#include "SMESH_Gen_i.hxx"
+#include "SMESH_Gen.hxx"
+#include "SMESH_PythonDump.hxx"
+
+#include <Utils_CorbaException.hxx>
+#include <utilities.h>
+
+//=============================================================================
+/*!
+ * StdMeshers_Geometric1D_i::StdMeshers_Geometric1D_i
+ *
+ * Constructor
+ */
+//=============================================================================
+
+StdMeshers_Geometric1D_i::StdMeshers_Geometric1D_i( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
+ : SALOME::GenericObj_i( thePOA ),
+ SMESH_Hypothesis_i( thePOA ),
+ StdMeshers_Reversible1D_i( this )
+{
+ myBaseImpl = new ::StdMeshers_Geometric1D( theGenImpl->GetANewId(),
+ theStudyId,
+ theGenImpl );
+}
+
+//=============================================================================
+/*!
+ * Sets <start segment length> parameter value
+ */
+//=============================================================================
+
+void StdMeshers_Geometric1D_i::SetStartLength( CORBA::Double theLength )
+ throw (SALOME::SALOME_Exception)
+{
+ try {
+ this->GetImpl()->SetStartLength( theLength );
+ }
+ catch ( SALOME_Exception& S_ex ) {
+ THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
+ }
+ // Update Python script
+ SMESH::TPythonDump()
+ << _this() << ".SetStartLength( " << SMESH::TVar(theLength) << " )";
+}
+
+//=============================================================================
+/*!
+ * Sets <common ratio> parameter value
+ */
+//=============================================================================
+
+void StdMeshers_Geometric1D_i::SetCommonRatio( CORBA::Double factor )
+ throw (SALOME::SALOME_Exception)
+{
+ try {
+ this->GetImpl()->SetCommonRatio( factor );
+ }
+ catch ( SALOME_Exception& S_ex ) {
+ THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
+ }
+ // Update Python script
+ SMESH::TPythonDump()
+ << _this() << ".SetCommonRatio( " << SMESH::TVar(factor) << " )";
+}
+
+//=============================================================================
+/*!
+ * Returns length of the first segment
+ */
+//=============================================================================
+
+CORBA::Double StdMeshers_Geometric1D_i::GetStartLength()
+{
+ return this->GetImpl()->GetStartLength();
+}
+
+//=============================================================================
+/*!
+ * Returns value of Common Ratio
+ */
+//=============================================================================
+
+CORBA::Double StdMeshers_Geometric1D_i::GetCommonRatio()
+{
+ return this->GetImpl()->GetCommonRatio();
+}
+
+//=============================================================================
+/*!
+ * StdMeshers_Geometric1D_i::GetImpl
+ *
+ * Get implementation
+ */
+//=============================================================================
+
+::StdMeshers_Geometric1D* StdMeshers_Geometric1D_i::GetImpl()
+{
+ return ( ::StdMeshers_Geometric1D* )myBaseImpl;
+}
+
+//================================================================================
+/*!
+ * \brief Verify whether hypothesis supports given entity type
+ * \param type - dimension (see SMESH::Dimension enumeration)
+ * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
+ *
+ * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
+ */
+//================================================================================
+
+CORBA::Boolean StdMeshers_Geometric1D_i::IsDimSupported(::SMESH::Dimension type)
+{
+ return type == SMESH::DIM_1D;
+}
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
+// File : StdMeshers_Geometric1D_i.hxx
+// Module : SMESH
+//
+#ifndef _SMESH_Geometric1D_I_HXX_
+#define _SMESH_Geometric1D_I_HXX_
+
+#include "SMESH_StdMeshers_I.hxx"
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
+
+#include "SMESH_Hypothesis_i.hxx"
+#include "StdMeshers_Geometric1D.hxx"
+#include "StdMeshers_Reversible1D_i.hxx"
+
+// ======================================================
+// Geometric 1D hypothesis
+// ======================================================
+class STDMESHERS_I_EXPORT StdMeshers_Geometric1D_i:
+ public virtual POA_StdMeshers::StdMeshers_Geometric1D,
+ public virtual SMESH_Hypothesis_i,
+ public virtual StdMeshers_Reversible1D_i
+{
+ public:
+ // Constructor
+ StdMeshers_Geometric1D_i( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl );
+
+ void SetStartLength(CORBA::Double length) throw(SALOME::SALOME_Exception);
+ void SetCommonRatio(CORBA::Double factor) throw(SALOME::SALOME_Exception);
+
+ CORBA::Double GetStartLength();
+ CORBA::Double GetCommonRatio();
+
+ virtual ::CORBA::Boolean IsDimSupported(::SMESH::Dimension type);
+
+ // Get implementation
+ ::StdMeshers_Geometric1D* GetImpl();
+};
+
+#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// Moved here from SMESH_Hexa_3D_i.cxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-// $Header$
//
#include "StdMeshers_Hexa_3D_i.hxx"
#include "SMESH_Gen.hxx"
//=============================================================================
StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
- : SALOME::GenericObj_i( thePOA ),
- SMESH_Hypothesis_i( thePOA ),
- SMESH_Algo_i( thePOA ),
- SMESH_3D_Algo_i( thePOA )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
+ : SALOME::GenericObj_i( thePOA ),
+ SMESH_Hypothesis_i( thePOA ),
+ SMESH_Algo_i( thePOA ),
+ SMESH_3D_Algo_i( thePOA )
{
MESSAGE( "StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i" );
myBaseImpl = new ::StdMeshers_Hexa_3D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
MESSAGE( "StdMeshers_Hexa_3D_i::GetImpl" );
return ( ::StdMeshers_Hexa_3D* )myBaseImpl;
}
+
+//=============================================================================
+/*!
+ * StdMeshers_Hexa_3D_i::IsApplicable
+ *
+ * Return true if the algorithm is applicable to a shape
+ */
+//=============================================================================
+
+CORBA::Boolean StdMeshers_Hexa_3D_i::IsApplicable( const TopoDS_Shape &S,
+ CORBA::Boolean toCheckAll )
+{
+ return ::StdMeshers_Hexa_3D::IsApplicable( S, toCheckAll );
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// Moved here from SMESH_Hexa_3D_i.hxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-// $Header$
//
#ifndef _SMESH_HEXA_3D_I_HXX_
#define _SMESH_HEXA_3D_I_HXX_
// Get implementation
::StdMeshers_Hexa_3D* GetImpl();
+
+ // Return true if the algorithm is applicable to a shape
+ static CORBA::Boolean IsApplicable(const TopoDS_Shape &S, CORBA::Boolean toCheckAll);
};
#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//purpose : Return study entry of GEOM Object
//=======================================================================
-std::string StdMeshers_ObjRefUlils::GeomObjectToEntry(GEOM::GEOM_Object_ptr& theGeomObject)
+std::string StdMeshers_ObjRefUlils::GeomObjectToEntry(GEOM::GEOM_Object_ptr theGeomObject)
{
if ( CORBA::is_nil( theGeomObject ))
return "NULL_OBJECT";
*/
//================================================================================
-TopoDS_Shape StdMeshers_ObjRefUlils::LoadFromStream( istream & stream)
+TopoDS_Shape StdMeshers_ObjRefUlils::LoadFromStream( istream & stream,
+ std::string* entry)
{
- if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
- SALOMEDS::Study_var study = gen->GetCurrentStudy();
- if ( ! study->_is_nil() ) {
- string str;
- if (stream >> str) {
+ string str;
+ if (stream >> str) {
+ if ( entry )
+ * entry = str;
+ if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
+ SALOMEDS::Study_var study = gen->GetCurrentStudy();
+ if ( ! study->_is_nil() ) {
SALOMEDS::SObject_wrap sobj = study->FindObjectID( str.c_str() );
CORBA::Object_var obj = gen->SObjectToObject( sobj );
GEOM::GEOM_Object_var geom = GEOM::GEOM_Object::_narrow( obj );
}
}
}
+ if ( entry )
+ entry->clear();
return TopoDS_Shape();
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
/*!
* \brief Return study entry of GEOM Object
*/
- static std::string GeomObjectToEntry(GEOM::GEOM_Object_ptr& theGeomObject);
+ static std::string GeomObjectToEntry(GEOM::GEOM_Object_ptr theGeomObject);
/*!
* \brief Return GEOM Object by its study entry or TopoDS_Shape
* \param stream - the stream
* \retval TopoDS_Shape - resulting shape
*/
- static TopoDS_Shape LoadFromStream( std::istream & stream );
+ static TopoDS_Shape LoadFromStream( std::istream & stream, std::string* entry=NULL );
/*!
* \brief Store the CORBA object in the stream
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// Moved here from SMESH_Prism_3D_i.cxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-// $Header$
//
#include "StdMeshers_Prism_3D_i.hxx"
#include "SMESH_Gen.hxx"
//=============================================================================
StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
- : SALOME::GenericObj_i( thePOA ),
- SMESH_Hypothesis_i( thePOA ),
- SMESH_Algo_i( thePOA ),
- SMESH_3D_Algo_i( thePOA )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
+ : SALOME::GenericObj_i( thePOA ),
+ SMESH_Hypothesis_i( thePOA ),
+ SMESH_Algo_i( thePOA ),
+ SMESH_3D_Algo_i( thePOA )
{
MESSAGE( "StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i" );
myBaseImpl = new ::StdMeshers_Prism_3D( theGenImpl->GetANewId(),
MESSAGE( "StdMeshers_Prism_3D_i::GetImpl" );
return ( ::StdMeshers_Prism_3D* )myBaseImpl;
}
+//-----------------------------------------------------------------------------
+
+CORBA::Boolean StdMeshers_Prism_3D_i::IsApplicable( const TopoDS_Shape &S,
+ CORBA::Boolean toCheckAll )
+{
+ return ::StdMeshers_Prism_3D::IsApplicable( S, toCheckAll );
+}
//=============================================================================
//=============================================================================
StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
- : SALOME::GenericObj_i( thePOA ),
- SMESH_Hypothesis_i( thePOA ),
- SMESH_Algo_i( thePOA ),
- SMESH_3D_Algo_i( thePOA )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
+ : SALOME::GenericObj_i( thePOA ),
+ SMESH_Hypothesis_i( thePOA ),
+ SMESH_Algo_i( thePOA ),
+ SMESH_3D_Algo_i( thePOA )
{
MESSAGE( "StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i" );
myBaseImpl = new ::StdMeshers_RadialPrism_3D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//-----------------------------------------------------------------------------
MESSAGE( "StdMeshers_RadialPrism_3D_i::GetImpl" );
return ( ::StdMeshers_RadialPrism_3D* )myBaseImpl;
}
+//-----------------------------------------------------------------------------
+CORBA::Boolean StdMeshers_RadialPrism_3D_i::IsApplicable( const TopoDS_Shape &S,
+ CORBA::Boolean toCheckAll )
+{
+ return ::StdMeshers_RadialPrism_3D::IsApplicable( S, toCheckAll );
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// Moved here from SMESH_Prism_3D_i.hxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-// $Header$
//
#ifndef _SMESH_Prism_3D_I_HXX_
#define _SMESH_Prism_3D_I_HXX_
// Get implementation
::StdMeshers_Prism_3D* GetImpl();
+
+ // Return true if the algorithm is applicable to a shape
+ static CORBA::Boolean IsApplicable(const TopoDS_Shape &S, CORBA::Boolean toCheckAll);
};
// ======================================================
// Get implementation
::StdMeshers_RadialPrism_3D* GetImpl();
+
+ // Return true if the algorithm is applicable to a shape
+ static CORBA::Boolean IsApplicable(const TopoDS_Shape &S, CORBA::Boolean toCheckAll);
};
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_Propagation_i.cxx
// Module : SMESH
-// $Header$
//
#include "StdMeshers_Propagation_i.hxx"
#include "SMESH_Gen.hxx"
StdMeshers_Propagation_i::StdMeshers_Propagation_i (PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl )
- : SALOME::GenericObj_i( thePOA ),
- SMESH_Hypothesis_i( thePOA )
+ : SALOME::GenericObj_i( thePOA ),
+ SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_Propagation_i::StdMeshers_Propagation_i" );
myBaseImpl = new ::StdMeshers_Propagation(theGenImpl->GetANewId(),
theGenImpl);
}
-//=============================================================================
+//================================================================================
/*!
- * StdMeshers_Propagation_i::~StdMeshers_Propagation_i
+ * \brief Verify whether hypothesis supports given entity type
+ * \param type - dimension (see SMESH::Dimension enumeration)
+ * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
*
- * Destructor
+ * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
*/
-//=============================================================================
-StdMeshers_Propagation_i::~StdMeshers_Propagation_i()
+//================================================================================
+CORBA::Boolean StdMeshers_Propagation_i::IsDimSupported( SMESH::Dimension type )
{
- MESSAGE( "StdMeshers_Propagation_i::~StdMeshers_Propagation_i" );
+ return type == SMESH::DIM_1D;
}
//=============================================================================
/*!
- * StdMeshers_Propagation_i::GetImpl
+ * StdMeshers_PropagOfDistribution_i::StdMeshers_PropagOfDistribution_i
*
- * Get implementation
+ * Constructor
*/
//=============================================================================
-::StdMeshers_Propagation* StdMeshers_Propagation_i::GetImpl()
+StdMeshers_PropagOfDistribution_i::
+StdMeshers_PropagOfDistribution_i (PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
+ : SALOME::GenericObj_i( thePOA ),
+ SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_Propagation_i::GetImpl" );
- return ( ::StdMeshers_Propagation* )myBaseImpl;
+ myBaseImpl = new ::StdMeshers_PropagOfDistribution(theGenImpl->GetANewId(),
+ theStudyId,
+ theGenImpl);
}
//================================================================================
/*!
- * \brief Verify whether hypothesis supports given entity type
- * \param type - dimension (see SMESH::Dimension enumeration)
- * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
- *
+ * \brief Verify whether hypothesis supports given entity type
+ * \param type - dimension (see SMESH::Dimension enumeration)
+ * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
+ *
* Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
*/
-//================================================================================
-CORBA::Boolean StdMeshers_Propagation_i::IsDimSupported( SMESH::Dimension type )
+//================================================================================
+CORBA::Boolean StdMeshers_PropagOfDistribution_i::IsDimSupported( SMESH::Dimension type )
{
return type == SMESH::DIM_1D;
}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_Propagation_i.hxx
// Module : SMESH
-// $Header$
//
#ifndef _SMESH_PROPAGATION_I_HXX_
#define _SMESH_PROPAGATION_I_HXX_
// ======================================================
// Propagation hypothesis
// ======================================================
+
class STDMESHERS_I_EXPORT StdMeshers_Propagation_i:
public virtual POA_StdMeshers::StdMeshers_Propagation,
public virtual SMESH_Hypothesis_i
StdMeshers_Propagation_i (PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl);
- // Destructor
- virtual ~StdMeshers_Propagation_i();
+
+ // Verify whether hypothesis supports given entity type
+ CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+};
+
+// ======================================================
+// Propagation of Distribution hypothesis
+// ======================================================
- // Get implementation
- ::StdMeshers_Propagation* GetImpl();
+class STDMESHERS_I_EXPORT StdMeshers_PropagOfDistribution_i:
+ public virtual POA_StdMeshers::StdMeshers_PropagOfDistribution,
+ public virtual SMESH_Hypothesis_i
+{
+public:
+ // Constructor
+ StdMeshers_PropagOfDistribution_i (PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl);
// Verify whether hypothesis supports given entity type
CORBA::Boolean IsDimSupported( SMESH::Dimension type );
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// Module : SMESH
#include "StdMeshers_QuadrangleParams_i.hxx"
-#include "SMESH_Gen_i.hxx"
+
#include "SMESH_Gen.hxx"
+#include "SMESH_Gen_i.hxx"
#include "SMESH_PythonDump.hxx"
+#include "StdMeshers_ObjRefUlils.hxx"
-#include "Utils_CorbaException.hxx"
-#include "utilities.h"
+#include <Utils_CorbaException.hxx>
+#include <utilities.h>
-#include <TCollection_AsciiString.hxx>
+#include <Standard_ErrorHandler.hxx>
+#include "SMESH_TryCatch.hxx"
using namespace std;
this->GetImpl()->SetTriaVertex( vertID );
}
catch ( SALOME_Exception& S_ex ) {
- THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
}
// Update Python script
- SMESH::TPythonDump() << _this() << ".SetTriaVertex( "
- << vertID << " )";
+ SMESH::TPythonDump() << _this() << ".SetTriaVertex( " << vertID << " )";
}
//=============================================================================
entry = this->GetImpl()->GetObjectEntry();
}
catch ( SALOME_Exception& S_ex ) {
- THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
}
return CORBA::string_dup( entry );
}
//=============================================================================
void StdMeshers_QuadrangleParams_i::SetQuadType(StdMeshers::QuadType type)
{
- //static char* quadTypes[5] = {"StdMeshers.QUAD_STANDARD",
- // "StdMeshers.QUAD_TRIANGLE_PREF",
- // "StdMeshers.QUAD_QUADRANGLE_PREF",
- // "StdMeshers.QUAD_QUADRANGLE_PREF_REVERSED",
- // "StdMeshers.QUAD_REDUCED"};
-
MESSAGE("StdMeshers_QuadrangleParams_i::SetQuadType");
ASSERT(myBaseImpl);
quadType = "UNKNOWN";
}
SMESH::TPythonDump() << _this() << ".SetQuadType( " << quadType << " )";
- //SMESH::TPythonDump() << _this() << ".SetQuadType( " << quadTypes[int(type)] << " )";
}
//=============================================================================
return StdMeshers::QuadType(int(this->GetImpl()->GetQuadType()));
}
+//================================================================================
+/*!
+ * \brief Set positions of enforced nodes
+ */
+//================================================================================
+
+void StdMeshers_QuadrangleParams_i::SetEnforcedNodes(const GEOM::ListOfGO& theVertices,
+ const SMESH::nodes_array& thePoints)
+ throw ( SALOME::SALOME_Exception )
+{
+ try {
+ std::vector< TopoDS_Shape > shapes;
+ std::vector< gp_Pnt > points;
+ shapes.reserve( theVertices.length() );
+ points.reserve( thePoints.length() );
+
+ myShapeEntries.clear();
+
+ for ( size_t i = 0; i < theVertices.length(); ++i )
+ {
+ if ( CORBA::is_nil( theVertices[i] ))
+ continue;
+ CORBA::String_var entry = theVertices[i]->GetStudyEntry();
+ if ( !entry.in() || !entry.in()[0] )
+ THROW_SALOME_CORBA_EXCEPTION( "Not published enforced vertex shape", SALOME::BAD_PARAM );
+
+ shapes.push_back( StdMeshers_ObjRefUlils::GeomObjectToShape( theVertices[i].in() ));
+ myShapeEntries.push_back( entry.in() );
+ }
+ for ( size_t i = 0; i < thePoints.length(); ++i )
+ {
+ points.push_back( gp_Pnt( thePoints[i].x, thePoints[i].y, thePoints[i].z ));
+ }
+ this->GetImpl()->SetEnforcedNodes( shapes, points );
+ }
+ catch ( SALOME_Exception& S_ex ) {
+ THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
+ }
+ // Update Python script
+ SMESH::TPythonDump() << _this() << ".SetEnforcedNodes( "
+ << theVertices << ", " << thePoints << " )";
+}
+
+//================================================================================
+/*!
+ * \brief Returns positions of enforced nodes
+ */
+//================================================================================
+
+void StdMeshers_QuadrangleParams_i::GetEnforcedNodes(GEOM::ListOfGO_out theVertices,
+ SMESH::nodes_array_out thePoints)
+{
+ SMESH_TRY;
+
+ std::vector< TopoDS_Shape > shapes;
+ std::vector< gp_Pnt > points;
+ this->GetImpl()->GetEnforcedNodes( shapes, points );
+
+ theVertices = new GEOM::ListOfGO;
+ thePoints = new SMESH::nodes_array;
+
+ size_t i = 0;
+ theVertices->length( myShapeEntries.size() );
+ for ( i = 0; i < myShapeEntries.size(); ++i )
+ theVertices[i] =
+ StdMeshers_ObjRefUlils::EntryOrShapeToGeomObject( myShapeEntries[i], shapes[i] );
+
+ thePoints->length( points.size() );
+ for ( i = 0; i < points.size(); ++i )
+ {
+ thePoints[i].x = points[i].X();
+ thePoints[i].y = points[i].Y();
+ thePoints[i].z = points[i].Z();
+ }
+ SMESH_CATCH( SMESH::doNothing );
+}
+
+//================================================================================
+/*!
+ * \brief Returns study entries of shapes defining enforced nodes
+ */
+//================================================================================
+
+SMESH::string_array* StdMeshers_QuadrangleParams_i::GetEnfVertices()
+{
+ SMESH::string_array_var arr = new SMESH::string_array;
+ arr->length( myShapeEntries.size() );
+
+ for ( size_t i = 0; i < myShapeEntries.size(); ++i )
+ arr[ i ] = myShapeEntries[ i ].c_str();
+
+ return arr._retn();
+}
+
//=============================================================================
/*!
* StdMeshers_QuadrangleParams_i::GetImpl
{
return type == SMESH::DIM_2D;
}
+
+//================================================================================
+/*!
+ * \brief Write parameters in a string
+ * \retval char* - resulting string
+ */
+//================================================================================
+
+char* StdMeshers_QuadrangleParams_i::SaveTo()
+{
+ ASSERT( myBaseImpl );
+ std::ostringstream os;
+
+ os << "ENTRIES: " << myShapeEntries.size();
+ for ( size_t i = 0; i < myShapeEntries.size(); ++i )
+ StdMeshers_ObjRefUlils::SaveToStream( myShapeEntries[ i ], os );
+ os << " ";
+
+ myBaseImpl->SaveTo( os );
+
+ return CORBA::string_dup( os.str().c_str() );
+}
+
+//================================================================================
+/*!
+ * \brief Retrieve parameters from the string
+ * \param theStream - the input string
+ */
+//================================================================================
+
+void StdMeshers_QuadrangleParams_i::LoadFrom( const char* theStream )
+{
+ ASSERT( myBaseImpl );
+
+ bool hasEntries = ( strncmp( "ENTRIES: ", theStream, 9 ) == 0 );
+ std::istringstream is( theStream + ( hasEntries ? 9 : 0 ));
+
+ if ( hasEntries )
+ {
+ int nb = 0;
+ if ( is >> nb && nb > 0 )
+ {
+ std::vector< TopoDS_Shape > shapes;
+ std::vector< gp_Pnt > points;
+ myShapeEntries.resize( nb );
+
+ for ( int i = 0; i < nb; ++i )
+ shapes.push_back( StdMeshers_ObjRefUlils::LoadFromStream( is, & myShapeEntries[i] ));
+
+ GetImpl()->SetEnforcedNodes( shapes, points );
+ }
+ }
+
+ myBaseImpl->LoadFrom( is );
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// File : StdMeshers_QuadrangleParams_i.hxx
// Author : Sergey KUUL, OCC
// Module : SMESH
-// $Header$
#ifndef _SMESH_QUADRANGLEPARAMS_I_HXX_
#define _SMESH_QUADRANGLEPARAMS_I_HXX_
// Destructor
virtual ~StdMeshers_QuadrangleParams_i();
- // Set length
- //void SetLength( CORBA::Double theLength, CORBA::Boolean theIsStart )
- // throw ( SALOME::SALOME_Exception );
-
- // Get length
- //CORBA::Double GetLength(CORBA::Boolean theIsStart);
-
// Set base vertex for triangles
void SetTriaVertex (CORBA::Long vertID);
// Get the type of quadrangulation
StdMeshers::QuadType GetQuadType();
+ // Set positions of enforced nodes
+ void SetEnforcedNodes(const GEOM::ListOfGO& vertices,
+ const SMESH::nodes_array& points) throw ( SALOME::SALOME_Exception );
+
+ // Returns positions of enforced nodes
+ void GetEnforcedNodes(GEOM::ListOfGO_out vertices, SMESH::nodes_array_out points);
+
+ // Returns entries of shapes defining enforced nodes
+ SMESH::string_array* GetEnfVertices();
+
+
// Get implementation
::StdMeshers_QuadrangleParams* GetImpl();
// Verify whether hypothesis supports given entity type
CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+
+ // Redefined Persistence
+ virtual char* SaveTo();
+ virtual void LoadFrom( const char* theStream );
+
+ protected:
+
+ std::vector<std::string> myShapeEntries;
+
};
#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// Moved here from SMESH_Quadrangle_2D_i.cxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-// $Header$
//
#include "StdMeshers_Quadrangle_2D_i.hxx"
#include "SMESH_Gen.hxx"
//=============================================================================
StdMeshers_Quadrangle_2D_i::StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
- : SALOME::GenericObj_i( thePOA ),
- SMESH_Hypothesis_i( thePOA ),
- SMESH_Algo_i( thePOA ),
- SMESH_2D_Algo_i( thePOA )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
+ : SALOME::GenericObj_i( thePOA ),
+ SMESH_Hypothesis_i( thePOA ),
+ SMESH_Algo_i( thePOA ),
+ SMESH_2D_Algo_i( thePOA )
{
MESSAGE( "StdMeshers_Quadrangle_2D_i::StdMeshers_Quadrangle_2D_i" );
myBaseImpl = new ::StdMeshers_Quadrangle_2D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
* StdMeshers_Quadrangle_2D_i::~StdMeshers_Quadrangle_2D_i
*
* Destructor
- *
+ *
*/
//=============================================================================
return ( ::StdMeshers_Quadrangle_2D* )myBaseImpl;
}
+//=============================================================================
+/*!
+ * StdMeshers_Quadrangle_2D_i::IsApplicable
+ *
+ * Return true if the algorithm is applicable to a shape
+ */
+//=============================================================================
+
+CORBA::Boolean StdMeshers_Quadrangle_2D_i::IsApplicable( const TopoDS_Shape &S,
+ CORBA::Boolean toCheckAll )
+{
+ return ::StdMeshers_Quadrangle_2D::IsApplicable( S, toCheckAll );
+}
+
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// Moved here from SMESH_Quadrangle_2D_i.hxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-// $Header$
//
#ifndef _SMESH_QUADRANGLE_2D_I_HXX_
#define _SMESH_QUADRANGLE_2D_I_HXX_
public virtual POA_StdMeshers::StdMeshers_Quadrangle_2D,
public virtual SMESH_2D_Algo_i
{
-public:
+ public:
// Constructor
StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_Quadrangle_2D_i();
// Get implementation
::StdMeshers_Quadrangle_2D* GetImpl();
+
+ // Return true if the algorithm is applicable to a shape
+ static CORBA::Boolean IsApplicable(const TopoDS_Shape &S, CORBA::Boolean toCheckAll);
};
#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
return ( ::StdMeshers_RadialQuadrangle_1D2D* )myBaseImpl;
}
+//-----------------------------------------------------------------------------
+
+CORBA::Boolean StdMeshers_RadialQuadrangle_1D2D_i::IsApplicable( const TopoDS_Shape &S, CORBA::Boolean toCheckAll )
+{
+ return ::StdMeshers_RadialQuadrangle_1D2D::IsApplicable( S, toCheckAll );
+}
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// Get implementation
::StdMeshers_RadialQuadrangle_1D2D* GetImpl();
+
+ // Return true if the algorithm is applicable to a shape
+ static CORBA::Boolean IsApplicable(const TopoDS_Shape &S, CORBA::Boolean toCheckAll);
};
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
+// File : StdMeshers_Reversible1D_i.cxx
+// Module : SMESH
+//
+#include "StdMeshers_Reversible1D_i.hxx"
+#include "SMESH_PythonDump.hxx"
+
+#include <Utils_CorbaException.hxx>
+#include <utilities.h>
+
+#include CORBA_SERVER_HEADER(SMESH_Hypothesis)
+
+//================================================================================
+/*!
+ * \brief Constructor
+ */
+//================================================================================
+
+StdMeshers_Reversible1D_i::StdMeshers_Reversible1D_i( SMESH_Hypothesis_i* reversible )
+ : myHyp( reversible )
+{
+}
+
+//=============================================================================
+/*!
+ * StdMeshers_Reversible1D_i::SetReversedEdges
+ *
+ * Set edges to reverse
+ */
+//=============================================================================
+
+void StdMeshers_Reversible1D_i::SetReversedEdges( const SMESH::long_array& theIds )
+{
+ try {
+ std::vector<int> ids( theIds.length() );
+ CORBA::Long iEnd = theIds.length();
+ for ( CORBA::Long i = 0; i < iEnd; i++ )
+ ids[ i ] = theIds[ i ];
+
+ this->GetImpl()->SetReversedEdges( ids );
+ }
+ catch ( SALOME_Exception& S_ex ) {
+ THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
+ }
+
+ // Update Python script
+ SMESH::TPythonDump() << myHyp->_this() << ".SetReversedEdges( " << theIds << " )";
+}
+
+//=============================================================================
+/*!
+ * StdMeshers_Reversible1D_i::SetObjectEntry
+ *
+ * Set the Entry for the Main Object
+ */
+//=============================================================================
+
+void StdMeshers_Reversible1D_i::SetObjectEntry( const char* theEntry )
+{
+ string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping
+ try {
+ this->GetImpl()->SetObjectEntry( entry.c_str() );
+ // Update Python script
+ SMESH::TPythonDump() << myHyp->_this() << ".SetObjectEntry( \"" << entry.c_str() << "\" )";
+ }
+ catch ( SALOME_Exception& S_ex ) {
+ THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),SALOME::BAD_PARAM );
+ }
+}
+
+//=============================================================================
+/*!
+ * StdMeshers_Reversible1D_i::GetObjectEntry
+ *
+ * Set the Entry for the Main Object
+ */
+//=============================================================================
+
+char* StdMeshers_Reversible1D_i::GetObjectEntry()
+{
+ const char* entry;
+ try {
+ entry = this->GetImpl()->GetObjectEntry();
+ }
+ catch ( SALOME_Exception& S_ex ) {
+ THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
+ }
+ return CORBA::string_dup( entry );
+}
+
+//=============================================================================
+/*!
+ * StdMeshers_Reversible1D_i::GetReversedEdges
+ *
+ * Get reversed edges
+ */
+//=============================================================================
+
+SMESH::long_array* StdMeshers_Reversible1D_i::GetReversedEdges()
+{
+ SMESH::long_array_var anArray = new SMESH::long_array;
+ std::vector<int> ids = this->GetImpl()->GetReversedEdges();
+ anArray->length( ids.size() );
+ for ( CORBA::Long i = 0; i < ids.size(); i++)
+ anArray [ i ] = ids [ i ];
+
+ return anArray._retn();
+}
+
+//=============================================================================
+/*!
+ * StdMeshers_Reversible1D_i::GetImpl
+ *
+ * Get implementation
+ */
+//=============================================================================
+
+::StdMeshers_Reversible1D* StdMeshers_Reversible1D_i::GetImpl()
+{
+ return ( ::StdMeshers_Reversible1D* )myHyp->GetImpl();
+}
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
+// File : StdMeshers_Reversible1D_i.hxx
+// Module : SMESH
+//
+#ifndef _SMESH_Reversible1D_I_HXX_
+#define _SMESH_Reversible1D_I_HXX_
+
+#include "SMESH_StdMeshers_I.hxx"
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
+
+#include "SMESH_Hypothesis_i.hxx"
+#include "StdMeshers_Reversible1D.hxx"
+
+// ======================================================
+// Common metrhods of Reversible 1D hypotheses
+// ======================================================
+class STDMESHERS_I_EXPORT StdMeshers_Reversible1D_i:
+ public virtual POA_StdMeshers::Reversible1D
+{
+ public:
+ StdMeshers_Reversible1D_i( SMESH_Hypothesis_i* reversible );
+
+ //Set Reversed Edges
+ void SetReversedEdges( const SMESH::long_array& theIDs);
+
+ //Get Reversed Edges
+ SMESH::long_array* GetReversedEdges();
+
+ //Set the Entry of the Object
+ void SetObjectEntry( const char* theEntry);
+
+ //Get Object Entry
+ char* GetObjectEntry();
+
+ // Get implementation
+ ::StdMeshers_Reversible1D* GetImpl();
+
+ private:
+ SMESH_Hypothesis_i* myHyp;
+};
+
+#endif
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
*/
//================================================================================
-void StdMeshers_ViscousLayers_i::SetIgnoreFaces(const ::SMESH::long_array& faceIDs)
-throw ( SALOME::SALOME_Exception )
+void StdMeshers_ViscousLayers_i::SetFaces(const ::SMESH::long_array& faceIDs,
+ CORBA::Boolean toIgnore)
+ throw ( SALOME::SALOME_Exception )
{
vector<int> ids( faceIDs.length() );
for ( unsigned i = 0; i < ids.size(); ++i )
if (( ids[i] = faceIDs[i] ) < 1 )
THROW_SALOME_CORBA_EXCEPTION( "Invalid face id", SALOME::BAD_PARAM );
- GetImpl()->SetBndShapes( ids, /*toIgnore=*/true );
- SMESH::TPythonDump() << _this() << ".SetIgnoreFaces( " << faceIDs << " )";
+
+ GetImpl()->SetBndShapes( ids, toIgnore );
+
+ SMESH::TPythonDump() << _this() << ".SetFaces( " << faceIDs << ", " << toIgnore << " )";
}
//================================================================================
*/
//================================================================================
-SMESH::long_array* StdMeshers_ViscousLayers_i::GetIgnoreFaces()
+SMESH::long_array* StdMeshers_ViscousLayers_i::GetFaces()
{
+ vector<int> idsVec = GetImpl()->GetBndShapes();
SMESH::long_array_var ids = new SMESH::long_array;
- if ( GetImpl()->IsToIgnoreShapes() )
- {
- vector<int> idsVec = GetImpl()->GetBndShapes();
- ids->length( idsVec.size() );
- for ( unsigned i = 0; i < idsVec.size(); ++i )
- ids[i] = idsVec[i];
- }
+ ids->length( idsVec.size() );
+ for ( unsigned i = 0; i < idsVec.size(); ++i )
+ ids[i] = idsVec[i];
return ids._retn();
}
*/
//================================================================================
+SMESH::long_array* StdMeshers_ViscousLayers_i::GetIgnoreFaces()
+{
+ if ( GetImpl()->IsToIgnoreShapes() )
+ return this->GetFaces();
+ return new SMESH::long_array;
+}
+
+//================================================================================
+/*!
+ * \brief
+ */
+//================================================================================
+
+CORBA::Boolean StdMeshers_ViscousLayers_i::GetIsToIgnoreFaces()
+{
+ return GetImpl()->IsToIgnoreShapes();
+}
+
+//================================================================================
+/*!
+ * \brief
+ */
+//================================================================================
+
+void StdMeshers_ViscousLayers_i::SetIgnoreFaces(const ::SMESH::long_array& faceIDs)
+throw ( SALOME::SALOME_Exception )
+{
+ vector<int> ids( faceIDs.length() );
+ for ( unsigned i = 0; i < ids.size(); ++i )
+ if (( ids[i] = faceIDs[i] ) < 1 )
+ THROW_SALOME_CORBA_EXCEPTION( "Invalid face id", SALOME::BAD_PARAM );
+ GetImpl()->SetBndShapes( ids, /*toIgnore=*/true );
+ SMESH::TPythonDump() << _this() << ".SetIgnoreFaces( " << faceIDs << " )";
+}
+
+//================================================================================
+/*!
+ * \brief
+ */
+//================================================================================
+
void StdMeshers_ViscousLayers_i::SetTotalThickness(::CORBA::Double thickness)
throw ( SALOME::SALOME_Exception )
{
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
void SetIgnoreFaces(const ::SMESH::long_array& faceIDs) throw ( SALOME::SALOME_Exception );
SMESH::long_array* GetIgnoreFaces();
+ void SetFaces(const SMESH::long_array& faceIDs,
+ CORBA::Boolean toIgnore) throw (SALOME::SALOME_Exception);
+ SMESH::long_array* GetFaces();
+ CORBA::Boolean GetIsToIgnoreFaces();
+
void SetTotalThickness(::CORBA::Double thickness) throw ( SALOME::SALOME_Exception );
::CORBA::Double GetTotalThickness();
-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "StdMeshers_AutomaticLength_i.hxx"
#include "StdMeshers_StartEndLength_i.hxx"
#include "StdMeshers_Arithmetic1D_i.hxx"
+#include "StdMeshers_Geometric1D_i.hxx"
#include "StdMeshers_FixedPoints1D_i.hxx"
#include "StdMeshers_NumberOfSegments_i.hxx"
#include "StdMeshers_Deflection1D_i.hxx"
#include "StdMeshers_ViscousLayers2D_i.hxx"
#include "StdMeshers_CartesianParameters3D_i.hxx"
-template <class T> class StdHypothesisCreator_i:public HypothesisCreator_i<T>
+namespace SMESH {
+ class ApplicableToAny
+ {
+ public:
+ static CORBA::Boolean IsApplicable( const TopoDS_Shape &S, CORBA::Boolean toCheckAll ) {
+ return true;
+ }
+ };
+};
+template <class T, class TIsApplicable = SMESH::ApplicableToAny> class StdHypothesisCreator_i:public HypothesisCreator_i<T>
{
public:
// as we have 'module StdMeshers' in SMESH_BasicHypothesis.idl
virtual std::string GetModuleName() { return "StdMeshers"; }
+ virtual CORBA::Boolean IsApplicable( const TopoDS_Shape & S, CORBA::Boolean toCheckAll ) {
+ return TIsApplicable::IsApplicable( S, toCheckAll );
+ }
};
//=============================================================================
aCreator = new StdHypothesisCreator_i<StdMeshers_NotConformAllowed_i>;
else if (strcmp(aHypName, "Propagation") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_Propagation_i>;
+ else if (strcmp(aHypName, "PropagOfDistribution") == 0)
+ aCreator = new StdHypothesisCreator_i<StdMeshers_PropagOfDistribution_i>;
else if (strcmp(aHypName, "MaxElementArea") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_MaxElementArea_i>;
else if (strcmp(aHypName, "MaxElementVolume") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_FixedPoints1D_i>;
else if (strcmp(aHypName, "Arithmetic1D") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_Arithmetic1D_i>;
+ else if (strcmp(aHypName, "GeometricProgression") == 0)
+ aCreator = new StdHypothesisCreator_i<StdMeshers_Geometric1D_i>;
else if (strcmp(aHypName, "AutomaticLength") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_AutomaticLength_i>;
else if (strcmp(aHypName, "QuadranglePreference") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_MEFISTO_2D_i>;
#endif
else if (strcmp(aHypName, "Quadrangle_2D") == 0)
- aCreator = new StdHypothesisCreator_i<StdMeshers_Quadrangle_2D_i>;
+ aCreator = new StdHypothesisCreator_i<StdMeshers_Quadrangle_2D_i, StdMeshers_Quadrangle_2D_i>;
else if (strcmp(aHypName, "Hexa_3D") == 0)
- aCreator = new StdHypothesisCreator_i<StdMeshers_Hexa_3D_i>;
+ aCreator = new StdHypothesisCreator_i<StdMeshers_Hexa_3D_i, StdMeshers_Hexa_3D_i>;
else if (strcmp(aHypName, "Projection_1D") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_Projection_1D_i>;
else if (strcmp(aHypName, "Projection_1D2D") == 0)
else if (strcmp(aHypName, "Projection_2D") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_Projection_2D_i>;
else if (strcmp(aHypName, "Projection_3D") == 0)
- aCreator = new StdHypothesisCreator_i<StdMeshers_Projection_3D_i>;
+ aCreator = new StdHypothesisCreator_i<StdMeshers_Projection_3D_i, StdMeshers_Hexa_3D_i>;
else if (strcmp(aHypName, "Prism_3D") == 0)
- aCreator = new StdHypothesisCreator_i<StdMeshers_Prism_3D_i>;
+ aCreator = new StdHypothesisCreator_i<StdMeshers_Prism_3D_i, StdMeshers_Prism_3D_i>;
else if (strcmp(aHypName, "RadialPrism_3D") == 0)
- aCreator = new StdHypothesisCreator_i<StdMeshers_RadialPrism_3D_i>;
+ aCreator = new StdHypothesisCreator_i<StdMeshers_RadialPrism_3D_i, StdMeshers_RadialPrism_3D_i>;
else if (strcmp(aHypName, "SegmentAroundVertex_0D") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_SegmentAroundVertex_0D_i>;
else if (strcmp(aHypName, "CompositeSegment_1D") == 0)
else if (strcmp(aHypName, "UseExisting_2D") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_UseExisting_2D_i>;
else if (strcmp(aHypName, "RadialQuadrangle_1D2D") == 0)
- aCreator = new StdHypothesisCreator_i<StdMeshers_RadialQuadrangle_1D2D_i>;
+ aCreator = new StdHypothesisCreator_i<StdMeshers_RadialQuadrangle_1D2D_i, StdMeshers_RadialQuadrangle_1D2D_i>;
else if (strcmp(aHypName, "Import_1D") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_Import_1D_i>;
else if (strcmp(aHypName, "Import_1D2D") == 0)
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
ADD_SUBDIRECTORY(MeshCut)
ADD_SUBDIRECTORY(padder)
ADD_SUBDIRECTORY(Verima)
+ADD_SUBDIRECTORY(blocFissure)
+ADD_SUBDIRECTORY(MacMesh)
IF(SALOME_BUILD_GUI)
ADD_SUBDIRECTORY(MGCleanerPlug)
ADD_SUBDIRECTORY(YamsPlug)
+ ADD_SUBDIRECTORY(ZCracksPlug)
ENDIF(SALOME_BUILD_GUI)
# scripts / static
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013 EDF R&D
+# Copyright (C) 2007-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013 EDF R&D
+# Copyright (C) 2007-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2013 EDF R&D
+# Copyright (C) 2006-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# General substitutions.
project = 'MGCleaner Plug-in'
-copyright = '2013, CEA'
+copyright = '2013-2014, CEA'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
--- /dev/null
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+SET(MACMESH_INSTALL_PY ${SALOME_SMESH_INSTALL_PLUGINS}/MacMesh)
+SET(MACMESH_INSTALL_DOC ${SALOME_INSTALL_DOC}/gui/SMESH/MacMesh)
+
+SALOME_CONFIGURE_FILE(Doc/index.html.in index.html)
+SALOME_CONFIGURE_FILE(Example/PressureValve.py.in PressureValve.py)
+
+SET(plugin_DOC_FILES
+ Doc/MacMesh.v.10avr.pdf
+ ${CMAKE_CURRENT_BINARY_DIR}/index.html
+ Doc/snap.jpg
+ )
+
+IF(SALOME_BUILD_DOC)
+ INSTALL(FILES ${plugin_DOC_FILES} DESTINATION ${MACMESH_INSTALL_DOC})
+ENDIF(SALOME_BUILD_DOC)
+
+# --- scripts ---
+
+# scripts / static
+SET(plugin_SCRIPTS
+ MacMesh/Alarms.py
+ MacMesh/CentralUnrefine.py
+ MacMesh/CompositeBox.py
+ MacMesh/CompositeBoxF.py
+ MacMesh/Config.py
+ MacMesh/CutnGroup.py
+ MacMesh/Cylinder.py
+ MacMesh/GenFunctions.py
+ MacMesh/MacObject.py
+ MacMesh/PublishGroups.py
+ MacMesh/SharpAngle.py
+)
+SET(sample_SCRIPT
+ ${CMAKE_CURRENT_BINARY_DIR}/PressureValve.py
+)
+# --- rules ---
+
+SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${MACMESH_INSTALL_PY})
+SALOME_INSTALL_SCRIPTS("${sample_SCRIPT}" ${SALOME_INSTALL_SCRIPT_PYTHON} DEF_PERMS)
+
+SET(testname MacMesh_Example_PressureValve)
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+ADD_TEST(
+ NAME ${testname}
+ COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/doc/salome/examples/testme.py ${sample_SCRIPT})
+SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}")
+
--- /dev/null
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>MacMesh for Salome</title>
+ </head>
+ <h1>The multi-purpose Salome plug-in for regular 2D meshing </h1>
+ <ul>
+ <li>Consider reading <a href="MacMesh.v.10avr.pdf">
+ User manual </a> to learn how to use the plug-in</li>
+ <li>Type <em><font color="brown">import PressureValve</font></em> in the Python console of
+ Salome to run a sample script</li>
+ <li> <a href="../../../../../../@SALOME_INSTALL_SCRIPT_PYTHON@/PressureValve.py">
+ Download the sample script</a></li>
+ <li>Python files of the plugin are located in <br><font color="brown">
+ ${SMESH_ROOT_DIR}/@MACMESH_INSTALL_PY@ </font> directory</li>
+ </ul>
+ <img src="snap.jpg" width="100%">
+ </body>
+</html>
--- /dev/null
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+##################################################################
+# Header for salome initialization ###############################
+
+import sys, salome, math, os
+sys.path.append( os.path.join( os.getenv('SMESH_ROOT_DIR'), '@MACMESH_INSTALL_PY@'))
+
+import Config, GenFunctions
+
+Config.theStudy = salome.myStudy;
+
+from MacObject import *
+from SharpAngle import *
+from CentralUnrefine import *
+from PublishGroups import *
+from CompositeBox import *
+from CompositeBoxF import *
+
+
+
+##################################################################
+# Mesh name ######################################################
+
+Config.StudyName = "SRV_X."
+
+##################################################################
+# Definition of geometrical parameters ###########################
+
+X = 1.0 # Valve initial opening
+
+Config.StudyName += str(X)+"mm"
+
+R = 7.5 # Upstream pipe radius
+T = 5.0 # Upstream pipe thickness
+H = 20.0 # Upstream pipe height
+J = 6.0 # Jet distance
+E = 60.0 # Exit extent
+
+##################################################################
+# Definition of meshing parameters ###############################
+
+d = 0.1 # Meshing element size at the inner corner
+Nl = 1 # Number of levels in the local refinement
+##################################################################
+Bloc = []
+
+# Object No. 1 #
+Bloc.append( SharpAngleOut(0.,0.,X,1.5*X,X,d,'NE',Nl,
+ groups=['PH','PV_IN','VH',None,None,None]) )
+
+# Object No. 2 #
+Bloc.append( CompositeBox(X/2.+0.5*(R-X/2.),0.5*(X+X/2.)-X/2.,R-X/2.,X+X/2.,
+ groups=[None,'VH',None,'AXIS'] ) )
+
+# Object No. 3 #
+Bloc.append( CompositeBoxF((0.,-X/2.),(R,-X/2.),(R,-H),(0.,-H),
+ groups=['IN',None,'PV_IN','AXIS'] ) )
+
+# Object No. 4 #
+Bloc.append( SharpAngleOut(-T,0.,X,X,X,d,'NW',Nl,
+ groups=['PH','PV_OUT',None,None,None,None]) )
+
+# Object No. 5 #
+Bloc.append( SharpAngleOut(-T,X,X,X,X,d,'SW',Nl,
+ groups=['VH','VV',None,None,None,None]) )
+
+if X < T :
+ gap = T-X
+ Bloc.append( MacObject('CompBoxF',[(-X/2.-gap/2.,X/2.),(gap,X)],
+ ['auto'],groups=['PH','VH',None,None] ) )
+
+# Object No. 6 #
+Bloc.append( MacObject('CompBoxF',[(-T-X/2.-(J-X/2.)/2.,X/2.),(J-X/2.,2.*X)],
+ ['auto'],groups=[None,None,None,None] ) )
+
+# Object No. 7 #
+Bloc.append( CentralUnrefine(-T-J,X/2.,2.*E-J,E,'EW',
+ groups=[None,None,None,'OUT_V','OUT_H_HI','OUT_H_LO']))
+
+# Object No. 8 #
+Bloc.append( CompositeBox(-T-J/2.,-X/2.-0.5*((E-X)/2.-X/2.),J,(E-X)/2.-X/2.,
+ groups=['OUT_H_LO',None,None,'PV_OUT'] ) )
+
+# Object No. 9 #
+Bloc.append( CompositeBox(-T-J/2.,X+X/2.+0.5*((E-X)/2.-X/2.),J,(E-X)/2.-X/2.,
+ groups=[None,'OUT_H_HI',None,'VV'] ) )
+
+SRVMesh = PublishGroups()
+
+RealLocalMeshing = Bloc[0][0].GeoPar[1][0]/Bloc[0][0].DirectionalMeshParams[0]
+ExtrusionAngle = 2. * math.asin(RealLocalMeshing/(2*R))*180./math.pi
+print "\nThe mesh will be revolved with an angle of :",ExtrusionAngle
+
+RevolveMesh(SRVMesh, Center=[R+0.01,0,0], Direction=[0,1,0], AngleDeg=ExtrusionAngle, Scale=0.001)
+
--- /dev/null
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+def Message (code) :
+ import sys
+ MessageString = { 1 : lambda x: "Successfully created \n",
+ 2 : lambda x: "Fatal: Incorrect input \n",
+ 3 : lambda x: "Fatal: Overlapping objects detected \n",
+ 4 : lambda x: "Fatal: Incompatible object type with neighbouring objects" }[code](str(code))
+ print MessageString
+ #if code > 1 : sys.exit()
+ return 1
+
--- /dev/null
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# 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 object allows unrefining from a central point (actually, a line) to the exterior
+# X0 and Y0 are the center points of the origin point and not those of the center of the generated block
+
+
+
+import sys, math, commands
+CWD = commands.getoutput('pwd')
+sys.path.append(CWD)
+
+from MacObject import *
+import Config, GenFunctions
+
+def CentralUnrefine (X0 , Y0 , DX , DY , Orientation, **args ) :
+
+ DirPar = {'SN' : lambda : ['NW', 'NE', 'EW', 'NW', 'SN', 'SN', 'NE', 'WE'],
+ 'NS' : lambda : ['SE', 'SW', 'WE', 'SE', 'NS', 'NS', 'SW', 'EW'],
+ 'EW' : lambda : ['NW', 'SW', 'SN', 'NW', 'EW', 'EW', 'SW', 'NS'],
+ 'WE' : lambda : ['SE', 'NE', 'NS', 'SE', 'WE', 'WE', 'NE', 'SN'], }[Orientation]()
+
+ CoefVer = {'SN' : lambda : 1.,
+ 'NS' : lambda : -1.,
+ 'EW' : lambda : 0.,
+ 'WE' : lambda : 0., }[Orientation]()
+
+ CoefHor = {'SN' : lambda : 0.,
+ 'NS' : lambda : 0.,
+ 'EW' : lambda : -1.,
+ 'WE' : lambda : 1., }[Orientation]()
+
+
+ MacObject('CompBoxF',[(X0+CoefHor*DX/2,Y0+CoefVer*DY/2),(DX,DY)],['auto'],publish=0)
+ ToLook1 = {'SN' : lambda : 2,
+ 'NS' : lambda : 3,
+ 'EW' : lambda : 1,
+ 'WE' : lambda : 0, }[Orientation]()
+
+ ToLook2 = {'SN' : lambda : 0,
+ 'NS' : lambda : 0,
+ 'EW' : lambda : 2,
+ 'WE' : lambda : 2, }[Orientation]()
+
+ ToLook3 = {'SN' : lambda : [0,1,2,3],
+ 'NS' : lambda : [1,0,3,2],
+ 'EW' : lambda : [3,2,1,0],
+ 'WE' : lambda : [2,3,0,1], }[Orientation]()
+
+ if args.__contains__('groups') :
+ GroupNames = args['groups']
+ else : GroupNames = [None, None, None, None, None, None]
+
+ ExistingSegments = Config.ListObj[-1].DirectionalMeshParams[ToLook1]
+ ObjIDs = Config.Connections[-1][ToLook1]
+ RemoveLastObj()
+
+ ExtensionSegments = math.ceil(ExistingSegments/12.)*12.
+ Dmin = 1.E50
+ Dmax = -1.E50
+ for ObjID in ObjIDs :
+ Boundaries = Config.ListObj[ObjID].Boundaries()
+ if Boundaries[ToLook2] < Dmin : Dmin = Boundaries[ToLook2]
+ if Boundaries[ToLook2+1] > Dmax : Dmax = Boundaries[ToLook2+1]
+ dx = 0
+ if ExtensionSegments > ExistingSegments :
+ dn = (ExtensionSegments-ExistingSegments)/2.
+ dx = dn*(Dmax-Dmin)/ExistingSegments
+ #MacObject('CompBoxF',[(X0-CoefHor*dx/2+CoefVer*(-X0+Dmin-dx/2),Y0-CoefVer*dx/2+CoefHor*(-Y0+Dmin-dx/2)),(dx,dx)],[(dn,dn)],publish=0)
+ #MacObject('CompBoxF',[(X0-CoefHor*dx/2+CoefVer*(-X0+Dmax+dx/2),Y0-CoefVer*dx/2+CoefHor*(-Y0+Dmax+dx/2)),(dx,dx)],[(dn,dn)],publish=0)
+
+ BoxSide = (Dmax-Dmin+2*dx)/2.
+
+ Obj = []
+ Obj.append(MacObject('BoxAng32',[(X0+CoefHor*(BoxSide/2)+CoefVer*(-BoxSide/2),Y0+CoefVer*(BoxSide/2)+CoefHor*(-BoxSide/2)),(BoxSide,BoxSide)],[int(ExtensionSegments/6),DirPar[0]],groups=GroupArray(ToLook3[0],GroupNames[0])))
+ Obj.append(MacObject('BoxAng32',[(X0+CoefHor*(BoxSide/2)+CoefVer*(BoxSide/2),Y0+CoefVer*(BoxSide/2)+CoefHor*(BoxSide/2)),(BoxSide,BoxSide)],[int(ExtensionSegments/6),DirPar[1]],groups=GroupArray(ToLook3[0],GroupNames[0])))
+
+ NLevOpt = 0
+ for NLevels in range (1,100) :
+ DX1 = abs(CoefVer)*BoxSide*2.**(NLevels+1)+abs(CoefHor)*BoxSide*2.**(NLevels)
+ DY1 = abs(CoefHor)*BoxSide*2.**(NLevels+1)+abs(CoefVer)*BoxSide*2.**(NLevels)
+ if DX1 > DX or DY1 > DY :
+ NLevOpt = NLevels-1
+ DXinner = DX1/2.
+ DYinner = DY1/2.
+ break
+
+ dummyArray = [DXinner,DYinner,DYinner,DXinner]
+ D1inner = dummyArray[ToLook2] # = DXinner for SN and NS orientations
+ D2inner = dummyArray[ToLook2+1] # = DYinner for SN and NS orientations
+
+ dummyArray = [DX,DY,DY,DX]
+ D1 = dummyArray[ToLook2] # = DX for SN and NS orientations
+ D2 = dummyArray[ToLook2+1] # = DY for SN and NS orientations
+
+ if D1inner < D1 :
+ GN0a = GroupArray(ToLook3[0],GroupNames[1])
+ GN0b = GroupArray(ToLook3[0],GroupNames[2])
+ GN01 = GroupArray(ToLook3[0],GroupNames[1])
+ GN02 = GroupArray(ToLook3[0],GroupNames[2])
+ if D2inner < D2 :
+ GN10 = [None,None,None,None]
+ GN11 = [None,None,None,None]
+ GN20 = [None,None,None,None]
+ else :
+ GN10 = GroupArray(ToLook3[1],GroupNames[3])
+ GN11 = GroupArray(ToLook3[1],GroupNames[3])
+ GN20 = GroupArray(ToLook3[1],GroupNames[3])
+ else :
+ GN0a = GroupArray(ToLook3[0],GroupNames[1])
+ GN0b = GroupArray(ToLook3[0],GroupNames[2])
+ GN01 = GroupArray([ToLook3[0],ToLook3[2]],[GroupNames[1],GroupNames[4]])
+ GN02 = GroupArray([ToLook3[0],ToLook3[3]],[GroupNames[2],GroupNames[5]])
+ if D2inner < D2 :
+ GN10 = GroupArray(ToLook3[2],GroupNames[4])
+ GN11 = GroupArray(ToLook3[3],GroupNames[5])
+ GN20 = [None,None,None,None]
+ else :
+ GN10 = GroupArray([ToLook3[1],ToLook3[2]],[GroupNames[3],GroupNames[4]])
+ GN11 = GroupArray([ToLook3[1],ToLook3[3]],[GroupNames[3],GroupNames[5]])
+ GN20 = GroupArray(ToLook3[1],GroupNames[3])
+
+ for N in range (1,NLevOpt+1):
+ n=N-1
+ D = BoxSide*(2.**n)
+ if N < NLevOpt :
+ Obj.append(MacObject('Box42' ,[(X0+D*(CoefHor*1/2-CoefVer*3/2) , Y0+D*(CoefVer*1/2-CoefHor*3/2) ) , (D,D)],['auto',DirPar[2]], groups=GN0a))
+ Obj.append(MacObject('BoxAng32',[(X0+D*(CoefHor*3/2-CoefVer*3/2) , Y0+D*(CoefVer*3/2-CoefHor*3/2) ) , (D,D)],['auto',DirPar[3]]))
+ Obj.append(MacObject('Box42' ,[(X0+D*(CoefHor*3/2-CoefVer*1/2) , Y0+D*(CoefVer*3/2-CoefHor*1/2) ) , (D,D)],['auto',DirPar[4]]))
+ Obj.append(MacObject('Box42' ,[(X0+D*(CoefHor*3/2+CoefVer*1/2) , Y0+D*(CoefHor*1/2+CoefVer*3/2) ) , (D,D)],['auto',DirPar[5]]))
+ Obj.append(MacObject('BoxAng32',[(X0+D*(CoefVer*3/2+CoefHor*3/2) , Y0+D*(CoefVer*3/2+CoefHor*3/2) ) , (D,D)],['auto',DirPar[6]]))
+ Obj.append(MacObject('Box42' ,[(X0+D*(CoefVer*3/2+CoefHor*1/2) , Y0+D*(CoefHor*3/2+CoefVer*1/2) ) , (D,D)],['auto',DirPar[7]], groups=GN0b))
+ else :
+ Obj.append(MacObject('Box42' ,[(X0+D*(CoefHor*1/2-CoefVer*3/2) , Y0+D*(CoefVer*1/2-CoefHor*3/2) ) , (D,D)],['auto',DirPar[2]], groups=GN01))
+ Obj.append(MacObject('BoxAng32',[(X0+D*(CoefHor*3/2-CoefVer*3/2) , Y0+D*(CoefVer*3/2-CoefHor*3/2) ) , (D,D)],['auto',DirPar[3]], groups=GN10))
+ Obj.append(MacObject('Box42' ,[(X0+D*(CoefHor*3/2-CoefVer*1/2) , Y0+D*(CoefVer*3/2-CoefHor*1/2) ) , (D,D)],['auto',DirPar[4]], groups=GN20))
+ Obj.append(MacObject('Box42' ,[(X0+D*(CoefHor*3/2+CoefVer*1/2) , Y0+D*(CoefHor*1/2+CoefVer*3/2) ) , (D,D)],['auto',DirPar[5]], groups=GN20))
+ Obj.append(MacObject('BoxAng32',[(X0+D*(CoefVer*3/2+CoefHor*3/2) , Y0+D*(CoefVer*3/2+CoefHor*3/2) ) , (D,D)],['auto',DirPar[6]], groups=GN11))
+ Obj.append(MacObject('Box42' ,[(X0+D*(CoefVer*3/2+CoefHor*1/2) , Y0+D*(CoefHor*3/2+CoefVer*1/2) ) , (D,D)],['auto',DirPar[7]], groups=GN02))
+
+
+ if CoefVer and DX>DXinner :
+ Obj.append(MacObject('CompBoxF',[(X0-CoefVer*0.25*(DX+DXinner),Y0+CoefVer*DYinner/2),((DX-DXinner)/2,DYinner)],['auto'], groups = GroupArray([ToLook3[0],ToLook3[2]],[GroupNames[1],GroupNames[4]])))
+ Obj.append(MacObject('CompBoxF',[(X0+CoefVer*0.25*(DX+DXinner),Y0+CoefVer*DYinner/2),((DX-DXinner)/2,DYinner)],['auto'], groups = GroupArray([ToLook3[0],ToLook3[3]],[GroupNames[2],GroupNames[5]])))
+ if DY>DYinner :
+ Obj.append(MacObject('CompBoxF',[(X0-CoefVer*0.25*(DX+DXinner),Y0+CoefVer*(DY+DYinner)/2.),((DX-DXinner)/2,DY-DYinner)],['auto'], groups = GroupArray([ToLook3[1],ToLook3[2]],[GroupNames[3],GroupNames[4]])))
+ Obj.append(MacObject('CompBoxF',[(X0+CoefVer*0.25*(DX+DXinner),Y0+CoefVer*(DY+DYinner)/2.),((DX-DXinner)/2,DY-DYinner)],['auto'], groups = GroupArray([ToLook3[1],ToLook3[3]],[GroupNames[3],GroupNames[5]])))
+ Obj.append(MacObject('CompBoxF',[(X0,Y0+CoefVer*(DY+DYinner)/2.),(DXinner,DY-DYinner)],['auto'], groups = GroupArray(ToLook3[1],GroupNames[3])))
+ elif CoefHor and DY>DYinner :
+ Obj.append(MacObject('CompBoxF',[(X0+CoefHor*DXinner/2,Y0-CoefHor*0.25*(DY+DYinner)),(DXinner,(DY-DYinner)/2)],['auto'], groups = GroupArray([ToLook3[0],ToLook3[2]],[GroupNames[1],GroupNames[4]])))
+ Obj.append(MacObject('CompBoxF',[(X0+CoefHor*DXinner/2,Y0+CoefHor*0.25*(DY+DYinner)),(DXinner,(DY-DYinner)/2)],['auto'], groups = GroupArray([ToLook3[0],ToLook3[3]],[GroupNames[2],GroupNames[5]])))
+ if DX>DXinner :
+ Obj.append(MacObject('CompBoxF',[(X0+CoefHor*(DX+DXinner)/2.,Y0-CoefHor*0.25*(DY+DYinner)),(DX-DXinner,(DY-DYinner)/2)],['auto'], groups = GroupArray([ToLook3[1],ToLook3[2]],[GroupNames[3],GroupNames[4]])))
+ Obj.append(MacObject('CompBoxF',[(X0+CoefHor*(DX+DXinner)/2.,Y0+CoefHor*0.25*(DY+DYinner)),(DX-DXinner,(DY-DYinner)/2)],['auto'], groups = GroupArray([ToLook3[1],ToLook3[3]],[GroupNames[3],GroupNames[5]])))
+ Obj.append(MacObject('CompBoxF',[(X0+CoefHor*(DX+DXinner)/2.,Y0),(DX-DXinner,DYinner)],['auto'], groups = GroupArray(ToLook3[1],GroupNames[3])))
+ return Obj
+
+def RemoveLastObj() :
+ Config.ListObj = Config.ListObj[:-1]
+ Config.Connections = Config.Connections[:-1]
+
+def GroupArray(indices, GroupNames) :
+ if type(indices) is int :
+ indices = [indices]
+ GroupNames = [GroupNames]
+ Output = [None,None,None,None]
+ for i, ind in enumerate(indices) :
+ Output[ind] = GroupNames[i]
+ return Output
--- /dev/null
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
+# INTRODUCTION HERE
+
+import sys, math, copy, commands
+CWD = commands.getoutput('pwd')
+sys.path.append(CWD)
+
+from MacObject import *
+import Config, GenFunctions
+
+def CompositeBox (X0 , Y0 , DX , DY , **args ) :
+
+ if args.__contains__('groups') :
+ GroupNames = args['groups']
+ else : GroupNames = [None, None, None, None]
+ # Create a full Box just to inherit, globally, the mesh parameters of bounding objects
+ MacObject('CompBoxF',[(X0,Y0),(DX,DY)],['auto'],publish=0)
+
+ # Save the existing number of segments on each direction
+ ExistingSegments = Config.ListObj[-1].DirectionalMeshParams
+
+ # Sort the connection list for the full Box
+ ObjIDLists = SortObjLists(Config.Connections[-1],X0 , Y0 , DX , DY )
+ RemoveLastObj()
+
+ print "ObjIDLists: ", ObjIDLists
+
+ RealSegments = []
+ Direction = []
+ flag = 0
+ if not(args.__contains__('recursive')) : Config.Count = 0
+ print "Config.Count : ", Config.Count
+ Config.Criterion = GetCriterion(ObjIDLists)
+ for index, ObjList in enumerate(ObjIDLists) :
+ if not (ObjList[0] == -1 or Config.Count >= Config.Criterion):
+ if len(ObjList)>1 : flag = 1
+ else : flag = 0
+ for ObjID in ObjList:
+ ToLook0 = [2,2,0,0][index]
+ ToLook1 = [3,2,1,0][index]
+ CommonSide = FindCommonSide(Config.ListObj[ObjID].DirBoundaries(ToLook1),[X0-DX/2.,X0+DX/2.,Y0-DY/2.,Y0+DY/2.][ToLook0:ToLook0+2])
+ ToLook2 = [1,0,3,2][index]
+ RealSegments.append(Config.ListObj[ObjID].DirectionalMeshParams[ToLook2]*IntLen(CommonSide)/IntLen(Config.ListObj[ObjID].DirBoundaries(ToLook1)))
+ Direction.append(ToLook0/2)
+
+ if flag and Config.Count < Config.Criterion:
+ if index < 2 :
+ if abs(CommonSide[0] - (Y0-DY/2.))<1e-7 : SouthGR = GroupNames[0]
+ else : SouthGR = None
+ if abs(CommonSide[1] - (Y0+DY/2.))<1e-7 : NorthGR = GroupNames[1]
+ else : NorthGR = None
+ CompositeBox (X0, CommonSide[0]+IntLen(CommonSide)/2., DX,IntLen(CommonSide), recursive=1, groups = [SouthGR,NorthGR]+GroupNames[2:4])
+ else :
+ if abs(CommonSide[0] - (X0-DX/2.))<1e-7 : EastGR = GroupNames[2]
+ else : EastGR = None
+ if abs(CommonSide[1] - (X0+DX/2.))<1e-7 : WestGR = GroupNames[3]
+ else : WestGR = None
+ CompositeBox (CommonSide[0]+IntLen(CommonSide)/2., Y0, IntLen(CommonSide),DY, recursive=1, groups = GroupNames[0:2]+[EastGR,WestGR])
+
+ if Config.Count >= Config.Criterion :
+ break
+ if flag == 0 and Config.Count < Config.Criterion:
+ #print "Dir : ", Direction
+ #print "RealSegments : ", RealSegments
+
+ #Xind = Direction.index(0)
+ #Yind = Direction.index(1)
+ #MacObject('CompBoxF',[(X0,Y0),(DX,DY)] ,[(RealSegments[Xind],RealSegments[Yind])], groups = GroupNames)
+ MacObject('CompBoxF',[(X0,Y0),(DX,DY)] ,['auto'], groups = GroupNames)
+
+ Config.Count += 1
+
+
+def FindCommonSide (Int1, Int2) :
+ if abs(min(Int1[1],Int2[1])-max(Int1[0],Int2[0])) < 1e-5: return [0,0]
+ else : return [max(Int1[0],Int2[0]), min(Int1[1],Int2[1])]
+
+def IntLen (Interval) :
+ return abs(Interval[1]-Interval[0])
+
+def RemoveLastObj() :
+ Config.ListObj = Config.ListObj[:-1]
+ Config.Connections = Config.Connections[:-1]
+
+def GetCriterion (ObjListIDs):
+ return max(Config.Criterion, max(len(ObjListIDs[0]),len(ObjListIDs[1]))*max(len(ObjListIDs[2]),len(ObjListIDs[3])))
+
+def SortObjLists (List,X0,Y0,DX,DY) :
+ """
+ This function sorts the list of neighbouring objects on each side, according to their intersection
+ with the object being created. From South to North and from East to West
+ """
+ Output = List
+ # First find the directions where no neighbour exists
+ # Important : Here we assume that exactly two directions have no neighbours !!!
+ # Should we change this to allow a more general case ????
+ dummy = IndexMultiOcc(List,(-1,))
+
+ # dummy[0] is either 0, meaning there is no neighbour on X- (West)
+ # or 1, meaning there is no neighbour on X+ (East)
+ # Similarly dummy[1] can be either 2 or 3 (South and North respectively)
+ # In order to get back to the formalism of groups (SNWE)
+ # => we do the following to define Sense of no neighbours and then the Direction list
+ # is calculated as to include uniquely the directions where we DO have neighbours
+ if len(dummy) == 1 :
+ # This adds a second direction where neighbours are not regarded, it is either 0 or 2
+ dummy.append(2*(dummy[0]+2<4))
+ print("Careful, you have neighbours on 3 or more sides of the box, we will not check if on two parallel sides the boxes are compatible !!!")
+ if len(dummy) == 2 or len(dummy) == 1 :
+ # Sense contains : Vertical then Horizontal
+ Sense = [dummy[1]%2,dummy[0]]
+ DirList = [[1,0][dummy[0]],[3,2][dummy[1]%2]]
+ for index,Direction in enumerate(DirList) :
+ ObjList = List[Direction]
+ RankMin = []
+ ToLook0 = [2,2,0,0][Direction]
+ ToLook1 = [3,2,1,0][Direction]
+ for index1,ObjID in enumerate(ObjList) :
+ RankMin.append([-1.,1.][Sense[index]] * FindCommonSide(Config.ListObj[ObjID].DirBoundaries(ToLook1),[X0-DX/2.,X0+DX/2.,Y0-DY/2.,Y0+DY/2.][ToLook0:ToLook0+2])[Sense[index]])
+ Output[Direction] = SortList(ObjList,RankMin)
+
+ elif len(dummy) == 3 :
+ # We find the direction where we do have neighbours and then we sort the object list along it
+ Sense = dummy[0]%2
+ Direction = [ i not in dummy for i in range(4) ].index(True)
+ ObjList = List[Direction]
+ RankMin = []
+ ToLook0 = [2,2,0,0][Direction]
+ ToLook1 = [3,2,1,0][Direction]
+ for index1,ObjID in enumerate(ObjList) :
+ RankMin.append([-1.,1.][Sense] * FindCommonSide(Config.ListObj[ObjID].DirBoundaries(ToLook1),[X0-DX/2.,X0+DX/2.,Y0-DY/2.,Y0+DY/2.][ToLook0:ToLook0+2])[Sense])
+ Output[Direction] = SortList(ObjList,RankMin)
+ else :
+ print ("Error : the composite box being created has no neighbours, how on earth do you want us to inherit its mesh parameters!!!")
+
+
+ return Output
+
+def IndexMultiOcc (Array,Element) :
+ """
+ This functions returns the occurrences indices of Element in Array.
+ As opposed to Array.index(Element) method, this allows determining
+ multiple entries rather than just the first one!
+ """
+ Output = []
+ try : Array.index(Element)
+ except ValueError : print "No more occurrences"
+ else : Output.append(Array.index(Element))
+
+ if not(Output == []) and len(Array) > 1 :
+ for index, ArrElem in enumerate(Array[Output[0]+1:]) :
+ if ArrElem == Element : Output.append(index+Output[0]+1)
+
+ return Output
+
+def SortList (ValList, CritList):
+ Output = []
+ SortedCritList = copy.copy(CritList)
+ SortedCritList.sort()
+ for i in range(0,len(ValList)):
+ index = CritList.index(SortedCritList[i])
+ Output.append(ValList[index])
+ return Output
+
+
+
--- /dev/null
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
+
+# INTRODUCTION HERE
+
+import sys, math, copy, commands
+CWD = commands.getoutput('pwd')
+sys.path.append(CWD)
+
+from MacObject import *
+import Config, GenFunctions
+
+def CompositeBoxF (Pt1 , Pt2 , Pt3 , Pt4 , **args ) :
+ [Pt1 , Pt2 , Pt3 , Pt4] = GenFunctions.SortPoints([Pt1 , Pt2 , Pt3 , Pt4])
+ if args.__contains__('groups') :
+ GroupNames = args['groups']
+ else : GroupNames = [None, None, None, None]
+ # Create a full NonOrtho box just to inherit, globally, the mesh parameters of bounding objects
+ dummy = MacObject('NonOrtho',[Pt1,Pt2,Pt3,Pt4],['auto'],publish=0)
+ # Save the existing number of segments on each direction
+ ExistingSeg0 = Config.ListObj[-1].DirectionalMeshParams
+ Convention = [2,3,0,1]
+ ExistingSegments = [ExistingSeg0[Convention[i]] for i in range(4)]
+ # Save Boundary lengths on each direction
+ BoundaryLengths = [IntLen(dummy.DirBoundaries(i)) for i in range(4) ]
+ # Calculate global mesh element size on each direction
+ GlobalDelta = [1.*BoundaryLengths[i]/ExistingSegments[i] for i in range(4) ]
+ print "GlobalDelta :",GlobalDelta
+ # Sort the connection list for the full Box
+ [(X0,Y0),(DX,DY)] = dummy.GeoPar
+ ObjIDLists = SortObjLists(Config.Connections[-1],X0 , Y0 , DX , DY )
+ [Xmin,Xmax,Ymin,Ymax] = dummy.Boundaries() # Used for groups determination
+ RemoveLastObj()
+
+ RealSegments = []
+ Direction = []
+ flag = 0
+ if not(args.__contains__('recursive')) :
+ Config.Count = 0
+
+ Config.Criterion = GetCriterion(ObjIDLists)
+ for index, ObjList in enumerate(ObjIDLists) :
+ if not (ObjList[0] == -1 or Config.Count >= Config.Criterion):
+ if not(args.__contains__('recursive')) :
+ Config.DirIndex = index
+ if index > 1 : Config.RefPts = [Pt2, Pt3]
+ elif index == 0 : Config.RefPts = [Pt1, Pt2]
+ else : Config.RefPts = [Pt4, Pt3]
+
+ if len(ObjList)>1 : flag = 1
+ else : flag = 0
+ for ObjID in ObjList:
+ ToLook0 = [2,3,0,1][index]
+ ToLook1 = [3,2,1,0][index]
+ CommonSide = FindCommonSide(Config.ListObj[ObjID].DirBoundaries(ToLook1),dummy.DirBoundaries(ToLook0))
+ ToLook2 = [1,0,3,2][index]
+ RealSegments = Config.ListObj[ObjID].DirectionalMeshParams[ToLook2]*IntLen(CommonSide)/IntLen(Config.ListObj[ObjID].DirBoundaries(ToLook1))
+ LocalDelta = 1.*IntLen(CommonSide)/RealSegments
+ print "Direction:", ["West","East","South","North"][ToLook2]
+ print "IntLen(CommonSide):",IntLen(CommonSide)
+ print "RealSegments:",RealSegments
+ print "LocalDelta:",LocalDelta
+ if flag and Config.Count < Config.Criterion:
+ if index ==0 :
+ if abs(CommonSide[0] - Ymin)<1e-7 : SouthGR = GroupNames[0]
+ else : SouthGR = None
+ if abs(CommonSide[1] - Ymax)<1e-7 : NorthGR = GroupNames[1]
+ else : NorthGR = None
+
+ NDelta = Config.ListObj[ObjID].DirectionalMeshParams[ToLook2]* (LocalDelta-GlobalDelta[Convention[index]])
+ [Pt1,Pt2] = Config.RefPts
+ Coef = [1.,-1.][index]
+ Vref1 = [Coef*(Pt2[0]-Pt1[0]),Coef*(Pt2[1]-Pt1[1])]
+ Vref2 = NormalizeVector([Pt2[0]-Pt3[0],Pt2[1]-Pt3[1]])
+ Ptref = Config.ListObj[ObjID].PtCoor[[2,3][index]]
+ NewPt = ExtrapPoint (Ptref,Vref1,Vref2,NDelta)
+ CompositeBoxF (Pt1, Pt2, NewPt, Ptref, recursive=1, groups = [SouthGR,NorthGR]+GroupNames[2:4])
+ elif index == 1:
+ if abs(CommonSide[0] - Ymin)<1e-7 : SouthGR = GroupNames[0]
+ else : SouthGR = None
+ if abs(CommonSide[1] - Ymax)<1e-7 : NorthGR = GroupNames[1]
+ else : NorthGR = None
+
+ NDelta = Config.ListObj[ObjID].DirectionalMeshParams[ToLook2]* (LocalDelta-GlobalDelta[Convention[index]])
+ [Pt4,Pt3] = Config.RefPts
+ Coef = 1.
+ Vref1 = [Coef*(Pt4[0]-Pt3[0]),Coef*(Pt4[1]-Pt3[1])]
+ Vref2 = NormalizeVector([Pt1[0]-Pt4[0],Pt1[1]-Pt4[1]])
+ Ptref = Config.ListObj[ObjID].PtCoor[0]
+ NewPt = ExtrapPoint (Ptref,Vref1,Vref2,NDelta)
+ CompositeBoxF (NewPt, Ptref, Pt3, Pt4, recursive=1, groups = [SouthGR,NorthGR]+GroupNames[2:4])
+ else :
+ if abs(CommonSide[0] - Xmin)<1e-7 : WestGR = GroupNames[2]
+ else : WestGR = None
+ if abs(CommonSide[1] - Xmax)<1e-7 : EastGR = GroupNames[3]
+ else : EastGR = None
+
+ NDelta = Config.ListObj[ObjID].DirectionalMeshParams[ToLook2]* (LocalDelta-GlobalDelta[Convention[index]])
+ [Pt2,Pt3] = Config.RefPts
+ Coef = [1.,-1.][index-2]
+ Vref1 = [Coef*(Pt3[0]-Pt2[0]),Coef*(Pt3[1]-Pt2[1])]
+ Vref2 = NormalizeVector([Pt3[0]-Pt4[0],Pt3[1]-Pt4[1]])
+ Ptref = Config.ListObj[ObjID].PtCoor[[3,0][index-2]]
+ NewPt = ExtrapPoint (Ptref,Vref1,Vref2,NDelta)
+ CompositeBoxF (Ptref, Pt2, Pt3, NewPt, recursive=1, groups = GroupNames[0:2] + [WestGR,EastGR])
+
+ if Config.Count >= Config.Criterion :
+ break
+ if flag == 0 and Config.Count < Config.Criterion:
+ print "Creating NonOrtho object with the points:", Pt1,Pt2,Pt3,Pt4
+ MacObject('NonOrtho',[Pt1,Pt2,Pt3,Pt4] ,['auto'], groups = GroupNames)
+
+ Config.Count += 1
+ if Config.DirIndex > 1 : Config.RefPts = [Pt1, Pt4]
+ elif Config.DirIndex==0 : Config.RefPts = [Pt4, Pt3]
+ else : Config.RefPts = [Pt1, Pt2]
+
+def FindCommonSide (Int1, Int2) :
+ if max(Int1[0],Int2[0])<min(Int1[1],Int2[1]): return [max(Int1[0],Int2[0]), min(Int1[1],Int2[1])]
+ else :
+ print "Can not find interval intersection, returning [0,0]..."
+ return [0,0]
+
+def IntLen (Interval) :
+ return float(abs(Interval[1]-Interval[0]))
+
+def RemoveLastObj() :
+ Config.ListObj = Config.ListObj[:-1]
+ Config.Connections = Config.Connections[:-1]
+
+def NormalizeVector(V):
+ Magnitude = math.sqrt(GenFunctions.DotProd(V,V))
+ return [ V[i]/Magnitude for i in range(len(V))]
+
+def GetCriterion (ObjListIDs):
+ return max(Config.Criterion, max(len(ObjListIDs[0]),len(ObjListIDs[1]))*max(len(ObjListIDs[2]),len(ObjListIDs[3])))
+
+def SortObjLists (List,X0,Y0,DX,DY) :
+ """
+ This function sorts the list of neighbouring objects on each side, according to their intersection
+ with the object being created. From South to North and from East to West
+ """
+ Output = List
+ # First find the directions where no neighbour exists
+ # Important : Here we assume that exactly two directions have no neighbours !!!
+ # Should we change this to allow a more general case ????
+ dummy = IndexMultiOcc(List,(-1,))
+
+ # dummy[0] is either 0, meaning there is no neighbour on X- (West)
+ # or 1, meaning there is no neighbour on X+ (East)
+ # Similarly dummy[1] can be either 2 or 3 (South and North respectively)
+ # In order to get back to the formalism of groups (SNWE)
+ # => we do the following to define Sense of no neighbours and then the Direction list
+ # is calculated as to include uniquely the directions where we DO have neighbours
+ if len(dummy) == 1 :
+ # This adds a second direction where neighbours are not regarded, it is either 0 or 2
+ dummy.append(2*(dummy[0]+2<4))
+ print("Careful, you have neighbours on 3 or more sides of the box, we will not check if on two parallel sides the boxes are compatible !!!")
+ if len(dummy) == 2 or len(dummy) == 1 :
+ # Sense contains : Vertical then Horizontal
+ Sense = [dummy[1]%2,dummy[0]]
+ DirList = [[1,0][dummy[0]],[3,2][dummy[1]%2]]
+ for index,Direction in enumerate(DirList) :
+ ObjList = List[Direction]
+ RankMin = []
+ ToLook0 = [2,2,0,0][Direction]
+ ToLook1 = [3,2,1,0][Direction]
+ for index1,ObjID in enumerate(ObjList) :
+ RankMin.append([-1.,1.][Sense[index]] * FindCommonSide(Config.ListObj[ObjID].DirBoundaries(ToLook1),[X0-DX/2.,X0+DX/2.,Y0-DY/2.,Y0+DY/2.][ToLook0:ToLook0+2])[Sense[index]])
+ Output[Direction] = SortList(ObjList,RankMin)
+
+ elif len(dummy) == 3 :
+ # We find the direction where we do have neighbours and then we sort the object list along it
+ Sense = dummy[0]%2
+ Direction = [ i not in dummy for i in range(4) ].index(True)
+ ObjList = List[Direction]
+ RankMin = []
+ ToLook0 = [2,2,0,0][Direction]
+ ToLook1 = [3,2,1,0][Direction]
+ for index1,ObjID in enumerate(ObjList) :
+ RankMin.append([-1.,1.][Sense] * FindCommonSide(Config.ListObj[ObjID].DirBoundaries(ToLook1),[X0-DX/2.,X0+DX/2.,Y0-DY/2.,Y0+DY/2.][ToLook0:ToLook0+2])[Sense])
+ Output[Direction] = SortList(ObjList,RankMin)
+ else :
+ print ("Error : the composite box being created has no neighbours, how on earth do you want us to inherit its mesh parameters!!!")
+
+
+ return Output
+
+def IndexMultiOcc (Array,Element) :
+ """
+ This functions returns the occurrences indices of Element in Array.
+ As opposed to Array.index(Element) method, this allows determining
+ multiple entries rather than just the first one!
+ """
+ Output = []
+ try : Array.index(Element)
+ except ValueError : print "No more occurrences"
+ else : Output.append(Array.index(Element))
+
+ if not(Output == []) and len(Array) > 1 :
+ for index, ArrElem in enumerate(Array[Output[0]+1:]) :
+ if ArrElem == Element : Output.append(index+Output[0]+1)
+
+ return Output
+
+def SortList (ValList, CritList):
+ Output = []
+ SortedCritList = copy.copy(CritList)
+ SortedCritList.sort()
+ for i in range(0,len(ValList)):
+ index = CritList.index(SortedCritList[i])
+ Output.append(ValList[index])
+ return Output
+
+def ExtrapPoint (Ptref,Vref1,Vref2,Delta):
+ """
+ This function allows determining the absolute coordinates of an extrapolation point
+ as shown in the following :
+
+
+ ExtrapPoint x---Vref2->--------o
+ / delta_glob |Vref1
+ / |
+ Ptref x---------------------+
+ delta_loc * Nseg
+
+ Delta = (delta_loc - delta_glob) * Nseg
+ """
+
+ X = Ptref[0] + Vref1[0] + Delta*Vref2[0]
+ Y = Ptref[1] + Vref1[1] + Delta*Vref2[1]
+ return (X,Y,)
+
--- /dev/null
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
+dz = 1
+debug = 1
+
+try : ListObj
+except NameError : ListObj = []
+
+try: Connections
+except NameError: Connections = []
+
+try : publish
+except NameError : publish = 1
+
+try : Groups
+except NameError : Groups = []
+
+try : StudyName
+except NameError : StudyName = "Compound"
+
+try : Criterion
+except NameError : Criterion = 1
+
+try : Count
+except NameError : Count = 0
+
+try : RefPts
+except NameError : RefPts = []
+
+try : DirIndex
+except NameError : DirIndex = 0
+
+try : theStudy
+except NameError :
+ import salome
+ salome.salome_init()
+ theStudy = salome.myStudy
+
+
--- /dev/null
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# 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 module allows cutting and grouping geometries by defining plane sections, with level of cutting as well as customizable Prefixes.
+
+import math, Config
+
+from salome.geom import geomBuilder
+geompy = geomBuilder.New( Config.theStudy )
+
+def Go(GeoObj, CutPlnLst, OutLvlLst, PrefixLst, Publish):
+
+ """
+ This function cuts any geometry (with infinite trim !) into several subgeometries that are cleanly saved inside the navigation tree. (Check GoTrim for the same functionality with custom trim size)
+ - GeoObj is the geometrical object to be cut and grouped
+ - CutPlnLst is a list of plane definitions. Each plane is a 6-tuple (contains 6 values). The first three represent the coordinates of the origin point and the second three represent the coordinates of the normal vector to the plane
+ Example 1: [(0,0,0,1,0,0)]: cut along a plane passing through the origin and normal to the x-axis
+ Example 2: [(0,0,0,1,0,0),(50,0,0,0,1,0)]: in addition to the first plane cut, cut through a plane passing by (50,0,0) and normal to the y axis.
+ Note that the plane size us determined automatically from the size of the geometry in question (using a very big trim size = 100 x length of geometry!)
+ - OutLvlLst is a list containing integers that represent the inner sectioning level with respect to the original geometry type
+ A value of 1 means that the section will provide elements of one level lower than the original type. For exemple a solid sectioned at level 1 will produce faces. A Face sectioned at level 1 will produce edges.
+ A value of 2 means that a deeper sectioning will be applied. A solid sectioned with level 2 will give faces and edges. A face will give edges and vertices. An edge will give only vertices
+ The number of elements in this list should be (this is verified in the code) equal to the number of elements in the plane cut list. This is logical.
+ Example 1: [1]
+ Example 2: [1, 2], This means that the cut over the second plane will produce two types of elements unlike the first cut which will only output the first level objects.
+ - PrefixLst is a list of strings that contains the naming Prefixes that are used by the script to generate the subshape names. This is very useful for relating the results to the sectioning requested.
+ Example 1: ['Entry']
+ Example 2: ['Entry','Exit'] The resulting groups from the sectioning with plane no.1 will then be saved as "Entry_FACE" and/or "Entry_EDGE" according to the original geometry object type and the cutting level
+
+ Imagine that we have a solid called ExampleSolid, an example command will be:
+ CutnGroup.Go(ExampleSolid,[(0,0,0,1,0,0),(50,0,0,0,1,0)],[1, 2],['Entry','Exit'])
+ """
+
+ NumCuts = CheckInput(CutPlnLst, OutLvlLst, PrefixLst, 1)
+ OrigType = FindStandType(GeoObj,0)
+ InvDictionary = dict((v,k) for k, v in geompy.ShapeType.iteritems()) # Give geometry type name as a function of standard type numbering, ex: 4=FACE, 6=EDGE, 7=VERTEX
+ TrimSize = geompy.BasicProperties(GeoObj)[0]*100
+ CutPlane = [] ; Sections = [] ; Parts = []
+
+ if NumCuts:
+ for i in range(0, NumCuts): # Loop over the cutting planes to create them one by one
+ CutPlane.append(CreatePlane(CutPlnLst[i],TrimSize))
+ OutFather = geompy.MakePartition([GeoObj],CutPlane, [], [],FindStandType(GeoObj,1), 0, [], 0) #Creating the partition object
+ if Publish: geompy.addToStudy(OutFather,'SectionedObject')
+ for i in range(0, NumCuts):
+ for j in range(OrigType+1+2, OrigType+1+2*(OutLvlLst[i]+1),2):
+ if j == 8 : j = 7; # Exception for the vertex case (=7)
+ PossSubShapesID = geompy.SubShapeAllIDs(OutFather,j) # List of subshape IDs than correspond to the required cutting level (section type : face/wire/vertex)
+ PossSubShapes = geompy.ExtractShapes(OutFather,j) # and the corresponding objects
+ Accepted = []
+ for k in range(0,len(PossSubShapesID)): # Loop over all the subshapes checking if they belong to the cutting plane! if yes add them to current list
+ if IsOnPlane(PossSubShapes[k], CutPlnLst[i], 1e-7):
+ Accepted.append(PossSubShapesID[k])
+ if Accepted : # If some element is found, save it as a group with the prescribed Prefix
+ dummyObj = geompy.CreateGroup(OutFather, j)
+ geompy.UnionIDs(dummyObj, Accepted)
+ Sections.append(dummyObj)
+ if Publish:geompy.addToStudyInFather(OutFather, dummyObj, PrefixLst[i]+"_"+InvDictionary[j][0:2])
+ else :
+ print "Warning: For the section no.", i, ", No intersection of type " + InvDictionary[j] + " was found. Hence, no corresponding groups were created"
+
+ SubShapesID = geompy.SubShapeAllIDs(OutFather,OrigType+1) # Saving also the groups corresponding to the sectioned item of the same type: ex. A solid into n sub-solids due to the sections
+ for i in range(0,len(SubShapesID)):
+ dummyObj = geompy.CreateGroup(OutFather, OrigType+1)
+ geompy.UnionIDs(dummyObj, [SubShapesID[i]])
+ Parts.append(dummyObj)
+ if Publish: geompy.addToStudyInFather(OutFather, dummyObj, "SB"+"_"+InvDictionary[OrigType+1][0:3]+"_"+str(i+1))
+
+ return OutFather, Sections, Parts
+ else:
+ print("Fatal error, the routine cannot continue any further, check your input variables")
+ return -1
+
+def GoTrim(GeoObj, CutPlnLst, OutLvlLst, PrefixLst, Publish):
+
+ """
+ This function cuts any geometry into several subgeometries that are cleanly saved inside the navigation tree with a fully customizable trim size.
+ - GeoObj is the geometrical object to be cut and grouped
+ - CutPlnLst is a list of plane definitions. Each plane is a 7-tuple (contains 7 values). The first three represent the coordinates of the origin point and the second three represent the coordinates of the normal vector to the plane, the last value corresponds to the trim size of the planes
+ Example 1: [(0,0,0,1,0,0,5)]: cut along a plane passing through the origin and normal to the x-axis with a trim size of 5
+ Example 2: [(0,0,0,1,0,0,5),(50,0,0,0,1,0,10)]: in addition to the first plane cut, cut through a plane passing by (50,0,0) and normal to the y axis with a trim size of 10
+ - OutLvlLst is a list containing integers that represent the inner sectioning level with respect to the original geometry type
+ A value of 1 means that the section will provide elements of one level lower than the original type. For exemple a solid sectioned at level 1 will produce faces. A Face sectioned at level 1 will produce edges.
+ A value of 2 means that a deeper sectioning will be applied. A solid sectioned with level 2 will give faces and edges. A face will give edges and vertices. An edge will give only vertices
+ The number of elements in this list should be (this is verified in the code) equal to the number of elements in the plane cut list. This is logical.
+ Example 1: [1]
+ Example 2: [1, 2], This means that the cut over the second plane will produce two types of elements unlike the first cut which will only output the first level objects.
+ - PrefixLst is a list of strings that contains the naming Prefixes that are used by the script to generate the subshape names. This is very useful for relating the results to the sectioning requested.
+ Example 1: ['Entry']
+ Example 2: ['Entry','Exit'] The resulting groups from the sectioning with plane no.1 will then be saved as "Entry_FACE" and/or "Entry_EDGE" according to the original geometry object type and the cutting level
+
+ Imagine that we have a solid called ExampleSolid, an example command will be:
+ CutnGroup.Go(ExampleSolid,[(0,0,0,1,0,0,5),(50,0,0,0,1,0,10)],[1, 2],['Entry','Exit'])
+ """
+
+ NumCuts = CheckInput(CutPlnLst, OutLvlLst, PrefixLst, 0)
+ OrigType = FindStandType(GeoObj,0)
+ InvDictionary = dict((v,k) for k, v in geompy.ShapeType.iteritems()) # Give geometry type name as a function of standard type numbering, ex: 4=FACE, 6=EDGE, 7=VERTEX
+ CutPlane = [] ; Sections = [] ; Parts = []
+ if NumCuts:
+ for i in range(0, NumCuts): # Loop over the cutting planes to create them one by one
+ CutPlane.append(CreatePlane(CutPlnLst[i][0:6],CutPlnLst[i][6]))
+ OutFather = geompy.MakePartition([GeoObj],CutPlane, [], [],FindStandType(GeoObj,1), 0, [], 0) #Creating the partition object
+ if Publish: geompy.addToStudy(OutFather,'SectionedObject')
+ for i in range(0, NumCuts):
+ for j in range(OrigType+1+2, OrigType+1+2*(OutLvlLst[i]+1),2):
+ if j == 8 : j = 7; # Exception for the vertex case (=7)
+ PossSubShapesID = geompy.SubShapeAllIDs(OutFather,j) # List of subshape IDs than correspond to the required cutting level (section type : face/wire/vertex)
+ PossSubShapes = geompy.ExtractShapes(OutFather,j) # and the corresponding objects
+ Accepted = []
+ for k in range(0,len(PossSubShapesID)): # Loop over all the subshapes checking if they belong to the cutting plane WITH THE TRIM SIZE CONDITION! if yes add them to current list
+ if IsOnPlane(PossSubShapes[k], CutPlnLst[i], 1e-7) and Distance2Pt(geompy.PointCoordinates(geompy.MakeCDG(PossSubShapes[k])),CutPlnLst[i][0:3])<=CutPlnLst[i][-1]:
+ Accepted.append(PossSubShapesID[k])
+ if Accepted : # If some element is found, save it as a group with the prescribed Prefix
+ dummyObj = geompy.CreateGroup(OutFather, j)
+ geompy.UnionIDs(dummyObj, Accepted)
+ Sections.append(dummyObj)
+ if Publish: geompy.addToStudyInFather(OutFather, dummyObj, PrefixLst[i]+"_"+InvDictionary[j][0:2])
+ else :
+ print "Warning: For the section no.", i, ", No intersection of type " + InvDictionary[j] + " was found. Hence, no corresponding groups were created"
+
+ SubShapesID = geompy.SubShapeAllIDs(OutFather,OrigType+1) # Saving also the groups corresponding to the sectioned item of the same type: ex. A solid into n sub-solids due to the sections
+ for i in range(0,len(SubShapesID)):
+ dummyObj = geompy.CreateGroup(OutFather, OrigType+1)
+ geompy.UnionIDs(dummyObj, [SubShapesID[i]])
+ Parts.append(dummyObj)
+ if Publish: geompy.addToStudyInFather(OutFather, dummyObj, "SB"+"_"+InvDictionary[OrigType+1][0:3]+"_"+str(i+1))
+
+ return OutFather, Sections, Parts
+ else:
+ print("Fatal error, the routine cannot continue any further, check your input variables")
+ return -1
+def FindStandType(GeoObj, method):
+ """
+ Find the standard index for the Geometrical object/compound type input, see dictionary in geompy.ShapeType
+ """
+ TopType = GeoObj.GetMaxShapeType().__str__()
+ UnModType = geompy.ShapeType[TopType]
+ if method == 0 :
+ StandType = UnModType-int(not(UnModType%2)) # So that wires and edges and considered the same, faces and shells, and so on
+ else :
+ StandType = UnModType
+
+ return(StandType)
+
+def CreatePlane(CutPlnVar,Trim):
+ """
+ Creates a temporary point and vector in salome in order to build the sectioning planes needed
+ """
+ Temp_Vtx = geompy.MakeVertex(CutPlnVar[0], CutPlnVar[1], CutPlnVar[2])
+ Temp_Vec = geompy.MakeVectorDXDYDZ(CutPlnVar[3], CutPlnVar[4], CutPlnVar[5])
+ CutPlane = geompy.MakePlane(Temp_Vtx, Temp_Vec, Trim)
+ return(CutPlane)
+
+def CheckInput(CutPlnLst, OutLvlLst, PrefixLst, AutoTrim):
+ """
+ Checks the user input specifically if all needed parameters are provided
+ """
+ if not ((len(CutPlnLst) == len(OutLvlLst)) and (len(CutPlnLst) == len(PrefixLst))):
+ print("Missing information about one or more of the cut planes")
+ return 0
+ elif not ((len(CutPlnLst[0]) == 6+int(not AutoTrim))):
+ print("For each cutting plane you need to specify 6 parameters = 2 x 3 coordinates")
+ return 0
+ else:
+ return len(CutPlnLst)
+
+def IsOnPlane(GeoSubObj, CutPlnVar, tolerance):
+ """
+ Checks whether a geometry (vertex, segment, or face) belongs *completely* to the plane defined as a point and a normal vector
+ """
+ # lambda function that represents the plane equation, function = 0 <=> Pt defined with Coor belongs to plane
+ PlaneEq = lambda Coor: CutPlnVar[3]*(Coor[0]-CutPlnVar[0])+CutPlnVar[4]*(Coor[1]-CutPlnVar[1])+CutPlnVar[5]*(Coor[2]-CutPlnVar[2])
+ OrigType = FindStandType(GeoSubObj,0)
+ if (OrigType >= 7): # Vertex
+ NonTrimDecision = abs(PlaneEq(geompy.PointCoordinates(GeoSubObj))) < tolerance
+ if len(CutPlnVar) == 6 : return NonTrimDecision # No trim condition used
+ else : return (NonTrimDecision and Distance2Pt(CutPlnVar[0:3],geompy.PointCoordinates(GeoSubObj))<=CutPlnVar[6]/2)
+ elif (OrigType >= 5): # Line, decompose into two points then call recursively IsOnPlane function!
+ Verdict = True
+ for i in range(0,2):
+ Verdict = Verdict and IsOnPlane(geompy.GetVertexByIndex(GeoSubObj,i), CutPlnVar, tolerance)
+ return Verdict
+ elif (OrigType >= 3): # Face, decompose into three points then call recursively IsOnPlane function!
+ if IsOnPlane(geompy.MakeCDG(GeoSubObj),CutPlnVar, tolerance) : # Center of gravity belongs to plane, check if normal is parallel to plane
+ NormalP1Coor = geompy.PointCoordinates(geompy.GetVertexByIndex(geompy.GetNormal(GeoSubObj),0))
+ NormalP2Coor = geompy.PointCoordinates(geompy.GetVertexByIndex(geompy.GetNormal(GeoSubObj),1))
+ Normal = [NormalP1Coor[0]-NormalP2Coor[0], NormalP1Coor[1]-NormalP2Coor[1], NormalP1Coor[2]-NormalP2Coor[2]]
+ CrossP = CrossProd(CutPlnVar[3:6],Normal) # Checks whether normals (of section plane and of face) are parallel or not
+ if (abs(CrossP[0])<tolerance and abs(CrossP[1])<tolerance and abs(CrossP[2])<tolerance): # meaning zero cross product => parallel
+ return True
+ else :
+ return False
+ else :
+ return False
+
+
+def CrossProd(V1,V2):
+ """
+ Determines the cross product of two 3D vectors
+ """
+ return ([V1[1]*V2[2]-V1[2]*V2[1], V1[2]*V2[0]-V1[0]*V2[2], V1[0]*V2[1]-V1[1]*V2[0]])
+
+def Distance2Pt(P1,P2):
+ """
+ Returns the distance between two points
+ """
+ return (math.sqrt((P1[0]-P2[0])**2+(P1[1]-P2[1])**2+(P1[2]-P2[2])**2))
--- /dev/null
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# 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 an automation of the cylinder-box object, defined with the coordinates of its center, its radius, and the box's
+# boundary size.
+# The pitch ratio is calculated automatically from the minimum of the box dimensions on x and y.
+# This functions can take a groups input containing the group names of 4 sides in addition to the internal circular boundary
+# in the following order : [South,North,West,East,Internal].
+
+import sys, math, commands
+CWD = commands.getoutput('pwd')
+sys.path.append(CWD)
+
+
+from MacObject import *
+import Config, GenFunctions
+
+def Cylinder (X0 , Y0 , D , DX , DY , LocalMeshing , **args) :
+ if args.__contains__('DLocal') : DLocal = float(args['DLocal'])
+ else : DLocal = float(min(DX,DY))
+
+ # K is the pitch ratio
+ K = float(D)/(DLocal-D)
+ print "A local pitch ratio of K =", K ," will be used. "
+ NumCuts = 2*GenFunctions.QuarCylParam(K)
+ InternalMeshing = int(math.ceil(math.pi*D/(4*NumCuts*LocalMeshing)))
+ if InternalMeshing == 0 : InternalMeshing = 1 # This sets a minimum meshing condition in order to avoid an error. The user is notified of the value considered for the local meshing
+ print "Possible Local meshing is :", math.pi*D/(4*NumCuts*InternalMeshing), "\nThis value is returned by this function for your convenience.\n"
+ if args.__contains__('groups') :
+ GroupNames = args['groups']
+ else : GroupNames = [None, None, None, None, None]
+
+ if DY == DLocal :
+ if DX == DLocal:
+ GN1 = [None,GroupNames[1],None,GroupNames[3],GroupNames[4]]
+ GN2 = [None,GroupNames[1],GroupNames[2],None,GroupNames[4]]
+ GN3 = [GroupNames[0],None,GroupNames[2],None,GroupNames[4]]
+ GN4 = [GroupNames[0],None,None,GroupNames[3],GroupNames[4]]
+ else :
+ GN1 = [None,GroupNames[1],None,None,GroupNames[4]]
+ GN2 = [None,GroupNames[1],None,None,GroupNames[4]]
+ GN3 = [GroupNames[0],None,None,None,GroupNames[4]]
+ GN4 = [GroupNames[0],None,None,None,GroupNames[4]]
+
+ GN5 = [GroupNames[0],GroupNames[1],None,GroupNames[3]]
+ GN6 = [GroupNames[0],GroupNames[1],GroupNames[2],None]
+ else :
+ if DX == DLocal:
+ GN1 = [None,None,None,GroupNames[3],GroupNames[4]]
+ GN2 = [None,None,GroupNames[2],None,GroupNames[4]]
+ GN3 = [None,None,GroupNames[2],None,GroupNames[4]]
+ GN4 = [None,None,None,GroupNames[3],GroupNames[4]]
+ GN7 = [GroupNames[0],None,GroupNames[2],GroupNames[3]]
+ GN8 = [None,GroupNames[1],GroupNames[2],GroupNames[3]]
+ else :
+ GN1 = [None,None,None,None,GroupNames[4]]
+ GN2 = [None,None,None,None,GroupNames[4]]
+ GN3 = [None,None,None,None,GroupNames[4]]
+ GN4 = [None,None,None,None,GroupNames[4]]
+
+ GN5 = [None,None,None,GroupNames[3]]
+ GN6 = [None,None,GroupNames[2],None]
+
+ GN9 = [GroupNames[0],None,None,GroupNames[3]]
+ GN10 = [GroupNames[0],None,None,None]
+ GN11 = [GroupNames[0],None,GroupNames[2],None]
+
+ GN12 = [None,GroupNames[1],None,GroupNames[3]]
+ GN13 = [None,GroupNames[1],None,None]
+ GN14 = [None,GroupNames[1],GroupNames[2],None]
+
+ Obj = []
+
+ Obj.append(MacObject('QuartCyl',[(X0+DLocal/4.,Y0+DLocal/4.),(DLocal/2.,DLocal/2.)],[InternalMeshing,'NE',K], groups = GN1))
+ Obj.append(MacObject('QuartCyl',[(X0-DLocal/4.,Y0+DLocal/4.),(DLocal/2.,DLocal/2.)],['auto','NW',K], groups = GN2))
+ Obj.append(MacObject('QuartCyl',[(X0-DLocal/4.,Y0-DLocal/4.),(DLocal/2.,DLocal/2.)],['auto','SW',K], groups = GN3))
+ Obj.append(MacObject('QuartCyl',[(X0+DLocal/4.,Y0-DLocal/4.),(DLocal/2.,DLocal/2.)],['auto','SE',K], groups = GN4))
+
+ if DX > DLocal :
+ dX = (DX - DLocal)/2.
+ Obj.append(MacObject('CompBoxF',[(X0+DLocal/2.+dX/2.,Y0),(dX,DLocal)],['auto'], groups = GN5))
+ Obj.append(MacObject('CompBoxF',[(X0-DLocal/2.-dX/2.,Y0),(dX,DLocal)],['auto'], groups = GN6))
+
+ if DY > DLocal :
+ dY = (DY - DLocal)/2.
+ if DX > DLocal :
+ Obj.append(MacObject('CompBoxF',[(X0+DLocal/2.+dX/2.,Y0-DLocal/2.-dY/2.),(dX,dY)],['auto'], groups = GN9))
+ Obj.append(MacObject('CompBoxF',[(X0,Y0-DLocal/2.-dY/2.),(DLocal,dY)],['auto'], groups = GN10))
+ Obj.append(MacObject('CompBoxF',[(X0-DLocal/2.-dX/2.,Y0-DLocal/2.-dY/2.),(dX,dY)],['auto'], groups = GN11))
+ Obj.append(MacObject('CompBoxF',[(X0+DLocal/2.+dX/2.,Y0+DLocal/2.+dY/2.),(dX,dY)],['auto'], groups = GN12))
+ Obj.append(MacObject('CompBoxF',[(X0,Y0+DLocal/2.+dY/2.),(DLocal,dY)],['auto'], groups = GN13))
+ Obj.append(MacObject('CompBoxF',[(X0-DLocal/2.-dX/2.,Y0+DLocal/2.+dY/2.),(dX,dY)],['auto'], groups = GN14))
+ else:
+ Obj.append(MacObject('CompBoxF',[(X0,Y0-DLocal/2.-dY/2.),(DLocal,dY)],['auto'], groups = GN7))
+ Obj.append(MacObject('CompBoxF',[(X0,Y0+DLocal/2.+dY/2.),(DLocal,dY)],['auto'], groups = GN8))
+
+ return Obj
--- /dev/null
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
+# In this file are all the generation functions for manipulating the different created macro-objects
+
+import math, copy
+import Config
+import CutnGroup
+import CompositeBox
+
+from salome.geom import geomBuilder
+geompy = geomBuilder.New( Config.theStudy )
+
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New( Config.theStudy )
+
+##########################################################################################################
+
+def Box11 (MacObject):
+ if Config.debug : print "Generating regular box"
+
+ dummy1 = geompy.MakeScaleAlongAxes( ElemBox11 (), None , MacObject.GeoPar[1][0], MacObject.GeoPar[1][1], 1)
+ RectFace = geompy.MakeTranslation(dummy1, MacObject.GeoPar[0][0], MacObject.GeoPar[0][1], 0)
+
+ MacObject.GeoChildren.append(RectFace)
+ MacObject.GeoChildrenNames.append("Box_"+ str(len(Config.ListObj)+1))
+
+ if Config.debug : Publish (MacObject.GeoChildren,MacObject.GeoChildrenNames)
+
+ if Config.publish :
+ MacObject.Mesh.append(smesh.Mesh(RectFace)) # Creation of a new mesh
+ Quad2D = MacObject.Mesh[0].Quadrangle() # Applying a quadrangle hypothesis
+
+ EdgeIDs = geompy.SubShapeAllSorted(RectFace,6) # List of Edge IDs belonging to RectFace, 6 = Edge in salome dictionary
+ Reg1D = MacObject.Mesh[0].Segment()
+ Reg1D.NumberOfSegments(MacObject.MeshPar[0])
+
+ MacObject.Mesh[0].Compute() # Generates the mesh
+
+ MacObject.DirectionalMeshParams = [MacObject.MeshPar[0],MacObject.MeshPar[0],MacObject.MeshPar[0],MacObject.MeshPar[0]]
+
+ MacObject.status = 1
+ Config.ListObj.append(MacObject)
+ return MacObject
+
+##########################################################################################################
+
+def Box42 (MacObject):
+ if Config.debug : print "Generating box 4-2 reducer"
+
+ Z_Axis = geompy.MakeVectorDXDYDZ(0., 0., 1.)
+ RotAngle = {'SN' : lambda : 0,
+ 'NS' : lambda : math.pi,
+ 'EW' : lambda : math.pi/2,
+ 'WE' : lambda : -math.pi/2, }[MacObject.MeshPar[1]]()
+ dummy0 = geompy.MakeRotation( ElemBox42 () , Z_Axis, RotAngle )
+ dummy1 = geompy.MakeScaleAlongAxes( dummy0, None , MacObject.GeoPar[1][0], MacObject.GeoPar[1][1], 1)
+ RectFace = geompy.MakeTranslation(dummy1, MacObject.GeoPar[0][0], MacObject.GeoPar[0][1], 0)
+
+ MacObject.GeoChildren.append(RectFace)
+ MacObject.GeoChildrenNames.append("Box_"+ str(len(Config.ListObj)+1))
+
+ if Config.debug : Publish (MacObject.GeoChildren,MacObject.GeoChildrenNames)
+
+ if Config.publish :
+ MacObject.Mesh.append(smesh.Mesh(RectFace)) # Creation of a new mesh
+ Quad2D = MacObject.Mesh[0].Quadrangle() # Applying a quadrangle hypothesis
+
+ EdgeIDs = geompy.SubShapeAllSorted(RectFace,6) # List of Edge IDs belonging to RectFace, 6 = Edge in salome dictionary
+ Reg1D = MacObject.Mesh[0].Segment()
+ Reg1D.NumberOfSegments(MacObject.MeshPar[0])
+
+ MacObject.Mesh[0].Compute() # Generates the mesh
+
+ MacObject.status = 1
+
+ x = MacObject.MeshPar[0]
+ MacObject.DirectionalMeshParams = {'SN' : lambda : [3*x, 3*x, 4*x, 2*x],
+ 'NS' : lambda : [3*x, 3*x, 2*x, 4*x],
+ 'EW' : lambda : [2*x, 4*x, 3*x, 3*x],
+ 'WE' : lambda : [4*x, 2*x, 3*x, 3*x], }[MacObject.MeshPar[1]]()
+
+ Config.ListObj.append(MacObject)
+ return MacObject
+
+
+##########################################################################################################
+
+def BoxAng32 (MacObject):
+ if Config.debug : print "Generating sharp angle"
+ Z_Axis = geompy.MakeVectorDXDYDZ(0., 0., 1.)
+ RotAngle = {'NE' : lambda : 0,
+ 'NW' : lambda : math.pi/2,
+ 'SW' : lambda : math.pi,
+ 'SE' : lambda : -math.pi/2, }[MacObject.MeshPar[1]]()
+ dummy0 = geompy.MakeRotation( ElemEdge32 () , Z_Axis, RotAngle )
+ dummy1 = geompy.MakeScaleAlongAxes( dummy0, None , MacObject.GeoPar[1][0], MacObject.GeoPar[1][1], 1)
+ RectFace = geompy.MakeTranslation(dummy1, MacObject.GeoPar[0][0], MacObject.GeoPar[0][1], 0)
+
+ MacObject.GeoChildren.append(RectFace)
+ MacObject.GeoChildrenNames.append("Box_"+ str(len(Config.ListObj)+1))
+
+ if Config.debug : Publish (MacObject.GeoChildren,MacObject.GeoChildrenNames)
+
+ if Config.publish :
+ MacObject.Mesh.append(smesh.Mesh(RectFace)) # Creation of a new mesh
+ Quad2D = MacObject.Mesh[0].Quadrangle() # Applying a quadrangle hypothesis
+
+ EdgeIDs = geompy.SubShapeAllSorted(RectFace,6) # List of Edge IDs belonging to RectFace, 6 = Edge in salome dictionary
+ Reg1D = MacObject.Mesh[0].Segment()
+ Reg1D.NumberOfSegments(MacObject.MeshPar[0])
+
+ MacObject.Mesh[0].Compute() # Generates the mesh
+
+ MacObject.status = 1
+
+ x = MacObject.MeshPar[0]
+ MacObject.DirectionalMeshParams = {'NE' : lambda : [3*x, 2*x, 3*x, 2*x],
+ 'NW' : lambda : [2*x, 3*x, 3*x, 2*x],
+ 'SW' : lambda : [2*x, 3*x, 2*x, 3*x],
+ 'SE' : lambda : [3*x, 2*x, 2*x, 3*x], }[MacObject.MeshPar[1]]()
+
+ Config.ListObj.append(MacObject)
+ return MacObject
+##########################################################################################################
+def CompBox (MacObject):
+ if Config.debug : print "Generating composite box"
+
+ dummy1 = geompy.MakeScaleAlongAxes( ElemBox11 (), None , MacObject.GeoPar[1][0], MacObject.GeoPar[1][1], 1)
+ RectFace = geompy.MakeTranslation(dummy1, MacObject.GeoPar[0][0], MacObject.GeoPar[0][1], 0)
+
+ MacObject.GeoChildren.append(RectFace)
+ MacObject.GeoChildrenNames.append("Box_"+ str(len(Config.ListObj)+1))
+
+ if Config.debug : Publish (MacObject.GeoChildren,MacObject.GeoChildrenNames)
+
+ if Config.publish :
+ MacObject.Mesh.append(smesh.Mesh(RectFace)) # Creation of a new mesh
+ Quad2D = MacObject.Mesh[0].Quadrangle() # Applying a quadrangle hypothesis
+
+ EdgeIDs = geompy.SubShapeAllSorted(RectFace,6) # List of Edge IDs belonging to RectFace, 6 = Edge in salome dictionary
+
+ ReducedRatio = ReduceRatio(MacObject.GeoPar[1][0],MacObject.GeoPar[1][1])
+
+ Reference = [0,0,0]
+ Vec = [(1,0,0),(0,1,0)]
+ for Edge in EdgeIDs:
+ for i in range(0,2):
+ if IsParallel(Edge,Vec[i]):
+ if not Reference[i]: # If this is the first found edge to be parallel to this direction, apply user preferences for meshing
+ Reference[i] = Edge
+ ApplyConstant1DMesh(MacObject.Mesh[0],Edge,int(round(ReducedRatio[i]*MacObject.MeshPar[0])))
+ break
+ else: # If there already exists an edge parallel to this direction, then use a 1D projection
+ Apply1DProjMesh(MacObject.Mesh[0],Edge,Reference[i])
+ break
+
+ MacObject.Mesh[0].Compute() # Generates the mesh
+
+ MacObject.DirectionalMeshParams = [MacObject.MeshPar[0]*ReducedRatio[1],MacObject.MeshPar[0]*ReducedRatio[1],MacObject.MeshPar[0]*ReducedRatio[0],MacObject.MeshPar[0]*ReducedRatio[0]]
+
+ MacObject.status = 1
+ Config.ListObj.append(MacObject)
+ return MacObject
+
+##########################################################################################################
+
+def CompBoxF (MacObject):
+ if Config.debug : print "Generating composite box"
+
+ dummy1 = geompy.MakeScaleAlongAxes( ElemBox11 (), None , MacObject.GeoPar[1][0], MacObject.GeoPar[1][1], 1)
+ RectFace = geompy.MakeTranslation(dummy1, MacObject.GeoPar[0][0], MacObject.GeoPar[0][1], 0)
+
+ MacObject.GeoChildren.append(RectFace)
+ MacObject.GeoChildrenNames.append("Box_"+ str(len(Config.ListObj)+1))
+
+ if Config.debug : Publish (MacObject.GeoChildren,MacObject.GeoChildrenNames)
+
+ if Config.publish :
+ MacObject.Mesh.append(smesh.Mesh(RectFace)) # Creation of a new mesh
+ Quad2D = MacObject.Mesh[0].Quadrangle() # Applying a quadrangle hypothesis
+
+ EdgeIDs = geompy.SubShapeAllSorted(RectFace,6) # List of Edge IDs belonging to RectFace, 6 = Edge in salome dictionary
+
+ #ReducedRatio = ReduceRatio(MacObject.GeoPar[1][0],MacObject.GeoPar[1][1])
+
+ Reference = [0,0,0]
+ Vec = [(1,0,0),(0,1,0)]
+ for Edge in EdgeIDs:
+ for i in range(0,2):
+ if IsParallel(Edge,Vec[i]):
+ if not Reference[i]: # If this is the first found edge to be parallel to this direction, apply user preferences for meshing
+ Reference[i] = Edge
+ ApplyConstant1DMesh(MacObject.Mesh[0],Edge,int(round(MacObject.MeshPar[0][i])))
+ break
+ else: # If there already exists an edge parallel to this direction, then use a 1D projection
+ Apply1DProjMesh(MacObject.Mesh[0],Edge,Reference[i])
+ break
+
+ MacObject.Mesh[0].Compute() # Generates the mesh
+
+ MacObject.DirectionalMeshParams = [MacObject.MeshPar[0][1],MacObject.MeshPar[0][1],MacObject.MeshPar[0][0],MacObject.MeshPar[0][0]]
+
+ MacObject.status = 1
+ Config.ListObj.append(MacObject)
+ return MacObject
+##########################################################################################################
+
+def NonOrtho (MacObject):
+ if Config.debug : print "Generating Non-orthogonal quadrangle"
+
+ RectFace = Quadrangler (MacObject.PtCoor)
+
+ MacObject.GeoChildren.append(RectFace)
+ MacObject.GeoChildrenNames.append("Quad_"+ str(len(Config.ListObj)+1))
+
+
+ if Config.debug : Publish (MacObject.GeoChildren,MacObject.GeoChildrenNames)
+
+ if Config.publish :
+ MacObject.Mesh.append(smesh.Mesh(RectFace)) # Creation of a new mesh
+ Quad2D = MacObject.Mesh[0].Quadrangle() # Applying a quadrangle hypothesis
+
+ EdgeIDs = geompy.SubShapeAllSorted(RectFace,6) # List of Edge IDs belonging to RectFace, 6 = Edge in salome dictionary
+
+ #ReducedRatio = ReduceRatio(MacObject.GeoPar[1][0],MacObject.GeoPar[1][1])
+
+ Vec = [MacObject.DirVectors(i) for i in range(4)]
+ for Edge in EdgeIDs:
+ Dir = [IsParallel(Edge,Vec[j]) for j in range(4)].index(True)
+ DirConv = [0,0,1,1][Dir]
+ ApplyConstant1DMesh(MacObject.Mesh[0],Edge,int(round(MacObject.MeshPar[0][DirConv])))
+
+ MacObject.Mesh[0].Compute() # Generates the mesh
+
+ MacObject.DirectionalMeshParams = [MacObject.MeshPar[0][1],MacObject.MeshPar[0][1],MacObject.MeshPar[0][0],MacObject.MeshPar[0][0]]
+
+ MacObject.status = 1
+ Config.ListObj.append(MacObject)
+ return MacObject
+
+##########################################################################################################
+
+def QuartCyl (MacObject):
+ if Config.debug : print "Generating quarter cylinder"
+ Z_Axis = geompy.MakeVectorDXDYDZ(0., 0., 1.)
+ RotAngle = {'NE' : lambda : 0,
+ 'NW' : lambda : math.pi/2,
+ 'SW' : lambda : math.pi,
+ 'SE' : lambda : -math.pi/2, }[MacObject.MeshPar[1]]()
+ dummy0 = geompy.MakeRotation( ElemQuartCyl(MacObject.MeshPar[2]) , Z_Axis, RotAngle )
+ dummy1 = geompy.MakeScaleAlongAxes( dummy0, None , MacObject.GeoPar[1][0]/10., MacObject.GeoPar[1][1]/10., 1)
+ RectFace = geompy.MakeTranslation(dummy1, MacObject.GeoPar[0][0], MacObject.GeoPar[0][1], 0)
+
+ MacObject.GeoChildren.append(RectFace)
+ MacObject.GeoChildrenNames.append("Box_"+ str(len(Config.ListObj)+1))
+
+ if Config.debug : Publish (MacObject.GeoChildren,MacObject.GeoChildrenNames)
+
+ if Config.publish :
+ MacObject.Mesh.append(smesh.Mesh(RectFace)) # Creation of a new mesh
+ Quad2D = MacObject.Mesh[0].Quadrangle() # Applying a quadrangle hypothesis
+
+ EdgeIDs = geompy.SubShapeAllSorted(RectFace,6) # List of Edge IDs belonging to RectFace, 6 = Edge in salome dictionary
+ Reg1D = MacObject.Mesh[0].Segment()
+
+ #if MacObject.MeshPar[0] == 2 and MacObject.MeshPar[2] <= 2.:
+ # print("Due to a bug in Salome 6.3, we are forced to either increase or decrease the local refinement by 50%, we choose in this case to increase the model's refinement.")
+ # MacObject.MeshPar[0] = 3
+
+ Reg1D.NumberOfSegments(MacObject.MeshPar[0])
+
+ MacObject.Mesh[0].Compute() # Generates the mesh
+
+ MacObject.status = 1
+
+ x = MacObject.MeshPar[0]
+ N = QuarCylParam(MacObject.MeshPar[2])+1
+
+ MacObject.DirectionalMeshParams = {'NE' : lambda : [2*x, N*x, 2*x, N*x],
+ 'NW' : lambda : [N*x, 2*x, 2*x, N*x],
+ 'SW' : lambda : [N*x, 2*x, N*x, 2*x],
+ 'SE' : lambda : [2*x, N*x, N*x, 2*x], }[MacObject.MeshPar[1]]()
+
+ Config.ListObj.append(MacObject)
+ return MacObject
+
+##########################################################################################################
+# Below this are the elementary calculation/visualization functions
+##########################################################################################################
+
+def Publish (ObjToPublish,NamesToPublish):
+ i = 0
+ for GeoObj in ObjToPublish :
+ geompy.addToStudy(GeoObj,NamesToPublish[i])
+ i = i+1
+
+def IsParallel (Edge, Vector):
+ """
+ Function checks whether a given edge object is parallel to a reference vector.
+ Output can be 0 (not parallel) or 1 (parallel and same sense) or 2 (parallel and opposite sense).
+ If the reference vector is null, the function returns 0
+ """
+ if Vector == (0,0,0) : return 0
+ else :
+ P1 = geompy.PointCoordinates(geompy.GetVertexByIndex(Edge,0))
+ P2 = geompy.PointCoordinates(geompy.GetVertexByIndex(Edge,1))
+ V0 = [ P1[0] - P2[0], P1[1] - P2[1], P1[2] - P2[2] ]
+ if Distance2Pt((0,0,0),CrossProd(V0,Vector))<1e-7 and DotProd(V0,Vector) > 0 : return 1
+ elif Distance2Pt((0,0,0),CrossProd(V0,Vector))<1e-7 and DotProd(V0,Vector) < 0 : return 2
+ else : return 0
+
+def IsOnCircle (Edge, Center, Radius):
+ """
+ Function checks whether a given edge object belong to the periphery of a circle defined by its
+ center and radius.
+ Output can be 0 (does not belong) or 1 (belongs).
+ If the reference Radius is null, the function returns 0
+ Note that this function is basic in the sense that it only checks if the two border points of a
+ given edge belong to the arc of reference.
+ """
+ if Radius == 0 : return 0
+ else :
+ P1 = geompy.PointCoordinates(geompy.GetVertexByIndex(Edge,0))
+ P2 = geompy.PointCoordinates(geompy.GetVertexByIndex(Edge,1))
+ if abs(Distance2Pt(Center,P1)-Radius) < 1e-6 and abs(Distance2Pt(Center,P2)-Radius) < 1e-6:
+ return 1
+ else :
+ return 0
+
+def CrossProd(V1,V2):
+ """
+ Determines the cross product of two 3D vectors
+ """
+ return ([V1[1]*V2[2]-V1[2]*V2[1], V1[2]*V2[0]-V1[0]*V2[2], V1[0]*V2[1]-V1[1]*V2[0]])
+
+def QuarCylParam(PitchRatio):
+ R = float(PitchRatio)/(PitchRatio+1)
+ Eps = 1. - R
+ X = (R+Eps/2.)*math.sin(math.pi/4)+Eps/2.
+ N = int(math.floor((math.pi*R/4.)/(Eps/2.)))
+ return N
+
+def DotProd(V1,V2):
+ """
+ Determines the dot product of two 3D vectors
+ """
+ if len(V1)==2 : V1.append(0)
+ if len(V2)==2 : V2.append(0)
+
+ return (V1[0]*V2[0]+V1[1]*V2[1]+V1[2]*V2[2])
+
+def Distance2Pt(P1,P2):
+ """
+ Returns the distance between two points
+ """
+ return (math.sqrt((P1[0]-P2[0])**2+(P1[1]-P2[1])**2+(P1[2]-P2[2])**2))
+
+def ApplyConstant1DMesh (ParentMsh, Edge, Nseg):
+ Reg1D = ParentMsh.Segment(geom=Edge)
+ Len = Reg1D.NumberOfSegments(Nseg)
+
+def Apply1DProjMesh (ParentMsh, Edge, Ref):
+ Proj1D = ParentMsh.Projection1D(geom=Edge)
+ SrcEdge = Proj1D.SourceEdge(Ref,None,None,None)
+
+def EdgeLength (Edge):
+ """
+ This function returns the edge object length.
+ """
+ P1 = geompy.PointCoordinates(geompy.GetVertexByIndex(Edge,0))
+ P2 = geompy.PointCoordinates(geompy.GetVertexByIndex(Edge,1))
+ return Distance2Pt(P1,P2)
+
+
+def D2R (Angle):
+ return Angle*math.pi/180
+
+def R2D (Angle):
+ return Angle*180/math.pi
+
+def F2D (FloatNumber):
+ return round(FloatNumber*100.)/100.
+
+def BezierGen (PointA, PointB, AngleA, AngleB):
+
+ if AngleA == 0 and AngleB == 0 : return (geompy.MakeEdge(PointA, PointB))
+ else :
+ A = geompy.PointCoordinates(PointA)
+ B = geompy.PointCoordinates(PointB)
+ dAB = Distance2Pt(A,B)
+ dAC = dAB * (math.tan(AngleA)*math.tan(AngleB)) / (math.sin(AngleA) * ( math.tan(AngleA)+math.tan(AngleB) ) )
+ AngleOX_AB = math.acos((B[0]-A[0])/dAB)
+ PointC = geompy.MakeVertex(A[0]+math.cos(AngleA+AngleOX_AB)*dAC,A[1]+math.sin(AngleA+AngleOX_AB)*dAC,0)
+ CurveACB = geompy.MakeBezier([PointA,PointC,PointB])
+ return CurveACB
+
+def GetSideAngleForBezier (PointA , PointB):
+ """
+ This function takes for input two points A and B where the bezier line is needed. It calculates the incident
+ angle needed at point A so that the final curve is either at 0 or 90 degrees from the x'Ox axis
+ """
+ A = geompy.PointCoordinates(PointA)
+ B = geompy.PointCoordinates(PointB)
+ ABx = B[0]-A[0]
+ dAB = Distance2Pt(A,B)
+ Alpha = math.acos(ABx/dAB)
+ #print "New angle request"
+ #print ABx, dAB, R2D(Alpha)
+ if Alpha < math.pi/4 :
+ #print "returning", R2D(-Alpha)
+ return -Alpha
+ elif Alpha < 3*math.pi/4 :
+ #print "returning", R2D(-(Alpha-math.pi/2))
+ return -(Alpha-math.pi/2)
+ else :
+ #print "returning", R2D(-(Alpha-math.pi))
+ return -(Alpha-math.pi)
+
+def VecDivRatio (Vec1, Vec2):
+ """
+ This function tries to find the ratio of Vec1 on Vec2 while neglecting any zero term in Vec1. This is used afterwards
+ for determining the global mesh parameter from automatically detected directional mesh params. If no compatibility is
+ possible, the function returns -1
+ """
+ Vec3 = []
+ for i in range(len(Vec1)) :
+ Vec3.append(float(Vec1[i])/Vec2[i])
+ Ratio=[]
+ for i in Vec3 :
+ if not (abs(i)<1e-7) : Ratio.append(i)
+ if Ratio :
+ if min(Ratio) == max(Ratio) and min(Ratio)==int(min(Ratio)) : return(min(Ratio))
+ else : return -1
+ else :
+ return -2
+
+
+def ReduceRatio (dx, dy):
+ """
+ This function transforms a decimal ratio into a scale between two integers, for example : [0.2,0.05] --> [4,1] ;
+ """
+ Output = [0,0]
+ ratio = float(dy)/dx
+ if isinteger(ratio) : return [1,ratio]
+ elif dx == 1 : # when this function is called recursively!
+ for i in range(1,20) : # searches over 20 decimals
+ if isinteger(ratio * (10**i) ) :
+ Output = GetScale((10**i),int(round(ratio * (10**i) ) ) )
+ break
+ else :
+ for n in range(0,i) :
+ if isinteger(ratio * ( 10**(i)-10**(n) )) :
+ Output = GetScale( 10**(i)-10**(n) , int(round(ratio * ( 10**(i)-10**(n) ) ) ) )
+ break
+ if not (Output==[0,0]) : break
+ return Output
+ else :
+ for i in range(1,10) : # searches over 10 decimals
+ if isinteger(ratio * (10**i) ) :
+ Output = GetScale((10**i),int(round(ratio * (10**i) ) ) )
+ break
+ else :
+ for n in range(0,i) :
+ if isinteger(ratio * ( 10**(i)-10**(n) )) :
+ Output = GetScale( 10**(i)-10**(n) , int(round(ratio * ( 10**(i)-10**(n) ) ) ) )
+ break
+ if not (Output==[0,0]) : break
+
+ if Output == [0,0] :
+ print "We are having some trouble while interpreting the following ratio: ",ratio, "\nWe will try a recursive method which may in some cases take some time..."
+ if dy > dx :
+ A = ReduceRatio (dx, dy-dx)
+ return ([A[0],A[1]+A[0]])
+ else :
+ A = ReduceRatio (dy, dx-dy)
+ return ([A[1]+A[0],A[0]])
+
+ else : return Output
+
+def GetScale (X,Y):
+ """
+ This function is called within ReduceRatio and aims to reduce down two integers X and Y by dividing them with their common divisors;
+ Example: 25 and 5 ---> 5 and 1 / 63 and 12 ---> 21 and 4
+ """
+ MaxDiv = max(X,Y)
+ Divisor = 2 # Initializing the divisor
+ while MaxDiv >= Divisor :
+ X0 = 0
+ Y0 = 0
+ if not(X%Divisor) :
+ X0 = X/Divisor
+ MaxDiv = max(MaxDiv,X0)
+ if not(Y%Divisor) :
+ Y0 = Y/Divisor
+ MaxDiv = max(MaxDiv,Y0)
+ if (X0*Y0) :
+ X = X0
+ Y = Y0
+ else :
+ Divisor = Divisor + 1
+ return [X,Y]
+
+def isinteger (x) :
+ """
+ This functions applies a simple check if the entered value is an integer
+ """
+ x = float('%.5f' % (x)) #Truncate x to 5 digits after the decimal point
+ if math.ceil(x) == math.floor(x) : return True
+ else : return False
+##########################################################################################
+# Below this are the functions that create the elementary forms for the macro objects
+##########################################################################################
+
+def ElemBox11 ():
+ """
+ This function returns a simple square face of 1 side length
+ """
+ RectFace = geompy.MakeFaceHW(1, 1, 1)
+ return RectFace
+
+def ElemBox42 ():
+ """
+ This function returns a square face of 1 side length, partitioned
+ according to the elementary 4 to 2 reductor method
+ """
+ OrigRectFace = geompy.MakeFaceHW(1, 1, 1)
+
+ SouthPt1 = geompy.MakeVertex (-.25, -.5, 0)
+ SouthPt2 = geompy.MakeVertex (0, -.5, 0)
+ SouthPt3 = geompy.MakeVertex (.25, -.5, 0)
+ WestPt1 = geompy.MakeVertex (-.5, -.5+1./3, 0)
+ WestPt2 = geompy.MakeVertex (-.5, -.5+2./3, 0)
+ EastPt1 = geompy.MakeVertex (.5, -.5+1./3, 0)
+ EastPt2 = geompy.MakeVertex (.5, -.5+2./3, 0)
+ NorthPt = geompy.MakeVertex (0, .5, 0)
+ MidPt1 = geompy.MakeVertex (0, .05, 0)
+ MidPt2 = geompy.MakeVertex (.2, -.18, 0)
+ MidPt3 = geompy.MakeVertex (0, -.28, 0)
+ MidPt4 = geompy.MakeVertex (-.2, -.18, 0)
+
+ Cutter = []
+ Cutter.append(geompy.MakeEdge(SouthPt2, MidPt3))
+ Cutter.append(geompy.MakeEdge(MidPt1, NorthPt))
+ Cutter.append(BezierGen(SouthPt1, MidPt4, GetSideAngleForBezier(SouthPt1,MidPt4), D2R(15)))
+ Cutter.append(BezierGen(SouthPt3, MidPt2, GetSideAngleForBezier(SouthPt3,MidPt2), D2R(-15)))
+ Cutter.append(BezierGen(WestPt1, MidPt4, GetSideAngleForBezier(WestPt1,MidPt4), D2R(-10)))
+ Cutter.append(BezierGen(EastPt1, MidPt2, GetSideAngleForBezier(EastPt1,MidPt2), D2R(10)))
+ Cutter.append(BezierGen(WestPt2, MidPt1, GetSideAngleForBezier(WestPt2,MidPt1), D2R(-10)))
+ Cutter.append(BezierGen(EastPt2, MidPt1, GetSideAngleForBezier(EastPt2,MidPt1), D2R(10)))
+ Cutter.append(BezierGen(MidPt2, MidPt1, D2R(-15), D2R(-15)))
+ Cutter.append(BezierGen(MidPt3, MidPt2, D2R(10), D2R(15)))
+ Cutter.append(BezierGen(MidPt3, MidPt4, D2R(-10), D2R(-15)))
+ Cutter.append(BezierGen(MidPt4, MidPt1, D2R(15), D2R(15)))
+
+ RectFace = geompy.MakePartition([OrigRectFace],Cutter, [], [],4, 0, [], 0) #Creating the partition object
+ #i=1
+ #for SingleCut in Cutter :
+ # geompy.addToStudy(SingleCut,'Cutter'+str(i))
+ # i = i+1
+ #geompy.addToStudy(RectFace,'RectFace')
+ return RectFace
+
+def ElemEdge32 ():
+ """
+ This function returns a square face of 1 side length, partitioned
+ according to the elementary edge with 3 to 2 reductor
+ """
+ OrigRectFace = geompy.MakeFaceHW(1., 1., 1)
+
+ SouthPt1 = geompy.MakeVertex (-1./6, -0.5, 0.)
+ SouthPt2 = geompy.MakeVertex ( 1./6, -0.5, 0.)
+ WestPt1 = geompy.MakeVertex (-0.5, -1./6, 0.)
+ WestPt2 = geompy.MakeVertex (-0.5, 1./6, 0.)
+ EastPt = geompy.MakeVertex ( 0.5, 0., 0.)
+ NorthPt = geompy.MakeVertex (0., 0.5, 0.)
+
+ MidPt1 = geompy.MakeVertex (-0.2, -0.2, 0.)
+ MidPt2 = geompy.MakeVertex ( -0.02, -0.02, 0.)
+
+ Cutter = []
+ Cutter.append(BezierGen(SouthPt1, MidPt1, GetSideAngleForBezier(SouthPt1,MidPt1) , D2R(-5)))
+ Cutter.append(BezierGen( WestPt1, MidPt1, GetSideAngleForBezier(WestPt1 ,MidPt1) , D2R(-5)))
+ Cutter.append(BezierGen(SouthPt2, MidPt2, GetSideAngleForBezier(SouthPt2,MidPt2) , D2R(-10)))
+ Cutter.append(BezierGen( EastPt, MidPt2, GetSideAngleForBezier(EastPt ,MidPt2) , D2R(5)))
+ Cutter.append(BezierGen( WestPt2, MidPt2, GetSideAngleForBezier(WestPt2 ,MidPt2) , D2R(-10)))
+ Cutter.append(BezierGen( MidPt2, NorthPt, GetSideAngleForBezier(NorthPt ,MidPt2) , D2R(-5)))
+
+ Cutter.append(geompy.MakeEdge(MidPt1, MidPt2))
+
+ RectFace = geompy.MakePartition([OrigRectFace],Cutter, [], [],4, 0, [], 0) #Creating the partition object
+ #i=1
+ #for SingleCut in Cutter :
+ # geompy.addToStudy(SingleCut,'Cutter'+str(i))
+ # i = i+1
+ #geompy.addToStudy(RectFace,'RectFace')
+ return RectFace
+
+def Quadrangler (Points):
+ """
+ This function returns a quadranglar face based on four points, non of which 3 are non-colinear.
+ The points are defined by their 2D [(x1,y1),(x2,y2)..] coordinates.
+ Note that the list of points is already arranged upon the creation in MacObject
+ """
+ Pt = []
+ for Point in Points: Pt.append(geompy.MakeVertex(Point[0], Point[1], 0))
+ # The first point is added at the end of the list in order to facilitate the line creation
+ Pt.append(Pt[0])
+ #Draw the lines in order to form the 4 side polygon
+ Ln=[]
+ for i in range(4) : Ln.append(geompy.MakeLineTwoPnt(Pt[i],Pt[i+1]))
+ RectFace = geompy.MakeQuad (Ln[0],Ln[1],Ln[2],Ln[3])
+ return RectFace
+
+def ElemQuartCyl(K):
+ """
+ This function returns a quarter cylinder to box relay of 1 side length, partitioned
+ with a pitch ratio of K, In other words the side of the box is R*(1+(1/K))
+ """
+ R = 10.*float(K)/(K+1)
+ Eps = 10.- R
+
+ Config.theStudy.SetReal("R" , R)
+ Config.theStudy.SetReal("minusR" , -R)
+ Config.theStudy.SetReal("Eps", Eps)
+
+ CylWire = geompy.MakeSketcher("Sketcher:F 'R' 0:R 0:L 'Eps':TT 10. 10.0:R 90:L 10.0:R 90:L 'Eps':R 90:C 'minusR' 90.0:WW", [0, 0, 0, 0, 0, 1, 1, 0, -0])
+ CylFace = geompy.MakeFace(CylWire, 1)
+
+ SouthPt = geompy.MakeVertex (R+Eps/2., 0., 0)
+ SouthWestPt = geompy.MakeVertex ( 0.,0., 0) #The origin can be used for practical partionning objectifs
+ WestPt = geompy.MakeVertex (0., R+Eps/2., 0)
+
+ N = int(math.floor((math.pi*R/4.)/(Eps/2.)))
+ X = 10.*(1.-1./(N+1))
+
+
+ EastPt = geompy.MakeVertex (10.0, X, 0.)
+ NorthPt = geompy.MakeVertex ( X, 10.0, 0.)
+
+ DivFactor = 8./(F2D(math.log(K))-0.223)
+ #MidPt = geompy.MakeVertex ((R+Eps)*math.cos(math.pi/4), (R+Eps)*math.sin(math.pi/4), 0.)
+ MidPt = geompy.MakeVertex (X-Eps/DivFactor, X-Eps/DivFactor, 0.)
+
+ Cutter = []
+ Cutter.append(BezierGen(SouthWestPt, MidPt, GetSideAngleForBezier(SouthWestPt,MidPt) , D2R(-5)))
+ Cutter.append(BezierGen( EastPt, MidPt, GetSideAngleForBezier(EastPt,MidPt) , D2R(5)))
+ Cutter.append(BezierGen( MidPt, NorthPt, (-1)**((K<1.25)*1)*D2R(-5), GetSideAngleForBezier(NorthPt,MidPt)))
+ SMBezier = BezierGen( SouthPt, MidPt, GetSideAngleForBezier(SouthPt ,MidPt) , D2R((K<1.25)*180-5))
+ WMBezier = BezierGen( WestPt, MidPt, GetSideAngleForBezier(WestPt, MidPt) , D2R(-5))
+ Cutter.append(WMBezier)
+ Cutter.append(SMBezier)
+
+ for i in range(1,N) :
+ # Determining intermediate points on the bezier lines and then performing additional cuts
+
+ TempAnglePlus = (math.pi/4)*(1+float(i)/N)
+ SectionResult = CutnGroup.Go(WMBezier, [(0,0,0,math.sin(TempAnglePlus),-math.cos(TempAnglePlus),0)], [1], ['Dummy'], 0)
+ TempPt1 = SectionResult[1][0]
+ TempPt11 = geompy.MakeVertex ((N-i)*X/N, 10., 0)
+
+ TempAngleMinus = (math.pi/4)*(1-float(i)/N)
+ SectionResult = CutnGroup.Go(SMBezier, [(0,0,0,math.sin(TempAngleMinus),-math.cos(TempAngleMinus),0)], [1], ['Dummy'], 0)
+ TempPt2 = SectionResult[1][0]
+ TempPt21 = geompy.MakeVertex (10., (N-i)*X/N, 0)
+
+ Cutter.append(geompy.MakeEdge(SouthWestPt, TempPt1))
+ Cutter.append(geompy.MakeEdge(SouthWestPt, TempPt2))
+ Cutter.append(geompy.MakeEdge(TempPt1, TempPt11))
+ Cutter.append(geompy.MakeEdge(TempPt2, TempPt21))
+
+ CylFace = geompy.MakePartition([CylFace],Cutter, [], [],4, 0, [], 0) #Creating the partition object
+ CylFace = geompy.MakeTranslation(CylFace, -5., -5., 0.0)
+
+ return CylFace
+
+def CompatibilityTest(MacObject):
+ Type = MacObject.Type
+ if Type == 'Box11' :
+ BaseDirPar = [1,1,1,1]
+ return int(VecDivRatio(MacObject.DirectionalMeshParams, BaseDirPar))
+ elif Type == 'Box42' :
+ BaseDirPar = {'SN' : lambda : [3, 3, 4, 2],
+ 'NS' : lambda : [3, 3, 2, 4],
+ 'EW' : lambda : [2, 4, 3, 3],
+ 'WE' : lambda : [4, 2, 3, 3], }[MacObject.MeshPar[1]]()
+ return int(VecDivRatio(MacObject.DirectionalMeshParams, BaseDirPar))
+ elif Type == 'BoxAng32' :
+ BaseDirPar = {'NE' : lambda : [3, 2, 3, 2],
+ 'NW' : lambda : [2, 3, 3, 2],
+ 'SW' : lambda : [2, 3, 2, 3],
+ 'SE' : lambda : [3, 2, 2, 3], }[MacObject.MeshPar[1]]()
+ return int(VecDivRatio(MacObject.DirectionalMeshParams, BaseDirPar))
+ elif Type == 'CompBox' :
+ #print "dx is: ", MacObject.GeoPar[1][1], ". dy is: ",MacObject.GeoPar[1][0]
+ ReducedRatio = ReduceRatio(MacObject.GeoPar[1][0], MacObject.GeoPar[1][1])
+ #print ReducedRatio
+ BaseDirPar = [ReducedRatio[1], ReducedRatio[1], ReducedRatio[0], ReducedRatio[0]]
+ return int(VecDivRatio(MacObject.DirectionalMeshParams, BaseDirPar))
+
+ elif Type == 'QuartCyl' :
+ N = QuarCylParam(MacObject.MeshPar[2])+1
+ BaseDirPar = {'NE' : lambda : [2, N, 2, N],
+ 'NW' : lambda : [N, 2, 2, N],
+ 'SW' : lambda : [N, 2, N, 2],
+ 'SE' : lambda : [2, N, N, 2], }[MacObject.MeshPar[1]]()
+ return int(VecDivRatio(MacObject.DirectionalMeshParams, BaseDirPar))
+ elif Type == 'CompBoxF' :
+ RealRatio = MacObject.GeoPar[1][1]/MacObject.GeoPar[1][0]
+ Xd = 0
+ Yd = 0
+ if MacObject.DirectionalMeshParams[2]+MacObject.DirectionalMeshParams[3] :
+ A = int(max(MacObject.DirectionalMeshParams[2:4]))
+ Xd = int(VecDivRatio([A,0,0,0], [1,1,1,1]))
+ if MacObject.DirectionalMeshParams[0]+MacObject.DirectionalMeshParams[1] :
+ A = int(max(MacObject.DirectionalMeshParams[0:2]))
+ Yd = int(VecDivRatio([0,0,A,0], [1,1,1,1]))
+
+ if Xd == 0 and Yd : Xd = int(round(Yd/RealRatio))
+ elif Yd == 0 : Yd = int(round(RealRatio*Xd))
+
+ return [Xd,Yd]
+ elif Type == 'NonOrtho' :
+ MeanDX = 0.5*(IntLen(MacObject.DirBoundaries(0))+IntLen(MacObject.DirBoundaries(1)))
+ MeanDY = 0.5*(IntLen(MacObject.DirBoundaries(2))+IntLen(MacObject.DirBoundaries(3)))
+ RealRatio = MeanDY/MeanDX
+ Xd = 0
+ Yd = 0
+ if MacObject.DirectionalMeshParams[2]+MacObject.DirectionalMeshParams[3] :
+ A = int(max(MacObject.DirectionalMeshParams[2:4]))
+ Xd = int(VecDivRatio([A,0,0,0], [1,1,1,1]))
+ if MacObject.DirectionalMeshParams[0]+MacObject.DirectionalMeshParams[1] :
+ A = int(max(MacObject.DirectionalMeshParams[0:2]))
+ Yd = int(VecDivRatio([0,0,A,0], [1,1,1,1]))
+
+ if Xd == 0 and Yd : Xd = int(round(Yd/RealRatio))
+ elif Yd == 0 : Yd = int(round(RealRatio*Xd))
+
+ return [Xd,Yd]
+
+def IntLen (Interval) :
+ """
+ This function returns the length of a given interval even if the latter is not sorted correctly.
+ """
+ return abs(Interval[1]-Interval[0])
+
+def NextTo (RefBox, Direction, Extension):
+ """
+ This functions returns geometrical parameters for easy positioning of neighbouring objects.
+ The input (RefBox) and output are in the form : [(X0,Y0),(DX,DY)]
+ """
+ X0_0 = RefBox[0][0]
+ Y0_0 = RefBox[0][1]
+ DX_0 = RefBox[1][0]
+ DY_0 = RefBox[1][1]
+
+ DirectionalCoef = {'Above' : lambda : [ 0, 1],
+ 'Below' : lambda : [ 0,-1],
+ 'Right' : lambda : [ 1, 0],
+ 'Left ' : lambda : [-1, 0], }[Direction]()
+
+ X0_1 = X0_0+ DirectionalCoef[0] * (DX_0/2.+Extension/2.)
+ DX_1 = abs(DirectionalCoef[0]) * (Extension) + abs(DirectionalCoef[1])*DX_0
+ Y0_1 = Y0_0+ DirectionalCoef[1] * (DY_0/2.+Extension/2.)
+ DY_1 = abs(DirectionalCoef[1]) * (Extension) + abs(DirectionalCoef[0])*DY_0
+
+ return [(X0_1,Y0_1),(DX_1,DY_1)]
+
+def GeomMinMax (PtA, PtB):
+ """
+ This function returns geometrical parameters in the format [(X0,Y0),(DX,DY)]. The input being
+ the coordinates of two points (Xa,Ya), (Xb,Yb).
+ """
+ # First test that the vector relying the two points is oblique
+ AB = [PtB[0]- PtA[0],PtB[1]- PtA[1]]
+ if 0 in AB :
+ print ("Error: the two points are not correctly defined. In the orthonormal system XOY, it is impossible to define a rectangle with these two points")
+ return -1
+ else:
+ X0 = 0.5*(PtA[0]+PtB[0])
+ Y0 = 0.5*(PtA[1]+PtB[1])
+ DX = abs(AB[0])
+ DY = abs(AB[1])
+ return [(X0,Y0),(DX,DY)]
+
+def AddIfDifferent (List, Element):
+ if not(Element in List):
+ List = List+(Element,)
+ return List
+
+def IndexMultiOcc (Array,Element) :
+ """
+ This functions returns the occurrences indices of Element in Array.
+ As opposed to Array.index(Element) method, this allows determining
+ multiple entries rather than just the first one!
+ """
+ Output = []
+ try : Array.index(Element)
+ except ValueError : print "No more occurrences"
+ else : Output.append(Array.index(Element))
+
+ if not(Output == []) and len(Array) > 1 :
+ for index, ArrElem in enumerate(Array[Output[0]+1:]) :
+ if ArrElem == Element : Output.append(index+Output[0]+1)
+
+ return Output
+
+def SortList (ValList, CritList):
+ Output = []
+ SortedCritList = copy.copy(CritList)
+ SortedCritList.sort()
+ for i in range(0,len(ValList)):
+ if i > 0 :
+ if not(SortedCritList[i]==SortedCritList[i-1]):
+ index = IndexMultiOcc(CritList,SortedCritList[i])
+ Output= Output + [ValList[j] for j in index]
+ else :
+ index = IndexMultiOcc(CritList,SortedCritList[i])
+ Output= Output + [ValList[j] for j in index]
+
+ return Output
+
+def SortPoints(Points):
+ """
+ This function sorts a list of the coordinates of N points as to start at
+ an origin that represents Xmin and Xmax and then proceed in a counter
+ clock-wise sense
+ """
+ NbPts = len(Points)
+ Xmin = min([Points[i][0] for i in range(NbPts)])
+ Ymin = min([Points[i][1] for i in range(NbPts)])
+ Xmax = max([Points[i][0] for i in range(NbPts)])
+ Ymax = max([Points[i][1] for i in range(NbPts)])
+ Crit = [(abs(Point[0]-Xmin)+0.1*(Xmax-Xmin))*(abs(Point[1]-Ymin)+0.1*(Ymax-Ymin)) for Point in Points]
+ #print "Input Points : ", Points
+ #print "Sorting Criterion : ", Crit
+ Order = SortList (range(NbPts), Crit)
+ #print "Sorted Results : ", Order
+ Output = []
+ Output.append(Points[Order[0]])
+
+ Point0 = Points[Order[0]]
+ #print "Reference point :", Point0
+
+ V = [[Point1[0]-Point0[0],Point1[1]-Point0[1]] for Point1 in Points]
+ Cosines = [-(vec[0]-1E-10)/(math.sqrt(DotProd(vec,vec)+1e-25)) for vec in V]
+ #print "Cosines criterion :", Cosines
+ Order = SortList(range(NbPts),Cosines)
+ #print "Ordered points:", Order
+ for PtIndex in Order[:-1]: Output.append(Points[PtIndex])
+
+ return Output
+
--- /dev/null
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+
+
+class MacObject:
+ """
+ This represents a python class definition which contains
+ all necessary information about the macro object being created
+ in Salome
+ """
+
+ def __init__( self, ObjectType, GeoParameters, MeshParameters, **args ):
+ """
+ Initializes the macro object to be created, saves parameters inside of it, checks for neighboring objects,
+ determines meshing parameters if necessary and finally launches the generation process.
+ """
+ import Config,GenFunctions
+ if Config.debug : print "Initializing object No. " + str(len(Config.ListObj)+1)
+
+ if 'publish' in args :
+ if args['publish']==0 : Config.publish = 0
+ else : Config.publish = 1
+ else : Config.publish = 1
+
+ if 'groups' in args :
+ self.GroupNames = args['groups']
+ for group in args['groups'] :
+ if not(group in Config.Groups) and group : Config.Groups.append(group)
+ else : self.GroupNames = [None, None, None, None]
+
+ if ObjectType == 'NonOrtho':
+ if not(len(GeoParameters)==4): print "Error: trying to construct a non-ortho object but the 4 constitutive vertices are not given!"
+ else :
+ Xmin = min([GeoParameters[i][0] for i in range(4)])
+ Xmax = max([GeoParameters[i][0] for i in range(4)])
+ Ymin = min([GeoParameters[i][1] for i in range(4)])
+ Ymax = max([GeoParameters[i][1] for i in range(4)])
+ self.GeoPar = [(0.5*(Xmin+Xmax),0.5*(Ymin+Ymax)),(Xmax-Xmin,Ymax-Ymin)]
+ self.PtCoor = GenFunctions.SortPoints(GeoParameters)
+ else:
+ self.GeoPar = GeoParameters
+ [Xmin,Ymin,Xmax,Ymax] = [ self.GeoPar[0][0]-0.5*self.GeoPar[1][0], self.GeoPar[0][1]-0.5*self.GeoPar[1][1] ] + [ self.GeoPar[0][0]+0.5*self.GeoPar[1][0], self.GeoPar[0][1]+0.5*self.GeoPar[1][1] ]
+ self.PtCoor = [(Xmin,Ymin),(Xmax,Ymin),(Xmax,Ymax),(Xmin,Ymax)]
+
+ self.Type = ObjectType
+ self.LowBound = [ self.GeoPar[0][0]-0.5*self.GeoPar[1][0], self.GeoPar[0][1]-0.5*self.GeoPar[1][1] ]
+ self.UpperBound = [ self.GeoPar[0][0]+0.5*self.GeoPar[1][0], self.GeoPar[0][1]+0.5*self.GeoPar[1][1] ]
+ self.MeshPar = MeshParameters
+ self.GeoChildren = []
+ self.GeoChildrenNames = []
+ self.Mesh = []
+ self.MeshGroups = []
+ self.CheckInterfaces()
+ if 'auto' in MeshParameters : self.AutoParam()
+ if not(self.MeshPar[0]<0): self.Generate()
+ else :
+ Config.ListObj.append(self)
+ print("Aborting object creation\n ")
+
+ def Generate(self) :
+ """
+ This method generates the geometrical object with the corresponding mesh once all verifications (CheckInterfaces and AutoParam)
+ have been accomplished
+ """
+ import GenFunctions, Alarms, Config
+ self = {'Box11' : lambda : GenFunctions.Box11(self),
+ 'Box42' : lambda : GenFunctions.Box42(self),
+ 'BoxAng32' : lambda : GenFunctions.BoxAng32(self),
+ 'CompBox' : lambda : GenFunctions.CompBox(self),
+ 'CompBoxF' : lambda : GenFunctions.CompBoxF(self),
+ 'NonOrtho' : lambda : GenFunctions.NonOrtho(self),
+ 'QuartCyl' : lambda : GenFunctions.QuartCyl(self) }[self.Type]()
+
+ if Config.debug : Alarms.Message(self.status) # notification on the result of the generation algorithm
+
+
+ def CheckInterfaces(self):
+ """
+ This method searches for neighbours for the object being created and saves them inside the Config.Connections
+ array. This array contains 4 entries per object corresponding to West, East, South, and North neighbours.
+ Note that an object may have more than one neighbour for a given direction.
+ """
+ import Alarms, Config
+ from GenFunctions import AddIfDifferent
+ from CompositeBox import FindCommonSide
+
+ Config.Connections.append([(-1,),(-1,),(-1,),(-1,)])
+ itemID = len(Config.ListObj)
+ # In all cases except non ortho, PrincipleBoxes is unitary and contains the box in question
+ # In the non-ortho case it contains all possible combinations of boxes with 3 vertices
+ PrincipleBoxes = self.PrincipleBoxes()
+ for i, TestObj in enumerate(Config.ListObj):
+ SecondaryBoxes = TestObj.PrincipleBoxes()
+ ConnX = 0
+ ConnY = 0
+ for Box0 in PrincipleBoxes:
+ for Box1 in SecondaryBoxes:
+ # Along X
+ CenterDis = abs(Box1[0][0]-Box0[0][0])
+ Extension = 0.5*(Box1[1][0]+Box0[1][0])
+ if CenterDis - Extension < -1e-7 :
+ ConnX = -1
+ elif CenterDis - Extension < 1e-7 :
+ if not(FindCommonSide(self.DirBoundaries(2),TestObj.DirBoundaries(3))==[0,0]) and Box1[0][0] < Box0[0][0] : ConnX = 1
+ elif not(FindCommonSide(self.DirBoundaries(3),TestObj.DirBoundaries(2))==[0,0]) and Box1[0][0] >= Box0[0][0]: ConnX = 2
+ else : ConnX = 0
+
+ # Along Y
+ CenterDis = abs(Box1[0][1]-Box0[0][1])
+ Extension = 0.5*(Box1[1][1]+Box0[1][1])
+ if CenterDis - Extension < -1e-7 :
+ ConnY = -1
+ elif CenterDis - Extension < 1e-7 :
+ if not(FindCommonSide(self.DirBoundaries(0),TestObj.DirBoundaries(1))==[0,0]) and Box1[0][1] < Box0[0][1] : ConnY = 1
+ elif not(FindCommonSide(self.DirBoundaries(1),TestObj.DirBoundaries(0))==[0,0]) and Box1[0][1] >= Box0[0][1]: ConnY = 2
+ else : ConnY = 0
+
+ if not (ConnX*ConnY == 0) :
+ if max(ConnX,ConnY) == -1 and not('NonOrtho' in [self.Type,TestObj.Type]) : Alarms.Message(3)
+ else:
+ if ConnX == 1 and ConnY == -1:
+ if Config.Connections[i][1] == (-1,) : Config.Connections[i][1] = (itemID,)
+ else : Config.Connections[i][1] = AddIfDifferent(Config.Connections[i][1],itemID)
+ if Config.Connections[itemID][0] == (-1,) : Config.Connections[itemID][0] = (i,)
+ else : Config.Connections[itemID][0] = AddIfDifferent(Config.Connections[itemID][0],i)
+ elif ConnX == 2 and ConnY == -1:
+ if Config.Connections[i][0] == (-1,) : Config.Connections[i][0] = (itemID,)
+ else : Config.Connections[i][0] = AddIfDifferent(Config.Connections[i][0],itemID)
+ if Config.Connections[itemID][1] == (-1,) : Config.Connections[itemID][1] = (i,)
+ else : Config.Connections[itemID][1] = AddIfDifferent(Config.Connections[itemID][1],i)
+ elif ConnY == 1 and ConnX == -1:
+ if Config.Connections[i][3] == (-1,) : Config.Connections[i][3] = (itemID,)
+ else : Config.Connections[i][3] = AddIfDifferent(Config.Connections[i][3],itemID)
+ if Config.Connections[itemID][2] == (-1,) : Config.Connections[itemID][2] = (i,)
+ else : Config.Connections[itemID][2] = AddIfDifferent(Config.Connections[itemID][2],i)
+ elif ConnY ==2 and ConnX == -1:
+ if Config.Connections[i][2] == (-1,) : Config.Connections[i][2] = (itemID,)
+ else : Config.Connections[i][2] = AddIfDifferent(Config.Connections[i][2],itemID)
+ if Config.Connections[itemID][3] == (-1,) : Config.Connections[itemID][3] = (i,)
+ else : Config.Connections[itemID][3] = AddIfDifferent(Config.Connections[itemID][3],i)
+
+ def AutoParam (self):
+ """
+ This method is called only if the 'auto' keyword is used inside the meshing algorithm. It is based on the
+ connection results per object and tries to find the correct parameters for obtaining a final compatible mesh
+ between the objects already present and the one being created. If this is not possible, the method gives an error
+ message.
+ """
+ import Alarms, Config, GenFunctions, CompositeBox
+ MeshPar = [0,0,0,0] # initialize the mesh parameter value to be used to -1
+ [(X0,Y0),(DX,DY)] = self.GeoPar
+ ObjectsInvolved = []
+ for i, Conn in enumerate(Config.Connections[-1]):
+ if not ( Conn == (-1,) ): # Meaning that there is one or more neighbors on this direction
+ for ObjID in Conn :
+ ToLook0 = [2,3,0,1][i]
+ ToLook1 = [3,2,1,0][i]
+ CommonSide = CompositeBox.FindCommonSide(Config.ListObj[ObjID].DirBoundaries(ToLook1),self.DirBoundaries(ToLook0))
+ #print "Common Side is:", CommonSide
+ ToLook2 = [1,0,3,2][i]
+ #print "Full Side is:", CompositeBox.IntLen(Config.ListObj[ObjID].DirBoundaries(ToLook1))
+ #print "Full Segments on this direction are:", Config.ListObj[ObjID].DirectionalMeshParams[ToLook2]
+ RealSegments = round(Config.ListObj[ObjID].DirectionalMeshParams[ToLook2]*CompositeBox.IntLen(CommonSide)/CompositeBox.IntLen(Config.ListObj[ObjID].DirBoundaries(ToLook1)))
+ #print "RealSegments :", RealSegments
+
+ MeshPar[i] = MeshPar[i] + RealSegments
+ ObjectsInvolved.append(ObjID+1)
+ self.DirectionalMeshParams = MeshPar
+ self.MeshPar[0] = GenFunctions.CompatibilityTest(self)
+
+ if self.MeshPar[0] < 0 :
+ Alarms.Message(4)
+ if self.MeshPar[0] == -1 : print ("Problem encountered with object(s) no. "+str(ObjectsInvolved))
+ elif self.MeshPar[0] == -2 : print ("This object has no neighbours !!!")
+
+ def Boundaries (self):
+ """
+ This method returns the global boundaries of the MacObject. [Xmin,Xmax,Ymin,Ymax]
+ """
+ Xmin = min([self.DirBoundaries(i)[0] for i in [0,1]])
+ Xmax = max([self.DirBoundaries(i)[1] for i in [0,1]])
+ Ymin = min([self.DirBoundaries(i)[0] for i in [2,3]])
+ Ymax = max([self.DirBoundaries(i)[1] for i in [2,3]])
+
+ return [Xmin,Xmax,Ymin,Ymax]
+
+ def DirBoundaries (self, Direction):
+ """
+ This method returns a single interval giving [Xmin,Xmax] or [Ymin,Ymax] according to the required direction.
+ This works particularly well for nonorthogonal objects.
+ Direction : [0,1,2,3] <=> [South, North, West, East]
+ """
+ PtCoor = self.PtCoor
+ PtCoor.append(self.PtCoor[0])
+ if type(Direction) is str :
+ Dir = { 'South' : lambda : 0,
+ 'North' : lambda : 1,
+ 'West' : lambda : 2,
+ 'East' : lambda : 3,}[Direction]()
+ else : Dir = int(Direction)
+
+ PtIndex = [0,2,3,1][Dir]
+ DirIndex = [0,0,1,1][Dir]
+
+ return sorted([PtCoor[PtIndex][DirIndex],PtCoor[PtIndex+1][DirIndex]])
+ def DirVectors (self, Direction):
+ """
+ This method returns for a given object, the real vectors which define a given direction
+ The interest in using this method is for non-orthogonal objects where the sides can be
+ deviated from the orthogonal basis vectors
+ """
+ if type(Direction) is str :
+ Dir = { 'South' : lambda : 0,
+ 'North' : lambda : 1,
+ 'West' : lambda : 2,
+ 'East' : lambda : 3,}[Direction]()
+ else : Dir = int(Direction)
+ PtCoor = self.PtCoor
+ PtCoor.append(self.PtCoor[0])
+ PtIndex = [0,2,3,1][Dir]
+ return [PtCoor[PtIndex+1][0]-PtCoor[PtIndex][0],PtCoor[PtIndex+1][1]-PtCoor[PtIndex][1],0.]
+
+ def GetBorder (self, Criterion):
+ import GenFunctions, Config
+
+ from salome.geom import geomBuilder
+ geompy = geomBuilder.New( Config.theStudy )
+
+ if type(Criterion) is str :
+ Crit = {'South' : lambda : 0,
+ 'North' : lambda : 1,
+ 'West' : lambda : 2,
+ 'East' : lambda : 3,}[Criterion]()
+ else : Crit = int(Criterion)
+
+ AcceptedObj = []
+ if Crit < 4 :
+ Boundaries = self.Boundaries()
+ Research = {0 : lambda : [self.DirVectors(0),1,Boundaries[2]],
+ 1 : lambda : [self.DirVectors(1),1,Boundaries[3]],
+ 2 : lambda : [self.DirVectors(2),0,Boundaries[0]],
+ 3 : lambda : [self.DirVectors(3),0,Boundaries[1]], }[Crit]()
+
+ for i,ElemObj in enumerate(self.GeoChildren):
+ EdgeIDs = geompy.ExtractShapes(ElemObj,6)# List of Edge IDs belonging to ElemObj
+ for Edge in EdgeIDs:
+ if GenFunctions.IsParallel(Edge,Research[0]):
+ if abs( geompy.PointCoordinates(geompy.GetVertexByIndex(Edge,0))[Research[1]] - Research[2] )< 1e-6 or abs( geompy.PointCoordinates(geompy.GetVertexByIndex(Edge,1))[Research[1]] - Research[2] )< 1e-6 :
+ AcceptedObj.append(Edge)
+ else :
+ CenterSrchPar = {'NE' : lambda : [-1., -1.],
+ 'NW' : lambda : [ 1., -1.],
+ 'SW' : lambda : [ 1., 1.],
+ 'SE' : lambda : [-1., 1.], }[self.MeshPar[1]]()
+ Radius = self.GeoPar[1][1]*float(self.MeshPar[2])/(self.MeshPar[2]+1)
+ Center = (self.GeoPar[0][0]+CenterSrchPar[0]*self.GeoPar[1][0]/2.,self.GeoPar[0][1]+CenterSrchPar[1]*self.GeoPar[1][1]/2.,0.)
+ for i,ElemObj in enumerate(self.GeoChildren):
+ EdgeIDs = geompy.ExtractShapes(ElemObj,6)# List of Edge IDs belonging to ElemObj
+ for Edge in EdgeIDs:
+ if GenFunctions.IsOnCircle(Edge,Center,Radius):
+ AcceptedObj.append(Edge)
+ return AcceptedObj
+
+ def PrincipleBoxes (self):
+ """
+ This function returns all possible combination rectangular shape objects that can contain at least 3 of the principle vertices
+ constituting the MacObject. This is indispensible for the Non-ortho types and shall return a number of 24 possible combinations
+ """
+ from itertools import combinations
+ Boxes = []
+ if self.Type == 'NonOrtho':
+ for combi in combinations(range(4),3):
+ Xmin = min([self.PtCoor[i][0] for i in combi])
+ Xmax = max([self.PtCoor[i][0] for i in combi])
+ Ymin = min([self.PtCoor[i][1] for i in combi])
+ Ymax = max([self.PtCoor[i][1] for i in combi])
+ Boxes.append([(0.5*(Xmin+Xmax),0.5*(Ymin+Ymax)),(Xmax-Xmin,Ymax-Ymin)])
+ else :
+ Boxes = [self.GeoPar]
+
+ return Boxes
+
+
--- /dev/null
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# 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
+import math
+import Config
+
+from salome.geom import geomBuilder
+geompy = geomBuilder.New( Config.theStudy )
+
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New( Config.theStudy )
+
+##########################################################################################################
+
+def PublishGroups ():
+ aFilterManager = smesh.CreateFilterManager()
+
+ # Building geometric and mesh compounds and groups ##############################################
+ if Config.debug : print "Searching for geometric groups and publishing final compound"
+
+ TempGEOList = []
+ TempMESHList = []
+
+ for MacroObj in Config.ListObj :
+ TempGEOList += MacroObj.GeoChildren
+ TempMESHList += MacroObj.Mesh
+
+ FinalCompound = geompy.MakeCompound(TempGEOList)
+ geompy.addToStudy (FinalCompound,Config.StudyName)
+ MeshCompound = smesh.Concatenate(TempMESHList, 1, 1, 1e-5)
+ MeshCompound.SetName(Config.StudyName)
+
+ GroupGEO = []
+ for group in Config.Groups :
+
+ # Geometric groups definition
+ TempGEOList = []
+ TempNames = []
+ for MacroObj in Config.ListObj :
+ if group in MacroObj.GroupNames :
+ Occurences = IndexMultiOcc(MacroObj.GroupNames, group)
+ for Occ in Occurences :
+ TempGEOList += MacroObj.GetBorder(Occ)
+ GroupGEO.append(geompy.MakeCompound(TempGEOList))
+ geompy.addToStudyInFather(FinalCompound,GroupGEO[-1],'GR_'+group)
+
+ # Mesh groups definition
+ Criterion = smesh.GetCriterion(SMESH.EDGE, SMESH.FT_BelongToGeom,'=',GroupGEO[-1],Tolerance=1e-06)
+ #Criterion = smesh.Filter.Criterion(18,39,0,'GR_'+group,'GR_'+group,39,39,1e-06,smesh.EDGE,7)
+ MeshCompound.MakeGroupByCriterion(group,Criterion)
+
+ StudyBuilder = Config.theStudy.NewBuilder()
+ for MeshObj in TempMESHList:
+ SO = Config.theStudy.FindObjectIOR(Config.theStudy.ConvertObjectToIOR(MeshObj))
+ if SO is not None: StudyBuilder.RemoveObjectWithChildren(SO)
+
+ return MeshCompound
+
+
+def IndexMultiOcc (Array,Element) :
+ """
+ This function returns the occurrences indices of Element in Array.
+ As opposed to Array.index(Element) method, this allows determining
+ multiple entries rather than just the first one!
+ """
+ Output = []
+ try : Array.index(Element)
+ except ValueError : print "No more occurrences"
+ else : Output.append(Array.index(Element))
+
+ if not(Output == [-1]) and len(Array) > 1 :
+ for index, ArrElem in enumerate(Array[Output[0]+1:]) :
+ if ArrElem is Element : Output.append(index+Output[0]+1)
+
+ return Output
+
+def Publish (ObjToPublish):
+ for i,GeoObj in enumerate(ObjToPublish) : geompy.addToStudy(GeoObj,"Sub_"+str(i))
+
+def RevolveMesh(MainMesh,**args):
+ """
+ This function premits to revolute and scale a 2D mesh while transforming the edge
+ groups into face groups. Moreover, the function automatically creates the face groups
+ corresponding to the symmetry lower and upper faces
+ Facultatif arguments are :
+ - Center [X,Y,Z], origin being the default
+ - Direction [VX,VY,VZ], x-axis being the default
+ - AngleDeg or AngleRad : ALPHA, 10 degrees being the default
+ - Scale : BETA, no scaling being default
+ """
+ ################################################################################
+ # Reading input arguments and proceeding to defaults if necessary
+ ################################################################################
+ if 'Center' in args : CenterCoor = [float(Coor) for Coor in args['Center']]
+ else :
+ print "\nThe coordinates of the center of revolution were not given\nThe origin is used by default."
+ CenterCoor = [0.,0.,0.]
+
+ if 'Direction' in args : Direction = [float(Dir) for Dir in args['Direction']]
+ else :
+ print "\nThe axis vector of revolution was not given\nThe x-axis is used by default."
+ Direction = [1.,0.,0.]
+
+ if 'AngleDeg' in args : Angle = float(args['AngleDeg'])*math.pi/180.
+ elif 'AngleRad' in args : Angle = float(args['AngleRad'])
+ else :
+ print "\nThe revolution angle was not given\nAn angle of 10 degrees is used by default."
+ Angle = 10.*math.pi/180.
+
+ if 'Scale' in args : Scale = float(args['Scale'])
+ else : Scale = 1.
+
+
+ # Creating the lower face group LOFAC
+ LOFAC = MainMesh.CreateEmptyGroup( SMESH.FACE, 'LOFAC' )
+ LOFAC.AddFrom(MainMesh.GetMesh())
+
+ GR_Names = MainMesh.GetGroupNames()
+ GRs = MainMesh.GetGroups()
+ Rev3DMeshGroups = MainMesh.RotationSweepObject2D( MainMesh, SMESH.AxisStruct( CenterCoor[0], CenterCoor[1], CenterCoor[2], Direction[0], Direction[1], Direction[2] ), Angle, 1, 1e-05 ,True)
+
+ # Adding an EDGE suffix to the edge groups (to be deleted eventually by the user...)
+ for GR in GRs:
+ CurrentName = GR.GetName()
+ if CurrentName in GR_Names and not(CurrentName=='LOFAC'): # Meaning that this is an old edge group
+ GR.SetName(CurrentName+'_EDGE')
+
+ # Removing the _rotated prefix from the rotated FACE groups
+ for GR in Rev3DMeshGroups:
+ CurrentName = GR.GetName()
+ if CurrentName.endswith( "_rotated"):
+ if CurrentName.startswith( 'LOFAC_' ):
+ GR.SetName('VOL')
+ else:
+ GR.SetName(CurrentName[:-8])
+ elif CurrentName == 'LOFAC_top':
+ GR.SetName('HIFAC')
+ #Index = [ GR_Names[i] in CurrentName for i in range(0,len(GR_Names)) ].index(True)
+ #GR.SetName(GR_Names[Index])
+
+ # Creating the upper face group HIFAC
+ ALLFAC = MainMesh.CreateEmptyGroup( SMESH.FACE, 'ALLFAC' )
+ ALLFAC.AddFrom(MainMesh.GetMesh())
+
+ #HIFAC = MainMesh.GetMesh().CutListOfGroups( [ ALLFAC ], [LOFAC] + [ MeshGroup for MeshGroup in Rev3DMeshGroups if not(MeshGroup.GetName()=='VOL') ], 'HIFAC' )
+ #HIFAC = MainMesh.GetMesh().CutListOfGroups( [ ALLFAC ], [LOFAC] + [ MeshGroup for MeshGroup in Rev3DMeshGroups if ( not(MeshGroup.GetName()=='VOL') and MeshGroup.GetType() == SMESH.FACE )], 'HIFAC' )
+
+ # Scaling down the mesh to meter units
+ if not(Scale==1.):
+ MeshEditor = MainMesh.GetMeshEditor()
+ MeshEditor.Scale( MainMesh.GetMesh(), SMESH.PointStruct( 0, 0, 0 ) ,[ Scale, Scale, Scale ], 0 )
+
+
+def ExtrudeMesh(MainMesh,**args):
+ """
+ This function premits to extrude and scale a 2D mesh while transforming the edge
+ groups into face groups. Moreover, the function automatically creates the face groups
+ corresponding to the symmetry lower and upper faces
+ Facultatif arguments are :
+ - Direction [VX,VY,VZ], z-axis being default
+ - Distance : D, default is 1
+ - NSteps : the object will be extruded by NSteps*Distance, default is Nsteps = 1
+ - Scale : BETA, no scaling being default
+ """
+ ################################################################################
+ # Reading input arguments and proceeding to defaults if necessary
+ ################################################################################
+ if 'Distance' in args : Distance = float(args['Distance'])
+ else :
+ print "\nThe extrusion distance was not given\nA default value of 1 is used."
+ Distance = 1.
+
+ if 'Direction' in args : Direction = NormalizeVector([float(Dir) for Dir in args['Direction']],Distance)
+ else :
+ print "\nThe extrusion vector of revolution was not given\nThe z-axis is used by default."
+ Direction = NormalizeVector([0.,0.,1.],Distance)
+
+ if 'Scale' in args : Scale = float(args['Scale'])
+ else : Scale = 1.
+
+ if 'NSteps' in args : NSteps = int(args['NSteps'])
+ else : NSteps = 1
+
+ # Creating the lower face group LOFAC
+ LOFAC = MainMesh.CreateEmptyGroup( SMESH.FACE, 'LOFAC' )
+ LOFAC.AddFrom(MainMesh.GetMesh())
+
+ GR_Names = MainMesh.GetGroupNames()
+ GRs = MainMesh.GetGroups()
+ Ext3DMeshGroups = MainMesh.ExtrusionSweepObject2D(MainMesh,SMESH.DirStruct(SMESH.PointStruct(Direction[0],Direction[1],Direction[2])), NSteps, True)
+
+ # Adding an EDGE suffix to the edge groups (to be deleted eventually by the user...)
+ for GR in GRs:
+ CurrentName = GR.GetName()
+ if CurrentName in GR_Names and not(CurrentName=='LOFAC'): # Meaning that this is an old edge group
+ GR.SetName(CurrentName+'_EDGE')
+
+ # Removing the _extruded suffix from the extruded FACE groups
+ for GR in Ext3DMeshGroups:
+ CurrentName = GR.GetName()
+ if CurrentName.endswith( "_extruded"):
+ if CurrentName.startswith( 'LOFAC_' ):
+ GR.SetName('VOL')
+ else:
+ GR.SetName(CurrentName[:-9])
+ elif CurrentName == 'LOFAC_top':
+ GR.SetName('HIFAC')
+
+ # Creating the upper face group HIFAC
+ ALLFAC = MainMesh.CreateEmptyGroup( SMESH.FACE, 'ALLFAC' )
+ ALLFAC.AddFrom(MainMesh.GetMesh())
+
+ #HIFAC = MainMesh.GetMesh().CutListOfGroups( [ ALLFAC ], [LOFAC] + [ MeshGroup for MeshGroup in Ext3DMeshGroups if not(MeshGroup.GetName()=='VOL') ], 'HIFAC' )
+
+ # Scaling down the mesh to meter units
+ if not(Scale==1.):
+ MeshEditor = MainMesh.GetMeshEditor()
+ MeshEditor.Scale( MainMesh.GetMesh(), SMESH.PointStruct( 0, 0, 0 ) ,[ Scale, Scale, Scale ], 0 )
+
+
+def NormalizeVector (V,Norm):
+ """
+ This function returns a normalized vector (magnitude = Norm), parallel to the entered one
+ """
+ V = [float(Coor) for Coor in V]
+ Norm = float(Norm)
+ MagV = math.sqrt(V[0]*V[0]+V[1]*V[1]+V[2]*V[2])
+ return [Coor*Norm/MagV for Coor in V]
+
--- /dev/null
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# 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 an automation of the sharp angle object, with a corner at (X0,Y0), side length : Extension and a fine local meshing : LocalMeshing
+# The corner orientation is defined as NE (North-East) , NW (North-West), SE, or SW. The object's "arm" is 8/14 of Extension
+# | | 8 6
+# ------- ---------
+# ----> | | <----
+# | NW NE | oo
+# _____| |_____
+
+import sys, math, commands
+CWD = commands.getoutput('pwd')
+sys.path.append(CWD)
+
+from MacObject import *
+from CompositeBox import *
+import Config, GenFunctions
+
+def SharpAngleOut (X0 , Y0 , DX , DY , DLocal, LocalMeshing , CornerOrientation , NLevels, **args) :
+ if DLocal == 'auto' : DLocal = float(min(DX,DY))
+
+ BoxSide = DLocal/(2.**(NLevels+1))
+ InternalMeshing = int(math.ceil(BoxSide/(3*LocalMeshing)))
+ InternalMeshing = InternalMeshing+InternalMeshing%2 # An even number is needed, otherwise the objects would not be compatible once created
+ if InternalMeshing == 0 : InternalMeshing = 2 # This sets a minimum meshing condition in order to avoid an error. The user is notified of the value considered for the local meshing
+ print "Possible Local meshing is :", BoxSide/(3*InternalMeshing), "\nThis value is returned by this function for your convenience"
+
+ DirPar = {'NE' : lambda : ['NE', 'NW', 'SE', 'EW', 'NW', 'SN', 'SN', 'NE', 'WE', 'WE', 'SE', 'NS'],
+ 'NW' : lambda : ['NW', 'NE', 'SW', 'WE', 'NE', 'SN', 'SN', 'NW', 'EW', 'EW', 'SW', 'NS'],
+ 'SE' : lambda : ['SE', 'SW', 'NE', 'EW', 'SW', 'NS', 'NS', 'SE', 'WE', 'WE', 'NE', 'SN'],
+ 'SW' : lambda : ['SW', 'SE', 'NW', 'WE', 'SE', 'NS', 'NS', 'SW', 'EW', 'EW', 'NW', 'SN'], }[CornerOrientation]()
+
+ CoefVer = {'NE' : lambda : 1,
+ 'NW' : lambda : 1,
+ 'SE' : lambda : -1,
+ 'SW' : lambda : -1, }[CornerOrientation]()
+
+ CoefHor = {'NE' : lambda : 1,
+ 'NW' : lambda : -1,
+ 'SE' : lambda : 1,
+ 'SW' : lambda : -1, }[CornerOrientation]()
+
+ ToLook = {'NE' : lambda : [0,2,1,3],
+ 'NW' : lambda : [0,3,1,2],
+ 'SE' : lambda : [1,2,0,3],
+ 'SW' : lambda : [1,3,0,2], }[CornerOrientation]()
+
+ if args.__contains__('groups') :
+ GroupNames = args['groups']
+ else : GroupNames = [None, None, None, None, None, None]
+
+ GN00 = GroupArray(ToLook[0],GroupNames[0])
+ GN01 = GroupArray(ToLook[1],GroupNames[1])
+
+ GN1 = GroupArray([ToLook[0],ToLook[1]],[GroupNames[0],GroupNames[5]])
+ GN7 = GroupArray([ToLook[0],ToLook[1]],[GroupNames[4],GroupNames[1]])
+
+ if DY == DLocal :
+ GN2 = GroupArray([ToLook[1],ToLook[2]],[GroupNames[5],GroupNames[2]])
+ GN3 = GroupArray(ToLook[2],GroupNames[2])
+ if DX == DLocal:
+ GN4 = GroupArray([ToLook[2],ToLook[3]],[GroupNames[2],GroupNames[3]])
+ GN5 = GroupArray(ToLook[3],GroupNames[3])
+ GN6 = GroupArray([ToLook[3],ToLook[0]],[GroupNames[3],GroupNames[4]])
+ else :
+ GN4 = GroupArray(ToLook[2],GroupNames[2])
+ GN5 = [None,None,None,None]
+ GN6 = GroupArray(ToLook[0],GroupNames[4])
+ GN21 = GroupArray([ToLook[3],ToLook[0],ToLook[2]],[GroupNames[3],GroupNames[4],GroupNames[2]])
+ else :
+ GN2 = GroupArray(ToLook[1],GroupNames[5])
+ GN3 = [None,None,None,None]
+ if DX == DLocal:
+ GN4 = GroupArray(ToLook[3],GroupNames[3])
+ GN5 = GroupArray(ToLook[3],GroupNames[3])
+ GN6 = GroupArray([ToLook[3],ToLook[0]],[GroupNames[3],GroupNames[4]])
+ GN22 = GroupArray([ToLook[1],ToLook[2],ToLook[3]],[GroupNames[5],GroupNames[2],GroupNames[3]])
+ else :
+ GN4 = [None,None,None,None]
+ GN5 = [None,None,None,None]
+ GN6 = GroupArray(ToLook[0],GroupNames[4])
+ GN21 = GroupArray([ToLook[3],ToLook[0]],[GroupNames[3],GroupNames[4]])
+ GN22 = GroupArray([ToLook[1],ToLook[2]],[GroupNames[5],GroupNames[2]])
+ GN23 = GroupArray([ToLook[2],ToLook[3]],[GroupNames[2],GroupNames[3]])
+
+ Obj = []
+
+ Obj.append(MacObject('BoxAng32',[(X0+CoefHor*BoxSide/2,Y0+CoefVer*BoxSide/2),(BoxSide,BoxSide)],[InternalMeshing,DirPar[0]]))
+ Obj.append(MacObject('BoxAng32',[(X0-CoefHor*BoxSide/2,Y0+CoefVer*BoxSide/2),(BoxSide,BoxSide)],['auto',DirPar[1]], groups = GroupArray(ToLook[0],GroupNames[0])))
+ Obj.append(MacObject('BoxAng32',[(X0+CoefHor*BoxSide/2,Y0-CoefVer*BoxSide/2),(BoxSide,BoxSide)],['auto',DirPar[2]], groups = GroupArray(ToLook[1],GroupNames[1])))
+
+ for N in range (1,NLevels+1):
+ n = N-1
+ if N < NLevels :
+ Obj.append(MacObject('Box42',[(X0-CoefHor*BoxSide*(2**n)*3/2,Y0+CoefVer*(2**n)*BoxSide/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[3]] , groups = GN00))
+ Obj.append(MacObject('BoxAng32',[(X0-CoefHor*(2**n)*BoxSide*3/2,Y0+CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[4]] ))
+ Obj.append(MacObject('Box42',[(X0-CoefHor*(2**n)*BoxSide/2,Y0+CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[5]] ))
+ Obj.append(MacObject('Box42',[(X0+CoefHor*(2**n)*BoxSide/2,Y0+CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[6]] ))
+ Obj.append(MacObject('BoxAng32',[(X0+CoefHor*(2**n)*BoxSide*3/2,Y0+CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[7]] ))
+ Obj.append(MacObject('Box42',[(X0+CoefHor*(2**n)*BoxSide*3/2,Y0+CoefVer*(2**n)*BoxSide/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[8]] ))
+ Obj.append(MacObject('Box42',[(X0+CoefHor*(2**n)*BoxSide*3/2,Y0-CoefVer*(2**n)*BoxSide/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[9]] ))
+ Obj.append(MacObject('BoxAng32',[(X0+CoefHor*(2**n)*BoxSide*3/2,Y0-CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[10]] ))
+ Obj.append(MacObject('Box42',[(X0+CoefHor*(2**n)*BoxSide/2,Y0-CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[11]] , groups = GN01))
+ else :
+ Obj.append(MacObject('Box42',[(X0-CoefHor*BoxSide*(2**n)*3/2,Y0+CoefVer*(2**n)*BoxSide/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[3]] , groups = GN1))
+ Obj.append(MacObject('BoxAng32',[(X0-CoefHor*(2**n)*BoxSide*3/2,Y0+CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[4]] , groups = GN2))
+ Obj.append(MacObject('Box42',[(X0-CoefHor*(2**n)*BoxSide/2,Y0+CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[5]] , groups = GN3))
+ Obj.append(MacObject('Box42',[(X0+CoefHor*(2**n)*BoxSide/2,Y0+CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[6]] , groups = GN3))
+ Obj.append(MacObject('BoxAng32',[(X0+CoefHor*(2**n)*BoxSide*3/2,Y0+CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[7]] , groups = GN4))
+ Obj.append(MacObject('Box42',[(X0+CoefHor*(2**n)*BoxSide*3/2,Y0+CoefVer*(2**n)*BoxSide/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[8]] , groups = GN5))
+ Obj.append(MacObject('Box42',[(X0+CoefHor*(2**n)*BoxSide*3/2,Y0-CoefVer*(2**n)*BoxSide/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[9]] , groups = GN5))
+ Obj.append(MacObject('BoxAng32',[(X0+CoefHor*(2**n)*BoxSide*3/2,Y0-CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[10]], groups = GN6))
+ Obj.append(MacObject('Box42',[(X0+CoefHor*(2**n)*BoxSide/2,Y0-CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[11]] , groups = GN7))
+
+ OuterMeshing = (3/2)*InternalMeshing*2**(NLevels-1)
+ OuterSegLength = (DLocal/OuterMeshing)
+
+ if DX > DLocal :
+ dX = DX - DLocal
+ Obj.append(MacObject('CompBoxF',[(X0+CoefHor*(DX)/2.,Y0),(dX,DLocal)],['auto'], groups = GN21))
+ if DY > DLocal :
+ dY = DY - DLocal
+ if DX > DLocal :
+ Obj.append(MacObject('CompBoxF',[(X0+CoefHor*DX/2.,Y0+CoefVer*(DY)/2.),(DX-DLocal,dY)],['auto'], groups = GN23))
+
+ Obj.append(MacObject('CompBoxF',[(X0,Y0+CoefVer*(DY)/2.),(DLocal,dY)],['auto'], groups = GN22))
+
+ return Obj
+
+def SharpAngleIn (X0 , Y0 , DX , DY , DLocal, LocalMeshing , CornerOrientation , NLevels, **args) :
+ if DLocal == 'auto' : DLocal = float(min(DX,DY))
+
+ BoxSide = DLocal/(2.**(NLevels))
+ InternalMeshing = int(math.ceil(BoxSide/(3*LocalMeshing)))
+ InternalMeshing = InternalMeshing+InternalMeshing%2 # An even number is needed, otherwise the objects would not be compatible once created
+ if InternalMeshing == 0 : InternalMeshing = 2 # This sets a minimum meshing condition in order to avoid an error. The user is notified of the value considered for the local meshing
+ print "Possible Local meshing is :", BoxSide/(3*InternalMeshing), "\nThis value is returned by this function for your convenience..."
+
+ DirPar = {'NE' : lambda : ['NE', 'SN', 'NE', 'WE'],
+ 'NW' : lambda : ['NW', 'SN', 'NW', 'EW'],
+ 'SE' : lambda : ['SE', 'NS', 'SE', 'WE'],
+ 'SW' : lambda : ['SW', 'NS', 'SW', 'EW'], }[CornerOrientation]()
+
+ CoefVer = {'NE' : lambda : 1,
+ 'NW' : lambda : 1,
+ 'SE' : lambda : -1,
+ 'SW' : lambda : -1, }[CornerOrientation]()
+
+ CoefHor = {'NE' : lambda : 1,
+ 'NW' : lambda : -1,
+ 'SE' : lambda : 1,
+ 'SW' : lambda : -1, }[CornerOrientation]()
+
+ ToLook = {'NE' : lambda : [0,2,1,3],
+ 'NW' : lambda : [0,3,1,2],
+ 'SE' : lambda : [1,2,0,3],
+ 'SW' : lambda : [1,3,0,2], }[CornerOrientation]()
+
+ if args.__contains__('groups') :
+ GroupNames = args['groups']
+ else : GroupNames = [None, None, None, None]
+
+ GN01 = GroupArray([ToLook[0],ToLook[1]],[GroupNames[ToLook[0]],GroupNames[ToLook[1]]])
+ GN02 = GroupArray(ToLook[1],GroupNames[ToLook[1]])
+ GN03 = [None, None, None, None]
+ GN04 = GroupArray(ToLook[0],GroupNames[ToLook[0]])
+
+ if DY == DLocal :
+ GN05 = GroupArray([ToLook[1],ToLook[2]],[GroupNames[ToLook[1]],GroupNames[ToLook[2]]])
+ GN08 = GroupArray([ToLook[0],ToLook[2],ToLook[3]],[GroupNames[ToLook[0]],GroupNames[ToLook[2]],GroupNames[ToLook[3]]])
+ if DX == DLocal:
+ GN06 = GroupArray([ToLook[2],ToLook[3]],[GroupNames[ToLook[2]],GroupNames[ToLook[3]]])
+ GN07 = GroupArray([ToLook[0],ToLook[3]],[GroupNames[ToLook[0]],GroupNames[ToLook[3]]])
+ else :
+ GN06 = GroupArray(ToLook[2],GroupNames[ToLook[2]])
+ GN07 = GroupArray(ToLook[0],GroupNames[ToLook[0]])
+ else :
+ GN05 = GroupArray(ToLook[1],GroupNames[ToLook[1]])
+ if DX == DLocal :
+ GN06 = GroupArray(ToLook[3],GroupNames[ToLook[3]])
+ GN07 = GroupArray([ToLook[0],ToLook[3]],[GroupNames[ToLook[0]],GroupNames[ToLook[3]]])
+ GN10 = GroupArray([ToLook[1],ToLook[2],ToLook[3]],[GroupNames[ToLook[1]],GroupNames[ToLook[2]],GroupNames[ToLook[3]]])
+ else :
+ GN06 = [None, None, None, None]
+ GN07 = GroupArray(ToLook[0],GroupNames[ToLook[0]])
+ GN08 = GroupArray([ToLook[0],ToLook[3]],[GroupNames[ToLook[0]],GroupNames[ToLook[3]]])
+ GN09 = GroupArray([ToLook[2],ToLook[3]],[GroupNames[ToLook[2]],GroupNames[ToLook[3]]])
+ GN10 = GroupArray([ToLook[1],ToLook[2]],[GroupNames[ToLook[1]],GroupNames[ToLook[2]]])
+
+ Obj = []
+
+ Obj.append(MacObject('BoxAng32',[(X0+CoefHor*BoxSide/2,Y0+CoefVer*BoxSide/2),(BoxSide,BoxSide)],[InternalMeshing,DirPar[0]],groups = GN01))
+
+ for N in range (1,NLevels+1):
+ n = N-1
+ if N < NLevels :
+ Obj.append(MacObject('Box42',[(X0+CoefHor*(2**n)*BoxSide/2,Y0+CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[1]],groups = GN02))
+ Obj.append(MacObject('BoxAng32',[(X0+CoefHor*(2**n)*BoxSide*3/2,Y0+CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[2]],groups = GN03))
+ Obj.append(MacObject('Box42',[(X0+CoefHor*(2**n)*BoxSide*3/2,Y0+CoefVer*(2**n)*BoxSide/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[3]],groups = GN04))
+ else :
+ Obj.append(MacObject('Box42',[(X0+CoefHor*(2**n)*BoxSide/2,Y0+CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[1]],groups = GN05))
+ Obj.append(MacObject('BoxAng32',[(X0+CoefHor*(2**n)*BoxSide*3/2,Y0+CoefVer*(2**n)*BoxSide*3/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[2]],groups = GN06))
+ Obj.append(MacObject('Box42',[(X0+CoefHor*(2**n)*BoxSide*3/2,Y0+CoefVer*(2**n)*BoxSide/2),((2**n)*BoxSide,(2**n)*BoxSide)],['auto',DirPar[3]],groups = GN07))
+
+ OuterMeshing = (3/2)*InternalMeshing*2**(NLevels-1)
+ OuterSegLength = (DLocal/OuterMeshing)
+
+ if DX > DLocal :
+ dX = DX - DLocal
+ Obj = Obj + CompositeBox(X0+CoefHor*(DLocal+dX/2.),Y0+CoefVer*(DLocal)/2.,dX,DLocal, groups = GN08)
+ if DY > DLocal :
+ dY = DY - DLocal
+
+ if DX > DLocal :
+ Obj = Obj + CompositeBox(X0+CoefHor*(DLocal+(DX-DLocal)/2.),Y0+CoefVer*(DLocal+dY/2.),DX-DLocal,dY, groups = GN09)
+
+ Obj = Obj + CompositeBox(X0+CoefHor*DLocal/2,Y0+CoefVer*(DLocal+dY/2.),DLocal,dY,groups = GN10)
+
+ return Obj
+
+def GroupArray(indices, GroupNames) :
+ if type(indices) is int :
+ indices = [indices]
+ GroupNames = [GroupNames]
+ Output = [None,None,None,None]
+ for i, ind in enumerate(indices) :
+ Output[ind] = GroupNames[i]
+ return Output
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2006-2013 EDF R&D
+// Copyright (C) 2006-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2006-2013 EDF R&D
+# Copyright (C) 2006-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013 EDF R&D
+# Copyright (C) 2007-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013 EDF R&D
+# Copyright (C) 2007-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# General substitutions.
project = 'Verima Plug-in'
-copyright = '2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE'
+copyright = '2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
# General substitutions.
project = 'Verima Plug-in'
-copyright = '2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE'
+copyright = '2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
-# Copyright (C) 2011 EDF R&D
+# Copyright (C) 2011-2014 EDF R&D
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or
-# email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
srcdir="."
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013 EDF R&D
+# Copyright (C) 2007-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
###
-### Copyright EDF R&D 2012
+### Copyright EDF R&D 2012-2014
###
### Gérald NICOLAS
### (33/0)1.47.65.56.94
# -*- coding: iso-8859-1 -*-
"""
Maillage du tunnel
-Copyright EDF R&D 2012, 2013
+Copyright EDF R&D 2012-2014
Gérald NICOLAS
(+33/0)1.47.65.56.94
# -*- coding: iso-8859-1 -*-
###
-### Copyright EDF R&D 2012
+### Copyright EDF R&D 2012-2014
###
### Gérald NICOLAS
### (33/0)1.47.65.56.94
# -*- coding: iso-8859-1 -*-
"""
Maillage du tunnel
-Copyright EDF R&D 2012, 2013
+Copyright EDF R&D 2012-2014
Gérald NICOLAS
(+33/0)1.47.65.56.94
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013 EDF R&D
+# Copyright (C) 2007-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013 EDF R&D
+# Copyright (C) 2007-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# General substitutions.
project = 'MeshGems-SurfOpt Plug-in'
-copyright = '2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE'
+copyright = '2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013 EDF R&D
+# Copyright (C) 2007-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013 EDF R&D
+# Copyright (C) 2007-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2013 EDF R&D
+# Copyright (C) 2006-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
--- /dev/null
+# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+
+
+# --- scripts ---
+
+# scripts / static
+SET(plugin_SCRIPTS
+ zcracks_plugin.py
+)
+
+
+# --- rules ---
+
+SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS})
+
--- /dev/null
+# -*- coding: utf-8 -*-
+# Copyright (C) 2006-2013 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# 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 SalomePyQt
+sgPyQt = SalomePyQt.SalomePyQt()
+import eficasSalome
+
+class EficasForZcracks(eficasSalome.MyEficas):
+ """
+ """
+ def __init__(self, fichier = None, version = None):
+ eficasSalome.MyEficas.__init__(self, sgPyQt.getDesktop(),
+ "ZCRACKS",
+ fichier, version = version)
+ #sgPyQt.createView(custom_appli.widgetname, self)
+
+
+def ZcracksLct(context):
+
+ window=EficasForZcracks()
+ window.show()
--- /dev/null
+# Copyright (C) 2012-2014 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+ADD_SUBDIRECTORY(CasTests)
+ADD_SUBDIRECTORY(gmu)
+ADD_SUBDIRECTORY(materielCasTests)
+
+IF(SALOME_BUILD_GUI)
+ ADD_SUBDIRECTORY(ihm)
+ENDIF(SALOME_BUILD_GUI)
+
+# --- scripts ---
+
+# scripts / static
+SET(plugin_SCRIPTS
+ __init__.py
+ casStandard.py
+ exemple.py
+ exemple2.py
+)
+
+# --- rules ---
+
+SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure)
--- /dev/null
+# Copyright (C) 2012-2014 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# --- scripts ---
+
+# scripts / static
+SET(plugin_SCRIPTS
+ __init__.py
+ cubeAngle2.py
+ cubeAngle.py
+ cylindre_2.py
+ cylindre.py
+ disquePerce.py
+ ellipse_1.py
+ ellipse_2.py
+ eprouvetteCourbe.py
+ eprouvetteDroite_2.py
+ eprouvetteDroite.py
+ execution_Cas.py
+ faceGauche_2.py
+ faceGauche.py
+ fissureCoude_10.py
+ fissureCoude_1.py
+ fissureCoude_2.py
+ fissureCoude_3.py
+ fissure_Coude_4.py
+ fissureCoude_4.py
+ fissureCoude_5.py
+ fissureCoude_6.py
+ fissureCoude_7.py
+ fissureCoude_8.py
+ fissureCoude_9.py
+ fissure_Coude.py
+ vis_1.py
+)
+
+# --- rules ---
+
+SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/CasTests)
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy, smesh
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from blocFissure.gmu.fissureGenerique import fissureGenerique
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+
+O, OX, OY, OZ = triedreBase()
+
+class cubeAngle(fissureGenerique):
+ """
+ problème de fissure plane coupant 2 faces (angle), débouches normaux, objet plan
+ """
+
+ nomProbleme = "cubeAngle"
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageSain(self, geometriesSaines, meshParams):
+ logging.info("genereMaillageSain %s", self.nomCas)
+
+ ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, 'materielCasTests/CubeAngle.med'))
+ smesh.SetName(objetSain.GetMesh(), 'objetSain')
+
+ return [objetSain, True] # True : maillage hexa
+
+ # ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour méthode insereFissureGenerale
+ lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
+ rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
+ """
+ logging.info("setParamShapeFissure %s", self.nomCas)
+ self.shapeFissureParams = dict(lgInfluence = 20,
+ rayonPipe = 10)
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+
+ lgInfluence = shapeFissureParams['lgInfluence']
+
+ shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep"), "BREP")
+ fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(fondFiss, [4])
+ geompy.addToStudy( shellFiss, 'shellFiss' )
+ geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
+
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10)
+
+ centre = None
+ return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 8,
+ areteFaceFissure = 10)
+
+ # ---------------------------------------------------------------------------
+ def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
+ elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
+ return elementsDefaut
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageFissure(self, geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step):
+ maillageFissure = insereFissureGenerale(maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step)
+ return maillageFissure
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 204,
+ Entity_Quad_Triangle = 336,
+ Entity_Quad_Edge = 278,
+ Entity_Quad_Penta = 96,
+ Entity_Quad_Hexa = 3651,
+ Entity_Node = 20490,
+ Entity_Quad_Tetra = 1877,
+ Entity_Quad_Quadrangle = 1702)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from cubeAngle import cubeAngle
+
+class cubeAngle2(cubeAngle):
+ """
+ problème de fissure plane coupant 2 faces (angle), débouches normaux, objet plan
+ detection d'un probleme de tolerance sur les edges de jonction pipe et face fissure externe
+ """
+
+ nomProbleme = "cubeAngle2"
+
+ # ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour méthode insereFissureGenerale
+ lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
+ rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
+ """
+ self.shapeFissureParams = dict(lgInfluence = 20,
+ rayonPipe = 5)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 32,
+ areteFaceFissure = 5)
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 748,
+ Entity_Quad_Triangle = 1228,
+ Entity_Quad_Edge = 351,
+ Entity_Quad_Penta = 640,
+ Entity_Quad_Hexa = 5827,
+ Entity_Node = 42865,
+ Entity_Quad_Tetra = 9216,
+ Entity_Quad_Quadrangle = 2518)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy, smesh
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from blocFissure.gmu.fissureGenerique import fissureGenerique
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+
+O, OX, OY, OZ = triedreBase()
+
+class cylindre(fissureGenerique):
+ """
+ problème de fissure plane sur cylindre, grand fond de fissure en arc de cercle
+ """
+
+ nomProbleme = "cylindre"
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageSain(self, geometriesSaines, meshParams):
+ """
+ génère le maillage de l'objet sain, par chargement d'un fichier med
+ ici, les paramètres de géométrie et de maillage ne sont pas utiles
+ """
+ logging.info("genereMaillageSain %s", self.nomCas)
+
+ ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests/CylindreSain.med"))
+ smesh.SetName(objetSain.GetMesh(), 'objetSain')
+
+ return [objetSain, True] # True : maillage hexa
+
+ # ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour méthode insereFissureGenerale
+ lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
+ rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
+ """
+ logging.info("setParamShapeFissure %s", self.nomCas)
+ self.shapeFissureParams = dict(lgInfluence = 20,
+ rayonPipe = 5)
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+
+ lgInfluence = shapeFissureParams['lgInfluence']
+
+ shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/FissInCylindre2.brep"), "BREP")
+ fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(fondFiss, [7])
+ geompy.addToStudy( shellFiss, 'shellFiss' )
+ geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
+
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,15)
+
+ centre = None
+ return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 8,
+ areteFaceFissure = 20)
+
+ # ---------------------------------------------------------------------------
+ def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
+ elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
+ return elementsDefaut
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageFissure(self, geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step):
+ maillageFissure = insereFissureGenerale(maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step)
+ return maillageFissure
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 1270,
+ Entity_Quad_Triangle = 1260,
+ Entity_Quad_Edge = 758,
+ Entity_Quad_Penta = 496,
+ Entity_Quad_Hexa = 18814,
+ Entity_Node = 113313,
+ Entity_Quad_Tetra = 20469,
+ Entity_Quad_Quadrangle = 7280)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy, smesh
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+import logging
+
+from cylindre import cylindre
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+
+O, OX, OY, OZ = triedreBase()
+
+class cylindre_2(cylindre):
+ """
+ problème de fissure plane sur cylindre hexa, fond de fissure complexe : polyline
+ """
+ nomProbleme = "cylindre2"
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+
+ lgInfluence = shapeFissureParams['lgInfluence']
+
+ shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/FissInCylindre.brep"), "BREP")
+ fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(fondFiss, [3])
+ geompy.addToStudy( shellFiss, 'shellFiss' )
+ geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
+
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,15)
+
+ centre = None
+ return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 1334,
+ Entity_Quad_Triangle = 1432,
+ Entity_Quad_Edge = 785,
+ Entity_Quad_Penta = 560,
+ Entity_Quad_Hexa = 19070,
+ Entity_Node = 114290,
+ Entity_Quad_Tetra = 19978,
+ Entity_Quad_Quadrangle = 7424)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+
+dicoParams = dict(nomCas = 'disque',
+ maillageSain = os.path.join(gmu.pathBloc, 'materielCasTests/disque.med'),
+ brepFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests/ellipse_disque.brep"),
+ edgeFissIds = [4],
+ lgInfluence = 10,
+ meshBrep = (0.5,2.5),
+ rayonPipe = 1.0,
+ lenSegPipe = 1.5,
+ nbSegRad = 6,
+ nbSegCercle = 16,
+ areteFaceFissure = 2.5)
+
+ # ---------------------------------------------------------------------------
+
+referencesMaillageFissure = dict(Entity_Quad_Pyramid = 610,
+ Entity_Quad_Triangle = 1284,
+ Entity_Quad_Edge = 393,
+ Entity_Quad_Penta = 592,
+ Entity_Quad_Hexa = 6952,
+ Entity_Node = 51119,
+ Entity_Quad_Tetra = 11672,
+ Entity_Quad_Quadrangle = 3000)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy, smesh
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from blocFissure.gmu.fissureGenerique import fissureGenerique
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+
+O, OX, OY, OZ = triedreBase()
+
+class ellipse_1(fissureGenerique):
+ """
+ problème de fissure non plane, débouchante non normale
+ """
+
+ nomProbleme = "ellipse1"
+
+# # ---------------------------------------------------------------------------
+# def genereGeometrieSaine(self, geomParams):
+# logging.info("genereGeometrieSaine %s", self.nomCas)
+# box = geompy.MakeBox(0, -500, 0, 400, 500, 800, "boiteSaine")
+# return [box]
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageSain(self, geometriesSaines, meshParams):
+ logging.info("genereMaillageSain %s", self.nomCas)
+
+ ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests/boiteSaine.med"))
+ smesh.SetName(objetSain.GetMesh(), 'objetSain')
+
+ return [objetSain, True] # True : maillage hexa
+
+ # ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour méthode insereFissureGenerale
+ lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
+ rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
+ convexe : optionnel, True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
+ pointIn_x : optionnel, coordonnée x d'un point dans le solide sain (pour orienter la face)
+ """
+ logging.info("setParamShapeFissure %s", self.nomCas)
+ self.shapeFissureParams = dict(lgInfluence = 50,
+ rayonPipe = 20)
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+
+ lgInfluence = shapeFissureParams['lgInfluence']
+
+ shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/ellipse1.brep"), "BREP")
+ fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(fondFiss, [4])
+ geompy.addToStudy( shellFiss, 'shellFiss' )
+ geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
+
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25)
+
+ centre = None
+ return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 8,
+ areteFaceFissure = 1000)
+
+ # ---------------------------------------------------------------------------
+ def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
+ elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
+ return elementsDefaut
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageFissure(self, geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step):
+ maillageFissure = insereFissureGenerale(maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step)
+ return maillageFissure
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 175,
+ Entity_Quad_Triangle = 298,
+ Entity_Quad_Edge = 248,
+ Entity_Quad_Penta = 96,
+ Entity_Quad_Hexa = 3699,
+ Entity_Node = 20741,
+ Entity_Quad_Tetra = 1979,
+ Entity_Quad_Quadrangle = 1694)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy, smesh
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from ellipse_1 import ellipse_1
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+
+O, OX, OY, OZ = triedreBase()
+
+class ellipse_2(ellipse_1):
+ """
+ problème de fissure non plane, débouchante non normale
+ """
+
+ nomProbleme = "ellipse2"
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+
+ lgInfluence = shapeFissureParams['lgInfluence']
+
+ shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/ellipse1_pb.brep"), "BREP")
+ fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(fondFiss, [4])
+ geompy.addToStudy( shellFiss, 'shellFiss' )
+ geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
+
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25)
+
+ centre = None
+ return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 159,
+ Entity_Quad_Triangle = 438,
+ Entity_Quad_Edge = 249,
+ Entity_Quad_Penta = 80,
+ Entity_Quad_Hexa = 3635,
+ Entity_Node = 20519,
+ Entity_Quad_Tetra = 1973,
+ Entity_Quad_Quadrangle = 1658)
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy, smesh
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from blocFissure.gmu.fissureGenerique import fissureGenerique
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+
+O, OX, OY, OZ = triedreBase()
+
+class eprouvetteCourbe(fissureGenerique):
+ """
+ problème de fissure plane coupant 3 faces (éprouvette), faces au débouché non planes, incidence presque normale
+ """
+
+ nomProbleme = "eprouvetteCourbe"
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageSain(self, geometriesSaines, meshParams):
+ logging.info("genereMaillageSain %s", self.nomCas)
+
+ ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteCourbe.med"))
+ smesh.SetName(objetSain.GetMesh(), 'objetSain')
+
+ return [objetSain, True] # True : maillage hexa
+
+ # ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour méthode insereFissureGenerale
+ lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
+ rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
+ convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
+ pointIn_x : optionnel coordonnée x d'un point dans le solide sain (pour orienter la face)
+ """
+ logging.info("setParamShapeFissure %s", self.nomCas)
+ self.shapeFissureParams = dict(lgInfluence = 30,
+ rayonPipe = 10)
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+
+ lgInfluence = shapeFissureParams['lgInfluence']
+
+ shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteCourbeFiss.brep"), "BREP")
+ fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(fondFiss, [8])
+ geompy.addToStudy( shellFiss, 'shellFiss' )
+ geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
+
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10)
+
+ centre = None
+ return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 8,
+ areteFaceFissure = 15)
+
+ # ---------------------------------------------------------------------------
+ def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
+ elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
+ return elementsDefaut
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageFissure(self, geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step):
+ maillageFissure = insereFissureGenerale(maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step)
+ return maillageFissure
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 618,
+ Entity_Quad_Triangle = 1224,
+ Entity_Quad_Edge = 578,
+ Entity_Quad_Penta = 168,
+ Entity_Quad_Hexa = 18342,
+ Entity_Node = 98170,
+ Entity_Quad_Tetra = 10809,
+ Entity_Quad_Quadrangle = 5408)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy, smesh
+
+import os
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from blocFissure.gmu.fissureGenerique import fissureGenerique
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+
+O, OX, OY, OZ = triedreBase()
+
+class eprouvetteDroite(fissureGenerique):
+ """
+ problème de fissure plane coupant 3 faces (éprouvette), débouches normaux, objet plan
+ """
+
+ nomProbleme = "eprouvetteDroite"
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageSain(self, geometriesSaines, meshParams):
+ logging.info("genereMaillageSain %s", self.nomCas)
+
+ ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests/eprouvetteDroite.med"))
+ smesh.SetName(objetSain.GetMesh(), 'objetSain')
+
+ return [objetSain, True] # True : maillage hexa
+
+ # ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour méthode insereFissureGenerale
+ lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
+ rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
+ convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
+ pointIn_x : optionnel coordonnée x d'un point dans le solide sain (pour orienter la face)
+ """
+ logging.info("setParamShapeFissure %s", self.nomCas)
+ self.shapeFissureParams = dict(lgInfluence = 30,
+ rayonPipe = 10,
+ lenSegPipe = 6)
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+
+ lgInfluence = shapeFissureParams['lgInfluence']
+
+ shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss_1.brep"), "BREP")
+ fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(fondFiss, [8])
+ geompy.addToStudy( shellFiss, 'shellFiss' )
+ geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
+
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10)
+
+ centre = None
+ return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 8,
+ areteFaceFissure = 15)
+
+ # ---------------------------------------------------------------------------
+ def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
+ elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
+ return elementsDefaut
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageFissure(self, geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step):
+ maillageFissure = insereFissureGenerale(maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step)
+ return maillageFissure
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 368,
+ Entity_Quad_Triangle = 798,
+ Entity_Quad_Edge = 491,
+ Entity_Quad_Penta = 88,
+ Entity_Quad_Hexa = 9692,
+ Entity_Node = 52652,
+ Entity_Quad_Tetra = 5093,
+ Entity_Quad_Quadrangle = 3750)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy, smesh
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from eprouvetteDroite import eprouvetteDroite
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+
+O, OX, OY, OZ = triedreBase()
+
+class eprouvetteDroite_2(eprouvetteDroite):
+ """
+ problème de fissure plane coupant 3 faces (éprouvette), débouches non normaux, objet plan
+ """
+
+ nomProbleme = "eprouvetteDroite2"
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+
+ lgInfluence = shapeFissureParams['lgInfluence']
+
+ shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss_2.brep"), "BREP")
+ fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(fondFiss, [10])
+ geompy.addToStudy( shellFiss, 'shellFiss' )
+ geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
+
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10)
+
+ centre = None
+ return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 396,
+ Entity_Quad_Triangle = 1084,
+ Entity_Quad_Edge = 510,
+ Entity_Quad_Penta = 96,
+ Entity_Quad_Hexa = 9504,
+ Entity_Node = 55482,
+ Entity_Quad_Tetra = 7545,
+ Entity_Quad_Quadrangle = 3724)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import sys, traceback
+from blocFissure import gmu
+from blocFissure.gmu import initLog
+#initLog.setDebug()
+initLog.setVerbose()
+
+from blocFissure.gmu import geomsmesh
+from blocFissure.casStandard import casStandard
+
+problemes = []
+
+cas=0
+from blocFissure.CasTests.fissure_Coude import fissure_Coude
+problemes.append(fissure_Coude(cas))
+
+cas=1
+from blocFissure.CasTests.faceGauche import faceGauche
+problemes.append(faceGauche(cas))
+
+cas=2
+from blocFissure.CasTests.faceGauche_2 import faceGauche_2
+problemes.append(faceGauche_2(cas))
+
+cas=3
+from blocFissure.CasTests.ellipse_1 import ellipse_1
+problemes.append(ellipse_1(cas))
+
+cas=4
+from blocFissure.CasTests.fissure_Coude_4 import fissure_Coude_4
+problemes.append(fissure_Coude_4(cas))
+
+cas=5
+from blocFissure.CasTests.cylindre import cylindre
+problemes.append(cylindre(cas))
+
+cas=6
+from blocFissure.CasTests.cylindre_2 import cylindre_2
+problemes.append(cylindre_2(cas))
+
+cas=7
+from blocFissure.CasTests.eprouvetteCourbe import eprouvetteCourbe
+problemes.append(eprouvetteCourbe(cas))
+
+cas=8
+from blocFissure.CasTests.eprouvetteDroite import eprouvetteDroite
+problemes.append(eprouvetteDroite(cas))
+
+cas=9
+from blocFissure.CasTests.eprouvetteDroite_2 import eprouvetteDroite_2
+problemes.append(eprouvetteDroite_2(cas))
+
+cas=10
+from blocFissure.CasTests.cubeAngle import cubeAngle
+problemes.append(cubeAngle(cas))
+
+cas=11
+from blocFissure.CasTests.fissureCoude_1 import fissureCoude_1
+problemes.append(fissureCoude_1(cas))
+
+cas=12
+from blocFissure.CasTests.fissureCoude_2 import fissureCoude_2
+problemes.append(fissureCoude_2(cas))
+
+cas=13
+from blocFissure.CasTests.fissureCoude_3 import fissureCoude_3
+problemes.append(fissureCoude_3(cas))
+
+cas=14
+from blocFissure.CasTests.fissureCoude_4 import fissureCoude_4
+problemes.append(fissureCoude_4(cas))
+
+cas=15
+from blocFissure.CasTests.fissureCoude_5 import fissureCoude_5
+problemes.append(fissureCoude_5(cas))
+
+cas=16
+from blocFissure.CasTests.ellipse_2 import ellipse_2
+problemes.append(ellipse_2(cas))
+
+cas=17
+from blocFissure.CasTests.cubeAngle2 import cubeAngle2
+problemes.append(cubeAngle2(cas))
+
+cas=18
+from blocFissure.CasTests import disquePerce
+problemes.append(casStandard(disquePerce.dicoParams, disquePerce.referencesMaillageFissure, cas))
+
+cas=19
+from blocFissure.CasTests.fissureCoude_6 import fissureCoude_6
+problemes.append(fissureCoude_6(cas))
+
+cas=20
+from blocFissure.CasTests.fissureCoude_7 import fissureCoude_7
+problemes.append(fissureCoude_7(cas))
+
+cas=21
+from blocFissure.CasTests.fissureCoude_8 import fissureCoude_8
+problemes.append(fissureCoude_8(cas))
+
+cas=22
+from blocFissure.CasTests.fissureCoude_9 import fissureCoude_9
+problemes.append(fissureCoude_9(cas))
+
+cas=23
+from blocFissure.CasTests.fissureCoude_10 import fissureCoude_10
+problemes.append(fissureCoude_10(cas))
+
+cas=24
+from blocFissure.CasTests.vis_1 import vis_1
+problemes.append(vis_1(cas))
+
+# ---tous les cas en sequence, ou les cas selectionnés ...
+runall = True
+if runall:
+ torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,]
+else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
+ torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]
+
+for i in range(len(problemes)):
+ if torun[i]:
+ try:
+ problemes[i].executeProbleme()
+ except:
+ traceback.print_exc()
+ print "---------------------------------------------------------------------"
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy, smesh
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from blocFissure.gmu.fissureGenerique import fissureGenerique
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+
+O, OX, OY, OZ = triedreBase()
+
+class faceGauche(fissureGenerique):
+ """
+ problème de fissure non plane, débouchante non normale
+ """
+
+ nomProbleme = "faceGauche"
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageSain(self, geometriesSaines, meshParams):
+ logging.info("genereMaillageSain %s", self.nomCas)
+
+ ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests/faceGaucheSain.med"))
+ smesh.SetName(objetSain.GetMesh(), 'objetSain')
+
+ return [objetSain, True] # True : maillage hexa
+
+ # ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour méthode insereFissureGenerale
+ lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
+ rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
+ convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
+ pointIn_x : optionnel coordonnée x d'un point dans le solide sain (pour orienter la face)
+ """
+ logging.info("setParamShapeFissure %s", self.nomCas)
+ self.shapeFissureParams = dict(lgInfluence = 300,
+ rayonPipe = 20)
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+
+ lgInfluence = shapeFissureParams['lgInfluence']
+
+ shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/faceGaucheFiss.brep"), "BREP")
+ fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(fondFiss, [6])
+ geompy.addToStudy( shellFiss, 'shellFiss' )
+ geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
+
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,50)
+
+ centre = None
+ return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 8,
+ areteFaceFissure = 1000)
+
+ # ---------------------------------------------------------------------------
+ def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
+ elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
+ return elementsDefaut
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageFissure(self, geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step):
+ maillageFissure = insereFissureGenerale(maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step)
+ return maillageFissure
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 1284,
+ Entity_Quad_Triangle = 2336,
+ Entity_Quad_Edge = 758,
+ Entity_Quad_Penta = 984,
+ Entity_Quad_Hexa = 6416,
+ Entity_Node = 85673,
+ Entity_Quad_Tetra = 35990,
+ Entity_Quad_Quadrangle = 4285)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy, smesh
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from blocFissure.gmu.fissureGenerique import fissureGenerique
+
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+
+O, OX, OY, OZ = triedreBase()
+
+class faceGauche_2(fissureGenerique):
+ """
+ problème de fissure non plane, débouchante non normale
+ """
+
+ nomProbleme = "faceGauche2"
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageSain(self, geometriesSaines, meshParams):
+ logging.info("genereMaillageSain %s", self.nomCas)
+
+ ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests/boiteSaine.med"))
+ smesh.SetName(objetSain.GetMesh(), 'objetSain')
+
+ return [objetSain, True] # True : maillage hexa
+
+ # ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour méthode insereFissureGenerale
+ lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
+ rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
+ convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
+ pointIn_x : optionnel coordonnée x d'un point dans le solide sain (pour orienter la face)
+ """
+ logging.info("setParamShapeFissure %s", self.nomCas)
+ self.shapeFissureParams = dict(lgInfluence = 100,
+ rayonPipe = 20)
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+
+ lgInfluence = shapeFissureParams['lgInfluence']
+
+ shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep"), "BREP")
+ fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(fondFiss, [12, 4])
+ geompy.addToStudy( shellFiss, 'shellFiss' )
+ geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
+
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25)
+
+ centre = None
+ return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 8,
+ areteFaceFissure = 1000)
+
+ # ---------------------------------------------------------------------------
+ def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
+ elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
+ return elementsDefaut
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageFissure(self, geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step):
+ maillageFissure = insereFissureGenerale(maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step)
+ return maillageFissure
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 859,
+ Entity_Quad_Triangle = 634,
+ Entity_Quad_Edge = 323,
+ Entity_Quad_Penta = 288,
+ Entity_Quad_Hexa = 3435,
+ Entity_Node = 44095,
+ Entity_Quad_Tetra = 18400,
+ Entity_Quad_Quadrangle = 2542)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure.gmu.fissureCoude import fissureCoude
+
+class fissureCoude_1(fissureCoude):
+ """
+ problème de fissure du Coude :
+ adaptation maillage
+ """
+
+# ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = 60,
+ r_cintr = 1200,
+ l_tube_p1 = 1600,
+ l_tube_p2 = 1200,
+ epais = 40,
+ de = 760)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = 16,
+ n_ep = 3,
+ n_long_coude = 15,
+ n_circ_g = 20,
+ n_circ_d = 20,
+ n_long_p2 = 12)
+
+# ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour le tuyau coude
+ profondeur : 0 < profondeur <= épaisseur
+ rayonPipe : rayon du pipe correspondant au maillage rayonnant
+ lenSegPipe : longueur des mailles rayonnantes le long du fond de fissure (= rayonPipe par défaut)
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> force une fissure elliptique (longueur/profondeur = grand axe/petit axe).
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
+ elliptique : True : fissure elliptique (longueur/profondeur = grand axe/petit axe); False : fissure longue (fond de fissure de profondeur constante, demi-cercles aux extrémites)
+ pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
+ externe : True : fissure face externe, False : fissure face interne
+ """
+ print "setParamShapeFissure", self.nomCas
+ self.shapeFissureParams = dict(profondeur = 10,
+ rayonPipe = 2.5,
+ lenSegPipe = 2.5,
+ azimut = 160,
+ alpha = 20,
+ longueur = 400,
+ orientation = 90,
+ lgInfluence = 50,
+ elliptique = False,
+ externe = True)
+
+# ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ """
+ Paramètres du maillage de la fissure pour le tuyau coudé
+ Voir également setParamShapeFissure, paramètres rayonPipe et lenSegPipe.
+ nbSegRad = nombre de couronnes
+ nbSegCercle = nombre de secteurs
+ areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
+ """
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 6,
+ areteFaceFissure = 5)
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Node = 77917,
+ Entity_Quad_Edge = 975,
+ Entity_Quad_Triangle = 2182,
+ Entity_Quad_Quadrangle = 6842,
+ Entity_Quad_Tetra = 20135,
+ Entity_Quad_Hexa = 8994,
+ Entity_Quad_Penta = 972,
+ Entity_Quad_Pyramid = 1038)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure.gmu.fissureCoude import fissureCoude
+
+class fissureCoude_10(fissureCoude):
+ # cas test ASCOU17
+
+
+# ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = 90,
+ r_cintr = 1143,
+ l_tube_p1 = 3200,
+ l_tube_p2 = 3200,
+ epais = 35,
+ de = 762)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = 13,
+ n_ep = 2,
+ n_long_coude = 20,
+ n_circ_g = 20,
+ n_circ_d = 20,
+ n_long_p2 = 13)
+
+ # ---------------------------------------------------------------------------
+
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour le tuyau coude
+ profondeur : 0 < profondeur <= épaisseur
+ rayonPipe : rayon du pipe correspondant au maillage rayonnant
+ lenSegPipe : longueur des mailles rayonnantes le long du fond de fissure (= rayonPipe par défaut)
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> force une fissure elliptique (longueur/profondeur = grand axe/petit axe).
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
+ elliptique : True : fissure elliptique (longueur/profondeur = grand axe/petit axe); False : fissure longue (fond de fissure de profondeur constante, demi-cercles aux extrémites)
+ pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
+ externe : True : fissure face externe, False : fissure face interne
+ """
+# logging.info("setParamShapeFissure %s", self.nomCas)
+ self.shapeFissureParams = dict(profondeur = 2.5,
+ rayonPipe = 1.5,
+ lenSegPipe = 6,
+ azimut = 180,
+ alpha = 45,
+ longueur = 1196,
+ orientation = 0,
+ lgInfluence = 30,
+ elliptique = False,
+ externe = False)
+
+ # ---------------------------------------------------------------------------
+
+ def setParamMaillageFissure(self):
+ """
+ Paramètres du maillage de la fissure pour le tuyau coudé
+ Voir également setParamShapeFissure, paramètres rayonPipe et lenSegPipe.
+ nbSegRad = nombre de couronnes
+ nbSegCercle = nombre de secteurs
+ areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
+ """
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 3,
+ nbsegCercle = 8,
+ areteFaceFissure = 2.5)
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Node = 93352,
+ Entity_Quad_Edge = 1456,
+ Entity_Quad_Triangle = 8934,
+ Entity_Quad_Quadrangle = 6978,
+ Entity_Quad_Tetra = 31147,
+ Entity_Quad_Hexa = 6972,
+ Entity_Quad_Penta = 1600,
+ Entity_Quad_Pyramid = 1696)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure.gmu.fissureCoude import fissureCoude
+
+class fissureCoude_2(fissureCoude):
+ """
+ problème de fissure du Coude :
+ adaptation maillage
+ """
+
+# ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = 90,
+ r_cintr = 1200,
+ l_tube_p1 = 1600,
+ l_tube_p2 = 1200,
+ epais = 40,
+ de = 760)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = 16,
+ n_ep = 3,
+ n_long_coude = 15,
+ n_circ_g = 20,
+ n_circ_d = 20,
+ n_long_p2 = 12)
+
+# ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour le tuyau coude
+ profondeur : 0 < profondeur <= épaisseur
+ rayonPipe : rayon du pipe correspondant au maillage rayonnant
+ lenSegPipe : longueur des mailles rayonnantes le long du fond de fissure (= rayonPipe par défaut)
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> force une fissure elliptique (longueur/profondeur = grand axe/petit axe).
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
+ elliptique : True : fissure elliptique (longueur/profondeur = grand axe/petit axe); False : fissure longue (fond de fissure de profondeur constante, demi-cercles aux extrémites)
+ pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
+ externe : True : fissure face externe, False : fissure face interne
+ """
+ print "setParamShapeFissure", self.nomCas
+ self.shapeFissureParams = dict(profondeur = 10,
+ rayonPipe = 2.5,
+ lenSegPipe = 2.5,
+ azimut = 200,
+ alpha = 40,
+ longueur = 800,
+ orientation = 0,
+ lgInfluence = 50,
+ elliptique = False,
+ externe = True)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ """
+ Paramètres du maillage de la fissure pour le tuyau coudé
+ Voir également setParamShapeFissure, paramètres rayonPipe et lenSegPipe.
+ nbSegRad = nombre de couronnes
+ nbSegCercle = nombre de secteurs
+ areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
+ """
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 6,
+ areteFaceFissure = 5)
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Node = 132120,
+ Entity_Quad_Edge = 1411,
+ Entity_Quad_Triangle = 5342,
+ Entity_Quad_Quadrangle = 9524,
+ Entity_Quad_Tetra = 40902,
+ Entity_Quad_Hexa = 12981,
+ Entity_Quad_Penta = 1980,
+ Entity_Quad_Pyramid = 2064)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure.gmu.fissureCoude import fissureCoude
+
+class fissureCoude_3(fissureCoude):
+ """
+ problème de fissure du Coude
+ adaptation maillage
+ """
+
+# ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = 40,
+ r_cintr = 654,
+ l_tube_p1 = 1700,
+ l_tube_p2 = 1700,
+ epais = 62.5,
+ de = 912.4)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = 16,
+ n_ep = 3,
+ n_long_coude = 30,
+ n_circ_g = 50,
+ n_circ_d = 20,
+ n_long_p2 = 12)
+
+# ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour le tuyau coude
+ profondeur : 0 < profondeur <= épaisseur
+ rayonPipe : rayon du pipe correspondant au maillage rayonnant
+ lenSegPipe : longueur des mailles rayonnantes le long du fond de fissure (= rayonPipe par défaut)
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> force une fissure elliptique (longueur/profondeur = grand axe/petit axe).
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
+ elliptique : True : fissure elliptique (longueur/profondeur = grand axe/petit axe); False : fissure longue (fond de fissure de profondeur constante, demi-cercles aux extrémites)
+ pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
+ externe : True : fissure face externe, False : fissure face interne
+ """
+ print "setParamShapeFissure", self.nomCas
+ self.shapeFissureParams = dict(profondeur = 10,
+ rayonPipe = 2.5,
+ lenSegPipe = 2.5,
+ azimut = 90,
+ alpha = 20,
+ longueur = 240,
+ orientation = 90,
+ lgInfluence = 30,
+ elliptique = False,
+ externe = False)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ """
+ Paramètres du maillage de la fissure pour le tuyau coudé
+ Voir également setParamShapeFissure, paramètres rayonPipe et lenSegPipe.
+ nbSegRad = nombre de couronnes
+ nbSegCercle = nombre de secteurs
+ areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
+ """
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 6,
+ areteFaceFissure = 5)
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Node = 98643,
+ Entity_Quad_Edge = 1130,
+ Entity_Quad_Triangle = 1476,
+ Entity_Quad_Quadrangle = 11100,
+ Entity_Quad_Tetra = 15993,
+ Entity_Quad_Hexa = 14508,
+ Entity_Quad_Penta = 624,
+ Entity_Quad_Pyramid = 788)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure.gmu.fissureCoude import fissureCoude
+
+class fissureCoude_4(fissureCoude):
+ """
+ problème de fissure du Coude : ASCOU09A
+ adaptation maillage
+ """
+
+# ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = 40,
+ r_cintr = 654,
+ l_tube_p1 = 1700,
+ l_tube_p2 = 1700,
+ epais = 62.5,
+ de = 912.4)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = 16,
+ n_ep = 5,
+ n_long_coude = 30,
+ n_circ_g = 50,
+ n_circ_d = 20,
+ n_long_p2 = 12)
+
+# ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour le tuyau coude
+ profondeur : 0 < profondeur <= épaisseur
+ rayonPipe : rayon du pipe correspondant au maillage rayonnant
+ lenSegPipe : longueur des mailles rayonnantes le long du fond de fissure (= rayonPipe par défaut)
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> force une fissure elliptique (longueur/profondeur = grand axe/petit axe).
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
+ elliptique : True : fissure elliptique (longueur/profondeur = grand axe/petit axe); False : fissure longue (fond de fissure de profondeur constante, demi-cercles aux extrémites)
+ pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
+ externe : True : fissure face externe, False : fissure face interne
+ """
+ print "setParamShapeFissure", self.nomCas
+ self.shapeFissureParams = dict(profondeur = 10,
+ rayonPipe = 2.5,
+ lenSegPipe =2.5,
+ azimut = 90,
+ alpha = 20,
+ longueur = 240,
+ orientation = 90,
+ lgInfluence = 30,
+ elliptique = False,
+ externe = True)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ """
+ Paramètres du maillage de la fissure pour le tuyau coudé
+ Voir également setParamShapeFissure, paramètres rayonPipe et lenSegPipe.
+ nbSegRad = nombre de couronnes
+ nbSegCercle = nombre de secteurs
+ areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
+ """
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 6,
+ areteFaceFissure = 5)
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Node = 133832,
+ Entity_Quad_Edge = 1133,
+ Entity_Quad_Triangle = 1498,
+ Entity_Quad_Quadrangle = 11892,
+ Entity_Quad_Tetra = 18401,
+ Entity_Quad_Hexa = 22412,
+ Entity_Quad_Penta = 600,
+ Entity_Quad_Pyramid = 816)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure.gmu.fissureCoude import fissureCoude
+
+class fissureCoude_5(fissureCoude):
+ """
+ problème de fissure du Coude :
+ adaptation maillage
+ """
+
+# ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = 90,
+ r_cintr = 1200,
+ l_tube_p1 = 1600,
+ l_tube_p2 = 1200,
+ epais = 40,
+ de = 760)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = 16,
+ n_ep = 3,
+ n_long_coude = 15,
+ n_circ_g = 20,
+ n_circ_d = 20,
+ n_long_p2 = 12)
+
+# ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour le tuyau coude
+ profondeur : 0 < profondeur <= épaisseur
+ rayonPipe : rayon du pipe correspondant au maillage rayonnant
+ lenSegPipe : longueur des mailles rayonnantes le long du fond de fissure (= rayonPipe par défaut)
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> force une fissure elliptique (longueur/profondeur = grand axe/petit axe).
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
+ elliptique : True : fissure elliptique (longueur/profondeur = grand axe/petit axe); False : fissure longue (fond de fissure de profondeur constante, demi-cercles aux extrémites)
+ pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
+ externe : True : fissure face externe, False : fissure face interne
+ """
+ print "setParamShapeFissure", self.nomCas
+ self.shapeFissureParams = dict(profondeur = 10,
+ rayonPipe = 2.5,
+ lenSegPipe = 2.5,
+ azimut = 180,
+ alpha = 40,
+ longueur = 200,
+ orientation = 0,
+ lgInfluence = 50,
+ elliptique = False,
+ externe = False)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ """
+ Paramètres du maillage de la fissure pour le tuyau coudé
+ Voir également setParamShapeFissure, paramètres rayonPipe et lenSegPipe.
+ nbSegRad = nombre de couronnes
+ nbSegCercle = nombre de secteurs
+ areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
+ """
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 6,
+ areteFaceFissure = 5)
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Node = 55217,
+ Entity_Quad_Edge = 762,
+ Entity_Quad_Triangle = 1586,
+ Entity_Quad_Quadrangle = 5610,
+ Entity_Quad_Tetra = 11468,
+ Entity_Quad_Hexa = 7200,
+ Entity_Quad_Penta = 516,
+ Entity_Quad_Pyramid = 552)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure.gmu.fissureCoude import fissureCoude
+
+class fissureCoude_6(fissureCoude):
+# --- cas ASCOU08
+
+# ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = 40,
+ r_cintr = 854,
+ l_tube_p1 = 1700,
+ l_tube_p2 = 1700,
+ epais = 62.5,
+ de = 912.4)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = 15,
+ n_ep = 3,
+ n_long_coude = 16,
+ n_circ_g = 30,
+ n_circ_d = 30,
+ n_long_p2 = 15)
+
+# ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour le tuyau coude
+ profondeur : 0 < profondeur <= épaisseur
+ rayonPipe : rayon du pipe correspondant au maillage rayonnant
+ lenSegPipe : longueur des mailles rayonnantes le long du fond de fissure (= rayonPipe par défaut)
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> force une fissure elliptique (longueur/profondeur = grand axe/petit axe).
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
+ elliptique : True : fissure elliptique (longueur/profondeur = grand axe/petit axe); False : fissure longue (fond de fissure de profondeur constante, demi-cercles aux extrémites)
+ pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
+ externe : True : fissure face externe, False : fissure face interne
+ """
+ print "setParamShapeFissure", self.nomCas
+ self.shapeFissureParams = dict(profondeur = 10,
+ rayonPipe = 4,
+ lenSegPipe = 4,
+ azimut = 90,
+ alpha = 20,
+ longueur = 133,
+ orientation = 0,
+ lgInfluence = 30,
+ elliptique = False,
+ externe = True)
+
+ # ---------------------------------------------------------------------------
+
+ def setParamMaillageFissure(self):
+ """
+ Paramètres du maillage de la fissure pour le tuyau coudé
+ Voir également setParamShapeFissure, paramètres rayonPipe et lenSegPipe.
+ nbSegRad = nombre de couronnes
+ nbSegCercle = nombre de secteurs
+ areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
+ """
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 12,
+ areteFaceFissure = 5)
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Node = 63783,
+ Entity_Quad_Edge = 831,
+ Entity_Quad_Triangle = 742,
+ Entity_Quad_Quadrangle = 7480,
+ Entity_Quad_Tetra = 8084,
+ Entity_Quad_Hexa = 10080,
+ Entity_Quad_Penta = 456,
+ Entity_Quad_Pyramid = 500)
+
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure.gmu.fissureCoude import fissureCoude
+
+class fissureCoude_7(fissureCoude):
+
+
+# ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = 40,
+ r_cintr = 654,
+ l_tube_p1 = 1700,
+ l_tube_p2 = 1700,
+ epais = 62.5,
+ de = 912.4)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = 15,
+ n_ep = 3,
+ n_long_coude = 16,
+ n_circ_g = 30,
+ n_circ_d = 30,
+ n_long_p2 = 15)
+
+ # ---------------------------------------------------------------------------
+
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour le tuyau coude
+ profondeur : 0 < profondeur <= épaisseur
+ rayonPipe : rayon du pipe correspondant au maillage rayonnant
+ lenSegPipe : longueur des mailles rayonnantes le long du fond de fissure (= rayonPipe par défaut)
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> force une fissure elliptique (longueur/profondeur = grand axe/petit axe).
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
+ elliptique : True : fissure elliptique (longueur/profondeur = grand axe/petit axe); False : fissure longue (fond de fissure de profondeur constante, demi-cercles aux extrémites)
+ pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
+ externe : True : fissure face externe, False : fissure face interne
+ """
+# logging.info("setParamShapeFissure %s", self.nomCas)
+ self.shapeFissureParams = dict(profondeur = 10,
+ rayonPipe = 4,
+ lenSegPipe = 4,
+ azimut = 0,
+ alpha = 20,
+ longueur = 240,
+ orientation = 0,
+ lgInfluence = 30,
+ elliptique = False,
+ externe = True)
+
+ # ---------------------------------------------------------------------------
+
+ def setParamMaillageFissure(self):
+ """
+ Paramètres du maillage de la fissure pour le tuyau coudé
+ Voir également setParamShapeFissure, paramètres rayonPipe et lenSegPipe.
+ nbSegRad = nombre de couronnes
+ nbSegCercle = nombre de secteurs
+ areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
+ """
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 12,
+ areteFaceFissure = 5)
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Node = 75580,
+ Entity_Quad_Edge = 899,
+ Entity_Quad_Triangle = 1158,
+ Entity_Quad_Quadrangle = 8022,
+ Entity_Quad_Tetra = 13162,
+ Entity_Quad_Hexa = 11272,
+ Entity_Quad_Penta = 756,
+ Entity_Quad_Pyramid = 812)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure.gmu.fissureCoude import fissureCoude
+
+class fissureCoude_8(fissureCoude):
+ # cas test ASCOU15
+
+
+# ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = 90,
+ r_cintr = 2290,
+ l_tube_p1 = 3200,
+ l_tube_p2 = 3200,
+ epais = 30.5,
+ de = 762)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = 8,
+ n_ep = 2,
+ n_long_coude = 20,
+ n_circ_g = 20,
+ n_circ_d = 20,
+ n_long_p2 = 8)
+
+ # ---------------------------------------------------------------------------
+
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour le tuyau coude
+ profondeur : 0 < profondeur <= épaisseur
+ rayonPipe : rayon du pipe correspondant au maillage rayonnant
+ lenSegPipe : longueur des mailles rayonnantes le long du fond de fissure (= rayonPipe par défaut)
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> force une fissure elliptique (longueur/profondeur = grand axe/petit axe).
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
+ elliptique : True : fissure elliptique (longueur/profondeur = grand axe/petit axe); False : fissure longue (fond de fissure de profondeur constante, demi-cercles aux extrémites)
+ pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
+ externe : True : fissure face externe, False : fissure face interne
+ """
+# logging.info("setParamShapeFissure %s", self.nomCas)
+ self.shapeFissureParams = dict(profondeur = 8,
+ rayonPipe = 1,
+ lenSegPipe = 1.5,
+ azimut = 180,
+ alpha = 45,
+ longueur = 48,
+ orientation = 0,
+ lgInfluence = 30,
+ elliptique = True,
+ externe = False)
+
+ # ---------------------------------------------------------------------------
+
+ def setParamMaillageFissure(self):
+ """
+ Paramètres du maillage de la fissure pour le tuyau coudé
+ Voir également setParamShapeFissure, paramètres rayonPipe et lenSegPipe.
+ nbSegRad = nombre de couronnes
+ nbSegCercle = nombre de secteurs
+ areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
+ """
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 4,
+ nbsegCercle = 16,
+ areteFaceFissure = 5)
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Node = 50627,
+ Entity_Quad_Edge = 666,
+ Entity_Quad_Triangle = 1498,
+ Entity_Quad_Quadrangle = 4747,
+ Entity_Quad_Tetra = 13225,
+ Entity_Quad_Hexa = 5464,
+ Entity_Quad_Penta = 864,
+ Entity_Quad_Pyramid = 880)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure.gmu.fissureCoude import fissureCoude
+
+class fissureCoude_9(fissureCoude):
+ # cas test ASCOU19
+
+
+# ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = 90,
+ r_cintr = 1144,
+ l_tube_p1 = 1651,
+ l_tube_p2 = 1651,
+ epais = 39,
+ de = 762)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = 16,
+ n_ep = 4,
+ n_long_coude = 40,
+ n_circ_g = 40,
+ n_circ_d = 40,
+ n_long_p2 = 16)
+
+# ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour le tuyau coude
+ profondeur : 0 < profondeur <= épaisseur
+ rayonPipe : rayon du pipe correspondant au maillage rayonnant
+ lenSegPipe : longueur des mailles rayonnantes le long du fond de fissure (= rayonPipe par défaut)
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> force une fissure elliptique (longueur/profondeur = grand axe/petit axe).
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
+ elliptique : True : fissure elliptique (longueur/profondeur = grand axe/petit axe); False : fissure longue (fond de fissure de profondeur constante, demi-cercles aux extrémites)
+ pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
+ externe : True : fissure face externe, False : fissure face interne
+ """
+ print "setParamShapeFissure", self.nomCas
+ self.shapeFissureParams = dict(profondeur = 10,
+ rayonPipe = 2,
+ lenSegPipe = 6,
+ azimut = 0,
+ alpha = 30.8456,
+ longueur = 240,
+ orientation = 90,
+ lgInfluence = 50,
+ elliptique = False,
+ externe = False)
+
+# ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ """
+ Paramètres du maillage de la fissure pour le tuyau coudé
+ Voir également setParamShapeFissure, paramètres rayonPipe et lenSegPipe.
+ nbSegRad = nombre de couronnes
+ nbSegCercle = nombre de secteurs
+ areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
+ """
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 6,
+ nbsegCercle = 20,
+ areteFaceFissure = 2.5)
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Node = 162936,
+ Entity_Quad_Edge = 1254,
+ Entity_Quad_Triangle = 3238,
+ Entity_Quad_Quadrangle = 15088,
+ Entity_Quad_Tetra = 19305,
+ Entity_Quad_Hexa = 27472,
+ Entity_Quad_Penta = 920,
+ Entity_Quad_Pyramid = 1056)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy, smesh
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from blocFissure.gmu.fissureGenerique import fissureGenerique
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from blocFissure.gmu.insereFissureLongue import insereFissureLongue
+
+O, OX, OY, OZ = triedreBase()
+
+class fissure_Coude(fissureGenerique):
+ """
+ problème de fissure du Coude : version de base
+ maillage hexa
+ """
+
+ nomProbleme = "tuyau_Coude"
+
+ # ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = 60,
+ r_cintr = 1200,
+ l_tube_p1 = 1600,
+ l_tube_p2 = 1200,
+ epais = 40,
+ de = 760)
+
+ # ---------------------------------------------------------------------------
+ def genereGeometrieSaine(self, geomParams):
+ logging.info("genereGeometrieSaine %s", self.nomCas)
+
+ angleCoude = geomParams['angleCoude']
+ r_cintr = geomParams['r_cintr']
+ l_tube_p1 = geomParams['l_tube_p1']
+ l_tube_p2 = geomParams['l_tube_p2']
+ epais = geomParams['epais']
+ de = geomParams['de']
+
+ centre = geompy.MakeVertex(0, 0, -l_tube_p1)
+ Disk_1 = geompy.MakeDiskPntVecR(centre, OZ, de/2.)
+ Disk_2 = geompy.MakeDiskPntVecR(centre, OZ, de/2. -epais)
+ Cut_1 = geompy.MakeCut(Disk_1, Disk_2)
+ Extrusion_1 = geompy.MakePrismVecH(Cut_1, OZ, l_tube_p1)
+ axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
+ Revolution_1 = geompy.MakeRevolution(Cut_1, axe, angleCoude*math.pi/180.0)
+ Rotation_1 = geompy.MakeRotation(Cut_1, axe, angleCoude*math.pi/180.0)
+ Rotation_2 = geompy.MakeRotation(OZ, OY, angleCoude*math.pi/180.0)
+ Extrusion_2 = geompy.MakePrismVecH(Rotation_1, Rotation_2, -l_tube_p2)
+ Plane_1 = geompy.MakePlaneLCS(None, 100000, 3)
+ geompy.addToStudy( Plane_1, "Plane_1" )
+ geompy.addToStudy( Extrusion_1, "Extrusion_1" )
+ geompy.addToStudy( Revolution_1, "Revolution_1" )
+ geompy.addToStudy( Extrusion_2, "Extrusion_2" )
+
+ P1 = O
+ geompy.addToStudy( P1, "P1" )
+ op2 = geompy.MakeVertex(0, 0, -l_tube_p1)
+ P2 = geompy.MakeRotation(op2, axe, angleCoude*math.pi/180.0)
+ P2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, -l_tube_p2)
+ geompy.addToStudy( P2, "P2" )
+
+ # --- tube coude sain
+
+ geometrieSaine = geompy.MakePartition([Extrusion_1, Revolution_1, Extrusion_2, P1, P2], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
+ geompy.addToStudy( geometrieSaine, self.nomCas )
+ [P1, P2] = geompy.RestoreGivenSubShapes(geometrieSaine, [P1, P2], GEOM.FSM_GetInPlaceByHistory, False, True)
+
+ [ep, circ_g, circ_d, long_p2, long_coude, long_p1] = geompy.Propagate(geometrieSaine)
+ geompy.addToStudyInFather( geometrieSaine, long_p1, 'long_p1' )
+ geompy.addToStudyInFather( geometrieSaine, ep, 'ep' )
+ geompy.addToStudyInFather( geometrieSaine, long_coude, 'long_coude' )
+ geompy.addToStudyInFather( geometrieSaine, circ_g, 'circ_g' )
+ geompy.addToStudyInFather( geometrieSaine, circ_d, 'circ_d' )
+ geompy.addToStudyInFather( geometrieSaine, long_p2, 'long_p2' )
+
+ # --- face extremite tube (EXTUBE)
+
+ facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], OZ, GEOM.ST_ON)
+ EXTUBE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
+ geompy.UnionIDs(EXTUBE, facesIds)
+ geompy.addToStudyInFather( geometrieSaine, EXTUBE, 'EXTUBE' )
+
+ # --- edge bord extremite tube (BORDTU)
+
+ edge1Ids = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["EDGE"], OZ, GEOM.ST_ON)
+ edge2Ids = geompy.GetShapesOnCylinderIDs(geometrieSaine, geompy.ShapeType["EDGE"], OZ, de/2., GEOM.ST_ON)
+ edgesIds = []
+ for edge in edge1Ids:
+ if edge in edge2Ids:
+ edgesIds.append(edge)
+ BORDTU = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(BORDTU, edgesIds)
+ geompy.addToStudyInFather( geometrieSaine, BORDTU, 'BORDTU' )
+
+ # --- face origine tube (CLGV)
+
+ pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10)
+ vec2 = geompy.MakeVector(P2, pp2)
+ #geompy.addToStudy(vec2, 'vec2')
+ facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON)
+ CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
+ geompy.UnionIDs(CLGV, facesIds)
+ geompy.addToStudyInFather( geometrieSaine, CLGV, 'CLGV' )
+
+ # --- peau tube interieur (PEAUINT)
+
+ extru1 = geompy.MakePrismVecH(Disk_2, OZ, l_tube_p1)
+ revol1 = geompy.MakeRevolution(Disk_2, axe, angleCoude*math.pi/180.0)
+ rot1 = geompy.MakeRotation(Disk_2, axe, angleCoude*math.pi/180.0)
+ extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
+ interne = geompy.MakeFuse(extru1, revol1)
+ interne = geompy.MakeFuse(extru2, interne)
+ geompy.addToStudy(interne, 'interne')
+ facesIds = geompy.GetShapesOnShapeIDs(interne, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ONIN)
+ PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
+ geompy.UnionIDs(PEAUINT, facesIds)
+ geompy.addToStudyInFather( geometrieSaine, PEAUINT, 'PEAUINT' )
+
+ # --- peau tube exterieur (PEAUEXT)
+
+ cercle1 = geompy.MakeCircle(centre, OZ, de/2.)
+ extru1 = geompy.MakePrismVecH(cercle1, OZ, l_tube_p1)
+ revol1 = geompy.MakeRevolution(cercle1, axe, angleCoude*math.pi/180.0)
+ rot1 = geompy.MakeRotation(cercle1, axe, angleCoude*math.pi/180.0)
+ extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
+ externe = geompy.MakeFuse(extru1, revol1)
+ externe = geompy.MakeFuse(extru2, externe)
+ geompy.addToStudy(externe, 'externe')
+ facesIds = geompy.GetShapesOnShapeIDs(externe, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ON)
+ PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
+ geompy.UnionIDs(PEAUEXT, facesIds)
+ geompy.addToStudyInFather( geometrieSaine, PEAUEXT, 'PEAUEXT' )
+
+ # --- solide sain
+
+ volIds = geompy.SubShapeAllIDs(geometrieSaine, geompy.ShapeType["SOLID"])
+ COUDE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["SOLID"])
+ geompy.UnionIDs(COUDE, volIds)
+ geompy.addToStudyInFather( geometrieSaine, COUDE, 'COUDSAIN' )
+
+ geometriesSaines = [geometrieSaine, long_p1, ep, long_coude, circ_g, circ_d, long_p2, P1, P2, EXTUBE, BORDTU, CLGV, PEAUINT, PEAUEXT, COUDE]
+
+ return geometriesSaines
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = 16,
+ n_ep = 3,
+ n_long_coude = 15,
+ n_circ_g = 20,
+ n_circ_d = 20,
+ n_long_p2 = 12)
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageSain(self, geometriesSaines, meshParams):
+ logging.info("genereMaillageSain %s", self.nomCas)
+
+ geometrieSaine = geometriesSaines[0]
+ long_p1 = geometriesSaines[1]
+ ep = geometriesSaines[2]
+ long_coude = geometriesSaines[3]
+ circ_g = geometriesSaines[4]
+ circ_d = geometriesSaines[5]
+ long_p2 = geometriesSaines[6]
+ P1 = geometriesSaines[7]
+ P2 = geometriesSaines[8]
+ EXTUBE = geometriesSaines[9]
+ BORDTU = geometriesSaines[10]
+ CLGV = geometriesSaines[11]
+ PEAUINT = geometriesSaines[12]
+ PEAUEXT = geometriesSaines[13]
+ COUDE = geometriesSaines[14]
+
+ n_long_p1 = meshParams['n_long_p1']
+ n_ep = meshParams['n_ep']
+ n_long_coude = meshParams['n_long_coude']
+ n_circ_g = meshParams['n_circ_g']
+ n_circ_d = meshParams['n_circ_d']
+ n_long_p2 = meshParams['n_long_p2']
+
+ maillageSain = smesh.Mesh(geometrieSaine)
+
+ algo3d = maillageSain.Hexahedron()
+ algo2d = maillageSain.Quadrangle()
+ smesh.SetName(algo3d, "algo3d_maillageSain")
+ smesh.SetName(algo2d, "algo2d_maillageSain")
+
+ algo1d_long_p1 = maillageSain.Segment(geom=long_p1)
+ hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1)
+ smesh.SetName(algo1d_long_p1, "algo1d_long_p1")
+ smesh.SetName(hypo1d_long_p1, "hypo1d_long_p1")
+
+ algo1d_ep = maillageSain.Segment(geom=ep)
+ hypo1d_ep = algo1d_ep.NumberOfSegments(n_ep)
+ smesh.SetName(algo1d_ep, "algo1d_ep")
+ smesh.SetName(hypo1d_ep, "hypo1d_ep")
+
+ algo1d_long_coude = maillageSain.Segment(geom=long_coude)
+ hypo1d_long_coude = algo1d_long_coude.NumberOfSegments(n_long_coude)
+ smesh.SetName(algo1d_long_coude, "algo1d_long_coude")
+ smesh.SetName(hypo1d_long_coude, "hypo1d_long_coude")
+
+ algo1d_circ_g = maillageSain.Segment(geom=circ_g)
+ hypo1d_circ_g = algo1d_circ_g.NumberOfSegments(n_circ_g)
+ smesh.SetName(algo1d_circ_g, "algo1d_circ_g")
+ smesh.SetName(hypo1d_circ_g, "hypo1d_circ_g")
+
+ algo1d_circ_d = maillageSain.Segment(geom=circ_d)
+ hypo1d_circ_d = algo1d_circ_d.NumberOfSegments(n_circ_d)
+ smesh.SetName(algo1d_circ_d, "algo1d_circ_d")
+ smesh.SetName(hypo1d_circ_d, "hypo1d_circ_d")
+
+ algo1d_long_p2 = maillageSain.Segment(geom=long_p2)
+ hypo1d_long_p2 = algo1d_long_p2.NumberOfSegments(n_long_p2)
+ smesh.SetName(algo1d_long_p2, "algo1d_long_p2")
+ smesh.SetName(hypo1d_long_p2, "hypo1d_long_p2")
+
+ isDone = maillageSain.Compute()
+
+ mp1 = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE)
+ mp2 = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE)
+ ext = maillageSain.GroupOnGeom(EXTUBE,'EXTUBE',SMESH.FACE)
+ btu = maillageSain.GroupOnGeom(BORDTU,'BORDTU',SMESH.EDGE)
+ clg = maillageSain.GroupOnGeom(CLGV,'CLGV',SMESH.FACE)
+ pei = maillageSain.GroupOnGeom(PEAUINT,'PEAUINT',SMESH.FACE)
+ pex = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE)
+ cou = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME)
+
+ return [maillageSain, True] # True : maillage hexa
+
+ # ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure
+ profondeur : 0 < profondeur <= épaisseur
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> ellipse, >2*profondeur = fissure longue
+ lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ externe : True : fissure face externe, False : fissure face interne
+ """
+ logging.info("setParamShapeFissure %s", self.nomCas)
+ self.shapeFissureParams = dict(profondeur = 10,
+ azimut = 160,
+ alpha = 20,
+ longueur = 400,
+ orientation = 90,
+ lgInfluence = 0,
+ elliptique = False,
+ externe = True)
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+ logging.info("shapeFissureParams %s", shapeFissureParams)
+
+ angleCoude = geomParams['angleCoude']
+ r_cintr = geomParams['r_cintr']
+ l_tube_p1 = geomParams['l_tube_p1']
+ l_tube_p2 = geomParams['l_tube_p2']
+ epais = geomParams['epais']
+ de = geomParams['de']
+
+ profondeur = shapeFissureParams['profondeur']
+ azimut = shapeFissureParams['azimut']
+ alpha = shapeFissureParams['alpha']
+ longueur = shapeFissureParams['longueur']
+ orientation = shapeFissureParams['orientation']
+ externe = shapeFissureParams['externe']
+ lgInfluence = shapeFissureParams['lgInfluence']
+
+ azimut = -azimut # axe inverse / ASCOUF
+ axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
+
+ if not lgInfluence:
+ lgInfluence = profondeur
+
+ if longueur > 2*profondeur:
+ self.fissureLongue=True
+ else:
+ self.fissureLongue=False
+
+ self.circonferentielle = False
+ self.longitudinale = False
+ if self.fissureLongue and (abs(orientation) < 45) :
+ self.longitudinale = True
+ elif self.fissureLongue:
+ self.circonferentielle = True
+
+ if self.circonferentielle:
+ if externe:
+ raybor = de/2.
+ rayint = raybor - profondeur
+ rayext = raybor + profondeur
+ else:
+ rayext = de/2. - epais
+ rayint = raybor + profondeur
+ rayext = raybor - profondeur
+ lgfond = longueur -2*profondeur
+ angle = lgfond/(2*raybor)
+ pb = geompy.MakeVertex(raybor, 0, 0)
+ pi = geompy.MakeVertex(rayint, 0, 0)
+ pe = geompy.MakeVertex(rayext, 0, 0)
+ pl = geompy.MakeVertex(raybor, profondeur, 0)
+ pr = geompy.MakeVertex(raybor, -profondeur, 0)
+ pil = geompy.MakeRotation(pi, OZ, angle)
+ pll = geompy.MakeRotation(pl, OZ, angle)
+ pel = geompy.MakeRotation(pe, OZ, angle)
+ pir = geompy.MakeRotation(pi, OZ, -angle)
+ prr = geompy.MakeRotation(pr, OZ, -angle)
+ per = geompy.MakeRotation(pe, OZ, -angle)
+ arcl = geompy.MakeArc(pil, pll, pel)
+ arcr = geompy.MakeArc(pir, prr, per)
+ arci = geompy.MakeArc(pil, pi, pir)
+ arce = geompy.MakeArc(pel, pe, per)
+ wire0 = geompy.MakeWire([arcr, arci, arcl])
+ cercle0 = geompy.MakeCircle(O, OY, profondeur/4.0)
+ cercle0 = geompy.MakeRotation(cercle0, OY, math.pi/2.0)
+ cercle0 = geompy.MakeTranslationTwoPoints(cercle0, O, pi)
+ facetube0 = geompy.MakeFaceWires([cercle0], 1)
+ facetubel = geompy.MakeRotation(facetube0, OZ, angle)
+ facetuber = geompy.MakeRotation(facetube0, OZ, -angle)
+ face0 = geompy.MakeFaceWires([arcl,arci, arce, arcr], 1)
+ plan0 = geompy.MakePlane(O, OZ, 10000)
+ geompy.addToStudy( face0, 'facefissOrig' )
+ face1 = geompy.MakeRotation(face0, OZ, azimut*math.pi/180.)
+ face2 = geompy.MakeTranslation(face1, 0, 0, -l_tube_p1)
+ facefiss = geompy.MakeRotation(face2, axe, alpha*math.pi/180.)
+ geompy.addToStudy( facefiss, 'facefissPlace' )
+ centre = geompy.MakeRotation(pb, OZ, azimut*math.pi/180.)
+ centre = geompy.MakeTranslation(centre, 0, 0, -l_tube_p1)
+ centre = geompy.MakeRotation(centre, axe, alpha*math.pi/180.)
+ geompy.addToStudy( centre, 'centrefissPlace' )
+ arcr = geompy.MakeRotation(arcr, OZ, azimut*math.pi/180.)
+ arcr = geompy.MakeTranslation(arcr, 0, 0, -l_tube_p1)
+ arcr = geompy.MakeRotation(arcr, axe, alpha*math.pi/180.)
+ arci = geompy.MakeRotation(arci, OZ, azimut*math.pi/180.)
+ arci = geompy.MakeTranslation(arci, 0, 0, -l_tube_p1)
+ arci = geompy.MakeRotation(arci, axe, alpha*math.pi/180.)
+ arcl = geompy.MakeRotation(arcl, OZ, azimut*math.pi/180.)
+ arcl = geompy.MakeTranslation(arcl, 0, 0, -l_tube_p1)
+ arcl = geompy.MakeRotation(arcl, axe, alpha*math.pi/180.)
+ wiretube = geompy.MakeRotation(wire0, OZ, azimut*math.pi/180.)
+ wiretube = geompy.MakeTranslation(wiretube, 0, 0, -l_tube_p1)
+ wiretube = geompy.MakeRotation(wiretube, axe, alpha*math.pi/180.)
+ geompy.addToStudy(wiretube, 'wiretubePlace' )
+ facetubel = geompy.MakeRotation(facetubel, OZ, azimut*math.pi/180.)
+ facetubel = geompy.MakeTranslation(facetubel, 0, 0, -l_tube_p1)
+ facetubel = geompy.MakeRotation(facetubel, axe, alpha*math.pi/180.)
+ geompy.addToStudy(facetubel, 'facetubeGauche' )
+ facetuber = geompy.MakeRotation(facetuber, OZ, azimut*math.pi/180.)
+ facetuber = geompy.MakeTranslation(facetuber, 0, 0, -l_tube_p1)
+ facetuber = geompy.MakeRotation(facetuber, axe, alpha*math.pi/180.)
+ geompy.addToStudy(facetuber, 'facetubeDroit' )
+ planfiss = geompy.MakeRotation(plan0, OZ, azimut*math.pi/180.)
+ planfiss = geompy.MakeTranslation(planfiss, 0, 0, -l_tube_p1)
+ planfiss = geompy.MakeRotation(planfiss, axe, alpha*math.pi/180.)
+ geompy.addToStudy(planfiss, 'planfissPlace' )
+ pipefissl = geompy.MakePipe(facetubel, arcl)
+ pipefissi = geompy.MakePipe(facetubel, arci)
+ pipefissr = geompy.MakePipe(facetuber, arcr)
+ pipefiss = geompy.MakePartition([pipefissl, pipefissi, pipefissr], [planfiss, wiretube], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+ geompy.addToStudy(pipefiss, 'pipefissPlace' )
+
+
+ elif self.longitudinale:
+ if externe:
+ raybor = r_cintr + de/2.
+ rayint = raybor - profondeur
+ rayext = raybor + profondeur
+ else:
+ rayext = r_cintr + de/2. - epais
+ rayint = raybor + profondeur
+ rayext = raybor - profondeur
+ lgfond = longueur -2*profondeur
+ angle = lgfond/(2*raybor)
+ pb = geompy.MakeVertex(-raybor, 0, 0)
+ pi = geompy.MakeVertex(-rayint, 0, 0)
+ pe = geompy.MakeVertex(-rayext, 0, 0)
+ pl = geompy.MakeVertex(-raybor, 0, -profondeur)
+ pr = geompy.MakeVertex(-raybor, 0, profondeur)
+ pil = geompy.MakeRotation(pi, OY, -angle)
+ pll = geompy.MakeRotation(pl, OY, -angle)
+ pel = geompy.MakeRotation(pe, OY, -angle)
+ pir = geompy.MakeRotation(pi, OY, angle)
+ prr = geompy.MakeRotation(pr, OY, angle)
+ per = geompy.MakeRotation(pe, OY, angle)
+ arcl = geompy.MakeArc(pil, pll, pel)
+ arcr = geompy.MakeArc(pir, prr, per)
+ arci = geompy.MakeArc(pil, pi, pir)
+ arce = geompy.MakeArc(pel, pe, per)
+ geompy.addToStudy( arcl, 'arcl' )
+ geompy.addToStudy( arcr, 'arcr' )
+ geompy.addToStudy( arci, 'arci' )
+ geompy.addToStudy( arce, 'arce' )
+ wire0 = geompy.MakeWire([arcr, arci, arcl])
+ cercle0 = geompy.MakeCircle(O, OZ, profondeur/4.0)
+ #cercle0 = geompy.MakeRotation(cercle0, OZ, math.pi/2.0)
+ cercle0 = geompy.MakeTranslationTwoPoints(cercle0, O, pi)
+ geompy.addToStudy( cercle0, 'cercle0' )
+ facetube0 = geompy.MakeFaceWires([cercle0], 1)
+ facetubel = geompy.MakeRotation(facetube0, OY, -angle)
+ facetuber = geompy.MakeRotation(facetube0, OY, angle)
+ geompy.addToStudy(facetubel , 'facetubel' )
+ geompy.addToStudy( facetuber, 'facetuber' )
+ face0 = geompy.MakeFaceWires([arcl,arci, arce, arcr], 1)
+ plan0 = geompy.MakePlane(O, OY, 10000)
+ geompy.addToStudy( face0, 'facefissOrig' )
+ facefiss = geompy.MakeRotation(face0, OY, alpha*math.pi/180.)
+ geompy.addToStudy( facefiss, 'facefissPlace' )
+ centre = geompy.MakeRotation(pb, OY, alpha*math.pi/180.)
+ geompy.addToStudy( centre, 'centrefissPlace' )
+ arcr = geompy.MakeRotation(arcr, OY, alpha*math.pi/180.)
+ arci = geompy.MakeRotation(arci, OY, alpha*math.pi/180.)
+ arcl = geompy.MakeRotation(arcl, OY, alpha*math.pi/180.)
+ wiretube = geompy.MakeRotation(wire0, OY, alpha*math.pi/180.)
+ geompy.addToStudy(wiretube, 'wiretubePlace' )
+ facetubel = geompy.MakeRotation(facetubel, OY, alpha*math.pi/180.)
+ geompy.addToStudy(facetubel, 'facetubeGauche' )
+ facetuber = geompy.MakeRotation(facetuber, OY, alpha*math.pi/180.)
+ geompy.addToStudy(facetubel, 'facetubeDroit' )
+ planfiss = geompy.MakeRotation(plan0, OY, alpha*math.pi/180.)
+ geompy.addToStudy(planfiss, 'planfissPlace' )
+ pipefissl = geompy.MakePipe(facetubel, arcl)
+ pipefissi = geompy.MakePipe(facetubel, arci)
+ pipefissr = geompy.MakePipe(facetuber, arcr)
+ pipefiss = geompy.MakePartition([pipefissl, pipefissi, pipefissr], [planfiss, wiretube], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+ geompy.addToStudy(pipefiss, 'pipefissPlace' )
+ else:
+ pass
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, 5 ,10)
+
+ return [facefiss, centre, lgInfluence, coordsNoeudsFissure, wiretube, facetubel, facetuber, planfiss, pipefiss]
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegExt = 5,
+ nbsegGen = 25,
+ nbsegRad = 5,
+ scaleRad = 4,
+ nbsegCercle = 6,
+ nbsegFis = 20,
+ lensegEllipso = 1.0)
+
+ # ---------------------------------------------------------------------------
+ def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
+ elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
+ return elementsDefaut
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageFissure(self, geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step):
+ maillageFissure = insereFissureLongue(geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step)
+ return maillageFissure
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Node = 77491,
+ Entity_Quad_Edge = 1006,
+ Entity_Quad_Triangle = 2412,
+ Entity_Quad_Quadrangle = 6710,
+ Entity_Quad_Tetra = 20853,
+ Entity_Quad_Hexa = 8656,
+ Entity_Quad_Penta = 1176,
+ Entity_Quad_Pyramid = 1232)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from fissure_Coude import fissure_Coude
+
+class fissure_Coude_4(fissure_Coude):
+ """
+ probleme de fissure du Coude : ASCOU09A
+ adaptation maillage
+ """
+
+# ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = 40,
+ r_cintr = 654,
+ l_tube_p1 = 1700,
+ l_tube_p2 = 1700,
+ epais = 62.5,
+ de = 912.4)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = 16,
+ n_ep = 5,
+ n_long_coude = 30,
+ n_circ_g = 50,
+ n_circ_d = 20,
+ n_long_p2 = 12)
+
+# ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure
+ profondeur : 0 < profondeur <= épaisseur
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> ellipse, >2*profondeur = fissure longue
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ externe : True : fissure face externe, False : fissure face interne
+ """
+ print "setParamShapeFissure", self.nomCas
+ self.shapeFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ profondeur = 10,
+ azimut = 90,
+ alpha = 20,
+ longueur = 240,
+ orientation = 90,
+ lgInfluence = 30,
+ elliptique = False,
+ convexe = True,
+ externe = True)
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 948,
+ Entity_Quad_Triangle = 1562,
+ Entity_Quad_Edge = 1192,
+ Entity_Quad_Penta = 732,
+ Entity_Quad_Hexa = 22208,
+ Entity_Node = 133418,
+ Entity_Quad_Tetra = 18759,
+ Entity_Quad_Quadrangle = 11852)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy, smesh
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from blocFissure.gmu.fissureGenerique import fissureGenerique
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+
+O, OX, OY, OZ = triedreBase()
+
+class vis_1(fissureGenerique):
+ """
+ problème de fissure non plane, débouchante non normale
+ """
+
+ nomProbleme = "vis_1"
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageSain(self, geometriesSaines, meshParams):
+ logging.info("genereMaillageSain %s", self.nomCas)
+
+ ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests/visSain.med"))
+ smesh.SetName(objetSain.GetMesh(), 'objetSain')
+
+ return [objetSain, True] # True : maillage hexa
+
+ # ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour méthode insereFissureGenerale
+ lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
+ rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
+ convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
+ pointIn_x : optionnel coordonnée x d'un point dans le solide sain (pour orienter la face)
+ """
+ logging.info("setParamShapeFissure %s", self.nomCas)
+ self.shapeFissureParams = dict(lgInfluence = 0.6,
+ rayonPipe = 0.1)
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+
+ lgInfluence = shapeFissureParams['lgInfluence']
+
+ shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/visFiss.brep"), "BREP")
+ fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(fondFiss, [4, 7, 9])
+ geompy.addToStudy( shellFiss, 'shellFiss' )
+ geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
+
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 0.1 ,0.2)
+
+ centre = None
+ return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 32,
+ areteFaceFissure = 0.1)
+
+ # ---------------------------------------------------------------------------
+ def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
+ elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
+ return elementsDefaut
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageFissure(self, geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step):
+ maillageFissure = insereFissureGenerale(maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step)
+ return maillageFissure
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 1284,
+ Entity_Quad_Triangle = 2336,
+ Entity_Quad_Edge = 758,
+ Entity_Quad_Penta = 984,
+ Entity_Quad_Hexa = 6416,
+ Entity_Node = 85673,
+ Entity_Quad_Tetra = 35990,
+ Entity_Quad_Quadrangle = 4285)
+
--- /dev/null
+
+Exécution des exemples et cas tests :
+------------------------------------
+
+- lancer salome
+- exécuter les instructions suivantes dans la console Python embarquée, ou dans une console Python avec l'environnement SALOME
+ # les shapes et fichiers med nécessaires aux tests sont créés dans ${SMESH_ROOT_DIR}/share/salome/plugins/smesh/blocFissure/CasTests
+ # les maillages fissurés sont écrits dans le répertoire d'exécution.
+
+
+# preparation des shapes et fichiers MED
+
+import sys, os
+sys.path.append(os.path.join(os.environ["SMESH_ROOT_DIR"], "share", "salome", "plugins", "smesh"))
+from blocFissure.materielCasTests import genereMateriel
+
+# execution exemples
+
+from blocFissure import exemple
+from blocFissure import exemple
+
+# execution des cas tests
+
+from blocFissure.CasTests import execution_Cas
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy, smesh
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from blocFissure.gmu.fissureGenerique import fissureGenerique
+
+from blocFissure.gmu.initEtude import initEtude
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from blocFissure.gmu.insereFissureGenerale import insereFissureGenerale
+
+O, OX, OY, OZ = triedreBase()
+
+class casStandard(fissureGenerique):
+ """
+ problème de fissure standard, défini par :
+ - un maillage sain (hexaèdres),
+ - une face géométrique de fissure, qui doit légèrement dépasser hors du volume maillé
+ - les numéros d'arêtes (edges géométriques) correspondant au fond de fissure
+ - les paramètres de maillage de la fissure
+ """
+
+ # ---------------------------------------------------------------------------
+ def __init__ (self, dicoParams, references = None, numeroCas = 0):
+ initEtude()
+ self.references = references
+ self.dicoParams = dicoParams
+ if self.dicoParams.has_key('nomCas'):
+ self.nomCas = self.dicoParams['nomCas']
+ else:
+ self.nomCas = 'casStandard'
+ self.numeroCas = numeroCas
+ if self.numeroCas != 0:
+ self.nomCas = self.nomProbleme +"_%d"%(self.numeroCas)
+ else:
+ self.nomProbleme = self.nomCas
+ if self.dicoParams.has_key('lenSegPipe'):
+ self.lenSegPipe = self.dicoParams['lenSegPipe']
+ else:
+ self.lenSegPipe =self.dicoParams['rayonPipe']
+ if self.dicoParams.has_key('step'):
+ step = self.dicoParams['step']
+ else:
+ step = -1 # exécuter toutes les étapes
+ if self.numeroCas == 0: # valeur par défaut : exécution immédiate, sinon execution différée dans le cas d'une liste de problèmes
+ self.executeProbleme(step)
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageSain(self, geometriesSaines, meshParams):
+ logging.info("genereMaillageSain %s", self.nomCas)
+
+ ([objetSain], status) = smesh.CreateMeshesFromMED(self.dicoParams['maillageSain'])
+ smesh.SetName(objetSain.GetMesh(), 'objetSain')
+
+ return [objetSain, True] # True : maillage hexa
+
+ # ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour méthode insereFissureGenerale
+ lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
+ rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
+ convexe : True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
+ pointIn_x : optionnel : coordonnée x d'un point dans le solide sain (pour orienter la face - idem avec y,z)
+ """
+ logging.info("setParamShapeFissure %s", self.nomCas)
+ if self.dicoParams.has_key('pointInterieur'):
+ self.shapeFissureParams = dict(lgInfluence = self.dicoParams['lgInfluence'],
+ rayonPipe = self.dicoParams['rayonPipe'],
+ lenSegPipe = self.lenSegPipe,
+ pointIn_x = self.dicoParams['pointInterieur'][0],
+ pointIn_y = self.dicoParams['pointInterieur'][1],
+ pointIn_z = self.dicoParams['pointInterieur'][2])
+ else:
+ self.shapeFissureParams = dict(lgInfluence = self.dicoParams['lgInfluence'],
+ rayonPipe = self.dicoParams['rayonPipe'],
+ lenSegPipe = self.lenSegPipe)
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+
+ lgInfluence = shapeFissureParams['lgInfluence']
+
+ shellFiss = geompy.ImportFile( self.dicoParams['brepFaceFissure'], "BREP")
+ fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(fondFiss, self.dicoParams['edgeFissIds'] )
+ geompy.addToStudy( shellFiss, 'shellFiss' )
+ geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
+
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, self.dicoParams['meshBrep'][0] ,self.dicoParams['meshBrep'][1])
+
+ centre = None
+ return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = self.dicoParams['nbSegRad'],
+ nbsegCercle = self.dicoParams['nbSegCercle'],
+ areteFaceFissure = self.dicoParams['areteFaceFissure'])
+
+ # ---------------------------------------------------------------------------
+ def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
+ elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
+ return elementsDefaut
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageFissure(self, geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step):
+ maillageFissure = insereFissureGenerale(maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step)
+ return maillageFissure
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ if self.references is not None:
+ self.referencesMaillageFissure = self.references
+ else:
+ self.referencesMaillageFissure = dict(Entity_Quad_Pyramid = 0,
+ Entity_Quad_Triangle = 0,
+ Entity_Quad_Edge = 0,
+ Entity_Quad_Penta = 0,
+ Entity_Quad_Hexa = 0,
+ Entity_Node = 0,
+ Entity_Quad_Tetra = 0,
+ Entity_Quad_Quadrangle = 0)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu import initLog
+initLog.setDebug()
+#initLog.setVerbose()
+
+from blocFissure.casStandard import casStandard
+
+dicoParams = dict(nomCas = 'angleCube',
+ maillageSain = os.path.join(gmu.pathBloc, 'materielCasTests/CubeAngle.med'),
+ brepFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep"),
+ edgeFissIds = [4],
+ lgInfluence = 20,
+ meshBrep = (5,10),
+ rayonPipe = 5,
+ lenSegPipe = 2.5,
+ nbSegRad = 5,
+ nbSegCercle = 32,
+ areteFaceFissure = 10)
+
+execInstance = casStandard(dicoParams)
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+import salome_notebook
+notebook = salome_notebook.NoteBook(theStudy)
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
+Vertex_1 = geompy.MakeVertex(0, 0, 100)
+Disk_1 = geompy.MakeDiskPntVecR(Vertex_1, OZ, 50)
+Rotation_1 = geompy.MakeRotation(Box_1, OZ, 45*math.pi/180.0)
+geompy.TranslateDXDYDZ(Rotation_1, -50, -250, 0)
+Cut_1 = geompy.MakeCut(Disk_1, Rotation_1)
+geompy.Export(Cut_1, "disk.brep", "BREP")
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( Box_1, 'Box_1' )
+geompy.addToStudy( Vertex_1, 'Vertex_1' )
+geompy.addToStudy( Disk_1, 'Disk_1' )
+geompy.addToStudy( Rotation_1, 'Rotation_1' )
+geompy.addToStudy( Cut_1, 'Cut_1' )
+
+###
+### SMESH component
+###
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+
+smesh = smeshBuilder.New(theStudy)
+from salome.StdMeshers import StdMeshersBuilder
+boite = smesh.Mesh(Box_1)
+Regular_1D = boite.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(15)
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = boite.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+Hexa_3D = boite.Hexahedron(algo=smeshBuilder.Hexa)
+isDone = boite.Compute()
+smesh.SetName(boite, 'boite')
+boite.ExportMED( r'boite.med', 0, SMESH.MED_V2_2, 1 )
+
+## set object names
+smesh.SetName(boite.GetMesh(), 'boite')
+smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
+smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
+
+import os
+from blocFissure import gmu
+from blocFissure.gmu import initLog
+#initLog.setDebug()
+initLog.setVerbose()
+
+from blocFissure.casStandard import casStandard
+
+dicoParams = dict(nomCas = 'angleCube2',
+ maillageSain = 'boite.med',
+ brepFaceFissure = "disk.brep",
+ edgeFissIds = [4],
+ lgInfluence = 20,
+ meshBrep = (5,10),
+ rayonPipe = 10,
+ nbSegRad = 5,
+ nbSegCercle = 8,
+ areteFaceFissure = 10)
+
+execInstance = casStandard(dicoParams)
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
--- /dev/null
+# Copyright (C) 2012-2014 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# --- scripts ---
+
+# scripts / static
+SET(plugin_SCRIPTS
+ __init__.py
+ blocDefaut.py
+ checkDecoupePartition.py
+ commonSubShapes.py
+ creeZoneDefautDansObjetSain.py
+ creeZoneDefautFilling.py
+ creeZoneDefautGeom.py
+ creeZoneDefautMaillage.py
+ distance2.py
+ eliminateDoubles.py
+ ellipsoideDefaut.py
+ enleveDefaut.py
+ extractionOrienteeMulti.py
+ extractionOrientee.py
+ facesCirculaires.py
+ facesFissure.py
+ facesToreInBloc.py
+ facesVolumesToriques.py
+ findWireEndVertices.py
+ findWireIntermediateVertices.py
+ fissureCoude.py
+ fissureGenerique.py
+ genereElemsFissureElliptique.py
+ genereMeshCalculZoneDefaut.py
+ geomsmesh.py
+ getCentreFondFiss.py
+ getStatsMaillageFissure.py
+ getSubshapeIds.py
+ initEtude.py
+ initLog.py
+ insereFissureElliptique.py
+ insereFissureGenerale.py
+ insereFissureLongue.py
+ meshBlocPart.py
+ orderEdgesFromWire.py
+ partitionBlocDefaut.py
+ partitionVolumeSain.py
+ peauInterne.py
+ produitMixte.py
+ projettePointSurCourbe.py
+ prolongeVertices.py
+ prolongeWire.py
+ propagateTore.py
+ putName.py
+ quadranglesToShape.py
+ regroupeSainEtDefaut.py
+ rotTrans.py
+ shapesSurFissure.py
+ shapeSurFissure.py
+ sortEdges.py
+ sortFaces.py
+ sortGeneratrices.py
+ sortSolids.py
+ substractSubShapes.py
+ testgmu.py
+ toreFissure.py
+ triedreBase.py
+ whichSideMulti.py
+ whichSide.py
+ whichSideVertex.py
+)
+
+# --- rules ---
+
+SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/gmu)
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import os
+import initLog
+#initLog.setDebug()
+#initLog.setVerbose()
+#initLog.setRelease()
+
+# --- calcul path blocFissure
+
+apath = initLog.__file__
+isabs = os.path.isabs(apath)
+pathGmu = os.path.split(apath)[0]
+if isabs:
+ pathBloc = os.path.join(pathGmu, '..')
+else:
+ pathBloc = os.path.join(os.getcwd(), pathGmu, '..')
+pathBloc = os.path.normpath(pathBloc)
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- bloc defaut
+
+def blocDefaut(blocDim):
+ """
+ Le bloc contenant la fissure est un cube construit centre a l'origine, dont on donne la demi arete.
+ @param blocdim : demi arete
+ @return cube (geomObject)
+ """
+ logging.info("start")
+ geomObj_1 = geompy.MakeVertex(-blocDim, -blocDim, -blocDim)
+ geomObj_2 = geompy.MakeVertex( blocDim, blocDim, blocDim)
+ Box = geompy.MakeBoxTwoPnt(geomObj_1, geomObj_2)
+ #geompy.addToStudy( Box_1, 'Box_1' )
+ return Box
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- teste si l'opération de partition a produit une modification
+
+def checkDecoupePartition(shapes, part):
+ """
+ Teste si l'opération de partition a produit une découpe
+ (plus de shapes dans la partition).
+ Résultat non garanti si recouvrement des shapes d'origine.
+ @param shapes : liste des shapes d'origine
+ @param part : résultat de la partition
+ @return True si la partition a découpé les shapes d'origine
+ """
+ logging.info('start')
+ # TODO: ShapeInfo donne des résultats faux (deux faces au lieu de une)
+
+ isPart = False
+ orig = {}
+ for shape in shapes:
+ info = geompy.ShapeInfo(shape)
+ logging.debug("shape info %s", info)
+ for k in ['VERTEX', 'EDGE', 'FACE', 'SOLID']:
+ if k in orig.keys():
+ orig[k] += info[k]
+ else:
+ orig[k] = info[k]
+ logging.debug("original shapes info %s", orig)
+ info = geompy.ShapeInfo(part)
+ logging.debug("partition info %s", info)
+ for k in ['VERTEX', 'EDGE', 'FACE', 'SOLID']:
+ if orig[k] < info[k]:
+ isPart = True
+ break
+ logging.debug("partition modifie l'original %s", isPart)
+
+ return isPart
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- subShapes communes à deux listes
+
+def commonSubShapes(obj, sub1, sub2):
+ """
+ liste de subshapes communes
+ """
+ logging.info("start")
+ idsub1 = {}
+ subList = []
+ for s in sub1:
+ idsub1[geompy.GetSubShapeID(obj, s)] = s
+ for s in sub2:
+ idsub = geompy.GetSubShapeID(obj, s)
+ if idsub in idsub1.keys():
+ subList.append(s)
+ logging.debug("subList=%s", subList)
+ return subList
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import smesh
+import SMESH
+import SALOMEDS
+
+from creeZoneDefautMaillage import creeZoneDefautMaillage
+from peauInterne import peauInterne
+from quadranglesToShape import quadranglesToShape
+from creeZoneDefautFilling import creeZoneDefautFilling
+from creeZoneDefautGeom import creeZoneDefautGeom
+from getCentreFondFiss import getCentreFondFiss
+
+# -----------------------------------------------------------------------------
+# ---
+
+def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure,
+ shapeFissureParams, maillageFissureParams):
+ """
+ TODO: a compléter
+ """
+ logging.info('start')
+
+ #smesh.SetCurrentStudy(salome.myStudy)
+
+ geometrieSaine = geometriesSaines[0]
+ maillageSain = maillagesSains[0]
+ isHexa = maillagesSains[1]
+ shapeDefaut = shapesFissure[0]
+ tailleDefaut = shapesFissure[2]
+ coordsNoeudsFissure = shapesFissure[3]
+
+ isElliptique = False
+ if shapeFissureParams.has_key('elliptique'):
+ isElliptique = shapeFissureParams['elliptique']
+ if isElliptique:
+ if shapeFissureParams.has_key('demiGrandAxe'):
+ demiGrandAxe = shapeFissureParams['demiGrandAxe']
+ else:
+ demiGrandAxe = shapeFissureParams['longueur']
+ lgExtrusion = 2.0*demiGrandAxe
+ else:
+ lgExtrusion = 50.
+
+ nomRep = maillageFissureParams['nomRep']
+ nomFicSain = maillageFissureParams['nomFicSain']
+
+ fichierMaillageSain = nomRep + '/' + nomFicSain + '.med'
+
+ # --- centre de fond de fissure et tangente
+
+ edgeFondExt, centreFondFiss, tgtCentre = getCentreFondFiss(shapesFissure)
+
+
+ # --- zone de défaut
+ nomZones = "zoneDefaut"
+
+ [origShapes, verticesShapes, dmoyen] = \
+ creeZoneDefautMaillage(maillagesSains, shapeDefaut, tailleDefaut, nomZones, coordsNoeudsFissure)
+
+ maillageSain.ExportMED( fichierMaillageSain, 0, SMESH.MED_V2_2, 1 )
+ logging.debug("fichier maillage sain %s", fichierMaillageSain)
+ [maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges] = \
+ peauInterne(fichierMaillageSain, nomZones)
+
+ facesDefaut = []
+ centresDefaut = []
+ normalsDefaut =[]
+ extrusionsDefaut = []
+ isPlane = False
+ if isHexa and not isPlane:
+ meshQuad = smesh.CopyMesh( zoneDefaut_skin, 'meshQuad', 0, 0)
+ fillings, noeuds_bords, bordsPartages, fillconts, idFilToCont = quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss)
+ for filling in fillings:
+ [faceDefaut, centreDefaut, normalDefaut, extrusionDefaut] = \
+ creeZoneDefautFilling(filling, shapeDefaut, lgExtrusion)
+ facesDefaut.append(faceDefaut)
+ centresDefaut.append(centreDefaut)
+ normalsDefaut.append(normalDefaut)
+ extrusionsDefaut.append(extrusionDefaut)
+ else:
+ [facesDefaut, centreDefaut, normalDefaut, extrusionDefaut] = \
+ creeZoneDefautGeom( geometrieSaine, shapeDefaut, origShapes, verticesShapes, dmoyen, lgExtrusion)
+ bordsPartages =[]
+ for face in facesDefaut:
+ bordsPartages.append([None,None]) # TODO : traitement des arêtes vives ?
+ fillconts = facesDefaut
+ idFilToCont = range(len(facesDefaut))
+
+ return [facesDefaut, centresDefaut, normalsDefaut, extrusionsDefaut, dmoyen, bordsPartages, fillconts, idFilToCont,
+ maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges,
+ edgeFondExt, centreFondFiss, tgtCentre]
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- crée zone géométrique défaut a partir d'un filling
+
+def creeZoneDefautFilling(filling, shapeDefaut, lgExtrusion=50):
+ """
+ Construction CAO de la zone à remailler, quand on utilise un filling,
+ après appel creeZoneDefautMaillage et quadranglesToShape
+ @param filling : la CAO de la peau du défaut reconstituée
+ @param shapeDefaut : objet géométrique représentant la fissure
+ (selon les cas, un point central, ou une shape plus complexe,
+ dont on ne garde que les vertices)
+ @return (facesDefaut = filling, centreDefaut, normalDefaut, extrusionDefaut)
+ """
+ logging.info("start")
+
+ trace = True
+ facesDefaut = filling
+ centreSphere = geompy.MakeCDG(shapeDefaut)
+ geompy.addToStudy(centreSphere, "cdg_defaut")
+ centreDefaut = geompy.MakeProjection(centreSphere, filling)
+ if trace:
+ geompy.addToStudy(centreDefaut, "centreDefaut")
+ normalDefaut = geompy.GetNormal(filling, centreDefaut)
+ if trace:
+ geompy.addToStudy(normalDefaut, "normalDefaut")
+ extrusionDefaut = geompy.MakePrismVecH(filling, normalDefaut, -lgExtrusion)
+ if trace:
+ geompy.addToStudy(extrusionDefaut, "extrusionDefaut")
+
+ return facesDefaut, centreDefaut, normalDefaut, extrusionDefaut
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+from prolongeVertices import prolongeVertices
+
+# -----------------------------------------------------------------------------
+# --- zone de defaut, constructions geometrique avec CAO d'origine
+
+def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoyen, lgExtrusion=50):
+ """
+ Construction CAO de la zone à remailler, quand on utilise la CAO d'origine,
+ apres appel creeZoneDefautMaillage
+ @param objetSain : la géometrie de l'objet initial
+ @param shapeDefaut : objet géometrique représentant la fissure
+ (selon les cas, un point central, ou une shape plus complexe,
+ dont on ne garde que les vertices)
+ @param origShapes : liste id subShapes
+ @param verticesShapes : listes noeuds de bord
+ @param dmoyen : longueur arete moyenne bord
+ @lgExtrusion : distance d'extrusion de la face du defaut
+ (ne vaut que pour des fissures courtes)
+ @return (facesDefaut, centreDefaut, normalDefaut, extrusionDefaut)
+ """
+ logging.info("start")
+
+ trace = True
+ faces = []
+ curves = []
+ cdgs = []
+ projs = []
+ normals = []
+ extrusions = []
+ partitions = []
+ decoupes = []
+
+ for ishape, vertices in enumerate(verticesShapes):
+ aShape = origShapes[ishape]
+ [face] = geompy.SubShapes(objetSain, [aShape])
+ faces.append(face)
+ curve = geompy.MakePolyline(vertices, False)
+ curves.append(curve)
+ if trace:
+ name="poly_%d"%aShape
+ geompy.addToStudy(curve, name)
+ #
+ cdg = geompy.MakeCDG(curve)
+ cdgs.append(cdg)
+ if trace:
+ name="cdgpoly_%d"%aShape
+ geompy.addToStudy(cdg, name)
+ #
+ projCdg = geompy.MakeProjection(cdg, face)
+ projs.append(projCdg)
+ if trace:
+ name="projCdg_%d"%aShape
+ geompy.addToStudy(projCdg, name)
+ #
+ normal = geompy.GetNormal(face, projCdg)
+ normals.append(normal)
+ if trace:
+ name="normal_%d"%aShape
+ geompy.addToStudy(normal, name)
+ #
+ extrusion = geompy.MakePrismVecH2Ways(curve, normal, 10)
+ extrusions.append(extrusion)
+ if trace:
+ name="extrusion_%d"%aShape
+ geompy.addToStudy(extrusion, name)
+ #
+ verticesProlongees = prolongeVertices(vertices)
+ #
+ curveprol = geompy.MakePolyline(verticesProlongees, False)
+ if trace:
+ name="polyProl_%d"%aShape
+ geompy.addToStudy(curveprol, name)
+ #
+ extruprol = geompy.MakePrismVecH2Ways(curveprol, normal, 10)
+ if trace:
+ name="extruProl_%d"%aShape
+ geompy.addToStudy(extruprol, name)
+ #
+ partition = geompy.MakePartition([face], [extruprol], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ partitions.append(partition)
+ if trace:
+ name="partition_%d"%aShape
+ geompy.addToStudy(partition, name)
+ pass
+ #
+
+ centreSphere = geompy.MakeCDG(shapeDefaut)
+ geompy.addToStudy(centreSphere, "cdg_defaut")
+ ccurves = geompy.MakeCompound(curves)
+ gravCenter = geompy.MakeCDG(ccurves)
+ geompy.addToStudy(gravCenter, "cdg_curves")
+ for i in range(len(partitions)):
+ if trace:
+ logging.debug(" --- original shape %s", origShapes[i])
+ dists = []
+ facesToSort = []
+ subFaces = geompy.ExtractShapes(partitions[i], geompy.ShapeType["FACE"], True)
+ for aFace in subFaces:
+ cdg = geompy.MakeCDG(aFace)
+ distance = geompy.MinDistance(cdg, centreSphere)
+ dists.append(distance)
+ facesToSort.append(aFace)
+ if trace:
+ logging.debug("distance = %s", distance)
+ pass
+ pass
+ if len(dists) > 0:
+ minDist = min(dists)
+ for j,d in enumerate(dists):
+ if d == minDist:
+ aFace = facesToSort[j]
+ name="decoupe_%d"%origShapes[i]
+ geompy.addToStudy(aFace, name)
+ decoupes.append(aFace)
+ break
+ pass
+ pass
+
+ facesDefaut = decoupes[0]
+ if len(decoupes) > 1:
+ facesDefaut = geompy.MakePartition(decoupes, [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ geompy.addToStudy(facesDefaut, "facesDefaut")
+
+ shells=[]
+ if len(decoupes) > 1: # plusieurs faces de defaut
+ subFaces = geompy.ExtractShapes(facesDefaut, geompy.ShapeType["FACE"], True)
+ # --- regroupe les subFaces en shells connectes
+ theFaces = list(subFaces) # copy
+ while len(theFaces) > 0:
+ logging.debug("------- len(theFaces) %s" , len(theFaces))
+ theFace = theFaces[0]
+ logging.debug(" start with face %s",theFaces[0])
+ theFaces[0:1] = []
+ aShell = [theFace]
+ toAdd =[theFace]
+ while len(toAdd) > 0:
+ toAdd = []
+ toRemove = []
+ for i in range(len(theFaces)):
+ logging.debug(" try %s", theFaces[i])
+ for aFace in aShell:
+ logging.debug(" with %s", aFace)
+ try:
+ edge = geompy.GetSharedShapesMulti([aFace, theFaces[i]], geompy.ShapeType["EDGE"])
+ edgeShared = True
+ except:
+ edgeShared = False
+ if edgeShared:
+ if theFaces[i] not in toAdd:
+ toAdd.append(theFaces[i])
+ toRemove.append(i)
+ logging.debug(" --- add %s", theFaces[i])
+ aShell += toAdd
+ for k in sorted(toRemove, reverse=True):
+ theFaces[k:k+1] = []
+ theShell = geompy.MakeShell(aShell)
+ name = "theShell%d"%len(shells)
+ geompy.addToStudy(theShell,name)
+ shells.append(theShell)
+ #
+ distances = []
+ for aShell in shells: # --- trouver le shell en contact avec la fissure
+ distances.append(geompy.MinDistance(aShell, shapeDefaut))
+ minDist = min(distances)
+ for index in range(len(distances)):
+ if distances[index] == minDist:
+ break
+ theShellDefaut = shells[index]
+ #
+ else: # --- une seule face de defaut
+ subFaces = [facesDefaut]
+ theShellDefaut = geompy.MakeShell(subFaces)
+ if trace:
+ geompy.addToStudy(theShellDefaut,"theShellDefaut")
+
+ theFaces = geompy.ExtractShapes(theShellDefaut, geompy.ShapeType["FACE"], True)
+ distances = []
+ for aFace in theFaces:
+ distances.append(geompy.MinDistance(aFace, centreSphere))
+ minDist = min(distances)
+ for index in range(len(distances)):
+ if distances[index] == minDist:
+ break
+
+ centreDefaut = geompy.MakeProjection(centreSphere, theFaces[index])
+ if trace:
+ geompy.addToStudy(centreDefaut, "centreDefaut")
+ normalDefaut = geompy.GetNormal(subFaces[index], centreDefaut)
+ if trace:
+ geompy.addToStudy(normalDefaut, "normalDefaut")
+ extrusionDefaut = geompy.MakePrismVecH(theShellDefaut, normalDefaut, -lgExtrusion)
+ info = geompy.ShapeInfo(extrusionDefaut)
+ logging.debug("shape info %s", info)
+ if (info['SOLID'] > 1) or (info['COMPOUND'] > 0) :
+ solids = geompy.ExtractShapes(extrusionDefaut, geompy.ShapeType["SOLID"], True)
+ solid0 = solids[0]
+ for i in range(1,len(solids)):
+ solid0 = geompy.MakeFuse(solid0, solids[i])
+ extrusionDefaut = solid0
+ if trace:
+ geompy.addToStudy(extrusionDefaut, "extrusionDefaut")
+
+ return facesDefaut, centreDefaut, normalDefaut, extrusionDefaut
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+import math
+from distance2 import distance2
+
+# -----------------------------------------------------------------------------
+# --- zone de defaut extraite du maillage
+
+def creeZoneDefautMaillage(maillagesSains, shapeDefaut, tailleDefaut,
+ nomZones, coordsNoeudsFissure):
+ """
+ Identification de la zone à remailler, opérations sur le maillage
+ de l'objet sain
+ La zone à remailler est définie à partir d'un objet géométrique
+ ou à partir d'un jeu de points et d'une distance d'influence.
+ @param maillagesSains : (le maillage de l'objet initial, booleen isHexa)
+ @param shapeDefaut : objet géométrique représentant la fissure
+ (selon les cas, un point central, ou une shape plus complexe,
+ dont on ne garde que les vertices)
+ @param tailleDefaut : distance d'influence définissant la zone à remailler:
+ tous les éléments du maillage initial qui pénètrent dans cette zone
+ sont détectés
+ @param nomZones : préfixe des noms de groupes créés dans le maillage initial. S'il y a un groupe de noeuds
+ @coordsNoeudsFissure : jeu de points donné par une liste (x1,y1,z1, x2,y2,z2, ...)
+ @return (origShapes, verticesShapes, dmoyen) liste id subShapes,
+ listes noeuds de bord, longueur arête moyenne bord
+ """
+ logging.info("start")
+
+ maillageSain = maillagesSains[0]
+ isHexa = maillagesSains[1]
+ lists = maillageSain.CreateHoleSkin(tailleDefaut, shapeDefaut, nomZones, coordsNoeudsFissure)
+
+ logging.debug("lists=%s", lists)
+
+ trace = True
+ origShapes = []
+ verticesShapes = []
+
+ cumul = 0 # somme des distances carrées entre point ordonnés (taille des arêtes)
+ nb = 0 # nombre d'arêtes évaluées
+
+ for aList in lists:
+ aShape = aList[0]
+ origShapes.append(aShape)
+ logging.debug(" shapeId %s", aShape)
+ vertices = []
+ xyz0 = None
+ for inode in range(1, len(aList)):
+ xyz = maillageSain.GetNodeXYZ(aList[inode])
+ if xyz0 is not None:
+ cumul += distance2(xyz, xyz0)
+ nb += 1
+ xyz0 = xyz
+ #logging.debug(" node %s %s", aList[inode], xyz)
+ vertices.append(geompy.MakeVertex(xyz[0], xyz[1], xyz[2]))
+ pass
+ verticesShapes.append(vertices)
+ pass
+
+ dmoyen = math.sqrt(cumul/nb) # ~ taille de l'arête moyenne du maillage global
+ return origShapes, verticesShapes, dmoyen
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+
+# -----------------------------------------------------------------------------
+# --- calcul de distance carree entre deux points, jeux de coordonnees x,y,z
+
+def distance2(xyz1, xyz2):
+ """
+ carré de la distance entre deux points donnés par des triplets [x,y,z]
+ """
+ #logging.info("start")
+
+ d2 = 0
+ for i in range(3):
+ d2 += (xyz1[i]-xyz2[i])*(xyz1[i]-xyz2[i])
+ logging.debug('d2=%s', d2)
+ return d2
+
+# -----------------------------------------------------------------------------
+# --- test unitaire
+
+import unittest
+class Test_distance2(unittest.TestCase):
+
+ def setUp(self):
+ self.a=[0, 0, 0]
+ self.b=[3, 4, 5]
+ self.c=[-5,-4,-3]
+
+ def test_calcul(self):
+ self.assertEqual(distance2(self.a, self.b), distance2(self.b, self.a))
+ self.assertEqual(distance2(self.a, self.b), distance2(self.a, self.c))
+ self.assertEqual(distance2(self.b, self.b), 0)
+ self.assertEqual(distance2(self.a, self.b), 50)
+
\ No newline at end of file
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- éliminer les doublons d'une liste de subshapes
+
+def eliminateDoubles(obj, subshapes):
+ """
+ éliminer les doublons d'une liste de subshapes
+ """
+ idsubs = {}
+ for sub in subshapes:
+ subid = geompy.GetSubShapeID(obj, sub)
+ if subid in idsubs.keys():
+ idsubs[subid].append(sub)
+ else:
+ idsubs[subid] = [sub]
+ shortList = []
+ for k, v in idsubs.iteritems():
+ shortList.append(v[0])
+ logging.debug("shortList=%s", shortList)
+ return shortList
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+import math
+from geomsmesh import geompy
+from triedreBase import triedreBase
+O, OX, OY, OZ = triedreBase()
+
+# -----------------------------------------------------------------------------
+# --- ellipsoide defaut
+
+def ellipsoideDefaut(minRad,allonge,rayTore):
+ """
+ Le bloc contenant la fissure est un ellipsoide construit centre a l'origine,
+ contenant le tore elliptique de fissure
+ @param minRad :petit rayon
+ @param allonge :rapport grand rayon / petit rayon
+ @param rayTore :rayon du tore construit autour de la generatrice de l'ellipse
+ @return ellipsoide (geomObject)
+ """
+ logging.info("start")
+ boule = geompy.MakeSphereR(2)
+ bouler = geompy.MakeRotation(boule, OY, math.pi/2.0)
+ face = geompy.MakeFaceHW(100, 100, 3)
+ boulepart = geompy.MakePartition([bouler], [face], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+ solids = geompy.ExtractShapes(boulepart, geompy.ShapeType["SOLID"], True)
+ solid0 = solids[0]
+ for i in range(1,len(solids)):
+ solid0 = geompy.MakeFuse(solid0, solids[i])
+ ellipsoide = geompy.MakeScaleAlongAxes(solid0, O, minRad, minRad*(allonge+2.0)/2.0, minRad) # on limite l'allongement de l'ellipsoide
+ #geompy.addToStudy( ellipsoide, 'ellipsoide' )
+ return ellipsoide
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+
+# -----------------------------------------------------------------------------
+# --- maillage sain sans la zone defaut
+
+def enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges):
+ """
+ Maillage sain sans la zone de defaut
+ TODO: a completer
+ """
+ logging.info('start')
+
+ maillageSain.RemoveGroupWithContents(zoneDefaut)
+ if zoneDefaut_skin is not None:
+ maillageSain.RemoveGroupWithContents(zoneDefaut_skin)
+ if zoneDefaut_internalFaces is not None:
+ maillageSain.RemoveGroupWithContents(zoneDefaut_internalFaces)
+ if zoneDefaut_internalEdges is not None:
+ maillageSain.RemoveGroupWithContents(zoneDefaut_internalEdges)
+ nbRemoved = maillageSain.RemoveOrphanNodes()
+ return maillageSain
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+from whichSide import whichSide
+
+# -----------------------------------------------------------------------------
+# --- renvoie l'extraction des shapes d'un objet selon leur position par rapport à la face.
+
+def extractionOrientee(face, obj, ref, shapeType, tol, prefix=""):
+ """
+ renvoie l'extraction des shapes d'un objet selon leur position
+ par rapport à la face.
+ shapeType in ["VERTEX", "EDGE", "FACE",...]
+ """
+ logging.info('start')
+ trace = True
+ sideRef = whichSide(face, ref)
+ logging.debug("ref side %s", sideRef)
+ shapesInside = []
+ shapesOutside = []
+ shapesOnside = []
+ shapes = geompy.ExtractShapes(obj, geompy.ShapeType[shapeType], False)
+ i=0
+ j=0
+ k=0
+ prefix = prefix + shapeType
+ for shape in shapes:
+ side = whichSide(face, shape, tol)
+ if side == sideRef:
+ shapesInside.append(shape)
+ if trace:
+ name = prefix + "_Inside%d"%i
+ geompy.addToStudyInFather(obj, shape, name)
+ i+=1
+ elif side == -sideRef:
+ shapesOutside.append(shape)
+ if trace:
+ name = prefix + "_Outside%d"%j
+ geompy.addToStudyInFather(obj, shape, name)
+ j+=1
+ elif side == 0:
+ shapesOnside.append(shape)
+ if trace:
+ name = prefix + "_Onside%d"%k
+ geompy.addToStudyInFather(obj, shape, name)
+ k+=1
+ logging.debug("--- shape was %s", name)
+ return [shapesInside, shapesOutside, shapesOnside]
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+from whichSideMulti import whichSideMulti
+
+# -----------------------------------------------------------------------------
+# --- renvoie l'extraction des shapes d'un objet selon leur position par rapport à la face.
+
+def extractionOrienteeMulti(faces, ifil, obj, centre, shapeType, tol, prefix=""):
+ """
+ renvoie l'extraction des shapes d'un objet selon leur position
+ par rapport aux faces.
+ shapeType in ["VERTEX", "EDGE", "FACE",...]
+ """
+ logging.info('start')
+ trace = True
+ shapesInside = []
+ shapesOutside = []
+ shapesOnside = []
+ shapes = geompy.ExtractShapes(obj, geompy.ShapeType[shapeType], False)
+ i=0
+ j=0
+ k=0
+ prefix = prefix + shapeType
+ for shape in shapes:
+ side = whichSideMulti(faces, ifil, shape, centre, tol)
+ if side == 1:
+ shapesInside.append(shape)
+ if trace:
+ name = prefix + "_Inside%d"%i
+ geompy.addToStudyInFather(obj, shape, name)
+ i+=1
+ elif side == -1:
+ shapesOutside.append(shape)
+ if trace:
+ name = prefix + "_Outside%d"%j
+ geompy.addToStudyInFather(obj, shape, name)
+ j+=1
+ elif side == 0:
+ shapesOnside.append(shape)
+ if trace:
+ name = prefix + "_Onside%d"%k
+ geompy.addToStudyInFather(obj, shape, name)
+ k+=1
+ logging.debug("--- shape was %s", name)
+ return [shapesInside, shapesOutside, shapesOnside]
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- TORE
+## --- faces 1/2 circulaires et leur centre, edges de ces faces dans le plan de fissure
+
+def facesCirculaires(bloc, tore):
+ """
+ Extraction des faces demi circulaires à l'intersection du tore partitionné et de la paroi,
+ de leur centre, les edges de ces faces situees dans le plan de fissure et un booleen par edge,
+ indiquant son sens (normal / reversed).
+ @param bloc : bloc defaut
+ @param tore : le tore partitionné et coupé
+ @return (faces, centres, edges, reverses)
+ """
+ logging.info("start")
+
+ faces = geompy.GetShapesOnShape(bloc, tore, geompy.ShapeType["FACE"], GEOM.ST_ON)
+
+ geompy.addToStudyInFather( tore, faces[0], 'face0' )
+ geompy.addToStudyInFather( tore, faces[1], 'face1' )
+ geompy.addToStudyInFather( tore, faces[2], 'face2' )
+ geompy.addToStudyInFather( tore, faces[3], 'face3' )
+
+ centres = [None, None, None, None]
+ [v1,centres[0],v3] = geompy.ExtractShapes(faces[0], geompy.ShapeType["VERTEX"], True)
+ [v1,centres[1],v3] = geompy.ExtractShapes(faces[1], geompy.ShapeType["VERTEX"], True)
+ [v1,centres[2],v3] = geompy.ExtractShapes(faces[2], geompy.ShapeType["VERTEX"], True)
+ [v1,centres[3],v3] = geompy.ExtractShapes(faces[3], geompy.ShapeType["VERTEX"], True)
+
+ geompy.addToStudyInFather( faces[0], centres[0], 'centre0' )
+ geompy.addToStudyInFather( faces[1], centres[1], 'centre1' )
+ geompy.addToStudyInFather( faces[2], centres[2], 'centre2' )
+ geompy.addToStudyInFather( faces[3], centres[3], 'centre3' )
+
+ alledges = [None, None, None, None]
+ alledges[0] = geompy.ExtractShapes(faces[0], geompy.ShapeType["EDGE"], True)
+ alledges[1] = geompy.ExtractShapes(faces[1], geompy.ShapeType["EDGE"], True)
+ alledges[2] = geompy.ExtractShapes(faces[2], geompy.ShapeType["EDGE"], True)
+ alledges[3] = geompy.ExtractShapes(faces[3], geompy.ShapeType["EDGE"], True)
+
+ dicoedge = {}
+ edges = []
+ reverses = []
+ for i in range(len(alledges)):
+ edgesface = alledges[i]
+ lenef = []
+ for j in range(len(edgesface)):
+ props = geompy.BasicProperties(edgesface[j])
+ lenef.append(props[0])
+ pass
+ maxlen = max(lenef)
+ for j in range(len(edgesface)):
+ if lenef[j] < maxlen:
+ edgid = geompy.GetSubShapeID(tore, edgesface[j])
+ if not (edgid in dicoedge):
+ dicoedge[edgid] = edgesface[j]
+ edges.append(edgesface[j])
+ named = 'edge_' + str(i) + '_' +str(j)
+ geompy.addToStudyInFather( faces[i], edgesface[j], named)
+ vertices = geompy.ExtractShapes(edgesface[j], geompy.ShapeType["VERTEX"], False)
+ #firstVertex = geompy.GetFirstVertex(edgesface[j])
+ if geompy.GetSubShapeID(tore, vertices[0]) != geompy.GetSubShapeID(tore, centres[i]):
+ reverses.append(1)
+ #print 'reversed ' + str(edgid)
+ else:
+ reverses.append(0)
+ #print 'normal' + str(edgid)
+ pass
+ pass
+ pass
+ pass
+
+ return faces, centres, edges, reverses
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- faces fissure dans et hors tore, et edges face hors tore
+
+def facesFissure(blocp, faceFissure, extrusionDefaut, genint):
+ """
+ extraction des faces de fissure dans et hors tore, des edges le long du tore et en paroi
+ @param faceFissure : la face de fissure avec la partie dans le tore elliptique et la partie externe
+ @return (facefissintore, facefissoutore, edgeint, edgeext)
+ """
+ logging.info('start')
+
+ [f0,f1] = geompy.ExtractShapes(faceFissure, geompy.ShapeType["FACE"], True)
+ ed0 = geompy.ExtractShapes(f0, geompy.ShapeType["EDGE"], True)
+ ed1 = geompy.ExtractShapes(f1, geompy.ShapeType["EDGE"], True)
+ if len(ed0) > len(ed1):
+ facefissintore = f0
+ facefissoutore = f1
+ else:
+ facefissintore = f1
+ facefissoutore = f0
+
+ geompy.addToStudyInFather(faceFissure, facefissintore,'facefissintore')
+ geompy.addToStudyInFather(faceFissure, facefissoutore,'facefissoutore')
+
+ edgeint = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_IN)
+ edgeext = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_ON)
+
+ for i in range(len(edgeint)):
+ name = "edgeint_%d"%i
+ geompy.addToStudyInFather(facefissoutore, edgeint[i],name)
+ for i in range(len(edgeext)):
+ name = "edgeext_%d"%i
+ geompy.addToStudyInFather(facefissoutore, edgeext[i],name)
+
+ reverext = []
+ if len(edgeext) > 1:
+ vertices = geompy.ExtractShapes(genint, geompy.ShapeType["VERTEX"], False)
+ for i in range(len(edgeext)):
+ vertedge = geompy.ExtractShapes(edgeext[i], geompy.ShapeType["VERTEX"], False)
+ if ((geompy.GetSubShapeID(blocp, vertedge[0]) == geompy.GetSubShapeID(blocp, vertices[0])) or
+ (geompy.GetSubShapeID(blocp, vertedge[0]) == geompy.GetSubShapeID(blocp, vertices[1]))):
+ reverext.append(0)
+ else:
+ reverext.append(1)
+
+ return facefissintore, facefissoutore, edgeint, edgeext, reverext
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- identification des faces tore et fissure dans le solide hors tore du bloc partitionné
+
+def facesToreInBloc(blocp, facefissoutore, facetore1, facetore2):
+ """
+ identification des faces tore et fissure dans le bloc partitionné : sous shapes du bloc
+ @param blocp : bloc partitionné
+ @param facefissoutore : la face de fissure externe au tore
+ @param facetore1 : face du tore selon la génératrice
+ @param facetore2 : face du tore selon la génératrice
+ @return (blocFaceFiss, blocFaceTore1, blocFaceTore2) sous shapes reperées
+ """
+ logging.info('start')
+
+ blocFaceFiss = geompy.GetInPlaceByHistory(blocp, facefissoutore)
+ blocFaceTore1 = geompy.GetInPlaceByHistory(blocp, facetore1)
+ blocFaceTore2 = geompy.GetInPlaceByHistory(blocp, facetore2)
+
+ geompy.addToStudyInFather(blocp, blocFaceFiss,'blocFaceFiss')
+ geompy.addToStudyInFather(blocp, blocFaceTore1,'blocFaceTore1')
+ geompy.addToStudyInFather(blocp, blocFaceTore2,'blocFaceTore2')
+
+ return blocFaceFiss, blocFaceTore1, blocFaceTore2
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+from extractionOrientee import extractionOrientee
+from getSubshapeIds import getSubshapeIds
+
+# -----------------------------------------------------------------------------
+# --- TORE
+# --- faces toriques et volumes du tore
+
+def facesVolumesToriques(tore, plan, facesDefaut):
+ """
+ Extraction des deux faces et volumes du tore partitionné, qui suivent la génératrice elliptique.
+ @param tore : le tore partitionné et coupé.
+ @param plan : le plan de coupe
+ @return (facetore1,facetore2) les 2 faces selon la génératrice
+ """
+ logging.info("start")
+
+ centre = geompy.MakeVertexOnSurface(plan, 0.5, 0.5)
+ normal = geompy.GetNormal(plan, centre)
+ reference = geompy.MakeTranslationVector(centre, normal)
+
+ [facesInPlan, facesOutPlan, facesOnPlan] = extractionOrientee(plan, tore, reference, "FACE", 1.e-2, "faceTorePlan_")
+ [facesInSide, facesOutSide, facesOnSide] = extractionOrientee(facesDefaut, tore, reference, "FACE", 1.e-2, "faceTorePeau_")
+ facesIdInPlan = getSubshapeIds(tore, facesInPlan)
+ facesIdOutPlan = getSubshapeIds(tore, facesOutPlan)
+ facesIdOnSide = getSubshapeIds(tore, facesOnSide)
+ facesIdInSide = getSubshapeIds(tore, facesInSide)
+ facesIdOutSide = getSubshapeIds(tore, facesOutSide)
+ #facesIdInOutSide = facesIdInSide + facesIdOutSide
+ facetore1 = None
+ faceTore2 = None
+ for i, faceId in enumerate(facesIdInPlan):
+ if faceId not in facesIdOnSide:
+ facetore1 = facesInPlan[i]
+ break
+ for i, faceId in enumerate(facesIdOutPlan):
+ if faceId not in facesIdOnSide:
+ facetore2 = facesOutPlan[i]
+ break
+
+ #[facetore1,facetore2] = geompy.GetShapesOnShape(pipe0, tore, geompy.ShapeType["FACE"], GEOM.ST_ON)
+
+ geompy.addToStudyInFather( tore, facetore1, 'facetore1' )
+ geompy.addToStudyInFather( tore, facetore2, 'facetore2' )
+
+ [volumeTore1, volumeTore2] = geompy.ExtractShapes(tore, geompy.ShapeType["SOLID"], True)
+ geompy.addToStudyInFather( tore, volumeTore1, 'volumeTore1' )
+ geompy.addToStudyInFather( tore, volumeTore2, 'volumeTore2' )
+
+ return facetore1, facetore2, volumeTore1, volumeTore2
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- trouver les vertices extremites d'un wire
+
+def findWireEndVertices(aWire, getNormals=False):
+ """
+ trouver les vertices extremites d'un wire
+ calcul optionnel des tangentes. Attention à la tolérance qui peut être élevée (> 0.001)
+ """
+ logging.info("start")
+ if geompy.NumberOfEdges(aWire) > 1:
+ edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"], False)
+ else:
+ edges = [aWire]
+ vertices = []
+ idsubs = {}
+ shortList = []
+ if getNormals:
+ normals = []
+ idnorm = {}
+ shortNorm = []
+ for edge in edges:
+ vert = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], False)
+ vertices += vert
+ if getNormals:
+ v0 = geompy.MakeVertexOnCurve(edge, 0.0)
+ n0 = geompy.MakeTangentOnCurve(edge, 0.0)
+ v1 = geompy.MakeVertexOnCurve(edge, 1.0)
+ n1 = geompy.MakeTangentOnCurve(edge, 1.0)
+ dist = geompy.MinDistance(v0, vert[0])
+ logging.debug("distance %s", dist)
+ if dist < 1.e-2:
+ normals += [n0, n1]
+ else:
+ normals += [n1, n0]
+ for i, sub in enumerate(vertices):
+ subid = geompy.GetSubShapeID(aWire, sub)
+ if subid in idsubs.keys():
+ idsubs[subid].append(sub)
+ else:
+ idsubs[subid] = [sub]
+ name='vertex%d'%i
+ geompy.addToStudyInFather(aWire, sub, name)
+ if getNormals:
+ idnorm[subid] = normals[i]
+ name='norm%d'%i
+ geompy.addToStudyInFather(aWire, normals[i], name)
+ logging.debug("idsubs: %s", idsubs)
+ for k, v in idsubs.iteritems():
+ if len(v) == 1:
+ shortList.append(v[0])
+ if getNormals:
+ shortNorm.append(idnorm[k])
+ if getNormals:
+ return shortList, shortNorm
+ else:
+ return shortList
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- trouver les vertices intermediaires d'un wire
+
+def findWireIntermediateVertices(aWire, getNormals=False):
+ """
+ trouver les vertices d'un wire qui ne sont pas aux extremités
+ calcul optionnel des tangentes. Attention à la tolérance qui peut être élevée (> 0.001)
+ """
+ logging.info("start")
+ edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"], False)
+ vertices = []
+ idsubs = {}
+ shortList = []
+ if getNormals:
+ normals = []
+ idnorm = {}
+ shortNorm = []
+ for edge in edges:
+ vert = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], False)
+ vertices += vert
+ if getNormals:
+ v0 = geompy.MakeVertexOnCurve(edge, 0.0)
+ n0 = geompy.MakeTangentOnCurve(edge, 0.0)
+ v1 = geompy.MakeVertexOnCurve(edge, 1.0)
+ n1 = geompy.MakeTangentOnCurve(edge, 1.0)
+ dist = geompy.MinDistance(v0, vert[0])
+ logging.debug("distance %s", dist)
+ if dist < 1.e-2:
+ normals += [n0, n1]
+ else:
+ normals += [n1, n0]
+ for i, sub in enumerate(vertices):
+ subid = geompy.GetSubShapeID(aWire, sub)
+ if subid in idsubs.keys():
+ idsubs[subid].append(sub)
+ else:
+ idsubs[subid] = [sub]
+ name='vertex%d'%i
+ geompy.addToStudyInFather(aWire, sub, name)
+ if getNormals:
+ idnorm[subid] = normals[i]
+ name='norm%d'%i
+ geompy.addToStudyInFather(aWire, normals[i], name)
+ for k, v in idsubs.iteritems():
+ if len(v) > 1:
+ shortList.append(v[0])
+ if getNormals:
+ shortNorm.append(idnorm[k])
+ if getNormals:
+ return shortList, shortNorm
+ else:
+ return shortList
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from geomsmesh import geompy, smesh
+
+import math
+import GEOM
+import SALOMEDS
+import SMESH
+#import StdMeshers
+#import GHS3DPlugin
+#import NETGENPlugin
+import logging
+
+from fissureGenerique import fissureGenerique
+
+from triedreBase import triedreBase
+from genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from insereFissureGenerale import insereFissureGenerale
+from sortEdges import sortEdges
+
+O, OX, OY, OZ = triedreBase()
+
+class fissureCoude(fissureGenerique):
+ """
+ problème de fissure du Coude : version de base
+ maillage hexa
+ """
+
+ nomProbleme = "tuyau_Coude"
+
+ # ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = 60,
+ r_cintr = 1200,
+ l_tube_p1 = 1600,
+ l_tube_p2 = 1200,
+ epais = 40,
+ de = 760)
+
+ # ---------------------------------------------------------------------------
+ def genereGeometrieSaine(self, geomParams):
+ logging.info("genereGeometrieSaine %s", self.nomCas)
+
+ angleCoude = geomParams['angleCoude']
+ r_cintr = geomParams['r_cintr']
+ l_tube_p1 = geomParams['l_tube_p1']
+ l_tube_p2 = geomParams['l_tube_p2']
+ epais = geomParams['epais']
+ de = geomParams['de']
+
+ centre = geompy.MakeVertex(0, 0, -l_tube_p1)
+ diskext = geompy.MakeDiskPntVecR(centre, OZ, de/2.)
+ diskint = geompy.MakeDiskPntVecR(centre, OZ, de/2. -epais)
+ couronne = geompy.MakeCut(diskext, diskint)
+ tube_1 = geompy.MakePrismVecH(couronne, OZ, l_tube_p1)
+ axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
+ coude = geompy.MakeRevolution(couronne, axe, angleCoude*math.pi/180.0)
+ Rotation_1 = geompy.MakeRotation(couronne, axe, angleCoude*math.pi/180.0)
+ Rotation_2 = geompy.MakeRotation(OZ, OY, angleCoude*math.pi/180.0)
+ tube_2 = geompy.MakePrismVecH(Rotation_1, Rotation_2, -l_tube_p2)
+ plan_y = geompy.MakePlaneLCS(None, 100000, 3)
+ geompy.addToStudy( plan_y, "plan_y" )
+ geompy.addToStudy( tube_1, "tube_1" )
+ geompy.addToStudy( coude, "coude" )
+ geompy.addToStudy( tube_2, "tube_2" )
+
+ P1 = O
+ geompy.addToStudy( P1, "P1" )
+ op2 = geompy.MakeVertex(0, 0, -l_tube_p1)
+ P2 = geompy.MakeRotation(op2, axe, angleCoude*math.pi/180.0)
+ P2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, -l_tube_p2)
+ geompy.addToStudy( P2, "P2" )
+
+ # --- tube coude sain
+
+ geometrieSaine = geompy.MakePartition([tube_1, coude, tube_2, P1, P2], [plan_y], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
+ geompy.addToStudy( geometrieSaine, self.nomCas )
+ [P1, P2] = geompy.RestoreGivenSubShapes(geometrieSaine, [P1, P2], GEOM.FSM_GetInPlaceByHistory, False, True)
+
+ xmin = -de -r_cintr -l_tube_p2
+ zmin = -l_tube_p1 -r_cintr -l_tube_p2 -de
+ ymax = de +100.
+ boxypos = geompy.MakeBox(xmin, 0, zmin, ymax, ymax, 100, "boxypos")
+ boxyneg = geompy.MakeBox(xmin, 0, zmin, ymax, -ymax, 100, "boxyneg")
+ edgesypos = geompy.GetShapesOnShape(boxypos, geometrieSaine, geompy.ShapeType["EDGE"], GEOM.ST_IN)
+ edgesyneg = geompy.GetShapesOnShape(boxyneg, geometrieSaine, geompy.ShapeType["EDGE"], GEOM.ST_IN)
+ circ_g = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
+ geompy.UnionList(circ_g, edgesyneg)
+ circ_d = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
+ geompy.UnionList(circ_d, edgesypos)
+ edgesy0pos = geompy.GetShapesOnShape(boxypos, geometrieSaine, geompy.ShapeType["EDGE"], GEOM.ST_ONIN)
+ grpedpos = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
+ geompy.UnionList(grpedpos, edgesy0pos)
+ grpedy0 = geompy.CutGroups(grpedpos, circ_d, "edges_y0")
+ boxtub1 = geompy.MakeBox(-de/2.0 -1, -1, -l_tube_p1, de, de, 0, "boxtub1")
+ edgestub1 = geompy.GetShapesOnShape(boxtub1, geometrieSaine, geompy.ShapeType["EDGE"], GEOM.ST_IN)
+ grped = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
+ geompy.UnionList(grped, edgestub1)
+ long_p1 = geompy.IntersectGroups(grped, grpedy0)
+ boxtub = geompy.MakeBox(-de/2.0 -1, -1, -l_tube_p1 -l_tube_p2, de, de, -l_tube_p1)
+ boxtub2 = geompy.MakeRotation(boxtub, axe, angleCoude*math.pi/180.0, "boxttub2")
+ edgestub2 = geompy.GetShapesOnShape(boxtub2, geometrieSaine, geompy.ShapeType["EDGE"], GEOM.ST_IN)
+ grped = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
+ geompy.UnionList(grped, edgestub2)
+ long_p2 = geompy.IntersectGroups(grped, grpedy0)
+ boxtub1t = geompy.MakeTranslationVectorDistance(boxtub1, OZ, -l_tube_p1)
+ facer = geompy.GetShapesOnShape(boxtub1t, boxtub1, geompy.ShapeType["FACE"], GEOM.ST_ONIN, "facer")
+ boxcoud = geompy.MakeRevolution(facer[0], axe, angleCoude*math.pi/180.0, "boxcoud")
+ edgescoud = geompy.GetShapesOnShape(boxcoud, geometrieSaine, geompy.ShapeType["EDGE"], GEOM.ST_IN)
+ grped = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
+ geompy.UnionList(grped, edgescoud)
+ long_coude = geompy.IntersectGroups(grped, grpedy0)
+ grped = geompy.CutGroups(grpedy0, long_p1)
+ grped = geompy.CutGroups(grped, long_p2)
+ ep = geompy.CutGroups(grped, long_coude)
+ geompy.addToStudyInFather( geometrieSaine, long_p1, 'long_p1' )
+ geompy.addToStudyInFather( geometrieSaine, ep, 'ep' )
+ geompy.addToStudyInFather( geometrieSaine, long_coude, 'long_coude' )
+ geompy.addToStudyInFather( geometrieSaine, circ_g, 'circ_g' )
+ geompy.addToStudyInFather( geometrieSaine, circ_d, 'circ_d' )
+ geompy.addToStudyInFather( geometrieSaine, long_p2, 'long_p2' )
+
+ # --- face extremite tube (EXTUBE)
+
+ facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], OZ, GEOM.ST_ON)
+ EXTUBE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
+ geompy.UnionIDs(EXTUBE, facesIds)
+ geompy.addToStudyInFather( geometrieSaine, EXTUBE, 'EXTUBE' )
+
+ # --- edge bord extremite tube (BORDTU)
+
+ edge1Ids = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["EDGE"], OZ, GEOM.ST_ON)
+ edge2Ids = geompy.GetShapesOnCylinderIDs(geometrieSaine, geompy.ShapeType["EDGE"], OZ, de/2. -epais, GEOM.ST_ON)
+ edgesIds = []
+ for edge in edge1Ids:
+ if edge in edge2Ids:
+ edgesIds.append(edge)
+ BORDTU = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
+ geompy.UnionIDs(BORDTU, edgesIds)
+ geompy.addToStudyInFather( geometrieSaine, BORDTU, 'BORDTU' )
+
+ # --- face origine tube (CLGV)
+
+ pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10)
+ vec2 = geompy.MakeVector(P2, pp2)
+ #geompy.addToStudy(vec2, 'vec2')
+ facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON)
+ CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
+ geompy.UnionIDs(CLGV, facesIds)
+ geompy.addToStudyInFather( geometrieSaine, CLGV, 'CLGV' )
+
+ # --- peau tube interieur (PEAUINT)
+
+ extru1 = geompy.MakePrismVecH(diskint, OZ, l_tube_p1)
+ revol1 = geompy.MakeRevolution(diskint, axe, angleCoude*math.pi/180.0)
+ rot1 = geompy.MakeRotation(diskint, axe, angleCoude*math.pi/180.0)
+ extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
+ interne = geompy.MakeFuse(extru1, revol1)
+ interne = geompy.MakeFuse(extru2, interne)
+ geompy.addToStudy(interne, 'interne')
+ facesIds = geompy.GetShapesOnShapeIDs(interne, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ONIN)
+ PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
+ geompy.UnionIDs(PEAUINT, facesIds)
+ geompy.addToStudyInFather( geometrieSaine, PEAUINT, 'PEAUINT' )
+
+ # --- peau tube exterieur (PEAUEXT)
+
+ cercle1 = geompy.MakeCircle(centre, OZ, de/2.)
+ extru1 = geompy.MakePrismVecH(cercle1, OZ, l_tube_p1)
+ revol1 = geompy.MakeRevolution(cercle1, axe, angleCoude*math.pi/180.0)
+ rot1 = geompy.MakeRotation(cercle1, axe, angleCoude*math.pi/180.0)
+ extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
+ externe = geompy.MakeFuse(extru1, revol1)
+ externe = geompy.MakeFuse(extru2, externe)
+ geompy.addToStudy(externe, 'externe')
+ facesIds = geompy.GetShapesOnShapeIDs(externe, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ON)
+ PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
+ geompy.UnionIDs(PEAUEXT, facesIds)
+ geompy.addToStudyInFather( geometrieSaine, PEAUEXT, 'PEAUEXT' )
+
+ # --- solide sain
+
+ volIds = geompy.SubShapeAllIDs(geometrieSaine, geompy.ShapeType["SOLID"])
+ COUDE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["SOLID"])
+ geompy.UnionIDs(COUDE, volIds)
+ geompy.addToStudyInFather( geometrieSaine, COUDE, 'COUDSAIN' )
+
+ geometriesSaines = [geometrieSaine, long_p1, ep, long_coude, circ_g, circ_d, long_p2, P1, P2, EXTUBE, BORDTU, CLGV, PEAUINT, PEAUEXT, COUDE]
+
+ return geometriesSaines
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = 16,
+ n_ep = 3,
+ n_long_coude = 15,
+ n_circ_g = 20,
+ n_circ_d = 20,
+ n_long_p2 = 12)
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageSain(self, geometriesSaines, meshParams):
+ logging.info("genereMaillageSain %s", self.nomCas)
+
+ geometrieSaine = geometriesSaines[0]
+ long_p1 = geometriesSaines[1]
+ ep = geometriesSaines[2]
+ long_coude = geometriesSaines[3]
+ circ_g = geometriesSaines[4]
+ circ_d = geometriesSaines[5]
+ long_p2 = geometriesSaines[6]
+ P1 = geometriesSaines[7]
+ P2 = geometriesSaines[8]
+ EXTUBE = geometriesSaines[9]
+ BORDTU = geometriesSaines[10]
+ CLGV = geometriesSaines[11]
+ PEAUINT = geometriesSaines[12]
+ PEAUEXT = geometriesSaines[13]
+ COUDE = geometriesSaines[14]
+
+ n_long_p1 = meshParams['n_long_p1']
+ n_ep = meshParams['n_ep']
+ n_long_coude = meshParams['n_long_coude']
+ n_circ_g = meshParams['n_circ_g']
+ n_circ_d = meshParams['n_circ_d']
+ n_long_p2 = meshParams['n_long_p2']
+
+ maillageSain = smesh.Mesh(geometrieSaine)
+
+ algo3d = maillageSain.Hexahedron()
+ algo2d = maillageSain.Quadrangle()
+ smesh.SetName(algo3d, "algo3d_maillageSain")
+ smesh.SetName(algo2d, "algo2d_maillageSain")
+
+ algo1d_long_p1 = maillageSain.Segment(geom=long_p1)
+ hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1)
+ smesh.SetName(algo1d_long_p1, "algo1d_long_p1")
+ smesh.SetName(hypo1d_long_p1, "hypo1d_long_p1")
+
+ algo1d_ep = maillageSain.Segment(geom=ep)
+ hypo1d_ep = algo1d_ep.NumberOfSegments(n_ep)
+ smesh.SetName(algo1d_ep, "algo1d_ep")
+ smesh.SetName(hypo1d_ep, "hypo1d_ep")
+
+ algo1d_long_coude = maillageSain.Segment(geom=long_coude)
+ hypo1d_long_coude = algo1d_long_coude.NumberOfSegments(n_long_coude)
+ smesh.SetName(algo1d_long_coude, "algo1d_long_coude")
+ smesh.SetName(hypo1d_long_coude, "hypo1d_long_coude")
+
+ algo1d_circ_g = maillageSain.Segment(geom=circ_g)
+ hypo1d_circ_g = algo1d_circ_g.NumberOfSegments(n_circ_g)
+ smesh.SetName(algo1d_circ_g, "algo1d_circ_g")
+ smesh.SetName(hypo1d_circ_g, "hypo1d_circ_g")
+
+ algo1d_circ_d = maillageSain.Segment(geom=circ_d)
+ hypo1d_circ_d = algo1d_circ_d.NumberOfSegments(n_circ_d)
+ smesh.SetName(algo1d_circ_d, "algo1d_circ_d")
+ smesh.SetName(hypo1d_circ_d, "hypo1d_circ_d")
+
+ algo1d_long_p2 = maillageSain.Segment(geom=long_p2)
+ hypo1d_long_p2 = algo1d_long_p2.NumberOfSegments(n_long_p2)
+ smesh.SetName(algo1d_long_p2, "algo1d_long_p2")
+ smesh.SetName(hypo1d_long_p2, "hypo1d_long_p2")
+
+ isDone = maillageSain.Compute()
+
+ mp1 = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE)
+ mp2 = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE)
+ ext = maillageSain.GroupOnGeom(EXTUBE,'EXTUBE',SMESH.FACE)
+ btu = maillageSain.GroupOnGeom(BORDTU,'BORDTU',SMESH.EDGE)
+ clg = maillageSain.GroupOnGeom(CLGV,'CLGV',SMESH.FACE)
+ pei = maillageSain.GroupOnGeom(PEAUINT,'PEAUINT',SMESH.FACE)
+ pex = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE)
+ cou = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME)
+
+ return [maillageSain, True] # True : maillage hexa
+
+ # ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour le tuyau coude
+ profondeur : 0 < profondeur <= épaisseur
+ rayonPipe : rayon du pipe correspondant au maillage rayonnant
+ lenSegPipe : longueur des mailles rayonnantes le long du fond de fissure (= rayonPipe par défaut)
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> force une fissure elliptique (longueur/profondeur = grand axe/petit axe).
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
+ elliptique : True : fissure elliptique (longueur/profondeur = grand axe/petit axe); False : fissure longue (fond de fissure de profondeur constante, demi-cercles aux extrémites)
+ pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
+ externe : True : fissure face externe, False : fissure face interne
+ """
+ logging.info("setParamShapeFissure %s", self.nomCas)
+ self.shapeFissureParams = dict(profondeur = 10,
+ rayonPipe = 2.5,
+ lenSegPipe = 2.5,
+ azimut = 160,
+ alpha = 20,
+ longueur = 400,
+ orientation = 90,
+ lgInfluence = 50,
+ elliptique = False,
+ externe = True)
+
+ # ---------------------------------------------------------------------------
+ def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
+ logging.info("genereShapeFissure %s", self.nomCas)
+ logging.info("shapeFissureParams %s", shapeFissureParams)
+
+ angleCoude = geomParams['angleCoude']
+ r_cintr = geomParams['r_cintr']
+ l_tube_p1 = geomParams['l_tube_p1']
+ l_tube_p2 = geomParams['l_tube_p2']
+ epais = geomParams['epais']
+ de = geomParams['de']
+
+ profondeur = shapeFissureParams['profondeur']
+ azimut = shapeFissureParams['azimut']
+ alpha = shapeFissureParams['alpha']
+ longueur = shapeFissureParams['longueur']
+ orientation = shapeFissureParams['orientation']
+ externe = shapeFissureParams['externe']
+ lgInfluence = shapeFissureParams['lgInfluence']
+ self.elliptique = False
+ if shapeFissureParams.has_key('elliptique'):
+ self.elliptique = shapeFissureParams['elliptique']
+
+
+
+ azimut = -azimut # axe inverse / ASCOUF
+ axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
+ geompy.addToStudy(axe,"axe")
+
+ if not lgInfluence:
+ lgInfluence = profondeur
+
+ if longueur > 2*profondeur:
+ self.fissureLongue=True
+ else:
+ self.fissureLongue=False
+ self.elliptique = True
+
+ self.circonferentielle = False
+ self.longitudinale = False
+ if self.fissureLongue and not self.elliptique:
+ if abs(orientation) < 45 :
+ self.longitudinale = True
+ else:
+ self.circonferentielle = True
+
+ nbp1 = 10
+ if self.circonferentielle:
+ if externe:
+ dp = -1.0
+ raybor = de/2.
+ rayint = raybor - profondeur
+ rayext = raybor + profondeur/5.0
+ else:
+ dp = 1.0
+ raybor = de/2. - epais
+ rayint = raybor + profondeur
+ rayext = raybor - profondeur/5.0
+ lgfond = longueur -2*profondeur
+ angle = lgfond/(2*raybor)
+ pb = geompy.MakeVertex(raybor, 0, 0)
+ pi = geompy.MakeVertex(rayint, 0, 0)
+ pbl = geompy.MakeRotation(pb, OZ, angle)
+ pbr = geompy.MakeRotation(pb, OZ, -angle)
+ geompy.addToStudy(pbl,"pbl")
+ geompy.addToStudy(pbr,"pbr")
+ pal = geompy.MakeTranslationVector(pbl, OZ)
+ par = geompy.MakeTranslationVector(pbr, OZ)
+ axl = geompy.MakeVector(pbl,pal)
+ axr = geompy.MakeVector(pbr,par)
+ pil = geompy.MakeRotation(pi, OZ, angle)
+ pir = geompy.MakeRotation(pi, OZ, -angle)
+ points = []
+ nbp = 3*nbp1
+ for i in range(nbp):
+ angi = dp*(nbp -i)*(2.0*math.pi/3.0)/nbp
+ pt = geompy.MakeRotation(pil, axl, angi)
+ points.append(pt)
+ for i in range(nbp):
+ angi = angle -2.0*i*angle/nbp
+ pt = geompy.MakeRotation(pi, OZ, angi)
+ points.append(pt)
+ for i in range(nbp+1):
+ angi = -dp*i*(2.0*math.pi/3.0)/nbp
+ pt = geompy.MakeRotation(pir, axr, angi)
+ points.append(pt)
+ for i, pt in enumerate(points):
+ pt = geompy.MakeRotation(pt, OZ, azimut*math.pi/180.)
+ pt = geompy.MakeTranslation(pt, 0, 0, -l_tube_p1)
+ pt = geompy.MakeRotation(pt, axe, alpha*math.pi/180.)
+ points[i] = pt
+ wire0 = geompy.MakeInterpol(points[0:nbp+1])
+ wire1 = geompy.MakeInterpol(points[nbp:2*nbp+1])
+ wire2 = geompy.MakeInterpol(points[2*nbp:3*nbp+1])
+ #wiretube = geompy.MakeInterpol(points)
+ wiretube=geompy.MakeWire([wire0,wire1,wire2])
+ geompy.addToStudy(wiretube,"wiretube")
+
+ pe = geompy.MakeVertex(rayext, 0, 0)
+ pe = geompy.MakeRotation(pe, OZ, azimut*math.pi/180.)
+ pe = geompy.MakeTranslation(pe, 0, 0, -l_tube_p1)
+ pe = geompy.MakeRotation(pe, axe, alpha*math.pi/180.)
+
+ arce = geompy.MakeArc(points[0], pe, points[-1])
+ geompy.addToStudy(arce,"arce")
+
+ facefiss = geompy.MakeFaceWires([arce, wiretube], 1)
+ geompy.addToStudy( facefiss, 'facefissPlace' )
+
+ pc = geompy.MakeVertex((raybor + rayint)/2.0, 0, 0)
+ centre = geompy.MakeRotation(pc, OZ, azimut*math.pi/180.)
+ centre = geompy.MakeTranslation(centre, 0, 0, -l_tube_p1)
+ centre = geompy.MakeRotation(centre, axe, alpha*math.pi/180.)
+ geompy.addToStudy( centre, 'centrefissPlace' )
+
+ wiretube = geompy.GetInPlace(facefiss, wiretube)
+ geompy.addToStudy(wiretube, 'wiretubePlace' )
+ try:
+ edgetube = geompy.MakeEdgeWire(wiretube)
+ geompy.addToStudy(edgetube,"edgetube")
+ except:
+ logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
+ edgetube = None
+
+ # ---------------------------------------------------------
+
+ elif self.longitudinale:
+ if externe:
+ raybor = de/2.
+ dp = -1.0
+ else:
+ raybor = de/2. - epais
+ dp = +1.0
+ prof = dp * profondeur
+ lgfond = longueur -2*profondeur
+ cosaz = math.cos(azimut*math.pi/180.)
+ sinaz = math.sin(azimut*math.pi/180.)
+ alfrd = alpha*math.pi/180.
+ rayxy = r_cintr + raybor*cosaz
+ angle = lgfond/(2.*rayxy)
+ logging.debug("longueur: %s, angle: %s, rayon: %s",lgfond, angle, rayxy)
+ pb = geompy.MakeVertex(raybor*cosaz, raybor*sinaz, -l_tube_p1, "pb")
+ pi = geompy.MakeTranslation(pb, prof*cosaz, prof*sinaz, 0., "pi")
+ pbv = geompy.MakeTranslation(pb, -sinaz, cosaz, 0., "pbv")
+ axb = geompy.MakeVector(pb,pbv, "axb")
+ pbl = geompy.MakeRotation(pb, axe, alfrd -angle, "pbl")
+ pbr = geompy.MakeRotation(pb, axe, alfrd +angle, "pbr")
+ axl = geompy.MakeRotation(axb, axe, alfrd -angle, "axl")
+ axr = geompy.MakeRotation(axb, axe, alfrd +angle, "axr")
+ pil = geompy.MakeRotation(pi, axe, alfrd -angle, "pil")
+ pir = geompy.MakeRotation(pi, axe, alfrd +angle, "pir")
+
+ curves = []
+
+ points = []
+ nbp = 3*nbp1
+ xs = []
+ totx = 0
+ for i in range(nbp+2):
+ x = math.sin(i*math.pi/(nbp+1)) # fonction de répartition des points : distance relative
+ x2 = x*x
+ totx += x2
+ xs.append(totx)
+ logging.debug("x2: %s, totx: %s", x2, totx)
+ for i in range(nbp+1):
+ #posi = nbp -i # répartition équidistante des points sur la courbe
+ posi = nbp*(1 -xs[i]/totx) # points plus resserrés aux extrémités de la courbe
+ angi = -dp*posi*(5.0*math.pi/8.0)/nbp
+ pt = geompy.MakeRotation(pil, axl, angi)
+ points.append(pt)
+ curves.append(geompy.MakeInterpol(points))
+ point0 = points[0]
+ geompy.addToStudy(curves[-1],"curve0")
+# for i, pt in enumerate(points):
+# name = "point%d"%i
+# geompy.addToStudyInFather(curves[-1], pt, name)
+
+ points = []
+ nbp = 3*nbp1
+ xs =[]
+ totx = 0
+ for i in range(nbp+1):
+ x = math.sin(i*math.pi/nbp)
+ #x = 1.0 # répartition équidistante des points sur la courbe
+ x2 = x*x # points plus resserrés aux extrémités de la courbe
+ totx += x2
+ xs.append(totx)
+ logging.debug("x2: %s, totx: %s", x2, totx)
+ for i in range(nbp):
+ angi = alfrd -angle +2.0*angle*xs[i]/totx
+ pt = geompy.MakeRotation(pi, axe, angi)
+ points.append(pt)
+ curves.append(geompy.MakeInterpol(points))
+ geompy.addToStudy(curves[-1],"curve1")
+# for i, pt in enumerate(points):
+# name = "point%d"%i
+# geompy.addToStudyInFather(curves[-1], pt, name)
+
+ points = []
+ nbp = 3*nbp1
+ xs = []
+ totx = 0
+ for i in range(nbp+2):
+ x = math.sin(i*math.pi/(nbp+1))
+ x2 = x*x
+ totx += x2
+ xs.append(totx)
+ logging.debug("x2: %s, totx: %s", x2, totx)
+ for i in range(nbp+1):
+ #posi = nbp -i # répartition équidistante des points sur la courbe
+ posi = nbp*xs[i]/totx # points plus resserrés aux extrémités de la courbe
+ angi = dp*posi*(5.0*math.pi/8.0)/nbp
+ pt = geompy.MakeRotation(pir, axr, angi)
+ points.append(pt)
+ curves.append(geompy.MakeInterpol(points))
+ point1 = points[-1]
+ geompy.addToStudy(curves[-1],"curve2")
+# for i, pt in enumerate(points):
+# name = "point%d"%i
+# geompy.addToStudyInFather(curves[-1], pt, name)
+
+ wiretube = geompy.MakeWire(curves)
+ geompy.addToStudy(wiretube,"wiretube")
+ try:
+ edgetube = geompy.MakeEdgeWire(wiretube)
+ geompy.addToStudy(edgetube,"edgetube")
+ except:
+ logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
+ edgetube = None
+
+ pts = []
+ pts.append(point0)
+ dpr = prof*math.cos(5.0*math.pi/8.0)
+ pe = geompy.MakeTranslation(pb, dpr*cosaz, dpr*sinaz, 0., "pe")
+ for i in range(nbp):
+ angi = alfrd -angle +2.0*i*angle/nbp
+ pt = geompy.MakeRotation(pe, axe, angi)
+ pts.append(pt)
+ pts.append(point1)
+ arce = geompy.MakeInterpol(pts)
+ geompy.addToStudy(arce,"arce")
+
+ facefiss = geompy.MakeFaceWires([arce, wiretube], 0)
+ geompy.addToStudy( facefiss, 'facefissPlace' )
+
+ pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.)
+ centre = geompy.MakeRotation(pc, axe, alfrd)
+ geompy.addToStudy( centre, 'centrefissPlace' )
+
+ edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True)
+ edgesTriees, minl, maxl = sortEdges(edges)
+ edges = edgesTriees[:-1] # la plus grande correspond à arce, on l'elimine
+ wiretube = geompy.MakeWire(edges)
+ #wiretube = edgesTriees[-1]
+ geompy.addToStudy(wiretube, 'wiretubePlace' )
+
+ # ---------------------------------------------------------
+
+ else: # fissure elliptique, longue ou courte
+ if externe:
+ raybor = de/2.
+ dp = -1.0
+ else:
+ raybor = de/2. - epais
+ dp = +1.0
+ prof = dp * profondeur
+ cosaz = math.cos(azimut*math.pi/180.)
+ sinaz = math.sin(azimut*math.pi/180.)
+ alfrd = alpha*math.pi/180.
+ pb = geompy.MakeVertex(raybor*cosaz, raybor*sinaz, -l_tube_p1, "pb")
+ pi = geompy.MakeTranslation(pb, prof*cosaz, prof*sinaz, 0., "pi")
+ pbv = geompy.MakeTranslation(pb, -profondeur*sinaz, profondeur*cosaz, 0., "pbv")
+ ayb = geompy.MakeVector(pb,pbv, "ayb")
+ pb0 = geompy.MakeRotation(pb, axe, alfrd, "pb0")
+ ay0 = geompy.MakeRotation(ayb, axe, alfrd, "ay0")
+ pi0 = geompy.MakeRotation(pi, axe, alfrd, "pi0")
+ az_ = geompy.MakeVector(pi0, pb0, "az_")
+ az0 = geompy.MakeTranslationVector(az_, az_, "az0") #normale sortante
+ ax0 = geompy.MakeRotation(ay0, az0, -math.pi/2.0, "ax0")
+ ax1 = geompy.MakeRotation(ax0, az0, orientation*math.pi/180., "ax1")
+ ay1 = geompy.MakeRotation(ay0, az0, orientation*math.pi/180., "ay1")
+ originLCS = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0, "originLCS")
+ coo = geompy.PointCoordinates(pb0)
+ cox = geompy.VectorCoordinates(ax1)
+ coy = geompy.VectorCoordinates(ay1)
+ localLCS = geompy.MakeMarker(coo[0], coo[1], coo[2], cox[0], cox[1], cox[2], coy[0], coy[1], coy[2], "localLCS")
+
+ pco = geompy.MakeVertex(0, 0, -profondeur, "pco")
+ pao = geompy.MakeRotation(pco, OY, 0.6*math.pi, "pao")
+ pbo = geompy.MakeRotation(pco, OY, -0.6*math.pi, "pbo")
+ pce = geompy.MakeVertex(0, 0, 0.1*profondeur,"pce")
+ arcoo = geompy.MakeArc(pao, pco, pbo, "arcoo")
+ linoo = geompy.MakeArc(pao, pce, pbo, "linoo")
+ scalex = longueur/profondeur
+ arco =geompy.MakeScaleAlongAxes(arcoo, O, scalex, 1., 1., "arco")
+ lino =geompy.MakeScaleAlongAxes(linoo, O, scalex, 1., 1., "lino")
+ arci = geompy.MakePosition(arco, originLCS, localLCS, "arci")
+ arce = geompy.MakePosition(lino, originLCS, localLCS, "arce")
+ facefiss = geompy.MakeFaceWires([arce, arci], 0)
+ geompy.addToStudy( facefiss, 'facefissPlace' )
+ edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True)
+ edgesTriees, minl, maxl = sortEdges(edges)
+ edgetube = edgesTriees[-1] # la plus grande correspond à arci
+ wiretube = edgetube
+
+ pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.)
+ centre = geompy.MakeRotation(pc, axe, alfrd)
+ geompy.addToStudy( centre, 'centrefissPlace' )
+
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, profondeur/2. ,profondeur)
+
+ return [facefiss, centre, lgInfluence, coordsNoeudsFissure, wiretube, edgetube]
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ """
+ Paramètres du maillage de la fissure pour le tuyau coudé
+ Voir également setParamShapeFissure, paramètres rayonPipe et lenSegPipe.
+ nbSegRad = nombre de couronnes
+ nbSegCercle = nombre de secteurs
+ areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
+ """
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = 5,
+ nbsegCercle = 6,
+ areteFaceFissure = 5)
+
+ # ---------------------------------------------------------------------------
+ def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):
+ elementsDefaut = creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams)
+ return elementsDefaut
+
+ # ---------------------------------------------------------------------------
+ def genereMaillageFissure(self, geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step):
+ maillageFissure = insereFissureGenerale(maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step)
+ return maillageFissure
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Node = 77917,
+ Entity_Quad_Edge = 975,
+ Entity_Quad_Triangle = 2182,
+ Entity_Quad_Quadrangle = 6842,
+ Entity_Quad_Tetra = 20135,
+ Entity_Quad_Hexa = 8994,
+ Entity_Quad_Penta = 972,
+ Entity_Quad_Pyramid = 1038)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure import gmu
+from blocFissure.gmu.initEtude import initEtude
+from blocFissure.gmu.getStatsMaillageFissure import getStatsMaillageFissure
+
+class fissureGenerique():
+ """
+ classe générique problème fissure:
+ génération géométrie et maillage sain
+ définition et positionnement d'une fissure
+ génération d'un bloc défaut inséré dans le maillage sain
+ """
+
+ nomProbleme = "generique"
+
+ def __init__(self, numeroCas):
+ initEtude()
+ self.numeroCas = numeroCas
+ self.nomCas = self.nomProbleme +"_%d"%(self.numeroCas)
+ self.fissureLongue = False
+
+ def setParamGeometrieSaine(self):
+ self.geomParams = {}
+
+ def genereGeometrieSaine(self, geomParams):
+ geometriesSaines = [None]
+ return geometriesSaines
+
+ def setParamMaillageSain(self):
+ self.meshParams = {}
+
+ def genereMaillageSain(self, geometriesSaines, meshParams):
+ maillagesSains = [None]
+ return maillagesSains
+
+ def setParamShapeFissure(self):
+ self.shapeFissureParams = {}
+
+ def genereShapeFissure(self, geometriesSaines, geomParams, shapeFissureParams):
+ shapesFissure = [None]
+ return shapesFissure
+
+ def setParamMaillageFissure(self):
+ self.maillageFissureParams = {}
+
+ def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, maillageFissureParams):
+ elementsDefaut = [None]
+ return elementsDefaut
+
+ def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure,
+ maillageFissureParams, elementsDefaut, step):
+ maillageFissure = None
+ return maillageFissure
+
+ def setReferencesMaillageFissure(self):
+ referencesMaillageFissure = {}
+ return referencesMaillageFissure
+
+# ---------------------------------------------------------------------------
+
+ def executeProbleme(self, step=-1):
+ print "executeProbleme", self.nomCas
+ if step == 0:
+ return
+
+ self.setParamGeometrieSaine()
+ geometriesSaines = self.genereGeometrieSaine(self.geomParams)
+ if step == 1:
+ return
+
+ self.setParamMaillageSain()
+ maillagesSains = self.genereMaillageSain(geometriesSaines, self.meshParams)
+ if step == 2:
+ return
+
+ self.setParamShapeFissure()
+ shapesFissure = self.genereShapeFissure(geometriesSaines, self.geomParams, self.shapeFissureParams)
+ if step == 3:
+ return
+
+ self.setParamMaillageFissure()
+ elementsDefaut = self.genereZoneDefaut(geometriesSaines, maillagesSains, shapesFissure, self.shapeFissureParams, self.maillageFissureParams)
+ if step == 4:
+ return
+
+ maillageFissure = self.genereMaillageFissure(geometriesSaines, maillagesSains,
+ shapesFissure, self.shapeFissureParams,
+ self.maillageFissureParams, elementsDefaut, step)
+
+ self.setReferencesMaillageFissure()
+ mesures = getStatsMaillageFissure(maillageFissure, self.referencesMaillageFissure, self.maillageFissureParams)
+
+
+
+
+
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+from toreFissure import toreFissure
+from ellipsoideDefaut import ellipsoideDefaut
+from rotTrans import rotTrans
+from genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+
+# -----------------------------------------------------------------------------
+# --- création élements géométriques fissure elliptique
+
+def genereElemsFissureElliptique(shapeFissureParams):
+ """
+ TODO: a completer
+ """
+ logging.info('start')
+
+ centreDefaut = shapeFissureParams['centreDefaut']
+ vecteurDefaut = shapeFissureParams['vecteurDefaut']
+ demiGrandAxe = shapeFissureParams['demiGrandAxe']
+ demiPetitAxe = shapeFissureParams['demiPetitAxe']
+ orientation = shapeFissureParams['orientation']
+ tailleDefaut = shapeFissureParams['taille']
+
+ # --- ellipse incomplete : generatrice
+
+ allonge = demiGrandAxe/demiPetitAxe
+ rayonTore = demiPetitAxe/5.0
+ generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part = toreFissure(demiPetitAxe, allonge, rayonTore)
+ ellipsoide = ellipsoideDefaut(demiPetitAxe, allonge, rayonTore)
+
+ # --- positionnement sur le bloc defaut de generatrice, tore et plan fissure
+
+ pipe0 = rotTrans(Pipe_1, orientation, centreDefaut, vecteurDefaut)
+ gener1 = rotTrans(generatrice, orientation, centreDefaut, vecteurDefaut)
+ pipe1 = rotTrans(Pipe1Part, orientation, centreDefaut, vecteurDefaut)
+ facefis1 = rotTrans(FaceFissure, orientation, centreDefaut, vecteurDefaut)
+ plane1 = rotTrans(Plane_1, orientation, centreDefaut, vecteurDefaut)
+ ellipsoide1 = rotTrans(ellipsoide, orientation, centreDefaut, vecteurDefaut)
+
+ geompy.addToStudy( pipe0, 'pipe0' )
+ geompy.addToStudy( gener1, 'gener1' )
+ geompy.addToStudy( pipe1, 'pipe1' )
+ geompy.addToStudy( facefis1, 'facefis1' )
+ geompy.addToStudy( plane1, 'plane1' )
+ geompy.addToStudy( ellipsoide1, 'ellipsoide1' )
+
+ shapeDefaut = facefis1
+ xyz_defaut = geompy.PointCoordinates(centreDefaut)
+ coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefis1, demiPetitAxe/10.0, demiPetitAxe/5.0)
+
+ return shapeDefaut, xyz_defaut, tailleDefaut, coordsNoeudsFissure, pipe0, gener1, pipe1, facefis1, plane1, ellipsoide1
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import smesh
+from salome.smesh import smeshBuilder
+
+# -----------------------------------------------------------------------------
+# --- maillage face de fissure pour identification zone de defaut
+
+def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize):
+ """
+ TODO: a completer
+ """
+ logging.info('start')
+
+ meshFissure = smesh.Mesh(facefiss)
+ algo2d = meshFissure.Triangle(algo=smeshBuilder.NETGEN_1D2D)
+ hypo2d = algo2d.Parameters()
+ hypo2d.SetMaxSize( maxSize )
+ hypo2d.SetSecondOrder( 0 )
+ hypo2d.SetOptimize( 1 )
+ hypo2d.SetFineness( 2 )
+ hypo2d.SetMinSize( minSize )
+ hypo2d.SetQuadAllowed( 0 )
+ isDone = meshFissure.Compute()
+ smesh.SetName(algo2d, "algo2d_zoneFiss")
+ smesh.SetName(hypo2d, "hypo1d_zoneFiss")
+
+ coordsNoeudsFissure = []
+ nodeIds = meshFissure.GetNodesId()
+ for id in nodeIds:
+ coords = meshFissure.GetNodeXYZ(id)
+ coordsNoeudsFissure.append(coords[0])
+ coordsNoeudsFissure.append(coords[1])
+ coordsNoeudsFissure.append(coords[2])
+ return coordsNoeudsFissure
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+logging.info('start')
+
+import salome
+salome.salome_init()
+
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+
+logging.debug("initialisation de geompy et smesh OK")
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+import bisect
+
+publie = False
+
+def getCentreFondFiss(shapesFissure):
+ """
+ identification du centre de fond de fissure,
+ transformation fond de fissure en edge unique (seulement pour la procédure insereFissureGenerale).
+ On distingue le cas d'utilisation de la procédure insereFissureLongue par le nombre d'éléments de shapesFissure.
+ """
+ global publie
+ logging.debug("start")
+
+ fondFiss = shapesFissure[4] # groupe d'edges de fond de fissure
+ if len(shapesFissure) == 6: # procédure insereFissureGenerale, et edge fond de fissure fournie explicitement
+ edgeFondExt = shapesFissure[5]
+ else:
+ edgeFondExt = None
+
+ if len(shapesFissure) > 6: # procédure insereFissureLongue (fissure plane, plusieurs edges sur le fond de fissure)
+ centreFondFiss = shapesFissure[1]
+ tgtCentre = None
+ else: # procédure insereFissureGenerale, détermination edge unique et milieu de l'edge
+ if geompy.NumberOfEdges(fondFiss) > 1:
+ if geompy.NbShapes(fondFiss, geompy.ShapeType["WIRE"]) > 0: # wire
+ aWire = fondFiss
+ else: # compound
+ edges = geompy.ExtractShapes(fondFiss, geompy.ShapeType["EDGE"], False)
+ aWire = geompy.MakeWire(edges, 1e-07)
+ else:
+ edgeFondExt = fondFiss
+ aWire = geompy.MakeWire([fondFiss], 1e-07)
+ if not publie:
+ geompy.addToStudy(aWire, "wireFondFissExt")
+
+ lgWire = geompy.BasicProperties(aWire)[0]
+ edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"], True)
+ lgEdges = [geompy.BasicProperties(ed)[0] for ed in edges]
+ lgSumEd =[sum(lgEdges[0:i+1]) for i in range(len(lgEdges))]
+ iedr = bisect.bisect_left(lgSumEd, lgWire/2.0)
+ iedg = iedr -1
+ if iedg < 0:
+ lgOnEdge = lgWire/2.0
+ else:
+ lgOnEdge = lgWire/2.0 - lgSumEd[iedg]
+ logging.debug("lgsumEdges %s", lgSumEd)
+ logging.debug("id edge: %s, lgOnEdge: %s, lgEdge: %s",iedr, lgOnEdge, lgEdges[iedr])
+ if iedr > 0: # il y a une edge avant celle du milieu
+ if geompy.MinDistance(edges[iedr-1], geompy.MakeVertexOnCurve(edges[iedr], 0.0 )) < 1.e-3: # edge orientée croissante
+ centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], lgOnEdge/lgEdges[iedr])
+ else:
+ centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], 1.0 - lgOnEdge/lgEdges[iedr])
+ elif iedr < len(edges)-1: # il y a une edge après celle du milieu
+ if geompy.MinDistance(edges[iedr+1], geompy.MakeVertexOnCurve(edges[iedr], 1.0 )) < 1.e-3: # edge orientée croissante
+ centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], lgOnEdge/lgEdges[iedr])
+ else:
+ centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], 1.0 - lgOnEdge/lgEdges[iedr])
+ else: # on ne sait pas comment est orientée l'edge unique, mais ça n'a pas d'importance
+ centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], lgOnEdge/lgEdges[iedr])
+ geompy.addToStudyInFather(aWire, centreFondFiss, "centreFondFiss")
+ tgtCentre = geompy.MakeTangentOnCurve(edges[iedr], lgOnEdge/ lgEdges[iedr])
+
+ if edgeFondExt is None: # fond de fissure non fourni explicitement sous forme d'edge
+ try:
+ edgeFondExt = geompy.MakeEdgeWire(aWire, 0.0005, 1e-07)
+ except:
+ logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
+ edgeFondExt = None
+ if not publie and edgeFondExt is not None:
+ geompy.addToStudy(edgeFondExt, "edgeFondExt")
+
+ publie = True
+ return edgeFondExt, centreFondFiss, tgtCentre
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+import SMESH
+
+# -----------------------------------------------------------------------------
+# --- statistiques maillage
+
+def getStatsMaillageFissure(maillage, referencesMaillageFissure, maillageFissureParams):
+ """
+ TODO: a completer
+ """
+ logging.debug('start')
+
+ nomRep = '.'
+ if maillageFissureParams.has_key('nomRep'):
+ nomRep = maillageFissureParams['nomRep']
+
+ nomFicFissure = maillageFissureParams['nomFicFissure']
+ fichierStatMaillageFissure = nomRep + '/' + nomFicFissure + '.res'
+ fichierNewRef = nomRep + '/' + nomFicFissure + '.new'
+ logging.debug("fichierStatMaillageFissure=%s", fichierStatMaillageFissure)
+
+ OK = False
+ if maillage is not None:
+ mesures = maillage.GetMeshInfo()
+ d= {}
+ for key, value in mesures.iteritems():
+ logging.debug( "key: %s value: %s", key, value)
+ d[str(key)] = value
+ logging.debug("dico mesures %s", d)
+
+ f = open(fichierStatMaillageFissure, 'w')
+ f2 = open(fichierNewRef, 'w')
+ OK = True
+ for key in ('Entity_Quad_Pyramid', 'Entity_Quad_Hexa', 'Entity_Quad_Quadrangle'):
+ if d[key] != referencesMaillageFissure[key]:
+ logging.info("Ecart: %s reference: %s calcul: %s", key, referencesMaillageFissure[key], d[key])
+ f.write("Ecart: " + key + " reference: " + str(referencesMaillageFissure[key]) + " calcul: " + str(d[key]) + '\n')
+ OK = False
+ else:
+ logging.info("Valeur_OK: %s reference: %s calcul: %s", key, referencesMaillageFissure[key], d[key])
+ f.write("Valeur_OK: " + key + " reference: " + str(referencesMaillageFissure[key]) + " calcul: " + str(d[key]) + '\n')
+ f2.write(key + " = " + str(d[key]) + ",\n")
+ tolerance = 0.05
+ for key in ('Entity_Quad_Penta', 'Entity_Quad_Tetra', 'Entity_Quad_Triangle', 'Entity_Quad_Edge', 'Entity_Node'):
+ if (d[key] < (1.0 - tolerance)*referencesMaillageFissure[key]) \
+ or (d[key] > (1.0 + tolerance)*referencesMaillageFissure[key]):
+ logging.info("Ecart: %s reference: %s calcul: %s", key, referencesMaillageFissure[key], d[key])
+ f.write("Ecart: " + key + " reference: " + str(referencesMaillageFissure[key]) + " calcul: " + str(d[key]) + '\n')
+ OK = False
+ else:
+ logging.info("Valeur_OK: %s reference: %s calcul: %s", key, referencesMaillageFissure[key], d[key])
+ f.write("Valeur_OK: " + key + " reference: " + str(referencesMaillageFissure[key]) + " calcul: " + str(d[key]) + '\n')
+ f2.write(key + " = " + str(d[key]) + ",\n")
+ f.close()
+ f2.close()
+ return OK
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- transformation d'une liste de subshapes en une liste d'Id
+
+def getSubshapeIds(obj, subshapes):
+ """
+ transformation d'une liste de subshapes en une liste d'Id
+ """
+ logging.debug("start")
+ subshapesId = []
+ for sub in subshapes:
+ subshapesId.append(geompy.GetSubShapeID(obj, sub))
+ logging.debug("subshapesId=%s", subshapesId)
+ return subshapesId
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+myStudy = None
+
+def initEtude():
+ """
+ creation nouvelle etude salome
+ """
+ import geomsmesh
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+
+def setDebug():
+ logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
+ level=logging.DEBUG)
+ logging.info('start Debug')
+
+def setVerbose():
+ logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
+ level=logging.INFO)
+ logging.info('start Verbose')
+
+def setRelease():
+ logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s',
+ level=logging.WARNING)
+ logging.warning('start Release')
+
+def setUnitTests():
+ logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s',
+ level=logging.CRITICAL)
+ logging.critical('start UnitTests')
+
+ #logging.basicConfig(filename='myapp.log',
+ # format='%(asctime)s %(message)s',
+ # datefmt='%m/%d/%Y %I:%M:%S %p',
+ # level=logging.DEBUG)
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+import salome
+from geomsmesh import geompy
+from geomsmesh import smesh
+import SMESH
+import math
+
+from partitionBlocDefaut import partitionBlocDefaut
+from facesVolumesToriques import facesVolumesToriques
+from facesCirculaires import facesCirculaires
+from propagateTore import propagateTore
+from sortGeneratrices import sortGeneratrices
+from facesFissure import facesFissure
+from facesToreInBloc import facesToreInBloc
+from shapeSurFissure import shapeSurFissure
+from meshBlocPart import meshBlocPart
+from enleveDefaut import enleveDefaut
+from regroupeSainEtDefaut import RegroupeSainEtDefaut
+from putName import putName
+
+# -----------------------------------------------------------------------------
+# --- procedure complete fissure elliptique
+
+def insereFissureElliptique(geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step=-1):
+ """
+ TODO: a completer
+ """
+ logging.info('start')
+
+ geometrieSaine = geometriesSaines[0]
+ maillageSain = maillagesSains[0]
+ isHexa = maillagesSains[1]
+ shapeDefaut = shapesFissure[0]
+ tailleDefaut = shapesFissure[2]
+ pipe0 = shapesFissure[4]
+ gener1 = shapesFissure[5]
+ pipe1 = shapesFissure[6]
+ facefis1 = shapesFissure[7]
+ plane1 = shapesFissure[8]
+ ellipsoide1 = shapesFissure[9]
+
+
+ demiGrandAxe = shapeFissureParams['demiGrandAxe']
+ demiPetitAxe = shapeFissureParams['demiPetitAxe']
+ orientation = shapeFissureParams['orientation']
+
+ nomRep = maillageFissureParams['nomRep']
+ nomFicSain = maillageFissureParams['nomFicSain']
+ nomFicFissure = maillageFissureParams['nomFicFissure']
+
+ nbsegExt = maillageFissureParams['nbsegExt'] # 5
+ nbsegGen = maillageFissureParams['nbsegGen'] # 25
+ nbsegRad = maillageFissureParams['nbsegRad'] # 5
+ scaleRad = maillageFissureParams['scaleRad'] # 4
+ nbsegCercle = maillageFissureParams['nbsegCercle'] # 6
+ nbsegFis = maillageFissureParams['nbsegFis'] # 20
+ lensegEllipsoide = maillageFissureParams['lensegEllipso'] # 1.0
+
+ fichierMaillageSain = nomRep + '/' + nomFicSain + '.med'
+ fichierMaillageFissure = nomRep + '/' + nomFicFissure + '.med'
+
+ facesDefaut = elementsDefaut[0]
+ centreDefaut = elementsDefaut[1]
+ normalDefaut = elementsDefaut[2]
+ extrusionDefaut = elementsDefaut[3]
+ dmoyen = elementsDefaut[4]
+ bordsPartages = elementsDefaut[5]
+ fillconts = elementsDefaut[6]
+ idFilToCont = elementsDefaut[7]
+ maillageSain = elementsDefaut[8]
+ internalBoundary = elementsDefaut[9]
+ zoneDefaut = elementsDefaut[10]
+ zoneDefaut_skin = elementsDefaut[11]
+ zoneDefaut_internalFaces = elementsDefaut[12]
+ zoneDefaut_internalEdges = elementsDefaut[13]
+
+ ## --- ellipse incomplete : generatrice
+ #if step == 5:
+ #return None
+
+ #allonge = demiGrandAxe/demiPetitAxe
+ #rayonTore = demiPetitAxe/5.0
+ #generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part = self.toreFissure(demiPetitAxe, allonge, rayonTore)
+ #ellipsoide = self.ellipsoideDefaut(demiPetitAxe, allonge, rayonTore)
+
+ ## --- positionnement sur le bloc defaut de generatrice, tore et plan fissure
+ #if step == 6:
+ #return None
+
+ #pipe0 = self.rotTrans(Pipe_1, orientation, centreDefaut, normalDefaut)
+ #gener1 = self.rotTrans(generatrice, orientation, centreDefaut, normalDefaut)
+ #pipe1 = self.rotTrans(Pipe1Part, orientation, centreDefaut, normalDefaut)
+ #facefis1 = self.rotTrans(FaceFissure, orientation, centreDefaut, normalDefaut)
+ #plane1 = self.rotTrans(Plane_1, orientation, centreDefaut, normalDefaut)
+ #ellipsoide1 = self.rotTrans(ellipsoide, orientation, centreDefaut, normalDefaut)
+
+ #geompy.addToStudy( pipe0, 'pipe0' )
+ #geompy.addToStudy( gener1, 'gener1' )
+ #geompy.addToStudy( pipe1, 'pipe1' )
+ #geompy.addToStudy( facefis1, 'facefis1' )
+ #geompy.addToStudy( plane1, 'plane1' )
+ #geompy.addToStudy( ellipsoide1, 'ellipsoide1' )
+
+ # --- partition du bloc défaut par génératrice, tore et plan fissure
+ if step == 7:
+ return None
+
+ [blocPartition, blocp, tore,
+ faceFissure, facesExternes, facesExtBloc, facesExtElli,
+ aretesInternes, ellipsoidep, sharedFaces, sharedEdges, edgesBords] = \
+ partitionBlocDefaut(extrusionDefaut, facesDefaut, gener1, pipe1,
+ facefis1, ellipsoide1)
+ if not isHexa:
+ edgesBords = None # maillage sain hexa ==> filling, et maillage edges Bords imposés du maillage sain
+
+ # --- TORE
+ # --- faces toriques du tore
+ if step == 8:
+ return None
+
+ [facetore1, facetore2, volumeTore1, volumeTore2] = facesVolumesToriques(tore, plane1, facesDefaut)
+
+ # --- faces 1/2 circulaires et edges dans le plan de fissure
+ if step == 9:
+ return None
+
+ [faces, centres, edges, reverses] = facesCirculaires(extrusionDefaut, tore)
+
+ # --- recherche et classement des edges du tore par propagate
+ if step == 10:
+ return None
+
+ [diams, circles, geners] = propagateTore(tore)
+
+ # --- tri par longueur des 3 génératrices
+ if step == 11:
+ return None
+
+ [genext, genint, gencnt] = sortGeneratrices(tore, geners)
+
+ # --- faces fissure dans et hors tore, et edges face hors tore
+ if step == 12:
+ return None
+
+ [facefissintore, facefissoutore, edgeint, edgeext, reverext] = \
+ facesFissure(ellipsoidep, faceFissure, extrusionDefaut, genint)
+
+ # --- identification des faces tore et fissure dans le solide hors tore
+ if step == 13:
+ return None
+
+ [blocFaceFiss, blocFaceTore1, blocFaceTore2] = \
+ facesToreInBloc(ellipsoidep, facefissoutore, facetore1, facetore2)
+
+ # --- identification des shapes modifiées par la duplication des noeuds de la face fissure (d'un coté de la face)
+
+ #shapesAModifier = self.shapesSurFissure(blocPartition, plane1 faceFissure, gencnt)
+ if step == 14:
+ return None
+
+ extrusionFaceFissure, normfiss = shapeSurFissure(plane1)
+
+ # --- maillage du bloc partitionne
+
+ if step == 15:
+ return None
+
+ [bloc1, blocComplet] = \
+ meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circles, faces,
+ gencnt, facefissoutore, edgeext, facesExternes, facesExtBloc, facesExtElli,
+ aretesInternes, internalBoundary, ellipsoidep, sharedFaces, sharedEdges, edgesBords,
+ nbsegExt, nbsegGen, nbsegRad, scaleRad, reverses, reverext, nbsegCercle,
+ nbsegFis, dmoyen, lensegEllipsoide)
+
+ if step == 16:
+ return None
+ maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges)
+
+ if step == 17:
+ return None
+ maillageComplet = RegroupeSainEtDefaut(maillageSain, blocComplet, extrusionFaceFissure, faceFissure, 'VOLUMES')
+
+ if step == 18:
+ return None
+ maillageComplet.ExportMED( fichierMaillageFissure, 0, SMESH.MED_V2_2, 1 )
+ putName(maillageComplet, nomFicFissure)
+ logging.info("fichier maillage fissure : %s", fichierMaillageFissure)
+
+ if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
+
+ return maillageComplet
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+import salome
+from geomsmesh import geompy
+import GEOM
+from geomsmesh import smesh
+from salome.smesh import smeshBuilder
+import SMESH
+import math
+import bisect
+
+from extractionOrientee import extractionOrientee
+from extractionOrienteeMulti import extractionOrienteeMulti
+from sortFaces import sortFaces
+from sortEdges import sortEdges
+from eliminateDoubles import eliminateDoubles
+from substractSubShapes import substractSubShapes
+from produitMixte import produitMixte
+from findWireEndVertices import findWireEndVertices
+from findWireIntermediateVertices import findWireIntermediateVertices
+from orderEdgesFromWire import orderEdgesFromWire
+from getSubshapeIds import getSubshapeIds
+from putName import putName
+from distance2 import distance2
+from enleveDefaut import enleveDefaut
+from shapeSurFissure import shapeSurFissure
+from regroupeSainEtDefaut import RegroupeSainEtDefaut
+from triedreBase import triedreBase
+from checkDecoupePartition import checkDecoupePartition
+from whichSide import whichSide
+from whichSideMulti import whichSideMulti
+from whichSideVertex import whichSideVertex
+from projettePointSurCourbe import projettePointSurCourbe
+from prolongeWire import prolongeWire
+#from getCentreFondFiss import getCentreFondFiss
+
+# -----------------------------------------------------------------------------
+# --- procédure complète fissure générale
+
+def insereFissureGenerale(maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step=-1):
+ """
+ TODO: a completer
+ """
+ logging.info('start')
+
+ shapeDefaut = shapesFissure[0] # faces de fissure, débordant
+ fondFiss = shapesFissure[4] # groupe d'edges de fond de fissure
+
+ rayonPipe = shapeFissureParams['rayonPipe']
+ if shapeFissureParams.has_key('lenSegPipe'):
+ lenSegPipe = shapeFissureParams['lenSegPipe']
+ else:
+ lenSegPipe = rayonPipe
+
+ nomRep = maillageFissureParams['nomRep']
+ nomFicSain = maillageFissureParams['nomFicSain']
+ nomFicFissure = maillageFissureParams['nomFicFissure']
+
+ nbsegRad = maillageFissureParams['nbsegRad'] # nombre de couches selon un rayon du pipe
+ nbsegCercle = maillageFissureParams['nbsegCercle'] # nombre de secteur dans un cercle du pipe
+ areteFaceFissure = maillageFissureParams['areteFaceFissure']
+
+ pointIn_x = 0.0
+ pointIn_y = 0.0
+ pointIn_z = 0.0
+ isPointInterne = False
+ if shapeFissureParams.has_key('pointIn_x'):
+ pointIn_x = shapeFissureParams['pointIn_x']
+ isPointInterne = True
+ if shapeFissureParams.has_key('pointIn_y'):
+ pointIn_y = shapeFissureParams['pointIn_y']
+ isPointInterne = True
+ if shapeFissureParams.has_key('pointIn_z'):
+ pointIn_z = shapeFissureParams['pointIn_z']
+ isPointInterne = True
+ if isPointInterne:
+ pointInterne = geompy.MakeVertex(pointIn_x, pointIn_y, pointIn_z)
+
+ #fichierMaillageSain = nomRep + '/' + nomFicSain + '.med'
+ fichierMaillageFissure = nomRep + '/' + nomFicFissure + '.med'
+
+ facesDefaut = elementsDefaut[0] # fillings des faces en peau
+ #centresDefaut = elementsDefaut[1]
+ #normalsDefaut = elementsDefaut[2]
+ #extrusionsDefaut = elementsDefaut[3]
+ dmoyen = elementsDefaut[4]
+ bordsPartages = elementsDefaut[5]
+ fillconts = elementsDefaut[6]
+ idFilToCont = elementsDefaut[7]
+ maillageSain = elementsDefaut[8]
+ internalBoundary = elementsDefaut[9]
+ zoneDefaut = elementsDefaut[10]
+ zoneDefaut_skin = elementsDefaut[11]
+ zoneDefaut_internalFaces = elementsDefaut[12]
+ zoneDefaut_internalEdges = elementsDefaut[13]
+ edgeFondExt = elementsDefaut[14]
+ centreFondFiss = elementsDefaut[15]
+ tgtCentre = elementsDefaut[16]
+
+ # --- restriction de la face de fissure au domaine solide :
+ # partition face fissure étendue par fillings, on garde la plus grande face
+
+ partShapeDefaut = geompy.MakePartition([shapeDefaut], facesDefaut, [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ geompy.addToStudy(partShapeDefaut, 'partShapeDefaut')
+ facesPartShapeDefaut = geompy.ExtractShapes(partShapeDefaut, geompy.ShapeType["FACE"], False)
+ if isPointInterne:
+ distfaces = [(geompy.MinDistance(face,pointInterne), i, face) for i, face in enumerate(facesPartShapeDefaut)]
+ distfaces.sort()
+ logging.debug("selection de la face la plus proche du point interne, distance=%s",distfaces[0][0])
+ facesPortFissure = distfaces[0][2]
+ else:
+ facesPartShapeDefautSorted, minSurf, maxSurf = sortFaces(facesPartShapeDefaut) # la face de fissure dans le volume doit être la plus grande
+ logging.debug("surfaces faces fissure étendue, min %s, max %s", minSurf, maxSurf)
+ facesPortFissure = facesPartShapeDefautSorted[-1]
+
+ geompy.addToStudy(facesPortFissure, "facesPortFissure")
+
+ O, OX, OY, OZ = triedreBase()
+
+ # -----------------------------------------------------------------------------
+ # --- pipe de fond de fissure, prolongé, partition face fissure par pipe
+ # identification des edges communes pipe et face fissure
+
+ if geompy.NumberOfFaces(shapeDefaut) == 1:
+ plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000)
+ shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss)
+ geompy.addToStudy(shapeDefaut, 'shapeDefaut_coupe')
+ geompy.addToStudyInFather(shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
+
+ extrem, norms = findWireEndVertices(fondFiss, True)
+ logging.debug("extrem: %s, norm: %s",extrem, norms)
+ cercle = geompy.MakeCircle(extrem[0], norms[0], rayonPipe)
+ cercle = geompy.MakeRotation(cercle, norms[0], math.pi/3.0 ) # éviter d'avoir l'arête de couture du pipe presque confondue avec la face fissure
+ geompy.addToStudy(cercle, 'cercle')
+ fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe)
+ pipeFiss = geompy.MakePipe(cercle, fondFissProlonge)
+ geompy.addToStudy(pipeFiss, 'pipeFiss')
+ partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
+ geompy.addToStudy(partFissPipe, 'partFissPipe')
+ fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut)
+ geompy.addToStudy(fissPipe, 'fissPipe')
+ partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss)
+ geompy.addToStudy(partPipe, 'partPipe')
+
+ edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"])
+ for i, edge in enumerate(edgesPipeFiss):
+ name = "edgePipe%d"%i
+ geompy.addToStudyInFather(fissPipe, edge, name)
+ try:
+ wirePipeFiss = geompy.MakeWire(edgesPipeFiss)
+ except:
+ wirePipeFiss = geompy.MakeCompound(edgesPipeFiss)
+ logging.debug("wirePipeFiss construit sous forme de compound")
+ geompy.addToStudy(wirePipeFiss, "wirePipeFiss")
+
+ wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss)
+ edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"])
+ for i, edge in enumerate(edgesFondFiss):
+ name = "edgeFondFiss%d"%i
+ geompy.addToStudyInFather(fissPipe, edge, name)
+ wireFondFiss = geompy.MakeWire(edgesFondFiss)
+ geompy.addToStudy(wireFondFiss,"wireFondFiss")
+
+ # -----------------------------------------------------------------------------
+ # --- peau et face de fissure
+ #
+ # --- partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée
+ # il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure
+ # liste de faces externes : facesDefaut
+ # liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection)
+
+ partitionsPeauFissFond = []
+ ipart = 0
+ for filling in facesDefaut:
+ part = geompy.MakePartition([fissPipe, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ isPart = checkDecoupePartition([fissPipe, filling], part)
+ if isPart: # on recrée la partition avec toutes les faces filling en outil pour avoir une face de fissure correcte
+ otherFD = [fd for fd in facesDefaut if fd != filling]
+ if len(otherFD) > 0:
+ fissPipePart = geompy.MakePartition([fissPipe], otherFD, [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ else:
+ fissPipePart = fissPipe
+ part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ partitionsPeauFissFond.append(part)
+ geompy.addToStudy( part, 'partitionPeauFissFond%d'%ipart )
+ else:
+ partitionsPeauFissFond.append(None)
+ ipart = ipart +1
+
+ # --- arêtes vives détectées (dans quadranglesToShape)
+
+ aretesVives = []
+ aretesVivesCoupees = []
+ ia = 0
+ for a in bordsPartages:
+ if a[0] is not None:
+ aretesVives.append(a[0])
+ name = "areteVive%d"%ia
+ geompy.addToStudy(a[0], name)
+ ia += 1
+ aretesVivesC = None
+ if len(aretesVives) > 0:
+ aretesVivesC =geompy.MakeCompound(aretesVives)
+
+ # -------------------------------------------------------
+ # --- inventaire des faces de peau coupées par la fissure
+ # pour chaque face de peau : 0, 1 ou 2 faces débouchante du fond de fissure
+ # 0, 1 ou plus edges de la face de fissure externe au pipe
+
+ nbFacesFilling = len(partitionsPeauFissFond)
+ ptEdgeFond = [ [] for i in range(nbFacesFilling)] # pour chaque face [points edge fond de fissure aux débouchés du pipe]
+ fsPipePeau = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes]
+ edRadFPiPo = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ]
+ fsFissuExt = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces de fissure externes au pipe]
+ edFisExtPe = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)]
+ edFisExtPi = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge commun au pipe des faces de fissure externes]
+ facesPeaux = [None for i in range(nbFacesFilling)] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes)
+ edCircPeau = [ [] for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
+ ptCircPeau = [ [] for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
+ gpedgeBord = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
+ gpedgeVifs = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupes subshape des edges aux arêtes vives entre fillings
+ edFissPeau = [ [] for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
+ ptFisExtPi = [ [] for i in range(nbFacesFilling)] # pour chaque face de peau : [point commun edFissPeau edCircPeau]
+
+ for ifil, partitionPeauFissFond in enumerate(partitionsPeauFissFond):
+ fillingFaceExterne = facesDefaut[ifil]
+ fillingSansDecoupe = fillconts[idFilToCont[ifil]]
+ if partitionPeauFissFond is not None:
+ logging.debug("traitement partitionPeauFissFond %s", ifil)
+ # -----------------------------------------------------------------------
+ # --- identification edges fond de fissure, edges pipe sur la face de fissure,
+ # edges prolongées
+
+ edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss))
+ geompy.addToStudyInFather(partitionPeauFissFond, edgesPipeC, "edgesPipeFiss")
+ edgesFondC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesFondFiss))
+ geompy.addToStudyInFather(partitionPeauFissFond, edgesFondC, "edgesFondFiss")
+
+ if aretesVivesC is None:
+ [edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
+ [facesInside, facesOutside, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
+ else:
+ [edgesInside, edgesOutside, edgesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
+ [facesInside, facesOutside, facesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
+
+ edgesPipeIn = geompy.GetSharedShapesMulti([edgesPipeC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"])
+ verticesPipePeau = []
+
+ for i, edge in enumerate(edgesPipeIn):
+ try:
+ vertices = geompy.GetSharedShapesMulti([edge, geompy.MakeCompound(facesOnside)], geompy.ShapeType["VERTEX"])
+ verticesPipePeau.append(vertices[0])
+ name = "edgePipeIn%d"%i
+ geompy.addToStudyInFather(partitionPeauFissFond, edge, name)
+ name = "verticePipePeau%d"%i
+ geompy.addToStudyInFather(partitionPeauFissFond, vertices[0], name)
+ logging.debug("edgePipeIn%s coupe les faces OnSide", i)
+ except:
+ logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i)
+ edgesFondOut = []
+ edgesFondIn =[]
+ if len(verticesPipePeau) > 0: # au moins une extrémité du pipe sur cette face de peau
+ tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesOutside)], geompy.ShapeType["EDGE"])
+ edgesFondOut = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3]
+ tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"])
+ edgesFondIn = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3]
+ verticesEdgesFondIn = [] # les points du fond de fissure au débouché du pipe sur la peau (indice de edgesFondIn)
+ pipexts = [] # les segments de pipe associés au points de fond de fissure débouchants (même indice)
+ cercles = [] # les cercles de generation des pipes débouchant (même indice)
+ facesFissExt = [] # les faces de la fissure externe associés au points de fond de fissure débouchants (même indice)
+ edgesFissExtPeau = [] # edges des faces de fissure externe sur la peau (même indice)
+ edgesFissExtPipe = [] # edges des faces de fissure externe sur le pipe (même indice)
+ #logging.debug("edgesFondIn %s", edgesFondIn)
+
+ edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
+ for i,edge in enumerate(edgesFondFiss):
+ geompy.addToStudyInFather(wireFondFiss, edge, "edgeFondFiss%d"%i)
+
+ for iedf, edge in enumerate(edgesFondIn):
+ name = "edgeFondIn%d"%iedf
+ geompy.addToStudyInFather(partitionPeauFissFond, edge, name)
+ dist = [ geompy.MinDistance(pt, edge) for pt in verticesPipePeau]
+ ptPeau = verticesPipePeau[dist.index(min(dist))] # le point de verticesPipePeau a distance minimale de l'edge
+ [u, PointOnEdge, EdgeInWireIndex] = geompy.MakeProjectionOnWire(ptPeau, wireFondFiss)
+ logging.debug("u:%s, EdgeInWireIndex: %s, len(edgesFondFiss): %s", u, EdgeInWireIndex, len(edgesFondFiss))
+ localEdgeInFondFiss = edgesFondFiss[EdgeInWireIndex]
+ centre = PointOnEdge
+ centre2 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, u)
+ geompy.addToStudyInFather(partitionPeauFissFond, centre2, "centre2_%d"%iedf)
+ verticesEdgesFondIn.append(centre)
+ name = "verticeEdgesFondIn%d"%iedf
+ geompy.addToStudyInFather(partitionPeauFissFond, centre, name)
+ norm = geompy.MakeTangentOnCurve(localEdgeInFondFiss, u)
+ geompy.addToStudyInFather(partitionPeauFissFond, centre, "norm%d"%iedf)
+ cercle = geompy.MakeCircle(centre, norm, rayonPipe)
+ geompy.addToStudyInFather(partitionPeauFissFond, cercle, "cerclorig%d"%iedf)
+ [vertex] = geompy.ExtractShapes(cercle, geompy.ShapeType["VERTEX"], False)
+ vec1 = geompy.MakeVector(centre, vertex)
+ vec2 = geompy.MakeVector(centre, ptPeau)
+ angle = geompy.GetAngleRadians(vec1, vec2)
+ # cas général : on reconstitue une portion de pipe, avec l'arête de couture qui coincide
+ # avec la face de fissure, au niveau du débouché sur la face externe
+ # cas dégénéré : le pipe débouche perpendiculairement à une surface plane à l'origine.
+ # La partition filling / pipe reconstruit échoue.
+ # - Si on partitionne le filling avec un simple pipe obtenu par extrusion droite du cercle,
+ # cela donne un point en trop sur le cercle.
+ # - Si on prend une vraie surface plane (pas un filling), on peut faire la partition avec
+ # les pipes reconstruits
+ logging.debug("angle=%s", angle)
+ #if abs(angle) > 1.e-7:
+ sommetAxe = geompy.MakeTranslationVector(centre, norm)
+ pm = produitMixte(centre, vertex, ptPeau, sommetAxe)
+ if pm > 0: # ajout de pi a (-)angle pour éviter des points confondus (partition échoue) dans les cas dégénérés
+ cercle = geompy.MakeRotation(cercle, norm, angle + math.pi)
+ else:
+ cercle = geompy.MakeRotation(cercle, norm, -angle + math.pi)
+ name = "cercle%d"%iedf
+ geompy.addToStudyInFather(partitionPeauFissFond, cercle, name)
+ cercles.append(cercle)
+
+ # --- estimation de la longueur du pipe necessaire de part et d'autre du point de sortie
+ if aretesVivesC is None:
+ faceTestPeau = fillingFaceExterne
+ else:
+ faceTestPeau = facesDefaut[ifil]
+ sideCentre = whichSide(faceTestPeau, centre)
+ locPt0 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, 0.0)
+ locPt1 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, 1.0)
+ sidePt0 = whichSide(faceTestPeau, locPt0)
+ sidePt1 = whichSide(faceTestPeau, locPt1)
+ logging.debug("position centre cercle: %s, extremité edge u0: %s, u1: %s", sideCentre, sidePt0, sidePt1)
+ normFace = geompy.GetNormal(faceTestPeau, ptPeau)
+ inclPipe = abs(geompy.GetAngleRadians(norm, normFace))
+ lgp = max(rayonPipe/2., abs(3*rayonPipe*math.tan(inclPipe)))
+ logging.debug("angle inclinaison Pipe en sortie: %s degres, lgp: %s", inclPipe*180/math.pi, lgp)
+
+ # --- position des points extremite du pipe sur l'edge debouchante
+ # il faut la distance curviligne ofp du point central par rapport à une extrémité de l'edge débouchante
+ locEdgePart = geompy.MakePartition([localEdgeInFondFiss],[centre], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
+ edgesLoc = geompy.ExtractShapes(locEdgePart, geompy.ShapeType["EDGE"], False)
+ edgesLocSorted =[(geompy.MinDistance(edge, locPt0), kk, edge) for kk, edge in enumerate(edgesLoc)]
+ edgesLocSorted.sort()
+ ofp = geompy.BasicProperties(edgesLocSorted[0][2])[0] # distance curviligne centre locPt0
+ logging.debug("distance curviligne centre extremite0: %s", ofp)
+ p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0)
+ p2 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp -lgp, locPt0)
+ geompy.addToStudyInFather(wireFondFiss, p1, "p1_%d"%iedf)
+ geompy.addToStudyInFather(wireFondFiss, p2, "p2_%d"%iedf)
+
+ edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
+ edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True)
+ for edp in edps:
+ if geompy.MinDistance(centre, edp) < 1.e-3:
+ pipext = geompy.MakePipe(cercle, edp)
+ name = "pipeExt%d"%iedf
+ geompy.addToStudyInFather(partitionPeauFissFond, pipext, name)
+ pipexts.append(pipext)
+
+ for face in facesInside:
+ logging.debug("recherche edges communes entre une face inside et (faces onside, edges pipe et fond débouchante)")
+ edgesPeauFis = []
+ edgesPipeFis = []
+ edgesPipeFnd = []
+ try:
+ edgesPeauFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(facesOnside), face], geompy.ShapeType["EDGE"])
+ logging.debug(" faces onside %s",edgesPeauFis)
+ edgesPipeFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesPipeIn), face], geompy.ShapeType["EDGE"])
+ logging.debug(" edgesPipeIn %s", edgesPipeFis)
+ edgesPipeFnd = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesFondIn), face], geompy.ShapeType["EDGE"])
+ logging.debug(" edgesFondIn %s ", edgesPipeFnd)
+ except:
+ logging.debug(" pb edges communes %s %s %s",edgesPeauFis, edgesPipeFis, edgesPipeFnd)
+ pass
+ if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0):
+ dist = geompy.MinDistance(geompy.MakeCompound(edgesPeauFis), ptPeau)
+ logging.debug(" test distance extrémité reference %s", dist)
+ if dist < 1.e-3: # c'est la face de fissure externe associée
+ logging.debug(" face %s inside ajoutée", i)
+ facesFissExt.append(face)
+ name="faceFissExt%d"%iedf
+ geompy.addToStudyInFather(partitionPeauFissFond, face, name)
+ dist = 1.
+ for ipe, edpe in enumerate(edgesPeauFis):
+ for ipi, edpi in enumerate(edgesPipeFis):
+ dist = geompy.MinDistance(edpe, edpi)
+ if dist < 1.e-3:
+ edgesFissExtPeau.append(edpe)
+ name="edgesFissExtPeau%d"%iedf
+ geompy.addToStudyInFather(partitionPeauFissFond, edpe, name)
+ edgesFissExtPipe.append(edpi)
+ name="edgesFissExtPipe%d"%iedf
+ geompy.addToStudyInFather(partitionPeauFissFond, edpi, name)
+ break
+ if dist < 1.e-3:
+ break
+
+ if len(verticesPipePeau) == 0: # aucune extrémité du pipe sur cette face de peau
+ # il faut recenser les edges de fissure sur la face de peau
+ j = 0
+ for face in facesInside:
+ edgesPeauFis = []
+ edgesPipeFis = []
+ edgesPipeFnd = []
+ try:
+ edgesPeauFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(facesOnside), face], geompy.ShapeType["EDGE"])
+ edgesPipeFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesPipeIn), face], geompy.ShapeType["EDGE"])
+ edgesPipeFnd = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesFondIn), face], geompy.ShapeType["EDGE"])
+ except:
+ pass
+ if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0):
+ edgesFissExtPeau.append(edgesPeauFis[0])
+ name="edgesFissExtPeau%d"%j
+ geompy.addToStudyInFather(partitionPeauFissFond, edgesPeauFis[0], name)
+ j += 1
+
+ # -----------------------------------------------------------------------
+ # --- identification faces de peau : face de peau percée du pipe, extrémités du pipe
+ # La partition avec le pipe peut créer un vertex (et un edge) de trop sur le cercle projeté,
+ # quand le cercle est très proche de la face.
+ # dans ce cas, la projection du cercle sur la face suivie d'une partition permet
+ # d'éviter le point en trop
+
+ facesAndFond = facesOnside
+ facesAndFond.append(wireFondFiss)
+ try:
+ partitionPeauByPipe = geompy.MakePartition(facesAndFond, pipexts, [], [], geompy.ShapeType["FACE"], 0, [], 1)
+ except:
+ logging.debug("probleme partition face pipe, contournement avec MakeSection")
+ sections = []
+ for pipext in pipexts:
+ sections.append(geompy.MakeSection(facesOnside[0], pipext))
+ partitionPeauByPipe = geompy.MakePartition(facesAndFond, sections, [], [], geompy.ShapeType["FACE"], 0, [], 1)
+
+ # contrôle edge en trop sur edges circulaires
+ if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
+ edgeEnTrop = []
+ outilPart = pipexts
+ facesPeau = geompy.ExtractShapes(partitionPeauByPipe, geompy.ShapeType["FACE"], False)
+ facesPeauSorted, minsur, maxsurf = sortFaces(facesPeau)
+ for i, face in enumerate(facesPeauSorted[:-1]): # on ne teste que la ou les petites faces "circulaires"
+ nbv = geompy.NumberOfEdges(face)
+ logging.debug("nombre d'edges sur face circulaire: %s", nbv)
+ if nbv > 3:
+ edgeEnTrop.append(True) # TODO : distinguer les cas avec deux faces circulaires dont l'une est correcte
+ else:
+ edgeEnTrop.append(False)
+ refaire = sum(edgeEnTrop)
+ if refaire > 0:
+ dc = [(geompy.MinDistance(verticesEdgesFondIn[0], fac), i) for i, fac in enumerate(facesPeauSorted[:-1])]
+ dc.sort()
+ logging.debug("dc sorted: %s", dc)
+ i0 = dc[0][1] # indice de facesPeauSorted qui correspond à verticesEdgesFondIn[0], donc 0 pour cercles
+ direct = (i0 == 0)
+ for i, bad in enumerate(edgeEnTrop):
+ if direct:
+ j = i
+ else:
+ j = 1-i
+ if bad:
+ outilPart[j] = geompy.MakeProjection(cercles[j],facesOnside[0])
+ pass
+ partitionPeauByPipe = geompy.MakePartition(facesAndFond, outilPart, [], [], geompy.ShapeType["FACE"], 0, [], 1)
+ pass
+
+ name="partitionPeauByPipe%d"%ifil
+ geompy.addToStudy(partitionPeauByPipe, name)
+ [edgesPeauFondIn, edgesPeauFondOut, edgesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "EDGE", 1.e-3)
+ [facesPeauFondIn, facesPeauFondOut, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3)
+
+ if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
+ facesPeauSorted, minsur, maxsurf = sortFaces(facesPeauFondOn)
+ facePeau = facesPeauSorted[-1] # la plus grande face
+ else:
+ facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
+ name="facePeau%d"%ifil
+ geompy.addToStudy(facePeau, name)
+
+ facesPipePeau = [None for i in range(len(edgesFissExtPipe))]
+ endsEdgeFond = [None for i in range(len(edgesFissExtPipe))]
+ edgeRadFacePipePeau = [None for i in range(len(edgesFissExtPipe))]
+
+ edgesListees = []
+ edgesCircPeau = []
+ verticesCircPeau = []
+ if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
+
+ for face in facesPeauSorted[:-1]: # la ou les faces débouchantes, pas la grande face de peau
+ logging.debug("examen face debouchante circulaire")
+ for i,efep in enumerate(edgesFissExtPipe):
+ dist = geompy.MinDistance(face, efep)
+ logging.debug(" distance face circulaire edge %s", dist)
+ if dist < 1e-3:
+ for ik, edpfi in enumerate(edgesPeauFondIn):
+ if geompy.MinDistance(face, edpfi) < 1e-3:
+ break
+ sharedVertices = geompy.GetSharedShapesMulti([face, edgesPeauFondIn[ik]], geompy.ShapeType["VERTEX"])
+ nameFace = "facePipePeau%d"%i
+ nameVert = "endEdgeFond%d"%i
+ nameEdge = "edgeRadFacePipePeau%d"%i
+ facesPipePeau[i] = face
+ endsEdgeFond[i] = sharedVertices[0]
+ geompy.addToStudy(face, nameFace)
+ geompy.addToStudy(sharedVertices[0], nameVert)
+ edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True)
+ for edge in edgesFace:
+ if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3:
+ edgeRadFacePipePeau[i] = edge
+ geompy.addToStudy(edge, nameEdge)
+ break
+ pass
+ pass
+ pass
+ pass
+
+ # --- edges circulaires de la face de peau et points de jonction de la face externe de fissure
+ logging.debug("facesPipePeau: %s", facesPipePeau)
+ edgesCircPeau = [None for i in range(len(facesPipePeau))]
+ verticesCircPeau = [None for i in range(len(facesPipePeau))]
+ for i,fcirc in enumerate(facesPipePeau):
+ edges = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["EDGE"])
+ grpEdgesCirc = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
+ geompy.UnionList(grpEdgesCirc, edges)
+ edgesCircPeau[i] = grpEdgesCirc
+ name = "edgeCirc%d"%i
+ geompy.addToStudyInFather(facePeau, grpEdgesCirc, name)
+ edgesListees = edgesListees + edges
+ vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
+ grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
+ geompy.UnionList(grpVertCircPeau, vertices)
+ verticesCircPeau[i] = grpVertCircPeau
+ name = "pointEdgeCirc%d"%i
+ geompy.addToStudyInFather(facePeau, grpVertCircPeau, name)
+ pass
+ pass # --- au moins une extrémité du pipe sur cette face de peau
+
+ # --- edges de bord de la face de peau
+
+ edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
+ edgesBords = []
+ for i, edge in enumerate(edgesFilling):
+ edgepeau = geompy.GetInPlace(facePeau, edge)
+ name = "edgepeau%d"%i
+ geompy.addToStudyInFather(facePeau,edgepeau, name)
+ logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau))
+ if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:
+ logging.debug(" EDGES multiples")
+ edgs = geompy.ExtractShapes(edgepeau, geompy.ShapeType["EDGE"], False)
+ edgesBords += edgs
+ edgesListees += edgs
+ else:
+ logging.debug(" EDGE")
+ edgesBords.append(edgepeau)
+ edgesListees.append(edgepeau)
+ groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
+ geompy.UnionList(groupEdgesBordPeau, edgesBords)
+ bordsVifs = None
+ if aretesVivesC is not None:
+ bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC)
+ if bordsVifs is not None:
+ geompy.addToStudyInFather(facePeau, bordsVifs, "bordsVifs")
+ groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs)
+ grptmp = None
+ if len(aretesVivesCoupees) > 0:
+ grpC = geompy.MakeCompound(aretesVivesCoupees)
+ grptmp = geompy.GetInPlace(facePeau, grpC)
+ if grptmp is not None:
+ grpnew = geompy.CutGroups(bordsVifs, grptmp) # ce qui est nouveau dans bordsVifs
+ else:
+ grpnew = bordsVifs
+ if grpnew is not None:
+ edv = geompy.ExtractShapes(grpnew, geompy.ShapeType["EDGE"], False)
+ aretesVivesCoupees += edv
+ logging.debug("aretesVivesCoupees %s",aretesVivesCoupees)
+ geompy.addToStudyInFather(facePeau, groupEdgesBordPeau , "EdgesBords")
+
+ # --- edges de la face de peau partagées avec la face de fissure
+
+ edgesPeau = geompy.ExtractShapes(facePeau, geompy.ShapeType["EDGE"], False)
+ edges = substractSubShapes(facePeau, edgesPeau, edgesListees)
+ edgesFissurePeau = []
+ if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
+ edgesFissurePeau = [None for i in range(len(verticesCircPeau))] # edges associés aux extrémités du pipe, en premier
+ for edge in edges:
+ for i, grpVert in enumerate(verticesCircPeau):
+ if (geompy.MinDistance(grpVert, edge) < 1.e-3) and (edge not in edgesFissurePeau):
+ edgesFissurePeau[i] = edge
+ name = "edgeFissurePeau%d"%i
+ geompy.addToStudyInFather(facePeau, edge, name)
+ for edge in edges: # on ajoute après les edges manquantes
+ if edge not in edgesFissurePeau:
+ edgesFissurePeau.append(edge)
+ else:
+ for i, edge in enumerate(edges):
+ edgesFissurePeau.append(edge)
+ name = "edgeFissurePeau%d"%i
+ geompy.addToStudyInFather(facePeau, edge, name)
+
+
+ ptEdgeFond[ifil] = endsEdgeFond # pour chaque face [points edge fond de fissure aux débouchés du pipe]
+ fsPipePeau[ifil] = facesPipePeau # pour chaque face [faces du pipe débouchantes]
+ edRadFPiPo[ifil] = edgeRadFacePipePeau # pour chaque face [edge radiale des faces du pipe débouchantes ]
+ fsFissuExt[ifil] = facesFissExt # pour chaque face [faces de fissure externes au pipe]
+ edFisExtPe[ifil] = edgesFissExtPeau # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)]
+ edFisExtPi[ifil] = edgesFissExtPipe # pour chaque face [edge commun au pipe des faces de fissure externes]
+ facesPeaux[ifil] = facePeau # pour chaque face : la face de peau finale a mailler (percee des faces débouchantes)
+ edCircPeau[ifil] = edgesCircPeau # pour chaque face de peau : [groupe subshapes edges circulaires aux débouchés du pipe]
+ ptCircPeau[ifil] = verticesCircPeau # pour chaque face de peau : [groupe subshapes points sur edges circulaires aux débouchés du pipe]
+ gpedgeBord[ifil] = groupEdgesBordPeau # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
+ gpedgeVifs[ifil] = bordsVifs # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives
+ edFissPeau[ifil] = edgesFissurePeau # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
+ ptFisExtPi[ifil] = verticesPipePeau # pour chaque face de peau : [point commun edFissPeau edCircPeau]
+
+ # -----------------------------------------------------------------------
+ # fin de la boucle sur les faces de filling
+ # -----------------------------------------------------------------------
+
+ for i, avc in enumerate(aretesVivesCoupees):
+ name = "areteViveCoupee%d"%i
+ geompy.addToStudy(avc, name)
+
+ # --- identification des faces et edges de fissure externe pour maillage
+
+ facesFissExt = []
+ edgesFissExtPeau = []
+ edgesFissExtPipe = []
+ for ifil in range(nbFacesFilling): # TODO: éliminer les doublons (comparer tous les vertices triés, avec mesure de distance ?)
+ facesFissExt += fsFissuExt[ifil]
+ edgesFissExtPeau += edFisExtPe[ifil]
+ edgesFissExtPipe += edFisExtPi[ifil]
+ logging.debug("---------------------------- identification faces de fissure externes au pipe :%s ", len(facesFissExt))
+ # regroupement des faces de fissure externes au pipe.
+
+ if len(facesFissExt) > 1:
+ faceFissureExterne = geompy.MakePartition(facesFissExt, [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ edgesPipeFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesPipeFiss)) # edgesFissExtPipe peut ne pas couvrir toute la longueur
+ # edgesPeauFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesFissExtPeau))
+ # il peut manquer des edges de faceFissureExterne en contact avec la peau dans edgesFissExtPeau
+ (isDone, closedFreeBoundaries, openFreeBoundaries) = geompy.GetFreeBoundary(faceFissureExterne)
+ edgesBordFFE = []
+ for bound in closedFreeBoundaries:
+ edgesBordFFE += geompy.ExtractShapes(bound, geompy.ShapeType["EDGE"], False)
+ edgesBordFFEid = [ (ed,geompy.GetSubShapeID(faceFissureExterne, ed)) for ed in edgesBordFFE]
+ logging.debug("edgesBordFFEid %s", edgesBordFFEid)
+ edgesPPE = geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False)
+ edgesPPEid = [ geompy.GetSubShapeID(faceFissureExterne, ed) for ed in edgesPPE]
+ logging.debug("edgesPPEid %s", edgesPPEid)
+ edgesPFE = [ edid[0] for edid in edgesBordFFEid if edid[1] not in edgesPPEid] # on garde toutes les edges de bord non en contact avec le pipe
+ logging.debug("edgesPFE %s", edgesPFE)
+ edgesPeauFissureExterneC = geompy.MakeCompound(edgesPFE)
+ else:
+ faceFissureExterne = facesFissExt[0]
+ edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau)
+ edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe)
+ wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False))
+ geompy.addToStudy(faceFissureExterne, "faceFissureExterne")
+ geompy.addToStudyInFather(faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
+ geompy.addToStudyInFather(faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
+
+ logging.debug("---------------------------- Preparation Maillage du Pipe --------------")
+ # -----------------------------------------------------------------------
+ # --- preparation maillage du pipe :
+ # - détections des points a respecter : jonction des edges/faces constituant
+ # la face de fissure externe au pipe
+ # - points sur les edges de fond de fissure et edges pipe/face fissure,
+ # - vecteurs tangents au fond de fissure (normal au disque maillé)
+
+ # --- option de maillage selon le rayon de courbure du fond de fissure
+ lenEdgeFondExt = 0
+ for edff in edgesFondFiss:
+ lenEdgeFondExt += geompy.BasicProperties(edff)[0]
+
+ disfond = []
+ for filling in facesDefaut:
+ disfond.append(geompy.MinDistance(centreFondFiss, filling))
+ disfond.sort()
+ rcourb = disfond[0]
+ nbSegQuart = 5 # on veut 5 segments min sur un quart de cercle
+ alpha = math.pi/(4*nbSegQuart)
+ deflexion = rcourb*(1.0 -math.cos(alpha))
+ lgmin = lenSegPipe*0.25
+ lgmax = lenSegPipe*1.5
+ logging.debug("rcourb: %s, lenFond:%s, deflexion: %s, lgmin: %s, lgmax: %s", rcourb, lenEdgeFondExt, deflexion, lgmin, lgmax)
+
+ meshFondExt = smesh.Mesh(wireFondFiss)
+ algo1d = meshFondExt.Segment()
+ hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
+ isDone = meshFondExt.Compute()
+
+ ptGSdic = {} # dictionnaire [paramètre sur la courbe] --> point géométrique
+ allNodeIds = meshFondExt.GetNodesId()
+ for nodeId in allNodeIds:
+ xyz = meshFondExt.GetNodeXYZ(nodeId)
+ #logging.debug("nodeId %s, coords %s", nodeId, str(xyz))
+ pt = geompy.MakeVertex(xyz[0], xyz[1], xyz[2])
+ u, PointOnEdge, EdgeInWireIndex = geompy.MakeProjectionOnWire(pt, wireFondFiss) # u compris entre 0 et 1
+ edgeOrder = edgesIdByOrientation[EdgeInWireIndex]
+ ptGSdic[(edgeOrder, EdgeInWireIndex, u)] = pt
+ #logging.debug("nodeId %s, u %s", nodeId, str(u))
+ usort = sorted(ptGSdic)
+ logging.debug("nombre de points obtenus par deflexion %s",len(usort))
+
+ centres = []
+ origins = []
+ normals = []
+ for edu in usort:
+ ied = edu[1]
+ u = edu[2]
+ vertcx = ptGSdic[edu]
+ norm = geompy.MakeTangentOnCurve(edgesFondFiss[ied], u)
+ plan = geompy.MakePlane(vertcx, norm, 3*rayonPipe)
+ part = geompy.MakePartition([plan], [wirePipeFiss], [], [], geompy.ShapeType["VERTEX"], 0, [], 0)
+ liste = geompy.ExtractShapes(part, geompy.ShapeType["VERTEX"], True)
+ if len(liste) == 5: # 4 coins du plan plus intersection recherchée
+ for point in liste:
+ if geompy.MinDistance(point, vertcx) < 1.1*rayonPipe: # les quatre coins sont plus loin
+ vertpx = point
+ break
+ centres.append(vertcx)
+ origins.append(vertpx)
+ normals.append(norm)
+# name = "vertcx%d"%i
+# geompy.addToStudyInFather(wireFondFiss, vertcx, name)
+# name = "vertpx%d"%i
+# geompy.addToStudyInFather(wireFondFiss, vertpx, name)
+# name = "plan%d"%i
+# geompy.addToStudyInFather(wireFondFiss, plan, name)
+
+ # --- maillage du pipe étendu, sans tenir compte de l'intersection avec la face de peau
+
+ logging.debug("nbsegCercle %s", nbsegCercle)
+
+ # -----------------------------------------------------------------------
+ # --- points géométriques
+
+ gptsdisks = [] # vertices géométrie de tous les disques
+ raydisks = [[] for i in range(nbsegCercle)]
+ for i in range(len(centres)): # boucle sur les disques
+ gptdsk = [] # vertices géométrie d'un disque
+ vertcx = centres[i]
+ vertpx = origins[i]
+ normal = normals[i]
+ vec1 = geompy.MakeVector(vertcx, vertpx)
+
+ points = [vertcx] # les points du rayon de référence
+ for j in range(nbsegRad):
+ pt = geompy.MakeTranslationVectorDistance(vertcx, vec1, (j+1)*float(rayonPipe)/nbsegRad)
+ points.append(pt)
+ gptdsk.append(points)
+ pt = geompy.MakeTranslationVectorDistance(vertcx, vec1, 1.5*rayonPipe)
+ rayon = geompy.MakeLineTwoPnt(vertcx, pt)
+ raydisks[0].append(rayon)
+
+ for k in range(nbsegCercle-1):
+ angle = (k+1)*2*math.pi/nbsegCercle
+ pts = [vertcx] # les points d'un rayon obtenu par rotation
+ for j in range(nbsegRad):
+ pt = geompy.MakeRotation(points[j+1], normal, angle)
+ pts.append(pt)
+ gptdsk.append(pts)
+ ray = geompy.MakeRotation(rayon, normal, angle)
+ raydisks[k+1].append(ray)
+
+ gptsdisks.append(gptdsk)
+
+ # -----------------------------------------------------------------------
+ # --- recherche des points en trop (externes au volume à remailler)
+ # - on associe chaque extrémité du pipe à une face filling
+ # - on part des disques aux extrémités du pipe
+ # - pour chaque disque, on prend les vertices de géométrie,
+ # on marque leur position relative à la face.
+ # - on s'arrete quand tous les noeuds sont dedans
+
+ logging.debug("---------------------------- recherche des points du pipe a éliminer --------------")
+
+ pt0 = centres[0]
+ pt1 = centres[-1]
+ idFillingFromBout = [None, None] # contiendra l'index du filling pour les extrémités 0 et 1
+ for ifil in range(nbFacesFilling):
+ for ipt, pt in enumerate(ptEdgeFond[ifil]): # il y a un ou deux points débouchant sur cette face
+ if geompy.MinDistance(pt,pt0) < geompy.MinDistance(pt,pt1): # TODO: trouver plus fiable pour les cas tordus...
+ idFillingFromBout[0] = ifil
+ else:
+ idFillingFromBout[1] = ifil
+ logging.debug("association bouts du pipe - faces de filling: %s", idFillingFromBout)
+
+ facesPipePeau = []
+ edgeRadFacePipePeau = []
+ for ifil in range(nbFacesFilling):
+ facesPipePeau += fsPipePeau[ifil]
+ edgeRadFacePipePeau += edRadFPiPo[ifil]
+
+ logging.debug("recherche des disques de noeuds complètement internes")
+ idisklim = [] # indices des premier et dernier disques internes
+ idiskout = [] # indices des premier et dernier disques externes
+ for bout in range(2):
+ if bout == 0:
+ idisk = -1
+ inc = 1
+ numout = -1
+ else:
+ idisk = len(gptsdisks)
+ inc = -1
+ numout = len(gptsdisks)
+ inside = False
+ outside = True
+ while not inside:
+ idisk = idisk + inc
+ logging.debug("examen disque %s", idisk)
+ gptdsk = gptsdisks[idisk]
+ inside = True
+ for k in range(nbsegCercle):
+ points = gptdsk[k]
+ for j, pt in enumerate(points):
+ side = whichSideVertex(facesDefaut[idFillingFromBout[bout]], pt)
+ if side < 0:
+ if outside: # premier point detecté dedans
+ outside = False
+ numout = idisk -inc # le disque précédent était dehors
+ else:
+ inside = False # ce point est dehors
+ if not inside and not outside:
+ break
+ idisklim.append(idisk) # premier et dernier disques internes
+ idiskout.append(numout) # premier et dernier disques externes
+
+ # --- listes de nappes radiales en filling à chaque extrémité débouchante
+ facesDebouchantes = [False, False]
+ idFacesDebouchantes = [-1, -1] # contiendra les indices des faces disque débouchantes (facesPipePeau)
+ listNappes =[]
+ for i, idisk in enumerate(idisklim):
+ numout = idiskout[i]
+ logging.debug("extremité %s, indices disques interne %s, externe %s",i, idisk, numout)
+ nappes = []
+ if (idisk != 0) and (idisk != len(gptsdisks)-1): # si extrémité débouchante
+ for k in range(nbsegCercle):
+ if i == 0:
+ iddeb = max(0, numout)
+ idfin = max(iddeb+3,idisk+1) # il faut 3 rayons pour faire un filling qui suive le fond de fissure
+ #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
+ comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
+ name='compoundRay%d'%k
+ geompy.addToStudy(comp, name)
+ else:
+ idfin = min(len(gptsdisks), numout+1)
+ iddeb = min(idfin-3, idisk) # il faut 3 rayons pour faire un filling qui suive le fond de fissure
+ #logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
+ comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
+ name='compoundRay%d'%k
+ geompy.addToStudy(comp, name)
+ nappe = geompy.MakeFilling(comp, 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default)
+ nappes.append(nappe)
+ name='nappe%d'%k
+ geompy.addToStudy(nappe, name)
+ facesDebouchantes[i] = True
+ listNappes.append(nappes)
+
+ # --- mise en correspondance avec les indices des faces disque débouchantes (facesPipePeau)
+ for i, nappes in enumerate(listNappes):
+ if facesDebouchantes[i]:
+ for k, face in enumerate(facesPipePeau):
+ edge = geompy.MakeSection(face, nappes[0])
+ if geompy.NbShapes(edge, geompy.ShapeType["EDGE"]) > 0:
+ idFacesDebouchantes[i] = k
+ break
+ logging.debug("idFacesDebouchantes: %s", idFacesDebouchantes)
+
+ # --- construction des listes d'edges radiales sur chaque extrémité débouchante
+ listEdges = []
+ for i, nappes in enumerate(listNappes):
+ id = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau)
+ if id < 0:
+ listEdges.append([])
+ else:
+ face = facesPipePeau[id]
+ edges = [edgeRadFacePipePeau[id]]
+ for k, nappe in enumerate(nappes):
+ if k > 0:
+ obj = geompy.MakeSection(face, nappes[k]) # normalement une edge, parfois un compound d'edges dont un tout petit
+ edge = obj
+ vs = geompy.ExtractShapes(obj, geompy.ShapeType["VERTEX"], False)
+ if len(vs) > 2:
+ eds = geompy.ExtractShapes(obj, geompy.ShapeType["EDGE"], False)
+ [edsorted, minl,maxl] = sortEdges(eds)
+ edge = edsorted[-1]
+ else:
+ maxl = geompy.BasicProperties(edge)[0]
+ if maxl < 0.01: # problème MakeSection
+ logging.debug("problème MakeSection recherche edge radiale %s, longueur trop faible: %s, utilisation partition", k, maxl)
+ partNappeFace = geompy.MakePartition([face, nappes[k]], [] , [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ edps= geompy.ExtractShapes(partNappeFace, geompy.ShapeType["EDGE"], False)
+ ednouv = []
+ for ii, ed in enumerate(edps):
+ vxs = geompy.ExtractShapes(ed, geompy.ShapeType["VERTEX"], False)
+ distx = [geompy.MinDistance(vx, face) for vx in vxs]
+ distx += [geompy.MinDistance(vx, nappes[k]) for vx in vxs]
+ dmax = max(distx)
+ logging.debug(" dmax %s",dmax)
+ if dmax < 0.01:
+ ednouv.append(ed)
+ logging.debug(" edges issues de la partition: %s", ednouv)
+ for ii, ed in enumerate(ednouv):
+ geompy.addToStudy(ed, "ednouv%d"%ii)
+ [edsorted, minl,maxl] = sortEdges(ednouv)
+ logging.debug(" longueur edge trouvée: %s", maxl)
+ edge = edsorted[-1]
+ edges.append(edge)
+ name = 'edgeEndPipe%d'%k
+ geompy.addToStudy(edge, name)
+ listEdges.append(edges)
+
+ # --- création des points du maillage du pipe sur la face de peau
+ for i, edges in enumerate(listEdges):
+ id = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau)
+ if id >= 0:
+ gptdsk = []
+ if id > 0: # id vaut 0 ou 1
+ id = -1 # si id vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face)
+ centre = ptEdgeFond[idFillingFromBout[i]][id]
+ name = "centre%d"%id
+ geompy.addToStudy(centre, name)
+ vertPipePeau = ptFisExtPi[idFillingFromBout[i]][id]
+ geompy.addToStudyInFather(centre, vertPipePeau, "vertPipePeau")
+ grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes
+ edgesCirc = []
+ for grpEdgesCirc in grpsEdgesCirc:
+ edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False)
+ for k, edge in enumerate(edges):
+ extrems = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True)
+ if geompy.MinDistance(centre, extrems[0]) < geompy.MinDistance(centre, extrems[1]):
+ bout = extrems[1]
+ else:
+ bout = extrems[0]
+ # ajustement du point extrémité (bout) sur l'edge circulaire en face de peau
+ logging.debug("edgesCirc: %s", edgesCirc)
+ distEdgeCirc = [(geompy.MinDistance(bout, edgeCirc), k2, edgeCirc) for k2, edgeCirc in enumerate(edgesCirc)]
+ distEdgeCirc.sort()
+ logging.debug("distEdgeCirc: %s", distEdgeCirc)
+ u = projettePointSurCourbe(bout, distEdgeCirc[0][2])
+ if (abs(u) < 0.02) or (abs(1-u) < 0.02): # les points très proches d'une extrémité doivent y être mis précisément.
+ extrCircs = geompy.ExtractShapes(distEdgeCirc[0][2], geompy.ShapeType["VERTEX"], True)
+ if geompy.MinDistance(bout, extrCircs[0]) < geompy.MinDistance(bout, extrCircs[1]):
+ bout = extrCircs[0]
+ else:
+ bout = extrCircs[1]
+ pass
+ else:
+ bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u)
+ name ="bout%d"%k
+ geompy.addToStudyInFather(centre, bout, name)
+ # enregistrement des points dans la structure
+ points = []
+ for j in range(nbsegRad +1):
+ u = j/float(nbsegRad)
+ points.append(geompy.MakeVertexOnCurve(edge, u))
+ if geompy.MinDistance(bout, points[0]) < geompy.MinDistance(centre, points[0]):
+ points.reverse()
+ points[0] = centre
+ points[-1] = bout
+ gptdsk.append(points)
+ if i == 0:
+ gptsdisks[idisklim[0] -1] = gptdsk
+ idisklim[0] = idisklim[0] -1
+ else:
+ gptsdisks[idisklim[1] +1] = gptdsk
+ idisklim[1] = idisklim[1] +1
+
+ # --- ajustement precis des points sur edgesPipeFissureExterneC
+
+ edgesPFE = geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False)
+ verticesPFE = findWireIntermediateVertices(wirePipeFissureExterne) # vertices intermédiaires (des points en trop dans ptsInWireFissExtPipe)
+ idiskmin = idisklim[0] + 1 # on ne prend pas le disque sur la peau, déjà ajusté
+ idiskmax = idisklim[1] # on ne prend pas le disque sur la peau, déjà ajusté
+ idiskint = []
+ for vtx in verticesPFE:
+ distPtVt = []
+ for idisk in range(idiskmin, idiskmax):
+ gptdsk = gptsdisks[idisk]
+ pt = gptdsk[0][-1] # le point sur l'edge de la fissure externe au pipe
+ distPtVt.append((geompy.MinDistance(pt, vtx), idisk))
+ distPtVt.sort()
+ idiskint.append(distPtVt[0][1])
+ gptsdisks[idiskint[-1]][0][-1] = vtx
+ logging.debug("ajustement point sur edgePipeFissureExterne, vertex: %s %s", idiskint[-1], distPtVt[0][0])
+ for idisk in range(idiskmin, idiskmax):
+ if idisk in idiskint:
+ break
+ logging.debug("ajustement point sur edgePipeFissureExterne: %s", idisk)
+ gptdsk = gptsdisks[idisk]
+ pt = gptdsk[0][-1] # le point sur l'edge de la fissure externe au pipe
+ distPtEd = [(geompy.MinDistance(pt, edgePFE), k, edgePFE) for k, edgePFE in enumerate(edgesPFE)]
+ distPtEd.sort()
+ edgePFE = distPtEd[0][2]
+ u = projettePointSurCourbe(pt, edgePFE)
+ ptproj = geompy.MakeVertexOnCurve(edgePFE, u)
+ gptsdisks[idisk][0][-1] = ptproj
+
+ # -----------------------------------------------------------------------
+ # --- maillage effectif du pipe
+
+ logging.debug("---------------------------- maillage effectif du pipe --------------")
+ meshPipe = smesh.Mesh(None, "meshPipe")
+ fondFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "FONDFISS")
+ nodesFondFissGroup = meshPipe.CreateEmptyGroup(SMESH.NODE, "nfondfis")
+ faceFissGroup = meshPipe.CreateEmptyGroup(SMESH.FACE, "fisInPi")
+ edgeFaceFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeFaceFiss")
+ edgeCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe0")
+ edgeCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe1")
+ faceCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe0")
+ faceCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe1")
+ mptsdisks = [] # vertices maillage de tous les disques
+ mEdges = [] # identifiants edges maillage fond de fissure
+ mEdgeFaces = [] # identifiants edges maillage edge face de fissure externe
+ mFaces = [] # identifiants faces maillage fissure
+ mVols = [] # identifiants volumes maillage pipe
+
+ mptdsk = None
+ for idisk in range(idisklim[0], idisklim[1]+1): # boucle sur les disques internes
+
+ # -----------------------------------------------------------------------
+ # --- points
+
+ gptdsk = gptsdisks[idisk]
+ if idisk > idisklim[0]:
+ oldmpts = mptdsk
+ mptdsk = [] # vertices maillage d'un disque
+ for k in range(nbsegCercle):
+ points = gptdsk[k]
+ mptids = []
+ for j, pt in enumerate(points):
+ if j == 0 and k > 0:
+ id = mptdsk[0][0]
+ else:
+ coords = geompy.PointCoordinates(pt)
+ id = meshPipe.AddNode(coords[0], coords[1], coords[2])
+ mptids.append(id)
+ mptdsk.append(mptids)
+ mptsdisks.append(mptdsk)
+
+ # -----------------------------------------------------------------------
+ # --- groupes edges cercles debouchants
+
+ if idisk == idisklim[0]:
+ pts = []
+ for k in range(nbsegCercle):
+ pts.append(mptdsk[k][-1])
+ edges = []
+ for k in range(len(pts)):
+ k1 = (k+1)%len(pts)
+ idEdge = meshPipe.AddEdge([pts[k], pts[k1]])
+ edges.append(idEdge)
+ edgeCircPipe0Group.Add(edges)
+
+ if idisk == idisklim[1]:
+ pts = []
+ for k in range(nbsegCercle):
+ pts.append(mptdsk[k][-1])
+ edges = []
+ for k in range(len(pts)):
+ k1 = (k+1)%len(pts)
+ idEdge = meshPipe.AddEdge([pts[k], pts[k1]])
+ edges.append(idEdge)
+ edgeCircPipe1Group.Add(edges)
+
+ # -----------------------------------------------------------------------
+ # --- groupes faces debouchantes
+
+ if idisk == idisklim[0]:
+ faces = []
+ for j in range(nbsegRad):
+ for k in range(nbsegCercle):
+ k1 = k+1
+ if k == nbsegCercle-1:
+ k1 = 0
+ if j == 0:
+ idf = meshPipe.AddFace([mptdsk[k][0], mptdsk[k][1], mptdsk[k1][1]]) # triangle
+ else:
+ idf = meshPipe.AddFace([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j]]) # quadrangle
+ faces.append(idf)
+ faceCircPipe0Group.Add(faces)
+
+ if idisk == idisklim[1]:
+ faces = []
+ for j in range(nbsegRad):
+ for k in range(nbsegCercle):
+ k1 = k+1
+ if k == nbsegCercle-1:
+ k1 = 0
+ if j == 0:
+ idf = meshPipe.AddFace([mptdsk[k][0], mptdsk[k][1], mptdsk[k1][1]]) # triangle
+ else:
+ idf = meshPipe.AddFace([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j]]) # quadrangle
+ faces.append(idf)
+ faceCircPipe1Group.Add(faces)
+
+ # -----------------------------------------------------------------------
+ # --- mailles volumiques, groupes noeuds et edges de fond de fissure, groupe de face de fissure
+
+ if idisk == idisklim[0]:
+ mEdges.append(0)
+ mEdgeFaces.append(0)
+ mFaces.append([0])
+ mVols.append([[0]])
+ nodesFondFissGroup.Add([mptdsk[0][0]])
+ else:
+ ide = meshPipe.AddEdge([oldmpts[0][0], mptdsk[0][0]])
+ mEdges.append(ide)
+ fondFissGroup.Add([ide])
+ nodesFondFissGroup.Add([mptdsk[0][0]])
+ ide2 = meshPipe.AddEdge([oldmpts[0][-1], mptdsk[0][-1]])
+ mEdgeFaces.append(ide2)
+ edgeFaceFissGroup.Add([ide2])
+ idFaces = []
+ idVols = []
+
+ for j in range(nbsegRad):
+ idf = meshPipe.AddFace([oldmpts[0][j], mptdsk[0][j], mptdsk[0][j+1], oldmpts[0][j+1]])
+ faceFissGroup.Add([idf])
+ idFaces.append(idf)
+
+ idVolCercle = []
+ for k in range(nbsegCercle):
+ k1 = k+1
+ if k == nbsegCercle-1:
+ k1 = 0
+ if j == 0:
+ idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1],
+ oldmpts[k][j], oldmpts[k][j+1], oldmpts[k1][j+1]])
+ else:
+ idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j],
+ oldmpts[k][j], oldmpts[k][j+1], oldmpts[k1][j+1], oldmpts[k1][j]])
+ idVolCercle.append(idv)
+ idVols.append(idVolCercle)
+
+ mFaces.append(idFaces)
+ mVols.append(idVols)
+
+ pipeFissGroup = meshPipe.CreateEmptyGroup( SMESH.VOLUME, 'PIPEFISS' )
+ nbAdd = pipeFissGroup.AddFrom( meshPipe.GetMesh() )
+
+ nb, new_mesh, new_group = meshPipe.MakeBoundaryElements(SMESH.BND_2DFROM3D, "pipeBoundaries")
+ edgesCircPipeGroup = [edgeCircPipe0Group, edgeCircPipe1Group]
+
+ # --- fin du maillage du pipe
+ # -----------------------------------------------------------------------
+ # --- edges de bord, faces défaut à respecter
+
+ aFilterManager = smesh.CreateFilterManager()
+ nbAdded, internalBoundary, _NoneGroup = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [ ])
+ criteres = []
+ unCritere = smesh.GetCriterion(SMESH.EDGE,SMESH.FT_FreeBorders,SMESH.FT_Undefined,0)
+ criteres.append(unCritere)
+ filtre = smesh.GetFilterFromCriteria(criteres)
+ bordsLibres = internalBoundary.MakeGroupByFilter( 'bords', filtre )
+ smesh.SetName(bordsLibres, 'bordsLibres')
+
+ # --- pour aider l'algo hexa-tetra à ne pas mettre de pyramides à l'exterieur des volumes repliés sur eux-mêmes
+ # on désigne les faces de peau en quadrangles par le groupe "skinFaces"
+
+ skinFaces = internalBoundary.CreateEmptyGroup( SMESH.FACE, 'skinFaces' )
+ nbAdd = skinFaces.AddFrom( internalBoundary.GetMesh() )
+
+ # --- maillage des éventuelles arêtes vives entre faces reconstruites
+
+ if len(aretesVivesCoupees) > 0:
+ aretesVivesC = geompy.MakeCompound(aretesVivesCoupees)
+ meshAretesVives = smesh.Mesh(aretesVivesC)
+ algo1d = meshAretesVives.Segment()
+ hypo1d = algo1d.LocalLength(dmoyen/3.0,[],1e-07)
+ putName(algo1d.GetSubMesh(), "aretesVives")
+ putName(algo1d, "algo1d_aretesVives")
+ putName(hypo1d, "hypo1d_aretesVives")
+ isDone = meshAretesVives.Compute()
+ logging.info("aretesVives fini")
+ grpAretesVives = meshAretesVives.CreateEmptyGroup( SMESH.EDGE, 'grpAretesVives' )
+ nbAdd = grpAretesVives.AddFrom( meshAretesVives.GetMesh() )
+
+ # -----------------------------------------------------------------------
+ # --- maillage faces de fissure
+
+ logging.debug("---------------------------- maillage faces de fissure externes au pipe :%s --------------", len(facesFissExt))
+
+ meshFaceFiss = smesh.Mesh(faceFissureExterne)
+ algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.NETGEN_1D2D)
+ hypo2d = algo2d.Parameters()
+ hypo2d.SetMaxSize( areteFaceFissure )
+ hypo2d.SetSecondOrder( 0 )
+ hypo2d.SetOptimize( 1 )
+ hypo2d.SetFineness( 2 )
+ hypo2d.SetMinSize( rayonPipe/float(nbsegRad) )
+ hypo2d.SetQuadAllowed( 0 )
+ putName(algo2d.GetSubMesh(), "faceFiss")
+ putName(algo2d, "algo2d_faceFiss")
+ putName(hypo2d, "hypo2d_faceFiss")
+
+ algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC)
+ hypo1d = algo1d.SourceEdges([ edgeFaceFissGroup ],0,0)
+ putName(algo1d.GetSubMesh(), "edgeFissPeau")
+ putName(algo1d, "algo1d_edgeFissPeau")
+ putName(hypo1d, "hypo1d_edgeFissPeau")
+
+ isDone = meshFaceFiss.Compute()
+ logging.info("meshFaceFiss fini")
+
+ grpFaceFissureExterne = meshFaceFiss.GroupOnGeom(faceFissureExterne, "fisOutPi", SMESH.FACE)
+ grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE)
+ grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE)
+
+ # --- maillage faces de peau
+
+ boutFromIfil = [None for i in range(nbFacesFilling)]
+ if idFillingFromBout[0] != idFillingFromBout[1]: # repérage des extremites du pipe quand elles débouchent sur des faces différentes
+ boutFromIfil[idFillingFromBout[0]] = 0
+ boutFromIfil[idFillingFromBout[1]] = 1
+
+ logging.debug("---------------------------- maillage faces de peau --------------")
+ meshesFacesPeau = []
+ for ifil in range(nbFacesFilling):
+ meshFacePeau = None
+ if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte
+
+ # --- edges de bord de la face de filling
+ filling = facesDefaut[ifil]
+ edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
+ groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
+ geompy.UnionList(groupEdgesBordPeau, edgesFilling)
+ geompy.addToStudyInFather(filling, groupEdgesBordPeau , "EdgesBords")
+
+ meshFacePeau = smesh.Mesh(facesDefaut[ifil])
+
+ algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
+ hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
+ putName(algo1d.GetSubMesh(), "bordsLibres", ifil)
+ putName(algo1d, "algo1d_bordsLibres", ifil)
+ putName(hypo1d, "hypo1d_bordsLibres", ifil)
+
+ else:
+
+ facePeau = facesPeaux[ifil] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes)
+ edgesCircPeau = edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
+ verticesCircPeau = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
+ groupEdgesBordPeau = gpedgeBord[ifil] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
+ bordsVifs = gpedgeVifs[ifil] # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives
+ edgesFissurePeau = edFissPeau[ifil] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
+
+ meshFacePeau = smesh.Mesh(facePeau)
+
+ algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
+ hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
+ putName(algo1d.GetSubMesh(), "bordsLibres", ifil)
+ putName(algo1d, "algo1d_bordsLibres", ifil)
+ putName(hypo1d, "hypo1d_bordsLibres", ifil)
+
+ algo1d = meshFacePeau.UseExisting1DElements(geom=geompy.MakeCompound(edgesFissurePeau))
+ hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0)
+ putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil)
+ putName(algo1d, "algo1d_edgePeauFiss", ifil)
+ putName(hypo1d, "hypo1d_edgePeauFiss", ifil)
+
+ if bordsVifs is not None:
+ algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs)
+ hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0)
+ putName(algo1d.GetSubMesh(), "bordsVifs", ifil)
+ putName(algo1d, "algo1d_bordsVifs", ifil)
+ putName(hypo1d, "hypo1d_bordsVifs", ifil)
+
+ for i, edgeCirc in enumerate(edgesCircPeau):
+ if edgeCirc is not None:
+ algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc)
+ if boutFromIfil[ifil] is None:
+ hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[i] ],0,0)
+ else:
+ hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[boutFromIfil[ifil]] ],0,0)
+ name = "cercle%d"%i
+ putName(algo1d.GetSubMesh(), name, ifil)
+ putName(algo1d, "algo1d_" + name, ifil)
+ putName(hypo1d, "hypo1d_" + name, ifil)
+
+ algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_1D2D)
+ hypo2d = algo2d.Parameters()
+ hypo2d.SetMaxSize( dmoyen )
+ hypo2d.SetOptimize( 1 )
+ hypo2d.SetFineness( 2 )
+ hypo2d.SetMinSize( rayonPipe/float(nbsegRad) )
+ hypo2d.SetQuadAllowed( 0 )
+ putName(algo2d.GetSubMesh(), "facePeau", ifil)
+ putName(algo2d, "algo2d_facePeau", ifil)
+ putName(hypo2d, "hypo2d_facePeau", ifil)
+
+ isDone = meshFacePeau.Compute()
+ logging.info("meshFacePeau %d fini", ifil)
+ GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil )
+ nbAdd = GroupFaces.AddFrom( meshFacePeau.GetMesh() )
+ meshesFacesPeau.append(meshFacePeau)
+
+ # --- regroupement des maillages du défaut
+
+ listMeshes = [internalBoundary.GetMesh(),
+ meshPipe.GetMesh(),
+ meshFaceFiss.GetMesh()]
+ for mp in meshesFacesPeau:
+ listMeshes.append(mp.GetMesh())
+
+ meshBoiteDefaut = smesh.Concatenate(listMeshes, 1, 1, 1e-05,False)
+ # pour aider l'algo hexa-tetra à ne pas mettre de pyramides à l'exterieur des volumes repliés sur eux-mêmes
+ # on désigne les faces de peau en quadrangles par le groupe "skinFaces"
+ group_faceFissOutPipe = None
+ group_faceFissInPipe = None
+ groups = meshBoiteDefaut.GetGroups()
+ for grp in groups:
+ if grp.GetType() == SMESH.FACE:
+ #if "internalBoundary" in grp.GetName():
+ # grp.SetName("skinFaces")
+ if grp.GetName() == "fisOutPi":
+ group_faceFissOutPipe = grp
+ elif grp.GetName() == "fisInPi":
+ group_faceFissInPipe = grp
+
+ # le maillage NETGEN ne passe pas toujours ==> utiliser GHS3D
+ distene=True
+ if distene:
+ algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.GHS3D)
+ else:
+ algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.NETGEN)
+ hypo3d = algo3d.MaxElementVolume(1000.0)
+ putName(algo3d.GetSubMesh(), "boiteDefaut")
+ putName(algo3d, "algo3d_boiteDefaut")
+ isDone = meshBoiteDefaut.Compute()
+ putName(meshBoiteDefaut, "boiteDefaut")
+ logging.info("meshBoiteDefaut fini")
+
+ faceFissure = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], 'FACE1' )
+ maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin,
+ zoneDefaut_internalFaces, zoneDefaut_internalEdges)
+ putName(maillageSain, nomFicSain+"_coupe")
+ extrusionFaceFissure, normfiss = shapeSurFissure(facesPortFissure)
+ maillageComplet = RegroupeSainEtDefaut(maillageSain, meshBoiteDefaut,
+ None, None, 'COMPLET', normfiss)
+
+ logging.info("conversion quadratique")
+ maillageComplet.ConvertToQuadratic( 1 )
+ logging.info("groupes")
+ groups = maillageComplet.GetGroups()
+ grps = [ grp for grp in groups if grp.GetName() == 'FONDFISS']
+ fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FONDFISS' )
+
+ logging.info("réorientation face de fissure FACE1")
+ grps = [ grp for grp in groups if grp.GetName() == 'FACE1']
+ nb = maillageComplet.Reorient2D( grps[0], normfiss, grps[0].GetID(1))
+
+ logging.info("réorientation face de fissure FACE2")
+ plansim = geompy.MakePlane(O, normfiss, 10000)
+ fissnorm = geompy.MakeMirrorByPlane(normfiss, plansim)
+ grps = [ grp for grp in groups if grp.GetName() == 'FACE2']
+ nb = maillageComplet.Reorient2D( grps[0], fissnorm, grps[0].GetID(1))
+ fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FACE2' )
+
+ logging.info("export maillage fini")
+ maillageComplet.ExportMED( fichierMaillageFissure, 0, SMESH.MED_V2_2, 1 )
+ putName(maillageComplet, nomFicFissure)
+ logging.info("fichier maillage fissure %s", fichierMaillageFissure)
+
+ if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
+
+ logging.info("maillage fissure fini")
+
+ return maillageComplet
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+import salome
+from geomsmesh import geompy
+from geomsmesh import smesh
+from salome.smesh import smeshBuilder
+import SMESH
+import math
+
+from extractionOrientee import extractionOrientee
+from sortFaces import sortFaces
+from sortEdges import sortEdges
+from eliminateDoubles import eliminateDoubles
+from substractSubShapes import substractSubShapes
+from produitMixte import produitMixte
+from findWireEndVertices import findWireEndVertices
+from getSubshapeIds import getSubshapeIds
+from putName import putName
+from distance2 import distance2
+from enleveDefaut import enleveDefaut
+from shapeSurFissure import shapeSurFissure
+from regroupeSainEtDefaut import RegroupeSainEtDefaut
+from triedreBase import triedreBase
+
+# -----------------------------------------------------------------------------
+# --- procedure complete fissure longue
+
+def insereFissureLongue(geometriesSaines, maillagesSains,
+ shapesFissure, shapeFissureParams,
+ maillageFissureParams, elementsDefaut, step=-1):
+ """
+ TODO: a completer
+ """
+ logging.info('start')
+
+ #geometrieSaine = geometriesSaines[0]
+ #maillageSain = maillagesSains[0]
+ #isHexa = maillagesSains[1]
+ shapeDefaut = shapesFissure[0] # face de fissure, debordant
+ #tailleDefaut = shapesFissure[2]
+ wiretube = shapesFissure[4] # wire fond de fissure, debordant
+ planfiss = shapesFissure[7] # plan de fissure
+ pipefiss = shapesFissure[8] # pipe, debordant
+
+ profondeur = shapeFissureParams['profondeur']
+ rayonPipe = profondeur/4.0
+
+ nomRep = maillageFissureParams['nomRep']
+ nomFicSain = maillageFissureParams['nomFicSain']
+ nomFicFissure = maillageFissureParams['nomFicFissure']
+
+ #nbsegExt = maillageFissureParams['nbsegExt'] # 5
+ #nbsegGen = maillageFissureParams['nbsegGen'] # 25
+ #nbsegRad = maillageFissureParams['nbsegRad'] # 5
+ #scaleRad = maillageFissureParams['scaleRad'] # 4
+ #nbsegCercle = maillageFissureParams['nbsegCercle'] # 6
+ #nbsegFis = maillageFissureParams['nbsegFis'] # 20
+ #lensegEllipsoide = maillageFissureParams['lensegEllipso'] # 1.0
+
+ #fichierMaillageSain = nomRep + '/' + nomFicSain + '.med'
+ fichierMaillageFissure = nomRep + '/' + nomFicFissure + '.med'
+
+ facesDefaut = elementsDefaut[0]
+ #centreDefaut = elementsDefaut[1]
+ #normalDefaut = elementsDefaut[2]
+ #extrusionDefaut = elementsDefaut[3]
+ #dmoyen = elementsDefaut[4]
+ #bordsPartages = elementsDefaut[5]
+ #fillconts = elementsDefaut[6]
+ #idFilToCont = elementsDefaut[7]
+ maillageSain = elementsDefaut[8]
+ internalBoundary = elementsDefaut[9]
+ zoneDefaut = elementsDefaut[10]
+ zoneDefaut_skin = elementsDefaut[11]
+ zoneDefaut_internalFaces = elementsDefaut[12]
+ zoneDefaut_internalEdges = elementsDefaut[13]
+
+ facePorteFissure = shapeDefaut
+ WirePorteFondFissure = wiretube
+ fillingFaceExterne = facesDefaut[0]
+ print fillingFaceExterne
+ geompy.addToStudy(fillingFaceExterne, "fillingFaceExterne")
+ edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
+
+ O, OX, OY, OZ = triedreBase()
+
+ # -----------------------------------------------------------------------------
+ # --- peau et face de fissure
+
+ # --- partition peau defaut - face de fissure prolongee - wire de fond de fissure prolongée
+ partitionPeauFissFond = geompy.MakePartition([facePorteFissure, WirePorteFondFissure, fillingFaceExterne], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ geompy.addToStudy( partitionPeauFissFond, 'partitionPeauFissFond' )
+
+ edges = geompy.ExtractShapes(WirePorteFondFissure, geompy.ShapeType["EDGE"], False)
+
+ lgmax = 0
+ imax = 0
+ for i, edge in enumerate(edges):
+ props = geompy.BasicProperties(edge)
+ lg = props[0]
+ if lg > lgmax:
+ lgmax = lg
+ imax = i
+ edgemax = edges[imax]
+ geompy.addToStudy(edgemax, 'edgemax')
+ centreFondFiss = geompy.MakeVertexOnCurve(edgemax, 0.5)
+ geompy.addToStudy(centreFondFiss, 'centreFondFiss')
+ tangentFondFiss = geompy.MakeTangentOnCurve(edgemax, 0.5)
+ geompy.addToStudy(tangentFondFiss, 'tangentFondFiss')
+
+ bord1FondFiss = geompy.MakeVertexOnCurve(edgemax, 0.0)
+ geompy.addToStudy(bord1FondFiss, 'bord1FondFiss')
+ tangentBord1FondFiss = geompy.MakeTangentOnCurve(edgemax, 0.0)
+ geompy.addToStudy(tangentBord1FondFiss, 'tangentBord1FondFiss')
+
+ bord2FondFiss = geompy.MakeVertexOnCurve(edgemax, 1.0)
+ geompy.addToStudy(bord2FondFiss, 'bord2FondFiss')
+ tangentBord2FondFiss = geompy.MakeTangentOnCurve(edgemax, 1.0)
+ geompy.addToStudy(tangentBord2FondFiss, 'tangentBord2FondFiss')
+
+ planBord1 = geompy.MakePlane(bord1FondFiss, tangentBord1FondFiss, 3*rayonPipe)
+ planBord2 = geompy.MakePlane(bord2FondFiss, tangentBord2FondFiss, 3*rayonPipe)
+ geompy.addToStudy(planBord1, 'planBord1')
+ geompy.addToStudy(planBord2, 'planBord2')
+
+ [edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
+ [facesInside, facesOutside, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
+
+ # --- partition peau -face fissure - pipe fond de fissure prolongé
+ partitionPeauFissByPipe = geompy.MakePartition([facesInside[0], facesOnside[0]], [pipefiss], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ geompy.addToStudy( partitionPeauFissByPipe, 'partitionPeauFissByPipe' )
+
+ # --- identification face de peau
+ [facesPeauFissInside, facesPeauFissOutside, facesPeauFissOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissByPipe, centreFondFiss, "FACE", 0.1, "peauFiss_bord_")
+ facesPeauSorted, minsur, maxsurf = sortFaces(facesPeauFissOnside) # 4 demi disques, une grande face
+ facePeau = facesPeauSorted[-1] # la plus grande face
+ geompy.addToStudyInFather(partitionPeauFissByPipe, facePeau, "facePeau")
+
+ # --- identification edges de bord face peau
+ edgesBords = []
+ for i, edge in enumerate(edgesFilling):
+ edgepeau = geompy.GetInPlace(facePeau, edge)
+ edgesBords.append(edgepeau)
+ groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
+ geompy.UnionList(groupEdgesBordPeau, edgesBords)
+ geompy.addToStudyInFather(facePeau, groupEdgesBordPeau , "EdgesBords")
+
+ # --- identification face fissure externe au pipe et edge commune peau fissure
+ for face in facesPeauFissInside:
+ try:
+ sharedEdges = geompy.GetSharedShapesMulti([facePeau, face], geompy.ShapeType["EDGE"])
+ if sharedEdges is not None:
+ faceFiss = face
+ edgePeauFiss = sharedEdges[0]
+ geompy.addToStudyInFather(partitionPeauFissByPipe, faceFiss, "faceFiss")
+ geompy.addToStudyInFather(faceFiss, edgePeauFiss, "edgePeauFiss")
+ geompy.addToStudyInFather(facePeau, edgePeauFiss, "edgePeauFiss")
+ break
+ except:
+ pass
+ verticesEdgePeauFiss = geompy.ExtractShapes(edgePeauFiss, geompy.ShapeType["VERTEX"], False)
+
+ # --- identification edges demi cercle dans face de peau
+ edgesFacePeau = geompy.ExtractShapes(facePeau, geompy.ShapeType["EDGE"], False)
+ edgesFacePeauSorted, minlg, maxlg = sortEdges(edgesFacePeau)
+ demiCerclesPeau = edgesFacePeauSorted[0:4]
+ verticesDemiCerclesPeau = []
+ for i, edge in enumerate(demiCerclesPeau):
+ name = "demiCerclePeau_%d"%i
+ geompy.addToStudyInFather(facePeau, edge, name)
+ verticesDemiCerclesPeau += geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], False)
+ verticesDemiCerclesPeau = eliminateDoubles(facePeau, verticesDemiCerclesPeau)
+ for i, vertex in enumerate(verticesDemiCerclesPeau):
+ name = "verticesDemiCerclesPeau_%d"%i
+ geompy.addToStudyInFather(facePeau, vertex, name)
+ verticesOutCercles = substractSubShapes(facePeau, verticesDemiCerclesPeau, verticesEdgePeauFiss)
+ for i, vertex in enumerate(verticesOutCercles):
+ name = "verticesOutCercles_%d"%i
+ geompy.addToStudyInFather(facePeau, vertex, name)
+
+ # --- demi cercles regroupés
+ groupsDemiCerclesPeau = []
+ for i, vertex in enumerate(verticesEdgePeauFiss):
+ demis = []
+ for edge in demiCerclesPeau:
+ if geompy.MinDistance(vertex, edge) < 1.e-5:
+ demis.append(edge)
+ group = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
+ geompy.UnionList(group, demis)
+ name = "Cercle%d"%i
+ geompy.addToStudyInFather(facePeau, group , name)
+ groupsDemiCerclesPeau.append(group)
+
+ # --- identification edges commune pipe face fissure externe au pipe
+ edgePeauFissId = geompy.GetSubShapeID(partitionPeauFissByPipe, edgePeauFiss)
+ edgesFaceFiss = geompy.ExtractShapes(faceFiss, geompy.ShapeType["EDGE"], False)
+ edgesFaceFissPipe = []
+ for edge in edgesFaceFiss:
+ if geompy.GetSubShapeID(partitionPeauFissByPipe, edge) != edgePeauFissId:
+ edgesFaceFissPipe.append(edge)
+ name = "edgeFaceFissPipe_%d"%len(edgesFaceFissPipe)
+ geompy.addToStudyInFather(faceFiss, edge, name)
+ groupEdgesFaceFissPipe = geompy.CreateGroup(faceFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionList(groupEdgesFaceFissPipe, edgesFaceFissPipe)
+ geompy.addToStudyInFather(faceFiss, groupEdgesFaceFissPipe, "edgesFaceFissPipe")
+
+ # -----------------------------------------------------------------------------
+ # --- pipe de fond de fissure
+
+ wireFondFiss = geompy.MakeWire(edgesInside, 1e-07)
+
+ disque = geompy.MakeDiskPntVecR(centreFondFiss, tangentFondFiss, rayonPipe)
+ [vertex] = geompy.ExtractShapes(disque, geompy.ShapeType["VERTEX"], False)
+ vertproj = geompy.MakeProjection(vertex, planfiss)
+ vec1 = geompy.MakeVector(centreFondFiss, vertex)
+ try:
+ # si centreFondFiss et vertproj sont proches: exception. Angle = +- 90°
+ vec2 = geompy.MakeVector(centreFondFiss, vertproj)
+ angle = geompy.GetAngleRadians(vec1, vec2)
+ except:
+ # on utilise la projection du centre sur la peau pour avoir un vecteur non nul
+ vertproj = geompy.MakeProjection(centreFondFiss, facePeau)
+ vec2 = geompy.MakeVector(centreFondFiss, vertproj)
+ angle = geompy.GetAngleRadians(vec1, vec2)
+ sommetAxe = geompy.MakeTranslationVector(centreFondFiss, tangentFondFiss)
+ pm = produitMixte(centreFondFiss, vertex, vertproj, sommetAxe)
+ if pm > 0:
+ disque = geompy.MakeRotation(disque, tangentFondFiss, angle)
+ else:
+ disque = geompy.MakeRotation(disque, tangentFondFiss, -angle)
+ [vertexReference] = geompy.ExtractShapes(disque, geompy.ShapeType["VERTEX"], False)
+
+ pipeFondFiss = geompy.MakePipe(disque, wireFondFiss)
+ pipeFondFiss = geompy.MakePartition([pipeFondFiss], [planfiss, wireFondFiss, planBord1, planBord2], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+ #pipe = geompy.MakePipe(disque, WirePorteFondFissure)
+ #pipe = geompy.MakePartition([pipe],[fillingFaceExterne], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+ #pipes = geompy.ExtractShapes(pipe, geompy.ShapeType["SOLID"], False)
+ #pipesSorted, volmin, volmax = sortSolids(pipes)
+ #pipeFondFiss = pipesSorted[-1]
+ #pipeFondFiss = geompy.MakePartition([pipeFondFiss], [planfiss, wireFondFiss, planBord1, planBord2], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+
+ geompy.addToStudy( disque, 'disque')
+ geompy.addToStudy( wireFondFiss, 'wireFondFiss')
+ geompy.addToStudy( pipeFondFiss, 'pipeFondFiss')
+
+ VerticesEndFondFiss = findWireEndVertices(wireFondFiss)
+ for i, v in enumerate(VerticesEndFondFiss):
+ name = "vertexEndFondFiss_%d"%i
+ geompy.addToStudyInFather(wireFondFiss, v, name)
+ VerticesEndPipeFiss = []
+ for v in VerticesEndFondFiss:
+ VerticesEndPipeFiss.append(geompy.GetInPlace(pipeFondFiss, v))
+ for i, v in enumerate(VerticesEndPipeFiss):
+ name = "vertexEndPipeFiss_%d"%i
+ geompy.addToStudyInFather(pipeFondFiss, v, name)
+
+ geompy.addToStudyInFather(pipeFondFiss, VerticesEndPipeFiss[0], "PFOR")
+ geompy.addToStudyInFather(pipeFondFiss, VerticesEndPipeFiss[1], "PFEX")
+ if geompy.MinDistance(VerticesEndPipeFiss[0], verticesOutCercles[0]) > geompy.MinDistance(VerticesEndPipeFiss[0], verticesOutCercles[1]):
+ a = verticesOutCercles[0]
+ verticesOutCercles[0] = verticesOutCercles[1]
+ verticesOutCercles[1] = a
+ geompy.addToStudyInFather(facePeau, verticesOutCercles[0], "THOR")
+ geompy.addToStudyInFather(facePeau, verticesOutCercles[1], "THEX")
+
+ [facesPipeInside, facesPipeOutside, facesPipeOnside] = extractionOrientee(fillingFaceExterne, pipeFondFiss, centreFondFiss, "FACE", 0.1, "pipe_bord_")
+ [edgesPipeInside, edgesPipeOutside, edgesPipeOnside] = extractionOrientee(fillingFaceExterne, pipeFondFiss, centreFondFiss, "EDGE", 0.1, "pipe_bord_")
+ disqueInt1 = geompy.GetInPlaceByHistory(pipeFondFiss, planBord1)
+ disqueInt2 = geompy.GetInPlaceByHistory(pipeFondFiss, planBord2)
+ disques = facesPipeOnside + [disqueInt1, disqueInt2]
+ edgesDiskInt = geompy.ExtractShapes(disqueInt1, geompy.ShapeType["EDGE"], False)
+ edgesDiskInt = edgesDiskInt +geompy.ExtractShapes(disqueInt2, geompy.ShapeType["EDGE"], False)
+ edgesSorted, minlg, maxlg = sortEdges(edgesDiskInt) # 4 rayons, 2 demi cercles
+
+ centre = geompy.MakeVertexOnSurface(planfiss, 0.5, 0.5)
+ refpoint = geompy.MakeTranslationVector(centre, geompy.GetNormal(planfiss,centre))
+ geompy.addToStudy(refpoint, 'refpoint')
+ [facesPipeInplan, facesPipeOutplan, facesPipeOnplan] = extractionOrientee(planfiss, pipeFondFiss, refpoint, "FACE", 0.1, "pipe_plan_")
+ [edgesPipeInplan, edgesPipeOutplan, edgesPipeOnplan] = extractionOrientee(planfiss, pipeFondFiss, refpoint, "EDGE", 0.1, "pipe_plan_")
+
+ # --- rayon disques = (edgesPipeOnside inter edgesPipeOnplan) + rayons disque internes
+ # demi cercles = edgesPipeOnside moins edgesPipeOnplan + demi cercles disque internes
+ # generatrices = edgesPipeOnplan moins rayon disques (3 grandes et 6 petites)
+ edgesIdPipeOnside = getSubshapeIds(pipeFondFiss, edgesPipeOnside)
+ edgesIdPipeOnplan = getSubshapeIds(pipeFondFiss, edgesPipeOnplan)
+ rayons = []
+ demiCercles = []
+ for i, edgeId in enumerate(edgesIdPipeOnside):
+ if edgeId in edgesIdPipeOnplan:
+ rayons.append(edgesPipeOnside[i])
+ else:
+ demiCercles.append(edgesPipeOnside[i])
+ demiCerclesExternes = demiCercles
+ rayons = rayons + edgesSorted[:4] # les 4 plus petits sont les rayons
+ demiCercles = demiCercles + edgesSorted[4:] # les suivants sont les arcs de cercle
+ rayonsId = getSubshapeIds(pipeFondFiss, rayons)
+ generatrices = []
+ for i, edgeId in enumerate(edgesIdPipeOnplan):
+ if edgeId not in rayonsId:
+ generatrices.append(edgesPipeOnplan[i])
+
+ # --- generatrices en contact avec la face fissure externe au pipe
+ generFiss = []
+ for edge in generatrices:
+ distance = geompy.MinDistance(vertexReference, edge)
+ logging.debug("distance %s", distance)
+ if distance < 1.e-5:
+ generFiss.append(edge)
+ break
+ for edge in generatrices:
+ distance = geompy.MinDistance(generFiss[0], edge)
+ logging.debug("distance %s", distance)
+ if distance < 1.e-5:
+ generFiss.append(edge)
+ groupGenerFiss = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionList(groupGenerFiss, generFiss)
+ geompy.addToStudyInFather(pipeFondFiss, groupGenerFiss, "GenFiss")
+
+ # --- demi cercles externes regroupés
+ groupsDemiCerclesPipe = []
+ for i, vertex in enumerate(verticesEdgePeauFiss):
+ demis = []
+ for edge in demiCerclesExternes:
+ if geompy.MinDistance(vertex, edge) < 0.1:
+ demis.append(edge)
+ group = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionList(group, demis)
+ name = "Cercle%d"%i
+ geompy.addToStudyInFather(pipeFondFiss, group , name)
+ groupsDemiCerclesPipe.append(group)
+
+ # --- faces fissure dans le pipe
+
+ facesFissinPipe = []
+ generFissId = getSubshapeIds(pipeFondFiss, generFiss)
+ logging.debug("generatrice fissure %s", generFissId)
+ for face in facesPipeOnplan:
+ edges =geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], False)
+ edgesId = getSubshapeIds(pipeFondFiss, edges)
+ logging.debug(" edges %s", edgesId)
+ for i,edgeId in enumerate(edgesId):
+ if edgeId in generFissId:
+ logging.debug("face found")
+ facesFissinPipe.append(face)
+ name = "faceFissInPipe_%d"%i
+ geompy.addToStudyInFather(pipeFondFiss, face, name)
+ break
+ groupFaceFissInPipe = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["FACE"])
+ geompy.UnionList(groupFaceFissInPipe, facesFissinPipe)
+ name = "FaceFissInPipe"
+ geompy.addToStudyInFather(pipeFondFiss, groupFaceFissInPipe , name)
+
+ # --- edges de fond de fissure
+
+ edgesFondFiss = []
+ for i, edge in enumerate(edgesInside):
+ anEdge = geompy.GetInPlace(pipeFondFiss, edge)
+ logging.debug(" edge %s ", anEdge)
+ edgesFondFiss.append(anEdge)
+ name ="edgeFondFissure_%d"%i
+ geompy.addToStudyInFather(pipeFondFiss, anEdge, name)
+ groupEdgeFondFiss = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
+ geompy.UnionList(groupEdgeFondFiss, edgesFondFiss)
+ name = "FONDFISS"
+ geompy.addToStudyInFather(pipeFondFiss, groupEdgeFondFiss , name)
+
+ # -------------------------------------------------------------------------
+ # --- maillage
+
+ # --- edges de bord face defaut à respecter
+
+ aFilterManager = smesh.CreateFilterManager()
+ nbAdded, internalBoundary, _NoneGroup = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [ ])
+ criteres = []
+ unCritere = smesh.GetCriterion(SMESH.EDGE,SMESH.FT_FreeBorders,SMESH.FT_Undefined,0)
+ criteres.append(unCritere)
+ filtre = smesh.GetFilterFromCriteria(criteres)
+ bordsLibres = internalBoundary.MakeGroupByFilter( 'bords', filtre )
+ smesh.SetName(bordsLibres, 'bordsLibres')
+
+ # --- pour aider l'algo hexa-tetra a ne pas mettre de pyramides a l'exterieur des volumes replies sur eux-memes
+ # on designe les faces de peau en quadrangles par le groupe "skinFaces"
+
+ skinFaces = internalBoundary.CreateEmptyGroup( SMESH.FACE, 'skinFaces' )
+ nbAdd = skinFaces.AddFrom( internalBoundary.GetMesh() )
+
+ # --- maillage pipe fond fissure
+
+ meshFondFiss = smesh.Mesh(pipeFondFiss)
+ algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+ algo3d = meshFondFiss.Prism()
+ putName(algo3d.GetSubMesh(), "pipe")
+ putName(algo3d, "algo3d_pipe")
+ putName(algo2d, "algo2d_pipe")
+
+ for i, face in enumerate(disques):
+ algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.RADIAL_QUAD,geom=face)
+ putName(algo2d.GetSubMesh(), "disque", i)
+ putName(algo2d, "algo2d_disque", i)
+
+ for i, edge in enumerate(rayons):
+ algo1d = meshFondFiss.Segment(geom=edge)
+ hypo1d = algo1d.NumberOfSegments(4)
+ putName(algo1d.GetSubMesh(), "rayon", i)
+ putName(algo1d, "algo1d_rayon", i)
+ putName(hypo1d, "hypo1d_rayon", i)
+
+ for i, edge in enumerate(demiCercles):
+ algo1d = meshFondFiss.Segment(geom=edge)
+ hypo1d = algo1d.NumberOfSegments(6)
+ putName(algo1d.GetSubMesh(), "demiCercle", i)
+ putName(algo1d, "algo1d_demiCercle", i)
+ putName(hypo1d, "hypo1d_demiCercle", i)
+
+ generSorted, minlg, maxlg = sortEdges(generatrices)
+ nbSegGenLong = int(math.sqrt(3.0)*maxlg/(profondeur - rayonPipe)) # on veut 2 triangles equilateraux dans la largeur de la face
+ nbSegGenBout = 6
+ logging.info("min %s, max %s, nombre de segments %s, nombre de generatrices %s", minlg, maxlg, nbSegGenLong, len(generSorted))
+ for i, edge in enumerate(generSorted):
+ algo1d = meshFondFiss.Segment(geom=edge)
+ if i < 6:
+ hypo1d = algo1d.NumberOfSegments(nbSegGenBout)
+ else:
+ hypo1d = algo1d.NumberOfSegments(nbSegGenLong)
+ putName(algo1d.GetSubMesh(), "generatrice", i)
+ putName(algo1d, "algo1d_generatrice", i)
+ putName(hypo1d, "hypo1d_generatrice", i)
+ isDone = meshFondFiss.Compute()
+ logging.info("meshFondFiss computed")
+
+ disks = []
+ for i, face in enumerate(disques[:4]):
+ name = "disk%d"%i
+ disks.append(meshFondFiss.GroupOnGeom(face, name, SMESH.FACE))
+ peauext_pipe = meshFondFiss.GetMesh().UnionListOfGroups( disks, 'PEAUEXT' )
+
+ grpPFOR = meshFondFiss.GroupOnGeom(VerticesEndPipeFiss[0], "PFOR", SMESH.NODE)
+ grpPFEX = meshFondFiss.GroupOnGeom(VerticesEndPipeFiss[1], "PFEX", SMESH.NODE)
+
+ grp = meshFondFiss.GroupOnGeom(groupFaceFissInPipe, "fisInPi", SMESH.FACE)
+ group_edgeFondFiss = meshFondFiss.GroupOnGeom(groupEdgeFondFiss, "FONDFISS", SMESH.EDGE)
+ noeudsFondFissure = meshFondFiss.GroupOnGeom(groupEdgeFondFiss, "nfondfis", SMESH.NODE)
+ groups_demiCercles = []
+ groupnodes_demiCercles = []
+ for i, group in enumerate(groupsDemiCerclesPipe):
+ name = "Cercle%d"%i
+ groups_demiCercles.append(meshFondFiss.GroupOnGeom(group, name, SMESH.EDGE))
+ name = "nCercle%d"%i
+ groupnodes_demiCercles.append(meshFondFiss.GroupOnGeom(group, name, SMESH.NODE))
+ group_generFiss = meshFondFiss.GroupOnGeom(groupGenerFiss, "GenFiss", SMESH.EDGE)
+ groupnode_generFiss = meshFondFiss.GroupOnGeom(groupGenerFiss, "GenFiss", SMESH.NODE)
+ grpNode0 = meshFondFiss.IntersectGroups(groupnode_generFiss, groupnodes_demiCercles[0], "Node0")
+ grpNode1 = meshFondFiss.IntersectGroups(groupnode_generFiss, groupnodes_demiCercles[1], "Node1")
+ idNode0 = grpNode0.GetID(1)
+ idNode1 = grpNode1.GetID(1)
+ coordsMesh = []
+ coordsMesh.append(meshFondFiss.GetNodeXYZ(idNode0))
+ coordsMesh.append(meshFondFiss.GetNodeXYZ(idNode1))
+ coordsGeom = []
+ for vertex in verticesEdgePeauFiss:
+ coord = geompy.PointCoordinates(vertex);
+ if distance2(coord, coordsMesh[0]) < 0.1:
+ meshFondFiss.MoveNode(idNode0, coord[0], coord[1], coord[2])
+ if distance2(coord, coordsMesh[1]) < 0.1:
+ meshFondFiss.MoveNode(idNode1, coord[0], coord[1], coord[2])
+
+ for groupNodes in groupnodes_demiCercles:
+ for idNode in groupNodes.GetListOfID():
+ coordMesh = meshFondFiss.GetNodeXYZ(idNode)
+ vertex = geompy.MakeVertex(coordMesh[0], coordMesh[1], coordMesh[2])
+ minDist = 100000
+ minCoord = None
+ imin = -1
+ for i, edge in enumerate(demiCerclesPeau):
+ discoord = geompy.MinDistanceComponents(vertex, edge)
+ if discoord[0] <minDist:
+ minDist = discoord[0]
+ minCoord = discoord[1:]
+ imin = i
+ if imin >= 0 and minDist > 1.E-6:
+ logging.debug("node id moved : %s distance=%s", idNode, minDist)
+ meshFondFiss.MoveNode(idNode, coordMesh[0] + minCoord[0], coordMesh[1] + minCoord[1], coordMesh[2] + minCoord[2])
+
+
+ # --- maillage face de peau
+
+ meshFacePeau = smesh.Mesh(facePeau)
+ algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_2D)
+ hypo2d = algo2d.Parameters()
+ hypo2d.SetMaxSize( 1000 )
+ hypo2d.SetOptimize( 1 )
+ hypo2d.SetFineness( 2 )
+ hypo2d.SetMinSize( 2 )
+ hypo2d.SetQuadAllowed( 0 )
+ putName(algo2d.GetSubMesh(), "facePeau")
+ putName(algo2d, "algo2d_facePeau")
+ putName(hypo2d, "hypo2d_facePeau")
+ #
+ lenEdgePeauFiss = geompy.BasicProperties(edgePeauFiss)[0]
+ frac = profondeur/lenEdgePeauFiss
+ nbSeg = nbSegGenLong +2*nbSegGenBout
+ ratio = (nbSegGenBout/float(profondeur)) / (nbSegGenLong/lenEdgePeauFiss)
+ logging.info("lenEdgePeauFiss %s, profondeur %s, nbSegGenLong %s, nbSegGenBout %s, frac %s, ratio %s", lenEdgePeauFiss, profondeur, nbSegGenLong, nbSegGenBout, frac, ratio)
+ algo1d = meshFacePeau.Segment(geom=edgePeauFiss)
+ hypo1d = algo1d.NumberOfSegments(nbSeg,[],[ ])
+ hypo1d.SetDistrType( 2 )
+ hypo1d.SetConversionMode( 1 )
+ hypo1d.SetTableFunction( [ 0, ratio, frac, 1, (1.-frac), 1, 1, ratio ] )
+ putName(algo1d.GetSubMesh(), "edgePeauFiss")
+ putName(algo1d, "algo1d_edgePeauFiss")
+ putName(hypo1d, "hypo1d_edgePeauFiss")
+ #
+ algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
+ hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
+ putName(algo1d.GetSubMesh(), "bordsLibres")
+ putName(algo1d, "algo1d_bordsLibres")
+ putName(hypo1d, "hypo1d_bordsLibres")
+ #
+ for i in range(2):
+ algo1d = meshFacePeau.UseExisting1DElements(geom=groupsDemiCerclesPeau[i])
+ hypo1d = algo1d.SourceEdges([ groups_demiCercles[i] ],0,0)
+ putName(algo1d.GetSubMesh(), "DemiCercles", i)
+ putName(algo1d, "algo1d_groupDemiCercles", i)
+ putName(hypo1d, "hypo1d_groupDemiCercles", i)
+ #
+ isDone = meshFacePeau.Compute()
+ logging.info("meshFacePeau computed")
+ grpTHOR = meshFacePeau.GroupOnGeom(verticesOutCercles[0], "THOR", SMESH.NODE)
+ grpTHEX = meshFacePeau.GroupOnGeom(verticesOutCercles[1], "THEX", SMESH.NODE)
+
+ groupEdgesPeauFiss = meshFacePeau.GroupOnGeom(edgePeauFiss, "PeauFis", SMESH.EDGE)
+
+ peauext_face = meshFacePeau.CreateEmptyGroup( SMESH.FACE, 'PEAUEXT' )
+ nbAdd = peauext_face.AddFrom( meshFacePeau.GetMesh() )
+
+
+ # --- maillage face de fissure
+
+ meshFaceFiss = smesh.Mesh(faceFiss)
+ algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.NETGEN_2D)
+ hypo2d = algo2d.Parameters()
+ hypo2d.SetMaxSize( (profondeur - rayonPipe)/math.sqrt(3.0) ) # pour avoir deux couches de triangles equilateraux partout sur la fissure
+ hypo2d.SetOptimize( 1 )
+ hypo2d.SetFineness( 2 )
+ hypo2d.SetMinSize( 2 )
+ hypo2d.SetQuadAllowed( 0 )
+ putName(algo2d.GetSubMesh(), "faceFiss")
+ putName(algo2d, "algo2d_faceFiss")
+ putName(hypo2d, "hypo2d_faceFiss")
+ #
+ algo1d = meshFaceFiss.UseExisting1DElements(geom=edgePeauFiss)
+ hypo1d = algo1d.SourceEdges([ groupEdgesPeauFiss ],0,0)
+ putName(algo1d.GetSubMesh(), "edgeFissPeau")
+ putName(algo1d, "algo1d_edgeFissPeau")
+ putName(hypo1d, "hypo1d_edgeFissPeau")
+ #
+ algo1d = meshFaceFiss.UseExisting1DElements(geom=groupEdgesFaceFissPipe)
+ hypo1d = algo1d.SourceEdges([ group_generFiss ],0,0)
+ putName(algo1d.GetSubMesh(), "edgeFissPeau")
+ putName(algo1d, "algo1d_edgeFissPeau")
+ putName(hypo1d, "hypo1d_edgeFissPeau")
+ #
+ isDone = meshFaceFiss.Compute()
+ logging.info("meshFaceFiss computed")
+
+ grp = meshFaceFiss.GroupOnGeom(faceFiss, "fisOutPi", SMESH.FACE)
+
+ meshBoiteDefaut = smesh.Concatenate([internalBoundary.GetMesh(),
+ meshFondFiss.GetMesh(),
+ meshFacePeau.GetMesh(),
+ meshFaceFiss.GetMesh()],
+ 1, 1, 1e-05,False)
+ # pour aider l'algo hexa-tetra a ne pas mettre de pyramides a l'exterieur des volumes replies sur eux-memes
+ # on designe les faces de peau en quadrangles par le groupe "skinFaces"
+ group_faceFissOutPipe = None
+ group_faceFissInPipe = None
+ groups = meshBoiteDefaut.GetGroups()
+ for grp in groups:
+ if grp.GetType() == SMESH.FACE:
+ #if "internalBoundary" in grp.GetName():
+ # grp.SetName("skinFaces")
+ if grp.GetName() == "fisOutPi":
+ group_faceFissOutPipe = grp
+ elif grp.GetName() == "fisInPi":
+ group_faceFissInPipe = grp
+
+ # le maillage NETGEN ne passe pas toujours ==> utiliser GHS3D
+ distene=True
+ if distene:
+ algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.GHS3D)
+ else:
+ algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.NETGEN)
+ hypo3d = algo3d.MaxElementVolume(1000.0)
+ putName(algo3d.GetSubMesh(), "boiteDefaut")
+ putName(algo3d, "algo3d_boiteDefaut")
+ isDone = meshBoiteDefaut.Compute()
+ logging.info("meshBoiteDefaut computed")
+ putName(meshBoiteDefaut, "boiteDefaut")
+
+ groups = maillageSain.GetGroups()
+ grps1 = [ grp for grp in groups if grp.GetName() == 'P1']
+ grps2 = [ grp for grp in groups if grp.GetName() == 'P2']
+ coords1 = maillageSain.GetNodeXYZ(grps1[0].GetID(1))
+ coords2 = maillageSain.GetNodeXYZ(grps2[0].GetID(1))
+ logging.info("coords1 %s, coords2 %s",coords1, coords2)
+
+ faceFissure = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], 'FACE1' )
+ maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges)
+ putName(maillageSain, nomFicSain+"_coupe")
+ extrusionFaceFissure, normfiss = shapeSurFissure(facePorteFissure)
+ maillageComplet = RegroupeSainEtDefaut(maillageSain, meshBoiteDefaut, extrusionFaceFissure, facePorteFissure, 'COUDE')
+
+ groups = maillageComplet.GetGroups()
+ grps1 = [ grp for grp in groups if grp.GetName() == 'P1']
+ grps2 = [ grp for grp in groups if grp.GetName() == 'P2']
+ nodeid1 = maillageComplet.AddNode(coords1[0], coords1[1], coords1[2])
+ nodeid2 = maillageComplet.AddNode(coords2[0], coords2[1], coords2[2])
+ grps1[0].Add([nodeid1])
+ grps2[0].Add([nodeid2])
+ ma0d1 = maillageComplet.Add0DElement(nodeid1)
+ ma0d2 = maillageComplet.Add0DElement(nodeid2)
+ grpma0d1 = maillageComplet.CreateEmptyGroup( SMESH.ELEM0D, 'P1' )
+ nbAdd = grpma0d1.Add( [ma0d1] )
+ grpma0d2 = maillageComplet.CreateEmptyGroup( SMESH.ELEM0D, 'P2' )
+ nbAdd = grpma0d2.Add( [ma0d2] )
+
+# grps = [ grp for grp in groups if grp.GetName() == 'affectedEdges']
+# grps[0].SetName('affEdges')
+# grps = [ grp for grp in groups if grp.GetName() == 'affectedFaces']
+# grps[0].SetName('affFaces')
+# grps = [ grp for grp in groups if grp.GetName() == 'affectedVolumes']
+# grps[0].SetName('affVols')
+
+ maillageComplet.ConvertToQuadratic( 1 )
+ grps = [ grp for grp in groups if grp.GetName() == 'FONDFISS']
+ fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FONDFISS' )
+
+ grps = [ grp for grp in groups if grp.GetName() == 'FACE1']
+ nb = maillageComplet.Reorient2D( grps[0], normfiss, grps[0].GetID(1))
+
+ plansim = geompy.MakePlane(O, normfiss, 10000)
+ fissnorm = geompy.MakeMirrorByPlane(normfiss, plansim)
+ grps = [ grp for grp in groups if grp.GetName() == 'FACE2']
+ nb = maillageComplet.Reorient2D( grps[0], fissnorm, grps[0].GetID(1))
+ #isDone = maillageComplet.ReorientObject( grps[0] )
+ fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FACE2' )
+
+ maillageComplet.ExportMED( fichierMaillageFissure, 0, SMESH.MED_V2_2, 1 )
+ putName(maillageComplet, nomFicFissure)
+ logging.info("fichier maillage fissure %s", fichierMaillageFissure)
+
+ if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
+
+ return maillageComplet
\ No newline at end of file
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+from geomsmesh import smesh
+from salome.smesh import smeshBuilder
+import SMESH
+from salome.StdMeshers import StdMeshersBuilder
+from putName import putName
+
+# -----------------------------------------------------------------------------
+# --- maillage du bloc partitionne
+
+def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circles, faces,
+ gencnt, facefissoutore, edgeext, facesExternes, facesExtBloc, facesExtElli,
+ aretesInternes, internalBoundary, ellipsoidep, sharedFaces, sharedEdges, edgesBords,
+ nbsegExt, nbsegGen, nbsegRad, scaleRad, reverses, reverext, nbsegCercle, nbsegFis, dmoyen, lensegEllipsoide):
+ """
+ Maillage du bloc partitionné
+ TODO: a completer
+ """
+ logging.info('start')
+
+ # --- edges de bord à respecter
+
+ aFilterManager = smesh.CreateFilterManager()
+ nbAdded, internalBoundary, _NoneGroup = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [ ])
+ criteres = []
+ unCritere = smesh.GetCriterion(SMESH.EDGE,SMESH.FT_FreeBorders,SMESH.FT_Undefined,0)
+ criteres.append(unCritere)
+ filtre = smesh.GetFilterFromCriteria(criteres)
+ bordsLibres = internalBoundary.MakeGroupByFilter( 'bords', filtre )
+ smesh.SetName(bordsLibres, 'bordsLibres')
+
+ # --- maillage bloc
+
+ bloc1 = smesh.Mesh(blocPartition)
+
+ for i in range(len(sharedFaces)):
+ algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN, geom=sharedFaces[i])
+ hypo2d = algo2d.Parameters(which=smesh.SIMPLE)
+ hypo2d.SetLocalLength(lensegEllipsoide)
+ hypo2d.LengthFromEdges()
+ hypo2d.SetAllowQuadrangles(0)
+ putName(algo2d.GetSubMesh(), "sharedFaces", i)
+ putName(algo2d, "algo2d_sharedFaces", i)
+ putName(hypo2d, "hypo2d_sharedFaces", i)
+
+ for i in range(len(sharedEdges)):
+ algo1d = bloc1.Segment(geom=sharedEdges[i])
+ hypo1d = algo1d.LocalLength(lensegEllipsoide)
+ putName(algo1d.GetSubMesh(), "sharedEdges", i)
+ putName(algo1d, "algo1d_sharedEdges", i)
+ putName(hypo1d, "hypo1d_sharedEdges", i)
+
+ declareAlgoEllipsoideFirst = False
+ if declareAlgoEllipsoideFirst:
+ algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep)
+ hypo3d = algo3d.MaxElementVolume(1000.0)
+ putName(algo3d.GetSubMesh(), "ellipsoide")
+ putName(algo3d, "algo3d_ellipsoide")
+ putName(hypo3d, "hypo3d_ellipsoide")
+
+ algo3d = bloc1.Prism(geom=tore)
+ algo2d = bloc1.Quadrangle(geom=tore)
+ algo1d = bloc1.Segment(geom=tore)
+ hypo1d = algo1d.NumberOfSegments(nbsegGen)
+ putName(algo3d.GetSubMesh(), "tore")
+ putName(algo3d, "algo3d_tore")
+ putName(algo2d, "algo2d_tore")
+ putName(algo1d, "algo1d_tore")
+ putName(hypo1d, "hypo1d_tore")
+
+ for i in range(len(faces)):
+ algo2d = bloc1.Quadrangle(geom=faces[i])
+ hypo2d = smesh.CreateHypothesis('QuadrangleParams')
+ hypo2d.SetTriaVertex( geompy.GetSubShapeID(blocPartition,centres[i]) )
+ hypo2d.SetQuadType( StdMeshersBuilder.QUAD_STANDARD )
+ status = bloc1.AddHypothesis(hypo2d,faces[i])
+ putName(algo2d.GetSubMesh(), "faces", i)
+ putName(algo2d, "algo2d_faces", i)
+ putName(hypo2d, "hypo2d_faces", i)
+
+ for i in range(len(edges)):
+ algo1d = bloc1.Segment(geom=edges[i])
+ if reverses[i] > 0:
+ hypo1d = algo1d.NumberOfSegments(nbsegRad, scaleRad,[ geompy.GetSubShapeID(blocPartition,edges[i]) ])
+ else:
+ hypo1d = algo1d.NumberOfSegments(nbsegRad, scaleRad,[ ])
+ putName(algo1d.GetSubMesh(), "edges", i)
+ putName(algo1d, "algo1d_edges", i)
+ putName(hypo1d, "hypo1d_edges", i)
+
+ for i in range(len(circles)):
+ algo1d = bloc1.Segment(geom=circles[i])
+ hypo1d = algo1d.NumberOfSegments(nbsegCercle)
+ putName(algo1d.GetSubMesh(), "circles", i)
+ putName(algo1d, "algo1d_circles", i)
+ putName(hypo1d, "hypo1d_circles", i)
+
+ if len(edgeext) == 1:
+ densite = int(round(nbsegFis/2))
+ algo1d = bloc1.Segment(geom=edgeext[0])
+ hypo1d = algo1d.NumberOfSegments(nbsegFis)
+ hypo1d.SetDistrType( 2 )
+ hypo1d.SetConversionMode( 1 )
+ hypo1d.SetTableFunction( [ 0, densite, 0.4, 1, 0.6, 1, 1, densite ] )
+ putName(algo1d.GetSubMesh(), "edgeext")
+ putName(algo1d, "algo1d_edgeext")
+ putName(hypo1d, "hypo1d_edgeext")
+ else:
+ longTotal = 0
+ longEdgeExts = []
+ for i in range(len(edgeext)):
+ props = geompy.BasicProperties(edgeext[i])
+ longEdgeExts.append(props[0])
+ longTotal += props[0]
+ for i in range(len(edgeext)):
+ local = longTotal/nbsegFis
+ nbLocal = int(round(nbsegFis*longEdgeExts[i]/longTotal))
+ densite = int(round(nbLocal/2))
+ algo1d = bloc1.Segment(geom=edgeext[i])
+ hypo1d = algo1d.NumberOfSegments(nbLocal)
+ hypo1d.SetDistrType( 2 )
+ hypo1d.SetConversionMode( 1 )
+ hypo1d.SetTableFunction( [ 0, densite, 0.8, 1, 1, 1 ] )
+ if reverext[i]:
+ hypo1d.SetReversedEdges([ geompy.GetSubShapeID(blocPartition, edgeext[i]) ])
+ putName(algo1d.GetSubMesh(), "edgeext", i)
+ putName(algo1d, "algo1d_edgeext", i)
+ putName(hypo1d, "hypo1d_edgeext", i)
+
+ algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN_2D, geom=facefissoutore)
+ hypo2d = algo2d.LengthFromEdges()
+ putName(algo2d.GetSubMesh(), "facefissoutore")
+ putName(algo2d, "algo2d_facefissoutore")
+ putName(hypo2d, "hypo2d_facefissoutore")
+
+
+ maxElemArea = 0.5*dmoyen*dmoyen
+ logging.debug("dmoyen %s, maxElemArea %s", dmoyen, maxElemArea)
+
+ for i in range(len(facesExternes)):
+ algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN_2D, geom=facesExternes[i])
+ hypo2d = algo2d.MaxElementArea(maxElemArea)
+ if edgesBords is None:
+ algo1d = bloc1.Segment(geom=facesExternes[i])
+ hypo1d = algo1d.NumberOfSegments(1)
+ putName(algo2d.GetSubMesh(), "facesExternes", i)
+ putName(algo2d, "algo2d_facesExternes", i)
+ putName(hypo2d, "hypo2d_facesExternes", i)
+ if edgesBords is None:
+ putName(algo1d, "algo1d_facesExternes", i)
+ putName(hypo1d, "hypo1d_facesExternes", i)
+
+ for i in range(len(aretesInternes)):
+ algo1d = bloc1.Segment(geom=aretesInternes[i])
+ hypo1d = algo1d.NumberOfSegments(nbsegExt)
+ putName(algo1d.GetSubMesh(), "aretesInternes", i)
+ putName(algo1d, "algo1d_aretesInternes", i)
+ putName(hypo1d, "hypo1d_aretesInternes", i)
+
+ if edgesBords is not None:
+ algo1d = bloc1.UseExisting1DElements(geom=edgesBords)
+ hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
+ putName(algo1d.GetSubMesh(), "bordsLibres")
+ putName(algo1d, "algo1d_bordsLibres")
+ putName(hypo1d, "hypo1d_bordsLibres")
+
+ #isDone = bloc1.Compute()
+
+ if not declareAlgoEllipsoideFirst:
+ algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep)
+ hypo3d = algo3d.MaxElementVolume(1000.0)
+ putName(algo3d.GetSubMesh(), "ellipsoide")
+ putName(algo3d, "algo3d_ellipsoide")
+ putName(hypo3d, "hypo3d_ellipsoide")
+
+ isDone = bloc1.Compute()
+
+ nbRemoved = bloc1.RemoveOrphanNodes()
+
+ faceFissure1 = bloc1.GroupOnGeom(faceFissure,'FACE1',SMESH.FACE)
+ noeudsFondFissure = bloc1.GroupOnGeom(gencnt,'nfondfis',SMESH.NODE)
+
+ groups_faceCommuneEllipsoideBloc = []
+ for i in range(len(sharedFaces)):
+ name = "faceCommuneEllipsoideBloc_%d"%i
+ groups_faceCommuneEllipsoideBloc.append(bloc1.GroupOnGeom(sharedFaces[i], name, SMESH.FACE))
+ groups_faceExterneBloc = []
+ for i in range(len(facesExtBloc)):
+ name = "faceExterneBloc_%d"%i
+ groups_faceExterneBloc.append(bloc1.GroupOnGeom(facesExtBloc[i], name, SMESH.FACE))
+
+ skinBlocMeshes = []
+ for i in range(len(groups_faceCommuneEllipsoideBloc)):
+ name = "faceCommuneEllipsoideBloc_%d"%i
+ skinBlocMeshes.append(smesh.CopyMesh(groups_faceCommuneEllipsoideBloc[i], name, 0, 0))
+ for i in range(len(groups_faceExterneBloc)):
+ name = "faceExterneBloc_%d"%i
+ skinBlocMeshes.append(smesh.CopyMesh(groups_faceExterneBloc[i], name, 0, 0))
+
+ meshesBloc = [internalBoundary.GetMesh()]
+ for i in range(len(skinBlocMeshes)):
+ meshesBloc.append(skinBlocMeshes[i].GetMesh())
+ blocMesh = smesh.Concatenate(meshesBloc, 1, 1, 1e-05,False)
+
+ algo3d = blocMesh.Tetrahedron(algo=smeshBuilder.NETGEN)
+ hypo3d = algo3d.MaxElementVolume(1000.0)
+ putName(algo3d.GetSubMesh(), "bloc")
+ putName(algo3d, "algo3d_bloc")
+ putName(hypo3d, "hypo3d_bloc")
+
+ is_done = blocMesh.Compute()
+
+ blocComplet = smesh.Concatenate([bloc1.GetMesh(), blocMesh.GetMesh()], 1, 1, 1e-05,False)
+
+ return bloc1, blocComplet
\ No newline at end of file
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- trouver les vertices intermediaires d'un wire
+
+def orderEdgesFromWire(aWire):
+ """
+ fournit les edges ordonnées d'un wire selon ExtractShapes(,,False),
+ et l'ordre des edges selon le sens de parcours (ordre des indices de la liste d'edges)
+ """
+ logging.info("start")
+ edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"], False)
+
+ idverts = {}
+ for i, edge in enumerate(edges):
+ verts = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True)
+# idverts[(i,0)] = verts[0]
+# idverts[(i,1)] = verts[1]
+ v0 = geompy.MakeVertexOnCurve(edge, 0.0)
+ dist = geompy.MinDistance(v0, verts[0])
+ if dist < 1.e-4:
+ idverts[(i,0)] = verts[0]
+ idverts[(i,1)] = verts[1]
+ else:
+ idverts[(i,0)] = verts[1]
+ idverts[(i,1)] = verts[0]
+
+ idsubs = {}
+ for kv, sub in idverts.iteritems():
+ subid = geompy.GetSubShapeID(aWire, sub)
+ if subid in idsubs.keys():
+ idsubs[subid].append(kv)
+ else:
+ idsubs[subid] = [kv]
+
+ debut = -1
+ fin = -1
+ for k, kvs in idsubs.iteritems():
+ if len(kvs) == 1: # une extremité
+ kv = kvs[0]
+ if kv[1] == 0:
+ debut = kv[0]
+ else:
+ fin = kv[0]
+ logging.debug("nombre d'edges: %s, indice edge début: %s, fin: %s",len(edges), debut, fin)
+ if debut < 0:
+ logging.critical("les edges du wire ne sont pas orientées dans le même sens: pas de début trouvé")
+ return edges, range(len(edges))
+
+ orderedList = [debut]
+ while len(orderedList) < len(edges):
+ bout = orderedList[-1]
+ vertex = idverts[(bout,1)]
+ for k, v in idverts.iteritems():
+ if k[0] not in orderedList:
+ if geompy.MinDistance(vertex, v) < 1.e-4:
+ if k[1] == 0:
+ orderedList.append(k[0])
+ break
+ else:
+ logging.critical("les edges du wire ne sont pas orientées dans le même sens: une edge à l'envers")
+ return edges, range(len(edges))
+
+ logging.debug("liste des edges ordonnées selon le sens de parcours: %s", orderedList)
+ accessList = range(len(orderedList))
+ for i,k in enumerate(orderedList):
+ accessList[k] = i
+ logging.info("position ordonnée des edges selon le sens de parcours: %s", accessList)
+ return edges, accessList
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- partition du bloc defaut par generatrice, tore et plan fissure
+
+def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
+ facefis, ellipsoide):
+ """
+ Partition du bloc defaut par la generatrice de l'ellipse,
+ le tore elliptique, la face plane de fissure
+ @param volDefaut : le bloc defaut
+ @param gener : la generatrice de l'ellipse, positionnée dans l'espace
+ @param pipe : le tore partitionné par le plan de fissure, positionné
+ dans l'espace
+ @param facefis : la face plane de la fissure, positionnée dans l'espace
+ @return (volDefautPart, blocp, tore, faceFissure), le bloc partitionné,
+ les sous shapes issues de la partition
+ (le bloc moins le tore, la generatrice, le tore, la face de fissure)
+ """
+ logging.info("start")
+
+ volDefautPart = geompy.MakePartition([volDefaut], [pipe, facefis, ellipsoide], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
+ blocp = geompy.GetInPlaceByHistory(volDefautPart, volDefaut)
+ #gencnt = geompy.GetInPlaceByHistory(volDefautPart, gener)
+ tore = geompy.GetInPlaceByHistory(volDefautPart, pipe)
+ faceFissure = geompy.GetInPlaceByHistory(volDefautPart, facefis)
+ #ellipsoidep =geompy.GetInPlaceByHistory(volDefautPart, ellipsoide)
+
+ geompy.addToStudy( volDefautPart, 'volDefautPart' )
+ geompy.addToStudyInFather( volDefautPart, tore, 'tore' )
+ geompy.addToStudyInFather( volDefautPart, faceFissure, 'FACE1' )
+ #geompy.addToStudyInFather( volDefautPart, gencnt, 'generatrice' )
+
+ solids = geompy.ExtractShapes(blocp, geompy.ShapeType["SOLID"], True)
+ vols = []
+ for i in range(len(solids)):
+ props = geompy.BasicProperties(solids[i])
+ vols.append(props[2])
+ maxvol = max(vols)
+ imaxvol = vols.index(maxvol)
+ blocp = solids[imaxvol]
+ vols[imaxvol] = 0
+ maxvol = max(vols)
+ imaxvol = vols.index(maxvol)
+ ellipsoidep = solids[imaxvol]
+
+ geompy.addToStudyInFather( volDefautPart, blocp, 'bloc' )
+ geompy.addToStudyInFather( volDefautPart, ellipsoidep, 'ellipsoide' )
+
+ sharedFaces = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["FACE"])
+ for i in range(len(sharedFaces)):
+ name = "faceCommuneEllipsoideBloc_%d"%i
+ geompy.addToStudyInFather(blocp, sharedFaces[i], name)
+
+ #sharedEdges = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["EDGE"])
+ allSharedEdges = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["EDGE"])
+ sharedEdges = []
+ for i in range(len(allSharedEdges)):
+ if geompy.NbShapes(allSharedEdges[i], geompy.ShapeType["VERTEX"]) > 1: # edge non degeneree
+ sharedEdges.append(allSharedEdges[i])
+ for i in range(len(sharedEdges)):
+ name = "edgeCommuneEllipsoideBloc_%d"%i
+ geompy.addToStudyInFather(blocp, sharedEdges[i], name)
+
+ facesExternes = []
+ facesExtBloc = []
+ facesExtElli = []
+ faces = geompy.ExtractShapes(facesDefaut, geompy.ShapeType["FACE"], True)
+ if len(faces) == 0:
+ faces = [facesDefaut]
+ for i in range(len(faces)):
+ faceExt = geompy.GetInPlace(ellipsoidep, faces[i])
+ if faceExt is not None:
+ name = "faceExterne_e%d"%i
+ geompy.addToStudyInFather(ellipsoidep, faceExt, name)
+ facesExternes.append(faceExt)
+ facesExtElli.append(faceExt)
+
+ faceExt = geompy.GetInPlace(blocp, faces[i])
+ if faceExt is not None:
+ name = "faceExterne_b%d"%i
+ geompy.addToStudyInFather(blocp, faceExt, name)
+ facesExternes.append(faceExt)
+ facesExtBloc.append(faceExt)
+ else:
+ logging.info(" recherche faces externes par GetShapesOnShape")
+ vertex = geompy.MakeVertexOnSurface(faces[i], 0.5, 0.5)
+ normal = geompy.GetNormal(faces[i], vertex)
+ extrusionFace = geompy.MakePrismVecH(faces[i], normal, 1)
+ #extrusionFace = geompy.MakePrismVecH2Ways(faces[i], normal, 0.1)
+ #extrusionFace = geompy.MakeScaleTransform(extrusionFace, vertex, 1.01)
+ name = "extrusionFace_b%d"%i
+ geompy.addToStudyInFather(blocp, extrusionFace, name)
+ #facesExt = geompy.GetShapesOnShape(extrusionFace, blocp, geompy.ShapeType["FACE"], GEOM.ST_ONIN)
+ facesExt = geompy.GetShapesOnShape(extrusionFace, blocp, geompy.ShapeType["FACE"], GEOM.ST_ON)
+ for j in range(len(facesExt)):
+ name = "faceExterne_b%d_%d"%(i,j)
+ geompy.addToStudyInFather(blocp, facesExt[j], name)
+ facesExternes.append(facesExt[j])
+ facesExtBloc.append(facesExt[j])
+
+ if len(facesExtBloc) < len(faces): # toutes les faces externes du bloc n'ont pas été trouvées. TODO eliminer les detections multiples
+ logging.info(" recherche faces externes par aretes partagees avec faces externes ellipsoide")
+ facesBloc = geompy.ExtractShapes(blocp, geompy.ShapeType["FACE"], True)
+ for i in range(len(facesBloc)):
+ notOnEllipsoide = True
+ for j in range(len(sharedFaces)): # eliminer les faces communes avec l'ellipsoide
+ if facesBloc[i].IsSame(sharedFaces[j]):
+ notOnEllipsoide = False
+ break
+ if notOnEllipsoide:
+ for j in range(len(facesExtElli)): # les faces recherchees ont une ou plusieurs edge communes avec la ou les faces externes de l'ellipsoide
+ allSharedEdges = []
+ try:
+ allSharedEdges += geompy.GetSharedShapesMulti([facesBloc[i], facesExtElli[j]], geompy.ShapeType["EDGE"])
+ except:
+ pass
+ if len(allSharedEdges) > 0:
+ name = "faceExterne_b%d_%d"%(i,j)
+ geompy.addToStudyInFather(blocp, facesBloc[i], name)
+ facesExternes.append(facesBloc[i])
+ facesExtBloc.append(facesBloc[i])
+
+ aretesInternes = []
+ for i in range(len(facesExternes)):
+ for j in range(i+1,len(facesExternes)):
+ shared = []
+ try:
+ shared += geompy.GetSharedShapesMulti([facesExternes[i], facesExternes[j]], geompy.ShapeType["EDGE"])
+ except:
+ logging.info("no shared edges in %s,%s",i,j)
+ else:
+ aretesInternes += shared
+ for i in range(len(aretesInternes)):
+ name = "aretesInternes_%d"%i
+ geompy.addToStudyInFather(blocp, aretesInternes[i], name)
+
+ edgesBords = []
+ for faceExtB in facesExtBloc:
+ edges = geompy.ExtractShapes(faceExtB, geompy.ShapeType["EDGE"], True)
+ for i in range(len(edges)):
+ isInterne = False
+ for j in range(len(aretesInternes)):
+ if edges[i].IsSame(aretesInternes[j]):
+ isInterne = True
+ break
+ if not isInterne:
+ edgesBords.append(edges[i])
+ name = "edgeBord%d"%i
+ geompy.addToStudyInFather(blocp,edges[i] , name)
+ group = None
+ if len(edgesBords) > 0:
+ group = geompy.CreateGroup(blocp, geompy.ShapeType["EDGE"])
+ geompy.UnionList(group, edgesBords)
+ edgesBords = group
+
+ return volDefautPart, blocp, tore, faceFissure, facesExternes, facesExtBloc, facesExtElli, aretesInternes, ellipsoidep, sharedFaces, sharedEdges, edgesBords
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- partition volume sain et bloc, face du bloc recevant la fissure
+
+def partitionVolumeSain(volumeSain,boiteDefaut):
+ """
+ Partition du volume complet sur lequel porte le calcul par le cube qui contiendra le defaut
+ @param volumeSain : volume complet (geomObject)
+ @param boiteDefaut : cube qui contiendra le defaut, positionné dans l'espace (son centre doit être au voisinage
+ immediat de la peau de l'objet sain: le tore elliptique debouche de paroi)
+ @return (volumeSainPart, partieSaine, volDefaut, faceBloc) : volume complet partionné par le cube, partie saine,
+ bloc du defaut (solide commun au cube et au volume complet), face du bloc defaut correspondant à la paroi.
+ """
+ logging.info("start")
+
+ volumeSainPart = geompy.MakePartition([volumeSain], [boiteDefaut], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+ [a,b] = geompy.ExtractShapes(volumeSainPart, geompy.ShapeType["SOLID"], True)
+ volDefaut = geompy.GetInPlaceByHistory(volumeSainPart, boiteDefaut)
+ if geompy.GetSubShapeID(volumeSainPart,b) == geompy.GetSubShapeID(volumeSainPart,volDefaut):
+ partieSaine = a
+ else:
+ partieSaine = b
+ faceBloc = geompy.GetShapesOnShapeAsCompound(volumeSain, volDefaut, geompy.ShapeType["FACE"], GEOM.ST_ON)
+
+ geompy.addToStudy( volumeSainPart, 'volumeSainPart' )
+ geompy.addToStudyInFather( volumeSainPart, partieSaine, 'partieSaine' )
+ geompy.addToStudyInFather( volumeSainPart, volDefaut, 'volDefaut' )
+ geompy.addToStudyInFather( volDefaut, faceBloc, 'faceBloc' )
+ return volumeSainPart, partieSaine, volDefaut, faceBloc
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import smesh
+import SMESH
+
+# -----------------------------------------------------------------------------
+# --- peau interne du defaut dans le maillage sain
+
+def peauInterne(fichierMaillage, nomZones):
+ """
+ Retrouve les groupes de défaut dans le maillage sain modifié par CreateHoleSkin (CreeZoneDefautMaillage)
+ On récupère le volume et la peau de la zone de défaut, les éventuelles faces et arêtes internes de cette zone.
+ """
+ logging.info("start")
+ ([maillageSain], status) = smesh.CreateMeshesFromMED(fichierMaillage)
+
+ groups = maillageSain.GetGroups()
+ zoneDefaut = None
+ for grp in groups:
+ #print " ",grp.GetName()
+ if grp.GetName() == nomZones + "_vol":
+ zoneDefaut = grp
+ break
+ zoneDefaut_skin = None
+ for grp in groups:
+ if grp.GetName() == nomZones + "_skin":
+ zoneDefaut_skin = grp
+ break
+ zoneDefaut_internalFaces = None
+ for grp in groups:
+ if grp.GetName() == nomZones + "_internalFaces":
+ zoneDefaut_internalFaces = grp
+ break
+ zoneDefaut_internalEdges = None
+ for grp in groups:
+ if grp.GetName() == nomZones + "_internalEdges":
+ zoneDefaut_internalEdges = grp
+ break
+
+ nbAdded, maillageSain, DefautBoundary = maillageSain.MakeBoundaryElements( SMESH.BND_2DFROM3D, 'DefBound', '', 0, [ zoneDefaut ])
+ internal = maillageSain.GetMesh().CutListOfGroups( [ DefautBoundary ], [ zoneDefaut_skin ], 'internal' )
+ internalBoundary = smesh.CopyMesh( internal, 'internalBoundary', 0, 0)
+
+ return maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- calcul de produit mixte pour orientation
+
+def produitMixte(o, p1, p2, p3):
+ """
+ produit mixte de 3 vecteurs a partir d'une origine et 3 points
+ """
+ coordo = geompy.PointCoordinates(o)
+ coordp1 = geompy.PointCoordinates(p1)
+ coordp2 = geompy.PointCoordinates(p2)
+ coordp3 = geompy.PointCoordinates(p3)
+ u = [coordp1[0] - coordo[0], coordp1[1] - coordo[1], coordp1[2] - coordo[2]]
+ v = [coordp2[0] - coordo[0], coordp2[1] - coordo[1], coordp2[2] - coordo[2]]
+ w = [coordp3[0] - coordo[0], coordp3[1] - coordo[1], coordp3[2] - coordo[2]]
+ pm = (u[0]*v[1]*w[2] + v[0]*w[1]*u[2] + w[0]*u[1]*v[2]) - (u[0]*w[1]*v[2] + v[0]*u[1]*w[2] + w[0]*v[1]*u[2])
+ logging.debug('pm=%s', pm)
+ return pm
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from geomsmesh import geompy
+import logging
+import math
+
+# -----------------------------------------------------------------------------
+# --- projection d'un point sur une courbe.
+
+def projettePointSurCourbe(pt, edge):
+ """
+ projection d'un point p sur une courbe c
+ on suppose que la distance (c(u), p) passe par un minimum quand u varie entre 0 et 1
+ et qu'elle presente pas de minimum local
+ """
+ #logging.debug("start")
+
+ dist = []
+ nbSlices = 50
+ du = 1.0/nbSlices
+ for i in range(nbSlices + 1):
+ p = geompy.MakeVertexOnCurve(edge, du*i)
+ d = geompy.MinDistance(p,pt)
+ dist.append((d,i))
+ dist.sort()
+ #logging.debug("dist %s", dist)
+ umin = du*dist[0][1]
+ umax = du*dist[1][1]
+ #umin = 0.0
+ #umax = 1.0
+ tol = 1.e-8
+ pmin = geompy.MakeVertexOnCurve(edge, umin)
+ pmax = geompy.MakeVertexOnCurve(edge, umax)
+ dmin = geompy.MinDistance(pmin,pt)
+ dmax = geompy.MinDistance(pmax,pt)
+ dext = geompy.MinDistance(pmin,pmax)
+ i=0
+ while dext > tol and i < 100 :
+ i = i+1
+ utest = (umax + umin) / 2.0
+ ptest = geompy.MakeVertexOnCurve(edge, utest)
+ dtest = geompy.MinDistance(ptest,pt)
+ if dmin < dmax:
+ umax = utest
+ pmax = ptest
+ dmax = dtest
+ else:
+ umin = utest
+ pmin = ptest
+ dmin = dtest
+ dext = geompy.MinDistance(pmin,pmax)
+ #logging.debug('umin=%s umax=%s dmin=%s dmax=%s dtest=%s dext=%s', umin,umax,dmin,dmax,dtest,dext)
+ if abs(utest) < 1.e-7:
+ utest = 0.0
+ if abs(1.0-utest) < 1.e-7:
+ utest = 1.0
+ logging.debug('u=%s, nbiter=%s dtest=%s dext=%s',utest,i,dtest,dext)
+ return utest
+
\ No newline at end of file
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- prolongation des segments extremité des polylines, pour la découpe
+
+def prolongeVertices(vertices):
+ """
+ Prolongation des segments extremité d'une polyline définie par un vecteur de points.
+ Chaque nouvelle extremité est obtenue par symétrie point du voisin de cette ancienne extrémité
+ (symétrie de centre l'ancienne extrémite) : les segments extremes sont doublés.
+ @param vertices : liste ordonnée des points (geomObject) de la polyline
+ @return vertices : liste avec les deux extremités modifiées
+ """
+ logging.info("start")
+ if len(vertices) < 2:
+ return vertices
+ v0 = vertices[0]
+ v1 = vertices[1]
+ m0 = geompy.MakeMirrorByPoint(v1, v0)
+ ve = vertices[-1]
+ vd = vertices[-2]
+ m1 = geompy.MakeMirrorByPoint(vd, ve)
+ vertices[0] = m0
+ vertices[-1] = m1
+ return vertices
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- prolongation d'un wire par deux segments tangents
+
+def prolongeWire(aWire, extrem, norms, long):
+ """
+ """
+ logging.info("start")
+ if geompy.NumberOfEdges(aWire) > 1:
+ edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"])
+ else:
+ edges = [aWire]
+ for i, v1 in enumerate(extrem):
+ exts = [geompy.MakeTranslationVectorDistance(v1, norms[i], l) for l in (-long, long)]
+ dists = [(geompy.MinDistance(v, aWire), i , v) for i, v in enumerate(exts)]
+ dists.sort()
+ v2 = dists[-1][-1]
+ #v2 = geompy.MakeTranslationVectorDistance(v1, norms[i], long)
+ edge = geompy.MakeEdge(v1, v2)
+ edges.append(edge)
+ name = "extrem%d"%i
+ #geompy.addToStudy(edge,name)
+ wireProlonge = geompy.MakeWire(edges)
+ geompy.addToStudy(wireProlonge, "wireProlonge")
+ return wireProlonge
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- recherche et classement des edges du tore par propagate
+
+def propagateTore(tore):
+ """
+ Classement des edges du tore par une operation 'propagate'
+ @param tore partionné et coupé
+ @return (diams, circles, geners) edges dans le plan de fissure, edges demi circulaires,
+ edges selon la generatrice (liste de compounds)
+ """
+ logging.info("start")
+
+ lencomp = []
+ compounds = geompy.Propagate(tore)
+ for i in range(len(compounds)):
+ #geompy.addToStudyInFather( tore, compounds[i], 'edges' )
+ props = geompy.BasicProperties(compounds[i])
+ lencomp.append(props[0])
+ pass
+ minlen = min(lencomp)
+ maxlen = max(lencomp)
+ diams = []
+ geners = []
+ circles = []
+ for i in range(len(lencomp)):
+ if (lencomp[i]- minlen)/minlen < 0.01 :
+ diams.append(compounds[i])
+ elif (maxlen - lencomp[i])/lencomp[i] < 0.2 :
+ geners.append(compounds[i])
+ else:
+ circles.append(compounds[i])
+
+ geompy.addToStudyInFather( tore, diams[0], 'diams0' )
+ geompy.addToStudyInFather( tore, diams[1], 'diams1' )
+ geompy.addToStudyInFather( tore, circles[0], 'circles0' )
+ geompy.addToStudyInFather( tore, circles[1], 'circles1' )
+ geompy.addToStudyInFather( tore, geners[0], 'geners' )
+
+ return diams, circles, geners
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from geomsmesh import smesh
+
+# -----------------------------------------------------------------------------
+# --- nommage des objets mesh (algorithme, hypothèse, subMesh)
+
+def putName(objmesh,name, i=-1):
+ if i >= 0:
+ suffix = "_%d"%i
+ name += suffix
+ smesh.SetName(objmesh, name)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+import GEOM
+import math
+import numpy as np
+
+def mydot(a):
+ return np.dot(a,a)
+
+# -----------------------------------------------------------------------------
+# --- groupe de quadrangles de face transformé en face géométrique par filling
+
+def quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss):
+ """
+ groupe de quadrangles de face transformée en faces géométriques par filling
+ on part de quadrangles définissant une zone a 4 cotés (convexe), et on reconstitue n lignes de p points.
+ Ces n lignes de p points sont transformées en n courbes géométriques,
+ à partir desquelles on reconstitue une surface géométrique.
+ Il peut y avoir plusieurs faces géométriques reconstituées, si on fournit des groupes de quadrangles non connexes.
+ On détecte les angles vifs, pour conserver des arêtes vives délimitant des faces connexes.
+ @param meshQuad : maillages constitué de quadrangles constituant une ou plusieurs zones convexes
+ @return (fillings, noeuds_Bords) : liste de geomObject, listes des bords (bord = liste ordonnée de noeuds (geomObject))
+ """
+ logging.info("start")
+
+ isVecteurDefaut = False
+ if shapeFissureParams.has_key('vecteurDefaut'):
+ isVecteurDefaut = True
+ vecteurDefaut = shapeFissureParams['vecteurDefaut']
+
+ fillings = [] # les faces reconstituées, découpées selon les arêtes vives
+ noeuds_bords = [] #
+ bords_Partages = [] # contient a la fin les courbes correspondant aux arêtes vives
+ fillconts = [] # les faces reconstituées, sans découpage selon les arêtes vives
+ idFilToCont = [] # index face découpée vers face sans découpe
+ iface = 0 # index face découpée
+ icont = 0 # index face continue
+
+ allNodeIds = meshQuad.GetNodesId()
+ while len(allNodeIds):
+ nodeIds = allNodeIds
+ for idNode in nodeIds: # rechercher un coin
+ elems = meshQuad.GetNodeInverseElements(idNode)
+ if len(elems) == 1:
+ # un coin: un noeud, un element quadrangle
+ elem = elems[0]
+ break;
+ idStart = idNode # le noeud de coin
+ elemStart = elem # l'élément quadrangle au coin
+ xyz = meshQuad.GetNodeXYZ(idStart)
+ logging.debug("idStart %s, coords %s", idStart, str(xyz))
+
+ nodelines =[] # on va constituer une liste de lignes de points
+ nextLine = True
+ ligneFinale = False
+ while nextLine:
+ logging.debug("--- une ligne")
+ idNode = idStart
+ elem = elemStart
+ if ligneFinale:
+ agauche = False # sens de parcours des 4 noeuds d'un quadrangle
+ nextLine = False
+ else:
+ agauche = True
+ ligneIncomplete = True # on commence une ligne de points
+ debutLigne = True
+ nodeline = []
+ elemline = []
+ while ligneIncomplete: # compléter la ligne de points
+ nodeline.append(idNode)
+ allNodeIds.remove(idNode)
+ elemline.append(elem)
+ nodes = meshQuad.GetElemNodes(elem)
+ i = nodes.index(idNode) # repérer l'index du noeud courant (i) dans l'élément quadrangle (0 a 3)
+ if agauche: # déterminer le noeud suivant (j) et celui opposé (k) dans le quadrangle
+ if i < 3:
+ j = i+1
+ else:
+ j = 0
+ if j < 3:
+ k = j+1
+ else:
+ k = 0
+ else:
+ if i > 0:
+ j = i -1
+ else:
+ j = 3
+ if j > 0:
+ k = j -1
+ else:
+ k = 3
+ isuiv = nodes[j] #noeud suivant
+ iapres = nodes[k] #noeud opposé
+ if debutLigne:
+ debutLigne = False
+ # précédent a trouver, dernière ligne : précédent au lieu de suivant
+ if agauche:
+ if i > 0:
+ iprec = nodes[i -1]
+ else:
+ iprec = nodes[3]
+ idStart = iprec
+ elems3 = meshQuad.GetNodeInverseElements(iprec)
+ if len(elems3) == 1: # autre coin
+ ligneFinale = True
+ else:
+ for elem3 in elems3:
+ if elem3 != elem:
+ elemStart = elem3
+ break
+ #print nodes, idNode, isuiv, iapres
+ elems1 = meshQuad.GetNodeInverseElements(isuiv)
+ elems2 = meshQuad.GetNodeInverseElements(iapres)
+ ligneIncomplete = False
+ for elem2 in elems2:
+ if elems1.count(elem2) and elem2 != elem:
+ ligneIncomplete = True
+ idNode = isuiv
+ elem = elem2
+ break
+ if not ligneIncomplete:
+ nodeline.append(isuiv)
+ allNodeIds.remove(isuiv)
+ logging.debug("nodeline %s", nodeline)
+ logging.debug("elemline %s", elemline)
+ nodelines.append(nodeline)
+
+ # on a constitué une liste de lignes de points connexes
+ logging.debug("dimensions [%s, %s]", len(nodelines), len(nodeline))
+
+ # stockage des coordonnées dans un tableau numpy
+ mat = np.zeros((len(nodelines), len(nodeline), 3))
+ for i, ligne in enumerate(nodelines):
+ for j, nodeId in enumerate(ligne):
+ mat[i,j] = meshQuad.GetNodeXYZ(nodeId)
+ logging.debug("matrice de coordonnées: \n%s",mat)
+ logging.debug("dimensions %s", mat.shape)
+
+ # recherche d'angles supérieurs a un seuil sur une ligne : angle entre deux vecteurs successifs
+ cosmin = math.cos(math.pi/4.) # TODO: angle reference en paramètre
+ vecx = mat[:, 1:, :] - mat[:, :-1, :] # vecteurs selon direction "x"
+ vx0 = vecx[:, :-1, :] # vecteurs amont
+ vx1 = vecx[:, 1:, :] # vecteurs aval
+ e = np.einsum('ijk,ijk->ij', vx0, vx1) # produit scalaire des vecteurs
+ f = np.apply_along_axis(mydot, 2, vx0) # normes carrées vecteurs amont
+ g = np.apply_along_axis(mydot, 2, vx1) # normes carrées vecteurs aval
+ h = e/(np.sqrt(f*g)) # cosinus
+ ruptureX = h < cosmin # True si angle > reference
+ logging.debug("matrice de rupture X: \n%s",ruptureX)
+ rupX = filter(lambda x: np.prod(ruptureX[:,x]), range(len(nodeline)-2))
+ logging.debug("colonnes de rupture: %s",rupX)
+ # recherche d'angles supérieurs a un seuil sur une colonne : angle entre deux vecteurs successifs
+ vecy = mat[ 1:, :, :] - mat[:-1, :, :] # vecteurs selon direction "y"
+ vy0 = vecy[:-1, :, :] # vecteurs amont
+ vy1 = vecy[ 1:, :, :] # vecteurs aval
+ e = np.einsum('ijk,ijk->ij', vy0, vy1) # produit scalaire des vecteurs
+ f = np.apply_along_axis(mydot, 2, vy0) # normes carrées vecteurs amont
+ g = np.apply_along_axis(mydot, 2, vy1) # normes carrées vecteurs aval
+ h = e/(np.sqrt(f*g)) # cosinus
+ ruptureY = h < cosmin # True si angle > reference
+ logging.debug("matrice de rupture Y: \n%s",ruptureY)
+ rupY = filter(lambda x: np.prod(ruptureY[x, :]), range(len(nodelines)-2))
+ logging.debug("lignes de rupture: %s",rupY)
+ if (len(rupX)*len(rupY)) > 0:
+ logging.critical("""Cas non traité: présence d'angles vifs dans 2 directions,
+ lors de la reconstitution des faces géométriques dans la zone remaillée""")
+
+ mats = []
+ bordsPartages = []
+ if (len(rupX)> 0):
+ rupX.append(mat.shape[1]-1)
+ for i, index in enumerate(rupX):
+ imax = index+2
+ imin = 0
+ if i > 0:
+ imin = rupX[i-1] + 1
+ mats.append(mat[:, imin:imax, :])
+ if imax == mat.shape[1] + 1:
+ ifin = 0
+ else:
+ ifin = imax
+ bordsPartages.append([imin,ifin]) # les indices différents de 0 correspondent à des bords partagés
+ elif (len(rupY)> 0):
+ rupY.append(mat.shape[0]-1)
+ for i, index in enumerate(rupY):
+ imax = index+2
+ imin = 0
+ if i > 0:
+ imin = rupY[i-1] + 1
+ mats.append(mat[imin:imax, :, :])
+ if imax == mat.shape[0] + 1:
+ ifin = 0
+ else:
+ ifin = imax
+ bordsPartages.append([imin,ifin]) # les indices différents de 0 correspondent à des bords partagés
+ else:
+ mats.append(mat)
+ bordsPartages.append([0,0]) # les indices différents de 0 correspondent à des bords partagés
+
+ curvconts = []
+ for nmat, amat in enumerate(mats):
+ logging.debug("dimensions matrice %s: %s", nmat, amat.shape)
+ nbLignes = amat.shape[1] # pas de rupture, ou rupture selon des colonnes: on transpose
+ nbCols = amat.shape[0]
+ if len(rupY) > 0 : # rupture selon des lignes: pas de transposition
+ nbLignes = amat.shape[0]
+ nbCols = amat.shape[1]
+ curves = []
+ noeudsBords = []
+ for i in range(4):
+ noeudsBords.append([])
+ k = 0
+ for i in range(nbLignes):
+ nodeList = []
+ for j in range(nbCols):
+ #logging.debug("point[%s,%s] = (%s, %s, %s)",i,j,amat[i,j,0], amat[i,j,1], amat[i,j,2])
+ if len(rupY) > 0 : # pas de transposition
+ node = geompy.MakeVertex(amat[i,j,0], amat[i,j,1], amat[i,j,2])
+ else: # transposition
+ node = geompy.MakeVertex(amat[j,i,0], amat[j,i,1], amat[j,i,2])
+ nodeList.append(node)
+ if i == 0:
+ noeudsBords[0].append(node)
+ #name = "bord0_%d"%k
+ #geompy.addToStudy( node, name )
+ if i == (nbLignes -1):
+ noeudsBords[2].append(node)
+ #name = "bord2_%d"%k
+ #geompy.addToStudy( node, name )
+ if j == 0:
+ noeudsBords[1].append(node)
+ #name = "bord1_%d"%k
+ #geompy.addToStudy( node, name )
+ if j == (nbCols -1):
+ noeudsBords[3].append(node)
+ #name = "bord3_%d"%k
+ #geompy.addToStudy( node, name )
+ k += 1
+ curve = geompy.MakeInterpol(nodeList, False, False)
+ #name = "curve_%d"%i
+ #geompy.addToStudy( curve, name )
+ if len(curvconts) == 0 or len(curves) > 0: # éliminer les doublons de la surface sans découpe
+ curvconts.append(nodeList)
+ curves.append(curve)
+ if bordsPartages[nmat][0] :
+ bordsPartages[nmat][0] = curves[0] # la première ligne est un bord partagé
+ else:
+ bordsPartages[nmat][0] = None
+ if bordsPartages[nmat][1] :
+ bordsPartages[nmat][1] = curves[-1] # la dernière ligne est un bord partagé
+ else:
+ bordsPartages[nmat][1] = None
+ filling = geompy.MakeFilling(geompy.MakeCompound(curves), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
+ # --- test orientation filling
+ vertex = geompy.MakeVertexOnSurface(filling, 0.5, 0.5)
+ normal = geompy.GetNormal(filling, vertex)
+
+ if centreFondFiss is not None:
+ logging.debug("orientation filling a l'aide du centre de fond de fissure")
+ vecteurDefaut = geompy.MakeVector(centreFondFiss, vertex)
+
+ if not isVecteurDefaut:
+ pointIn_x = 0.0
+ pointIn_y = 0.0
+ pointIn_z = 0.0
+ pointExplicite = False
+ if shapeFissureParams.has_key('pointIn_x'):
+ pointExplicite = True
+ pointIn_x = shapeFissureParams['pointIn_x']
+ if shapeFissureParams.has_key('pointIn_y'):
+ pointExplicite = True
+ pointIn_y = shapeFissureParams['pointIn_y']
+ if shapeFissureParams.has_key('pointIn_z'):
+ pointExplicite = True
+ pointIn_z = shapeFissureParams['pointIn_z']
+ if pointExplicite:
+ cdg = geompy.MakeVertex(pointIn_x, pointIn_y, pointIn_z)
+ logging.debug("orientation filling par point intérieur %s", (pointIn_x, pointIn_y, pointIn_z))
+ vecteurDefaut = geompy.MakeVector(cdg, vertex)
+
+ if shapeFissureParams.has_key('convexe'):
+ isConvexe = shapeFissureParams['convexe']
+ logging.debug("orientation filling par indication de convexité %s", isConvexe)
+ cdg = geompy.MakeCDG(filling)
+ if isConvexe:
+ vecteurDefaut = geompy.MakeVector(cdg, vertex)
+ else:
+ vecteurDefaut = geompy.MakeVector(vertex, cdg)
+
+ if vecteurDefaut is not None:
+ geompy.addToStudy(normal, "normFillOrig%d"%iface)
+ geompy.addToStudy(vecteurDefaut, "fromInterieur%d"%iface)
+ if geompy.GetAngleRadians(vecteurDefaut, normal) > math.pi/2.0:
+ filling = geompy.ChangeOrientation(filling)
+ geompy.addToStudy( filling, "filling%d"%iface )
+ #geompy.ExportBREP(filling, "filling.brep")
+ iface = iface+1
+ fillings.append(filling)
+ noeuds_bords.append(noeudsBords)
+ idFilToCont.append(icont)
+ bords_Partages += bordsPartages
+ pass # --- loop on mats
+ # --- reconstruction des faces continues à partir des listes de noeuds
+ # les courbes doivent suivre la courbure pour éviter les oscillations
+ if icont == iface - 1: # pas de découpe, on garde la même face
+ fillcont = fillings[-1]
+ else:
+ nbLignes = len(curvconts[0])
+ curves = []
+ for i in range(nbLignes):
+ nodes = [curvconts[j][i] for j in range(len(curvconts))]
+ curve = geompy.MakeInterpol(nodes, False, False)
+ curves.append(curve)
+ fillcont = geompy.MakeFilling(geompy.MakeCompound(curves), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
+ geompy.addToStudy( fillcont, "filcont%d"%icont )
+ fillconts.append(fillcont)
+ icont = icont+1
+ pass # --- loop while there are remaining nodes
+
+ return fillings, noeuds_bords, bords_Partages, fillconts, idFilToCont
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import smesh
+import SMESH
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- maillage complet et fissure
+
+def RegroupeSainEtDefaut(maillageSain, blocComplet, extrusionFaceFissure, faceGeomFissure, nomVolume, normal = None):
+ """
+ Maillage sain sans la zone de defaut
+ TODO: a completer
+ """
+ logging.info('Concatenation')
+
+ maillageComplet = smesh.Concatenate([maillageSain.GetMesh(), blocComplet.GetMesh()], 1, 1, 1e-05,False)
+
+ groups = maillageComplet.GetGroups()
+ grps = [ grp for grp in groups if grp.GetName() == 'FACE1']
+ faceFissure = grps[0]
+ grps = [ grp for grp in groups if grp.GetName() == 'nfondfis']
+ noeudsFondFissure = grps[0]
+ grps = [ grp for grp in groups if grp.GetName() == 'fisInPi']
+ fisInPi = grps[0]
+ grps = [ grp for grp in groups if grp.GetName() == 'fisOutPi']
+ fisOutPi = grps[0]
+
+ # --- TODO: fiabiliser l'orientation dans le cas general
+ if normal is None:
+ normal = smesh.MakeDirStruct( 0, 0, 1 )
+ maillageComplet.Reorient2D( fisInPi, normal, [0,0,0])
+ maillageComplet.Reorient2D( fisOutPi, normal, [0,0,0])
+
+ shapes = []
+ if extrusionFaceFissure is not None:
+ subIds = geompy.SubShapeAllIDs(extrusionFaceFissure, geompy.ShapeType["SOLID"])
+ if len(subIds) > 1:
+ shapes = geompy.ExtractShapes(extrusionFaceFissure, geompy.ShapeType["SOLID"], False)
+ else:
+ shapes = [extrusionFaceFissure]
+# else:
+# subIds = geompy.SubShapeAllIDs(faceGeomFissure, geompy.ShapeType["FACE"])
+# if len(subIds) > 1:
+# shapes = geompy.ExtractShapes(faceGeomFissure, geompy.ShapeType["FACE"], False)
+# else:
+# shapes = [faceGeomFissure]
+
+ grpEdges = []
+ grpFaces = []
+ grpVolumes = []
+ if len(shapes) == 0:
+ shapes = [None] # calcul uniquement avec les normales des faces mailles de la fissure
+ for i, aShape in enumerate(shapes):
+ logging.info('Detection elements affectes par le dedoublement de la face %d'%i)
+ affectedGroups = maillageComplet.AffectedElemGroupsInRegion([faceFissure], [noeudsFondFissure], aShape)
+ grps = [ grp for grp in affectedGroups if grp.GetName() == 'affectedEdges']
+ affectedEdges = grps[0]
+ affectedEdges.SetName('affEd%d'%i)
+ grpEdges.append(affectedEdges)
+ grps = [ grp for grp in affectedGroups if grp.GetName() == 'affectedFaces']
+ affectedFaces = grps[0]
+ affectedFaces.SetName('affFa%d'%i)
+ grpFaces.append(affectedFaces)
+ grps = [ grp for grp in affectedGroups if grp.GetName() == 'affectedVolumes']
+ affectedVolumes = grps[0]
+ affectedVolumes.SetName('affVo%d'%i)
+ grpVolumes.append(affectedVolumes)
+ logging.info("union des groupes d'edges")
+ affectedEdges = maillageComplet.UnionListOfGroups(grpEdges, 'affEdges')
+ logging.info("union des groupes de faces")
+ affectedFaces = maillageComplet.UnionListOfGroups(grpFaces, 'affFaces')
+ logging.info("union des groupes de volumes")
+ affectedVolumes = maillageComplet.UnionListOfGroups(grpVolumes, 'affVols')
+ for grp in affectedGroups:
+ logging.debug("nom groupe %s",grp.GetName())
+ [ FACE2, FACE2_nodes ] = maillageComplet.DoubleNodeElemGroups([faceFissure], [noeudsFondFissure], affectedGroups, True, True)
+ FACE2.SetName( 'FACE2' )
+
+ GroupVol = maillageComplet.CreateEmptyGroup( SMESH.VOLUME, nomVolume )
+ nbAdd = GroupVol.AddFrom( maillageComplet.GetMesh() )
+
+ return maillageComplet
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+import math
+from triedreBase import triedreBase
+O, OX, OY, OZ = triedreBase()
+
+# -----------------------------------------------------------------------------
+# --- operateur de rotation translation d'un objet centré à l'origine
+
+def rotTrans(objet, orientation, point, normal, trace = False):
+ """
+ Déplacement par rotation translation d'un objet centré à l'origine, vers un point de la surface de la pièce saine
+ dans laquelle on insère le défaut.
+ @param objet : objet original centré à l'origine (geomObject)
+ @param orientation : rotation selon OX de l'objet original (degrés)
+ @param point : le point qui sera le centre de l'objet déplacé (geomObject), en général sur la surface de la pièce saine
+ @param normal : la normale à la surface de la pièce saine au point central (geomObject)
+ @return trans : objet transformé (geomObject)
+ """
+ logging.info("start")
+ planXY = geompy.MakePlaneLCS(None, 2000, 1)
+ projXY = geompy.MakeProjection(normal, planXY)
+ [v1,v2] = geompy.ExtractShapes(projXY, geompy.ShapeType["VERTEX"], False)
+ xyz1 = geompy.PointCoordinates(v1)
+ xyz2 = geompy.PointCoordinates(v2)
+ x = xyz2[0] - xyz1[0]
+ y = xyz2[1] - xyz1[1]
+ sinalpha = y / math.sqrt(x*x + y*y)
+ cosalpha = x / math.sqrt(x*x + y*y)
+ alpha = math.asin(sinalpha)
+ if cosalpha < 0:
+ alpha = math.pi -alpha
+
+ beta = geompy.GetAngleRadians(OZ, normal)
+ [v1,v2] = geompy.ExtractShapes(normal, geompy.ShapeType["VERTEX"], False)
+ xyz1 = geompy.PointCoordinates(v1)
+ xyz2 = geompy.PointCoordinates(v2)
+ z = xyz2[2] - xyz1[2]
+ if z < 0:
+ beta = math.pi -beta
+
+ rot0 = geompy.MakeRotation(objet, OX, orientation*math.pi/180.0)
+ rot1 = geompy.MakeRotation(rot0, OZ, alpha)
+ axe2 = geompy.MakeRotation(OY, OZ, alpha)
+ rot2 = geompy.MakeRotation(rot1, axe2, beta -math.pi/2.)
+ logging.debug("alpha",alpha)
+ logging.debug("beta",beta)
+ if trace:
+ geompy.addToStudy( rot1, 'rot1' )
+ geompy.addToStudy( axe2, 'axe2' )
+ geompy.addToStudy( rot2, 'rot2' )
+
+ xyz = geompy.PointCoordinates(point)
+ trans = geompy.MakeTranslation(rot2, xyz[0], xyz[1], xyz[2])
+ return trans
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- construction d'une shape de dectection des éléments à modifier suite à la la duplication des noeuds de la face fissure (d'un coté de la face)
+
+def shapeSurFissure(facesFissure):
+ """
+ TODO: a completer, Normaliser les vecteurs et ponderer par les surfaces...
+ """
+ logging.info('start')
+ normal = None
+ subIds = geompy.SubShapeAllIDs(facesFissure, geompy.ShapeType["FACE"])
+ if len(subIds) > 1:
+ logging.debug("plusieurs faces de fissure")
+ faces = geompy.ExtractShapes(facesFissure, geompy.ShapeType["FACE"], False)
+ extrusions = []
+ for n,face in enumerate(faces):
+ vertex = geompy.MakeVertexOnSurface(face, 0.5, 0.5)
+ normal = geompy.GetNormal(face, vertex)
+ extrusion = geompy.MakePrismVecH(face, normal, 100)
+ extrusions.append(extrusion)
+ extrusionFaceFissure = geompy.MakeCompound(extrusions)
+ else:
+ logging.debug("une seule face de fissure")
+ face = facesFissure
+ vertex = geompy.MakeVertexOnSurface(face, 0.5, 0.5)
+ normal = geompy.GetNormal(face, vertex)
+ extrusionFaceFissure = geompy.MakePrismVecH(facesFissure, normal, 100)
+
+ geompy.addToStudy(extrusionFaceFissure, "extrusionFaceFissure")
+ return extrusionFaceFissure, normal
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- identification des shapes modifiées par la duplication des noeuds de la face fissure (d'un coté de la face)
+
+def shapesSurFissure(blocPartition, plane1, faceFissure, gencnt):
+ """
+ TODO: a completer
+ """
+ logging.info('start')
+
+ shapesAModifier = []
+ vertex = geompy.MakeVertexOnSurface(plane1, 0.5, 0.5)
+ normal = geompy.GetNormal(plane1, vertex)
+ extrusion = geompy.MakePrismVecH(plane1, normal, 100)
+
+ sharedSolids = []
+ solids= geompy.GetShapesOnBox ( extrusion, blocPartition, geompy.ShapeType("SOLID"), GEOM.ST_ONIN )
+ for solid in solids:
+ sharedSolids += geompy.GetSharedShapes(faceFissure, solid, geompy.ShapeType["SOLID"])
+ logging.debug("sharedSolids %s",sharedSolids)
+
+ sharedFaces = []
+ faces= geompy.GetShapesOnBox ( extrusion, blocPartition, geompy.ShapeType("FACE"), GEOM.ST_ONIN )
+ for face in faces:
+ sharedFaces += geompy.GetSharedShapes(faceFissure, face, geompy.ShapeType["FACE"])
+ logging.debug("sharedFaces %s",sharedFaces)
+
+ sharedEdges = []
+ edges= geompy.GetShapesOnBox ( extrusion, blocPartition, geompy.ShapeType("EDGE"), GEOM.ST_ONIN )
+ for edge in edges:
+ if not edge.IsSame(gencnt):
+ sharedEdges += geompy.GetSharedShapes(faceFissure, edge, geompy.ShapeType["EDGE"])
+ logging.debug("sharedEdges %s",sharedEdges)
+
+ shapesAModifier = [ sharedSolids, sharedFaces, sharedEdges]
+ return shapesAModifier
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- tri par longueur d'edges
+
+def sortEdges(edgesToSort):
+ """
+ tri des edges par longueur
+ """
+ logging.info('start')
+
+ lenEdges = [(geompy.BasicProperties(edge)[0], i, edge) for i, edge in enumerate(edgesToSort)]
+ lenEdges.sort()
+ edgesSorted = [edge for length, i, edge in lenEdges]
+ return edgesSorted, lenEdges[0][0], lenEdges[-1][0]
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- tri par surface de faces
+
+def sortFaces(facesToSort):
+ """
+ tri des faces par surface
+ """
+ logging.info('start')
+
+ surFaces = [(geompy.BasicProperties(face)[1], i, face) for i, face in enumerate(facesToSort)]
+ surFaces.sort()
+ facesSorted = [face for surf, i, face in surFaces]
+ return facesSorted, surFaces[0][0], surFaces[-1][0]
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- tri par longueur des 3 generatrices
+
+def sortGeneratrices(tore, geners):
+ """
+ tri des 3 edges 'génératrices' selon leur longueur.
+ @param tore
+ @param les edges 'generatrices'
+ @return (genext, genint, gencnt) les 3 edges, de la plus grande à la plus petite
+ """
+ logging.info("start")
+
+ genx = geompy.ExtractShapes(geners[0], geompy.ShapeType["EDGE"], True)
+
+ lenx = []
+ for i in range(len(genx)):
+ props = geompy.BasicProperties(genx[i])
+ lenx.append(props[0])
+ pass
+ minlen = min(lenx)
+ maxlen = max(lenx)
+ genext=None
+ gencnt=None
+ genint=None
+ for i in range(len(genx)):
+ if lenx[i] == minlen:
+ genint = genx[i]
+ elif lenx[i] == maxlen:
+ genext = genx[i]
+ else:
+ gencnt= genx[i]
+ pass
+
+ geompy.addToStudyInFather( tore, genext, 'genext' )
+ geompy.addToStudyInFather( tore, genint, 'genint' )
+ geompy.addToStudyInFather( tore, gencnt, 'gencnt' )
+
+ return genext, genint, gencnt
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- tri par volume de solides
+
+def sortSolids(solidsToSort):
+ """
+ tri des solides par volume
+ """
+ logging.info('start')
+
+ volSolids = [(geompy.BasicProperties(solid)[2], i, solid) for i, solid in enumerate(solidsToSort)]
+ volSolids.sort()
+ solidsSorted = [solid for vol, i, solid in volSolids]
+ return solidsSorted, volSolids[0][0], volSolids[-1][0]
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- substract a list of subShapes from another
+
+def substractSubShapes(obj, subs, toRemove):
+ """
+ liste de subshapes par difference
+ """
+ logging.info("start")
+ idToremove = {}
+ subList = []
+ for s in toRemove:
+ idToremove[geompy.GetSubShapeID(obj, s)] = s
+ for s in subs:
+ idsub = geompy.GetSubShapeID(obj, s)
+ if idsub not in idToremove.keys():
+ subList.append(s)
+ logging.debug("subList=%s", subList)
+ return subList
--- /dev/null
+
+from blocFissure import gmu
+from blocFissure.gmu.initEtude import initEtude
+initEtude()
+from blocFissure.gmu.triedreBase import triedreBase
+O, OX, OY, OZ = triedreBase()
+
+from blocFissure.gmu.distance2 import distance2
+a=[10, 20, 30]
+b=[5, 7, 3]
+c=distance2(a,b)
+
+import unittest
+from blocFissure.gmu import initLog
+initLog.setUnitTests()
+
+from blocFissure.gmu import distance2
+
+suite = unittest.TestLoader().loadTestsFromTestCase(distance2.Test_distance2)
+unittest.TextTestRunner(verbosity=2).run(suite)
+
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+import math
+from triedreBase import triedreBase
+
+O, OX, OY, OZ = triedreBase()
+
+# -----------------------------------------------------------------------------
+# --- tore et plan de fissure
+
+def toreFissure(minRad,allonge,rayTore):
+ """
+ Construction de la geometrie du tore elliptique autour du front de fissure.
+ L'ellipse est construite dans le plan xoy, axe oy.
+ @param minRad :petit rayon
+ @param allonge :rapport grand rayon / petit rayon
+ @param rayTore :rayon du tore construit autour de la generatrice de l'ellipse
+ @return (generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part) : ellipse, section du tore,
+ tore plein, face plane de le fissure, plan de la fissure, tore partitioné par le plan de fissure.
+ """
+ logging.info("start ", minRad, allonge, rayTore)
+
+ Vertex_1 = geompy.MakeVertex( minRad, 0, 0)
+ Vertex_2 = geompy.MakeVertex(-minRad, 0, 0)
+ Vertex_3 = geompy.MakeRotation(Vertex_1, OZ, 45*math.pi/180.0)
+ Arc_1 = geompy.MakeArc(Vertex_1, Vertex_2, Vertex_3)
+ generatrice = geompy.MakeScaleAlongAxes(Arc_1, O, 1, allonge, 1)
+
+ #geompy.addToStudy( Vertex_1, 'Vertex_1' )
+ #geompy.addToStudy( Vertex_2, 'Vertex_2' )
+ #geompy.addToStudy( Vertex_3, 'Vertex_3' )
+ #geompy.addToStudy( Arc_1, 'Arc_1' )
+ #geompy.addToStudy( generatrice, 'generatrice' )
+
+ # --- face circulaire sur la generatrice, pour extrusion
+
+ Circle_1 = geompy.MakeCircle(O, OY, rayTore)
+ Rotation_1 = geompy.MakeRotation(Circle_1, OY, -90*math.pi/180.0)
+ Translation_1 = geompy.MakeTranslation(Rotation_1, minRad, 0, 0)
+ FaceGenFiss = geompy.MakeFaceWires([Translation_1], 1)
+
+ #geompy.addToStudy( Circle_1, 'Circle_1' )
+ #geompy.addToStudy( Rotation_1, 'Rotation_1' )
+ #geompy.addToStudy( Translation_1, 'Translation_1' )
+ #geompy.addToStudy( FaceGenFiss, 'FaceGenFiss' )
+
+ # --- tore extrude
+
+ Pipe_1 = geompy.MakePipe(FaceGenFiss, generatrice)
+
+ # --- plan fissure, delimite par la generatrice
+
+ Scale_1_vertex_3 = geompy.GetSubShape(generatrice, [3])
+ Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Scale_1_vertex_3)
+ FaceFissure = geompy.MakeFaceWires([generatrice, Line_1], 1)
+
+ #geompy.addToStudyInFather( generatrice, Scale_1_vertex_3, 'Scale_1:vertex_3' )
+ #geompy.addToStudy( Line_1, 'Line_1' )
+ #geompy.addToStudy( FaceFissure, 'FaceFissure' )
+
+ # --- tore coupe en 2 demi tore de section 1/2 disque
+
+ Plane_1 = geompy.MakePlane(O, OZ, 2000)
+ Pipe1Part = geompy.MakePartition([Pipe_1], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
+ geompy.addToStudy(Pipe1Part , 'Pipe1Part' )
+
+ return generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# --- origine et vecteurs de base
+
+O = None
+OX = None
+OY = None
+OZ = None
+
+def triedreBase():
+ """
+ definitions globales du triedre de reference,
+ objets partages par plusieurs methodes
+ """
+ global O, OX, OY, OZ
+
+ if O == None:
+ logging.info("start")
+ O = geompy.MakeVertex(0, 0, 0)
+ OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+ OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+ OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+
+ geompy.addToStudy( O, 'O' )
+ geompy.addToStudy( OX, 'OX' )
+ geompy.addToStudy( OY, 'OY' )
+ geompy.addToStudy( OZ, 'OZ' )
+
+ return O, OX, OY, OZ
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- calcul de la position d'une shape par rapport à une face (dessus, dessous, sur la surface même)
+
+def whichSide(face, obj, tol = 1.e-3):
+ """
+ Position d'un objet par rapport a une face (non nécessairement plane).
+ L'objet est supposé situé entierement d'un coté de la face,
+ ou lui appartenant totalement (objets traversants non pris en compte)
+ renvoie 1 si 'objet est du coté de la normale à la face,
+ -1 de l'autre coté, 0 si il est sur la face
+ """
+ logging.debug('start')
+ side = 0
+ logging.debug("shape info %s", geompy.ShapeInfo(obj))
+ nbEdges = geompy.NbShapes(obj, geompy.ShapeType["EDGE"]) # --- attention ! pour une seule edge presente, renvoie 2
+ logging.debug(" nbEdges %s", nbEdges)
+ nbFaces = geompy.NbShapes(obj, geompy.ShapeType["FACE"]) # --- attention ! pour une seule face presente, renvoie 2
+ logging.debug(" nbFaces %s", nbFaces)
+ vertices = geompy.ExtractShapes(obj, geompy.ShapeType["VERTEX"], False)
+ if nbEdges > 0 and nbFaces == 0: # --- edges
+ if nbEdges <= 2:
+ point = geompy.MakeVertexOnCurve(obj, 0.5)
+ vertices.append(point)
+ else:
+ edges = geompy.ExtractShapes(obj, geompy.ShapeType["EDGE"], False)
+ for anEdge in edges:
+ point = geompy.MakeVertexOnCurve(anEdge, 0.5)
+ vertices.append(point)
+ elif nbFaces >0: # --- faces
+ if nbFaces <=2:
+ point = geompy.MakeVertexOnSurface(obj, 0.5, 0.5)
+ vertices.append(point)
+ if nbFaces > 2:
+ faces = geompy.ExtractShapes(obj, geompy.ShapeType["FACE"], False)
+ for aFace in faces:
+ point = geompy.MakeVertexOnSurface(aFace, 0.5, 0.5)
+ vertices.append(point)
+ else: # --- vertices
+ vertices = [obj]
+ for vertex in vertices:
+ distance = geompy.MinDistance(vertex, face)
+ logging.debug(" distance %s", distance)
+ if distance > tol:
+ projection = geompy.MakeProjection(vertex, face)
+ normal = geompy.GetNormal(face, projection)
+ vect = geompy.MakeVector(projection, vertex)
+ angle = geompy.GetAngle(normal, vect)
+ logging.debug(" angle %s", angle)
+ side = 1
+ if abs(angle) > 10:
+ side = -1
+ break
+ logging.debug(" side %s", side)
+ return side
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- calcul de la position d'une shape par rapport à une face (dessus, dessous, sur la surface même)
+
+def whichSideMulti(facerefs, ifil, obj, centre, tol = 1.e-3):
+ """
+ Position d'un objet par rapport a un ensemble de faces (non nécessairement planes).
+ Ces faces délimitent partiellement un volume, le point "centre" est supposé dans le volume
+ L'objet est supposé situé entierement d'un coté des faces,
+ ou appartenant totalement à une face (objets traversants non pris en compte)
+ renvoie 1 si 'objet est dedans (inside),
+ -1 dehors (outside), 0 si il est sur une face d'index ifil
+ """
+ logging.debug('start')
+ side = 0
+ logging.debug("shape info %s", geompy.ShapeInfo(obj))
+ nbEdges = geompy.NbShapes(obj, geompy.ShapeType["EDGE"]) # --- attention ! pour une seule edge presente, renvoie 2
+ logging.debug(" nbEdges %s", nbEdges)
+ vertices = geompy.ExtractShapes(obj, geompy.ShapeType["VERTEX"], False)
+ if nbEdges > 0 : # --- edges
+ if nbEdges <= 2:
+ point = geompy.MakeVertexOnCurve(obj, 0.5)
+ vertices.append(point)
+ else:
+ edges = geompy.ExtractShapes(obj, geompy.ShapeType["EDGE"], False)
+ for anEdge in edges:
+ point = geompy.MakeVertexOnCurve(anEdge, 0.5)
+ vertices.append(point)
+ else: # --- vertices
+ vertices = [obj]
+ nbOnRef = 0
+ nbOnOther = 0
+ for vertex in vertices:
+ nbMiss = 0
+ for i, face in enumerate(facerefs):
+ distance = geompy.MinDistance(vertex, face)
+ logging.debug(" distance %s", distance)
+ if distance > tol:
+ if geompy.MinDistance(vertex, centre) > tol:
+ line = geompy.MakeLineTwoPnt(vertex, centre)
+ else :
+ side = 1 # le centre est inside...
+ break
+ part = geompy.MakePartition([line], [face], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
+ nbpts = geompy.NbShapes(part,geompy.ShapeType["VERTEX"])
+ if nbpts > 2:
+ side = -1 # outside
+ break
+ else:
+ nbMiss += 1
+ pass # peut-être inside, tester les autres faces
+ else:
+ if i == ifil:
+ nbOnRef +=1 # le point est sur la face de référence, on continue avec les autres points
+ break
+ else:
+ nbOnOther += 1 # le point est sur une autre face, mais il peut aussi être sur la face de référence...
+ pass # on peut tester les autres faces
+ if nbMiss == len(facerefs):
+ side = 1 # inside
+ if side != 0:
+ break
+ if side == 0 and nbOnRef < len(vertices):
+ side = 1 # inside
+ logging.debug(" side %s", side)
+ return side
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+import logging
+from geomsmesh import geompy
+
+# -----------------------------------------------------------------------------
+# --- calcul de la position d'une shape par rapport à une face (dessus, dessous, sur la surface même)
+
+def whichSideVertex(face, vertex, tol = 1.e-3):
+ """
+ Position d'un vertex par rapport a une face (non nécessairement plane).
+ renvoie 1 si le vertex est du coté de la normale à la face,
+ -1 de l'autre coté, 0 si il est sur la face
+ """
+ #logging.info('start')
+ side = 0
+ distance = geompy.MinDistance(vertex, face)
+ #logging.debug(" distance %s", distance)
+ if distance > tol:
+ projection = geompy.MakeProjection(vertex, face)
+ normal = geompy.GetNormal(face, projection)
+ vect = geompy.MakeVector(projection, vertex)
+ angle = geompy.GetAngle(normal, vect)
+ #logging.debug(" angle %s", angle)
+ side = 1
+ if abs(angle) > 10:
+ side = -1
+ logging.debug("side %s distance %s", side, distance)
+ return side
+
--- /dev/null
+# Copyright (C) 2012-2014 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# 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(UsePyQt4)
+
+# --- scripts ---
+
+# scripts / static
+SET(plugin_SCRIPTS
+ __init__.py
+ fissureCoude_ihm.py
+ fissureCoude_plugin.py
+)
+
+# --- resources ---
+
+# uic files / to be processed by pyuic
+SET(_pyuic_files
+ fissureCoude.ui
+ fissureGenerale.ui
+)
+
+# scripts / pyuic wrappings
+PYQT4_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+
+# --- rules ---
+
+SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/ihm)
+
+SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/ihm)
\ No newline at end of file
--- /dev/null
+{'nbAxeTubeP2': 12, 'orientation': 90.0, 'nbAxeTubeP1': 16, 'posiAngul': 20.0, 'influence': 50.0, 'nbCirconf': 20, 'azimut': 160.0, 'longueur': 400.0, 'rbFissExt': True, 'cbForceEllipse': False, 'cbOptDiscrFiss': True, 'lTubeP2': 1200.0, 'dext': 760.0, 'angle': 60.0, 'cbOptDiscrSain': True, 'nbAxeCoude': 15, 'epais': 40.0, 'nbSecteurs': 6, 'aretesFaceFissure': 5.0, 'rCintr': 1200.0, 'rayonTore': 2.5, 'nbEpaisseur': 3, 'nbTranches': 176, 'rbPosiAngul': True, 'lenSegPipe': 2.4511363636363637, 'absCurv': 0.0, 'profondeur': 10.0, 'lTubeP1': 1600.0, 'nbCouronnes': 5}
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>826</width>
+ <height>540</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_8">
+ <item row="0" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Coude Sain</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
+ <string>Géométrie</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>L_TUBE_P1</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_angle">
+ <property name="toolTip">
+ <string>Valeur de l'angle du coude en degrés</string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="minimum">
+ <double>-181.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>180.000000000000000</double>
+ </property>
+ <property name="value">
+ <double>-181.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>R_CINTR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>EPAIS</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_epais">
+ <property name="toolTip">
+ <string>Valeur de l’épaisseur du coude et des embouts</string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>L_TUBE_P2</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_lTubeP2">
+ <property name="toolTip">
+ <string>Valeur de la longueur de l’embout P2 à l’extrémité duquel seront appliqués les chargements</string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>DEXT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>ANGLE</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_dext">
+ <property name="toolTip">
+ <string>Valeur du diamètre externe du coude et des embouts droits</string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_lTubeP1">
+ <property name="toolTip">
+ <string>Valeur de la longueur de l’embout P1 à l’extrémité duquel seront appliqués les chargements</string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_rCintr">
+ <property name="toolTip">
+ <string>Valeur du rayon de cintrage du coude</string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cb_optDiscrSain">
+ <property name="toolTip">
+ <string>Paramètres optionnels de discretisation</string>
+ </property>
+ <property name="text">
+ <string>Options de discretisation</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="gb_discrSain">
+ <property name="title">
+ <string>Maillage</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>Nombres de segments</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>NB_AXE_TUBE_P1</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QSpinBox" name="sb_nbAxeTubeP1">
+ <property name="toolTip">
+ <string>Nombre d’éléments le long de l’embout P1</string>
+ </property>
+ <property name="maximum">
+ <number>10000</number>
+ </property>
+ <property name="value">
+ <number>15</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_9">
+ <property name="text">
+ <string>NB_AXE_TUBE_P2</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QSpinBox" name="sb_nbAxeTubeP2">
+ <property name="toolTip">
+ <string>Nombre d’éléments le long de l’embout P2</string>
+ </property>
+ <property name="maximum">
+ <number>10000</number>
+ </property>
+ <property name="value">
+ <number>15</number>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_10">
+ <property name="text">
+ <string>NB_AXE_COUDE</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QSpinBox" name="sb_nbAxeCoude">
+ <property name="toolTip">
+ <string>Nombre d’éléments le long de l’axe du coude</string>
+ </property>
+ <property name="maximum">
+ <number>10000</number>
+ </property>
+ <property name="value">
+ <number>10</number>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_11">
+ <property name="text">
+ <string>NB_CIRCONF</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QSpinBox" name="sb_nbCirconf">
+ <property name="toolTip">
+ <string><html><head/><body><p>Nombre d’éléments le long de la circonférence</p><p>(nombre pair)</p></body></html></string>
+ </property>
+ <property name="maximum">
+ <number>10000</number>
+ </property>
+ <property name="value">
+ <number>20</number>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_13">
+ <property name="text">
+ <string>NB_EPAISSEUR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QSpinBox" name="sb_nbEpaisseur">
+ <property name="toolTip">
+ <string>Nombre d'éléments dans l'épaisseur</string>
+ </property>
+ <property name="maximum">
+ <number>10000</number>
+ </property>
+ <property name="value">
+ <number>3</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>Fissure</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QGroupBox" name="groupBox_5">
+ <property name="title">
+ <string>Géométrie fissure</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_12">
+ <item row="0" column="0">
+ <layout class="QGridLayout" name="gridLayout_10">
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="groupBox_4">
+ <property name="title">
+ <string>position</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_7">
+ <item>
+ <widget class="QRadioButton" name="rb_fissInt">
+ <property name="toolTip">
+ <string><html><head/><body><p>Fissure positionnée sur la face interne</p></body></html></string>
+ </property>
+ <property name="text">
+ <string>fissure interne</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="rb_fissExt">
+ <property name="toolTip">
+ <string><html><head/><body><p>Fissure positionnée sur la face externe</p></body></html></string>
+ </property>
+ <property name="text">
+ <string>fissure externe</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="cb_forceEllipse">
+ <property name="toolTip">
+ <string><html><head/><body><p>Forcer une fissure de forme elliptique, même si elle est longue</p></body></html></string>
+ </property>
+ <property name="accessibleDescription">
+ <string/>
+ </property>
+ <property name="text">
+ <string>forcer elliptique</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <layout class="QGridLayout" name="gridLayout_5">
+ <item row="2" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_azimut">
+ <property name="toolTip">
+ <string>Valeur de la position circonférentielle du centre de la fissure comptée positivement en degrés à partir de l’extrados jusqu’à l’intrados en passant par le flanc gauche</string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="minimum">
+ <double>-181.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>180.000000000000000</double>
+ </property>
+ <property name="value">
+ <double>-181.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_18">
+ <property name="text">
+ <string>PROFONDEUR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_profondeur">
+ <property name="toolTip">
+ <string><html><head/><body><p>Profondeur de la fissure :</p><p>distance maximale entre le fond de fissure et la peau interne ou externe sur laquelle débouche la fissure</p></body></html></string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_19">
+ <property name="text">
+ <string>LONGUEUR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_14">
+ <property name="text">
+ <string>AZIMUT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_15">
+ <property name="text">
+ <string>ORIEN</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_orientation">
+ <property name="toolTip">
+ <string>Valeur de l’angle en degrés formé par le grand axe de la fissure et la génératrice du coude donnant ainsi l’orientation du défaut</string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="minimum">
+ <double>-1.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>90.000000000000000</double>
+ </property>
+ <property name="value">
+ <double>-1.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_longueur">
+ <property name="toolTip">
+ <string>Longueur du grand axe de la fissure mesurée sur le coude en peau interne ou externe, suivant la peau sur laquelle se trouve la fissure</string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="0">
+ <widget class="QGroupBox" name="groupBox_11">
+ <property name="title">
+ <string>position longitudinale</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_11">
+ <item row="0" column="0">
+ <widget class="QRadioButton" name="rb_absCurv">
+ <property name="toolTip">
+ <string>Définition de la position longitudinale par une abscisse curiviligne</string>
+ </property>
+ <property name="text">
+ <string>ABS_CURV</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QRadioButton" name="rb_posiAngul">
+ <property name="toolTip">
+ <string>Définition de la position longitudinale par un angle</string>
+ </property>
+ <property name="text">
+ <string>POSI_ANGUL</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_absCurv">
+ <property name="toolTip">
+ <string><html><head/><body><p>Valeur de la position longitudinale du centre de la fissure définie par rapport à l'interface de l'embout P1 :</p><p>Abcisse curviligne le long de l'axe du coude, sur la peau interne ou externe, selon la position de la fissure.</p><p><br/></p></body></html></string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_posiAngul">
+ <property name="toolTip">
+ <string><html><head/><body><p>Valeur de la position longitudinale du centre de la fissure définie par rapport à l'interface de l'embout P1 :</p><p>Angle en degrés formé par la section contenant le centre de la fissure et l'interface de l'embout P1.</p><p><br/></p></body></html></string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="minimum">
+ <double>-181.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>180.000000000000000</double>
+ </property>
+ <property name="value">
+ <double>-181.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_6">
+ <item>
+ <widget class="QGroupBox" name="groupBox_6">
+ <property name="title">
+ <string>Maillage fissure</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_7">
+ <item row="1" column="0" colspan="2">
+ <widget class="QGroupBox" name="groupBox_8">
+ <property name="title">
+ <string>maillage zone de fissure</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <item>
+ <widget class="QGroupBox" name="groupBox_9">
+ <property name="title">
+ <string>pipe rayonnant</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <layout class="QGridLayout" name="gridLayout_6">
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_21">
+ <property name="text">
+ <string>NB_TRANCHES</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_22">
+ <property name="text">
+ <string>NB_COURONNE</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QSpinBox" name="sb_nbCouronne">
+ <property name="toolTip">
+ <string><html><head/><body><p>Pipe rayonnant construit sur le fond de fissure :</p><p>nombre de couronnes du maillage rayonnant autour de la ligne de fond de fissure, y compris la couronne centrale formée de prismes.</p></body></html></string>
+ </property>
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>10000</number>
+ </property>
+ <property name="value">
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_23">
+ <property name="text">
+ <string>NB_SECTEUR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QSpinBox" name="sb_nbSecteur">
+ <property name="toolTip">
+ <string><html><head/><body><p>Pipe rayonnant construit sur le fond de fissure :</p><p>nombre de secteurs selon un cercle normal au fond de fissure.</p></body></html></string>
+ </property>
+ <property name="minimum">
+ <number>3</number>
+ </property>
+ <property name="maximum">
+ <number>10000</number>
+ </property>
+ <property name="value">
+ <number>3</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QSpinBox" name="sb_nbTranches">
+ <property name="toolTip">
+ <string><html><head/><body><p>Pipe rayonnant construit sur le fond de fissure :</p><p>Nombre de mailles (approximatif) le long de la ligne de fond de fissure.</p></body></html></string>
+ </property>
+ <property name="minimum">
+ <number>7</number>
+ </property>
+ <property name="maximum">
+ <number>100000</number>
+ </property>
+ <property name="value">
+ <number>7</number>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_20">
+ <property name="text">
+ <string>RAYON_TORE</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_rayonTore">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string><html><head/><body><p>Pipe rayonnant construit sur le fond de fissure :</p><p>Rayon du pipe.</p></body></html></string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ <property name="value">
+ <double>2.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>6</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cb_optDiscrFiss">
+ <property name="toolTip">
+ <string>Paramètres optionnels de discrétisation</string>
+ </property>
+ <property name="text">
+ <string>Options de discretisation</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="gb_discrFacesExternes">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="title">
+ <string>faces externes</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QLabel" name="label_24">
+ <property name="text">
+ <string>aretes face fissure</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDoubleSpinBox" name="dsb_aretesFaceFissure">
+ <property name="toolTip">
+ <string><html><head/><body><p>Faces externes de la zone à remailler.</p><p>Mailage en triangles : valeur cible des arêtes.</p></body></html></string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>1</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QGroupBox" name="gb_zoneRemail">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="title">
+ <string>identification zone à remailler</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_16">
+ <item row="0" column="0">
+ <layout class="QGridLayout" name="gridLayout_17">
+ <item row="1" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_influence">
+ <property name="toolTip">
+ <string><html><head/><body><p>La zone remaillée contiendra toutes les mailles du maillage sain à une distance de la face de fissure inférieure à cette valeur.</p></body></html></string>
+ </property>
+ <property name="decimals">
+ <number>5</number>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_25">
+ <property name="text">
+ <string>distance influence</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="1">
+ <spacer name="horizontalSpacer_8">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>47</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="lb_calcul">
+ <property name="font">
+ <font>
+ <pointsize>24</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string>--- Calcul en cours ---</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_9">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="0">
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>4</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QPushButton" name="pb_reset">
+ <property name="toolTip">
+ <string>réinitialisation de tous les paramètres à leur valeur par défaut</string>
+ </property>
+ <property name="text">
+ <string>Reset</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pb_valPrec">
+ <property name="toolTip">
+ <string>réinitialisation de tous les paramètres à leur valeur de la précédente éxécution</string>
+ </property>
+ <property name="text">
+ <string>Précédent</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pb_recharger">
+ <property name="toolTip">
+ <string>réinitialisation des paramètres à partir d'un fichier préalablement sauvegardé</string>
+ </property>
+ <property name="text">
+ <string>Recharger</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pb_sauver">
+ <property name="toolTip">
+ <string>sauvegarde des paramètres dans un fichier à choisir</string>
+ </property>
+ <property name="text">
+ <string>Sauver</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_7">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ <zorder>verticalSpacer_2</zorder>
+ <zorder>horizontalSpacer</zorder>
+ <zorder>lb_calcul</zorder>
+ <zorder>horizontalSpacer_9</zorder>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>Dialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>1055</x>
+ <y>594</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>Dialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>1055</x>
+ <y>594</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>cb_optDiscrSain</sender>
+ <signal>clicked(bool)</signal>
+ <receiver>gb_discrSain</receiver>
+ <slot>setShown(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>69</x>
+ <y>312</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>70</x>
+ <y>549</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>cb_optDiscrFiss</sender>
+ <signal>clicked(bool)</signal>
+ <receiver>gb_discrFacesExternes</receiver>
+ <slot>setShown(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>1033</x>
+ <y>311</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>1033</x>
+ <y>387</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>cb_optDiscrFiss</sender>
+ <signal>clicked(bool)</signal>
+ <receiver>gb_zoneRemail</receiver>
+ <slot>setShown(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>1033</x>
+ <y>311</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>1036</x>
+ <y>472</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>cb_optDiscrFiss</sender>
+ <signal>clicked(bool)</signal>
+ <receiver>dsb_rayonTore</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>1033</x>
+ <y>311</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>1005</x>
+ <y>278</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>rb_absCurv</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>dsb_absCurv</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>477</x>
+ <y>392</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>649</x>
+ <y>396</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>rb_posiAngul</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>dsb_posiAngul</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>477</x>
+ <y>425</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>649</x>
+ <y>429</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure.gmu.fissureCoude import fissureCoude
+
+class fissureCoude_ihm(fissureCoude):
+ """
+ problème de fissure du Coude :
+ pour version IHM graphique
+ """
+
+# ---------------------------------------------------------------------------
+ def setDicoParams(self,dico):
+ self.dico = dico
+
+# ---------------------------------------------------------------------------
+ def setParamGeometrieSaine(self):
+ """
+ Paramètres géométriques du tuyau coudé sain:
+ angleCoude
+ r_cintr
+ l_tube_p1
+ l_tube_p2
+ epais
+ de
+ """
+ self.geomParams = dict(angleCoude = self.dico['angle'],
+ r_cintr = self.dico['rCintr'],
+ l_tube_p1 = self.dico['lTubeP1'],
+ l_tube_p2 = self.dico['lTubeP2'],
+ epais = self.dico['epais'],
+ de = self.dico['dext'])
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageSain(self):
+ self.meshParams = dict(n_long_p1 = self.dico['nbAxeTubeP1'],
+ n_ep = self.dico['nbEpaisseur'],
+ n_long_coude = self.dico['nbAxeCoude'],
+ n_circ_g = self.dico['nbCirconf'],
+ n_circ_d = self.dico['nbCirconf'],
+ n_long_p2 = self.dico['nbAxeTubeP2'])
+
+# ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """
+ paramètres de la fissure pour le tuyau coude
+ profondeur : 0 < profondeur <= épaisseur
+ rayonPipe : rayon du pipe correspondant au maillage rayonnant
+ lenSegPipe : longueur des mailles rayonnantes le long du fond de fissure (= rayonPipe par défaut)
+ azimut : entre 0 et 360°
+ alpha : 0 < alpha < angleCoude
+ longueur : <=2*profondeur ==> force une fissure elliptique (longueur/profondeur = grand axe/petit axe).
+ orientation : 0° : longitudinale, 90° : circonférentielle, autre : uniquement fissures elliptiques
+ lgInfluence : distance autour de la shape de fissure a remailler (si 0, pris égal à profondeur. A ajuster selon le maillage)
+ elliptique : True : fissure elliptique (longueur/profondeur = grand axe/petit axe); False : fissure longue (fond de fissure de profondeur constante, demi-cercles aux extrémites)
+ pointIn_x : optionnel coordonnées x d'un point dans le solide, pas trop loin du centre du fond de fissure (idem y,z)
+ externe : True : fissure face externe, False : fissure face interne
+ """
+ print "setParamShapeFissure", self.nomCas
+ self.shapeFissureParams = dict(profondeur = self.dico['profondeur'],
+ rayonPipe = self.dico['rayonTore'],
+ lenSegPipe = self.dico['lenSegPipe'],
+ azimut = self.dico['azimut'],
+ alpha = self.dico['posiAngul'],
+ longueur = self.dico['longueur'],
+ orientation = self.dico['orientation'],
+ lgInfluence = self.dico['influence'],
+ elliptique = self.dico['cbForceEllipse'],
+ externe = self.dico['rbFissExt'])
+
+# ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ """
+ Paramètres du maillage de la fissure pour le tuyau coudé
+ Voir également setParamShapeFissure, paramètres rayonPipe et lenSegPipe.
+ nbSegRad = nombre de couronnes
+ nbSegCercle = nombre de secteurs
+ areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
+ """
+ self.maillageFissureParams = dict(nomRep = '.',
+ nomFicSain = self.nomCas,
+ nomFicFissure = 'fissure_' + self.nomCas,
+ nbsegRad = self.dico['nbCouronnes'],
+ nbsegCercle = self.dico['nbSecteurs'],
+ areteFaceFissure = self.dico['aretesFaceFissure'])
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict(Entity_Node = 0,
+ Entity_Quad_Edge = 0,
+ Entity_Quad_Triangle = 0,
+ Entity_Quad_Quadrangle = 0,
+ Entity_Quad_Tetra = 0,
+ Entity_Quad_Hexa = 0,
+ Entity_Quad_Penta = 0,
+ Entity_Quad_Pyramid = 0)
+
--- /dev/null
+# -*- coding: utf-8 -*-
+
+# Copyright (C) 2006-2014 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# if you already have plugins defined in a salome_plugins.py file, add this file at the end.
+# if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py
+
+import sys, traceback
+import math
+from blocFissure import gmu
+from blocFissure.gmu import initLog
+#initLog.setDebug()
+initLog.setVerbose()
+
+from blocFissure.gmu import geomsmesh
+from blocFissure.casStandard import casStandard
+
+from blocFissure.ihm.fissureCoude_ihm import fissureCoude_ihm
+
+def fissureCoudeDlg(context):
+ # get context study, studyId, salomeGui
+ study = context.study
+ studyId = context.studyId
+ sg = context.sg
+
+ import os
+ #import subprocess
+ #import tempfile
+ from PyQt4 import QtCore
+ from PyQt4 import QtGui
+ from PyQt4.QtGui import QFileDialog
+ from PyQt4.QtGui import QMessageBox
+ from PyQt4.QtGui import QPalette
+ from PyQt4.QtGui import QColor
+ from fissureCoude_ui import Ui_Dialog
+
+ class fissureCoudeDialog(QtGui.QDialog):
+
+ def __init__(self):
+ QtGui.QDialog.__init__(self)
+ # Set up the user interface from Designer.
+ self.ui = Ui_Dialog()
+ self.ui.setupUi(self)
+
+ self.blackPalette = self.ui.dsb_angle.palette()
+ self.redPalette = QPalette()
+ self.redPalette.setColor(QPalette.Text, QColor(255,0,0))
+ self.NOK = False
+
+ self.initDefaut()
+ self.initDialog(self.defaut)
+ self.ui.dsb_angle.setSpecialValueText("saisie_obligatoire")
+ self.ui.dsb_rCintr.setSpecialValueText("saisie_obligatoire")
+ self.ui.dsb_lTubeP1.setSpecialValueText("saisie_obligatoire")
+ self.ui.dsb_lTubeP2.setSpecialValueText("saisie_obligatoire")
+ self.ui.dsb_epais.setSpecialValueText("saisie_obligatoire")
+ self.ui.dsb_dext.setSpecialValueText("saisie_obligatoire")
+ self.ui.dsb_profondeur.setSpecialValueText("saisie_obligatoire")
+ self.ui.dsb_longueur.setSpecialValueText("saisie_obligatoire")
+ self.ui.dsb_azimut.setSpecialValueText("saisie_obligatoire")
+ self.ui.dsb_orientation.setSpecialValueText("saisie_obligatoire")
+ self.ui.dsb_posiAngul.setSpecialValueText("saisie_obligatoire")
+ self.ui.dsb_absCurv.setSpecialValueText("saisie_obligatoire")
+ self.ui.sb_nbTranches.setSpecialValueText("saisie_obligatoire")
+ self.ui.sb_nbCouronne.setSpecialValueText("saisie_obligatoire")
+ self.ui.sb_nbSecteur.setSpecialValueText("saisie_obligatoire")
+ self.ui.dsb_aretesFaceFissure.setSpecialValueText("automatique")
+ self.ui.dsb_influence.setSpecialValueText("automatique")
+ self.ui.lb_calcul.hide()
+
+ # Connect up the buttons.
+ self.connect(self.ui.pb_valPrec, QtCore.SIGNAL("clicked()"),
+ self.readValPrec)
+ self.connect(self.ui.pb_reset, QtCore.SIGNAL("clicked()"),
+ self.resetVal)
+ self.connect(self.ui.pb_recharger, QtCore.SIGNAL("clicked()"),
+ self.recharger)
+ self.connect(self.ui.pb_sauver, QtCore.SIGNAL("clicked()"),
+ self.sauver)
+ self.disconnect(self.ui.buttonBox, QtCore.SIGNAL("accepted()"), self.accept)
+ self.connect(self.ui.buttonBox, QtCore.SIGNAL("accepted()"),
+ self.execute)
+
+ def initDefaut(self):
+ self.defaut = dict(
+ angle = -181.0,
+ rCintr = 0.0,
+ lTubeP1 = 0.0,
+ lTubeP2 = 0.0,
+ epais = 0.0,
+ dext = 0.0,
+ profondeur = 0.0,
+ longueur = 0.0,
+ azimut = -181.0,
+ orientation = -1.0,
+ posiAngul = -181.0,
+ absCurv = 0.0,
+ nbTranches = 7,
+ nbCouronnes = 1,
+ nbSecteurs = 3,
+ cbOptDiscrSain = False,
+ cbOptDiscrFiss = False,
+ rbPosiAngul = True,
+ rbFissExt = True,
+ cbForceEllipse = False,
+ nbAxeTubeP1 = 15,
+ nbAxeTubeP2 = 15,
+ nbAxeCoude = 10,
+ nbCirconf = 20,
+ nbEpaisseur = 3,
+ rayonTore = 2.0,
+ aretesFaceFissure = 0.0,
+ influence = 0.0,
+ )
+
+ def initDialog(self, dico):
+ self.ui.dsb_angle.setValue(dico['angle'])
+ self.ui.dsb_rCintr.setValue(dico['rCintr'])
+ self.ui.dsb_lTubeP1.setValue(dico['lTubeP1'])
+ self.ui.dsb_lTubeP2.setValue(dico['lTubeP2'])
+ self.ui.dsb_epais.setValue(dico['epais'])
+ self.ui.dsb_dext.setValue(dico['dext'])
+ self.ui.dsb_profondeur.setValue(dico['profondeur'])
+ self.ui.dsb_longueur.setValue(dico['longueur'])
+ self.ui.dsb_azimut.setValue(dico['azimut'])
+ self.ui.dsb_orientation.setValue(dico['orientation'])
+ self.ui.dsb_posiAngul.setValue(dico['posiAngul'])
+ self.ui.dsb_absCurv.setValue(dico['absCurv'])
+ self.ui.sb_nbTranches.setValue(dico['nbTranches'])
+ self.ui.sb_nbCouronne.setValue(dico['nbCouronnes'])
+ self.ui.sb_nbSecteur.setValue(dico['nbSecteurs'])
+ self.ui.dsb_aretesFaceFissure.setValue(dico['aretesFaceFissure'])
+ self.ui.dsb_influence.setValue(dico['influence'])
+ self.ui.sb_nbAxeTubeP1.setValue(dico['nbAxeTubeP1'])
+ self.ui.sb_nbAxeTubeP2.setValue(dico['nbAxeTubeP2'])
+ self.ui.sb_nbAxeCoude.setValue(dico['nbAxeCoude'])
+ self.ui.sb_nbCirconf.setValue(dico['nbCirconf'])
+ self.ui.sb_nbEpaisseur.setValue(dico['nbEpaisseur'])
+ self.ui.dsb_rayonTore.setValue(dico['rayonTore'])
+ #self.ui.cb_optDiscrSain.setChecked(False)
+ #self.ui.gb_discrSain.setShown(False)
+ self.ui.cb_optDiscrSain.setChecked(not(dico['cbOptDiscrSain']))
+ self.ui.cb_optDiscrSain.click()
+ self.ui.cb_optDiscrFiss.setChecked(not(dico['cbOptDiscrFiss']))
+ self.ui.cb_optDiscrFiss.click()
+ if dico['rbPosiAngul']:
+ self.ui.dsb_absCurv.setEnabled(False)
+ self.ui.dsb_posiAngul.setEnabled(True)
+ self.ui.rb_posiAngul.setChecked(True)
+ #self.ui.rb_posiAngul.click()
+ else:
+ self.ui.dsb_absCurv.setEnabled(True)
+ self.ui.dsb_posiAngul.setEnabled(False)
+ self.ui.rb_absCurv.setChecked(True)
+ #self.ui.rb_absCurv.click()
+ self.ui.rb_fissExt.setChecked(dico['rbFissExt'])
+ self.ui.cb_forceEllipse.setChecked(dico['cbForceEllipse'])
+ incomplet = self.testval(dico)
+ pass
+
+ def testval(self, dico):
+ incomplet = False
+ if dico['angle'] < -180.0:
+ self.ui.dsb_angle.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.dsb_angle.setPalette(self.blackPalette)
+
+ if dico['rCintr'] == 0.0:
+ self.ui.dsb_rCintr.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.dsb_rCintr.setPalette(self.blackPalette)
+
+ if dico['lTubeP1'] == 0.0:
+ self.ui.dsb_lTubeP1.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.dsb_lTubeP1.setPalette(self.blackPalette)
+
+ if dico['lTubeP2'] == 0.0:
+ self.ui.dsb_lTubeP2.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.dsb_lTubeP2.setPalette(self.blackPalette)
+
+ if dico['epais'] == 0.0:
+ self.ui.dsb_epais.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.dsb_epais.setPalette(self.blackPalette)
+
+ if dico['dext'] == 0.0:
+ self.ui.dsb_dext.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.dsb_dext.setPalette(self.blackPalette)
+
+ if dico['profondeur'] == 0.0:
+ self.ui.dsb_profondeur.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.dsb_profondeur.setPalette(self.blackPalette)
+
+ if dico['longueur'] == 0.0:
+ self.ui.dsb_longueur.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.dsb_longueur.setPalette(self.blackPalette)
+
+ if dico['azimut'] < -180.0:
+ self.ui.dsb_azimut.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.dsb_azimut.setPalette(self.blackPalette)
+
+ if dico['orientation'] < 0.0:
+ self.ui.dsb_orientation.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.dsb_orientation.setPalette(self.blackPalette)
+
+ if dico['posiAngul'] < -180.0 and dico['rbPosiAngul'] == True:
+ self.ui.dsb_posiAngul.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.dsb_posiAngul.setPalette(self.blackPalette)
+
+ if dico['absCurv'] == 0.0 and dico['rbPosiAngul'] == False:
+ self.ui.dsb_absCurv.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.dsb_absCurv.setPalette(self.blackPalette)
+
+ if dico['nbTranches'] == 7:
+ self.ui.sb_nbTranches.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.sb_nbTranches.setPalette(self.blackPalette)
+
+ if dico['nbCouronnes'] == 1:
+ self.ui.sb_nbCouronne.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.sb_nbCouronne.setPalette(self.blackPalette)
+
+ if dico['nbSecteurs'] == 3:
+ self.ui.sb_nbSecteur.setPalette(self.redPalette)
+ incomplet = True
+ else:
+ self.ui.sb_nbSecteur.setPalette(self.blackPalette)
+
+ print "incomplet: ", incomplet
+ return incomplet
+
+ def fileDefault(self):
+ filedef = os.path.expanduser("~/.config/salome/dialogFissureCoude.dic")
+ print filedef
+ return filedef
+
+ def writeDefault(self, dico):
+ filedef = self.fileDefault()
+ f = open(filedef, 'w')
+ f.write(str(dico))
+ f.close()
+
+ def readValPrec(self):
+ filedef = self.fileDefault()
+ if os.path.exists(filedef):
+ f = open(filedef, 'r')
+ txt = f.read()
+ dico = eval(txt)
+ print dico
+ self.initDialog(dico)
+
+ def resetVal(self):
+ #self.initDefaut()
+ self.initDialog(self.defaut)
+
+ def sauver(self):
+ print "sauver"
+ fileDiag = QFileDialog(self)
+ fileDiag.setFileMode(QFileDialog.AnyFile)
+ fileDiag.setNameFilter("Parametres *.dic (*.dic)")
+ fileDiag.setViewMode(QFileDialog.List)
+ if fileDiag.exec_() :
+ fileNames = fileDiag.selectedFiles()
+ filedef = fileNames[0]
+ dico = self.creeDico()
+ f = open(filedef, 'w')
+ f.write(str(dico))
+ f.close()
+
+ def recharger(self):
+ print "recharger"
+ fileDiag = QFileDialog(self)
+ fileDiag.setFileMode(QFileDialog.ExistingFile)
+ fileDiag.setNameFilter("Parametres *.dic (*.dic)")
+ fileDiag.setViewMode(QFileDialog.Detail)
+ if fileDiag.exec_() :
+ fileNames = fileDiag.selectedFiles()
+ filedef = fileNames[0]
+ print filedef
+ if os.path.exists(filedef):
+ f = open(filedef, 'r')
+ txt = f.read()
+ dico = eval(txt)
+ print dico
+ self.initDialog(dico)
+
+ def creeDico(self):
+ dico = dict(
+ angle = self.ui.dsb_angle.value(),
+ rCintr = self.ui.dsb_rCintr.value(),
+ lTubeP1 = self.ui.dsb_lTubeP1.value(),
+ lTubeP2 = self.ui.dsb_lTubeP2.value(),
+ epais = self.ui.dsb_epais.value(),
+ dext = self.ui.dsb_dext.value(),
+ profondeur = self.ui.dsb_profondeur.value(),
+ longueur = self.ui.dsb_longueur.value(),
+ azimut = self.ui.dsb_azimut.value(),
+ orientation = self.ui.dsb_orientation.value(),
+ posiAngul = self.ui.dsb_posiAngul.value(),
+ absCurv = self.ui.dsb_absCurv.value(),
+ nbTranches = self.ui.sb_nbTranches.value(),
+ nbCouronnes = self.ui.sb_nbCouronne.value(),
+ nbSecteurs = self.ui.sb_nbSecteur.value(),
+ cbOptDiscrSain = self.ui.cb_optDiscrSain.isChecked(),
+ cbOptDiscrFiss = self.ui.cb_optDiscrFiss.isChecked(),
+ rbPosiAngul = self.ui.rb_posiAngul.isChecked(),
+ rbFissExt = self.ui.rb_fissExt.isChecked(),
+ cbForceEllipse = self.ui.cb_forceEllipse.isChecked(),
+ nbAxeTubeP1 = self.ui.sb_nbAxeTubeP1.value(),
+ nbAxeTubeP2 = self.ui.sb_nbAxeTubeP2.value(),
+ nbAxeCoude = self.ui.sb_nbAxeCoude.value(),
+ nbCirconf = self.ui.sb_nbCirconf.value(),
+ nbEpaisseur = self.ui.sb_nbEpaisseur.value(),
+ rayonTore = self.ui.dsb_rayonTore.value(),
+ aretesFaceFissure = self.ui.dsb_aretesFaceFissure.value(),
+ influence = self.ui.dsb_influence.value(),
+ )
+ print dico
+ return dico
+
+ def checkValues(self):
+ return self.NOK
+
+ def execute(self):
+ dico = self.creeDico()
+ NOK = self.testval(dico)
+ if not(NOK):
+ dico['lenSegPipe'] = (dico['longueur'] + math.pi*dico['profondeur'])/dico['nbTranches']
+ print 'lenSegPipe', dico['lenSegPipe']
+ areteMinAngle = (dico['rCintr'] -dico['dext']/2.0)*(dico['angle']*math.pi/180.0)/dico['nbAxeCoude']
+ print'areteMinAngle', areteMinAngle
+ areteMinCirco = dico['dext']*math.pi/(2*dico['nbCirconf'])
+ print'areteMinCirco', areteMinCirco
+ areteMinEpais = dico['epais']/dico['nbEpaisseur']
+ print'areteMinEpais', areteMinEpais
+ if dico['influence'] == 0:
+ dico['influence'] = max(areteMinAngle, areteMinCirco, areteMinEpais)
+ print 'influence', dico['influence']
+ if dico['aretesFaceFissure'] == 0:
+ dico['aretesFaceFissure'] = (areteMinAngle + areteMinCirco)/2.0
+ print 'aretesFaceFissure', dico['aretesFaceFissure']
+ if dico['rbPosiAngul'] == False:
+ rmoy = (dico['dext'] - dico['epais'])/2.0
+ eta = 1
+ if dico['rbFissExt'] == False:
+ eta = -1
+ dico['posiAngul'] = (180.0/math.pi)*dico['absCurv']/(dico['rCintr']+(rmoy+eta*dico['epais']/2.0)*math.cos(math.pi*dico['azimut']/180.))
+ print 'posiAngul' , dico['posiAngul']
+
+ self.writeDefault(dico)
+ self.ui.lb_calcul.show()
+ probleme = fissureCoude_ihm(0)
+ probleme.setDicoParams(dico)
+ probleme.executeProbleme()
+ self.NOK = NOK
+ self.accept()
+
+ pass
+
+# ----------------------------------------------------------------------------
+
+ window = fissureCoudeDialog()
+# window.ui.dsb_tolerance.setValue(0.01)
+ retry = True
+ while(retry):
+ retry = False
+ window.exec_()
+ result = window.result()
+ if result:
+ # dialog accepted
+ print "dialog accepted, check"
+ retry = window.checkValues()
+ else:
+ print "dialog rejected, exit"
+ pass
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>631</width>
+ <height>490</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <property name="toolTip">
+ <string><html><head/><body><p>Insertion d'un maillage de fissure dans un maillage hexaédrique sain.</p><p>Le maillage sain est fourni sous forme de fichier Med.</p><p>La face de fissure est décrite par une géométrie dans un fichier brep.</p><p>La ou les arêtes de fond de fissure sont données par leurs index dans la face de fissure.</p><p>La procédure identfie des mailles saines à enlever et remailler, construit un maillage régulier rayonnant autour de la ligne de fond de fissure, reconstitue les faces externes en triangles, complète la zone à remailler en tétraèdres.</p></body></html></string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_11">
+ <item row="0" column="0" colspan="2">
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>maillage sain et géometries de fissure</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0">
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QPushButton" name="pb_maillage">
+ <property name="toolTip">
+ <string><html><head/><body><p>sélection du fichier med du maillage sain (hexaèdres)</p></body></html></string>
+ </property>
+ <property name="text">
+ <string>maillage sain</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="le_maillage">
+ <property name="toolTip">
+ <string><html><head/><body><p>fichier med du maillage sain (hexaèdres)</p></body></html></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QPushButton" name="pb_facefiss">
+ <property name="toolTip">
+ <string><html><head/><body><p>sélection du fichier brep (géométrie) décrivant la face de fissure.</p></body></html></string>
+ </property>
+ <property name="text">
+ <string>face fissure</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="le_facefiss">
+ <property name="toolTip">
+ <string><html><head/><body><p>fichier brep (géométrie) décrivant la face de fissure.</p></body></html></string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>index edges fond fissure</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="le_fondfiss">
+ <property name="toolTip">
+ <string><html><head/><body><p>Index des edges décrivant le fond de fissure, dans la face de fissure.</p><p>Sous forme d'une liste Python.</p><p>Exemples :<span style=" color:#00ffff;"/><span style=" font-style:italic; color:#00ffff;">[5,9]</span> ou <span style=" font-style:italic; color:#00ffff;">[3]</span></p><p>(on peut récupérer ces valeurs à l'aide du dialogue de création de groupes d'edges, dans GEOM)</p></body></html></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ <zorder></zorder>
+ <zorder></zorder>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="2">
+ <layout class="QGridLayout" name="gridLayout_10">
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>identification zone à remailler</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_12">
+ <item row="0" column="0">
+ <layout class="QGridLayout" name="gridLayout_6">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>distance influence</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_influence">
+ <property name="toolTip">
+ <string><html><head/><body><p>La zone remaillée contiendra toutes les mailles du maillage sain à une distance de la face de fissure inférieure à cette valeur.</p></body></html></string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="1">
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0" colspan="2">
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
+ <string>prémaillage face fissure</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_5">
+ <item row="0" column="0">
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>min</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_meshBrepMin">
+ <property name="toolTip">
+ <string><html><head/><body><p>Pour faciliter la détermination de la zone à remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.</p><p>Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.</p></body></html></string>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>max</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_meshBrepMax">
+ <property name="toolTip">
+ <string><html><head/><body><p>Pour faciliter la détermination de la zone à remailler, il faut des points sur la face de fissure, suffisament resserrés, en relation avec la taille des mailles du maillage sain.</p><p>Ces points sont obtenus par pré maillage de la face de fissure, en triangles. On donne la taille min et max des triangles.</p></body></html></string>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="1">
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>34</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="0" column="1" rowspan="2">
+ <widget class="QGroupBox" name="groupBox_4">
+ <property name="title">
+ <string>maillage zone de fissure</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_9">
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="groupBox_5">
+ <property name="title">
+ <string>pipe rayonnant</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_7">
+ <item row="0" column="0">
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>rayon pipe</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_rayonPipe">
+ <property name="toolTip">
+ <string><html><head/><body><p>Pipe rayonnant construit sur le fond de fissure :</p><p>Rayon du pipe.</p></body></html></string>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>longueur mailles</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_lenSegPipe">
+ <property name="toolTip">
+ <string><html><head/><body><p>Pipe rayonnant construit sur le fond de fissure :</p><p>Longueur des mailles le long de la ligne de fond de fissure.</p></body></html></string>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>couronnes</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QSpinBox" name="sb_couronnes">
+ <property name="toolTip">
+ <string><html><head/><body><p>Pipe rayonnant construit sur le fond de fissure :</p><p>nombre de couronnes de mailles autour de la ligne de fond de fissure.</p></body></html></string>
+ </property>
+ <property name="minimum">
+ <number>2</number>
+ </property>
+ <property name="maximum">
+ <number>10000</number>
+ </property>
+ <property name="value">
+ <number>4</number>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>secteurs</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QSpinBox" name="sb_secteurs">
+ <property name="toolTip">
+ <string><html><head/><body><p>Pipe rayonnant construit sur le fond de fissure :</p><p>nombre de secteurs selon un cercle normal au fond de fissure.</p></body></html></string>
+ </property>
+ <property name="minimum">
+ <number>4</number>
+ </property>
+ <property name="maximum">
+ <number>10000</number>
+ </property>
+ <property name="value">
+ <number>8</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="1">
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>6</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QGroupBox" name="groupBox_6">
+ <property name="title">
+ <string>faces externes</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_8">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_9">
+ <property name="text">
+ <string>aretes face fissure</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QDoubleSpinBox" name="dsb_areteFaceFissure">
+ <property name="toolTip">
+ <string><html><head/><body><p>Faces externes de la zone à remailler.</p><p>Mailage en triangles : valeur cible des arêtes.</p></body></html></string>
+ </property>
+ <property name="maximum">
+ <double>1000000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>1</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>112</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="1">
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="bb_OkCancel">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>bb_OkCancel</sender>
+ <signal>accepted()</signal>
+ <receiver>Dialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>bb_OkCancel</sender>
+ <signal>rejected()</signal>
+ <receiver>Dialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
--- /dev/null
+# Copyright (C) 2012-2014 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# --- scripts ---
+
+# scripts / static
+SET(plugin_SCRIPTS
+ __init__.py
+ cubeAngle.py
+ decoupeCylindre.py
+ disque_perce.py
+ ellipse_disque.py
+ ellipse_probleme.py
+ ellipse.py
+ eprouvetteCourbe.py
+ eprouvetteDroite.py
+ fissureGauche2.py
+ fissureGauche.py
+ genereMateriel.py
+ vis.py
+)
+
+# --- rules ---
+
+SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/blocFissure/materielCasTests)
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+import salome_notebook
+notebook = salome_notebook.NoteBook(theStudy)
+
+import os
+from blocFissure import gmu
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
+Vertex_1 = geompy.MakeVertex(0, 0, 100)
+Disk_1 = geompy.MakeDiskPntVecR(Vertex_1, OZ, 60)
+Vertex_2 = geompy.MakeVertex(-5, -5, 90)
+Vertex_3 = geompy.MakeVertex(65, 65, 110)
+Box_2 = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
+Common_1 = geompy.MakeCommon(Disk_1, Box_2)
+geompy.Export(Common_1, os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep"), "BREP")
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( Box_1, 'Box_1' )
+geompy.addToStudy( Vertex_1, 'Vertex_1' )
+geompy.addToStudy( Disk_1, 'Disk_1' )
+geompy.addToStudy( Vertex_2, 'Vertex_2' )
+geompy.addToStudy( Vertex_3, 'Vertex_3' )
+geompy.addToStudy( Box_2, 'Box_2' )
+geompy.addToStudy( Common_1, 'Common_1' )
+
+###
+### SMESH component
+###
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+
+smesh = smeshBuilder.New(theStudy)
+from salome.StdMeshers import StdMeshersBuilder
+Mesh_1 = smesh.Mesh(Box_1)
+Regular_1D = Mesh_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(15)
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
+isDone = Mesh_1.Compute()
+smesh.SetName(Mesh_1, 'Mesh_1')
+Mesh_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/CubeAngle.med"), 0, SMESH.MED_V2_2, 1 )
+
+## set object names
+smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')
+smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
+smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+import salome_notebook
+notebook = salome_notebook.notebook
+
+import os
+from blocFissure import gmu
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+O_1 = geompy.MakeVertex(0, 0, 0)
+OX_1 = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY_1 = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ_1 = geompy.MakeVectorDXDYDZ(0, 0, 1)
+Vertex_1 = geompy.MakeVertex(0, 0, 500)
+Vertex_2 = geompy.MakeVertex(100, 0, 500)
+Vertex_3 = geompy.MakeVertex(110, 0, 500)
+Vertex_4 = geompy.MakeVertex(117.071068, -2.928932, 500)
+Vertex_5 = geompy.MakeVertex(120, -10, 500)
+Vertex_6 = geompy.MakeVertex(120, -30, 500)
+Vertex_7 = geompy.MakeVertex(122.928932, -37.071068, 500)
+Vertex_8 = geompy.MakeVertex(130, -40, 500)
+Vertex_9 = geompy.MakeVertex(135, -40, 500)
+Vertex_10 = geompy.MakeVertex(160, -40, 500)
+Plane_1 = geompy.MakePlaneLCS(None, 2000, 2)
+Mirror_1_1 = geompy.MakeMirrorByPlane(Vertex_2, Plane_1)
+Mirror_1_2 = geompy.MakeMirrorByPlane(Vertex_3, Plane_1)
+Mirror_1_3 = geompy.MakeMirrorByPlane(Vertex_4, Plane_1)
+Mirror_1_4 = geompy.MakeMirrorByPlane(Vertex_5, Plane_1)
+Mirror_1_5 = geompy.MakeMirrorByPlane(Vertex_6, Plane_1)
+Mirror_1_6 = geompy.MakeMirrorByPlane(Vertex_7, Plane_1)
+Mirror_1_7 = geompy.MakeMirrorByPlane(Vertex_8, Plane_1)
+Mirror_1_8 = geompy.MakeMirrorByPlane(Vertex_9, Plane_1)
+Mirror_1_9 = geompy.MakeMirrorByPlane(Vertex_10, Plane_1)
+Curve_2 = geompy.MakeInterpol([Mirror_1_9, Mirror_1_8, Mirror_1_7, Mirror_1_6, Mirror_1_5, Mirror_1_4, Mirror_1_3, Mirror_1_2, Mirror_1_1, Vertex_1, Vertex_2, Vertex_3, Vertex_4, Vertex_5, Vertex_6, Vertex_7, Vertex_8, Vertex_9, Vertex_10], False, False)
+Circle_1 = geompy.MakeCircle(Vertex_1, None, 145)
+Vertex_11 = geompy.MakeVertex(0, -165, 500)
+Curve_2_vertex_2 = geompy.GetSubShape(Curve_2, [2])
+Curve_2_vertex_3 = geompy.GetSubShape(Curve_2, [3])
+Arc_1 = geompy.MakeArc(Curve_2_vertex_2, Vertex_11, Curve_2_vertex_3)
+FissInCylindre = geompy.MakeFaceWires([Curve_2, Arc_1], 1)
+Divided_Cylinder_1 = geompy.MakeDividedCylinder(145, 800, GEOM.SQUARE)
+CylindreSain = geompy.MakeRotation(Divided_Cylinder_1, OZ, 45*math.pi/180.0)
+[Compound_1, vertical, radial, Compound_4] = geompy.Propagate(CylindreSain)
+geompy.Export(FissInCylindre, os.path.join(gmu.pathBloc, "materielCasTests/FissInCylindre.brep"), "BREP")
+Vertex_12 = geompy.MakeVertex(0, -145, 500)
+Circle_2 = geompy.MakeCircle(Vertex_12, None, 145)
+Face_1 = geompy.MakeFaceWires([Circle_2], 1)
+Vertex_13 = geompy.MakeVertex(0, 0, 500)
+Disk_1 = geompy.MakeDiskPntVecR(Vertex_13, OZ_1, 170)
+FissInCylindre2 = geompy.MakeCommon(Face_1, Disk_1)
+geompy.Export(FissInCylindre2, os.path.join(gmu.pathBloc, "materielCasTests/FissInCylindre2.brep"), "BREP")
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( O_1, 'O' )
+geompy.addToStudy( OX_1, 'OX' )
+geompy.addToStudy( OY_1, 'OY' )
+geompy.addToStudy( OZ_1, 'OZ' )
+geompy.addToStudy( Vertex_1, 'Vertex_1' )
+geompy.addToStudy( Vertex_2, 'Vertex_2' )
+geompy.addToStudy( Vertex_3, 'Vertex_3' )
+geompy.addToStudy( Vertex_4, 'Vertex_4' )
+geompy.addToStudy( Vertex_5, 'Vertex_5' )
+geompy.addToStudy( Vertex_6, 'Vertex_6' )
+geompy.addToStudy( Vertex_7, 'Vertex_7' )
+geompy.addToStudy( Vertex_8, 'Vertex_8' )
+geompy.addToStudy( Vertex_9, 'Vertex_9' )
+geompy.addToStudy( Vertex_10, 'Vertex_10' )
+geompy.addToStudy( Plane_1, 'Plane_1' )
+geompy.addToStudy( Mirror_1_1, 'Mirror_1_1' )
+geompy.addToStudy( Mirror_1_2, 'Mirror_1_2' )
+geompy.addToStudy( Mirror_1_3, 'Mirror_1_3' )
+geompy.addToStudy( Mirror_1_4, 'Mirror_1_4' )
+geompy.addToStudy( Mirror_1_5, 'Mirror_1_5' )
+geompy.addToStudy( Mirror_1_6, 'Mirror_1_6' )
+geompy.addToStudy( Mirror_1_7, 'Mirror_1_7' )
+geompy.addToStudy( Mirror_1_8, 'Mirror_1_8' )
+geompy.addToStudy( Mirror_1_9, 'Mirror_1_9' )
+geompy.addToStudy( Curve_2, 'Curve_2' )
+geompy.addToStudy( Circle_1, 'Circle_1' )
+geompy.addToStudy( Vertex_11, 'Vertex_11' )
+geompy.addToStudyInFather( Curve_2, Curve_2_vertex_2, 'Curve_2:vertex_2' )
+geompy.addToStudyInFather( Curve_2, Curve_2_vertex_3, 'Curve_2:vertex_3' )
+geompy.addToStudy( Arc_1, 'Arc_1' )
+geompy.addToStudy( FissInCylindre, 'FissInCylindre' )
+geompy.addToStudy( Divided_Cylinder_1, 'Divided Cylinder_1' )
+geompy.addToStudy( CylindreSain, 'CylindreSain' )
+geompy.addToStudyInFather( CylindreSain, Compound_1, 'Compound_1' )
+geompy.addToStudyInFather( CylindreSain, vertical, 'vertical' )
+geompy.addToStudyInFather( CylindreSain, radial, 'radial' )
+geompy.addToStudyInFather( CylindreSain, Compound_4, 'Compound_4' )
+geompy.addToStudy( Vertex_12, 'Vertex_12' )
+geompy.addToStudy( Circle_2, 'Circle_2' )
+geompy.addToStudy( Face_1, 'Face_1' )
+geompy.addToStudy( Vertex_13, 'Vertex_13' )
+geompy.addToStudy( Disk_1, 'Disk_1' )
+geompy.addToStudy( FissInCylindre2, 'FissInCylindre2' )
+
+###
+### SMESH component
+###
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+
+smesh = smeshBuilder.New(theStudy)
+from salome.StdMeshers import StdMeshersBuilder
+smeshObj_1 = smesh.CreateHypothesis('NumberOfSegments')
+smeshObj_1.SetNumberOfSegments( 5 )
+smeshObj_1.SetDistrType( 0 )
+CylindreSain_1 = smesh.Mesh(CylindreSain)
+Regular_1D = CylindreSain_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[ ])
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = CylindreSain_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+Hexa_3D = CylindreSain_1.Hexahedron(algo=smeshBuilder.Hexa)
+Regular_1D_1 = CylindreSain_1.Segment(geom=vertical)
+Nb_Segments_2 = Regular_1D_1.NumberOfSegments(30,[],[ ])
+Nb_Segments_2.SetDistrType( 0 )
+Regular_1D_2 = CylindreSain_1.Segment(geom=radial)
+Nb_Segments_3 = Regular_1D_2.NumberOfSegments(6,[],[ ])
+Nb_Segments_3.SetDistrType( 0 )
+isDone = CylindreSain_1.Compute()
+smesh.SetName(CylindreSain_1, 'CylindreSain')
+CylindreSain_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests//CylindreSain.med"), 0, SMESH.MED_V2_2, 1 )
+SubMesh_1 = Regular_1D_1.GetSubMesh()
+SubMesh_2 = Regular_1D_2.GetSubMesh()
+
+## some objects were removed
+aStudyBuilder = theStudy.NewBuilder()
+SO = theStudy.FindObjectIOR(theStudy.ConvertObjectToIOR(smeshObj_1))
+if SO is not None: aStudyBuilder.RemoveObjectWithChildren(SO)
+## set object names
+smesh.SetName(CylindreSain_1.GetMesh(), 'CylindreSain')
+smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
+smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
+smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
+smesh.SetName(Nb_Segments_3, 'Nb. Segments_3')
+smesh.SetName(SubMesh_1, 'SubMesh_1')
+smesh.SetName(SubMesh_2, 'SubMesh_2')
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+import salome_notebook
+notebook = salome_notebook.notebook
+
+import os
+from blocFissure import gmu
+
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+Cylinder_1 = geompy.MakeCylinderRH(100, 300)
+Cylinder_2 = geompy.MakeCylinderRH(600, 200)
+Cut_1 = geompy.MakeCut(Cylinder_2, Cylinder_1)
+Face_1 = geompy.MakeFaceHW(500, 1500, 3)
+Disque = geompy.MakePartition([Cut_1], [Face_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+[Compound_1, Compound_2, Compound_3, Compound_4] = geompy.Propagate(Disque)
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( Cylinder_1, 'Cylinder_1' )
+geompy.addToStudy( Cylinder_2, 'Cylinder_2' )
+geompy.addToStudy( Cut_1, 'Cut_1' )
+geompy.addToStudy( Face_1, 'Face_1' )
+geompy.addToStudy( Disque, 'Disque' )
+geompy.addToStudyInFather( Disque, Compound_1, 'Compound_1' )
+geompy.addToStudyInFather( Disque, Compound_2, 'Compound_2' )
+geompy.addToStudyInFather( Disque, Compound_3, 'Compound_3' )
+geompy.addToStudyInFather( Disque, Compound_4, 'Compound_4' )
+
+###
+### SMESH component
+###
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+
+smesh = smeshBuilder.New(theStudy)
+from salome.StdMeshers import StdMeshersBuilder
+Disque_1 = smesh.Mesh(Disque)
+Regular_1D = Disque_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
+Nb_Segments_1.SetDistrType( 0 )
+Hexa_3D = Disque_1.Hexahedron(algo=smeshBuilder.Hexa)
+Regular_1D_1 = Disque_1.Segment(geom=Compound_3)
+Nb_Segments_2 = Regular_1D_1.NumberOfSegments(20)
+Nb_Segments_2.SetDistrType( 0 )
+Regular_1D_2 = Disque_1.Segment(geom=Compound_4)
+status = Disque_1.AddHypothesis(Nb_Segments_2,Compound_4)
+Quadrangle_2D = Disque_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+isDone = Disque_1.Compute()
+smesh.SetName(Disque_1, 'Disque')
+Disque_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/disque.med"), 0, SMESH.MED_V2_2, 1 )
+SubMesh_1 = Regular_1D_1.GetSubMesh()
+SubMesh_2 = Regular_1D_2.GetSubMesh()
+
+## set object names
+smesh.SetName(Disque_1.GetMesh(), 'Disque')
+smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
+smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
+smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
+smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+smesh.SetName(SubMesh_1, 'SubMesh_1')
+smesh.SetName(SubMesh_2, 'SubMesh_2')
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+import salome_notebook
+notebook = salome_notebook.notebook
+
+import os
+from blocFissure import gmu
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+Vertex_1 = geompy.MakeVertex(400, 0, 400)
+Vertex_2 = geompy.MakeVertex(400, 0, 500)
+Vector_1 = geompy.MakeVector(Vertex_1, Vertex_2)
+Disk_1 = geompy.MakeDiskPntVecR(Vertex_1, Vector_1, 50)
+Rotation_1 = geompy.MakeRotation(Disk_1, Vector_1, 180*math.pi/180.0)
+Scale_1 = geompy.MakeScaleAlongAxes(Rotation_1, Vertex_1, 1, 1.5, 1)
+Vertex_3 = geompy.MakeVertex(420, -400, 300)
+Vertex_4 = geompy.MakeVertex(500, 400, 500)
+Box_1 = geompy.MakeBoxTwoPnt(Vertex_4, Vertex_3)
+ellipse1 = geompy.MakeCut(Scale_1, Box_1)
+[fondFiss] = geompy.SubShapes(ellipse1, [4])
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( Vertex_1, 'Vertex_1' )
+geompy.addToStudy( Vertex_2, 'Vertex_2' )
+geompy.addToStudy( Vector_1, 'Vector_1' )
+geompy.addToStudy( Disk_1, 'Disk_1' )
+geompy.addToStudy( Rotation_1, 'Rotation_1' )
+geompy.addToStudy( Scale_1, 'Scale_1' )
+geompy.addToStudy( Vertex_3, 'Vertex_3' )
+geompy.addToStudy( Vertex_4, 'Vertex_4' )
+geompy.addToStudy( Box_1, 'Box_1' )
+geompy.addToStudy( ellipse1, 'ellipse1' )
+geompy.addToStudyInFather( ellipse1, fondFiss, 'fondFiss' )
+geompy.Export(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse1.brep"), "BREP")
+
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+import salome_notebook
+notebook = salome_notebook.NoteBook(theStudy)
+
+import os
+from blocFissure import gmu
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+Vertex_1 = geompy.MakeVertex(100, 0, 0)
+Disk_1 = geompy.MakeDiskPntVecR(Vertex_1, OY, 12.5)
+Scale_1 = geompy.MakeScaleAlongAxes(Disk_1, Vertex_1, 1, 1, 4.1)
+Vertex_2 = geompy.MakeVertex(98, -2, -2)
+Vertex_3 = geompy.MakeVertex(120, 2, 60)
+Box_1 = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
+Ellipse_disque = geompy.MakeCommon(Box_1, Scale_1)
+geompy.Export(Ellipse_disque, os.path.join(gmu.pathBloc, "materielCasTests/ellipse_disque.brep"), "BREP")
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( Vertex_1, 'Vertex_1' )
+geompy.addToStudy( Disk_1, 'Disk_1' )
+geompy.addToStudy( Vertex_2, 'Vertex_2' )
+geompy.addToStudy( Scale_1, 'Scale_1' )
+geompy.addToStudy( Vertex_3, 'Vertex_3' )
+geompy.addToStudy( Box_1, 'Box_1' )
+geompy.addToStudy( Ellipse_disque, 'Ellipse_disque' )
+
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+import salome_notebook
+notebook = salome_notebook.notebook
+
+import os
+from blocFissure import gmu
+
+###
+### GEOM component
+###
+
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+geompy = geomBuilder.New(theStudy)
+
+Disk_1 = geompy.MakeDiskR(100, 1)
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+Scale_1 = geompy.MakeScaleAlongAxes(Disk_1, None, 0.4, 0.75, 1)
+[Vertex_1] = geompy.ExtractShapes(Scale_1, geompy.ShapeType["VERTEX"], True)
+Rotation_1 = geompy.MakeRotation(Scale_1, OY, 190*math.pi/180.0)
+Rotation_2 = geompy.MakeRotation(Rotation_1, OZ, 10*math.pi/180.0)
+Vertex_2 = geompy.MakeVertex(20, -100, -50)
+Vertex_4 = geompy.MakeVertex(100, 100, 50)
+Box_1 = geompy.MakeBoxTwoPnt(Vertex_2, Vertex_4)
+Cut_1 = geompy.MakeCut(Rotation_1, Box_1)
+ellipse1 = geompy.MakeTranslation(Cut_1, 400, 0, 400)
+geompy.addToStudy( Disk_1, 'Disk_1' )
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( Scale_1, 'Scale_1' )
+geompy.addToStudyInFather( Scale_1, Vertex_1, 'Vertex_1' )
+geompy.addToStudy( Rotation_1, 'Rotation_1' )
+geompy.addToStudy( Rotation_2, 'Rotation_2' )
+geompy.addToStudy( Vertex_2, 'Vertex_2' )
+geompy.addToStudy( Box_1, 'Box_1' )
+geompy.addToStudy( Vertex_4, 'Vertex_4' )
+geompy.addToStudy( Cut_1, 'Cut_1' )
+geompy.addToStudy( ellipse1, 'ellipse1_pb' )
+geompy.Export(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse1_pb.brep"), "BREP")
+
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+import salome_notebook
+notebook = salome_notebook.notebook
+
+import os
+from blocFissure import gmu
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+Vertex_1 = geompy.MakeVertex(-2000, 0, 0)
+Cylinder_1 = geompy.MakeCylinder(Vertex_1, OY, 1900, 300)
+Cylinder_2 = geompy.MakeCylinder(Vertex_1, OY, 2100, 300)
+Cut_1 = geompy.MakeCut(Cylinder_2, Cylinder_1)
+Vertex_2 = geompy.MakeVertex(-500, -100, -300)
+Vertex_3 = geompy.MakeVertex(500, 400, 300)
+Box_1 = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
+Common_1 = geompy.MakeCommon(Box_1, Cut_1)
+Vertex_4 = geompy.MakeVertex(-300, -1000, 0)
+Cylinder_3 = geompy.MakeCylinder(Vertex_4, OX, 1100, 600)
+EprouvetteCourbe = geompy.MakeCut(Common_1, Cylinder_3)
+[Compound_y, Compound_z, Compound_x] = geompy.Propagate(EprouvetteCourbe)
+geomObj_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
+Sketch_1 = geompy.MakeSketcherOnPlane("Sketcher:F -110.000000 85.000000:T 220.000000 0.000000:T 0.000000 75.000000:T -220.000000 0.000000:WW", geomObj_1 )
+SectionDroite = geompy.MakeFaceWires([Sketch_1], 1)
+geompy.Export(SectionDroite, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteCourbeFiss.brep"), "BREP")
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( Vertex_1, 'Vertex_1' )
+geompy.addToStudy( Cylinder_1, 'Cylinder_1' )
+geompy.addToStudy( Cylinder_2, 'Cylinder_2' )
+geompy.addToStudy( Cut_1, 'Cut_1' )
+geompy.addToStudy( Vertex_2, 'Vertex_2' )
+geompy.addToStudy( Vertex_3, 'Vertex_3' )
+geompy.addToStudy( Box_1, 'Box_1' )
+geompy.addToStudy( Common_1, 'Common_1' )
+geompy.addToStudy( Cylinder_3, 'Cylinder_3' )
+geompy.addToStudy( Vertex_4, 'Vertex_4' )
+geompy.addToStudy( EprouvetteCourbe, 'EprouvetteCourbe' )
+geompy.addToStudy( Sketch_1, 'Sketch_1' )
+geompy.addToStudy( SectionDroite, 'SectionDroite' )
+geompy.addToStudyInFather( EprouvetteCourbe, Compound_y, 'Compound_y' )
+geompy.addToStudyInFather( EprouvetteCourbe, Compound_z, 'Compound_z' )
+geompy.addToStudyInFather( EprouvetteCourbe, Compound_x, 'Compound_x' )
+
+###
+### SMESH component
+###
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+
+smesh = smeshBuilder.New(theStudy)
+from salome.StdMeshers import StdMeshersBuilder
+EprouvetteCourbe_1 = smesh.Mesh(EprouvetteCourbe)
+Regular_1D = EprouvetteCourbe_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(50)
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = EprouvetteCourbe_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+Hexa_3D = EprouvetteCourbe_1.Hexahedron(algo=smeshBuilder.Hexa)
+Regular_1D_1 = EprouvetteCourbe_1.Segment(geom=Compound_x)
+Nb_Segments_2 = Regular_1D_1.NumberOfSegments(15)
+Nb_Segments_2.SetDistrType( 0 )
+Regular_1D_2 = EprouvetteCourbe_1.Segment(geom=Compound_y)
+Nb_Segments_3 = Regular_1D_2.NumberOfSegments(25)
+Nb_Segments_3.SetDistrType( 0 )
+isDone = EprouvetteCourbe_1.Compute()
+smesh.SetName(EprouvetteCourbe_1, 'EprouvetteCourbe')
+EprouvetteCourbe_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteCourbe.med"), 0, SMESH.MED_V2_2, 1 )
+SubMesh_1 = Regular_1D_1.GetSubMesh()
+SubMesh_2 = Regular_1D_2.GetSubMesh()
+
+## set object names
+smesh.SetName(EprouvetteCourbe_1.GetMesh(), 'EprouvetteCourbe')
+smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
+smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
+smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
+smesh.SetName(Nb_Segments_3, 'Nb. Segments_3')
+smesh.SetName(SubMesh_1, 'SubMesh_1')
+smesh.SetName(SubMesh_2, 'SubMesh_2')
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+import salome_notebook
+notebook = salome_notebook.NoteBook(theStudy)
+
+import os
+from blocFissure import gmu
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+eprouvetteDroite = geompy.MakeBoxDXDYDZ(100, 200, 500)
+[Compound_z, Compound_y, Compound_x] = geompy.Propagate(eprouvetteDroite)
+
+Vertex_1 = geompy.MakeVertex(-10, -10, 200)
+geomObj_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
+Plane_1 = geompy.MakePlane(Vertex_1, OZ, 2000)
+geomObj_2 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
+Sketch_1 = geompy.MakeSketcherOnPlane("Sketcher:F 0.000000 0.000000:TT 120.000000 0.000000:T 0.000000 100.000000:T -120.000000 0.000000:WW", Plane_1 )
+sectionDroite = geompy.MakeFaceWires([Sketch_1], 1)
+Box_1_vertex_7 = geompy.GetSubShape(eprouvetteDroite, [7])
+Box_1_vertex_16 = geompy.GetSubShape(eprouvetteDroite, [16])
+Line_1 = geompy.MakeLineTwoPnt(Box_1_vertex_7, Box_1_vertex_16)
+geomObj_3 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
+Plane_2 = geompy.MakePlane(Vertex_1, Line_1, 2000)
+geomObj_4 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
+Sketch_2 = geompy.MakeSketcherOnPlane("Sketcher:F 0.000000 0.000000:T 120.000000 0.000000:T 0.000000 100.000000:T -120.000000 20.000000:WW", Plane_2 )
+SectionInclinee = geompy.MakeFaceWires([Sketch_2], 1)
+geompy.Export(sectionDroite, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFissPb1.brep"), "BREP")
+geompy.Export(SectionInclinee, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss2.brep"), "BREP")
+Vertex_2 = geompy.MakeVertex(110, -10, 200)
+Vertex_3 = geompy.MakeVertex(110, 80, 200)
+Vertex_4 = geompy.MakeVertex(-10, 80, 200)
+Line_2 = geompy.MakeLineTwoPnt(Vertex_1, Vertex_2)
+Line_3 = geompy.MakeLineTwoPnt(Vertex_2, Vertex_3)
+Line_4 = geompy.MakeLineTwoPnt(Vertex_3, Vertex_4)
+Line_5 = geompy.MakeLineTwoPnt(Vertex_4, Vertex_1)
+Face_1 = geompy.MakeFaceWires([Line_2, Line_3, Line_4, Line_5], 1)
+Vertex_5 = geompy.MakeVertex(110, -10, 180)
+Vertex_6 = geompy.MakeVertex(110, 70, 180)
+Face_1_vertex_4 = geompy.GetSubShape(Face_1, [4])
+Line_6 = geompy.MakeLineTwoPnt(Face_1_vertex_4, Vertex_5)
+Line_7 = geompy.MakeLineTwoPnt(Vertex_5, Vertex_6)
+Face_1_vertex_9 = geompy.GetSubShape(Face_1, [9])
+Line_8 = geompy.MakeLineTwoPnt(Vertex_6, Face_1_vertex_9)
+Face_2 = geompy.MakeFaceWires([Line_5, Line_6, Line_7, Line_8], 1)
+geompy.Export(Face_1, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss_1.brep"), "BREP")
+geompy.Export(Face_2, os.path.join(gmu.pathBloc, "materielCasTests/EprouvetteDroiteFiss_2.brep"), "BREP")
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( eprouvetteDroite, 'eprouvetteDroite' )
+geompy.addToStudyInFather( eprouvetteDroite, Compound_z, 'Compound_z' )
+geompy.addToStudyInFather( eprouvetteDroite, Compound_y, 'Compound_y' )
+geompy.addToStudyInFather( eprouvetteDroite, Compound_x, 'Compound_x' )
+geompy.addToStudy( Vertex_1, 'Vertex_1' )
+geompy.addToStudy( Plane_1, 'Plane_1' )
+geompy.addToStudy( Sketch_1, 'Sketch_1' )
+geompy.addToStudy( sectionDroite, 'sectionDroite' )
+geompy.addToStudyInFather( eprouvetteDroite, Box_1_vertex_7, 'Box_1:vertex_7' )
+geompy.addToStudyInFather( eprouvetteDroite, Box_1_vertex_16, 'Box_1:vertex_16' )
+geompy.addToStudy( Line_1, 'Line_1' )
+geompy.addToStudy( Plane_2, 'Plane_2' )
+geompy.addToStudy( Sketch_2, 'Sketch_2' )
+geompy.addToStudy( SectionInclinee, 'SectionInclinee' )
+geompy.addToStudy( Vertex_2, 'Vertex_2' )
+geompy.addToStudy( Vertex_3, 'Vertex_3' )
+geompy.addToStudy( Vertex_4, 'Vertex_4' )
+geompy.addToStudy( Line_2, 'Line_2' )
+geompy.addToStudy( Line_3, 'Line_3' )
+geompy.addToStudy( Line_4, 'Line_4' )
+geompy.addToStudy( Line_5, 'Line_5' )
+geompy.addToStudy( Face_1, 'Face_1' )
+geompy.addToStudy( Vertex_5, 'Vertex_5' )
+geompy.addToStudy( Vertex_6, 'Vertex_6' )
+geompy.addToStudyInFather( Face_1, Face_1_vertex_4, 'Face_1:vertex_4' )
+geompy.addToStudy( Line_6, 'Line_6' )
+geompy.addToStudy( Line_7, 'Line_7' )
+geompy.addToStudyInFather( Face_1, Face_1_vertex_9, 'Face_1:vertex_9' )
+geompy.addToStudy( Line_8, 'Line_8' )
+geompy.addToStudy( Face_2, 'Face_2' )
+
+###
+### SMESH component
+###
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+
+smesh = smeshBuilder.New(theStudy)
+from salome.StdMeshers import StdMeshersBuilder
+eprouvetteDroite_1 = smesh.Mesh(eprouvetteDroite)
+Regular_1D = eprouvetteDroite_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(50,[],[ ])
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = eprouvetteDroite_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+Hexa_3D = eprouvetteDroite_1.Hexahedron(algo=smeshBuilder.Hexa)
+Regular_1D_1 = eprouvetteDroite_1.Segment(geom=Compound_y)
+Nb_Segments_2 = Regular_1D_1.NumberOfSegments(20,[],[ ])
+Nb_Segments_2.SetDistrType( 0 )
+Regular_1D_2 = eprouvetteDroite_1.Segment(geom=Compound_x)
+Nb_Segments_3 = Regular_1D_2.NumberOfSegments(10,[],[ ])
+Nb_Segments_3.SetDistrType( 0 )
+isDone = eprouvetteDroite_1.Compute()
+smesh.SetName(eprouvetteDroite_1, 'eprouvetteDroite')
+eprouvetteDroite_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/eprouvetteDroite.med"), 0, SMESH.MED_V2_2, 1 )
+SubMesh_1 = Regular_1D_1.GetSubMesh()
+SubMesh_2 = Regular_1D_2.GetSubMesh()
+
+## set object names
+smesh.SetName(eprouvetteDroite_1.GetMesh(), 'eprouvetteDroite')
+smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
+smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
+smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
+smesh.SetName(Nb_Segments_3, 'Nb. Segments_3')
+smesh.SetName(SubMesh_1, 'SubMesh_1')
+smesh.SetName(SubMesh_2, 'SubMesh_2')
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+import salome_notebook
+notebook = salome_notebook.notebook
+
+import os
+from blocFissure import gmu
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+geomObj_1 = geompy.MakeCylinderRH(1000, 3000)
+Cylinder_1 = geompy.MakeRotation(geomObj_1, OZ, 180*math.pi/180.0)
+geomObj_2 = geompy.MakeCylinder(O, OX, 2000, 5000)
+Cylinder_2 = geompy.MakeRotation(geomObj_2, OX, 180*math.pi/180.0)
+Translation_1 = geompy.MakeTranslation(Cylinder_2, -2000, 0, 0)
+Fuse_1 = geompy.MakeFuse(Cylinder_1, Translation_1)
+Fillet_1 = geompy.MakeFillet(Fuse_1, 800, geompy.ShapeType["EDGE"], [11])
+Vertex_1 = geompy.MakeVertex(0, -3000, -3000)
+Vertex_2 = geompy.MakeVertex(2500, 3000, 3000)
+Box_1 = geompy.MakeBoxTwoPnt(Vertex_2, Vertex_1)
+Partition_1 = geompy.MakePartition([Box_1], [Fillet_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+geomObj_3 = geompy.MakeCylinderRH(1450, 8000)
+Cylinder_3 = geompy.MakeRotation(geomObj_3, OZ, 180*math.pi/180.0)
+Cut_1 = geompy.MakeCut(Partition_1, Cylinder_3)
+[faceFiss1] = geompy.SubShapes(Cut_1, [61])
+[Vertex_3,geomObj_4] = geompy.SubShapes(faceFiss1, [4, 5])
+Cylinder_4 = geompy.MakeCylinderRH(2000, 4000)
+Cylinder_5 = geompy.MakeCylinderRH(1500, 4000)
+Cut_2 = geompy.MakeCut(Cylinder_4, Cylinder_5)
+Plane_1 = geompy.MakePlaneLCS(None, 10000, 3)
+Vertex_5 = geompy.MakeVertex(0, 0, 100)
+Plane_2 = geompy.MakePlaneThreePnt(O, Vertex_5, Vertex_3, 10000)
+Plane_3 = geompy.MakePlaneThreePnt(O, Vertex_5, geomObj_4, 10000)
+Vertex_6 = geompy.MakeVertex(0, -5000, -5000)
+Vertex_7 = geompy.MakeVertex(5000, 5000, 5000)
+Box_2 = geompy.MakeBoxTwoPnt(Vertex_7, Vertex_6)
+Common_1 = geompy.MakeCommon(Box_2, Cut_2)
+objetSain = geompy.MakePartition([Common_1], [Plane_1, Plane_2, Plane_3], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+[hauteurs, epaisseurs, Compound_3, Compound_4, Compound_5, Compound_6] = geompy.Propagate(objetSain)
+geompy.Export(faceFiss1, os.path.join(gmu.pathBloc, "materielCasTests/faceGaucheFiss.brep"), "BREP")
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( Cylinder_1, 'Cylinder_1' )
+geompy.addToStudy( Cylinder_2, 'Cylinder_2' )
+geompy.addToStudy( Translation_1, 'Translation_1' )
+geompy.addToStudy( Fuse_1, 'Fuse_1' )
+geompy.addToStudy( Fillet_1, 'Fillet_1' )
+geompy.addToStudy( Vertex_1, 'Vertex_1' )
+geompy.addToStudy( Vertex_2, 'Vertex_2' )
+geompy.addToStudy( Box_1, 'Box_1' )
+geompy.addToStudy( Partition_1, 'Partition_1' )
+geompy.addToStudy( Cylinder_3, 'Cylinder_3' )
+geompy.addToStudy( Cut_1, 'Cut_1' )
+geompy.addToStudyInFather( Cut_1, faceFiss1, 'faceFiss1' )
+geompy.addToStudyInFather( faceFiss1, Vertex_3, 'Vertex_3' )
+geompy.addToStudy( Cylinder_4, 'Cylinder_4' )
+geompy.addToStudy( Cylinder_5, 'Cylinder_5' )
+geompy.addToStudy( Cut_2, 'Cut_2' )
+geompy.addToStudy( Plane_1, 'Plane_1' )
+geompy.addToStudy( Vertex_5, 'Vertex_5' )
+geompy.addToStudy( Plane_2, 'Plane_2' )
+geompy.addToStudy( Plane_3, 'Plane_3' )
+geompy.addToStudy( Vertex_6, 'Vertex_6' )
+geompy.addToStudy( Vertex_7, 'Vertex_7' )
+geompy.addToStudy( Box_2, 'Box_2' )
+geompy.addToStudy( Common_1, 'Common_1' )
+geompy.addToStudy( objetSain, 'objetSain' )
+geompy.addToStudyInFather( objetSain, hauteurs, 'hauteurs' )
+geompy.addToStudyInFather( objetSain, epaisseurs, 'epaisseurs' )
+geompy.addToStudyInFather( objetSain, Compound_3, 'Compound_3' )
+geompy.addToStudyInFather( objetSain, Compound_4, 'Compound_4' )
+geompy.addToStudyInFather( objetSain, Compound_5, 'Compound_5' )
+geompy.addToStudyInFather( objetSain, Compound_6, 'Compound_6' )
+
+###
+### SMESH component
+###
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+
+smesh = smeshBuilder.New(theStudy)
+from salome.StdMeshers import StdMeshersBuilder
+objetSain_1 = smesh.Mesh(objetSain)
+Regular_1D = objetSain_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(10,[],[ ])
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = objetSain_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+Hexa_3D = objetSain_1.Hexahedron(algo=smeshBuilder.Hexa)
+Regular_1D_1 = objetSain_1.Segment(geom=hauteurs)
+Nb_Segments_2 = Regular_1D_1.NumberOfSegments(15,[],[ ])
+Nb_Segments_2.SetDistrType( 0 )
+Regular_1D_2 = objetSain_1.Segment(geom=epaisseurs)
+Nb_Segments_3 = Regular_1D_2.NumberOfSegments(5,[],[ ])
+Nb_Segments_3.SetDistrType( 0 )
+isDone = objetSain_1.Compute()
+smesh.SetName(objetSain_1, 'objetSain')
+objetSain_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/faceGaucheSain.med"), 0, SMESH.MED_V2_2, 1 )
+SubMesh_1 = Regular_1D_1.GetSubMesh()
+SubMesh_2 = Regular_1D_2.GetSubMesh()
+
+## set object names
+smesh.SetName(objetSain_1.GetMesh(), 'objetSain')
+smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
+smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
+smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
+smesh.SetName(Nb_Segments_3, 'Nb. Segments_3')
+smesh.SetName(SubMesh_1, 'SubMesh_1')
+smesh.SetName(SubMesh_2, 'SubMesh_2')
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+import salome_notebook
+notebook = salome_notebook.notebook
+
+import os
+from blocFissure import gmu
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+Circle_1 = geompy.MakeCircle(O, OX, 500)
+Extrusion_1 = geompy.MakePrismVecH2Ways(Circle_1, OX, 500)
+Vertex_1 = geompy.MakeVertex(500, 0, 0)
+Circle_3 = geompy.MakeCircle(Vertex_1, OZ, 300)
+Extrusion_2 = geompy.MakePrismVecH(Circle_3, OZ, 1000)
+Partition_1 = geompy.MakePartition([Extrusion_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+[Face_1,Face_2] = geompy.SubShapes(Partition_1, [18, 13])
+FaceFissExt = geompy.MakeFuse(Face_2, Face_1)
+geompy.Export(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2Fiss.brep"), "BREP")
+Vertex_2 = geompy.MakeVertex(0, -500, 0)
+Vertex_3 = geompy.MakeVertex(400, 500, 800)
+objetSain = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
+Rotation_1 = geompy.MakeRotation(Extrusion_1, OX, 180*math.pi/180.0)
+Partition_2 = geompy.MakePartition([Rotation_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+[FaceFissExtSimple] = geompy.SubShapes(Partition_2, [13])
+Plane_1 = geompy.MakePlaneLCS(None, 2000, 3)
+FaceFissExtCoupe = geompy.MakePartition([FaceFissExtSimple], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+geompy.Export(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep"), "BREP")
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( Circle_1, 'Circle_1' )
+geompy.addToStudy( Extrusion_1, 'Extrusion_1' )
+geompy.addToStudy( Vertex_1, 'Vertex_1' )
+geompy.addToStudy( Circle_3, 'Circle_3' )
+geompy.addToStudy( Extrusion_2, 'Extrusion_2' )
+geompy.addToStudy( Partition_1, 'Partition_1' )
+geompy.addToStudyInFather( Partition_1, Face_1, 'Face_1' )
+geompy.addToStudyInFather( Partition_1, Face_2, 'Face_2' )
+geompy.addToStudy( FaceFissExt, 'FaceFissExt' )
+geompy.addToStudy( Vertex_2, 'Vertex_2' )
+geompy.addToStudy( Vertex_3, 'Vertex_3' )
+geompy.addToStudy( objetSain, 'objetSain' )
+geompy.addToStudy( Rotation_1, 'Rotation_1' )
+geompy.addToStudy( Partition_2, 'Partition_2' )
+geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' )
+geompy.addToStudy( Plane_1, 'Plane_1' )
+geompy.addToStudy( FaceFissExtCoupe, 'FaceFissExtCoupe' )
+
+###
+### SMESH component
+###
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+
+smesh = smeshBuilder.New(theStudy)
+from salome.StdMeshers import StdMeshersBuilder
+Mesh_1 = smesh.Mesh(objetSain)
+Regular_1D = Mesh_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[ ])
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
+isDone = Mesh_1.Compute()
+smesh.SetName(Mesh_1, 'Mesh_1')
+Mesh_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/boiteSaine.med"), 0, SMESH.MED_V2_2, 1 )
+
+## set object names
+smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')
+smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
+smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from blocFissure.materielCasTests import cubeAngle
+from blocFissure.materielCasTests import decoupeCylindre
+from blocFissure.materielCasTests import eprouvetteCourbe
+from blocFissure.materielCasTests import eprouvetteDroite
+from blocFissure.materielCasTests import fissureGauche
+from blocFissure.materielCasTests import fissureGauche2
+from blocFissure.materielCasTests import ellipse
+from blocFissure.materielCasTests import ellipse_probleme
+from blocFissure.materielCasTests import disque_perce
+from blocFissure.materielCasTests import ellipse_disque
+from blocFissure.materielCasTests import vis
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+import salome_notebook
+notebook = salome_notebook.notebook
+
+import os
+from blocFissure import gmu
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+O = geompy.MakeVertex(0, 0, 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+geomObj_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
+geomObj_2 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
+sk = geompy.Sketcher2D()
+sk.addPoint(0.000000, 0.000000)
+sk.addSegmentAbsolute(10.000000, 0.000000)
+sk.addSegmentAbsolute(10.000000, 98.750000)
+sk.addArcAngleRadiusLength(0, -1.250000, 90.000000)
+sk.addSegmentAbsolute(15.000000, 100.000000)
+sk.addSegmentAbsolute(15.000000, 120.000000)
+sk.addSegmentAbsolute(9.945000, 120.000000)
+sk.addSegmentAbsolute(9.945000, 108.000000)
+sk.addSegmentAbsolute(0.000000, 105.000000)
+sk.close()
+Sketch_1 = sk.wire(geomObj_2)
+Face_1 = geompy.MakeFaceWires([Sketch_1], 1)
+Vertex_1 = geompy.MakeVertex(15, 108, 0)
+Vertex_2 = geompy.MakeVertex(0, 94, 0)
+Vertex_3 = geompy.MakeVertex(10, 94, 0)
+Face_1_vertex_17 = geompy.GetSubShape(Face_1, [17])
+Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Face_1_vertex_17)
+Face_1_vertex_9 = geompy.GetSubShape(Face_1, [9])
+Line_2 = geompy.MakeLineTwoPnt(Face_1_vertex_17, Face_1_vertex_9)
+Face_1_vertex_19 = geompy.GetSubShape(Face_1, [19])
+Face_1_vertex_7 = geompy.GetSubShape(Face_1, [7])
+Line_3 = geompy.MakeLineTwoPnt(Face_1_vertex_19, Face_1_vertex_7)
+Line_4 = geompy.MakeLineTwoPnt(Vertex_2, Vertex_3)
+coupe_vis = geompy.MakePartition([Face_1], [Line_1, Line_2, Line_3, Line_4], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+[tige, section, tige_haute, rond, tete, section_tete] = geompy.Propagate(coupe_vis)
+conge = geompy.CreateGroup(coupe_vis, geompy.ShapeType["EDGE"])
+geompy.UnionIDs(conge, [21])
+appui = geompy.CreateGroup(coupe_vis, geompy.ShapeType["EDGE"])
+geompy.UnionIDs(appui, [37])
+p_imp = geompy.CreateGroup(coupe_vis, geompy.ShapeType["EDGE"])
+geompy.UnionIDs(p_imp, [4])
+
+Vertex_4 = geompy.MakeVertex(11.25, 98.75, 0)
+Vertex_5 = geompy.MakeVertexWithRef(Vertex_4, -0.5, 0.5, 0)
+Vertex_6 = geompy.MakeVertexWithRef(Vertex_4, -5, 5, 0)
+Line_5 = geompy.MakeLineTwoPnt(Vertex_5, Vertex_6)
+Partition_1 = geompy.MakePartition([Line_5], [conge], [], [], geompy.ShapeType["EDGE"], 0, [], 1)
+[Vertex_7] = geompy.SubShapes(Partition_1, [4])
+Vertex_8 = geompy.MakeVertexWithRef(Vertex_7, -1.1, 1.1, 0)
+generatrice = geompy.MakeLineTwoPnt(Vertex_5, Vertex_8)
+Revolution_1 = geompy.MakeRevolution2Ways(generatrice, OY, 60*math.pi/180.0)
+Partition_2 = geompy.MakePartition([Revolution_1], [conge], [], [], geompy.ShapeType["FACE"], 0, [], 1)
+Partition_2_vertex_11 = geompy.GetSubShape(Partition_2, [11])
+Plane_1 = geompy.MakePlane(Partition_2_vertex_11, OY, 2000)
+Partition_3 = geompy.MakePartition([Revolution_1], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+Vertex_9 = geompy.MakeVertex(0, 99.633883, 8.977320000000001)
+Vertex_10 = geompy.MakeVertex(0, 99.633883, -8.977320000000001)
+Vertex_11 = geompy.MakeVertexWithRef(Vertex_9, 0, 0, -1)
+Vertex11x = geompy.MakeVertexWithRef(Vertex_11, 1, 0, 0)
+Line_11x = geompy.MakeLineTwoPnt(Vertex_11, Vertex11x)
+Vertex_12 = geompy.MakeVertexWithRef(Vertex_10, 0, 0, 1)
+Vertex12x = geompy.MakeVertexWithRef(Vertex_12, 1, 0, 0)
+Line_12x = geompy.MakeLineTwoPnt(Vertex_12, Vertex12x)
+Vertex_13 = geompy.MakeVertexWithRef(Vertex_11, 0, 1, 0)
+Vertex_14 = geompy.MakeVertexWithRef(Vertex_12, 0, 1, 0)
+Vertex_15 = geompy.MakeRotation(Vertex_9, Line_11x, 30*math.pi/180.0)
+Vertex_16 = geompy.MakeRotation(Vertex_10, Line_12x, -30*math.pi/180.0)
+Arc_1 = geompy.MakeArc(Vertex_15, Vertex_9, Vertex_13,False)
+Arc_2 = geompy.MakeArc(Vertex_14, Vertex_10, Vertex_16,False)
+Line_6 = geompy.MakeLineTwoPnt(Vertex_13, Vertex_14)
+Line_8 = geompy.MakeLineTwoPnt(Vertex_16, Vertex_15)
+Wire_1 = geompy.MakeWire([Arc_1, Arc_2, Line_6, Line_8], 1e-07)
+Face_2 = geompy.MakeFaceWires([Wire_1], 1)
+Extrusion_1 = geompy.MakePrismVecH(Face_2, OX, 15)
+Revolution_2 = geompy.MakeRevolution2Ways(generatrice, OY, 65*math.pi/180.0)
+Fissure = geompy.MakeCommonList([Extrusion_1, Revolution_2], True)
+fondFiss = geompy.CreateGroup(Fissure, geompy.ShapeType["EDGE"])
+geompy.UnionIDs(fondFiss, [9, 7, 4])
+geompy.Export(Fissure, os.path.join(gmu.pathBloc, "materielCasTests/visFiss.brep"), "BREP")
+
+geompy.addToStudy( O, 'O' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( OZ, 'OZ' )
+geompy.addToStudy( Sketch_1, 'Sketch_1' )
+geompy.addToStudy( Face_1, 'Face_1' )
+geompy.addToStudy( Vertex_1, 'Vertex_1' )
+geompy.addToStudy( Vertex_2, 'Vertex_2' )
+geompy.addToStudy( Vertex_3, 'Vertex_3' )
+geompy.addToStudyInFather( Face_1, Face_1_vertex_17, 'Face_1:vertex_17' )
+geompy.addToStudy( Line_1, 'Line_1' )
+geompy.addToStudyInFather( Face_1, Face_1_vertex_9, 'Face_1:vertex_9' )
+geompy.addToStudy( Line_2, 'Line_2' )
+geompy.addToStudyInFather( Face_1, Face_1_vertex_19, 'Face_1:vertex_19' )
+geompy.addToStudyInFather( Face_1, Face_1_vertex_7, 'Face_1:vertex_7' )
+geompy.addToStudy( Line_3, 'Line_3' )
+geompy.addToStudy( Line_4, 'Line_4' )
+geompy.addToStudy( coupe_vis, 'coupe_vis' )
+geompy.addToStudyInFather( coupe_vis, tige, 'tige' )
+geompy.addToStudyInFather( coupe_vis, section, 'section' )
+geompy.addToStudyInFather( coupe_vis, tige_haute, 'tige_haute' )
+geompy.addToStudyInFather( coupe_vis, rond, 'rond' )
+geompy.addToStudyInFather( coupe_vis, tete, 'tete' )
+geompy.addToStudyInFather( coupe_vis, section_tete, 'section_tete' )
+geompy.addToStudyInFather( coupe_vis, conge, 'conge' )
+geompy.addToStudyInFather( coupe_vis, appui, 'appui' )
+geompy.addToStudyInFather( coupe_vis, p_imp, 'p_imp' )
+
+geompy.addToStudy( Vertex_4, 'Vertex_4' )
+geompy.addToStudy( Vertex_6, 'Vertex_6' )
+geompy.addToStudy( Vertex_5, 'Vertex_5' )
+geompy.addToStudy( Line_5, 'Line_5' )
+geompy.addToStudy( Partition_1, 'Partition_1' )
+geompy.addToStudyInFather( Partition_1, Vertex_7, 'Vertex_7' )
+geompy.addToStudy( Vertex_8, 'Vertex_8' )
+geompy.addToStudy( generatrice, 'generatrice' )
+geompy.addToStudy( Revolution_1, 'Revolution_1' )
+geompy.addToStudy( Partition_2, 'Partition_2' )
+geompy.addToStudyInFather( Partition_2, Partition_2_vertex_11, 'Partition_2:vertex_11' )
+geompy.addToStudy( Plane_1, 'Plane_1' )
+geompy.addToStudy( Partition_3, 'Partition_3' )
+geompy.addToStudy( Vertex_9, 'Vertex_9' )
+geompy.addToStudy( Vertex_10, 'Vertex_10' )
+geompy.addToStudy( Vertex_11, 'Vertex_11' )
+geompy.addToStudy( Vertex_12, 'Vertex_12' )
+geompy.addToStudy( Vertex_13, 'Vertex_13' )
+geompy.addToStudy( Vertex_14, 'Vertex_14' )
+geompy.addToStudy( Vertex_15, 'Vertex_15' )
+geompy.addToStudy( Vertex_16, 'Vertex_16' )
+geompy.addToStudy( Arc_1, 'Arc_1' )
+geompy.addToStudy( Arc_2, 'Arc_2' )
+geompy.addToStudy( Line_6, 'Line_6' )
+geompy.addToStudy( Line_8, 'Line_8' )
+geompy.addToStudy( Wire_1, 'Wire_1' )
+geompy.addToStudy( Face_2, 'Face_2' )
+geompy.addToStudy( Extrusion_1, 'Extrusion_1' )
+geompy.addToStudy( Revolution_2, 'Revolution_2' )
+geompy.addToStudy( Fissure, 'Fissure' )
+geompy.addToStudyInFather( Fissure, fondFiss, 'fondFiss' )
+
+###
+### SMESH component
+###
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+
+smesh = smeshBuilder.New(theStudy)
+coupe_vis_1 = smesh.Mesh(coupe_vis)
+Regular_1D = coupe_vis_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = coupe_vis_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+isDone = coupe_vis_1.Compute()
+Nb_Segments_2 = smesh.CreateHypothesis('NumberOfSegments')
+Nb_Segments_2.SetNumberOfSegments( 30 )
+Nb_Segments_2.SetDistrType( 0 )
+status = coupe_vis_1.AddHypothesis(Regular_1D,tige)
+status = coupe_vis_1.AddHypothesis(Nb_Segments_2,tige)
+isDone = coupe_vis_1.Compute()
+Nb_Segments_3 = smesh.CreateHypothesis('NumberOfSegments')
+Nb_Segments_3.SetNumberOfSegments( 10 )
+Nb_Segments_3.SetScaleFactor( 3 )
+Nb_Segments_3.SetReversedEdges( [ ] )
+Nb_Segments_3.SetObjectEntry( "0:1:1:14" )
+status = coupe_vis_1.AddHypothesis(Regular_1D,section)
+status = coupe_vis_1.AddHypothesis(Nb_Segments_3,section)
+coupe_vis_1.Clear()
+isDone = coupe_vis_1.Compute()
+coupe_vis_1.Clear()
+Nb_Segments_3.SetNumberOfSegments( 10 )
+Nb_Segments_3.SetDistrType( 1 )
+Nb_Segments_3.SetScaleFactor( 3 )
+Nb_Segments_3.SetReversedEdges( [ 23, 4, 9, 16 ] )
+Nb_Segments_3.SetObjectEntry( "0:1:1:14" )
+isDone = coupe_vis_1.Compute()
+tige_1 = coupe_vis_1.GroupOnGeom(tige,'tige',SMESH.EDGE)
+section_1 = coupe_vis_1.GroupOnGeom(section,'section',SMESH.EDGE)
+tige_haute_1 = coupe_vis_1.GroupOnGeom(tige_haute,'tige_haute',SMESH.EDGE)
+rond_1 = coupe_vis_1.GroupOnGeom(rond,'rond',SMESH.EDGE)
+tete_1 = coupe_vis_1.GroupOnGeom(tete,'tete',SMESH.EDGE)
+section_tete_1 = coupe_vis_1.GroupOnGeom(section_tete,'section_tete',SMESH.EDGE)
+conge_1 = coupe_vis_1.GroupOnGeom(conge,'conge',SMESH.EDGE)
+appui_1 = coupe_vis_1.GroupOnGeom(appui,'appui',SMESH.EDGE)
+p_imp_1 = coupe_vis_1.GroupOnGeom(p_imp,'p_imp',SMESH.EDGE)
+isDone = coupe_vis_1.SplitQuad( [ 691 ], 1 )
+visHex80 = smesh.CopyMesh( coupe_vis_1, 'visHex80', 1, 0)
+[ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2 ] = visHex80.GetGroups()
+[ tige_rotated, section_rotated, tige_haute_rotated, rond_rotated, tete_rotated, section_tete_rotated, conge_rotated, appui_rotated, p_imp_rotated, tige_top, section_top, tige_haute_top, rond_top, tete_top, section_tete_top, conge_top, appui_top, p_imp_top ] = visHex80.RotationSweepObject2D( visHex80, SMESH.AxisStruct( 0, 0, 0, 0, 10, 0 ), math.pi/40, 40, 1e-05 ,True)
+[ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2, tige_rotated, tige_top, section_rotated, section_top, tige_haute_rotated, tige_haute_top, rond_rotated, rond_top, tete_rotated, tete_top, section_tete_rotated, section_tete_top, conge_rotated, conge_top, appui_rotated, appui_top, p_imp_rotated, p_imp_top ] = visHex80.GetGroups()
+[ tige_mirrored, section_mirrored, tige_haute_mirrored, rond_mirrored, tete_mirrored, section_tete_mirrored, conge_mirrored, appui_mirrored, p_imp_mirrored, tige_rotated_mirrored, tige_top_mirrored, section_rotated_mirrored, section_top_mirrored, tige_haute_rotated_mirrored, tige_haute_top_mirrored, rond_rotated_mirrored, rond_top_mirrored, tete_rotated_mirrored, tete_top_mirrored, section_tete_rotated_mirrored, section_tete_top_mirrored, conge_rotated_mirrored, conge_top_mirrored, appui_rotated_mirrored, appui_top_mirrored, p_imp_rotated_mirrored, p_imp_top_mirrored ] = visHex80.MirrorObject( visHex80, SMESH.AxisStruct( 0, 0, 0, 0, 0, 10 ), SMESH.SMESH_MeshEditor.PLANE ,True,True)
+[ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2, tige_rotated, tige_top, section_rotated, section_top, tige_haute_rotated, tige_haute_top, rond_rotated, rond_top, tete_rotated, tete_top, section_tete_rotated, section_tete_top, conge_rotated, conge_top, appui_rotated, appui_top, p_imp_rotated, p_imp_top, tige_mirrored, section_mirrored, tige_haute_mirrored, rond_mirrored, tete_mirrored, section_tete_mirrored, conge_mirrored, appui_mirrored, p_imp_mirrored, tige_rotated_mirrored, tige_top_mirrored, section_rotated_mirrored, section_top_mirrored, tige_haute_rotated_mirrored, tige_haute_top_mirrored, rond_rotated_mirrored, rond_top_mirrored, tete_rotated_mirrored, tete_top_mirrored, section_tete_rotated_mirrored, section_tete_top_mirrored, conge_rotated_mirrored, conge_top_mirrored, appui_rotated_mirrored, appui_top_mirrored, p_imp_rotated_mirrored, p_imp_top_mirrored ] = visHex80.GetGroups()
+coincident_nodes_on_part = visHex80.FindCoincidentNodesOnPart( visHex80, 1e-05, [ ] )
+visHex80.MergeNodes(coincident_nodes_on_part)
+equal_elements = visHex80.FindEqualElements( visHex80 )
+visHex80.MergeElements(equal_elements)
+[ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2, tige_rotated, tige_top, section_rotated, section_top, tige_haute_rotated, tige_haute_top, rond_rotated, rond_top, tete_rotated, tete_top, section_tete_rotated, section_tete_top, conge_rotated, conge_top, appui_rotated, appui_top, p_imp_rotated, p_imp_top, tige_mirrored, section_mirrored, tige_haute_mirrored, rond_mirrored, tete_mirrored, section_tete_mirrored, conge_mirrored, appui_mirrored, p_imp_mirrored, tige_rotated_mirrored, tige_top_mirrored, section_rotated_mirrored, section_top_mirrored, tige_haute_rotated_mirrored, tige_haute_top_mirrored, rond_rotated_mirrored, rond_top_mirrored, tete_rotated_mirrored, tete_top_mirrored, section_tete_rotated_mirrored, section_tete_top_mirrored, conge_rotated_mirrored, conge_top_mirrored, appui_rotated_mirrored, appui_top_mirrored, p_imp_rotated_mirrored, p_imp_top_mirrored ] = visHex80.GetGroups()
+SubMesh_1 = coupe_vis_1.GetSubMesh( tige, 'SubMesh_1' )
+SubMesh_2 = coupe_vis_1.GetSubMesh( section, 'SubMesh_2' )
+visHex80.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/visSain.med"), 0, SMESH.MED_V2_2, 1 )
+
+
+## Set names of Mesh objects
+smesh.SetName(appui_rotated, 'appui_rotated')
+smesh.SetName(p_imp_rotated, 'p_imp_rotated')
+smesh.SetName(section_tete_rotated, 'section_tete_rotated')
+smesh.SetName(conge_rotated, 'conge_rotated')
+smesh.SetName(rond_rotated, 'rond_rotated')
+smesh.SetName(tete_rotated, 'tete_rotated')
+smesh.SetName(section_rotated, 'section_rotated')
+smesh.SetName(tige_haute_rotated, 'tige_haute_rotated')
+smesh.SetName(tige_rotated, 'tige_rotated')
+smesh.SetName(SubMesh_2, 'SubMesh_2')
+smesh.SetName(SubMesh_1, 'SubMesh_1')
+smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+smesh.SetName(appui_1, 'appui')
+smesh.SetName(p_imp_1, 'p_imp')
+smesh.SetName(coupe_vis_1.GetMesh(), 'coupe_vis')
+smesh.SetName(visHex80.GetMesh(), 'visHex80')
+smesh.SetName(tige_1, 'tige')
+smesh.SetName(p_imp_2, 'p_imp')
+smesh.SetName(section_1, 'section')
+smesh.SetName(appui_2, 'appui')
+smesh.SetName(tige_haute_1, 'tige_haute')
+smesh.SetName(conge_2, 'conge')
+smesh.SetName(rond_1, 'rond')
+smesh.SetName(section_tete_2, 'section_tete')
+smesh.SetName(tete_1, 'tete')
+smesh.SetName(tete_2, 'tete')
+smesh.SetName(section_tete_1, 'section_tete')
+smesh.SetName(rond_2, 'rond')
+smesh.SetName(conge_1, 'conge')
+smesh.SetName(tige_haute_2, 'tige_haute')
+smesh.SetName(section_2, 'section')
+smesh.SetName(tige_2, 'tige')
+smesh.SetName(p_imp_top, 'p_imp_top')
+smesh.SetName(Nb_Segments_3, 'Nb. Segments_3')
+smesh.SetName(conge_top, 'conge_top')
+smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
+smesh.SetName(appui_top, 'appui_top')
+smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
+smesh.SetName(tete_top, 'tete_top')
+smesh.SetName(section_tete_top, 'section_tete_top')
+smesh.SetName(tige_haute_top, 'tige_haute_top')
+smesh.SetName(rond_top, 'rond_top')
+smesh.SetName(tige_top, 'tige_top')
+smesh.SetName(section_top, 'section_top')
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2007-2013 EDF R&D
+# Copyright (C) 2007-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2011-2013 EDF R&D
+// Copyright (C) 2011-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2011-2013 EDF R&D
+// Copyright (C) 2011-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2011-2013 EDF R&D
+// Copyright (C) 2011-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2011-2013 EDF R&D
+// Copyright (C) 2011-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2011-2013 EDF R&D
+// Copyright (C) 2011-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2011-2013 EDF R&D
+// Copyright (C) 2011-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// Copyright (C) 2011-2013 EDF R&D
+// Copyright (C) 2011-2014 EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#!/usr/bin/env python
-# Copyright (C) 2011-2013 EDF R&D
+# Copyright (C) 2011-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2011-2013 EDF R&D
+# Copyright (C) 2011-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2011-2013 EDF R&D
+# Copyright (C) 2011-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2011-2013 EDF R&D
+# Copyright (C) 2011-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2011-2013 EDF R&D
+# Copyright (C) 2011-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2011-2013 EDF R&D
+# Copyright (C) 2011-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2011-2013 EDF R&D
+# Copyright (C) 2011-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
name. This returns the filename.
'''
filename=str("/tmp/padder_inputfile_"+meshName+".med")
- meshObject.ExportToMEDX( filename, 0, SMESH.MED_V2_2, 1 )
+ meshObject.ExportToMEDX( filename, 0, SMESH.MED_V2_2, 1, 1 )
return filename
def clear(self):
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2011-2013 EDF R&D
+# Copyright (C) 2011-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2011-2013 EDF R&D
+# Copyright (C) 2011-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# Copyright (C) 2011-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2011-2014 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#!/bin/bash
-# Copyright (C) 2010-2013 EDF R&D
+# Copyright (C) 2010-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2011-2013 EDF R&D
+# Copyright (C) 2011-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2011-2013 EDF R&D
+# Copyright (C) 2011-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2011-2013 EDF R&D
+# Copyright (C) 2011-2014 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
from meshcut_plugin import MeshCut
from yamsplug_plugin import YamsLct
from MGCleanerplug_plugin import MGCleanerLct
+from blocFissure.ihm.fissureCoude_plugin import fissureCoudeDlg
salome_pluginsmanager.AddFunction('PADDER mesher',
'Create a mesh with PADDER',
'Run MGCleaner',
MGCleanerLct)
+salome_pluginsmanager.AddFunction('Meshed Pipe with a crack',
+ 'Create a mesh with blocFissure tool',
+ fissureCoudeDlg)
+
+# ZCracks plugin requires the module EFICAS to be installed
+# thus it is first tested if this module is available before
+# adding the plugin to salome_pluginsmanager
+enable_zcracks = True
+try:
+ import eficasSalome
+except:
+ enable_zcracks = False
+
+if enable_zcracks:
+ from zcracks_plugin import ZcracksLct
+ salome_pluginsmanager.AddFunction('Run Zcrack',
+ 'Run Zcrack',
+ ZcracksLct)