-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Patrick GOLDBRONN (CEA)
# Date : 28/06/2001
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_version.h
// Author : Vadim SANDLER
// Module : SALOME
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
SUBDIRS = unix cmake_files
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
SET(SMESH_CXXFLAGS -I${SMESH_ROOT_DIR}/include/salome)
+FIND_LIBRARY(GeomSelectionTools GeomSelectionTools ${SMESH_ROOT_DIR}/lib/salome)
FIND_LIBRARY(MEFISTO2D MEFISTO2D ${SMESH_ROOT_DIR}/lib/salome)
FIND_LIBRARY(MeshDriverDAT MeshDriverDAT ${SMESH_ROOT_DIR}/lib/salome)
FIND_LIBRARY(MeshDriverMED MeshDriverMED ${SMESH_ROOT_DIR}/lib/salome)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
admlocal_cmakedir = $(admlocaldir)/cmake_files
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
SUBDIRS = config_files
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
dist_admlocalm4_DATA = \
check_SMESH.m4 \
- check_f77.m4 \
- check_Platform.m4 \
- check_qwt.m4
+ check_Platform.m4
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_PLATFORM],[
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
# Check availability of SMesh binary distribution
#
# Author : Nicolas REJNERI (OPEN CASCADE, 2003)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# The following is to avoid PACKAGE_... env variable
# redefinition compilation warnings
# ============================================================
+#
AM_CXXFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h
AM_CPPFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Guillaume Boulant (CSSI)
# Module : SMESH
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
-\r
+@REM Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+@REM
+@REM This library is free software; you can redistribute it and/or
+@REM modify it under the terms of the GNU Lesser General Public
+@REM License as published by the Free Software Foundation; either
+@REM version 2.1 of the License.
+@REM
+@REM This library is distributed in the hope that it will be useful,
+@REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+@REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+@REM Lesser General Public License for more details.
+@REM
+@REM You should have received a copy of the GNU Lesser General Public
+@REM License along with this library; if not, write to the Free Software
+@REM Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+@REM
+@REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+@REM
+
%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --smesh\r
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Tool for updating list of .in file for the SALOME project
# and regenerating configure script
# Author : Marc Tajchman - CEA
# autom4te.cache (directory)
echo "====================================================== aclocal"
-aclocal -I adm_local/unix/config_files \
- -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
- -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
- -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files || exit 1
+if test -d "${GUI_ROOT_DIR}"; then
+ aclocal -I adm_local/unix/config_files \
+ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
+ -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
+ -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files || exit 1
+else
+ aclocal -I adm_local/unix/config_files \
+ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+ -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
+ -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files || exit 1
+fi
+
# ____________________________________________________________________
# libtoolize creates some configuration files (ltmain.sh,
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
rm -rf autom4te.cache aclocal.m4 configure make_config
find . -name "*~" -print -exec rm {} \;
find . -name "*.pyc" -print -exec rm {} \;
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Author : Marc Tajchman (CEA)
# Date : 28/06/2001
# Modified by : Patrick GOLDBRONN (CEA)
# Modified by : Alexander BORODIN (OCN) - autotools usage
# Created from configure.in.base
#
-AC_INIT([Salome2 Project SMESH module], [5.1.3], [webmaster.salome@opencascade.com], [SalomeSMESH])
+AC_INIT([Salome2 Project SMESH module], [5.1.4], [webmaster.salome@opencascade.com], [SalomeSMESH])
AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
doc/salome/gui/SMESH/Makefile \
doc/salome/gui/SMESH/doxyfile \
doc/salome/gui/SMESH/doxyfile_py \
+ doc/salome/gui/SMESH/static/header.html \
doc/salome/tui/Makefile \
doc/salome/tui/doxyfile \
+ doc/salome/tui/static/header.html \
src/Makefile \
src/Controls/Makefile \
src/Driver/Makefile \
src/DriverUNV/Makefile \
src/MEFISTO2/Makefile \
src/OBJECT/Makefile \
+ src/PluginUtils/Makefile \
src/SMDS/Makefile \
src/SMESH/Makefile \
src/SMESHClient/Makefile \
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Patrick GOLDBRONN (CEA)
# Date : 30/11/2001
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Patrick GOLDBRONN (CEA)
# Date : 30/11/2001
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vasily Rusyaev (Open Cascade NN)
# Modified by : Alexander BORODIN (OCN) - autotools usage
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vasily Rusyaev (Open Cascade NN)
# Modified by : Alexander BORODIN (OCN) - autotools usage
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-EXTRA_DIST += images input static
+EXTRA_DIST += images input static/footer.html static/doxygen.css
+
+guidocdir = $(docdir)/gui/SMESH
+guidoc_DATA = images/head.png
+
usr_docs: doxyfile_py doxyfile
echo "===========================================" ; \
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesh Module Reference Manual v.@VERSION@"
+PROJECT_NAME = "SALOME Mesh User's Guide"
OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = .
-HTML_HEADER = @srcdir@/static/header.html
+HTML_HEADER = @builddir@/static/header.html
HTML_FOOTER = @srcdir@/static/footer.html
-#HTML_STYLESHEET = @srcdir@/static/doxygen.css
+HTML_STYLESHEET = @srcdir@/static/doxygen.css
TOC_EXPAND = YES
DISABLE_INDEX = NO
GENERATE_TREEVIEW = YES
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesh Module Reference Manual v.@VERSION@"
+PROJECT_NAME = "SALOME Mesh User's Guide"
OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = smeshpy_doc
-HTML_HEADER = @srcdir@/static/header.html
+HTML_HEADER = @builddir@/static/header.html
HTML_FOOTER = @srcdir@/static/footer.html
-#HTML_STYLESHEET = @srcdir@/static/doxygen.css
+HTML_STYLESHEET = @srcdir@/static/doxygen.css
TOC_EXPAND = YES
DISABLE_INDEX = YES
GENERATE_TREEVIEW = NO
\image html hypo_quad_params_res_2.png "The resulting meshes"
-<br>
+<b>See Also</b> a sample TUI Script of a
+\ref tui_quadrangle_parameters "Quadrangle Parameters" hypothesis.
+
\anchor quadrangle_preference_anchor
<h2>Quadrangle Preference</h2>
-This algorithm can be used only together with Quadrangle (Mapping)
-algorithm. It allows to build quadrangular meshes even if the number
+This algorithm can be used together with Quadrangle (Mapping) and Netgen 2D
+algorithms.
+
+It allows Netgen 2D to build quadrangular meshes at any conditions.
+
+It allows Quadrangle (Mapping) to build quadrangular meshes even if the number
of nodes at the opposite edges of a meshed face is not equal,
otherwise this mesh will contain some triangular elements.
<br>
This hypothesis has one restriction on its work: the total quantity of
segments on all four sides of the face must be even (divisible by 2).
+
<br>
\anchor triangle_preference_anchor
<h2>Triangle Preference</h2>
<li>\subpage ghs3d_hypo_page</li> - works with GHS3D algorithm.
<li>\subpage ghs3dprl_hypo_page</li> - works with GHS3DPRL (tepal) algorithm.
<li>\subpage blsurf_hypo_page</li> - works with BLSURF algorithm.
+<li>\subpage hexotic_hypo_page</li> - works with Hexotic algorithm.
</ul>
There also exist
\image html image146.png
From this submenu select the type of element which you would like to add to your mesh.
+\note All dialogs intended for adding nodes or elements to mesh (except dialog for adding
+0D elements) provide a possibility to add these nodes/elements to the specified group
+(or to create the group if it doesn't exist). <b>Add to group</b> box allows to choose
+an existing group for created node or element or to specify a name for new group.
</ol>
<b>See Also</b> sample TUI Scripts of
\image html image152.png
+\note All dialogs intended for adding quadratic elements to mesh provide a possibility
+to add these elements to the specified group (or to create the group if it doesn't exist).
+<b>Add to group</b> box allows to choose an existing group for created element or
+to specify a name for new group.
+
To create any <b>Quadratic Element</b> specify the nodes which will form your
triangle by selecting them in the 3D viewer with pressed Shift
button. Their numbers will appear in the dialog box as <b>Corner Nodes</b>
\image html image126.gif "Example of a hexahedral 3D mesh"
</ul>
+Some of 3D meshing algorithms also can generate 3D meshes from 2D meshes, working without
+geometrical objects. Such algorithms are
+<ul>
+<li>Hexahedron meshing algorithm (i,j,k),</li>
+<li>Tetrahedron (Netgen and GHS3D) meshing algorithms,</li>
+<li>Hexotic.</li>
+</ul>
+
+
\note BLSURF and GHS3D are commercial meshers and require a
license to be used within the Mesh module.
--- /dev/null
+/*!
+
+\page colors_size_page Colors / Size
+
+\image html colors_size.png
+
+Using this dialog you can define the following set of mesh visualization
+parameters:
+<ul>
+<li><b>Elements</b></li>
+<ul>
+<li><b>Fill</b> - color of surface of elements (seen in Shading mode).</li>
+<li><b>Back Face</b> - color of interior surface of elements.</li>
+<li><b>Outline</b> - color of borders of elements.</li>
+<li><b>0D slements</b> - color of 0D elements.</li>
+<li><b>Size of 0D slements</b> - size of 0D elements.</li>
+<li><b>Width</b> - width of lines (edges and borders of elements).</li>
+<li><b>Shrink coef.</b> - relative space of elements compared to gaps between
+ them in shrink mode.</li>
+</ul>
+<li><b>Nodes</b></li>
+<ul>
+<li><b>Color</b> - color of nodes.</li>
+<li><b>Marker</b> - group of options allowing to change the representation of
+ points (see \subpage point_marker_page "Point Marker" page).</li>
+</ul>
+<li><b>Orientation of faces</b></li>
+<ul>
+<li><b>Color</b> - color of orientation vertors.</li>
+<li><b>Scale</b> - size of orientation vectors.</li>
+<li><b>3D vectors</b> - allows to choose between 2D planar and 3D vectors.</li>
+</ul>
+</ul>
+
+*/
\ No newline at end of file
\image html mesh_evaluation_succeed.png
+</li>
-Consider trying a sample script for construction of a mesh from our
-\ref tui_creating_meshes_page "TUI Scripts" section.
+</ol>
+
+\anchor mesh_order_anchor
+It is allowed to change submesh priority in mesh computation when
+there are concurrent submeshes present. I.e. user can change priority of
+applying algorithms on shared subshapes of Mesh shape.
+<em>To change submesh priority:</em>
+<ol>
+<li>From the Mesh menu choose the "Change submesh priority" on
+selected Mesh item, or invoke from popup menu. The opened dialogue box
+shows a list of submeshes in the order of their priority. Algorithm and its
+hypotheses of a submesh being upper in the list are applied before those of
+a submesh lower in the list.
+
+There is an example of submesh order modifications of Mesh created on a Box
+shape. The main Mesh object:
+<ul>
+<li><i>3D</i> <b>Tetrahedron (Netgen)</b> with Hypothesis<b>Max Element Volume</b></li>
+<li><i>2D</i> <b>Triangle (Mefisto)</b> with Hypothesis<b>Max Element Area</b>
</li>
+<li><i>1D</i> <b>Wire discretisation</b> with <b>Number of Segments</b>=20</li>
+</ul>
+The first submesh object <b>Submesh_1</b> created on <b>Face_1</b>
+is:
+<ul>
+<li><i>2D</i> Netgen 1D-2D with Hypothesis <b>Netgen Simple parameters</b>
+(Number of Segments = 4)</li>
+</ul>
+The second submesh object <b>Submesh_2</b> created on <b>Face_2</b>
+is:
+<ul>
+<li><i>2D</i> Netgen 1D-2D with Hypothesis <b>Netgen Simple parameters</b>
+(Number of Segments = 8)</li>
+</ul>
+
+And the last third submesh object <b>Submesh_3</b> created on <b>Face_3</b>
+is:
+<ul>
+<li><i>2D</i> Netgen 1D-2D with Hypothesis <b>Netgen Simple parameters</b>
+(Number of Segments = 12)</li>
+</ul>
+The submeshes can become concurrent if their algorithms leads to mesh shared subshape
+with different algorithms (or different algorithms parameters, i.e. hypothesises).
+In fact, we have three submeshes with concurrent algorithms, because
+they have different hypothesises assigned to them.
+
+The first mesh computation made with:
+\image html mesh_order_123.png
+<center><em>"Mesh order SubMesh_1, SubMesh_2, SubMesh_3"</em></center>
+\image html mesh_order_123_res.png
+<center><em>"Result mesh with order SubMesh_1, SubMesh_2, SubMesh_3 "</em></center>
+
+The next mesh computation with:
+\image html mesh_order_213.png
+<center><em>"Mesh order SubMesh_2, SubMesh_1, SubMesh_3"</em></center>
+\image html mesh_order_213_res.png
+<center><em>"Result mesh with order SubMesh_2, SubMesh_1, SubMesh_3 "</em></center>
+
+And the last mesh computation with:
+\image html mesh_order_321.png
+<center><em>"Mesh order SubMesh_3, SubMesh_2, SubMesh_1"</em></center>
+\image html mesh_order_321_res.png
+<center><em>"Result mesh with order SubMesh_3, SubMesh_2, SubMesh_1 "</em></center>
+
+As we can see each mesh computation has different number of result
+elements and different mesh discretisation on shared edges (edges
+that are shared between <b>Face_1</b>, <b>Face_2</b> and <b>Face_3</b>)
+
+Additionally, submesh priority (order of algorithms to be applied) can
+be modified not only in separate dialog box, but in <b>Preview</b>
+also. This helps to preview different mesh results, modifying submesh
+order.
+\image html mesh_order_preview.png
+<center><em>"Preview with submesh priority list box"</em></center>
+
+If there are no concurrent submeshes under Mesh object, then user will see the
+following information dialog box
+\image html mesh_order_no_concurrent.png
+<center><em>"No concurrent submeshes detected"</em></center>
+and no mesh order list box will appear in Preview dialog box.
+
</ol>
+Consider trying a sample script for construction of a mesh from our
+\ref tui_creating_meshes_page "TUI Scripts" section.
+
*/
--- /dev/null
+/*!
+
+\page find_element_by_point_page Find Element by Point
+
+\n This functionality allows you to find all mesh elements to which
+belongs a certain point.
+
+<em>To find the elements:</em>
+<ol>
+<li>Select the mesh</li>
+<li>Select from the Mesh menu or from the context menu the Find
+Element by Point item.
+
+\image html findelement3.png
+<center><em>"Find Element by Point" button</em></center>
+
+The following dialog box will appear:
+
+\image html findelement2.png
+
+</li>
+<li>In this dialog box you should select:
+
+<ul>
+<li>the coordinates of the point;</li>
+<li>the type of elements to be found; it is also possible to find elements
+of all types related to the reference point. To be exact, type "All"
+means to find elements of any type except nodes and 0D elements.</li>
+</ul>
+
+</li>
+<li>Click the \b Apply or \b OK button.</li>
+</ol>
+
+\image html findelement1.png
+<center>The reference point and the related elements.</center>
+
+
+<br><b>See Also</b> a sample TUI Script of a \ref tui_find_element_by_point "Find Element by Point" operation.
+
+*/
\page ghs3dprl_hypo_page GHS3DPRL Parameters hypothesis
-\n GHS3DPRL Parameters hypothesis works only with <b>Tetrahedron (Tepal with TetMesh-GHS3D)</b> algorithm.
-\n
-\n This algorithm is a commercial software, its use requires a licence (http://www.distene.com/fr/build/offer.html).
-
-\n Tepal gives the possibility to generate a partitioned
+\n GHS3DPRL Parameters hypothesis works only with <b>Tetrahedron (Tepal with TetMesh-GHS3D)</b> algorithm.
+This algorithm is a commercial software, its use requires a licence (http://www.distene.com/fr/build/offer.html).
+\n Tepal_V1.4 gives the possibility to generate a partitioned
mesh with 200 million tetrahedrons on a computer with average memory size
-(2Go RAM) in about 50 hours on one CPU (Xeon, 2008).
-This is a serious alternative to GHS3D, which requires a much less common
+(2Go RAM) in about 50 hours on one CPU (Xeon, 2008).
+\n New Tepal_V2.0 gives the possibility to generate a partitioned mesh with (for the moment) no more than 100 million
+tetrahedrons on computers using MPI, (Total 16 Go RAM)
+in about 900 seconds (!yes! : !seconds!) on 2 octo processors (Xeon, 2009).
+The launch of this beta-version is described below.
+\n This is a serious alternative to GHS3D, which requires a much less common
configuration with 64Go RAM to only try to make a partition of a mesh with
200 million tetrahedrons, no result guaranteed.
\n
\note The Plugin doesn't load in the Memory the supposedly large resulting meshes.
The meshes are saved in MED files and can be imported in the user-defined location via menu File-Import-MED Files.
-\n Pay attention, that Salome GUI needs 2Go RAM. to load a MED
+\n Pay attention, that Salome GUI needs 2Go RAM to load a MED
file with 5 million tetrahedrons.
\image html ghs3dprl_parameters_basic.png
--verbose=0 --test=yes --menu=no --launchtepal=no
\endverbatim
-
+\n
</li>
<li>
-<p>
- <b>Advanced tepal Parameters</b> <p>
+<b>Advanced Tepal_V1.4 Parameters</b> <p>
\verbatim
Arguments to pass to Tetmesh during cutting process
\endverbatim
-
+\n
</li>
<li>
-<p>
-<b>Advanced ghs3d Parameters (through tepal's --tetmesh_args)</b> - type "ghs3d -h" in a Terminal. <p>
+<b>Advanced ghs3d Parameters (through Tepal_V1.4's --tetmesh_args)</b> - type "ghs3d -h" in a Terminal. <p>
\verbatim
myname@myhost > ghs3d -h
EMail: support@distene.com )
\endverbatim
-
+\n
</li>
<h1>Saving user's preferred GHS3DPRL Advanced Parameters</h1><br>
GHS3DPRL Plugin launches standalone binary executable tepal2med.<br>
-You may rename tepal2med as tepal2med.exe for example, and replace
-tepal2med by a shell script at your convenience to overriding parameters.<br>... or else $PATH modification... .<br>Idem for tepal.<br><br>
+You may rename file tepal2med as tepal2med.exe for example, and replace
+tepal2med by a shell script at your convenience to overriding parameters.
+<br>... or else $PATH modification... .<br>Idem for file tepal.<br><br>
<li>
<b>Advanced tepal2med Parameters</b> - overriding parameter deletegroups<p>
+You may rename tepal2med as tepal2med.exe for example.
\code
#!/bin/bash
tepal2med.exe $* --deletegroups="(\bAll_Nodes|\bAll_Faces)"
\endcode
-
+\n
</li>
<li>
-<p>
-<b>Advanced tepal Parameters</b> - overriding parameter component of ghs3d (to mesh holes). <p>
+<b>Advanced Tepal_V1.4 Parameters</b> - overriding parameter component of ghs3d (to mesh holes). <p>
+You may rename tepal as tepal.exe for example.
\code
#!/bin/bash
tepal.exe $* --tetmesh_args "-c 0"
\endcode
-
+\n
</li>
<li>
-<p>
<b>Advanced tepal Parameters</b> - overriding launching tepal on other host. <p>
+You may rename tepal as tepal.exe for example.
\code
#!/bin/bash
#ssh otherhost "tepal.exe $* --tetmesh_args \"-c 0\"" > /home/myname/tmp/tepal.log
\endcode
+\n
+</li>
+
+<h1>Tepal_V2.0 and MPI use.</h1><br>
+This all new beta-version needs MPI, (openmpi-1.3.1 was used). To use it you have to proceed
+as done in "overriding parameter component of ghs3d".
+Advanced ghs3d Parameters (through Tepal_V1.4's --tetmesh_args) are not assumed yet.
+It meshes holes.
+\n You may rename tepal as tepal64_v2.exe for example, and replace tepal by a shell script like below.
+
+<li>
+<b>example tepal_v2_mpirun.</b><p>
+
+\code
+#!/bin/bash
+#script tepal overriding launching Tepal_V2.0 with MPI (tepal run 64 bits only).
+#we have renamed binary executable tepal as tepal64_v2.exe.
+#typical command to launch tepal v1 :
+#tepal -f /tmp/myname/GHS3DPRL -n 16 > /tmp/myname/tepal.log
+#this file is an exemple to transform this call for tepal v2.0,
+# (beta version using .mesh input file)
+#you have to adapt for your convenience.
+
+#first problem is convert v1 input files GHS3DPRL.faces and GHS3DPRL.points
+# to v2 input file GHS3DPRL.mesh.
+#second problem is to launch on heterogeneous system linux cluster of
+# 2 hosts (64 bits) of 8 nodes (by example)
+# with different 2 executables codes linked on 2 different
+# openmpi shared library codes.
+#third problem is convert tepal v2 output files GHS3DPRL*.mesh
+# to v1 input files GHS3DPRL*.faces an GHS3DPRL*.points.
+
+#you have to work on the same physical disk and same path input and ouput files : $SAME_DIR
+#you have to work on different physical disk but same path and name for executable files
+# (and shared libraries) : $DIFF_DIR
+
+echo "parameter 0="$0
+echo "parameter 1="$1
+echo "parameter 2="$2
+echo "parameter 3="$3
+echo "parameter 4="$4
+
+export SAME_DIR=/same_physical_disk_and_same path/tmp
+export DIFF_DIR=/different_physical_disk_but_same path/myname
+
+#copy input local files from local current directory (something like /tmp/myname)
+#in this case we need /tmp/myname and $SAME_DIR different
+cd $SAME_DIR
+rm *
+cp $2* .
+
+export IN_FILES=`basename $2`
+export IN_DIR=`dirname $2`
+#created .mesh from .faces et .points
+/through_salome_path/facespoints2mesh.py $IN_FILES
+
+#there are 2 executable openmpi and library through 2 physical DIFF_DIR
+export PATH=$DIFF_DIR/openmpi-1.3.1_install/bin:${PATH}
+export LD_LIBRARY_PATH=$DIFF_DIR/openmpi-1.3.1_install/lib:${LD_LIBRARY_PATH}
+
+#there are 2 executables tepal_v2 through 2 physical DIFF_DIR
+export LD_LIBRARY_PATH=$DIFF_DIR/tepal-2.0.0/bin/Linux_64:${LD_LIBRARY_PATH}
+export PATH=$DIFF_DIR/tepal-2.0.0/bin/Linux_64:$PATH
+
+#small test betweeen friends
+#rm hostnames.log
+#mpirun -n $4 hostname >> hostnames.log
+
+#there necessary set env licence file for tepal v2
+export DISTENE_LICENSE_FILE="Use global envvar: DLIM8VAR"
+export DLIM8VAR="dlim8 1:1:29030@is142356/0016175ef08c::a1ba...9e19"
+export SIMULOGD_LICENSE_FILE=29029@is142356
+export LICENSE_FILE=/product/distene/dlim8.var.sh
+
+#mpirun with necessary set envenvironment
+export TMP_ENV="-x PATH -x LD_LIBRARY_PATH -x DISTENE_LICENSE_FILE -x DLIM8VAR \
+ -x SIMULOGD_LICENSE_FILE -x LICENSE_FILE"
+#mpirun $TMPENV -n $4 which tepal64_v2.exe >> hostnames.log
+
+#real mpirun uncomment after verify small test
+mpirun $TMPENV -n $4 tepal64_v2.exe --in $IN_FILES.mesh --out $IN_FILES.mesh --verbose 100
+
+#convert output files tepalv1 format
+/through_salome_path/mesh2facespoints.py $IN_FILES
+
+#copy ouputs files from $SAME_DIR to local current directory (something like /tmp/myname)
+cp -f hostnames.log $IN_DIR
+cp -f $IN_FILES* $IN_DIR
+
+#ls -al $SAME_DIR
+#cat $SAME_DIR/hostnames.log
+#cat /tmp/myname/tepal.log
+
+\endcode
+\n
</li>
<h1>TUI use.</h1><br>
<li>
-<p>
<b>example ex30_tepal.py.</b><p>
\code
else:
print "KO: tepal"
\endcode
-
+\n
</li>
</ul>
--- /dev/null
+/*!
+
+\page hexotic_hypo_page Hexotic Parameters hypothesis
+
+\n Hexotic Parameters hypothesis works only with <b>Hexotic</b>
+algorithm. This algorithm is a commercial software.
+
+\image html hexotic_parameters.png
+
+<ul>
+<li><b>Name</b> - allows to define the name of the hypothesis (Hexotic
+Parameters by default).</li>
+
+<li><b>Nb. Hexes Min Level</b> - allows defining the minimal level of recursive partitioning on the initial octree cube.</li>
+
+<li><b>Nb. Hexes Max Level</b> - allows defining the maximal level of recursive partitioning on the initial octree cube.</li>
+
+<li><b>Salome Quadrangles</b> - not documented.</li>
+
+<li><b>Generate smooth meshes no ridges</b> - specifies that the mesher can ignore ridges. A ridge is a geometrical entity (a sharp edge). The resulting meshes will have better quality elements, at the price of "smoothing" out the geometry.
+</li>
+
+<li><b>Authorize invalid elements</b> - specifies that the mesher must conform as much as possible to the geometry (especially the sharp edges). The resulting meshes may contain invalid elements (but with positive volumes: for example, three vertices of an hexahedron on the same edge), for the benefit of better geometry accuracy.
+</li>
+
+<li><b>Sharp angle threshold in degrees</b> - specifies the angle between two triangles above which the hex mesher will consider the edge common to these two triangles as being a "ridge". A ridge is a geometrical entity (a sharp edge) which has to be kept as it is in the final hex mesh.The default value is 60 (degrees).<br>If you raise this value, the hex mesher will detect less ridges, and the final solid mesh will therefore be smoother. On the other hand, if you reduce this value, more ridges will be detected and the algorithm will face harder situations to conform to.
+</li>
+</ul>
+
+*/
\n This functionality allows to merge coincident elements of a mesh
selectable in the dialog box.
-
\image html mergeelems_ico.png "Merge elements button"
+<ol>
+<li>From the \b Modification choose \b Transformation and from its
+sub-menu select the <b>Merge elements</b> item. The following dialog box
+shall appear:</li>
-\image html mergeelems.png
+\image html mergeelems_auto.png
+<br>
+<ul>
+<li>\b Name is the name of the mesh whose elements will be merged.</li>
+<li>\b Automatic Mode or \b Manual Mode is to switch the dialog
+controls type.
+</ul>
+
+<li><b>Automatic mode:</b>
+<ul>
+<li>In \b Automatic Mode the elements that were created on the same nodes will be merged.</li>
+</ul>
+</li>
+
+<li>If the \b Manual Mode is selected there are additional controls to
+manage the elements to be merged in more detail:
+\image html mergeelems.png
+<br>
+<ul>
+<li>\b Detect button generates the list of coincident elements for the given \b Tolerance.</li>
+<li><b>Coincident elements</b> is a list of groupes of elements for
+merging. All elements of each group will form one after the operation.
<ul>
- <li>\b Name is the name of the mesh whose elements will be merged.</li>
- <li>\b Tolerance is a maximum distance between elements sufficient for merging.
- <ul>
- <li>\b Detect button generates the list of coincident elements for the given \b Tolerance.</li>
- </ul></li>
- <li><b>Coincident elements</b> is a list of groupes of elements for
- merging. All elements of each group will form one after the operation.
- <ul>
- <li>\b Remove button deletes the selected group from the list.</li>
- <li>\b Add button adds to the list a group of elements selected in the
- viewer with pressed "Shift" key.</li>
- <li><b>Select all</b> checkbox selects all groups.</li>
- </ul></li>
- <li><b>Edit selected group</b> list allows editing the selected group:
- <br><br>
- \image html add.png
- <center>adds to the group the element selected in the viewer.</center>
- <br>
- \image html remove.png
- <center>removes from the group the selected element.</center>
- <br>
- \image html sort.png
- <center>moves the selected element to the first position in the
- group. This means that all other elements will be merged into this
- one.</center>
- <br>
- </li>
- <li>To confirm your choice click \b Apply or <b>Apply and Close</b> button.</li>
+<li>\b Remove button deletes the selected group from the list.</li>
+<li>\b Add button adds to the list a group of elements selected in the
+viewer with pressed "Shift" key.</li>
+<li><b>Select all</b> checkbox selects all groups.</li>
+</ul></li>
+<li><b>Edit selected group</b> list allows editing the selected group:
+<br><br>
+\image html add.png
+<center>adds to the group the element selected in the viewer.</center>
+<br>
+\image html remove.png
+<center>removes from the group the selected element.</center>
+<br>
+\image html sort.png
+<center>moves the selected element to the first position in the
+group. This means that all other elements will be merged into this
+one.</center>
+<br>
+</li>
+<li>To confirm your choice click \b Apply or <b>Apply and Close</b> button.</li>
</ul>
+</ol>
In this picture you see a triangle which coincides with one of the
elements of the mesh. After we apply <b>Merge Elements</b> functionality, the
<ol>
<li>From the \b Modification choose \b Transformation and from its
sub-menu select the <b>Merge nodes</b> item. The following dialog box
-shall appear:
-
-\image html mergenodes.png
+shall appear:</li>
+\image html mergenodes_auto.png
+<br>
<ul>
<li>\b Name is the name of the mesh whose nodes will be merged.</li>
+<li>\b Automatic Mode or \b Manual Mode is to switch the dialog
+controls type.
<li>\b Tolerance is a maximum distance between nodes sufficient for
-merging.
+merging, that is able in both dialog modes.</li>
+</ul>
+
+<li><b>Automatic mode:</b>
+<br>
+<ul>
+<li>In \b Automatic Mode to merge the Nodes, just input the tolerance
+value and confirm by \b Apply button.</li>
+</ul>
+</li><br>
+<li>If the \b Manual Mode is selected there are additional controls to
+manage the nodes to be merged in more detail:
<ul>
<li>\b Detect button generates the list of coincident nodes for the given
\b Tolerance.</li>
-</ul>
-</li>
<li><b>Coincident nodes</b> is a list of groupes of nodes for
merging. All nodes of each group will form one after the
operation.
viewer with pressed "Shift" key.</li>
<li><b>Select all</b> checkbox selects all groups.</li>
</ul>
+
+\image html mergenodes.png
+
</li>
<li><b>Edit selected group</b> list allows editing the selected
group:
<br><b>See Also</b> a sample TUI Script of a
\ref tui_merging_nodes "Merge Nodes" operation.
-*/
\ No newline at end of file
+*/
its elements.</li>
<li>\subpage rotation_page "Rotate" by the indicated axis and angle
the mesh or some of its elements.</li>
+<li>\subpage scale_page "Scale Transform" the mesh or some of its elements.</li>
<li>Create a \subpage symmetry_page "symmetrical copy" of the mesh
through a point or a vector of symmetry.</li>
<li>Unite meshes by \subpage sewing_meshes_page "sewing" free borders,
<li>\subpage changing_orientation_of_elements_page "Change orientation"
of the selected elements.</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 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>
key-points. Additionally, you may choose the way of getting nodes
coordinates by <b>projecting nodes on the face</b> instead of using
"positions on face" generated by mesher (if there is any). Faces
-having a seam edge can?t be used for automatic pattern creation.
+having a seam edge can't be used for automatic pattern creation.
When creating a pattern from an existing mesh, there are two possible
cases:
<br><b>See Also</b> a sample TUI Script of a
\ref tui_pattern_mapping "Pattern Mapping" operation.
-*/
\ No newline at end of file
+*/
--- /dev/null
+/*!
+
+\page point_marker_page Point Marker
+
+\n You can change the representation of points in
+the 3D viewer either by selecting one of the predefined
+shapes or by loading a custom texture from an external file.
+
+- Standard point markers
+
+The Mesh module provides a set of predefined point marker shapes
+which can be used to display points in 3D viewer.
+Each standard point marker has two attributes: type (defines shape
+form) and scale factor (defines shape size).
+
+\image html point_marker_widget1.png
+
+<br>
+
+\image html std_point_marker.png "Mesh presentation with standard point markers"
+
+- Custom point markers
+
+It is also possible to load a point marker shape from an external file.
+This file should provide a description of the point texture as a set
+of lines; each line is represented as sequence of "0" and "1" symbols,
+where "1" symbol means an opaque pixel and "0" symbol means a
+transparent pixel. The width of the texture correspond to the length
+of the longest line in the file, expanded to the nearest byte-aligned
+value. The height of the texture is equal to the number of non-empty
+lines in the file. Note that missing symbols are replaced by "0".
+
+Here is a texture file sample:
+
+<pre>
+00111100
+00111100
+11111111
+11111111
+11111111
+11111111
+00111100
+00111100
+</pre>
+
+\image html point_marker_widget2.png
+
+<br>
+
+\image html custom_point_marker.png "Mesh presentation with custom point markers"
+
+*/
+
The resulting mesh consists of triangles (near the center point) and
quadrangles.
-This algorithm requires the hypothesis indicating the number
+This algorithm is optionally parametrized by the hypothesis indicating the number
of mesh layers along the radius. The distribution of layers can be set with any 1D Hypothesis.
+If no own hypothesis of the algorithm is assigned, any local or global hypothesis is used
+by the algorithm to discretize edges. Note that if the geometrical face has two radial edges,
+they must be meshed with equal number of segments.
+
+If no 1D hypothesis is assigned to an edge, "Default Number of Segments" preferences parameter
+is used to discretize the edge.
+
\image html hypo_radquad_dlg.png
\image html mesh_radquad_01.png "Radial Quadrangle 2D mesh on the top and the bottom faces of a cylinder"
<li>Click \b Apply or <b> Apply and Close</b> button to confirm the
operation.</li>
-
+</ul>
</ol>
--- /dev/null
+/*!
+
+\page scale_page Scale
+
+\n This geometrical operation allows to scale in space your mesh
+or some of its elements.
+
+<em>To scale a mesh:</em>
+
+<ol>
+<li>From the \b Modification menu choose \b Transformation -> \b Scale
+\b Transform item.
+
+One of the following dialogs will appear:
+
+With one scale factor:
+\image html scale01.png
+
+Or with different scale factors for axes:
+\image html scale02.png
+
+</li>
+
+<li>
+In the dialog:
+<ul>
+<li>specify the IDs of the translated elements:
+
+<ul>
+<li><b>Select the whole mesh, submesh or group</b> activating this
+checkbox; or</li>
+<li>choose mesh elements with the mouse in the 3D Viewer. It is
+possible to select a whole area with a mouse frame; or</li>
+<li>input the element IDs directly in <b>ID Elements</b> field. The selected elements will be highlighted in the
+viewer; or</li>
+<li>apply Filters. <b>Set filter</b> button allows to apply a filter to the selection of elements. See more
+about filters in the \ref selection_filter_library_page "Selection filter library" page.</li>
+</ul>
+</li>
+
+<li>specify the base point for scale</li>
+
+<li>specify the scale factor</li>
+
+<li>specify the conditions of scale:
+<ul>
+<li>activate <b>Move elements</b> radio button to create the source
+mesh (or elements) at the new location and erase it from the previous location;</li>
+<li>activate <b>Copy elements</b> radio button to create the source
+mesh (or elements) at the new location, but leave it at the previous
+location, the source mesh will be considered one and single mesh with
+the result of the scale operation;</li>
+<li>activate <b>Create as new mesh</b> radio button to leave the
+source mesh (or elements) at its previous location and create a new
+mesh at the new location, the new mesh appears in the Object Browser
+with the default name MeshName_scaled (it is possible to change this
+name in the adjacent box);</li>
+<li>activate <b> Copy groups </b> checkbox to copy the groups of elements of the source mesh to the newly created mesh.</li>
+</ul>
+</li>
+
+</li>
+
+<li>Click \b Apply or <b> Apply and Close</b> button to confirm the operation.</li>
+</ul>
+</ol>
+
+
+
+<b>Example of using:</b>
+
+1. Create quandrangle mesh 3x3 on simple planar face (200x200)
+
+\image html scaleinit01.png
+
+and union 3 face (along axis Z) to group "gr_faces"
+
+\image html scaleinit02.png
+
+
+
+2. Perform scale operation for whole mesh with creation of new mesh:
+
+\image html scale03.png
+
+result after operation:
+
+\image html scaleres03.png
+
+
+
+3. Perform scale operation for whole mesh with copy of elements:
+
+\image html scale04.png
+
+result after operation:
+
+\image html scaleres04.png
+
+
+
+4. Perform scale operation for group of faces with copy of elements:
+
+\image html scale06.png
+
+result after operation:
+
+\image html scaleres06.png
+
+
+
+5. Perform scale operation for two edges with moving of elements:
+
+\image html scale07.png
+
+result after operation:
+
+\image html scaleres07.png
+
+
+
+6. Perform scale operation for one face with moving of elements:
+
+\image html scale09.png
+
+result after operation:
+
+\image html scaleres09.png
+
+
+<br><b>See Also</b> a sample TUI Script of a \ref tui_scale "Scale" operation.
+
+
+*/
--- /dev/null
+/*!
+
+\page split_to_tetra_page Splitting volumes into tetrahedra
+
+\n This operation allows to split volumic elements into tetrahedra.
+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.
+
+\image html split_into_tetra_icon.png
+<center><em>"Split into Tetrahedra" button</em></center>
+
+The following dialog box will appear:
+
+\image html split_into_tetra.png
+
+\par
+<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 a
+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>
+</ul>
+
+<ul>
+<li>\b Split hexahedron
+
+<ul>
+<li><b>Into 5 tetrahedra</b> and <b>Into 6 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 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>
+
+<li><b>Select from</b> set of fields allows to choose a submesh or an
+existing group whose elements will be automatically added to the
+list.</li>
+</ul>
+
+<li>Click the \b Apply or <b>Apply and Close</b> button to confirm the operation.</li>
+</ol>
+*/
\n This geometrical operation allows to perform a symmetrical copy of
your mesh or some of its elements.
-<em>To create a symmtrical copy of the mesh:</em>
+<em>To create a symmetrical copy of the mesh:</em>
<ol>
<li>From the \b Modification menu choose \b Transformation -> \b Symmetry item or click
</ul>
<li>Click \b Apply or <b> Apply and Close</b> button to confirm the
operation.</li>
+</ul>
</ol>
</li>
<li>Click \b Apply or <b> Apply and Close</b> button to confirm the operation.</li>
+</ul>
</ol>
<br><b>See Also</b> a sample TUI Script of a \ref tui_translation "Translation" operation.
\endcode
+<br>
+<h2>Change priority of submeshes in Mesh</h2>
+
+\code
+import salome
+import geompy
+import smesh
+import SMESH
+
+Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
+[Face_1,Face_2,Face_3,Face_4,Face_5,Face_6] = geompy.SubShapeAllSorted(Box_1, geompy.ShapeType["FACE"])
+
+# create Mesh object on Box shape
+Mesh_1 = smesh.Mesh(Box_1)
+
+# assign mesh algorithms
+Regular_1D = Mesh_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(20)
+Nb_Segments_1.SetDistrType( 0 )
+MEFISTO_2D = Mesh_1.Triangle()
+Max_Element_Area_1 = MEFISTO_2D.MaxElementArea(1200)
+Tetrahedron_Netgen = Mesh_1.Tetrahedron(algo=smesh.NETGEN)
+Max_Element_Volume_1 = Tetrahedron_Netgen.MaxElementVolume(40000)
+
+# create submesh and assign algorithms on Face_1
+Netgen_1D_2D = Mesh_1.Triangle(algo=smesh.NETGEN,geom=Face_1)
+SubMesh_1 = Netgen_1D_2D.GetSubMesh()
+NETGEN_2D_Simple_Parameters_1 = Netgen_1D_2D.Parameters(which=smesh.SIMPLE)
+NETGEN_2D_Simple_Parameters_1.SetNumberOfSegments( 4 )
+NETGEN_2D_Simple_Parameters_1.LengthFromEdges()
+
+# create submesh and assign algorithms on Face_2
+Netgen_1D_2D_1 = Mesh_1.Triangle(algo=smesh.NETGEN,geom=Face_2)
+SubMesh_2 = Netgen_1D_2D_1.GetSubMesh()
+NETGEN_2D_Simple_Parameters_2 = Netgen_1D_2D_1.Parameters(which=smesh.SIMPLE)
+NETGEN_2D_Simple_Parameters_2.SetNumberOfSegments( 8 )
+NETGEN_2D_Simple_Parameters_2.LengthFromEdges()
+smeshObj_1 = smesh.CreateHypothesis('NETGEN_SimpleParameters_2D',
+'NETGENEngine')
+
+# create submesh and assign algorithms on Face_3
+Netgen_1D_2D_2 = Mesh_1.Triangle(algo=smesh.NETGEN,geom=Face_3)
+SubMesh_3 = Netgen_1D_2D_2.GetSubMesh()
+NETGEN_2D_Simple_Parameters_3 = Netgen_1D_2D_2.Parameters(which=smesh.SIMPLE)
+NETGEN_2D_Simple_Parameters_3.SetNumberOfSegments( 12 )
+NETGEN_2D_Simple_Parameters_3.LengthFromEdges()
+
+# check exisiting submesh priority order
+[ [ SubMesh_1, SubMesh_3, SubMesh_2 ] ] = Mesh_1.GetMeshOrder()
+# set new submesh order
+isDone = Mesh_1.SetMeshOrder( [ [ SubMesh_1, SubMesh_2, SubMesh_3 ] ])
+# compute mesh
+isDone = Mesh_1.Compute()
+
+# clear mesh result and compute with other submesh order
+Mesh_1.Clear()
+isDone = Mesh_1.SetMeshOrder( [ [ SubMesh_2, SubMesh_1, SubMesh_3 ] ])
+isDone = Mesh_1.Compute()
+
+\endcode
+
<br>
\anchor tui_editing_mesh
<h2>Editing of a mesh</h2>
\anchor tui_radial_quadrangle
<h2> Radial Quadrangle 1D2D example </h2>
\code
-import salome
-import geompy
-import smesh
-import StdMeshers
+from smesh import *
+
+SetCurrentStudy(salome.myStudy)
# Create face from the wire and add to study
-WirePath = geompy.MakeSketcher("Sketcher:F 0 0:TT 20 0:R 90:C 20 90:WW", [0, 0, 0, 1, 0, 0, 0, 0, 1])
-Face = geompy.MakeFace(WirePath,1)
+Face = geompy.MakeSketcher("Sketcher:F 0 0:TT 20 0:R 90:C 20 90:WF", [0, 0, 0, 1, 0, 0, 0, 0, 1])
geompy.addToStudy(Face,"Face")
+edges = geompy.SubShapeAllSorted(Face, geompy.ShapeType["EDGE"])
+circle, radius1, radius2 = edges
+geompy.addToStudyInFather(Face, radius1,"radius1")
+geompy.addToStudyInFather(Face, radius2,"radius2")
+geompy.addToStudyInFather(Face, circle,"circle")
-# Define geometry for mesh, and 1D parameters
+
+# Define geometry for mesh, and Radial Quadrange algorithm
mesh = smesh.Mesh(Face)
-Wire_discretisation = mesh.Segment()
-Nb_Segments = Wire_discretisation.NumberOfSegments(5)
-Nb_Segments.SetDistrType( 0 )
+radial_Quad_algo = mesh.Quadrangle(algo=RADIAL_QUAD)
-# Define 2D parameters and Radial Quadrange hypothesis
-Number_of_Layers = smesh.CreateHypothesis('NumberOfLayers2D')
-Number_of_Layers.SetNumberOfLayers( 4 )
-mesh.AddHypothesis(Number_of_Layers)
-RadialQuadrangle_1D2D = smesh.CreateHypothesis('RadialQuadrangle_1D2D')
-mesh.AddHypothesis(RadialQuadrangle_1D2D)
+# The Radial Quadrange algorithm can work without any hypothesis
+# In this case it uses "Default Nb of Segments" preferences parameter to discretize edges
+mesh.Compute()
+# The Radial Quadrange uses global or local 1d hypotheses if no its own hypotheses assigned.
+# Define global hypotheses to discretize radial edges and a local one for circular edge
+global_Nb_Segments = mesh.Segment().NumberOfSegments(5)
+local_Nb_Segments = mesh.Segment(circle).NumberOfSegments(10)
+mesh.Compute()
+
+# Define own parameters of Radial Quadrange algorithm
+radial_Quad_algo.NumberOfLayers( 4 )
mesh.Compute()
\endcode
+\anchor tui_quadrangle_parameters
+<h2>Quadrangle Parameters example </h2>
+\code
+import geompy
+import smesh
+import StdMeshers
+
+# Get 1/4 part from the disk face.
+Box_1 = geompy.MakeBoxDXDYDZ(100, 100, 100)
+Disk_1 = geompy.MakeDiskR(100, 1)
+Common_1 = geompy.MakeCommon(Disk_1, Box_1)
+geompy.addToStudy( Disk_1, "Disk_1" )
+geompy.addToStudy( Box_1, "Box_1" )
+geompy.addToStudy( Common_1, "Common_1" )
+
+# Set the Geometry for meshing
+Mesh_1 = smesh.Mesh(Common_1)
+
+# Create Quadrangle parameters and define the Base Vertex.
+Quadrangle_Parameters_1 = smesh.CreateHypothesis('QuadrangleParams')
+Quadrangle_Parameters_1.SetTriaVertex( 8 )
+
+# Define 1D hypothesis and cmpute the mesh
+Regular_1D = Mesh_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
+Nb_Segments_1.SetDistrType( 0 )
+status = Mesh_1.AddHypothesis(Quadrangle_Parameters_1)
+Quadrangle_2D = Mesh_1.Quadrangle()
+Mesh_1.Compute()
+\endcode
\n Other meshing algorithms:
mesh.Rotate([], axisXYZ, angle270, 1)
\endcode
+<br>
+\anchor tui_scale
+<h3>Scale</h3>
+
+\code
+import geompy
+Box = geompy.MakeBoxDXDYDZ(200, 200, 200)
+f = geompy.SubShapeAllSorted(Box, geompy.ShapeType["FACE"])
+
+import smesh,SMESH
+import StdMeshers
+Mesh1 = smesh.Mesh(f[0])
+Regular_1D = Mesh1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(3)
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = Mesh1.Quadrangle()
+isDone = Mesh1.Compute()
+
+#Perform scale opration for whole mesh with creation of new mesh
+newMesh = Mesh1.ScaleMakeMesh(Mesh1,SMESH.PointStruct(100,100,200),[0.5,0.3,0.7],True,"ScaledMesh")
+
+#Perform scale operation for whole mesh with copy of elements
+Mesh1.Scale(Mesh1,SMESH.PointStruct(200,100,100),[0.5,0.5,0.5],True,True)
+
+#Perform scale opration for two edges with moving of elements
+Mesh1.Scale([1,2],SMESH.PointStruct(-100,100,100),[0.8,1.0,0.7],False)
+
+#Perform scale opration for one face with moving of elements
+Mesh1.Scale([21],SMESH.PointStruct(0,200,200),[0.7,0.7,0.7],False)
+\endcode
+
<br>
\anchor tui_symmetry
<h3>Symmetry</h3>
mesh.SewSideElements([69, 70, 71, 72], [91, 92, 89, 90], 8, 38, 23, 58)
\endcode
-*/
\ No newline at end of file
+*/
pass
\endcode
+
+
+<br>
+\anchor tui_find_element_by_point
+<h2>Find Element by Point</h2>
+
+\code
+import geompy
+import smesh
+import SMESH
+
+# Create a geometry to mesh
+box = geompy.MakeBoxDXDYDZ(100,100,100)
+
+# Create a mesh
+mesh = Mesh(box,"Mesh")
+mesh.AutomaticHexahedralization()
+mesh.Compute()
+
+# Create a point
+x,y,z = 0, 0, 1
+
+# Find all elements (except 0D ones) located at the point
+all_elems_except_0D = mesh.FindElementsByPoint(x,y,z)
+assert( len(all_elems_except_0D) == 4)
+
+# Find nodes at the point
+nodes = mesh.FindElementsByPoint(x,y,z, SMESH.NODE )
+assert( len(nodes) == 0)
+assert( len( mesh.FindElementsByPoint(x,y,0, SMESH.NODE)) == 1)
+
+# Find an edge at the point
+edges = mesh.FindElementsByPoint(x,y,z, SMESH.EDGE )
+assert( len(edges) == 1)
+
+# Find faces at the point
+edges = mesh.FindElementsByPoint(x,y,z, SMESH.FACE )
+assert( len(edges) == 2)
+
+# Find a volume at the point
+vols = mesh.FindElementsByPoint(x,y,z, SMESH.VOLUME )
+assert( len(vols) == 1)
+
+# Find 0D elements at the point
+edges = mesh.FindElementsByPoint(x,y,z, SMESH.ELEM0D )
+assert( len(edges) == 0)
+
+\endcode
+
*/
information about the mesh.</li>
<li>\ref mesh_element_info_anchor "Mesh Element Info" - provides basic
information about the selected element of the mesh. </li>
+<li>\subpage find_element_by_point_page "Find Element by Point" -
+allows to find all mesh elements, to which belongs a point with the
+given coordinates.</li>
<li>\subpage numbering_page "Numbering" - allows to display the ID
numbers of all meshing elements or nodes composing your mesh in the
viewer.</li>
Wireframe, Shading and Nodes presentation.</li>
<li>\subpage display_entity_page "Display Entity" - allows to display
Faces, Edges or both.</li>
+<li><b>2D Quadratic</b> - allows to select between the representation
+of quadratic edges as broken <b>lines</b> or as <b>arcs</b></li>
<li><b>Orientation of faces</b> - shows vectors of orientation of
-faces of the selected mesh</li>
-<li><b>Colors / Size</b> - allows to select color and size of
+faces of the selected mesh. Vector is shown for each 2D mesh element
+and for each free face of 3D mesh element. Vector direction is calculated by
+the first three nodes of face as a cross product of vectors n1-n2 and n1-n3.</li>
+<li>\subpage colors_size_page "Colors / Size" - allows to select color and size of
meshes.</li>
<li>\subpage transparency_page "Transparency" - allows to change the
transparency of mesh elements.</li>
<li><b>Hide</b> - allows to hide the selected mesh from the viewer.</li>
<li><b>Show Only</b> -allows to display only the selected mesh, hiding all other from the viewer.</li>
<li><b>Dump view</b> - exports an object from the viewer in bmp, png, jpg or jpeg image format.</li>
-<li><b>Change background</b> - allows to redefine the background color. By default it is black.</li>
+<li><b>Change background</b> - allows to redefine the background
+color. By default it is black.</li>
+<li><b>View Operations</b> checkbox - allows to show/hide the
+visualization toolbar in the viewer window.</li>
+<li><b>Recording Operations</b> - allows to show/hide the recording
+toolbar in the viewer window.</li>
</ul>
*/
-H1 {
+body {
+ font-family: Arial, Helvetica, sans-serif;
+ background-color: #ffffff;
+}
+
+h1 {
text-align: center;
+ text-decoration: none;
+ border: none;
+ line-height: 25px;
+ text-align: center;
+// text-transform:uppercase;
+ background: #D9f4fd;
+ font-size: 12pt;
+ font-weight: bold;
+ border: 1px solid #CCCCCC;
+ -moz-border-radius: 8px;
+ -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+/* background-color: rgb(75, 140, 185);
+ color: #ffffff;
+ text-align: center;
+ height: 25px;*/
+
+}
+
+h2 {
+ font-size: 12pt;
+ font-weight: bold;
+}
+
+table {
+ font-size: 10pt;
}
CAPTION {
A.qindexRef {}
-/* Link to any cross-referenced Doxygen element */
-A.el {
- text-decoration: none;
- font-weight: bold
-}
-
-A.elRef {
- font-weight: bold
-}
-
/* Link to any cross-referenced Doxygen element inside a code section
(ex: header)
*/
A:hover {
text-decoration: none;
- background-color: lightblue
+ background-color: lightblue;
+}
+
+div.contents {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+}
+
+div.navpath {
+ font-size: 11pt;
+}
+
+div.version {
+ background-color:#ffffde;
+ border:1px solid #cccccc;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 9pt;
+ text-align: center;
+ width:100px;
+ -moz-border-radius: 8px;
+// -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+}
+
+div.header {
+ background: url("head.png");
+ background-color: #175783;
+ border: 1px solid;
+ height: 80px;
+ background-repeat: no-repeat;
+ margin-bottom: 10px;
+}
+
+div.tabs {
+ display: none;
+}
+
+div.footer {
+ background-color: #D9f4fd;
+ border: 1px solid #AAAAAA;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ padding: 10px;
+ margin-top: 15px;
}
DL.el {
}
/* A code fragment (ex: header) */
-DIV.fragment {
- width: 100%;
+div.fragment {
border: none;
- background-color: #CCCCCC
}
/* In the alpha list (coumpound index), style of an alphabetical index letter */
font-size: smaller
}
-BODY {
- background: #FFFFFF;
-}
-
/*div.div-page {
background-color: #FFFFFF;
margin-left: 1em;
span.preprocessor { color: #806020 }
span.stringliteral { color: #002080 }
span.charliteral { color: #008080 }
+
+/* @group Code Colorization */
+
+.fragment {
+ font-family: monospace, fixed;
+ font-size: 10pt;
+}
+
+pre.fragment {
+ width: 95%;
+ border: 1px solid #CCCCCC;
+ -moz-border-radius: 8px;
+ -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+ background-color:#EEF3F5;
+ padding: 4px 6px;
+ margin: 4px 1px 4px 1px;
+}
+
+/* Top Navigation style */
+
+div.navigation {
+ margin-bottom:20px;
+}
+
+/* Left navigation panel style */
+
+body.ftvtree {
+ background-color: #D9f4fd;
+ margin: 10px;
+}
+
+div.directory {
+ margin: 0;
+}
+
+div.directory.p {
+ margin: 0;
+}
+
+h3.swap {
+ font-size: 10pt;
+ margin-bottom: 0;
+}
+
+/* Link to any cross-referenced Doxygen element */
+a.el {
+ text-decoration: none;
+ font-family: Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 9pt;
+ color: #551a8b;
+}
+
+a.el:hover {
+ background-color: transparent;
+}
+
+a.elRef {
+ font-weight: normal;
+}
+
+
+#MSearchBox {
+ -moz-border-radius:8px 8px 8px 8px;
+ background-color:white;
+ border:1px solid #84B0C7;
+ margin:0;
+ padding:0;
+ white-space:nowrap;
+}
+
+div.directory img {
+ vertical-align:-30%;
+}
+
+div.directory p {
+ white-space:nowrap;
+ margin: 0;
+}
+
+div.directory-alt div {
+ display: none;
+ margin: 0px;
+}
+
+
+div.directory div {
+ display: none;
+ margin: 0px;
+}
+
+div.version {
+ background-color:#ffffde;
+ border:1px solid #cccccc;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 9pt;
+ text-align: center;
+ width:100px;
+ -moz-border-radius: 8px;
+// -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+}
+
+/* @group Member Descriptions */
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+ background-color: #FAFAFA;
+ border: none;
+ margin: 4px;
+ padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+ padding: 0px 8px 4px 8px;
+ color: #555;
+}
+
+.memItemLeft, .memItemRight, .memTemplParams {
+ border-top: 1px solid #ccc;
+}
+
+.memItemLeft, .memTemplItemLeft {
+ white-space: nowrap;
+}
+
+.memTemplParams {
+ color: #606060;
+ white-space: nowrap;
+}
+
+/* @end */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+ font-size: 80%;
+ color: #606060;
+ font-weight: normal;
+ margin-left: 3px;
+}
+
+.memnav {
+ background-color: #e8eef2;
+ border: 1px solid #84b0c7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+
+.memitem {
+ padding: 0;
+ margin-bottom: 10px;
+}
+
+.memname {
+ white-space: nowrap;
+ font-weight: bold;
+}
+
+.memproto, .memdoc {
+ border: 1px solid #84b0c7;
+}
+
+.memproto {
+ padding: 0;
+ background-color: #d5e1e8;
+ font-weight: bold;
+ -webkit-border-top-left-radius: 8px;
+ -webkit-border-top-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -moz-border-radius-topleft: 8px;
+ -moz-border-radius-topright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+
+}
+
+
+
+.memdoc {
+ padding: 2px 5px;
+ background-color: #eef3f5;
+ border-top-width: 0;
+ -webkit-border-bottom-left-radius: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+}
+
+.paramkey {
+ text-align: right;
+}
+
+.paramtype {
+ white-space: nowrap;
+}
+
+.paramname {
+ color: #602020;
+ white-space: nowrap;
+}
+.paramname em {
+ font-style: normal;
+}
+
+/* @end */
<head>
</head>
<body>
-<hr style="width: 100%; height: 2px;">
+<div class="footer">
<div style="text-align: center;">
-Copyright © 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+Copyright © 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE<br>
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
</div>
+</div>
</body>
</html>
--- /dev/null
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>$title</title>
+ <link href="doxygen.css" rel="stylesheet" type="text/css">
+</head>
+<div class="header"></div>
+<div align="right"><div class="version">Version: @VERSION@</div></div>
+
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vasily Rusyaev (Open Cascade NN)
# Module : doc
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-EXTRA_DIST += images static
+EXTRA_DIST += images static/doxygen.css static/footer.html
+
+tuidocdir = $(docdir)/tui/SMESH
+tuidoc_DATA = images/head.png images/smeshscreen.png
dist_doc_DATA = \
extra/AddNetgenInSalome2.pdf \
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "Mesh Module Programming Guide v.@VERSION@"
+PROJECT_NAME = "SALOME Mesh Module Developer"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = SMESH
CREATE_SUBDIRS = NO
INPUT = @top_srcdir@/src \
@top_srcdir@/bin \
@top_srcdir@/idl \
- @top_builddir@/bin
-FILE_PATTERNS = *.idl *.hxx *.cxx *.h *.c *.hh *.cc @DOXYGEN_PYTHON_EXTENSION@
+ @top_builddir@/bin \
+ @srcdir@/input
+FILE_PATTERNS = *.idl *.hxx *.cxx *.h *.c *.hh *.cc @DOXYGEN_PYTHON_EXTENSION@ *.doc
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
GENERATE_HTML = YES
HTML_OUTPUT = .
HTML_FILE_EXTENSION = .html
-#HTML_HEADER = @srcdir@/static/myheader.html
-#HTML_FOOTER = @srcdir@/static/footer.html
-#HTML_STYLESHEET = @srcdir@/static/doxygen.css
+HTML_HEADER = @builddir@/static/header.html
+HTML_FOOTER = @srcdir@/static/footer.html
+HTML_STYLESHEET = @srcdir@/static/doxygen.css
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
--- /dev/null
+/*! \mainpage
+
+\image html smeshscreen.png
+
+To browse the \b SALOME Mesh module Developer Documentation, follow the links below or use navigation menu at the top of the page:
+<ul>
+<li> <a href="modules.html">Modules</a> - documentation of TUI functionality.</li>
+<li> <a href="namespaces.html">Name Spaces</a> - list of TUI packages and scripts.</li>
+<li> <a href="annotated.html">Data Structures</a> - list of all data structures and classes with brief descriptions.</li>
+<li> <a href="files.html">Files</a> - list of all files with brief descriptions.</li>
+</ul>
+
+*/
\ No newline at end of file
-H1 {
+body {
+ font-family: Arial, Helvetica, sans-serif;
+ background-color: #ffffff;
+}
+
+h1 {
text-align: center;
+ text-decoration: none;
+ border: none;
+ line-height: 25px;
+ text-align: center;
+// text-transform:uppercase;
+ background: #D9f4fd;
+ font-size: 12pt;
+ font-weight: bold;
+ border: 1px solid #CCCCCC;
+ margin-top: 50px;
+ -moz-border-radius: 8px;
+ -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+}
+
+h2 {
+ font-size: 12pt;
+ font-weight: bold;
+}
+
+table {
+ font-size: 10pt;
+ padding-left: 20px;
}
CAPTION {
A.qindexRef {}
-/* Link to any cross-referenced Doxygen element */
-A.el {
- text-decoration: none;
- font-weight: bold
-}
-
-A.elRef {
- font-weight: bold
-}
-
/* Link to any cross-referenced Doxygen element inside a code section
(ex: header)
*/
A:hover {
text-decoration: none;
- background-color: lightblue
+ background-color: lightblue;
+}
+
+div.contents {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ padding: 20px;
+}
+
+div.navpath {
+ font-size: 11pt;
+}
+
+div.header {
+ background: url("head.png");
+ background-color: #175783;
+ border: 1px solid;
+ height: 80px;
+ background-repeat: no-repeat;
+ margin-bottom:20px;
+}
+
+div.tabs {
+ text-align: justify;
+ margin-left : 2px;
+ margin-right : 2px;
+ margin-top : 2px;
+ margin-bottom : 2px
+ font-weight: bold;
+ color: #FFFFFF;
+}
+
+div.footer {
+ background-color: #D9f4fd;
+ border: 1px solid #AAAAAA;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ padding: 10px;
+}
+
+div.div-footer {
+ background-color: #D9f4fd;
+ border: 1px solid #AAAAAA;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ padding: 10px;
+ text-align: center;
}
DL.el {
}
/* A code fragment (ex: header) */
-DIV.fragment {
- width: 100%;
+div.fragment {
border: none;
- background-color: #CCCCCC
}
/* In the alpha list (coumpound index), style of an alphabetical index letter */
font-size: smaller
}
-BODY {
- background: #FFFFFF;
-}
-
/*div.div-page {
background-color: #FFFFFF;
margin-left: 1em;
border-color: #0D299A;
}*/
-DIV.div-footer {
- margin-left: 1em;
- margin-right: 1em;
- margin-bottom: 0.2em;
- text-align: right;
- font-size: 9pt;
+div.tabs {
+ text-align: justify;
+ margin-left : 2px;
+ margin-right : 2px;
+ margin-top : 2px;
+ margin-bottom : 2px
+ font-weight: bold;
+ color: #FFFFFF;
}
/* In File List, Coumpound List, etc, 1st column of the index */
TD.indexkey {
- background-color: #CCCCCC;
+ background-color: #DDDDEE;
font-weight: bold;
padding-right : 10px;
padding-top : 2px;
/* In File List, Coumpound List, etc, 2nd column of the index */
TD.indexvalue {
- background-color: #CCCCCC;
+ background-color: #EEEEFF;
font-style: italic;
padding-right : 10px;
padding-top : 2px;
span.preprocessor { color: #806020 }
span.stringliteral { color: #002080 }
span.charliteral { color: #008080 }
+
+/* @group Code Colorization */
+
+.fragment {
+ font-family: monospace, fixed;
+ font-size: 10pt;
+}
+
+pre.fragment {
+ width: 95%;
+ border: 1px solid #CCCCCC;
+ -moz-border-radius: 8px;
+ -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+ background-color:#EEF3F5;
+ padding: 4px 6px;
+ margin: 20px;
+}
+
+/* Top Navigation style */
+
+div.navigation {
+ margin-bottom:20px;
+}
+
+/* Left navigation panel style */
+
+body.ftvtree {
+ background-color: #D9f4fd;
+ margin: 10px;
+}
+
+div.directory {
+ margin: 0;
+}
+
+div.directory.p {
+ margin: 0;
+}
+
+h3.swap {
+ font-size: 10pt;
+ margin-bottom: 0;
+}
+
+/* Link to any cross-referenced Doxygen element */
+a.el {
+ text-decoration: none;
+ font-family: Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 10pt;
+ color: #551a8b;
+}
+
+a.el:hover {
+ background-color: transparent;
+ color: #551acc;
+}
+
+a {
+// text-decoration: none;
+ font-family: Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 10pt;
+ color: #551a8b;
+}
+
+a:hover {
+ background-color: transparent;
+ color: #551acc;
+}
+
+a.elRef {
+ font-weight: normal;
+}
+
+
+#MSearchBox {
+ -moz-border-radius:8px 8px 8px 8px;
+ background-color:white;
+ border:1px solid #84B0C7;
+ margin:0;
+ padding:0;
+ white-space:nowrap;
+}
+
+div.directory img {
+ vertical-align:-30%;
+}
+
+div.directory p {
+ white-space:nowrap;
+ margin: 0;
+}
+
+div.directory-alt div {
+ display: none;
+ margin: 0px;
+}
+
+
+div.directory div {
+ display: none;
+ margin: 0px;
+}
+
+div.version {
+ background-color:#ffffde;
+ border:1px solid #cccccc;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 9pt;
+ text-align: center;
+ width:100px;
+ -moz-border-radius: 8px;
+ // -moz-box-shadow:5px 5px 5px rgba(0, 0, 0, 0.15);
+}
+
+
+/* @group Member Descriptions */
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+ background-color: #FAFAFA;
+ border: none;
+ margin: 4px;
+ padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+ padding: 0px 8px 4px 8px;
+ color: #555;
+}
+
+.memItemLeft, .memItemRight, .memTemplParams {
+ border-top: 1px solid #ccc;
+}
+
+.memItemLeft, .memTemplItemLeft {
+ white-space: nowrap;
+}
+
+.memTemplParams {
+ color: #606060;
+ white-space: nowrap;
+}
+
+/* @end */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+ font-size: 80%;
+ color: #606060;
+ font-weight: normal;
+ margin-left: 3px;
+}
+
+.memnav {
+ background-color: #e8eef2;
+ border: 1px solid #84b0c7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+
+.memitem {
+ padding: 0;
+ margin-bottom: 10px;
+}
+
+.memname {
+ white-space: nowrap;
+ font-weight: bold;
+}
+
+.memproto, .memdoc {
+ border: 1px solid #84b0c7;
+}
+
+.memproto {
+ padding: 0;
+ background-color: #d5e1e8;
+ font-weight: bold;
+ -webkit-border-top-left-radius: 8px;
+ -webkit-border-top-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -moz-border-radius-topleft: 8px;
+ -moz-border-radius-topright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+
+}
+
+
+
+.memdoc {
+ padding: 2px 5px;
+ background-color: #eef3f5;
+ border-top-width: 0;
+ -webkit-border-bottom-left-radius: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+}
+
+.paramkey {
+ text-align: right;
+}
+
+.paramtype {
+ white-space: nowrap;
+}
+
+.paramname {
+ color: #602020;
+ white-space: nowrap;
+}
+.paramname em {
+ font-style: normal;
+}
+
+/* @end */
-</DIV>
-<DIV class="div-footer">
-Generated on $datetime for $projectname by <A href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></A> $doxygenversion</DIV>
-</BODY>
-</HTML>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+</head>
+<body>
+<div class="footer">
+<!--hr style="width: 100%; height: 2px;"-->
+<div style="text-align: center;">
+Copyright © 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
+</div>
+</div>
+</body>
+</html>
--- /dev/null
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">
+ <title>$title</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+<link href="tabs.css" rel="stylesheet" type="text/css">
+</head>
+<body>
+<div class="header"></div>
+<div align="right"><div class="version">Version: @VERSION@</div></div>
+</body>
+</html>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# This Makefile is responsible of generating the client and server
# implementation of IDL interfaces for both C++ and python usage.
# The building process of the C++ files is in charge of each source
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_BasicHypothesis.idl
// Author : Paul RASCLE, EDF
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_Filter.idl
// Author : Alexey Petrov, OCC
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_Gen.idl
// Author : Paul RASCLE, EDF
-
+//
#ifndef _SMESH_GEN_IDL_
#define _SMESH_GEN_IDL_
* Can be used to check if the object was created in the same container, as this engine.
*/
long GetObjectId(in Object theObject);
+
+ /*!
+ * \brief Get MED version of the file by its name.
+ */
+ boolean GetMEDVersion(in string theFileName, out MED_VERSION theVersion);
+
+ /*!
+ * \brief Get names of meshes defined in file with the specified name.
+ */
+ string_array GetMeshNames(in string theFileName);
};
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_Group.idl
// Author : Sergey ANIKIN, OCC
// $Header$
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_Hypothesis.idl
// Author : Paul RASCLE, EDF
// $Header$
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_Mesh.idl
// Author : Paul RASCLE, EDF
//
-
#ifndef _SMESH_MESH_IDL_
#define _SMESH_MESH_IDL_
interface SMESH_GroupOnGeom;
interface SMESH_subMesh;
interface SMESH_MeshEditor;
+
+ typedef sequence<SMESH_subMesh> submesh_array;
+ typedef sequence<submesh_array> submesh_array_array;
+
interface SMESH_Mesh : SALOME::GenericObj, SMESH_IDSource
{
/*!
* the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
* the typical use is auto_groups=false.
* - theVersion : define the version of format of MED file, that will be created
+ * - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
+ */
+ void ExportToMEDX( in string file, in boolean auto_groups, in MED_VERSION theVersion, in boolean overwrite )
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Export Mesh to different MED Formats
+ * Works, just the same as ExportToMEDX, with overwrite parameter equal to true.
+ * The method is kept in order to support old functionality
*/
void ExportToMED( in string file, in boolean auto_groups, in MED_VERSION theVersion )
raises (SALOME::SALOME_Exception);
/*!
* Export Mesh to MED_V2_1 MED format
- * Works, just the same as ExportToMED, with MED_VERSION parameter equal to MED_V2_1.
+ * Works, just the same as ExportToMEDX with MED_VERSION parameter equal to MED_V2_1
+ * and overwrite parameter equal to true
* The method is kept in order to support old functionality
*/
void ExportMED( in string file, in boolean auto_groups )
ElementType GetElementType( in long id, in boolean iselem )
raises (SALOME::SALOME_Exception);
+ EntityType GetElementGeomType( in long id )
+ raises (SALOME::SALOME_Exception);
+
long_array GetSubMeshElementsId(in long ShapeID)
raises (SALOME::SALOME_Exception);
ElementType GetSubMeshElementType(in long ShapeID)
raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Methods to set meshing order of submeshes
+ */
+
+ /*!
+ * \brief Return submesh objects list in meshing order
+ */
+ submesh_array_array GetMeshOrder();
+
+ /*!
+ * \brief Set submesh object order
+ */
+ boolean SetMeshOrder(in submesh_array_array theSubMeshArray);
+
+
/*!
* Get mesh description
*/
*/
long ElemNbFaces(in long id);
+ /*!
+ * Returns nodes of given face (counted from zero) for given volumic element.
+ */
+ long_array GetElemFaceNodes(in long elemId, in short faceIndex);
+
+ /*!
+ * Returns an element based on all given nodes.
+ */
+ long FindElementByNodes(in long_array nodes);
+
/*!
* Returns true if given element is polygon
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_MeshEditor.idl
//
-
#ifndef _SMESH_MESHEDITOR_IDL_
#define _SMESH_MESHEDITOR_IDL_
interface NumericalFunctor;
interface SMESH_MeshEditor
{
+ /*!
+ * \brief Wrap a sequence of ids in a SMESH_IDSource
+ */
+ SMESH_IDSource MakeIDSource(in long_array IDsOfElements);
+
boolean RemoveElements(in long_array IDsOfElements);
boolean RemoveNodes(in long_array IDsOfNodes);
long BestSplit (in long IDOfQuad,
in NumericalFunctor Criterion);
+ /*!
+ * \brief Split volumic elements into tetrahedrons
+ * \param elems - elements to split
+ * \param methodFlags - flags passing splitting method:
+ * 1 - split the hexahedron into 5 tetrahedrons
+ * 2 - split the hexahedron into 6 tetrahedrons
+ */
+ void SplitVolumesIntoTetra(in SMESH_IDSource elems, in short methodFlags)
+ raises (SALOME::SALOME_Exception);
+
+
enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
boolean Smooth(in long_array IDsOfElements,
in boolean CopyGroups,
in string MeshName);
+ void Scale (in SMESH_IDSource theObject,
+ in PointStruct thePoint,
+ in double_array theScaleFact,
+ in boolean Copy);
+ ListOfGroups ScaleMakeGroups (in SMESH_IDSource theObject,
+ in PointStruct thePoint,
+ in double_array theScaleFact);
+ SMESH_Mesh ScaleMakeMesh (in SMESH_IDSource theObject,
+ in PointStruct thePoint,
+ in double_array theScaleFact,
+ in boolean CopyGroups,
+ in string MeshName);
+
void Rotate (in long_array IDsOfElements,
in AxisStruct Axis,
in double AngleInRadians,
*/
long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type);
+ /*!
+ * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
+ * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
+ */
+ short GetPointState(in double x, in double y, in double z);
+
enum Sew_Error {
SEW_OK,
SEW_BORDER1_NOT_FOUND,
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_Pattern.idl
// Created : Mon Aug 2 10:48:36 2004
// Author : Edward AGAPOV (eap)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Patrick GOLDBRONN (CEA)
# Date : 28/06/2001
mesh_init.png \
mesh_length.png \
mesh_length_2d.png \
+ mesh_find_elem_by_point.png \
mesh_free_edges.png \
mesh_free_edges_2d.png \
mesh_free_nodes.png \
mesh_extractGroup.png \
mesh_precompute.png \
mesh_2d_from_3d.png \
- mesh_free_faces.png
+ mesh_free_faces.png \
+ scale.png \
+ scale_along_axes.png \
+ split_into_tetra.png
# VSR: little trick to avoid putting if SMESHCatalog.xml to the distribution archive
nodist_salomeres_SCRIPTS = SMESHCatalog.xml
<?xml version='1.0' encoding='us-ascii' ?>
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
</path-prefix-list>
<type-list>
- <objref name="SMESH_Mesh" id="IDL:Mesh/SMESH_Mesh:1.0"/>
+ <objref name="SMESH_Mesh" id="IDL:SMESH/SMESH_Mesh:1.0"/>
<objref name="SMESH_Hypothesis" id="IDL:SMESH/SMESH_Hypothesis:1.0"/>
</type-list>
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
<parameter name="backface_color" value="0, 0, 255"/>
<parameter name="elem0d_color" value="0, 255, 0"/>
<parameter name="highlight_color" value="0, 255, 255"/>
- <parameter name="node_size" value="3" />
+ <parameter name="type_of_marker" value="1" />
+ <parameter name="marker_scale" value="9" />
<parameter name="elem0d_size" value="5" />
<parameter name="element_width" value="1" />
<parameter name="shrink_coeff" value="75"/>
<parameter name="nb_segments_per_edge" value="15"/>
<parameter name="quadratic_mode" value="0"/>
<parameter name="max_angle" value="2"/>
+ <parameter name="documentation" value="smesh_help"/>
+ <!-- Input field precisions -->
+ <parameter name="def_precision" value="3" />
+ <parameter name="length_precision" value="-6" />
+ <parameter name="angle_precision" value="-3" />
+ <parameter name="len_tol_precision" value="-7" />
+ <parameter name="parametric_precision" value="-6" />
+ <parameter name="area_precision" value="-6" />
+ <parameter name="vol_precision" value="-6" />
+ </section>
+ <section name="smesh_help" >
+ <parameter name="sub_menu" value="%1 module"/>
+ <parameter name="User's Guide" value="${SMESH_ROOT_DIR}/share/doc/salome/gui/SMESH/index.html"/>
+ <parameter name="Developer's Guide" value="${SMESH_ROOT_DIR}/share/doc/salome/tui/SMESH/index.html"/>
</section>
<section name="resources">
<!-- Module resources -->
<?xml version='1.0' encoding='us-ascii'?>
<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
label-id="Hexahedron (i,j,k)"
icon-id="mesh_algo_hexa.png"
input="QUAD"
+ need-geom="false"
dim="3"/>
<algorithm type="Projection_1D"
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Patrick GOLDBRONN (CEA)
# Modified by : Alexander BORODIN (OCN) - autotools usage
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SMESH_ControlsDef.hxx"
int main(int argc, char** argv)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SMESH_ControlsDef.hxx"
#include <set>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SMESH_CONTROLS_HXX_
#define _SMESH_CONTROLS_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SMESH_CONTROLSDEF_HXX_
#define _SMESH_CONTROLSDEF_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "Driver_Document.h"
Driver_Document::Driver_Document():
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVER_DOCUMENT
#define _INCLUDE_DRIVER_DOCUMENT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SMESH Driver : implementaion of driver for reading and writing
+
+// SMESH Driver : implementaion of driver for reading and writing
// File : Mesh_Reader.cxx
// Module : SMESH
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH Driver : implementaion of driver for reading and writing
// File : Mesh_Reader.h
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "Driver_SMDS_Mesh.h"
using namespace std;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVER_SMDS_MESH
#define _INCLUDE_DRIVER_SMDS_MESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "Driver_SMESHDS_Mesh.h"
using namespace std;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVER_SMESHDS_MESH
#define _INCLUDE_DRIVER_SMESHDS_MESH
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH Driver : implementaion of driver for reading and writing
# File : Makefile.in
# Author : Marc Tajchman (CEA)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverDAT_R_SMDS_Mesh.h"
#include "DriverDAT_W_SMDS_Mesh.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include <stdio.h>
#include "DriverDAT_R_SMDS_Mesh.h"
ValDegre = 3;
nbNoeuds = 2;
ok = myMesh->AddEdgeWithID(NoeudsMaille[0], NoeudsMaille[1],
- intNumMaille);
+ intNumMaille);
break;
case 204:
case 208:
ValDegre = 9;
nbNoeuds = 4;
ok = myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1],
- NoeudsMaille[2], NoeudsMaille[3],
- intNumMaille);
+ NoeudsMaille[2], NoeudsMaille[3],
+ intNumMaille);
break;
case 203:
case 206:
ValDegre = 5;
nbNoeuds = 3;
ok = myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1],
- NoeudsMaille[2], intNumMaille);
+ NoeudsMaille[2], intNumMaille);
break;
case 308:
case 320:
ValDegre = 12;
nbNoeuds = 8;
if (ValElement == 320){
- //A voir, correspondance VTK
- NoeudsMaille[4] = NoeudsMaille[8];
- NoeudsMaille[5] = NoeudsMaille[9];
- NoeudsMaille[6] = NoeudsMaille[10];
- NoeudsMaille[7] = NoeudsMaille[11];
+ //A voir, correspondance VTK
+ NoeudsMaille[4] = NoeudsMaille[8];
+ NoeudsMaille[5] = NoeudsMaille[9];
+ NoeudsMaille[6] = NoeudsMaille[10];
+ NoeudsMaille[7] = NoeudsMaille[11];
}
ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
- NoeudsMaille[2], NoeudsMaille[3],
- NoeudsMaille[4], NoeudsMaille[5],
- NoeudsMaille[6], NoeudsMaille[7],
- intNumMaille);
+ NoeudsMaille[2], NoeudsMaille[3],
+ NoeudsMaille[4], NoeudsMaille[5],
+ NoeudsMaille[6], NoeudsMaille[7],
+ intNumMaille);
break;
case 304:
case 310:
ValDegre = 10;
nbNoeuds = 4;
if (ValElement == 310)
- NoeudsMaille[3] = NoeudsMaille[6];
+ NoeudsMaille[3] = NoeudsMaille[6];
ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
- NoeudsMaille[2], NoeudsMaille[3],
- intNumMaille);
+ NoeudsMaille[2], NoeudsMaille[3],
+ intNumMaille);
break;
case 306:
case 315:
ValDegre = 12;
nbNoeuds = 8;
if (ValElement == 315) {
- NoeudsMaille[3] = NoeudsMaille[6];
- NoeudsMaille[4] = NoeudsMaille[7];
- NoeudsMaille[5] = NoeudsMaille[8];
+ NoeudsMaille[3] = NoeudsMaille[6];
+ NoeudsMaille[4] = NoeudsMaille[7];
+ NoeudsMaille[5] = NoeudsMaille[8];
}
NoeudsMaille[7] = NoeudsMaille[5];
NoeudsMaille[6] = NoeudsMaille[5];
NoeudsMaille[4] = NoeudsMaille[3];
NoeudsMaille[3] = NoeudsMaille[2];
ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
- NoeudsMaille[2], NoeudsMaille[3],
- NoeudsMaille[4], NoeudsMaille[5],
- intNumMaille);
- break;
+ NoeudsMaille[2], NoeudsMaille[3],
+ NoeudsMaille[4], NoeudsMaille[5],
+ intNumMaille);
+ break;
}
}
/****************************************************************************
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERDAT_R_SMDS_MESH
#define _INCLUDE_DRIVERDAT_R_SMDS_MESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverDAT_R_SMESHDS_Document.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERDAT_R_SMESHDS_DOCUMENT
#define _INCLUDE_DRIVERDAT_R_SMESHDS_DOCUMENT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverDAT_R_SMESHDS_Mesh.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERDAT_R_SMESHDS_MESH
#define _INCLUDE_DRIVERDAT_R_SMESHDS_MESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include <stdio.h>
#include "DriverDAT_W_SMDS_Mesh.h"
fprintf(stdout, "(************************)\n");
SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator();
- while(itNodes->more()){
+ while(itNodes->more()){
const SMDS_MeshNode * node = itNodes->next();
fprintf(aFileId, "%d %e %e %e\n", node->GetID(), node->X(), node->Y(), node->Z());
}
-
+
/****************************************************************************
* ECRITURE DES ELEMENTS *
****************************************************************************/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH DriverDAT : driver to read and write 'dat' files
// File : DriverDAT_W_SMDS_Mesh.h
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverDAT_W_SMESHDS_Document.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERDAT_W_SMESHDS_DOCUMENT
#define _INCLUDE_DRIVERDAT_W_SMESHDS_DOCUMENT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverDAT_W_SMESHDS_Mesh.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH DriverDAT : driver to read and write 'dat' files
// File : DriverDAT_W_SMESHDS_Mesh.h
// Module : SMESH
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH DriverDAT : driver to read and write 'dat' files
# File : Makefile.in
# Author : Marc Tajchman (CEA)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_DriverDAT.hxx
// Author : Alexander A. BORODIN
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH DriverMED : tool to split groups on families
// File : DriverMED_Family.cxx
// Author : Julia DOROVSKIKH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH DriverMED : tool to split groups on families
// File : DriverMED_Family.hxx
// Author : Julia DOROVSKIKH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverMED_R_SMDS_Mesh.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERMED_R_SMDS_MESH
#define _INCLUDE_DRIVERMED_R_SMDS_MESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverMED_R_SMESHDS_Document.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERMED_R_SMESHDS_DOCUMENT
#define _INCLUDE_DRIVERMED_R_SMESHDS_DOCUMENT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH DriverMED : driver to read and write 'med' files
// File : DriverMED_R_SMESHDS_Mesh.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH DriverMED : driver to read and write 'med' files
// File : DriverMED_R_SMESHDS_Mesh.h
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverMED_W_SMDS_Mesh.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERMED_W_SMDS_MESH
#define _INCLUDE_DRIVERMED_W_SMDS_MESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH DriverMED : driver to read and write 'med' files
// File : DriverMED_W_SMESHDS_Document.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERMED_W_SMESHDS_DOCUMENT
#define _INCLUDE_DRIVERMED_W_SMESHDS_DOCUMENT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH DriverMED : driver to read and write 'med' files
// File : DriverMED_W_SMESHDS_Mesh.cxx
// Module : SMESH
}
}
- SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
+ SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator(/*idInceasingOrder=*/true);
switch(aMeshDimension){
case 3:
aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXYZGetCoord,aXYZName));
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH DriverMED : driver to read and write 'med' files
// File : DriverMED_W_SMESHDS_Mesh.h
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverMED_R_SMESHDS_Mesh.h"
#include "DriverMED_W_SMESHDS_Mesh.h"
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH DriverMED : driver to read and write 'med' files
# File : Makefile.in
# Author : Marc Tajchman (CEA)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_DriverMED.hxx
// Author : Alexander A. BORODIN
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include <stdio.h>
#include <gp_Pnt.hxx>
//=======================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERSTL_R_SMDS_MESH
#define _INCLUDE_DRIVERSTL_R_SMDS_MESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include <stdio.h>
#include "DriverSTL_W_SMDS_Mesh.h"
// static methods
static void writeInteger( const Standard_Integer& theVal,
- OSD_File& ofile )
+ OSD_File& ofile )
{
union {
Standard_Integer i;
}
static void writeFloat ( const Standard_ShortReal& theVal,
- OSD_File& ofile)
+ OSD_File& ofile)
{
union {
Standard_ShortReal f;
SMDS_ElemIteratorPtr aNodeIter = aFace->nodesIterator();
for (; aNodeIter->more(); ) {
- SMDS_MeshNode* node = (SMDS_MeshNode*)aNodeIter->next();
+ SMDS_MeshNode* node = (SMDS_MeshNode*)aNodeIter->next();
buf += " vertex ";
sprintf (sval,"% 12e",node->X());
buf += sval;
SMDS_ElemIteratorPtr aNodeIter = aFace->nodesIterator();
for (; aNodeIter->more(); ) {
- SMDS_MeshNode* node = (SMDS_MeshNode*)aNodeIter->next();
- writeFloat(node->X(),aFile);
- writeFloat(node->Y(),aFile);
- writeFloat(node->Z(),aFile);
+ SMDS_MeshNode* node = (SMDS_MeshNode*)aNodeIter->next();
+ writeFloat(node->X(),aFile);
+ writeFloat(node->Y(),aFile);
+ writeFloat(node->Z(),aFile);
}
aFile.Write (&dum,2);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH DriverSTL : driver to read and write 'stl' files
// File : DriverSTL_W_SMDS_Mesh.h
// Module : SMESH
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH DriverSTL : driver to read and write 'stl' files
# File : Makefile.in
# Author : Marc Tajchman (CEA)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_DriverSTL.hxx
// Author : Alexander A. BORODIN
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
//#include "DriverSTL_R_SMDS_Mesh.h"
//
#include "DriverSTL_W_SMDS_Mesh.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverUNV_R_SMDS_Mesh.h"
#include "SMDS_Mesh.hxx"
#include "SMDS_MeshGroup.hxx"
if(MYDEBUG) MESSAGE("Perform - aDataSet2411.size() = "<<aDataSet2411.size());
TDataSet::const_iterator anIter = aDataSet2411.begin();
for(; anIter != aDataSet2411.end(); anIter++){
- const TNodeLab& aLabel = anIter->first;
- const TRecord& aRec = anIter->second;
- myMesh->AddNodeWithID(aRec.coord[0],aRec.coord[1],aRec.coord[2],aLabel);
+ const TNodeLab& aLabel = anIter->first;
+ const TRecord& aRec = anIter->second;
+ myMesh->AddNodeWithID(aRec.coord[0],aRec.coord[1],aRec.coord[2],aLabel);
}
}
{
TDataSet::const_iterator anIter = aDataSet2412.begin();
if(MYDEBUG) MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
for(; anIter != aDataSet2412.end(); anIter++){
- SMDS_MeshElement* anElement = NULL;
- const TElementLab& aLabel = anIter->first;
- const TRecord& aRec = anIter->second;
- if(IsBeam(aRec.fe_descriptor_id)) {
+ SMDS_MeshElement* anElement = NULL;
+ const TElementLab& aLabel = anIter->first;
+ const TRecord& aRec = anIter->second;
+ if(IsBeam(aRec.fe_descriptor_id)) {
switch ( aRec.node_labels.size() ) {
case 2: // edge with two nodes
anElement = myMesh->AddEdgeWithID(aRec.node_labels[0],
aRec.node_labels[1],
aLabel);
}
- }
+ }
else if(IsFace(aRec.fe_descriptor_id)) {
- switch(aRec.fe_descriptor_id){
- case 71: // TRI3
- case 72:
- case 74:
-
- case 41: // Plane Stress Linear Triangle - TRI3
- case 91: // Thin Shell Linear Triangle - TRI3
- anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
- aRec.node_labels[1],
- aRec.node_labels[2],
- aLabel);
- break;
-
- case 42: // Plane Stress Quadratic Triangle - TRI6
- case 92: // Thin Shell Quadratic Triangle - TRI6
- anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
- aRec.node_labels[2],
- aRec.node_labels[4],
- aRec.node_labels[1],
- aRec.node_labels[3],
- aRec.node_labels[5],
- aLabel);
- break;
-
- case 44: // Plane Stress Linear Quadrilateral - QUAD4
- case 94: // Thin Shell Linear Quadrilateral - QUAD4
- anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
- aRec.node_labels[1],
- aRec.node_labels[2],
- aRec.node_labels[3],
- aLabel);
- break;
-
- case 45: // Plane Stress Quadratic Quadrilateral - QUAD8
- case 95: // Thin Shell Quadratic Quadrilateral - QUAD8
- anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
- aRec.node_labels[2],
- aRec.node_labels[4],
- aRec.node_labels[6],
- aRec.node_labels[1],
- aRec.node_labels[3],
- aRec.node_labels[5],
- aRec.node_labels[7],
- aLabel);
- break;
- }
- }
+ switch(aRec.fe_descriptor_id){
+ case 71: // TRI3
+ case 72:
+ case 74:
+
+ case 41: // Plane Stress Linear Triangle - TRI3
+ case 91: // Thin Shell Linear Triangle - TRI3
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[1],
+ aRec.node_labels[2],
+ aLabel);
+ break;
+
+ case 42: // Plane Stress Quadratic Triangle - TRI6
+ case 92: // Thin Shell Quadratic Triangle - TRI6
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[4],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aRec.node_labels[5],
+ aLabel);
+ break;
+
+ case 44: // Plane Stress Linear Quadrilateral - QUAD4
+ case 94: // Thin Shell Linear Quadrilateral - QUAD4
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[1],
+ aRec.node_labels[2],
+ aRec.node_labels[3],
+ aLabel);
+ break;
+
+ case 45: // Plane Stress Quadratic Quadrilateral - QUAD8
+ case 95: // Thin Shell Quadratic Quadrilateral - QUAD8
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[4],
+ aRec.node_labels[6],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aRec.node_labels[5],
+ aRec.node_labels[7],
+ aLabel);
+ break;
+ }
+ }
else if(IsVolume(aRec.fe_descriptor_id)){
- switch(aRec.fe_descriptor_id){
-
- case 111: // Solid Linear Tetrahedron - TET4
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[2],
- aRec.node_labels[1],
- aRec.node_labels[3],
- aLabel);
- break;
+ switch(aRec.fe_descriptor_id){
+
+ case 111: // Solid Linear Tetrahedron - TET4
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aLabel);
+ break;
- case 118: // Solid Quadratic Tetrahedron - TET10
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[4],
- aRec.node_labels[2],
+ case 118: // Solid Quadratic Tetrahedron - TET10
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[4],
+ aRec.node_labels[2],
- aRec.node_labels[9],
+ aRec.node_labels[9],
- aRec.node_labels[5],
- aRec.node_labels[3],
+ aRec.node_labels[5],
+ aRec.node_labels[3],
aRec.node_labels[1],
aRec.node_labels[6],
- aRec.node_labels[8],
- aRec.node_labels[7],
- aLabel);
- break;
-
- case 112: // Solid Linear Prism - PRISM6
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[2],
- aRec.node_labels[1],
- aRec.node_labels[3],
- aRec.node_labels[5],
- aRec.node_labels[4],
- aLabel);
- break;
-
- case 113: // Solid Quadratic Prism - PRISM15
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[4],
- aRec.node_labels[2],
+ aRec.node_labels[8],
+ aRec.node_labels[7],
+ aLabel);
+ break;
+
+ case 112: // Solid Linear Prism - PRISM6
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aRec.node_labels[5],
+ aRec.node_labels[4],
+ aLabel);
+ break;
+
+ case 113: // Solid Quadratic Prism - PRISM15
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[4],
+ aRec.node_labels[2],
- aRec.node_labels[9],
- aRec.node_labels[13],
- aRec.node_labels[11],
+ aRec.node_labels[9],
+ aRec.node_labels[13],
+ aRec.node_labels[11],
- aRec.node_labels[5],
- aRec.node_labels[3],
+ aRec.node_labels[5],
+ aRec.node_labels[3],
aRec.node_labels[1],
- aRec.node_labels[14],
- aRec.node_labels[12],
+ aRec.node_labels[14],
+ aRec.node_labels[12],
aRec.node_labels[10],
aRec.node_labels[6],
- aRec.node_labels[8],
- aRec.node_labels[7],
- aLabel);
- break;
-
- case 115: // Solid Linear Brick - HEX8
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[3],
- aRec.node_labels[2],
- aRec.node_labels[1],
- aRec.node_labels[4],
- aRec.node_labels[7],
- aRec.node_labels[6],
- aRec.node_labels[5],
- aLabel);
- break;
+ aRec.node_labels[8],
+ aRec.node_labels[7],
+ aLabel);
+ break;
+
+ case 115: // Solid Linear Brick - HEX8
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[3],
+ aRec.node_labels[2],
+ aRec.node_labels[1],
+ aRec.node_labels[4],
+ aRec.node_labels[7],
+ aRec.node_labels[6],
+ aRec.node_labels[5],
+ aLabel);
+ break;
- case 116: // Solid Quadratic Brick - HEX20
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[6],
- aRec.node_labels[4],
- aRec.node_labels[2],
+ case 116: // Solid Quadratic Brick - HEX20
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[6],
+ aRec.node_labels[4],
+ aRec.node_labels[2],
- aRec.node_labels[12],
- aRec.node_labels[18],
- aRec.node_labels[16],
- aRec.node_labels[14],
+ aRec.node_labels[12],
+ aRec.node_labels[18],
+ aRec.node_labels[16],
+ aRec.node_labels[14],
- aRec.node_labels[7],
- aRec.node_labels[5],
- aRec.node_labels[3],
- aRec.node_labels[1],
+ aRec.node_labels[7],
+ aRec.node_labels[5],
+ aRec.node_labels[3],
+ aRec.node_labels[1],
- aRec.node_labels[19],
- aRec.node_labels[17],
- aRec.node_labels[15],
+ aRec.node_labels[19],
+ aRec.node_labels[17],
+ aRec.node_labels[15],
aRec.node_labels[13],
aRec.node_labels[8],
- aRec.node_labels[11],
- aRec.node_labels[10],
- aRec.node_labels[9],
- aLabel);
- break;
+ aRec.node_labels[11],
+ aRec.node_labels[10],
+ aRec.node_labels[9],
+ aLabel);
+ break;
- case 114: // pyramid of 13 nodes (quadratic) - PIRA13
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[6],
- aRec.node_labels[4],
- aRec.node_labels[2],
- aRec.node_labels[7],
- aRec.node_labels[5],
- aRec.node_labels[3],
- aRec.node_labels[1],
+ case 114: // pyramid of 13 nodes (quadratic) - PIRA13
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[6],
+ aRec.node_labels[4],
+ aRec.node_labels[2],
+ aRec.node_labels[7],
+ aRec.node_labels[5],
+ aRec.node_labels[3],
+ aRec.node_labels[1],
- aRec.node_labels[8],
- aRec.node_labels[11],
- aRec.node_labels[10],
- aRec.node_labels[9],
- aRec.node_labels[12],
- aLabel);
- break;
+ aRec.node_labels[8],
+ aRec.node_labels[11],
+ aRec.node_labels[10],
+ aRec.node_labels[9],
+ aRec.node_labels[12],
+ aLabel);
+ break;
- }
- }
- // if(!anElement)
- // MESSAGE("DriverUNV_R_SMDS_Mesh::Perform - can not add element with ID = "<<aLabel<<" and type = "<<aRec.fe_descriptor_id);
+ }
+ }
+ // if(!anElement)
+ // MESSAGE("DriverUNV_R_SMDS_Mesh::Perform - can not add element with ID = "<<aLabel<<" and type = "<<aRec.fe_descriptor_id);
}
}
{
UNV2417::Read(in_stream,aDataSet2417);
if(MYDEBUG) MESSAGE("Perform - aDataSet2417.size() = "<<aDataSet2417.size());
if (aDataSet2417.size() > 0) {
- myGroup = new SMDS_MeshGroup(myMesh);
- TDataSet::const_iterator anIter = aDataSet2417.begin();
- for(; anIter != aDataSet2417.end(); anIter++){
- const TGroupId& aLabel = anIter->first;
- const TRecord& aRec = anIter->second;
+ myGroup = new SMDS_MeshGroup(myMesh);
+ TDataSet::const_iterator anIter = aDataSet2417.begin();
+ for(; anIter != aDataSet2417.end(); anIter++){
+ const TGroupId& aLabel = anIter->first;
+ const TRecord& aRec = anIter->second;
- int aNodesNb = aRec.NodeList.size();
- int aElementsNb = aRec.ElementList.size();
+ int aNodesNb = aRec.NodeList.size();
+ int aElementsNb = aRec.ElementList.size();
- bool useSuffix = ((aNodesNb > 0) && (aElementsNb > 0));
- int i;
- if (aNodesNb > 0) {
- SMDS_MeshGroup* aNodesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Node);
- std::string aGrName = (useSuffix) ? aRec.GroupName + "_Nodes" : aRec.GroupName;
- int i = aGrName.find( "\r" );
- if (i > 0)
- aGrName.erase (i, 2);
- myGroupNames.insert(TGroupNamesMap::value_type(aNodesGroup, aGrName));
- myGroupId.insert(TGroupIdMap::value_type(aNodesGroup, aLabel));
+ bool useSuffix = ((aNodesNb > 0) && (aElementsNb > 0));
+ int i;
+ if (aNodesNb > 0) {
+ SMDS_MeshGroup* aNodesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Node);
+ std::string aGrName = (useSuffix) ? aRec.GroupName + "_Nodes" : aRec.GroupName;
+ int i = aGrName.find( "\r" );
+ if (i > 0)
+ aGrName.erase (i, 2);
+ myGroupNames.insert(TGroupNamesMap::value_type(aNodesGroup, aGrName));
+ myGroupId.insert(TGroupIdMap::value_type(aNodesGroup, aLabel));
- for (i = 0; i < aNodesNb; i++) {
- const SMDS_MeshNode* aNode = myMesh->FindNode(aRec.NodeList[i]);
- if (aNode)
- aNodesGroup->Add(aNode);
- }
- }
- if (aElementsNb > 0){
- SMDS_MeshGroup* aEdgesGroup = 0;
- SMDS_MeshGroup* aFacesGroup = 0;
- SMDS_MeshGroup* aVolumeGroup = 0;
- bool createdGroup = false;
+ for (i = 0; i < aNodesNb; i++) {
+ const SMDS_MeshNode* aNode = myMesh->FindNode(aRec.NodeList[i]);
+ if (aNode)
+ aNodesGroup->Add(aNode);
+ }
+ }
+ if (aElementsNb > 0){
+ SMDS_MeshGroup* aEdgesGroup = 0;
+ SMDS_MeshGroup* aFacesGroup = 0;
+ SMDS_MeshGroup* aVolumeGroup = 0;
+ bool createdGroup = false;
- for (i = 0; i < aElementsNb; i++) {
- const SMDS_MeshElement* aElement = myMesh->FindElement(aRec.ElementList[i]);
- if (aElement) {
- switch (aElement->GetType()) {
- case SMDSAbs_Edge:
- if (!aEdgesGroup) {
- aEdgesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Edge);
- if (!useSuffix && createdGroup) useSuffix = true;
- std::string aEdgesGrName = (useSuffix) ? aRec.GroupName + "_Edges" : aRec.GroupName;
- int i = aEdgesGrName.find( "\r" );
- if (i > 0)
- aEdgesGrName.erase (i, 2);
- myGroupNames.insert(TGroupNamesMap::value_type(aEdgesGroup, aEdgesGrName));
- myGroupId.insert(TGroupIdMap::value_type(aEdgesGroup, aLabel));
- createdGroup = true;
- }
- aEdgesGroup->Add(aElement);
- break;
- case SMDSAbs_Face:
- if (!aFacesGroup) {
- aFacesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Face);
- if (!useSuffix && createdGroup) useSuffix = true;
- std::string aFacesGrName = (useSuffix) ? aRec.GroupName + "_Faces" : aRec.GroupName;
- int i = aFacesGrName.find( "\r" );
- if (i > 0)
- aFacesGrName.erase (i, 2);
- myGroupNames.insert(TGroupNamesMap::value_type(aFacesGroup, aFacesGrName));
- myGroupId.insert(TGroupIdMap::value_type(aFacesGroup, aLabel));
- createdGroup = true;
- }
- aFacesGroup->Add(aElement);
- break;
- case SMDSAbs_Volume:
- if (!aVolumeGroup) {
- aVolumeGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Volume);
- if (!useSuffix && createdGroup) useSuffix = true;
- std::string aVolumeGrName = (useSuffix) ? aRec.GroupName + "_Volumes" : aRec.GroupName;
- int i = aVolumeGrName.find( "\r" );
- if (i > 0)
- aVolumeGrName.erase (i, 2);
- myGroupNames.insert(TGroupNamesMap::value_type(aVolumeGroup, aVolumeGrName));
- myGroupId.insert(TGroupIdMap::value_type(aVolumeGroup, aLabel));
- createdGroup = true;
- }
- aVolumeGroup->Add(aElement);
- break;
- }
- }
- }
- }
- }
+ for (i = 0; i < aElementsNb; i++) {
+ const SMDS_MeshElement* aElement = myMesh->FindElement(aRec.ElementList[i]);
+ if (aElement) {
+ switch (aElement->GetType()) {
+ case SMDSAbs_Edge:
+ if (!aEdgesGroup) {
+ aEdgesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Edge);
+ if (!useSuffix && createdGroup) useSuffix = true;
+ std::string aEdgesGrName = (useSuffix) ? aRec.GroupName + "_Edges" : aRec.GroupName;
+ int i = aEdgesGrName.find( "\r" );
+ if (i > 0)
+ aEdgesGrName.erase (i, 2);
+ myGroupNames.insert(TGroupNamesMap::value_type(aEdgesGroup, aEdgesGrName));
+ myGroupId.insert(TGroupIdMap::value_type(aEdgesGroup, aLabel));
+ createdGroup = true;
+ }
+ aEdgesGroup->Add(aElement);
+ break;
+ case SMDSAbs_Face:
+ if (!aFacesGroup) {
+ aFacesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Face);
+ if (!useSuffix && createdGroup) useSuffix = true;
+ std::string aFacesGrName = (useSuffix) ? aRec.GroupName + "_Faces" : aRec.GroupName;
+ int i = aFacesGrName.find( "\r" );
+ if (i > 0)
+ aFacesGrName.erase (i, 2);
+ myGroupNames.insert(TGroupNamesMap::value_type(aFacesGroup, aFacesGrName));
+ myGroupId.insert(TGroupIdMap::value_type(aFacesGroup, aLabel));
+ createdGroup = true;
+ }
+ aFacesGroup->Add(aElement);
+ break;
+ case SMDSAbs_Volume:
+ if (!aVolumeGroup) {
+ aVolumeGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Volume);
+ if (!useSuffix && createdGroup) useSuffix = true;
+ std::string aVolumeGrName = (useSuffix) ? aRec.GroupName + "_Volumes" : aRec.GroupName;
+ int i = aVolumeGrName.find( "\r" );
+ if (i > 0)
+ aVolumeGrName.erase (i, 2);
+ myGroupNames.insert(TGroupNamesMap::value_type(aVolumeGroup, aVolumeGrName));
+ myGroupId.insert(TGroupIdMap::value_type(aVolumeGroup, aLabel));
+ createdGroup = true;
+ }
+ aVolumeGroup->Add(aElement);
+ break;
+ }
+ }
+ }
+ }
+ }
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERUNV_R_SMDS_MESH
#define _INCLUDE_DRIVERUNV_R_SMDS_MESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverUNV_R_SMESHDS_Document.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERUNV_R_SMESHDS_DOCUMENT
#define _INCLUDE_DRIVERUNV_R_SMESHDS_DOCUMENT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverUNV_R_SMESHDS_Mesh.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERUNV_R_SMESHDS_MESH
#define _INCLUDE_DRIVERUNV_R_SMESHDS_MESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include <algorithm>
#include "DriverUNV_W_SMDS_Mesh.h"
typedef std::vector<size_t> TConnect;
int GetConnect(const SMDS_ElemIteratorPtr& theNodesIter,
- TConnect& theConnect)
+ TConnect& theConnect)
{
theConnect.clear();
for(; theNodesIter->more();){
MESSAGE("Perform - myMesh->NbNodes() = "<<myMesh->NbNodes());
SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
for(; aNodesIter->more();){
- const SMDS_MeshNode* aNode = aNodesIter->next();
- TRecord aRec;
- aRec.coord[0] = aNode->X();
- aRec.coord[1] = aNode->Y();
- aRec.coord[2] = aNode->Z();
- const TNodeLab& aLabel = aNode->GetID();
- aDataSet2411.insert(TDataSet::value_type(aLabel,aRec));
+ const SMDS_MeshNode* aNode = aNodesIter->next();
+ TRecord aRec;
+ aRec.coord[0] = aNode->X();
+ aRec.coord[1] = aNode->Y();
+ aRec.coord[2] = aNode->Z();
+ const TNodeLab& aLabel = aNode->GetID();
+ aDataSet2411.insert(TDataSet::value_type(aLabel,aRec));
}
MESSAGE("Perform - aDataSet2411.size() = "<<aDataSet2411.size());
UNV2411::Write(out_stream,aDataSet2411);
// Storing SMDS Edges
MESSAGE("Perform - myMesh->NbEdges() = "<<myMesh->NbEdges());
if(myMesh->NbEdges()){
- SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
- for(; anIter->more();){
- const SMDS_MeshEdge* anElem = anIter->next();
- TElementLab aLabel = anElem->GetID();
- int aNbNodes = anElem->NbNodes();
- TRecord aRec;
- aRec.node_labels.reserve(aNbNodes);
- SMDS_ElemIteratorPtr aNodesIter;
+ SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
+ for(; anIter->more();){
+ const SMDS_MeshEdge* anElem = anIter->next();
+ TElementLab aLabel = anElem->GetID();
+ int aNbNodes = anElem->NbNodes();
+ TRecord aRec;
+ aRec.node_labels.reserve(aNbNodes);
+ SMDS_ElemIteratorPtr aNodesIter;
if( anElem->IsQuadratic() ) {
aNodesIter = static_cast<const SMDS_QuadraticEdge* >
( anElem )->interlacedNodesElemIterator();
aNodesIter = anElem->nodesIterator();
aRec.fe_descriptor_id = 11;
}
- for(; aNodesIter->more();){
- const SMDS_MeshElement* aNode = aNodesIter->next();
- aRec.node_labels.push_back(aNode->GetID());
- }
- aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
- }
- MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
+ for(; aNodesIter->more();){
+ const SMDS_MeshElement* aNode = aNodesIter->next();
+ aRec.node_labels.push_back(aNode->GetID());
+ }
+ aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
+ }
+ MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
}
MESSAGE("Perform - myMesh->NbFaces() = "<<myMesh->NbFaces());
if(myMesh->NbFaces()){
- SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
- for(; anIter->more();){
- const SMDS_MeshFace* anElem = anIter->next();
- TElementLab aLabel = anElem->GetID();
- int aNbNodes = anElem->NbNodes();
- TRecord aRec;
- aRec.node_labels.reserve(aNbNodes);
- SMDS_ElemIteratorPtr aNodesIter;
+ SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
+ for(; anIter->more();){
+ const SMDS_MeshFace* anElem = anIter->next();
+ TElementLab aLabel = anElem->GetID();
+ int aNbNodes = anElem->NbNodes();
+ TRecord aRec;
+ aRec.node_labels.reserve(aNbNodes);
+ SMDS_ElemIteratorPtr aNodesIter;
if( anElem->IsQuadratic() )
aNodesIter = static_cast<const SMDS_QuadraticFaceOfNodes* >
( anElem )->interlacedNodesElemIterator();
else
aNodesIter = anElem->nodesIterator();
- for(; aNodesIter->more();){
- const SMDS_MeshElement* aNode = aNodesIter->next();
- aRec.node_labels.push_back(aNode->GetID());
- }
- switch(aNbNodes){
- case 3:
- aRec.fe_descriptor_id = 41;
- break;
- case 4:
- aRec.fe_descriptor_id = 44;
- break;
- case 6:
- aRec.fe_descriptor_id = 42;
- break;
- case 8:
- aRec.fe_descriptor_id = 45;
- break;
- default:
- continue;
- }
- aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
- }
- MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
+ for(; aNodesIter->more();){
+ const SMDS_MeshElement* aNode = aNodesIter->next();
+ aRec.node_labels.push_back(aNode->GetID());
+ }
+ switch(aNbNodes){
+ case 3:
+ aRec.fe_descriptor_id = 41;
+ break;
+ case 4:
+ aRec.fe_descriptor_id = 44;
+ break;
+ case 6:
+ aRec.fe_descriptor_id = 42;
+ break;
+ case 8:
+ aRec.fe_descriptor_id = 45;
+ break;
+ default:
+ continue;
+ }
+ aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
+ }
+ MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
}
MESSAGE("Perform - myMesh->NbVolumes() = "<<myMesh->NbVolumes());
if(myMesh->NbVolumes()){
- SMDS_VolumeIteratorPtr anIter = myMesh->volumesIterator();
- for(; anIter->more();){
- const SMDS_MeshVolume* anElem = anIter->next();
- TElementLab aLabel = anElem->GetID();
+ SMDS_VolumeIteratorPtr anIter = myMesh->volumesIterator();
+ for(; anIter->more();){
+ const SMDS_MeshVolume* anElem = anIter->next();
+ TElementLab aLabel = anElem->GetID();
- int aNbNodes = anElem->NbNodes();
- SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
+ int aNbNodes = anElem->NbNodes();
+ SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
if ( anElem->IsPoly() ) {
if ( const SMDS_PolyhedralVolumeOfNodes* ph =
dynamic_cast<const SMDS_PolyhedralVolumeOfNodes*> (anElem))
aNodesIter = ph->uniqueNodesIterator();
}
}
- aConnect.resize(aNbNodes);
- GetConnect(aNodesIter,aConnect);
+ aConnect.resize(aNbNodes);
+ GetConnect(aNodesIter,aConnect);
- int anId = -1;
- int* aConn = NULL;
- switch(aNbNodes){
- case 4: {
- static int anIds[] = {0,2,1,3};
- aConn = anIds;
- anId = 111;
- break;
- }
- case 6: {
- static int anIds[] = {0,2,1,3,5,4};
- aConn = anIds;
- anId = 112;
- break;
- }
- case 8: {
- static int anIds[] = {0,3,2,1,4,7,6,5};
- aConn = anIds;
- anId = 115;
- break;
- }
- case 10: {
- static int anIds[] = {0,4,2,9,5,3, 1,6,8, 7};
- aConn = anIds;
- anId = 118;
- break;
- }
- case 13: {
- static int anIds[] = {0,6,4,2,7,5,3,1,8,11,10,9,12};
- aConn = anIds;
- anId = 114;
- break;
- }
- case 15: {
- static int anIds[] = {0,4,2,9,13,11,5,3,1,14,12,10,6,8,7};
- aConn = anIds;
- anId = 113;
- break;
- }
- case 20: {
- static int anIds[] = {0,6, 4,2, 12,18,16,14,7, 5, 3, 1, 19,17,15,13,8, 11,10,9};
- aConn = anIds;
- anId = 116;
- break;
- }
- default:
- continue;
- }
- if(aConn){
- TRecord aRec;
- aRec.fe_descriptor_id = anId;
- aRec.node_labels.resize(aNbNodes);
- for(int aNodeId = 0; aNodeId < aNbNodes; aNodeId++){
- aRec.node_labels[aConn[aNodeId]] = aConnect[aNodeId];
- }
- aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
- }
- }
- MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
+ int anId = -1;
+ int* aConn = NULL;
+ switch(aNbNodes){
+ case 4: {
+ static int anIds[] = {0,2,1,3};
+ aConn = anIds;
+ anId = 111;
+ break;
+ }
+ case 6: {
+ static int anIds[] = {0,2,1,3,5,4};
+ aConn = anIds;
+ anId = 112;
+ break;
+ }
+ case 8: {
+ static int anIds[] = {0,3,2,1,4,7,6,5};
+ aConn = anIds;
+ anId = 115;
+ break;
+ }
+ case 10: {
+ static int anIds[] = {0,4,2,9,5,3, 1,6,8, 7};
+ aConn = anIds;
+ anId = 118;
+ break;
+ }
+ case 13: {
+ static int anIds[] = {0,6,4,2,7,5,3,1,8,11,10,9,12};
+ aConn = anIds;
+ anId = 114;
+ break;
+ }
+ case 15: {
+ static int anIds[] = {0,4,2,9,13,11,5,3,1,14,12,10,6,8,7};
+ aConn = anIds;
+ anId = 113;
+ break;
+ }
+ case 20: {
+ static int anIds[] = {0,6, 4,2, 12,18,16,14,7, 5, 3, 1, 19,17,15,13,8, 11,10,9};
+ aConn = anIds;
+ anId = 116;
+ break;
+ }
+ default:
+ continue;
+ }
+ if(aConn){
+ TRecord aRec;
+ aRec.fe_descriptor_id = anId;
+ aRec.node_labels.resize(aNbNodes);
+ for(int aNodeId = 0; aNodeId < aNbNodes; aNodeId++){
+ aRec.node_labels[aConn[aNodeId]] = aConnect[aNodeId];
+ }
+ aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
+ }
+ }
+ MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
}
UNV2412::Write(out_stream,aDataSet2412);
}
{
using namespace UNV2417;
if (myGroups.size() > 0) {
- TDataSet aDataSet2417;
- TGroupList::const_iterator aIter = myGroups.begin();
- for (; aIter != myGroups.end(); aIter++) {
- SMESHDS_GroupBase* aGroupDS = *aIter;
- TRecord aRec;
- aRec.GroupName = aGroupDS->GetStoreName();
+ TDataSet aDataSet2417;
+ TGroupList::const_iterator aIter = myGroups.begin();
+ for (; aIter != myGroups.end(); aIter++) {
+ SMESHDS_GroupBase* aGroupDS = *aIter;
+ TRecord aRec;
+ aRec.GroupName = aGroupDS->GetStoreName();
- int i;
- SMDS_ElemIteratorPtr aIter = aGroupDS->GetElements();
- if (aGroupDS->GetType() == SMDSAbs_Node) {
- aRec.NodeList.resize(aGroupDS->Extent());
- i = 0;
- while (aIter->more()) {
- const SMDS_MeshElement* aElem = aIter->next();
- aRec.NodeList[i] = aElem->GetID();
- i++;
- }
- } else {
- aRec.ElementList.resize(aGroupDS->Extent());
- i = 0;
- while (aIter->more()) {
- const SMDS_MeshElement* aElem = aIter->next();
- aRec.ElementList[i] = aElem->GetID();
- i++;
- }
- }
+ int i;
+ SMDS_ElemIteratorPtr aIter = aGroupDS->GetElements();
+ if (aGroupDS->GetType() == SMDSAbs_Node) {
+ aRec.NodeList.resize(aGroupDS->Extent());
+ i = 0;
+ while (aIter->more()) {
+ const SMDS_MeshElement* aElem = aIter->next();
+ aRec.NodeList[i] = aElem->GetID();
+ i++;
+ }
+ } else {
+ aRec.ElementList.resize(aGroupDS->Extent());
+ i = 0;
+ while (aIter->more()) {
+ const SMDS_MeshElement* aElem = aIter->next();
+ aRec.ElementList[i] = aElem->GetID();
+ i++;
+ }
+ }
// 0019936: EDF 794 SMESH : Export UNV : Node color and group id
- //aDataSet2417.insert(TDataSet::value_type(aGroupDS->GetID(), aRec));
+ //aDataSet2417.insert(TDataSet::value_type(aGroupDS->GetID(), aRec));
aDataSet2417.insert(TDataSet::value_type(aGroupDS->GetID()+1, aRec));
- }
- UNV2417::Write(out_stream,aDataSet2417);
- myGroups.clear();
+ }
+ UNV2417::Write(out_stream,aDataSet2417);
+ myGroups.clear();
}
}
/* {
using namespace UNV2417;
TDataSet aDataSet2417;
for ( TGroupsMap::iterator it = myGroupsMap.begin(); it != myGroupsMap.end(); it++ ) {
- SMESH_Group* aGroup = it->second;
- SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS();
- if ( aGroupDS ) {
- TRecord aRec;
- aRec.GroupName = aGroup->GetName();
- int i;
- SMDS_ElemIteratorPtr aIter = aGroupDS->GetElements();
- if (aGroupDS->GetType() == SMDSAbs_Node) {
- aRec.NodeList.resize(aGroupDS->Extent());
- i = 0;
- while (aIter->more()) {
- const SMDS_MeshElement* aElem = aIter->next();
- aRec.NodeList[i] = aElem->GetID();
- i++;
- }
- } else {
- aRec.ElementList.resize(aGroupDS->Extent());
- i = 0;
- while (aIter->more()) {
- const SMDS_MeshElement* aElem = aIter->next();
- aRec.ElementList[i] = aElem->GetID();
- i++;
- }
- }
- aDataSet2417.insert(TDataSet::value_type(aGroupDS->GetID(), aRec));
- }
+ SMESH_Group* aGroup = it->second;
+ SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS();
+ if ( aGroupDS ) {
+ TRecord aRec;
+ aRec.GroupName = aGroup->GetName();
+ int i;
+ SMDS_ElemIteratorPtr aIter = aGroupDS->GetElements();
+ if (aGroupDS->GetType() == SMDSAbs_Node) {
+ aRec.NodeList.resize(aGroupDS->Extent());
+ i = 0;
+ while (aIter->more()) {
+ const SMDS_MeshElement* aElem = aIter->next();
+ aRec.NodeList[i] = aElem->GetID();
+ i++;
+ }
+ } else {
+ aRec.ElementList.resize(aGroupDS->Extent());
+ i = 0;
+ while (aIter->more()) {
+ const SMDS_MeshElement* aElem = aIter->next();
+ aRec.ElementList[i] = aElem->GetID();
+ i++;
+ }
+ }
+ aDataSet2417.insert(TDataSet::value_type(aGroupDS->GetID(), aRec));
+ }
}
UNV2417::Write(out_stream,aDataSet2417);
}*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERUNV_W_SMDS_MESH
#define _INCLUDE_DRIVERUNV_W_SMDS_MESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverUNV_W_SMESHDS_Document.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERUNV_W_SMESHDS_DOCUMENT
#define _INCLUDE_DRIVERUNV_W_SMESHDS_DOCUMENT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DriverUNV_W_SMESHDS_Mesh.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _INCLUDE_DRIVERUNV_W_SMESHDS_MESH
#define _INCLUDE_DRIVERUNV_W_SMESHDS_MESH
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH DriverUNV : driver to read and write 'unv' files
# File : Makefile.in
# Author : Marc Tajchman (CEA)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_DriverUNV.hxx
// Author : Alexander A. BORODIN
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <fstream>
-#include <stdio.h>
+
+#include <fstream>
+#include <stdio.h>
#include "UNV2411_Structure.hxx"
#include "UNV_Utilities.hxx"
const TRecord& aRec = anIter->second;
char buf[78];
sprintf(buf, "%10d%10d%10d%10d\n",
- aLabel,
- aRec.exp_coord_sys_num,
- aRec.disp_coord_sys_num,
- aRec.color);
+ aLabel,
+ aRec.exp_coord_sys_num,
+ aRec.disp_coord_sys_num,
+ aRec.color);
out_stream<<buf;
// the coordinates
sprintf(buf, "%25.16E%25.16E%25.16E\n",
- aRec.coord[0],
- aRec.coord[1],
- aRec.coord[2]);
+ aRec.coord[0],
+ aRec.coord[1],
+ aRec.coord[2]);
out_stream<<buf;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef UNV2411_Structure_HeaderFile
#define UNV2411_Structure_HeaderFile
#include "SMESH_DriverUNV.hxx"
#include <map>
-#include <fstream>
+#include <fstream>
namespace UNV2411{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <fstream>
+
+#include <fstream>
#include <iomanip>
#include "UNV2412_Structure.hxx"
for(int i = 0, k = 0; i < iEnd; i++){
int jEnd = n_nodes - 8*(i+1);
if(jEnd < 0)
- jEnd = 8 + jEnd;
+ jEnd = 8 + jEnd;
else
- jEnd = 8;
+ jEnd = 8;
for(int j = 0; j < jEnd ; k++, j++){
- out_stream<<std::setw(10)<<aRec.node_labels[k];
+ out_stream<<std::setw(10)<<aRec.node_labels[k];
}
out_stream<<std::endl;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef UNV2412_Structure_HeaderFile
#define UNV2412_Structure_HeaderFile
#include <map>
#include <vector>
-#include <fstream>
+#include <fstream>
namespace UNV2412{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "UNV2417_Structure.hxx"
#include "UNV_Utilities.hxx"
-#include <fstream>
+#include <fstream>
#include <iomanip>
using namespace std;
static string _group_labels[] = {"2417", "2429", "2430", "2432",
- "2435", "2452", "2467", "2477"};
+ "2435", "2452", "2467", "2477"};
#define NBGROUP 8
static string _label_dataset = "2467";
* a "-1" followed by a number means the beginning of a dataset
* stop combing at the end of the file
*/
- while( ((olds != "-1") || (news == "-1") ) && !in_stream.eof() ){
+ while( ((olds != "-1") || (news == "-1") ) && !in_stream.eof() ){
olds = news;
in_stream >> news;
}
return;
for (int i = 0; i < NBGROUP; i++) {
if (news == _group_labels[i]) {
- ReadGroup(news, in_stream, theDataSet);
+ ReadGroup(news, in_stream, theDataSet);
}
}
}
in_stream>>aElType;
in_stream>>aElId;
if ((myGroupLabel.compare("2435") == 0) ||
- (myGroupLabel.compare("2452") == 0) ||
- (myGroupLabel.compare("2467") == 0) ||
- (myGroupLabel.compare("2477") == 0)) {
- in_stream>>aTmp;
- in_stream>>aTmp;
+ (myGroupLabel.compare("2452") == 0) ||
+ (myGroupLabel.compare("2467") == 0) ||
+ (myGroupLabel.compare("2477") == 0)) {
+ in_stream>>aTmp;
+ in_stream>>aTmp;
}
switch (aElType) {
case 7: // Nodes
- aNum = aRec.NodeList.size();
- aRec.NodeList.resize(aNum + 1);
- aRec.NodeList[aNum] = aElId;
- break;
+ aNum = aRec.NodeList.size();
+ aRec.NodeList.resize(aNum + 1);
+ aRec.NodeList[aNum] = aElId;
+ break;
case 8: // Elements
- aNum = aRec.ElementList.size();
- aRec.ElementList.resize(aNum + 1);
- aRec.ElementList[aNum] = aElId;
- break;
+ aNum = aRec.ElementList.size();
+ aRec.ElementList.resize(aNum + 1);
+ aRec.ElementList[aNum] = aElId;
+ break;
}
}
theDataSet.insert(TDataSet::value_type(aId,aRec));
int i;
for (i = 0; i < aNbNodes; i++) {
if (aRow == 2) {
- out_stream<<std::endl;
- aRow = 0;
+ out_stream<<std::endl;
+ aRow = 0;
}
out_stream<<std::setw(10)<<7;
out_stream<<std::setw(10)<<aRec.NodeList[i];
}
for (i = 0; i < aNbElements; i++) {
if (aRow == 2) {
- out_stream<<std::endl;
- aRow = 0;
+ out_stream<<std::endl;
+ aRow = 0;
}
out_stream<<std::setw(10)<<8;
out_stream<<std::setw(10)<<aRec.ElementList[i];
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef UNV2417_Structure_HeaderFile
#define UNV2417_Structure_HeaderFile
#include <map>
#include <vector>
-#include <fstream>
-#include <string>
+#include <fstream>
+#include <string>
namespace UNV2417{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "UNV2411_Structure.hxx"
#include "UNV2412_Structure.hxx"
#include "UNV_Utilities.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "UNV_Utilities.hxx"
using namespace std;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef MED_Utilities_HeaderFile
#define MED_Utilities_HeaderFile
#include "SMESH_DriverUNV.hxx"
-#include <iostream>
-#include <sstream>
+#include <iostream>
+#include <sstream>
#include <fstream>
#include <string>
#include <stdexcept>
* a "-1" followed by a number means the beginning of a dataset
* stop combing at the end of the file
*/
- while( ((olds != "-1") || (news == "-1") ) && !in_file.eof() ){
- olds = news;
- in_file >> news;
+ while( ((olds != "-1") || (news == "-1") ) && !in_file.eof() ){
+ olds = news;
+ in_file >> news;
}
if(in_file.eof())
- return false;
+ return false;
if (news == ds_name)
- return true;
+ return true;
}
// should never end up here
return false;
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author :
# Modified by : Alexander BORODIN (OCN) - autotools usage
bool DansPave( R3 & xyzMin, R3 & xyzMax )
{ return xyzMin.x<=x && x<=xyzMax.x &&
- xyzMin.y<=y && y<=xyzMax.y &&
- xyzMin.z<=z && z<=xyzMax.z; }
+ xyzMin.y<=y && y<=xyzMax.y &&
+ xyzMin.z<=z && z<=xyzMax.z; }
};
//la classe R4
void aptrte( Z nutysu, R aretmx,
- Z nblf, Z * nudslf, R2 * uvslf,
- Z nbpti, R2 * uvpti,
- Z & nbst, R2 * & uvst,
- Z & nbt, Z * & nust,
- Z & ierr )
+ Z nblf, Z * nudslf, R2 * uvslf,
+ Z nbpti, R2 * uvpti,
+ Z & nbst, R2 * & uvst,
+ Z & nbt, Z * & nust,
+ Z & ierr )
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// but : appel de la triangulation par un arbre-4 recouvrant
// ----- de triangles equilateraux
mxsomm = Max( 20000, 64*nbpti+i*i );
MESSAGE( "APTRTE: Debut de la triangulation plane avec " );
MESSAGE( "nutysu=" << nutysu << " aretmx=" << aretmx
- << " mxsomm=" << mxsomm );
+ << " mxsomm=" << mxsomm );
MESSAGE( nbarfr << " sommets sur la frontiere et " << nbpti << " points internes");
NEWDEPART:
mnpxyd[ns0].y = uvslf[ns0].y;
mnpxyd[ns0].z = areteideale();//( mnpxyd[ns0], direction );
// MESSAGE("Sommet " << ns0 << ": " << mnpxyd[ns0].x
-// << " " << mnpxyd[ns0].y << " longueur arete=" << mnpxyd[ns0].z);
+// << " " << mnpxyd[ns0].y << " longueur arete=" << mnpxyd[ns0].z);
//carre de la longueur de l'arete 1 de la ligne fermee n
d = pow( uvslf[ns0+1].x - uvslf[ns0].x, 2 )
//le numero n de la ligne du sommet et son numero ns1 dans la ligne
mnslig[ns0-1] = 1000000 * n + ns1-nudslf[n-1];
fasoar( ns1, ns2, moins1, moins1, n,
- mosoar, mxsoar, n1soar, mnsoar, mnarst,
- noar0, ierr );
+ mosoar, mxsoar, n1soar, mnsoar, mnarst,
+ noar0, ierr );
//pas de test sur ierr car pas de saturation possible a ce niveau
//le pointeur dans le hachage sur la premiere arete de la ligne fermee n
{
ns1 = ns2; //le numero de l'arete et le numero du premier sommet de l'arete
if( i < nbarli )
- //nbs+1 est le 2-eme sommet de l'arete i de la ligne fermee n
- ns2 = ns1+1;
+ //nbs+1 est le 2-eme sommet de l'arete i de la ligne fermee n
+ ns2 = ns1+1;
else
- //le 2-eme sommet de la derniere arete est le premier sommet de la ligne
- ns2 = ns0;
+ //le 2-eme sommet de la derniere arete est le premier sommet de la ligne
+ ns2 = ns0;
//l'arete precedente est dotee de sa suivante:celle cree ensuite
//les 2 coordonnees du sommet ns2 de la ligne
mnpxyd[ns].y = uvslf[ns].y;
mnpxyd[ns].z = areteideale();//( mnpxyd[ns], direction );
// MESSAGE("Sommet " << ns << ": " << mnpxyd[ns].x
-// << " " << mnpxyd[ns].y << " longueur arete=" << mnpxyd[ns].z);
+// << " " << mnpxyd[ns].y << " longueur arete=" << mnpxyd[ns].z);
//carre de la longueur de l'arete
d = pow( uvslf[ns2-1].x - uvslf[ns1-1].x, 2)
//ajout de l'arete dans la liste
fasoar( ns1, ns2, moins1, moins1, n,
- mosoar, mxsoar, n1soar, mnsoar,
- mnarst, noar, ierr );
+ mosoar, mxsoar, n1soar, mnsoar,
+ mnarst, noar, ierr );
//pas de test sur ierr car pas de saturation possible a ce niveau
//chainage des aretes frontalieres en position 6 du tableau mnsoar
MESSAGE("Sur le bord: arete min=" << aremin << " arete max=" << aremax );
MESSAGE("Triangulation: arete mx=" << aretmx
- << " triangle aire mx=" << airemx );
+ << " triangle aire mx=" << airemx );
//chainage des aretes frontalieres : la derniere arete frontaliere
mnsoar[ mosoar * noar - mosoar + 5 ] = 0;
if( mnqueu==NULL) goto ERREUR;
tehote( nutysu, nbarpi, mxsomm, nbsomm, mnpxyd,
- comxmi, aretmx,
- mntree, mxqueu, mnqueu,
- ierr );
+ comxmi, aretmx,
+ mntree, mxqueu, mnqueu,
+ ierr );
deltacpu_( d );
tcpu += d;
// et des points de la frontiere, des points internes imposes interieurs
// ==========================================================================
tetrte( comxmi, aretmx, nbarpi, mxsomm, mnpxyd,
- mxqueu, mnqueu, mntree, mosoar, mxsoar, n1soar, mnsoar,
- moartr, mxartr, n1artr, mnartr, mnarst,
- ierr );
+ mxqueu, mnqueu, mntree, mosoar, mxsoar, n1soar, mnsoar,
+ moartr, mxartr, n1artr, mnartr, mnarst,
+ ierr );
// destruction de la queue et de l'arbre devenus inutiles
delete [] mnqueu; mnqueu=NULL;
//qualites de la triangulation actuelle
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
- nbt, quamoy, quamin );
+ nbt, quamoy, quamin );
// boucle sur les aretes internes (non sur une ligne de la frontiere)
// avec echange des 2 diagonales afin de rendre la triangulation delaunay
// formation du chainage 6 des aretes internes a echanger eventuellement
aisoar( mosoar, mxsoar, mnsoar, na );
tedela( mnpxyd, mnarst,
- mosoar, mxsoar, n1soar, mnsoar, na,
- moartr, mxartr, n1artr, mnartr, n );
+ mosoar, mxsoar, n1soar, mnsoar, na,
+ moartr, mxartr, n1artr, mnartr, n );
MESSAGE( "Nombre d'echanges des diagonales de 2 triangles=" << n );
deltacpu_( d );
//qualites de la triangulation actuelle
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
- nbt, quamoy, quamin );
+ nbt, quamoy, quamin );
// detection des aretes frontalieres initiales perdues
// triangulation frontale pour les restaurer
if( mnarcf2 == NULL ) goto ERREUR;
terefr( nbarpi, mnpxyd,
- mosoar, mxsoar, n1soar, mnsoar,
- moartr, mxartr, n1artr, mnartr, mnarst,
- mxarcf, mn1arcf, mnarcf, mnarcf1, mnarcf2,
- n, ierr );
+ mosoar, mxsoar, n1soar, mnsoar,
+ moartr, mxartr, n1artr, mnartr, mnarst,
+ mxarcf, mn1arcf, mnarcf, mnarcf1, mnarcf2,
+ n, ierr );
MESSAGE( "Restauration de " << n << " aretes perdues de la frontiere ierr=" << ierr );
deltacpu_( d );
//qualites de la triangulation actuelle
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
- nbt, quamoy, quamin );
+ nbt, quamoy, quamin );
// fin de la triangulation avec respect des aretes initiales frontalieres
mnlftr[n] = n+1;
tesuex( nblf, mnlftr,
- ndtri0, nbsomm, mnpxyd, mnslig,
- mosoar, mxsoar, mnsoar,
- moartr, mxartr, n1artr, mnartr, mnarst,
- nbt, mntrsu, ierr );
+ ndtri0, nbsomm, mnpxyd, mnslig,
+ mosoar, mxsoar, mnsoar,
+ moartr, mxartr, n1artr, mnartr, mnarst,
+ nbt, mntrsu, ierr );
delete [] mnlftr; mnlftr=NULL;
delete [] mntrsu; mntrsu=NULL;
//qualites de la triangulation actuelle
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
- nbt, quamoy, quamin );
+ nbt, quamoy, quamin );
// amelioration de la qualite de la triangulation par
// barycentrage des sommets internes a la triangulation
goto ERREUR;
}
teamqt( nutysu, aretmx, airemx,
- mnarst, mosoar, mxsoar, n1soar, mnsoar,
- moartr, mxartr, n1artr, mnartr,
- mxarcf, mnarcf2, mnarcf3,
- mn1arcf, mnarcf, mnarcf1,
- nbarpi, nbsomm, mxsomm, mnpxyd, mnslig,
- ierr );
+ mnarst, mosoar, mxsoar, n1soar, mnsoar,
+ moartr, mxartr, n1artr, mnartr,
+ mxarcf, mnarcf2, mnarcf3,
+ mn1arcf, mnarcf, mnarcf1,
+ nbarpi, nbsomm, mxsomm, mnpxyd, mnslig,
+ ierr );
if( mnarcf3 != NULL ) {delete [] mnarcf3; mnarcf3=NULL;}
if( mn1arcf != NULL ) {delete [] mn1arcf; mn1arcf=NULL;}
if( mnarcf != NULL ) {delete [] mnarcf; mnarcf =NULL;}
//qualites de la triangulation finale
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
- nbt, quamoy, quamin );
+ nbt, quamoy, quamin );
// renumerotation des sommets internes: mnarst(i)=numero final du sommet
// ===================================
n = mnslig[i];
if( n > 0 )
{
- if( n >= 1000000 )
- {
- //sommet d'une ligne
- //retour aux coordonnees initiales dans uvslf
- l = n / 1000000;
- n = n - 1000000 * l + nudslf[l-1] - 1;
- uvst[nbst].x = uvslf[n].x;
- uvst[nbst].y = uvslf[n].y;
- }
- else
- {
- //point utilisateur n interne impose
- //retour aux coordonnees initiales dans uvpti
- uvst[nbst].x = uvpti[n-1].x;
- uvst[nbst].y = uvpti[n-1].y;
- }
+ if( n >= 1000000 )
+ {
+ //sommet d'une ligne
+ //retour aux coordonnees initiales dans uvslf
+ l = n / 1000000;
+ n = n - 1000000 * l + nudslf[l-1] - 1;
+ uvst[nbst].x = uvslf[n].x;
+ uvst[nbst].y = uvslf[n].y;
+ }
+ else
+ {
+ //point utilisateur n interne impose
+ //retour aux coordonnees initiales dans uvpti
+ uvst[nbst].x = uvpti[n-1].x;
+ uvst[nbst].y = uvpti[n-1].y;
+ }
}
}
}
}
nbt /= nbsttria; //le nombre final de triangles de la surface
MESSAGE( "APTRTE: Fin de la triangulation plane avec "<<nbst<<" sommets et "
- << nbt << " triangles" );
+ << nbt << " triangles" );
deltacpu_( d );
tcpu += d;
MESSAGE( "APTRTE: Temps total de la triangulation plane=" << tcpu << " secondes" );
#endif
#endif
qualitetrte( R3 *mnpxyd,
- Z & mosoar, Z & mxsoar, Z *mnsoar,
- Z & moartr, Z & mxartr, Z *mnartr,
- Z & nbtria, R & quamoy, R & quamin )
+ Z & mosoar, Z & mxsoar, Z *mnsoar,
+ Z & moartr, Z & mxartr, Z *mnartr,
+ Z & nbtria, R & quamoy, R & quamin )
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// but : calculer la qualite moyenne et minimale de la triangulation
// ----- actuelle definie par les tableaux mnsoar et mnartr
//la qualite du triangle ns1 ns2 ns3
qutr2d( mnpxyd[nosotr[0]-1], mnpxyd[nosotr[1]-1], mnpxyd[nosotr[2]-1],
- qualite );
+ qualite );
//la qualite moyenne
quamoy += qualite;
d = surtd2( mnpxyd[nosotr[0]-1], mnpxyd[nosotr[1]-1], mnpxyd[nosotr[2]-1] );
if( d<0 )
{
- //un triangle d'aire negative de plus
- nbtrianeg++;
- MESSAGE("ATTENTION: le triangle " << nt << " de sommets:"
- << nosotr[0] << " " << nosotr[1] << " " << nosotr[2]
- << " a une aire " << d <<"<=0");
+ //un triangle d'aire negative de plus
+ nbtrianeg++;
+ MESSAGE("ATTENTION: le triangle " << nt << " de sommets:"
+ << nosotr[0] << " " << nosotr[1] << " " << nosotr[2]
+ << " a une aire " << d <<"<=0");
}
//aire des triangles actuels
<<nosotr[0]<<" "<<nosotr[1]<<" "<<nosotr[2]<<" ");
for (int i=0;i<3;i++)
MESSAGE("Sommet "<<nosotr[i]<<": x="<< mnpxyd[nosotr[i]-1].x
- <<" y="<< mnpxyd[nosotr[i]-1].y);
+ <<" y="<< mnpxyd[nosotr[i]-1].y);
}
if( nbtrianeg>0 )
MEFISTO2D_EXPORT
void aptrte( Z nutysu, R aretmx,
- Z nblf, Z *nudslf, R2 *uvslf,
- Z nbpti, R2 *uvpti,
- Z & nbst, R2 * & uvst, Z & nbt, Z * & nust,
- Z & ierr );
+ Z nblf, Z *nudslf, R2 *uvslf,
+ Z nbpti, R2 *uvpti,
+ Z & nbst, R2 * & uvst, Z & nbt, Z * & nust,
+ Z & ierr );
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// but : appel de la triangulation par un arbre-4 recouvrant
// ----- de triangles equilateraux
#define nusotr NUSOTR
#define qutr2d QUTR2D
#define surtd2 SURTD2
- #define qualitetrte QUALITETRTE
+ #define qualitetrte QUALITETRTE
#define areteideale ARETEIDEALE
#endif
#endif
qualitetrte( R3 *mnpxyd,
- Z & mosoar, Z & mxsoar, Z *mnsoar,
- Z & moartr, Z & mxartr, Z *mnartr,
- Z & nbtria, R & quamoy, R & quamin ); }
+ Z & mosoar, Z & mxsoar, Z *mnsoar,
+ Z & moartr, Z & mxartr, Z *mnartr,
+ Z & nbtria, R & quamoy, R & quamin ); }
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// but : calculer la qualite moyenne et minimale de la triangulation
// ----- actuelle definie par les tableaux nosoar et noartr
#endif
#endif
fasoar( Z & ns1, Z & ns2, Z & nt1, Z & nt2, Z & nolign,
- Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar, Z * mnarst,
- Z & noar, Z & ierr );
+ Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar, Z * mnarst,
+ Z & noar, Z & ierr );
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// but : former l'arete de sommet ns1-ns2 dans le hachage du tableau
#endif
#endif
teajte( Z & mxsomm, Z & nbsomm, R3 * mnpxyd, R3 * comxmi,
- R & aretmx, Z & mxtree, Z * letree,
- Z & ierr );
+ R & aretmx, Z & mxtree, Z * letree,
+ Z & ierr );
}
extern "C" {void
#endif
#endif
tehote( Z & nutysu, Z & nbarpi, Z & mxsomm, Z & nbsomm, R3 * mnpxyd,
- R3 * comxmi, R & aretmx,
- Z * letree, Z & mxqueu, Z * mnqueu,
- Z & ierr );
+ R3 * comxmi, R & aretmx,
+ Z * letree, Z & mxqueu, Z * mnqueu,
+ Z & ierr );
}
// homogeneisation de l'arbre des te a un saut de taille au plus
// prise en compte des tailles d'aretes souhaitees autour des sommets initiaux
#endif
#endif
tetrte( R3 * comxmi, R & aretmx, Z & nbarpi, Z & mxsomm, R3 * mnpxyd,
- Z & mxqueu, Z * mnqueu, Z * mntree,
- Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
- Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z * mnarst,
- Z & ierr );
+ Z & mxqueu, Z * mnqueu, Z * mntree,
+ Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
+ Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z * mnarst,
+ Z & ierr );
}
// trianguler les triangles equilateraux feuilles a partir de leurs 3 sommets
// et des points de la frontiere, des points internes imposes interieurs
#endif
#endif
tedela( R3 * mnpxyd, Z * mnarst,
- Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar, Z & na,
- Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z & n );
+ Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar, Z & na,
+ Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z & n );
}
// boucle sur les aretes internes (non sur une ligne de la frontiere)
// avec echange des 2 diagonales afin de rendre la triangulation delaunay
#endif
#endif
terefr( Z & nbarpi, R3 * mnpxyd,
- Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
- Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z * mnarst,
- Z & mxarcf, Z * mnarc1, Z * mnarc2,
- Z * mnarc3, Z * mnarc4,
- Z & n, Z & ierr );
+ Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
+ Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z * mnarst,
+ Z & mxarcf, Z * mnarc1, Z * mnarc2,
+ Z * mnarc3, Z * mnarc4,
+ Z & n, Z & ierr );
}
// detection des aretes frontalieres initiales perdues
// triangulation frontale pour les restaurer
#endif
#endif
tesuex( Z & nblf, Z * nulftr,
- Z & ndtri0, Z & nbsomm, R3 * mnpxyd, Z * mnslig,
- Z & mosoar, Z & mxsoar, Z * mnsoar,
- Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z * mnarst,
- Z & nbtria, Z * mntrsu, Z & ierr );
+ Z & ndtri0, Z & nbsomm, R3 * mnpxyd, Z * mnslig,
+ Z & mosoar, Z & mxsoar, Z * mnsoar,
+ Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z * mnarst,
+ Z & nbtria, Z * mntrsu, Z & ierr );
}
// suppression des triangles externes a la surface
#endif
#endif
teamqt( Z & nutysu, R & aretmx, R & airemx,
- Z * mnarst, Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
- Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr,
- Z & mxarcf, Z * mntrcf, Z * mnstbo,
- Z * n1arcf, Z * mnarcf, Z * mnarc1,
- Z & nbarpi, Z & nbsomm, Z & mxsomm,
- R3 * mnpxyd, Z * mnslig,
- Z & ierr );
+ Z * mnarst, Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
+ Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr,
+ Z & mxarcf, Z * mntrcf, Z * mnstbo,
+ Z * n1arcf, Z * mnarcf, Z * mnarc1,
+ Z & nbarpi, Z & nbsomm, Z & mxsomm,
+ R3 * mnpxyd, Z * mnslig,
+ Z & ierr );
}
// amelioration de la qualite de la triangulation par
// barycentrage des sommets internes a la triangulation
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Patrick GOLDBRONN (CEA)
# Modified by : Alexander BORODIN (OCN) - autotools usage
OBJECT \
SMESHFiltersSelection \
SMESHGUI \
+ PluginUtils \
SMESH_SWIG_WITHIHM \
StdMeshersGUI
endif
DIST_SUBDIRS = SMDS SMESHDS Controls Driver DriverMED DriverDAT DriverUNV DriverSTL SMESH \
SMESH_I SMESHClient SMESH_SWIG MEFISTO2 StdMeshers StdMeshers_I OBJECT \
- SMESHFiltersSelection SMESHGUI SMESH_SWIG_WITHIHM StdMeshersGUI
+ SMESHFiltersSelection SMESHGUI PluginUtils SMESH_SWIG_WITHIHM StdMeshersGUI
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH OBJECT : interactive object for SMESH visualization
# File : Makefile.in
# Modified by : Alexander BORODIN (OCN) - autotools usage
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH OBJECT : interactive object for SMESH visualization
// File : SMESH_Actor.cxx
// Author : Nicolas REJNERI
// Module : SMESH
-
-
+//
#include "SMESH_ActorDef.h"
#include "SMESH_ActorUtils.h"
#include "SMESH_DeviceActor.h"
#endif
static int aLineWidthInc = 2;
-static int aPointSizeInc = 2;
SMESH_ActorDef* SMESH_ActorDef::New(){
if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
myControlsPrecision = mgr->integerValue( "SMESH", "controls_precision", -1);
- vtkFloatingPointType aPointSize = SMESH::GetFloat("SMESH:node_size",3);
vtkFloatingPointType aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5);
vtkFloatingPointType aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
my1DProp = vtkProperty::New();
my1DProp->DeepCopy(myEdgeProp);
my1DProp->SetLineWidth(aLineWidth + aLineWidthInc);
- my1DProp->SetPointSize(aPointSize);
+ my1DProp->SetPointSize(aElem0DSize);
my1DExtProp = vtkProperty::New();
my1DExtProp->DeepCopy(myEdgeProp);
anRGB[2] = 1 - anRGB[2];
my1DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
my1DExtProp->SetLineWidth(aLineWidth + aLineWidthInc);
- my1DExtProp->SetPointSize(aPointSize + aPointSizeInc);
+ my1DExtProp->SetPointSize(aElem0DSize);
my1DExtActor = SMESH_DeviceActor::New();
my1DExtActor->SetUserMatrix(aMatrix);
myNodeProp = vtkProperty::New();
SMESH::GetColor( "SMESH", "node_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 0, 0 ) );
myNodeProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
- myNodeProp->SetPointSize(aPointSize);
myNodeActor = SMESH_DeviceActor::New();
myNodeActor->SetUserMatrix(aMatrix);
anRGB[1] = 1 - anRGB[1];
anRGB[2] = 1 - anRGB[2];
myNodeExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
- myNodeExtProp->SetPointSize(aPointSize);
myNodeExtActor = SMESH_DeviceActor::New();
myNodeExtActor->SetUserMatrix(aMatrix);
myHighlightProp->SetSpecular(0.0);
SMESH::GetColor( "SMESH", "selection_object_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
myHighlightProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
- //myHighlightProp->SetPointSize(aPointSize);
- myHighlightProp->SetPointSize(std::max(aElem0DSize,aPointSize)); // ??
+ myHighlightProp->SetPointSize(aElem0DSize); // ??
myHighlightProp->SetRepresentation(1);
myPreselectProp = vtkProperty::New();
myPreselectProp->SetSpecular(0.0);
SMESH::GetColor( "SMESH", "highlight_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 255 ) );
myPreselectProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
- //myPreselectProp->SetPointSize(aPointSize);
- myPreselectProp->SetPointSize(std::max(aElem0DSize,aPointSize)); // ??
+ myPreselectProp->SetPointSize(aElem0DSize); // ??
myPreselectProp->SetRepresentation(1);
myHighlitableActor = SMESH_DeviceActor::New();
myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper->SetInput(myPtsSelectVisiblePoints->GetOutput());
-#if (VTK_XVERSION >= 0x050200)
- myPtsLabeledDataMapper->SetLabelFormat("%d");
-#else
+#if (VTK_XVERSION < 0x050200)
myPtsLabeledDataMapper->SetLabelFormat("%g");
#endif
myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
myClsLabeledDataMapper = vtkLabeledDataMapper::New();
myClsLabeledDataMapper->SetInput(myClsSelectVisiblePoints->GetOutput());
-#if (VTK_XVERSION >= 0x050200)
- myClsLabeledDataMapper->SetLabelFormat("%d");
-#else
+#if (VTK_XVERSION < 0x050200)
myClsLabeledDataMapper->SetLabelFormat("%g");
#endif
myClsLabeledDataMapper->SetLabelModeToLabelScalars();
return myIsFacesOriented;
}
+void SMESH_ActorDef::SetFacesOrientationColor(vtkFloatingPointType theColor[3])
+{
+ my2DActor->SetFacesOrientationColor( theColor );
+ my3DActor->SetFacesOrientationColor( theColor );
+}
+
+void SMESH_ActorDef::GetFacesOrientationColor(vtkFloatingPointType theColor[3])
+{
+ my3DActor->GetFacesOrientationColor( theColor );
+}
+
+void SMESH_ActorDef::SetFacesOrientationScale(vtkFloatingPointType theScale)
+{
+ my2DActor->SetFacesOrientationScale( theScale );
+ my3DActor->SetFacesOrientationScale( theScale );
+}
+
+vtkFloatingPointType SMESH_ActorDef::GetFacesOrientationScale()
+{
+ return my3DActor->GetFacesOrientationScale();
+}
+
+void SMESH_ActorDef::SetFacesOrientation3DVectors(bool theState)
+{
+ my2DActor->SetFacesOrientation3DVectors( theState );
+ my3DActor->SetFacesOrientation3DVectors( theState );
+}
+
+bool SMESH_ActorDef::GetFacesOrientation3DVectors()
+{
+ return my3DActor->GetFacesOrientation3DVectors();
+}
+
void
SMESH_ActorDef::
void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer){
- SALOME_Actor::AddToRender(theRenderer);
-
theRenderer->AddActor(myNodeActor);
theRenderer->AddActor(myBaseActor);
theRenderer->AddActor2D(myPointLabels);
theRenderer->AddActor2D(myCellsLabels);
+
+ // the superclass' method should be called at the end
+ // (in particular, for correct work of selection)
+ SALOME_Actor::AddToRender(theRenderer);
}
void SMESH_ActorDef::RemoveFromRender(vtkRenderer* theRenderer){
if( dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
SetIsDisplayNameActor( true );
+ int aMarkerType = mgr->integerValue( "SMESH", "type_of_marker", 1 ); // dot
+ int aMarkerScale = mgr->integerValue( "SMESH", "marker_scale", 9 ); // 5 pixels
+ SetMarkerStd( (VTK::MarkerType)aMarkerType, (VTK::MarkerScale)aMarkerScale );
+
myTimeStamp->Modified();
Modified();
return true;
my0DActor->VisibilityOn();
}
- if(myEntityMode & eEdges){
+ if(myEntityMode & eEdges && GetRepresentation() != ePoint){
my1DActor->VisibilityOn();
}
- if(myEntityMode & eFaces){
+ if(myEntityMode & eFaces && GetRepresentation() != ePoint){
my2DActor->VisibilityOn();
}
- if(myEntityMode & eVolumes){
+ if(myEntityMode & eVolumes && GetRepresentation() != ePoint){
my3DActor->VisibilityOn();
}
VTKViewer_ExtractUnstructuredGrid* aHightFilter = myHighlitableActor->GetExtractUnstructuredGrid();
aHightFilter->ClearRegisteredCellsWithType();
-
- // The following row has been commented (initially added in 1.28.2.3.1 revision)
- // Reason: seems to be unnecessary, this filter should always have default (ePassAll) mode of changing
- // In addition, it leads to exception (see bug IPAL21372)
- //aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+ aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
if (myEntityMode & e0DElements) {
if (MYDEBUG) MESSAGE("0D ELEMENTS");
SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
myHighlitableActor->SetVisibility(anIsVisible);
myHighlitableActor->SetRepresentation(SMESH_DeviceActor::ePoint);
+
+ VTK::MarkerType aMarkerType = GetMarkerType();
+ if(aMarkerType != VTK::MT_USER)
+ myHighlitableActor->SetMarkerStd(aMarkerType, GetMarkerScale());
+ else
+ myHighlitableActor->SetMarkerTexture(GetMarkerTexture(), myMarkerTexture);
}
}
}
::GetColor(myNodeProp,r,g,b);
}
+void SMESH_ActorDef::Set0DColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
+ my0DProp->SetColor(r,g,b);
+ if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
+ if( aGroupObj->GetElementType() == SMDSAbs_0DElement )
+ myNameActor->SetBackgroundColor(r,g,b);
+ Modified();
+}
+
+void SMESH_ActorDef::Get0DColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
+ ::GetColor(my0DProp,r,g,b);
+}
+
void SMESH_ActorDef::SetHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
myHighlightProp->SetColor(r,g,b);
Modified();
}
-void SMESH_ActorDef::SetNodeSize(vtkFloatingPointType theVal){
- myNodeProp->SetPointSize(theVal);
- myNodeExtProp->SetPointSize(theVal);
-
- vtkFloatingPointType aPointSize = my0DProp->GetPointSize() > theVal ? my0DProp->GetPointSize() : theVal;
- //myHighlightProp->SetPointSize(theVal);
- myHighlightProp->SetPointSize(aPointSize); // ??
- //myPreselectProp->SetPointSize(theVal);
- myPreselectProp->SetPointSize(aPointSize); // ??
-
- my1DProp->SetPointSize(theVal + aPointSizeInc);
- my1DExtProp->SetPointSize(theVal + aPointSizeInc);
-
+void SMESH_ActorDef::Set0DSize(vtkFloatingPointType theVal){
+ my0DProp->SetPointSize(theVal);
Modified();
}
-vtkFloatingPointType SMESH_ActorDef::GetNodeSize(){
- return myNodeProp->GetPointSize();
+vtkFloatingPointType SMESH_ActorDef::Get0DSize(){
+ return my0DProp->GetPointSize();
}
int SMESH_ActorDef::GetObjDimension( const int theObjId )
else
return SMESH_Actor::eLines;
}
+
+void SMESH_ActorDef::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+{
+ SALOME_Actor::SetMarkerStd( theMarkerType, theMarkerScale );
+ myNodeActor->SetMarkerStd( theMarkerType, theMarkerScale );
+ myNodeExtActor->SetMarkerStd( theMarkerType, theMarkerScale );
+}
+
+void SMESH_ActorDef::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
+{
+ SALOME_Actor::SetMarkerTexture( theMarkerId, theMarkerTexture );
+ myNodeActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
+ myNodeExtActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
+ myMarkerTexture = theMarkerTexture; // for deferred update of myHighlightActor
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH OBJECT : interactive object for SMESH visualization
// File : SMESH_Actor.h
// Author : Nicolas REJNERI
// Module : SMESH
-
+//
#ifndef SMESH_ACTOR_H
#define SMESH_ACTOR_H
virtual void SetNodeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
virtual void GetNodeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
+ virtual void Set0DColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
+ virtual void Get0DColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
+
virtual void SetHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
virtual void GetHighlightColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
virtual vtkFloatingPointType GetLineWidth() = 0;
virtual void SetLineWidth(vtkFloatingPointType theVal) = 0;
- virtual void SetNodeSize(vtkFloatingPointType size) = 0;
- virtual vtkFloatingPointType GetNodeSize() = 0;
+ virtual void Set0DSize(vtkFloatingPointType size) = 0;
+ virtual vtkFloatingPointType Get0DSize() = 0;
enum EReperesent { ePoint, eEdge, eSurface};
virtual void SetFacesOriented(bool theIsFacesOriented) = 0;
virtual bool GetFacesOriented() = 0;
+ virtual void SetFacesOrientationColor(vtkFloatingPointType theColor[3]) = 0;
+ virtual void GetFacesOrientationColor(vtkFloatingPointType theColor[3]) = 0;
+
+ virtual void SetFacesOrientationScale(vtkFloatingPointType theScale) = 0;
+ virtual vtkFloatingPointType GetFacesOrientationScale() = 0;
+
+ virtual void SetFacesOrientation3DVectors(bool theState) = 0;
+ virtual bool GetFacesOrientation3DVectors() = 0;
+
enum eControl{eNone, eLength, eLength2D, eFreeBorders, eFreeEdges, eFreeNodes,
eFreeFaces, eMultiConnection, eArea, eTaper, eAspectRatio,
eMinimumAngle, eWarping, eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH OBJECT : interactive object for SMESH visualization
// File : SMESH_ActorDef.h
// Author : Nicolas REJNERI
// Module : SMESH
//
-
#ifndef SMESH_ACTORDEF_H
#define SMESH_ACTORDEF_H
virtual void SetNodeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
virtual void GetNodeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b);
+ virtual void Set0DColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
+ virtual void Get0DColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b);
+
virtual void SetHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
virtual void GetHighlightColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b);
virtual vtkFloatingPointType GetLineWidth();
virtual void SetLineWidth(vtkFloatingPointType theVal);
- virtual void SetNodeSize(vtkFloatingPointType size) ;
- virtual vtkFloatingPointType GetNodeSize() ;
+ virtual void Set0DSize(vtkFloatingPointType size);
+ virtual vtkFloatingPointType Get0DSize();
virtual int GetNodeObjId(int theVtkID);
virtual vtkFloatingPointType* GetNodeCoord(int theObjID);
virtual void SetFacesOriented(bool theIsFacesOriented);
virtual bool GetFacesOriented();
+ virtual void SetFacesOrientationColor(vtkFloatingPointType theColor[3]);
+ virtual void GetFacesOrientationColor(vtkFloatingPointType theColor[3]);
+
+ virtual void SetFacesOrientationScale(vtkFloatingPointType theScale);
+ virtual vtkFloatingPointType GetFacesOrientationScale();
+
+ virtual void SetFacesOrientation3DVectors(bool theState);
+ virtual bool GetFacesOrientation3DVectors();
+
virtual void SetControlMode(eControl theMode);
virtual eControl GetControlMode(){ return myControlMode;}
virtual void SetQuadratic2DRepresentation(EQuadratic2DRepresentation);
virtual EQuadratic2DRepresentation GetQuadratic2DRepresentation();
+ virtual void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
+ virtual void SetMarkerTexture( int, VTK::MarkerTexture );
+
protected:
void SetControlMode(eControl theMode, bool theCheckEntityMode);
void SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed);
bool myIsFacesOriented;
+ VTK::MarkerTexture myMarkerTexture;
+
SMESH_ActorDef();
~SMESH_ActorDef();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SMESH_ActorUtils.h"
#include "SUIT_Tools.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SMESH_ACTORUTILS_H
#define SMESH_ACTORUTILS_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH OBJECT : interactive object for SMESH visualization
// File : SMESH_DeviceActor.cxx
// Author :
// Module : SMESH
//
-
#include "SMESH_DeviceActor.h"
#include "SMESH_ExtractGeometry.h"
#include "SMESH_ControlsDef.hxx"
#include "SMESH_ActorUtils.h"
#include "SMESH_FaceOrientationFilter.h"
#include "VTKViewer_CellLocationsArray.h"
+#include "VTKViewer_PolyDataMapper.h"
#include <VTKViewer_Transform.h>
#include <VTKViewer_TransformFilter.h>
myRepresentation = eSurface;
myProperty = vtkProperty::New();
- myMapper = vtkPolyDataMapper::New();
+ myMapper = VTKViewer_PolyDataMapper::New();
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
myPolygonOffsetUnits);
}
}
+void
+SMESH_DeviceActor
+::SetFacesOrientationColor(vtkFloatingPointType theColor[3])
+{
+ myFaceOrientation->GetProperty()->SetColor( theColor );
+}
+
+void
+SMESH_DeviceActor
+::GetFacesOrientationColor(vtkFloatingPointType theColor[3])
+{
+ myFaceOrientation->GetProperty()->GetColor( theColor );
+}
+
+void
+SMESH_DeviceActor
+::SetFacesOrientationScale(vtkFloatingPointType theScale)
+{
+ myFaceOrientationFilter->SetOrientationScale( theScale );
+}
+
+vtkFloatingPointType
+SMESH_DeviceActor
+::GetFacesOrientationScale()
+{
+ return myFaceOrientationFilter->GetOrientationScale();
+}
+
+void
+SMESH_DeviceActor
+::SetFacesOrientation3DVectors(bool theState)
+{
+ myFaceOrientationFilter->Set3dVectors( theState );
+}
+
+bool
+SMESH_DeviceActor
+::GetFacesOrientation3DVectors()
+{
+ return myFaceOrientationFilter->Get3dVectors();
+}
+
void
SMESH_DeviceActor
::UpdateFaceOrientation()
myGeomFilter->SetWireframeMode(false);
GetProperty()->SetRepresentation(theMode);
}
+ SetMarkerEnabled(theMode == ePoint);
myRepresentation = theMode;
UpdateFaceOrientation();
GetProperty()->Modified();
vtkFloatingPointType SMESH_DeviceActor::GetQuadraticArcAngle(){
return myGeomFilter->GetQuadraticArcAngle();
}
+
+/*!
+ * Set point marker enabled
+ * \param theMarkerEnabled flag to enable/disable point marker
+ */
+void SMESH_DeviceActor::SetMarkerEnabled( bool theMarkerEnabled )
+{
+ myMapper->SetMarkerEnabled( theMarkerEnabled );
+}
+
+/*!
+ * Set standard point marker
+ * \param theMarkerType type of the marker
+ */
+void SMESH_DeviceActor::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+{
+ myMapper->SetMarkerStd( theMarkerType, theMarkerScale );
+}
+
+/*!
+ * Set custom point marker
+ * \param theMarkerId id of the marker texture
+ * \param theMarkerTexture marker texture
+ */
+void SMESH_DeviceActor::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
+{
+ myMapper->SetMarkerTexture( theMarkerId, theMarkerTexture );
+}
+
+/*!
+ * Get type of the point marker
+ * \return type of the point marker
+ */
+VTK::MarkerType SMESH_DeviceActor::GetMarkerType()
+{
+ return myMapper->GetMarkerType();
+}
+
+/*!
+ Get scale of the point marker
+ \return scale of the point marker
+*/
+VTK::MarkerScale SMESH_DeviceActor::GetMarkerScale()
+{
+ return myMapper->GetMarkerScale();
+}
+
+/*!
+ * Get texture identifier of the point marker
+ * \return texture identifier of the point marker
+ */
+int SMESH_DeviceActor::GetMarkerTexture()
+{
+ return myMapper->GetMarkerTexture();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH OBJECT : interactive object for SMESH visualization
// File : SMESH_DeviceActor.h
// Author : Nicolas REJNERI
#define SMESH_DEVICE_ACTOR_H
#include <VTKViewer_GeometryFilter.h>
+#include <VTKViewer_MarkerDef.h>
#include "SMESH_Controls.hxx"
#include "SMESH_Object.h"
class vtkProperty;
class vtkMergeFilter;
class vtkShrinkFilter;
-class vtkPolyDataMapper;
class vtkUnstructuredGrid;
class vtkScalarBarActor;
class vtkLookupTable;
class VTKViewer_Transform;
class VTKViewer_TransformFilter;
class VTKViewer_ExtractUnstructuredGrid;
+class VTKViewer_PolyDataMapper;
class SMESH_ExtractGeometry;
class SMESH_FaceOrientationFilter;
virtual void SetFacesOriented(bool theIsFacesOriented);
virtual bool GetFacesOriented() { return myIsFacesOriented; }
+ virtual void SetFacesOrientationColor(vtkFloatingPointType theColor[3]);
+ virtual void GetFacesOrientationColor(vtkFloatingPointType theColor[3]);
+
+ virtual void SetFacesOrientationScale(vtkFloatingPointType theScale);
+ virtual vtkFloatingPointType GetFacesOrientationScale();
+
+ virtual void SetFacesOrientation3DVectors(bool theState);
+ virtual bool GetFacesOrientation3DVectors();
+
//----------------------------------------------------------------------------
//! Setting for displaying quadratic elements
virtual void SetQuadraticArcMode(bool theFlag);
void SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed);
bool IsImplicitFunctionUsed() const{ return myIsImplicitFunctionUsed;}
+ void SetMarkerEnabled( bool );
+ void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
+ void SetMarkerTexture( int, VTK::MarkerTexture );
+ VTK::MarkerType GetMarkerType();
+ VTK::MarkerScale GetMarkerScale();
+ int GetMarkerTexture();
+
protected:
void Init(TVisualObjPtr theVisualObj, vtkImplicitBoolean* theImplicitBoolean);
void SetUnstructuredGrid(vtkUnstructuredGrid* theGrid);
- vtkPolyDataMapper *myMapper;
+ VTKViewer_PolyDataMapper *myMapper;
TVisualObjPtr myVisualObj;
vtkProperty *myProperty;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SMESH_ExtractGeometry.h"
#include <vtkCell.h>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOME_ExtractGeometry_HeaderFile
#define SALOME_ExtractGeometry_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SMESH_FaceOrientationFilter.h"
#include "SMESH_ActorUtils.h"
myBaseGlyph->Delete();
}
+void SMESH_FaceOrientationFilter::SetOrientationScale( vtkFloatingPointType theScale )
+{
+ myOrientationScale = theScale;
+ Modified();
+}
+
+void SMESH_FaceOrientationFilter::Set3dVectors( bool theState )
+{
+ my3dVectors = theState;
+ myBaseGlyph->SetSource(my3dVectors ? myArrowPolyData : myGlyphSource->GetOutput());
+ Modified();
+}
+
vtkPolyData* SMESH_FaceOrientationFilter::CreateArrowPolyData()
{
vtkPoints* points = vtkPoints::New();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SMESH_FACEORIENTATIONFILTER_H
#define SMESH_FACEORIENTATIONFILTER_H
/*!Create a new SMESH_FaceOrientationFilter.*/
static SMESH_FaceOrientationFilter *New();
+ void SetOrientationScale( vtkFloatingPointType );
+ vtkFloatingPointType GetOrientationScale() const { return myOrientationScale; }
+
+ void Set3dVectors( bool );
+ bool Get3dVectors() const { return my3dVectors; }
+
protected:
SMESH_FaceOrientationFilter();
virtual ~SMESH_FaceOrientationFilter();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH OBJECT : interactive object for SMESH visualization
// File : SMESH_Grid.cxx
// Author : Nicolas REJNERI
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH OBJECT : interactive object for SMESH visualization
// File : SMESH_Object.h
// Author : Nicolas REJNERI
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH OBJECT : interactive object for SMESH visualization
// File : SMESH_Object.h
// Author : Nicolas REJNERI
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH OBJECT : interactive object for SMESH visualization
// File : SMESH_PreviewActorsCollection.cxx
// Author :
// Module : SMESH
//
-
#include "SMESH_PreviewActorsCollection.h"
#include "utilities.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH OBJECT : interactive object for SMESH visualization
// File : SMESH_PreviewActorsCollection.h
// Author : OCN
--- /dev/null
+// Copyright (C) 2007-2010 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// 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 : GeomSelectionTools.cxx
+// Authors : Nicolas GEIMER (OCC)
+// ---
+
+#include "GeomSelectionTools.h"
+
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SUIT_Session.h>
+
+#include <SALOME_ListIteratorOfListIO.hxx>
+#include <GEOM_Client.hxx>
+#include <SMESHGUI_Utils.h>
+#include <boost/shared_ptr.hpp>
+#include <GEOMImpl_Types.hxx>
+
+#include <TopoDS.hxx>
+#include <BRep_Tool.hxx>
+#include <Handle_Geom_Surface.hxx>
+#include <BRepAdaptor_Surface.hxx>
+
+#include "utilities.h"
+
+#include "SALOME_LifeCycleCORBA.hxx"
+#include <sstream>
+
+/*!
+ * Constructor
+ * @param aStudy pointer to the Study
+ *
+ */
+GeomSelectionTools::GeomSelectionTools(_PTR(Study) aStudy)
+{
+ myStudy = aStudy;
+}
+
+/*!
+ * Accessor to the Study used by this GeomSelectionTools object
+ * @return The study used by the GeomSelectionTools class
+ */
+_PTR(Study) GeomSelectionTools::getMyStudy()
+{
+ return myStudy;
+}
+
+/*!
+ * Allows to get the Salome Application
+ * @return A LightApp_SelectionMgr Pointer or 0 if it can't get it.
+ */
+SalomeApp_Application* GeomSelectionTools::GetSalomeApplication()
+{
+ SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+ if (anApp)
+ return anApp;
+ else
+ return 0;
+}
+
+/*!
+ * Allows to get the selection manager from LightApp
+ * @return A LightApp_SelectionMgr Pointer or 0 if it can't get it.
+ */
+LightApp_SelectionMgr* GeomSelectionTools::selectionMgr()
+{
+ SalomeApp_Application* anApp = GetSalomeApplication();
+ if (anApp)
+ return dynamic_cast<LightApp_SelectionMgr*>( anApp->selectionMgr() );
+ else
+ return 0;
+}
+
+/*!
+ * Return the list of the selected Salome Interactive Object (SALOME_ListIO*)
+ * @return the list of the selected Salome Interactive Object
+ */
+SALOME_ListIO* GeomSelectionTools::getSelectedSalomeObjects()
+{
+ SALOME_ListIO* selected;
+ LightApp_SelectionMgr* aSel = selectionMgr();
+ aSel->selectedObjects( *selected, NULL, false );
+ return selected;
+}
+
+/*!
+ * Return the first selected Salome Interactive Object (Handle(Salome_InteractiveObject))
+ * @return the first selected Salome Interactive Object
+ */
+Handle(SALOME_InteractiveObject) GeomSelectionTools::getFirstSelectedSalomeObject()
+{
+ SALOME_ListIO selected;
+ LightApp_SelectionMgr* aSel = selectionMgr();
+ aSel->selectedObjects( selected, NULL, false );
+ if (!selected.IsEmpty()){
+ SALOME_ListIteratorOfListIO anIt(selected);
+ Handle(SALOME_InteractiveObject) anIO;
+ anIO = anIt.Value();
+ return anIO;
+ }
+ return NULL;
+}
+
+/*!
+ * Return the entry of the first selected Object
+ * @return the entry of the first selected Object
+ */
+std::string GeomSelectionTools::getFirstSelectedEntry()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ std::string entry="";
+ anIO=GeomSelectionTools::getFirstSelectedSalomeObject();
+ return GeomSelectionTools::getEntryOfObject(anIO);
+}
+
+/*!
+ * Return the entry of a Salome Interactive Object
+ * @param anIO the Handle of the Salome Interactive Object
+ * @return the entry of the Salome Interactive Object
+ */
+std::string GeomSelectionTools::getEntryOfObject(Handle(SALOME_InteractiveObject) anIO){
+ std::string entry="";
+ _PTR(SObject) aSO = myStudy->FindObjectID(anIO->getEntry());
+ if (aSO){
+ _PTR(SObject) aRefSObj;
+ // If selected object is a reference
+ if ( aSO->ReferencedObject( aRefSObj ))
+ entry = aRefSObj->GetID();
+ // If selected object is a reference is not a reference
+ else
+ entry= anIO->getEntry();
+ }
+ return entry;
+}
+
+/*!
+ * Retrieve the name from the entry of the object
+ * @param entry the entry of the object
+ * @return the name of the object
+ */
+std::string GeomSelectionTools::getNameFromEntry(std::string entry){
+ std::string name = "";
+ _PTR(SObject) aSO = myStudy->FindObjectID(entry);
+ if (aSO){
+ _PTR(SObject) aRefSObj;
+ // If selected object is a reference
+ if ( aSO->ReferencedObject( aRefSObj ))
+ name = aRefSObj->GetName();
+ // If selected object is a reference is not a reference
+ else
+ name = aSO->GetName();
+ }
+ return name;
+}
+
+
+/*!
+ * Retrieve the component type of the first selected object, it manages successfully references.
+ * @return the component type of the first selected object
+ */
+std::string GeomSelectionTools::getFirstSelectedComponentDataType()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ std::string DataType="";
+ anIO=GeomSelectionTools::getFirstSelectedSalomeObject();
+ _PTR(SObject) aSO = myStudy->FindObjectID(anIO->getEntry());
+ if (aSO){
+ _PTR(SObject) aRefSObj;
+ // If selected object is a reference
+ if ( aSO->ReferencedObject( aRefSObj ))
+ DataType= aRefSObj->GetFatherComponent()->ComponentDataType();
+ // If selected object is a reference is not a reference
+ else
+ DataType=anIO->getComponentDataType();
+ }
+ return DataType;
+}
+
+/*!
+ * Retrieve the shape type from the entry
+ * @return the shape type from the entry, return TopAbs_SHAPE if the object does not define a shape or a group.
+ */
+TopAbs_ShapeEnum GeomSelectionTools::entryToShapeType(std::string entry){
+// MESSAGE("GeomSelectionTools::entryToShapeType"<<entry );
+ TopoDS_Shape S = TopoDS_Shape();
+ TopAbs_ShapeEnum ShapeType = TopAbs_SHAPE;
+ _PTR(SObject) aSO = myStudy->FindObjectID(entry);
+ if (aSO){
+ _PTR(SObject) aRefSObj;
+ GEOM::GEOM_Object_var aShape;
+ // MESSAGE("Got a SO");
+ // If selected object is a reference
+ if ( aSO->ReferencedObject( aRefSObj ))
+ aSO = aRefSObj;
+ // MESSAGE("aSO->GetFatherComponent()->ComponentDataType(): " << aSO->GetFatherComponent()->ComponentDataType());
+ if ( strcmp(aSO->GetFatherComponent()->ComponentDataType().c_str(),"GEOM") == 0)
+ aShape = SMESH::SObjectToInterface<GEOM::GEOM_Object>(aSO);
+ if ( !aShape->_is_nil() ){
+ // MESSAGE("Got the Geom Object ");
+ // MESSAGE("Geom Object Type "<< aShape->GetType());
+ SalomeApp_Application* anApp = GetSalomeApplication();
+ if (anApp) {
+// MESSAGE("Got Application");
+ Engines::Component_var component = anApp->lcc()->FindOrLoad_Component( "FactoryServer","GEOM" );
+ GEOM::GEOM_Gen_var _geomEngine = GEOM::GEOM_Gen::_narrow(component);
+// MESSAGE("Got GEOM engine");
+ // if the Geom Object is a group
+ if (aShape->GetType() == GEOM_GROUP){
+// MESSAGE("It's a group");
+ GEOM::GEOM_IGroupOperations_var aGroupOp = _geomEngine->GetIGroupOperations(myStudy->StudyId());
+ ShapeType= (TopAbs_ShapeEnum)aGroupOp->GetType(aShape);
+ }
+ // if not
+ else {
+ GEOM_Client* aClient = new GEOM_Client();
+ if ( aClient && !_geomEngine->_is_nil() ) {
+// MESSAGE("GEOM client is OK and GEOM engine is not null");
+ S = aClient->GetShape( _geomEngine, aShape );
+ ShapeType=S.ShapeType();
+ }
+ }
+ }
+ }
+ }
+// MESSAGE("ShapeType returned is " << ShapeType);
+ return ShapeType;
+}
+
+/*!
+ * Gives the ShapeType of the first Selected Object, return TopAbs_SHAPE if the first selected object does not define a shape.
+ * @return the ShapeType of the first Selected Object, return TopAbs_SHAPE if the first selected object does not define a shape.
+ */
+TopAbs_ShapeEnum GeomSelectionTools:: getFirstSelectedShapeType()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ anIO=GeomSelectionTools::getFirstSelectedSalomeObject();
+ return entryToShapeType(anIO->getEntry());
+}
+
+/*!
+ * Print information to std output of the face
+ * and return the OCC type of face: Plane, Cylinder,Cone, Sphere, Torus, BezierSurface,BSplineSurface, SurfaceOfRevolution,SurfaceOfExtrusion, OtherSurface
+ * @param TopoDS_Shape S Face we want information about.
+ * @return the OCC type of face: Plane, Cylinder,Cone, Sphere, Torus, BezierSurface,BSplineSurface, SurfaceOfRevolution,SurfaceOfExtrusion, OtherSurface
+ * return Other_Surface if the selected face is not a face.
+ * Information printed is :
+ * U and V degrees
+ * U and V number of poles
+ * U and V number of knots
+ * U or V is Rational ?
+ *
+ */
+GeomAbs_SurfaceType GeomSelectionTools::getFaceInformation(TopoDS_Shape S)
+{
+ GeomAbs_SurfaceType surf_type=GeomAbs_OtherSurface ;
+ if (!S.IsNull() && S.ShapeType()==TopAbs_FACE){
+ TopoDS_Face f=TopoDS::Face(S);
+ Handle(Geom_Surface) surf = BRep_Tool::Surface(f);
+ BRepAdaptor_Surface surf_adap=BRepAdaptor_Surface::BRepAdaptor_Surface(f);
+
+ /* Global Information */
+ std::cout << "GLOBAL INFORMATION" << std::endl;
+ std::cout << "******************" << std::endl;
+ std::stringstream buffer;
+ buffer << "Degre U : " << surf_adap.UDegree();
+ //conversion nécessaire pour affichage
+ std::cout << buffer.str() << std::endl;
+ std::cout << " Degre V : " << surf_adap.VDegree() << std::endl;
+ std::cout << " Nb Poles U : " << surf_adap.NbUPoles() << std::endl;
+ std::cout << " Nb Poles V : " << surf_adap.NbVPoles() << std::endl;
+ std::cout << " Nb Noeuds U : " << surf_adap.NbUKnots() << std::endl;
+ std::cout << " Nb Noeuds V : " << surf_adap.NbVKnots() << std::endl;
+ std::cout << " U Rationnel ? " << surf_adap.IsURational() << std::endl;
+ std::cout << " V Rationnel ? " << surf_adap.IsVRational() << std::endl;
+
+ surf_type=surf_adap.GetType();
+ }
+ return surf_type;
+}
+
+
+
+
--- /dev/null
+// Copyright (C) 2007-2010 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// 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 : GeomSelectionTools.h
+// Authors : Nicolas GEIMER (OCC)
+// ---
+
+#ifndef _GEOMSELECTIONTOOLS_H_
+#define _GEOMSELECTIONTOOLS_H_
+
+#ifdef WIN32
+# ifdef GeomSelectionTools_EXPORTS
+# define GEOMSELECTIONTOOLS_EXPORT __declspec( dllexport )
+# else
+# define GEOMSELECTIONTOOLS_EXPORT __declspec( dllimport )
+# endif
+#else
+# define GEOMSELECTIONTOOLS_EXPORT
+#endif
+
+#include "SALOMEDSClient.hxx"
+#include "SALOME_InteractiveObject.hxx"
+#include <SALOME_ListIO.hxx>
+#include <SalomeApp_Application.h>
+
+#include <TopoDS_Shape.hxx>
+#include <GeomAbs_SurfaceType.hxx>
+
+class LightApp_SelectionMgr;
+
+
+/*!
+ * The GeomSelectionTools class gives high level tools to select Geom (and other objects)
+ * A specific attention has been given to analyze selected GEOM objects.
+ *
+ * @param myStudy This class is specific to the study !
+ *
+ */
+
+class GEOMSELECTIONTOOLS_EXPORT GeomSelectionTools
+{
+
+private:
+
+ _PTR(Study) myStudy;
+
+public:
+
+ GeomSelectionTools(_PTR(Study));
+ static SalomeApp_Application* GetSalomeApplication();
+ static LightApp_SelectionMgr* selectionMgr();
+ SALOME_ListIO* getSelectedSalomeObjects();
+ Handle(SALOME_InteractiveObject) getFirstSelectedSalomeObject();
+ std::string getFirstSelectedEntry();
+ std::string getEntryOfObject(Handle(SALOME_InteractiveObject));
+ std::string getNameFromEntry(std::string);
+ std::string getFirstSelectedComponentDataType();
+ TopAbs_ShapeEnum getFirstSelectedShapeType();
+ TopAbs_ShapeEnum entryToShapeType(std::string );
+ GeomAbs_SurfaceType getFaceInformation(TopoDS_Shape);
+ _PTR(Study) getMyStudy();
+};
+
+
+#endif // _GEOMSELECTIONTOOLS_H_
+
--- /dev/null
+# Copyright (C) 2007-2010 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.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# ---
+# File : Makefile.am
+# Author : Nicolas GEIMER (OCC)
+# ---
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+# header files
+salomeinclude_HEADERS = \
+ GeomSelectionTools.h
+
+# Libraries targets
+lib_LTLIBRARIES = libGeomSelectionTools.la
+
+dist_libGeomSelectionTools_la_SOURCES = \
+ GeomSelectionTools.h \
+ GeomSelectionTools.cxx
+
+# additionnal information to compil and link file
+libGeomSelectionTools_la_CPPFLAGS = \
+ $(QT_INCLUDES) \
+ $(CAS_CPPFLAGS) \
+ $(PYTHON_INCLUDES) \
+ $(KERNEL_CXXFLAGS) \
+ $(GUI_CXXFLAGS) \
+ $(GEOM_CXXFLAGS) \
+ $(MED_CXXFLAGS) \
+ $(BOOST_CPPFLAGS) \
+ $(CORBA_CXXFLAGS) \
+ $(CORBA_INCLUDES) \
+ -I$(srcdir)/../SMESHGUI \
+ -I$(top_builddir)/idl
+
+libGeomSelectionTools_la_LDFLAGS = \
+ ../../idl/libSalomeIDLSMESH.la \
+ ../SMESHGUI/libSMESH.la \
+ $(QT_LIBS) \
+ $(CORBA_LIBS) \
+ $(KERNEL_LDFLAGS) -lSalomeIDLKernel -lSALOMELocalTrace -lSalomeLifeCycleCORBA \
+ $(GUI_LDFLAGS) -lSalomeObject -lsuit -lLightApp -lSalomeApp \
+ $(GEOM_LDFLAGS) -lSalomeIDLGEOM -lGEOMClient \
+ $(CAS_KERNEL) -lTKBRep -lTKG3d
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH SMDS : implementaion of Salome mesh data structure
# File : Makefile.in
# Author : Patrick GOLDBRONN (CEA)
SMDS_SetIterator.hxx \
SMESH_SMDS.hxx \
SMDS_MeshInfo.hxx \
- SMDS_UnstructuredGrid.hxx
+ SMDS_UnstructuredGrid.hxx \
+ SMDS_StdIterator.hxx
# Libraries targets
SMDS_MemoryLimit_LDADD = \
$(KERNEL_LDFLAGS) -lSALOMELocalTrace
+
+#libSMDS_la_LDFLAGS += -L/data/eap/S5_MV/INSTALL/SMESH/lib/salome -lPerfmeter
mais script OK
==> cassé apres mode embedded ou elimination noeuds en trop ?
- extrusion elements 2D along a path : affichage apres calcul pas toujours OK (filaire)
+- branche git a ouvrir pour merge avec V5_1_4_BR tag V5_1_4rc1
A tester, non pris en compte
============================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDSAbs_ElementType.hxx
// Module : SMESH
-
+//
#ifndef _SMDSAbs_ElementType_HeaderFile
#define _SMDSAbs_ElementType_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_EdgePosition.cxx
// Author : Jean-Michel BOULCOURT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_EdgePosition.hxx
// Module : SMESH
{
public:
- SMDS_EdgePosition(const int aEdgeId=0, const double aUParam=0);
- const virtual double * Coords() const;
- SMDS_TypeOfPosition GetTypeOfPosition() const;
- void SetUParameter(double aUparam);
- double GetUParameter() const;
+ SMDS_EdgePosition(const int aEdgeId=0, const double aUParam=0);
+ const virtual double * Coords() const;
+ SMDS_TypeOfPosition GetTypeOfPosition() const;
+ void SetUParameter(double aUparam);
+ double GetUParameter() const;
private:
- double myUParameter;
+ double myUParameter;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshElement.hxx
// Module : SMESH
// Created: 12.01.05 18:02:52
// Author: Michael Sazonov
-
+//
#ifndef SMDS_ElemIterator_HeaderFile
#define SMDS_ElemIterator_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifdef _MSC_VER
int SMDS_FaceOfEdges::NbEdges() const
{
- return myNbEdges;
+ return myNbEdges;
}
int SMDS_FaceOfEdges::NbFaces() const
{
- return 1;
+ return 1;
}
//=======================================================================
//function : Print
void SMDS_FaceOfEdges::Print(ostream & OS) const
{
- OS << "face <" << GetID() << " > : ";
- int i;
- for (i = 0; i < NbEdges() - 1; i++) OS << myEdges[i] << ",";
- OS << myEdges[i] << ") " << endl;
+ OS << "face <" << GetID() << " > : ";
+ int i;
+ for (i = 0; i < NbEdges() - 1; i++) OS << myEdges[i] << ",";
+ OS << myEdges[i] << ") " << endl;
}
SMDSAbs_ElementType SMDS_FaceOfEdges::GetType() const
{
- return SMDSAbs_Face;
+ return SMDSAbs_Face;
}
//=======================================================================
{
index++;
return mySet[index-1];
- }
+ }
};
SMDS_ElemIteratorPtr SMDS_FaceOfEdges::elementsIterator
const SMDS_MeshEdge* edge2,
const SMDS_MeshEdge* edge3)
{
- myNbEdges = 3;
- myEdges[0]=edge1;
- myEdges[1]=edge2;
- myEdges[2]=edge3;
- myEdges[3]=0;
+ myNbEdges = 3;
+ myEdges[0]=edge1;
+ myEdges[1]=edge2;
+ myEdges[2]=edge3;
+ myEdges[3]=0;
}
SMDS_FaceOfEdges::SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
const SMDS_MeshEdge* edge3,
const SMDS_MeshEdge* edge4)
{
- myNbEdges = 4;
- myEdges[0]=edge1;
- myEdges[1]=edge2;
- myEdges[2]=edge3;
- myEdges[3]=edge4;
+ myNbEdges = 4;
+ myEdges[0]=edge1;
+ myEdges[1]=edge2;
+ myEdges[2]=edge3;
+ myEdges[3]=edge4;
}
/*bool operator<(const SMDS_FaceOfEdges& f1, const SMDS_FaceOfEdges& f2)
{
- set<SMDS_MeshNode> set1,set2;
- SMDS_ElemIteratorPtr it;
- const SMDS_MeshNode * n;
-
- it=f1.nodesIterator();
-
- while(it->more())
- {
- n=static_cast<const SMDS_MeshNode *>(it->next());
- set1.insert(*n);
- }
-
- delete it;
- it=f2.nodesIterator();
-
- while(it->more())
- {
- n=static_cast<const SMDS_MeshNode *>(it->next());
- set2.insert(*n);
- }
-
- delete it;
- return set1<set2;
+ set<SMDS_MeshNode> set1,set2;
+ SMDS_ElemIteratorPtr it;
+ const SMDS_MeshNode * n;
+
+ it=f1.nodesIterator();
+
+ while(it->more())
+ {
+ n=static_cast<const SMDS_MeshNode *>(it->next());
+ set1.insert(*n);
+ }
+
+ delete it;
+ it=f2.nodesIterator();
+
+ while(it->more())
+ {
+ n=static_cast<const SMDS_MeshNode *>(it->next());
+ set2.insert(*n);
+ }
+
+ delete it;
+ return set1<set2;
}*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifndef _SMDS_FaceOfEdges_HeaderFile
class SMDS_EXPORT SMDS_FaceOfEdges:public SMDS_MeshFace
{
public:
- void Print(std::ostream & OS) const;
- SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
+ void Print(std::ostream & OS) const;
+ SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
const SMDS_MeshEdge* edge2,
const SMDS_MeshEdge* edge3);
- SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
+ SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
const SMDS_MeshEdge* edge2,
const SMDS_MeshEdge* edge3,
const SMDS_MeshEdge* edge4);
-
- SMDSAbs_ElementType GetType() const;
- virtual SMDSAbs_EntityType GetEntityType() const;
- int NbNodes() const;
- int NbEdges() const;
- int NbFaces() const;
-// friend bool operator<(const SMDS_FaceOfEdges& e1, const SMDS_FaceOfEdges& e2);
+
+ SMDSAbs_ElementType GetType() const;
+ virtual SMDSAbs_EntityType GetEntityType() const;
+ int NbNodes() const;
+ int NbEdges() const;
+ int NbFaces() const;
+// friend bool operator<(const SMDS_FaceOfEdges& e1, const SMDS_FaceOfEdges& e2);
/*!
virtual const SMDS_MeshNode* GetNode(const int ind) const;
protected:
- SMDS_ElemIteratorPtr
- elementsIterator(SMDSAbs_ElementType type) const;
+ SMDS_ElemIteratorPtr
+ elementsIterator(SMDSAbs_ElementType type) const;
private:
- const SMDS_MeshEdge* myEdges[4];
+ const SMDS_MeshEdge* myEdges[4];
int myNbEdges;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifdef _MSC_VER
int SMDS_FaceOfNodes::NbEdges() const
{
- return NbNodes();
+ return NbNodes();
}
int SMDS_FaceOfNodes::NbFaces() const
{
- return 1;
+ return 1;
}
int SMDS_FaceOfNodes::NbNodes() const
{
- return myNbNodes;
+ return myNbNodes;
}
//=======================================================================
void SMDS_FaceOfNodes::Print(ostream & OS) const
{
- OS << "face <" << GetID() << " > : ";
- int i;
- for (i = 0; i < NbNodes() - 1; i++) OS << myNodes[i] << ",";
- OS << myNodes[i] << ") " << endl;
+ OS << "face <" << GetID() << " > : ";
+ int i;
+ for (i = 0; i < NbNodes() - 1; i++) OS << myNodes[i] << ",";
+ OS << myNodes[i] << ") " << endl;
}
//=======================================================================
const SMDS_MeshNode* node2,
const SMDS_MeshNode* node3)
{
- myNbNodes = 3;
- myNodes[0]=node1;
- myNodes[1]=node2;
- myNodes[2]=node3;
- myNodes[3]=0;
+ myNbNodes = 3;
+ myNodes[0]=node1;
+ myNodes[1]=node2;
+ myNodes[2]=node3;
+ myNodes[3]=0;
}
SMDS_FaceOfNodes::SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
const SMDS_MeshNode* node3,
const SMDS_MeshNode* node4)
{
- myNbNodes = 4;
- myNodes[0]=node1;
- myNodes[1]=node2;
- myNodes[2]=node3;
- myNodes[3]=node4;
+ myNbNodes = 4;
+ myNodes[0]=node1;
+ myNodes[1]=node2;
+ myNodes[2]=node3;
+ myNodes[3]=node4;
}
bool SMDS_FaceOfNodes::ChangeNodes(const SMDS_MeshNode* nodes[],
const int nbNodes)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifndef _SMDS_FaceOfNodes_HeaderFile
class SMDS_EXPORT SMDS_FaceOfNodes:public SMDS_MeshFace
{
public:
- void Print(std::ostream & OS) const;
- SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
+ void Print(std::ostream & OS) const;
+ SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
const SMDS_MeshNode* node2,
const SMDS_MeshNode* node3);
- SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
+ SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
const SMDS_MeshNode* node2,
const SMDS_MeshNode* node3,
const SMDS_MeshNode* node4);
bool ChangeNodes(const SMDS_MeshNode* nodes[],
const int nbNodes);
- int NbEdges() const;
- int NbFaces() const;
- int NbNodes() const;
+ int NbEdges() const;
+ int NbFaces() const;
+ int NbNodes() const;
/*!
* \brief Return node by its index
virtual SMDSAbs_EntityType GetEntityType() const;
protected:
- SMDS_ElemIteratorPtr
- elementsIterator(SMDSAbs_ElementType type) const;
+ SMDS_ElemIteratorPtr
+ elementsIterator(SMDSAbs_ElementType type) const;
private:
- const SMDS_MeshNode* myNodes[4];
+ const SMDS_MeshNode* myNodes[4];
int myNbNodes;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_FacePosition.cxx
// Author : Jean-Michel BOULCOURT
//=======================================================================
SMDS_FacePosition::SMDS_FacePosition(const int aEdgeId,
- const double aUParam,
- const double aVParam)
+ const double aUParam,
+ const double aVParam)
:SMDS_Position(aEdgeId),
myUParameter(aUParam),myVParameter(aVParam)
{
//=======================================================================
const double *SMDS_FacePosition::Coords() const
{
- static double origin[]={0,0,0};
- MESSAGE("SMDS_EdgePosition::Coords not implemented");
- return origin;
+ static double origin[]={0,0,0};
+ MESSAGE("SMDS_EdgePosition::Coords not implemented");
+ return origin;
}
/**
*/
SMDS_TypeOfPosition SMDS_FacePosition::GetTypeOfPosition() const
{
- return SMDS_TOP_FACE;
+ return SMDS_TOP_FACE;
}
void SMDS_FacePosition::SetUParameter(double aUparam)
{
- myUParameter = aUparam;
+ myUParameter = aUparam;
}
//=======================================================================
void SMDS_FacePosition::SetVParameter(double aVparam)
{
- myVParameter = aVparam;
+ myVParameter = aVparam;
}
//=======================================================================
double SMDS_FacePosition::GetUParameter() const
{
- return myUParameter;
+ return myUParameter;
}
//=======================================================================
double SMDS_FacePosition::GetVParameter() const
{
- return myVParameter;
+ return myVParameter;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_FacePosition.hxx
// Module : SMESH
{
public:
- SMDS_FacePosition(int aFaceId=0, double aUParam=0,
- double aVParam=0);
- const virtual double * Coords() const;
- SMDS_TypeOfPosition GetTypeOfPosition() const;
- void SetUParameter(double aUparam);
- void SetVParameter(double aVparam);
- double GetUParameter() const;
- double GetVParameter() const;
+ SMDS_FacePosition(int aFaceId=0, double aUParam=0,
+ double aVParam=0);
+ const virtual double * Coords() const;
+ SMDS_TypeOfPosition GetTypeOfPosition() const;
+ void SetUParameter(double aUparam);
+ void SetVParameter(double aVparam);
+ double GetUParameter() const;
+ double GetVParameter() const;
private:
- double myUParameter;
- double myVParameter;
+ double myUParameter;
+ double myVParameter;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifndef _SMDS_Iterator_HeaderFile
template<typename VALUE> class SMDS_Iterator
{
public:
- /// Return true if and only if there are other object in this iterator
- virtual bool more()=0;
-
- /// Return the current object and step to the next one
- virtual VALUE next()=0;
-
- /// Delete the current element and step to the next one
- virtual void remove(){}
-
- /// Provide virtual destructor just for case if some derived iterator
+ /// Return true if and only if there are other object in this iterator
+ virtual bool more()=0;
+
+ /// Return the current object and step to the next one
+ virtual VALUE next()=0;
+
+ /// Delete the current element and step to the next one
+ virtual void remove(){}
+
+ /// Provide virtual destructor just for case if some derived iterator
/// must have a destructor
- virtual ~SMDS_Iterator(){}
+ virtual ~SMDS_Iterator(){}
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifdef _MSC_VER
bool SMDS_IteratorOfElements::subMore()
{
- if((t2Iterator.get()==NULL)||(!t2Iterator->more()))
- {
- if(t1Iterator->more())
- {
- t2Iterator=t1Iterator->next()->elementsIterator(myType);
- return subMore();
- }
- else return false;
- }
- else return true;
+ if((t2Iterator.get()==NULL)||(!t2Iterator->more()))
+ {
+ if(t1Iterator->more())
+ {
+ t2Iterator=t1Iterator->next()->elementsIterator(myType);
+ return subMore();
+ }
+ else return false;
+ }
+ else return true;
}
const SMDS_MeshElement * SMDS_IteratorOfElements::subNext()
{
- if((t2Iterator.get()==NULL)||(!t2Iterator->more()))
- if(t1Iterator->more())
- t2Iterator=t1Iterator->next()->elementsIterator(myType);
- return t2Iterator->next();
+ if((t2Iterator.get()==NULL)||(!t2Iterator->more()))
+ if(t1Iterator->more())
+ t2Iterator=t1Iterator->next()->elementsIterator(myType);
+ return t2Iterator->next();
}
/////////////////////////////////////////////////////////////////////////////
myType(type), myElement(element),
myProxyElement(NULL)
{
- while(subMore())
- alreadyReturnedElements.insert(subNext());
- itAlreadyReturned= alreadyReturnedElements.begin();
- switch(myElement->GetType())
- {
- case SMDSAbs_Node:
- case SMDSAbs_Edge: myReverseIteration=true; break;
- case SMDSAbs_Face: myReverseIteration=(type==SMDSAbs_Volume); break;
- default: myReverseIteration=false;
- }
+ while(subMore())
+ alreadyReturnedElements.insert(subNext());
+ itAlreadyReturned= alreadyReturnedElements.begin();
+ switch(myElement->GetType())
+ {
+ case SMDSAbs_Node:
+ case SMDSAbs_Edge: myReverseIteration=true; break;
+ case SMDSAbs_Face: myReverseIteration=(type==SMDSAbs_Volume); break;
+ default: myReverseIteration=false;
+ }
}
bool SMDS_IteratorOfElements::more()
{
- if(myProxyElement==NULL)
- {
- while(itAlreadyReturned!=alreadyReturnedElements.end())
- {
- myProxyElement=*itAlreadyReturned;
- itAlreadyReturned++;
+ if(myProxyElement==NULL)
+ {
+ while(itAlreadyReturned!=alreadyReturnedElements.end())
+ {
+ myProxyElement=*itAlreadyReturned;
+ itAlreadyReturned++;
- if(myReverseIteration)
- {
- SMDS_ElemIteratorPtr it=
- myProxyElement->elementsIterator(myElement->GetType());
- while(it->more())
- {
- if(it->next()==myElement) return true;
- }
- }
- else return true;
- }
- myProxyElement=NULL;
- return false;
- }
- else return true;
+ if(myReverseIteration)
+ {
+ SMDS_ElemIteratorPtr it=
+ myProxyElement->elementsIterator(myElement->GetType());
+ while(it->more())
+ {
+ if(it->next()==myElement) return true;
+ }
+ }
+ else return true;
+ }
+ myProxyElement=NULL;
+ return false;
+ }
+ else return true;
}
const SMDS_MeshElement * SMDS_IteratorOfElements::next()
{
- more();
- const SMDS_MeshElement *e=myProxyElement;
- myProxyElement=NULL;
- return e;
+ more();
+ const SMDS_MeshElement *e=myProxyElement;
+ myProxyElement=NULL;
+ return e;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#include "SMESH_SMDS.hxx"
/// Create an iterator which look for elements of type type which are linked
/// to the element element. it is the iterator to get connectivity of element
//////////////////////////////////////////////////////////////////////////////
- SMDS_IteratorOfElements(const SMDS_MeshElement * element,
+ SMDS_IteratorOfElements(const SMDS_MeshElement * element,
SMDSAbs_ElementType type,
const SMDS_ElemIteratorPtr& it);
- bool more();
- const SMDS_MeshElement * next();
+ bool more();
+ const SMDS_MeshElement * next();
private:
- SMDS_ElemIteratorPtr t2Iterator;
- SMDS_ElemIteratorPtr t1Iterator;
- SMDSAbs_ElementType myType;
- const SMDS_MeshElement * myProxyElement;
- const SMDS_MeshElement * myElement;
- bool myReverseIteration;
+ SMDS_ElemIteratorPtr t2Iterator;
+ SMDS_ElemIteratorPtr t1Iterator;
+ SMDSAbs_ElementType myType;
+ const SMDS_MeshElement * myProxyElement;
+ const SMDS_MeshElement * myElement;
+ bool myReverseIteration;
- std::set<const SMDS_MeshElement*> alreadyReturnedElements;
- std::set<const SMDS_MeshElement*>::iterator itAlreadyReturned;
- bool subMore();
- const SMDS_MeshElement * subNext();
+ std::set<const SMDS_MeshElement*> alreadyReturnedElements;
+ std::set<const SMDS_MeshElement*>::iterator itAlreadyReturned;
+ bool subMore();
+ const SMDS_MeshElement * subNext();
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMDS_MemoryLimit.cxx
// Created : Fri Sep 21 17:16:42 2007
// Author : Edward AGAPOV (eap)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SMESH SMDS : implementaion of Salome mesh data structure
+// SMESH SMDS : implementaion of Salome mesh data structure
+//
#ifdef _MSC_VER
#pragma warning(disable:4786)
#endif
/// Add a polygon defined by its nodes IDs
///////////////////////////////////////////////////////////////////////////////
-SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (std::vector<int> nodes_ids,
+SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (vector<int> nodes_ids,
const int ID)
{
int nbNodes = nodes_ids.size();
- std::vector<const SMDS_MeshNode*> nodes (nbNodes);
+ vector<const SMDS_MeshNode*> nodes (nbNodes);
for (int i = 0; i < nbNodes; i++) {
nodes[i] = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(nodes_ids[i]);
if (!nodes[i]) return NULL;
///////////////////////////////////////////////////////////////////////////////
SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID
- (std::vector<const SMDS_MeshNode*> nodes,
+ (vector<const SMDS_MeshNode*> nodes,
const int ID)
{
SMDS_MeshFace * face;
/// An ID is automatically affected to the created face.
///////////////////////////////////////////////////////////////////////////////
-SMDS_MeshFace* SMDS_Mesh::AddPolygonalFace (std::vector<const SMDS_MeshNode*> nodes)
+SMDS_MeshFace* SMDS_Mesh::AddPolygonalFace (vector<const SMDS_MeshNode*> nodes)
{
return SMDS_Mesh::AddPolygonalFaceWithID(nodes, myElementIDFactory->GetFreeID());
}
///////////////////////////////////////////////////////////////////////////////
SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID
- (std::vector<int> nodes_ids,
- std::vector<int> quantities,
+ (vector<int> nodes_ids,
+ vector<int> quantities,
const int ID)
{
int nbNodes = nodes_ids.size();
- std::vector<const SMDS_MeshNode*> nodes (nbNodes);
+ vector<const SMDS_MeshNode*> nodes (nbNodes);
for (int i = 0; i < nbNodes; i++) {
nodes[i] = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(nodes_ids[i]);
if (!nodes[i]) return NULL;
///////////////////////////////////////////////////////////////////////////////
SMDS_MeshVolume* SMDS_Mesh::AddPolyhedralVolumeWithID
- (std::vector<const SMDS_MeshNode*> nodes,
- std::vector<int> quantities,
+ (vector<const SMDS_MeshNode*> nodes,
+ vector<int> quantities,
const int ID)
{
SMDS_MeshVolume* volume;
///////////////////////////////////////////////////////////////////////////////
SMDS_MeshVolume* SMDS_Mesh::AddPolyhedralVolume
- (std::vector<const SMDS_MeshNode*> nodes,
- std::vector<int> quantities)
+ (vector<const SMDS_MeshNode*> nodes,
+ vector<int> quantities)
{
int ID = myElementIDFactory->GetFreeID();
SMDS_MeshVolume * v = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, ID);
//purpose : find polygon
//=======================================================================
-const SMDS_MeshFace* SMDS_Mesh::FindFace (std::vector<int> nodes_ids) const
+const SMDS_MeshFace* SMDS_Mesh::FindFace (const vector<int>& nodes_ids) const
{
int nbnodes = nodes_ids.size();
- std::vector<const SMDS_MeshNode *> poly_nodes (nbnodes);
+ vector<const SMDS_MeshNode *> poly_nodes (nbnodes);
for (int inode = 0; inode < nbnodes; inode++) {
const SMDS_MeshNode * node = FindNode(nodes_ids[inode]);
if (node == NULL) return NULL;
return FindFace(poly_nodes);
}
-const SMDS_MeshFace* SMDS_Mesh::FindFace (std::vector<const SMDS_MeshNode *> nodes)
+const SMDS_MeshFace* SMDS_Mesh::FindFace (const vector<const SMDS_MeshNode *>& nodes)
{
- if ( nodes.size() > 2 && nodes[0] ) {
- SMDS_ElemIteratorPtr itF = nodes[0]->GetInverseElementIterator(SMDSAbs_Face);
- while (itF->more()) {
- const SMDS_MeshElement* f = itF->next();
- if ( f->NbNodes() == nodes.size() ) {
- SMDS_ElemIteratorPtr it2 = f->nodesIterator();
- while(it2->more()) {
- if ( find( nodes.begin(), nodes.end(), it2->next() ) == nodes.end() ) {
- f = 0;
- break;
- }
+ return (const SMDS_MeshFace*) FindElement( nodes, SMDSAbs_Face );
+}
+
+
+//================================================================================
+/*!
+ * \brief Return element based on all given nodes
+ * \param nodes - node of element
+ * \param type - type of element
+ * \param noMedium - true if medium nodes of quadratic element are not included in <nodes>
+ * \retval const SMDS_MeshElement* - found element or NULL
+ */
+//================================================================================
+
+const SMDS_MeshElement* SMDS_Mesh::FindElement (const vector<const SMDS_MeshNode *>& nodes,
+ const SMDSAbs_ElementType type,
+ const bool noMedium)
+{
+ if ( nodes.size() > 0 && nodes[0] )
+ {
+ SMDS_ElemIteratorPtr itF = nodes[0]->GetInverseElementIterator(type);
+ while (itF->more())
+ {
+ const SMDS_MeshElement* e = itF->next();
+ int nbNodesToCheck = noMedium ? e->NbCornerNodes() : e->NbNodes();
+ if ( nbNodesToCheck == nodes.size() )
+ {
+ for ( int i = 1; e && i < nodes.size(); ++ i )
+ {
+ int nodeIndex = e->GetNodeIndex( nodes[ i ]);
+ if ( nodeIndex < 0 || nodeIndex >= nbNodesToCheck )
+ e = 0;
}
- if ( f )
- return static_cast<const SMDS_MeshFace *> (f);
+ if ( e )
+ return static_cast<const SMDS_MeshFace *> (e);
}
}
}
///////////////////////////////////////////////////////////////////////////////
void SMDS_Mesh::setInverseElements(bool b)
{
- if(!b) MESSAGE("Error : inverseElement=false not implemented");
- myHasInverseElements=b;
+ if(!b) MESSAGE("Error : inverseElement=false not implemented");
+ myHasInverseElements=b;
}
+namespace {
+
///////////////////////////////////////////////////////////////////////////////
///Iterator on NCollection_Map
///////////////////////////////////////////////////////////////////////////////
_type = typ;
}
- bool more()
+bool more()
{
while (_ctr < _map.size())
{
}
};
+//================================================================================
+ /*!
+ * \brief Iterator on elements in id increasing order
+ */
+ //================================================================================
+
+ template <typename ELEM=const SMDS_MeshElement*>
+ class IdSortedIterator : public SMDS_Iterator<ELEM>
+ {
+ const SMDS_MeshElementIDFactory& myIDFact;
+ int myID, myMaxID;
+ ELEM myElem;
+
+ public:
+ IdSortedIterator(const SMDS_MeshElementIDFactory& fact)
+ :myIDFact( fact ), myID(1), myMaxID( myIDFact.GetMaxID() ), myElem(0)
+ {
+ next();
+ }
+ bool more()
+ {
+ return myElem;
+ }
+ ELEM next()
+ {
+ ELEM current = myElem;
+ for ( myElem = 0; myID <= myMaxID && !myElem; ++myID )
+ myElem = (ELEM) myIDFact.MeshElement( myID );
+ return current;
+ }
+ };
+}
+
///////////////////////////////////////////////////////////////////////////////
/// Return an iterator on nodes of the current mesh factory
///////////////////////////////////////////////////////////////////////////////
-SMDS_NodeIteratorPtr SMDS_Mesh::nodesIterator() const
+SMDS_NodeIteratorPtr SMDS_Mesh::nodesIterator(bool idInceasingOrder) const
{
- //return SMDS_NodeIteratorPtr
- // (new SMDS_Mesh_MyNodeIterator(myNodeIDFactory->elementsIterator()));
typedef MYNode_Map_Iterator
< SetOfNodes, const SMDS_MeshNode*, SMDS_NodeIterator > TIterator;
- return SMDS_NodeIteratorPtr(new TIterator(myNodes));
+ typedef IdSortedIterator< const SMDS_MeshNode* > TSortedIterator;
+/* return ( idInceasingOrder ?
+ SMDS_NodeIteratorPtr( new TSortedIterator( *myNodeIDFactory )) :
+ SMDS_NodeIteratorPtr( new TIterator(myNodes)));*/
+ return ( SMDS_NodeIteratorPtr( new TIterator(myNodes)));
}
///////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_Mesh.hxx
// Module : SMESH
-
+//
#ifndef _SMDS_Mesh_HeaderFile
#define _SMDS_Mesh_HeaderFile
inline vtkUnstructuredGrid* getGrid() {return myGrid; };
inline int getMeshId() {return myMeshId; };
- SMDS_NodeIteratorPtr nodesIterator() const;
+ SMDS_NodeIteratorPtr nodesIterator(bool idInceasingOrder=false) const;
SMDS_0DElementIteratorPtr elements0dIterator() const;
SMDS_EdgeIteratorPtr edgesIterator() const;
SMDS_FaceIteratorPtr facesIterator() const;
const SMDS_MeshNode *n7,
const SMDS_MeshNode *n8);
- const SMDS_MeshFace *FindFace(std::vector<int> nodes_ids) const;
- static const SMDS_MeshFace* FindFace(std::vector<const SMDS_MeshNode *> nodes);
+ const SMDS_MeshFace *FindFace(const std::vector<int>& nodes_ids) const;
+ static const SMDS_MeshFace* FindFace(const std::vector<const SMDS_MeshNode *>& nodes);
+ static const SMDS_MeshElement* FindElement(const std::vector<const SMDS_MeshNode *>& nodes,
+ const SMDSAbs_ElementType type=SMDSAbs_All,
+ const bool noMedium=true);
/*!
* \brief Raise an exception if free memory (ram+swap) too low
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_Mesh0DElement.cxx
// Author : Jean-Michel BOULCOURT
// Module : SMESH
-
+//
#ifdef _MSC_VER
#pragma warning(disable:4786)
#endif
//=======================================================================
SMDS_Mesh0DElement::SMDS_Mesh0DElement (const SMDS_MeshNode * node)
{
- MESSAGE("SMDS_Mesh0DElement " << GetID());
+ MESSAGE("SMDS_Mesh0DElement " << GetID());
myNode = node;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_Mesh0DElement.hxx
// Module : SMESH
-
+//
#ifndef _SMDS_Mesh0DElement_HeaderFile
#define _SMDS_Mesh0DElement_HeaderFile
-#ifndef _SMDS_MESHEDGE_HXX_
-#define _SMDS_MESHEDGE_HXX_
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMDS : implementaion of Salome mesh data structure
+// File : SMDS_MeshEdge.hxx
+// Module : SMESH
+//
+#ifndef _SMDS_MeshEdge_HeaderFile
+#define _SMDS_MeshEdge_HeaderFile
#include "SMESH_SMDS.hxx"
{
public:
- SMDSAbs_ElementType GetType() const;
- virtual vtkIdType GetVtkType() const;
+ SMDSAbs_ElementType GetType() const;
+ virtual vtkIdType GetVtkType() const;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifdef _MSC_VER
void SMDS_MeshElement::Print(ostream & OS) const
{
- OS << "dump of mesh element" << endl;
+ OS << "dump of mesh element" << endl;
}
ostream & operator <<(ostream & OS, const SMDS_MeshElement * ME)
{
- ME->Print(OS);
- return OS;
+ ME->Print(OS);
+ return OS;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
SMDS_ElemIteratorPtr SMDS_MeshElement::nodesIterator() const
{
- return elementsIterator(SMDSAbs_Node);
+ return elementsIterator(SMDSAbs_Node);
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
SMDS_ElemIteratorPtr SMDS_MeshElement::edgesIterator() const
{
- return elementsIterator(SMDSAbs_Edge);
+ return elementsIterator(SMDSAbs_Edge);
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
SMDS_ElemIteratorPtr SMDS_MeshElement::facesIterator() const
{
- return elementsIterator(SMDSAbs_Face);
+ return elementsIterator(SMDSAbs_Face);
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
int SMDS_MeshElement::NbNodes() const
{
- int nbnodes=0;
- SMDS_ElemIteratorPtr it=nodesIterator();
- while(it->more())
- {
- it->next();
- nbnodes++;
- }
- return nbnodes;
+ int nbnodes=0;
+ SMDS_ElemIteratorPtr it=nodesIterator();
+ while(it->more())
+ {
+ it->next();
+ nbnodes++;
+ }
+ return nbnodes;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
int SMDS_MeshElement::NbEdges() const
{
- int nbedges=0;
- SMDS_ElemIteratorPtr it=edgesIterator();
- while(it->more())
- {
- it->next();
- nbedges++;
- }
- return nbedges;
+ int nbedges=0;
+ SMDS_ElemIteratorPtr it=edgesIterator();
+ while(it->more())
+ {
+ it->next();
+ nbedges++;
+ }
+ return nbedges;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
int SMDS_MeshElement::NbFaces() const
{
- int nbfaces=0;
- SMDS_ElemIteratorPtr it=facesIterator();
- while(it->more())
- {
- it->next();
- nbfaces++;
- }
- return nbfaces;
+ int nbfaces=0;
+ SMDS_ElemIteratorPtr it=facesIterator();
+ while(it->more())
+ {
+ it->next();
+ nbfaces++;
+ }
+ return nbfaces;
}
///////////////////////////////////////////////////////////////////////////////
const SMDS_MeshElement* next()
{
myMore=false;
- return myElement;
- }
+ return myElement;
+ }
};
SMDS_ElemIteratorPtr SMDS_MeshElement::
- elementsIterator(SMDSAbs_ElementType type) const
+ elementsIterator(SMDSAbs_ElementType type) const
{
- /** @todo Check that iterator in the child classes return elements
- in the same order for each different implementation (i.e: SMDS_VolumeOfNodes
- and SMDS_VolumeOfFaces */
-
- if(type==GetType())
+ /** @todo Check that iterator in the child classes return elements
+ in the same order for each different implementation (i.e: SMDS_VolumeOfNodes
+ and SMDS_VolumeOfFaces */
+
+ if(type==GetType())
return SMDS_ElemIteratorPtr(new SMDS_MeshElement_MyIterator(this));
- else
- {
+ else
+ {
MESSAGE("Iterator not implemented");
return SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL);
- }
+ }
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
int SMDS_MeshElement::GetID() const
{
- return myID;
+ return myID;
}
bool operator<(const SMDS_MeshElement& e1, const SMDS_MeshElement& e2)
{
- if(e1.GetType()!=e2.GetType()) return false;
- switch(e1.GetType())
- {
- case SMDSAbs_Node:
- return static_cast<const SMDS_MeshNode &>(e1) <
- static_cast<const SMDS_MeshNode &>(e2);
+ if(e1.GetType()!=e2.GetType()) return false;
+ switch(e1.GetType())
+ {
+ case SMDSAbs_Node:
+ return static_cast<const SMDS_MeshNode &>(e1) <
+ static_cast<const SMDS_MeshNode &>(e2);
- case SMDSAbs_Edge:
- return static_cast<const SMDS_MeshEdge &>(e1) <
- static_cast<const SMDS_MeshEdge &>(e2);
+ case SMDSAbs_Edge:
+ return static_cast<const SMDS_MeshEdge &>(e1) <
+ static_cast<const SMDS_MeshEdge &>(e2);
- case SMDSAbs_Face:
- return static_cast<const SMDS_MeshFace &>(e1) <
- static_cast<const SMDS_MeshFace &>(e2);
+ case SMDSAbs_Face:
+ return static_cast<const SMDS_MeshFace &>(e1) <
+ static_cast<const SMDS_MeshFace &>(e2);
- case SMDSAbs_Volume:
- return static_cast<const SMDS_MeshVolume &>(e1) <
- static_cast<const SMDS_MeshVolume &>(e2);
+ case SMDSAbs_Volume:
+ return static_cast<const SMDS_MeshVolume &>(e1) <
+ static_cast<const SMDS_MeshVolume &>(e2);
- default : MESSAGE("Internal Error");
- }
+ default : MESSAGE("Internal Error");
+ }
return false;
}
return false;
}
+//================================================================================
+/*!
+ * \brief Return number of nodes excluding medium ones
+ */
+//================================================================================
+
+int SMDS_MeshElement::NbCornerNodes() const
+{
+ return IsQuadratic() ? NbNodes() - NbEdges() : NbNodes();
+}
+
//================================================================================
/*!
* \brief Check if a node belongs to the element
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshElement.hxx
// Module : SMESH
#define _SMDS_MeshElement_HeaderFile
#include "SMESH_SMDS.hxx"
-
+
#include "SMDSAbs_ElementType.hxx"
#include "SMDS_MeshObject.hxx"
#include "SMDS_ElemIterator.hxx"
#include "SMDS_MeshElementIDFactory.hxx"
+#include "SMDS_StdIterator.hxx"
#include <vector>
#include <iostream>
SMDS_ElemIteratorPtr facesIterator() const;
virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const;
+ // std-like iteration on nodes
+ typedef SMDS_StdIterator< const SMDS_MeshNode*, SMDS_ElemIteratorPtr > iterator;
+ iterator begin_nodes() const { return iterator( nodesIterator() ); }
+ iterator end_nodes() const { return iterator(); }
+
virtual int NbNodes() const;
virtual int NbEdges() const;
virtual int NbFaces() const;
virtual SMDSAbs_EntityType GetEntityType() const = 0;
virtual bool IsMediumNode(const SMDS_MeshNode* node) const;
+ virtual int NbCornerNodes() const;
friend SMDS_EXPORT std::ostream & operator <<(std::ostream & OS, const SMDS_MeshElement *);
friend SMDS_EXPORT bool SMDS_MeshElementIDFactory::BindID(int ID,SMDS_MeshElement* elem);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshElementIDFactory.cxx
// Author : Jean-Michel BOULCOURT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshElementIDFactory.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#include "SMDS_MeshFace.hxx"
SMDSAbs_ElementType SMDS_MeshFace::GetType() const
{
- return SMDSAbs_Face;
+ return SMDSAbs_Face;
}
vtkIdType SMDS_MeshFace::GetVtkType() const
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshFace.hxx
// Module : SMESH
class SMDS_EXPORT SMDS_MeshFace:public SMDS_MeshCell
{
public:
- SMDSAbs_ElementType GetType() const;
- virtual vtkIdType GetVtkType() const;
+ SMDSAbs_ElementType GetType() const;
+ virtual vtkIdType GetVtkType() const;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshGroup.cxx
// Author : Jean-Michel BOULCOURT
SMDS_MeshGroup::SMDS_MeshGroup(const SMDS_Mesh * theMesh,
const SMDSAbs_ElementType theType)
- :myMesh(theMesh),myType(theType), myParent(NULL)
+ :myMesh(theMesh),myType(theType), myParent(NULL)
{
}
SMDS_MeshGroup::SMDS_MeshGroup(SMDS_MeshGroup * theParent,
const SMDSAbs_ElementType theType)
- :myMesh(theParent->myMesh),myType(theType), myParent(theParent)
+ :myMesh(theParent->myMesh),myType(theType), myParent(theParent)
{
}
const SMDS_MeshGroup *SMDS_MeshGroup::AddSubGroup
(const SMDSAbs_ElementType theType)
{
- const SMDS_MeshGroup * subgroup = new SMDS_MeshGroup(this,theType);
- myChildren.insert(myChildren.end(),subgroup);
- return subgroup;
+ const SMDS_MeshGroup * subgroup = new SMDS_MeshGroup(this,theType);
+ myChildren.insert(myChildren.end(),subgroup);
+ return subgroup;
}
//=======================================================================
bool SMDS_MeshGroup::RemoveSubGroup(const SMDS_MeshGroup * theGroup)
{
- bool found = false;
- list<const SMDS_MeshGroup*>::iterator itgroup;
- for(itgroup=myChildren.begin(); itgroup!=myChildren.end(); itgroup++)
- {
- const SMDS_MeshGroup* subgroup=*itgroup;
- if (subgroup == theGroup)
- {
- found = true;
- myChildren.erase(itgroup);
- }
- }
-
- return found;
+ bool found = false;
+ list<const SMDS_MeshGroup*>::iterator itgroup;
+ for(itgroup=myChildren.begin(); itgroup!=myChildren.end(); itgroup++)
+ {
+ const SMDS_MeshGroup* subgroup=*itgroup;
+ if (subgroup == theGroup)
+ {
+ found = true;
+ myChildren.erase(itgroup);
+ }
+ }
+
+ return found;
}
//=======================================================================
bool SMDS_MeshGroup::RemoveFromParent()
{
-
- if (myParent==NULL) return false;
- else
- {
- return (myParent->RemoveSubGroup(this));
- }
+
+ if (myParent==NULL) return false;
+ else
+ {
+ return (myParent->RemoveSubGroup(this));
+ }
}
//=======================================================================
//function : Clear
void SMDS_MeshGroup::Clear()
{
- myElements.clear();
- myType = SMDSAbs_All;
+ myElements.clear();
+ myType = SMDSAbs_All;
}
//=======================================================================
void SMDS_MeshGroup::Add(const SMDS_MeshElement * theElem)
{
- // the type of the group is determined by the first element added
- if (myElements.empty()) myType = theElem->GetType();
- else if (theElem->GetType() != myType) {
- MESSAGE("SMDS_MeshGroup::Add : Type Mismatch "<<theElem->GetType()<<"!="<<myType);
- return;
- }
-
- myElements.insert(theElem);
+ // the type of the group is determined by the first element added
+ if (myElements.empty()) myType = theElem->GetType();
+ else if (theElem->GetType() != myType) {
+ MESSAGE("SMDS_MeshGroup::Add : Type Mismatch "<<theElem->GetType()<<"!="<<myType);
+ return;
+ }
+
+ myElements.insert(theElem);
}
//=======================================================================
bool SMDS_MeshGroup::Contains(const SMDS_MeshElement * theElem) const
{
- return myElements.find(theElem)!=myElements.end();
+ return myElements.find(theElem)!=myElements.end();
}
//=======================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshGroup.hxx
// Module : SMESH
class SMDS_EXPORT SMDS_MeshGroup:public SMDS_MeshObject
{
public:
- SMDS_MeshGroup(const SMDS_Mesh * theMesh,
+ SMDS_MeshGroup(const SMDS_Mesh * theMesh,
const SMDSAbs_ElementType theType = SMDSAbs_All);
- const SMDS_MeshGroup * AddSubGroup
+ const SMDS_MeshGroup * AddSubGroup
(const SMDSAbs_ElementType theType = SMDSAbs_All);
- virtual bool RemoveSubGroup(const SMDS_MeshGroup* theGroup);
- virtual bool RemoveFromParent();
+ virtual bool RemoveSubGroup(const SMDS_MeshGroup* theGroup);
+ virtual bool RemoveFromParent();
const SMDS_Mesh* GetMesh() const { return myMesh; }
void SetType (const SMDSAbs_ElementType theType);
void Clear();
- void Add(const SMDS_MeshElement * theElem);
- bool Remove(const SMDS_MeshElement * theElem);
- bool IsEmpty() const { return myElements.empty(); }
- int Extent() const { return myElements.size(); }
+ void Add(const SMDS_MeshElement * theElem);
+ bool Remove(const SMDS_MeshElement * theElem);
+ bool IsEmpty() const { return myElements.empty(); }
+ int Extent() const { return myElements.size(); }
- int SubGroupsNb() const { return myChildren.size(); }
+ int SubGroupsNb() const { return myChildren.size(); }
SMDSAbs_ElementType GetType() const { return myType; }
- bool Contains(const SMDS_MeshElement * theElem) const;
+ bool Contains(const SMDS_MeshElement * theElem) const;
void InitIterator() const
{ const_cast<TIterator&>(myIterator) = myElements.begin(); }
{ return *(const_cast<TGroupIterator&>(myGroupIterator))++; }
private:
- SMDS_MeshGroup(SMDS_MeshGroup* theParent,
+ SMDS_MeshGroup(SMDS_MeshGroup* theParent,
const SMDSAbs_ElementType theType = SMDSAbs_All);
typedef std::set<const SMDS_MeshElement *>::const_iterator TIterator;
typedef std::list<const SMDS_MeshGroup *>::const_iterator TGroupIterator;
- const SMDS_Mesh * myMesh;
- SMDSAbs_ElementType myType;
- std::set<const SMDS_MeshElement *> myElements;
- SMDS_MeshGroup * myParent;
- std::list<const SMDS_MeshGroup*> myChildren;
+ const SMDS_Mesh * myMesh;
+ SMDSAbs_ElementType myType;
+ std::set<const SMDS_MeshElement *> myElements;
+ SMDS_MeshGroup * myParent;
+ std::list<const SMDS_MeshGroup*> myChildren;
TIterator myIterator;
TGroupIterator myGroupIterator;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshIDFactory.cxx
// Author : Jean-Michel BOULCOURT
int SMDS_MeshIDFactory::GetFreeID()
{
- int newid;
- if (myPoolOfID.empty())
+ int newid;
+ if (myPoolOfID.empty())
{
newid = ++myMaxID;
//MESSAGE("GetFreeID new " << newid);
}
- else
- {
- set<int>::iterator i = myPoolOfID.begin();
- newid = *i;//myPoolOfID.top();
- myPoolOfID.erase( i );//myPoolOfID.pop();
- //MESSAGE("GetFreeID pool " << newid);
- }
+ else
+ {
+ set<int>::iterator i = myPoolOfID.begin();
+ newid = *i;//myPoolOfID.top();
+ myPoolOfID.erase( i );//myPoolOfID.pop();
+ //MESSAGE("GetFreeID pool " << newid);
+ }
return newid;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshIDFactory.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMDS_MeshInfo.hxx
// Created : Mon Sep 24 18:32:41 2007
// Author : Edward AGAPOV (eap)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifdef _MSC_VER
void SMDS_MeshNode::Print(ostream & OS) const
{
- OS << "Node <" << myID << "> : X = " << X() << " Y = "
- << Y() << " Z = " << Z() << endl;
+ OS << "Node <" << myID << "> : X = " << X() << " Y = "
+ << Y() << " Z = " << Z() << endl;
}
//=======================================================================
void SMDS_MeshNode::SetPosition(const SMDS_PositionPtr& aPos)
{
- myPosition = aPos;
+ myPosition = aPos;
}
//=======================================================================
const SMDS_PositionPtr& SMDS_MeshNode::GetPosition() const
{
- return myPosition;
+ return myPosition;
}
//=======================================================================
const SMDS_MeshElement* elem = myMesh->FindElement(smdsId);
if (!elem)
{
- assert(0);
- throw SALOME_Exception("SMDS_MeshNode_MyInvIterator problem Null element");
+ assert(0);
+ throw SALOME_Exception("SMDS_MeshNode_MyInvIterator problem Null element");
}
//MESSAGE("vtkId " << vtkId << " smdsId " << smdsId << " " << (elem!=0));
iter++;
return elem;
- }
+ }
};
SMDS_ElemIteratorPtr SMDS_MeshNode::
- GetInverseElementIterator(SMDSAbs_ElementType type) const
+ GetInverseElementIterator(SMDSAbs_ElementType type) const
{
vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myID);
//MESSAGE("myID " << myID << " ncells " << l.ncells);
};
SMDS_ElemIteratorPtr SMDS_MeshNode::
- elementsIterator(SMDSAbs_ElementType type) const
+ elementsIterator(SMDSAbs_ElementType type) const
{
if(type==SMDSAbs_Node)
return SMDS_MeshElement::elementsIterator(SMDSAbs_Node);
int SMDS_MeshNode::NbNodes() const
{
- return 1;
+ return 1;
}
SMDSAbs_ElementType SMDS_MeshNode::GetType() const
{
- return SMDSAbs_Node;
+ return SMDSAbs_Node;
}
vtkIdType SMDS_MeshNode::GetVtkType() const
///////////////////////////////////////////////////////////////////////////////
bool operator<(const SMDS_MeshNode& e1, const SMDS_MeshNode& e2)
{
- return e1.GetID()<e2.GetID();
- /*if(e1.myX<e2.myX) return true;
- else if(e1.myX==e2.myX)
- {
- if(e1.myY<e2.myY) return true;
- else if(e1.myY==e2.myY) return (e1.myZ<e2.myZ);
- else return false;
- }
- else return false;*/
+ return e1.GetID()<e2.GetID();
+ /*if(e1.myX<e2.myX) return true;
+ else if(e1.myX==e2.myX)
+ {
+ if(e1.myY<e2.myY) return true;
+ else if(e1.myY==e2.myY) return (e1.myZ<e2.myZ);
+ else return false;
+ }
+ else return false;*/
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshNode.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshObject.cxx
// Author : Jean-Michel BOULCOURT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshObject.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshVolume.cxx
// Author : Jean-Michel BOULCOURT
SMDSAbs_ElementType SMDS_MeshVolume::GetType() const
{
- return SMDSAbs_Volume;
+ return SMDSAbs_Volume;
}
vtkIdType SMDS_MeshVolume::GetVtkType() const
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshVolume.hxx
// Module : SMESH
class SMDS_EXPORT SMDS_MeshVolume:public SMDS_MeshCell
{
-
+
public:
- SMDSAbs_ElementType GetType() const;
+ SMDSAbs_ElementType GetType() const;
virtual vtkIdType GetVtkType() const;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifdef _MSC_VER
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifndef _SMDS_PolygonalFaceOfNodes_HeaderFile
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifdef _MSC_VER
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_PolyhedralVolumeOfNodes.hxx
// Module : SMESH
//virtual ~SMDS_PolyhedralVolumeOfNodes();
- virtual SMDSAbs_ElementType GetType() const;
+ virtual SMDSAbs_ElementType GetType() const;
virtual SMDSAbs_EntityType GetEntityType() const { return SMDSEntity_Polyhedra; }
virtual bool IsPoly() const { return true; };
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_Position.cxx
// Author : Jean-Michel BOULCOURT
void SMDS_Position::SetShapeId(int aShapeId)
{
- myShapeId = aShapeId;
+ myShapeId = aShapeId;
}
//=======================================================================
int SMDS_Position::GetShapeId() const
{
- return myShapeId;
+ return myShapeId;
}
//=======================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_Position.hxx
// Module : SMESH
{
public:
- const virtual double * Coords() const = 0;
- virtual SMDS_TypeOfPosition GetTypeOfPosition() const = 0;
- virtual int GetDim() const;
- void SetShapeId(int aShapeId);
- int GetShapeId() const;
- virtual ~SMDS_Position() {}
+ const virtual double * Coords() const = 0;
+ virtual SMDS_TypeOfPosition GetTypeOfPosition() const = 0;
+ virtual int GetDim() const;
+ void SetShapeId(int aShapeId);
+ int GetShapeId() const;
+ virtual ~SMDS_Position() {}
protected:
- SMDS_Position(int aShapeId);
+ SMDS_Position(int aShapeId);
private:
- int myShapeId;
+ int myShapeId;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File: SMDS_QuadraticEdge.cxx
// Created: 16.01.06 16:25:42
const SMDS_MeshNode * node2,
const SMDS_MeshNode * node12)
:SMDS_LinearEdge(node1,node2)
-{
+{
myNodes[2]=node12;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_QuadraticEdge.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File: SMDS_QuadraticFaceOfNodes.cxx
// Created: 16.01.06 17:12:58
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_QuadraticVolumeOfNodes.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File: SMDS_QuadraticVolumeOfNodes.cxx
// Created: 17.01.06 09:46:11
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_QuadraticVolumeOfNodes.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_SetIterator.hxx
// Created : Mon Feb 27 16:57:43 2006
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_SpacePosition.cxx
// Author : Jean-Michel BOULCOURT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_SpacePosition.hxx
// Module : SMESH
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMDS : implementaion of Salome mesh data structure
+// File : SMDS_StdIterator.hxx
+// Created : Fri Feb 5 11:03:46 2010
+// Author : Edward AGAPOV (eap)
+//
+#ifndef __SMDS_StdIterator_HXX__
+#define __SMDS_StdIterator_HXX__
+
+
+///////////////////////////////////////////////////////////////////////////////
+/*!
+ * \brief Wrapper over pointer to SMDS_Iterator, like SMDS_ElemIteratorPtr, enabling
+ * its usage in std-like way: provide operators ++, *, etc.
+ */
+///////////////////////////////////////////////////////////////////////////////
+
+template<typename VALUE, class PtrSMDSIterator, class EqualVALUE = std::equal_to<VALUE> >
+class SMDS_StdIterator : public std::iterator< std::input_iterator_tag, VALUE >
+{
+ VALUE _value;
+ PtrSMDSIterator _piterator;
+ EqualVALUE _EqualVALUE;
+
+public:
+ typedef SMDS_StdIterator<VALUE, PtrSMDSIterator> _Self;
+
+ // constructor to use as return from begin()
+ SMDS_StdIterator( PtrSMDSIterator pItr )
+ : _value( pItr->more() ? (VALUE)(pItr->next()) : 0 ), _piterator(pItr)
+ {}
+ // constructor to use as return from end()
+ SMDS_StdIterator(): _value( 0 )
+ {}
+
+ /// Return the current object
+ VALUE operator*() const
+ { return _value; }
+
+ // Step to the next one
+ _Self&
+ operator++()
+ { _value = _piterator->more() ? VALUE( _piterator->next()) : 0; return *this; }
+
+ // Test of end
+ bool
+ operator!=(const _Self& __x) const
+ { return !_EqualVALUE( _value, __x._value); }
+
+};
+
+#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_TypeOfPosition.hxx
// Module : SMESH
enum SMDS_TypeOfPosition // Value is equal to shape dimention
{
- SMDS_TOP_UNSPEC = -1,
- SMDS_TOP_VERTEX = 0,
- SMDS_TOP_EDGE = 1,
- SMDS_TOP_FACE = 2,
- SMDS_TOP_3DSPACE = 3
+ SMDS_TOP_UNSPEC = -1,
+ SMDS_TOP_VERTEX = 0,
+ SMDS_TOP_EDGE = 1,
+ SMDS_TOP_FACE = 2,
+ SMDS_TOP_3DSPACE = 3
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_VertexPosition.cxx
// Author : Jean-Michel BOULCOURT
//=======================================================================
SMDS_VertexPosition:: SMDS_VertexPosition(const int aVertexId)
- :SMDS_Position(aVertexId)
+ :SMDS_Position(aVertexId)
{
}
const double *SMDS_VertexPosition::Coords() const
{
- const static double origin[]={0,0,0};
- MESSAGE("SMDS_VertexPosition::Coords not implemented");
- return origin;
+ const static double origin[]={0,0,0};
+ MESSAGE("SMDS_VertexPosition::Coords not implemented");
+ return origin;
}
SMDS_TypeOfPosition SMDS_VertexPosition::GetTypeOfPosition() const
{
- return SMDS_TOP_VERTEX;
+ return SMDS_TOP_VERTEX;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_VertexPosition.hxx
// Module : SMESH
class SMDS_EXPORT SMDS_VertexPosition:public SMDS_Position
{
- public:
- SMDS_TypeOfPosition GetTypeOfPosition() const;
- SMDS_VertexPosition(int aVertexId=0);
- const double *Coords() const;
+ public:
+ SMDS_TypeOfPosition GetTypeOfPosition() const;
+ SMDS_VertexPosition(int aVertexId=0);
+ const double *Coords() const;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_VolumeOfFaces.cxx
// Author : Jean-Michel BOULCOURT
void SMDS_VolumeOfFaces::Print(ostream & OS) const
{
- OS << "volume <" << GetID() << "> : ";
- int i;
- for (i = 0; i < NbFaces()-1; ++i) OS << myFaces[i] << ",";
- OS << myFaces[i]<< ") " << endl;
+ OS << "volume <" << GetID() << "> : ";
+ int i;
+ for (i = 0; i < NbFaces()-1; ++i) OS << myFaces[i] << ",";
+ OS << myFaces[i]<< ") " << endl;
}
int SMDS_VolumeOfFaces::NbFaces() const
{
- return myNbFaces;
+ return myNbFaces;
}
class SMDS_VolumeOfFaces_MyIterator:public SMDS_ElemIterator
};
SMDS_ElemIteratorPtr SMDS_VolumeOfFaces::
- elementsIterator(SMDSAbs_ElementType type) const
+ elementsIterator(SMDSAbs_ElementType type) const
{
switch(type)
{
const SMDS_MeshFace * face3,
const SMDS_MeshFace * face4)
{
- myNbFaces = 4;
- myFaces[0]=face1;
- myFaces[1]=face2;
- myFaces[2]=face3;
- myFaces[3]=face4;
- myFaces[4]=0;
- myFaces[5]=0;
+ myNbFaces = 4;
+ myFaces[0]=face1;
+ myFaces[1]=face2;
+ myFaces[2]=face3;
+ myFaces[3]=face4;
+ myFaces[4]=0;
+ myFaces[5]=0;
}
SMDS_VolumeOfFaces::SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
const SMDS_MeshFace * face4,
const SMDS_MeshFace * face5)
{
- myNbFaces = 5;
- myFaces[0]=face1;
- myFaces[1]=face2;
- myFaces[2]=face3;
- myFaces[3]=face4;
- myFaces[4]=face5;
- myFaces[5]=0;
+ myNbFaces = 5;
+ myFaces[0]=face1;
+ myFaces[1]=face2;
+ myFaces[2]=face3;
+ myFaces[3]=face4;
+ myFaces[4]=face5;
+ myFaces[5]=0;
}
SMDS_VolumeOfFaces::SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
const SMDS_MeshFace * face5,
const SMDS_MeshFace * face6)
{
- myNbFaces = 6;
- myFaces[0]=face1;
- myFaces[1]=face2;
- myFaces[2]=face3;
- myFaces[3]=face4;
- myFaces[4]=face5;
- myFaces[5]=face6;
+ myNbFaces = 6;
+ myFaces[0]=face1;
+ myFaces[1]=face2;
+ myFaces[2]=face3;
+ myFaces[3]=face4;
+ myFaces[4]=face5;
+ myFaces[5]=face6;
}
SMDSAbs_EntityType SMDS_VolumeOfFaces::GetEntityType() const
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_VolumeOfFaces.hxx
// Module : SMESH
class SMDS_EXPORT SMDS_VolumeOfFaces:public SMDS_MeshVolume
{
-
+
public:
- SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
+ SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
const SMDS_MeshFace * face2,
const SMDS_MeshFace * face3,
const SMDS_MeshFace * face4);
- SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
+ SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
const SMDS_MeshFace * face2,
const SMDS_MeshFace * face3,
const SMDS_MeshFace * face4,
const SMDS_MeshFace * face5);
- SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
+ SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
const SMDS_MeshFace * face2,
const SMDS_MeshFace * face3,
const SMDS_MeshFace * face4,
const SMDS_MeshFace * face5,
const SMDS_MeshFace * face6);
- virtual SMDSAbs_EntityType GetEntityType() const;
- void Print(std::ostream & OS) const;
-
- int NbFaces() const;
+ virtual SMDSAbs_EntityType GetEntityType() const;
+ void Print(std::ostream & OS) const;
+
+ int NbFaces() const;
protected:
- SMDS_ElemIteratorPtr
- elementsIterator(SMDSAbs_ElementType type) const;
- const SMDS_MeshFace * myFaces[6];
- int myNbFaces;
+ SMDS_ElemIteratorPtr
+ elementsIterator(SMDSAbs_ElementType type) const;
+ const SMDS_MeshFace * myFaces[6];
+ int myNbFaces;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifdef _MSC_VER
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshVolume.hxx
// Module : SMESH
class SMDS_EXPORT SMDS_VolumeOfNodes:public SMDS_MeshVolume
{
-
+
public:
- SMDS_VolumeOfNodes(
- const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3,
- const SMDS_MeshNode * node4);
- SMDS_VolumeOfNodes(
- const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3,
- const SMDS_MeshNode * node4,
- const SMDS_MeshNode * node5);
- SMDS_VolumeOfNodes(
- const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3,
- const SMDS_MeshNode * node4,
- const SMDS_MeshNode * node5,
- const SMDS_MeshNode * node6);
- SMDS_VolumeOfNodes(
- const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3,
- const SMDS_MeshNode * node4,
- const SMDS_MeshNode * node5,
- const SMDS_MeshNode * node6,
- const SMDS_MeshNode * node7,
- const SMDS_MeshNode * node8);
+ SMDS_VolumeOfNodes(
+ const SMDS_MeshNode * node1,
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3,
+ const SMDS_MeshNode * node4);
+ SMDS_VolumeOfNodes(
+ const SMDS_MeshNode * node1,
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3,
+ const SMDS_MeshNode * node4,
+ const SMDS_MeshNode * node5);
+ SMDS_VolumeOfNodes(
+ const SMDS_MeshNode * node1,
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3,
+ const SMDS_MeshNode * node4,
+ const SMDS_MeshNode * node5,
+ const SMDS_MeshNode * node6);
+ SMDS_VolumeOfNodes(
+ const SMDS_MeshNode * node1,
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3,
+ const SMDS_MeshNode * node4,
+ const SMDS_MeshNode * node5,
+ const SMDS_MeshNode * node6,
+ const SMDS_MeshNode * node7,
+ const SMDS_MeshNode * node8);
bool ChangeNodes(const SMDS_MeshNode* nodes[],
const int nbNodes);
~SMDS_VolumeOfNodes();
- void Print(std::ostream & OS) const;
- int NbFaces() const;
- int NbNodes() const;
- int NbEdges() const;
- virtual SMDSAbs_ElementType GetType() const;
+ void Print(std::ostream & OS) const;
+ int NbFaces() const;
+ int NbNodes() const;
+ int NbEdges() const;
+ virtual SMDSAbs_ElementType GetType() const;
virtual SMDSAbs_EntityType GetEntityType() const;
/*!
virtual const SMDS_MeshNode* GetNode(const int ind) const;
protected:
- SMDS_ElemIteratorPtr
- elementsIterator(SMDSAbs_ElementType type) const;
- const SMDS_MeshNode** myNodes;
- int myNbNodes;
+ SMDS_ElemIteratorPtr
+ elementsIterator(SMDSAbs_ElementType type) const;
+ const SMDS_MeshNode** myNodes;
+ int myNbNodes;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMDS_VolumeTool.cxx
// Created : Tue Jul 13 12:22:13 2004
// Author : Edward AGAPOV (eap)
SMDS_VolumeTool::~SMDS_VolumeTool()
{
- if (myVolumeNodes != NULL) {
- delete [] myVolumeNodes;
- myVolumeNodes = NULL;
- }
- if (myFaceNodes != NULL) {
- delete [] myFaceNodes;
- myFaceNodes = NULL;
- }
+ if ( myVolumeNodes != NULL ) delete [] myVolumeNodes;
+ if ( myFaceNodes != NULL ) delete [] myFaceNodes;
+
+ myFaceNodeIndices = NULL;
+ myVolumeNodes = myFaceNodes = NULL;
}
//=======================================================================
const int* SMDS_VolumeTool::GetFaceNodesIndices( int faceIndex )
{
- if (myVolume->IsPoly()) {
- MESSAGE("Warning: attempt to obtain FaceNodesIndices of polyhedral volume");
- return NULL;
- }
if ( !setFace( faceIndex ))
return 0;
+
+ if (myVolume->IsPoly())
+ {
+ myPolyIndices.resize( myFaceNbNodes + 1 );
+ myFaceNodeIndices = & myPolyIndices[0];
+ for ( int i = 0; i <= myFaceNbNodes; ++i )
+ myFaceNodeIndices[i] = myVolume->GetNodeIndex( myFaceNodes[i] );
+ }
return myFaceNodeIndices;
}
//purpose : return element
//=======================================================================
-const SMDS_MeshVolume* SMDS_VolumeTool::Get() const
+const SMDS_MeshVolume* SMDS_VolumeTool::Element() const
{
return static_cast<const SMDS_MeshVolume*>( myVolume );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_VolumeTool.hxx
// Module : SMESH
// Set volume.
// Return false if theVolume is not of type SMDSAbs_Volume
- const SMDS_MeshVolume* Get() const;
+ const SMDS_MeshVolume* Element() const;
// return element
int ID() const;
int myNbFaces;
int myVolumeNbNodes;
const SMDS_MeshNode** myVolumeNodes;
+ std::vector< int > myPolyIndices;
bool myExternalFaces;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_SMDS.hxx
// Author : Alexander A. BORODIN
// Module : SMESH
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH SMESH : implementaion of SMESH idl descriptions
# File : Makefile.in
# Author : Paul RASCLE, EDF
SMESH_OctreeNode.hxx \
SMESH_Comment.hxx \
SMESH_ComputeError.hxx \
+ SMESH_File.hxx \
SMESH_SMESH.hxx
# Libraries targets
SMESH_HypoFilter.cxx \
SMESH_MesherHelper.cxx \
SMESH_Octree.cxx \
- SMESH_OctreeNode.cxx
+ SMESH_OctreeNode.cxx \
+ SMESH_File.cxx
# additionnal information to compile and link file
libSMESHimpl_la_CPPFLAGS = \
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_0D_Algo.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_0D_Algo.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_1D_Algo.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_1D_Algo.hxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_2D_Algo.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_2D_Algo.hxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_3D_Algo.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_3D_Algo.hxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_Algo.cxx
// Author : Paul RASCLE, EDF
// Module : SMESH
//
-
#include "SMESH_Algo.hxx"
#include "SMESH_Comment.hxx"
#include "SMESH_Gen.hxx"
#include "utilities.h"
#include <algorithm>
+#include <limits>
using namespace std;
gen->_mapAlgo[hypId] = this;
_onlyUnaryInput = _requireDescretBoundary = _requireShape = true;
- _quadraticMesh = false;
+ _quadraticMesh = _supportSubmeshes = false;
_error = COMPERR_OK;
}
return length;
}
+//================================================================================
+/*!
+ * \brief Calculate normal of a mesh face
+ */
+//================================================================================
+
+bool SMESH_Algo::FaceNormal(const SMDS_MeshElement* F, gp_XYZ& normal, bool normalized)
+{
+ if ( !F || F->GetType() != SMDSAbs_Face )
+ return false;
+
+ normal.SetCoord(0,0,0);
+ int nbNodes = F->IsQuadratic() ? F->NbNodes()/2 : F->NbNodes();
+ for ( int i = 0; i < nbNodes-2; ++i )
+ {
+ gp_XYZ p[3];
+ for ( int n = 0; n < 3; ++n )
+ {
+ const SMDS_MeshNode* node = F->GetNode( i + n );
+ p[n].SetCoord( node->X(), node->Y(), node->Z() );
+ }
+ normal += ( p[2] - p[1] ) ^ ( p[0] - p[1] );
+ }
+ double size2 = normal.SquareModulus();
+ bool ok = ( size2 > numeric_limits<double>::min() * numeric_limits<double>::min());
+ if ( normalized && ok )
+ normal /= sqrt( size2 );
+
+ return ok;
+}
+
//================================================================================
/*!
* \brief Find out elements orientation on a geometrical face
*/
//================================================================================
-GeomAbs_Shape SMESH_Algo::Continuity(const TopoDS_Edge & E1,
- const TopoDS_Edge & E2)
+GeomAbs_Shape SMESH_Algo::Continuity(TopoDS_Edge E1,
+ TopoDS_Edge E2)
{
+ E1.Orientation(TopAbs_FORWARD), E2.Orientation(TopAbs_FORWARD); // avoid pb with internal edges
TopoDS_Vertex V = TopExp::LastVertex (E1, true);
if ( !V.IsSame( TopExp::FirstVertex(E2, true )))
if ( !TopExp::CommonVertex( E1, E2, V ))
return 0;
}
+//=======================================================================
+//function : GetCommonNodes
+//purpose : Return nodes common to two elements
+//=======================================================================
+
+vector< const SMDS_MeshNode*> SMESH_Algo::GetCommonNodes(const SMDS_MeshElement* e1,
+ const SMDS_MeshElement* e2)
+{
+ vector< const SMDS_MeshNode*> common;
+ for ( int i = 0 ; i < e1->NbNodes(); ++i )
+ if ( e2->GetNodeIndex( e1->GetNode( i )) >= 0 )
+ common.push_back( e1->GetNode( i ));
+ return common;
+}
+
//================================================================================
/*!
* \brief Sets event listener to submeshes if necessary
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_Algo.hxx
// Author : Paul RASCLE, EDF
// Module : SMESH
//
-
#ifndef _SMESH_ALGO_HXX_
#define _SMESH_ALGO_HXX_
class SMDS_MeshNode;
class SMESH_subMesh;
class SMESH_MesherHelper;
+class gp_XYZ;
-typedef std::map< SMESH_subMesh*, std::vector<int> > MapShapeNbElems;
-// vector must have size corresponding to EntityType_Last from SMDSAbs:
+typedef std::map< SMESH_subMesh*, std::vector<int> > MapShapeNbElems;
typedef std::map< SMESH_subMesh*, std::vector<int> >::iterator MapShapeNbElemsItr;
+/*!
+ * \brief Root of all algorithms
+ *
+ * Methods of the class are grouped into several parts:
+ * - main lifecycle methods, like Compute()
+ * - methods describing features of the algorithm, like NeedShape()
+ * - methods related to dependencies between sub-meshes imposed by the algorith
+ * - static utilities, like EdgeLength()
+ */
class SMESH_EXPORT SMESH_Algo:public SMESH_Hypothesis
{
public:
*/
static double EdgeLength(const TopoDS_Edge & E);
+ /*!
+ * \brief Calculate normal of a mesh face
+ */
+ static bool FaceNormal(const SMDS_MeshElement* F, gp_XYZ& normal, bool normalized=true);
+
/*!
* \brief Return continuity of two edges
* \param E1 - the 1st edge
* \param E2 - the 2nd edge
* \retval GeomAbs_Shape - regularity at the junction between E1 and E2
*/
- static GeomAbs_Shape Continuity(const TopoDS_Edge & E1, const TopoDS_Edge & E2);
+ static GeomAbs_Shape Continuity(TopoDS_Edge E1, TopoDS_Edge E2);
/*!
* \brief Return true if an edge can be considered as a continuation of another
* \param meshDS - mesh
* \retval const SMDS_MeshNode* - found node or NULL
*/
- static const SMDS_MeshNode* VertexNode(const TopoDS_Vertex& V,
- const SMESHDS_Mesh* meshDS);
+ static const SMDS_MeshNode* VertexNode(const TopoDS_Vertex& V, const SMESHDS_Mesh* meshDS);
+ /*!
+ * \brief Return nodes common to two elements
+ */
+ static std::vector< const SMDS_MeshNode*> GetCommonNodes(const SMDS_MeshElement* e1,
+ const SMDS_MeshElement* e2);
protected:
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_Pattern.hxx
// Created : Mon Aug 2 10:30:00 2004
// Author : Edward AGAPOV (eap)
TopoDS_Wire anOuterWire =
theShapeAnalysisAlgo ? ShapeAnalysis::OuterWire( theFace ) : BRepTools::OuterWire( theFace );
for ( TopoDS_Iterator wIt (theFace); wIt.More(); wIt.Next() )
- if ( !anOuterWire.IsSame( wIt.Value() ))
- aWireList.push_back( TopoDS::Wire( wIt.Value() ));
- else
- aWireList.push_front( TopoDS::Wire( wIt.Value() ));
+ if ( wIt.Value().ShapeType() == TopAbs_WIRE ) // it can be internal vertex!
+ {
+ if ( !anOuterWire.IsSame( wIt.Value() ))
+ aWireList.push_back( TopoDS::Wire( wIt.Value() ));
+ else
+ aWireList.push_front( TopoDS::Wire( wIt.Value() ));
+ }
// loop on edges of wires
theNbVertexInWires.clear();
// edge = TopoDS::Edge( edge.Oriented( wExp.Orientation() ));
theEdges.push_back( edge );
}
+ if ( iE == 0 ) // wExp returns nothing if e.g. the wire contains one internal edge
+ { // Issue 0020676
+ for ( TopoDS_Iterator e( *wlIt ); e.More(); e.Next(), ++iE )
+ theEdges.push_back( TopoDS::Edge( e.Value() ));
+ }
theNbVertexInWires.push_back( iE );
iE = 0;
if ( wlIt == aWireList.begin() && theEdges.size() > 1 ) { // the outer wire
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_Block.hxx
// Created : Tue Nov 30 12:42:18 2004
// Author : Edward AGAPOV (eap)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_Comment.hxx
// Created : Wed Mar 14 18:28:45 2007
this->string::operator=( _s.str() );
}
+ SMESH_Comment & operator=(const SMESH_Comment& c) {
+ _s << c.c_str() ;
+ this->string::operator=( _s.str() );
+ return *this;
+ }
+
template <class T>
SMESH_Comment( const T &anything ) {
_s << anything ;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_Hypothesis.hxx
// Author : Edward AGAPOV (eap)
_case2char(COMPERR_EXCEPTION );
_case2char(COMPERR_MEMORY_PB );
_case2char(COMPERR_ALGO_FAILED );
+ _case2char(COMPERR_BAD_SHAPE );
default:;
}
return "";
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx
// Created: 26.09.05 17:41:10
// Author: Sergey KUUL
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : SMESH_File.cxx
+// 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 <fcntl.h>
+#include <sys/stat.h>
+
+#ifdef WIN32
+#include <io.h>
+#else
+#include <sys/mman.h>
+#endif
+
+//================================================================================
+/*!
+ * \brief Creator opening the file for reading by default
+ */
+//================================================================================
+
+SMESH_File::SMESH_File(const std::string& name, bool open)
+ :_name(name), _size(-1), _file(0), _map(0), _pos(0), _end(0)
+{
+ if ( open ) this->open();
+}
+
+//================================================================================
+/*!
+ * \brief Destructor closing the file
+ */
+//================================================================================
+
+SMESH_File::~SMESH_File()
+{
+ close();
+}
+
+//================================================================================
+/*!
+ * \brief Open file for reading. Return true if there is something to read
+ */
+//================================================================================
+
+bool SMESH_File::open()
+{
+ int length = size();
+ if ( !_map && length > 0 )
+ {
+#ifdef WNT
+ _file = CreateFile(_name.data(), GENERIC_READ, FILE_SHARE_READ,
+ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ bool ok = ( _file != INVALID_HANDLE_VALUE );
+#else
+ _file = ::open(_name.data(), O_RDONLY );
+ bool ok = ( _file > 0 );
+#endif
+ if ( ok )
+ {
+#ifdef WNT
+ _mapObj = CreateFileMapping(_file, NULL, PAGE_READONLY, 0, (DWORD)length, NULL);
+ _map = (void*) MapViewOfFile( _mapObj, FILE_MAP_READ, 0, 0, 0 );
+#else
+ _map = ::mmap(0,length,PROT_READ,MAP_PRIVATE,_file,0);
+ if ( _map == MAP_FAILED ) _map = NULL;
+#endif
+ if ( _map != NULL )
+ {
+ _size = length;
+ _pos = (char*) _map;
+ _end = _pos + _size;
+ }
+ else
+ {
+#ifdef WNT
+ CloseHandle(_mapObj);
+ CloseHandle(_file);
+#else
+ ::close(_file);
+#endif
+ }
+ }
+ }
+ return _pos;
+}
+
+//================================================================================
+/*!
+ * \brief Close the file
+ */
+//================================================================================
+
+void SMESH_File::close()
+{
+ if ( _map != NULL )
+ {
+#ifdef WNT
+ UnmapViewOfFile(_map);
+ CloseHandle(_mapObj);
+ CloseHandle(_file);
+#else
+ ::munmap(_map, _size);
+ ::close(_file);
+#endif
+ _map = NULL;
+ _pos = _end = 0;
+ _size = -1;
+ }
+}
+
+//================================================================================
+/*!
+ * \brief Remove the file
+ */
+//================================================================================
+
+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;
+}
+
+//================================================================================
+/*!
+ * \brief Return file size
+ */
+//================================================================================
+
+int SMESH_File::size() const
+{
+ if ( _size >= 0 ) return _size; // size of 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;
+}
+
+//================================================================================
+/*!
+ * \brief Set cursor to the given position
+ */
+//================================================================================
+
+void SMESH_File::setPos(const char* pos)
+{
+ if ( pos > (const char*)_map && pos < _end )
+ _pos = (char*) pos;
+}
+
+//================================================================================
+/*!
+ * \brief Skip till current line end and return the skipped string
+ */
+//================================================================================
+
+std::string SMESH_File::getLine()
+{
+ std::string line;
+ const char* p = _pos;
+ while ( !eof() )
+ if ( *(++_pos) == '\n' )
+ break;
+ line.append( p, _pos );
+ if ( !eof() ) _pos++;
+ return line;
+}
+
+//================================================================================
+/*!
+ * \brief Move cursor to the file beginning
+ */
+//================================================================================
+
+void SMESH_File::rewind()
+{
+ _pos = (char*) _map;
+}
+
+//================================================================================
+/*!
+ * \brief Fill vector by reading out integers from file. Vector size gives number
+ * of integers to read
+ */
+//================================================================================
+
+bool SMESH_File::getInts(std::vector<int>& ints)
+{
+ int i = 0;
+ while ( i < ints.size() )
+ {
+ while ( !isdigit( *_pos ) && !eof()) ++_pos;
+ if ( eof() ) break;
+ if ( _pos[-1] == '-' ) --_pos;
+ ints[ i++ ] = strtol( _pos, (char**)&_pos, 10 );
+ }
+ return ( i == ints.size() );
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : SMESH_File.hxx
+// Created : Wed Mar 10 10:33:04 2010
+// Author : Edward AGAPOV (eap)
+//
+#ifndef __SMESH_File_HXX__
+#define __SMESH_File_HXX__
+
+#include "SMESH_SMESH.hxx"
+
+#include <string>
+#include <vector>
+
+#ifdef WNT
+#include <windows.h>
+#else
+#include <dlfcn.h>
+#endif
+
+/*!
+ * \brief High level util for effective file reading and other file operations
+ */
+class SMESH_EXPORT SMESH_File
+{
+public:
+
+ SMESH_File(const std::string& name, bool open=true);
+
+ ~SMESH_File();
+
+ std::string getName() const { return _name; }
+
+ bool open();
+
+ void close();
+
+ bool remove();
+
+ int size() const;
+
+ // ------------------------
+ // Access to file contents
+ // ------------------------
+
+ operator const char*() const { return _pos; }
+
+ bool operator++() { return ++_pos < _end; }
+
+ void operator +=(int posDelta) { _pos+=posDelta; }
+
+ bool eof() const { return _pos >= _end; }
+
+ const char* getPos() const { return _pos; }
+
+ void setPos(const char* pos);
+
+ std::string getLine();
+
+ void rewind();
+
+ bool getInts(std::vector<int>& ids);
+
+private:
+
+ std::string _name; //!< file name
+ int _size; //!< file size
+#ifdef WNT
+ HANDLE _file, _mapObj;
+#else
+ int _file;
+#endif
+ void* _map;
+ const char* _pos; //!< current position
+ const char* _end; //!< position after file end
+};
+
+#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_Gen.cxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-
+//
#include "SMESH_Gen.hxx"
#include "SMESH_subMesh.hxx"
#include "SMESH_HypoFilter.hxx"
//=============================================================================
/*!
- * default constructor:
+ * Constructor
*/
//=============================================================================
//=============================================================================
/*!
- *
+ * Destructor
*/
//=============================================================================
SMESH_Gen::~SMESH_Gen()
{
- MESSAGE("SMESH_Gen::~SMESH_Gen");
+ MESSAGE("SMESH_Gen::~SMESH_Gen");
}
//=============================================================================
/*!
- *
- */
-//=============================================================================
-
-/*SMESH_Hypothesis *SMESH_Gen::CreateHypothesis(const char *anHyp, int studyId)
- throw(SALOME_Exception)
-{
-
- MESSAGE("CreateHypothesis("<<anHyp<<","<<studyId<<")");
- // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
-
- StudyContextStruct *myStudyContext = GetStudyContext(studyId);
-
- // create a new hypothesis object, store its ref. in studyContext
-
- SMESH_Hypothesis *myHypothesis = _hypothesisFactory.Create(anHyp, studyId);
- int hypId = myHypothesis->GetID();
- myStudyContext->mapHypothesis[hypId] = myHypothesis;
- SCRUTE(studyId);
- SCRUTE(hypId);
-
- // store hypothesis in SMESHDS document
-
- myStudyContext->myDocument->AddHypothesis(myHypothesis);
- return myHypothesis;
-}*/
-
-//=============================================================================
-/*!
- *
+ * Creates a mesh in a study.
+ * if (theIsEmbeddedMode) { mesh modification commands are not logged }
*/
//=============================================================================
if ( algo && !algo->NeedDescretBoundary() )
{
if ( algo->SupportSubmeshes() )
- smWithAlgoSupportingSubmeshes.push_back( smToCompute );
+ smWithAlgoSupportingSubmeshes.push_front( smToCompute );
else
{
smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
}
}
}
+
+ // ------------------------------------------------------------
+ // sort list of meshes according to mesh order
+ // ------------------------------------------------------------
+ aMesh.SortByMeshOrder( smWithAlgoSupportingSubmeshes );
+
// ------------------------------------------------------------
// compute submeshes under shapes with algos that DO NOT require
// descretized boundaries and DO support submeshes
// ------------------------------------------------------------
- list< SMESH_subMesh* >::reverse_iterator subIt, subEnd;
- subIt = smWithAlgoSupportingSubmeshes.rbegin();
- subEnd = smWithAlgoSupportingSubmeshes.rend();
+ list< SMESH_subMesh* >::iterator subIt, subEnd;
+ subIt = smWithAlgoSupportingSubmeshes.begin();
+ subEnd = smWithAlgoSupportingSubmeshes.end();
// start from lower shapes
for ( ; subIt != subEnd; ++subIt )
{
// ----------------------------------------------------------
// apply the algos that do not require descretized boundaries
// ----------------------------------------------------------
- for ( subIt = smWithAlgoSupportingSubmeshes.rbegin(); subIt != subEnd; ++subIt )
+ for ( subIt = smWithAlgoSupportingSubmeshes.begin(); subIt != subEnd; ++subIt )
{
sm = *subIt;
if ( sm->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
SMESH_Algo* algo = GetAlgo( aMesh, aSubShape );
if ( algo && !algo->NeedDescretBoundary() ) {
if ( algo->SupportSubmeshes() ) {
- smWithAlgoSupportingSubmeshes.push_back( smToCompute );
+ smWithAlgoSupportingSubmeshes.push_front( smToCompute );
}
else {
smToCompute->Evaluate(aResMap);
}
}
}
+
+ // ------------------------------------------------------------
+ // sort list of meshes according to mesh order
+ // ------------------------------------------------------------
+ aMesh.SortByMeshOrder( smWithAlgoSupportingSubmeshes );
+
// ------------------------------------------------------------
// compute submeshes under shapes with algos that DO NOT require
// descretized boundaries and DO support submeshes
// ------------------------------------------------------------
- list< SMESH_subMesh* >::reverse_iterator subIt, subEnd;
- subIt = smWithAlgoSupportingSubmeshes.rbegin();
- subEnd = smWithAlgoSupportingSubmeshes.rend();
+ list< SMESH_subMesh* >::iterator subIt, subEnd;
+ subIt = smWithAlgoSupportingSubmeshes.begin();
+ subEnd = smWithAlgoSupportingSubmeshes.end();
// start from lower shapes
for ( ; subIt != subEnd; ++subIt ) {
sm = *subIt;
// ----------------------------------------------------------
// apply the algos that do not require descretized boundaries
// ----------------------------------------------------------
- for ( subIt = smWithAlgoSupportingSubmeshes.rbegin(); subIt != subEnd; ++subIt )
+ for ( subIt = smWithAlgoSupportingSubmeshes.begin(); subIt != subEnd; ++subIt )
{
sm = *subIt;
sm->Evaluate(aResMap);
//=============================================================================
/*!
- *
+ * Finds algo to mesh a shape. Optionally returns a shape the found algo is bound to
*/
//=============================================================================
const TopoDS_Shape & aShape,
TopoDS_Shape* assignedTo)
{
-
SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
filter.And( filter.IsApplicableTo( aShape ));
//=============================================================================
/*!
- *
+ * Returns StudyContextStruct for a study
*/
//=============================================================================
StudyContextStruct *SMESH_Gen::GetStudyContext(int studyId)
{
- // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
+ // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
- if (_mapStudyContext.find(studyId) == _mapStudyContext.end())
- {
- _mapStudyContext[studyId] = new StudyContextStruct;
- _mapStudyContext[studyId]->myDocument = new SMESHDS_Document(studyId);
- }
- StudyContextStruct *myStudyContext = _mapStudyContext[studyId];
-// ASSERT(_mapStudyContext.find(studyId) != _mapStudyContext.end());
- return myStudyContext;
+ if (_mapStudyContext.find(studyId) == _mapStudyContext.end())
+ {
+ _mapStudyContext[studyId] = new StudyContextStruct;
+ _mapStudyContext[studyId]->myDocument = new SMESHDS_Document(studyId);
+ }
+ StudyContextStruct *myStudyContext = _mapStudyContext[studyId];
+ return myStudyContext;
}
-// //=============================================================================
-// /*!
-// *
-// */
-// //=============================================================================
-
-// void SMESH_Gen::Save(int studyId, const char *aUrlOfFile)
-// {
-// }
-
-// //=============================================================================
-// /*!
-// *
-// */
-// //=============================================================================
-
-// void SMESH_Gen::Load(int studyId, const char *aUrlOfFile)
-// {
-// }
-
-// //=============================================================================
-// /*!
-// *
-// */
-// //=============================================================================
-
-// void SMESH_Gen::Close(int studyId)
-// {
-// }
-
-//=============================================================================
+//================================================================================
/*!
- *
+ * \brief Return shape dimension by TopAbs_ShapeEnum
*/
-//=============================================================================
+//================================================================================
int SMESH_Gen::GetShapeDim(const TopAbs_ShapeEnum & aShapeType)
{
//=============================================================================
/*!
- *
+ * Genarate a new id unique withing this Gen
*/
//=============================================================================
int SMESH_Gen::GetANewId()
{
- //MESSAGE("SMESH_Gen::GetANewId");
- return _hypId++;
+ return _hypId++;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_Gen.hxx
// Author : Paul RASCLE, EDF
// Module : SMESH
//
-
#ifndef _SMESH_GEN_HXX_
#define _SMESH_GEN_HXX_
private:
- int _localId; // unique Id of created objects, within SMESH_Gen entity
+ int _localId; // unique Id of created objects, within SMESH_Gen entity
std::map < int, StudyContextStruct * >_mapStudyContext;
// hypotheses managing
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_Group.cxx
// Author : Michael Sazonov (OCC)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_Group.hxx
// Author : Michael Sazonov (OCC)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_HypoFilter.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_HypoFilter.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_Hypothesis.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_Hypothesis.hxx
// Author : Paul RASCLE, EDF
// Module : SMESH
//
-
#ifndef _SMESH_HYPOTHESIS_HXX_
#define _SMESH_HYPOTHESIS_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx
// Created: 20.09.05 09:51:12
// Author: Sergey KUUL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_Mesh.cxx
// Author : Paul RASCLE, EDF
#include "Utils_ExceptHandlers.hxx"
+using namespace std;
+
// maximum stored group name length in MED file
#define MAX_MED_GROUP_NAME_LENGTH 80
sm->ComputeStateEngine( SMESH_subMesh::MESH_ENTITY_REMOVED );
// delete groups
- std::map < int, SMESH_Group * >::iterator itg;
+ map < int, SMESH_Group * >::iterator itg;
for (itg = _mapGroup.begin(); itg != _mapGroup.end(); itg++) {
SMESH_Group *aGroup = (*itg).second;
delete aGroup;
{
// removal of a shape to mesh, delete objects referring to sub-shapes:
// - sub-meshes
- std::map <int, SMESH_subMesh *>::iterator i_sm = _mapSubMesh.begin();
+ map <int, SMESH_subMesh *>::iterator i_sm = _mapSubMesh.begin();
for ( ; i_sm != _mapSubMesh.end(); ++i_sm )
delete i_sm->second;
_mapSubMesh.clear();
// - groups on geometry
- std::map <int, SMESH_Group *>::iterator i_gr = _mapGroup.begin();
+ map <int, SMESH_Group *>::iterator i_gr = _mapGroup.begin();
while ( i_gr != _mapGroup.end() ) {
if ( dynamic_cast<SMESHDS_GroupOnGeom*>( i_gr->second->GetGroupDS() )) {
_myMeshDS->RemoveGroup( i_gr->second->GetGroupDS() );
_isShapeToMesh = true;
_nbSubShapes = _myMeshDS->MaxShapeIndex();
- // fill _mapAncestors
- int desType, ancType;
- for ( desType = TopAbs_VERTEX; desType > TopAbs_COMPOUND; desType-- )
- for ( ancType = desType - 1; ancType >= TopAbs_COMPOUND; ancType-- )
- TopExp::MapShapesAndAncestors ( aShape,
- (TopAbs_ShapeEnum) desType,
- (TopAbs_ShapeEnum) ancType,
- _mapAncestors );
+ // fill map of ancestors
+ fillAncestorsMap(aShape);
}
else
{
sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
}
}
-
-// // clear sub-meshes; get ready to re-compute as a side-effect
-
-// if ( SMESH_subMesh *sm = GetSubMeshContaining( GetShapeToMesh() ) )
-// {
-// SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/true,
-// /*complexShapeFirst=*/false);
-// while ( smIt->more() )
-// {
-// sm = smIt->next();
-// TopAbs_ShapeEnum shapeType = sm->GetSubShape().ShapeType();
-// if ( shapeType == TopAbs_VERTEX || shapeType < TopAbs_SOLID )
-// // all other shapes depends on vertices so they are already cleaned
-// sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
-// // to recompute even if failed
-// sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
-// }
-// }
-
-// // clear entities not on sub-meshes
-
-// SMDS_VolumeIteratorPtr vIt = _myMeshDS->volumesIterator();
-// while ( vIt->more() )
-// _myMeshDS->RemoveFreeElement( vIt->next(), 0 );
-
-// SMDS_FaceIteratorPtr fIt = _myMeshDS->facesIterator();
-// while ( fIt->more() )
-// _myMeshDS->RemoveFreeElement( fIt->next(), 0 );
-
-// SMDS_EdgeIteratorPtr eIt = _myMeshDS->edgesIterator();
-// while ( eIt->more() )
-// _myMeshDS->RemoveFreeElement( eIt->next(), 0 );
-
-// SMDS_NodeIteratorPtr nIt = _myMeshDS->nodesIterator();
-// while ( nIt->more() ) {
-// const SMDS_MeshNode * node = nIt->next();
-// if ( node->NbInverseElements() == 0 )
-// _myMeshDS->RemoveFreeNode( node, 0 );
-// else
-// _myMeshDS->RemoveNode(node);
-// }
}
//=======================================================================
aGroup->InitSubGroupsIterator();
while (aGroup->MoreSubGroups()) {
SMDS_MeshGroup* aSubGroup = (SMDS_MeshGroup*) aGroup->NextSubGroup();
- std::string aName = aGroupNames[aSubGroup];
+ string aName = aGroupNames[aSubGroup];
int aId;
SMESH_Group* aSMESHGroup = AddGroup( aSubGroup->GetType(), aName.c_str(), aId );
}
// Reading groups (sub-meshes are out of scope of MED import functionality)
- std::list<TNameAndType> aGroupNames = myReader.GetGroupNamesAndTypes();
+ list<TNameAndType> aGroupNames = myReader.GetGroupNamesAndTypes();
if(MYDEBUG) MESSAGE("MEDToMesh - Nb groups = "<<aGroupNames.size());
int anId;
- std::list<TNameAndType>::iterator name_type = aGroupNames.begin();
+ list<TNameAndType>::iterator name_type = aGroupNames.begin();
for ( ; name_type != aGroupNames.end(); name_type++ ) {
SMESH_Group* aGroup = AddGroup( name_type->second, name_type->first.c_str(), anId );
if ( aGroup ) {
if ( !subMesh || !subMesh->GetId())
return SMESH_Hypothesis::HYP_BAD_SUBSHAPE;
- SMESHDS_SubMesh *subMeshDS = subMesh->GetSubMeshDS();
- if ( subMeshDS && subMeshDS->IsComplexSubmesh() ) // group of sub-shapes and maybe of not sub-
- {
- MESSAGE("AddHypothesis() to complex submesh");
- // return the worst but not fatal state of all group memebers
- SMESH_Hypothesis::Hypothesis_Status aBestRet, aWorstNotFatal, ret;
- aBestRet = SMESH_Hypothesis::HYP_BAD_DIM;
- aWorstNotFatal = SMESH_Hypothesis::HYP_OK;
- for ( TopoDS_Iterator itS ( aSubShape ); itS.More(); itS.Next())
- {
- if ( !GetMeshDS()->ShapeToIndex( itS.Value() ))
- continue; // not sub-shape
- ret = AddHypothesis( itS.Value(), anHypId );
- if ( !SMESH_Hypothesis::IsStatusFatal( ret ) && ret > aWorstNotFatal )
- aWorstNotFatal = ret;
- if ( ret < aBestRet )
- aBestRet = ret;
- }
- // bind hypotheses to a group just to know
- SMESH_Hypothesis *anHyp = _gen->GetStudyContext(_studyId)->mapHypothesis[anHypId];
- GetMeshDS()->AddHypothesis( aSubShape, anHyp );
-
- if ( SMESH_Hypothesis::IsStatusFatal( aBestRet ))
- return aBestRet;
- return aWorstNotFatal;
- }
-
StudyContextStruct *sc = _gen->GetStudyContext(_studyId);
if (sc->mapHypothesis.find(anHypId) == sc->mapHypothesis.end())
{
if (ret2 > ret)
ret = ret2;
- // check concurent hypotheses on ansestors
+ // check concurent hypotheses on ancestors
if (ret < SMESH_Hypothesis::HYP_CONCURENT && !isGlobalHyp )
{
SMESH_subMeshIteratorPtr smIt = subMesh->getDependsOnIterator(false,false);
}
if(MYDEBUG) subMesh->DumpAlgoState(true);
- SCRUTE(ret);
+ if(MYDEBUG) SCRUTE(ret);
return ret;
}
Unexpect aCatch(SalomeException);
if(MYDEBUG) MESSAGE("SMESH_Mesh::RemoveHypothesis");
- SMESH_subMesh *subMesh = GetSubMesh(aSubShape);
- SMESHDS_SubMesh *subMeshDS = subMesh->GetSubMeshDS();
- if ( subMeshDS && subMeshDS->IsComplexSubmesh() )
- {
- // return the worst but not fatal state of all group memebers
- SMESH_Hypothesis::Hypothesis_Status aBestRet, aWorstNotFatal, ret;
- aBestRet = SMESH_Hypothesis::HYP_BAD_DIM;
- aWorstNotFatal = SMESH_Hypothesis::HYP_OK;
- for ( TopoDS_Iterator itS ( aSubShape ); itS.More(); itS.Next())
- {
- if ( !GetMeshDS()->ShapeToIndex( itS.Value() ))
- continue; // not sub-shape
- ret = RemoveHypothesis( itS.Value(), anHypId );
- if ( !SMESH_Hypothesis::IsStatusFatal( ret ) && ret > aWorstNotFatal )
- aWorstNotFatal = ret;
- if ( ret < aBestRet )
- aBestRet = ret;
- }
- SMESH_Hypothesis *anHyp = _gen->GetStudyContext(_studyId)->mapHypothesis[anHypId];
- GetMeshDS()->RemoveHypothesis( aSubShape, anHyp );
-
- if ( SMESH_Hypothesis::IsStatusFatal( aBestRet ))
- return aBestRet;
- return aWorstNotFatal;
- }
-
StudyContextStruct *sc = _gen->GetStudyContext(_studyId);
if (sc->mapHypothesis.find(anHypId) == sc->mapHypothesis.end())
throw SALOME_Exception(LOCALIZED("hypothesis does not exist"));
SMESH_Hypothesis *anHyp = sc->mapHypothesis[anHypId];
- int hypType = anHyp->GetType();
- if(MYDEBUG) SCRUTE(hypType);
+ if(MYDEBUG) {
+ int hypType = anHyp->GetType();
+ SCRUTE(hypType);
+ }
// shape
bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO );
int event = isAlgo ? SMESH_subMesh::REMOVE_ALGO : SMESH_subMesh::REMOVE_HYP;
+ SMESH_subMesh *subMesh = GetSubMesh(aSubShape);
+
SMESH_Hypothesis::Hypothesis_Status ret = subMesh->AlgoStateEngine(event, anHyp);
// there may appear concurrent hyps that were covered by the removed hyp
if (ret2 > ret) // more severe
ret = ret2;
- // check concurent hypotheses on ansestors
+ // check concurent hypotheses on ancestors
if (ret < SMESH_Hypothesis::HYP_CONCURENT && !IsMainShape( aSubShape ) )
{
SMESH_subMeshIteratorPtr smIt = subMesh->getDependsOnIterator(false,false);
*/
//=============================================================================
-const std::list<const SMESHDS_Hypothesis*>&
+const list<const SMESHDS_Hypothesis*>&
SMESH_Mesh::GetHypothesisList(const TopoDS_Shape & aSubShape) const
throw(SALOME_Exception)
{
TopoDS_Shape* assignedTo) const
{
{
- const std::list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(aSubShape);
- std::list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin();
+ const list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(aSubShape);
+ list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin();
for ( ; hyp != hypList.end(); hyp++ ) {
const SMESH_Hypothesis * h = cSMESH_Hyp( *hyp );
if ( aFilter.IsOk( h, aSubShape)) {
}
if ( andAncestors )
{
- TopTools_ListIteratorOfListOfShape it( GetAncestors( aSubShape ));
- for (; it.More(); it.Next() )
+ // user sorted submeshes of ancestors, according to stored submesh priority
+ const list<SMESH_subMesh*> smList = getAncestorsSubMeshes( aSubShape );
+ list<SMESH_subMesh*>::const_iterator smIt = smList.begin();
+ for ( ; smIt != smList.end(); smIt++ )
{
- const std::list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(it.Value());
- std::list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin();
+ const TopoDS_Shape& curSh = (*smIt)->GetSubShape();
+ const list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(curSh);
+ list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin();
for ( ; hyp != hypList.end(); hyp++ ) {
const SMESH_Hypothesis * h = cSMESH_Hyp( *hyp );
- if (aFilter.IsOk( h, it.Value() )) {
- if ( assignedTo ) *assignedTo = it.Value();
+ if (aFilter.IsOk( h, curSh )) {
+ if ( assignedTo ) *assignedTo = curSh;
return h;
}
}
bool mainHypFound = false;
// fill in hypTypes
- std::list<const SMESHDS_Hypothesis*>::const_iterator hyp;
+ list<const SMESHDS_Hypothesis*>::const_iterator hyp;
for ( hyp = aHypList.begin(); hyp != aHypList.end(); hyp++ ) {
if ( hypTypes.insert( (*hyp)->GetName() ).second )
nbHyps++;
// get hypos from aSubShape
{
- const std::list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(aSubShape);
+ const list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(aSubShape);
for ( hyp = hypList.begin(); hyp != hypList.end(); hyp++ )
if ( aFilter.IsOk (cSMESH_Hyp( *hyp ), aSubShape) &&
( cSMESH_Hyp(*hyp)->IsAuxiliary() || !mainHypFound ) &&
if ( andAncestors )
{
TopTools_MapOfShape map;
- TopTools_ListIteratorOfListOfShape it( GetAncestors( aSubShape ));
- for (; it.More(); it.Next() )
+
+ // user sorted submeshes of ancestors, according to stored submesh priority
+ const list<SMESH_subMesh*> smList = getAncestorsSubMeshes( aSubShape );
+ list<SMESH_subMesh*>::const_iterator smIt = smList.begin();
+ for ( ; smIt != smList.end(); smIt++ )
{
- if ( !map.Add( it.Value() ))
+ const TopoDS_Shape& curSh = (*smIt)->GetSubShape();
+ if ( !map.Add( curSh ))
continue;
- const std::list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(it.Value());
+ const list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(curSh);
for ( hyp = hypList.begin(); hyp != hypList.end(); hyp++ )
- if (aFilter.IsOk( cSMESH_Hyp( *hyp ), it.Value() ) &&
+ if (aFilter.IsOk( cSMESH_Hyp( *hyp ), curSh ) &&
( cSMESH_Hyp(*hyp)->IsAuxiliary() || !mainHypFound ) &&
hypTypes.insert( (*hyp)->GetName() ).second )
{
*/
//=============================================================================
-const std::list<SMESHDS_Command*> & SMESH_Mesh::GetLog() throw(SALOME_Exception)
+const list<SMESHDS_Command*> & SMESH_Mesh::GetLog() throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
if(MYDEBUG) MESSAGE("SMESH_Mesh::GetLog");
{
index = _myMeshDS->AddCompoundSubmesh( aSubShape, it.Value().ShapeType() );
if ( index > _nbSubShapes ) _nbSubShapes = index; // not to create sm for this group again
+
+ // fill map of Ancestors
+ fillAncestorsMap(aSubShape);
}
}
// if ( !index )
{
aSubMesh = new SMESH_subMesh(index, this, _myMeshDS, aSubShape);
_mapSubMesh[index] = aSubMesh;
+ ClearMeshOrder();
}
return aSubMesh;
}
*/
//================================================================================
-std::list<SMESH_subMesh*>
+list<SMESH_subMesh*>
SMESH_Mesh::GetGroupSubMeshesContaining(const TopoDS_Shape & aSubShape) const
throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
- std::list<SMESH_subMesh*> found;
+ list<SMESH_subMesh*> found;
SMESH_subMesh * subMesh = GetSubMeshContaining(aSubShape);
if ( !subMesh )
return found;
// submeshes of groups have max IDs, so search from the map end
- std::map<int, SMESH_subMesh *>::const_reverse_iterator i_sm;
+ map<int, SMESH_subMesh *>::const_reverse_iterator i_sm;
for ( i_sm = _mapSubMesh.rbegin(); i_sm != _mapSubMesh.rend(); ++i_sm) {
SMESHDS_SubMesh * ds = i_sm->second->GetSubMeshDS();
if ( ds && ds->IsComplexSubmesh() ) {
bool SMESH_Mesh::HasDuplicatedGroupNamesMED()
{
- set<string> aGroupNames;
- for ( std::map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
+ //set<string> aGroupNames; // Corrected for Mantis issue 0020028
+ map< SMDSAbs_ElementType, set<string> > aGroupNames;
+ for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ )
+ {
SMESH_Group* aGroup = it->second;
- std::string aGroupName = aGroup->GetName();
+ SMDSAbs_ElementType aType = aGroup->GetGroupDS()->GetType();
+ string aGroupName = aGroup->GetName();
aGroupName.resize(MAX_MED_GROUP_NAME_LENGTH);
- if (!aGroupNames.insert(aGroupName).second)
+ if (!aGroupNames[aType].insert(aGroupName).second)
return true;
}
}
// Pass groups to writer. Provide unique group names.
- set<string> aGroupNames;
+ //set<string> aGroupNames; // Corrected for Mantis issue 0020028
+ map< SMDSAbs_ElementType, set<string> > aGroupNames;
char aString [256];
int maxNbIter = 10000; // to guarantee cycle finish
- for ( std::map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
+ for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
SMESH_Group* aGroup = it->second;
SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS();
if ( aGroupDS ) {
+ SMDSAbs_ElementType aType = aGroupDS->GetType();
string aGroupName0 = aGroup->GetName();
aGroupName0.resize(MAX_MED_GROUP_NAME_LENGTH);
string aGroupName = aGroupName0;
- for (int i = 1; !aGroupNames.insert(aGroupName).second && i < maxNbIter; i++) {
+ for (int i = 1; !aGroupNames[aType].insert(aGroupName).second && i < maxNbIter; i++) {
sprintf(&aString[0], "GR_%d_%s", i, aGroupName0.c_str());
aGroupName = aString;
aGroupName.resize(MAX_MED_GROUP_NAME_LENGTH);
myWriter.SetMeshId(_idDoc);
// myWriter.SetGroups(_mapGroup);
- for ( std::map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
+ for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
SMESH_Group* aGroup = it->second;
SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS();
if ( aGroupDS ) {
- std::string aGroupName = aGroup->GetName();
+ string aGroupName = aGroup->GetName();
aGroupDS->SetStoreName( aGroupName.c_str() );
myWriter.AddGroup( aGroupDS );
}
*/
//=============================================================================
-std::list<int> SMESH_Mesh::GetGroupIds() const
+list<int> SMESH_Mesh::GetGroupIds() const
{
- std::list<int> anIds;
- for ( std::map<int, SMESH_Group*>::const_iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ )
+ list<int> anIds;
+ for ( map<int, SMESH_Group*>::const_iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ )
anIds.push_back( it->first );
return anIds;
save << clause << ".1) Number of " << orderStr << " triangles: \t" << nb3 << endl;
save << clause << ".2) Number of " << orderStr << " quadrangles:\t" << nb4 << endl;
if ( nb3 + nb4 != NbFaces(order) ) {
- std::map<int,int> myFaceMap;
+ map<int,int> myFaceMap;
SMDS_FaceIteratorPtr itFaces=_myMeshDS->facesIterator();
while( itFaces->more( ) ) {
int nbNodes = itFaces->next()->NbNodes();
save << clause << ".3) Number of " << orderStr << " prisms: \t" << nb6 << endl;
save << clause << ".4) Number of " << orderStr << " pyramids:\t" << nb5 << endl;
if ( nb8 + nb4 + nb5 + nb6 != NbVolumes(order) ) {
- std::map<int,int> myVolumesMap;
+ map<int,int> myVolumesMap;
SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator();
while( itVolumes->more( ) ) {
int nbNodes = itVolumes->next()->NbNodes();
SMESH_Group* SMESH_Mesh::ConvertToStandalone ( int theGroupID )
{
SMESH_Group* aGroup = 0;
- std::map < int, SMESH_Group * >::iterator itg = _mapGroup.find( theGroupID );
+ map < int, SMESH_Group * >::iterator itg = _mapGroup.find( theGroupID );
if ( itg == _mapGroup.end() )
return aGroup;
return aGroup;
}
+//=============================================================================
+/*!
+ * \brief remove submesh order from Mesh
+ */
+//=============================================================================
+
+void SMESH_Mesh::ClearMeshOrder()
+{
+ _mySubMeshOrder.clear();
+}
+
+//=============================================================================
+/*!
+ * \brief remove submesh order from Mesh
+ */
+//=============================================================================
+
+void SMESH_Mesh::SetMeshOrder(const TListOfListOfInt& theOrder )
+{
+ _mySubMeshOrder = theOrder;
+}
+
+//=============================================================================
+/*!
+ * \brief return submesh order if any
+ */
+//=============================================================================
+
+const TListOfListOfInt& SMESH_Mesh::GetMeshOrder() const
+{
+ return _mySubMeshOrder;
+}
+
+//=============================================================================
+/*!
+ * \brief fill _mapAncestors
+ */
+//=============================================================================
+
+void SMESH_Mesh::fillAncestorsMap(const TopoDS_Shape& theShape)
+{
+
+ int desType, ancType;
+ if ( !theShape.IsSame( GetShapeToMesh()) && theShape.ShapeType() == TopAbs_COMPOUND )
+ {
+ // a geom group is added. Insert it into lists of ancestors before
+ // the first ancestor more complex than group members
+ int memberType = TopoDS_Iterator( theShape ).Value().ShapeType();
+ for ( desType = TopAbs_VERTEX; desType >= memberType; desType-- )
+ for (TopExp_Explorer des( theShape, TopAbs_ShapeEnum( desType )); des.More(); des.Next())
+ {
+ TopTools_ListOfShape& ancList = _mapAncestors.ChangeFromKey( des.Current() );
+ TopTools_ListIteratorOfListOfShape ancIt (ancList);
+ while ( ancIt.More() && ancIt.Value().ShapeType() >= memberType )
+ ancIt.Next();
+ if ( ancIt.More() )
+ ancList.InsertBefore( theShape, ancIt );
+ }
+ }
+ {
+ for ( desType = TopAbs_VERTEX; desType > TopAbs_COMPOUND; desType-- )
+ for ( ancType = desType - 1; ancType >= TopAbs_COMPOUND; ancType-- )
+ TopExp::MapShapesAndAncestors ( theShape,
+ (TopAbs_ShapeEnum) desType,
+ (TopAbs_ShapeEnum) ancType,
+ _mapAncestors );
+ }
+}
+
+//=============================================================================
+/*!
+ * \brief sort submeshes according to stored mesh order
+ * \param theListToSort in out list to be sorted
+ * \return FALSE if nothing sorted
+ */
+//=============================================================================
+
+bool SMESH_Mesh::SortByMeshOrder(list<SMESH_subMesh*>& theListToSort) const
+{
+ if ( !_mySubMeshOrder.size() || theListToSort.size() < 2)
+ return true;
+
+ bool res = false;
+ list<SMESH_subMesh*> onlyOrderedList;
+ // collect all ordered submeshes in one list as pointers
+ // and get their positions within theListToSort
+ typedef list<SMESH_subMesh*>::iterator TPosInList;
+ map< int, TPosInList > sortedPos;
+ TPosInList smBeg = theListToSort.begin(), smEnd = theListToSort.end();
+ TListOfListOfInt::const_iterator listIddIt = _mySubMeshOrder.begin();
+ for( ; listIddIt != _mySubMeshOrder.end(); listIddIt++) {
+ const TListOfInt& listOfId = *listIddIt;
+ TListOfInt::const_iterator idIt = listOfId.begin();
+ for ( ; idIt != listOfId.end(); idIt++ ) {
+ if ( SMESH_subMesh * sm = GetSubMeshContaining( *idIt )) {
+ TPosInList smPos = find( smBeg, smEnd, sm );
+ if ( smPos != smEnd ) {
+ onlyOrderedList.push_back( sm );
+ sortedPos[ distance( smBeg, smPos )] = smPos;
+ }
+ }
+ }
+ }
+ if (onlyOrderedList.size() < 2)
+ return res;
+ res = true;
+
+ list<SMESH_subMesh*>::iterator onlyBIt = onlyOrderedList.begin();
+ list<SMESH_subMesh*>::iterator onlyEIt = onlyOrderedList.end();
+
+ // iterates on ordered submeshes and insert them in detected positions
+ map< int, TPosInList >::iterator i_pos = sortedPos.begin();
+ for ( ; onlyBIt != onlyEIt; ++onlyBIt, ++i_pos )
+ *(i_pos->second) = *onlyBIt;
+
+ return res;
+}
+
+//=============================================================================
+/*!
+ * \brief sort submeshes according to stored mesh order
+ * \param theListToSort in out list to be sorted
+ * \return FALSE if nothing sorted
+ */
+//=============================================================================
+
+list<SMESH_subMesh*> SMESH_Mesh::getAncestorsSubMeshes
+ (const TopoDS_Shape& theSubShape) const
+{
+ list<SMESH_subMesh*> listOfSubMesh;
+ TopTools_ListIteratorOfListOfShape it( GetAncestors( theSubShape ));
+ for (; it.More(); it.Next() )
+ if ( SMESH_subMesh* sm = GetSubMeshContaining( it.Value() ))
+ listOfSubMesh.push_back(sm);
+
+ // sort submeshes according to stored mesh order
+ SortByMeshOrder( listOfSubMesh );
+
+ return listOfSubMesh;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_Mesh.hxx
// Author : Paul RASCLE, EDF
#include <TopoDS_Shape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <list>
#include <map>
+#include <list>
+
+#ifdef WNT
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#pragma warning(disable:4290) // Warning Exception ...
+#endif
class SMESH_Gen;
class SMESHDS_Document;
class SMESH_HypoFilter;
class TopoDS_Solid;
+typedef std::list<int> TListOfInt;
+typedef std::list<TListOfInt> TListOfListOfInt;
+
class SMESH_EXPORT SMESH_Mesh
{
public:
SMDSAbs_ElementType GetElementType( const int id, const bool iselem );
+ void ClearMeshOrder();
+ void SetMeshOrder(const TListOfListOfInt& theOrder );
+ const TListOfListOfInt& GetMeshOrder() const;
+
+ /*!
+ * \brief sort submeshes according to stored mesh order
+ * \param theListToSort in out list to be sorted
+ * \return FALSE if nothing sorted
+ */
+ bool SortByMeshOrder(std::list<SMESH_subMesh*>& theListToSort) const;
+
//
ostream& Dump(ostream & save);
private:
+
+ void fillAncestorsMap(const TopoDS_Shape& theShape);
+ std::list<SMESH_subMesh*> getAncestorsSubMeshes
+ (const TopoDS_Shape& theSubShape) const;
protected:
int _id; // id given by creator (unique within the creator instance)
std::map <int, SMESH_subMesh*> _mapSubMesh;
std::map <int, SMESH_Group*> _mapGroup;
SMESH_Gen * _gen;
-
+
bool _isAutoColor;
double _shapeDiagonal; //!< diagonal size of bounding box of shape to mesh
TopTools_IndexedDataMapOfShapeListOfShape _mapAncestors;
+ TListOfListOfInt _mySubMeshOrder;
+
protected:
SMESH_Mesh() {};
SMESH_Mesh(const SMESH_Mesh&) {};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's classes
// File : SMESH_MeshEditor.cxx
// Created : Mon Apr 12 16:10:22 2004
#include "SMDS_SpacePosition.hxx"
#include "SMDS_QuadraticFaceOfNodes.hxx"
#include "SMDS_MeshGroup.hxx"
+#include "SMDS_LinearEdge.hxx"
#include "SMESHDS_Group.hxx"
#include "SMESHDS_Mesh.hxx"
-#include "SMESH_subMesh.hxx"
+#include "SMESH_Algo.hxx"
#include "SMESH_ControlsDef.hxx"
+#include "SMESH_Group.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_OctreeNode.hxx"
-#include "SMESH_Group.hxx"
+#include "SMESH_subMesh.hxx"
#include "utilities.h"
-#include <BRep_Tool.hxx>
+#include <BRepAdaptor_Surface.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
+#include <BRep_Tool.hxx>
#include <ElCLib.hxx>
#include <Extrema_GenExtPS.hxx>
+#include <Extrema_POnCurv.hxx>
#include <Extrema_POnSurf.hxx>
+#include <GC_MakeSegment.hxx>
#include <Geom2d_Curve.hxx>
+#include <GeomAPI_ExtremaCurveCurve.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <Geom_Curve.hxx>
+#include <Geom_Line.hxx>
#include <Geom_Surface.hxx>
+#include <IntAna_IntConicQuad.hxx>
+#include <IntAna_Quadric.hxx>
#include <Precision.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TopAbs_State.hxx>
#include <gp_Vec.hxx>
#include <gp_XY.hxx>
#include <gp_XYZ.hxx>
+
#include <math.h>
#include <map>
typedef map<const SMDS_MeshElement*, list<const SMDS_MeshNode*> > TElemOfNodeListMap;
typedef map<const SMDS_MeshElement*, list<const SMDS_MeshElement*> > TElemOfElemListMap;
-//typedef map<const SMDS_MeshNode*, vector<const SMDS_MeshNode*> > TNodeOfNodeVecMap;
-//typedef TNodeOfNodeVecMap::iterator TNodeOfNodeVecMapItr;
-//typedef map<const SMDS_MeshElement*, vector<TNodeOfNodeVecMapItr> > TElemOfVecOfMapNodesMap;
-
-//=======================================================================
-/*!
- * \brief SMDS_MeshNode -> gp_XYZ convertor
- */
-//=======================================================================
-
-struct TNodeXYZ : public gp_XYZ
-{
- TNodeXYZ( const SMDS_MeshNode* n ):gp_XYZ( n->X(), n->Y(), n->Z() ) {}
- double Distance( const SMDS_MeshNode* n )
- {
- return gp_Vec( *this, TNodeXYZ( n )).Magnitude();
- }
- double SquareDistance( const SMDS_MeshNode* n )
- {
- return gp_Vec( *this, TNodeXYZ( n )).SquareMagnitude();
- }
-};
//=======================================================================
//function : SMESH_MeshEditor
int nbnode = node.size();
SMESHDS_Mesh* mesh = GetMeshDS();
switch ( type ) {
+ case SMDSAbs_0DElement:
+ if ( nbnode == 1 )
+ if ( ID ) e = mesh->Add0DElementWithID(node[0], ID);
+ else e = mesh->Add0DElement (node[0] );
+ break;
case SMDSAbs_Edge:
if ( nbnode == 2 )
if ( ID ) e = mesh->AddEdgeWithID(node[0], node[1], ID);
//function : BestSplit
//purpose : Find better diagonal for cutting.
//=======================================================================
+
int SMESH_MeshEditor::BestSplit (const SMDS_MeshElement* theQuad,
SMESH::Controls::NumericalFunctorPtr theCrit)
{
return -1;
}
+namespace
+{
+ // Methods of splitting volumes into tetra
+
+ const int theHexTo5_1[5*4+1] =
+ {
+ 0, 1, 2, 5, 0, 4, 5, 7, 0, 2, 3, 7, 2, 5, 6, 7, 0, 5, 2, 7, -1
+ };
+ const int theHexTo5_2[5*4+1] =
+ {
+ 1, 2, 3, 6, 1, 4, 5, 6, 0, 1, 3, 4, 3, 4, 6, 7, 1, 3, 4, 6, -1
+ };
+ const int* theHexTo5[2] = { theHexTo5_1, theHexTo5_2 };
+
+ const int theHexTo6_1[6*4+1] =
+ {
+ 1, 5, 6, 0, 0, 1, 2, 6, 0, 4, 5, 6, 0, 4, 6, 7, 0, 2, 3, 6, 0, 3, 7, 6, -1
+ };
+ const int theHexTo6_2[6*4+1] =
+ {
+ 2, 6, 7, 1, 1, 2, 3, 7, 1, 5, 6, 7, 1, 5, 7, 4, 1, 3, 0, 7, 1, 0, 4, 7, -1
+ };
+ const int theHexTo6_3[6*4+1] =
+ {
+ 3, 7, 4, 2, 2, 3, 0, 4, 2, 6, 7, 4, 2, 6, 4, 5, 2, 0, 1, 4, 2, 1, 5, 4, -1
+ };
+ const int theHexTo6_4[6*4+1] =
+ {
+ 0, 4, 5, 3, 3, 0, 1, 5, 3, 7, 4, 5, 3, 7, 5, 6, 3, 1, 2, 5, 3, 2, 6, 5, -1
+ };
+ const int* theHexTo6[4] = { theHexTo6_1, theHexTo6_2, theHexTo6_3, theHexTo6_4 };
+
+ const int thePyraTo2_1[2*4+1] =
+ {
+ 0, 1, 2, 4, 0, 2, 3, 4, -1
+ };
+ const int thePyraTo2_2[2*4+1] =
+ {
+ 1, 2, 3, 4, 1, 3, 0, 4, -1
+ };
+ const int* thePyraTo2[2] = { thePyraTo2_1, thePyraTo2_2 };
+
+ const int thePentaTo3_1[3*4+1] =
+ {
+ 0, 1, 2, 3, 1, 3, 4, 2, 2, 3, 4, 5, -1
+ };
+ const int thePentaTo3_2[3*4+1] =
+ {
+ 1, 2, 0, 4, 2, 4, 5, 0, 0, 4, 5, 3, -1
+ };
+ const int thePentaTo3_3[3*4+1] =
+ {
+ 2, 0, 1, 5, 0, 5, 3, 1, 1, 5, 3, 4, -1
+ };
+ const int thePentaTo3_4[3*4+1] =
+ {
+ 0, 1, 2, 3, 1, 3, 4, 5, 2, 3, 1, 5, -1
+ };
+ const int thePentaTo3_5[3*4+1] =
+ {
+ 1, 2, 0, 4, 2, 4, 5, 3, 0, 4, 2, 3, -1
+ };
+ const int thePentaTo3_6[3*4+1] =
+ {
+ 2, 0, 1, 5, 0, 5, 3, 4, 1, 5, 0, 4, -1
+ };
+ const int* thePentaTo3[6] = { thePentaTo3_1, thePentaTo3_2, thePentaTo3_3,
+ thePentaTo3_4, thePentaTo3_5, thePentaTo3_6 };
+
+ 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;
+ };
+ struct TSplitMethod
+ {
+ int _nbTetra;
+ 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
+
+ TSplitMethod( int nbTet=0, const int* conn=0, bool addNode=false)
+ : _nbTetra(nbTet), _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;
+ return false;
+ }
+ };
+
+ //=======================================================================
+ /*!
+ * \brief return TSplitMethod for the given element
+ */
+ //=======================================================================
+
+ TSplitMethod getSplitMethod( SMDS_VolumeTool& vol, const int theMethodFlags)
+ {
+ int iQ = vol.Element()->IsQuadratic() ? 2 : 1;
+
+ // Find out how adjacent volumes are split
+
+ vector < list< TTriangleFacet > > triaSplitsByFace( vol.NbFaces() ); // splits of each side
+ int hasAdjacentSplits = 0, maxTetConnSize = 0;
+ for ( int iF = 0; iF < vol.NbFaces(); ++iF )
+ {
+ int nbNodes = vol.NbFaceNodes( iF ) / iQ;
+ maxTetConnSize += 4 * ( nbNodes - 2 );
+ if ( nbNodes < 4 ) continue;
+
+ list< TTriangleFacet >& triaSplits = triaSplitsByFace[ iF ];
+ const int* nInd = vol.GetFaceNodesIndices( iF );
+ if ( nbNodes == 4 )
+ {
+ 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 );
+ }
+ else
+ {
+ int iCom = 0; // common node of triangle faces to split into
+ for ( int iVar = 0; iVar < nbNodes; ++iVar, ++iCom )
+ {
+ TTriangleFacet t012( nInd[ iQ * ( iCom )],
+ nInd[ iQ * ( (iCom+1)%nbNodes )],
+ nInd[ iQ * ( (iCom+2)%nbNodes )]);
+ TTriangleFacet t023( nInd[ iQ * ( iCom )],
+ nInd[ iQ * ( (iCom+2)%nbNodes )],
+ nInd[ iQ * ( (iCom+3)%nbNodes )]);
+ if ( t012.hasAdjacentTetra( vol.Element() ) && t023.hasAdjacentTetra( vol.Element() ))
+ {
+ triaSplits.push_back( t012 );
+ triaSplits.push_back( t023 );
+ break;
+ }
+ }
+ }
+ if ( !triaSplits.empty() )
+ hasAdjacentSplits = true;
+ }
+
+ // Among variants of split method select one compliant with adjacent volumes
+
+ TSplitMethod method;
+ if ( !vol.Element()->IsPoly() )
+ {
+ int nbVariants = 2, nbTet = 0;
+ const int** connVariants = 0;
+ switch ( vol.Element()->GetEntityType() )
+ {
+ case SMDSEntity_Hexa:
+ case SMDSEntity_Quad_Hexa:
+ if ( theMethodFlags & SMESH_MeshEditor::HEXA_TO_5 )
+ connVariants = theHexTo5, nbTet = 5;
+ else
+ connVariants = theHexTo6, nbTet = 6, nbVariants = 4;
+ break;
+ case SMDSEntity_Pyramid:
+ case SMDSEntity_Quad_Pyramid:
+ connVariants = thePyraTo2; nbTet = 2;
+ break;
+ case SMDSEntity_Penta:
+ case SMDSEntity_Quad_Penta:
+ connVariants = thePentaTo3; nbTet = 3; nbVariants = 6;
+ break;
+ default:
+ nbVariants = 0;
+ }
+ for ( int variant = 0; variant < nbVariants && method._nbTetra == 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 )
+ {
+ bool facetCreated = true;
+ for ( int iF = 0; facetCreated && iF < triaSplitsByFace.size(); ++iF )
+ {
+ list< TTriangleFacet >::const_iterator facet = triaSplitsByFace[iF].begin();
+ for ( ; facetCreated && facet != triaSplitsByFace[iF].end(); ++facet )
+ facetCreated = method.hasFacet( *facet );
+ }
+ if ( !facetCreated )
+ method = TSplitMethod(0); // incompatible method
+ }
+ }
+ }
+ if ( method._nbTetra < 1 )
+ {
+ // No standard method is applicable, use a generic solution:
+ // each facet of a volume is split into triangles and
+ // each of triangles and a volume barycenter form a tetrahedron.
+
+ int* connectivity = new int[ maxTetConnSize + 1 ];
+ method._connectivity = connectivity;
+ method._ownConn = true;
+ method._baryNode = true;
+
+ int connSize = 0;
+ int baryCenInd = vol.NbNodes();
+ for ( int iF = 0; iF < vol.NbFaces(); ++iF )
+ {
+ const int nbNodes = vol.NbFaceNodes( iF ) / iQ;
+ const int* nInd = vol.GetFaceNodesIndices( iF );
+ // find common node of triangle facets of tetra to create
+ int iCommon = 0; // index in linear numeration
+ const list< TTriangleFacet >& triaSplits = triaSplitsByFace[ iF ];
+ if ( !triaSplits.empty() )
+ {
+ // by found facets
+ const TTriangleFacet* facet = &triaSplits.front();
+ for ( ; iCommon < nbNodes-1 ; ++iCommon )
+ if ( facet->contains( nInd[ iQ * iCommon ]) &&
+ facet->contains( nInd[ iQ * ((iCommon+2)%nbNodes) ]))
+ break;
+ }
+ else if ( nbNodes > 3 )
+ {
+ // find the best method of splitting into triangles by aspect ratio
+ SMESH::Controls::NumericalFunctorPtr aspectRatio( new SMESH::Controls::AspectRatio);
+ map< double, int > badness2iCommon;
+ const SMDS_MeshNode** nodes = vol.GetFaceNodes( iF );
+ int nbVariants = ( nbNodes == 4 ? 2 : nbNodes );
+ for ( int iVar = 0; iVar < nbVariants; ++iVar, ++iCommon )
+ for ( int iLast = iCommon+2; iLast < iCommon+nbNodes; ++iLast )
+ {
+ SMDS_FaceOfNodes tria ( nodes[ iQ*( iCommon )],
+ nodes[ iQ*((iLast-1)%nbNodes)],
+ nodes[ iQ*((iLast )%nbNodes)]);
+ double badness = getBadRate( &tria, aspectRatio );
+ badness2iCommon.insert( make_pair( badness, iCommon ));
+ }
+ // use iCommon with lowest badness
+ iCommon = badness2iCommon.begin()->second;
+ }
+ if ( iCommon >= nbNodes )
+ iCommon = 0; // something wrong
+ // fill connectivity of tetra
+ int nbTet = nbNodes - 2;
+ for ( int i = 0; i < nbTet; ++i )
+ {
+ int i1 = (iCommon+1+i) % nbNodes, i2 = (iCommon+2+i) % nbNodes;
+ if ( !vol.IsFaceExternal( iF )) swap( i1, i2 );
+ connectivity[ connSize++ ] = nInd[ iQ * iCommon ];
+ connectivity[ connSize++ ] = nInd[ iQ * i1 ];
+ connectivity[ connSize++ ] = nInd[ iQ * i2 ];
+ connectivity[ connSize++ ] = baryCenInd;
+ ++method._nbTetra;
+ }
+ }
+ connectivity[ connSize++ ] = -1;
+ }
+ 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
+ {
+ // find the tetrahedron including the three nodes of facet
+ const SMDS_MeshNode* n1 = elem->GetNode(_n1);
+ const SMDS_MeshNode* n2 = elem->GetNode(_n2);
+ const SMDS_MeshNode* n3 = elem->GetNode(_n3);
+ SMDS_ElemIteratorPtr volIt1 = n1->GetInverseElementIterator(SMDSAbs_Volume);
+ while ( volIt1->more() )
+ {
+ const SMDS_MeshElement* v = volIt1->next();
+ if ( v->GetEntityType() != ( v->IsQuadratic() ? SMDSEntity_Quad_Tetra : SMDSEntity_Tetra ))
+ continue;
+ SMDS_ElemIteratorPtr volIt2 = n2->GetInverseElementIterator(SMDSAbs_Volume);
+ while ( volIt2->more() )
+ if ( v != volIt2->next() )
+ continue;
+ SMDS_ElemIteratorPtr volIt3 = n3->GetInverseElementIterator(SMDSAbs_Volume);
+ while ( volIt3->more() )
+ if ( v == volIt3->next() )
+ return true;
+ }
+ return false;
+ }
+} // namespace
+
+//=======================================================================
+//function : SplitVolumesIntoTetra
+//purpose : Split volumic elements into tetrahedra.
+//=======================================================================
+
+void SMESH_MeshEditor::SplitVolumesIntoTetra (const TIDSortedElemSet & theElems,
+ const int theMethodFlags)
+{
+ // std-like iterator on coordinates of nodes of mesh element
+ typedef SMDS_StdIterator< TNodeXYZ, SMDS_ElemIteratorPtr > NXyzIterator;
+ NXyzIterator xyzEnd;
+
+ SMDS_VolumeTool volTool;
+ SMESH_MesherHelper helper( *GetMesh());
+
+ SMESHDS_SubMesh* subMesh = GetMeshDS()->MeshElements(1);
+ SMESHDS_SubMesh* fSubMesh = subMesh;
+
+ SMESH_SequenceOfElemPtr newNodes, newElems;
+
+ TIDSortedElemSet::const_iterator elem = theElems.begin();
+ for ( ; elem != theElems.end(); ++elem )
+ {
+ SMDSAbs_EntityType geomType = (*elem)->GetEntityType();
+ if ( geomType <= SMDSEntity_Quad_Tetra )
+ continue; // tetra or face or ...
+
+ if ( !volTool.Set( *elem )) continue; // not volume? strange...
+
+ TSplitMethod splitMethod = getSplitMethod( volTool, theMethodFlags );
+ if ( splitMethod._nbTetra < 1 ) continue;
+
+ // find submesh to add new tetras in
+ if ( !subMesh || !subMesh->Contains( *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() )
+ {
+ iQ = 2;
+ // add quadratic links to the helper
+ for ( int iF = 0; iF < volTool.NbFaces(); ++iF )
+ {
+ const SMDS_MeshNode** fNodes = volTool.GetFaceNodes( iF );
+ for ( int iN = 0; iN < volTool.NbFaceNodes( iF ); iN += iQ )
+ helper.AddTLinkNode( fNodes[iF], fNodes[iF+2], fNodes[iF+1] );
+ }
+ helper.SetIsQuadratic( true );
+ }
+ else
+ {
+ iQ = 1;
+ helper.SetIsQuadratic( false );
+ }
+ vector<const SMDS_MeshNode*> nodes( (*elem)->begin_nodes(), (*elem)->end_nodes() );
+ if ( splitMethod._baryNode )
+ {
+ // make a node at barycenter
+ gp_XYZ gc( 0,0,0 );
+ gc = accumulate( NXyzIterator((*elem)->nodesIterator()), xyzEnd, gc ) / nodes.size();
+ SMDS_MeshNode* gcNode = helper.AddNode( gc.X(), gc.Y(), gc.Z() );
+ nodes.push_back( gcNode );
+ newNodes.Append( gcNode );
+ }
+
+ // make tetras
+ helper.SetElementsOnShape( true );
+ 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] ]));
+
+ ReplaceElemInGroups( *elem, tetras, GetMeshDS() );
+
+ // Split faces on sides of the split volume
+
+ const SMDS_MeshNode** volNodes = volTool.GetNodes();
+ for ( int iF = 0; iF < volTool.NbFaces(); ++iF )
+ {
+ const int nbNodes = volTool.NbFaceNodes( iF ) / iQ;
+ if ( nbNodes < 4 ) continue;
+
+ // find an existing face
+ vector<const SMDS_MeshNode*> fNodes( volTool.GetFaceNodes( iF ),
+ volTool.GetFaceNodes( iF ) + nbNodes*iQ );
+ while ( const SMDS_MeshElement* face = GetMeshDS()->FindFace( fNodes ))
+ {
+ // among possible triangles create ones discribed by split method
+ const int* nInd = volTool.GetFaceNodesIndices( iF );
+ int nbVariants = ( nbNodes == 4 ? 2 : nbNodes );
+ int iCom = 0; // common node of triangle faces to split into
+ list< TTriangleFacet > facets;
+ for ( int iVar = 0; iVar < nbVariants; ++iVar, ++iCom )
+ {
+ TTriangleFacet t012( nInd[ iQ * ( iCom )],
+ nInd[ iQ * ( (iCom+1)%nbNodes )],
+ nInd[ iQ * ( (iCom+2)%nbNodes )]);
+ TTriangleFacet t023( nInd[ iQ * ( iCom )],
+ nInd[ iQ * ( (iCom+2)%nbNodes )],
+ nInd[ iQ * ( (iCom+3)%nbNodes )]);
+ if ( splitMethod.hasFacet( t012 ) && splitMethod.hasFacet( t023 ))
+ {
+ facets.push_back( t012 );
+ facets.push_back( t023 );
+ for ( int iLast = iCom+4; iLast < iCom+nbNodes; ++iLast )
+ facets.push_back( TTriangleFacet( nInd[ iQ * ( iCom )],
+ nInd[ iQ * ((iLast-1)%nbNodes )],
+ nInd[ iQ * ((iLast )%nbNodes )]));
+ break;
+ }
+ }
+ // find submesh to add new faces in
+ if ( !fSubMesh || !fSubMesh->Contains( face ))
+ {
+ int shapeID = FindShape( face );
+ fSubMesh = GetMeshDS()->MeshElements( shapeID );
+ }
+ // make triangles
+ helper.SetElementsOnShape( false );
+ vector< const SMDS_MeshElement* > triangles;
+ list< TTriangleFacet >::iterator facet = facets.begin();
+ for ( ; facet != facets.end(); ++facet )
+ {
+ if ( !volTool.IsFaceExternal( iF ))
+ swap( facet->_n2, facet->_n3 );
+ triangles.push_back( helper.AddFace( volNodes[ facet->_n1 ],
+ volNodes[ facet->_n2 ],
+ volNodes[ facet->_n3 ]));
+ if ( triangles.back() && fSubMesh )
+ fSubMesh->AddElement( triangles.back());
+ newElems.Append( triangles.back() );
+ }
+ ReplaceElemInGroups( face, triangles, GetMeshDS() );
+ GetMeshDS()->RemoveFreeElement( face, fSubMesh, /*fromGroups=*/false );
+ }
+
+ } // loop on volume faces to split them into triangles
+
+ GetMeshDS()->RemoveFreeElement( *elem, subMesh, /*fromGroups=*/false );
+
+ } // loop on volumes to split
+
+ myLastCreatedNodes = newNodes;
+ myLastCreatedElems = newElems;
+}
+
//=======================================================================
//function : AddToSameGroups
//purpose : add elemToAdd to the groups the elemInGroups belongs to
}
}
-//=======================================================================
-//function : ReplaceElemInGroups
-//purpose : replace elemToRm by elemToAdd in the all groups
-//=======================================================================
+//================================================================================
+/*!
+ * \brief Replace elemToRm by elemToAdd in the all groups
+ */
+//================================================================================
void SMESH_MeshEditor::ReplaceElemInGroups (const SMDS_MeshElement* elemToRm,
const SMDS_MeshElement* elemToAdd,
}
}
+//================================================================================
+/*!
+ * \brief Replace elemToRm by elemToAdd in the all groups
+ */
+//================================================================================
+
+void SMESH_MeshEditor::ReplaceElemInGroups (const SMDS_MeshElement* elemToRm,
+ const vector<const SMDS_MeshElement*>& elemToAdd,
+ SMESHDS_Mesh * aMesh)
+{
+ const set<SMESHDS_GroupBase*>& groups = aMesh->GetGroups();
+ if (!groups.empty())
+ {
+ set<SMESHDS_GroupBase*>::const_iterator grIt = groups.begin();
+ for ( ; grIt != groups.end(); grIt++ ) {
+ SMESHDS_Group* group = dynamic_cast<SMESHDS_Group*>( *grIt );
+ if ( group && group->SMDSGroup().Remove( elemToRm ) )
+ for ( int i = 0; i < elemToAdd.size(); ++i )
+ group->SMDSGroup().Add( elemToAdd[ i ] );
+ }
+ }
+}
+
//=======================================================================
//function : QuadToTri
//purpose : Cut quadrangles into triangles.
return newGroupIDs;
}
+
//=======================================================================
-/*!
- * \brief Create groups of elements made during transformation
- * \param nodeGens - nodes making corresponding myLastCreatedNodes
- * \param elemGens - elements making corresponding myLastCreatedElems
- * \param postfix - to append to names of new groups
- */
+//function : Scale
+//purpose :
//=======================================================================
SMESH_MeshEditor::PGroupIDs
-SMESH_MeshEditor::generateGroups(const SMESH_SequenceOfElemPtr& nodeGens,
- const SMESH_SequenceOfElemPtr& elemGens,
- const std::string& postfix,
- SMESH_Mesh* targetMesh)
+SMESH_MeshEditor::Scale (TIDSortedElemSet & theElems,
+ const gp_Pnt& thePoint,
+ const std::list<double>& theScaleFact,
+ const bool theCopy,
+ const bool theMakeGroups,
+ SMESH_Mesh* theTargetMesh)
{
- PGroupIDs newGroupIDs( new list<int> );
- SMESH_Mesh* mesh = targetMesh ? targetMesh : GetMesh();
+ myLastCreatedElems.Clear();
+ myLastCreatedNodes.Clear();
- // Sort existing groups by types and collect their names
+ SMESH_MeshEditor targetMeshEditor( theTargetMesh );
+ SMESHDS_Mesh* aTgtMesh = theTargetMesh ? theTargetMesh->GetMeshDS() : 0;
+ SMESHDS_Mesh* aMesh = GetMeshDS();
- // to store an old group and a generated new one
- typedef pair< SMESHDS_GroupBase*, SMDS_MeshGroup* > TOldNewGroup;
- vector< list< TOldNewGroup > > groupsByType( SMDSAbs_NbElementTypes );
- // group names
- set< string > groupNames;
- //
- SMDS_MeshGroup* nullNewGroup = (SMDS_MeshGroup*) 0;
- SMESH_Mesh::GroupIteratorPtr groupIt = GetMesh()->GetGroups();
- while ( groupIt->more() ) {
- SMESH_Group * group = groupIt->next();
- if ( !group ) continue;
- SMESHDS_GroupBase* groupDS = group->GetGroupDS();
- if ( !groupDS || groupDS->IsEmpty() ) continue;
- groupNames.insert( group->GetName() );
- groupDS->SetStoreName( group->GetName() );
- groupsByType[ groupDS->GetType() ].push_back( make_pair( groupDS, nullNewGroup ));
- }
+ double scaleX=1.0, scaleY=1.0, scaleZ=1.0;
+ std::list<double>::const_iterator itS = theScaleFact.begin();
+ scaleX = (*itS);
+ if(theScaleFact.size()==1) {
+ scaleY = (*itS);
+ scaleZ= (*itS);
+ }
+ if(theScaleFact.size()==2) {
+ itS++;
+ scaleY = (*itS);
+ scaleZ= (*itS);
+ }
+ if(theScaleFact.size()>2) {
+ itS++;
+ scaleY = (*itS);
+ itS++;
+ scaleZ= (*itS);
+ }
+
+ // map old node to new one
+ TNodeNodeMap nodeMap;
- // Groups creation
+ // elements sharing moved nodes; those of them which have all
+ // nodes mirrored but are not in theElems are to be reversed
+ TIDSortedElemSet inverseElemSet;
- // loop on nodes and elements
- for ( int isNodes = 0; isNodes < 2; ++isNodes )
- {
- const SMESH_SequenceOfElemPtr& gens = isNodes ? nodeGens : elemGens;
- const SMESH_SequenceOfElemPtr& elems = isNodes ? myLastCreatedNodes : myLastCreatedElems;
- if ( gens.Length() != elems.Length() )
- throw SALOME_Exception(LOCALIZED("invalid args"));
+ // source elements for each generated one
+ SMESH_SequenceOfElemPtr srcElems, srcNodes;
- // loop on created elements
- for (int iElem = 1; iElem <= elems.Length(); ++iElem )
- {
- const SMDS_MeshElement* sourceElem = gens( iElem );
- if ( !sourceElem ) {
- MESSAGE("generateGroups(): NULL source element");
- continue;
- }
- list< TOldNewGroup > & groupsOldNew = groupsByType[ sourceElem->GetType() ];
- if ( groupsOldNew.empty() ) {
- while ( iElem < gens.Length() && gens( iElem+1 ) == sourceElem )
- ++iElem; // skip all elements made by sourceElem
- continue;
- }
+ // loop on theElems
+ TIDSortedElemSet::iterator itElem;
+ for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) {
+ const SMDS_MeshElement* elem = *itElem;
+ if ( !elem )
+ continue;
+
+ // loop on elem nodes
+ SMDS_ElemIteratorPtr itN = elem->nodesIterator();
+ while ( itN->more() ) {
+
+ // check if a node has been already transformed
+ const SMDS_MeshNode* node = cast2Node( itN->next() );
+ pair<TNodeNodeMap::iterator,bool> n2n_isnew =
+ nodeMap.insert( make_pair ( node, node ));
+ if ( !n2n_isnew.second )
+ continue;
+
+ //double coord[3];
+ //coord[0] = node->X();
+ //coord[1] = node->Y();
+ //coord[2] = node->Z();
+ //theTrsf.Transforms( coord[0], coord[1], coord[2] );
+ double dx = (node->X() - thePoint.X()) * scaleX;
+ double dy = (node->Y() - thePoint.Y()) * scaleY;
+ double dz = (node->Z() - thePoint.Z()) * scaleZ;
+ if ( theTargetMesh ) {
+ //const SMDS_MeshNode * newNode = aTgtMesh->AddNode( coord[0], coord[1], coord[2] );
+ const SMDS_MeshNode * newNode =
+ aTgtMesh->AddNode( thePoint.X()+dx, thePoint.Y()+dy, thePoint.Z()+dz );
+ n2n_isnew.first->second = newNode;
+ myLastCreatedNodes.Append(newNode);
+ srcNodes.Append( node );
+ }
+ else if ( theCopy ) {
+ //const SMDS_MeshNode * newNode = aMesh->AddNode( coord[0], coord[1], coord[2] );
+ const SMDS_MeshNode * newNode =
+ aMesh->AddNode( thePoint.X()+dx, thePoint.Y()+dy, thePoint.Z()+dz );
+ n2n_isnew.first->second = newNode;
+ myLastCreatedNodes.Append(newNode);
+ srcNodes.Append( node );
+ }
+ else {
+ //aMesh->MoveNode( node, coord[0], coord[1], coord[2] );
+ aMesh->MoveNode( node, thePoint.X()+dx, thePoint.Y()+dy, thePoint.Z()+dz );
+ // node position on shape becomes invalid
+ const_cast< SMDS_MeshNode* > ( node )->SetPosition
+ ( SMDS_SpacePosition::originSpacePosition() );
+ }
+
+ // keep inverse elements
+ //if ( !theCopy && !theTargetMesh && needReverse ) {
+ // SMDS_ElemIteratorPtr invElemIt = node->GetInverseElementIterator();
+ // while ( invElemIt->more() ) {
+ // const SMDS_MeshElement* iel = invElemIt->next();
+ // inverseElemSet.insert( iel );
+ // }
+ //}
+ }
+ }
+
+ // either create new elements or reverse mirrored ones
+ //if ( !theCopy && !needReverse && !theTargetMesh )
+ if ( !theCopy && !theTargetMesh )
+ return PGroupIDs();
+
+ TIDSortedElemSet::iterator invElemIt = inverseElemSet.begin();
+ for ( ; invElemIt != inverseElemSet.end(); invElemIt++ )
+ theElems.insert( *invElemIt );
+
+ // replicate or reverse elements
+
+ enum {
+ REV_TETRA = 0, // = nbNodes - 4
+ REV_PYRAMID = 1, // = nbNodes - 4
+ REV_PENTA = 2, // = nbNodes - 4
+ REV_FACE = 3,
+ REV_HEXA = 4, // = nbNodes - 4
+ FORWARD = 5
+ };
+ int index[][8] = {
+ { 2, 1, 0, 3, 4, 0, 0, 0 }, // REV_TETRA
+ { 2, 1, 0, 3, 4, 0, 0, 0 }, // REV_PYRAMID
+ { 2, 1, 0, 5, 4, 3, 0, 0 }, // REV_PENTA
+ { 2, 1, 0, 3, 0, 0, 0, 0 }, // REV_FACE
+ { 2, 1, 0, 3, 6, 5, 4, 7 }, // REV_HEXA
+ { 0, 1, 2, 3, 4, 5, 6, 7 } // FORWARD
+ };
+
+ for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ )
+ {
+ const SMDS_MeshElement* elem = *itElem;
+ if ( !elem || elem->GetType() == SMDSAbs_Node )
+ continue;
+
+ int nbNodes = elem->NbNodes();
+ int elemType = elem->GetType();
+
+ if (elem->IsPoly()) {
+ // Polygon or Polyhedral Volume
+ switch ( elemType ) {
+ case SMDSAbs_Face:
+ {
+ vector<const SMDS_MeshNode*> poly_nodes (nbNodes);
+ int iNode = 0;
+ SMDS_ElemIteratorPtr itN = elem->nodesIterator();
+ while (itN->more()) {
+ const SMDS_MeshNode* node =
+ static_cast<const SMDS_MeshNode*>(itN->next());
+ TNodeNodeMap::iterator nodeMapIt = nodeMap.find(node);
+ if (nodeMapIt == nodeMap.end())
+ break; // not all nodes transformed
+ //if (needReverse) {
+ // // reverse mirrored faces and volumes
+ // poly_nodes[nbNodes - iNode - 1] = (*nodeMapIt).second;
+ //} else {
+ poly_nodes[iNode] = (*nodeMapIt).second;
+ //}
+ iNode++;
+ }
+ if ( iNode != nbNodes )
+ continue; // not all nodes transformed
+
+ if ( theTargetMesh ) {
+ myLastCreatedElems.Append(aTgtMesh->AddPolygonalFace(poly_nodes));
+ srcElems.Append( elem );
+ }
+ else if ( theCopy ) {
+ myLastCreatedElems.Append(aMesh->AddPolygonalFace(poly_nodes));
+ srcElems.Append( elem );
+ }
+ else {
+ aMesh->ChangePolygonNodes(elem, poly_nodes);
+ }
+ }
+ break;
+ case SMDSAbs_Volume:
+ {
+ // ATTENTION: Reversing is not yet done!!!
+ const SMDS_PolyhedralVolumeOfNodes* aPolyedre =
+ dynamic_cast<const SMDS_PolyhedralVolumeOfNodes*>( elem );
+ if (!aPolyedre) {
+ MESSAGE("Warning: bad volumic element");
+ continue;
+ }
+
+ vector<const SMDS_MeshNode*> poly_nodes;
+ vector<int> quantities;
+
+ bool allTransformed = true;
+ int nbFaces = aPolyedre->NbFaces();
+ for (int iface = 1; iface <= nbFaces && allTransformed; iface++) {
+ int nbFaceNodes = aPolyedre->NbFaceNodes(iface);
+ for (int inode = 1; inode <= nbFaceNodes && allTransformed; inode++) {
+ const SMDS_MeshNode* node = aPolyedre->GetFaceNode(iface, inode);
+ TNodeNodeMap::iterator nodeMapIt = nodeMap.find(node);
+ if (nodeMapIt == nodeMap.end()) {
+ allTransformed = false; // not all nodes transformed
+ } else {
+ poly_nodes.push_back((*nodeMapIt).second);
+ }
+ }
+ quantities.push_back(nbFaceNodes);
+ }
+ if ( !allTransformed )
+ continue; // not all nodes transformed
+
+ if ( theTargetMesh ) {
+ myLastCreatedElems.Append(aTgtMesh->AddPolyhedralVolume(poly_nodes, quantities));
+ srcElems.Append( elem );
+ }
+ else if ( theCopy ) {
+ myLastCreatedElems.Append(aMesh->AddPolyhedralVolume(poly_nodes, quantities));
+ srcElems.Append( elem );
+ }
+ else {
+ aMesh->ChangePolyhedronNodes(elem, poly_nodes, quantities);
+ }
+ }
+ break;
+ default:;
+ }
+ continue;
+ }
+
+ // Regular elements
+ int* i = index[ FORWARD ];
+ //if ( needReverse && nbNodes > 2) // reverse mirrored faces and volumes
+ // if ( elemType == SMDSAbs_Face )
+ // i = index[ REV_FACE ];
+ // else
+ // i = index[ nbNodes - 4 ];
+
+ if(elem->IsQuadratic()) {
+ static int anIds[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ i = anIds;
+ //if(needReverse) {
+ // if(nbNodes==3) { // quadratic edge
+ // static int anIds[] = {1,0,2};
+ // i = anIds;
+ // }
+ // else if(nbNodes==6) { // quadratic triangle
+ // static int anIds[] = {0,2,1,5,4,3};
+ // i = anIds;
+ // }
+ // else if(nbNodes==8) { // quadratic quadrangle
+ // static int anIds[] = {0,3,2,1,7,6,5,4};
+ // i = anIds;
+ // }
+ // else if(nbNodes==10) { // quadratic tetrahedron of 10 nodes
+ // static int anIds[] = {0,2,1,3,6,5,4,7,9,8};
+ // i = anIds;
+ // }
+ // else if(nbNodes==13) { // quadratic pyramid of 13 nodes
+ // static int anIds[] = {0,3,2,1,4,8,7,6,5,9,12,11,10};
+ // i = anIds;
+ // }
+ // else if(nbNodes==15) { // quadratic pentahedron with 15 nodes
+ // static int anIds[] = {0,2,1,3,5,4,8,7,6,11,10,9,12,14,13};
+ // i = anIds;
+ // }
+ // else { // nbNodes==20 - quadratic hexahedron with 20 nodes
+ // static int anIds[] = {0,3,2,1,4,7,6,5,11,10,9,8,15,14,13,12,16,19,18,17};
+ // i = anIds;
+ // }
+ //}
+ }
+
+ // find transformed nodes
+ vector<const SMDS_MeshNode*> nodes(nbNodes);
+ int iNode = 0;
+ SMDS_ElemIteratorPtr itN = elem->nodesIterator();
+ while ( itN->more() ) {
+ const SMDS_MeshNode* node =
+ static_cast<const SMDS_MeshNode*>( itN->next() );
+ TNodeNodeMap::iterator nodeMapIt = nodeMap.find( node );
+ if ( nodeMapIt == nodeMap.end() )
+ break; // not all nodes transformed
+ nodes[ i [ iNode++ ]] = (*nodeMapIt).second;
+ }
+ if ( iNode != nbNodes )
+ continue; // not all nodes transformed
+
+ if ( theTargetMesh ) {
+ if ( SMDS_MeshElement* copy =
+ targetMeshEditor.AddElement( nodes, elem->GetType(), elem->IsPoly() )) {
+ myLastCreatedElems.Append( copy );
+ srcElems.Append( elem );
+ }
+ }
+ else if ( theCopy ) {
+ if ( SMDS_MeshElement* copy = AddElement( nodes, elem->GetType(), elem->IsPoly() )) {
+ myLastCreatedElems.Append( copy );
+ srcElems.Append( elem );
+ }
+ }
+ else {
+ // reverse element as it was reversed by transformation
+ if ( nbNodes > 2 )
+ aMesh->ChangeElementNodes( elem, &nodes[0], nbNodes );
+ }
+ }
+
+ PGroupIDs newGroupIDs;
+
+ if ( theMakeGroups && theCopy ||
+ theMakeGroups && theTargetMesh ) {
+ string groupPostfix = "scaled";
+ newGroupIDs = generateGroups( srcNodes, srcElems, groupPostfix, theTargetMesh );
+ }
+
+ return newGroupIDs;
+}
+
+
+//=======================================================================
+/*!
+ * \brief Create groups of elements made during transformation
+ * \param nodeGens - nodes making corresponding myLastCreatedNodes
+ * \param elemGens - elements making corresponding myLastCreatedElems
+ * \param postfix - to append to names of new groups
+ */
+//=======================================================================
+
+SMESH_MeshEditor::PGroupIDs
+SMESH_MeshEditor::generateGroups(const SMESH_SequenceOfElemPtr& nodeGens,
+ const SMESH_SequenceOfElemPtr& elemGens,
+ const std::string& postfix,
+ SMESH_Mesh* targetMesh)
+{
+ PGroupIDs newGroupIDs( new list<int> );
+ SMESH_Mesh* mesh = targetMesh ? targetMesh : GetMesh();
+
+ // Sort existing groups by types and collect their names
+
+ // to store an old group and a generated new one
+ typedef pair< SMESHDS_GroupBase*, SMDS_MeshGroup* > TOldNewGroup;
+ vector< list< TOldNewGroup > > groupsByType( SMDSAbs_NbElementTypes );
+ // group names
+ set< string > groupNames;
+ //
+ SMDS_MeshGroup* nullNewGroup = (SMDS_MeshGroup*) 0;
+ SMESH_Mesh::GroupIteratorPtr groupIt = GetMesh()->GetGroups();
+ while ( groupIt->more() ) {
+ SMESH_Group * group = groupIt->next();
+ if ( !group ) continue;
+ SMESHDS_GroupBase* groupDS = group->GetGroupDS();
+ if ( !groupDS || groupDS->IsEmpty() ) continue;
+ groupNames.insert( group->GetName() );
+ groupDS->SetStoreName( group->GetName() );
+ groupsByType[ groupDS->GetType() ].push_back( make_pair( groupDS, nullNewGroup ));
+ }
+
+ // Groups creation
+
+ // loop on nodes and elements
+ for ( int isNodes = 0; isNodes < 2; ++isNodes )
+ {
+ const SMESH_SequenceOfElemPtr& gens = isNodes ? nodeGens : elemGens;
+ const SMESH_SequenceOfElemPtr& elems = isNodes ? myLastCreatedNodes : myLastCreatedElems;
+ if ( gens.Length() != elems.Length() )
+ throw SALOME_Exception(LOCALIZED("invalid args"));
+
+ // loop on created elements
+ for (int iElem = 1; iElem <= elems.Length(); ++iElem )
+ {
+ const SMDS_MeshElement* sourceElem = gens( iElem );
+ if ( !sourceElem ) {
+ MESSAGE("generateGroups(): NULL source element");
+ continue;
+ }
+ list< TOldNewGroup > & groupsOldNew = groupsByType[ sourceElem->GetType() ];
+ if ( groupsOldNew.empty() ) {
+ while ( iElem < gens.Length() && gens( iElem+1 ) == sourceElem )
+ ++iElem; // skip all elements made by sourceElem
+ continue;
+ }
// collect all elements made by sourceElem
list< const SMDS_MeshElement* > resultElems;
if ( const SMDS_MeshElement* resElem = elems( iElem ))
const SMDS_MeshNode* closestNode = 0;
list<const SMDS_MeshNode*>::iterator nIt = nodes.begin();
for ( ; nIt != nodes.end(); ++nIt ) {
- double sqDist = thePnt.SquareDistance( TNodeXYZ( *nIt ) );
+ double sqDist = thePnt.SquareDistance( SMESH_MeshEditor::TNodeXYZ( *nIt ) );
if ( minSqDist > sqDist ) {
closestNode = *nIt;
minSqDist = sqDist;
ElementBndBoxTree(const SMDS_Mesh& mesh, SMDSAbs_ElementType elemType);
void getElementsNearPoint( const gp_Pnt& point, TIDSortedElemSet& foundElems);
+ void getElementsNearLine ( const gp_Ax1& line, TIDSortedElemSet& foundElems);
~ElementBndBoxTree();
protected:
if ( isLeaf() )
{
for ( int i = 0; i < _elements.size(); ++i )
- if ( !_elements[i]->IsOut( point.XYZ() ))
+ if ( !_elements[i]->IsOut( point.XYZ() ))
+ foundElems.insert( _elements[i]->_element );
+ }
+ else
+ {
+ for (int i = 0; i < 8; i++)
+ ((ElementBndBoxTree*) myChildren[i])->getElementsNearPoint( point, foundElems );
+ }
+ }
+
+ //================================================================================
+ /*!
+ * \brief Return elements which can be intersected by the line
+ */
+ //================================================================================
+
+ void ElementBndBoxTree::getElementsNearLine( const gp_Ax1& line,
+ TIDSortedElemSet& foundElems)
+ {
+ if ( level() && getBox().IsOut( line ))
+ return;
+
+ if ( isLeaf() )
+ {
+ for ( int i = 0; i < _elements.size(); ++i )
+ if ( !_elements[i]->IsOut( line ))
foundElems.insert( _elements[i]->_element );
}
else
{
for (int i = 0; i < 8; i++)
- ((ElementBndBoxTree*) myChildren[i])->getElementsNearPoint( point, foundElems );
+ ((ElementBndBoxTree*) myChildren[i])->getElementsNearLine( line, foundElems );
}
}
_refCount = 1;
SMDS_ElemIteratorPtr nIt = elem->nodesIterator();
while ( nIt->more() )
- Add( TNodeXYZ( cast2Node( nIt->next() )));
+ Add( SMESH_MeshEditor::TNodeXYZ( cast2Node( nIt->next() )));
Enlarge( NodeRadius );
}
//=======================================================================
/*!
- * \brief Implementation of search for the elements by point
+ * \brief Implementation of search for the elements by point and
+ * of classification of point in 2D mesh
*/
//=======================================================================
struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher
{
- SMESHDS_Mesh* _mesh;
- ElementBndBoxTree* _ebbTree;
- SMESH_NodeSearcherImpl* _nodeSearcher;
- SMDSAbs_ElementType _elementType;
-
- SMESH_ElementSearcherImpl( SMESHDS_Mesh& mesh ): _mesh(&mesh),_ebbTree(0),_nodeSearcher(0) {}
+ SMESHDS_Mesh* _mesh;
+ ElementBndBoxTree* _ebbTree;
+ SMESH_NodeSearcherImpl* _nodeSearcher;
+ SMDSAbs_ElementType _elementType;
+ double _tolerance;
+ bool _outerFacesFound;
+ set<const SMDS_MeshElement*> _outerFaces; // empty means "no internal faces at all"
+
+ SMESH_ElementSearcherImpl( SMESHDS_Mesh& mesh )
+ : _mesh(&mesh),_ebbTree(0),_nodeSearcher(0), _tolerance(-1), _outerFacesFound(false) {}
~SMESH_ElementSearcherImpl()
{
if ( _ebbTree ) delete _ebbTree; _ebbTree = 0;
if ( _nodeSearcher ) delete _nodeSearcher; _nodeSearcher = 0;
}
+ virtual int FindElementsByPoint(const gp_Pnt& point,
+ SMDSAbs_ElementType type,
+ vector< const SMDS_MeshElement* >& foundElements);
+ virtual TopAbs_State GetPointState(const gp_Pnt& point);
- /*!
- * \brief Return elements of given type where the given point is IN or ON.
- *
- * 'ALL' type means elements of any type excluding nodes and 0D elements
- */
- void FindElementsByPoint(const gp_Pnt& point,
- SMDSAbs_ElementType type,
- vector< const SMDS_MeshElement* >& foundElements)
+ double getTolerance();
+ bool getIntersParamOnLine(const gp_Lin& line, const SMDS_MeshElement* face,
+ const double tolerance, double & param);
+ void findOuterBoundary(const SMDS_MeshElement* anyOuterFace);
+ bool isOuterBoundary(const SMDS_MeshElement* face) const
+ {
+ return _outerFaces.empty() || _outerFaces.count(face);
+ }
+ struct TInters //!< data of intersection of the line and the mesh face used in GetPointState()
+ {
+ const SMDS_MeshElement* _face;
+ gp_Vec _faceNorm;
+ bool _coincides; //!< the line lays in face plane
+ TInters(const SMDS_MeshElement* face, const gp_Vec& faceNorm, bool coinc=false)
+ : _face(face), _faceNorm( faceNorm ), _coincides( coinc ) {}
+ };
+ struct TFaceLink //!< link and faces sharing it (used in findOuterBoundary())
{
- foundElements.clear();
+ SMESH_TLink _link;
+ TIDSortedElemSet _faces;
+ TFaceLink( const SMDS_MeshNode* n1, const SMDS_MeshNode* n2, const SMDS_MeshElement* face)
+ : _link( n1, n2 ), _faces( &face, &face + 1) {}
+ };
+};
+
+ostream& operator<< (ostream& out, const SMESH_ElementSearcherImpl::TInters& i)
+{
+ return out << "TInters(face=" << ( i._face ? i._face->GetID() : 0)
+ << ", _coincides="<<i._coincides << ")";
+}
+
+//=======================================================================
+/*!
+ * \brief define tolerance for search
+ */
+//=======================================================================
+double SMESH_ElementSearcherImpl::getTolerance()
+{
+ if ( _tolerance < 0 )
+ {
const SMDS_MeshInfo& meshInfo = _mesh->GetMeshInfo();
- // -----------------
- // define tolerance
- // -----------------
- double tolerance = 0;
+ _tolerance = 0;
if ( _nodeSearcher && meshInfo.NbNodes() > 1 )
{
double boxSize = _nodeSearcher->getTree()->maxSize();
- tolerance = 1e-8 * boxSize/* / meshInfo.NbNodes()*/;
+ _tolerance = 1e-8 * boxSize/* / meshInfo.NbNodes()*/;
}
else if ( _ebbTree && meshInfo.NbElements() > 0 )
{
double boxSize = _ebbTree->maxSize();
- tolerance = 1e-8 * boxSize/* / meshInfo.NbElements()*/;
+ _tolerance = 1e-8 * boxSize/* / meshInfo.NbElements()*/;
}
- if ( tolerance == 0 )
+ if ( _tolerance == 0 )
{
// define tolerance by size of a most complex element
int complexType = SMDSAbs_Volume;
while ( complexType > SMDSAbs_All &&
meshInfo.NbElements( SMDSAbs_ElementType( complexType )) < 1 )
--complexType;
- if ( complexType == SMDSAbs_All ) return; // empty mesh
+ if ( complexType == SMDSAbs_All ) return 0; // empty mesh
double elemSize;
if ( complexType == int( SMDSAbs_Node ))
SMDS_NodeIteratorPtr nodeIt = _mesh->nodesIterator();
elemSize = 1;
if ( meshInfo.NbNodes() > 2 )
- elemSize = TNodeXYZ( nodeIt->next() ).Distance( nodeIt->next() );
+ elemSize = SMESH_MeshEditor::TNodeXYZ( nodeIt->next() ).Distance( nodeIt->next() );
}
else
{
const SMDS_MeshElement* elem =
_mesh->elementsIterator( SMDSAbs_ElementType( complexType ))->next();
SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator();
- TNodeXYZ n1( cast2Node( nodeIt->next() ));
+ SMESH_MeshEditor::TNodeXYZ n1( cast2Node( nodeIt->next() ));
while ( nodeIt->more() )
{
double dist = n1.Distance( cast2Node( nodeIt->next() ));
elemSize = max( dist, elemSize );
}
}
- tolerance = 1e-6 * elemSize;
+ _tolerance = 1e-6 * elemSize;
}
+ }
+ return _tolerance;
+}
+
+//================================================================================
+/*!
+ * \brief Find intersection of the line and an edge of face and return parameter on line
+ */
+//================================================================================
- // =================================================================================
- if ( type == SMDSAbs_Node || type == SMDSAbs_0DElement )
+bool SMESH_ElementSearcherImpl::getIntersParamOnLine(const gp_Lin& line,
+ const SMDS_MeshElement* face,
+ const double tol,
+ double & param)
+{
+ int nbInts = 0;
+ param = 0;
+
+ GeomAPI_ExtremaCurveCurve anExtCC;
+ Handle(Geom_Curve) lineCurve = new Geom_Line( line );
+
+ int nbNodes = face->IsQuadratic() ? face->NbNodes()/2 : face->NbNodes();
+ for ( int i = 0; i < nbNodes && nbInts < 2; ++i )
+ {
+ GC_MakeSegment edge( SMESH_MeshEditor::TNodeXYZ( face->GetNode( i )),
+ SMESH_MeshEditor::TNodeXYZ( face->GetNode( (i+1)%nbNodes) ));
+ anExtCC.Init( lineCurve, edge);
+ if ( anExtCC.NbExtrema() > 0 && anExtCC.LowerDistance() <= tol)
{
- if ( !_nodeSearcher )
- _nodeSearcher = new SMESH_NodeSearcherImpl( _mesh );
+ Quantity_Parameter pl, pe;
+ anExtCC.LowerDistanceParameters( pl, pe );
+ param += pl;
+ if ( ++nbInts == 2 )
+ break;
+ }
+ }
+ if ( nbInts > 0 ) param /= nbInts;
+ return nbInts > 0;
+}
+//================================================================================
+/*!
+ * \brief Find all faces belonging to the outer boundary of mesh
+ */
+//================================================================================
+
+void SMESH_ElementSearcherImpl::findOuterBoundary(const SMDS_MeshElement* outerFace)
+{
+ if ( _outerFacesFound ) return;
- const SMDS_MeshNode* closeNode = _nodeSearcher->FindClosestTo( point );
- if ( !closeNode ) return;
+ // Collect all outer faces by passing from one outer face to another via their links
+ // and BTW find out if there are internal faces at all.
- if ( point.Distance( TNodeXYZ( closeNode )) > tolerance )
- return; // to far from any node
+ // checked links and links where outer boundary meets internal one
+ set< SMESH_TLink > visitedLinks, seamLinks;
- if ( type == SMDSAbs_Node )
+ // links to treat with already visited faces sharing them
+ list < TFaceLink > startLinks;
+
+ // load startLinks with the first outerFace
+ startLinks.push_back( TFaceLink( outerFace->GetNode(0), outerFace->GetNode(1), outerFace));
+ _outerFaces.insert( outerFace );
+
+ TIDSortedElemSet emptySet;
+ while ( !startLinks.empty() )
+ {
+ const SMESH_TLink& link = startLinks.front()._link;
+ TIDSortedElemSet& faces = startLinks.front()._faces;
+
+ outerFace = *faces.begin();
+ // find other faces sharing the link
+ const SMDS_MeshElement* f;
+ while (( f = SMESH_MeshEditor::FindFaceInSet(link.node1(), link.node2(), emptySet, faces )))
+ faces.insert( f );
+
+ // select another outer face among the found
+ const SMDS_MeshElement* outerFace2 = 0;
+ if ( faces.size() == 2 )
+ {
+ outerFace2 = (outerFace == *faces.begin() ? *faces.rbegin() : *faces.begin());
+ }
+ else if ( faces.size() > 2 )
+ {
+ seamLinks.insert( link );
+
+ // link direction within the outerFace
+ gp_Vec n1n2( SMESH_MeshEditor::TNodeXYZ( link.node1()),
+ SMESH_MeshEditor::TNodeXYZ( link.node2()));
+ int i1 = outerFace->GetNodeIndex( link.node1() );
+ int i2 = outerFace->GetNodeIndex( link.node2() );
+ bool rev = ( abs(i2-i1) == 1 ? i1 > i2 : i2 > i1 );
+ if ( rev ) n1n2.Reverse();
+ // outerFace normal
+ gp_XYZ ofNorm, fNorm;
+ if ( SMESH_Algo::FaceNormal( outerFace, ofNorm, /*normalized=*/false ))
{
- foundElements.push_back( closeNode );
+ // direction from the link inside outerFace
+ gp_Vec dirInOF = gp_Vec( ofNorm ) ^ n1n2;
+ // sort all other faces by angle with the dirInOF
+ map< double, const SMDS_MeshElement* > angle2Face;
+ set< const SMDS_MeshElement*, TIDCompare >::const_iterator face = faces.begin();
+ for ( ; face != faces.end(); ++face )
+ {
+ if ( !SMESH_Algo::FaceNormal( *face, fNorm, /*normalized=*/false ))
+ continue;
+ gp_Vec dirInF = gp_Vec( fNorm ) ^ n1n2;
+ double angle = dirInOF.AngleWithRef( dirInF, n1n2 );
+ if ( angle < 0 ) angle += 2*PI;
+ angle2Face.insert( make_pair( angle, *face ));
+ }
+ if ( !angle2Face.empty() )
+ outerFace2 = angle2Face.begin()->second;
}
- else
+ }
+ // store the found outer face and add its links to continue seaching from
+ if ( outerFace2 )
+ {
+ _outerFaces.insert( outerFace );
+ int nbNodes = outerFace2->NbNodes()/( outerFace2->IsQuadratic() ? 2 : 1 );
+ for ( int i = 0; i < nbNodes; ++i )
{
- SMDS_ElemIteratorPtr elemIt = closeNode->GetInverseElementIterator( SMDSAbs_0DElement );
- while ( elemIt->more() )
- foundElements.push_back( elemIt->next() );
+ SMESH_TLink link2( outerFace2->GetNode(i), outerFace2->GetNode((i+1)%nbNodes));
+ if ( visitedLinks.insert( link2 ).second )
+ startLinks.push_back( TFaceLink( link2.node1(), link2.node2(), outerFace2 ));
}
}
- // =================================================================================
- else // elements more complex than 0D
+ startLinks.pop_front();
+ }
+ _outerFacesFound = true;
+
+ if ( !seamLinks.empty() )
+ {
+ // There are internal boundaries touching the outher one,
+ // find all faces of internal boundaries in order to find
+ // faces of boundaries of holes, if any.
+
+ }
+ else
+ {
+ _outerFaces.clear();
+ }
+}
+
+//=======================================================================
+/*!
+ * \brief Find elements of given type where the given point is IN or ON.
+ * Returns nb of found elements and elements them-selves.
+ *
+ * 'ALL' type means elements of any type excluding nodes and 0D elements
+ */
+//=======================================================================
+
+int SMESH_ElementSearcherImpl::
+FindElementsByPoint(const gp_Pnt& point,
+ SMDSAbs_ElementType type,
+ vector< const SMDS_MeshElement* >& foundElements)
+{
+ foundElements.clear();
+
+ double tolerance = getTolerance();
+
+ // =================================================================================
+ if ( type == SMDSAbs_Node || type == SMDSAbs_0DElement )
+ {
+ if ( !_nodeSearcher )
+ _nodeSearcher = new SMESH_NodeSearcherImpl( _mesh );
+
+ const SMDS_MeshNode* closeNode = _nodeSearcher->FindClosestTo( point );
+ if ( !closeNode ) return foundElements.size();
+
+ if ( point.Distance( SMESH_MeshEditor::TNodeXYZ( closeNode )) > tolerance )
+ return foundElements.size(); // to far from any node
+
+ if ( type == SMDSAbs_Node )
+ {
+ foundElements.push_back( closeNode );
+ }
+ else
+ {
+ SMDS_ElemIteratorPtr elemIt = closeNode->GetInverseElementIterator( SMDSAbs_0DElement );
+ while ( elemIt->more() )
+ foundElements.push_back( elemIt->next() );
+ }
+ }
+ // =================================================================================
+ else // elements more complex than 0D
+ {
+ if ( !_ebbTree || _elementType != type )
+ {
+ if ( _ebbTree ) delete _ebbTree;
+ _ebbTree = new ElementBndBoxTree( *_mesh, _elementType = type );
+ }
+ TIDSortedElemSet suspectElems;
+ _ebbTree->getElementsNearPoint( point, suspectElems );
+ TIDSortedElemSet::iterator elem = suspectElems.begin();
+ for ( ; elem != suspectElems.end(); ++elem )
+ if ( !SMESH_MeshEditor::isOut( *elem, point, tolerance ))
+ foundElements.push_back( *elem );
+ }
+ return foundElements.size();
+}
+
+//================================================================================
+/*!
+ * \brief Classify the given point in the closed 2D mesh
+ */
+//================================================================================
+
+TopAbs_State SMESH_ElementSearcherImpl::GetPointState(const gp_Pnt& point)
+{
+ double tolerance = getTolerance();
+ if ( !_ebbTree || _elementType != SMDSAbs_Face )
+ {
+ if ( _ebbTree ) delete _ebbTree;
+ _ebbTree = new ElementBndBoxTree( *_mesh, _elementType = SMDSAbs_Face );
+ }
+ // Algo: analyse transition of a line starting at the point through mesh boundary;
+ // try three lines parallel to axis of the coordinate system and perform rough
+ // analysis. If solution is not clear perform thorough analysis.
+
+ const int nbAxes = 3;
+ gp_Dir axisDir[ nbAxes ] = { gp::DX(), gp::DY(), gp::DZ() };
+ map< double, TInters > paramOnLine2TInters[ nbAxes ];
+ list< TInters > tangentInters[ nbAxes ]; // of faces whose plane includes the line
+ multimap< int, int > nbInt2Axis; // to find the simplest case
+ for ( int axis = 0; axis < nbAxes; ++axis )
+ {
+ gp_Ax1 lineAxis( point, axisDir[axis]);
+ gp_Lin line ( lineAxis );
+
+ TIDSortedElemSet suspectFaces; // faces possibly intersecting the line
+ _ebbTree->getElementsNearLine( lineAxis, suspectFaces );
+
+ // Intersect faces with the line
+
+ map< double, TInters > & u2inters = paramOnLine2TInters[ axis ];
+ TIDSortedElemSet::iterator face = suspectFaces.begin();
+ for ( ; face != suspectFaces.end(); ++face )
{
- if ( !_ebbTree || _elementType != type )
+ // get face plane
+ gp_XYZ fNorm;
+ if ( !SMESH_Algo::FaceNormal( *face, fNorm, /*normalized=*/false)) continue;
+ gp_Pln facePlane( SMESH_MeshEditor::TNodeXYZ( (*face)->GetNode(0)), fNorm );
+
+ // perform intersection
+ IntAna_IntConicQuad intersection( line, IntAna_Quadric( facePlane ));
+ if ( !intersection.IsDone() )
+ continue;
+ if ( intersection.IsInQuadric() )
+ {
+ tangentInters[ axis ].push_back( TInters( *face, fNorm, true ));
+ }
+ else if ( ! intersection.IsParallel() && intersection.NbPoints() > 0 )
{
- if ( _ebbTree ) delete _ebbTree;
- _ebbTree = new ElementBndBoxTree( *_mesh, _elementType = type );
+ gp_Pnt intersectionPoint = intersection.Point(1);
+ if ( !SMESH_MeshEditor::isOut( *face, intersectionPoint, tolerance ))
+ u2inters.insert(make_pair( intersection.ParamOnConic(1), TInters( *face, fNorm )));
}
- TIDSortedElemSet suspectElems;
- _ebbTree->getElementsNearPoint( point, suspectElems );
- TIDSortedElemSet::iterator elem = suspectElems.begin();
- for ( ; elem != suspectElems.end(); ++elem )
- if ( !SMESH_MeshEditor::isOut( *elem, point, tolerance ))
- foundElements.push_back( *elem );
}
- }
-}; // struct SMESH_ElementSearcherImpl
+ // Analyse intersections roughly
+
+ int nbInter = u2inters.size();
+ if ( nbInter == 0 )
+ return TopAbs_OUT;
+
+ double f = u2inters.begin()->first, l = u2inters.rbegin()->first;
+ if ( nbInter == 1 ) // not closed mesh
+ return fabs( f ) < tolerance ? TopAbs_ON : TopAbs_UNKNOWN;
+
+ if ( fabs( f ) < tolerance || fabs( l ) < tolerance )
+ return TopAbs_ON;
+
+ if ( (f<0) == (l<0) )
+ return TopAbs_OUT;
+
+ int nbIntBeforePoint = std::distance( u2inters.begin(), u2inters.lower_bound(0));
+ int nbIntAfterPoint = nbInter - nbIntBeforePoint;
+ if ( nbIntBeforePoint == 1 || nbIntAfterPoint == 1 )
+ return TopAbs_IN;
+
+ nbInt2Axis.insert( make_pair( min( nbIntBeforePoint, nbIntAfterPoint ), axis ));
+
+ if ( _outerFacesFound ) break; // pass to thorough analysis
+
+ } // three attempts - loop on CS axes
+
+ // Analyse intersections thoroughly.
+ // We make two loops maximum, on the first one we only exclude touching intersections,
+ // on the second, if situation is still unclear, we gather and use information on
+ // position of faces (internal or outer). If faces position is already gathered,
+ // we make the second loop right away.
+
+ for ( int hasPositionInfo = _outerFacesFound; hasPositionInfo < 2; ++hasPositionInfo )
+ {
+ multimap< int, int >::const_iterator nb_axis = nbInt2Axis.begin();
+ for ( ; nb_axis != nbInt2Axis.end(); ++nb_axis )
+ {
+ int axis = nb_axis->second;
+ map< double, TInters > & u2inters = paramOnLine2TInters[ axis ];
+
+ gp_Ax1 lineAxis( point, axisDir[axis]);
+ gp_Lin line ( lineAxis );
+
+ // add tangent intersections to u2inters
+ double param;
+ list< TInters >::const_iterator tgtInt = tangentInters[ axis ].begin();
+ for ( ; tgtInt != tangentInters[ axis ].end(); ++tgtInt )
+ if ( getIntersParamOnLine( line, tgtInt->_face, tolerance, param ))
+ u2inters.insert(make_pair( param, *tgtInt ));
+ tangentInters[ axis ].clear();
+
+ // Count intersections before and after the point excluding touching ones.
+ // If hasPositionInfo we count intersections of outer boundary only
+
+ int nbIntBeforePoint = 0, nbIntAfterPoint = 0;
+ double f = numeric_limits<double>::max(), l = -numeric_limits<double>::max();
+ map< double, TInters >::iterator u_int1 = u2inters.begin(), u_int2 = u_int1;
+ bool ok = ! u_int1->second._coincides;
+ while ( ok && u_int1 != u2inters.end() )
+ {
+ double u = u_int1->first;
+ bool touchingInt = false;
+ if ( ++u_int2 != u2inters.end() )
+ {
+ // skip intersections at the same point (if the line passes through edge or node)
+ int nbSamePnt = 0;
+ while ( u_int2 != u2inters.end() && fabs( u_int2->first - u ) < tolerance )
+ {
+ ++nbSamePnt;
+ ++u_int2;
+ }
+
+ // skip tangent intersections
+ int nbTgt = 0;
+ const SMDS_MeshElement* prevFace = u_int1->second._face;
+ while ( ok && u_int2->second._coincides )
+ {
+ if ( SMESH_Algo::GetCommonNodes(prevFace , u_int2->second._face).empty() )
+ ok = false;
+ else
+ {
+ nbTgt++;
+ u_int2++;
+ ok = ( u_int2 != u2inters.end() );
+ }
+ }
+ if ( !ok ) break;
+
+ // skip intersections at the same point after tangent intersections
+ if ( nbTgt > 0 )
+ {
+ double u2 = u_int2->first;
+ ++u_int2;
+ while ( u_int2 != u2inters.end() && fabs( u_int2->first - u2 ) < tolerance )
+ {
+ ++nbSamePnt;
+ ++u_int2;
+ }
+ }
+ // decide if we skipped a touching intersection
+ if ( nbSamePnt + nbTgt > 0 )
+ {
+ double minDot = numeric_limits<double>::max(), maxDot = -numeric_limits<double>::max();
+ map< double, TInters >::iterator u_int = u_int1;
+ for ( ; u_int != u_int2; ++u_int )
+ {
+ if ( u_int->second._coincides ) continue;
+ double dot = u_int->second._faceNorm * line.Direction();
+ if ( dot > maxDot ) maxDot = dot;
+ if ( dot < minDot ) minDot = dot;
+ }
+ touchingInt = ( minDot*maxDot < 0 );
+ }
+ }
+ if ( !touchingInt )
+ {
+ if ( !hasPositionInfo || isOuterBoundary( u_int1->second._face ))
+ {
+ if ( u < 0 )
+ ++nbIntBeforePoint;
+ else
+ ++nbIntAfterPoint;
+ }
+ if ( u < f ) f = u;
+ if ( u > l ) l = u;
+ }
+
+ u_int1 = u_int2; // to next intersection
+
+ } // loop on intersections with one line
+
+ if ( ok )
+ {
+ if ( fabs( f ) < tolerance || fabs( l ) < tolerance )
+ return TopAbs_ON;
+
+ if ( nbIntBeforePoint == 0 || nbIntAfterPoint == 0)
+ return TopAbs_OUT;
+
+ if ( nbIntBeforePoint + nbIntAfterPoint == 1 ) // not closed mesh
+ return fabs( f ) < tolerance ? TopAbs_ON : TopAbs_UNKNOWN;
+
+ if ( nbIntBeforePoint == 1 || nbIntAfterPoint == 1 )
+ return TopAbs_IN;
+
+ if ( (f<0) == (l<0) )
+ return TopAbs_OUT;
+
+ if ( hasPositionInfo )
+ return nbIntBeforePoint % 2 ? TopAbs_IN : TopAbs_OUT;
+ }
+ } // loop on intersections of the tree lines - thorough analysis
+
+ if ( !hasPositionInfo )
+ {
+ // gather info on faces position - is face in the outer boundary or not
+ map< double, TInters > & u2inters = paramOnLine2TInters[ 0 ];
+ findOuterBoundary( u2inters.begin()->second._face );
+ }
+
+ } // two attempts - with and w/o faces position info in the mesh
+
+ return TopAbs_UNKNOWN;
+}
//=======================================================================
/*!
while ( nodeIt->more() )
xyz.push_back( TNodeXYZ( cast2Node( nodeIt->next() )));
+ int i, nbNodes = element->NbNodes();
+
if ( element->GetType() == SMDSAbs_Face ) // --------------------------------------------------
{
- // gravity center
- gp_XYZ gc(0,0,0);
- gc = accumulate( xyz.begin(), xyz.end(), gc );
- gc /= element->NbNodes();
-
- // compute face normal using gc
- gp_Vec normal(0,0,0);
+ // compute face normal
+ gp_Vec faceNorm(0,0,0);
xyz.push_back( xyz.front() );
- for ( int i = 0; i < element->NbNodes(); ++i )
+ for ( i = 0; i < nbNodes; ++i )
{
- gp_Vec edge( xyz[i], xyz[i+1]);
- gp_Vec n2gc( xyz[i], gc );
- normal += edge ^ n2gc;
+ gp_Vec edge1( xyz[i+1], xyz[i]);
+ gp_Vec edge2( xyz[i+1], xyz[(i+2)%nbNodes] );
+ faceNorm += edge1 ^ edge2;
+ }
+ double normSize = faceNorm.Magnitude();
+ if ( normSize <= tol )
+ {
+ // degenerated face: point is out if it is out of all face edges
+ for ( i = 0; i < nbNodes; ++i )
+ {
+ SMDS_MeshNode n1( xyz[i].X(), xyz[i].Y(), xyz[i].Z() );
+ SMDS_MeshNode n2( xyz[i+1].X(), xyz[i+1].Y(), xyz[i+1].Z() );
+ SMDS_LinearEdge edge( &n1, &n2 );
+ if ( !isOut( &edge, point, tol ))
+ return false;
+ }
+ return true;
}
- double faceDoubleArea = normal.Magnitude();
- if ( faceDoubleArea <= numeric_limits<double>::min() )
- return true; // invalid face
- normal /= faceDoubleArea;
+ faceNorm /= normSize;
// check if the point lays on face plane
gp_Vec n2p( xyz[0], point );
- if ( fabs( n2p * normal ) > tol )
+ if ( fabs( n2p * faceNorm ) > tol )
return true; // not on face plane
- // check if point is out of face boundary
- int i, out = false;
- for ( i = 0; !out && i < element->NbNodes(); ++i )
+ // check if point is out of face boundary:
+ // define it by closest transition of a ray point->infinity through face boundary
+ // on the face plane.
+ // First, find normal of a plane perpendicular to face plane, to be used as a cutting tool
+ // to find intersections of the ray with the boundary.
+ gp_Vec ray = n2p;
+ gp_Vec plnNorm = ray ^ faceNorm;
+ normSize = plnNorm.Magnitude();
+ if ( normSize <= tol ) return false; // point coincides with the first node
+ plnNorm /= normSize;
+ // for each node of the face, compute its signed distance to the plane
+ vector<double> dist( nbNodes + 1);
+ for ( i = 0; i < nbNodes; ++i )
{
- gp_Vec edge( xyz[i], xyz[i+1]);
- gp_Vec n2p ( xyz[i], point );
- gp_Vec cross = edge ^ n2p;
- out = ( cross * normal < -tol );
- }
- if ( out && element->IsPoly() )
+ gp_Vec n2p( xyz[i], point );
+ dist[i] = n2p * plnNorm;
+ }
+ dist.back() = dist.front();
+ // find the closest intersection
+ int iClosest = -1;
+ double rClosest, distClosest = 1e100;;
+ gp_Pnt pClosest;
+ for ( i = 0; i < nbNodes; ++i )
{
- // define point position by the closest edge
- double minDist = numeric_limits<double>::max();
- int iMinDist;
- for ( i = 0; i < element->NbNodes(); ++i )
+ double r;
+ if ( fabs( dist[i]) < tol )
+ r = 0.;
+ else if ( fabs( dist[i+1]) < tol )
+ r = 1.;
+ else if ( dist[i] * dist[i+1] < 0 )
+ r = dist[i] / ( dist[i] - dist[i+1] );
+ else
+ continue; // no intersection
+ gp_Pnt pInt = xyz[i] * (1.-r) + xyz[i+1] * r;
+ gp_Vec p2int ( point, pInt);
+ if ( p2int * ray > -tol ) // right half-space
{
- gp_Vec edge( xyz[i], xyz[i+1]);
- gp_Vec n1p ( xyz[i], point);
- double dist = ( edge ^ n1p ).Magnitude() / edge.Magnitude();
- if ( dist < minDist )
- iMinDist = i;
+ double intDist = p2int.SquareMagnitude();
+ if ( intDist < distClosest )
+ {
+ iClosest = i;
+ rClosest = r;
+ pClosest = pInt;
+ distClosest = intDist;
+ }
}
- gp_Vec edge( xyz[iMinDist], xyz[iMinDist+1]);
- gp_Vec n2p ( xyz[iMinDist], point );
- gp_Vec cross = edge ^ n2p;
- out = ( cross * normal < -tol );
}
- return out;
+ if ( iClosest < 0 )
+ return true; // no intesections - out
+
+ // analyse transition
+ gp_Vec edge( xyz[iClosest], xyz[iClosest+1] );
+ gp_Vec edgeNorm = -( edge ^ faceNorm ); // normal to intersected edge pointing out of face
+ gp_Vec p2int ( point, pClosest );
+ bool out = (edgeNorm * p2int) < -tol;
+ if ( rClosest > 0. && rClosest < 1. ) // not node intersection
+ return out;
+
+ // ray pass through a face node; analyze transition through an adjacent edge
+ gp_Pnt p1 = xyz[ (rClosest == 0.) ? ((iClosest+nbNodes-1) % nbNodes) : (iClosest+1) ];
+ gp_Pnt p2 = xyz[ (rClosest == 0.) ? iClosest : ((iClosest+2) % nbNodes) ];
+ gp_Vec edgeAdjacent( p1, p2 );
+ gp_Vec edgeNorm2 = -( edgeAdjacent ^ faceNorm );
+ bool out2 = (edgeNorm2 * p2int) < -tol;
+
+ bool covexCorner = ( edgeNorm * edgeAdjacent * (rClosest==1. ? 1. : -1.)) < 0;
+ return covexCorner ? (out || out2) : (out && out2);
}
if ( element->GetType() == SMDSAbs_Edge ) // --------------------------------------------------
{
- for ( int i = 1; i < element->NbNodes(); ++i )
+ // point is out of edge if it is NOT ON any straight part of edge
+ // (we consider quadratic edge as being composed of two straight parts)
+ for ( i = 1; i < nbNodes; ++i )
{
gp_Vec edge( xyz[i-1], xyz[i]);
gp_Vec n1p ( xyz[i-1], point);
double dist = ( edge ^ n1p ).Magnitude() / edge.Magnitude();
if ( dist > tol )
- return true;
+ continue;
gp_Vec n2p( xyz[i], point );
if ( fabs( edge.Magnitude() - n1p.Magnitude() - n2p.Magnitude()) > tol )
- return true;
+ continue;
+ return false; // point is ON this part
}
- return false;
+ return true;
}
// Node or 0D element -------------------------------------------------------------------------
{
//purpose : Return a face having linked nodes n1 and n2 and which is
// - not in avoidSet,
// - in elemSet provided that !elemSet.empty()
+// i1 and i2 optionally returns indices of n1 and n2
//=======================================================================
const SMDS_MeshElement*
SMESH_MeshEditor::FindFaceInSet(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const TIDSortedElemSet& elemSet,
- const TIDSortedElemSet& avoidSet)
+ const TIDSortedElemSet& avoidSet,
+ int* n1ind,
+ int* n2ind)
{
+ int i1, i2;
+ const SMDS_MeshElement* face = 0;
+
SMDS_ElemIteratorPtr invElemIt = n1->GetInverseElementIterator(SMDSAbs_Face);
- while ( invElemIt->more() ) { // loop on inverse elements of n1
+ while ( invElemIt->more() && !face ) // loop on inverse faces of n1
+ {
const SMDS_MeshElement* elem = invElemIt->next();
- if (avoidSet.find( elem ) != avoidSet.end() )
+ if (avoidSet.count( elem ))
continue;
- if ( !elemSet.empty() && elemSet.find( elem ) == elemSet.end())
+ if ( !elemSet.empty() && !elemSet.count( elem ))
continue;
- // get face nodes and find index of n1
- int i1, nbN = elem->NbNodes(), iNode = 0;
- //const SMDS_MeshNode* faceNodes[ nbN ], *n;
- vector<const SMDS_MeshNode*> faceNodes( nbN );
- const SMDS_MeshNode* n;
- SMDS_ElemIteratorPtr nIt = elem->nodesIterator();
- while ( nIt->more() ) {
- faceNodes[ iNode ] = static_cast<const SMDS_MeshNode*>( nIt->next() );
- if ( faceNodes[ iNode++ ] == n1 )
- i1 = iNode - 1;
- }
+ // index of n1
+ i1 = elem->GetNodeIndex( n1 );
// find a n2 linked to n1
- if(!elem->IsQuadratic()) {
- for ( iNode = 0; iNode < 2; iNode++ ) {
- if ( iNode ) // node before n1
- n = faceNodes[ i1 == 0 ? nbN - 1 : i1 - 1 ];
- else // node after n1
- n = faceNodes[ i1 + 1 == nbN ? 0 : i1 + 1 ];
- if ( n == n2 )
- return elem;
- }
- }
- else { // analysis for quadratic elements
- bool IsFind = false;
- // check using only corner nodes
- for ( iNode = 0; iNode < 2; iNode++ ) {
- if ( iNode ) // node before n1
- n = faceNodes[ i1 == 0 ? nbN/2 - 1 : i1 - 1 ];
- else // node after n1
- n = faceNodes[ i1 + 1 == nbN/2 ? 0 : i1 + 1 ];
- if ( n == n2 )
- IsFind = true;
- }
- if(IsFind) {
- return elem;
- }
- else {
- // check using all nodes
- const SMDS_QuadraticFaceOfNodes* F =
- static_cast<const SMDS_QuadraticFaceOfNodes*>(elem);
- // use special nodes iterator
- iNode = 0;
- SMDS_NodeIteratorPtr anIter = F->interlacedNodesIterator();
- while ( anIter->more() ) {
- faceNodes[iNode] = static_cast<const SMDS_MeshNode*>(anIter->next());
- if ( faceNodes[ iNode++ ] == n1 )
- i1 = iNode - 1;
- }
- for ( iNode = 0; iNode < 2; iNode++ ) {
- if ( iNode ) // node before n1
- n = faceNodes[ i1 == 0 ? nbN - 1 : i1 - 1 ];
- else // node after n1
- n = faceNodes[ i1 + 1 == nbN ? 0 : i1 + 1 ];
- if ( n == n2 ) {
- return elem;
- }
+ int nbN = elem->IsQuadratic() ? elem->NbNodes()/2 : elem->NbNodes();
+ for ( int di = -1; di < 2 && !face; di += 2 )
+ {
+ i2 = (i1+di+nbN) % nbN;
+ if ( elem->GetNode( i2 ) == n2 )
+ face = elem;
+ }
+ if ( !face && elem->IsQuadratic())
+ {
+ // analysis for quadratic elements using all nodes
+ const SMDS_QuadraticFaceOfNodes* F =
+ static_cast<const SMDS_QuadraticFaceOfNodes*>(elem);
+ // use special nodes iterator
+ SMDS_NodeIteratorPtr anIter = F->interlacedNodesIterator();
+ const SMDS_MeshNode* prevN = cast2Node( anIter->next() );
+ for ( i1 = -1, i2 = 0; anIter->more() && !face; i1++, i2++ )
+ {
+ const SMDS_MeshNode* n = cast2Node( anIter->next() );
+ if ( n1 == prevN && n2 == n )
+ {
+ face = elem;
+ }
+ else if ( n2 == prevN && n1 == n )
+ {
+ face = elem; swap( i1, i2 );
}
+ prevN = n;
}
- } // end analysis for quadratic elements
+ }
}
- return 0;
+ if ( n1ind ) *n1ind = i1;
+ if ( n2ind ) *n2ind = i2;
+ return face;
}
//=======================================================================
return SEW_OK;
}
+//================================================================================
/*!
\brief Creates a hole in a mesh by doubling the nodes of some particular elements
\param theElems - the list of elements (edges or faces) to be replicated
replicated nodes should be associated to.
\return TRUE if operation has been completed successfully, FALSE otherwise
*/
+//================================================================================
+
bool SMESH_MeshEditor::DoubleNodes( const TIDSortedElemSet& theElems,
const TIDSortedElemSet& theNodesNot,
const TIDSortedElemSet& theAffectedElems )
return res;
}
+//================================================================================
/*!
\brief Creates a hole in a mesh by doubling the nodes of some particular elements
\param theMeshDS - mesh instance
\param theIsDoubleElem - flag os to replicate element or modify
\return TRUE if operation has been completed successfully, FALSE otherwise
*/
+//================================================================================
+
bool SMESH_MeshEditor::doubleNodes( SMESHDS_Mesh* theMeshDS,
const TIDSortedElemSet& theElems,
const TIDSortedElemSet& theNodesNot,
return res;
}
-/*!
- \brief Check if element located inside shape
- \return TRUE if IN or ON shape, FALSE otherwise
-*/
-
-static bool isInside(const SMDS_MeshElement* theElem,
- BRepClass3d_SolidClassifier& theBsc3d,
- const double theTol)
-{
- gp_XYZ centerXYZ (0, 0, 0);
- SMDS_ElemIteratorPtr aNodeItr = theElem->nodesIterator();
- while (aNodeItr->more())
- {
- SMDS_MeshNode* aNode = (SMDS_MeshNode*)aNodeItr->next();
- centerXYZ += gp_XYZ(aNode->X(), aNode->Y(), aNode->Z());
- }
- gp_Pnt aPnt(centerXYZ);
- theBsc3d.Perform(aPnt, theTol);
- TopAbs_State aState = theBsc3d.State();
- return (aState == TopAbs_IN || aState == TopAbs_ON );
-}
-
+//================================================================================
/*!
\brief Creates a hole in a mesh by doubling the nodes of some particular elements
\param theNodes - identifiers of nodes to be doubled
they not assigned to elements
\return TRUE if operation has been completed successfully, FALSE otherwise
*/
+//================================================================================
+
bool SMESH_MeshEditor::DoubleNodes( const std::list< int >& theListOfNodes,
const std::list< int >& theListOfModifiedElems )
{
return true;
}
+namespace {
+
+ //================================================================================
+ /*!
+ \brief Check if element located inside shape
+ \return TRUE if IN or ON shape, FALSE otherwise
+ */
+ //================================================================================
+
+ template<class Classifier>
+ bool isInside(const SMDS_MeshElement* theElem,
+ Classifier& theClassifier,
+ const double theTol)
+ {
+ gp_XYZ centerXYZ (0, 0, 0);
+ SMDS_ElemIteratorPtr aNodeItr = theElem->nodesIterator();
+ while (aNodeItr->more())
+ centerXYZ += SMESH_MeshEditor::TNodeXYZ(cast2Node( aNodeItr->next()));
+
+ gp_Pnt aPnt = centerXYZ / theElem->NbNodes();
+ theClassifier.Perform(aPnt, theTol);
+ TopAbs_State aState = theClassifier.State();
+ return (aState == TopAbs_IN || aState == TopAbs_ON );
+ }
+
+ //================================================================================
+ /*!
+ * \brief Classifier of the 3D point on the TopoDS_Face
+ * with interaface suitable for isInside()
+ */
+ //================================================================================
+
+ struct _FaceClassifier
+ {
+ Extrema_ExtPS _extremum;
+ BRepAdaptor_Surface _surface;
+ TopAbs_State _state;
+
+ _FaceClassifier(const TopoDS_Face& face):_extremum(),_surface(face),_state(TopAbs_OUT)
+ {
+ _extremum.Initialize( _surface,
+ _surface.FirstUParameter(), _surface.LastUParameter(),
+ _surface.FirstVParameter(), _surface.LastVParameter(),
+ _surface.Tolerance(), _surface.Tolerance() );
+ }
+ void Perform(const gp_Pnt& aPnt, double theTol)
+ {
+ _state = TopAbs_OUT;
+ _extremum.Perform(aPnt);
+ if ( _extremum.IsDone() )
+ for ( int iSol = 1; iSol <= _extremum.NbExt() && _state == TopAbs_OUT; ++iSol)
+ _state = ( _extremum.Value(iSol) <= theTol ? TopAbs_IN : TopAbs_OUT );
+ }
+ TopAbs_State State() const
+ {
+ return _state;
+ }
+ };
+}
+
+//================================================================================
/*!
\brief Creates a hole in a mesh by doubling the nodes of some particular elements
\param theElems - group of of elements (edges or faces) to be replicated
- \param theNodesNot - group of nodes not to replicated
+ \param theNodesNot - group of nodes not to replicate
\param theShape - shape to detect affected elements (element which geometric center
located on or inside shape).
The replicated nodes should be associated to affected elements.
\return TRUE if operation has been completed successfully, FALSE otherwise
*/
+//================================================================================
bool SMESH_MeshEditor::DoubleNodesInRegion( const TIDSortedElemSet& theElems,
const TIDSortedElemSet& theNodesNot,
return false;
const double aTol = Precision::Confusion();
- BRepClass3d_SolidClassifier bsc3d(theShape);
- bsc3d.PerformInfinitePoint(aTol);
+ auto_ptr< BRepClass3d_SolidClassifier> bsc3d;
+ auto_ptr<_FaceClassifier> aFaceClassifier;
+ if ( theShape.ShapeType() == TopAbs_SOLID )
+ {
+ bsc3d.reset( new BRepClass3d_SolidClassifier(theShape));;
+ bsc3d->PerformInfinitePoint(aTol);
+ }
+ else if (theShape.ShapeType() == TopAbs_FACE )
+ {
+ aFaceClassifier.reset( new _FaceClassifier(TopoDS::Face(theShape)));
+ }
// iterates on indicated elements and get elements by back references from their nodes
TIDSortedElemSet anAffected;
SMDS_ElemIteratorPtr nodeItr = anElem->nodesIterator();
while ( nodeItr->more() )
{
- const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(nodeItr->next());
+ const SMDS_MeshNode* aNode = cast2Node(nodeItr->next());
if ( !aNode || theNodesNot.find(aNode) != theNodesNot.end() )
continue;
SMDS_ElemIteratorPtr backElemItr = aNode->GetInverseElementIterator();
while ( backElemItr->more() )
{
- SMDS_MeshElement* curElem = (SMDS_MeshElement*)backElemItr->next();
+ const SMDS_MeshElement* curElem = backElemItr->next();
if ( curElem && theElems.find(curElem) == theElems.end() &&
- isInside( curElem, bsc3d, aTol ) )
+ ( bsc3d.get() ?
+ isInside( curElem, *bsc3d, aTol ) :
+ isInside( curElem, *aFaceClassifier, aTol )))
anAffected.insert( curElem );
}
}
return DoubleNodes( theElems, theNodesNot, anAffected );
}
+//================================================================================
/*!
* \brief Generated skin mesh (containing 2D cells) from 3D mesh
* The created 2D mesh elements based on nodes of free faces of boundary volumes
* \return TRUE if operation has been completed successfully, FALSE otherwise
*/
+//================================================================================
bool SMESH_MeshEditor::Make2DMeshFrom3D()
{
SMESHDS_Mesh* aMesh = GetMeshDS();
if (!aMesh)
return false;
- bool res = false;
+ //bool res = false;
+ int nbFree = 0, nbExisted = 0, nbCreated = 0;
SMDS_VolumeIteratorPtr vIt = aMesh->volumesIterator();
while(vIt->more())
{
const SMDS_MeshVolume* volume = vIt->next();
SMDS_VolumeTool vTool( volume );
+ vTool.SetExternalNormal();
const bool isPoly = volume->IsPoly();
const bool isQuad = volume->IsQuadratic();
for ( int iface = 0, n = vTool.NbFaces(); iface < n; iface++ )
{
if (!vTool.IsFreeFace(iface))
continue;
+ nbFree++;
vector<const SMDS_MeshNode *> nodes;
int nbFaceNodes = vTool.NbFaceNodes(iface);
const SMDS_MeshNode** faceNodes = vTool.GetFaceNodes(iface);
- if (vTool.IsFaceExternal(iface))
- {
- int inode = 0;
- for ( ; inode < nbFaceNodes; inode += isQuad ? 2 : 1)
- nodes.push_back(faceNodes[inode]);
- if (isQuad)
- for ( inode = 1; inode < nbFaceNodes; inode += 2)
- nodes.push_back(faceNodes[inode]);
- }
- else
- {
- int inode = nbFaceNodes-1;
- for ( ; inode >=0; inode -= isQuad ? 2 : 1)
+ int inode = 0;
+ for ( ; inode < nbFaceNodes; inode += isQuad ? 2 : 1)
+ nodes.push_back(faceNodes[inode]);
+ if (isQuad)
+ for ( inode = 1; inode < nbFaceNodes; inode += 2)
nodes.push_back(faceNodes[inode]);
- if (isQuad)
- for ( inode = nbFaceNodes-2; inode >=0; inode -= 2)
- nodes.push_back(faceNodes[inode]);
- }
// add new face based on volume nodes
- if (aMesh->FindFace( nodes ) )
+ if (aMesh->FindFace( nodes ) ) {
+ nbExisted++;
continue; // face already exsist
+ }
myLastCreatedElems.Append( AddElement(nodes, SMDSAbs_Face, isPoly && iface == 1) );
- res = true;
+ nbCreated++;
}
}
- return res;
+ return ( nbFree==(nbExisted+nbCreated) );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_MeshEditor.hxx
// Created : Mon Apr 12 14:56:19 2004
#include "SMESH_SequenceOfElemPtr.hxx"
#include "SMESH_SequenceOfNode.hxx"
+#include <utilities.h>
+
#include <TColStd_HSequenceOfReal.hxx>
#include <gp_Dir.hxx>
//=======================================================================
/*!
- * \brief Return elements of given type where the given point is IN or ON.
+ * \brief Find elements of given type where the given point is IN or ON.
+ * Returns nb of found elements and elements them-selves.
+ * Another task is to find out if the given point is out of closed 2D mesh.
*
* 'ALL' type means elements of any type excluding nodes and 0D elements
*/
struct SMESH_ElementSearcher
{
- virtual void FindElementsByPoint(const gp_Pnt& point,
- SMDSAbs_ElementType type,
- std::vector< const SMDS_MeshElement* >& foundElems)=0;
+ virtual int FindElementsByPoint(const gp_Pnt& point,
+ SMDSAbs_ElementType type,
+ std::vector< const SMDS_MeshElement* >& foundElems)=0;
+
+ virtual TopAbs_State GetPointState(const gp_Pnt& point) = 0;
};
//=======================================================================
//=======================================================================
/*!
- * auxiliary class
+ * \brief SMESH_TLink knowing its orientation
*/
//=======================================================================
-class SMESH_MeshEditor_PathPoint {
-public:
- SMESH_MeshEditor_PathPoint() {
- myPnt.SetCoord(99., 99., 99.);
- myTgt.SetCoord(1.,0.,0.);
- myAngle=0.;
- myPrm=0.;
- }
- void SetPnt(const gp_Pnt& aP3D){
- myPnt=aP3D;
- }
- void SetTangent(const gp_Dir& aTgt){
- myTgt=aTgt;
- }
- void SetAngle(const double& aBeta){
- myAngle=aBeta;
- }
- void SetParameter(const double& aPrm){
- myPrm=aPrm;
- }
- const gp_Pnt& Pnt()const{
- return myPnt;
- }
- const gp_Dir& Tangent()const{
- return myTgt;
- }
- double Angle()const{
- return myAngle;
- }
- double Parameter()const{
- return myPrm;
- }
-
-protected:
- gp_Pnt myPnt;
- gp_Dir myTgt;
- double myAngle;
- double myPrm;
-};
+struct SMESH_OrientedLink: public SMESH_TLink
+{
+ bool _reversed;
+ SMESH_OrientedLink(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2 )
+ : SMESH_TLink( n1, n2 ), _reversed( n1 != node1() ) {}
+};
// ============================================================
/*!
*/
// ============================================================
-class SMESH_EXPORT SMESH_MeshEditor {
+class SMESH_EXPORT SMESH_MeshEditor
+{
+public:
+ //------------------------------------------
+ /*!
+ * \brief SMDS_MeshNode -> gp_XYZ convertor
+ */
+ //------------------------------------------
+ struct TNodeXYZ : public gp_XYZ
+ {
+ const SMDS_MeshNode* _node;
+ TNodeXYZ( const SMDS_MeshElement* e):gp_XYZ(0,0,0),_node(0) {
+ if (e) {
+ ASSERT( e->GetType() == SMDSAbs_Node );
+ _node = static_cast<const SMDS_MeshNode*>(e);
+ SetCoord( _node->X(), _node->Y(), _node->Z() );
+ }
+ }
+ double Distance(const SMDS_MeshNode* n) const { return (TNodeXYZ( n )-*this).Modulus(); }
+ double SquareDistance(const SMDS_MeshNode* n) const { return (TNodeXYZ( n )-*this).SquareModulus(); }
+ bool operator==(const TNodeXYZ& other) const { return _node == other._node; }
+ };
public:
SMESH::Controls::NumericalFunctorPtr theCriterion);
+ enum SplitVolumToTetraFlags { HEXA_TO_5 = 1, HEXA_TO_6 = 2 };//!<arg of SplitVolumesIntoTetra()
+ /*!
+ * \brief Split volumic elements into tetrahedra.
+ */
+ void SplitVolumesIntoTetra (const TIDSortedElemSet & theElems, const int theMethodFlags);
+
+
enum SmoothMethod { LAPLACIAN = 0, CENTROIDAL };
void Smooth (TIDSortedElemSet & theElements,
// Move or copy theElements applying theTrsf to their nodes
+ /*!
+ * Generate new elements by extrusion of theElements
+ * param theElems - list of elements for scale
+ * param thePoint - base point for scale
+ * param theScaleFact - scale factors for axises
+ * param theCopy - allows copying the translated elements
+ * param theMakeGroups - forces the generation of new groups from existing ones
+ * param theTargetMesh - the name of the newly created mesh
+ * return instance of Mesh class
+ */
+ PGroupIDs Scale (TIDSortedElemSet& theElements,
+ const gp_Pnt& thePoint,
+ const std::list<double>& theScaleFact,
+ const bool theCopy,
+ const bool theMakeGroups,
+ SMESH_Mesh* theTargetMesh=0);
+
typedef std::list< std::list< const SMDS_MeshNode* > > TListOfListOfNodes;
void FindCoincidentNodes (std::set<const SMDS_MeshNode*> & theNodes,
//converts all mesh from quadratic to ordinary ones, deletes old quadratic elements, replacing
//them with ordinary mesh elements with the same id.
-
-// static int SortQuadNodes (const SMDS_Mesh * theMesh,
-// int theNodeIds[] );
-// // Set 4 nodes of a quadrangle face in a good order.
-// // Swap 1<->2 or 2<->3 nodes and correspondingly return
-// // 1 or 2 else 0.
-//
-// static bool SortHexaNodes (const SMDS_Mesh * theMesh,
-// int theNodeIds[] );
-// // Set 8 nodes of a hexahedron in a good order.
-// // Return success status
-
static void AddToSameGroups (const SMDS_MeshElement* elemToAdd,
const SMDS_MeshElement* elemInGroups,
SMESHDS_Mesh * aMesh);
SMESHDS_Mesh * aMesh);
// replace elemToRm by elemToAdd in the all groups
+ static void ReplaceElemInGroups (const SMDS_MeshElement* elemToRm,
+ const std::vector<const SMDS_MeshElement*>& elemToAdd,
+ SMESHDS_Mesh * aMesh);
+ // replace elemToRm by elemToAdd in the all groups
+
/*!
* \brief Return nodes linked to the given one in elements of the type
*/
TIDSortedElemSet & linkedNodes,
SMDSAbs_ElementType type = SMDSAbs_All );
- static const SMDS_MeshElement*
- FindFaceInSet(const SMDS_MeshNode* n1,
- const SMDS_MeshNode* n2,
- const TIDSortedElemSet& elemSet,
- const TIDSortedElemSet& avoidSet);
+ static const SMDS_MeshElement* FindFaceInSet(const SMDS_MeshNode* n1,
+ const SMDS_MeshNode* n2,
+ const TIDSortedElemSet& elemSet,
+ const TIDSortedElemSet& avoidSet,
+ int* i1=0,
+ int* i2=0);
// Return a face having linked nodes n1 and n2 and which is
// - not in avoidSet,
// - in elemSet provided that !elemSet.empty()
+ // i1 and i2 optionally returns indices of n1 and n2
/*!
* \brief Find corresponding nodes in two sets of faces
*/
static Sew_Error FindMatchingNodes(std::set<const SMDS_MeshElement*>& theSide1,
std::set<const SMDS_MeshElement*>& theSide2,
- const SMDS_MeshNode* theFirstNode1,
- const SMDS_MeshNode* theFirstNode2,
- const SMDS_MeshNode* theSecondNode1,
- const SMDS_MeshNode* theSecondNode2,
- TNodeNodeMap & nReplaceMap);
+ const SMDS_MeshNode* theFirstNode1,
+ const SMDS_MeshNode* theFirstNode2,
+ const SMDS_MeshNode* theSecondNode1,
+ const SMDS_MeshNode* theSecondNode2,
+ TNodeNodeMap & theNodeReplaceMap);
/*!
* \brief Returns true if given node is medium
const int nbSteps,
SMESH_SequenceOfElemPtr& srcElements);
- /*!
- * auxilary for ExtrusionAlongTrack
- */
- Extrusion_Error MakeEdgePathPoints(std::list<double>& aPrms,
- const TopoDS_Edge& aTrackEdge,
- bool FirstIsStart,
- list<SMESH_MeshEditor_PathPoint>& LPP);
- Extrusion_Error MakeExtrElements(TIDSortedElemSet& theElements,
- list<SMESH_MeshEditor_PathPoint>& fullList,
- const bool theHasAngles,
- list<double>& theAngles,
- const bool theLinearVariation,
- const bool theHasRefPoint,
- const gp_Pnt& theRefPoint,
- const bool theMakeGroups);
- void LinearAngleVariation(const int NbSteps,
+ struct SMESH_MeshEditor_PathPoint
+ {
+ gp_Pnt myPnt;
+ gp_Dir myTgt;
+ double myAngle, myPrm;
+
+ SMESH_MeshEditor_PathPoint(): myPnt(99., 99., 99.), myTgt(1.,0.,0.), myAngle(0), myPrm(0) {}
+ void SetPnt (const gp_Pnt& aP3D) { myPnt =aP3D; }
+ void SetTangent (const gp_Dir& aTgt) { myTgt =aTgt; }
+ void SetAngle (const double& aBeta) { myAngle=aBeta; }
+ void SetParameter(const double& aPrm) { myPrm =aPrm; }
+ const gp_Pnt& Pnt ()const { return myPnt; }
+ const gp_Dir& Tangent ()const { return myTgt; }
+ double Angle ()const { return myAngle; }
+ double Parameter ()const { return myPrm; }
+ };
+ Extrusion_Error MakeEdgePathPoints(std::list<double>& aPrms,
+ const TopoDS_Edge& aTrackEdge,
+ bool aFirstIsStart,
+ std::list<SMESH_MeshEditor_PathPoint>& aLPP);
+ Extrusion_Error MakeExtrElements(TIDSortedElemSet& theElements,
+ std::list<SMESH_MeshEditor_PathPoint>& theFullList,
+ const bool theHasAngles,
+ std::list<double>& theAngles,
+ const bool theLinearVariation,
+ const bool theHasRefPoint,
+ const gp_Pnt& theRefPoint,
+ const bool theMakeGroups);
+ void LinearAngleVariation(const int NbSteps,
list<double>& theAngles);
- bool doubleNodes( SMESHDS_Mesh* theMeshDS,
- const TIDSortedElemSet& theElems,
- const TIDSortedElemSet& theNodesNot,
- std::map< const SMDS_MeshNode*,
- const SMDS_MeshNode* >& theNodeNodeMap,
- const bool theIsDoubleElem );
+ bool doubleNodes( SMESHDS_Mesh* theMeshDS,
+ const TIDSortedElemSet& theElems,
+ const TIDSortedElemSet& theNodesNot,
+ std::map< const SMDS_MeshNode*, const SMDS_MeshNode* >& theNodeNodeMap,
+ const bool theIsDoubleElem );
private:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SMESH_MesherHelper.cxx
// Created: 15.02.06 15:22:41
// Author: Sergey KUUL
#include <BRepTools_WireExplorer.hxx>
#include <BRep_Tool.hxx>
#include <Geom2d_Curve.hxx>
+#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <limits>
+using namespace std;
+
#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; }
namespace {
gp_XYZ XYZ(const SMDS_MeshNode* n) { return gp_XYZ(n->X(), n->Y(), n->Z()); }
+ enum { U_periodic = 1, V_periodic = 2 };
}
//================================================================================
//================================================================================
SMESH_MesherHelper::SMESH_MesherHelper(SMESH_Mesh& theMesh)
- : myMesh(&theMesh), myShapeID(0), myCreateQuadratic(false)
+ : myParIndex(0), myMesh(&theMesh), myShapeID(0), myCreateQuadratic(false)
{
+ myPar1[0] = myPar2[0] = myPar1[1] = myPar2[1] = 0;
mySetElemOnShape = ( ! myMesh->HasShapeToMesh() );
}
//=======================================================================
-//function : CheckShape
+//function : ~SMESH_MesherHelper
//purpose :
//=======================================================================
+SMESH_MesherHelper::~SMESH_MesherHelper()
+{
+ TID2Projector::iterator i_proj = myFace2Projector.begin();
+ for ( ; i_proj != myFace2Projector.end(); ++i_proj )
+ delete i_proj->second;
+}
+
+//=======================================================================
+//function : IsQuadraticSubMesh
+//purpose : Check submesh for given shape: if all elements on this shape
+// are quadratic, quadratic elements will be created.
+// Also fill myTLinkNodeMap
+//=======================================================================
+
bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh)
{
SMESHDS_Mesh* meshDS = GetMeshDS();
return myCreateQuadratic;
}
-//================================================================================
-/*!
- * \brief Set geomerty to make elements on
- * \param aSh - geomertic shape
- */
-//================================================================================
+//=======================================================================
+//function : SetSubShape
+//purpose : Set geomerty to make elements on
+//=======================================================================
void SMESH_MesherHelper::SetSubShape(const int aShID)
{
SetSubShape( TopoDS_Shape() );
}
-//================================================================================
-/*!
- * \brief Set geomerty to make elements on
- * \param aSh - geomertic shape
- */
-//================================================================================
+//=======================================================================
+//function : SetSubShape
+//purpose : Set geomerty to create elements on
+//=======================================================================
void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh)
{
}
SMESHDS_Mesh* meshDS = GetMeshDS();
myShapeID = meshDS->ShapeToIndex(aSh);
+ myParIndex = 0;
// treatment of periodic faces
for ( TopExp_Explorer eF( aSh, TopAbs_FACE ); eF.More(); eF.Next() )
const TopoDS_Edge& edge = TopoDS::Edge( exp.Current() );
if ( BRep_Tool::IsClosed( edge, face )) {
// initialize myPar1, myPar2 and myParIndex
- if ( mySeamShapeIds.empty() ) {
- gp_Pnt2d uv1, uv2;
- BRep_Tool::UVPoints( edge, face, uv1, uv2 );
- if ( Abs( uv1.Coord(1) - uv2.Coord(1) ) < Abs( uv1.Coord(2) - uv2.Coord(2) ))
- {
- myParIndex = 1; // U periodic
- myPar1 = surface.FirstUParameter();
- myPar2 = surface.LastUParameter();
- }
- else {
- myParIndex = 2; // V periodic
- myPar1 = surface.FirstVParameter();
- myPar2 = surface.LastVParameter();
- }
+ gp_Pnt2d uv1, uv2;
+ BRep_Tool::UVPoints( edge, face, uv1, uv2 );
+ if ( Abs( uv1.Coord(1) - uv2.Coord(1) ) < Abs( uv1.Coord(2) - uv2.Coord(2) ))
+ {
+ myParIndex |= U_periodic;
+ myPar1[0] = surface.FirstUParameter();
+ myPar2[0] = surface.LastUParameter();
+ }
+ else {
+ myParIndex |= V_periodic;
+ myPar1[1] = surface.FirstVParameter();
+ myPar2[1] = surface.LastVParameter();
}
// store seam shape indices, negative if shape encounters twice
int edgeID = meshDS->ShapeToIndex( edge );
}
}
-//================================================================================
- /*!
- * \brief Check if inFaceNode argument is necessary for call GetNodeUV(F,..)
- * \param F - the face
- * \retval bool - return true if the face is periodic
- */
-//================================================================================
+//=======================================================================
+//function : GetNodeUVneedInFaceNode
+//purpose : Check if inFaceNode argument is necessary for call GetNodeUV(F,..)
+// Return true if the face is periodic.
+// If F is Null, answer about subshape set through IsQuadraticSubMesh() or
+// * SetSubShape()
+//=======================================================================
bool SMESH_MesherHelper::GetNodeUVneedInFaceNode(const TopoDS_Face& F) const
{
}
//=======================================================================
-/*!
- * \brief Return support shape of a node
- * \param node - the node
- * \param meshDS - mesh DS
- * \retval TopoDS_Shape - found support shape
- */
+//function : GetSubShapeByNode
+//purpose : Return support shape of a node
//=======================================================================
TopoDS_Shape SMESH_MesherHelper::GetSubShapeByNode(const SMDS_MeshNode* node,
//=======================================================================
//function : AddTLinkNode
-//purpose :
+//purpose : add a link in my data structure
//=======================================================================
-/*!
- * Auxilary function for filling myTLinkNodeMap
- */
+
void SMESH_MesherHelper::AddTLinkNode(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n12)
}
//=======================================================================
-/*!
- * \brief Select UV on either of 2 pcurves of a seam edge, closest to the given UV
- * \param uv1 - UV on the seam
- * \param uv2 - UV within a face
- * \retval gp_Pnt2d - selected UV
- */
+//function : GetUVOnSeam
+//purpose : Select UV on either of 2 pcurves of a seam edge, closest to the given UV
//=======================================================================
gp_Pnt2d SMESH_MesherHelper::GetUVOnSeam( const gp_Pnt2d& uv1, const gp_Pnt2d& uv2 ) const
{
- double p1 = uv1.Coord( myParIndex );
- double p2 = uv2.Coord( myParIndex );
- double p3 = ( Abs( p1 - myPar1 ) < Abs( p1 - myPar2 )) ? myPar2 : myPar1;
- if ( Abs( p2 - p1 ) > Abs( p2 - p3 ))
- p1 = p3;
gp_Pnt2d result = uv1;
- result.SetCoord( myParIndex, p1 );
+ for ( int i = U_periodic; i <= V_periodic ; ++i )
+ {
+ if ( myParIndex & i )
+ {
+ double p1 = uv1.Coord( i );
+ double dp1 = Abs( p1-myPar1[i-1]), dp2 = Abs( p1-myPar2[i-1]);
+ if ( myParIndex == i ||
+ dp1 < ( myPar2[i-1] - myPar2[i-1] ) / 100. ||
+ dp2 < ( myPar2[i-1] - myPar2[i-1] ) / 100. )
+ {
+ double p2 = uv2.Coord( i );
+ double p1Alt = ( dp1 < dp2 ) ? myPar2[i-1] : myPar1[i-1];
+ if ( Abs( p2 - p1 ) > Abs( p2 - p1Alt ))
+ result.SetCoord( i, p1Alt );
+ }
+ }
+ }
return result;
}
//=======================================================================
-/*!
- * \brief Return node UV on face
- * \param F - the face
- * \param n - the node
- * \param n2 - a node of element being created located inside a face
- * \param check - optional flag returing false if found UV are invalid
- * \retval gp_XY - resulting UV
- */
+//function : GetNodeUV
+//purpose : Return node UV on face
//=======================================================================
gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face& F,
const SMDS_MeshNode* n2,
bool* check) const
{
- gp_Pnt2d uv( 1e100, 1e100 );
+ gp_Pnt2d uv( Precision::Infinite(), Precision::Infinite() );
const SMDS_PositionPtr Pos = n->GetPosition();
bool uvOK = false;
if(Pos->GetTypeOfPosition()==SMDS_TOP_FACE)
const SMDS_FacePosition* fpos =
static_cast<const SMDS_FacePosition*>(n->GetPosition());
uv.SetCoord(fpos->GetUParameter(),fpos->GetVParameter());
- uvOK = CheckNodeUV( F, n, uv.ChangeCoord(), BRep_Tool::Tolerance( F ));
+ if ( check )
+ uvOK = CheckNodeUV( F, n, uv.ChangeCoord(), BRep_Tool::Tolerance( F ));
}
else if(Pos->GetTypeOfPosition()==SMDS_TOP_EDGE)
{
TopoDS_Edge E = TopoDS::Edge(GetMeshDS()->IndexToShape(edgeID));
double f, l, u = epos->GetUParameter();
Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
- if ( f < u && u < l )
+ bool validU = ( f < u && u < l );
+ if ( validU )
uv = C2d->Value( u );
else
uv.SetCoord(0.,0.);
- uvOK = CheckNodeUV( F, n, uv.ChangeCoord(), BRep_Tool::Tolerance( E ));
+ if ( check || !validU )
+ uvOK = CheckNodeUV( F, n, uv.ChangeCoord(), BRep_Tool::Tolerance( E ),/*force=*/ !validU );
// for a node on a seam edge select one of UVs on 2 pcurves
if ( n2 && IsSeamShape( edgeID ) )
}
}
else {
+ uvOK = false;
TopTools_ListIteratorOfListOfShape it( myMesh->GetAncestors( V ));
for ( ; it.More(); it.Next() ) {
if ( it.Value().ShapeType() == TopAbs_EDGE ) {
if ( !C2d.IsNull() ) {
double u = ( V == TopExp::FirstVertex( edge ) ) ? f : l;
uv = C2d->Value( u );
+ uvOK = true;
break;
}
}
}
//=======================================================================
-/*!
- * \brief Check and fix node UV on a face
- * \retval bool - false if UV is bad and could not be fixed
- */
+//function : CheckNodeUV
+//purpose : Check and fix node UV on a face
//=======================================================================
bool SMESH_MesherHelper::CheckNodeUV(const TopoDS_Face& F,
const SMDS_MeshNode* n,
gp_XY& uv,
- const double tol) const
+ const double tol,
+ const bool force) const
{
- if ( !myOkNodePosShapes.count( n->GetPosition()->GetShapeId() ))
+ if ( force || !myOkNodePosShapes.count( n->GetPosition()->GetShapeId() ))
{
// check that uv is correct
TopLoc_Location loc;
Handle(Geom_Surface) surface = BRep_Tool::Surface( F,loc );
gp_Pnt nodePnt = XYZ( n );
if ( !loc.IsIdentity() ) nodePnt.Transform( loc.Transformation().Inverted() );
- if ( nodePnt.Distance( surface->Value( uv.X(), uv.Y() )) > tol )
+ if ( Precision::IsInfinite( uv.X() ) ||
+ Precision::IsInfinite( uv.Y() ) ||
+ nodePnt.Distance( surface->Value( uv.X(), uv.Y() )) > tol )
{
// uv incorrect, project the node to surface
- GeomAPI_ProjectPointOnSurf projector( nodePnt, surface, tol );
+ GeomAPI_ProjectPointOnSurf& projector = GetProjector( F, loc, tol );
+ projector.Perform( nodePnt );
if ( !projector.IsDone() || projector.NbPoints() < 1 )
{
MESSAGE( "SMESH_MesherHelper::CheckNodeUV() failed to project" );
}
//=======================================================================
-/*!
- * \brief Return middle UV taking in account surface period
- */
+//function : GetProjector
+//purpose : Return projector intitialized by given face without location, which is returned
+//=======================================================================
+
+GeomAPI_ProjectPointOnSurf& SMESH_MesherHelper::GetProjector(const TopoDS_Face& F,
+ TopLoc_Location& loc,
+ double tol ) const
+{
+ Handle(Geom_Surface) surface = BRep_Tool::Surface( F,loc );
+ int faceID = GetMeshDS()->ShapeToIndex( F );
+ TID2Projector& i2proj = const_cast< TID2Projector&>( myFace2Projector );
+ TID2Projector::iterator i_proj = i2proj.find( faceID );
+ if ( i_proj == i2proj.end() )
+ {
+ if ( tol == 0 ) tol = BRep_Tool::Tolerance( F );
+ double U1, U2, V1, V2;
+ surface->Bounds(U1, U2, V1, V2);
+ GeomAPI_ProjectPointOnSurf* proj = new GeomAPI_ProjectPointOnSurf();
+ proj->Init( surface, U1, U2, V1, V2, tol );
+ i_proj = i2proj.insert( make_pair( faceID, proj )).first;
+ }
+ return *( i_proj->second );
+}
+
+namespace
+{
+ gp_XY AverageUV(const gp_XY& uv1, const gp_XY& uv2) { return ( uv1 + uv2 ) / 2.; }
+ gp_XY_FunPtr(Added); // define gp_XY_Added pointer to function calling gp_XY::Added(gp_XY)
+ gp_XY_FunPtr(Subtracted);
+}
+
+//=======================================================================
+//function : applyIn2D
+//purpose : Perform given operation on two 2d points in parameric space of given surface.
+// It takes into account period of the surface. Use gp_XY_FunPtr macro
+// to easily define pointer to function of gp_XY class.
+//=======================================================================
+
+gp_XY SMESH_MesherHelper::applyIn2D(const Handle(Geom_Surface)& surface,
+ const gp_XY& uv1,
+ const gp_XY& uv2,
+ xyFunPtr fun,
+ const bool resultInPeriod)
+{
+ Standard_Boolean isUPeriodic = surface.IsNull() ? false : surface->IsUPeriodic();
+ Standard_Boolean isVPeriodic = surface.IsNull() ? false : surface->IsVPeriodic();
+ if ( !isUPeriodic && !isVPeriodic )
+ return fun(uv1,uv2);
+
+ // move uv2 not far than half-period from uv1
+ double u2 =
+ uv2.X()+(isUPeriodic ? ShapeAnalysis::AdjustByPeriod(uv2.X(),uv1.X(),surface->UPeriod()) :0);
+ double v2 =
+ uv2.Y()+(isVPeriodic ? ShapeAnalysis::AdjustByPeriod(uv2.Y(),uv1.Y(),surface->VPeriod()) :0);
+
+ // execute operation
+ gp_XY res = fun( uv1, gp_XY(u2,v2) );
+
+ // move result within period
+ if ( resultInPeriod )
+ {
+ Standard_Real UF,UL,VF,VL;
+ surface->Bounds(UF,UL,VF,VL);
+ if ( isUPeriodic )
+ res.SetX( res.X() + ShapeAnalysis::AdjustToPeriod(res.X(),UF,UL));
+ if ( isVPeriodic )
+ res.SetY( res.Y() + ShapeAnalysis::AdjustToPeriod(res.Y(),VF,VL));
+ }
+
+ return res;
+}
+//=======================================================================
+//function : GetMiddleUV
+//purpose : Return middle UV taking in account surface period
//=======================================================================
gp_XY SMESH_MesherHelper::GetMiddleUV(const Handle(Geom_Surface)& surface,
const gp_XY& p1,
const gp_XY& p2)
{
- if ( surface.IsNull() )
- return 0.5 * ( p1 + p2 );
- //checking if surface is periodic
- Standard_Real UF,UL,VF,VL;
- surface->Bounds(UF,UL,VF,VL);
-
- Standard_Real u,v;
- Standard_Boolean isUPeriodic = surface->IsUPeriodic();
- if(isUPeriodic) {
- Standard_Real UPeriod = surface->UPeriod();
- Standard_Real p2x = p2.X()+ShapeAnalysis::AdjustByPeriod(p2.X(),p1.X(),UPeriod);
- Standard_Real pmid = (p1.X()+p2x)/2.;
- u = pmid+ShapeAnalysis::AdjustToPeriod(pmid,UF,UL);
- }
- else {
- u= (p1.X()+p2.X())/2.;
- }
- Standard_Boolean isVPeriodic = surface->IsVPeriodic();
- if(isVPeriodic) {
- Standard_Real VPeriod = surface->VPeriod();
- Standard_Real p2y = p2.Y()+ShapeAnalysis::AdjustByPeriod(p2.Y(),p1.Y(),VPeriod);
- Standard_Real pmid = (p1.Y()+p2y)/2.;
- v = pmid+ShapeAnalysis::AdjustToPeriod(pmid,VF,VL);
- }
- else {
- v = (p1.Y()+p2.Y())/2.;
- }
- return gp_XY( u,v );
+ return applyIn2D( surface, p1, p2, & AverageUV );
}
//=======================================================================
-/*!
- * \brief Return node U on edge
- * \param E - the Edge
- * \param n - the node
- * \retval double - resulting U
- *
- * Auxilary function called form GetMediumNode()
- */
+//function : GetNodeU
+//purpose : Return node U on edge
//=======================================================================
double SMESH_MesherHelper::GetNodeU(const TopoDS_Edge& E,
const SMDS_MeshNode* n,
+ const SMDS_MeshNode* inEdgeNode,
bool* check)
{
double param = 0;
const SMDS_PositionPtr Pos = n->GetPosition();
- if(Pos->GetTypeOfPosition()==SMDS_TOP_EDGE) {
+ if ( Pos->GetTypeOfPosition()==SMDS_TOP_EDGE )
+ {
const SMDS_EdgePosition* epos =
static_cast<const SMDS_EdgePosition*>(n->GetPosition());
param = epos->GetUParameter();
}
- else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX) {
- SMESHDS_Mesh * meshDS = GetMeshDS();
- int vertexID = n->GetPosition()->GetShapeId();
- const TopoDS_Vertex& V = TopoDS::Vertex(meshDS->IndexToShape(vertexID));
- param = BRep_Tool::Parameter( V, E );
+ else if( Pos->GetTypeOfPosition() == SMDS_TOP_VERTEX )
+ {
+ if ( inEdgeNode && TopExp::FirstVertex( E ).IsSame( TopExp::LastVertex( E ))) // issue 0020128
+ {
+ Standard_Real f,l;
+ BRep_Tool::Range( E, f,l );
+ double uInEdge = GetNodeU( E, inEdgeNode );
+ param = ( fabs( uInEdge - f ) < fabs( l - uInEdge )) ? f : l;
+ }
+ else
+ {
+ SMESHDS_Mesh * meshDS = GetMeshDS();
+ int vertexID = n->GetPosition()->GetShapeId();
+ const TopoDS_Vertex& V = TopoDS::Vertex(meshDS->IndexToShape(vertexID));
+ param = BRep_Tool::Parameter( V, E );
+ }
}
+ if ( check )
+ *check = CheckNodeU( E, n, param, BRep_Tool::Tolerance( E ));
return param;
}
-//================================================================================
-/*!
- * \brief Return existing or create new medium nodes between given ones
- * \param force3d - if true, new node is the middle of n1 and n2,
- * else is located on geom face or geom edge
- */
-//================================================================================
+//=======================================================================
+//function : CheckNodeU
+//purpose : Check and fix node U on an edge
+// Return false if U is bad and could not be fixed
+//=======================================================================
+
+bool SMESH_MesherHelper::CheckNodeU(const TopoDS_Edge& E,
+ const SMDS_MeshNode* n,
+ double& u,
+ const double tol,
+ const bool force) const
+{
+ if ( force || !myOkNodePosShapes.count( n->GetPosition()->GetShapeId() ))
+ {
+ // check that u is correct
+ TopLoc_Location loc; double f,l;
+ Handle(Geom_Curve) curve = BRep_Tool::Curve( E,loc,f,l );
+ if ( curve.IsNull() ) // degenerated edge
+ {
+ if ( u+tol < f || u-tol > l )
+ {
+ double r = Max( 0.5, 1 - tol*n->GetID()); // to get a unique u on edge
+ u = f*r + l*(1-r);
+ }
+ }
+ else
+ {
+ gp_Pnt nodePnt = SMESH_MeshEditor::TNodeXYZ( n );
+ if ( !loc.IsIdentity() ) nodePnt.Transform( loc.Transformation().Inverted() );
+ if ( nodePnt.Distance( curve->Value( u )) > tol )
+ {
+ // u incorrect, project the node to the curve
+ GeomAPI_ProjectPointOnCurve projector( nodePnt, curve, f, l );
+ if ( projector.NbPoints() < 1 )
+ {
+ MESSAGE( "SMESH_MesherHelper::CheckNodeU() failed to project" );
+ return false;
+ }
+ Quantity_Parameter U = projector.LowerDistanceParameter();
+ if ( nodePnt.Distance( curve->Value( U )) > tol )
+ {
+ MESSAGE( "SMESH_MesherHelper::CheckNodeU(), invalid projection" );
+ return false;
+ }
+ u = double( U );
+ }
+ else if ( fabs( u ) > numeric_limits<double>::min() )
+ {
+ ((SMESH_MesherHelper*) this)->myOkNodePosShapes.insert( n->GetPosition()->GetShapeId() );
+ }
+ }
+ }
+ return true;
+}
+
+//=======================================================================
+//function : GetMediumNode
+//purpose : Return existing or create new medium nodes between given ones
+//=======================================================================
const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
- bool force3d)
+ bool force3d)
{
+ // Find existing node
+
SMESH_TLink link(n1,n2);
ItTLinkNode itLN = myTLinkNodeMap.find( link );
if ( itLN != myTLinkNodeMap.end() ) {
return (*itLN).second;
}
- // create medium node
+
+ // Create medium node
+
SMDS_MeshNode* n12;
SMESHDS_Mesh* meshDS = GetMeshDS();
+
+ // get type of shape for the new medium node
int faceID = -1, edgeID = -1;
const SMDS_PositionPtr Pos1 = n1->GetPosition();
const SMDS_PositionPtr Pos2 = n2->GetPosition();
edgeID = Pos2->GetShapeId();
}
}
+ // get positions of the given nodes on shapes
+ TopoDS_Edge E; double u [2];
+ TopoDS_Face F; gp_XY uv[2];
+ bool uvOK[2] = { false, false };
+ TopAbs_ShapeEnum shapeType = myShape.IsNull() ? TopAbs_SHAPE : myShape.ShapeType();
+ if ( faceID>0 || shapeType == TopAbs_FACE)
+ {
+ if( myShape.IsNull() )
+ F = TopoDS::Face(meshDS->IndexToShape(faceID));
+ else {
+ F = TopoDS::Face(myShape);
+ faceID = myShapeID;
+ }
+ uv[0] = GetNodeUV(F,n1,n2, force3d ? 0 : &uvOK[0]);
+ uv[1] = GetNodeUV(F,n2,n1, force3d ? 0 : &uvOK[1]);
+ }
+ else if (edgeID>0 || shapeType == TopAbs_EDGE)
+ {
+ if( myShape.IsNull() )
+ E = TopoDS::Edge(meshDS->IndexToShape(edgeID));
+ else {
+ E = TopoDS::Edge(myShape);
+ edgeID = myShapeID;
+ }
+ u[0] = GetNodeU(E,n1,n2, force3d ? 0 : &uvOK[0]);
+ u[1] = GetNodeU(E,n2,n1, force3d ? 0 : &uvOK[1]);
+ }
if(!force3d)
{
// we try to create medium node using UV parameters of
// nodes, else - medium between corresponding 3d points
-
- TopAbs_ShapeEnum shapeType = myShape.IsNull() ? TopAbs_SHAPE : myShape.ShapeType();
- if(faceID>0 || shapeType == TopAbs_FACE) {
- // obtaining a face and 2d points for nodes
- TopoDS_Face F;
- if( myShape.IsNull() )
- F = TopoDS::Face(meshDS->IndexToShape(faceID));
- else {
- F = TopoDS::Face(myShape);
- faceID = myShapeID;
- }
- bool uvOK1, uvOK2;
- gp_XY p1 = GetNodeUV(F,n1,n2, &uvOK1);
- gp_XY p2 = GetNodeUV(F,n2,n1, &uvOK2);
-
- if ( uvOK1 && uvOK2 )
+ if( ! F.IsNull() )
+ {
+ if ( uvOK[0] && uvOK[1] )
{
if ( IsDegenShape( Pos1->GetShapeId() ))
- p1.SetCoord( myParIndex, p2.Coord( myParIndex ));
+ if ( myParIndex & U_periodic ) uv[0].SetCoord( 1, uv[1].Coord( 1 ));
+ else uv[0].SetCoord( 2, uv[1].Coord( 2 ));
else if ( IsDegenShape( Pos2->GetShapeId() ))
- p2.SetCoord( myParIndex, p1.Coord( myParIndex ));
+ if ( myParIndex & U_periodic ) uv[1].SetCoord( 1, uv[0].Coord( 1 ));
+ else uv[1].SetCoord( 2, uv[0].Coord( 2 ));
TopLoc_Location loc;
Handle(Geom_Surface) S = BRep_Tool::Surface(F,loc);
- gp_XY uv = GetMiddleUV( S, p1, p2 );
- gp_Pnt P = S->Value( uv.X(), uv.Y() ).Transformed(loc);
+ gp_XY UV = GetMiddleUV( S, uv[0], uv[1] );
+ gp_Pnt P = S->Value( UV.X(), UV.Y() ).Transformed(loc);
n12 = meshDS->AddNode(P.X(), P.Y(), P.Z());
- meshDS->SetNodeOnFace(n12, faceID, uv.X(), uv.Y());
+ meshDS->SetNodeOnFace(n12, faceID, UV.X(), UV.Y());
myTLinkNodeMap.insert(make_pair(link,n12));
return n12;
}
}
- if (edgeID>0 || shapeType == TopAbs_EDGE) {
-
- TopoDS_Edge E;
- if( myShape.IsNull() )
- E = TopoDS::Edge(meshDS->IndexToShape(edgeID));
- else {
- E = TopoDS::Edge(myShape);
- edgeID = myShapeID;
- }
-
- double p1 = GetNodeU(E,n1);
- double p2 = GetNodeU(E,n2);
-
+ else if ( !E.IsNull() )
+ {
double f,l;
Handle(Geom_Curve) C = BRep_Tool::Curve(E, f, l);
- if(!C.IsNull()) {
-
+ if(!C.IsNull())
+ {
Standard_Boolean isPeriodic = C->IsPeriodic();
- double u;
+ double U;
if(isPeriodic) {
Standard_Real Period = C->Period();
- Standard_Real p = p2+ShapeAnalysis::AdjustByPeriod(p2,p1,Period);
- Standard_Real pmid = (p1+p)/2.;
- u = pmid+ShapeAnalysis::AdjustToPeriod(pmid,C->FirstParameter(),C->LastParameter());
+ Standard_Real p = u[1]+ShapeAnalysis::AdjustByPeriod(u[1],u[0],Period);
+ Standard_Real pmid = (u[0]+p)/2.;
+ U = pmid+ShapeAnalysis::AdjustToPeriod(pmid,C->FirstParameter(),C->LastParameter());
}
else
- u = (p1+p2)/2.;
+ U = (u[0]+u[1])/2.;
- gp_Pnt P = C->Value( u );
+ gp_Pnt P = C->Value( U );
n12 = meshDS->AddNode(P.X(), P.Y(), P.Z());
- meshDS->SetNodeOnEdge(n12, edgeID, u);
+ meshDS->SetNodeOnEdge(n12, edgeID, U);
myTLinkNodeMap.insert(make_pair(link,n12));
return n12;
}
double y = ( n1->Y() + n2->Y() )/2.;
double z = ( n1->Z() + n2->Z() )/2.;
n12 = meshDS->AddNode(x,y,z);
- if(edgeID>0)
- meshDS->SetNodeOnEdge(n12, edgeID);
- else if(faceID>0)
- meshDS->SetNodeOnFace(n12, faceID);
- else
+ if ( !F.IsNull() )
+ {
+ gp_XY UV = ( uv[0] + uv[1] ) / 2.;
+ CheckNodeUV( F, n12, UV, BRep_Tool::Tolerance( F ), /*force=*/true);
+ meshDS->SetNodeOnFace(n12, faceID, UV.X(), UV.Y() );
+ }
+ else if ( !E.IsNull() )
+ {
+ double U = ( u[0] + u[1] ) / 2.;
+ CheckNodeU( E, n12, U, BRep_Tool::Tolerance( E ), /*force=*/true);
+ meshDS->SetNodeOnEdge(n12, edgeID, U);
+ }
+ else if ( myShapeID > 1 )
+ {
meshDS->SetNodeInVolume(n12, myShapeID);
+ }
myTLinkNodeMap.insert( make_pair( link, n12 ));
return n12;
}
//=======================================================================
-/*!
- * Creates a node
- */
+//function : AddNode
+//purpose : Creates a node
//=======================================================================
SMDS_MeshNode* SMESH_MesherHelper::AddNode(double x, double y, double z, int ID)
}
//=======================================================================
-/*!
- * Creates quadratic or linear edge
- */
+//function : AddEdge
+//purpose : Creates quadratic or linear edge
//=======================================================================
SMDS_MeshEdge* SMESH_MesherHelper::AddEdge(const SMDS_MeshNode* n1,
- const SMDS_MeshNode* n2,
- const int id,
- const bool force3d)
+ const SMDS_MeshNode* n2,
+ const int id,
+ const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
}
//=======================================================================
-/*!
- * Creates quadratic or linear triangle
- */
+//function : AddFace
+//purpose : Creates quadratic or linear triangle
//=======================================================================
SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
}
//=======================================================================
-/*!
- * Creates quadratic or linear quadrangle
- */
+//function : AddFace
+//purpose : Creates quadratic or linear quadrangle
//=======================================================================
SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
- const int id,
- const bool force3d)
+ const int id,
+ const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshFace* elem = 0;
}
//=======================================================================
-/*!
- * Creates quadratic or linear volume
- */
+//function : AddVolume
+//purpose : Creates quadratic or linear prism
//=======================================================================
SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
}
//=======================================================================
-/*!
- * Creates quadratic or linear volume
- */
+//function : AddVolume
+//purpose : Creates quadratic or linear tetrahedron
//=======================================================================
SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
}
//=======================================================================
-/*!
- * Creates quadratic or linear pyramid
- */
+//function : AddVolume
+//purpose : Creates quadratic or linear pyramid
//=======================================================================
SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
}
//=======================================================================
-/*!
- * Creates quadratic or linear hexahedron
- */
+//function : AddVolume
+//purpose : Creates quadratic or linear hexahedron
//=======================================================================
SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
}
//=======================================================================
-/*!
- * \brief Load nodes bound to face into a map of node columns
- * \param theParam2ColumnMap - map of node columns to fill
- * \param theFace - the face on which nodes are searched for
- * \param theBaseEdge - the edge nodes of which are columns' bases
- * \param theMesh - the mesh containing nodes
- * \retval bool - false if something is wrong
- *
- * The key of the map is a normalized parameter of each
- * base node on theBaseEdge.
- * This method works in supposition that nodes on the face
- * forms a rectangular grid and elements can be quardrangles or triangles
- */
+//function : LoadNodeColumns
+//purpose : Load nodes bound to face into a map of node columns
//=======================================================================
bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
const TopoDS_Edge& theBaseEdge,
SMESHDS_Mesh* theMesh)
{
- // get vertices of theBaseEdge
- TopoDS_Vertex vfb, vlb, vft; // first and last, bottom and top vertices
- TopoDS_Edge eFrw = TopoDS::Edge( theBaseEdge.Oriented( TopAbs_FORWARD ));
- TopExp::Vertices( eFrw, vfb, vlb );
-
- // find the other edges of theFace and orientation of e1
- TopoDS_Edge e1, e2, eTop;
- bool rev1, CumOri = false;
- TopExp_Explorer exp( theFace, TopAbs_EDGE );
- int nbEdges = 0;
- for ( ; exp.More(); exp.Next() ) {
- if ( ++nbEdges > 4 ) {
- return false; // more than 4 edges in theFace
- }
- TopoDS_Edge e = TopoDS::Edge( exp.Current() );
- if ( theBaseEdge.IsSame( e ))
- continue;
- TopoDS_Vertex vCommon;
- if ( !TopExp::CommonVertex( theBaseEdge, e, vCommon ))
- eTop = e;
- else if ( vCommon.IsSame( vfb )) {
- e1 = e;
- vft = TopExp::LastVertex( e1, CumOri );
- rev1 = vfb.IsSame( vft );
- if ( rev1 )
- vft = TopExp::FirstVertex( e1, CumOri );
- }
- else
- e2 = e;
- }
- if ( nbEdges < 4 ) {
- return false; // less than 4 edges in theFace
- }
- if ( e2.IsNull() && vfb.IsSame( vlb ))
- e2 = e1;
-
- // submeshes corresponding to shapes
- SMESHDS_SubMesh* smFace = theMesh->MeshElements( theFace );
- SMESHDS_SubMesh* smb = theMesh->MeshElements( theBaseEdge );
- SMESHDS_SubMesh* smt = theMesh->MeshElements( eTop );
- SMESHDS_SubMesh* sm1 = theMesh->MeshElements( e1 );
- SMESHDS_SubMesh* sm2 = theMesh->MeshElements( e2 );
- SMESHDS_SubMesh* smVfb = theMesh->MeshElements( vfb );
- SMESHDS_SubMesh* smVlb = theMesh->MeshElements( vlb );
- SMESHDS_SubMesh* smVft = theMesh->MeshElements( vft );
- if (!smFace || !smb || !smt || !sm1 || !sm2 || !smVfb || !smVlb || !smVft ) {
- RETURN_BAD_RESULT( "NULL submesh " <<smFace<<" "<<smb<<" "<<smt<<" "<<
- sm1<<" "<<sm2<<" "<<smVfb<<" "<<smVlb<<" "<<smVft);
- }
- if ( smb->NbNodes() != smt->NbNodes() || sm1->NbNodes() != sm2->NbNodes() ) {
- RETURN_BAD_RESULT(" Diff nb of nodes on opposite edges" );
- }
- if (smVfb->NbNodes() != 1 || smVlb->NbNodes() != 1 || smVft->NbNodes() != 1) {
- RETURN_BAD_RESULT("Empty submesh of vertex");
- }
- // define whether mesh is quadratic
- bool isQuadraticMesh = false;
- SMDS_ElemIteratorPtr eIt = smFace->GetElements();
- if ( !eIt->more() ) {
- RETURN_BAD_RESULT("No elements on the face");
- }
- const SMDS_MeshElement* e = eIt->next();
- isQuadraticMesh = e->IsQuadratic();
-
- if ( sm1->NbNodes() * smb->NbNodes() != smFace->NbNodes() ) {
- // check quadratic case
- if ( isQuadraticMesh ) {
- // what if there are quadrangles and triangles mixed?
-// int n1 = sm1->NbNodes()/2;
-// int n2 = smb->NbNodes()/2;
-// int n3 = sm1->NbNodes() - n1;
-// int n4 = smb->NbNodes() - n2;
-// int nf = sm1->NbNodes()*smb->NbNodes() - n3*n4;
-// if( nf != smFace->NbNodes() ) {
-// MESSAGE( "Wrong nb face nodes: " <<
-// sm1->NbNodes()<<" "<<smb->NbNodes()<<" "<<smFace->NbNodes());
-// return false;
-// }
- }
- else {
- RETURN_BAD_RESULT( "Wrong nb face nodes: " <<
- sm1->NbNodes()<<" "<<smb->NbNodes()<<" "<<smFace->NbNodes());
- }
+ SMESHDS_SubMesh* faceSubMesh = theMesh->MeshElements( theFace );
+ if ( !faceSubMesh || faceSubMesh->NbElements() == 0 )
+ return false;
+
+ // get nodes on theBaseEdge sorted by param on edge and initialize theParam2ColumnMap with them
+
+ map< double, const SMDS_MeshNode*> sortedBaseNodes;
+ if ( !SMESH_Algo::GetSortedNodesOnEdge( theMesh, theBaseEdge,/*noMedium=*/true, sortedBaseNodes)
+ || sortedBaseNodes.size() < 2 )
+ return false;
+
+ int nbRows = faceSubMesh->NbElements() / ( sortedBaseNodes.size()-1 ) + 1;
+ map< double, const SMDS_MeshNode*>::iterator u_n = sortedBaseNodes.begin();
+ double f = u_n->first, range = sortedBaseNodes.rbegin()->first - f;
+ for ( ; u_n != sortedBaseNodes.end(); u_n++ )
+ {
+ double par = ( u_n->first - f ) / range;
+ vector<const SMDS_MeshNode*>& nCol = theParam2ColumnMap[ par ];
+ nCol.resize( nbRows );
+ nCol[0] = u_n->second;
}
- // IJ size
- int vsize = sm1->NbNodes() + 2;
- int hsize = smb->NbNodes() + 2;
- if(isQuadraticMesh) {
- vsize = vsize - sm1->NbNodes()/2 -1;
- hsize = hsize - smb->NbNodes()/2 -1;
- }
-
- // load nodes from theBaseEdge
-
- std::set<const SMDS_MeshNode*> loadedNodes;
- const SMDS_MeshNode* nullNode = 0;
-
- std::vector<const SMDS_MeshNode*> & nVecf = theParam2ColumnMap[ 0.];
- nVecf.resize( vsize, nullNode );
- loadedNodes.insert( nVecf[ 0 ] = smVfb->GetNodes()->next() );
-
- std::vector<const SMDS_MeshNode*> & nVecl = theParam2ColumnMap[ 1.];
- nVecl.resize( vsize, nullNode );
- loadedNodes.insert( nVecl[ 0 ] = smVlb->GetNodes()->next() );
-
- double f, l;
- BRep_Tool::Range( eFrw, f, l );
- double range = l - f;
- SMDS_NodeIteratorPtr nIt = smb->GetNodes();
- const SMDS_MeshNode* node;
- while ( nIt->more() ) {
- node = nIt->next();
- if(IsMedium(node, SMDSAbs_Edge))
- continue;
- const SMDS_EdgePosition* pos =
- dynamic_cast<const SMDS_EdgePosition*>( node->GetPosition() );
- if ( !pos ) {
- return false;
- }
- double u = ( pos->GetUParameter() - f ) / range;
- std::vector<const SMDS_MeshNode*> & nVec = theParam2ColumnMap[ u ];
- nVec.resize( vsize, nullNode );
- loadedNodes.insert( nVec[ 0 ] = node );
- }
- if ( theParam2ColumnMap.size() != hsize ) {
- RETURN_BAD_RESULT( "Wrong node positions on theBaseEdge" );
- }
-
- // load nodes from e1
-
- std::map< double, const SMDS_MeshNode*> sortedNodes; // sort by param on edge
- nIt = sm1->GetNodes();
- while ( nIt->more() ) {
- node = nIt->next();
- if(IsMedium(node))
- continue;
- const SMDS_EdgePosition* pos =
- dynamic_cast<const SMDS_EdgePosition*>( node->GetPosition() );
- if ( !pos ) {
- return false;
- }
- sortedNodes.insert( std::make_pair( pos->GetUParameter(), node ));
- }
- loadedNodes.insert( nVecf[ vsize - 1 ] = smVft->GetNodes()->next() );
- std::map< double, const SMDS_MeshNode*>::iterator u_n = sortedNodes.begin();
- int row = rev1 ? vsize - 1 : 0;
- int dRow = rev1 ? -1 : +1;
- for ( ; u_n != sortedNodes.end(); u_n++ ) {
- row += dRow;
- loadedNodes.insert( nVecf[ row ] = u_n->second );
- }
-
- // try to load the rest nodes
-
- // get all faces from theFace
- TIDSortedElemSet allFaces, foundFaces;
- eIt = smFace->GetElements();
- while ( eIt->more() ) {
- const SMDS_MeshElement* e = eIt->next();
- if ( e->GetType() == SMDSAbs_Face )
- allFaces.insert( e );
- }
- // Starting from 2 neighbour nodes on theBaseEdge, look for a face
- // the nodes belong to, and between the nodes of the found face,
- // look for a not loaded node considering this node to be the next
- // in a column of the starting second node. Repeat, starting
- // from nodes next to the previous starting nodes in their columns,
- // and so on while a face can be found. Then go the the next pair
- // of nodes on theBaseEdge.
- TParam2ColumnMap::iterator par_nVec_1 = theParam2ColumnMap.begin();
- TParam2ColumnMap::iterator par_nVec_2 = par_nVec_1;
- // loop on columns
- int col = 0;
- for ( par_nVec_2++; par_nVec_2 != theParam2ColumnMap.end(); par_nVec_1++, par_nVec_2++ ) {
- col++;
- row = 0;
- const SMDS_MeshNode* n1 = par_nVec_1->second[ row ];
- const SMDS_MeshNode* n2 = par_nVec_2->second[ row ];
- const SMDS_MeshElement* face = 0;
- bool lastColOnClosedFace = ( nVecf[ row ] == n2 );
- do {
- // look for a face by 2 nodes
- face = SMESH_MeshEditor::FindFaceInSet( n1, n2, allFaces, foundFaces );
- if ( face ) {
- int nbFaceNodes = face->NbNodes();
- if ( face->IsQuadratic() )
- nbFaceNodes /= 2;
- if ( nbFaceNodes>4 ) {
- RETURN_BAD_RESULT(" Too many nodes in a face: " << nbFaceNodes );
- }
- // look for a not loaded node of the <face>
- bool found = false;
- const SMDS_MeshNode* n3 = 0; // a node defferent from n1 and n2
- for ( int i = 0; i < nbFaceNodes && !found; ++i ) {
- node = face->GetNode( i );
- found = loadedNodes.insert( node ).second;
- if ( !found && node != n1 && node != n2 )
- n3 = node;
- }
- if ( lastColOnClosedFace && row + 1 < vsize ) {
- node = nVecf[ row + 1 ];
- found = ( face->GetNodeIndex( node ) >= 0 );
- }
- if ( found ) {
- if ( ++row > vsize - 1 ) {
- RETURN_BAD_RESULT( "Too many nodes in column "<< col <<": "<< row+1);
- }
- par_nVec_2->second[ row ] = node;
- foundFaces.insert( face );
- n2 = node;
- if ( nbFaceNodes==4 ) {
- n1 = par_nVec_1->second[ row ];
- }
- }
- else if ( nbFaceNodes==3 && n3 == par_nVec_1->second[ row + 1 ] ) {
- n1 = n3;
- }
- else {
- RETURN_BAD_RESULT( "Not quad mesh, column "<< col );
- }
+
+ // fill theParam2ColumnMap column by column by passing from nodes on
+ // theBaseEdge up via mesh faces on theFace
+
+ TParam2ColumnMap::iterator par_nVec_2 = theParam2ColumnMap.begin();
+ TParam2ColumnMap::iterator par_nVec_1 = par_nVec_2++;
+ TIDSortedElemSet emptySet, avoidSet;
+ for ( ; par_nVec_2 != theParam2ColumnMap.end(); ++par_nVec_1, ++par_nVec_2 )
+ {
+ vector<const SMDS_MeshNode*>& nCol1 = par_nVec_1->second;
+ vector<const SMDS_MeshNode*>& nCol2 = par_nVec_2->second;
+
+ int i1, i2, iRow = 0;
+ const SMDS_MeshNode *n1 = nCol1[0], *n2 = nCol2[0];
+ // find face sharing node n1 and n2 and belonging to faceSubMesh
+ while ( const SMDS_MeshElement* face =
+ SMESH_MeshEditor::FindFaceInSet( n1, n2, emptySet, avoidSet, &i1, &i2))
+ {
+ if ( faceSubMesh->Contains( face ))
+ {
+ int nbNodes = face->IsQuadratic() ? face->NbNodes()/2 : face->NbNodes();
+ if ( nbNodes != 4 )
+ return false;
+ n1 = face->GetNode( (i2+2) % 4 ); // opposite corner of quadrangle face
+ n2 = face->GetNode( (i1+2) % 4 );
+ if ( ++iRow >= nbRows )
+ return false;
+ nCol1[ iRow ] = n1;
+ nCol2[ iRow ] = n2;
+ avoidSet.clear();
}
+ avoidSet.insert( face );
}
- while ( face && n1 && n2 );
-
- if ( row < vsize - 1 ) {
- MESSAGE( "Too few nodes in column "<< col <<": "<< row+1);
- MESSAGE( "Base node 1: "<< par_nVec_1->second[0]);
- MESSAGE( "Base node 2: "<< par_nVec_2->second[0]);
- if ( n1 ) { MESSAGE( "Current node 1: "<< n1); }
- else { MESSAGE( "Current node 1: NULL"); }
- if ( n2 ) { MESSAGE( "Current node 2: "<< n2); }
- else { MESSAGE( "Current node 2: NULL"); }
- MESSAGE( "first base node: "<< theParam2ColumnMap.begin()->second[0]);
- MESSAGE( "last base node: "<< theParam2ColumnMap.rbegin()->second[0]);
- return false;
- }
- } // loop on columns
-
+ if ( iRow + 1 < nbRows ) // compact if necessary
+ nCol1.resize( iRow + 1 ), nCol2.resize( iRow + 1 );
+ }
return true;
}
//=======================================================================
-/*!
- * \brief Return number of unique ancestors of the shape
- */
+//function : NbAncestors
+//purpose : Return number of unique ancestors of the shape
//=======================================================================
int SMESH_MesherHelper::NbAncestors(const TopoDS_Shape& shape,
}
//=======================================================================
-/**
- * Check mesh without geometry for: if all elements on this shape are quadratic,
- * quadratic elements will be created.
- * Used then generated 3D mesh without geometry.
- */
+//function : GetSubShapeOri
+//purpose : Return orientation of sub-shape in the main shape
+//=======================================================================
+
+TopAbs_Orientation SMESH_MesherHelper::GetSubShapeOri(const TopoDS_Shape& shape,
+ const TopoDS_Shape& subShape)
+{
+ TopAbs_Orientation ori = TopAbs_Orientation(-1);
+ if ( !shape.IsNull() && !subShape.IsNull() )
+ {
+ TopExp_Explorer e( shape, subShape.ShapeType() );
+ if ( shape.Orientation() >= TopAbs_INTERNAL ) // TopAbs_INTERNAL or TopAbs_EXTERNAL
+ e.Init( shape.Oriented(TopAbs_FORWARD), subShape.ShapeType() );
+ for ( ; e.More(); e.Next())
+ if ( subShape.IsSame( e.Current() ))
+ break;
+ if ( e.More() )
+ ori = e.Current().Orientation();
+ }
+ return ori;
+}
+
+//=======================================================================
+//function : IsSubShape
+//purpose :
+//=======================================================================
+
+bool SMESH_MesherHelper::IsSubShape( const TopoDS_Shape& shape,
+ const TopoDS_Shape& mainShape )
+{
+ if ( !shape.IsNull() && !mainShape.IsNull() )
+ {
+ for ( TopExp_Explorer exp( mainShape, shape.ShapeType());
+ exp.More();
+ exp.Next() )
+ if ( shape.IsSame( exp.Current() ))
+ return true;
+ }
+ SCRUTE((shape.IsNull()));
+ SCRUTE((mainShape.IsNull()));
+ return false;
+}
+
+//=======================================================================
+//function : IsSubShape
+//purpose :
+//=======================================================================
+
+bool SMESH_MesherHelper::IsSubShape( const TopoDS_Shape& shape, SMESH_Mesh* aMesh )
+{
+ if ( shape.IsNull() || !aMesh )
+ return false;
+ return
+ aMesh->GetMeshDS()->ShapeToIndex( shape ) ||
+ // PAL16202
+ shape.ShapeType() == TopAbs_COMPOUND && aMesh->GetMeshDS()->IsGroupOfSubShapes( shape );
+}
+
+//=======================================================================
+//function : IsQuadraticMesh
+//purpose : Check mesh without geometry for: if all elements on this shape are quadratic,
+// quadratic elements will be created.
+// Used then generated 3D mesh without geometry.
//=======================================================================
SMESH_MesherHelper:: MType SMESH_MesherHelper::IsQuadraticMesh()
}
//=======================================================================
-/*!
- * \brief Return an alternative parameter for a node on seam
- */
+//function : GetOtherParam
+//purpose : Return an alternative parameter for a node on seam
//=======================================================================
double SMESH_MesherHelper::GetOtherParam(const double param) const
{
- return fabs(param-myPar1) < fabs(param-myPar2) ? myPar2 : myPar1;
+ int i = myParIndex & U_periodic ? 0 : 1;
+ return fabs(param-myPar1[i]) < fabs(param-myPar2[i]) ? myPar2[i] : myPar1[i];
}
//=======================================================================
mutable vector< const QLink* > _sides;
mutable bool _sideIsAdded[4]; // added in chain of links
gp_Vec _normal;
+#ifdef _DEBUG_
+ mutable const SMDS_MeshElement* _face;
+#endif
- QFace( const vector< const QLink*>& links );
+ QFace( const vector< const QLink*>& links, const SMDS_MeshElement* face=0 );
void SetVolume(const SMDS_MeshElement* v) const { _volumes[ _volumes[0] ? 1 : 0 ] = v; }
for (int i=0; i<_sides.size(); ++i ) if ( _sides[i] == side ) return i;
return -1;
}
- bool GetLinkChain( int iSide, TChain& chain, SMDS_TypeOfPosition pos, int& error) const;
+ bool GetLinkChain( int iSide, TChain& chain, SMDS_TypeOfPosition pos, int& err) const;
- bool GetLinkChain( TChainLink& link, TChain& chain, SMDS_TypeOfPosition pos, int& error) const
+ bool GetLinkChain( TChainLink& link, TChain& chain, SMDS_TypeOfPosition pos, int& err) const
{
int i = LinkIndex( link._qlink );
if ( i < 0 ) return true;
_sideIsAdded[i] = true;
link.SetFace( this );
// continue from opposite link
- return GetLinkChain( (i+2)%_sides.size(), chain, pos, error );
+ return GetLinkChain( (i+2)%_sides.size(), chain, pos, err );
}
bool IsBoundary() const { return !_volumes[1]; }
const TChainLink& avoidLink,
TLinkInSet * notBoundaryLink = 0,
const SMDS_MeshNode* nodeToContain = 0,
- bool * isAdjacentUsed = 0) const;
+ bool * isAdjacentUsed = 0,
+ int nbRecursionsLeft = -1) const;
TLinkInSet GetLinkByNode( const TLinkSet& links,
const TChainLink& avoidLink,
*/
//================================================================================
- QFace::QFace( const vector< const QLink*>& links )
+ QFace::QFace( const vector< const QLink*>& links, const SMDS_MeshElement* face )
{
_volumes[0] = _volumes[1] = 0;
_sides = links;
_normal /= sqrt( normSqSize );
else
_normal.SetCoord(1e-33,0,0);
+
+#ifdef _DEBUG_
+ _face = face;
+#endif
}
//================================================================================
/*!
if ( _sides.size() != 4 ) { // triangle - visit all my continous faces
MSGBEG( *this );
- for ( int i = 0; i < _sides.size(); ++i ) {
- if ( !_sideIsAdded[i] && _sides[i] ) {
- _sideIsAdded[i]=true;
- TChain::iterator chLink = chain.insert( chain.begin(), TChainLink(_sides[i]));
- chLink->SetFace( this );
- if ( _sides[i]->MediumPos() >= pos )
- if ( const QFace* f = _sides[i]->GetContinuesFace( this ))
- f->GetLinkChain( *chLink, chain, pos, error );
+ list< const QFace* > faces( 1, this );
+ for (list< const QFace* >::iterator fIt = faces.begin(); fIt != faces.end(); ++fIt ) {
+ const QFace* face = *fIt;
+ for ( int i = 0; i < face->_sides.size(); ++i ) {
+ if ( !face->_sideIsAdded[i] && face->_sides[i] ) {
+ face->_sideIsAdded[i] = true;
+ TChain::iterator chLink = chain.insert( chain.begin(), TChainLink(face->_sides[i]));
+ chLink->SetFace( face );
+ if ( face->_sides[i]->MediumPos() >= pos )
+ if ( const QFace* contFace = face->_sides[i]->GetContinuesFace( face ))
+ faces.push_back( contFace );
+ }
}
}
if ( error < ERR_TRI )
chLink->SetFace( this );
MSGBEG( *this );
- // propagate from rectangle to neighbour faces
+ // propagate from quadrangle to neighbour faces
if ( link->MediumPos() >= pos ) {
int nbLinkFaces = link->_faces.size();
if ( nbLinkFaces == 4 || nbLinkFaces < 4 && link->OnBoundary()) {
* \param nodeToContain - node the returned link must contain; if provided, search
* also performed on adjacent faces
* \param isAdjacentUsed - returns true if link is found in adjacent faces
+ * \param nbRecursionsLeft - to limit recursion
*/
//================================================================================
const TChainLink& avoidLink,
TLinkInSet * notBoundaryLink,
const SMDS_MeshNode* nodeToContain,
- bool * isAdjacentUsed) const
+ bool * isAdjacentUsed,
+ int nbRecursionsLeft) const
{
TLinkInSet linksEnd = links.end(), boundaryLink = linksEnd;
continue;
TLinkInSet link = links.find( _sides[iL] );
if ( link == linksEnd ) continue;
+ if ( (*link)->MediumPos() > SMDS_TOP_FACE )
+ continue; // We work on faces here, don't go into a volume
// check link
if ( link->IsBoundary() ) {
if ( boundaryLink != linksEnd ) break;
}
- if ( boundaryLink == linksEnd && nodeToContain ) // cellect adjacent faces
+ if ( boundaryLink == linksEnd && nodeToContain ) // collect adjacent faces
if ( const QFace* adj = link->NextFace( this ))
if ( adj->Contains( nodeToContain ))
adjacentFaces.push_back( make_pair( adj, link ));
}
if ( isAdjacentUsed ) *isAdjacentUsed = false;
- if ( boundaryLink == linksEnd && nodeToContain ) // check adjacent faces
+ if ( boundaryLink == linksEnd && nodeToContain && nbRecursionsLeft) // check adjacent faces
{
+ if ( nbRecursionsLeft < 0 )
+ nbRecursionsLeft = nodeToContain->NbInverseElements();
TFaceLinkList::iterator adj = adjacentFaces.begin();
for ( ; boundaryLink == linksEnd && adj != adjacentFaces.end(); ++adj )
- boundaryLink = adj->first->GetBoundaryLink( links, *(adj->second),
- 0, nodeToContain, isAdjacentUsed);
+ boundaryLink = adj->first->GetBoundaryLink( links, *(adj->second), 0, nodeToContain,
+ isAdjacentUsed, nbRecursionsLeft-1);
if ( isAdjacentUsed ) *isAdjacentUsed = true;
}
return boundaryLink;
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 );
for ( TopExp_Explorer f(myShape,TopAbs_FACE,TopAbs_SOLID); f.More(); f.Next() ) {
faces.Add( f.Current() );
}
- for ( TopExp_Explorer v(myShape,TopAbs_SOLID); v.More(); v.Next() ) {
- if ( myMesh->GetSubMesh( v.Current() )->IsEmpty() ) { // get faces of solid
- for ( TopExp_Explorer f( v.Current(), TopAbs_FACE); f.More(); f.Next() )
+ for ( TopExp_Explorer s(myShape,TopAbs_SOLID); s.More(); s.Next() ) {
+ if ( myMesh->GetSubMesh( s.Current() )->IsEmpty() ) { // get faces of solid
+ for ( TopExp_Explorer f( s.Current(), TopAbs_FACE); f.More(); f.Next() )
faces.Add( f.Current() );
}
else { // fix nodes in the solid and its faces
SMESH_MesherHelper h(*myMesh);
- h.SetSubShape( v.Current() );
+ h.SetSubShape( s.Current() );
h.FixQuadraticElements(false);
}
}
for ( TopTools_MapIteratorOfMapOfShape fIt( faces ); fIt.More(); fIt.Next() ) {
SMESH_MesherHelper h(*myMesh);
h.SetSubShape( fIt.Key() );
- h.FixQuadraticElements();
+ h.FixQuadraticElements(true);
}
return;
}
hasRectFaces = hasRectFaces ||
( volTool.GetVolumeType() == SMDS_VolumeTool::QUAD_HEXA ||
volTool.GetVolumeType() == SMDS_VolumeTool::QUAD_PENTA );
+#ifdef _DEBUG_
+ if ( nbN == 6 )
+ pFace->_face = GetMeshDS()->FindFace(faceNodes[0],faceNodes[2],faceNodes[4]);
+ else
+ pFace->_face = GetMeshDS()->FindFace(faceNodes[0],faceNodes[2],
+ faceNodes[4],faceNodes[6] );
+#endif
}
}
set< QLink >::iterator pLink = links.begin();
// not treat boundary of volumic submesh
int isInside = ( elemType == SMDSAbs_Volume && volumeOnly ) ? 1 : 0;
for ( ; isInside < 2; ++isInside ) {
- MSG( "--------------- LOOP " << isInside << " ------------------");
+ MSG( "--------------- LOOP (inside=" << isInside << ") ------------------");
SMDS_TypeOfPosition pos = isInside ? SMDS_TOP_3DSPACE : SMDS_TOP_FACE;
for ( pFace = faces.begin(); pFace != faces.end(); ++pFace ) {
if ( !pFace->GetLinkChain( dir+2, rawChain, pos, error ) && error ==ERR_UNKNOWN ) continue;
vector< TChain > chains;
- if ( error == ERR_OK ) { // chains contains continues rectangles
+ if ( error == ERR_OK ) { // chain contains continues rectangles
chains.resize(1);
chains[0].splice( chains[0].begin(), rawChain );
}
- else if ( error == ERR_TRI ) { // chains contains continues triangles
+ else if ( error == ERR_TRI ) { // chain contains continues triangles
TSplitTriaResult res = splitTrianglesIntoChains( rawChain, chains, pos );
- if ( res != _OK ) { // not rectangles split into triangles
+ if ( res != _OK ) { // not quadrangles split into triangles
fixTriaNearBoundary( rawChain, *this );
break;
}
}
- else if ( error == ERR_PRISM ) { // side faces of prisms
+ else if ( error == ERR_PRISM ) { // quadrangle side faces of prisms
fixPrism( rawChain );
break;
}
// compute node displacement of end links in parametric space of face
const SMDS_MeshNode* nodeOnFace = (*(++chain.begin()))->_mediumNode;
TopoDS_Shape f = GetSubShapeByNode( nodeOnFace, GetMeshDS() );
- if ( !f.IsNull() && f.ShapeType() == TopAbs_FACE ) {
+ if ( !f.IsNull() && f.ShapeType() == TopAbs_FACE )
+ {
face = TopoDS::Face( f );
- for ( int is1 = 0; is1 < 2; ++is1 ) { // move0 or move1
+ Handle(Geom_Surface) surf = BRep_Tool::Surface(face,loc);
+ for ( int is1 = 0; is1 < 2; ++is1 ) // move0 or move1
+ {
TChainLink& link = is1 ? chain.back() : chain.front();
+ gp_XY uvm = GetNodeUV( face, link->_mediumNode, nodeOnFace, &checkUV);
gp_XY uv1 = GetNodeUV( face, link->node1(), nodeOnFace, &checkUV);
gp_XY uv2 = GetNodeUV( face, link->node2(), nodeOnFace, &checkUV);
- gp_XY uvm = GetNodeUV( face, link->_mediumNode, nodeOnFace, &checkUV);
- gp_XY uvMove = uvm - GetMiddleUV( BRep_Tool::Surface(face,loc), uv1, uv2);
- if ( is1 ) move1.SetCoord( uvMove.X(), uvMove.Y(), 0 );
- else move0.SetCoord( uvMove.X(), uvMove.Y(), 0 );
+ gp_XY uv12 = GetMiddleUV( surf, uv1, uv2);
+ // uvMove = uvm - uv12
+ gp_XY uvMove = applyIn2D(surf, uvm, uv12, gp_XY_Subtracted, /*inPeriod=*/false);
+ ( is1 ? move1 : move0 ).SetCoord( uvMove.X(), uvMove.Y(), 0 );
}
if ( move0.SquareMagnitude() < straightTol2 &&
move1.SquareMagnitude() < straightTol2 ) {
}
else {
// compute 3D displacement by 2D one
+ Handle(Geom_Surface) s = BRep_Tool::Surface(face,loc);
gp_XY oldUV = GetNodeUV( face, (*link1)->_mediumNode, 0, &checkUV);
- gp_XY newUV = oldUV + gp_XY( move.X(), move.Y() );
- gp_Pnt newPnt = BRep_Tool::Surface(face,loc)->Value( newUV.X(), newUV.Y());
+ gp_XY newUV = applyIn2D( s, oldUV, gp_XY( move.X(),move.Y()), gp_XY_Added);
+ gp_Pnt newPnt = s->Value( newUV.X(), newUV.Y());
move = gp_Vec( XYZ((*link1)->_mediumNode), newPnt.Transformed(loc) );
#ifdef _DEBUG_
if ( (XYZ((*link1)->node1()) - XYZ((*link1)->node2())).SquareModulus() <
}
}
}
+
+//=======================================================================
+/*!
+ * \brief Iterator on ancestors of the given type
+ */
+//=======================================================================
+
+struct TAncestorsIterator : public SMDS_Iterator<const TopoDS_Shape*>
+{
+ TopTools_ListIteratorOfListOfShape _ancIter;
+ TopAbs_ShapeEnum _type;
+ TAncestorsIterator( const TopTools_ListOfShape& ancestors, TopAbs_ShapeEnum type)
+ : _ancIter( ancestors ), _type( type )
+ {
+ if ( _ancIter.More() && _ancIter.Value().ShapeType() != _type ) next();
+ }
+ virtual bool more()
+ {
+ return _ancIter.More();
+ }
+ virtual const TopoDS_Shape* next()
+ {
+ const TopoDS_Shape* s = _ancIter.More() ? & _ancIter.Value() : 0;
+ if ( _ancIter.More() )
+ for ( _ancIter.Next(); _ancIter.More(); _ancIter.Next())
+ if ( _ancIter.Value().ShapeType() == _type )
+ break;
+ return s;
+ }
+};
+
+//=======================================================================
+/*!
+ * \brief Return iterator on ancestors of the given type
+ */
+//=======================================================================
+
+PShapeIteratorPtr SMESH_MesherHelper::GetAncestors(const TopoDS_Shape& shape,
+ const SMESH_Mesh& mesh,
+ TopAbs_ShapeEnum ancestorType)
+{
+ return PShapeIteratorPtr( new TAncestorsIterator( mesh.GetAncestors(shape), ancestorType));
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SMESH_MesherHelper.hxx
// Created: 15.02.06 14:48:09
// Author: Sergey KUUL
#include <map>
+class GeomAPI_ProjectPointOnSurf;
+
typedef std::map<SMESH_TLink, const SMDS_MeshNode*> TLinkNodeMap;
typedef std::map<SMESH_TLink, const SMDS_MeshNode*>::iterator ItTLinkNode;
+typedef SMDS_Iterator<const TopoDS_Shape*> PShapeIterator;
+typedef boost::shared_ptr< PShapeIterator > PShapeIteratorPtr;
+
+typedef std::vector<const SMDS_MeshNode* > TNodeColumn;
+typedef std::map< double, TNodeColumn > TParam2ColumnMap;
+
+typedef gp_XY (*xyFunPtr)(const gp_XY& uv1, const gp_XY& uv2);
+
+//=======================================================================
/*!
* \brief It helps meshers to add elements
*
* It defines degree of elements to create when IsQuadraticSubMesh()
* is called.
*/
-
-typedef std::vector<const SMDS_MeshNode* > TNodeColumn;
-typedef std::map< double, TNodeColumn > TParam2ColumnMap;
+//=======================================================================
class SMESH_EXPORT SMESH_MesherHelper
{
static int NbAncestors(const TopoDS_Shape& shape,
const SMESH_Mesh& mesh,
TopAbs_ShapeEnum ancestorType=TopAbs_SHAPE);
+ /*!
+ * \brief Return iterator on ancestors of the given type
+ */
+ static PShapeIteratorPtr GetAncestors(const TopoDS_Shape& shape,
+ const SMESH_Mesh& mesh,
+ TopAbs_ShapeEnum ancestorType);
+
+ /*!
+ * \brief Return orientation of sub-shape in the main shape
+ */
+ static TopAbs_Orientation GetSubShapeOri(const TopoDS_Shape& shape,
+ const TopoDS_Shape& subShape);
+
+ static bool IsSubShape( const TopoDS_Shape& shape, const TopoDS_Shape& mainShape );
+
+ static bool IsSubShape( const TopoDS_Shape& shape, SMESH_Mesh* aMesh );
+
public:
// ---------- PUBLIC INSTANCE METHODS ----------
/*!
* \brief Return the shape set by IsQuadraticSubMesh() or SetSubShape()
*/
- TopoDS_Shape GetSubShape() const { return myShape; }
+ const TopoDS_Shape& GetSubShape() const { return myShape; }
/*!
* Creates a node
*/
double GetNodeU(const TopoDS_Edge& theEdge,
const SMDS_MeshNode* theNode,
+ const SMDS_MeshNode* inEdgeNode=0,
bool* check=0);
/*!
* \brief Return node UV on face
bool* check=0) const;
/*!
* \brief Check and fix node UV on a face
+ * \param force - check even if checks of other nodes on this face passed OK
* \retval bool - false if UV is bad and could not be fixed
*/
bool CheckNodeUV(const TopoDS_Face& F,
const SMDS_MeshNode* n,
gp_XY& uv,
- const double tol) const;
+ const double tol,
+ const bool force=false) const;
+ /*!
+ * \brief Check and fix node U on an edge
+ * \param force - check even if checks of other nodes on this edge passed OK
+ * \retval bool - false if U is bad and could not be fixed
+ */
+ bool CheckNodeU(const TopoDS_Edge& E,
+ const SMDS_MeshNode* n,
+ double& u,
+ const double tol,
+ const bool force=false) const;
/*!
* \brief Return middle UV taking in account surface period
*/
static gp_XY GetMiddleUV(const Handle(Geom_Surface)& surface,
const gp_XY& uv1,
const gp_XY& uv2);
+ /*!
+ * \brief Define a pointer to wrapper over a function of gp_XY class,
+ * suitable to pass as xyFunPtr to applyIn2D().
+ * For exaple gp_XY_FunPtr(Added) defines pointer gp_XY_Added to function
+ * calling gp_XY::Added(gp_XY), which is to be used like following
+ * applyIn2D(surf, uv1, uv2, gp_XY_Added)
+ */
+#define gp_XY_FunPtr(meth) \
+ static gp_XY __gpXY_##meth (const gp_XY& uv1, const gp_XY& uv2) { return uv1.meth( uv2 ); } \
+ static xyFunPtr gp_XY_##meth = & __gpXY_##meth
+
+ /*!
+ * \brief Perform given operation on two 2d points in parameric space of given surface.
+ * It takes into account period of the surface. Use gp_XY_FunPtr macro
+ * to easily define pointer to function of gp_XY class.
+ */
+ static gp_XY applyIn2D(const Handle(Geom_Surface)& surface,
+ const gp_XY& uv1,
+ const gp_XY& uv2,
+ xyFunPtr fun,
+ const bool resultInPeriod=true);
+
/*!
* \brief Check if inFaceNode argument is necessary for call GetNodeUV(F,..)
* \retval bool - return true if the face is periodic
*
- * if F is Null, answer about subshape set through IsQuadraticSubMesh() or
+ * If F is Null, answer about subshape set through IsQuadraticSubMesh() or
* SetSubShape()
*/
bool GetNodeUVneedInFaceNode(const TopoDS_Face& F = TopoDS_Face()) const;
+ /*!
+ * \brief Return projector intitialized by given face without location, which is returned
+ */
+ GeomAPI_ProjectPointOnSurf& GetProjector(const TopoDS_Face& F,
+ TopLoc_Location& loc,
+ double tol=0 ) const;
+
/*!
* \brief Check if shape is a degenerated edge or it's vertex
* \param subShape - edge or vertex index in SMESHDS
*/
bool IsDegenShape(const int subShape) const
{ return myDegenShapeIds.find( subShape ) != myDegenShapeIds.end(); }
+ /*!
+ * \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape()
+ * has a degenerated edges
+ * \retval bool - true if it has
+ */
+ bool HasDegeneratedEdges() const { return !myDegenShapeIds.empty(); }
+
/*!
* \brief Check if shape is a seam edge or it's vertex
* \param subShape - edge or vertex index in SMESHDS
*/
double GetOtherParam(const double param) const;
- /**
- * Special function for search or creation medium node
+ /*!
+ * \brief Return existing or create new medium nodes between given ones
+ * \param force3d - true means node creation at the middle between the
+ * two given nodes, else node position is found on its
+ * supporting geometrical shape, if any.
*/
const SMDS_MeshNode* GetMediumNode(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const bool force3d);
/*!
- * Auxilary function for filling myTLinkNodeMap
+ * \brief Add a link in my data structure
*/
void AddTLinkNode(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n12);
- /**
- * Auxilary function for filling myTLinkNodeMap
+ /*!
+ * \brief Add many links in my data structure
*/
void AddTLinkNodeMap(const TLinkNodeMap& aMap)
{ myTLinkNodeMap.insert(aMap.begin(), aMap.end()); }
enum MType{ LINEAR, QUADRATIC, COMP };
MType IsQuadraticMesh();
+ virtual ~SMESH_MesherHelper();
+
protected:
/*!
std::set< int > myDegenShapeIds;
std::set< int > mySeamShapeIds;
- double myPar1, myPar2; // bounds of a closed periodic surface
- int myParIndex; // bounds' index (1-U, 2-V)
+ double myPar1[2], myPar2[2]; // U and V bounds of a closed periodic surface
+ int myParIndex; // bounds' index (1-U, 2-V, 3-both)
+
+ typedef std::map< int, GeomAPI_ProjectPointOnSurf* > TID2Projector;
+ TID2Projector myFace2Projector;
TopoDS_Shape myShape;
SMESH_Mesh* myMesh;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_Octree : global Octree implementation
-//
// File : SMESH_Octree.cxx
// Created : Tue Jan 16 16:00:00 2007
// Author : Nicolas Geimer & Aurélien Motteux(OCC)
// Module : SMESH
-
+//
#include "SMESH_Octree.hxx"
//===========================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_Octree : global Octree implementation
-//
// File : SMESH_Octree.hxx
// Created : Tue Jan 16 16:00:00 2007
// Author : Nicolas Geimer & Aurélien Motteux (OCC)
// Module : SMESH
-
+//
#ifndef _SMESH_OCTREE_HXX_
#define _SMESH_OCTREE_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_OctreeNode : Octree with Nodes set
// inherites global class SMESH_Octree
-//
// File : SMESH_OctreeNode.cxx
// Created : Tue Jan 16 16:00:00 2007
// Author : Nicolas Geimer & Aurélien Motteux (OCC)
// Module : SMESH
-
+//
#include "SMESH_OctreeNode.hxx"
#include "SMDS_MeshNode.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_OctreeNode : Octree with Nodes set
// inherites global class SMESH_Octree
-//
// File : SMESH_OctreeNode.hxx
// Created : Tue Jan 16 16:00:00 2007
// Author : Nicolas Geimer & Aurélien Motteux (OCC)
// Module : SMESH
-
+//
#ifndef _SMESH_OCTREENODE_HXX_
#define _SMESH_OCTREENODE_HXX_
public:
// Constructor
- SMESH_OctreeNode (const std::set<const SMDS_MeshNode*>& theNodes, const int maxLevel = -1,
+ SMESH_OctreeNode (const std::set<const SMDS_MeshNode*>& theNodes, const int maxLevel = 8,
const int maxNbNodes = 5, const double minBoxSize = 0.);
//=============================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_Pattern.hxx
// Created : Mon Aug 2 10:30:00 2004
// Author : Edward AGAPOV (eap)
point->myXYZ.Z());
nodesVector [ pIndex ] = node;
- if ( true /*subMeshDS*/ ) {
+ if ( !S.IsNull() /*subMeshDS*/ ) {
// !!!!! do not merge new nodes with ones existing on submeshes (see method comment)
switch ( S.ShapeType() ) {
case TopAbs_VERTEX: {
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_Pattern.hxx
// Created : Mon Aug 2 10:30:00 2004
// Author : Edward AGAPOV (eap)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_SMESH.hxx
// Author : Alexander A. BORODIN
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SMESH_SequenceOfElemPtr.hxx
// Created: 26.09.05 17:41:10
// Author: Sergey KUUL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SMESH_SequenceOfNode.hxx
// Created: 11.11.05 10:00:04
// Author: Sergey KUUL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_subMesh.cxx
// Author : Paul RASCLE, EDF
#include "utilities.h"
#include "OpUtil.hxx"
+#include "Basics_Utils.hxx"
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <Standard_OutOfMemory.hxx>
#include <Standard_ErrorHandler.hxx>
+#include <numeric>
+
using namespace std;
//=============================================================================
algo->InitComputeError();
MemoryReserve aMemoryReserve;
SMDS_Mesh::CheckMemory();
+ Kernel_Utils::Localizer loc;
if ( !_father->HasShapeToMesh() ) // no shape
{
SMESH_MesherHelper helper( *_father );
bool ret = true;
if (_subShape.ShapeType() == TopAbs_VERTEX) {
- std::vector<int> aVec(SMDSEntity_Last);
- for(int i= SMDSEntity_Node; i < SMDSEntity_Last; i++)
- aVec[i] = 0;
+ vector<int> aVec(SMDSEntity_Last,0);
aVec[SMDSEntity_Node] = 1;
- aResMap.insert(std::make_pair(this,aVec));
+ aResMap.insert(make_pair(this,aVec));
return ret;
}
SMESH_Hypothesis::Hypothesis_Status hyp_status;
algo = gen->GetAlgo((*_father), _subShape);
- if(algo) {
+ if(algo && !aResMap.count(this) )
+ {
ret = algo->CheckHypothesis((*_father), _subShape, hyp_status);
if (!ret) return false;
- TopoDS_Shape shape = _subShape;
-
+ if (_father->HasShapeToMesh() && algo->NeedDescretBoundary())
+ {
+ // check submeshes needed
+ bool subMeshEvaluated = true;
+ int dimToCheck = SMESH_Gen::GetShapeDim( _subShape ) - 1;
+ SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,/*complexShapeFirst=*/true);
+ while ( smIt->more() && subMeshEvaluated )
+ {
+ SMESH_subMesh* sm = smIt->next();
+ int dim = SMESH_Gen::GetShapeDim( sm->GetSubShape() );
+ if (dim < dimToCheck) break; // the rest subMeshes are all of less dimension
+ const vector<int> & nbs = aResMap[ sm ];
+ subMeshEvaluated = (std::accumulate( nbs.begin(), nbs.end(), 0 ) > 0 );
+ }
+ if ( !subMeshEvaluated )
+ return false;
+ }
_computeError = SMESH_ComputeError::New(COMPERR_OK,"",algo);
+ ret = algo->Evaluate((*_father), _subShape, aResMap);
- ret = algo->Evaluate((*_father), shape, aResMap);
+ aResMap.insert( make_pair( this,vector<int>(0)));
}
return ret;
( new _Iterator( new SMDS_mapIterator<TMap>( DependsOn() ), prepend, append ));
}
}
+
+//================================================================================
+/*!
+ * \brief Find common submeshes (based on shared subshapes with other
+ * \param theOther submesh to check
+ * \param theSetOfCommon set of common submesh
+ */
+//================================================================================
+
+bool SMESH_subMesh::FindIntersection(const SMESH_subMesh* theOther,
+ std::set<const SMESH_subMesh*>& theSetOfCommon ) const
+{
+ int oldNb = theSetOfCommon.size();
+ // check main submeshes
+ const map <int, SMESH_subMesh*>::const_iterator otherEnd = theOther->_mapDepend.end();
+ if ( theOther->_mapDepend.find(this->GetId()) != otherEnd )
+ theSetOfCommon.insert( this );
+ if ( _mapDepend.find(theOther->GetId()) != _mapDepend.end() )
+ theSetOfCommon.insert( theOther );
+ // check common submeshes
+ map <int, SMESH_subMesh*>::const_iterator mapIt = _mapDepend.begin();
+ for( ; mapIt != _mapDepend.end(); mapIt++ )
+ if ( theOther->_mapDepend.find((*mapIt).first) != otherEnd )
+ theSetOfCommon.insert( (*mapIt).second );
+ return oldNb < theSetOfCommon.size();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_subMesh.hxx
// Author : Paul RASCLE, EDF
void SetIsAlwaysComputed(bool isAlCo);
bool IsAlwaysComputed() { return _alwaysComputed; }
+
+ /*!
+ * \brief Find common submeshes (based on shared subshapes with other
+ * \param theOther submesh to check
+ * \param theCommonIds set of common submesh IDs
+ * NOTE: this method does not cleat set before collect common IDs
+ */
+ bool FindIntersection( const SMESH_subMesh * theOther,
+ std::set<const SMESH_subMesh*>& theSetOfCommon ) const;
protected:
// ==================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : SMESH_subMeshEventListener.hxx
// Created : Mon Nov 13 10:45:49 2006
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# GEOM GEOMClient : tool to transfer BREP files from GEOM server to GEOM client
# File : Makefile.in
# Author : Pavel TELKOV (OCC)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File :
// Author :
// Module :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHClient : tool to update client mesh structure by mesh from server
// File : SMESH_Client.cxx
// Author : Pavel TELKOV
//function : AddNodesWithID
//=======================================================================
inline void AddNodesWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::double_array& aCoords = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
EXCEPTION(runtime_error,"AddNodesWithID - 3*aNbElems != aCoords.length()");
for(CORBA::Long aCoordId = 0; anElemId < aNbElems; anElemId++, aCoordId+=3){
SMDS_MeshElement* anElem = theMesh->AddNodeWithID(aCoords[aCoordId],
- aCoords[aCoordId+1],
- aCoords[aCoordId+2],
- anIndexes[anElemId]);
+ aCoords[aCoordId+1],
+ aCoords[aCoordId+2],
+ anIndexes[anElemId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddNodeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddNodeWithID for ID = "<<anElemId);
}
}
SMDS_MeshElement* anElem = theMesh->Add0DElementWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId]);
if (!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot Add0DElementWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot Add0DElementWithID for ID = "<<anElemId);
}
}
//function : AddEdgesWithID
//=======================================================================
inline void AddEdgesWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
EXCEPTION(runtime_error,"AddEdgeWithID - 3*aNbElems != aCoords.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=3){
SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddEdgeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddEdgeWithID for ID = "<<anElemId);
}
}
//function : AddTriasWithID
//=======================================================================
inline void AddTriasWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
EXCEPTION(runtime_error,"AddTriasWithID - 4*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){
SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
}
}
//function : AddQuadsWithID
//=======================================================================
inline void AddQuadsWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
EXCEPTION(runtime_error,"AddQuadsWithID - 4*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){
SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
}
}
SMDS_MeshElement* anElem = theMesh->AddPolygonalFaceWithID(nodes_ids, aFaceId);
if (!anElem)
- EXCEPTION(runtime_error, "SMDS_Mesh::FindElement - cannot AddPolygonalFaceWithID for ID = "
+ EXCEPTION(runtime_error, "SMDS_Mesh::FindElement - cannot AddPolygonalFaceWithID for ID = "
<< anElemId);
}
}
//function : AddTetrasWithID
//=======================================================================
inline void AddTetrasWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
EXCEPTION(runtime_error,"AddTetrasWithID - 5*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
//function : AddPiramidsWithID
//=======================================================================
inline void AddPiramidsWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
EXCEPTION(runtime_error,"AddPiramidsWithID - 6*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=6){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId+5],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
//function : AddPrismsWithID
//=======================================================================
inline void AddPrismsWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
EXCEPTION(runtime_error,"AddPrismsWithID - 7*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=7){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId+5],
- anIndexes[anIndexId+6],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
//function : AddHexasWithID
//=======================================================================
inline void AddHexasWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
EXCEPTION(runtime_error,"AddHexasWithID - 9*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=9){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId+5],
- anIndexes[anIndexId+6],
- anIndexes[anIndexId+7],
- anIndexes[anIndexId+8],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId+7],
+ anIndexes[anIndexId+8],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
SMDS_MeshElement* anElem =
theMesh->AddPolyhedralVolumeWithID(nodes_ids, quantities, aFaceId);
if (!anElem)
- EXCEPTION(runtime_error, "SMDS_Mesh::FindElement - cannot AddPolyhedralVolumeWithID for ID = "
+ EXCEPTION(runtime_error, "SMDS_Mesh::FindElement - cannot AddPolyhedralVolumeWithID for ID = "
<< anElemId);
}
}
EXCEPTION(runtime_error,"AddQuadEdgeWithID - 4*aNbElems != aCoords.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){
SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddEdgeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddEdgeWithID for ID = "<<anElemId);
}
}
EXCEPTION(runtime_error,"AddQuadTriasWithID - 7*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=7){
SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId+5],
- anIndexes[anIndexId+6],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
}
}
EXCEPTION(runtime_error,"AddQuadQuadsWithID - 9*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=9){
SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId+5],
- anIndexes[anIndexId+6],
- anIndexes[anIndexId+7],
- anIndexes[anIndexId+8],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId+7],
+ anIndexes[anIndexId+8],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
}
}
EXCEPTION(runtime_error,"AddQuadTetrasWithID - 11*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=11){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId+5],
- anIndexes[anIndexId+6],
- anIndexes[anIndexId+7],
- anIndexes[anIndexId+8],
- anIndexes[anIndexId+9],
- anIndexes[anIndexId+10],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId+7],
+ anIndexes[anIndexId+8],
+ anIndexes[anIndexId+9],
+ anIndexes[anIndexId+10],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
EXCEPTION(runtime_error,"AddQuadPiramidsWithID - 14*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=14){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId+5],
- anIndexes[anIndexId+6],
- anIndexes[anIndexId+7],
- anIndexes[anIndexId+8],
- anIndexes[anIndexId+9],
- anIndexes[anIndexId+10],
- anIndexes[anIndexId+11],
- anIndexes[anIndexId+12],
- anIndexes[anIndexId+13],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId+7],
+ anIndexes[anIndexId+8],
+ anIndexes[anIndexId+9],
+ anIndexes[anIndexId+10],
+ anIndexes[anIndexId+11],
+ anIndexes[anIndexId+12],
+ anIndexes[anIndexId+13],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
EXCEPTION(runtime_error,"AddQuadPentasWithID - 16*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=16){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId+5],
- anIndexes[anIndexId+6],
- anIndexes[anIndexId+7],
- anIndexes[anIndexId+8],
- anIndexes[anIndexId+9],
- anIndexes[anIndexId+10],
- anIndexes[anIndexId+11],
- anIndexes[anIndexId+12],
- anIndexes[anIndexId+13],
- anIndexes[anIndexId+14],
- anIndexes[anIndexId+15],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId+7],
+ anIndexes[anIndexId+8],
+ anIndexes[anIndexId+9],
+ anIndexes[anIndexId+10],
+ anIndexes[anIndexId+11],
+ anIndexes[anIndexId+12],
+ anIndexes[anIndexId+13],
+ anIndexes[anIndexId+14],
+ anIndexes[anIndexId+15],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
EXCEPTION(runtime_error,"AddQuadHexasWithID - 21*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=21){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId+5],
- anIndexes[anIndexId+6],
- anIndexes[anIndexId+7],
- anIndexes[anIndexId+8],
- anIndexes[anIndexId+9],
- anIndexes[anIndexId+10],
- anIndexes[anIndexId+11],
- anIndexes[anIndexId+12],
- anIndexes[anIndexId+13],
- anIndexes[anIndexId+14],
- anIndexes[anIndexId+15],
- anIndexes[anIndexId+16],
- anIndexes[anIndexId+17],
- anIndexes[anIndexId+18],
- anIndexes[anIndexId+19],
- anIndexes[anIndexId+20],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId+7],
+ anIndexes[anIndexId+8],
+ anIndexes[anIndexId+9],
+ anIndexes[anIndexId+10],
+ anIndexes[anIndexId+11],
+ anIndexes[anIndexId+12],
+ anIndexes[anIndexId+13],
+ anIndexes[anIndexId+14],
+ anIndexes[anIndexId+15],
+ anIndexes[anIndexId+16],
+ anIndexes[anIndexId+17],
+ anIndexes[anIndexId+18],
+ anIndexes[anIndexId+19],
+ anIndexes[anIndexId+20],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
//=======================================================================
SMESH::SMESH_Gen_var
SMESH_Client::GetSMESHGen(CORBA::ORB_ptr theORB,
- CORBA::Boolean& theIsEmbeddedMode)
+ CORBA::Boolean& theIsEmbeddedMode)
{
static SMESH::SMESH_Gen_var aMeshGen;
// purpose :
//=======================================================================
SMESH_Client::SMESH_Client(CORBA::ORB_ptr theORB,
- SMESH::SMESH_Mesh_ptr theMesh):
+ SMESH::SMESH_Mesh_ptr theMesh):
myMeshServer(SMESH::SMESH_Mesh::_duplicate(theMesh)),
mySMESHDSMesh(NULL),
mySMDSMesh(NULL)
{
for ( CORBA::Long anId = 0; anId < aLength; anId++)
{
- const SMESH::double_array& aCoords = aSeq[anId].coords;
- const SMESH::long_array& anIndexes = aSeq[anId].indexes;
- CORBA::Long anElemId = 0, aNbElems = aSeq[anId].number;
- CORBA::Long aCommand = aSeq[anId].commandType;
+ const SMESH::double_array& aCoords = aSeq[anId].coords;
+ const SMESH::long_array& anIndexes = aSeq[anId].indexes;
+ CORBA::Long anElemId = 0, aNbElems = aSeq[anId].number;
+ CORBA::Long aCommand = aSeq[anId].commandType;
- switch(aCommand)
+ switch(aCommand)
{
- case SMESH::ADD_NODE : AddNodesWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_NODE : AddNodesWithID ( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_ELEM0D : Add0DElementsWithID ( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_EDGE : AddEdgesWithID ( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_TRIANGLE : AddTriasWithID ( mySMDSMesh, aSeq, anId ); break;
break;
default:;
- }
+ }
}
}
catch ( SALOME::SALOME_Exception& exc )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHClient : tool to update client mesh structure by mesh from server
// File : SMESH_Client.hxx
// Author : Pavel TELKOV
static
SMESH::SMESH_Gen_var
GetSMESHGen(CORBA::ORB_ptr theORB,
- CORBA::Boolean& theIsEmbeddedMode);
+ CORBA::Boolean& theIsEmbeddedMode);
SMESH_Client(CORBA::ORB_ptr theORB,
- SMESH::SMESH_Mesh_ptr theMesh);
+ SMESH::SMESH_Mesh_ptr theMesh);
~SMESH_Client();
bool
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH SMESHDS : management of mesh data and SMESH document
# File : Makefile.in
# Author : Patrick GOLDBRONN (CEA)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESH_Command.cxx
// Author : Yves FRICAUD, OCC
//=======================================================================
void SMESHDS_Command::AddNode(int NewNodeID, double x, double y, double z)
{
- if (!myType == SMESHDS_AddNode)
- {
- MESSAGE("SMESHDS_Command::AddNode : Bad Type");
- return;
- }
- myIntegers.push_back(NewNodeID);
- myReals.push_back(x);
- myReals.push_back(y);
- myReals.push_back(z);
- myNumber++;
+ if (!myType == SMESHDS_AddNode)
+ {
+ MESSAGE("SMESHDS_Command::AddNode : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewNodeID);
+ myReals.push_back(x);
+ myReals.push_back(y);
+ myReals.push_back(z);
+ myNumber++;
}
//=======================================================================
//=======================================================================
void SMESHDS_Command::MoveNode(int NodeID, double x, double y, double z)
{
- if (!myType == SMESHDS_MoveNode)
- {
- MESSAGE("SMESHDS_Command::MoveNode : Bad Type");
- return;
- }
- myIntegers.push_back(NodeID);
- myReals.push_back(x);
- myReals.push_back(y);
- myReals.push_back(z);
- myNumber++;
+ if (!myType == SMESHDS_MoveNode)
+ {
+ MESSAGE("SMESHDS_Command::MoveNode : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NodeID);
+ myReals.push_back(x);
+ myReals.push_back(y);
+ myReals.push_back(z);
+ myNumber++;
}
//=======================================================================
//=======================================================================
void SMESHDS_Command::AddEdge(int NewEdgeID, int idnode1, int idnode2)
{
- if (!myType == SMESHDS_AddEdge)
- {
- MESSAGE("SMESHDS_Command::AddEdge : Bad Type");
- return;
- }
- myIntegers.push_back(NewEdgeID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myNumber++;
+ if (!myType == SMESHDS_AddEdge)
+ {
+ MESSAGE("SMESHDS_Command::AddEdge : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewEdgeID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myNumber++;
}
//=======================================================================
//purpose :
//=======================================================================
void SMESHDS_Command::AddFace(int NewFaceID,
- int idnode1, int idnode2, int idnode3)
+ int idnode1, int idnode2, int idnode3)
{
- if (!myType == SMESHDS_AddTriangle)
- {
- MESSAGE("SMESHDS_Command::AddFace : Bad Type");
- return;
- }
- myIntegers.push_back(NewFaceID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myIntegers.push_back(idnode3);
- myNumber++;
+ if (!myType == SMESHDS_AddTriangle)
+ {
+ MESSAGE("SMESHDS_Command::AddFace : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewFaceID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myIntegers.push_back(idnode3);
+ myNumber++;
}
//=======================================================================
//purpose :
//=======================================================================
void SMESHDS_Command::AddFace(int NewFaceID,
- int idnode1, int idnode2, int idnode3, int idnode4)
+ int idnode1, int idnode2, int idnode3, int idnode4)
{
- if (!myType == SMESHDS_AddQuadrangle)
- {
- MESSAGE("SMESHDS_Command::AddFace : Bad Type");
- return;
- }
- myIntegers.push_back(NewFaceID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myIntegers.push_back(idnode3);
- myIntegers.push_back(idnode4);
- myNumber++;
+ if (!myType == SMESHDS_AddQuadrangle)
+ {
+ MESSAGE("SMESHDS_Command::AddFace : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewFaceID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myIntegers.push_back(idnode3);
+ myIntegers.push_back(idnode4);
+ myNumber++;
}
//=======================================================================
//purpose :
//=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1, int idnode2, int idnode3, int idnode4)
+ int idnode1, int idnode2, int idnode3, int idnode4)
{
- if (!myType == SMESHDS_AddTetrahedron)
- {
- MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
- return;
- }
- myIntegers.push_back(NewVolID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myIntegers.push_back(idnode3);
- myIntegers.push_back(idnode4);
- myNumber++;
+ if (!myType == SMESHDS_AddTetrahedron)
+ {
+ MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewVolID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myIntegers.push_back(idnode3);
+ myIntegers.push_back(idnode4);
+ myNumber++;
}
//=======================================================================
//purpose :
//=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1, int idnode2, int idnode3, int idnode4, int idnode5)
+ int idnode1, int idnode2, int idnode3, int idnode4, int idnode5)
{
- if (!myType == SMESHDS_AddPyramid)
- {
- MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
- return;
- }
- myIntegers.push_back(NewVolID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myIntegers.push_back(idnode3);
- myIntegers.push_back(idnode4);
- myIntegers.push_back(idnode5);
- myNumber++;
+ if (!myType == SMESHDS_AddPyramid)
+ {
+ MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewVolID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myIntegers.push_back(idnode3);
+ myIntegers.push_back(idnode4);
+ myIntegers.push_back(idnode5);
+ myNumber++;
}
//=======================================================================
//purpose :
//=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1,
- int idnode2, int idnode3, int idnode4, int idnode5, int idnode6)
+ int idnode1,
+ int idnode2, int idnode3, int idnode4, int idnode5, int idnode6)
{
- if (!myType == SMESHDS_AddPrism)
- {
- MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
- return;
- }
- myIntegers.push_back(NewVolID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myIntegers.push_back(idnode3);
- myIntegers.push_back(idnode4);
- myIntegers.push_back(idnode5);
- myIntegers.push_back(idnode6);
- myNumber++;
+ if (!myType == SMESHDS_AddPrism)
+ {
+ MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewVolID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myIntegers.push_back(idnode3);
+ myIntegers.push_back(idnode4);
+ myIntegers.push_back(idnode5);
+ myIntegers.push_back(idnode6);
+ myNumber++;
}
//=======================================================================
//purpose :
//=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1,
- int idnode2,
- int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8)
+ int idnode1,
+ int idnode2,
+ int idnode3,
+ int idnode4, int idnode5, int idnode6, int idnode7, int idnode8)
{
- if (!myType == SMESHDS_AddHexahedron)
- {
- MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
- return;
- }
- myIntegers.push_back(NewVolID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myIntegers.push_back(idnode3);
- myIntegers.push_back(idnode4);
- myIntegers.push_back(idnode5);
- myIntegers.push_back(idnode6);
- myIntegers.push_back(idnode7);
- myIntegers.push_back(idnode8);
- myNumber++;
+ if (!myType == SMESHDS_AddHexahedron)
+ {
+ MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewVolID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myIntegers.push_back(idnode3);
+ myIntegers.push_back(idnode4);
+ myIntegers.push_back(idnode5);
+ myIntegers.push_back(idnode6);
+ myIntegers.push_back(idnode7);
+ myIntegers.push_back(idnode8);
+ myNumber++;
}
//=======================================================================
//=======================================================================
void SMESHDS_Command::RemoveNode(int NodeID)
{
- if (!myType == SMESHDS_RemoveNode)
- {
- MESSAGE("SMESHDS_Command::RemoveNode : Bad Type");
- return;
- }
- myIntegers.push_back(NodeID);
- myNumber++;
+ if (!myType == SMESHDS_RemoveNode)
+ {
+ MESSAGE("SMESHDS_Command::RemoveNode : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NodeID);
+ myNumber++;
}
//=======================================================================
//=======================================================================
void SMESHDS_Command::RemoveElement(int ElementID)
{
- if (!myType == SMESHDS_RemoveElement)
- {
- MESSAGE("SMESHDS_Command::RemoveElement : Bad Type");
- return;
- }
- myIntegers.push_back(ElementID);
- myNumber++;
+ if (!myType == SMESHDS_RemoveElement)
+ {
+ MESSAGE("SMESHDS_Command::RemoveElement : Bad Type");
+ return;
+ }
+ myIntegers.push_back(ElementID);
+ myNumber++;
}
//=======================================================================
//=======================================================================
SMESHDS_CommandType SMESHDS_Command::GetType()
{
- return myType;
+ return myType;
}
//=======================================================================
//=======================================================================
int SMESHDS_Command::GetNumber()
{
- return myNumber;
+ return myNumber;
}
//=======================================================================
//=======================================================================
const list < int >&SMESHDS_Command::GetIndexes()
{
- return myIntegers;
+ return myIntegers;
}
//=======================================================================
//=======================================================================
const list < double >&SMESHDS_Command::GetCoords()
{
- return myReals;
+ return myReals;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESHDS_Command.hxx
// Module : SMESH
{
public:
- SMESHDS_Command(const SMESHDS_CommandType aType);
- void AddNode(int NewNodeID, double x, double y, double z);
- void Add0DElement(int New0DElementID, int idnode);
- void AddEdge(int NewEdgeID, int idnode1, int idnode2);
- void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
- void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
+ SMESHDS_Command(const SMESHDS_CommandType aType);
+ void AddNode(int NewNodeID, double x, double y, double z);
+ void Add0DElement(int New0DElementID, int idnode);
+ void AddEdge(int NewEdgeID, int idnode1, int idnode2);
+ void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
+ void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
+ int idnode4);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5, int idnode6);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
void AddPolygonalFace (const int ElementID,
std::vector<int> nodes_ids);
void AddPolyhedralVolume (const int ElementID,
std::vector<int> nodes_ids,
std::vector<int> quantities);
// special methods for quadratic elements
- void AddEdge(int NewEdgeID, int n1, int n2, int n12);
+ void AddEdge(int NewEdgeID, int n1, int n2, int n12);
void AddFace(int NewFaceID, int n1, int n2, int n3,
int n12, int n23, int n31);
void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
int n56, int n67, int n78, int n85,
int n15, int n26, int n37, int n48);
- void MoveNode(int NewNodeID, double x, double y, double z);
- void RemoveNode(int NodeID);
- void RemoveElement(int ElementID);
- void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
- void ChangePolyhedronNodes(const int ElementID,
+ void MoveNode(int NewNodeID, double x, double y, double z);
+ void RemoveNode(int NodeID);
+ void RemoveElement(int ElementID);
+ void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
+ void ChangePolyhedronNodes(const int ElementID,
std::vector<int> nodes_ids,
std::vector<int> quantities);
- void Renumber (const bool isNodes, const int startID, const int deltaID);
- SMESHDS_CommandType GetType();
- int GetNumber();
- const std::list<int> & GetIndexes();
- const std::list<double> & GetCoords();
- ~SMESHDS_Command();
+ void Renumber (const bool isNodes, const int startID, const int deltaID);
+ SMESHDS_CommandType GetType();
+ int GetNumber();
+ const std::list<int> & GetIndexes();
+ const std::list<double> & GetCoords();
+ ~SMESHDS_Command();
private:
- SMESHDS_CommandType myType;
- int myNumber;
- std::list<double> myReals;
- std::list<int> myIntegers;
+ SMESHDS_CommandType myType;
+ int myNumber;
+ std::list<double> myReals;
+ std::list<int> myIntegers;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESHDS_CommandType.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SMESHDS_DataMapOfShape.hxx
// Created: 20.09.05 09:51:12
// Author: Alexander BORODIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESHDS_Document.cxx
// Author : Yves FRICAUD, OCC
//=======================================================================
SMESHDS_Mesh *SMESHDS_Document::GetMesh(int MeshID)
{
- map<int,SMESHDS_Mesh*>::iterator it=myMeshes.find(MeshID);
- if (it==myMeshes.end())
- {
- MESSAGE("SMESHDS_Document::GetMesh : ID not found");
- return NULL;
- }
- else return (*it).second;
+ map<int,SMESHDS_Mesh*>::iterator it=myMeshes.find(MeshID);
+ if (it==myMeshes.end())
+ {
+ MESSAGE("SMESHDS_Document::GetMesh : ID not found");
+ return NULL;
+ }
+ else return (*it).second;
}
//=======================================================================
//=======================================================================
void SMESHDS_Document::RemoveMesh(int MeshID)
{
- map<int,SMESHDS_Mesh*>::iterator it=myMeshes.find(MeshID);
- if (it==myMeshes.end())
- MESSAGE("SMESHDS_Document::RemoveMesh : ID not found");
- myMeshes.erase(it);
+ map<int,SMESHDS_Mesh*>::iterator it=myMeshes.find(MeshID);
+ if (it==myMeshes.end())
+ MESSAGE("SMESHDS_Document::RemoveMesh : ID not found");
+ myMeshes.erase(it);
}
//=======================================================================
//=======================================================================
void SMESHDS_Document::AddHypothesis(SMESHDS_Hypothesis * H)
{
- myHypothesis[H->GetID()]=H;
+ myHypothesis[H->GetID()]=H;
}
//=======================================================================
//=======================================================================
SMESHDS_Hypothesis * SMESHDS_Document::GetHypothesis(int HypID)
{
- map<int,SMESHDS_Hypothesis*>::iterator it=myHypothesis.find(HypID);
- if (it==myHypothesis.end())
- {
- MESSAGE("SMESHDS_Document::GetHypothesis : ID not found");
- return NULL;
- }
- else return (*it).second;
+ map<int,SMESHDS_Hypothesis*>::iterator it=myHypothesis.find(HypID);
+ if (it==myHypothesis.end())
+ {
+ MESSAGE("SMESHDS_Document::GetHypothesis : ID not found");
+ return NULL;
+ }
+ else return (*it).second;
}
//=======================================================================
//=======================================================================
void SMESHDS_Document::RemoveHypothesis(int HypID)
{
- map<int,SMESHDS_Hypothesis*>::iterator it=myHypothesis.find(HypID);
- if (it==myHypothesis.end())
- MESSAGE("SMESHDS_Document::RemoveHypothesis : ID not found");
- myHypothesis.erase(it);
+ map<int,SMESHDS_Hypothesis*>::iterator it=myHypothesis.find(HypID);
+ if (it==myHypothesis.end())
+ MESSAGE("SMESHDS_Document::RemoveHypothesis : ID not found");
+ myHypothesis.erase(it);
}
//=======================================================================
//=======================================================================
int SMESHDS_Document::NbMeshes()
{
- return myMeshes.size();
+ return myMeshes.size();
}
//=======================================================================
//=======================================================================
int SMESHDS_Document::NbHypothesis()
{
- return myHypothesis.size();
+ return myHypothesis.size();
}
//=======================================================================
//=======================================================================
void SMESHDS_Document::InitMeshesIterator()
{
- myMeshesIt=myMeshes.begin();
+ myMeshesIt=myMeshes.begin();
}
//=======================================================================
//=======================================================================
SMESHDS_Mesh * SMESHDS_Document::NextMesh()
{
- SMESHDS_Mesh * toReturn=(*myMeshesIt).second;
- myMeshesIt++;
- return toReturn;
+ SMESHDS_Mesh * toReturn=(*myMeshesIt).second;
+ myMeshesIt++;
+ return toReturn;
}
//=======================================================================
//=======================================================================
bool SMESHDS_Document::MoreMesh()
{
- return myMeshesIt!=myMeshes.end();
+ return myMeshesIt!=myMeshes.end();
}
//=======================================================================
//=======================================================================
void SMESHDS_Document::InitHypothesisIterator()
{
- myHypothesisIt=myHypothesis.begin();
+ myHypothesisIt=myHypothesis.begin();
}
//=======================================================================
//=======================================================================
SMESHDS_Hypothesis * SMESHDS_Document::NextHypothesis()
{
- SMESHDS_Hypothesis * toReturn=(*myHypothesisIt).second;
- myHypothesisIt++;
- return toReturn;
+ SMESHDS_Hypothesis * toReturn=(*myHypothesisIt).second;
+ myHypothesisIt++;
+ return toReturn;
}
//=======================================================================
//=======================================================================
bool SMESHDS_Document::MoreHypothesis()
{
- return myHypothesisIt!=myHypothesis.end();
+ return myHypothesisIt!=myHypothesis.end();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESHDS_Document.hxx
// Module : SMESH
class SMESHDS_EXPORT SMESHDS_Document
{
public:
- SMESHDS_Document(int UserID);
- int NewMesh(bool theIsEmbeddedMode);
- void RemoveMesh(int MeshID);
- SMESHDS_Mesh * GetMesh(int MeshID);
- void AddHypothesis(SMESHDS_Hypothesis * H);
- void RemoveHypothesis(int HypID);
- SMESHDS_Hypothesis * GetHypothesis(int HypID);
- int NbMeshes();
- int NbHypothesis();
- void InitMeshesIterator();
- SMESHDS_Mesh * NextMesh();
- bool MoreMesh();
- void InitHypothesisIterator();
- SMESHDS_Hypothesis * NextHypothesis();
- bool MoreHypothesis();
- ~SMESHDS_Document();
+ SMESHDS_Document(int UserID);
+ int NewMesh(bool theIsEmbeddedMode);
+ void RemoveMesh(int MeshID);
+ SMESHDS_Mesh * GetMesh(int MeshID);
+ void AddHypothesis(SMESHDS_Hypothesis * H);
+ void RemoveHypothesis(int HypID);
+ SMESHDS_Hypothesis * GetHypothesis(int HypID);
+ int NbMeshes();
+ int NbHypothesis();
+ void InitMeshesIterator();
+ SMESHDS_Mesh * NextMesh();
+ bool MoreMesh();
+ void InitHypothesisIterator();
+ SMESHDS_Hypothesis * NextHypothesis();
+ bool MoreHypothesis();
+ ~SMESHDS_Document();
private:
- int myUserID;
- std::map<int,SMESHDS_Mesh*> myMeshes;
- std::map<int,SMESHDS_Hypothesis*> myHypothesis;
- std::map<int,SMESHDS_Mesh*>::iterator myMeshesIt;
- std::map<int,SMESHDS_Hypothesis*>::iterator myHypothesisIt;
+ int myUserID;
+ std::map<int,SMESHDS_Mesh*> myMeshes;
+ std::map<int,SMESHDS_Hypothesis*> myHypothesis;
+ std::map<int,SMESHDS_Mesh*>::iterator myMeshesIt;
+ std::map<int,SMESHDS_Hypothesis*>::iterator myHypothesisIt;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : idl implementation based on 'SMESH' unit's classes
// File : SMESHDS_Group.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESHDS_Group.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : idl implementation based on 'SMESH' unit's classes
// File : SMESHDS_Group.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESHDS_Group.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : idl implementation based on 'SMESH' unit's classes
// File : SMESHDS_GroupOnGeom.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESHDS_GroupOnGeom.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESHDS_Hypothesis.cxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-// $Header$
//
#include "SMESHDS_Hypothesis.hxx"
+#include <sstream>
+
using namespace std;
//=============================================================================
SMESHDS_Hypothesis::SMESHDS_Hypothesis(int hypId)
{
-// MESSAGE("SMESHDS_Hypothesis::SMESHDS_Hypothesis");
_hypId = hypId;
_name = "generic";
-// SCRUTE(_name);
-// SCRUTE(_hypId);
}
//=============================================================================
SMESHDS_Hypothesis::~SMESHDS_Hypothesis()
{
-// MESSAGE("SMESHDS_Hypothesis::~SMESHDS_Hypothesis");
}
//=============================================================================
const char* SMESHDS_Hypothesis::GetName() const
{
-// MESSAGE("SMESHDS_Hypothesis::GetName");
-// SCRUTE(_name);
-// SCRUTE(&_name);
return _name.c_str();
}
int SMESHDS_Hypothesis::GetID() const
{
-// MESSAGE("SMESHDS_Hypothesis::GetId");
-// SCRUTE(_hypId);
return _hypId;
}
int SMESHDS_Hypothesis::GetType() const
{
-// MESSAGE("SMESHDS_Hypothesis::GetType");
-// SCRUTE(_type);
return _type;
}
+//=============================================================================
+/*!
+ * Equality
+ */
+//=============================================================================
+
+bool SMESHDS_Hypothesis::operator==(const SMESHDS_Hypothesis& other) const
+{
+ if ( this == &other )
+ return true;
+ if ( _name != other._name )
+ return false;
+ ostringstream mySave, otherSave;
+ ((SMESHDS_Hypothesis*)this )->SaveTo(mySave);
+ ((SMESHDS_Hypothesis*)&other)->SaveTo(otherSave);
+ return mySave.str() == otherSave.str();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESHDS_Hypothesis.hxx
// Author : Paul RASCLE, EDF
virtual std::ostream & SaveTo(std::ostream & save)=0;
virtual std::istream & LoadFrom(std::istream & load)=0;
+ virtual bool operator==(const SMESHDS_Hypothesis& other) const;
+ bool operator!=(const SMESHDS_Hypothesis& other) const { return !(*this==other); }
+
enum hypothesis_type {PARAM_ALGO, ALGO_0D, ALGO_1D, ALGO_2D, ALGO_3D};
protected:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESH_Mesh.cxx
// Author : Yves FRICAUD, OCC
#include "SMDS_SpacePosition.hxx"
#include "SMESHDS_GroupOnGeom.hxx"
-#include <TopExp_Explorer.hxx>
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_OutOfRange.hxx>
#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
#include <TopoDS_Iterator.hxx>
#include "utilities.h"
//=======================================================================
const TopoDS_Shape& SMESHDS_Mesh::IndexToShape(int ShapeIndex) const
{
- return myIndexToShape.FindKey(ShapeIndex);
+ try
+ {
+ return myIndexToShape.FindKey(ShapeIndex);
+ }
+ catch ( Standard_OutOfRange )
+ {
+ }
+ static TopoDS_Shape nullShape;
+ return nullShape;
}
//=======================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESHDS_Mesh.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESH_Script.cxx
// Author : Yves FRICAUD, OCC
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESHDS_Script.hxx
// Module : SMESH
class SMESHDS_EXPORT SMESHDS_Script
{
public:
- SMESHDS_Script(bool theIsEmbeddedMode);
- ~SMESHDS_Script();
+ SMESHDS_Script(bool theIsEmbeddedMode);
+ ~SMESHDS_Script();
void SetModified(bool theModified);
bool IsModified();
- void AddNode(int NewNodeID, double x, double y, double z);
- void Add0DElement(int New0DElementID, int idnode);
- void AddEdge(int NewEdgeID, int idnode1, int idnode2);
- void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
- void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
+ void AddNode(int NewNodeID, double x, double y, double z);
+ void Add0DElement(int New0DElementID, int idnode);
+ void AddEdge(int NewEdgeID, int idnode1, int idnode2);
+ void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
+ void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
+ int idnode4);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5, int idnode6);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
void AddPolygonalFace (const int NewFaceID,
std::vector<int> nodes_ids);
- void AddPolyhedralVolume (const int NewVolID,
+ void AddPolyhedralVolume (const int NewVolID,
std::vector<int> nodes_ids,
std::vector<int> quantities);
// special methods for quadratic elements
- void AddEdge(int NewEdgeID, int n1, int n2, int n12);
+ void AddEdge(int NewEdgeID, int n1, int n2, int n12);
void AddFace(int NewFaceID, int n1, int n2, int n3,
int n12, int n23, int n31);
void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
int n56, int n67, int n78, int n85,
int n15, int n26, int n37, int n48);
void MoveNode(int NewNodeID, double x, double y, double z);
- void RemoveNode(int NodeID);
- void RemoveElement(int ElementID);
- void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
- void ChangePolyhedronNodes(const int ElementID,
+ void RemoveNode(int NodeID);
+ void RemoveElement(int ElementID);
+ void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
+ void ChangePolyhedronNodes(const int ElementID,
std::vector<int> nodes_ids,
std::vector<int> quantities);
- void Renumber (const bool isNodes, const int startID, const int deltaID);
- void ClearMesh();
- void Clear();
- const std::list<SMESHDS_Command*> & GetCommands();
+ void Renumber (const bool isNodes, const int startID, const int deltaID);
+ void ClearMesh();
+ void Clear();
+ const std::list<SMESHDS_Command*> & GetCommands();
private:
- SMESHDS_Command* getCommand(const SMESHDS_CommandType aType);
+ SMESHDS_Command* getCommand(const SMESHDS_CommandType aType);
- std::list<SMESHDS_Command*> myCommands;
+ std::list<SMESHDS_Command*> myCommands;
bool myIsEmbeddedMode;
bool myIsModified;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESH_SubMesh.cxx
// Author : Yves FRICAUD, OCC
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHDS : management of mesh data and SMESH document
// File : SMESHDS_SubMesh.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_SMESHDS.hxx
// Author : Alexander A. BORODIN
// Module : SMESH
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH SMESHFiltersSelection : filter selector for viewer
# File : Makefile.in
# Author : Patrick GOLDBRONN (CEA)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_LogicalFilter.cxx
// Module : SMESH
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_LogicalFilter.hxx
// Module : SMESH
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_NumberFilter.cxx
// Module : SMESH
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_NumberFilter.hxx
// Module : SMESH
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_Type.h
// Created : Mon Jun 03 15:14:15 2002
// Author : Nicolas REJNERI
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SMESH_TypeFilter.hxx"
#include <SUIT_Session.h>
switch (myType)
{
case HYPOTHESIS:
- {
- if (aLevel == 2 && (objFather->Tag() == SMESH::Tag_HypothesisRoot))
+ {
+ if (aLevel == 2 && (objFather->Tag() == SMESH::Tag_HypothesisRoot))
// hypo definition
- Ok = true;
- else if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_RefOnAppliedHypothesis))
+ Ok = true;
+ else if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_RefOnAppliedHypothesis))
// applied global hypo
- Ok = true;
- else if (aLevel == 5 && (objFather->Tag() == SMESH::Tag_RefOnAppliedHypothesis))
+ Ok = true;
+ else if (aLevel == 5 && (objFather->Tag() == SMESH::Tag_RefOnAppliedHypothesis))
// applied local hypo
- Ok = true;
- break;
- }
+ Ok = true;
+ break;
+ }
case ALGORITHM:
- {
- if (aLevel == 2 && (objFather->Tag() == SMESH::Tag_AlgorithmsRoot))
+ {
+ if (aLevel == 2 && (objFather->Tag() == SMESH::Tag_AlgorithmsRoot))
// algo definition
- Ok = true;
- else if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_RefOnAppliedAlgorithms))
+ Ok = true;
+ else if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_RefOnAppliedAlgorithms))
// applied global algo
- Ok = true;
- else if (aLevel == 5 && (objFather->Tag() == SMESH::Tag_RefOnAppliedAlgorithms))
+ Ok = true;
+ else if (aLevel == 5 && (objFather->Tag() == SMESH::Tag_RefOnAppliedAlgorithms))
// applied local algo
- Ok = true;
- break;
- }
+ Ok = true;
+ break;
+ }
case MESH:
- {
- if (aLevel == 1 && (obj->Tag() >= SMESH::Tag_FirstMeshRoot))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 1 && (obj->Tag() >= SMESH::Tag_FirstMeshRoot))
+ Ok = true;
+ break;
+ }
case SUBMESH:
- {
- // see SMESH_Gen_i.cxx for tag numbers
- if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstSubMesh &&
+ {
+ // see SMESH_Gen_i.cxx for tag numbers
+ if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstSubMesh &&
objFather->Tag() <= SMESH::Tag_LastSubMesh))
- Ok = true;
- break;
- }
+ Ok = true;
+ break;
+ }
case MESHorSUBMESH:
- {
- if (aLevel == 1 && (obj->Tag() >= SMESH::Tag_FirstMeshRoot))
- Ok = true; // mesh
+ {
+ if (aLevel == 1 && (obj->Tag() >= SMESH::Tag_FirstMeshRoot))
+ Ok = true; // mesh
else if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstSubMesh &&
objFather->Tag() <= SMESH::Tag_LastSubMesh))
- Ok = true;
- break;
- }
+ Ok = true;
+ break;
+ }
case SUBMESH_VERTEX: // Label "SubMeshes on vertexes"
- {
- if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnVertex))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnVertex))
+ Ok = true;
+ break;
+ }
case SUBMESH_EDGE:
- {
- if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnEdge))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnEdge))
+ Ok = true;
+ break;
+ }
case SUBMESH_FACE:
- {
- if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnFace))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnFace))
+ Ok = true;
+ break;
+ }
case SUBMESH_SOLID:
- {
- if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnSolid))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnSolid))
+ Ok = true;
+ break;
+ }
case SUBMESH_COMPOUND:
- {
- if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnCompound))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnCompound))
+ Ok = true;
+ break;
+ }
case GROUP:
- {
- if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstGroup))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstGroup))
+ Ok = true;
+ break;
+ }
}
}
return Ok;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_TypeFilter.hxx
// Module : SMESH
//
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH SMESHGUI : GUI for SMESH component
# File : Makefile.am
# Author : Alexander BORODIN, Open CASCADE S.A.S.
SMESHGUI_RevolutionDlg.h \
SMESHGUI_RotationDlg.h \
SMESHGUI_TranslationDlg.h \
+ SMESHGUI_ScaleDlg.h \
SMESHGUI_SymmetryDlg.h \
SMESHGUI_SewingDlg.h \
SMESHGUI_EditMeshDlg.h \
SMESHGUI_IdValidator.h \
SMESHGUI_MeshInfosBox.h \
SMESHGUI_Make2DFrom3DOp.h \
+ SMESHGUI_FindElemByPointDlg.h \
+ SMESHGUI_MeshOrderDlg.h \
+ SMESHGUI_MeshOrderOp.h \
+ SMESHGUI_FileValidator.h \
SMESH_SMESHGUI.hxx
# Libraries targets
SMESHGUI_RevolutionDlg.cxx \
SMESHGUI_RotationDlg.cxx \
SMESHGUI_TranslationDlg.cxx \
+ SMESHGUI_ScaleDlg.cxx \
SMESHGUI_SymmetryDlg.cxx \
SMESHGUI_SewingDlg.cxx \
SMESHGUI_EditMeshDlg.cxx \
SMESHGUI_GroupOnShapeDlg.cxx \
SMESHGUI_FileInfoDlg.cxx \
SMESHGUI_MeshInfosBox.cxx \
- SMESHGUI_Make2DFrom3DOp.cxx
+ SMESHGUI_Make2DFrom3DOp.cxx \
+ SMESHGUI_FindElemByPointDlg.cxx \
+ SMESHGUI_MeshOrderDlg.cxx \
+ SMESHGUI_MeshOrderOp.cxx \
+ SMESHGUI_FileValidator.cxx
MOC_FILES = \
SMESHGUI_moc.cxx \
SMESHGUI_RevolutionDlg_moc.cxx \
SMESHGUI_RotationDlg_moc.cxx \
SMESHGUI_TranslationDlg_moc.cxx \
+ SMESHGUI_ScaleDlg_moc.cxx \
SMESHGUI_SymmetryDlg_moc.cxx \
SMESHGUI_SewingDlg_moc.cxx \
SMESHGUI_EditMeshDlg_moc.cxx \
SMESHGUI_GroupOnShapeDlg_moc.cxx \
SMESHGUI_FileInfoDlg_moc.cxx \
SMESHGUI_MeshInfosBox_moc.cxx \
- SMESHGUI_Make2DFrom3DOp_moc.cxx
+ SMESHGUI_Make2DFrom3DOp_moc.cxx \
+ SMESHGUI_FindElemByPointDlg_moc.cxx \
+ SMESHGUI_MeshOrderDlg_moc.cxx \
+ SMESHGUI_MeshOrderOp_moc.cxx
nodist_libSMESH_la_SOURCES= \
$(MOC_FILES)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
// SMESH includes
-
+//
#include "SMESHGUI.h"
-#include "SMESHGUI_NodesDlg.h"
-#include "SMESHGUI_TransparencyDlg.h"
-#include "SMESHGUI_ClippingDlg.h"
-#include "SMESHGUI_GroupDlg.h"
-#include "SMESHGUI_RemoveNodesDlg.h"
-#include "SMESHGUI_RemoveElementsDlg.h"
-#include "SMESHGUI_MeshInfosDlg.h"
-#include "SMESHGUI_StandardMeshInfosDlg.h"
-#include "SMESHGUI_WhatIsDlg.h"
-#include "SMESHGUI_Preferences_ColorDlg.h"
-#include "SMESHGUI_Preferences_ScalarBarDlg.h"
-#include "SMESHGUI_Hypotheses.h"
-#include "SMESHGUI_MoveNodesDlg.h"
#include "SMESHGUI_AddMeshElementDlg.h"
#include "SMESHGUI_AddQuadraticElementDlg.h"
+#include "SMESHGUI_BuildCompoundDlg.h"
+#include "SMESHGUI_ClippingDlg.h"
+#include "SMESHGUI_ComputeDlg.h"
+#include "SMESHGUI_ConvToQuadOp.h"
+#include "SMESHGUI_CreatePolyhedralVolumeDlg.h"
+#include "SMESHGUI_DeleteGroupDlg.h"
+#include "SMESHGUI_Displayer.h"
+#include "SMESHGUI_EditMeshDlg.h"
+#include "SMESHGUI_ExtrusionAlongPathDlg.h"
+#include "SMESHGUI_ExtrusionDlg.h"
+#include "SMESHGUI_FileInfoDlg.h"
+#include "SMESHGUI_FileValidator.h"
#include "SMESHGUI_FilterDlg.h"
#include "SMESHGUI_FilterLibraryDlg.h"
-#include "SMESHGUI_SingleEditDlg.h"
-#include "SMESHGUI_MultiEditDlg.h"
-#include "SMESHGUI_GroupOpDlg.h"
+#include "SMESHGUI_FindElemByPointDlg.h"
+#include "SMESHGUI_GroupDlg.h"
#include "SMESHGUI_GroupOnShapeDlg.h"
-#include "SMESHGUI_DeleteGroupDlg.h"
-#include "SMESHGUI_SmoothingDlg.h"
+#include "SMESHGUI_GroupOpDlg.h"
+#include "SMESHGUI_Hypotheses.h"
+#include "SMESHGUI_Make2DFrom3DOp.h"
+#include "SMESHGUI_MakeNodeAtPointDlg.h"
+#include "SMESHGUI_MeshInfosDlg.h"
+#include "SMESHGUI_MeshOp.h"
+#include "SMESHGUI_MeshOrderOp.h"
+#include "SMESHGUI_MeshPatternDlg.h"
+#include "SMESHGUI_MoveNodesDlg.h"
+#include "SMESHGUI_MultiEditDlg.h"
+#include "SMESHGUI_NodesDlg.h"
+#include "SMESHGUI_Preferences_ColorDlg.h"
+#include "SMESHGUI_Preferences_ScalarBarDlg.h"
+#include "SMESHGUI_RemoveElementsDlg.h"
+#include "SMESHGUI_RemoveNodesDlg.h"
#include "SMESHGUI_RenumberingDlg.h"
-#include "SMESHGUI_ExtrusionDlg.h"
-#include "SMESHGUI_ExtrusionAlongPathDlg.h"
#include "SMESHGUI_RevolutionDlg.h"
-#include "SMESHGUI_TranslationDlg.h"
#include "SMESHGUI_RotationDlg.h"
-#include "SMESHGUI_SymmetryDlg.h"
-#include "SMESHGUI_SewingDlg.h"
-#include "SMESHGUI_EditMeshDlg.h"
-#include "SMESHGUI_MeshPatternDlg.h"
#include "SMESHGUI_Selection.h"
-#include "SMESHGUI_CreatePolyhedralVolumeDlg.h"
-#include "SMESHGUI_ConvToQuadOp.h"
-#include "SMESHGUI_MeshOp.h"
-#include "SMESHGUI_Displayer.h"
-#include "SMESHGUI_MakeNodeAtPointDlg.h"
-#include "SMESHGUI_BuildCompoundDlg.h"
-#include "SMESHGUI_ComputeDlg.h"
-#include "SMESHGUI_FileInfoDlg.h"
-#include "SMESHGUI_Make2DFrom3DOp.h"
+#include "SMESHGUI_SewingDlg.h"
+#include "SMESHGUI_SingleEditDlg.h"
+#include "SMESHGUI_SmoothingDlg.h"
+#include "SMESHGUI_StandardMeshInfosDlg.h"
+#include "SMESHGUI_SymmetryDlg.h"
+#include "SMESHGUI_TranslationDlg.h"
+#include "SMESHGUI_ScaleDlg.h"
+#include "SMESHGUI_TransparencyDlg.h"
+#include "SMESHGUI_WhatIsDlg.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_MeshUtils.h"
void ExportMeshToFile(int theCommandID);
- void SetDisplayMode(int theCommandID);
+ void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap);
void SetDisplayEntity(int theCommandID);
if( aSel )
aSel->selectedObjects( selected );
- SMESH::SMESH_Mesh_var aMesh;
- if(selected.Extent() == 1)
- aMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(selected.First());
- if ( aMesh->_is_nil() ) {
- SUIT_MessageBox::warning( SMESHGUI::desktop(),
- QObject::tr( "SMESH_WRN_WARNING" ),
- QObject::tr( "SMESH_BAD_MESH_SELECTION" ));
+ // actually, the following condition can't be met (added for insurance)
+ if( selected.Extent() == 0 ||
+ selected.Extent() > 1 && theCommandID != 122 && theCommandID != 125 )
return;
+
+ bool hasDuplicatedMeshNames = false;
+ QList< QPair< SMESH::SMESH_Mesh_var, QString > > aMeshList;
+ QList< QPair< SMESH::SMESH_Mesh_var, QString > >::iterator aMeshIter;
+ SALOME_ListIteratorOfListIO It( selected );
+ for( ; It.More(); It.Next() ) {
+ Handle(SALOME_InteractiveObject) anIObject = It.Value();
+ SMESH::SMESH_Mesh_var aMeshItem = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>( anIObject );
+ if ( aMeshItem->_is_nil() ) {
+ SUIT_MessageBox::warning( SMESHGUI::desktop(),
+ QObject::tr( "SMESH_WRN_WARNING" ),
+ QObject::tr( "SMESH_BAD_MESH_SELECTION" ));
+ return;
+ }
+
+ QString aMeshName = anIObject->getName();
+
+ // check for duplications
+ for( aMeshIter = aMeshList.begin(); aMeshIter != aMeshList.end(); aMeshIter++ ) {
+ if( aMeshName == (*aMeshIter).second ) {
+ hasDuplicatedMeshNames = true;
+ break;
+ }
+ }
+
+ aMeshList.append( QPair< SMESH::SMESH_Mesh_var, QString >( aMeshItem, aMeshName ) );
}
- Handle(SALOME_InteractiveObject) anIObject = selected.First();
+ if( hasDuplicatedMeshNames ) {
+ int aRet = SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_EXPORT_MED_DUPLICATED_MESH_NAMES"),
+ QObject::tr("SMESH_BUT_YES"),
+ QObject::tr("SMESH_BUT_NO"), 0, 1);
+ if (aRet != 0)
+ return;
+ }
+
+ aMeshIter = aMeshList.begin();
+ SMESH::SMESH_Mesh_var aMesh = (*aMeshIter).first;
+ QString aMeshName = (*aMeshIter).second;
+
+ QList<SALOMEDS::Color> aReservedColors;
+
QString aFilter, aTitle = QObject::tr("Export mesh");
QMap<QString, SMESH::MED_VERSION> aFilterMap;
QMap<QString, int> aFilterMapSTL;
case 125:
case 122:
{
- if (aMesh->HasDuplicatedGroupNamesMED()) {
- int aRet = SUIT_MessageBox::warning
- (SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_EXPORT_MED_DUPLICATED_GRP").arg(anIObject->getName()),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::Yes);
- if (aRet != SUIT_MessageBox::Yes)
- return;
+ for( aMeshIter = aMeshList.begin(); aMeshIter != aMeshList.end(); aMeshIter++ ) {
+ SMESH::SMESH_Mesh_var aMeshItem = (*aMeshIter).first;
+ if (aMeshItem->HasDuplicatedGroupNamesMED()) {
+ int aRet = SUIT_MessageBox::warning
+ (SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_EXPORT_MED_DUPLICATED_GRP").arg((*aMeshIter).second),
+ QObject::tr("SMESH_BUT_YES"),
+ QObject::tr("SMESH_BUT_NO"), 0, 1);
+ if (aRet != 0)
+ return;
+ }
}
// PAL18696
QString v21 (aMesh->GetVersionString(SMESH::MED_V2_1, 2));
int aRet = SUIT_MessageBox::warning
(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_EXPORT_UNV").arg(anIObject->getName()),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::Yes);
- if (aRet != SUIT_MessageBox::Yes)
+ QObject::tr("SMESH_EXPORT_UNV").arg(aMeshName),
+ QObject::tr("SMESH_BUT_YES"),
+ QObject::tr("SMESH_BUT_NO"), 0, 1);
+ if (aRet != 0)
return;
}
aFilter = QObject::tr("IDEAS files (*.unv)");
SUIT_MessageBox::warning
(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_EXPORT_STL1").arg(anIObject->getName()));
+ QObject::tr("SMESH_EXPORT_STL1").arg(aMeshName));
return;
}
if (!(aMesh->NbElements() - aMesh->NbTriangles())) {
int aRet = SUIT_MessageBox::warning
(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_EXPORT_STL2").arg(anIObject->getName()),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::Yes);
- if (aRet != SUIT_MessageBox::Yes)
+ QObject::tr("SMESH_EXPORT_STL2").arg(aMeshName),
+ QObject::tr("SMESH_BUT_YES"),
+ QObject::tr("SMESH_BUT_NO"), 0, 1);
+ if (aRet != 0)
return;
}
- aFilterMapSTL.insert( QObject::tr("STL ASCII (*.stl)"), 1 ); // 1 - ASCII mode
+ aFilterMapSTL.insert( QObject::tr("STL ASCII (*.stl)"), 1 ); // 1 - ASCII mode
aFilterMapSTL.insert( QObject::tr("STL Binary (*.stl)"), 0 ); // 0 - Binary mode
}
break;
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
if ( resMgr )
toCreateGroups = resMgr->booleanValue( "SMESH", "auto_groups", false );
+ bool toOverwrite = true;
QString anInitialPath = "";
if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
if ( theCommandID != 122 && theCommandID != 125 && theCommandID != 140 && theCommandID != 141) {
if ( anInitialPath.isEmpty() ) anInitialPath = SUIT_FileDlg::getLastVisitedPath();
- aFilename = SUIT_FileDlg::getFileName(SMESHGUI::desktop(), anInitialPath + QString("/") + anIObject->getName(),
+ aFilename = SUIT_FileDlg::getFileName(SMESHGUI::desktop(), anInitialPath + QString("/") + aMeshName,
aFilter, aTitle, false);
}
else if(theCommandID == 140 || theCommandID == 141) { // Export to STL
SUIT_FileDlg* fd = new SUIT_FileDlg( SMESHGUI::desktop(), false, true, true );
fd->setWindowTitle( aTitle );
- fd->setFilters( filters );
- fd->selectFilter( QObject::tr("STL ASCII (*.stl)") );
+ fd->setNameFilters( filters );
+ fd->selectNameFilter( QObject::tr("STL ASCII (*.stl)") );
if ( !anInitialPath.isEmpty() )
fd->setDirectory( anInitialPath );
- fd->selectFile(anIObject->getName());
+ fd->selectFile(aMeshName);
bool is_ok = false;
while (!is_ok) {
if ( fd->exec() )
aFilename = fd->selectedFile();
- aIsASCII_STL = (aFilterMapSTL[fd->selectedFilter()]) == 1 ? true: false;
+ aIsASCII_STL = (aFilterMapSTL[fd->selectedNameFilter()]) == 1 ? true: false;
is_ok = true;
}
delete fd;
SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg
( SMESHGUI::desktop(), false, QObject::tr("SMESH_AUTO_GROUPS"), true, true );
fd->setWindowTitle( aTitle );
- fd->setFilters( filters );
- //fd->setSelectedFilter( QObject::tr("MED 2.2 (*.med)") );
- fd->selectFilter(aDefaultFilter);
+ fd->setNameFilters( filters );
+ //fd->setSelectedNameFilter( QObject::tr("MED 2.2 (*.med)") );
+ fd->selectNameFilter(aDefaultFilter);
fd->SetChecked(toCreateGroups);
if ( !anInitialPath.isEmpty() )
fd->setDirectory( anInitialPath );
- fd->selectFile(anIObject->getName());
+ fd->selectFile(aMeshName);
+
+ SMESHGUI_FileValidator* fv = new SMESHGUI_FileValidator( fd );
+ fd->setValidator( fv );
+
bool is_ok = false;
while (!is_ok) {
if ( fd->exec() )
aFilename = fd->selectedFile();
- aFormat = aFilterMap[fd->selectedFilter()];
+ else {
+ aFilename = QString::null;
+ break;
+ }
+ aFormat = aFilterMap[fd->selectedNameFilter()];
+ toOverwrite = fv->isOverwrite();
is_ok = true;
- if ( !aFilename.isEmpty()
- && (aMesh->NbPolygons()>0 || aMesh->NbPolyhedrons()>0)
- && aFormat==SMESH::MED_V2_1) {
- int aRet = SUIT_MessageBox::warning(SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_EXPORT_MED_V2_1").arg(anIObject->getName()),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::Yes);
- if (aRet != SUIT_MessageBox::Yes) {
- is_ok = false;
+ if ( !aFilename.isEmpty() ) {
+ for( aMeshIter = aMeshList.begin(); aMeshIter != aMeshList.end(); aMeshIter++ ) {
+ SMESH::SMESH_Mesh_var aMeshItem = (*aMeshIter).first;
+ if( (aMeshItem->NbPolygons()>0 || aMeshItem->NbPolyhedrons()>0)
+ && aFormat==SMESH::MED_V2_1) {
+ int aRet = SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_EXPORT_MED_V2_1").arg((*aMeshIter).second),
+ QObject::tr("SMESH_BUT_YES"),
+ QObject::tr("SMESH_BUT_NO"), 0, 1);
+ if (aRet != 0) {
+ is_ok = false;
+ break;
+ }
+ }
+ }
+ if( !toOverwrite ) {
+ SMESH::MED_VERSION aVersion = SMESH::MED_V2_1;
+ bool isVersionOk = SMESHGUI::GetSMESHGen()->GetMEDVersion( aFilename.toLatin1().constData(), aVersion );
+ if( !isVersionOk || aVersion != aFormat ) {
+ int aRet = SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_EXPORT_MED_VERSION_COLLISION").arg(aFilename),
+ QObject::tr("SMESH_BUT_YES"),
+ QObject::tr("SMESH_BUT_NO"), 0, 1);
+ if (aRet == 0)
+ toOverwrite = true;
+ else
+ is_ok = false;
+ }
+
+ QStringList aMeshNamesCollisionList;
+ SMESH::string_array_var aMeshNames = SMESHGUI::GetSMESHGen()->GetMeshNames( aFilename.toLatin1().constData() );
+ for( int i = 0, n = aMeshNames->length(); i < n; i++ ) {
+ QString anExistingMeshName( aMeshNames[ i ] );
+ for( aMeshIter = aMeshList.begin(); aMeshIter != aMeshList.end(); aMeshIter++ ) {
+ QString anExportMeshName = (*aMeshIter).second;
+ if( anExportMeshName == anExistingMeshName ) {
+ aMeshNamesCollisionList.append( anExportMeshName );
+ break;
+ }
+ }
+ }
+
+ if( !aMeshNamesCollisionList.isEmpty() ) {
+ QString aMeshNamesCollisionString = aMeshNamesCollisionList.join( ", " );
+ int aRet = SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_EXPORT_MED_MESH_NAMES_COLLISION").arg(aMeshNamesCollisionString),
+ QObject::tr("SMESH_BUT_YES"),
+ QObject::tr("SMESH_BUT_NO"),
+ QObject::tr("SMESH_BUT_CANCEL"), 0, 2);
+ if (aRet == 0)
+ toOverwrite = true;
+ else if (aRet == 2)
+ is_ok = false;
+ }
}
}
}
if ( !aFilename.isEmpty() ) {
// Check whether the file already exists and delete it if yes
QFile aFile( aFilename );
- if ( aFile.exists() )
+ if ( aFile.exists() && toOverwrite )
aFile.remove();
SUIT_OverrideCursor wc;
}
switch ( theCommandID ) {
case 125:
- case 122:
- aMesh->ExportToMED( aFilename.toLatin1().data(), toCreateGroups, aFormat );
+ case 122: {
+ int aMeshIndex = 0;
+ for( aMeshIter = aMeshList.begin(); aMeshIter != aMeshList.end(); aMeshIter++, aMeshIndex++ ) {
+ SMESH::SMESH_Mesh_var aMeshItem = (*aMeshIter).first;
+ if( !aMeshItem->_is_nil() )
+ aMeshItem->ExportToMEDX( aFilename.toLatin1().data(), toCreateGroups, aFormat, toOverwrite && aMeshIndex == 0 );
+ }
+ }
break;
case 124:
case 121:
aReservedColors.append( aColor );
_PTR(SObject) aGroupSObject = SMESH::FindSObject(aGroupObject);
- if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aGroupSObject->GetID().c_str()))
- {
- if( aGroupObject->GetType() == SMESH::NODE )
- anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
- else if( aGroupObject->GetType() == SMESH::EDGE )
- anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
- else
- anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
+ if (aGroupSObject) {
+ if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aGroupSObject->GetID().c_str())) {
+ if( aGroupObject->GetType() == SMESH::NODE )
+ anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
+ else if( aGroupObject->GetType() == SMESH::EDGE )
+ anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
+ else if( aGroupObject->GetType() == SMESH::ELEM0D )
+ anActor->Set0DColor( aColor.R, aColor.G, aColor.B );
+ else
+ anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
+ }
}
}
}
}
- void SetDisplayMode(int theCommandID){
+ void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap){
SALOME_ListIO selected;
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
if( !app )
c2 = int (nodecolor[2] * 255);
QColor n(c0, c1, c2);
+ vtkFloatingPointType color0D[3];
+ anActor->Get0DColor(color0D[0], color0D[1], color0D[2]);
+ c0 = int (color0D[0] * 255);
+ c1 = int (color0D[1] * 255);
+ c2 = int (color0D[2] * 255);
+ QColor c0D(c0, c1, c2);
+
+ int size0D = (int)anActor->Get0DSize();
+ if(size0D == 0)
+ size0D = 1;
int Edgewidth = (int)anActor->GetLineWidth();
if(Edgewidth == 0)
Edgewidth = 1;
- int intValue = int(anActor->GetNodeSize());
vtkFloatingPointType Shrink = anActor->GetShrinkFactor();
+ vtkFloatingPointType faces_orientation_color[3];
+ anActor->GetFacesOrientationColor(faces_orientation_color);
+ c0 = int (faces_orientation_color[0] * 255);
+ c1 = int (faces_orientation_color[1] * 255);
+ c2 = int (faces_orientation_color[2] * 255);
+ QColor o(c0, c1, c2);
+
+ vtkFloatingPointType faces_orientation_scale = anActor->GetFacesOrientationScale();
+ bool faces_orientation_3dvectors = anActor->GetFacesOrientation3DVectors();
+
SMESHGUI_Preferences_ColorDlg *aDlg =
new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI() );
aDlg->SetColor(1, c);
aDlg->SetColor(2, e);
aDlg->SetColor(3, n);
aDlg->SetColor(4, b);
+ aDlg->SetColor(5, c0D);
+ aDlg->SetColor(6, o);
aDlg->SetIntValue(1, Edgewidth);
- aDlg->SetIntValue(2, intValue);
- aDlg->SetIntValue(3, int(Shrink*100.));
+ aDlg->SetIntValue(2, int(Shrink*100.));
+ aDlg->SetIntValue(3, size0D);
+ aDlg->SetDoubleValue(1, faces_orientation_scale);
+ aDlg->SetBooleanValue(1, faces_orientation_3dvectors);
+
+ aDlg->setCustomMarkerMap( theMarkerMap[ aStudy->StudyId() ] );
+
+ VTK::MarkerType aMarkerTypeCurrent = anActor->GetMarkerType();
+ VTK::MarkerScale aMarkerScaleCurrent = anActor->GetMarkerScale();
+ int aMarkerTextureCurrent = anActor->GetMarkerTexture();
+ if( aMarkerTypeCurrent != VTK::MT_USER )
+ aDlg->setStandardMarker( aMarkerTypeCurrent, aMarkerScaleCurrent );
+ else
+ aDlg->setCustomMarker( aMarkerTextureCurrent );
+
if(aDlg->exec()){
QColor color = aDlg->GetColor(1);
QColor edgecolor = aDlg->GetColor(2);
QColor nodecolor = aDlg->GetColor(3);
QColor backfacecolor = aDlg->GetColor(4);
+ QColor color0D = aDlg->GetColor(5);
+ QColor faces_orientation_color = aDlg->GetColor(6);
/* actor color and backface color */
anActor->SetSufaceColor(vtkFloatingPointType (color.red()) / 255.,
vtkFloatingPointType (color.green()) / 255.,
vtkFloatingPointType (edgecolor.blue()) / 255.);
/* Shrink factor and size edges */
- anActor->SetShrinkFactor(aDlg->GetIntValue(3) / 100.);
+ anActor->SetShrinkFactor(aDlg->GetIntValue(2) / 100.);
anActor->SetLineWidth(aDlg->GetIntValue(1));
/* Nodes color and size */
anActor->SetNodeColor(vtkFloatingPointType (nodecolor.red()) / 255.,
vtkFloatingPointType (nodecolor.green()) / 255.,
vtkFloatingPointType (nodecolor.blue()) / 255.);
- anActor->SetNodeSize(aDlg->GetIntValue(2));
+
+ /* 0D elements */
+ anActor->Set0DColor(vtkFloatingPointType (color0D.red()) / 255.,
+ vtkFloatingPointType (color0D.green()) / 255.,
+ vtkFloatingPointType (color0D.blue()) / 255.);
+ anActor->Set0DSize(aDlg->GetIntValue(3));
+
+ /* Faces orientation */
+ vtkFloatingPointType c[3] = {vtkFloatingPointType(faces_orientation_color.redF()),
+ vtkFloatingPointType(faces_orientation_color.greenF()),
+ vtkFloatingPointType(faces_orientation_color.blueF())};
+ anActor->SetFacesOrientationColor(c);
+ anActor->SetFacesOrientationScale(aDlg->GetDoubleValue(1));
+ anActor->SetFacesOrientation3DVectors(aDlg->GetBooleanValue(1));
+
+ /* Point marker */
+ theMarkerMap[ aStudy->StudyId() ] = aDlg->getCustomMarkerMap();
+
+ VTK::MarkerType aMarkerTypeNew = aDlg->getMarkerType();
+ VTK::MarkerScale aMarkerScaleNew = aDlg->getStandardMarkerScale();
+ int aMarkerTextureNew = aDlg->getCustomMarkerID();
+ if( aMarkerTypeNew != VTK::MT_USER )
+ anActor->SetMarkerStd( aMarkerTypeNew, aMarkerScaleNew );
+ else {
+ const VTK::MarkerMap& aMarkerMap = theMarkerMap[ aStudy->StudyId() ];
+ VTK::MarkerMap::const_iterator anIter = aMarkerMap.find( aMarkerTextureNew );
+ if( anIter != aMarkerMap.end() )
+ anActor->SetMarkerTexture( aMarkerTextureNew, anIter->second.second );
+ }
SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
if( !aGroupObject->_is_nil() )
case 213: // Nodes
case 212: // Nodes
case 211: // Nodes
- ::SetDisplayMode(theCommandID);
+ ::SetDisplayMode(theCommandID, myMarkerMap);
break;
//2D quadratic representation
case 231:
case 232:
- ::SetDisplayMode(theCommandID);
+ ::SetDisplayMode(theCommandID, myMarkerMap);
break;
// Display Entity
case 701: // COMPUTE MESH
case 711: // PRECOMPUTE MESH
case 712: // EVALUATE MESH
+ case 713: // MESH ORDER
{
if (checkLock(aStudy)) break;
startOperation( theCommandID );
( new SMESHGUI_UnionOfTwoTrianglesDlg( this ) )->show();
break;
}
- case 409: // Change orientation
- case 410: // Union of triangles
- case 411: // Cutting of quadrangles
+ case 409: // Change orientation
+ case 410: // Union of triangles
+ case 411: // Cutting of quadrangles
+ case 419: // Splitting volumes into tetrahedra
{
if ( !vtkwnd )
{
aDlg = new SMESHGUI_ChangeOrientationDlg(this);
else if ( theCommandID == 410 )
aDlg = new SMESHGUI_UnionOfTrianglesDlg(this);
+ else if ( theCommandID == 419 )
+ aDlg = new SMESHGUI_CuttingIntoTetraDlg(this);
else
aDlg = new SMESHGUI_CuttingOfQuadsDlg(this);
break;
}
+ case 904: // FIND ELEM
+ {
+ startOperation( theCommandID );
+ break;
+ }
+
case 1100: // EDIT HYPOTHESIS
{
if(checkLock(aStudy)) break;
startOperation( 4067 );
break;
+ case 4068: // SCALE
+ {
+ if(checkLock(aStudy)) break;
+ if ( vtkwnd ) {
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_ScaleDlg( this ) )->show();
+ }
+ else {
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ }
+ break;
+ }
+
case 5105: // Library of selection filters
{
static QList<int> aTypes;
createSMESHAction( 710, "BUILD_COMPOUND", "ICON_BUILD_COMPOUND" );
createSMESHAction( 711, "PRECOMPUTE", "ICON_PRECOMPUTE" );
createSMESHAction( 712, "EVALUATE", "ICON_COMPUTE" );
+ createSMESHAction( 713, "MESH_ORDER", "ICON_COMPUTE" );
createSMESHAction( 806, "CREATE_GEO_GROUP","ICON_CREATE_GEO_GROUP" );
createSMESHAction( 801, "CREATE_GROUP", "ICON_CREATE_GROUP" );
createSMESHAction( 802, "CONSTRUCT_GROUP", "ICON_CONSTRUCT_GROUP" );
createSMESHAction( 900, "ADV_INFO", "ICON_ADV_INFO" );
createSMESHAction( 902, "STD_INFO", "ICON_STD_INFO" );
createSMESHAction( 903, "WHAT_IS", "ICON_WHAT_IS" );
+ createSMESHAction( 904, "FIND_ELEM", "ICON_FIND_ELEM" );
createSMESHAction( 6001, "LENGTH", "ICON_LENGTH", 0, true );
createSMESHAction( 6002, "FREE_EDGE", "ICON_FREE_EDGE", 0, true );
createSMESHAction( 6021, "FREE_FACES", "ICON_FREE_FACES", 0, true );
createSMESHAction( 4065, "MERGE", "ICON_SMESH_MERGE_NODES" );
createSMESHAction( 4066, "MERGE_ELEMENTS", "ICON_DLG_MERGE_ELEMENTS" );
createSMESHAction( 4067, "MESH_THROU_POINT","ICON_DLG_MESH_THROU_POINT" );
+ createSMESHAction( 4068, "SCALE", "ICON_DLG_MESH_SCALE" );
createSMESHAction( 406, "MOVE", "ICON_DLG_MOVE_NODE" );
createSMESHAction( 407, "INV", "ICON_DLG_MESH_DIAGONAL" );
createSMESHAction( 408, "UNION2", "ICON_UNION2TRI" );
createSMESHAction( 416, "EXTRUSION_ALONG", "ICON_EXTRUSION_ALONG" );
createSMESHAction( 417, "CONV_TO_QUAD", "ICON_CONV_TO_QUAD" );
createSMESHAction( 418, "2D_FROM_3D", "ICON_2D_FROM_3D" );
+ createSMESHAction( 419, "SPLIT_TO_TETRA", "ICON_SPLIT_TO_TETRA" );
createSMESHAction( 200, "RESET" );
createSMESHAction( 201, "SCALAR_BAR_PROP" );
createSMESHAction( 211, "WIRE", "ICON_WIRE", 0, true );
createMenu( 701, meshId, -1 );
createMenu( 711, meshId, -1 );
createMenu( 712, meshId, -1 );
+ createMenu( 713, meshId, -1 );
createMenu( separator(), meshId, -1 );
createMenu( 801, meshId, -1 );
createMenu( 806, meshId, -1 );
createMenu( 900, meshId, -1 );
createMenu( 902, meshId, -1 );
createMenu( 903, meshId, -1 );
+ createMenu( 904, meshId, -1 );
createMenu( separator(), meshId, -1 );
createMenu( 6003, ctrlId, -1 );
createMenu( 4064, transfId, -1 );
createMenu( 4065, transfId, -1 );
createMenu( 4066, transfId, -1 );
+ createMenu( 4068, transfId, -1 );
createMenu( 406, modifyId, -1 );
createMenu( 4067,modifyId, -1 );
createMenu( 409, modifyId, -1 );
createMenu( 410, modifyId, -1 );
createMenu( 411, modifyId, -1 );
+ createMenu( 419, modifyId, -1 );
createMenu( 412, modifyId, -1 );
createMenu( 413, modifyId, -1 );
createMenu( 416, modifyId, -1 );
createTool( 701, meshTb );
createTool( 711, meshTb );
createTool( 712, meshTb );
+ createTool( 713, meshTb );
createTool( separator(), meshTb );
createTool( 801, meshTb );
createTool( 806, meshTb );
createTool( 900, meshTb );
createTool( 902, meshTb );
createTool( 903, meshTb );
+ createTool( 904, meshTb );
createTool( separator(), meshTb );
createTool( 6001, ctrlTb );
createTool( 4064, addRemTb );
createTool( 4065, addRemTb );
createTool( 4066, addRemTb );
+ createTool( 4068, addRemTb );
createTool( separator(), addRemTb );
createTool( 406, modifyTb );
createTool( 409, modifyTb );
createTool( 410, modifyTb );
createTool( 411, modifyTb );
+ createTool( 419, modifyTb );
createTool( 412, modifyTb );
createTool( 413, modifyTb );
createTool( 416, modifyTb );
popupMgr()->insert( separator(), -1, 0 );
createPopupItem( 701, OB, mesh, "&& isComputable" ); // COMPUTE
createPopupItem( 711, OB, mesh, "&& isComputable && isPreComputable" ); // PRECOMPUTE
- createPopupItem( 712, OB, mesh, "&& isComputable" ); // COMPUTE
+ createPopupItem( 712, OB, mesh, "&& isComputable" ); // EVALUATE
+ createPopupItem( 713, OB, mesh, "&& isComputable" ); // MESH ORDER
createPopupItem( 214, OB, mesh_group ); // UPDATE
createPopupItem( 900, OB, mesh_group ); // ADV_INFO
createPopupItem( 902, OB, mesh ); // STD_INFO
createPopupItem( 903, OB, mesh_group ); // WHAT_IS
+ createPopupItem( 904, OB, mesh_group ); // FIND_ELEM
popupMgr()->insert( separator(), -1, 0 );
createPopupItem( 801, OB, mesh ); // CREATE_GROUP
createPopupItem( 806, OB, mesh ); // CREATE_GEO_GROUP
popupMgr()->insert( separator(), -1, 0 );
QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc );
+ QString multiple_non_empty = QString( " && %1>0 && numberOfNodes>0" ).arg( dc );
- createPopupItem( 125, OB, mesh, only_one_non_empty ); // EXPORT_MED
+ createPopupItem( 125, OB, mesh, multiple_non_empty ); // EXPORT_MED
createPopupItem( 126, OB, mesh, only_one_non_empty ); // EXPORT_UNV
createPopupItem( 141, OB, mesh, only_one_non_empty ); // EXPORT_STL
//createPopupItem( 33, OB, subMesh + " " + group ); // DELETE
createPopupItem( 900, View, mesh_group ); // ADV_INFO
createPopupItem( 902, View, mesh ); // STD_INFO
createPopupItem( 903, View, mesh_group ); // WHAT_IS
+ createPopupItem( 904, View, mesh_group ); // FIND_ELEM
popupMgr()->insert( separator(), -1, 0 );
createPopupItem( 1136, OB + " " + View, mesh, "&& (not isAutoColor)" ); // AUTO_COLOR
return isCompatible;
}
+
+bool SMESHGUI::reusableOperation( const int id )
+{
+ // compute, evaluate and precompute are not reusable operations
+ return ( id == 701 || id == 711 || id == 712 ) ? false : SalomeApp_Module::reusableOperation( id );
+}
+
bool SMESHGUI::activateModule( SUIT_Study* study )
{
bool res = SalomeApp_Module::activateModule( study );
"SMESH", "nb_segments_per_edge" );
setPreferenceProperty( nbSeg, "min", 1 );
setPreferenceProperty( nbSeg, "max", 10000000 );
+
+ // Quantities with individual precision settings
+ int precGroup = addPreference( tr( "SMESH_PREF_GROUP_PRECISION" ), genTab );
+ setPreferenceProperty( precGroup, "columns", 2 );
+
+ const int nbQuantities = 6;
+ int precs[nbQuantities], ii = 0;
+ precs[ii++] = addPreference( tr( "SMESH_PREF_length_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "SMESH", "length_precision" );
+ precs[ii++] = addPreference( tr( "SMESH_PREF_angle_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "SMESH", "angle_precision" );
+ precs[ii++] = addPreference( tr( "SMESH_PREF_len_tol_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "SMESH", "len_tol_precision" );
+ precs[ii++] = addPreference( tr( "SMESH_PREF_parametric_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "SMESH", "parametric_precision" );
+ precs[ii++] = addPreference( tr( "SMESH_PREF_area_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "SMESH", "area_precision" );
+ precs[ii ] = addPreference( tr( "SMESH_PREF_vol_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "SMESH", "vol_precision" );
+
+ // Set property for precision value for spinboxes
+ for ( ii = 0; ii < nbQuantities; ii++ ){
+ setPreferenceProperty( precs[ii], "min", -10 );
+ setPreferenceProperty( precs[ii], "max", 10 );
+ setPreferenceProperty( precs[ii], "precision", 2 );
+ }
// Mesh tab ------------------------------------------------------------------------
int meshTab = addPreference( tr( "PREF_TAB_MESH" ) );
int nodeGroup = addPreference( tr( "PREF_GROUP_NODES" ), meshTab );
- setPreferenceProperty( nodeGroup, "columns", 2 );
+ setPreferenceProperty( nodeGroup, "columns", 3 );
addPreference( tr( "PREF_COLOR" ), nodeGroup, LightApp_Preferences::Color, "SMESH", "node_color" );
- int nodeSz = addPreference( tr( "PREF_SIZE" ), nodeGroup, LightApp_Preferences::IntSpin, "SMESH", "node_size" );
- setPreferenceProperty( nodeSz, "min", 1 );
- setPreferenceProperty( nodeSz, "max", 5 );
+ int typeOfMarker = addPreference( tr( "PREF_TYPE_OF_MARKER" ), nodeGroup, LightApp_Preferences::Selector, "SMESH", "type_of_marker" );
+
+ SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this);
+ QList<QVariant> aMarkerTypeIndicesList;
+ QList<QVariant> aMarkerTypeIconsList;
+ for ( int i = VTK::MT_POINT; i < VTK::MT_USER; i++ ) {
+ QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
+ QPixmap pixmap = aResourceMgr->loadPixmap( "VTKViewer", tr( qPrintable( icoFile ) ) );
+ aMarkerTypeIndicesList << i;
+ aMarkerTypeIconsList << pixmap;
+ }
+ setPreferenceProperty( typeOfMarker, "indexes", aMarkerTypeIndicesList );
+ setPreferenceProperty( typeOfMarker, "icons", aMarkerTypeIconsList );
+
+ int markerScale = addPreference( tr( "PREF_MARKER_SCALE" ), nodeGroup, LightApp_Preferences::Selector, "SMESH", "marker_scale" );
+
+ QList<QVariant> aMarkerScaleIndicesList;
+ QStringList aMarkerScaleValuesList;
+ for ( int i = VTK::MS_10; i <= VTK::MS_70; i++ ) {
+ aMarkerScaleIndicesList << i;
+ aMarkerScaleValuesList << QString::number( (i-(int)VTK::MS_10)*0.5 + 1.0 );
+ }
+ setPreferenceProperty( markerScale, "strings", aMarkerScaleValuesList );
+ setPreferenceProperty( markerScale, "indexes", aMarkerScaleIndicesList );
int elemGroup = addPreference( tr( "PREF_GROUP_ELEMENTS" ), meshTab );
setPreferenceProperty( elemGroup, "columns", 2 );
// to do : create operation here
switch( id )
{
+ case 417: //convert to quadratic
+ op = new SMESHGUI_ConvToQuadOp();
+ break;
+ case 418: // create 2D mesh as boundary on 3D
+ op = new SMESHGUI_Make2DFrom3DOp();
+ break;
case 701: // Compute mesh
op = new SMESHGUI_ComputeOp();
break;
case 712: // Evaluate mesh
op = new SMESHGUI_EvaluateOp();
break;
+ case 713: // Evaluate mesh
+ op = new SMESHGUI_MeshOrderOp();
+ break;
case 806: // Create group on geom
op = new SMESHGUI_GroupOnShapeOp();
break;
- case 417: //convert to quadratic
- op = new SMESHGUI_ConvToQuadOp();
- break;
- case 418: // create 2D mesh as boundary on 3D
- op = new SMESHGUI_Make2DFrom3DOp();
- break;
+ case 904: // Find element
+ op = new SMESHGUI_FindElemByPointOp();
+ break;
case 4067: // make mesh pass through point
op = new SMESHGUI_MakeNodeAtPointOp();
break;
const char gSeparator = '_'; // character used to separate parameter names
const char gDigitsSep = ':'; // character used to separate numeric parameter values (color = r:g:b)
+const char gPathSep = '|'; // character used to separate paths
/*!
* \brief Store visual parameters
savePoint);
_PTR(IParameters) ip = ClientFactory::getIParameters(ap);
+ // store map of custom markers
+ const VTK::MarkerMap& aMarkerMap = myMarkerMap[ studyDS->StudyId() ];
+ if( !aMarkerMap.empty() )
+ {
+ VTK::MarkerMap::const_iterator anIter = aMarkerMap.begin();
+ for( ; anIter != aMarkerMap.end(); anIter++ )
+ {
+ int anId = anIter->first;
+ VTK::MarkerData aMarkerData = anIter->second;
+ std::string aMarkerFileName = aMarkerData.first;
+ VTK::MarkerTexture aMarkerTexture = aMarkerData.second;
+ if( aMarkerTexture.size() < 3 )
+ continue; // should contain at least width, height and the first value
+
+ QString aPropertyName( "texture" );
+ aPropertyName += gSeparator;
+ aPropertyName += QString::number( anId );
+
+ QString aPropertyValue = aMarkerFileName.c_str();
+ aPropertyValue += gPathSep;
+
+ VTK::MarkerTexture::const_iterator aTextureIter = aMarkerTexture.begin();
+ ushort aWidth = *aTextureIter++;
+ ushort aHeight = *aTextureIter++;
+ aPropertyValue += QString::number( aWidth ); aPropertyValue += gDigitsSep;
+ aPropertyValue += QString::number( aHeight ); aPropertyValue += gDigitsSep;
+ for( ; aTextureIter != aMarkerTexture.end(); aTextureIter++ )
+ aPropertyValue += QString::number( *aTextureIter );
+
+ ip->setProperty( aPropertyName.toStdString(), aPropertyValue.toStdString() );
+ }
+ }
+
// viewers counters are used for storing view_numbers in IParameters
int vtkViewers = 0;
// Sizes of lines and points
QString sizeStr ("line");
sizeStr += gDigitsSep; sizeStr += QString::number((int)aSmeshActor->GetLineWidth());
- sizeStr += gDigitsSep; sizeStr += "node";
- sizeStr += gDigitsSep; sizeStr += QString::number((int)aSmeshActor->GetNodeSize());
sizeStr += gDigitsSep; sizeStr += "shrink";
sizeStr += gDigitsSep; sizeStr += QString::number(aSmeshActor->GetShrinkFactor());
param = vtkParam + "Sizes";
ip->setParameter(entry, param, sizeStr.toLatin1().data());
+ // Point marker
+ QString markerStr;
+
+ VTK::MarkerType aMarkerType = aSmeshActor->GetMarkerType();
+ if( aMarkerType == VTK::MT_USER ) {
+ markerStr += "custom";
+ markerStr += gDigitsSep;
+ markerStr += QString::number( aSmeshActor->GetMarkerTexture() );
+ }
+ else {
+ markerStr += "std";
+ markerStr += gDigitsSep;
+ markerStr += QString::number( (int)aMarkerType );
+ markerStr += gDigitsSep;
+ markerStr += QString::number( (int)aSmeshActor->GetMarkerScale() );
+ }
+
+ param = vtkParam + "PointMarker";
+ ip->setParameter(entry, param, markerStr.toLatin1().data());
+
// Opacity
param = vtkParam + "Opacity";
ip->setParameter(entry, param,
savePoint);
_PTR(IParameters) ip = ClientFactory::getIParameters(ap);
+ // restore map of custom markers
+ VTK::MarkerMap& aMarkerMap = myMarkerMap[ studyDS->StudyId() ];
+
+ std::vector<std::string> properties = ip->getProperties();
+ for (std::vector<std::string>::iterator propIt = properties.begin(); propIt != properties.end(); ++propIt)
+ {
+ std::string property = *propIt;
+ QString aPropertyName( property.c_str() );
+ QString aPropertyValue( ip->getProperty( property ).c_str() );
+
+ QStringList aPropertyNameList = aPropertyName.split( gSeparator, QString::SkipEmptyParts );
+ if( aPropertyNameList.size() != 2 )
+ continue;
+
+ int anId = 0;
+ bool ok = false;
+ if( aPropertyNameList[0] == "texture" )
+ anId = aPropertyNameList[1].toInt( &ok );
+
+ if( !ok || anId < 1 )
+ continue;
+
+ QStringList aPropertyValueList = aPropertyValue.split( gPathSep, QString::SkipEmptyParts );
+ if( aPropertyValueList.size() != 2 )
+ continue;
+
+ std::string aMarkerFileName = aPropertyValueList[0].toStdString();
+ QString aMarkerTextureString = aPropertyValueList[1];
+ QStringList aMarkerTextureStringList = aMarkerTextureString.split( gDigitsSep, QString::SkipEmptyParts );
+ if( aMarkerTextureStringList.size() != 3 )
+ continue;
+
+ ok = false;
+ ushort aWidth = aMarkerTextureStringList[0].toUShort( &ok );
+ if( !ok )
+ continue;
+
+ ok = false;
+ ushort aHeight = aMarkerTextureStringList[1].toUShort( &ok );
+ if( !ok )
+ continue;
+
+ VTK::MarkerTexture aMarkerTexture;
+ aMarkerTexture.push_back( aWidth );
+ aMarkerTexture.push_back( aHeight );
+
+ QString aMarkerTextureData = aMarkerTextureStringList[2];
+ for( int i = 0, n = aMarkerTextureData.length(); i < n; i++ )
+ {
+ QChar aChar = aMarkerTextureData.at( i );
+ if( aChar.isDigit() )
+ aMarkerTexture.push_back( aChar.digitValue() );
+ }
+
+ aMarkerMap[ anId ] = VTK::MarkerData( aMarkerFileName, aMarkerTexture );
+ }
+
std::vector<std::string> entries = ip->getEntries();
for (std::vector<std::string>::iterator entIt = entries.begin(); entIt != entries.end(); ++entIt)
// Sizes of lines and points
else if (paramNameStr == "Sizes") {
QStringList sizes = val.split(gDigitsSep, QString::SkipEmptyParts);
- if (sizes.count() == 6) {
+ if (sizes.count() == 4) {
+ if (sizes[0] != "line" || sizes[2] != "shrink") {
+ MESSAGE("Invalid order of data in Sizes, must be: "
+ "line:int:shrink:float");
+ }
+ else {
+ aSmeshActor->SetLineWidth(sizes[1].toInt());
+ aSmeshActor->SetShrinkFactor(sizes[3].toFloat());
+ }
+ }
+ else if (sizes.count() == 6) { // just to support old format
if (sizes[0] != "line" || sizes[2] != "node" || sizes[4] != "shrink") {
MESSAGE("Invalid order of data in Sizes, must be: "
"line:int:node:int:shrink:float");
}
else {
aSmeshActor->SetLineWidth(sizes[1].toInt());
- aSmeshActor->SetNodeSize(sizes[3].toInt());
+ //aSmeshActor->SetNodeSize(sizes[3].toInt()); // made obsolete
aSmeshActor->SetShrinkFactor(sizes[5].toFloat());
}
}
}
+ // Point marker
+ else if (paramNameStr == "PointMarker") {
+ QStringList data = val.split(gDigitsSep, QString::SkipEmptyParts);
+ if( data.count() >= 2 ) {
+ bool ok = false;
+ int aParam1 = data[1].toInt( &ok );
+ if( ok ) {
+ if( data[0] == "std" && data.count() == 3 ) {
+ int aParam2 = data[2].toInt( &ok );
+ aSmeshActor->SetMarkerStd( (VTK::MarkerType)aParam1, (VTK::MarkerScale)aParam2 );
+ }
+ else if( data[0] == "custom" ) {
+ VTK::MarkerMap::const_iterator markerIt = aMarkerMap.find( aParam1 );
+ if( markerIt != aMarkerMap.end() ) {
+ VTK::MarkerData aMarkerData = markerIt->second;
+ aSmeshActor->SetMarkerTexture( aParam1, aMarkerData.second );
+ }
+ }
+ }
+ }
+ }
// Opacity
else if (paramNameStr == "Opacity") {
aSmeshActor->SetOpacity(val.toFloat());
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI.h
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
// SALOME GUI includes
#include <SalomeApp_Module.h>
+#include <VTKViewer_MarkerDef.h>
#include <SALOME_InteractiveObject.hxx>
// IDL includes
class SMESHGUI_FilterLibraryDlg;
+typedef std::map<int, VTK::MarkerMap> SMESHGUI_StudyId2MarkerMap;
+
//=================================================================================
// class : SMESHGUI
// purpose :
virtual bool isSelectionCompatible();
+ virtual bool reusableOperation( const int id );
+
private:
void OnEditDelete();
int addVtkFontPref( const QString& label,
LightApp_Displayer* myDisplayer;
SMESHGUI_FilterLibraryDlg* myFilterLibraryDlg;
+
+ SMESHGUI_StudyId2MarkerMap myMarkerMap;
};
#endif // SMESHGUI_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_AddMeshElementDlg.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
-
// SMESH includes
+//
#include "SMESHGUI_AddMeshElementDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_MeshUtils.h"
+#include "SMESHGUI_GroupUtils.h"
#include "SMESHGUI_IdValidator.h"
#include <SMESH_Actor.h>
#include <vtkProperty.h>
// Qt includes
+#include <QComboBox>
#include <QGroupBox>
#include <QLabel>
#include <QLineEdit>
GroupC1Layout->addWidget(LineEditC1A1, 0, 2);
if ( Reverse ) GroupC1Layout->addWidget(Reverse, 1, 0, 1, 3);
+ /***************************************************************/
+ GroupGroups = new QGroupBox( tr( "SMESH_ADD_TO_GROUP" ), this );
+ GroupGroups->setCheckable( true );
+ QHBoxLayout* GroupGroupsLayout = new QHBoxLayout(GroupGroups);
+ GroupGroupsLayout->setSpacing(SPACING);
+ GroupGroupsLayout->setMargin(MARGIN);
+
+ TextLabel_GroupName = new QLabel( tr( "SMESH_GROUP" ), GroupGroups );
+ ComboBox_GroupName = new QComboBox( GroupGroups );
+ ComboBox_GroupName->setEditable( true );
+
+ GroupGroupsLayout->addWidget( TextLabel_GroupName );
+ GroupGroupsLayout->addWidget( ComboBox_GroupName, 1 );
+
/***************************************************************/
GroupButtons = new QGroupBox(this);
QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
/***************************************************************/
aTopLayout->addWidget(GroupConstructors);
aTopLayout->addWidget(GroupC1);
+ aTopLayout->addWidget(GroupGroups);
aTopLayout->addWidget(GroupButtons);
Init(); /* Initialisations */
myEditCurrentArgument = LineEditC1A1;
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
+ /* reset "Add to group" control */
+ GroupGroups->setChecked( false );
+ GroupGroups->setVisible( myElementType != SMDSAbs_0DElement );
+
myNbOkNodes = 0;
myActor = 0;
//=================================================================================
void SMESHGUI_AddMeshElementDlg::ClickOnApply()
{
+ if( !isValid() )
+ return;
+
if (myNbOkNodes && !mySMESHGUI->isActiveStudyLocked()) {
myBusy = true;
SMESH::long_array_var anArrayOfIndices = new SMESH::long_array;
else
anArrayOfIndices[i] = aListId[ i ].toInt();
+ bool addToGroup = GroupGroups->isChecked();
+ QString aGroupName;
+
+ SMESH::SMESH_GroupBase_var aGroup;
+ int idx = 0;
+ if( addToGroup ) {
+ aGroupName = ComboBox_GroupName->currentText();
+ for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) {
+ QString aName = ComboBox_GroupName->itemText( i );
+ if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) )
+ idx = i;
+ }
+ if ( idx > 0 ) {
+ SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( myGroups[idx-1] );
+ if ( !aGeomGroup->_is_nil() ) {
+ int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ),
+ tr( "MESH_STANDALONE_GRP_CHOSEN" ).arg( aGroupName ),
+ tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 );
+ if ( res == 1 ) return;
+ }
+ aGroup = myGroups[idx-1];
+ }
+ }
+
+ long anElemId = -1;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
switch (myElementType) {
case SMDSAbs_0DElement:
- aMeshEditor->Add0DElement(anArrayOfIndices[0]); break;
+ anElemId = aMeshEditor->Add0DElement(anArrayOfIndices[0]); break;
case SMDSAbs_Edge:
- aMeshEditor->AddEdge(anArrayOfIndices.inout()); break;
+ anElemId = aMeshEditor->AddEdge(anArrayOfIndices.inout()); break;
case SMDSAbs_Face: {
if(myIsPoly)
- aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout());
+ anElemId = aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout());
else
- aMeshEditor->AddFace(anArrayOfIndices.inout());
+ anElemId = aMeshEditor->AddFace(anArrayOfIndices.inout());
break;
}
case SMDSAbs_Volume:
- aMeshEditor->AddVolume(anArrayOfIndices.inout()); break;
- default:;
+ anElemId = aMeshEditor->AddVolume(anArrayOfIndices.inout()); break;
+ default: break;
+ }
+
+ if ( anElemId != -1 && addToGroup && !aGroupName.isEmpty() ) {
+ SMESH::SMESH_Group_var aGroupUsed;
+ if ( aGroup->_is_nil() ) {
+ // create new group
+ aGroupUsed = SMESH::AddGroup( myMesh, (SMESH::ElementType)myElementType, aGroupName );
+ if ( !aGroupUsed->_is_nil() ) {
+ myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed));
+ ComboBox_GroupName->addItem( aGroupName );
+ }
+ }
+ else {
+ SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGroup );
+ if ( !aGeomGroup->_is_nil() ) {
+ aGroupUsed = myMesh->ConvertToStandalone( aGeomGroup );
+ if ( !aGroupUsed->_is_nil() && idx > 0 ) {
+ myGroups[idx-1] = SMESH::SMESH_GroupBase::_duplicate(aGroupUsed);
+ SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser();
+ }
+ }
+ else
+ aGroupUsed = SMESH::SMESH_Group::_narrow( aGroup );
+ }
+
+ if ( !aGroupUsed->_is_nil() ) {
+ SMESH::long_array_var anIdList = new SMESH::long_array;
+ anIdList->length( 1 );
+ anIdList[0] = anElemId;
+ aGroupUsed->Add( anIdList.inout() );
+ }
}
SALOME_ListIO aList; aList.Append( myActor->getIO() );
mySimulation->SetVisibility(false);
// SMESH::SetPointRepresentation(true);
+ QString aCurrentEntry = myEntry;
+
// get selected mesh
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
return;
Handle(SALOME_InteractiveObject) anIO = aList.First();
+ myEntry = anIO->getEntry();
myMesh = SMESH::GetMeshByIO(anIO);
if (myMesh->_is_nil())
return;
+ // process groups
+ if ( !myMesh->_is_nil() && myEntry != aCurrentEntry ) {
+ myGroups.clear();
+ ComboBox_GroupName->clear();
+ ComboBox_GroupName->addItem( QString() );
+ SMESH::ListOfGroups aListOfGroups = *myMesh->GetGroups();
+ for ( int i = 0, n = aListOfGroups.length(); i < n; i++ ) {
+ SMESH::SMESH_GroupBase_var aGroup = aListOfGroups[i];
+ if ( !aGroup->_is_nil() && aGroup->GetType() == (SMESH::ElementType)myElementType ) {
+ QString aGroupName( aGroup->GetName() );
+ if ( !aGroupName.isEmpty() ) {
+ myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup));
+ ComboBox_GroupName->addItem( aGroupName );
+ }
+ }
+ }
+ }
+
myActor = SMESH::FindActorByEntry(anIO->getEntry());
if (!myActor)
return;
ClickOnHelp();
}
}
+
+//=================================================================================
+// function : isValid
+// purpose :
+//=================================================================================
+bool SMESHGUI_AddMeshElementDlg::isValid()
+{
+ if( GroupGroups->isChecked() && ComboBox_GroupName->currentText().isEmpty() ) {
+ SUIT_MessageBox::warning( this, tr( "SMESH_WRN_WARNING" ), tr( "GROUP_NAME_IS_EMPTY" ) );
+ return false;
+ }
+ return true;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_AddMeshElementDlg.h
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
+class QComboBox;
class QGroupBox;
class QLabel;
class QLineEdit;
void keyPressEvent( QKeyEvent* );
void displaySimulation();
+ bool isValid();
+
+ typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
+
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
int myNbOkNodes; /* to check when arguments is defined */
SMESH::SMESH_Mesh_var myMesh;
SMESH_Actor* myActor;
SMESH::TElementSimulation* mySimulation;
+ QString myEntry;
+ GrpList myGroups;
QGroupBox* GroupConstructors;
QRadioButton* Constructor1;
+ QGroupBox* GroupGroups;
+ QLabel* TextLabel_GroupName;
+ QComboBox* ComboBox_GroupName;
QGroupBox* GroupButtons;
QPushButton* buttonOk;
QPushButton* buttonCancel;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_AddMeshElementDlg.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_MeshUtils.h"
+#include "SMESHGUI_GroupUtils.h"
#include "SMESHGUI_IdValidator.h"
#include <SMESH_Actor.h>
#include <vtkCellType.h>
// Qt includes
+#include <QComboBox>
#include <QGroupBox>
#include <QLabel>
#include <QLineEdit>
aGroupArgumentsLayout->addWidget(myTable, 1, 0, 1, 3);
aGroupArgumentsLayout->addWidget(myReverseCB, 2, 0, 1, 3);
+ /***************************************************************/
+ GroupGroups = new QGroupBox( tr( "SMESH_ADD_TO_GROUP" ), this );
+ GroupGroups->setCheckable( true );
+ QHBoxLayout* GroupGroupsLayout = new QHBoxLayout(GroupGroups);
+ GroupGroupsLayout->setSpacing(SPACING);
+ GroupGroupsLayout->setMargin(MARGIN);
+
+ TextLabel_GroupName = new QLabel( tr( "SMESH_GROUP" ), GroupGroups );
+ ComboBox_GroupName = new QComboBox( GroupGroups );
+ ComboBox_GroupName->setEditable( true );
+
+ GroupGroupsLayout->addWidget( TextLabel_GroupName );
+ GroupGroupsLayout->addWidget( ComboBox_GroupName, 1 );
+
/***************************************************************/
GroupButtons = new QGroupBox(this);
QHBoxLayout* aGroupButtonsLayout = new QHBoxLayout(GroupButtons);
/***************************************************************/
aDialogLayout->addWidget(GroupConstructors);
aDialogLayout->addWidget(GroupArguments);
+ aDialogLayout->addWidget(GroupGroups);
aDialogLayout->addWidget(GroupButtons);
Init(); /* Initialisations */
myRadioButton1->setChecked(true);
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
+ /* reset "Add to group" control */
+ GroupGroups->setChecked( false );
+
myActor = 0;
int aNumRows;
//=================================================================================
void SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
{
+ if( !isValid() )
+ return;
+
if ( mySMESHGUI->isActiveStudyLocked() || myBusy || !IsValid() )
return;
for (int i = 0; i < aNumberOfIds; i++)
anArrayOfIdeces[i] = anIds[ i ];
+ bool addToGroup = GroupGroups->isChecked();
+ QString aGroupName;
+
+ SMESH::SMESH_GroupBase_var aGroup;
+ int idx = 0;
+ if( addToGroup ) {
+ aGroupName = ComboBox_GroupName->currentText();
+ for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) {
+ QString aName = ComboBox_GroupName->itemText( i );
+ if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) )
+ idx = i;
+ }
+ if ( idx > 0 ) {
+ SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( myGroups[idx-1] );
+ if ( !aGeomGroup->_is_nil() ) {
+ int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ),
+ tr( "MESH_STANDALONE_GRP_CHOSEN" ).arg( aGroupName ),
+ tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 );
+ if ( res == 1 ) return;
+ }
+ aGroup = myGroups[idx-1];
+ }
+ }
+
+ SMESH::ElementType anElementType;
+ long anElemId = -1;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
switch (myType) {
case QUAD_EDGE:
- aMeshEditor->AddEdge(anArrayOfIdeces.inout()); break;
+ anElementType = SMESH::EDGE;
+ anElemId = aMeshEditor->AddEdge(anArrayOfIdeces.inout()); break;
case QUAD_TRIANGLE:
case QUAD_QUADRANGLE:
- aMeshEditor->AddFace(anArrayOfIdeces.inout()); break;
+ anElementType = SMESH::FACE;
+ anElemId = aMeshEditor->AddFace(anArrayOfIdeces.inout()); break;
case QUAD_TETRAHEDRON:
case QUAD_PYRAMID:
case QUAD_PENTAHEDRON:
case QUAD_HEXAHEDRON:
- aMeshEditor->AddVolume(anArrayOfIdeces.inout()); break;
+ anElementType = SMESH::VOLUME;
+ anElemId = aMeshEditor->AddVolume(anArrayOfIdeces.inout()); break;
+ default: break;
}
+ if ( anElemId != -1 && addToGroup && !aGroupName.isEmpty() ) {
+ SMESH::SMESH_Group_var aGroupUsed;
+ if ( aGroup->_is_nil() ) {
+ // create new group
+ aGroupUsed = SMESH::AddGroup( myMesh, anElementType, aGroupName );
+ if ( !aGroupUsed->_is_nil() ) {
+ myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed));
+ ComboBox_GroupName->addItem( aGroupName );
+ }
+ }
+ else {
+ SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGroup );
+ if ( !aGeomGroup->_is_nil() ) {
+ aGroupUsed = myMesh->ConvertToStandalone( aGeomGroup );
+ if ( !aGroupUsed->_is_nil() && idx > 0 ) {
+ myGroups[idx-1] = SMESH::SMESH_GroupBase::_duplicate(aGroupUsed);
+ SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser();
+ }
+ }
+ else
+ aGroupUsed = SMESH::SMESH_Group::_narrow( aGroup );
+ }
+
+ if ( !aGroupUsed->_is_nil() ) {
+ SMESH::long_array_var anIdList = new SMESH::long_array;
+ anIdList->length( 1 );
+ anIdList[0] = anElemId;
+ aGroupUsed->Add( anIdList.inout() );
+ }
+ }
+
SALOME_ListIO aList; aList.Append( myActor->getIO() );
mySelector->ClearIndex();
mySelectionMgr->setSelectedObjects( aList, false );
if (myBusy) return;
BusyLocker lock( myBusy );
+ QString aCurrentEntry = myEntry;
+
if ( myIsEditCorners )
{
// clear
}
Handle(SALOME_InteractiveObject) anIO = aList.First();
+ myEntry = anIO->getEntry();
myMesh = SMESH::GetMeshByIO(anIO);
if (myMesh->_is_nil()) {
updateButtons();
myActor = SMESH::FindActorByEntry(anIO->getEntry());
}
+
+ // process groups
+ if ( !myMesh->_is_nil() && myEntry != aCurrentEntry ) {
+ SMESH::ElementType anElementType;
+ switch ( myType ) {
+ case QUAD_EDGE:
+ anElementType = SMESH::EDGE; break;
+ case QUAD_TRIANGLE:
+ case QUAD_QUADRANGLE:
+ anElementType = SMESH::FACE; break;
+ case QUAD_TETRAHEDRON:
+ case QUAD_PYRAMID:
+ case QUAD_PENTAHEDRON:
+ case QUAD_HEXAHEDRON:
+ anElementType = SMESH::VOLUME; break;
+ }
+ myGroups.clear();
+ ComboBox_GroupName->clear();
+ ComboBox_GroupName->addItem( QString() );
+ SMESH::ListOfGroups aListOfGroups = *myMesh->GetGroups();
+ for ( int i = 0, n = aListOfGroups.length(); i < n; i++ ) {
+ SMESH::SMESH_GroupBase_var aGroup = aListOfGroups[i];
+ if ( !aGroup->_is_nil() && aGroup->GetType() == anElementType ) {
+ QString aGroupName( aGroup->GetName() );
+ if ( !aGroupName.isEmpty() ) {
+ myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup));
+ ComboBox_GroupName->addItem( aGroupName );
+ }
+ }
+ }
+ }
if (!myActor) {
updateButtons();
buttonOk->setEnabled( valid );
buttonApply->setEnabled( valid );
}
+
+//=================================================================================
+// function : isValid
+// purpose :
+//=================================================================================
+bool SMESHGUI_AddQuadraticElementDlg::isValid()
+{
+ if( GroupGroups->isChecked() && ComboBox_GroupName->currentText().isEmpty() ) {
+ SUIT_MessageBox::warning( this, tr( "SMESH_WRN_WARNING" ), tr( "GROUP_NAME_IS_EMPTY" ) );
+ return false;
+ }
+ return true;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_AddMeshElementDlg.h
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
+class QComboBox;
class QGroupBox;
+class QLabel;
class QLineEdit;
class QPushButton;
class QRadioButton;
~SMESHGUI_AddQuadraticElementDlg();
private:
+ typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
+
void Init();
void closeEvent( QCloseEvent* );
void hideEvent( QHideEvent* ); /* ESC key */
bool IsValid();
void updateButtons();
+ bool isValid();
+
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
int myNbCorners; /* The required number of corners */
SMESH::SMESH_Mesh_var myMesh;
SMESH_Actor* myActor;
SMESH::TElementSimulation* mySimulation;
+ QString myEntry;
+ GrpList myGroups;
int myType;
bool myIsEditCorners;
QTableWidget* myTable;
QCheckBox* myReverseCB;
+ QGroupBox* GroupGroups;
+ QLabel* TextLabel_GroupName;
+ QComboBox* ComboBox_GroupName;
+
QGroupBox* GroupButtons;
QPushButton* buttonOk;
QPushButton* buttonCancel;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_BuildCompoundDlg.cxx
// Author : Alexander KOVALEV, Open CASCADE S.A.S.
TextLabelTol = new QLabel(tr("SMESH_TOLERANCE"), GroupArgs);
TextLabelTol->setAlignment(Qt::AlignCenter);
SpinBoxTol = new SMESHGUI_SpinBox(GroupArgs);
- SpinBoxTol->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, 6);
+ SpinBoxTol->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, "len_tol_precision" );
GroupArgsLayout->addWidget(TextLabelMeshes, 0, 0);
GroupArgsLayout->addWidget(SelectButton, 0, 1);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_BuildCompoundDlg.h
// Author : Alexander KOVALEV, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_ClippingDlg.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
SMESHGUI_ClippingDlgLayout->setMargin(MARGIN);
// Controls for selecting, creating, deleting planes
- QGroupBox* GroupPlanes = new QGroupBox(tr("Clipping planes"), this);
+ QGroupBox* GroupPlanes = new QGroupBox(tr("CLIP_PLANES"), this);
QHBoxLayout* GroupPlanesLayout = new QHBoxLayout(GroupPlanes);
GroupPlanesLayout->setSpacing(SPACING);
GroupPlanesLayout->setMargin(MARGIN);
SpinBoxDistance = new SMESHGUI_SpinBox(GroupParameters);
- TextLabelRot1 = new QLabel(tr("Rotation around X (Y to Z):"), GroupParameters);
+ TextLabelRot1 = new QLabel(tr("ROTATION_AROUND_X_Y2Z"), GroupParameters);
SpinBoxRot1 = new SMESHGUI_SpinBox(GroupParameters);
- TextLabelRot2 = new QLabel(tr("Rotation around Y (X to Z):"), GroupParameters);
+ TextLabelRot2 = new QLabel(tr("ROTATION_AROUND_Y_X2Z"), GroupParameters);
SpinBoxRot2 = new SMESHGUI_SpinBox(GroupParameters);
- PreviewCheckBox = new QCheckBox(tr("Show preview"), GroupParameters);
+ PreviewCheckBox = new QCheckBox(tr("SHOW_PREVIEW"), GroupParameters);
PreviewCheckBox->setChecked(true);
- AutoApplyCheckBox = new QCheckBox(tr("Auto Apply"), GroupParameters);
+ AutoApplyCheckBox = new QCheckBox(tr("AUTO_APPLY"), GroupParameters);
AutoApplyCheckBox->setChecked(false);
GroupParametersLayout->addWidget(TextLabelOrientation, 0, 0);
SMESHGUI_ClippingDlgLayout->addWidget(GroupButtons);
// Initial state
- SpinBoxDistance->RangeStepAndValidator(0.0, 1.0, 0.01, 3);
- SpinBoxRot1->RangeStepAndValidator(-180.0, 180.0, 1, 3);
- SpinBoxRot2->RangeStepAndValidator(-180.0, 180.0, 1, 3);
+ SpinBoxDistance->RangeStepAndValidator(0.0, 1.0, 0.01, "length_precision" );
+ SpinBoxRot1->RangeStepAndValidator(-180.0, 180.0, 1, "angle_precision" );
+ SpinBoxRot2->RangeStepAndValidator(-180.0, 180.0, 1, "angle_precision" );
- ComboBoxOrientation->addItem(tr("|| X-Y"));
- ComboBoxOrientation->addItem(tr("|| Y-Z"));
- ComboBoxOrientation->addItem(tr("|| Z-X"));
+ ComboBoxOrientation->addItem(tr("ALONG_XY"));
+ ComboBoxOrientation->addItem(tr("ALONG_YZ"));
+ ComboBoxOrientation->addItem(tr("ALONG_ZX"));
SpinBoxDistance->SetValue(0.5);
return;
if (theItem == 0) {
- TextLabelRot1->setText(tr("Rotation around X (Y to Z):"));
- TextLabelRot2->setText(tr("Rotation around Y (X to Z):"));
+ TextLabelRot1->setText(tr("ROTATION_AROUND_X_Y2Z"));
+ TextLabelRot2->setText(tr("ROTATION_AROUND_Y_X2Z"));
}
else if (theItem == 1) {
- TextLabelRot1->setText(tr("Rotation around Y (Z to X):"));
- TextLabelRot2->setText(tr("Rotation around Z (Y to X):"));
+ TextLabelRot1->setText(tr("ROTATION_AROUND_Y_Z2X"));
+ TextLabelRot2->setText(tr("ROTATION_AROUND_Z_Y2X"));
}
else if (theItem == 2) {
- TextLabelRot1->setText(tr("Rotation around Z (X to Y):"));
- TextLabelRot2->setText(tr("Rotation around X (Z to Y):"));
+ TextLabelRot1->setText(tr("ROTATION_AROUND_Z_X2Y"));
+ TextLabelRot2->setText(tr("ROTATION_AROUND_X_Z2Y"));
}
if((QComboBox*)sender() == ComboBoxOrientation)
QString aName;
for(int i = 1; i<=aNbPlanes; i++) {
- aName = QString(tr("Plane# %1")).arg(i);
+ aName = QString(tr("PLANE_NUM")).arg(i);
ComboBoxPlanes->addItem(aName);
}
if (anIsControlsEnable) {
onSelectPlane(aPos);
} else {
- ComboBoxPlanes->addItem(tr("No planes"));
+ ComboBoxPlanes->addItem(tr("NO_PLANES"));
SpinBoxRot1->SetValue(0.0);
SpinBoxRot2->SetValue(0.0);
SpinBoxDistance->SetValue(0.5);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_ClippingDlg.h
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_ComputeDlg.cxx
// Author : Edward AGAPOV, Open CASCADE S.A.S.
// SMESH includes
#include "SMESHGUI_MeshInfosBox.h"
#include "SMESHGUI_HypothesesUtils.h"
#include "SMESHGUI_MeshEditPreview.h"
+#include "SMESHGUI_MeshOrderOp.h"
+#include "SMESHGUI_MeshOrderDlg.h"
+
#include "SMESH_ActorUtils.h"
#include <SMDS_SetIterator.hxx>
myHelpFileName = "about_meshes_page.html"; // V4
}
+SMESH::SMESH_Mesh_ptr SMESHGUI_BaseComputeOp::getMesh()
+{
+ LightApp_SelectionMgr* Sel = selectionMgr();
+ SALOME_ListIO selected; Sel->selectedObjects( selected );
+ Handle(SALOME_InteractiveObject) anIO = selected.First();
+ SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(anIO);
+ return myMesh->_is_nil() ? aMesh._retn() : SMESH::SMESH_Mesh::_duplicate( myMesh );
+}
+
//================================================================================
/*!
* \brief Start operation
{
QTableWidget* tbl = aCompDlg->myTable;
SMESH::long_array_var aRes = myMesh->GetMeshInfo();
- aCompDlg->myFullInfo->SetMeshInfo( aRes );
+ aCompDlg->myBriefInfo->SetMeshInfo( aRes );
aCompDlg->myBriefInfo->show();
aCompDlg->myFullInfo->hide();
computeMesh();
}
+//================================================================================
+/*!
+ * \brief check the same operations on the same mesh
+ */
+//================================================================================
+
+bool SMESHGUI_BaseComputeOp::isValid( SUIT_Operation* theOp ) const
+{
+ SMESHGUI_BaseComputeOp* baseOp = dynamic_cast<SMESHGUI_BaseComputeOp*>( theOp );
+ bool ret = true;
+ if ( !myMesh->_is_nil() && baseOp ) {
+ SMESH::SMESH_Mesh_var aMesh = baseOp->getMesh();
+ if ( !aMesh->_is_nil() && aMesh->GetId() == myMesh->GetId() ) ret = false;
+ }
+ return ret;
+}
+
//================================================================================
/*!
* \brief Gets dialog of this operation
SMESHGUI_PrecomputeOp::SMESHGUI_PrecomputeOp()
: SMESHGUI_BaseComputeOp(),
myDlg( 0 ),
+ myOrderMgr( 0 ),
myActiveDlg( 0 ),
myPreviewDisplayer( 0 )
{
{
delete myDlg;
myDlg = 0;
+ delete myOrderMgr;
+ myOrderMgr = 0;
myActiveDlg = 0;
if ( myPreviewDisplayer )
delete myPreviewDisplayer;
if (myMesh->_is_nil())
return;
+ if (myDlg->getPreviewMode() == -1)
+ {
+ // nothing to preview
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"),
+ tr("SMESH_WRN_NOTHING_PREVIEW"));
+ onCancel();
+ return;
+ }
+
// disconnect slot from preview dialog to have Apply from results of compute operation only
disconnect( myDlg, SIGNAL( dlgOk() ), this, SLOT( onOk() ) );
disconnect( myDlg, SIGNAL( dlgApply() ), this, SLOT( onApply() ) );
modes.append( SMESH::DIM_1D );
}
+ myOrderMgr = new SMESHGUI_MeshOrderMgr( myDlg->getMeshOrderBox() );
+ myOrderMgr->SetMesh( myMesh );
+ bool isOrder = myOrderMgr->GetMeshOrder(myPrevOrder);
+ myDlg->getMeshOrderBox()->setShown(isOrder);
+ if ( !isOrder ) {
+ delete myOrderMgr;
+ myOrderMgr = 0;
+ }
+
myDlg->setPreviewModes( modes );
}
void SMESHGUI_PrecomputeOp::onCompute()
{
myDlg->hide();
+ if (myOrderMgr && myOrderMgr->IsOrderChanged())
+ myOrderMgr->SetMeshOrder();
myMapShapeId.clear();
myActiveDlg = computeDlg();
computeMesh();
return;
}
+ bool isRestoreOrder = false;
if ( myActiveDlg == myDlg && !myMesh->_is_nil() && myMapShapeId.count() )
{
// ask to remove already computed mesh elements
QMap<int,int>::const_iterator it = myMapShapeId.constBegin();
for ( ; it != myMapShapeId.constEnd(); ++it )
myMesh->ClearSubMesh( *it );
+ isRestoreOrder = true;
}
}
+
+ // return previous mesh order
+ if (myOrderMgr && myOrderMgr->IsOrderChanged()) {
+ if (!isRestoreOrder)
+ isRestoreOrder =
+ (SUIT_MessageBox::question( desktop(), tr( "SMESH_WARNING" ),
+ tr( "SMESH_REJECT_MESH_ORDER" ),
+ tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 ) == 0);
+ if (isRestoreOrder)
+ myOrderMgr->SetMeshOrder(myPrevOrder);
+ }
+
+ delete myOrderMgr;
+ myOrderMgr = 0;
+
myMapShapeId.clear();
SMESHGUI_BaseComputeOp::onCancel();
}
_PTR(SObject) aMeshSObj = SMESH::FindSObject(myMesh);
if ( !aMeshSObj )
return;
+
+ // set modified submesh priority if any
+ if (myOrderMgr && myOrderMgr->IsOrderChanged())
+ myOrderMgr->SetMeshOrder();
+
// Compute preview of mesh,
// i.e. compute mesh till indicated dimension
int dim = myDlg->getPreviewMode();
//================================================================================
SMESHGUI_PrecomputeDlg::SMESHGUI_PrecomputeDlg( QWidget* parent )
- : SMESHGUI_Dialog( parent, false, false, OK | Cancel | Help )
+ : SMESHGUI_Dialog( parent, false, false, OK | Cancel | Help ),
+ myOrderBox(0)
{
setWindowTitle( tr( "CAPTION" ) );
QVBoxLayout* layout = new QVBoxLayout( main );
+ myOrderBox = new SMESHGUI_MeshOrderBox( main );
+ layout->addWidget(myOrderBox);
+
QFrame* frame = new QFrame( main );
layout->setMargin(0); layout->setSpacing(0);
layout->addWidget( frame );
return myPreviewMode->currentId();
}
+//================================================================================
+/*!
+ * \brief Returns current preview mesh mode
+*/
+//================================================================================
+
+SMESHGUI_MeshOrderBox* SMESHGUI_PrecomputeDlg::getMeshOrderBox() const
+{
+ return myOrderBox;
+}
+
//================================================================================
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_ComputeDlg.h
// Author : Edward AGAPOV, Open CASCADE S.A.S.
//
// Qt includes
#include <QMap>
+#include <QList>
#include <QPointer>
#include <QGroupBox>
SMESHGUI_BaseComputeOp();
virtual ~SMESHGUI_BaseComputeOp();
+ SMESH::SMESH_Mesh_ptr getMesh();
+
protected:
virtual void startOperation();
virtual void stopOperation();
SMESH::compute_error_array_var&,
const bool,
const QString&);
+
+ virtual bool isValid( SUIT_Operation* theOp ) const;
protected slots:
virtual bool onApply();
protected slots:
};
+class SMESHGUI_MeshOrderMgr;
+
/*!
* \brief Operation to preview and compute a mesh and show computation errors
*/
void onCompute();
private:
+ //! private fields
QMap< int, int > myMapShapeId;
QPointer<LightApp_Dialog> myActiveDlg;
QPointer<SMESHGUI_PrecomputeDlg> myDlg;
SMESHGUI_MeshEditPreview* myPreviewDisplayer;
+ //! fields for mesh order
+ typedef QList<int> TListOfInt;
+ typedef QList<TListOfInt> TListOfListOfInt;
+ TListOfListOfInt myPrevOrder;
+ SMESHGUI_MeshOrderMgr* myOrderMgr;
};
/*!
friend class SMESHGUI_PrecomputeOp;
};
+class SMESHGUI_MeshOrderBox;
+
/*!
* \brief Dialog to preview and compute a mesh and show computation errors
*/
void setPreviewModes( const QList<int>& );
int getPreviewMode() const;
+
+ SMESHGUI_MeshOrderBox* getMeshOrderBox() const;
signals:
void preview();
private:
+ SMESHGUI_MeshOrderBox* myOrderBox;
QPushButton* myPreviewBtn;
QtxComboBox* myPreviewMode;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_ConvToQuadDlg.cxx
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_ConvToQuadDlg.h
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_ConvToQuadOp.cxx
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_ConvToQuadOp.h
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_CreatePatternDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
// SMESH includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_CreatePatternDlg.h
// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_CreatePolyhedralVolumeDlg.cxx
// Author : Michael ZORIN, Open CASCADE S.A.S.
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_MeshUtils.h"
+#include "SMESHGUI_GroupUtils.h"
#include "SMESHGUI_IdValidator.h"
#include <SMESH_Actor.h>
// Qt includes
#include <QApplication>
#include <QButtonGroup>
+#include <QComboBox>
#include <QGroupBox>
#include <QLabel>
#include <QLineEdit>
GroupContentLayout->addWidget( RemoveButton, 3, 3 );
GroupContentLayout->addWidget( Preview, 5, 0, 1, 4 );
+ /***************************************************************/
+ GroupGroups = new QGroupBox( tr( "SMESH_ADD_TO_GROUP" ), this );
+ GroupGroups->setCheckable( true );
+ QHBoxLayout* GroupGroupsLayout = new QHBoxLayout(GroupGroups);
+ GroupGroupsLayout->setSpacing(SPACING);
+ GroupGroupsLayout->setMargin(MARGIN);
+
+ TextLabel_GroupName = new QLabel( tr( "SMESH_GROUP" ), GroupGroups );
+ ComboBox_GroupName = new QComboBox( GroupGroups );
+ ComboBox_GroupName->setEditable( true );
+
+ GroupGroupsLayout->addWidget( TextLabel_GroupName );
+ GroupGroupsLayout->addWidget( ComboBox_GroupName, 1 );
+
/***************************************************************/
GroupButtons = new QGroupBox( this );
QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
/***************************************************************/
topLayout->addWidget( ConstructorsBox );
topLayout->addWidget( GroupContent );
+ topLayout->addWidget( GroupGroups );
topLayout->addWidget( GroupButtons );
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
myEditCurrentArgument = LineEditElements;
mySMESHGUI->SetActiveDialogBox( (QDialog*)this );
+ /* reset "Add to group" control */
+ GroupGroups->setChecked( false );
+
myNbOkElements = 0;
myActor = 0;
//=================================================================================
void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply()
{
+ if( !isValid() )
+ return;
+
if ( myNbOkElements>0 && !mySMESHGUI->isActiveStudyLocked())
{
if(checkEditLine(false) == -1) {return;}
busy = true;
+ long anElemId = -1;
+
+ bool addToGroup = GroupGroups->isChecked();
+ QString aGroupName;
+
+ SMESH::SMESH_GroupBase_var aGroup;
+ int idx = 0;
+ if( addToGroup ) {
+ aGroupName = ComboBox_GroupName->currentText();
+ for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) {
+ QString aName = ComboBox_GroupName->itemText( i );
+ if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) )
+ idx = i;
+ }
+ if ( idx > 0 ) {
+ SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( myGroups[idx-1] );
+ if ( !aGeomGroup->_is_nil() ) {
+ int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ),
+ tr( "MESH_STANDALONE_GRP_CHOSEN" ).arg( aGroupName ),
+ tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 );
+ if ( res == 1 ) return;
+ }
+ aGroup = myGroups[idx-1];
+ }
+ }
+
if (GetConstructorId() == 0)
{
SMESH::long_array_var anIdsOfNodes = new SMESH::long_array;
try{
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities);
+ anElemId = aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities);
}catch(SALOME::SALOME_Exception& exc){
INFOS("Follow exception was cought:\n\t"<<exc.details.text);
}catch(std::exception& exc){
try{
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces);
+ anElemId = aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces);
}catch(SALOME::SALOME_Exception& exc){
INFOS("Follow exception was cought:\n\t"<<exc.details.text);
}catch(std::exception& exc){
INFOS("Unknown exception was cought !!!");
}
}
-
+
+ if ( anElemId != -1 && addToGroup && !aGroupName.isEmpty() ) {
+ SMESH::SMESH_Group_var aGroupUsed;
+ if ( aGroup->_is_nil() ) {
+ // create new group
+ aGroupUsed = SMESH::AddGroup( myMesh, SMESH::VOLUME, aGroupName );
+ if ( !aGroupUsed->_is_nil() ) {
+ myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed));
+ ComboBox_GroupName->addItem( aGroupName );
+ }
+ }
+ else {
+ SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGroup );
+ if ( !aGeomGroup->_is_nil() ) {
+ aGroupUsed = myMesh->ConvertToStandalone( aGeomGroup );
+ if ( !aGroupUsed->_is_nil() && idx > 0 ) {
+ myGroups[idx-1] = SMESH::SMESH_GroupBase::_duplicate(aGroupUsed);
+ SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser();
+ }
+ }
+ else
+ aGroupUsed = SMESH::SMESH_Group::_narrow( aGroup );
+ }
+
+ if ( !aGroupUsed->_is_nil() ) {
+ SMESH::long_array_var anIdList = new SMESH::long_array;
+ anIdList->length( 1 );
+ anIdList[0] = anElemId;
+ aGroupUsed->Add( anIdList.inout() );
+ }
+ }
+
//SALOME_ListIO aList;
//mySelectionMgr->setSelectedObjects( aList );
SMESH::UpdateView();
mySimulation->SetVisibility(false);
+ QString aCurrentEntry = myEntry;
+
// get selected mesh
SALOME_ListIO selected;
return;
}
+ myEntry = selected.First()->getEntry();
myMesh = SMESH::GetMeshByIO( selected.First() );
if ( myMesh->_is_nil() )
return;
+ // process groups
+ if ( !myMesh->_is_nil() && myEntry != aCurrentEntry ) {
+ myGroups.clear();
+ ComboBox_GroupName->clear();
+ ComboBox_GroupName->addItem( QString() );
+ SMESH::ListOfGroups aListOfGroups = *myMesh->GetGroups();
+ for ( int i = 0, n = aListOfGroups.length(); i < n; i++ ) {
+ SMESH::SMESH_GroupBase_var aGroup = aListOfGroups[i];
+ if ( !aGroup->_is_nil() && aGroup->GetType() == SMESH::VOLUME ) {
+ QString aGroupName( aGroup->GetName() );
+ if ( !aGroupName.isEmpty() ) {
+ myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup));
+ ComboBox_GroupName->addItem( aGroupName );
+ }
+ }
+ }
+ }
+
myActor = SMESH::FindActorByObject(myMesh);
if ( !myActor )
return;
ClickOnHelp();
}
}
+
+//=================================================================================
+// function : isValid
+// purpose :
+//=================================================================================
+bool SMESHGUI_CreatePolyhedralVolumeDlg::isValid()
+{
+ if( GroupGroups->isChecked() && ComboBox_GroupName->currentText().isEmpty() ) {
+ SUIT_MessageBox::warning( this, tr( "SMESH_WRN_WARNING" ), tr( "GROUP_NAME_IS_EMPTY" ) );
+ return false;
+ }
+ return true;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_CreatePolyhedralVolumeDlg.h
// Author : Michael ZORIN, Open CASCADE S.A.S.
#include CORBA_SERVER_HEADER(SMESH_Mesh)
class QButtonGroup;
+class QComboBox;
class QGroupBox;
class QListWidget;
class QLabel;
~SMESHGUI_CreatePolyhedralVolumeDlg();
private:
+ typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
+
void Init();
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
int GetConstructorId();
void displaySimulation();
+ bool isValid();
+
int checkEditLine( bool = true ); /*! Checking for indices, return 1 if all ok, esle -1*/
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
SMESH::SMESH_Mesh_var myMesh;
SMESH_Actor* myActor;
SMESH::TPolySimulation* mySimulation;
+ QString myEntry;
+ GrpList myGroups;
QGroupBox* ConstructorsBox;
QButtonGroup* GroupConstructors;
QRadioButton* RadioButton1;
QRadioButton* RadioButton2;
QCheckBox* Preview;
+ QGroupBox* GroupGroups;
+ QLabel* TextLabel_GroupName;
+ QComboBox* ComboBox_GroupName;
QGroupBox* GroupButtons;
QPushButton* buttonOk;
QPushButton* buttonCancel;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_DeleteGroupDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
// SMESH includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_DeleteGroupDlg.h
// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_Dialog.cxx
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_Dialog.h
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : Displayer for SMESH module
// File : SMESHGUI_Displayer.cxx
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : Displayer for SMESH module
// File : SMESHGUI_Displayer.h
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_EditMeshDlg.cxx
// Author : Open CASCADE S.A.S.
#include <vtkIntArray.h>
#include <vtkProperty2D.h>
#include <vtkPointData.h>
+#include <vtkConfigure.h>
+#if !defined(VTK_XVERSION)
+#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
+#endif
// Qt includes
#include <QApplication>
myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper->SetInput(myPtsSelectVisiblePoints->GetOutput());
+#if (VTK_XVERSION < 0x050200)
myPtsLabeledDataMapper->SetLabelFormat("%g");
+#endif
myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
vtkTextProperty* aPtsTextProp = vtkTextProperty::New();
GroupMeshLayout->addWidget(SelectMeshButton);
GroupMeshLayout->addWidget(LineEditMesh);
+ /***************************************************************/
+ // Controls for switch dialog behaviour
+
+ TypeBox = new QGroupBox( tr( "SMESH_MODE" ), this );
+ GroupType = new QButtonGroup( this );
+ QHBoxLayout* aTypeBoxLayout = new QHBoxLayout( TypeBox );
+ aTypeBoxLayout->setMargin( MARGIN );
+ aTypeBoxLayout->setSpacing( SPACING );
+
+ QRadioButton* rb1 = new QRadioButton( tr( "SMESH_AUTOMATIC" ), TypeBox );
+ QRadioButton* rb2 = new QRadioButton( tr( "SMESH_MANUAL" ), TypeBox );
+ GroupType->addButton( rb1, 0 );
+ GroupType->addButton( rb2, 1 );
+ aTypeBoxLayout->addWidget( rb1 );
+ aTypeBoxLayout->addWidget( rb2 );
+
+ myTypeId = 0;
+
/***************************************************************/
// Controls for coincident elements detecting
GroupCoincident = new QGroupBox(myAction == 1 ?
tr("COINCIDENT_NODES"),
this);
- QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincident);
- GroupCoincidentLayout->setSpacing(SPACING);
- GroupCoincidentLayout->setMargin(MARGIN);
+ QVBoxLayout* aCoincidentLayout = new QVBoxLayout(GroupCoincident);
+
+ GroupCoincident->setLayout(aCoincidentLayout);
+
+ QHBoxLayout* aSpinBoxLayout = new QHBoxLayout( GroupCoincident );
if (myAction == 0) { // case merge nodes
TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), GroupCoincident);
SpinBoxTolerance = new SMESHGUI_SpinBox(GroupCoincident);
SpinBoxTolerance->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
- GroupCoincidentLayout->addWidget(TextLabelTolerance, 0, 0);
- GroupCoincidentLayout->addWidget(SpinBoxTolerance, 0, 1);
+ aSpinBoxLayout->addWidget(TextLabelTolerance);
+ aSpinBoxLayout->addWidget(SpinBoxTolerance);
+ aCoincidentLayout->addLayout(aSpinBoxLayout);
}
else {
TextLabelTolerance = 0;
SpinBoxTolerance = 0;
}
- int row = GroupCoincidentLayout->rowCount();
+ GroupCoincidentWidget = new QWidget(GroupCoincident);
+ QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincidentWidget);
+ GroupCoincidentLayout->setSpacing(SPACING);
+ GroupCoincidentLayout->setMargin(MARGIN);
- ListCoincident = new QListWidget(GroupCoincident);
+ ListCoincident = new QListWidget(GroupCoincidentWidget);
ListCoincident->setSelectionMode(QListWidget::ExtendedSelection);
- DetectButton = new QPushButton(tr("DETECT"), GroupCoincident);
- AddGroupButton = new QPushButton(tr("SMESH_BUT_ADD"), GroupCoincident);
- RemoveGroupButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupCoincident);
+ DetectButton = new QPushButton(tr("DETECT"), GroupCoincidentWidget);
+ AddGroupButton = new QPushButton(tr("SMESH_BUT_ADD"), GroupCoincidentWidget);
+ RemoveGroupButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupCoincidentWidget);
+
+ SelectAllCB = new QCheckBox(tr("SELECT_ALL"), GroupCoincidentWidget);
- SelectAllCB = new QCheckBox(tr("SELECT_ALL"), GroupCoincident);
+ if (myAction == 0)
+ GroupCoincidentWidget->hide();
+ else
+ GroupCoincident->hide();
+
+ GroupCoincidentLayout->addWidget(ListCoincident, 0, 0, 4, 2);
+ GroupCoincidentLayout->addWidget(DetectButton, 0, 2);
+ GroupCoincidentLayout->addWidget(AddGroupButton, 2, 2);
+ GroupCoincidentLayout->addWidget(RemoveGroupButton, 3, 2);
+ GroupCoincidentLayout->addWidget(SelectAllCB, 4, 0, 1, 3);
+ GroupCoincidentLayout->setRowMinimumHeight(1, 10);
+ GroupCoincidentLayout->setRowStretch(1, 5);
- GroupCoincidentLayout->addWidget(ListCoincident, row, 0, 4, 2);
- GroupCoincidentLayout->addWidget(DetectButton, row, 2);
- GroupCoincidentLayout->addWidget(AddGroupButton, row+2, 2);
- GroupCoincidentLayout->addWidget(RemoveGroupButton, row+3, 2);
- GroupCoincidentLayout->addWidget(SelectAllCB, row+4, 0, 1, 3);
- GroupCoincidentLayout->setRowMinimumHeight(row+1, 10);
- GroupCoincidentLayout->setRowStretch(row+1, 5);
+ aCoincidentLayout->addWidget(GroupCoincidentWidget);
/***************************************************************/
// Controls for editing the selected group
GroupEditLayout->addWidget(RemoveElemButton, 0, 2);
GroupEditLayout->addWidget(SetFirstButton, 1, 1, 1, 2);
+ GroupEdit->hide();
+
/***************************************************************/
GroupButtons = new QGroupBox(this);
QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
/***************************************************************/
DlgLayout->addWidget(GroupConstructors);
DlgLayout->addWidget(GroupMesh);
+ DlgLayout->addWidget(TypeBox);
DlgLayout->addWidget(GroupCoincident);
DlgLayout->addWidget(GroupEdit);
DlgLayout->addWidget(GroupButtons);
+ this->resize(10,10);
+
Init(); // Initialisations
}
void SMESHGUI_EditMeshDlg::Init()
{
if (myAction == 0) {
- SpinBoxTolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, 5);
+ SpinBoxTolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, "len_tol_precision");
SpinBoxTolerance->SetValue(1e-05);
}
RadioButton->setChecked(true);
+ GroupType->button(0)->setChecked(true);
+
myEditCurrentArgument = (QWidget*)LineEditMesh;
myActor = 0;
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
myIsBusy = false;
- // Costruction of the logical filter
- SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
- SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
-
- QList<SUIT_SelectionFilter*> aListOfFilters;
- if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
- if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
-
- myMeshOrSubMeshOrGroupFilter =
- new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
-
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(AddElemButton, SIGNAL (clicked()), this, SLOT(onAddElement()));
connect(RemoveElemButton, SIGNAL (clicked()), this, SLOT(onRemoveElement()));
connect(SetFirstButton, SIGNAL( clicked() ), this, SLOT( onSetFirst() ) );
+ connect(GroupType, SIGNAL(buttonClicked(int)), this, SLOT(onTypeChanged(int)));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
- SetFirstButton->setEnabled(false);
- buttonOk->setEnabled(false);
- buttonApply->setEnabled(false);
-
// Init Mesh field from selection
SelectionIntoArgument();
- myHelpFileName = "merging_elements_page.html";
+ // Update Buttons
+ updateControls();
+
+ if (myAction == 0)
+ myHelpFileName = "merging_nodes_page.html";
+ else
+ myHelpFileName = "merging_elements_page.html";
}
//=================================================================================
return false;
try {
+ if (myTypeId == 0)
+ onDetect();
+
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
SMESH::long_array_var anIds = new SMESH::long_array;
SMESH::array_of_long_array_var aGroupsOfElements = new SMESH::array_of_long_array;
+ if ( ListCoincident->count() == 0) {
+ if (myAction == 0)
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_WARNING"),
+ tr("SMESH_NO_NODES_DETECTED"));
+ else
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_WARNING"),
+ tr("SMESH_NO_ELEMENTS_DETECTED"));
+ return false;
+ }
+
aGroupsOfElements->length(ListCoincident->count());
int anArrayNum = 0;
else
aMeshEditor->MergeElements (aGroupsOfElements.inout());
+ if ( myTypeId == 0 ) {
+ if (myAction ==0)
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INFORMATION"),
+ tr("SMESH_MERGED_NODES").arg(QString::number(ListCoincident->count()).toLatin1().data()));
+ else
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INFORMATION"),
+ tr("SMESH_MERGED_ELEMENTS").arg(QString::number(ListCoincident->count()).toLatin1().data()));
+ }
+
+
} catch(...) {
}
SMESH::UpdateView();
-
- onDetect();
+
return true;
}
void SMESHGUI_EditMeshDlg::ClickOnCancel()
{
myIdPreview->SetPointsLabeled(false);
+ SMESH::SetPointRepresentation(false);
+ disconnect(mySelectionMgr, 0, this, 0);
+ disconnect(mySMESHGUI, 0, this, 0);
+ mySMESHGUI->ResetState();
+
mySelectionMgr->clearFilters();
//mySelectionMgr->clearSelected();
- SMESH::SetPointRepresentation(false);
+
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
- disconnect(mySelectionMgr, 0, this, 0);
- mySMESHGUI->ResetState();
+
reject();
}
{
if (ListEdit->count() == 0)
SetFirstButton->setEnabled(false);
- bool enable = !(myMesh->_is_nil()) && ListCoincident->count();
+ bool enable = !(myMesh->_is_nil()) && (ListCoincident->count() || (myTypeId == 0));
buttonOk->setEnabled(enable);
buttonApply->setEnabled(enable);
}
return;
QString anIDs = "";
- SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), anIDs);
+ int aNbElements = 0;
+ aNbElements = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), anIDs);
+
+ if (aNbElements < 1)
+ return;
ListCoincident->clearSelection();
ListCoincident->addItem(anIDs);
SMESH::SetPointRepresentation(false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
- mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
+ if (myTypeId == 1)
+ mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
}
myEditCurrentArgument->setFocus();
myActor = 0;
int nbSel = SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
- if (nbSel != 1)
+ if (nbSel != 1) {
+ myIdPreview->SetPointsLabeled(false);
+ SMESH::SetPointRepresentation(false);
+ mySelectionMgr->clearFilters();
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
return;
+ }
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type());
+ mySelectionMgr->selectedObjects(aList);
Handle(SALOME_InteractiveObject) IO = aList.First();
myMesh = SMESH::GetMeshByIO(IO);
if (myMesh->_is_nil())
return;
+
+ LineEditMesh->setText(aString);
myActor = SMESH::FindActorByEntry(IO->getEntry());
if (!myActor)
myActor = SMESH::FindActorByObject(myMesh);
- if(!myActor)
- return;
-
- mySubMeshOrGroup = SMESH::SMESH_IDSource::_nil();
- if ((!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil() || //SUBMESH OR GROUP
- !SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO)->_is_nil()) &&
- !SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil())
- mySubMeshOrGroup = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
-
- LineEditMesh->setText(aString);
-
- if (myAction == 0) {
- SMESH::SetPointRepresentation(true);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(NodeSelection);
+ if ( myActor && myTypeId ==1 ) {
+ mySubMeshOrGroup = SMESH::SMESH_IDSource::_nil();
+ mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
+
+ if ((!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil() || //SUBMESH OR GROUP
+ !SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO)->_is_nil()) &&
+ !SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil())
+ mySubMeshOrGroup = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
+
+ if (myAction == 0) {
+ SMESH::SetPointRepresentation(true);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(NodeSelection);
+ }
+ else
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(CellSelection);
}
- else
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(CellSelection);
+
+ updateControls();
}
}
{
if (GroupConstructors->isEnabled()) {
GroupConstructors->setEnabled(false);
+ TypeBox->setEnabled(false);
GroupMesh->setEnabled(false);
GroupCoincident->setEnabled(false);
GroupEdit->setEnabled(false);
/* Emit a signal to deactivate the active dialog */
mySMESHGUI->EmitSignalDeactivateDialog();
GroupConstructors->setEnabled(true);
+ TypeBox->setEnabled(true);
GroupMesh->setEnabled(true);
GroupCoincident->setEnabled(true);
GroupEdit->setEnabled(true);
ClickOnHelp();
}
}
+
+//=================================================================================
+// function : onTypeChanged()
+// purpose : the type radio button management
+//=================================================================================
+void SMESHGUI_EditMeshDlg::onTypeChanged (int id)
+{
+ if (myTypeId == id)
+ return;
+
+ myTypeId = id;
+ switch (id) {
+ case 0:
+ myIdPreview->SetPointsLabeled(false);
+ SMESH::SetPointRepresentation(false);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
+ mySelectionMgr->clearFilters();
+ if (myAction == 0)
+ GroupCoincidentWidget->hide();
+ else
+ GroupCoincident->hide();
+ GroupEdit->hide();
+ break;
+ case 1:
+ SMESH::UpdateView();
+
+ // Costruction of the logical filter
+ SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
+ SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
+
+ QList<SUIT_SelectionFilter*> aListOfFilters;
+ if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
+ if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
+
+ myMeshOrSubMeshOrGroupFilter =
+ new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
+
+ if (myAction == 0) {
+ GroupCoincidentWidget->show();
+ SMESH::SetPointRepresentation(true);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(NodeSelection);
+ }
+ else {
+ GroupCoincident->show();
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(CellSelection);
+ }
+ GroupEdit->show();
+ break;
+ }
+ updateControls();
+
+ qApp->processEvents();
+ updateGeometry();
+ resize(10,10);
+
+ SelectionIntoArgument();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_EditMeshDlg.h
// Author : Open CASCADE S.A.S.
class QRadioButton;
class QCheckBox;
class QListWidget;
+class QButtonGroup;
class SMESHGUI;
class SMESHGUI_SpinBox;
class SMESH_Actor;
int myAction;
bool myIsBusy;
+ int myTypeId;
// Widgets
QGroupBox* GroupConstructors;
QLineEdit* LineEditMesh;
QGroupBox* GroupCoincident;
+ QWidget* GroupCoincidentWidget;
QLabel* TextLabelTolerance;
SMESHGUI_SpinBox* SpinBoxTolerance;
QPushButton* DetectButton;
QPushButton* AddElemButton;
QPushButton* RemoveElemButton;
QPushButton* SetFirstButton;
+
+ QGroupBox* TypeBox;
+ QButtonGroup* GroupType;
QString myHelpFileName;
void SelectionIntoArgument();
void DeactivateActiveDialog();
void ActivateThisDialog();
+ void onTypeChanged(int);
};
#endif // SMESHGUI_EDITMESHDLG_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_ExtrusionAlongPathDlg.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S.
/***************************************************************/
// Initialisations
- XSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- YSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- ZSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- AngleSpin->RangeStepAndValidator(-180.0, 180.0, 5.0, 3);
+ XSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ YSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ ZSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ AngleSpin->RangeStepAndValidator(-180.0, 180.0, 5.0, "angle_precision");
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
//if (myMesh->_is_nil() || MeshCheck->isChecked() && myIDSource->_is_nil() ||
// !myMeshActor || myPathMesh->_is_nil() || myPathShape->_is_nil())
if ( myMesh->_is_nil() || MeshCheck->isChecked() && myIDSource->_is_nil() ||
- !myMeshActor || myPath->_is_nil() )
+ /*!myMeshActor ||*/ myPath->_is_nil() )
return false;
if (!isValid())
// If "Select whole mesh, submesh or group" check box is off ->
// use only elements of given type selected by user
- SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh();
+ SMDS_Mesh* aMesh;
+ if ( myMeshActor )
+ aMesh = myMeshActor->GetObject()->GetMesh();
+
if (aMesh) {
QStringList aListElementsId = ElementsLineEdit->text().split(" ", QString::SkipEmptyParts);
anElementsId = new SMESH::long_array;
}
//mySelectionMgr->clearSelected();
- SMESH::Update( myMeshActor->getIO(), myMeshActor->GetVisibility() );
+ if ( myMeshActor )
+ SMESH::Update( myMeshActor->getIO(), myMeshActor->GetVisibility() );
+
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
mySMESHGUI->updateObjBrowser(true); // new groups may appear
//SMESH::UpdateView();
}
// find actor
myMeshActor = SMESH::FindActorByObject(myMesh);
- if (!myMeshActor)
+ if (!myMeshActor && !MeshCheck->isChecked())
return;
if (MeshCheck->isChecked()) {
void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button)
{
disconnect(mySelectionMgr, 0, this, 0);
- mySelectionMgr->clearSelected();
+ // mySelectionMgr->clearSelected();
mySelectionMgr->clearFilters();
SMESH::SetPickable();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_ExtrusionAlongPathDlg.h
// Author : Vadim SANDLER, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_ExtrusionDlg.cxx
// Author : Michael ZORIN, Open CASCADE S.A.S.
SMESHGUI_ExtrusionDlgLayout->addWidget(GroupButtons);
/* Initialisations */
- SpinBox_Vx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, 3);
- SpinBox_Vy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, 3);
- SpinBox_Vz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, 3);
+ SpinBox_Vx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, "length_precision");
+ SpinBox_Vy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, "length_precision");
+ SpinBox_Vz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, "length_precision");
- SpinBox_Dx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_Dy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_Dz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
+ SpinBox_Dx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_Dy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_Dz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
SpinBox_NbSteps->setRange(1, 999999);
- SpinBox_VDist->RangeStepAndValidator(0, COORD_MAX, 10.0, 3);
+ SpinBox_VDist->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
RadioButton1->setChecked(true);
RadioButton3->setChecked(true);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_ExtrusionDlg.h
// Author : Michael ZORIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_FileInfoDlg.cxx
// Author : Alexandre SOLOVYOV, Open CASCADE S.A.S. (alexander.solovyov@opencascade.com)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_FileInfoDlg.h
// Author : Alexandre SOLOVYOV, Open CASCADE S.A.S. (alexander.solovyov@opencascade.com)
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMESHGUI : GUI for SMESH component
+// File : SMESHGUI_FileValidator.cxx
+// Author : Oleg UVAROV
+// SMESH includes
+//
+#include "SMESHGUI_FileValidator.h"
+
+// SALOME GUI includes
+#include <SUIT_MessageBox.h>
+#include <SUIT_Tools.h>
+
+// Qt includes
+#include <QFileInfo>
+
+//=======================================================================
+//function : SMESHGUI_FileValidator
+//purpose :
+//=======================================================================
+SMESHGUI_FileValidator::SMESHGUI_FileValidator( QWidget* parent )
+: SUIT_FileValidator( parent ),
+ myIsOverwrite( true )
+{
+}
+
+//=======================================================================
+//function : canSave
+//purpose :
+//=======================================================================
+bool SMESHGUI_FileValidator::canSave( const QString& fileName, bool checkPermission )
+{
+ if ( QFile::exists( fileName ) ) {
+ if ( parent() ) {
+ int anAnswer = SUIT_MessageBox::question( parent(), QObject::tr( "SMESH_WRN_WARNING" ),
+ QObject::tr( "SMESH_FILE_EXISTS" ).arg( fileName ),
+ QObject::tr( "SMESH_BUT_OVERWRITE" ),
+ QObject::tr( "SMESH_BUT_ADD" ),
+ QObject::tr( "SMESH_BUT_CANCEL" ), 0, 2 );
+ if( anAnswer == 2 )
+ return false;
+ myIsOverwrite = anAnswer == 0;
+ }
+
+ // copied from SUIT_FileValidator
+ if ( checkPermission && !QFileInfo( fileName ).isWritable() ) {
+ if ( parent() )
+ SUIT_MessageBox::critical( parent(), QObject::tr( "SMESH_ERROR" ),
+ QObject::tr( "NO_PERMISSION" ).arg( fileName ) );
+ return false;
+ }
+ }
+ else {
+ return SUIT_FileValidator::canSave( fileName, checkPermission );
+ }
+ return true;
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMESHGUI : GUI for SMESH component
+// File : SMESHGUI_FileValidator.h
+// Author : Oleg UVAROV
+//
+#ifndef SMESHGUI_FILEVALIDATOR_H
+#define SMESHGUI_FILEVALIDATOR_H
+
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
+
+// SALOME GUI includes
+#include <SUIT_FileValidator.h>
+
+class SMESHGUI_EXPORT SMESHGUI_FileValidator : public SUIT_FileValidator
+{
+public:
+ SMESHGUI_FileValidator( QWidget* = 0 );
+
+ virtual bool canSave( const QString&, bool = true );
+
+ bool isOverwrite() const { return myIsOverwrite; }
+
+private:
+ bool myIsOverwrite;
+};
+
+#endif // SMESHGUI_FILEVALIDATOR_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESHGUI_Filter : Filters for VTK viewer
// File : SMESHGUI_Filter.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESHGUI_Filter : Filters for VTK viewer
// File : SMESHGUI_Filter.h
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_FilterDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_FilterDlg.h
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_FilterLibraryDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_FilterLibraryDlg.h
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_FilterUtils.cxx
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_FilterUtils.h
// Author : Open CASCADE S.A.S.
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : SMESHGUI_FindElemByPointDlg.cxx
+// Author : Edward AGAPOV, Open CASCADE S.A.S.
+// SMESH includes
+//
+#include "SMESHGUI_FindElemByPointDlg.h"
+
+#include "SMESHGUI.h"
+#include "SMESHGUI_MeshUtils.h"
+#include "SMESHGUI_VTKUtils.h"
+#include "SMESHGUI_SpinBox.h"
+#include "SMESHGUI_MeshEditPreview.h"
+
+#include <SMESH_Actor.h>
+#include <SMESH_ActorUtils.h>
+#include <SMESH_TypeFilter.hxx>
+
+// SALOME GUI includes
+#include <LightApp_SelectionMgr.h>
+#include <QtxComboBox.h>
+#include <SALOME_ListIO.hxx>
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_ResourceMgr.h>
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+#include <SalomeApp_Tools.h>
+#include <SalomeApp_TypeFilter.h>
+
+// Qt includes
+#include <QAbstractButton>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QLineEdit>
+#include <QListWidget>
+#include <QPushButton>
+#include <QVBoxLayout>
+
+// VTK includes
+#include <vtkProperty.h>
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
+
+#define SPACING 6
+#define MARGIN 11
+
+//=======================================================================
+/*!
+ * \brief Dialog to find elements by a point coordinates
+ */
+//=======================================================================
+
+SMESHGUI_FindElemByPointDlg::SMESHGUI_FindElemByPointDlg()
+ : SMESHGUI_Dialog( 0, false, true, OK | Help )
+{
+ setWindowTitle(tr("CAPTION"));
+
+ QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame());
+ aDlgLay->setMargin(MARGIN);;
+ aDlgLay->setSpacing(SPACING);
+
+ QWidget* aMainFrame = createMainFrame (mainFrame());
+
+ aDlgLay->addWidget(aMainFrame);
+ aDlgLay->setStretchFactor(aMainFrame, 1);
+}
+
+//=======================================================================
+// function : createMainFrame()
+// purpose : Create frame containing dialog's input fields
+//=======================================================================
+QWidget* SMESHGUI_FindElemByPointDlg::createMainFrame (QWidget* theParent)
+{
+ QWidget* aFrame = new QWidget(theParent);
+
+ //mesh name
+
+ QGroupBox* aMeshGrp = new QGroupBox(tr("SMESH_MESH"), aFrame);
+ QHBoxLayout* aMeshGrpLayout = new QHBoxLayout(aMeshGrp);
+ aMeshGrpLayout->setMargin(MARGIN);
+ aMeshGrpLayout->setSpacing(SPACING);
+
+ myMeshName = new QLineEdit(aMeshGrp);
+ aMeshGrpLayout->addWidget(myMeshName);
+
+ // coordinates
+
+ QGroupBox* aCoordGrp = new QGroupBox(tr("SMESH_COORDINATES"), aFrame);
+ QHBoxLayout* aCoordGrpLayout = new QHBoxLayout(aCoordGrp);
+ aCoordGrpLayout->setMargin(MARGIN);
+ aCoordGrpLayout->setSpacing(SPACING);
+
+ 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);
+
+ 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");
+ myX->SetValue(0);
+ myY->SetValue(0);
+ myZ->SetValue(0);
+
+ aCoordGrpLayout->addWidget(aXLabel);
+ aCoordGrpLayout->addWidget(myX);
+ aCoordGrpLayout->addWidget(aYLabel);
+ aCoordGrpLayout->addWidget(myY);
+ aCoordGrpLayout->addWidget(aZLabel);
+ aCoordGrpLayout->addWidget(myZ);
+
+ // Elements
+
+ QGroupBox* elementGrp = new QGroupBox(tr("Elements"), aFrame);
+ QGridLayout* elementGrpLayout = new QGridLayout(elementGrp);
+ elementGrpLayout->setSpacing(SPACING);
+ elementGrpLayout->setMargin(MARGIN);
+
+
+ myFindBtn = new QPushButton(elementGrp);
+ myFindBtn->setText(tr("Find"));
+ //myFindBtn->setCheckable(false);
+
+ myElemTypeCombo = new QtxComboBox(elementGrp);
+ myElemTypeCombo->addItem( tr( "MEN_ALL" )); myElemTypeCombo->setId( 0, int( SMESH::ALL ));
+ myElemTypeCombo->addItem( tr( "MEN_NODE" )); myElemTypeCombo->setId( 1, int( SMESH::NODE ));
+ myElemTypeCombo->addItem( tr( "MEN_EDGE" )); myElemTypeCombo->setId( 2, int( SMESH::EDGE ));
+ myElemTypeCombo->addItem( tr( "MEN_FACE" )); myElemTypeCombo->setId( 3, int( SMESH::FACE ));
+ myElemTypeCombo->addItem( tr("MEN_VOLUME_3D"));myElemTypeCombo->setId( 4, int( SMESH::VOLUME));
+ myElemTypeCombo->addItem( tr( "MEN_ELEM0D" )); myElemTypeCombo->setId( 5, int( SMESH::ELEM0D));
+
+ myFoundList = new QListWidget(elementGrp);
+
+ elementGrpLayout->addWidget( myFindBtn, 0, 0 );
+ elementGrpLayout->addWidget( myElemTypeCombo, 0, 1 );
+ elementGrpLayout->addWidget( myFoundList, 1, 0, 2, 2 );
+
+
+ QVBoxLayout* aLay = new QVBoxLayout(aFrame);
+ aLay->addWidget(aMeshGrp);
+ aLay->addWidget(aCoordGrp);
+ aLay->addWidget(elementGrp);
+
+ // OK instead of "Apply and Close"
+ if ( QAbstractButton* but = button(OK) )
+ but->setText( tr("SMESH_BUT_OK"));
+
+ return aFrame;
+}
+
+//================================================================================
+/*!
+ * \brief Constructor
+*/
+//================================================================================
+
+SMESHGUI_FindElemByPointOp::SMESHGUI_FindElemByPointOp()
+ :SMESHGUI_SelectionOp()
+{
+ mySimulation = 0;
+ myDlg = new SMESHGUI_FindElemByPointDlg;
+ myHelpFileName = "find_element_by_point_page.html";
+ myFilter = new SMESH_TypeFilter( MESH );
+
+ myPreview = new SMESH::MeshPreviewStruct();
+
+ myPreview->nodesXYZ.length(1);
+ myPreview->nodesXYZ[0].x = myDlg->myX->GetValue();
+ myPreview->nodesXYZ[0].y = myDlg->myY->GetValue();
+ myPreview->nodesXYZ[0].z = myDlg->myZ->GetValue();
+
+ myPreview->elementTypes.length(1);
+ myPreview->elementTypes[0].SMDS_ElementType = SMESH::NODE;
+ myPreview->elementTypes[0].isPoly = false;
+ myPreview->elementTypes[0].nbNodesInElement = 1;
+
+ myPreview->elementConnectivities.length(1);
+ myPreview->elementConnectivities[0] = 0;
+
+ // connect signals and slots
+ connect(myDlg->myFindBtn, SIGNAL(clicked()), this, SLOT(onFind()));
+ 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->myFoundList, SIGNAL(itemSelectionChanged()), this, SLOT(onElemSelected()));
+ connect(myDlg->myElemTypeCombo,SIGNAL(currentIndexChanged(int)),this, SLOT(onElemTypeChange(int)));
+}
+
+//=======================================================================
+// function : startOperation()
+// purpose : Init dialog fields, connect signals and slots, show dialog
+//=======================================================================
+void SMESHGUI_FindElemByPointOp::startOperation()
+{
+ // init simulation with a current View
+ if ( mySimulation ) delete mySimulation;
+ mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( getSMESHGUI() ));
+ vtkProperty* aProp = vtkProperty::New();
+ aProp->SetRepresentationToWireframe();
+ aProp->SetColor(250, 0, 250);
+ aProp->SetPointSize(5);
+ aProp->SetLineWidth( SMESH::GetFloat("SMESH:element_width",1) + 1);
+ mySimulation->GetActor()->SetProperty(aProp);
+ aProp->Delete();
+
+ myDlg->myElemTypeCombo->setCurrentId( int(SMESH::ALL));
+
+ SMESHGUI_SelectionOp::startOperation();
+ myDlg->show();
+ redisplayPreview();
+
+ onSelectionDone(); // init myMesh
+}
+
+//================================================================================
+/*!
+ * \brief Stops operation
+ */
+//================================================================================
+
+void SMESHGUI_FindElemByPointOp::stopOperation()
+{
+ if ( mySimulation )
+ {
+ mySimulation->SetVisibility(false);
+ delete mySimulation;
+ mySimulation = 0;
+ }
+ selectionMgr()->removeFilter( myFilter );
+ SMESHGUI_SelectionOp::stopOperation();
+}
+
+//================================================================================
+/*!
+ * \brief hilight found selected elements
+ */
+//================================================================================
+
+void SMESHGUI_FindElemByPointOp::onElemSelected()
+{
+ if ( !myMeshIO.IsNull() )
+ {
+ Selection_Mode selMode =
+ myDlg->myElemTypeCombo->currentId() == int(SMESH::NODE) ? NodeSelection : CellSelection;
+ if ( selectionMode() != selMode )
+ setSelectionMode( selMode );
+
+ QList<QListWidgetItem *> ids = myDlg->myFoundList->selectedItems();
+ QList<QListWidgetItem*>::iterator id = ids.begin();
+ TColStd_MapOfInteger idMap;
+ for ( ; id != ids.end(); ++id )
+ idMap.Add( (*id)->text().toInt() );
+
+ addOrRemoveIndex( myMeshIO, idMap, false );
+
+ SALOME_ListIO aList;
+ aList.Append(myMeshIO);
+ selectionMgr()->setSelectedObjects(aList,false);
+ }
+}
+
+//================================================================================
+/*!
+ * \brief Set selection mode according to element type
+ */
+//================================================================================
+
+void SMESHGUI_FindElemByPointOp::onElemTypeChange(int index)
+{
+ Selection_Mode newMode = (index == 1) ? NodeSelection : CellSelection;
+ if ( selectionMode() != newMode )
+ {
+ selectionMgr()->clearFilters();
+ setSelectionMode( newMode );
+ }
+ myDlg->myFoundList->clear();
+}
+
+//================================================================================
+/*!
+ * \brief perform it's intention action: find elements
+ */
+//================================================================================
+
+void SMESHGUI_FindElemByPointOp::onFind()
+{
+ if ( myMesh->_is_nil() ) {
+ return;
+ }
+
+ try {
+ SUIT_OverrideCursor wc;
+
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+ if (aMeshEditor->_is_nil())
+ return;
+
+ SMESH::long_array_var foundIds =
+ aMeshEditor->FindElementsByPoint( myDlg->myX->GetValue(),
+ myDlg->myY->GetValue(),
+ myDlg->myZ->GetValue(),
+ SMESH::ElementType( myDlg->myElemTypeCombo->currentId() ));
+ myDlg->myFoundList->clear();
+ for ( int i = 0; i < foundIds->length(); ++i )
+ myDlg->myFoundList->addItem( QString::number( foundIds[i] ));
+
+ if ( foundIds->length() > 0 )
+ myDlg->myFoundList->setCurrentRow(0);
+ }
+ catch (const SALOME::SALOME_Exception& S_ex) {
+ SalomeApp_Tools::QtCatchCorbaException(S_ex);
+ }
+ catch (...) {
+ }
+}
+
+//================================================================================
+/*!
+ * \brief Method needed for internal cuisine
+ */
+//================================================================================
+
+bool SMESHGUI_FindElemByPointOp::onApply()
+{
+ return true;
+}
+
+//================================================================================
+/*!
+ * \brief SLOT called when selection changed
+ */
+//================================================================================
+
+void SMESHGUI_FindElemByPointOp::onSelectionDone()
+{
+ if ( !myDlg->isVisible() || !myDlg->isEnabled() )
+ return;
+
+ QString oldMeshEntry, newMeshEntry;
+ if ( !myMeshIO.IsNull() && myMeshIO->hasEntry() )
+ oldMeshEntry = myMeshIO->getEntry();
+
+ myDlg->myMeshName->setText("");
+ myMeshIO.Nullify();
+
+ try {
+ SALOME_ListIO aList;
+ selectionMgr()->selectedObjects(aList, SVTK_Viewer::Type());
+ if (aList.Extent() == 1 && aList.First()->hasEntry())
+ {
+ Handle(SALOME_InteractiveObject) anIO = aList.First();
+ _PTR(SObject) pObj = studyDS()->FindObjectID(anIO->getEntry());
+ myMesh = SMESH::GetMeshByIO( anIO );
+ if ( pObj && !myMesh->_is_nil() )
+ {
+ myMeshIO = anIO;
+ myDlg->myMeshName->setText( pObj->GetName().c_str() );
+ newMeshEntry = anIO->getEntry();
+ }
+ }
+ }
+ catch (...) {
+ }
+
+ if ( oldMeshEntry != newMeshEntry || newMeshEntry.isEmpty() )
+ myDlg->myFoundList->clear();
+
+ myDlg->myFindBtn->setEnabled( !myMeshIO.IsNull() );
+}
+
+//================================================================================
+/*!
+ * \brief show point by coordinates
+ */
+//================================================================================
+
+void SMESHGUI_FindElemByPointOp::redisplayPreview()
+{
+ myDlg->myFoundList->clear();
+
+ myPreview->nodesXYZ[0].x = myDlg->myX->GetValue();
+ myPreview->nodesXYZ[0].y = myDlg->myY->GetValue();
+ myPreview->nodesXYZ[0].z = myDlg->myZ->GetValue();
+
+ mySimulation->SetData(&myPreview.in());
+}
+
+//================================================================================
+/*!
+ * \brief install filter on meshes
+ */
+//================================================================================
+
+void SMESHGUI_FindElemByPointOp::activateSelection()
+{
+ selectionMgr()->clearFilters();
+ selectionMgr()->installFilter( myFilter );
+}
+
+//================================================================================
+/*!
+ * \brief Destructor
+*/
+//================================================================================
+
+SMESHGUI_FindElemByPointOp::~SMESHGUI_FindElemByPointOp()
+{
+ if ( myDlg ) { delete myDlg; myDlg = 0; }
+ if ( mySimulation ) { delete mySimulation; mySimulation = 0; }
+ if ( myFilter ) { delete myFilter; myFilter = 0; }
+}
+
+//================================================================================
+/*!
+ * \brief Gets dialog of this operation
+ * \retval LightApp_Dialog* - pointer to dialog of this operation
+ */
+//================================================================================
+
+LightApp_Dialog* SMESHGUI_FindElemByPointOp::dlg() const
+{
+ return myDlg;
+}
+
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef SMESHGUI_FindElemByPointDLG_H
+#define SMESHGUI_FindElemByPointDLG_H
+
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
+
+#include "SMESHGUI_Dialog.h"
+#include "SMESHGUI_SelectionOp.h"
+
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
+
+class QLineEdit;
+class QPushButton;
+class QListWidget;
+class QtxComboBox;
+class SMESHGUI_SpinBox;
+class SMESHGUI_MeshEditPreview;
+class SMESHGUI_FindElemByPointDlg;
+
+/*!
+ * \brief Operation to find elements by a point coordinates
+ */
+class SMESHGUI_EXPORT SMESHGUI_FindElemByPointOp: public SMESHGUI_SelectionOp
+{
+ Q_OBJECT
+
+public:
+ SMESHGUI_FindElemByPointOp();
+ virtual ~SMESHGUI_FindElemByPointOp();
+
+ virtual LightApp_Dialog* dlg() const;
+
+protected:
+
+ virtual void startOperation();
+ virtual void stopOperation();
+
+ virtual void activateSelection();
+
+protected slots:
+
+ virtual void onFind();
+ virtual bool onApply();
+
+private slots:
+ void onSelectionDone();
+ void onElemSelected();
+ void onElemTypeChange(int);
+ void redisplayPreview();
+
+private:
+ SMESHGUI_FindElemByPointDlg* myDlg;
+
+ SUIT_SelectionFilter* myFilter;
+ SMESHGUI_MeshEditPreview* mySimulation; // to show point coordinates
+ //SMESH_Actor* myMeshActor; // to show found elements
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH::MeshPreviewStruct_var myPreview;
+ Handle(SALOME_InteractiveObject) myMeshIO;
+};
+
+/*!
+ * \brief Dialog to find elements by a point coordinates
+ */
+
+class SMESHGUI_EXPORT SMESHGUI_FindElemByPointDlg : public SMESHGUI_Dialog
+{
+ Q_OBJECT
+
+public:
+ SMESHGUI_FindElemByPointDlg();
+
+private:
+ QWidget* createMainFrame( QWidget* );
+
+ QLineEdit* myMeshName;
+ SMESHGUI_SpinBox* myX;
+ SMESHGUI_SpinBox* myY;
+ SMESHGUI_SpinBox* myZ;
+ QtxComboBox* myElemTypeCombo;
+ QPushButton* myFindBtn;
+ QListWidget* myFoundList;
+
+ QString myHelpFileName;
+
+ friend class SMESHGUI_FindElemByPointOp;
+
+private slots:
+//void ButtonToggled( bool );
+};
+
+#endif // SMESHGUI_FindElemByPointDLG_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_GEOMGenUtils.cxx
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_GEOMGenUtils.h
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_GroupDlg.cxx
// Author : Natalia KOPNOVA, Open CASCADE S.A.S.
// SMESH includes
-
+//
#include "SMESHGUI_GroupDlg.h"
#include "SMESHGUI.h"
if (!aGroupShape->_is_nil())
{
_PTR(SObject) aGroupShapeSO = aStudy->FindObjectID(aGroupShape->GetStudyEntry());
- aShapeName = aGroupShapeSO->GetName().c_str();
+ if ( aGroupShapeSO )
+ aShapeName = aGroupShapeSO->GetName().c_str();
}
myGeomGroupLine->setText( aShapeName );
myNameChanged = true;
} else {
// try mesh actor
SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh);
- if (anActor && anActor->hasIO())
- {
- isActor = true;
- if (aViewWindow && !aViewWindow->isVisible(anActor->getIO()))
- isActor = false;
- else
- myActorsList.append(anActor);
- }
+ if (anActor && anActor->hasIO()) {
+ isActor = true;
+ if (aViewWindow && !aViewWindow->isVisible(anActor->getIO()))
+ isActor = false;
+ else
+ myActorsList.append(anActor);
+ }
+
+ // try group actor
+ if (!isActor && !myGroup->_is_nil()) {
+ SMESH_Actor* anActor = SMESH::FindActorByObject(myGroup);
+ if (anActor && anActor->hasIO())
+ myActorsList.append(anActor);
+ }
// try any visible actor of group or submesh of current mesh
if (aViewWindow) {
if (anActor && anActor->hasIO()) {
Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
if (aViewWindow->isVisible(anIO)) {
- if (anIO->hasEntry() && strncmp(anIO->getEntry(), meshEntry, len) == 0)
+ if (anIO->hasEntry() && strncmp(anIO->getEntry(), meshEntry, len) == 0 && !myActorsList.contains(anActor) )
myActorsList.append(anActor);
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_GroupDlg.h
// Author : Natalia KOPNOVA, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_GroupOnShapeDlg.cxx
// Created : Wed Sep 17 18:36:51 2008
: SMESHGUI_SelectionOp(ActorSelection),
myDlg( 0 )
{
- myHelpFileName = "creating_groups_page.html";
+ myHelpFileName = "create_groups_from_geometry_page.html";
}
SMESHGUI_GroupOnShapeOp::~SMESHGUI_GroupOnShapeOp()
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_GroupOnShapeDlg.h
// Author : Edard AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_GroupOpDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_GroupOpDlg.h
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_GroupUtils.cxx
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_GroupUtils.h
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_Hypotheses.cxx
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_Hypotheses.h
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_HypothesesUtils.cxx
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
-
// SMESH includes
+//
#include "SMESHGUI_HypothesesUtils.h"
#include "SMESHGUI.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_HypothesesUtils.h
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
-
+//
#ifndef SMESHGUI_HYPOTHESESUTILS_H
#define SMESHGUI_HYPOTHESESUTILS_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_IdValidator.h
// Author : Edward AGAPOV, Open CASCADE S.A.S.
-// Copyright (C) 2007-2009 CEA/DEN, EDF R&D, OPEN 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-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_Make2DFrom3DOp.cxx
// Author : Open CASCADE S.A.S.
// SMESH includes
-// Copyright (C) 2007-2009 CEA/DEN, EDF R&D, OPEN 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-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_Make2DFrom3D.h
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_MakeNodeAtPointDlg.cxx
// Author : Edward AGAPOV, Open CASCADE S.A.S.
// SMESH includes
QLabel* aZLabel = new QLabel(tr("SMESH_Z"), aCoordGrp);
myZ = new SMESHGUI_SpinBox(aCoordGrp);
- myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
- myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
- myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
+ 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");
aCoordGrpLayout->addWidget(myCoordBtn);
aCoordGrpLayout->addWidget(aXLabel);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_MakeNodeAtPointDlg.h
// Author : Edward AGAPOV, Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshDlg.h
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshEditPreview.cxx
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshEditPreview.h
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_MeshInfosBox.cxx
// Author : Edward AGAPOV, Open CASCADE S.A.S.
// SMESH includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_MeshInfosBox.h
// Author : Edward AGAPOV, Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshInfosDlg.cxx
// Author : Nicolas BARBEROU
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshInfosDlg.h
// Author : Nicolas BARBEROU
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshOp.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-
// SMESH includes
+//
#include "SMESHGUI_MeshOp.h"
#include "SMESHGUI.h"
}
}
- return SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType.toLatin1().data(),
- aServerLib.toLatin1().data(),
- aMeshVar,
- aGeomVar,
- /*byMesh = */isSubMesh);
-
+ SMESH::SMESH_Hypothesis_var hyp =
+ SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType.toLatin1().data(),
+ aServerLib.toLatin1().data(),
+ aMeshVar,
+ aGeomVar,
+ /*byMesh = */isSubMesh);
+ if ( hyp->_is_nil() && isSubMesh )
+ hyp = SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType.toLatin1().data(),
+ aServerLib.toLatin1().data(),
+ aMeshVar,
+ aGeomVar,
+ /*byMesh = */false);
+ return hyp;
}
//================================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshOp.h
// Author : Sergey LITONIN, Open CASCADE S.A.S.
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : SMESHGUI_MeshOrderDlg.cxx
+// Author : Pavel TELKOV, Open CASCADE S.A.S.
+// SMESH includes
+//
+#include "SMESHGUI_MeshOrderDlg.h"
+
+// Qt includes
+#include <Qt>
+#include <QFrame>
+#include <QLabel>
+#include <QBoxLayout>
+#include <QSpacerItem>
+#include <QToolButton>
+#include <QListWidget>
+#include <QListWidgetItem>
+
+#define SPACING 6
+#define MARGIN 11
+
+/*!
+ * Enumeartion of list widget item types (mesh name or separator)
+ */
+enum MeshOrderItemType { MeshItem = QListWidgetItem::UserType, SeparatorItem };
+
+// =========================================================================================
+/*!
+ * \brief Constructor
+ */
+// =========================================================================================
+
+SMESHGUI_MeshOrderBox::SMESHGUI_MeshOrderBox(QWidget* theParent)
+: QGroupBox( theParent ), myIsChanged( false ), myUpBtn(0), myDownBtn(0)
+{
+ QHBoxLayout* hBoxLayout = new QHBoxLayout(this);
+ hBoxLayout->setMargin( MARGIN );
+ hBoxLayout->setSpacing( SPACING );
+
+ myMeshNames = new QListWidget(this);
+ myMeshNames->setSelectionMode(QAbstractItemView::SingleSelection);
+ myMeshNames->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding ));
+ hBoxLayout->addWidget(myMeshNames);
+
+ QGroupBox* btnGrp = new QGroupBox(this);
+ hBoxLayout->addWidget(btnGrp);
+
+ myUpBtn = new QToolButton(btnGrp);
+ myDownBtn = new QToolButton(btnGrp);
+ myUpBtn-> setArrowType( Qt::UpArrow );
+ myDownBtn->setArrowType( Qt::DownArrow );
+
+ QVBoxLayout* vBoxLayout = new QVBoxLayout(btnGrp);
+ vBoxLayout->addSpacerItem( new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
+ vBoxLayout->addWidget( myUpBtn );
+ vBoxLayout->addWidget( myDownBtn );
+ vBoxLayout->addSpacerItem( new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
+
+ connect( myUpBtn, SIGNAL( clicked() ), this, SLOT( onMoveItem() ) );
+ connect( myDownBtn, SIGNAL( clicked() ), this, SLOT( onMoveItem() ) );
+ connect( myMeshNames, SIGNAL( itemSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
+
+ onSelectionChanged();
+}
+
+// =========================================================================================
+/*!
+ * \brief Destructor
+ */
+//=======================================================================
+
+SMESHGUI_MeshOrderBox::~SMESHGUI_MeshOrderBox()
+{
+}
+
+// =========================================================================================
+/*!
+ * \brief add separator item
+ */
+// =========================================================================================
+
+static void addSeparator( QListWidget* theList )
+{
+ QListWidgetItem* item = new QListWidgetItem( theList, SeparatorItem );
+ QFrame* hline = new QFrame( theList );
+ hline->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ theList->addItem( item );
+ theList->setItemWidget( item, hline );
+}
+
+// =========================================================================================
+/*!
+ * \brief add sub-mesh item
+ */
+// =========================================================================================
+
+static void addMeshItem( QListWidget* theList,
+ const QString& theName,
+ const int theId )
+{
+ QListWidgetItem* item = new QListWidgetItem( theName, theList, MeshItem );
+ item->setData( Qt::UserRole, theId );
+ theList->addItem( item );
+}
+
+// =========================================================================================
+/*!
+ * \brief Clear submesh names and indeces
+ */
+// =========================================================================================
+
+void SMESHGUI_MeshOrderBox::Clear()
+{
+ myMeshNames->clear();
+ myIsChanged = false;
+}
+
+// =========================================================================================
+/*!
+ * \brief Set submesh names and indeces
+ */
+// =========================================================================================
+
+void SMESHGUI_MeshOrderBox::SetMeshes(const ListListName& theMeshNames,
+ const ListListId& theMeshIds)
+{
+ Clear();
+ ListListName::const_iterator nLIt = theMeshNames.constBegin();
+ ListListId::const_iterator idLIt = theMeshIds.constBegin();
+ for ( ; nLIt != theMeshNames.constEnd(); ++nLIt, ++idLIt )
+ {
+ const QStringList& names = (*nLIt);
+ const QList<int>& ids = (*idLIt);
+ if ( myMeshNames->count() )
+ addSeparator( myMeshNames );
+ QStringList::const_iterator nameIt = names.constBegin();
+ QList<int>::const_iterator idIt = ids.constBegin();
+ for ( ; nameIt != names.constEnd(); ++nameIt, ++idIt )
+ addMeshItem( myMeshNames, *nameIt, *idIt );
+ }
+}
+
+// =========================================================================================
+/*!
+ * \brief cehck that item exists and not a separator
+ */
+// =========================================================================================
+
+static bool checkItem(QListWidgetItem* theItem)
+{
+ return theItem && (int)theItem->type() != (int)SeparatorItem;
+}
+
+// =========================================================================================
+/*!
+ * \brief Returns result (ordered by user) mesh names
+ */
+// =========================================================================================
+
+ListListId SMESHGUI_MeshOrderBox::GetMeshIds() const
+{
+ ListListId aLLIds;
+ aLLIds.append( QList<int>() );
+ for ( int i = 0, n = myMeshNames->count(); i < n; i++ )
+ {
+ QListWidgetItem* it = myMeshNames->item( i );
+ if (checkItem( it ))
+ aLLIds.last().append( it->data( Qt::UserRole ).toInt() );
+ else // separator before next list of mesh items
+ aLLIds.append( QList<int>() );
+ }
+ return aLLIds;
+}
+
+// =========================================================================================
+/*!
+ * \brief Returns result (ordered by user) mesh indeces
+ */
+// =========================================================================================
+
+ListListName SMESHGUI_MeshOrderBox::GetMeshNames() const
+{
+ ListListName aLLNames;
+ aLLNames.append( QStringList() );
+ for ( int i = 0, n = myMeshNames->count(); i < n; i++ )
+ {
+ QListWidgetItem* it = myMeshNames->item( i );
+ if (checkItem( it ))
+ aLLNames.last().append( it->text() );
+ else // separator before next list of mesh items
+ aLLNames.append( QStringList() );
+ }
+ return aLLNames;
+}
+
+// =========================================================================================
+/*!
+ * \brief update state of arrow buttons according to selection
+ */
+// =========================================================================================
+
+void SMESHGUI_MeshOrderBox::onSelectionChanged()
+{
+ bool isUp = false;
+ bool isDown = false;
+ QList<QListWidgetItem *> items = myMeshNames->selectedItems();
+ if ( !items.isEmpty() )
+ {
+ QListWidgetItem* selItem = (*(items.begin()));
+ if (checkItem(selItem))
+ {
+ const int rowId = myMeshNames->row( selItem );
+ isUp = checkItem( myMeshNames->item( rowId - 1 ) );
+ isDown = checkItem( myMeshNames->item( rowId + 1 ) );
+ }
+ }
+ myUpBtn-> setEnabled( isUp );
+ myDownBtn->setEnabled( isDown );
+}
+
+// =========================================================================================
+/*!
+ * \brief move item according to clicked arrow button
+ */
+// =========================================================================================
+
+void SMESHGUI_MeshOrderBox::onMoveItem()
+{
+ moveItem( sender() == myUpBtn );
+}
+
+// =========================================================================================
+/*!
+ * \brief move mesh in order up or down
+ */
+// =========================================================================================
+
+void SMESHGUI_MeshOrderBox::moveItem(const bool theIsUp)
+{
+ // move selected list item up or down
+ QList<QListWidgetItem *> items = myMeshNames->selectedItems();
+ if ( items.isEmpty() )
+ return;
+ QListWidgetItem * selItem = (*(items.begin()));
+ if (!checkItem(selItem))
+ return;
+ int rowId = myMeshNames->row( selItem );
+ if ( rowId == -1 )
+ return;
+
+ // move item in list widget
+ myIsChanged = true;
+ myMeshNames->takeItem( rowId );
+ myMeshNames->insertItem(theIsUp ? rowId-1 : rowId+1, selItem );
+
+ // restore selection and current status
+ selItem->setSelected( true );
+ myMeshNames->setCurrentItem( selItem );
+}
+
+// =========================================================================================
+/*!
+ * \brief returns status is order changed by user
+ */
+// =========================================================================================
+
+bool SMESHGUI_MeshOrderBox:: IsOrderChanged() const
+{
+ return myIsChanged;
+}
+
+// =========================================================================================
+/*!
+ * \brief Constructor
+ */
+// =========================================================================================
+
+SMESHGUI_MeshOrderDlg::SMESHGUI_MeshOrderDlg(QWidget* theParent)
+: SMESHGUI_Dialog( theParent, false, false, OK | Cancel | Help )
+{
+ setWindowTitle( tr( "SMESH_MESHORDER_TITLE") );
+ QFrame* main = mainFrame();
+
+ QVBoxLayout* aDlgLay = new QVBoxLayout (main);
+ aDlgLay->setMargin( 0 );
+ aDlgLay->setSpacing( SPACING );
+
+ myBox = new SMESHGUI_MeshOrderBox( main );
+
+ aDlgLay->addWidget(myBox);
+ aDlgLay->setStretchFactor(main, 1);
+}
+
+// =========================================================================================
+/*!
+ * \brief Destructor
+ */
+// =========================================================================================
+
+SMESHGUI_MeshOrderDlg::~SMESHGUI_MeshOrderDlg()
+{
+}
+
+// =========================================================================================
+/*!
+ * \brief return Box widget to show mesh order
+ */
+// =========================================================================================
+
+SMESHGUI_MeshOrderBox* SMESHGUI_MeshOrderDlg::GetMeshOrderBox() const
+{
+ return myBox;
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : SMESHGUI_MeshOrderDlg.h
+// Author : Pavel TELKOV, Open CASCADE S.A.S.
+//
+#ifndef SMESHGUI_MeshOrderDlg_H
+#define SMESHGUI_MeshOrderDlg_H
+
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Dialog.h"
+
+// Qt includes
+#include <QGroupBox>
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
+
+class QToolButton;
+class QListWidget;
+
+typedef QList<QStringList> ListListName;
+typedef QList<int> ListId;
+typedef QList<ListId> ListListId;
+
+/*!
+ * \brief Reusable widget that shows and allows modify meshing order
+ */
+
+class SMESHGUI_EXPORT SMESHGUI_MeshOrderBox : public QGroupBox
+{
+ Q_OBJECT
+
+ public:
+ /*! Public methods */
+ SMESHGUI_MeshOrderBox( QWidget* );
+ ~SMESHGUI_MeshOrderBox();
+
+ //! Clear mesh box
+ void Clear();
+
+ //! Set mesh (submesh) names and indeces
+ void SetMeshes(const ListListName& theMeshNames,
+ const ListListId& theMeshIds);
+
+ //! returns status is order changed by user
+ bool IsOrderChanged() const;
+
+ //! Returns result (ordered by user) mesh names
+ ListListId GetMeshIds() const;
+ //! Returns result (ordered by user) mesh indeces
+ ListListName GetMeshNames() const;
+
+ private slots:
+ /*! Private slots */
+ //! update state of arrow buttons according to selection
+ void onSelectionChanged();
+ //! move item according to clicked arrow button
+ void onMoveItem();
+
+ private:
+ /*! Privatemethods */
+ //! move mesh in order up or down
+ void moveItem(const bool theIsUp);
+
+ private:
+ /*! Private fields */
+ bool myIsChanged;
+ QToolButton* myUpBtn;
+ QToolButton* myDownBtn;
+ QListWidget* myMeshNames;
+};
+
+/*!
+ * \brief Dialog contains mesh order box for modification operation
+ */
+
+class SMESHGUI_EXPORT SMESHGUI_MeshOrderDlg : public SMESHGUI_Dialog
+{
+ Q_OBJECT
+
+ public:
+ /*! Public methods */
+ SMESHGUI_MeshOrderDlg( QWidget* );
+ ~SMESHGUI_MeshOrderDlg();
+
+ SMESHGUI_MeshOrderBox* GetMeshOrderBox() const;
+
+ private:
+ /*! Private fields */
+ SMESHGUI_MeshOrderBox* myBox;
+};
+
+#endif // SMESHGUI_MeshOrderDlg_H
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : SMESHGUI_MeshOrderOp.cxx
+// Author : Pavel TELKOV, Open CASCADE S.A.S.
+//
+#include "SMESHGUI_MeshOrderOp.h"
+
+#include "SMESHGUI.h"
+#include "SMESHGUI_Utils.h"
+#include "SMESHGUI_MeshUtils.h"
+
+// SALOME GUI includes
+#include <LightApp_SelectionMgr.h>
+#include <SALOME_ListIO.hxx>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Desktop.h>
+
+// SALOME KERNEL includes
+#include <SALOMEDS_SObject.hxx>
+#include <SALOMEDSClient_SObject.hxx>
+
+// STL includes
+#include <set>
+
+//================================================================================
+/*!
+ * \brief Constructor
+*/
+//================================================================================
+
+SMESHGUI_MeshOrderOp::SMESHGUI_MeshOrderOp()
+ : SMESHGUI_Operation(), myDlg(0), myMgr(0)
+{
+ myDlg = new SMESHGUI_MeshOrderDlg( desktop() );
+
+ myHelpFileName = "constructing_meshes_page.html#mesh_order_anchor";
+}
+
+//================================================================================
+/*!
+ * \brief Destructor
+*/
+//================================================================================
+
+SMESHGUI_MeshOrderOp::~SMESHGUI_MeshOrderOp()
+{
+}
+
+//================================================================================
+/*!
+ * \brief Return operation dialog
+ */
+//================================================================================
+
+LightApp_Dialog* SMESHGUI_MeshOrderOp::dlg() const
+{
+ return myDlg;
+}
+
+//================================================================================
+/*!
+ * \brief perform it's intention action: compute 2D mesh on 3D
+ */
+//================================================================================
+
+void SMESHGUI_MeshOrderOp::startOperation()
+{
+ SMESHGUI_Operation::startOperation();
+ if (myMgr)
+ myDlg->show();
+}
+
+//================================================================================
+/*!
+ * \brief Init dialog and mesh order box
+ */
+//================================================================================
+
+void SMESHGUI_MeshOrderOp::initDialog()
+{
+ if (!myDlg )
+ return;
+
+ SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil();
+ // check selection
+ LightApp_SelectionMgr *Sel = selectionMgr();
+ SALOME_ListIO selected; Sel->selectedObjects( selected );
+
+ if (selected.Extent() == 1)
+ aMesh = SMESH::GetMeshByIO(selected.First());
+ if (aMesh->_is_nil()) {
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"),
+ tr("SMESH_WRN_NO_AVAILABLE_DATA"));
+ onCancel();
+ return;
+ }
+
+ myMgr = new SMESHGUI_MeshOrderMgr( myDlg->GetMeshOrderBox() );
+ myMgr->SetMesh( aMesh );
+ if ( !myMgr->GetMeshOrder() ) {
+ SUIT_MessageBox::information(desktop(),
+ tr("SMESH_INFORMATION"),
+ tr("SMESH_NO_CONCURENT_MESH"));
+
+ onCancel();
+ return;
+ }
+}
+
+//================================================================================
+/*!
+ * \brief Apply changes
+ */
+//================================================================================
+
+bool SMESHGUI_MeshOrderOp::onApply()
+{
+ SUIT_OverrideCursor aWaitCursor;
+ bool res = myMgr ? myMgr->SetMeshOrder() : false;
+
+ delete myMgr;
+ myMgr = 0;
+
+ return res;
+}
+
+//================================================================================
+/*!
+ * \brief Apply changes
+ */
+//================================================================================
+
+void SMESHGUI_MeshOrderOp::onCancel()
+{
+ delete myMgr;
+ myMgr = 0;
+
+ abort();
+}
+
+//================================================================================
+/*!
+ * \brief Constructor
+*/
+//================================================================================
+
+SMESHGUI_MeshOrderMgr::SMESHGUI_MeshOrderMgr( SMESHGUI_MeshOrderBox* theBox )
+: myBox( theBox )
+{
+ myMesh = SMESH::SMESH_Mesh::_nil();
+}
+
+//================================================================================
+/*!
+ * \brief Destructor
+*/
+//================================================================================
+
+SMESHGUI_MeshOrderMgr::~SMESHGUI_MeshOrderMgr()
+{
+}
+
+//================================================================================
+/*!
+ * \brief Set root mesh object
+ */
+//================================================================================
+
+void SMESHGUI_MeshOrderMgr::SetMesh(SMESH::SMESH_Mesh_var& theMesh)
+{
+ myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh);
+ _PTR(SObject) aMeshSObj = SMESH::FindSObject(theMesh);
+ if ( myBox && aMeshSObj )
+ myBox->setTitle( aMeshSObj->GetName().c_str() );
+}
+
+//================================================================================
+/*!
+ * \brief Check for concurents between submesh objects
+ */
+//================================================================================
+
+bool SMESHGUI_MeshOrderMgr::GetMeshOrder()
+{
+ ListListId idListList;
+ return GetMeshOrder(idListList);
+}
+
+//================================================================================
+/*!
+ * \brief Check for concurents between submesh objects
+ */
+//================================================================================
+
+bool SMESHGUI_MeshOrderMgr::GetMeshOrder(ListListId& theIdListList)
+{
+ if (!myBox || myMesh->_is_nil())
+ return false;
+ myBox->Clear();
+ SMESH::submesh_array_array_var meshOrder = myMesh->GetMeshOrder();
+ if ( !meshOrder.operator->() || !meshOrder->length() )
+ return false;
+ ListListName nameListList;
+ for ( int i = 0, n = meshOrder->length(); i < n; i++ )
+ {
+ QList<int> idList;
+ QStringList nameList;
+ const SMESH::submesh_array& aSMArray = meshOrder[i];
+ for ( int j = 0, jn = aSMArray.length(); j < jn; j++ )
+ {
+ const SMESH::SMESH_subMesh_var subMesh = aSMArray[j];
+
+ _PTR(SObject) aSubMeshSObj = SMESH::FindSObject(subMesh);
+ if ( !aSubMeshSObj )
+ continue;
+
+ idList.append(subMesh->GetId() );
+ nameList.append( QString(aSubMeshSObj->GetName().c_str()) );
+ }
+ theIdListList.append(idList);
+ nameListList.append(nameList);
+ }
+ myBox->SetMeshes(nameListList, theIdListList);
+ return !theIdListList.isEmpty();
+}
+
+//================================================================================
+/*!
+ * \brief Returns status is order changed by user
+ */
+//================================================================================
+
+bool SMESHGUI_MeshOrderMgr::IsOrderChanged() const
+{
+ return myBox && myBox->IsOrderChanged();
+}
+
+//================================================================================
+/*!
+ * \brief Store submesh priority order
+ */
+//================================================================================
+
+bool SMESHGUI_MeshOrderMgr::SetMeshOrder()
+{
+ return myBox ? SetMeshOrder(myBox->GetMeshIds()) : false;
+}
+
+//================================================================================
+/*!
+ * \brief Store submesh priority order
+ */
+//================================================================================
+
+bool SMESHGUI_MeshOrderMgr::SetMeshOrder( const ListListId& theListListIds )
+{
+ if (theListListIds.isEmpty() || myMesh->_is_nil())
+ return false;
+
+ _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(SObject) aMeshSObj = SMESH::FindSObject(myMesh);
+ if ( !aStudy || !aMeshSObj )
+ return false;
+
+ std::map<int, SMESH::SMESH_subMesh_var> mapOfSubMesh;
+ for (int i = SMESH::Tag_FirstSubMesh; i <= SMESH::Tag_LastSubMesh; i++) {
+ _PTR(SObject) aSubmeshRoot;
+ if ( !aMeshSObj->FindSubObject( i, aSubmeshRoot ) )
+ continue;
+ _PTR(ChildIterator) smIter = aStudy->NewChildIterator( aSubmeshRoot );
+ for ( ; smIter->More(); smIter->Next() ) {
+ _PTR(SObject) aSmObj = smIter->Value();
+ SMESH::SMESH_subMesh_var sm =
+ SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( aSmObj );
+ mapOfSubMesh[ sm->GetId() ] = SMESH::SMESH_subMesh::_duplicate(sm);
+ }
+ }
+
+ // is it enought to set modifid attribute on root mesh objects only?
+ // it is seems that modifaction flag will be set on child submeshes
+ // automatically (see SMESH::ModifiedMesh for details)
+ SMESH::ModifiedMesh( aMeshSObj, false, false );
+
+ SMESH::submesh_array_array_var meshOrder = new SMESH::submesh_array_array();
+ meshOrder->length(theListListIds.count() );
+ ListListId::const_iterator it = theListListIds.constBegin();
+ for ( int i = 0; it != theListListIds.constEnd(); ++it ) {
+ const QList<int>& ids = *it;
+ SMESH::submesh_array_var subMeshList = new SMESH::submesh_array();
+ subMeshList->length( ids.count() );
+ QList<int>::const_iterator subIt = ids.constBegin();
+ for( int j = 0; subIt != ids.constEnd(); ++subIt )
+ if ( mapOfSubMesh.find( *subIt ) != mapOfSubMesh.end() )
+ subMeshList[ j++ ] = mapOfSubMesh[ *subIt ];
+
+ meshOrder[ i++ ] = subMeshList;
+ }
+ // update object browser
+ SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );
+
+ return myMesh->SetMeshOrder(meshOrder);
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : SMESHGUI_MeshOrderOp.h
+// Author : Pavel TELKOV, Open CASCADE S.A.S.
+//
+#ifndef SMESHGUI_MeshOrderOp_H
+#define SMESHGUI_MeshOrderOp_H
+
+
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
+
+#include "SMESHGUI_Operation.h"
+#include "SMESHGUI_MeshOrderDlg.h"
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Gen)
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
+
+/*!
+ * \brief Operator to check and modify mesh computation submesh priority (order)
+ */
+class SMESHGUI_EXPORT SMESHGUI_MeshOrderMgr
+{
+public:
+ SMESHGUI_MeshOrderMgr( SMESHGUI_MeshOrderBox* );
+ virtual ~SMESHGUI_MeshOrderMgr();
+ //! Set root mesh object
+ void SetMesh( SMESH::SMESH_Mesh_var& theMesh );
+ //! Check for concurents between submesh objects
+ bool GetMeshOrder();
+ //! Check for concurents between submesh objects
+ bool GetMeshOrder( ListListId& theIds );
+ //! Store submesh priority order
+ bool SetMeshOrder();
+ //! Store given submesh priority order
+ bool SetMeshOrder( const ListListId& theIds );
+
+ //! Returns status is order changed by user
+ bool IsOrderChanged() const;
+
+private:
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESHGUI_MeshOrderBox* myBox;
+};
+
+/*!
+ * \brief Operator to check and modify mesh computation submesh priority (order)
+ */
+class SMESHGUI_EXPORT SMESHGUI_MeshOrderOp: public SMESHGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ SMESHGUI_MeshOrderOp();
+ virtual ~SMESHGUI_MeshOrderOp();
+
+protected:
+ virtual LightApp_Dialog* dlg() const;
+
+ virtual void startOperation();
+
+ //! sets the dialog widgets to state just after operation start
+ virtual void initDialog();
+
+ protected slots:
+ virtual bool onApply();
+ virtual void onCancel();
+
+ private:
+ SMESHGUI_MeshOrderDlg* myDlg;
+ SMESHGUI_MeshOrderMgr* myMgr;
+};
+
+#endif // SMESHGUI_MeshOrderOp_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshPatternDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_MeshPatternDlg.h
// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshUtils.cxx
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshUtils.h
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MoveNodesDlg.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
aCoordGrpLayout->addWidget(myZ);
//------------------------------------------------------------
- myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, DBL_DIGITS_DISPLAY);
- myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, DBL_DIGITS_DISPLAY);
- myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, DBL_DIGITS_DISPLAY);
+ myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, "length_precision");
+ myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, "length_precision");
+ myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, "length_precision");
//------------------------------------------------------------
QVBoxLayout* aLay = new QVBoxLayout(aFrame);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MoveNodesDlg.h
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_MultiEditDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
// SMESH includes
#include <SMDS_Mesh.hxx>
// SALOME GUI includes
-#include <SUIT_ResourceMgr.h>
#include <SUIT_Desktop.h>
-#include <SUIT_Session.h>
#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
#include <LightApp_SelectionMgr.h>
#include <LightApp_Application.h>
#include <SALOME_ListIO.hxx>
#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SalomeApp_Tools.h>
#include <SVTK_Selector.h>
#include <SVTK_ViewWindow.h>
bool SMESHGUI_MultiEditDlg::isValid (const bool /*theMess*/)
{
return (!myMesh->_is_nil() &&
- (myListBox->count() > 0 || (myToAllChk->isChecked() && myActor)));
+ (myListBox->count() > 0 || (myToAllChk->isChecked()/* && myActor*/)));
}
//=======================================================================
//=======================================================================
// name : SMESHGUI_MultiEditDlg::getIds
-// Purpose : Retrive identifiers from list box
+// Purpose : Retrive identifiers from list box or the whole object
//=======================================================================
-SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds()
+
+SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds(SMESH::SMESH_IDSource_var& obj)
{
SMESH::long_array_var anIds = new SMESH::long_array;
if (myToAllChk->isChecked())
{
myIds.Clear();
- SMESH_Actor * anActor = SMESH::FindActorByObject(myMesh);
- if (!anActor)
- anActor = myActor;
- if (anActor != 0)
- {
- // skl 07.02.2006
- SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh();
- if( myFilterType == SMESH::TriaFilter ||
- myFilterType == SMESH::QuadFilter ||
- myFilterType == SMESH::FaceFilter ) {
- SMDS_FaceIteratorPtr it = aMesh->facesIterator();
- while(it->more()) {
- const SMDS_MeshFace* f = it->next();
- if(myFilterType == SMESH::FaceFilter) {
- myIds.Add(f->GetID());
- }
- else if( myFilterType==SMESH::TriaFilter &&
- ( f->NbNodes()==3 || f->NbNodes()==6 ) ) {
- myIds.Add(f->GetID());
- }
- else if( myFilterType==SMESH::QuadFilter &&
- ( f->NbNodes()==4 || f->NbNodes()==8 ) ) {
- myIds.Add(f->GetID());
- }
- }
- }
- else if(myFilterType == SMESH::VolumeFilter) {
- SMDS_VolumeIteratorPtr it = aMesh->volumesIterator();
- while(it->more()) {
- const SMDS_MeshVolume* f = it->next();
- myIds.Add(f->GetID());
- }
- }
- /* commented by skl 07.02.2006
+ obj = SMESH::SMESH_IDSource::_narrow( myMesh );
+// SMESH_Actor * anActor = SMESH::FindActorByObject(myMesh);
+// if (!anActor)
+// anActor = myActor;
+// if (anActor != 0)
+// {
+// // skl 07.02.2006
+// SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh();
+// if( myFilterType == SMESH::TriaFilter ||
+// myFilterType == SMESH::QuadFilter ||
+// myFilterType == SMESH::FaceFilter ) {
+// SMDS_FaceIteratorPtr it = aMesh->facesIterator();
+// while(it->more()) {
+// const SMDS_MeshFace* f = it->next();
+// if(myFilterType == SMESH::FaceFilter) {
+// myIds.Add(f->GetID());
+// }
+// else if( myFilterType==SMESH::TriaFilter &&
+// ( f->NbNodes()==3 || f->NbNodes()==6 ) ) {
+// myIds.Add(f->GetID());
+// }
+// else if( myFilterType==SMESH::QuadFilter &&
+// ( f->NbNodes()==4 || f->NbNodes()==8 ) ) {
+// myIds.Add(f->GetID());
+// }
+// }
+// }
+// else if(myFilterType == SMESH::VolumeFilter) {
+// SMDS_VolumeIteratorPtr it = aMesh->volumesIterator();
+// while(it->more()) {
+// const SMDS_MeshVolume* f = it->next();
+// myIds.Add(f->GetID());
+// }
+// }
+ /* commented by skl 07.02.2006 - to work with quadratic elements
TVisualObjPtr aVisualObj = anActor->GetObject();
vtkUnstructuredGrid* aGrid = aVisualObj->GetUnstructuredGrid();
if (aGrid != 0) {
}
}
*/
- }
+ //}
}
anIds->length(myIds.Extent());
myBusy = true;
- SMESH::long_array_var anIds = getIds();
+ SUIT_OverrideCursor aWaitCursor;
+
+ SMESH::SMESH_IDSource_var obj;
+ SMESH::long_array_var anIds = getIds(obj);
- bool aResult = process(aMeshEditor, anIds.inout());
+ bool aResult = process(aMeshEditor, anIds.inout(), obj);
if (aResult) {
if (myActor) {
SALOME_ListIO sel;
}
bool SMESHGUI_ChangeOrientationDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
- const SMESH::long_array& theIds)
+ const SMESH::long_array& theIds,
+ SMESH::SMESH_IDSource_ptr obj)
{
- return theEditor->Reorient(theIds);
+ if ( CORBA::is_nil( obj ))
+ return theEditor->Reorient(theIds);
+ else
+ return theEditor->ReorientObject( obj );
}
/*!
QLabel* aLab = new QLabel (tr("MAXIMUM_ANGLE"), aMaxAngleGrp);
myMaxAngleSpin = new SMESHGUI_SpinBox (aMaxAngleGrp);
- myMaxAngleSpin->RangeStepAndValidator(0, 180.0, 1.0, 3);
+ myMaxAngleSpin->RangeStepAndValidator(0, 180.0, 1.0, "angle_precision");
myMaxAngleSpin->SetValue(30.0);
aMaxAngleGrpLayout->addWidget(aLab);
}
bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
- const SMESH::long_array& theIds)
+ const SMESH::long_array& theIds,
+ SMESH::SMESH_IDSource_ptr obj)
{
SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
double aMaxAngle = myMaxAngleSpin->GetValue() * PI / 180.0;
- bool ok = theEditor->TriToQuad(theIds, aCriterion, aMaxAngle);
+ bool ok;
+ if ( CORBA::is_nil( obj ))
+ ok = theEditor->TriToQuad(theIds, aCriterion, aMaxAngle);
+ else
+ ok = theEditor->TriToQuadObject(obj, aCriterion, aMaxAngle);
if( ok ) {
QStringList aParameters;
aParameters << myMaxAngleSpin->text();
}
bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
- const SMESH::long_array& theIds)
+ const SMESH::long_array& theIds,
+ SMESH::SMESH_IDSource_ptr obj)
{
+ bool hasObj = (! CORBA::is_nil( obj ));
switch (myGroupChoice->checkedId()) {
case 0: // use diagonal 1-3
- return theEditor->SplitQuad(theIds, true);
+ return hasObj ? theEditor->SplitQuadObject(obj, true) : theEditor->SplitQuad(theIds, true);
case 1: // use diagonal 2-4
- return theEditor->SplitQuad(theIds, false);
+ return hasObj ? theEditor->SplitQuadObject(obj, false) : theEditor->SplitQuad(theIds, false);
default: // use numeric functor
break;
}
- SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
- return theEditor->QuadToTri(theIds, aCriterion);
+ SMESH::NumericalFunctor_var aCrit = getNumericalFunctor();
+ return hasObj ? theEditor->QuadToTriObject(obj, aCrit) : theEditor->QuadToTri(theIds, aCrit);
}
void SMESHGUI_CuttingOfQuadsDlg::onCriterionRB()
erasePreview();
// get Ids of elements
- SMESH::long_array_var anElemIds = getIds();
- if (getIds()->length() == 0)
+ SMESH::SMESH_IDSource_var obj;
+ SMESH::long_array_var anElemIds = getIds(obj);
+ if (anElemIds->length() == 0 && obj->_is_nil() )
return;
SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh();
aCellTypesArray->Delete();
aCellLocationsArray->Delete();
}
+
+/*!
+ * Class : SMESHGUI_CuttingIntoTetraDlg
+ * Description : Modification of orientation of faces
+ */
+
+SMESHGUI_CuttingIntoTetraDlg::SMESHGUI_CuttingIntoTetraDlg(SMESHGUI* theModule)
+ : SMESHGUI_MultiEditDlg(theModule, SMESH::VolumeFilter, false)
+{
+ setWindowTitle(tr("CAPTION"));
+ myHelpFileName = "split_to_tetra_page.html";
+ myEntityType = SMESH::VolumeFilter;
+
+ myToAllChk->setChecked( true ); //aplly to the whole mesh by default
+
+ bool hasHexa = true;//myMesh->_is_nil() ? false : myMesh->NbHexas();
+
+ if ( hasHexa )
+ {
+ myGroupChoice->button(2)->hide();
+ myGroupChoice->button(0)->setText( tr("SPLIT_HEX_TO_5_TETRA"));
+ myGroupChoice->button(1)->setText( tr("SPLIT_HEX_TO_6_TETRA"));
+
+ myCriterionGrp->setTitle( tr("SPLIT_METHOD"));
+ myCriterionGrp->show();
+ myComboBoxFunctor->hide();
+ myChoiceWidget->show();
+ }
+ setSelectionMode();
+ updateButtons();
+}
+
+SMESHGUI_CuttingIntoTetraDlg::~SMESHGUI_CuttingIntoTetraDlg()
+{
+}
+
+bool SMESHGUI_CuttingIntoTetraDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
+ const SMESH::long_array& theIds,
+ SMESH::SMESH_IDSource_ptr theObj)
+{
+ SMESH::SMESH_IDSource_var obj = theObj;
+ if ( CORBA::is_nil( obj ))
+ obj = theEditor->MakeIDSource( theIds );
+ try {
+ theEditor->SplitVolumesIntoTetra( obj, myGroupChoice->checkedId()+1 );
+ }
+ catch ( const SALOME::SALOME_Exception& S_ex ) {
+ SalomeApp_Tools::QtCatchCorbaException( S_ex );
+ return false;
+ }
+ return true;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_MultiEditDlg.h
// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
QWidget* createButtonFrame( QWidget* );
QWidget* createMainFrame( QWidget*, const bool );
virtual bool isValid( const bool );
- SMESH::long_array_var getIds();
+ SMESH::long_array_var getIds(SMESH::SMESH_IDSource_var& obj);
void updateButtons();
void setSelectionMode();
virtual bool isIdValid( const int ) const;
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
- const SMESH::long_array& ) = 0;
+ const SMESH::long_array& ,
+ SMESH::SMESH_IDSource_ptr obj) = 0;
int entityType();
protected:
virtual ~SMESHGUI_ChangeOrientationDlg();
protected:
- virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
+ virtual bool process( SMESH::SMESH_MeshEditor_ptr,
+ const SMESH::long_array& ,
+ SMESH::SMESH_IDSource_ptr obj);
};
/*!
protected:
virtual bool isValid( const bool );
- virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
+ virtual bool process( SMESH::SMESH_MeshEditor_ptr,
+ const SMESH::long_array&,
+ SMESH::SMESH_IDSource_ptr obj );
private:
SMESHGUI_SpinBox* myMaxAngleSpin;
virtual ~SMESHGUI_CuttingOfQuadsDlg();
protected:
- virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
+ virtual bool process( SMESH::SMESH_MeshEditor_ptr,
+ const SMESH::long_array& ,
+ SMESH::SMESH_IDSource_ptr obj);
protected slots:
virtual void onClose();
QCheckBox* myPreviewChk;
};
+/*!
+ * Class : SMESHGUI_CuttingIntoTetraDlg
+ * Description : Split all volumes into tetrahedrons
+ */
+class SMESHGUI_CuttingIntoTetraDlg : public SMESHGUI_MultiEditDlg
+{
+ Q_OBJECT
+
+public:
+ SMESHGUI_CuttingIntoTetraDlg( SMESHGUI* );
+ virtual ~SMESHGUI_CuttingIntoTetraDlg();
+
+protected:
+ virtual bool process( SMESH::SMESH_MeshEditor_ptr,
+ const SMESH::long_array&,
+ SMESH::SMESH_IDSource_ptr obj );
+};
+
#endif // SMESHGUI_MULTIEDITDLG_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_NodesDlg.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_MeshUtils.h"
+#include "SMESHGUI_GroupUtils.h"
#include <SMESH_Actor.h>
#include <SMESH_ActorUtils.h>
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+
#include <SVTK_ViewWindow.h>
#include <VTKViewer_Algorithm.h>
#include <VTKViewer_CellLocationsArray.h>
#include <vtkPoints.h>
// Qt includes
+#include <QComboBox>
#include <QGroupBox>
#include <QLabel>
#include <QPushButton>
namespace SMESH
{
- void AddNode( SMESH::SMESH_Mesh_ptr theMesh, float x, float y, float z, const QStringList& theParameters )
+ long AddNode( SMESH::SMESH_Mesh_ptr theMesh, float x, float y, float z, const QStringList& theParameters )
{
+ long aNodeId = -1;
SUIT_OverrideCursor wc;
try {
_PTR(SObject) aSobj = SMESH::FindSObject( theMesh );
SMESH::SMESH_MeshEditor_var aMeshEditor = theMesh->GetMeshEditor();
- aMeshEditor->AddNode( x, y, z );
+ aNodeId = aMeshEditor->AddNode( x, y, z );
theMesh->SetParameters( theParameters.join(":").toLatin1().constData() );
_PTR(Study) aStudy = GetActiveStudyDocument();
CORBA::Long anId = aStudy->StudyId();
catch ( ... ) {
INFOS( "Unknown exception was cought !!!" );
}
+ return aNodeId;
}
class TNodeSimulation
GroupCoordinatesLayout->addWidget( TextLabel_Z );
GroupCoordinatesLayout->addWidget( SpinBox_Z );
+
+ /***************************************************************/
+ GroupGroups = new QGroupBox( tr( "SMESH_ADD_TO_GROUP" ), this );
+ GroupGroups->setCheckable( true );
+ QHBoxLayout* GroupGroupsLayout = new QHBoxLayout(GroupGroups);
+ GroupGroupsLayout->setSpacing(SPACING);
+ GroupGroupsLayout->setMargin(MARGIN);
+
+ TextLabel_GroupName = new QLabel( tr( "SMESH_GROUP" ), GroupGroups );
+ ComboBox_GroupName = new QComboBox( GroupGroups );
+ ComboBox_GroupName->setEditable( true );
+
+ GroupGroupsLayout->addWidget( TextLabel_GroupName );
+ GroupGroupsLayout->addWidget( ComboBox_GroupName, 1 );
+
/***************************************************************/
GroupButtons = new QGroupBox( this );
QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
/***************************************************************/
SMESHGUI_NodesDlgLayout->addWidget( GroupConstructors );
SMESHGUI_NodesDlgLayout->addWidget( GroupCoordinates );
+ SMESHGUI_NodesDlgLayout->addWidget( GroupGroups );
SMESHGUI_NodesDlgLayout->addWidget( GroupButtons );
myHelpFileName = "adding_nodes_and_elements_page.html#adding_nodes_anchor";
double step = 25.0;
/* min, max, step and decimals for spin boxes */
- SpinBox_X->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY );
- SpinBox_Y->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY );
- SpinBox_Z->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY );
+ SpinBox_X->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, "length_precision" );
+ SpinBox_Y->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, "length_precision" );
+ SpinBox_Z->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, "length_precision" );
SpinBox_X->SetValue( 0.0 );
SpinBox_Y->SetValue( 0.0 );
SpinBox_Z->SetValue( 0.0 );
+ /* reset "Add to group" control */
+ GroupGroups->setChecked( false );
+
mySMESHGUI->SetActiveDialogBox( this );
/* signals and slots connections */
aParameters << SpinBox_Y->text();
aParameters << SpinBox_Z->text();
+ bool addToGroup = GroupGroups->isChecked();
+ QString aGroupName;
+
+ SMESH::SMESH_GroupBase_var aGroup;
+ int idx = 0;
+ if( addToGroup ) {
+ aGroupName = ComboBox_GroupName->currentText();
+ for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) {
+ QString aName = ComboBox_GroupName->itemText( i );
+ if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) )
+ idx = i;
+ }
+ if ( idx > 0 ) {
+ SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( myGroups[idx-1] );
+ if ( !aGeomGroup->_is_nil() ) {
+ int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ),
+ tr( "MESH_STANDALONE_GRP_CHOSEN" ).arg( aGroupName ),
+ tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 );
+ if ( res == 1 ) return false;
+ }
+ aGroup = myGroups[idx-1];
+ }
+ }
+
mySimulation->SetVisibility( false );
- SMESH::AddNode( myMesh, x, y, z, aParameters );
+
+ long aNodeId = SMESH::AddNode( myMesh, x, y, z, aParameters );
+
SMESH::SetPointRepresentation( true );
+ if ( aNodeId != -1 && addToGroup && !aGroupName.isEmpty() ) {
+ SMESH::SMESH_Group_var aGroupUsed;
+ if ( aGroup->_is_nil() ){
+ // create new group
+ aGroupUsed = SMESH::AddGroup( myMesh, SMESH::NODE, aGroupName );
+ if ( !aGroupUsed->_is_nil() ) {
+ myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed));
+ ComboBox_GroupName->addItem( aGroupName );
+ }
+ }
+ else {
+ SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGroup );
+ if ( !aGeomGroup->_is_nil() ) {
+ aGroupUsed = myMesh->ConvertToStandalone( aGeomGroup );
+ if ( !aGroupUsed->_is_nil() && idx > 0 ) {
+ myGroups[idx-1] = SMESH::SMESH_GroupBase::_duplicate(aGroupUsed);
+ SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser();
+ }
+ }
+ else
+ aGroupUsed = SMESH::SMESH_Group::_narrow( aGroup );
+ }
+
+ if ( !aGroupUsed->_is_nil() ) {
+ SMESH::long_array_var anIdList = new SMESH::long_array;
+ anIdList->length( 1 );
+ anIdList[0] = aNodeId;
+ aGroupUsed->Add( anIdList.inout() );
+ }
+ }
+
// select myMesh
SALOME_ListIO aList;
mySelectionMgr->selectedObjects( aList );
mySimulation->SetVisibility( false );
SMESH::SetPointRepresentation( true );
+ QString aCurrentEntry = myEntry;
+
const SALOME_ListIO& aList = mySelector->StoredIObjects();
if ( aList.Extent() == 1 ) {
Handle(SALOME_InteractiveObject) anIO = aList.First();
if ( anIO->hasEntry() ) {
+ myEntry = anIO->getEntry();
myMesh = SMESH::GetMeshByIO( anIO );
if ( myMesh->_is_nil() ) return;
QString aText;
SpinBox_Z->GetValue() );
}
}
+
+ // process groups
+ if ( !myMesh->_is_nil() && myEntry != aCurrentEntry ) {
+ myGroups.clear();
+ ComboBox_GroupName->clear();
+ ComboBox_GroupName->addItem( QString() );
+ SMESH::ListOfGroups aListOfGroups = *myMesh->GetGroups();
+ for( int i = 0, n = aListOfGroups.length(); i < n; i++ ) {
+ SMESH::SMESH_GroupBase_var aGroup = aListOfGroups[i];
+ if ( !aGroup->_is_nil() && aGroup->GetType() == SMESH::NODE ) {
+ QString aGroupName( aGroup->GetName() );
+ if ( !aGroupName.isEmpty() ) {
+ myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup));
+ ComboBox_GroupName->addItem( aGroupName );
+ }
+ }
+ }
+ }
}
//=================================================================================
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
return false;
}
+
+ if( GroupGroups->isChecked() && ComboBox_GroupName->currentText().isEmpty() ) {
+ SUIT_MessageBox::warning( this, tr( "SMESH_WRN_WARNING" ), tr( "GROUP_NAME_IS_EMPTY" ) );
+ return false;
+ }
return true;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_NodesDlg.h
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
+class QComboBox;
class QGroupBox;
class QLabel;
class QPushButton;
~SMESHGUI_NodesDlg();
private:
+ typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
+
LightApp_SelectionMgr* mySelectionMgr;
SVTK_Selector* mySelector;
SMESHGUI* mySMESHGUI;
SMESH::SMESH_Mesh_var myMesh;
SMESH::TNodeSimulation* mySimulation;
+ QString myEntry;
+ GrpList myGroups;
void Init();
void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* );
bool isValid();
-
+
QGroupBox* GroupConstructors;
QRadioButton* Constructor1;
QGroupBox* GroupCoordinates;
QLabel* TextLabel_Y;
QLabel* TextLabel_Z;
+ QGroupBox* GroupGroups;
+ QLabel* TextLabel_GroupName;
+ QComboBox* ComboBox_GroupName;
+
QGroupBox* GroupButtons;
QPushButton* buttonApply;
QPushButton* buttonOk;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMESHGUI_Operation.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMESHGUI_Operation.h
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_PatternUtils.cxx
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_PatternUtils.h
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_PatternWidget.cxx
// Author : Michael ZORIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_PatternWidget.h
// Author : Michael ZORIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_Preferences_ColorDlg.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
#include "SMESHGUI_Preferences_ColorDlg.h"
#include "SMESHGUI.h"
+#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_Utils.h"
// SALOME GUI includes
#include <SUIT_Desktop.h>
#include <QtxColorButton.h>
-#include <QtxIntSpinBox.h>
+#include <VTKViewer_MarkerWidget.h>
+#include <SalomeApp_IntSpinBox.h>
// Qt includes
#include <QGroupBox>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGridLayout>
-#include <QSpinBox>
+#include <QCheckBox>
#define SPACING 6
#define MARGIN 11
QLabel* TextLabel_Outine = new QLabel( tr( "Outline" ), ButtonGroup1 );
btnOutlineColor = new QtxColorButton( ButtonGroup1 );
+ QLabel* TextLabel_0DElements_Color = new QLabel( tr( "0D elements" ), ButtonGroup1 );
+ btn0DElementsColor = new QtxColorButton( ButtonGroup1 );
+
+ QLabel* TextLabel_0DElements_Size = new QLabel( tr( "Size of 0D elements" ), ButtonGroup1 );
+ SpinBox_0DElements_Size = new SalomeApp_IntSpinBox( ButtonGroup1 );
+ SpinBox_0DElements_Size->setAcceptNames( false ); // No Notebook variables allowed
+ SpinBox_0DElements_Size->setRange( 1, 10 );
+ SpinBox_0DElements_Size->setSingleStep( 1 );
+ SpinBox_0DElements_Size->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ SpinBox_0DElements_Size->setButtonSymbols( QSpinBox::PlusMinus );
+
QLabel* TextLabel_Width = new QLabel( tr( "Width" ), ButtonGroup1 );
- SpinBox_Width = new QSpinBox( ButtonGroup1 );
+ SpinBox_Width = new SalomeApp_IntSpinBox( ButtonGroup1 );
+ SpinBox_Width->setAcceptNames( false ); // No Notebook variables allowed
SpinBox_Width->setRange( 0, 5 );
SpinBox_Width->setSingleStep( 1 );
SpinBox_Width->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
SpinBox_Width->setButtonSymbols( QSpinBox::PlusMinus );
QLabel* TextLabel_ShrinkCoeff = new QLabel( tr( "Shrink coef." ), ButtonGroup1 );
- SpinBox_Shrink = new QtxIntSpinBox( ButtonGroup1 );
+ SpinBox_Shrink = new SalomeApp_IntSpinBox( ButtonGroup1 );
+ SpinBox_Shrink->setAcceptNames( false ); // No Notebook variables allowed
SpinBox_Shrink->setRange( 20, 100 );
SpinBox_Shrink->setSingleStep( 1 );
SpinBox_Shrink->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
SpinBox_Shrink->setButtonSymbols( QSpinBox::PlusMinus );
- ButtonGroup1Layout->addWidget( TextLabel_Fill, 0, 0 );
- ButtonGroup1Layout->addWidget( btnFillColor, 0, 1 );
- ButtonGroup1Layout->addWidget( TextLabel_BackFace, 0, 2 );
- ButtonGroup1Layout->addWidget( btnBackFaceColor, 0, 3 );
- ButtonGroup1Layout->addWidget( TextLabel_Outine, 1, 0 );
- ButtonGroup1Layout->addWidget( btnOutlineColor, 1, 1 );
- ButtonGroup1Layout->addWidget( TextLabel_Width, 1, 2 );
- ButtonGroup1Layout->addWidget( SpinBox_Width, 1, 3 );
- ButtonGroup1Layout->addWidget( TextLabel_ShrinkCoeff, 2, 0 );
- ButtonGroup1Layout->addWidget( SpinBox_Shrink, 2, 1, 1, 3 );
+ ButtonGroup1Layout->addWidget( TextLabel_Fill, 0, 0 );
+ ButtonGroup1Layout->addWidget( btnFillColor, 0, 1 );
+ ButtonGroup1Layout->addWidget( TextLabel_BackFace, 0, 2 );
+ ButtonGroup1Layout->addWidget( btnBackFaceColor, 0, 3 );
+ ButtonGroup1Layout->addWidget( TextLabel_Outine, 1, 0 );
+ ButtonGroup1Layout->addWidget( btnOutlineColor, 1, 1 );
+ ButtonGroup1Layout->addWidget( TextLabel_0DElements_Color, 1, 2 );
+ ButtonGroup1Layout->addWidget( btn0DElementsColor, 1, 3 );
+ ButtonGroup1Layout->addWidget( TextLabel_0DElements_Size, 2, 0 );
+ ButtonGroup1Layout->addWidget( SpinBox_0DElements_Size, 2, 1 );
+ ButtonGroup1Layout->addWidget( TextLabel_Width, 3, 0 );
+ ButtonGroup1Layout->addWidget( SpinBox_Width, 3, 1 );
+ ButtonGroup1Layout->addWidget( TextLabel_ShrinkCoeff, 3, 2 );
+ ButtonGroup1Layout->addWidget( SpinBox_Shrink, 3, 3 );
// -------------------------------
QGroupBox* ButtonGroup2 = new QGroupBox( tr( "Nodes" ), this );
- QHBoxLayout* ButtonGroup2Layout = new QHBoxLayout( ButtonGroup2 );
+ QGridLayout* ButtonGroup2Layout = new QGridLayout( ButtonGroup2 );
ButtonGroup2Layout->setSpacing( SPACING );
ButtonGroup2Layout->setMargin( MARGIN );
QLabel* TextLabel_Nodes_Color = new QLabel( tr( "Color" ), ButtonGroup2 );
btnNodeColor = new QtxColorButton( ButtonGroup2 );
- QLabel* TextLabel_Nodes_Size = new QLabel( tr( "Size" ), ButtonGroup2 );
- SpinBox_Nodes_Size = new QSpinBox( ButtonGroup2 );
- SpinBox_Nodes_Size->setRange( 0, 5 );
- SpinBox_Nodes_Size->setSingleStep( 1 );
- SpinBox_Nodes_Size->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- SpinBox_Nodes_Size->setButtonSymbols( QSpinBox::PlusMinus );
+ QGroupBox* MarkerGroup = new QGroupBox( tr( "Marker" ), ButtonGroup2 );
+ QVBoxLayout* MarkerGroupLayout = new QVBoxLayout( MarkerGroup );
+ MarkerGroupLayout->setSpacing( 0 );
+ MarkerGroupLayout->setMargin( 0 );
+
+ MarkerWidget = new VTKViewer_MarkerWidget( MarkerGroup );
+
+ MarkerGroupLayout->addWidget( MarkerWidget );
+
+ ButtonGroup2Layout->addWidget( TextLabel_Nodes_Color, 0, 0 );
+ ButtonGroup2Layout->addWidget( btnNodeColor, 0, 1 );
+ ButtonGroup2Layout->addWidget( MarkerGroup, 1, 0, 1, 3 );
+ ButtonGroup2Layout->setColumnStretch( 2, 1 );
- ButtonGroup2Layout->addWidget( TextLabel_Nodes_Color );
- ButtonGroup2Layout->addWidget( btnNodeColor );
- ButtonGroup2Layout->addWidget( TextLabel_Nodes_Size );
- ButtonGroup2Layout->addWidget( SpinBox_Nodes_Size );
+ // -------------------------------
+ QGroupBox* ButtonGroup3 = new QGroupBox( tr( "Orientation of faces" ), this );
+ QGridLayout* ButtonGroup3Layout = new QGridLayout( ButtonGroup3 );
+ ButtonGroup3Layout->setSpacing( SPACING );
+ ButtonGroup3Layout->setMargin( MARGIN );
+
+ QLabel* TextLabel_Orientation_Color = new QLabel( tr( "Color" ), ButtonGroup3 );
+ btnOrientationColor = new QtxColorButton( ButtonGroup3 );
+
+ QLabel* TextLabel_Orientation_Scale = new QLabel( tr( "Scale" ), ButtonGroup3 );
+ SpinBox_Orientation_Scale = new SMESHGUI_SpinBox( ButtonGroup3 );
+ SpinBox_Orientation_Scale->setAcceptNames( false ); // No Notebook variables allowed
+ SpinBox_Orientation_Scale->RangeStepAndValidator( .05, .5, .05, "parametric_precision" );
+ SpinBox_Orientation_Scale->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ SpinBox_Orientation_Scale->setButtonSymbols( QSpinBox::PlusMinus );
+
+ CheckBox_Orientation_3DVectors = new QCheckBox( tr( "3D vectors" ), ButtonGroup3 );
+
+ ButtonGroup3Layout->addWidget( TextLabel_Orientation_Color, 0, 0 );
+ ButtonGroup3Layout->addWidget( btnOrientationColor, 0, 1 );
+ ButtonGroup3Layout->addWidget( TextLabel_Orientation_Scale, 0, 2 );
+ ButtonGroup3Layout->addWidget( SpinBox_Orientation_Scale, 0, 3 );
+ ButtonGroup3Layout->addWidget( CheckBox_Orientation_3DVectors, 1, 0, 1, 4 );
// -------------------------------
QGroupBox* GroupButtons = new QGroupBox( this );
// -------------------------------
topLayout->addWidget( ButtonGroup1 );
topLayout->addWidget( ButtonGroup2 );
+ topLayout->addWidget( ButtonGroup3 );
topLayout->addWidget( GroupButtons );
// -------------------------------
void SMESHGUI_Preferences_ColorDlg::SetColor( int type, const QColor& color )
{
switch ( type ) {
- case 1 : btnFillColor->setColor( color ); break; // fill
- case 2 : btnOutlineColor->setColor( color ); break; // outline
- case 3 : btnNodeColor->setColor( color ); break; // node
- case 4 : btnBackFaceColor->setColor( color ); break; // back face
+ case 1 : btnFillColor->setColor( color ); break; // fill
+ case 2 : btnOutlineColor->setColor( color ); break; // outline
+ case 3 : btnNodeColor->setColor( color ); break; // node
+ case 4 : btnBackFaceColor->setColor( color ); break; // back face
+ case 5 : btn0DElementsColor->setColor( color ); break; // 0d elements
+ case 6 : btnOrientationColor->setColor( color ); break; // orientation of faces
default: break;
}
}
{
QColor color;
switch ( type ) {
- case 1 : color = btnFillColor->color(); break; // fill
- case 2 : color = btnOutlineColor->color(); break; // outline
- case 3 : color = btnNodeColor->color(); break; // node
- case 4 : color = btnBackFaceColor->color(); break; // back face
+ case 1 : color = btnFillColor->color(); break; // fill
+ case 2 : color = btnOutlineColor->color(); break; // outline
+ case 3 : color = btnNodeColor->color(); break; // node
+ case 4 : color = btnBackFaceColor->color(); break; // back face
+ case 5 : color = btn0DElementsColor->color(); break; // 0d elements
+ case 6 : color = btnOrientationColor->color(); break; // orientation of faces
default: break;
}
return color;
void SMESHGUI_Preferences_ColorDlg::SetIntValue( int type, int value )
{
switch ( type ) {
- case 1 : SpinBox_Width->setValue( value ); break; // width
- case 2 : SpinBox_Nodes_Size->setValue( value ); break; // nodes size = value; break;
- case 3 : SpinBox_Shrink->setValue( value ); break; // shrink coeff
+ case 1 : SpinBox_Width->setValue( value ); break; // width
+ case 2 : SpinBox_Shrink->setValue( value ); break; // shrink coeff
+ case 3 : SpinBox_0DElements_Size->setValue( value ); break; // 0d elements
default: break;
}
}
{
int res = 0;
switch ( type ) {
- case 1 : res = SpinBox_Width->value(); break; // width
- case 2 : res = SpinBox_Nodes_Size->value(); break; // nodes size
- case 3 : res = SpinBox_Shrink->value(); break; // shrink coeff
+ case 1 : res = SpinBox_Width->value(); break; // width
+ case 2 : res = SpinBox_Shrink->value(); break; // shrink coeff
+ case 3 : res = SpinBox_0DElements_Size->value(); break; // 0d elements
+ default: break;
+ }
+ return res;
+}
+
+//=================================================================================
+// function : SetDoubleValue()
+// purpose :
+//=================================================================================
+void SMESHGUI_Preferences_ColorDlg::SetDoubleValue( int type, double value )
+{
+ switch ( type ) {
+ case 1 : SpinBox_Orientation_Scale->setValue( value ); break; // orientation scale
+ default: break;
+ }
+}
+
+//=================================================================================
+// function : GetDoubleValue()
+// purpose :
+//=================================================================================
+double SMESHGUI_Preferences_ColorDlg::GetDoubleValue( int type )
+{
+ double res = 0;
+ switch ( type ) {
+ case 1 : res = SpinBox_Orientation_Scale->value(); break; // orientation scale
default: break;
}
return res;
}
+
+//=================================================================================
+// function : SetBooleanValue()
+// purpose :
+//=================================================================================
+void SMESHGUI_Preferences_ColorDlg::SetBooleanValue( int type, bool value )
+{
+ switch ( type ) {
+ case 1 : CheckBox_Orientation_3DVectors->setChecked( value ); break; // 3D vectors
+ default: break;
+ }
+}
+
+//=================================================================================
+// function : GetBooleanValue()
+// purpose :
+//=================================================================================
+bool SMESHGUI_Preferences_ColorDlg::GetBooleanValue( int type )
+{
+ bool res = false;
+ switch ( type ) {
+ case 1 : res = CheckBox_Orientation_3DVectors->isChecked(); break; // 3D vectors
+ default: break;
+ }
+ return res;
+}
+
+//=================================================================================
+// function : setCustomMarkerMap()
+// purpose :
+//=================================================================================
+void SMESHGUI_Preferences_ColorDlg::setCustomMarkerMap( VTK::MarkerMap theMarkerMap )
+{
+ MarkerWidget->setCustomMarkerMap( theMarkerMap );
+}
+
+//=================================================================================
+// function : getCustomMarkerMap()
+// purpose :
+//=================================================================================
+VTK::MarkerMap SMESHGUI_Preferences_ColorDlg::getCustomMarkerMap()
+{
+ return MarkerWidget->getCustomMarkerMap();
+}
+
+//=================================================================================
+// function : setStandardMarker()
+// purpose :
+//=================================================================================
+void SMESHGUI_Preferences_ColorDlg::setStandardMarker( VTK::MarkerType theMarkerType,
+ VTK::MarkerScale theMarkerScale )
+{
+ MarkerWidget->setStandardMarker( theMarkerType, theMarkerScale );
+}
+
+//=================================================================================
+// function : setCustomMarker()
+// purpose :
+//=================================================================================
+void SMESHGUI_Preferences_ColorDlg::setCustomMarker( int theId )
+{
+ MarkerWidget->setCustomMarker( theId );
+}
+
+//=================================================================================
+// function : getMarkerType()
+// purpose :
+//=================================================================================
+VTK::MarkerType SMESHGUI_Preferences_ColorDlg::getMarkerType() const
+{
+ return MarkerWidget->getMarkerType();
+}
+
+//=================================================================================
+// function : getStandardMarkerScale()
+// purpose :
+//=================================================================================
+VTK::MarkerScale SMESHGUI_Preferences_ColorDlg::getStandardMarkerScale() const
+{
+ return MarkerWidget->getStandardMarkerScale();
+}
+
+//=================================================================================
+// function : getCustomMarkerID()
+// purpose :
+//=================================================================================
+int SMESHGUI_Preferences_ColorDlg::getCustomMarkerID() const
+{
+ return MarkerWidget->getCustomMarkerID();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_Preferences_ColorDlg.h
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
// SMESH includes
#include "SMESH_SMESHGUI.hxx"
+// SALOME GUI includes
+#include <VTKViewer_MarkerDef.h>
+
// Qt includes
#include <QDialog>
-class QSpinBox;
+class QCheckBox;
class SMESHGUI;
-class QtxIntSpinBox;
+class SMESHGUI_SpinBox;
+class SalomeApp_IntSpinBox;
class QtxColorButton;
+class VTKViewer_MarkerWidget;
class SMESHGUI_EXPORT SMESHGUI_Preferences_ColorDlg : public QDialog
{
QColor GetColor( int );
void SetIntValue( int, int );
int GetIntValue( int );
+ void SetDoubleValue( int, double );
+ double GetDoubleValue( int );
+ void SetBooleanValue( int, bool );
+ bool GetBooleanValue( int );
+
+ void setCustomMarkerMap( VTK::MarkerMap );
+ VTK::MarkerMap getCustomMarkerMap();
+
+ void setStandardMarker( VTK::MarkerType, VTK::MarkerScale );
+ void setCustomMarker( int );
+ VTK::MarkerType getMarkerType() const;
+ VTK::MarkerScale getStandardMarkerScale() const;
+ int getCustomMarkerID() const;
protected:
void closeEvent( QCloseEvent* );
QtxColorButton* btnFillColor;
QtxColorButton* btnBackFaceColor;
QtxColorButton* btnOutlineColor;
- QSpinBox* SpinBox_Width;
- QtxIntSpinBox* SpinBox_Shrink;
+ QtxColorButton* btn0DElementsColor;
+ SalomeApp_IntSpinBox* SpinBox_0DElements_Size;
+ SalomeApp_IntSpinBox* SpinBox_Width;
+ SalomeApp_IntSpinBox* SpinBox_Shrink;
QtxColorButton* btnNodeColor;
- QSpinBox* SpinBox_Nodes_Size;
+ VTKViewer_MarkerWidget* MarkerWidget;
+ QtxColorButton* btnOrientationColor;
+ SMESHGUI_SpinBox* SpinBox_Orientation_Scale;
+ QCheckBox* CheckBox_Orientation_3DVectors;
};
#endif // SMESHGUI_PREFERENCES_COLORDLG_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_Preferences_ScalarBarDlg.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
#include "SMESHGUI_Preferences_ScalarBarDlg.h"
#include "SMESHGUI.h"
+#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_Utils.h"
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <SALOME_ListIO.hxx>
+#include <SalomeApp_IntSpinBox.h>
-#include <QtxDoubleSpinBox.h>
#include <QtxColorButton.h>
// Qt includes
#include <QLineEdit>
#include <QPushButton>
#include <QRadioButton>
-#include <QSpinBox>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QGridLayout>
QHBoxLayout* myLabColorGrpLayout = new QHBoxLayout( myLabColorGrp );
myLabColorGrpLayout->setSpacing( SPACING_SIZE ); myLabColorGrpLayout->setMargin( MARGIN_SIZE );
- myColorsSpin = new QSpinBox( myLabColorGrp );
+ myColorsSpin = new SalomeApp_IntSpinBox( myLabColorGrp );
+ myColorsSpin->setAcceptNames( false ); // No Notebook variables allowed
myColorsSpin->setRange( 2, 256 );
myColorsSpin->setSingleStep( 1 );
myColorsSpin->setMinimumWidth( MINIMUM_WIDTH );
myColorsSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myLabelsSpin = new QSpinBox( myLabColorGrp );
+ myLabelsSpin = new SalomeApp_IntSpinBox( myLabColorGrp );
+ myLabelsSpin->setAcceptNames( false ); // No Notebook variables allowed
myLabelsSpin->setRange( 2, 65 );
myLabelsSpin->setSingleStep( 1 );
myLabelsSpin->setMinimumWidth( MINIMUM_WIDTH );
QGridLayout* myOriginDimGrpLayout = new QGridLayout( myOriginDimGrp );
myOriginDimGrpLayout->setSpacing( SPACING_SIZE ); myOriginDimGrpLayout->setMargin( MARGIN_SIZE );
- myXSpin = new QtxDoubleSpinBox (0.0, 1.0, 0.1, myOriginDimGrp);
+ myXSpin = new SMESHGUI_SpinBox(myOriginDimGrp);
+ myXSpin->setAcceptNames( false );
+ myXSpin->RangeStepAndValidator( 0.0, 1.0, 0.1, "parametric_precision" );
myXSpin->setMinimumWidth( MINIMUM_WIDTH );
myXSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myYSpin = new QtxDoubleSpinBox(0.0, 1.0, 0.1, myOriginDimGrp);
+ myYSpin = new SMESHGUI_SpinBox(myOriginDimGrp);
+ myYSpin->setAcceptNames( false );
+ myYSpin->RangeStepAndValidator( 0.0, 1.0, 0.1, "parametric_precision" );
myYSpin->setMinimumWidth( MINIMUM_WIDTH );
myYSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myWidthSpin = new QtxDoubleSpinBox(0.0, 1.0, 0.1, myOriginDimGrp);
+ myWidthSpin = new SMESHGUI_SpinBox(myOriginDimGrp);
+ myWidthSpin->setAcceptNames( false );
+ myWidthSpin->RangeStepAndValidator( 0.0, 1.0, 0.1, "parametric_precision" );
myWidthSpin->setMinimumWidth( MINIMUM_WIDTH );
myWidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myHeightSpin = new QtxDoubleSpinBox(0.0, 1.0, 0.1, myOriginDimGrp);
+ myHeightSpin = new SMESHGUI_SpinBox(myOriginDimGrp);
+ myHeightSpin->setAcceptNames( false );
+ myHeightSpin->RangeStepAndValidator( 0.0, 1.0, 0.1, "parametric_precision" );
myHeightSpin->setMinimumWidth( MINIMUM_WIDTH );
myHeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_Preferences_ScalarBarDlg.h
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
class QPushButton;
class QToolButton;
class QRadioButton;
-class QSpinBox;
class SMESHGUI;
class SMESH_Actor;
-class QtxDoubleSpinBox;
+class SMESHGUI_SpinBox;
+class SalomeApp_IntSpinBox;
class QtxColorButton;
class LightApp_SelectionMgr;
QCheckBox* myLabelsShadowCheck;
QGroupBox* myLabColorGrp;
- QSpinBox* myColorsSpin;
- QSpinBox* myLabelsSpin;
+ SalomeApp_IntSpinBox* myColorsSpin;
+ SalomeApp_IntSpinBox* myLabelsSpin;
QGroupBox* myOrientationGrp;
QRadioButton* myVertRadioBtn;
QRadioButton* myHorizRadioBtn;
QGroupBox* myOriginDimGrp;
- QtxDoubleSpinBox* myXSpin;
- QtxDoubleSpinBox* myYSpin;
- QtxDoubleSpinBox* myWidthSpin;
- QtxDoubleSpinBox* myHeightSpin;
+ SMESHGUI_SpinBox* myXSpin;
+ SMESHGUI_SpinBox* myYSpin;
+ SMESHGUI_SpinBox* myWidthSpin;
+ SMESHGUI_SpinBox* myHeightSpin;
QGroupBox* myButtonGrp;
QPushButton* myOkBtn;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_RemoveElementsDlg.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_RemoveElementsDlg.h
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_RemoveNodesDlg.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_RemoveNodesDlg.h
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_RenumberingDlg.cxx
// Author : Michael ZORIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_RenumberingDlg.h
// Author : Michael ZORIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_RevolutionDlg.cxx
// Author : Michael ZORIN, Open CASCADE S.A.S.
SMESHGUI_RevolutionDlgLayout->addWidget(GroupButtons);
/* Initialisations */
- SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
+ SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
RadioButton3->setChecked(true);
- SpinBox_Angle->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5.0, 3);
+ SpinBox_Angle->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5.0, "angle_precision");
SpinBox_NbSteps->setRange(1, 999999);
- SpinBox_Tolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, 6);
+ SpinBox_Tolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, "len_tol_precision");
RadioButton1->setChecked(true);
SMESH_Actor* anActor = SMESH::FindActorByObject(aMeshVar);
if (!anActor)
anActor = SMESH::FindActorByEntry(IO->getEntry());
- if (!anActor)
+ if (!anActor && !CheckBoxMesh->isChecked())
return;
int aNbUnits = 0;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_RevolutionDlg.h
// Author : Michael ZORIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_RotationDlg.cxx
// Author : Michael ZORIN, Open CASCADE S.A.S.
SMESHGUI_RotationDlgLayout->addWidget(GroupButtons);
/* Initialisations */
- SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
+ SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
- SpinBox_Angle->RangeStepAndValidator(-360.0, +360.0, 5.0, 3);
+ SpinBox_Angle->RangeStepAndValidator(-360.0, +360.0, 5.0, "angle_precision");
myConstructorId = 0;
RadioButton1->setChecked(true);
myActor = SMESH::FindActorByObject(myMesh);
if (!myActor)
myActor = SMESH::FindActorByEntry(IO->getEntry());
- if (!myActor)
+ if (!myActor && !CheckBoxMesh->isChecked())
return;
int aNbUnits = 0;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_RotationDlg.h
// Author : Michael ZORIN, Open CASCADE S.A.S.
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMESHGUI : GUI for SMESH component
+// File : SMESHGUI_ScaleDlg.cxx
+// Author : Michael ZORIN, Open CASCADE S.A.S.
+// SMESH includes
+//
+#include "SMESHGUI_ScaleDlg.h"
+
+#include "SMESHGUI.h"
+#include "SMESHGUI_SpinBox.h"
+#include "SMESHGUI_Utils.h"
+#include "SMESHGUI_VTKUtils.h"
+#include "SMESHGUI_MeshUtils.h"
+#include "SMESHGUI_IdValidator.h"
+#include "SMESHGUI_FilterDlg.h"
+
+#include <SMESH_Actor.h>
+#include <SMESH_TypeFilter.hxx>
+#include <SMESH_LogicalFilter.hxx>
+#include <SMDS_Mesh.hxx>
+
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+#include <SALOME_ListIO.hxx>
+
+// SALOME KERNEL includes
+#include <SALOMEDSClient_SObject.hxx>
+
+// OCCT includes
+#include <TColStd_MapOfInteger.hxx>
+
+// Qt includes
+#include <QApplication>
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QSpinBox>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Group)
+#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
+
+enum { MOVE_ELEMS_BUTTON = 0, COPY_ELEMS_BUTTON, MAKE_MESH_BUTTON }; //!< action type
+
+/*!
+ \class BusyLocker
+ \brief Simple 'busy state' flag locker.
+ \internal
+*/
+
+class BusyLocker
+{
+public:
+ //! Constructor. Sets passed boolean flag to \c true.
+ BusyLocker( bool& busy ) : myBusy( busy ) { myBusy = true; }
+ //! Destructor. Clear external boolean flag passed as parameter to the constructor to \c false.
+ ~BusyLocker() { myBusy = false; }
+private:
+ bool& myBusy; //! External 'busy state' boolean flag
+};
+
+#define SPACING 6
+#define MARGIN 11
+
+//=================================================================================
+// class : SMESHGUI_ScaleDlg()
+// purpose :
+//=================================================================================
+SMESHGUI_ScaleDlg::SMESHGUI_ScaleDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+ myFilterDlg(0),
+ mySelectedObject(SMESH::SMESH_IDSource::_nil())
+{
+ QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_MESH_SCALE")));
+ QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_SCALE_ALONG_AXES")));
+ QPixmap image2 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
+
+ setModal(false);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle(tr("SMESH_SCALE_TITLE"));
+ setSizeGripEnabled(true);
+
+ QVBoxLayout* SMESHGUI_ScaleDlgLayout = new QVBoxLayout(this);
+ SMESHGUI_ScaleDlgLayout->setSpacing(SPACING);
+ SMESHGUI_ScaleDlgLayout->setMargin(MARGIN);
+
+ /***************************************************************/
+ ConstructorsBox = new QGroupBox(tr("SMESH_SCALE"), this);
+ GroupConstructors = new QButtonGroup(this);
+ QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox);
+ ConstructorsBoxLayout->setSpacing(SPACING);
+ ConstructorsBoxLayout->setMargin(MARGIN);
+
+ RadioButton1= new QRadioButton(ConstructorsBox);
+ RadioButton1->setIcon(image0);
+ RadioButton2= new QRadioButton(ConstructorsBox);
+ RadioButton2->setIcon(image1);
+
+ ConstructorsBoxLayout->addWidget(RadioButton1);
+ ConstructorsBoxLayout->addWidget(RadioButton2);
+ GroupConstructors->addButton(RadioButton1, 0);
+ GroupConstructors->addButton(RadioButton2, 1);
+
+ /***************************************************************/
+ GroupArguments = new QGroupBox(tr("SMESH_ARGUMENTS"), this);
+ QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
+ GroupArgumentsLayout->setSpacing(SPACING);
+ GroupArgumentsLayout->setMargin(MARGIN);
+
+ myIdValidator = new SMESHGUI_IdValidator(this);
+
+ // Controls for elements selection
+ TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
+ SelectElementsButton = new QPushButton(GroupArguments);
+ SelectElementsButton->setIcon(image2);
+ LineEditElements = new QLineEdit(GroupArguments);
+ LineEditElements->setValidator(myIdValidator);
+ myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
+ connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
+
+ // Control for the whole mesh selection
+ CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
+
+ // Controls for vector and points selection
+ TextLabel1 = new QLabel(tr("SMESH_BASE_POINT"), GroupArguments);
+ SelectButton1 = new QPushButton(GroupArguments);
+ SelectButton1->setIcon(image2);
+
+ TextLabel1_1 = new QLabel(tr("SMESH_X"), GroupArguments);
+ SpinBox1_1 = new SMESHGUI_SpinBox(GroupArguments);
+ TextLabel1_2 = new QLabel(tr("SMESH_Y"), GroupArguments);
+ SpinBox1_2 = new SMESHGUI_SpinBox(GroupArguments);
+ TextLabel1_3 = new QLabel(tr("SMESH_Z"), GroupArguments);
+ SpinBox1_3 = new SMESHGUI_SpinBox(GroupArguments);
+
+ TextLabel2 = new QLabel(tr("SMESH_SCALE_FACTOR"), GroupArguments);
+ SpinBox_FX = new SMESHGUI_SpinBox(GroupArguments);
+
+ TextLabel3 = new QLabel(tr("SMESH_SCALE_FACTOR_Y"), GroupArguments);
+ SpinBox_FY = new SMESHGUI_SpinBox(GroupArguments);
+
+ TextLabel4 = new QLabel(tr("SMESH_SCALE_FACTOR_Z"), GroupArguments);
+ SpinBox_FZ = new SMESHGUI_SpinBox(GroupArguments);
+
+
+ // switch of action type
+ ActionBox = new QGroupBox(GroupArguments);
+ ActionGroup = new QButtonGroup(GroupArguments);
+ QVBoxLayout* ActionBoxLayout = new QVBoxLayout(ActionBox);
+ ActionBoxLayout->addSpacing(SPACING);
+ ActionBoxLayout->setMargin(MARGIN);
+
+ QRadioButton* aMoveElements = new QRadioButton(tr("SMESH_MOVE_ELEMENTS"), ActionBox);
+ QRadioButton* aCopyElements = new QRadioButton(tr("SMESH_COPY_ELEMENTS"), ActionBox);
+ QRadioButton* aCreateMesh = new QRadioButton(tr("SMESH_CREATE_MESH"), ActionBox);
+
+ ActionBoxLayout->addWidget(aMoveElements);
+ ActionBoxLayout->addWidget(aCopyElements);
+ ActionBoxLayout->addWidget(aCreateMesh);
+ ActionGroup->addButton(aMoveElements, MOVE_ELEMS_BUTTON);
+ ActionGroup->addButton(aCopyElements, COPY_ELEMS_BUTTON);
+ ActionGroup->addButton(aCreateMesh, MAKE_MESH_BUTTON);
+
+ // CheckBox for groups generation
+ MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
+ MakeGroupsCheck->setChecked(false);
+
+ // Name of a mesh to create
+ LineEditNewMesh = new QLineEdit(GroupArguments);
+
+ // layout
+ GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
+ GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
+ GroupArgumentsLayout->addWidget(LineEditElements, 0, 2, 1, 5);
+ GroupArgumentsLayout->addWidget(myFilterBtn, 0, 7);
+ GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 8);
+ GroupArgumentsLayout->addWidget(TextLabel1, 2, 0);
+ GroupArgumentsLayout->addWidget(SelectButton1, 2, 1);
+ GroupArgumentsLayout->addWidget(TextLabel1_1, 2, 2);
+ GroupArgumentsLayout->addWidget(SpinBox1_1, 2, 3);
+ GroupArgumentsLayout->addWidget(TextLabel1_2, 2, 4);
+ GroupArgumentsLayout->addWidget(SpinBox1_2, 2, 5);
+ GroupArgumentsLayout->addWidget(TextLabel1_3, 2, 6);
+ GroupArgumentsLayout->addWidget(SpinBox1_3, 2, 7);
+ GroupArgumentsLayout->addWidget(TextLabel2, 3, 0);
+ GroupArgumentsLayout->addWidget(SpinBox_FX, 3, 3);
+ GroupArgumentsLayout->addWidget(TextLabel3, 4, 0);
+ GroupArgumentsLayout->addWidget(SpinBox_FY, 4, 3);
+ GroupArgumentsLayout->addWidget(TextLabel4, 5, 0);
+ GroupArgumentsLayout->addWidget(SpinBox_FZ, 5, 3);
+ GroupArgumentsLayout->addWidget(ActionBox, 7, 0, 3, 4);
+ GroupArgumentsLayout->addWidget(MakeGroupsCheck, 7, 5, 1, 4);
+ GroupArgumentsLayout->addWidget(LineEditNewMesh, 8, 5, 1, 4);
+
+ /***************************************************************/
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
+
+ /***************************************************************/
+ SMESHGUI_ScaleDlgLayout->addWidget(ConstructorsBox);
+ SMESHGUI_ScaleDlgLayout->addWidget(GroupArguments);
+ SMESHGUI_ScaleDlgLayout->addWidget(GroupButtons);
+
+ /* Initialisations */
+ SpinBox1_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox1_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox1_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_FX->RangeStepAndValidator(1.e-6, 1.e+6, 1.0, "parametric_precision");
+ SpinBox_FX->SetStep(0.1);
+ SpinBox_FY->RangeStepAndValidator(1.e-6, 1.e+6, 1.0, "parametric_precision");
+ SpinBox_FY->SetStep(0.1);
+ SpinBox_FZ->RangeStepAndValidator(1.e-6, 1.e+6, 1.0, "parametric_precision");
+ SpinBox_FZ->SetStep(0.1);
+
+ RadioButton1->setChecked(true);
+
+ mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
+ mySMESHGUI->SetActiveDialogBox((QDialog*)this);
+
+ // Costruction of the logical filter
+ SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
+ SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
+
+ QList<SUIT_SelectionFilter*> aListOfFilters;
+ if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
+ if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
+
+ myMeshOrSubMeshOrGroupFilter =
+ new SMESH_LogicalFilter(aListOfFilters, SMESH_LogicalFilter::LO_OR);
+
+ myHelpFileName = "scale_page.html";
+
+ Init();
+
+ /* signals and slots connections */
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
+ connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
+
+ connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(SelectButton1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
+
+ connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+ connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ /* to close dialog if study change */
+ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
+ connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
+ connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
+
+ ConstructorsClicked(0);
+ SelectionIntoArgument();
+ onActionClicked(MOVE_ELEMS_BUTTON);
+}
+
+//=================================================================================
+// function : ~SMESHGUI_ScaleDlg()
+// purpose : Destroys the object and frees any allocated resources
+//=================================================================================
+SMESHGUI_ScaleDlg::~SMESHGUI_ScaleDlg()
+{
+ if ( myFilterDlg ) {
+ myFilterDlg->setParent( 0 );
+ delete myFilterDlg;
+ myFilterDlg = 0;
+ }
+}
+
+//=================================================================================
+// function : Init()
+// purpose :
+//=================================================================================
+void SMESHGUI_ScaleDlg::Init (bool ResetControls)
+{
+ myBusy = false;
+
+ myEditCurrentArgument = 0;
+ LineEditElements->clear();
+ myElementsId = "";
+ myNbOkElements = 0;
+
+ buttonOk->setEnabled(false);
+ buttonApply->setEnabled(false);
+
+ myActor = 0;
+ myMesh = SMESH::SMESH_Mesh::_nil();
+
+ if (ResetControls) {
+ SpinBox1_1->SetValue(0.0);
+ SpinBox1_2->SetValue(0.0);
+ SpinBox1_3->SetValue(0.0);
+ SpinBox_FX->SetValue(1.0);
+ SpinBox_FY->SetValue(1.0);
+ SpinBox_FZ->SetValue(1.0);
+
+ ActionGroup->button( MOVE_ELEMS_BUTTON )->setChecked(true);
+ CheckBoxMesh->setChecked(false);
+ onSelectMesh(false);
+ }
+}
+
+//=================================================================================
+// function : ConstructorsClicked()
+// purpose : Radio button management
+//=================================================================================
+void SMESHGUI_ScaleDlg::ConstructorsClicked (int constructorId)
+{
+ disconnect(mySelectionMgr, 0, this, 0);
+
+ switch (constructorId) {
+ case 0:
+ {
+ TextLabel2->setText(tr("SMESH_SCALE_FACTOR"));
+ TextLabel3->hide();
+ TextLabel4->hide();
+ SpinBox_FY->hide();
+ SpinBox_FZ->hide();
+ break;
+ }
+ case 1:
+ {
+ TextLabel2->setText(tr("SMESH_SCALE_FACTOR_X"));
+ TextLabel3->show();
+ TextLabel4->show();
+ SpinBox_FY->show();
+ SpinBox_FZ->show();
+ break;
+ }
+ }
+
+ if (myEditCurrentArgument != (QWidget*)LineEditElements) {
+ SMESH::SetPointRepresentation(false);
+ if (!CheckBoxMesh->isChecked())
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( CellSelection );
+ }
+
+ myEditCurrentArgument = (QWidget*)LineEditElements;
+ LineEditElements->setFocus();
+
+ if (CheckBoxMesh->isChecked())
+ onSelectMesh(true);
+
+ connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+ QApplication::instance()->processEvents();
+ updateGeometry();
+ resize(100,100);
+}
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose :
+//=================================================================================
+bool SMESHGUI_ScaleDlg::ClickOnApply()
+{
+ if (mySMESHGUI->isActiveStudyLocked())
+ return false;
+
+ if( !isValid() )
+ return false;
+
+ if (myNbOkElements) {
+ QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
+
+ SMESH::long_array_var anElementsId = new SMESH::long_array;
+
+ anElementsId->length(aListElementsId.count());
+ for (int i = 0; i < aListElementsId.count(); i++)
+ anElementsId[i] = aListElementsId[i].toInt();
+
+ SMESH::PointStruct aPoint;
+ aPoint.x = SpinBox1_1->GetValue();
+ aPoint.y = SpinBox1_2->GetValue();
+ aPoint.z = SpinBox1_3->GetValue();
+ SMESH::double_array_var aScaleFact = new SMESH::double_array;
+ aScaleFact->length(3);
+ aScaleFact[0] = SpinBox_FX->GetValue();
+ if (GetConstructorId() == 0) {
+ aScaleFact[1] = SpinBox_FX->GetValue();
+ aScaleFact[2] = SpinBox_FX->GetValue();
+ }
+ else {
+ aScaleFact[1] = SpinBox_FY->GetValue();
+ aScaleFact[2] = SpinBox_FZ->GetValue();
+ }
+
+ QStringList aParameters;
+ aParameters << SpinBox1_1->text();
+ aParameters << SpinBox1_2->text();
+ aParameters << SpinBox1_3->text();
+ aParameters << SpinBox_FX->text();
+ if (GetConstructorId() == 1) {
+ aParameters << SpinBox_FX->text();
+ aParameters << SpinBox_FX->text();
+ }
+ else {
+ aParameters << SpinBox_FY->text();
+ aParameters << SpinBox_FZ->text();
+ }
+
+ int actionButton = ActionGroup->checkedId();
+ bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
+ try {
+ SUIT_OverrideCursor aWaitCursor;
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+ switch ( actionButton ) {
+ case MOVE_ELEMS_BUTTON:
+ if(CheckBoxMesh->isChecked()) {
+ aMeshEditor->Scale(mySelectedObject, aPoint, aScaleFact, false);
+ }
+ else {
+ SMESH::SMESH_IDSource_ptr anObj = aMeshEditor->MakeIDSource(anElementsId);
+ aMeshEditor->Scale(anObj, aPoint, aScaleFact, false);
+ }
+ if( !myMesh->_is_nil())
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ break;
+ case COPY_ELEMS_BUTTON:
+ if ( makeGroups ) {
+ SMESH::ListOfGroups_var groups;
+ if(CheckBoxMesh->isChecked()) {
+ groups = aMeshEditor->ScaleMakeGroups(mySelectedObject, aPoint, aScaleFact);
+ }
+ else {
+ groups = aMeshEditor->ScaleMakeGroups(aMeshEditor->MakeIDSource(anElementsId),
+ aPoint, aScaleFact);
+ }
+ }
+ else {
+ if(CheckBoxMesh->isChecked()) {
+ aMeshEditor->Scale(mySelectedObject, aPoint, aScaleFact, true);
+ }
+ else {
+ aMeshEditor->Scale(aMeshEditor->MakeIDSource(anElementsId),
+ aPoint, aScaleFact, true);
+ }
+ }
+ if( !myMesh->_is_nil())
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ break;
+ case MAKE_MESH_BUTTON:
+ SMESH::SMESH_Mesh_var mesh;
+ if(CheckBoxMesh->isChecked()) {
+ mesh = aMeshEditor->ScaleMakeMesh(mySelectedObject, aPoint, aScaleFact, makeGroups,
+ LineEditNewMesh->text().toLatin1().data());
+ }
+ else {
+ mesh = aMeshEditor->ScaleMakeMesh(aMeshEditor->MakeIDSource(anElementsId),
+ aPoint, aScaleFact, makeGroups,
+ LineEditNewMesh->text().toLatin1().data());
+ }
+ if( !mesh->_is_nil())
+ mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ }
+ } catch (...) {
+ }
+
+ SMESH::UpdateView();
+ if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ||
+ actionButton == MAKE_MESH_BUTTON )
+ mySMESHGUI->updateObjBrowser(true); // new groups may appear
+ Init(false);
+ ConstructorsClicked(GetConstructorId());
+ mySelectedObject = SMESH::SMESH_IDSource::_nil();
+ SelectionIntoArgument();
+ }
+
+ return true;
+}
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose :
+//=================================================================================
+void SMESHGUI_ScaleDlg::ClickOnOk()
+{
+ if( ClickOnApply() )
+ ClickOnCancel();
+}
+
+//=================================================================================
+// function : ClickOnCancel()
+// purpose :
+//=================================================================================
+void SMESHGUI_ScaleDlg::ClickOnCancel()
+{
+ disconnect(mySelectionMgr, 0, this, 0);
+ mySelectionMgr->clearFilters();
+ //mySelectionMgr->clearSelected();
+ if (SMESH::GetCurrentVtkView()) {
+ SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
+ SMESH::SetPointRepresentation(false);
+ }
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( ActorSelection );
+ mySMESHGUI->ResetState();
+ reject();
+}
+
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_ScaleDlg::ClickOnHelp()
+{
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
+ else {
+ QString platform;
+#ifdef WIN32
+ platform = "winapplication";
+#else
+ platform = "application";
+#endif
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
+ }
+}
+
+//=======================================================================
+// function : onTextChange()
+// purpose :
+//=======================================================================
+void SMESHGUI_ScaleDlg::onTextChange (const QString& theNewText)
+{
+ QLineEdit* send = (QLineEdit*)sender();
+
+ if (myBusy) return;
+ BusyLocker lock( myBusy );
+
+ if (send == LineEditElements)
+ myNbOkElements = 0;
+
+ buttonOk->setEnabled(false);
+ buttonApply->setEnabled(false);
+
+ // hilight entered elements
+ SMDS_Mesh* aMesh = 0;
+ if (myActor)
+ aMesh = myActor->GetObject()->GetMesh();
+
+ if (aMesh) {
+ Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
+
+ TColStd_MapOfInteger newIndices;
+
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
+
+ if (send == LineEditElements) {
+ for (int i = 0; i < aListId.count(); i++) {
+ const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
+ if (e)
+ newIndices.Add(e->GetID());
+ myNbOkElements++;
+ }
+ }
+
+ mySelector->AddOrRemoveIndex( anIO, newIndices, false );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( anIO, true, true );
+
+ myElementsId = theNewText;
+ }
+
+ if (myNbOkElements) {
+ buttonOk->setEnabled(true);
+ buttonApply->setEnabled(true);
+ }
+}
+
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose : Called when selection as changed or other case
+//=================================================================================
+void SMESHGUI_ScaleDlg::SelectionIntoArgument()
+{
+ if (myBusy) return;
+ BusyLocker lock( myBusy );
+ // clear
+ myActor = 0;
+ QString aString = "";
+
+ if (myEditCurrentArgument == (QWidget*)LineEditElements) {
+ LineEditElements->setText(aString);
+ myNbOkElements = 0;
+ buttonOk->setEnabled(false);
+ buttonApply->setEnabled(false);
+ }
+
+ if (!GroupButtons->isEnabled()) // inactive
+ return;
+
+ // get selected mesh
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
+
+ int nbSel = aList.Extent();
+ if (nbSel != 1)
+ return;
+
+ Handle(SALOME_InteractiveObject) IO = aList.First();
+ myMesh = SMESH::GetMeshByIO(IO);
+ if (myMesh->_is_nil())
+ return;
+
+ myActor = SMESH::FindActorByObject(myMesh);
+ if (!myActor)
+ myActor = SMESH::FindActorByEntry(IO->getEntry());
+ if (!myActor && !CheckBoxMesh->isChecked())
+ return;
+
+ int aNbUnits = 0;
+
+ if (myEditCurrentArgument == (QWidget*)LineEditElements) {
+ myElementsId = "";
+
+ // MakeGroups is available if there are groups and "Copy"
+ if ( myMesh->NbGroups() == 0 ) {
+ MakeGroupsCheck->setChecked(false);
+ MakeGroupsCheck->setEnabled(false);
+ }
+ else if ( ActionGroup->checkedId() != MOVE_ELEMS_BUTTON ) {
+ MakeGroupsCheck->setEnabled(true);
+ }
+
+ if (CheckBoxMesh->isChecked()) {
+ SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString );
+
+ if (!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil()) { //MESH, SUBMESH, OR GROUP
+ mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
+ }
+ else
+ return;
+ // get IDs from mesh
+ /*
+ SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
+ if (!aSMDSMesh)
+ return;
+
+ for (int i = aSMDSMesh->MinElementID(); i <= aSMDSMesh->MaxElementID(); i++) {
+ const SMDS_MeshElement * e = aSMDSMesh->FindElement(i);
+ if (e) {
+ myElementsId += QString(" %1").arg(i);
+ aNbUnits++;
+ }
+ }
+ } else if (!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) { //SUBMESH
+ // get submesh
+ SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
+
+ // get IDs from submesh
+ SMESH::long_array_var anElementsIds = new SMESH::long_array;
+ anElementsIds = aSubMesh->GetElementsId();
+ for (int i = 0; i < anElementsIds->length(); i++) {
+ myElementsId += QString(" %1").arg(anElementsIds[i]);
+ }
+ aNbUnits = anElementsIds->length();
+ } else { // GROUP
+ // get smesh group
+ SMESH::SMESH_GroupBase_var aGroup =
+ SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
+ if (aGroup->_is_nil())
+ return;
+
+ // get IDs from smesh group
+ SMESH::long_array_var anElementsIds = new SMESH::long_array;
+ anElementsIds = aGroup->GetListOfID();
+ for (int i = 0; i < anElementsIds->length(); i++) {
+ myElementsId += QString(" %1").arg(anElementsIds[i]);
+ }
+ aNbUnits = anElementsIds->length();
+ }
+ */
+ } else {
+ aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
+ myElementsId = aString;
+ if (aNbUnits < 1)
+ return;
+ }
+
+ myNbOkElements = true;
+ } else {
+ aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
+ if (aNbUnits != 1)
+ return;
+
+ SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh();
+ if (!aMesh)
+ return;
+
+ const SMDS_MeshNode * n = aMesh->FindNode(aString.toInt());
+ if (!n)
+ return;
+
+ double x = n->X();
+ double y = n->Y();
+ double z = n->Z();
+
+ if (myEditCurrentArgument == (QWidget*)SpinBox1_1) {
+ SpinBox1_1->SetValue(x);
+ SpinBox1_2->SetValue(y);
+ SpinBox1_3->SetValue(z);
+ }
+ else if (myEditCurrentArgument == (QWidget*)SpinBox_FX) {
+ SpinBox_FX->SetValue(x);
+ SpinBox_FY->SetValue(y);
+ SpinBox_FZ->SetValue(z);
+ }
+ }
+
+ if (myEditCurrentArgument == (QWidget*)LineEditElements) {
+ LineEditElements->setText(aString);
+ LineEditElements->repaint();
+ LineEditElements->setEnabled(false); // to fully update lineedit IPAL 19809
+ LineEditElements->setEnabled(true);
+ setNewMeshName();
+ }
+
+ // OK
+ if (myNbOkElements) {
+ buttonOk->setEnabled(true);
+ buttonApply->setEnabled(true);
+ }
+}
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose :
+//=================================================================================
+void SMESHGUI_ScaleDlg::SetEditCurrentArgument()
+{
+ QPushButton* send = (QPushButton*)sender();
+
+ disconnect(mySelectionMgr, 0, this, 0);
+ mySelectionMgr->clearSelected();
+ mySelectionMgr->clearFilters();
+
+ if (send == SelectElementsButton) {
+ myEditCurrentArgument = (QWidget*)LineEditElements;
+ SMESH::SetPointRepresentation(false);
+ if (CheckBoxMesh->isChecked()) {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( ActorSelection );
+ mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
+ }
+ else {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( CellSelection );
+ }
+ }
+ else if (send == SelectButton1) {
+ myEditCurrentArgument = (QWidget*)SpinBox1_1;
+ SMESH::SetPointRepresentation(true);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( NodeSelection );
+ }
+
+ myEditCurrentArgument->setFocus();
+ connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : DeactivateActiveDialog()
+// purpose :
+//=================================================================================
+void SMESHGUI_ScaleDlg::DeactivateActiveDialog()
+{
+ if (ConstructorsBox->isEnabled()) {
+ ConstructorsBox->setEnabled(false);
+ GroupArguments->setEnabled(false);
+ GroupButtons->setEnabled(false);
+ mySMESHGUI->ResetState();
+ mySMESHGUI->SetActiveDialogBox(0);
+ }
+}
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose :
+//=================================================================================
+void SMESHGUI_ScaleDlg::ActivateThisDialog()
+{
+ /* Emit a signal to deactivate the active dialog */
+ mySMESHGUI->EmitSignalDeactivateDialog();
+ ConstructorsBox->setEnabled(true);
+ GroupArguments->setEnabled(true);
+ GroupButtons->setEnabled(true);
+
+ mySMESHGUI->SetActiveDialogBox((QDialog*)this);
+
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( CellSelection );
+
+ SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : enterEvent()
+// purpose :
+//=================================================================================
+void SMESHGUI_ScaleDlg::enterEvent (QEvent*)
+{
+ if (!ConstructorsBox->isEnabled())
+ ActivateThisDialog();
+}
+
+//=================================================================================
+// function : closeEvent()
+// purpose :
+//=================================================================================
+void SMESHGUI_ScaleDlg::closeEvent (QCloseEvent*)
+{
+ /* same than click on cancel button */
+ ClickOnCancel();
+}
+
+//=======================================================================
+//function : hideEvent
+//purpose : caused by ESC key
+//=======================================================================
+void SMESHGUI_ScaleDlg::hideEvent (QHideEvent*)
+{
+ if (!isMinimized())
+ ClickOnCancel();
+}
+
+//=======================================================================
+//function : onSelectMesh
+//purpose :
+//=======================================================================
+void SMESHGUI_ScaleDlg::onSelectMesh (bool toSelectMesh)
+{
+ if (toSelectMesh)
+ TextLabelElements->setText(tr("SMESH_NAME"));
+ else
+ TextLabelElements->setText(tr("SMESH_ID_ELEMENTS"));
+ myFilterBtn->setEnabled(!toSelectMesh);
+
+ if (myEditCurrentArgument != LineEditElements) {
+ LineEditElements->clear();
+ return;
+ }
+
+ mySelectionMgr->clearFilters();
+ SMESH::SetPointRepresentation(false);
+
+ if (toSelectMesh) {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( ActorSelection );
+ mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
+ LineEditElements->setReadOnly(true);
+ LineEditElements->setValidator(0);
+ } else {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( CellSelection );
+ LineEditElements->setReadOnly(false);
+ LineEditElements->setValidator(myIdValidator);
+ onTextChange(LineEditElements->text());
+ }
+
+ SelectionIntoArgument();
+}
+
+//=======================================================================
+//function : onActionClicked
+//purpose : slot called when an action type changed
+//=======================================================================
+
+void SMESHGUI_ScaleDlg::onActionClicked(int button)
+{
+ switch ( button ) {
+ case MOVE_ELEMS_BUTTON:
+ MakeGroupsCheck->setEnabled(false);
+ LineEditNewMesh->setEnabled(false);
+ break;
+ case COPY_ELEMS_BUTTON:
+ LineEditNewMesh->setEnabled(false);
+ MakeGroupsCheck->setText( tr("SMESH_MAKE_GROUPS"));
+ if ( myMesh->_is_nil() || myMesh->NbGroups() > 0)
+ MakeGroupsCheck->setEnabled(true);
+ else
+ MakeGroupsCheck->setEnabled(false);
+ break;
+ case MAKE_MESH_BUTTON:
+ LineEditNewMesh->setEnabled(true);
+ MakeGroupsCheck->setText( tr("SMESH_COPY_GROUPS"));
+ if ( myMesh->_is_nil() || myMesh->NbGroups() > 0)
+ MakeGroupsCheck->setEnabled(true);
+ else
+ MakeGroupsCheck->setEnabled(false);
+ break;
+ }
+ setNewMeshName();
+}
+
+//=======================================================================
+//function : setNewMeshName
+//purpose : update contents of LineEditNewMesh
+//=======================================================================
+
+void SMESHGUI_ScaleDlg::setNewMeshName()
+{
+ LineEditNewMesh->setText("");
+ if ( LineEditNewMesh->isEnabled() && !myMesh->_is_nil() ) {
+ QString name;
+ if ( CheckBoxMesh->isChecked() ) {
+ name = LineEditElements->text();
+ }
+ else {
+ _PTR(SObject) meshSO = SMESH::FindSObject( myMesh );
+ name = meshSO->GetName().c_str();
+ }
+ if ( !name.isEmpty() )
+ LineEditNewMesh->setText( SMESH::UniqueMeshName( name, "scaled"));
+ }
+}
+
+//=================================================================================
+// function : GetConstructorId()
+// purpose :
+//=================================================================================
+int SMESHGUI_ScaleDlg::GetConstructorId()
+{
+ return GroupConstructors->checkedId();
+}
+
+//=================================================================================
+// function : keyPressEvent()
+// purpose :
+//=================================================================================
+void SMESHGUI_ScaleDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
+}
+
+//=================================================================================
+// function : setFilters()
+// purpose : SLOT. Called when "Filter" button pressed.
+//=================================================================================
+void SMESHGUI_ScaleDlg::setFilters()
+{
+ if(myMesh->_is_nil()) {
+ SUIT_MessageBox::critical(this,
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
+ return;
+ }
+ if ( !myFilterDlg )
+ myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );
+
+ myFilterDlg->SetSelection();
+ myFilterDlg->SetMesh( myMesh );
+ myFilterDlg->SetSourceWg( LineEditElements );
+
+ myFilterDlg->show();
+}
+
+//=================================================================================
+// function : isValid
+// purpose :
+//=================================================================================
+bool SMESHGUI_ScaleDlg::isValid()
+{
+ bool ok = true;
+ QString msg;
+
+ ok = SpinBox1_1->isValid( msg, true ) && ok;
+ ok = SpinBox1_2->isValid( msg, true ) && ok;
+ ok = SpinBox1_3->isValid( msg, true ) && ok;
+ ok = SpinBox_FX->isValid( msg, true ) && ok;
+ if (GetConstructorId() == 1) {
+ ok = SpinBox_FY->isValid( msg, true ) && ok;
+ ok = SpinBox_FZ->isValid( msg, true ) && ok;
+ }
+
+ if( !ok ) {
+ QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+ if ( !msg.isEmpty() )
+ str += "\n" + msg;
+ SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+ return false;
+ }
+ return true;
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SMESH SMESHGUI : GUI for SMESH component
+// File : SMESHGUI_ScaleDlg.h
+// Author : Sergey Kuul, Open CASCADE S.A.S.
+//
+#ifndef SMESHGUI_SCALEDLG_H
+#define SMESHGUI_SCALEDLG_H
+
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
+
+// Qt includes
+#include <QDialog>
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
+
+class QButtonGroup;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QRadioButton;
+class QCheckBox;
+class SMESHGUI;
+class SMESHGUI_IdValidator;
+class SMESHGUI_SpinBox;
+class SMESHGUI_FilterDlg;
+class SMESH_Actor;
+class SVTK_Selector;
+class LightApp_SelectionMgr;
+class SMESH_LogicalFilter;
+
+//=================================================================================
+// class : SMESHGUI_ScaleDlg
+// purpose :
+//=================================================================================
+class SMESHGUI_EXPORT SMESHGUI_ScaleDlg : public QDialog
+{
+ Q_OBJECT
+
+public:
+ SMESHGUI_ScaleDlg( SMESHGUI* );
+ ~SMESHGUI_ScaleDlg();
+
+private:
+ void Init( bool = true );
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+ int GetConstructorId();
+ void setNewMeshName();
+
+ bool isValid();
+
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ SMESHGUI_IdValidator* myIdValidator;
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ QString myElementsId;
+ int myNbOkElements; /* to check when elements are defined */
+
+ SVTK_Selector* mySelector;
+
+ QWidget* myEditCurrentArgument;
+
+ bool myBusy;
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH_Actor* myActor;
+ SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
+
+ SMESH::SMESH_IDSource_var mySelectedObject;
+
+ QGroupBox* ConstructorsBox;
+ QButtonGroup* GroupConstructors;
+ QRadioButton* RadioButton1;
+ QRadioButton* RadioButton2;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+ QGroupBox* GroupArguments;
+ QLabel* TextLabelElements;
+ QPushButton* SelectElementsButton;
+ QLineEdit* LineEditElements;
+ QCheckBox* CheckBoxMesh;
+ QLabel* TextLabel1;
+ QPushButton* SelectButton1;
+ QLabel* TextLabel1_1;
+ SMESHGUI_SpinBox* SpinBox1_1;
+ QLabel* TextLabel1_2;
+ SMESHGUI_SpinBox* SpinBox1_2;
+ QLabel* TextLabel1_3;
+ SMESHGUI_SpinBox* SpinBox1_3;
+ QLabel* TextLabel2;
+ SMESHGUI_SpinBox* SpinBox_FX;
+ QLabel* TextLabel3;
+ SMESHGUI_SpinBox* SpinBox_FY;
+ QLabel* TextLabel4;
+ SMESHGUI_SpinBox* SpinBox_FZ;
+ QGroupBox* ActionBox;
+ QButtonGroup* ActionGroup;
+ QCheckBox* MakeGroupsCheck;
+ QLineEdit* LineEditNewMesh;
+
+ QString myHelpFileName;
+
+ QPushButton* myFilterBtn;
+ SMESHGUI_FilterDlg* myFilterDlg;
+
+private slots:
+ void ConstructorsClicked( int );
+ void ClickOnOk();
+ void ClickOnCancel();
+ bool ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onTextChange( const QString& );
+ void onSelectMesh( bool );
+ void onActionClicked( int );
+ void setFilters();
+};
+
+#endif // SMESHGUI_SCALEDLG_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI_Selection
// File : SMESHGUI_Selection.cxx
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
//function : processOwner
//purpose :
//=======================================================================
-void SMESHGUI_Selection::processOwner( const LightApp_DataOwner* ow )
+bool SMESHGUI_Selection::processOwner( const LightApp_DataOwner* ow )
{
const LightApp_SVTKDataOwner* owner =
dynamic_cast<const LightApp_SVTKDataOwner*> ( ow );
myActors.append( dynamic_cast<SMESH_Actor*>( owner->GetActor() ) );
else
myActors.append( 0 );
+ return true;
}
//=======================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI_Selection
// File : SMESHGUI_Selection.h
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
virtual void init( const QString&, LightApp_SelectionMgr* );
virtual QVariant parameter( const int, const QString& ) const;
- virtual void processOwner( const LightApp_DataOwner* );
+ virtual bool processOwner( const LightApp_DataOwner* );
// got from object, not from actor
virtual bool isAutoColor( int ) const;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_SelectionOp.cxx
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
// SMESH includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_SelectionOp.h
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_SewingDlg.cxx
// Author : Michael ZORIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_SewingDlg.h
// Author : Michael ZORIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_ShapeByMeshDlg.cxx
// Author : Edward AGAPOV, Open CASCADE S.A.S.
// SMESH includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_ShapeByMeshDlg.h
// Author : Edward AGAPOV, Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_SingleEditDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
// SMESH includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESHGUI_SingleEditDlg.h
// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_SmoothingDlg.cxx
// Author : Michael ZORIN, Open CASCADE S.A.S.
SpinBox_IterationLimit->setRange(1, 999999);
SpinBox_IterationLimit->setValue(20);
- SpinBox_AspectRatio->RangeStepAndValidator(0.0, +999999.999, 0.1, 3);
+ SpinBox_AspectRatio->RangeStepAndValidator(0.0, +999999.999, 0.1, "parametric_precision");
SpinBox_AspectRatio->SetValue(1.1);
GroupArguments->show();
}
if (aResult) {
- Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
+ if ( myActor ) {
+ Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
+ SALOME_ListIO aList;
+ aList.Append(anIO);
+ mySelectionMgr->setSelectedObjects(aList, false);
+ }
- SALOME_ListIO aList;
- aList.Append(anIO);
- mySelectionMgr->setSelectedObjects(aList, false);
SMESH::UpdateView();
Init();
return;
myActor = SMESH::FindActorByObject(myMesh);
- if (!myActor)
+ if (!myActor && !CheckBoxMesh->isChecked())
return;
int aNbUnits = 0;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_SmoothingDlg.h
// Author : Michael ZORIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_SpinBox.cxx
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "SMESHGUI_SpinBox.h"
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+
// Qt includes
-#include <QDoubleValidator>
#include <QLineEdit>
+#include <QVariant>
//=================================================================================
// class : SMESHGUI_SpinBox()
return SalomeApp_DoubleSpinBox::lineEdit();
}
-//=================================================================================
-// function : validator()
-// purpose : returns validator
-//=================================================================================
-QDoubleValidator* SMESHGUI_SpinBox::validator() const
-{
- return (QDoubleValidator*)editor()->validator();
-}
-
//=================================================================================
// function : RangeStepAndValidator()
// purpose :
void SMESHGUI_SpinBox::RangeStepAndValidator( double min,
double max,
double step,
- unsigned short precision )
+ const char* quantity )
{
- setPrecision(precision*(-1)); // PAL8769. Minus is for using 'g' double->string conversion specifier,
- // see QtxDoubleSpinBox::mapValueToText( double v )
- setDecimals(32);
+ // Obtain precision from preferences
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ int precision = resMgr->integerValue( "SMESH", quantity, -3 );
+
+ setPrecision(precision); // PAL8769. Minus is for using 'g' double->string conversion specifier,
+ // see QtxDoubleSpinBox::mapValueToText( double v )
+ // san: this can be achieved using preferences
+ setDecimals(qAbs(precision));
setRange(min, max);
setSingleStep( step );
setDefaultValue( min );
+
+ // Add a hint for the user saying how to tune precision
+ QString userPropName = QObject::tr( QString( "SMESH_PREF_%1" ).arg( quantity ).toLatin1().constData() );
+ setProperty( "validity_tune_hint",
+ QVariant( QObject::tr( "SMESH_PRECISION_HINT" ).arg( userPropName ) ) );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_SpinBox.h
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
void RangeStepAndValidator( double = -1000000.0,
double = +1000000.0,
double = 100.0,
- unsigned short = 3 );
+ const char* = "length_precision" );
void SetValue( double );
double GetValue() const;
QString GetString() const;
QLineEdit* editor() const;
- QDoubleValidator* validator() const;
public slots:
void SetStep( double );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_StandardMeshInfosDlg.cxx
// Author : Michael ZORIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_StandardMeshInfosDlg.h
// Author : Michael ZORIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_SymmetryDlg.cxx
// Author : Michael ZORIN, Open CASCADE S.A.S.
SMESHGUI_SymmetryDlgLayout->addWidget(GroupButtons);
/* Initialisations */
- SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
+ SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
RadioButton1->setChecked(true);
myActor = SMESH::FindActorByObject(myMesh);
if (!myActor)
myActor = SMESH::FindActorByEntry(IO->getEntry());
- if (!myActor)
+ if (!myActor && !CheckBoxMesh->isChecked())
return;
int aNbUnits = 0;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_SymmetryDlg.h
// Author : Michael ZORIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_TranslationDlg.cxx
// Author : Michael ZORIN, Open CASCADE S.A.S.
SMESHGUI_TranslationDlgLayout->addWidget(GroupButtons);
/* Initialisations */
- SpinBox1_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
- SpinBox1_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
- SpinBox1_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
- SpinBox2_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
- SpinBox2_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
- SpinBox2_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
+ SpinBox1_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox1_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox1_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox2_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox2_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox2_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
RadioButton1->setChecked(true);
myActor = SMESH::FindActorByObject(myMesh);
if (!myActor)
myActor = SMESH::FindActorByEntry(IO->getEntry());
- if (!myActor)
- return;
+
+ if (!myActor && !CheckBoxMesh->isChecked())
+ return;
int aNbUnits = 0;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_TranslationDlg.h
// Author : Michael ZORIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_TransparencyDlg.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_TransparencyDlg.h
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_Utils.cxx
// Author : Open CASCADE S.A.S.
if (theSObject->FindAttribute(anAttr, "AttributeIOR")) {
_PTR(AttributeIOR) anIOR = anAttr;
CORBA::String_var aVal = anIOR->Value().c_str();
- return app->orb()->string_to_object(aVal);
+ // string_to_object() DOC: If the input string is not valid ...
+ // a CORBA::SystemException is thrown.
+ if ( aVal && strlen( aVal ) > 0 )
+ return app->orb()->string_to_object(aVal);
}
}
return CORBA::Object::_nil();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_Utils.h
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_VTKUtils.cxx
// Author : Open CASCADE S.A.S.
anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
else if( aGroup->GetType() == SMESH::EDGE )
anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
+ else if( aGroup->GetType() == SMESH::ELEM0D )
+ anActor->Set0DColor( aColor.R, aColor.G, aColor.B );
else
anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
}
PW = mgr->integerValue( "SMESH", "highlight_width", 5 );
// adjust highlight_width to the width of mesh entities
- int aPointSize = mgr->integerValue("SMESH", "node_size", 3);
int aElem0DSize = mgr->integerValue("SMESH", "elem0d_size", 5);
int aLineWidth = mgr->integerValue("SMESH", "element_width", 1);
- int maxSize = aPointSize;
+ int maxSize = aElem0DSize;
if (aElem0DSize > maxSize) maxSize = aElem0DSize;
if (aLineWidth > maxSize) maxSize = aLineWidth;
if (PW < maxSize + 2) PW = maxSize + 2;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_VTKUtils.h
// Author : Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_WhatIsDlg.cxx
// Author : Vladimir TURIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_WhatIsDlg.h
// Author : Vladimir TURIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : reading of xml file with list of available hypotheses and algorithms
// File : SMESHGUI_XmlHandler.cxx
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : reading of xml file with list of available hypotheses and algorithms
// File : SMESHGUI_XmlHandler.h
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_SMESHGUI.hxx
// Author : Alexander BORODIN, Open CASCADE S.A.S.
//
<!DOCTYPE TS>
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
<source>ICON_FREE_FACES</source>
<translation>mesh_free_faces.png</translation>
</message>
+ <message>
+ <source>ICON_FIND_ELEM</source>
+ <translation>mesh_find_elem_by_point.png</translation>
+ </message>
<message>
<source>ICON_HYPO</source>
<translation>mesh_hypo_length.png</translation>
<source>ICON_SMESH_TRANSLATION_VECTOR</source>
<translation>mesh_translation_vector.png</translation>
</message>
+ <message>
+ <source>ICON_DLG_MESH_SCALE</source>
+ <translation>scale.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_SCALE_ALONG_AXES</source>
+ <translation>scale_along_axes.png</translation>
+ </message>
<message>
<source>ICON_SMESH_TREE_ALGO</source>
<translation>mesh_tree_algo.png</translation>
<source>ICON_2D_FROM_3D</source>
<translation>mesh_2d_from_3d.png</translation>
</message>
+ <message>
+ <source>ICON_SPLIT_TO_TETRA</source>
+ <translation>split_into_tetra.png</translation>
+ </message>
</context>
</TS>
<!DOCTYPE TS>
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
<source>MEN_2D_FROM_3D</source>
<translation>Create 2D mesh from 3D</translation>
</message>
+ <message>
+ <source>MEN_MESH_ORDER</source>
+ <translation>Change submesh priority</translation>
+ </message>
<message>
<source>MEN_CREATE_GROUP</source>
<translation>Create Group</translation>
<source>MEN_FILE</source>
<translation>File</translation>
</message>
+ <message>
+ <source>MEN_FIND_ELEM</source>
+ <translation>Find Element by Point</translation>
+ </message>
+ <message>
+ <source>TOP_FIND_ELEM</source>
+ <translation>Find Element by Point</translation>
+ </message>
<message>
<source>MEN_FREE_BORDER</source>
<translation>Free Borders</translation>
<source>MEN_MERGE_ELEMENTS</source>
<translation>Merge Elements</translation>
</message>
+
<message>
<source>MEN_MESH</source>
<translation>Mesh</translation>
<source>MEN_TRANS</source>
<translation>Translation</translation>
</message>
+ <message>
+ <source>MEN_SCALE</source>
+ <translation>Scale Transform</translation>
+ </message>
<message>
<source>MEN_TRANSF</source>
<translation>Transformation</translation>
<source>MEN_WIRE</source>
<translation>Wireframe</translation>
</message>
+ <message>
+ <source>MEN_SPLIT_TO_TETRA</source>
+ <translation>Split into Tetrahedra</translation>
+ </message>
+ <message>
+ <source>TOP_SPLIT_TO_TETRA</source>
+ <translation>Split into Tetrahedra</translation>
+ </message>
+ <message>
+ <source>STB_SPLIT_TO_TETRA</source>
+ <translation>Split into Tetrahedra</translation>
+ </message>
<message>
<source>MESHERS_FILE_CANT_OPEN</source>
<translation>Can not open resource file</translation>
<source>MULTI_BORDERS</source>
<translation>Borders at Multi-Connections</translation>
</message>
+ <message>
+ <source>GROUP_NAME_IS_EMPTY</source>
+ <translation>Name of group is not specified.
+Please enter a name of new group to be created or choose an existing one.</translation>
+ </message>
+ <message>
+ <source>MESH_STANDALONE_GRP_CHOSEN</source>
+ <translation>Group on geometry is chosen: %1.
+Do you want to convert it to the standalone group?</translation>
+ </message>
<message>
<source>NODE_ID</source>
<translation>Node ID</translation>
<message>
<source>SMESH_ADD_HYP_WRN</source>
<translation>"%1" assigned but:
-</translation>
+ </translation>
</message>
<message>
<source>SMESH_ADD_POLYGON</source>
<source>SMESH_ADD_TETRAS_TITLE</source>
<translation>Add Tetrahedron</translation>
</message>
+ <message>
+ <source>SMESH_ADD_TO_GROUP</source>
+ <translation>Add to group</translation>
+ </message>
<message>
<source>SMESH_ADD_TRIANGLE</source>
<translation>Add Triangle</translation>
<source>SMESH_BUT_OK</source>
<translation>&Ok</translation>
</message>
+ <message>
+ <source>SMESH_BUT_OVERWRITE</source>
+ <translation>Over&write</translation>
+ </message>
<message>
<source>SMESH_BUT_APPLY_AND_CLOSE</source>
<translation>A&pply and Close</translation>
You can cancel exporting and rename them,
otherwise some group names in the resulting MED file
will not match ones in the study.
+Do you want to continue ?</translation>
+ </message>
+ <message>
+ <source>SMESH_EXPORT_MED_DUPLICATED_MESH_NAMES</source>
+ <translation>There are some meshes with the same names in the selection.
+The result file may be incorrect.
Do you want to continue ?</translation>
</message>
<message>
polygons and polyhedrons elements will be missed
For correct export use MED 2.2
Are you sure want to export to MED 2.1 ?</translation>
+ </message>
+ <message>
+ <source>SMESH_EXPORT_MED_VERSION_COLLISION</source>
+ <translation>MED version of the file "%1"
+is unknown or doesn't match the selected version.
+Overwrite the file?</translation>
+ </message>
+ <message>
+ <source>SMESH_EXPORT_MED_MESH_NAMES_COLLISION</source>
+ <translation>The selected file already contains
+meshes with the following names: %1
+The result file may be incorrect.
+Overwrite the file?</translation>
</message>
<message>
<source>SMESH_EXPORT_STL1</source>
<source>SMESH_FEATUREEDGES</source>
<translation>Feature Edges</translation>
</message>
+ <message>
+ <source>SMESH_FILE_EXISTS</source>
+ <translation>The file "%1" already exists.
+Do you want to overwrite it or
+add the exported data to its contents?</translation>
+ </message>
<message>
<source>SMESH_FONT_ARIAL</source>
<translation>Arial</translation>
</message>
<message>
<source>SMESH_HYP_12</source>
- <translation>Geomerty mismatches algorithm's expectation</translation>
+ <translation>Geometry mismatches algorithm's expectation\nCheck algorithm documentation for supported geometry</translation>
</message>
<message>
<source>SMESH_HYP_13</source>
<source>SMESH_MEN_SubMeshesOnVertex</source>
<translation>SubMeshes On Vertex</translation>
</message>
+ <message>
+ <source>SMESH_AUTOMATIC</source>
+ <translation>Automatic</translation>
+ </message>
+ <message>
+ <source>SMESH_MANUAL</source>
+ <translation>Manual</translation>
+ </message>
<message>
<source>SMESH_MERGE_ELEMENTS</source>
<translation>Merge elements</translation>
</message>
+ <message>
+ <source>SMESH_MODE</source>
+ <translation>Mode</translation>
+ </message>
+ <message>
+ <source>SMESH_MERGED_ELEMENTS</source>
+ <translation>%1 elements successfully merged.</translation>
+ </message>
+ <message>
+ <source>SMESH_MERGED_NODES</source>
+ <translation>%1 nodes successfully merged.</translation>
+ </message>
+ <message>
+ <source>SMESH_NO_ELEMENTS_DETECTED</source>
+ <translation>There are no elements to merge.</translation>
+ </message>
+ <message>
+ <source>SMESH_NO_NODES_DETECTED</source>
+ <translation>There are no nodes to merge.</translation>
+ </message>
<message>
<source>SMESH_MERGE_NODES</source>
<translation>Merge nodes</translation>
<source>SMESH_POINT_2</source>
<translation>Point 2</translation>
</message>
+ <message>
+ <source>SMESH_BASE_POINT</source>
+ <translation>Base Point</translation>
+ </message>
<message>
<source>SMESH_POLYEDRE_CREATE_ERROR</source>
<translation>Polyedron creation error</translation>
<source>SMESH_TRANSLATION</source>
<translation>Translation</translation>
</message>
+ <message>
+ <source>SMESH_SCALE_TITLE</source>
+ <translation>Scale Transform</translation>
+ </message>
+ <message>
+ <source>SMESH_SCALE</source>
+ <translation>Scale</translation>
+ </message>
+ <message>
+ <source>SMESH_SCALE_FACTOR</source>
+ <translation>Scale Factor :</translation>
+ </message>
+ <message>
+ <source>SMESH_SCALE_FACTOR_X</source>
+ <translation>Scale Factor X :</translation>
+ </message>
+ <message>
+ <source>SMESH_SCALE_FACTOR_Y</source>
+ <translation>Scale Factor Y :</translation>
+ </message>
+ <message>
+ <source>SMESH_SCALE_FACTOR_Z</source>
+ <translation>Scale Factor Z :</translation>
+ </message>
<message>
<source>SMESH_TRANSPARENCY_OPAQUE</source>
<translation>---> Opaque</translation>
<source>STB_2D_FROM_3D</source>
<translation>Create 2D mesh from 3D</translation>
</message>
+ <message>
+ <source>STB_MESH_ORDER</source>
+ <translation>Change submesh priority</translation>
+ </message>
<message>
<source>STB_CREATE_GROUP</source>
<translation>Create Group</translation>
<source>STB_TRANS</source>
<translation>Translation</translation>
</message>
+ <message>
+ <source>STB_SCALE</source>
+ <translation>Scale Transform</translation>
+ </message>
<message>
<source>STB_TRANSP</source>
<translation>Transparency</translation>
<source>TOP_2D_FROM_3D</source>
<translation>Create 2D mesh from 3D</translation>
</message>
+ <message>
+ <source>TOP_MESH_ORDER</source>
+ <translation>Change submesh priority</translation>
+ </message>
<message>
<source>TOP_CREATE_GROUP</source>
<translation>Create Group</translation>
<source>TOP_TRANS</source>
<translation>Translation</translation>
</message>
+ <message>
+ <source>TOP_SCALE</source>
+ <translation>Scale Transform</translation>
+ </message>
<message>
<source>TOP_TRANSP</source>
<translation>Transparency</translation>
<source>NO_MESH_SELECTED</source>
<translation>No mesh selected</translation>
</message>
+ <message>
+ <source>SMESH_PREF_def_precision</source>
+ <translation>Default precision</translation>
+ </message>
+ <message>
+ <source>SMESH_PREF_length_precision</source>
+ <translation>Length precision</translation>
+ </message>
+ <message>
+ <source>SMESH_PREF_angle_precision</source>
+ <translation>Angular precision</translation>
+ </message>
+ <message>
+ <source>SMESH_PREF_len_tol_precision</source>
+ <translation>Length tolerance precision</translation>
+ </message>
+ <message>
+ <source>SMESH_PREF_parametric_precision</source>
+ <translation>Parametric precision</translation>
+ </message>
+ <message>
+ <source>SMESH_PREF_area_precision</source>
+ <translation>Area precision</translation>
+ </message>
+ <message>
+ <source>SMESH_PREF_vol_precision</source>
+ <translation>Volume precision</translation>
+ </message>
+ <message>
+ <source>SMESH_PRECISION_HINT</source>
+ <translation>
+Input value precision can be adjusted using
+'%1' parameter in Mesh module preferences.</translation>
+ </message>
</context>
<context>
<name>SMESHGUI</name>
<source>PREF_NOTIFY_MODE</source>
<translation>Show a computation result notification</translation>
</message>
+ <message>
+ <source>SMESH_PREF_GROUP_PRECISION</source>
+ <translation>Input fields precision</translation>
+ </message>
<message>
<source>PREF_GROUP_ELEMENTS</source>
<translation>Elements</translation>
<source>PREF_LABELS_COLOR</source>
<translation>Labels color</translation>
</message>
+ <message>
+ <source>PREF_MARKER_SCALE</source>
+ <translation>Scale of marker</translation>
+ </message>
<message>
<source>PREF_NODES</source>
<translation>Nodes</translation>
<source>PREF_SHRINK_COEFF</source>
<translation>Shrink coef.</translation>
</message>
- <message>
- <source>PREF_SIZE</source>
- <translation>Size</translation>
- </message>
<message>
<source>PREF_TAB_GENERAL</source>
<translation>General</translation>
<source>PREF_TITLE_COLOR</source>
<translation>Title color</translation>
</message>
+ <message>
+ <source>PREF_TYPE_OF_MARKER</source>
+ <translation>Type of marker</translation>
+ </message>
<message>
<source>PREF_COLOR_0D</source>
<translation>0D elements</translation>
created during preview operation.
Do you want to remove all this submeshes?</translation>
</message>
+ <message>
+ <source>SMESH_WRN_NOTHING_PREVIEW</source>
+ <translation>No mesh preview is available</translation>
+ </message>
+ <message>
+ <source>SMESH_REJECT_MESH_ORDER</source>
+ <translation>The submesh priority changed during preview operation.
+Do you want to restore original submesh priority?</translation>
+ </message>
</context>
<context>
<name>SMESHGUI_ConvToQuadDlg</name>
<translation>Mesh to modify not selected</translation>
</message>
</context>
+ <context>
+ <name>SMESHGUI_FindElemByPointDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Find Element by Point</translation>
+ </message>
+ <message>
+ <source>CREATE_NEW_METHOD</source>
+ <translation>Create a node</translation>
+ </message>
+ <message>
+ <source>MESH_PASS_THROUGH_POINT</source>
+ <translation>Make a node at point</translation>
+ </message>
+ <message>
+ <source>METHOD</source>
+ <translation>Method</translation>
+ </message>
+ <message>
+ <source>MOVE_EXISTING_METHOD</source>
+ <translation>Move a node</translation>
+ </message>
+ <message>
+ <source>NODE_2MOVE</source>
+ <translation>Node to move</translation>
+ </message>
+ <message>
+ <source>NODE_2MOVE_ID</source>
+ <translation>ID</translation>
+ </message>
+ </context>
<context>
<name>SMESHGUI_MeshDlg</name>
<message>
<translation>Use numeric functor</translation>
</message>
</context>
+ <context>
+ <name>SMESHGUI_CuttingIntoTetraDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Splitting volumes into tetrahedra</translation>
+ </message>
+ <message>
+ <source>SPLIT_METHOD</source>
+ <translation>Split hexahedron</translation>
+ </message>
+ <message>
+ <source>SPLIT_HEX_TO_5_TETRA</source>
+ <translation>Into 5 tetrahedra</translation>
+ </message>
+ <message>
+ <source>SPLIT_HEX_TO_6_TETRA</source>
+ <translation>Into 6 tetrahedra</translation>
+ </message>
+ </context>
<context>
<name>SMESHGUI_PrecisionDlg</name>
<message>
<source>MERGE_EQUAL_ELEMENTS</source>
<translation>Merge equal elements</translation>
</message>
+
<message>
<source>NODE1_TO_MERGE</source>
<translation>Node 1 To Merge</translation>
<translation>Create Groups from Geometry</translation>
</message>
</context>
+ <context>
+ <name>SMESHGUI_MeshOrderDlg</name>
+ <message>
+ <source>SMESH_MESHORDER_TITLE</source>
+ <translation>Order of submesh in meshing process</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_MeshOrderOp</name>
+ <message>
+ <source>SMESH_NO_CONCURENT_MESH</source>
+ <translation>No concurent submeshes detected</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_ClippingDlg</name>
+ <message>
+ <source>CLIP_PLANES</source>
+ <translation>Clipping planes</translation>
+ </message>
+ <message>
+ <source>ROTATION_AROUND_X_Y2Z</source>
+ <translation>Rotation around X (Y to Z):</translation>
+ </message>
+ <message>
+ <source>ROTATION_AROUND_Y_X2Z</source>
+ <translation>Rotation around Y (X to Z):</translation>
+ </message>
+ <message>
+ <source>ROTATION_AROUND_Z_Y2X</source>
+ <translation>Rotation around Z (Y to X):</translation>
+ </message>
+ <message>
+ <source>ROTATION_AROUND_X_Z2Y</source>
+ <translation>Rotation around X (Z to Y):</translation>
+ </message>
+ <message>
+ <source>ROTATION_AROUND_Y_Z2X</source>
+ <translation>Rotation around Y (Z to X):</translation>
+ </message>
+ <message>
+ <source>ROTATION_AROUND_Z_X2Y</source>
+ <translation>Rotation around Z (X to Y):</translation>
+ </message>
+ <message>
+ <source>SHOW_PREVIEW</source>
+ <translation>Show preview</translation>
+ </message>
+ <message>
+ <source>AUTO_APPLY</source>
+ <translation>Auto Apply</translation>
+ </message>
+ <message>
+ <source>ALONG_XY</source>
+ <translation>|| X-Y</translation>
+ </message>
+ <message>
+ <source>ALONG_YZ</source>
+ <translation>|| Y-Z</translation>
+ </message>
+ <message>
+ <source>ALONG_ZX</source>
+ <translation>|| Z-X</translation>
+ </message>
+ <message>
+ <source>PLANE_NUM</source>
+ <translation>Plane# %1</translation>
+ </message>
+ <message>
+ <source>NO_PLANES</source>
+ <translation>No planes</translation>
+ </message>
+ </context>
</TS>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
# File : Makefile.in
# Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I :
// File : SMESH.hxx
// Author : Michael ZORIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
int main(int argc, char** argv)
{
return 1;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_0D_Algo_i.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_0D_Algo_i.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_1D_Algo_i.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_1D_Algo_i.hxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_2D_Algo_i.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_2D_Algo_i.hxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
// File : SMESH_2smeshpy.cxx
// Created : Fri Nov 18 13:20:10 2005
// Author : Edward AGAPOV (eap)
Handle(_pySubMesh) subMesh = new _pySubMesh( aCommand );
myObjects.insert( make_pair( subMeshID, subMesh ));
}
+
id_mesh->second->Process( aCommand );
return aCommand;
}
}
}
// ----------------------------------------------------------------------
- else if ( method == "ExportToMED" ) { // ExportToMED() --> ExportMED()
+ else if ( method == "ExportToMED" || // ExportToMED() --> ExportMED()
+ method == "ExportToMEDX" ) { // ExportToMEDX() --> ExportMED()
theCommand->SetMethod( "ExportMED" );
}
// ----------------------------------------------------------------------
// remove hyp from myHypos
myHypos.remove( hyp );
}
+ // check for SubMesh order commands
+ else if ( theCommand->GetMethod() == "GetMeshOrder" ||
+ theCommand->GetMethod() == "SetMeshOrder" ) {
+ // In fact arguments and result values does not support complex containers
+ // such as list of list
+ // So, here we parse it manually
+ // GetMeshOrder
+ //for(int ind = 0, n = theCommand->GetNbResultValues();ind<n;ind++) {
+ // Handle(_pySubMesh) subMesh = theGen->FindSubMesh( theCommand->GetResultValue(ind) );
+ // SetMeshOrder
+ //for(int ind = 0, n = theCommand->GetNbArgs();ind<n;ind++) {
+ // Handle(_pySubMesh) subMesh = theGen->FindSubMesh( theCommand->GetArg(ind) );
+ const bool isArg = theCommand->GetMethod() == "SetMeshOrder";
+ const TCollection_AsciiString& cmdStr = theCommand->GetString();
+ int begPos = (/*isArg ? cmdStr.Search( "(" ) :*/ cmdStr.Search( "[" )) + 1;
+ int endPos = (isArg ? cmdStr.Search( ")" ) : cmdStr.Search( "=" )) - 1;
+ if ( begPos != -1 && begPos < endPos && endPos <= cmdStr.Length() ) {
+ TCollection_AsciiString aSubStr = cmdStr.SubString( begPos, endPos );
+ Standard_Integer index = 1;
+ TCollection_AsciiString anIDStr = aSubStr.Token("\t ,[]", index++);
+ while ( !anIDStr.IsEmpty() ) {
+ Handle(_pySubMesh) subMesh = theGen->FindSubMesh( anIDStr );
+ if ( !subMesh.IsNull() )
+ subMesh->Process( theCommand );
+ anIDStr = aSubStr.Token("\t ,[]", index++);
+ }
+ }
+ }
// add accessor method if necessary
else
{
"GetNodeInverseElements","GetShapeID","GetShapeIDForElem","GetElemNbNodes",
"GetElemNode","IsMediumNode","IsMediumNodeOfAnyElem","ElemNbEdges","ElemNbFaces",
"IsPoly","IsQuadratic","BaryCenter","GetHypothesisList", "SetAutoColor", "GetAutoColor",
- "Clear", "ConvertToStandalone"
+ "Clear", "ConvertToStandalone", "GetMeshOrder", "SetMeshOrder"
,"" }; // <- mark of end
sameMethods.Insert( names );
}
else if ( hypType == "TrianglePreference" ) {
hyp->SetConvMethodAndType( "TrianglePreference", "Quadrangle_2D");
}
+ // RadialQuadrangle_1D2D ----------
+ else if ( hypType == "RadialQuadrangle_1D2D" ) {
+ algo->SetConvMethodAndType( "Quadrangle" , hypType.ToCString());
+ algo->myArgs.Append( "algo=smesh.RADIAL_QUAD" );
+ }
+ else if ( hypType == "NumberOfLayers2D" ) {
+ hyp->SetConvMethodAndType( "NumberOfLayers", "RadialQuadrangle_1D2D");
+ hyp->AddArgMethod( "SetNumberOfLayers" );
+ }
+ else if ( hypType == "LayerDistribution2D" ) {
+ hyp = new _pyLayerDistributionHypo( theCreationCmd, "Get2DHypothesis" );
+ hyp->SetConvMethodAndType( "LayerDistribution", "RadialQuadrangle_1D2D");
+ }
// BLSURF ----------
else if ( hypType == "BLSURF" ) {
algo->SetConvMethodAndType( "Triangle", hypType.ToCString());
hyp->AddArgMethod( "SetNumberOfLayers" );
}
else if ( hypType == "LayerDistribution" ) {
- hyp = new _pyLayerDistributionHypo( theCreationCmd );
+ hyp = new _pyLayerDistributionHypo( theCreationCmd, "Get3DHypothesis" );
hyp->SetConvMethodAndType( "LayerDistribution", "RadialPrism_3D");
}
- if ( algo->IsValid() ) {
- return algo;
- }
- return hyp;
+ return algo->IsValid() ? algo : hyp;
}
//================================================================================
my1dHyp->ClearAllCommands();
}
my1dHyp = hyp1d;
- if ( my1dHyp.IsNull() )
- return; // something wrong :(
-
- // make a new name for 1D hyp = "HypType" + "_Distribution"
- if ( my1dHyp->GetCreationCmd()->GetMethod() == "CreateHypothesis" ) {
- // not yet converted creation cmd
- TCollection_AsciiString hypTypeQuoted = my1dHyp->GetCreationCmd()->GetArg(1);
- TCollection_AsciiString hypType = hypTypeQuoted.SubString( 2, hypTypeQuoted.Length() - 1 );
- newName = hypType + "_Distribution";
- my1dHyp->GetCreationCmd()->SetResultValue( newName );
- }
- else {
- // already converted creation cmd
- newName = my1dHyp->GetCreationCmd()->GetResultValue();
- }
- // as creation of 1D hyp was written later then it's edition,
- // we need to find all it's edition calls and process them
- list< Handle(_pyCommand) >& cmds = theGen->GetCommands();
- list< Handle(_pyCommand) >::iterator cmdIt = cmds.begin();
- for ( ; cmdIt != cmds.end(); ++cmdIt ) {
- const _pyID& objID = (*cmdIt)->GetObject();
- if ( objID == hyp1dID ) {
- my1dHyp->Process( *cmdIt );
- my1dHyp->GetCreationCmd()->AddDependantCmd( *cmdIt );
- ( *cmdIt )->SetObject( newName );
- }
- }
if ( !myArgCommands.empty() )
myArgCommands.front()->Clear();
- theCommand->SetArg( 1, newName );
myArgCommands.push_back( theCommand );
- // copy hyp1d's creation method and args
-// myCreationMethod = hyp1d->GetCreationMethod();
-// myArgs = hyp1d->GetArgs();
-// // make them cleared at conversion
-// myArgCommands = hyp1d->GetArgCommands();
-
-// // to be cleared at convertion only
-// myArgCommands.push_back( theCommand );
}
//================================================================================
_pyID geom = theAdditionCmd->GetArg( 1 );
- my1dHyp->SetMesh( theMesh );
- if ( !my1dHyp->Addition2Creation( theAdditionCmd, theMesh ))
- return false;
+ Handle(_pyHypothesis) algo = theGen->FindAlgo( geom, theMesh, this );
+ if ( !algo.IsNull() )
+ {
+ my1dHyp->SetMesh( theMesh );
+ my1dHyp->SetConvMethodAndType(my1dHyp->GetAlgoCreationMethod().ToCString(),
+ algo->GetAlgoType().ToCString());
+ if ( !my1dHyp->Addition2Creation( theAdditionCmd, theMesh ))
+ return false;
- // clear "SetLayerDistribution()" cmd
- myArgCommands.front()->Clear();
+ // clear "SetLayerDistribution()" cmd
+ myArgCommands.back()->Clear();
- // Convert my creation => me = RadialPrismAlgo.Get3DHypothesis()
+ // Convert my creation => me = RadialPrismAlgo.Get3DHypothesis()
- // find RadialPrism algo created on <geom> for theMesh
- Handle(_pyHypothesis) algo = theGen->FindAlgo( geom, theMesh, this );
- if ( !algo.IsNull() ) {
+ // find RadialPrism algo created on <geom> for theMesh
GetCreationCmd()->SetObject( algo->GetID() );
- GetCreationCmd()->SetMethod( "Get3DHypothesis" );
+ GetCreationCmd()->SetMethod( myAlgoMethod );
GetCreationCmd()->RemoveArgs();
theAdditionCmd->AddDependantCmd( GetCreationCmd() );
myIsWrapped = true;
void _pyLayerDistributionHypo::Flush()
{
- //my1dHyp.Nullify();
- //_pyHypothesis::Flush();
+ // as creation of 1D hyp was written later then it's edition,
+ // we need to find all it's edition calls and process them
+ if ( !my1dHyp.IsNull() )
+ {
+ _pyID hyp1dID = my1dHyp->GetCreationCmd()->GetResultValue();
+
+ // make a new name for 1D hyp = "HypType" + "_Distribution"
+ _pyID newName;
+ if ( my1dHyp->IsWrapped() ) {
+ newName = my1dHyp->GetCreationCmd()->GetMethod();
+ }
+ else {
+ TCollection_AsciiString hypTypeQuoted = my1dHyp->GetCreationCmd()->GetArg(1);
+ newName = hypTypeQuoted.SubString( 2, hypTypeQuoted.Length() - 1 );
+ }
+ newName += "_Distribution";
+ my1dHyp->GetCreationCmd()->SetResultValue( newName );
+
+ list< Handle(_pyCommand) >& cmds = theGen->GetCommands();
+ list< Handle(_pyCommand) >::iterator cmdIt = cmds.begin();
+ for ( ; cmdIt != cmds.end(); ++cmdIt ) {
+ const _pyID& objID = (*cmdIt)->GetObject();
+ if ( objID == hyp1dID ) {
+ my1dHyp->Process( *cmdIt );
+ my1dHyp->GetCreationCmd()->AddDependantCmd( *cmdIt );
+ ( *cmdIt )->SetObject( newName );
+ }
+ }
+ // Set new hyp name to SetLayerDistribution() cmd
+ if ( !myArgCommands.empty() && !myArgCommands.back()->IsEmpty() )
+ myArgCommands.back()->SetArg( 1, newName );
+ }
}
//================================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_smesh.hxx
// Created : Fri Nov 18 12:05:18 2005
// Author : Edward AGAPOV (eap)
int GetOrderNb() const { return myOrderNb; }
void SetOrderNb( int theNb ) { myOrderNb = theNb; }
int Length() { return myString.Length(); }
- void Clear() { myString.Clear(); myBegPos.Clear(); }
+ void Clear() { myString.Clear(); myBegPos.Clear(); myArgs.Clear(); }
bool IsEmpty() const { return myString.IsEmpty(); }
TCollection_AsciiString GetIndentation();
const TCollection_AsciiString & GetResultValue();
class _pyLayerDistributionHypo: public _pyHypothesis
{
Handle(_pyHypothesis) my1dHyp;
+ TCollection_AsciiString myAlgoMethod;
public:
- _pyLayerDistributionHypo(const Handle(_pyCommand)& theCreationCmd):
- _pyHypothesis(theCreationCmd) {}
+ _pyLayerDistributionHypo(const Handle(_pyCommand)& theCreationCmd, const char* algoMethod):
+ _pyHypothesis(theCreationCmd), myAlgoMethod((char*)algoMethod) {}
void Process( const Handle(_pyCommand)& theCommand);
void Flush();
bool Addition2Creation( const Handle(_pyCommand)& theAdditionCmd,
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_3D_Algo_i.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_3D_Algo_i.hxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_Algo_i.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_Algo_i.hxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_Gen_i_DumpPython.cxx
// Created : Thu Mar 24 17:17:59 2005
// Author : Julia DOROVSKIKH
return *this;
}
+ TPythonDump&
+ TPythonDump::
+ operator<<(SMESH::SMESH_Hypothesis_ptr theArg)
+ {
+ SALOMEDS::Study_var aStudy = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
+ SALOMEDS::SObject_var aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
+ if(aSObject->_is_nil() && !CORBA::is_nil(theArg))
+ myStream << "hyp_" << theArg->GetId();
+ else
+ *this << CORBA::Object_ptr( theArg );
+ return *this;
+ }
+
+ TPythonDump&
+ TPythonDump::
+ operator<<(SMESH::SMESH_IDSource_ptr theArg)
+ {
+ SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
+ SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
+ SALOMEDS::SObject_var aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
+ if(!aSObject->_is_nil() || CORBA::is_nil( theArg ))
+ return *this << aSObject;
+ SMESH::long_array_var anElementsId = theArg->GetIDs();
+ return *this << anElementsId;
+ }
+
TPythonDump&
TPythonDump::
operator<<(SMESH::FilterLibrary_i* theArg)
TCollection_AsciiString aSavedTrace (oldValue);
// Add trace of API methods calls and replace study entries by names
- TCollection_AsciiString aScript =
- "# -*- coding: iso-8859-1 -*-\n"
- "### This file is generated by SALOME automatically by dump python functionality of SMESH component\n\n";
+ TCollection_AsciiString aScript;
aScript += DumpPython_impl(aStudy, aMap, aMapNames,
isPublished, isValidScript, aSavedTrace);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_Filter_i.cxx
// Author : Alexey Petrov, OCC
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_Filter_i.hxx
// Author : Alexey Petrov, OCC
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_Gen_i.cxx
// Author : Paul RASCLE, EDF
#ifdef WNT
#include <windows.h>
+ #include <process.h>
#else
#include <dlfcn.h>
#endif
#include "OpUtil.hxx"
#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
+#include CORBA_CLIENT_HEADER(SALOME_Session)
#include "GEOM_Client.hxx"
#include "Utils_ExceptHandlers.hxx"
#include "memoire.h"
+#include "Basics_Utils.hxx"
#include <map>
// set it in standalone mode only
//OSD::SetSignal( true );
+
+ // 0020605: EDF 1190 SMESH: Display performance. 80 seconds for 52000 cells.
+ // find out mode (embedded or standalone) here else
+ // meshes created before calling SMESH_Client::GetSMESHGen(), which calls
+ // SMESH_Gen_i::SetEmbeddedMode(), have wrong IsEmbeddedMode flag
+ if ( SALOME_NamingService* ns = GetNS() )
+ {
+ CORBA::Object_var obj = ns->Resolve( "/Kernel/Session" );
+ SALOME::Session_var session = SALOME::Session::_narrow( obj ) ;
+ if ( !session->_is_nil() )
+ {
+ CORBA::String_var s_host = session->getHostname();
+ CORBA::Long s_pid = session->getPID();
+ string my_host = Kernel_Utils::GetHostname();
+#ifdef WNT
+ long my_pid = (long)_getpid();
+#else
+ long my_pid = (long) getpid();
+#endif
+ SetEmbeddedMode( s_pid == my_pid && my_host == s_host.in() );
+ }
+ }
}
//=============================================================================
void SMESH_Gen_i::SetDefaultNbSegments(CORBA::Long theNbSegments)
throw ( SALOME::SALOME_Exception )
{
- if ( theNbSegments )
+ if ( theNbSegments > 0 )
myGen.SetDefaultNbSegments( int(theNbSegments) );
else
THROW_SALOME_CORBA_EXCEPTION( "non-positive number of segments", SALOME::BAD_PARAM );
MapShapeNbElemsItr anIt = aResMap.begin();
for(; anIt!=aResMap.end(); anIt++) {
const vector<int>& aVec = (*anIt).second;
- for(i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) {
- nbels[i] += aVec[i];
+ for(i = SMESH::Entity_Node; i < aVec.size(); i++) {
+ int nbElem = aVec[i];
+ if ( nbElem < 0 ) // algo failed, check that it has reported a message
+ {
+ SMESH_subMesh* sm = anIt->first;
+ SMESH_ComputeErrorPtr& error = sm->GetComputeError();
+ const SMESH_Algo* algo = myGen.GetAlgo( myLocMesh, sm->GetSubShape());
+ if ( algo && !error.get() || error->IsOK() )
+ error.reset( new SMESH_ComputeError( COMPERR_ALGO_FAILED,"Failed to evaluate",algo));
+ }
+ else
+ {
+ nbels[i] += aVec[i];
+ }
}
}
-#ifdef _DEBUG_
- cout<<endl;
-#endif
return nbels._retn();
}
}
return aNewMesh._retn();
}
+//================================================================================
+/*!
+ * SMESH_Gen_i::GetMEDVersion
+ *
+ * Get MED version of the file by its name
+ */
+//================================================================================
+CORBA::Boolean SMESH_Gen_i::GetMEDVersion(const char* theFileName,
+ SMESH::MED_VERSION& theVersion)
+{
+ theVersion = SMESH::MED_V2_1;
+ MED::EVersion aVersion = MED::GetVersionId( theFileName );
+ switch( aVersion ) {
+ case MED::eV2_1 : theVersion = SMESH::MED_V2_1; return true;
+ case MED::eV2_2 : theVersion = SMESH::MED_V2_2; return true;
+ case MED::eVUnknown : return false;
+ }
+ return false;
+}
+
+//================================================================================
+/*!
+ * SMESH_Gen_i::GetMeshNames
+ *
+ * Get names of meshes defined in file with the specified name
+ */
+//================================================================================
+SMESH::string_array* SMESH_Gen_i::GetMeshNames(const char* theFileName)
+{
+ SMESH::string_array_var aResult = new SMESH::string_array();
+ MED::PWrapper aMed = MED::CrWrapper( theFileName );
+ MED::TErr anErr;
+ MED::TInt aNbMeshes = aMed->GetNbMeshes( &anErr );
+ if( anErr >= 0 ) {
+ aResult->length( aNbMeshes );
+ for( MED::TInt i = 0; i < aNbMeshes; i++ ) {
+ MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo( i+1 );
+ aResult[i] = CORBA::string_dup( aMeshInfo->GetName().c_str() );
+ }
+ }
+ return aResult._retn();
+}
+
//=============================================================================
/*!
* SMESH_Gen_i::Save
//if ( shapeRefFound )
//myWriter.AddAllSubMeshes();
+ // store submesh order if any
+ const TListOfListOfInt& theOrderIds = myLocMesh.GetMeshOrder();
+ if ( theOrderIds.size() ) {
+ char order_list[ 30 ];
+ strcpy( order_list, "Mesh Order" );
+ // count number of submesh ids
+ int nbIDs = 0;
+ TListOfListOfInt::const_iterator idIt = theOrderIds.begin();
+ for ( ; idIt != theOrderIds.end(); idIt++ )
+ nbIDs += (*idIt).size();
+ // number of values = number of IDs +
+ // number of lists (for separators) - 1
+ int* smIDs = new int [ nbIDs + theOrderIds.size() - 1 ];
+ idIt = theOrderIds.begin();
+ for ( int i = 0; idIt != theOrderIds.end(); idIt++ ) {
+ const TListOfInt& idList = *idIt;
+ if (idIt != theOrderIds.begin()) // not first list
+ smIDs[ i++ ] = -1/* *idList.size()*/; // separator between lists
+ // dump submesh ids from current list
+ TListOfInt::const_iterator id_smId = idList.begin();
+ for( ; id_smId != idList.end(); id_smId++ )
+ smIDs[ i++ ] = *id_smId;
+ }
+ // write HDF group
+ aSize[ 0 ] = nbIDs + theOrderIds.size() - 1;
+
+ aDataset = new HDFdataset( order_list, aTopGroup, HDF_INT32, aSize, 1 );
+ aDataset->CreateOnDisk();
+ aDataset->WriteOnDisk( smIDs );
+ aDataset->CloseOnDisk();
+ //
+ delete[] smIDs;
+ }
+
// groups root sub-branch
SALOMEDS::SObject_var myGroupsBranch;
for ( int i = GetNodeGroupsTag(); i <= GetVolumeGroupsTag(); i++ ) {
aDataset->WriteOnDisk( smIDs );
aDataset->CloseOnDisk();
//
- delete smIDs;
+ delete[] smIDs;
}
// Store node positions on sub-shapes (SMDS_Position):
if ( nbNodes == 0 ) continue;
int aShapeID = (*itSubM).first;
+ if ( aShapeID < 1 || aShapeID > mySMESHDSMesh->MaxShapeIndex() )
+ continue;
int aShapeType = mySMESHDSMesh->IndexToShape( aShapeID ).ShapeType();
// write only SMDS_FacePosition and SMDS_EdgePosition
switch ( aShapeType ) {
}
}
}
-
}
}
}
aGroup->CloseOnDisk();
}
}
+ // read submeh order if any
+ if( aTopGroup->ExistInternalObject( "Mesh Order" ) ) {
+ aDataset = new HDFdataset( "Mesh Order", aTopGroup );
+ aDataset->OpenOnDisk();
+ size = aDataset->GetSize();
+ int* smIDs = new int[ size ];
+ aDataset->ReadFromDisk( smIDs );
+ aDataset->CloseOnDisk();
+ TListOfListOfInt anOrderIds;
+ anOrderIds.push_back( TListOfInt() );
+ for ( int i = 0; i < size; i++ )
+ if ( smIDs[ i ] < 0 ) // is separator
+ anOrderIds.push_back( TListOfInt() );
+ else
+ anOrderIds.back().push_back(smIDs[ i ]);
+
+ myNewMeshImpl->GetImpl().SetMeshOrder( anOrderIds );
+ }
}
// close mesh group
if(aTopGroup)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_Gen_i.hxx
// Author : Paul RASCLE, EDF
CORBA::Double theMergeTolerance)
throw ( SALOME::SALOME_Exception );
+ // Get MED version of the file by its name
+ CORBA::Boolean GetMEDVersion(const char* theFileName,
+ SMESH::MED_VERSION& theVersion);
+
+ // Get names of meshes defined in file with the specified name
+ SMESH::string_array* GetMeshNames(const char* theFileName);
+
// ****************************************************
// Interface inherited methods (from SALOMEDS::Driver)
// ****************************************************
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_Gen_i_1.cxx
// Created : Thu Oct 21 17:24:06 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
// File : SMESH_Group_i.cxx
// Author : Sergey ANIKIN, OCC
SMDSAbs_ElementType aSMDSType = aGroupDS->GetType();
SMESH::ElementType aType;
switch (aSMDSType) {
- case SMDSAbs_Node: aType = SMESH::NODE; break;
- case SMDSAbs_Edge: aType = SMESH::EDGE; break;
- case SMDSAbs_Face: aType = SMESH::FACE; break;
- case SMDSAbs_Volume: aType = SMESH::VOLUME; break;
- default: aType = SMESH::ALL; break;
+ case SMDSAbs_Node: aType = SMESH::NODE; break;
+ case SMDSAbs_Edge: aType = SMESH::EDGE; break;
+ case SMDSAbs_Face: aType = SMESH::FACE; break;
+ case SMDSAbs_Volume: aType = SMESH::VOLUME; break;
+ case SMDSAbs_0DElement: aType = SMESH::ELEM0D; break;
+ default: aType = SMESH::ALL; break;
}
return aType;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
// File : SMESH_Group_i.hxx
// Author : Sergey ANIKIN, OCC
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_Hypothesis_i.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_Hypothesis_i.hxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_MEDFamily_i.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_MEDFamily_i.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_MEDMesh_i.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_MEDMesh_i.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_MEDSupport_i.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_MEDSupport_i.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_MeshEditor_i.cxx
// Author : Nicolas REJNERI
// Module : SMESH
-
+//
#include "SMESH_MeshEditor_i.hxx"
#include "SMDS_Mesh0DElement.hxx"
}
}
+//=======================================================================
+//function : MakeIDSource
+//purpose : Wrap a sequence of ids in a SMESH_IDSource
+//=======================================================================
+
+struct _IDSource : public POA_SMESH::SMESH_IDSource
+{
+ SMESH::long_array _ids;
+ SMESH::long_array* GetIDs() { return new SMESH::long_array( _ids ); }
+ SMESH::long_array* GetMeshInfo() { return 0; }
+};
+
+SMESH::SMESH_IDSource_ptr SMESH_MeshEditor_i::MakeIDSource(const SMESH::long_array& ids)
+{
+ _IDSource* anIDSource = new _IDSource;
+ anIDSource->_ids = ids;
+ SMESH::SMESH_IDSource_var anIDSourceVar = anIDSource->_this();
+
+ return anIDSourceVar._retn();
+}
+
//=============================================================================
/*!
*
// Update Python script
TPythonDump() << "isDone = " << this << ".RemoveElements( " << IDsOfElements << " )";
-#ifdef _DEBUG_
- TPythonDump() << "print 'RemoveElements: ', isDone";
-#endif
// Remove Elements
return anEditor.Remove( IdList, false );
}
// Update Python script
TPythonDump() << "isDone = " << this << ".RemoveNodes( " << IDsOfNodes << " )";
-#ifdef _DEBUG_
- TPythonDump() << "print 'RemoveNodes: ', isDone";
-#endif
return anEditor.Remove( IdList, true );
}
// Update Python script
TPythonDump() <<"faceID = "<<this<<".AddPolygonalFace( "<<IDsOfNodes<<" )";
-#ifdef _DEBUG_
- TPythonDump() << "print 'AddPolygonalFace: ', faceID";
-#endif
- if(elem)
- return elem->GetID();
-
- return 0;
+ return elem ? elem->GetID() : 0;
}
//=============================================================================
// Update Python script
TPythonDump() << "volID = " << this << ".AddVolume( " << IDsOfNodes << " )";
-#ifdef _DEBUG_
- TPythonDump() << "print 'AddVolume: ', volID";
-#endif
if(elem)
return elem->GetID();
// Update Python script
TPythonDump() << "volID = " << this << ".AddPolyhedralVolume( "
<< IDsOfNodes << ", " << Quantities << " )";
-#ifdef _DEBUG_
- TPythonDump() << "print 'AddPolyhedralVolume: ', volID";
-#endif
-
- if(elem)
- return elem->GetID();
- return 0;
+ return elem ? elem->GetID() : 0;
}
//=============================================================================
// Update Python script
TPythonDump() << "volID = " << this << ".AddPolyhedralVolumeByFaces( "
<< IdsOfFaces << " )";
-#ifdef _DEBUG_
- TPythonDump() << "print 'AddPolyhedralVolume: ', volID";
-#endif
-
- if(elem)
- return elem->GetID();
- return 0;
+ return elem ? elem->GetID() : 0;
}
//=============================================================================
// Update Python script
TPythonDump() << "isDone = " << this << ".TriToQuad( "
<< IDsOfElements << ", " << aNumericalFunctor << ", " << MaxAngle << " )";
-#ifdef _DEBUG_
- TPythonDump() << "print 'TriToQuad: ', isDone";
-#endif
::SMESH_MeshEditor anEditor( myMesh );
// Clear python line(s), created by TriToQuad()
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
-#ifdef _DEBUG_
- aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
-#endif
SMESH::NumericalFunctor_i* aNumericalFunctor =
SMESH::DownCast<SMESH::NumericalFunctor_i*>( Criterion );
// Update Python script
TPythonDump() << "isDone = " << this << ".TriToQuadObject("
<< theObject << ", " << aNumericalFunctor << ", " << MaxAngle << " )";
-#ifdef _DEBUG_
- TPythonDump() << "print 'TriToQuadObject: ', isDone";
-#endif
return isDone;
}
// Update Python script
TPythonDump() << "isDone = " << this << ".QuadToTri( " << IDsOfElements << ", " << aNumericalFunctor << " )";
-#ifdef _DEBUG_
- TPythonDump() << "print 'QuadToTri: ', isDone";
-#endif
::SMESH_MeshEditor anEditor( myMesh );
CORBA::Boolean stat = anEditor.QuadToTri( faces, aCrit );
// Clear python line(s), created by QuadToTri()
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
-#ifdef _DEBUG_
- aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
-#endif
SMESH::NumericalFunctor_i* aNumericalFunctor =
SMESH::DownCast<SMESH::NumericalFunctor_i*>( Criterion );
// Update Python script
TPythonDump() << "isDone = " << this << ".QuadToTriObject( " << theObject << ", " << aNumericalFunctor << " )";
-#ifdef _DEBUG_
- TPythonDump() << "print 'QuadToTriObject: ', isDone";
-#endif
return isDone;
}
// Update Python script
TPythonDump() << "isDone = " << this << ".SplitQuad( "
<< IDsOfElements << ", " << Diag13 << " )";
-#ifdef _DEBUG_
- TPythonDump() << "print 'SplitQuad: ', isDone";
-#endif
::SMESH_MeshEditor anEditor( myMesh );
CORBA::Boolean stat = anEditor.QuadToTri( faces, Diag13 );
// Clear python line(s), created by SplitQuad()
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
-#ifdef _DEBUG_
- aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
-#endif
// Update Python script
TPythonDump() << "isDone = " << this << ".SplitQuadObject( "
<< theObject << ", " << Diag13 << " )";
-#ifdef _DEBUG_
- TPythonDump() << "print 'SplitQuadObject: ', isDone";
-#endif
return isDone;
}
return -1;
}
+//================================================================================
+/*!
+ * \brief Split volumic elements into tetrahedrons
+ */
+//================================================================================
+
+void SMESH_MeshEditor_i::SplitVolumesIntoTetra (SMESH::SMESH_IDSource_ptr elems,
+ CORBA::Short methodFlags)
+ throw (SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+
+ SMESH::long_array_var anElementsId = elems->GetIDs();
+ TIDSortedElemSet elemSet;
+ arrayToSet( anElementsId, GetMeshDS(), elemSet, SMDSAbs_Volume );
+
+ ::SMESH_MeshEditor anEditor (myMesh);
+ anEditor.SplitVolumesIntoTetra( elemSet, int( methodFlags ));
+
+ TPythonDump() << this << ".SplitVolumesIntoTetra( "
+ << elems << ", " << methodFlags << " )";
+}
//=======================================================================
//function : Smooth
<< "SMESH.SMESH_MeshEditor."
<< ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ?
"CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )");
-#ifdef _DEBUG_
- TPythonDump() << "print 'Smooth: ', isDone";
-#endif
return true;
}
// Clear python line(s), created by Smooth()
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
-#ifdef _DEBUG_
- aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
-#endif
// Update Python script
TPythonDump() << "isDone = " << this << "."
<< "SMESH.SMESH_MeshEditor."
<< ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ?
"CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )");
-#ifdef _DEBUG_
- TPythonDump() << "print 'SmoothObject: ', isDone";
-#endif
return isDone;
}
return mesh._retn();
}
+
+//=======================================================================
+//function : scale
+//purpose :
+//=======================================================================
+
+SMESH::ListOfGroups*
+SMESH_MeshEditor_i::scale(const SMESH::long_array & theIDsOfElements,
+ const SMESH::PointStruct& thePoint,
+ const SMESH::double_array& theScaleFact,
+ CORBA::Boolean theCopy,
+ const bool theMakeGroups,
+ ::SMESH_Mesh* theTargetMesh)
+{
+ initData();
+
+ TIDSortedElemSet elements;
+ arrayToSet(theIDsOfElements, GetMeshDS(), elements);
+
+ gp_Pnt aPnt( thePoint.x, thePoint.y, thePoint.z );
+ list<double> aScaleFact;
+ for (int i = 0; i < theScaleFact.length(); i++) {
+ aScaleFact.push_back( theScaleFact[i] );
+ }
+
+ ::SMESH_MeshEditor anEditor( myMesh );
+ ::SMESH_MeshEditor::PGroupIDs groupIds =
+ anEditor.Scale (elements, aPnt, aScaleFact, theCopy,
+ theMakeGroups, theTargetMesh);
+
+ if(theCopy)
+ storeResult(anEditor);
+
+ return theMakeGroups ? getGroups(groupIds.get()) : 0;
+}
+
+
+//=======================================================================
+//function : Scale
+//purpose :
+//=======================================================================
+
+void SMESH_MeshEditor_i::Scale(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::PointStruct& thePoint,
+ const SMESH::double_array& theScaleFact,
+ CORBA::Boolean theCopy)
+{
+ if ( !myPreviewMode ) {
+ TPythonDump() << this << ".Scale( "
+ << theObject << ", "
+ << "SMESH.PointStruct( " << thePoint.x << ", "
+ << thePoint.y << ", " << thePoint.z << " ) ,"
+ << theScaleFact << ", "
+ << theCopy << " )";
+ }
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ scale(anElementsId, thePoint, theScaleFact, theCopy, false);
+}
+
+
+//=======================================================================
+//function : ScaleMakeGroups
+//purpose :
+//=======================================================================
+
+SMESH::ListOfGroups*
+SMESH_MeshEditor_i::ScaleMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::PointStruct& thePoint,
+ const SMESH::double_array& theScaleFact)
+{
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::ListOfGroups * aGroups =
+ scale(anElementsId, thePoint, theScaleFact, true, true);
+
+ if ( !myPreviewMode ) {
+
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump << this << ".Scale("
+ << theObject << ","
+ << "SMESH.PointStruct(" <<thePoint.x << ","
+ << thePoint.y << "," << thePoint.z << "),"
+ << theScaleFact << ",True,True)";
+ }
+ return aGroups;
+}
+
+
+//=======================================================================
+//function : ScaleMakeMesh
+//purpose :
+//=======================================================================
+
+SMESH::SMESH_Mesh_ptr
+SMESH_MeshEditor_i::ScaleMakeMesh(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::PointStruct& thePoint,
+ const SMESH::double_array& theScaleFact,
+ CORBA::Boolean theCopyGroups,
+ const char* theMeshName)
+{
+ SMESH_Mesh_i* mesh_i;
+ SMESH::SMESH_Mesh_var mesh;
+ { // open new scope to dump "MakeMesh" command
+ // and then "GetGroups" using SMESH_Mesh::GetGroups()
+
+ TPythonDump pydump; // to prevent dump at mesh creation
+ mesh = makeMesh( theMeshName );
+ mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
+
+ if ( mesh_i ) {
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ scale(anElementsId, thePoint, theScaleFact,
+ false, theCopyGroups, & mesh_i->GetImpl());
+ mesh_i->CreateGroupServants();
+ }
+ if ( !myPreviewMode ) {
+ pydump << mesh << " = " << this << ".ScaleMakeMesh( "
+ << theObject << ", "
+ << "SMESH.PointStruct( " << thePoint.x << ", "
+ << thePoint.y << ", " << thePoint.z << " ) ,"
+ << theScaleFact << ", "
+ << theCopyGroups << ", '"
+ << theMeshName << "' )";
+ }
+ }
+
+ //dump "GetGroups"
+ if(!myPreviewMode && mesh_i)
+ mesh_i->GetGroups();
+
+ return mesh._retn();
+}
+
+
//=======================================================================
//function : FindCoincidentNodes
//purpose :
return res._retn();
}
+//=======================================================================
+//function : GetPointState
+//purpose : Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
+// TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
+//=======================================================================
+
+CORBA::Short SMESH_MeshEditor_i::GetPointState(CORBA::Double x,
+ CORBA::Double y,
+ CORBA::Double z)
+{
+ theSearchersDeleter.Set( myMesh );
+ if ( !theElementSearcher ) {
+ ::SMESH_MeshEditor anEditor( myMesh );
+ theElementSearcher = anEditor.GetElementSearcher();
+ }
+ return CORBA::Short( theElementSearcher->GetPointState( gp_Pnt( x,y,z )));
+}
+
//=======================================================================
//function : convError
//purpose :
}
TPythonDump() << "isDone = " << this << ".ChangeElemNodes( "
<< ide << ", " << newIDs << " )";
-#ifdef _DEBUG_
- TPythonDump() << "print 'ChangeElemNodes: ', isDone";
-#endif
return GetMeshDS()->ChangeElementNodes( elem, & aNodes[0], nbn1+1 );
}
storeResult( aMeshEditor) ;
// Update Python script
- TPythonDump() << "isDone = " << this << ".DoubleNodeGroups( " << &theElems << ", "
+ TPythonDump() << "isDone = " << this << ".DoubleNodeElemGroups( " << &theElems << ", "
<< &theNodesNot << ", " << &theAffectedElems << " )";
return aResult;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_MeshEditor_i.hxx
// Author : Nicolas REJNERI
class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
{
- public:
+public:
SMESH_MeshEditor_i(SMESH_Mesh_i * theMesh, bool isPreview);
virtual ~ SMESH_MeshEditor_i();
// --- CORBA
+
+ /*!
+ * \brief Wrap a sequence of ids in a SMESH_IDSource
+ */
+ SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::long_array& IDsOfElements);
+
CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes);
CORBA::Boolean Diag13);
CORBA::Long BestSplit (CORBA::Long IDOfQuad,
SMESH::NumericalFunctor_ptr Criterion);
+ void SplitVolumesIntoTetra (SMESH::SMESH_IDSource_ptr elems,
+ CORBA::Short methodFlags) throw (SALOME::SALOME_Exception);
CORBA::Boolean Smooth(const SMESH::long_array & IDsOfElements,
const SMESH::long_array & IDsOfFixedNodes,
CORBA::Boolean CopyGroups,
const char* MeshName);
+ void Scale(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::PointStruct& thePoint,
+ const SMESH::double_array& theScaleFact,
+ CORBA::Boolean theCopy);
+
+ SMESH::ListOfGroups* ScaleMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::PointStruct& thePoint,
+ const SMESH::double_array& theScaleFact);
+
+ SMESH::SMESH_Mesh_ptr ScaleMakeMesh(SMESH::SMESH_IDSource_ptr Object,
+ const SMESH::PointStruct& Point,
+ const SMESH::double_array& theScaleFact,
+ CORBA::Boolean CopyGroups,
+ const char* MeshName);
+
void FindCoincidentNodes (CORBA::Double Tolerance,
SMESH::array_of_long_array_out GroupsOfNodes);
void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr Object,
CORBA::Double z);
/*!
* Return elements of given type where the given point is IN or ON.
- *
* 'ALL' type means elements of any type excluding nodes
*/
SMESH::long_array* FindElementsByPoint(CORBA::Double x,
CORBA::Double z,
SMESH::ElementType type);
+ /*!
+ * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
+ * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
+ */
+ CORBA::Short GetPointState(CORBA::Double x, CORBA::Double y, CORBA::Double z);
SMESH::SMESH_MeshEditor::Sew_Error
SewFreeBorders(CORBA::Long FirstNodeID1,
const bool MakeGroups,
::SMESH_Mesh* TargetMesh=0);
+ SMESH::ListOfGroups* scale(const SMESH::long_array & theIDsOfElements,
+ const SMESH::PointStruct& thePoint,
+ const SMESH::double_array& theScaleFact,
+ CORBA::Boolean theCopy,
+ const bool theMakeGroups,
+ ::SMESH_Mesh* theTargetMesh=0);
+
SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
void DumpGroupsList(SMESH::TPythonDump & theDumpPython,
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_Mesh_i.cxx
// Author : Paul RASCLE, EDF
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Compound.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopTools_MapIteratorOfMapOfShape.hxx>
// STL Includes
+#include <algorithm>
#include <string>
#include <iostream>
#include <sstream>
char* SMESH_Mesh_i::GetVersionString(SMESH::MED_VERSION version, CORBA::Short nbDigits)
{
- std::string ver = DriverMED_W_SMESHDS_Mesh::GetVersionString(MED::EVersion(version),
+ string ver = DriverMED_W_SMESHDS_Mesh::GetVersionString(MED::EVersion(version),
nbDigits);
return CORBA::string_dup( ver.c_str() );
}
//=============================================================================
/*!
* \brief Create standalone group instead if group on geometry
- *
*/
//=============================================================================
_mapGroups[anId] = SMESH::SMESH_GroupBase::_duplicate( aGroup );
// register CORBA object for persistence
- //int nextId = _gen_i->RegisterObject( aGroup );
- //if(MYDEBUG) MESSAGE( "Add group to map with id = "<< nextId);
+ /*int nextId =*/ _gen_i->RegisterObject( aGroup );
+
builder->SetIOR( aGroupSO, _gen_i->GetORB()->object_to_string( aGroup ) );
return aGroup._retn();
return _impl->HasDuplicatedGroupNamesMED();
}
-void SMESH_Mesh_i::PrepareForWriting (const char* file)
+void SMESH_Mesh_i::PrepareForWriting (const char* file, bool overwrite)
{
TCollection_AsciiString aFullName ((char*)file);
OSD_Path aPath (aFullName);
// existing filesystem node
if (aFile.KindOfFile() == OSD_FILE) {
if (aFile.IsWriteable()) {
- aFile.Reset();
- aFile.Remove();
+ if (overwrite) {
+ aFile.Reset();
+ aFile.Remove();
+ }
if (aFile.Failed()) {
TCollection_AsciiString msg ("File ");
msg += aFullName + " cannot be replaced.";
}
}
-void SMESH_Mesh_i::ExportToMED (const char* file,
- CORBA::Boolean auto_groups,
- SMESH::MED_VERSION theVersion)
+void SMESH_Mesh_i::ExportToMEDX (const char* file,
+ CORBA::Boolean auto_groups,
+ SMESH::MED_VERSION theVersion,
+ CORBA::Boolean overwrite)
throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
// Perform Export
- PrepareForWriting(file);
+ PrepareForWriting(file, overwrite);
const char* aMeshName = "Mesh";
SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
if ( !aStudy->_is_nil() ) {
// check names of groups
checkGroupNames();
- TPythonDump() << _this() << ".ExportToMED( '"
- << file << "', " << auto_groups << ", " << theVersion << " )";
+ TPythonDump() << _this() << ".ExportToMEDX( '"
+ << file << "', " << auto_groups << ", " << theVersion << ", " << overwrite << " )";
_impl->ExportMED( file, aMeshName, auto_groups, theVersion );
}
+void SMESH_Mesh_i::ExportToMED (const char* file,
+ CORBA::Boolean auto_groups,
+ SMESH::MED_VERSION theVersion)
+ throw(SALOME::SALOME_Exception)
+{
+ ExportToMEDX(file,auto_groups,theVersion,true);
+}
+
void SMESH_Mesh_i::ExportMED (const char* file,
CORBA::Boolean auto_groups)
throw(SALOME::SALOME_Exception)
{
- ExportToMED(file,auto_groups,SMESH::MED_V2_1);
+ ExportToMEDX(file,auto_groups,SMESH::MED_V2_1,true);
}
void SMESH_Mesh_i::ExportDAT (const char *file)
//=============================================================================
char* SMESH_Mesh_i::Dump()
{
- std::ostringstream os;
+ ostringstream os;
_impl->Dump( os );
return CORBA::string_dup( os.str().c_str() );
}
return ( SMESH::ElementType )_impl->GetElementType( id, iselem );
}
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+SMESH::EntityType SMESH_Mesh_i::GetElementGeomType( const CORBA::Long id )
+ throw (SALOME::SALOME_Exception)
+{
+ const SMDS_MeshElement* e = _impl->GetMeshDS()->FindElement(id);
+ if ( !e )
+ THROW_SALOME_CORBA_EXCEPTION( "invalid element id", SALOME::BAD_PARAM );
+
+ return ( SMESH::EntityType ) e->GetEntityType();
+}
//=============================================================================
/*!
return elem->NbFaces();
}
+//=======================================================================
+//function : GetElemFaceNodes
+//purpose : Returns nodes of given face (counted from zero) for given element.
+//=======================================================================
+
+SMESH::long_array* SMESH_Mesh_i::GetElemFaceNodes(CORBA::Long elemId,
+ CORBA::Short faceIndex)
+{
+ SMESH::long_array_var aResult = new SMESH::long_array();
+ if ( SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS() )
+ {
+ if ( const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(elemId) )
+ {
+ SMDS_VolumeTool vtool( elem );
+ if ( faceIndex < vtool.NbFaces() )
+ {
+ aResult->length( vtool.NbFaceNodes( faceIndex ));
+ const SMDS_MeshNode** nn = vtool.GetFaceNodes( faceIndex );
+ for ( int i = 0; i < aResult->length(); ++i )
+ aResult[ i ] = nn[ i ]->GetID();
+ }
+ }
+ }
+ return aResult._retn();
+}
+
+//=======================================================================
+//function : FindElementByNodes
+//purpose : Returns an element based on all given nodes.
+//=======================================================================
+
+CORBA::Long SMESH_Mesh_i::FindElementByNodes(const SMESH::long_array& nodes)
+{
+ CORBA::Long elemID(0);
+ if ( SMESHDS_Mesh* mesh = _impl->GetMeshDS() )
+ {
+ vector< const SMDS_MeshNode * > nn( nodes.length() );
+ for ( int i = 0; i < nodes.length(); ++i )
+ if ( !( nn[i] = mesh->FindNode( nodes[i] )))
+ return elemID;
+
+ const SMDS_MeshElement* elem = mesh->FindElement( nn );
+ if ( !elem && ( _impl->NbEdges( ORDER_QUADRATIC ) ||
+ _impl->NbFaces( ORDER_QUADRATIC ) ||
+ _impl->NbVolumes( ORDER_QUADRATIC )))
+ elem = mesh->FindElement( nn, SMDSAbs_All, /*noMedium=*/true );
+
+ if ( elem ) elemID = CORBA::Long( elem->GetID() );
+ }
+ return elemID;
+}
//=============================================================================
/*!
while (theItr->more())
theInfo[ theItr->next()->GetEntityType() ]++;
}
+
+//=============================================================================
+/*!
+ * \brief mapping of mesh dimension into shape type
+ */
+//=============================================================================
+static TopAbs_ShapeEnum shapeTypeByDim(const int theDim)
+{
+ TopAbs_ShapeEnum aType = TopAbs_SOLID;
+ switch ( theDim ) {
+ case 0: aType = TopAbs_VERTEX; break;
+ case 1: aType = TopAbs_EDGE; break;
+ case 2: aType = TopAbs_FACE; break;
+ case 3:
+ default:aType = TopAbs_SOLID; break;
+ }
+ return aType;
+}
+
+//=============================================================================
+/*!
+ * \brief Internal structure used to find concurent submeshes
+ *
+ * It represents a pair < submesh, concurent dimension >, where
+ * 'concurrent dimension' is dimension of shape where the submesh can concurent
+ * with another submesh. In other words, it is dimension of a hypothesis assigned
+ * to submesh.
+ */
+//=============================================================================
+
+class SMESH_DimHyp
+{
+ public:
+ //! fileds
+ int _dim; //!< a dimension the algo can build (concurrent dimension)
+ int _ownDim; //!< dimension of shape of _subMesh (>=_dim)
+ TopTools_MapOfShape _shapeMap;
+ SMESH_subMesh* _subMesh;
+ list<const SMESHDS_Hypothesis*> _hypothesises; //!< algo is first, then its parameters
+
+ //! Constructors
+ SMESH_DimHyp(const SMESH_subMesh* theSubMesh,
+ const int theDim,
+ const TopoDS_Shape& theShape)
+ {
+ _subMesh = (SMESH_subMesh*)theSubMesh;
+ SetShape( theDim, theShape );
+ }
+
+ //! set shape
+ void SetShape(const int theDim,
+ const TopoDS_Shape& theShape)
+ {
+ _dim = theDim;
+ _ownDim = (int)SMESH_Gen::GetShapeDim(theShape);
+ if (_dim >= _ownDim)
+ _shapeMap.Add( theShape );
+ else {
+ TopExp_Explorer anExp( theShape, shapeTypeByDim(theDim) );
+ for( ; anExp.More(); anExp.Next() )
+ _shapeMap.Add( anExp.Current() );
+ }
+ }
+
+ //! Check sharing of sub shapes
+ static bool isShareSubShapes(const TopTools_MapOfShape& theToCheck,
+ const TopTools_MapOfShape& theToFind,
+ const TopAbs_ShapeEnum theType)
+ {
+ bool isShared = false;
+ TopTools_MapIteratorOfMapOfShape anItr( theToCheck );
+ for (; !isShared && anItr.More(); anItr.Next() ) {
+ const TopoDS_Shape aSubSh = anItr.Key();
+ // check for case when concurrent dimensions are same
+ isShared = theToFind.Contains( aSubSh );
+ // check for subshape with concurrent dimension
+ TopExp_Explorer anExp( aSubSh, theType );
+ for ( ; !isShared && anExp.More(); anExp.Next() )
+ isShared = theToFind.Contains( anExp.Current() );
+ }
+ return isShared;
+ }
+
+ //! check algorithms
+ static bool checkAlgo(const SMESHDS_Hypothesis* theA1,
+ const SMESHDS_Hypothesis* theA2)
+ {
+ if ( theA1->GetType() == SMESHDS_Hypothesis::PARAM_ALGO ||
+ theA2->GetType() == SMESHDS_Hypothesis::PARAM_ALGO )
+ return false; // one of the hypothesis is not algorithm
+ // check algorithm names (should be equal)
+ return strcmp( theA1->GetName(), theA2->GetName() ) == 0;
+ }
+
+
+ //! Check if subshape hypotheses are concurrent
+ bool IsConcurrent(const SMESH_DimHyp* theOther) const
+ {
+ if ( _subMesh == theOther->_subMesh )
+ return false; // same subshape - should not be
+
+ // if ( <own dim of either of submeshes> == <concurrent dim> &&
+ // any of the two submeshes is not on COMPOUND shape )
+ // -> no concurrency
+ bool meIsCompound = (_subMesh->GetSubMeshDS() && _subMesh->GetSubMeshDS()->IsComplexSubmesh());
+ bool otherIsCompound = (theOther->_subMesh->GetSubMeshDS() && theOther->_subMesh->GetSubMeshDS()->IsComplexSubmesh());
+ if ( (_ownDim == _dim || theOther->_ownDim == _dim ) && (!meIsCompound || !otherIsCompound))
+ return false;
+
+// bool checkSubShape = ( _dim >= theOther->_dim )
+// ? isShareSubShapes( _shapeMap, theOther->_shapeMap, shapeTypeByDim(theOther->_dim) )
+// : isShareSubShapes( theOther->_shapeMap, _shapeMap, shapeTypeByDim(_dim) ) ;
+ bool checkSubShape = isShareSubShapes( _shapeMap, theOther->_shapeMap, shapeTypeByDim(_dim));
+ if ( !checkSubShape )
+ return false;
+
+ // check algorithms to be same
+ if (!checkAlgo( _hypothesises.front(), theOther->_hypothesises.front() ))
+ return true; // different algorithms
+
+ // check hypothesises for concurrence (skip first as algorithm)
+ int nbSame = 0;
+ // pointers should be same, becase it is referenes from mesh hypothesis partition
+ list <const SMESHDS_Hypothesis*>::const_iterator hypIt = _hypothesises.begin();
+ list <const SMESHDS_Hypothesis*>::const_iterator otheEndIt = theOther->_hypothesises.end();
+ for ( hypIt++ /*skip first as algo*/; hypIt != _hypothesises.end(); hypIt++ )
+ if ( find( theOther->_hypothesises.begin(), otheEndIt, *hypIt ) != otheEndIt )
+ nbSame++;
+ // the submeshes are concurrent if their algorithms has different parameters
+ return nbSame != theOther->_hypothesises.size() - 1;
+ }
+
+}; // end of SMESH_DimHyp
+
+typedef list<SMESH_DimHyp*> TDimHypList;
+
+static void addDimHypInstance(const int theDim,
+ const TopoDS_Shape& theShape,
+ const SMESH_Algo* theAlgo,
+ const SMESH_subMesh* theSubMesh,
+ const list <const SMESHDS_Hypothesis*>& theHypList,
+ TDimHypList* theDimHypListArr )
+{
+ TDimHypList& listOfdimHyp = theDimHypListArr[theDim];
+ if ( listOfdimHyp.empty() || listOfdimHyp.back()->_subMesh != theSubMesh ) {
+ SMESH_DimHyp* dimHyp = new SMESH_DimHyp( theSubMesh, theDim, theShape );
+ listOfdimHyp.push_back( dimHyp );
+ }
+
+ SMESH_DimHyp* dimHyp = listOfdimHyp.back();
+ dimHyp->_hypothesises.push_front(theAlgo);
+ list <const SMESHDS_Hypothesis*>::const_iterator hypIt = theHypList.begin();
+ for( ; hypIt != theHypList.end(); hypIt++ )
+ dimHyp->_hypothesises.push_back( *hypIt );
+}
+
+static void findConcurrents(const SMESH_DimHyp* theDimHyp,
+ const TDimHypList& theListOfDimHyp,
+ TListOfInt& theListOfConcurr )
+{
+ TDimHypList::const_reverse_iterator rIt = theListOfDimHyp.rbegin();
+ for ( ; rIt != theListOfDimHyp.rend(); rIt++ ) {
+ const SMESH_DimHyp* curDimHyp = *rIt;
+ if ( curDimHyp == theDimHyp )
+ break; // meet own dimHyp pointer in same dimension
+ else if ( theDimHyp->IsConcurrent( curDimHyp ) )
+ if ( find( theListOfConcurr.begin(),
+ theListOfConcurr.end(),
+ curDimHyp->_subMesh->GetId() ) == theListOfConcurr.end() )
+ theListOfConcurr.push_back( curDimHyp->_subMesh->GetId() );
+ }
+}
+
+static void unionLists(TListOfInt& theListOfId,
+ TListOfListOfInt& theListOfListOfId,
+ const int theIndx )
+{
+ TListOfListOfInt::iterator it = theListOfListOfId.begin();
+ for ( int i = 0; it != theListOfListOfId.end(); it++, i++ ) {
+ if ( i < theIndx )
+ continue; //skip already treated lists
+ // check if other list has any same submesh object
+ TListOfInt& otherListOfId = *it;
+ if ( find_first_of( theListOfId.begin(), theListOfId.end(),
+ otherListOfId.begin(), otherListOfId.end() ) == theListOfId.end() )
+ continue;
+
+ // union two lists (from source into target)
+ TListOfInt::iterator it2 = otherListOfId.begin();
+ for ( ; it2 != otherListOfId.end(); it2++ ) {
+ if ( find( theListOfId.begin(), theListOfId.end(), (*it2) ) == theListOfId.end() )
+ theListOfId.push_back(*it2);
+ }
+ // clear source list
+ otherListOfId.clear();
+ }
+}
+
+//! free memory allocated for dimension-hypothesis objects
+static void removeDimHyps( TDimHypList* theArrOfList )
+{
+ for (int i = 0; i < 4; i++ ) {
+ TDimHypList& listOfdimHyp = theArrOfList[i];
+ TDimHypList::const_iterator it = listOfdimHyp.begin();
+ for ( ; it != listOfdimHyp.end(); it++ )
+ delete (*it);
+ }
+}
+
+//=============================================================================
+/*!
+ * \brief Return submesh objects list in meshing order
+ */
+//=============================================================================
+
+SMESH::submesh_array_array* SMESH_Mesh_i::GetMeshOrder()
+{
+ SMESH::submesh_array_array_var aResult = new SMESH::submesh_array_array();
+
+ 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() ) {
+
+ // collect submeshes detecting 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;
+ // shape of submesh
+ const TopoDS_Shape& aSubMeshShape = sm->GetSubShape();
+
+ // list of assigned hypothesises
+ const list <const SMESHDS_Hypothesis*>& hypList = mesh.GetHypothesisList(aSubMeshShape);
+ // Find out dimensions where the submesh can be concurrent.
+ // We define the dimensions by algo of each of hypotheses in hypList
+ list <const SMESHDS_Hypothesis*>::const_iterator hypIt = hypList.begin();
+ for( ; hypIt != hypList.end(); hypIt++ ) {
+ SMESH_Algo* anAlgo = 0;
+ const SMESH_Hypothesis* hyp = dynamic_cast<const SMESH_Hypothesis*>(*hypIt);
+ if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO )
+ // hyp it-self is algo
+ anAlgo = (SMESH_Algo*)dynamic_cast<const SMESH_Algo*>(hyp);
+ else {
+ // try to find algorithm with help of subshapes
+ TopExp_Explorer anExp( aSubMeshShape, shapeTypeByDim(hyp->GetDim()) );
+ for ( ; !anAlgo && anExp.More(); anExp.Next() )
+ anAlgo = mesh.GetGen()->GetAlgo( mesh, anExp.Current() );
+ }
+ if (!anAlgo)
+ continue; // no assigned algorithm to current submesh
+
+ int dim = anAlgo->GetDim(); // top concurrent dimension (see comment to SMESH_DimHyp)
+ // the submesh can concurrent at <dim> (or lower dims if !anAlgo->NeedDescretBoundary())
+
+ // create instance of dimension-hypothesis for found concurrent dimension(s) and algorithm
+ for ( int j = anAlgo->NeedDescretBoundary() ? dim : 1, jn = dim; j <= jn; j++ )
+ addDimHypInstance( j, aSubMeshShape, anAlgo, sm, hypList, dimHypListArr );
+ }
+ } // end iterations on submesh
+
+ // iterate on created dimension-hypotheses and check for concurrents
+ for ( int i = 0; i < 4; i++ ) {
+ const list<SMESH_DimHyp*>& listOfDimHyp = dimHypListArr[i];
+ // check for concurrents in own and other dimensions (step-by-step)
+ TDimHypList::const_iterator dhIt = listOfDimHyp.begin();
+ for ( ; dhIt != listOfDimHyp.end(); dhIt++ ) {
+ const SMESH_DimHyp* dimHyp = *dhIt;
+ TListOfInt listOfConcurr;
+ // looking for concurrents and collect into own list
+ for ( int j = i; j < 4; j++ )
+ findConcurrents( dimHyp, dimHypListArr[j], listOfConcurr );
+ // check if any concurrents found
+ if ( listOfConcurr.size() > 0 ) {
+ // add own submesh to list of concurrent
+ listOfConcurr.push_front( dimHyp->_subMesh->GetId() );
+ anOrder.push_back( listOfConcurr );
+ }
+ }
+ }
+
+ removeDimHyps(dimHypListArr);
+
+ // now, minimise the number of concurrent groups
+ // Here we assume that lists of submhes can has same submesh
+ // in case of multi-dimension algorithms, as result
+ // list with common submesh have to be union into one list
+ 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, true );
+
+ return aResult._retn();
+}
+
+//=============================================================================
+/*!
+ * \brief find common submeshes with given submesh
+ * \param theSubMeshList list of already collected submesh to check
+ * \param theSubMesh given submesh to intersect with other
+ * \param theCommonSubMeshes collected common submeshes
+ */
+//=============================================================================
+
+static void findCommonSubMesh
+ (list<const SMESH_subMesh*>& theSubMeshList,
+ const SMESH_subMesh* theSubMesh,
+ set<const SMESH_subMesh*>& theCommon )
+{
+ if ( !theSubMesh )
+ return;
+ list<const SMESH_subMesh*>::const_iterator it = theSubMeshList.begin();
+ for ( ; it != theSubMeshList.end(); it++ )
+ theSubMesh->FindIntersection( *it, theCommon );
+ theSubMeshList.push_back( theSubMesh );
+ //theCommon.insert( theSubMesh );
+}
+
+//=============================================================================
+/*!
+ * \brief Set submesh object order
+ * \param theSubMeshArray submesh array order
+ */
+//=============================================================================
+
+::CORBA::Boolean SMESH_Mesh_i::SetMeshOrder(const SMESH::submesh_array_array& theSubMeshArray)
+{
+ bool res = false;
+ ::SMESH_Mesh& mesh = GetImpl();
+
+ TPythonDump aPythonDump; // prevent dump of called methods
+ aPythonDump << "isDone = " << _this() << ".SetMeshOrder( [ ";
+
+ TListOfListOfInt subMeshOrder;
+ for ( int i = 0, n = theSubMeshArray.length(); i < n; i++ )
+ {
+ const SMESH::submesh_array& aSMArray = theSubMeshArray[i];
+ TListOfInt subMeshIds;
+ aPythonDump << "[ ";
+ // Collect subMeshes which should be clear
+ // do it list-by-list, because modification of submesh order
+ // take effect between concurrent submeshes only
+ set<const SMESH_subMesh*> subMeshToClear;
+ list<const SMESH_subMesh*> subMeshList;
+ for ( int j = 0, jn = aSMArray.length(); j < jn; j++ )
+ {
+ const SMESH::SMESH_subMesh_var subMesh = SMESH::SMESH_subMesh::_duplicate(aSMArray[j]);
+ if ( j > 0 )
+ aPythonDump << ", ";
+ aPythonDump << subMesh;
+ subMeshIds.push_back( subMesh->GetId() );
+ // detect common parts of submeshes
+ if ( _mapSubMesh.find(subMesh->GetId()) != _mapSubMesh.end() )
+ findCommonSubMesh( subMeshList, _mapSubMesh[ subMesh->GetId() ], subMeshToClear );
+ }
+ aPythonDump << " ]";
+ subMeshOrder.push_back( subMeshIds );
+
+ // clear collected submeshes
+ set<const SMESH_subMesh*>::iterator clrIt = subMeshToClear.begin();
+ for ( ; clrIt != subMeshToClear.end(); clrIt++ ) {
+ SMESH_subMesh* sm = (SMESH_subMesh*)*clrIt;
+ if ( sm )
+ sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
+ // ClearSubMesh( *clrIt );
+ }
+ }
+ aPythonDump << " ])";
+
+ mesh.SetMeshOrder( subMeshOrder );
+ res = true;
+
+ return res;
+}
+
+//=============================================================================
+/*!
+ * \brief Convert submesh ids into submesh interfaces
+ */
+//=============================================================================
+
+void SMESH_Mesh_i::convertMeshOrder
+(const TListOfListOfInt& theIdsOrder,
+ SMESH::submesh_array_array& theResOrder,
+ const bool theIsDump)
+{
+ int nbSet = theIdsOrder.size();
+ TPythonDump aPythonDump; // prevent dump of called methods
+ if ( theIsDump )
+ aPythonDump << "[ ";
+ theResOrder.length(nbSet);
+ TListOfListOfInt::const_iterator it = theIdsOrder.begin();
+ int listIndx = 0;
+ for( ; it != theIdsOrder.end(); it++ ) {
+ // translate submesh identificators into submesh objects
+ // takeing into account real number of concurrent lists
+ const TListOfInt& aSubOrder = (*it);
+ if (!aSubOrder.size())
+ continue;
+ if ( theIsDump )
+ aPythonDump << "[ ";
+ // convert shape indeces into interfaces
+ 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++ ) {
+ if ( _mapSubMeshIor.find(*subIt) == _mapSubMeshIor.end() )
+ continue;
+ SMESH::SMESH_subMesh_var subMesh =
+ SMESH::SMESH_subMesh::_duplicate( _mapSubMeshIor[*subIt] );
+ if ( theIsDump ) {
+ if ( j > 0 )
+ aPythonDump << ", ";
+ aPythonDump << subMesh;
+ }
+ aResSubSet[ j++ ] = subMesh;
+ }
+ if ( theIsDump )
+ aPythonDump << " ]";
+ theResOrder[ listIndx++ ] = aResSubSet;
+ }
+ // correct number of lists
+ theResOrder.length( listIndx );
+
+ if ( theIsDump ) {
+ // finilise python dump
+ aPythonDump << " ]";
+ aPythonDump << " = " << _this() << ".GetMeshOrder()";
+ }
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_Mesh_i.hxx
// Author : Paul RASCLE, EDF
public:
SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
SMESH_Gen_i* myGen_i,
- CORBA::Long studyId );
+ CORBA::Long studyId );
virtual ~SMESH_Mesh_i();
*/
char* GetVersionString(SMESH::MED_VERSION version, CORBA::Short nbDigits);
+ void ExportToMEDX( const char* file, CORBA::Boolean auto_groups, SMESH::MED_VERSION theVersion, CORBA::Boolean overwrite )
+ throw (SALOME::SALOME_Exception);
void ExportToMED( const char* file, CORBA::Boolean auto_groups, SMESH::MED_VERSION theVersion )
throw (SALOME::SALOME_Exception);
void ExportMED( const char* file, CORBA::Boolean auto_groups )
SMESH::ElementType GetElementType( CORBA::Long id, bool iselem )
throw (SALOME::SALOME_Exception);
+ SMESH::EntityType GetElementGeomType( CORBA::Long id )
+ throw (SALOME::SALOME_Exception);
+
/*!
* Returns ID of elements for given submesh
*/
static SMESH::Hypothesis_Status
ConvertHypothesisStatus (SMESH_Hypothesis::Hypothesis_Status theStatus);
- static void PrepareForWriting (const char* file);
+ static void PrepareForWriting (const char* file, bool overwrite = true);
//int importMEDFile( const char* theFileName, const char* theMeshName );
* Returns number of faces for given element
*/
CORBA::Long ElemNbFaces(CORBA::Long id);
-
+ /*!
+ * Returns nodes of given face (counted from zero) for given element.
+ */
+ SMESH::long_array* GetElemFaceNodes(CORBA::Long elemId, CORBA::Short faceIndex);
+
+ /*!
+ * Returns an element based on all given nodes.
+ */
+ CORBA::Long FindElementByNodes(const SMESH::long_array& nodes);
+
/*!
* Returns true if given element is polygon
*/
static void CollectMeshInfo(const SMDS_ElemIteratorPtr theItr,
SMESH::long_array& theInfo);
+
+ /*!
+ * \brief Return submesh objects list in meshing order
+ */
+ virtual SMESH::submesh_array_array* GetMeshOrder();
+ /*!
+ * \brief Set submesh object order
+ */
+ virtual ::CORBA::Boolean SetMeshOrder(const SMESH::submesh_array_array& theSubMeshArray);
+
std::map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI
std::map<int, ::SMESH_subMesh*> _mapSubMesh; //NRI
*/
void checkGroupNames();
+ /*!
+ * Convert submesh ids into submesh interfaces
+ */
+ void convertMeshOrder(const TListOfListOfInt& theIdsOrder,
+ SMESH::submesh_array_array& theSubMeshOrder,
+ const bool theIsDump);
+
private:
static int myIdGenerator;
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_NoteBook.cxx
// Author : Roman NIKOLAEV
-
+//
#include "SMESH_2smeshpy.hxx"
#include "SMESH_NoteBook.hxx"
#include "SMESH_Gen_i.hxx"
using namespace std;
-void SetVariable(Handle(_pyCommand) theCommand,const ObjectStates* theStates, int position, int theArgNb);
+void SetVariable(Handle(_pyCommand) theCommand,const SMESH_ObjectStates* theStates, int position, int theArgNb);
//================================================================================
/*!
* \brief Constructor
*/
//================================================================================
-ObjectStates::ObjectStates(TCollection_AsciiString theType)
+SMESH_ObjectStates::SMESH_ObjectStates(TCollection_AsciiString theType)
{
_type = theType;
_dumpstate = 0;
* \brief Destructor
*/
//================================================================================
-ObjectStates::~ObjectStates()
+SMESH_ObjectStates::~SMESH_ObjectStates()
{
}
* \param theState - Object state (vector of notebook variable)
*/
//================================================================================
-void ObjectStates::AddState(const TState &theState)
+void SMESH_ObjectStates::AddState(const TState &theState)
{
_states.push_back(theState);
}
* \\retval state - Object state (vector of notebook variable)
*/
//================================================================================
-TState ObjectStates::GetCurrectState() const
+TState SMESH_ObjectStates::GetCurrectState() const
{
if(_states.size() > _dumpstate)
return _states[_dumpstate];
*
*/
//================================================================================
-TAllStates ObjectStates::GetAllStates() const
+TAllStates SMESH_ObjectStates::GetAllStates() const
{
return _states;
}
*
*/
//================================================================================
-void ObjectStates::IncrementState()
+void SMESH_ObjectStates::IncrementState()
{
_dumpstate++;
}
*
*/
//================================================================================
-TCollection_AsciiString ObjectStates::GetObjectType() const{
+TCollection_AsciiString SMESH_ObjectStates::GetObjectType() const{
return _type;
}
*/
//================================================================================
LayerDistributionStates::LayerDistributionStates():
- ObjectStates("LayerDistribution")
+ SMESH_ObjectStates("LayerDistribution")
{
}
//================================================================================
if(it != _objectMap.end()) {
if(MYDEBUG)
cout << "Found object : " << (*it).first << endl;
- ObjectStates *aStates = (*it).second;
+ SMESH_ObjectStates *aStates = (*it).second;
// Case for LocalLength hypothesis
if(aStates->GetObjectType().IsEqual("LocalLength") && aStates->GetCurrectState().size() >= 2) {
if(aMethod.IsEqual("SetLength")) {
}
if(MYDEBUG)
cout<<"The object Type : "<<anObjType<<endl;
- ObjectStates *aState = NULL;
+ SMESH_ObjectStates *aState = NULL;
if(anObjType == "LayerDistribution") {
aState = new LayerDistributionStates();
}
else
- aState = new ObjectStates(anObjType);
+ aState = new SMESH_ObjectStates(anObjType);
for(int i = 0; i < aSections->length(); i++) {
TState aVars;
}
aState->AddState(aVars);
}
- _objectMap.insert(pair<TCollection_AsciiString,ObjectStates*>(TCollection_AsciiString(aSObject->GetID()),aState));
+ _objectMap.insert(pair<TCollection_AsciiString,SMESH_ObjectStates*>(TCollection_AsciiString(aSObject->GetID()),aState));
}
}
}
/*!
- * Set variable of the ObjectStates from position to the _pyCommand
+ * Set variable of the SMESH_ObjectStates from position to the _pyCommand
* method as nbArg argument
*/
-void SetVariable(Handle(_pyCommand) theCommand, const ObjectStates* theStates, int position, int theArgNb)
+void SetVariable(Handle(_pyCommand) theCommand, const SMESH_ObjectStates* theStates, int position, int theArgNb)
{
if(theStates->GetCurrectState().size() > position)
if(!theStates->GetCurrectState().at(position).IsEmpty())
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_NoteBook.hxx
// Author : Roman NIKOLAEV ()
-
-
+//
#ifndef SMESH_NoteBook_HeaderFile
#define SMESH_NoteBook_HeaderFile
typedef std::vector<TState> TAllStates;
typedef TCollection_AsciiString _pyID;
-class ObjectStates{
+class SMESH_ObjectStates{
public:
- ObjectStates(TCollection_AsciiString theType);
- virtual ~ObjectStates();
+ SMESH_ObjectStates(TCollection_AsciiString theType);
+ virtual ~SMESH_ObjectStates();
void AddState(const TState &theState);
int _dumpstate;
};
-class LayerDistributionStates : public ObjectStates
+class LayerDistributionStates : public SMESH_ObjectStates
{
public:
typedef std::map<TCollection_AsciiString,TCollection_AsciiString> TDistributionMap;
class SMESH_NoteBook
{
public:
- typedef std::map<TCollection_AsciiString,ObjectStates*> TVariablesMap;
+ typedef std::map<TCollection_AsciiString,SMESH_ObjectStates*> TVariablesMap;
typedef std::map<TCollection_AsciiString,TCollection_AsciiString> TMeshEditorMap;
SMESH_NoteBook();
~SMESH_NoteBook();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_Pattern_i.cxx
// Created : Fri Aug 20 16:15:49 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_Pattern_i.hxx
// Created : Fri Aug 20 16:03:15 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SMESH_PYTHONDUMP_HXX_
#define _SMESH_PYTHONDUMP_HXX_
TPythonDump&
operator<<(const SMESH::double_array& theArg);
+ TPythonDump&
+ operator<<(SMESH::SMESH_Hypothesis_ptr theArg);
+
+ TPythonDump&
+ operator<<(SMESH::SMESH_IDSource_ptr theArg);
+
TPythonDump&
operator<<(SALOMEDS::SObject_ptr theArg);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_subMesh_i.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_subMesh_i.hxx
// Author : Paul RASCLE, EDF
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
# File : smeshpy.py
# Module : SMESH
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Nicolas REJNERI, Paul RASCLE
# Modified by : Alexander BORODIN (OCN) - autotools usage
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import salome
import geompy
import smesh
#-----------------------------SMESH-------------------------------------------
-
+smesh.SetCurrentStudy(salome.myStudy)
# -- Init mesh --
plane_mesh = salome.IDToObject( Id_face1)
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_testExtrusion2D.py
# Module : SMESH
# Description : Create meshes to test extrusion of mesh elements along path
#---------------------------------SMESH
+smesh.SetCurrentStudy(salome.myStudy)
# create the path mesh
mesh1 = smesh.Mesh(ellipse1, "Path Mesh")
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_testExtrusion3D.py
# Module : SMESH
# Description : Create meshes to test extrusion of mesh elements along path
idface = geompy.addToStudy(face, "Circular face")
+smesh.SetCurrentStudy(salome.myStudy)
# init a Mesh with the circular face
mesh1 = smesh.Mesh(face, "Mesh on circular face")
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
+import salome
import smesh
import math
pass
return newnodes
-
+smesh.SetCurrentStudy(salome.myStudy)
+
# create empty mesh
mesh = smesh.Mesh()
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
from SMESH_test1 import *
## Old style
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_BuildCompound.py
# Author : Alexander KOVALEV
# Module : SMESH
# ! as some sequences of symbols from this example are used during
# ! documentation generation to identify certain places of this file
#
+import salome
import geompy
import smesh
geompy.addToStudyInFather(Box_sup, Fsup2, "Fsup")
geompy.addToStudyInFather(Box_sup, Finf2, "Finf")
+smesh.SetCurrentStudy(salome.myStudy)
+
## create a bottom mesh
Mesh_inf = smesh.Mesh(Box_inf, "Mesh_inf")
algo1D_1=Mesh_inf.Segment()
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_GroupFromGeom.py
# Module : SMESH
#
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#==============================================================================
# Info.
# Bug (from script, bug) : SMESH_GroupFromGeom.py, PAL6945
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
+import salome
import smesh
+smesh.SetCurrentStudy(salome.myStudy)
+
def BuildGroupLyingOn(theMesh, theElemType, theName, theShape):
aFilterMgr = smesh.smesh.CreateFilterManager()
aFilter = aFilterMgr.CreateFilter()
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#####################################################################
#Created :17/02/2005
#Auhtor :MASLOV Eugeny, KOVALTCHUK Alexey
#Mesh creation
+smesh.SetCurrentStudy(salome.myStudy)
+
# -- Init --
shape_mesh = salome.IDToObject( Cut_1_ID )
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Tetrahedrization of the geometry generated by the Python script GEOM_Partition1.py
# Hypothesis and algorithms for the mesh generation are global
# -- Rayon de la bariere
print " check status ", status
# ---- launch SMESH
+smesh.SetCurrentStudy(salome.myStudy)
# ---- init a Mesh with the alveole
shape_mesh = salome.IDToObject( idalveole )
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
# File : GEOM_Sphere.py
# Author : Damien COQUERET, Open CASCADE
#-----------------------------------------------------------------------
#Meshing
+smesh.SetCurrentStudy(salome.myStudy)
my_hexa = smesh.Mesh(Result, "Sphere_Mesh")
algo = my_hexa.Segment()
algo.NumberOfSegments(NbSeg)
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH SMESH_SWIG : binding of C++ implementaion with Python
# File : SMESH_blocks.py
# Author : Julia DOROVSKIKH
isBlocksTest = 0 # False
isMeshTest = 1 # True
+smesh.SetCurrentStudy(salome.myStudy)
GEOM_Spanner.MakeSpanner(geompy, math, isBlocksTest, isMeshTest, smesh)
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#==============================================================================
# Info.
# Bug (from script, bug) : box.py, PAL5223
boxId = geompy.addToStudy(box,"box")
# ---- SMESH
+smesh.SetCurrentStudy(salome.myStudy)
# ---- init a Mesh
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Tetrahedrization of the geometry union of 2 boxes having a face in common
# Hypothesis and algorithms for the mesh generation are global
#
### ---------------------------- SMESH --------------------------------------
+smesh.SetCurrentStudy(salome.myStudy)
# ---- init a Mesh with the shell
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Tetrahedrization of the geometry union of 3 boxes aligned where the middle
# one has a race in common with the two others.
# Hypothesis and algorithms for the mesh generation are global
### ---------------------------- SMESH --------------------------------------
-
+smesh.SetCurrentStudy(salome.myStudy)
# ---- init a Mesh with the shell
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Tetrahedrization of a simple box. Hypothesis and algorithms for
# the mesh generation are global
#
### ---------------------------- SMESH --------------------------------------
+smesh.SetCurrentStudy(salome.myStudy)
# ---- init a Mesh with the boxe
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_control.py
# Author : Sergey LITONIN
# Module : SMESH
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#==============================================================================
# Info.
# Bug (from script, bug) : SMESH_demo_hexa2_upd.py, PAL6781
idEdgeZ.append(geompy.addToStudyInFather(vol,edgeZ[i],"EdgeZ"+str(i+1)))
### ---------------------------- SMESH --------------------------------------
+smesh.SetCurrentStudy(salome.myStudy)
# ---- init a Mesh with the volume
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_fix_volute.py
# Author : Paul RASCLE, EDF
# Module : SMESH
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Hexahedrization of the geometry generated by the Python script
# SMESH_fixation.py
# Hypothesis and algorithms for the mesh generation are global
print " check status ", status
### ---------------------------- SMESH --------------------------------------
+smesh.SetCurrentStudy(salome.myStudy)
# ---- init a Mesh with the compshell
shape_mesh = salome.IDToObject( idcomp )
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Tetrahedrization of the geometry generated by the Python script
# SMESH_fixation.py
# The new Netgen algorithm is used that discretizes baoundaries itself
print " check status ", status
### ---------------------------- SMESH --------------------------------------
+smesh.SetCurrentStudy(salome.myStudy)
print "-------------------------- create Mesh, algorithm, hypothesis"
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Tetrahedrization of the geometry generated by the Python script
# SMESH_fixation.py
# Hypothesis and algorithms for the mesh generation are global
print " check status ", status
### ---------------------------- SMESH --------------------------------------
+smesh.SetCurrentStudy(salome.myStudy)
# ---- init a Mesh with the compshell
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Triangulation of the skin of the geometry from a Brep representing a plane
# Hypothesis and algorithms for the mesh generation are global
#
### ---------------------------- SMESH --------------------------------------
+smesh.SetCurrentStudy(salome.myStudy)
# ---- init a Mesh with the shell
shape_mesh = salome.IDToObject( idShape )
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import salome
import geompy
import smesh
aBox = salome.IDToObject( idbox )
# Create mesh
+smesh.SetCurrentStudy(salome.myStudy)
mesh = smesh.Mesh(aBox, "Mesh_freebord")
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#==============================================================================
# Info.
# Bug (from script, bug) : hexaedre_modified.py, PAL6194, PAL7153
# -----------------------------------------------------------------------------
print "-------------------------- mesh"
+smesh.SetCurrentStudy(salome.myStudy)
# ---- init a Mesh with the geom shape
shape_mesh = blob
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_withHole.py
# Author : Lucien PIGNOLONI
# Module : SMESH
Id_SubFace4 = geompy.addToStudyInFather( mechanic, sub_face4, name )
# ---------------------------- SMESH --------------------------------------
+smesh.SetCurrentStudy(salome.myStudy)
# -- Init --
shape_mesh = salome.IDToObject( Id_mechanic )
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_withHole.py
# Author : Lucien PIGNOLONI
# Module : SMESH
Id_SubFace4 = geompy.addToStudyInFather( mechanic, sub_face4, name )
# ---------------------------- SMESH --------------------------------------
+smesh.SetCurrentStudy(salome.myStudy)
# -- Init --
shape_mesh = salome.IDToObject( Id_mechanic )
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Quadrangulation of the geometry generated by the Python script
# SMESH_mechanic.py
# The new Netgen algorithm is used that discretizes baoundaries itself
print "number of Edges in mechanic : ",len(subEdgeList)
### ---------------------------- SMESH --------------------------------------
+smesh.SetCurrentStudy(salome.myStudy)
print "-------------------------- create Mesh, algorithm, hypothesis"
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_withHole.py
# Author : Lucien PIGNOLONI
# Module : SMESH
print "number of Edges in mechanic : ",len(subEdgeList)
### ---------------------------- SMESH --------------------------------------
+smesh.SetCurrentStudy(salome.myStudy)
shape_mesh = salome.IDToObject( Id_mechanic )
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_reg.py
# Module : SMESH
#
# ---- launch SMESH
smeshgui = salome.ImportComponentGUI("SMESH")
smeshgui.Init(salome.myStudyId)
-
+smesh.SetCurrentStudy(salome.myStudy)
# ---- Creating meshes
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
"""
"""
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
# File : SMESH_test.py
# Module : SMESH
# ---- SMESH
+smesh.SetCurrentStudy(salome.myStudy)
box = salome.IDToObject(idb)
mesh = smesh.Mesh(box, "Meshbox")
elif comType == 2:
for i in range(a.number):
ind = a.indexes[ii]
+ print ind
ii = ii+1
+ print ii
i1 = a.indexes[ii]
ii = ii+1
i2 = a.indexes[ii]
+ print i2
ii = ii+1
+ print "ii", ii
i3 = a.indexes[ii]
+ print i3
+ #ii = ii+1
ii = ii+1
print "AddTriangle %i - %i %i %i" % (ind, i1, i2, i3)
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_test0.py
# Module : SMESH
#
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_test1.py
# Module : SMESH
#
import geompy
import smesh
-
# ---- define a box
box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
# ---- SMESH
+smesh.SetCurrentStudy(salome.myStudy)
+
# ---- Init a Mesh with the box
mesh = smesh.Mesh(box, "Meshbox")
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_test1.py
# Module : SMESH
#
# ---- SMESH
+smesh.SetCurrentStudy(salome.myStudy)
+
# ---- Init a Mesh with the box
mesh = smesh.Mesh(box, "Meshbox")
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_test2.py
# Module : SMESH
#
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_test3.py
# Module : SMESH
#import salome
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import salome
import geompy
import smesh
# ---- SMESH
+smesh.SetCurrentStudy(salome.myStudy)
mesh = smesh.Mesh(box, "Meshbox")
# Set 1D algorithm/hypotheses to mesh
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : SMESH_test5.py
# Module : SMESH
#
import os
import os.path
+smesh.SetCurrentStudy(salome.myStudy)
+
def SetSObjName(theSObj,theName) :
ok, anAttr = theSObj.FindAttribute("AttributeName")
if ok:
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import os
import re
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : batchmode_smesh.py
# Author : Oksana TCHEBANOVA
# Module : SMESH
modulecatalog = naming_service.Resolve("/Kernel/ModulCatalog")
smesh = lcc.FindOrLoadComponent("FactoryServer", "SMESH")
+smesh.SetCurrentStudy(myStudy)
myStudyBuilder = myStudy.NewBuilder()
if myStudyBuilder is None:
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ==================================
# Load all examples
# -----------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create hexahedrical mesh on piece
# ---------------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create hexahedrical mesh on piece
# ---------------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create hexahedrical mesh on piece
# ---------------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create a hexahedral mesh
# ------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create a hexahedral mesh
# ------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create a hexahedral mesh
# ------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create a hexahedral mesh
# ------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create a hexahedral mesh
# ------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create a hexahedral mesh
# ------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create a hexahedral mesh
# ------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create a hexahedral mesh
# ------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create a hexahedral mesh
# ------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ==================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create a mesh
# -------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Maillage
# ========
+smesh.SetCurrentStudy(salome.myStudy)
+
# Creer un maillage hexahedrique
# ------------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Compound
# --------
-piece = RemoveExtraEdges(MakeCompound(cpd), 0)
+piece = RemoveExtraEdges(MakeCompound(cpd), True)
# Ajouter la piece dans l'etude
# -----------------------------
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create a hexahedral mesh
# ------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create a hexahedral mesh
# ------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Maillage
# ========
+smesh.SetCurrentStudy(salome.myStudy)
+
# Maillage hexahedrique
# ---------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
#
from geompy import *
# Maillage
# ========
+smesh.SetCurrentStudy(salome.myStudy)
+
# Maillage hexahedrique
# ---------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ==================================
#
from geompy import *
# Meshing
# =======
+smesh.SetCurrentStudy(salome.myStudy)
+
# Create a hexahedral mesh
# ------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ==================================
#
from geompy import *
# Create a mesh
# =============
+smesh.SetCurrentStudy(salome.myStudy)
+
# Define a mesh on a geometry
# ---------------------------
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# ==================================
#
import math
import geompy
import smesh
-
+import salome
geo = geompy
# Parameters
# Mesh the blocks with hexahedral
# -------------------------------
+smesh.SetCurrentStudy(salome.myStudy)
+
def discretize(x, y, z, n, s=blocks):
p = geo.MakeVertex(x, y, z)
e = geo.GetEdgeNearPoint(s, p)
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# =======================================
# Procedure that take a triangulation and split all triangles in 4 others triangles
#
# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
import sys
import salome
Face_1 = geompy.MakeFaceHW(100, 100, 1)
geompy.addToStudy( Face_1, "Face_1" )
-#smesh.smesh.SetCurrentStudy(aStudyId)
+smesh.SetCurrentStudy(salome.myStudy)
import StdMeshers
pattern = smesh.GetPattern()
Mesh_1 = smesh.Mesh(Face_1)
# -*- coding: iso-8859-1 -*-
-# CEA/LGLS 2008, Christian Van Wambeke (CEA/LGLS), Francis KLOSS (OCC)
-# ====================================================================
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# ====================================================================
+#
import os
import geompy
# Define a mesh on a geometry
# ---------------------------
+smesh.SetCurrentStudy(salome.myStudy)
+
m = smesh.Mesh(cylinder)
# 2D mesh with BLSURF
# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
import sys
import salome
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
geompy.addToStudy( Box_1, "Box_1" )
-#smesh.smesh.SetCurrentStudy(theStudy)
+smesh.SetCurrentStudy(salome.myStudy)
import StdMeshers
Mesh_1 = smesh.Mesh(Box_1)
Regular_1D = Mesh_1.Segment()
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : smesh.py
# Author : Francis KLOSS, OCC
# Module : SMESH
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : smesh.py
# Author : Francis KLOSS, OCC
# Module : SMESH
import StdMeshers
import SALOME
+import SALOMEDS
# import NETGENPlugin module if possible
noNETGENPlugin = 0
Hexotic = 9
BLSURF = 10
GHS3DPRL = 11
+QUADRANGLE = 0
+RADIAL_QUAD = 1
# MirrorType enumeration
POINT = SMESH_MeshEditor.POINT
PrecisionConfusion = 1e-07
+# TopAbs_State enumeration
+[TopAbs_IN, TopAbs_OUT, TopAbs_ON, TopAbs_UNKNOWN] = range(4)
+
+
## Converts an angle from degrees to radians
def DegreesToRadians(AngleInDegrees):
from math import pi
## Gets object name
def GetName(obj):
- ior = salome.orb.object_to_string(obj)
- sobj = salome.myStudy.FindObjectIOR(ior)
- if sobj is None:
- return NO_NAME
- else:
- attr = sobj.FindAttribute("AttributeName")[1]
- return attr.Value()
+ if obj:
+ # object not null
+ if isinstance(obj, SALOMEDS._objref_SObject):
+ # study object
+ return obj.GetName()
+ ior = salome.orb.object_to_string(obj)
+ if ior:
+ # CORBA object
+ studies = salome.myStudyManager.GetOpenStudies()
+ for sname in studies:
+ s = salome.myStudyManager.GetStudyByName(sname)
+ if not s: continue
+ sobj = s.FindObjectIOR(ior)
+ if not sobj: continue
+ return sobj.GetName()
+ if hasattr(obj, "GetName"):
+ # unknown CORBA object, having GetName() method
+ return obj.GetName()
+ else:
+ # unknown CORBA object, no GetName() method
+ return NO_NAME
+ pass
+ if hasattr(obj, "GetName"):
+ # unknown non-CORBA object, having GetName() method
+ return obj.GetName()
+ pass
+ raise RuntimeError, "Null or invalid object"
## Prints error message if a hypothesis was not assigned.
def TreatHypoStatus(status, hypName, geomName, isAlgo):
return
hypName = '"' + hypName + '"'
geomName= '"' + geomName+ '"'
- if status < HYP_UNKNOWN_FATAL:
+ if status < HYP_UNKNOWN_FATAL and not geomName =='""':
print hypName, "was assigned to", geomName,"but", reason
- else:
+ elif not geomName == '""':
print hypName, "was not assigned to",geomName,":", reason
+ else:
+ print hypName, "was not assigned:", reason
pass
## Check meshing plugin availability
if (isinstance(algo, geompyDC.GEOM._objref_GEOM_Object)):
geom = algo
algo = MEFISTO
-
return Mesh_Triangle(self, algo, geom)
## Creates a quadrangle 2D algorithm for faces.
# If the optional \a geom parameter is not set, this algorithm is global.
# \n Otherwise, this algorithm defines a submesh based on \a geom subshape.
# @param geom If defined, the subshape to be meshed (GEOM_Object)
+ # @param algo values are: smesh.QUADRANGLE || smesh.RADIAL_QUAD
# @return an instance of Mesh_Quadrangle algorithm
# @ingroup l3_algos_basic
- def Quadrangle(self, geom=0):
- return Mesh_Quadrangle(self, geom)
+ def Quadrangle(self, geom=0, algo=QUADRANGLE):
+ if algo==RADIAL_QUAD:
+ return Mesh_RadialQuadrangle1D2D(self,geom)
+ else:
+ return Mesh_Quadrangle(self, geom)
## Creates a tetrahedron 3D algorithm for solids.
# The parameter \a algo permits to choose the algorithm: NETGEN or GHS3D
print "Mesh computation failed, exception caught:"
traceback.print_exc()
if True:#not ok:
- errors = self.smeshpyD.GetAlgoState( self.mesh, geom )
allReasons = ""
+
+ # Treat compute errors
+ computeErrors = self.smeshpyD.GetComputeErrors( self.mesh, geom )
+ for err in computeErrors:
+ shapeText = ""
+ if self.mesh.HasShapeToMesh():
+ try:
+ mainIOR = salome.orb.object_to_string(geom)
+ for sname in salome.myStudyManager.GetOpenStudies():
+ s = salome.myStudyManager.GetStudyByName(sname)
+ if not s: continue
+ mainSO = s.FindObjectIOR(mainIOR)
+ if not mainSO: continue
+ subIt = s.NewChildIterator(mainSO)
+ while subIt.More():
+ subSO = subIt.Value()
+ subIt.Next()
+ obj = subSO.GetObject()
+ if not obj: continue
+ go = obj._narrow( geompyDC.GEOM._objref_GEOM_Object )
+ if not go: continue
+ ids = go.GetSubShapeIndices()
+ if len(ids) == 1 and ids[0] == err.subShapeID:
+ shapeText = ' on "%s"' % subSO.GetName()
+ break
+ if not shapeText:
+ shape = self.geompyD.GetSubShape( geom, [err.subShapeID])
+ if shape:
+ shapeText = " on %s #%s" % (shape.GetShapeType(), err.subShapeID)
+ else:
+ shapeText = " on subshape #%s" % (err.subShapeID)
+ except:
+ shapeText = " on subshape #%s" % (err.subShapeID)
+ errText = ""
+ stdErrors = ["OK", #COMPERR_OK
+ "Invalid input mesh", #COMPERR_BAD_INPUT_MESH
+ "std::exception", #COMPERR_STD_EXCEPTION
+ "OCC exception", #COMPERR_OCC_EXCEPTION
+ "SALOME exception", #COMPERR_SLM_EXCEPTION
+ "Unknown exception", #COMPERR_EXCEPTION
+ "Memory allocation problem", #COMPERR_MEMORY_PB
+ "Algorithm failed", #COMPERR_ALGO_FAILED
+ "Unexpected geometry"]#COMPERR_BAD_SHAPE
+ if err.code > 0:
+ if err.code < len(stdErrors): errText = stdErrors[err.code]
+ else:
+ errText = "code %s" % -err.code
+ if errText: errText += ". "
+ errText += err.comment
+ if allReasons != "":allReasons += "\n"
+ allReasons += '"%s" failed%s. Error: %s' %(err.algoName, shapeText, errText)
+ pass
+
+ # Treat hyp errors
+ errors = self.smeshpyD.GetAlgoState( self.mesh, geom )
for err in errors:
if err.isGlobalAlgo:
glob = "global"
reason = "For unknown reason."+\
" Revise Mesh.Compute() implementation in smeshDC.py!"
pass
- if allReasons != "":
- allReasons += "\n"
- pass
+ if allReasons != "":allReasons += "\n"
allReasons += reason
pass
if allReasons != "":
pass
return ok
+ ## Return submesh objects list in meshing order
+ # @return list of list of submesh objects
+ # @ingroup l2_construct
+ def GetMeshOrder(self):
+ return self.mesh.GetMeshOrder()
+
+ ## Return submesh objects list in meshing order
+ # @return list of list of submesh objects
+ # @ingroup l2_construct
+ def SetMeshOrder(self, submeshes):
+ return self.mesh.SetMeshOrder(submeshes)
+
## Removes all nodes and elements
# @ingroup l2_construct
def Clear(self):
pass
status = self.mesh.AddHypothesis(geom, hyp)
isAlgo = hyp._narrow( SMESH_Algo )
- TreatHypoStatus( status, GetName( hyp ), GetName( geom ), isAlgo )
+ hyp_name = GetName( hyp )
+ geom_name = ""
+ if geom:
+ geom_name = GetName( geom )
+ TreatHypoStatus( status, hyp_name, geom_name, isAlgo )
return status
## Unassigns a hypothesis
def GetElementType(self, id, iselem):
return self.mesh.GetElementType(id, iselem)
+ ## Returns the geometric type of mesh element
+ # @return the value from SMESH::EntityType enumeration
+ # @ingroup l1_meshinfo
+ def GetElementGeomType(self, id):
+ return self.mesh.GetElementGeomType(id)
+
## Returns the list of submesh elements IDs
# @param Shape a geom object(subshape) IOR
# Shape must be the subshape of a ShapeToMesh()
def ElemNbFaces(self, id):
return self.mesh.ElemNbFaces(id)
+ ## Returns nodes of given face (counted from zero) for given volumic element.
+ # @ingroup l1_meshinfo
+ def GetElemFaceNodes(self,elemId, faceIndex):
+ return self.mesh.GetElemFaceNodes(elemId, faceIndex)
+
+ ## Returns an element based on all given nodes.
+ # @ingroup l1_meshinfo
+ def FindElementByNodes(self,nodes):
+ return self.mesh.FindElementByNodes(nodes)
+
## Returns true if the given element is a polygon
# @ingroup l1_meshinfo
def IsPoly(self, id):
def FindElementsByPoint(self, x, y, z, elementType = SMESH.ALL):
return self.editor.FindElementsByPoint(x, y, z, elementType)
+ # Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
+ # TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
+
+ def GetPointState(self, x, y, z):
+ return self.editor.GetPointState(x, y, z)
## Finds the node closest to a point and moves it to a point location
# @param x the X coordinate of a point
def BestSplit (self, IDOfQuad, theCriterion):
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:
+ # 1 - split the hexahedron into 5 tetrahedrons
+ # 2 - split the hexahedron into 6 tetrahedrons
+ # @ingroup l2_modif_cutquadr
+ def SplitVolumesIntoTetra(self, elemIDs, method=1 ):
+ if isinstance( elemIDs, Mesh ):
+ elemIDs = elemIDs.GetMesh()
+ self.editor.SplitVolumesIntoTetra(elemIDs, method)
+
## Splits quadrangle faces near triangular facets of volumes
#
# @ingroup l1_auxiliary
mesh.SetParameters(Parameters)
return Mesh( self.smeshpyD, self.geompyD, mesh )
+
+
+ ## Scales the object
+ # @param theObject - the object to translate (mesh, submesh, or group)
+ # @param thePoint - base point for scale
+ # @param theScaleFact - scale factors for axises
+ # @param Copy - allows copying the translated elements
+ # @param MakeGroups - forces the generation of new groups from existing
+ # ones (if Copy)
+ # @return list of created groups (SMESH_GroupBase) if MakeGroups=True,
+ # empty list otherwise
+ def Scale(self, theObject, thePoint, theScaleFact, Copy, MakeGroups=False):
+ if ( isinstance( theObject, Mesh )):
+ theObject = theObject.GetMesh()
+ if ( isinstance( theObject, list )):
+ theObject = self.editor.MakeIDSource(theObject)
+
+ thePoint, Parameters = ParsePointStruct(thePoint)
+ self.mesh.SetParameters(Parameters)
+
+ if Copy and MakeGroups:
+ return self.editor.ScaleMakeGroups(theObject, thePoint, theScaleFact)
+ self.editor.Scale(theObject, thePoint, theScaleFact, Copy)
+ return []
+
+ ## Creates a new mesh from the translated object
+ # @param theObject - the object to translate (mesh, submesh, or group)
+ # @param thePoint - base point for scale
+ # @param theScaleFact - scale factors for axises
+ # @param MakeGroups - forces the generation of new groups from existing ones
+ # @param NewMeshName - the name of the newly created mesh
+ # @return instance of Mesh class
+ def ScaleMakeMesh(self, theObject, thePoint, theScaleFact, MakeGroups=False, NewMeshName=""):
+ if (isinstance(theObject, Mesh)):
+ theObject = theObject.GetMesh()
+ if ( isinstance( theObject, list )):
+ theObject = self.editor.MakeIDSource(theObject)
+
+ mesh = self.editor.ScaleMakeMesh(theObject, thePoint, theScaleFact,
+ MakeGroups, NewMeshName)
+ #mesh.SetParameters(Parameters)
+ return Mesh( self.smeshpyD, self.geompyD, mesh )
+
+
+
## Rotates the elements
# @param IDsOfElements list of elements ids
# @param Axis the axis of rotation (AxisStruct or geom line)
## Creates a hole in a mesh by doubling the nodes of some particular elements
# This method provided for convenience works as DoubleNodes() described above.
- # @param theNodes identifiers of node to be doubled
+ # @param theNodeId identifiers of node to be doubled
# @param theModifiedElems identifiers of elements to be updated
# @return TRUE if operation has been completed successfully, FALSE otherwise
# @ingroup l2_modif_edit
# The replicated nodes should be associated to affected elements.
# @ingroup l2_modif_edit
def DoubleNodeElemGroupInRegion(self, theElems, theNodesNot, theShape):
- return self.editor.DoubleNodeElemGroup(theElems, theNodesNot, theShape)
+ return self.editor.DoubleNodeElemGroupInRegion(theElems, theNodesNot, theShape)
## Creates a hole in a mesh by doubling the nodes of some particular elements
# This method provided for convenience works as DoubleNodes() described above.
raise RuntimeError, "Attemp to create " + algo + " algoritm on None shape"
self.mesh = mesh
piece = mesh.geom
+ name = ""
if not geom:
self.geom = piece
else:
self.geom = geom
- name = GetName(geom)
- if name==NO_NAME:
+ try:
+ name = GetName(geom)
+ pass
+ except:
name = mesh.geompyD.SubShapeName(geom, piece)
mesh.geompyD.addToStudyInFather(piece, geom, name)
+ pass
self.subm = mesh.mesh.GetSubMesh(geom, algo.GetName())
self.algo = algo
status = mesh.mesh.AddHypothesis(self.geom, self.algo)
- TreatHypoStatus( status, algo.GetName(), GetName(self.geom), True )
+ TreatHypoStatus( status, algo.GetName(), name, True )
def CompareHyp (self, hyp, args):
print "CompareHyp is not implemented for ", self.__class__.__name__, ":", hyp.GetName()
def FixedPoints1D(self, points, nbSegs=[1], reversedEdges=[], UseExisting=0):
if not isinstance(reversedEdges,list): #old version script, before adding reversedEdges
reversedEdges, UseExisting = [], reversedEdges
+ if reversedEdges and isinstance( reversedEdges[0], geompyDC.GEOM._objref_GEOM_Object ):
+ for i in range( len( reversedEdges )):
+ reversedEdges[i] = self.mesh.geompyD.GetSubShapeID(self.mesh.geom, reversedEdges[i] )
entry = self.MainShapeEntry()
hyp = self.Hypothesis("FixedPoints1D", [points, nbSegs, reversedEdges, entry],
UseExisting=UseExisting,
- CompareMethod=self.CompareArithmetic1D)
+ CompareMethod=self.CompareFixedPoints1D)
hyp.SetPoints(points)
hyp.SetNbSegments(nbSegs)
hyp.SetReversedEdges(reversedEdges)
### 0D algorithm
if self.geom is None:
raise RuntimeError, "Attemp to create SegmentAroundVertex_0D algoritm on None shape"
- name = GetName(self.geom)
- if name == NO_NAME:
+ try:
+ name = GetName(self.geom)
+ pass
+ except:
piece = self.mesh.geom
name = self.mesh.geompyD.SubShapeName(self.geom, piece)
self.mesh.geompyD.addToStudyInFather(piece, self.geom, name)
+ pass
algo = self.FindAlgorithm("SegmentAroundVertex_0D", self.mesh.smeshpyD)
if algo is None:
algo = self.mesh.smeshpyD.CreateHypothesis("SegmentAroundVertex_0D", "libStdMeshersEngine.so")
CompareMethod=self.CompareEqualHyp)
return hyp
+ ## Defines "QuadrangleParams" hypothesis
+ # @param vertex: 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
+ #
+ # @ingroup l3_hypos_additi
+ def TriangleVertex(self, vertex, UseExisting=0):
+ vertexID = vertex
+ if isinstance( vertexID, geompyDC.GEOM._objref_GEOM_Object ):
+ vertexID = self.mesh.geompyD.GetSubShapeID( self.mesh.geom, vertex )
+ hyp = self.Hypothesis("QuadrangleParams", [vertexID], UseExisting = UseExisting,
+ CompareMethod=lambda hyp,args: hyp.GetTriaVertex()==args[0])
+ hyp.SetTriaVertex( vertexID )
+ return hyp
+
+
# Public class: Mesh_Tetrahedron
# ------------------------------
self.mesh.GetMesh().RemoveHypothesis( self.geom, self.nbLayers )
self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
+ self.mesh.smeshpyD.SetCurrentStudy( None )
hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
self.distribHyp.SetLayerDistribution( hyp )
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, "RadialQuadrangle_1D2D")
- self.distribHyp = self.Hypothesis("LayerDistribution2D", UseExisting=0)
+ self.distribHyp = None #self.Hypothesis("LayerDistribution2D", UseExisting=0)
self.nbLayers = None
## Return 2D hypothesis holding the 1D one
# hypothesis. Returns the created hypothesis
def OwnHypothesis(self, hypType, args=[], so="libStdMeshersEngine.so"):
#print "OwnHypothesis",hypType
- if not self.nbLayers is None:
+ if self.nbLayers:
self.mesh.GetMesh().RemoveHypothesis( self.geom, self.nbLayers )
+ if self.distribHyp is None:
+ self.distribHyp = self.Hypothesis("LayerDistribution2D", UseExisting=0)
+ else:
self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
+ self.mesh.smeshpyD.SetCurrentStudy( None )
hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
self.distribHyp.SetLayerDistribution( hyp )
return hyp
- ## Defines "NumberOfLayers2D" hypothesis, specifying the number of layers
+ ## Defines "NumberOfLayers" hypothesis, specifying the number of layers
# @param n number of layers
# @param UseExisting if ==true - searches for the existing hypothesis created with
# the same parameters, else (default) - creates a new one
- def NumberOfLayers2D(self, n, UseExisting=0):
- self.mesh.GetMesh().RemoveHypothesis( self.geom, self.distribHyp )
+ def NumberOfLayers(self, n, UseExisting=0):
+ if self.distribHyp:
+ self.mesh.GetMesh().RemoveHypothesis( self.geom, self.distribHyp )
self.nbLayers = self.Hypothesis("NumberOfLayers2D", [n], UseExisting=UseExisting,
CompareMethod=self.CompareNumberOfLayers)
self.nbLayers.SetNumberOfLayers( n )
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH SMESHGUI : GUI for SMESH component
# File : Makefile.am
# Author : Alexander BORODIN, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : GUI for SMESH component
// File : libSMESH_Swig.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
inline
SALOMEDS::SObject_var
GetDomainRoot(const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder,
- CORBA::Long theDomainRootTag,
- const QString& theName,
- const QString& thePixmap)
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder,
+ CORBA::Long theDomainRootTag,
+ const QString& theName,
+ const QString& thePixmap)
{
SALOMEDS::SObject_var aDomainRoot;
if (!theSComponentMesh->FindSubObject(theDomainRootTag,aDomainRoot)) {
inline
SALOMEDS::SObject_var
GetHypothesisRoot(const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
return GetDomainRoot(theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_HypothesisRoot,
- QObject::tr("SMESH_MEN_HYPOTHESIS"),
- "ICON_SMESH_TREE_HYPO");
+ theStudyBuilder,
+ SMESH::Tag_HypothesisRoot,
+ QObject::tr("SMESH_MEN_HYPOTHESIS"),
+ "ICON_SMESH_TREE_HYPO");
}
inline
SALOMEDS::SObject_var
GetAlgorithmsRoot(const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
return GetDomainRoot(theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_AlgorithmsRoot,
- QObject::tr("SMESH_MEN_ALGORITHMS"),
- "ICON_SMESH_TREE_ALGO");
+ theStudyBuilder,
+ SMESH::Tag_AlgorithmsRoot,
+ QObject::tr("SMESH_MEN_ALGORITHMS"),
+ "ICON_SMESH_TREE_ALGO");
}
inline
SALOMEDS::SObject_var
AddToDomain(const std::string& theIOR,
- const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder,
- CORBA::Long theDomainRootTag,
- const QString& theDomainName,
- const QString& theDomainPixmap)
+ const SALOMEDS::SComponent_var& theSComponentMesh,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder,
+ CORBA::Long theDomainRootTag,
+ const QString& theDomainName,
+ const QString& theDomainPixmap)
{
SALOMEDS::SObject_var aDomain = GetDomainRoot(theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_AlgorithmsRoot,
- theDomainName,
- theDomainPixmap);
+ theStudyBuilder,
+ SMESH::Tag_AlgorithmsRoot,
+ theDomainName,
+ theDomainPixmap);
// Add New Hypothesis
SALOMEDS::SObject_var aSObject = theStudyBuilder->NewObject(aDomain);
SALOMEDS::GenericAttribute_var anAttr = theStudyBuilder->FindOrCreateAttribute(aSObject,"AttributePixMap");
//---------------------------------------------------------------
SALOMEDS::SObject_var
AddHypothesis(const std::string& theIOR,
- const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ const SALOMEDS::SComponent_var& theSComponentMesh,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
return AddToDomain(theIOR,
- theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_HypothesisRoot,
- QObject::tr("SMESH_MEN_HYPOTHESIS"),
- "ICON_SMESH_TREE_HYPO");
+ theSComponentMesh,
+ theStudyBuilder,
+ SMESH::Tag_HypothesisRoot,
+ QObject::tr("SMESH_MEN_HYPOTHESIS"),
+ "ICON_SMESH_TREE_HYPO");
}
//---------------------------------------------------------------
SALOMEDS::SObject_var
AddAlgorithms(const std::string& theIOR,
- const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ const SALOMEDS::SComponent_var& theSComponentMesh,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
return AddToDomain(theIOR,
- theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_AlgorithmsRoot,
- QObject::tr("SMESH_MEN_ALGORITHMS"),
- "ICON_SMESH_TREE_ALGO");
+ theSComponentMesh,
+ theStudyBuilder,
+ SMESH::Tag_AlgorithmsRoot,
+ QObject::tr("SMESH_MEN_ALGORITHMS"),
+ "ICON_SMESH_TREE_ALGO");
}
//---------------------------------------------------------------
void
SetDomain(const char* theMeshOrSubMeshEntry,
- const char* theDomainEntry,
- const SALOMEDS::Study_var& theStudy,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder,
- long theRefOnAppliedDomainTag,
- const QString& theAppliedDomainMEN,
- const QString& theAppliedDomainICON)
+ const char* theDomainEntry,
+ const SALOMEDS::Study_var& theStudy,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder,
+ long theRefOnAppliedDomainTag,
+ const QString& theAppliedDomainMEN,
+ const QString& theAppliedDomainICON)
{
SALOMEDS::SObject_var aMeshOrSubMeshSO = theStudy->FindObjectID(theMeshOrSubMeshEntry);
SALOMEDS::SObject_var aHypothesisSO = theStudy->FindObjectID(theDomainEntry);
//Find or Create Applied Hypothesis root
SALOMEDS::SObject_var anAppliedDomainSO;
if(!aMeshOrSubMeshSO->FindSubObject(theRefOnAppliedDomainTag,anAppliedDomainSO)){
- anAppliedDomainSO = theStudyBuilder->NewObjectToTag(aMeshOrSubMeshSO,theRefOnAppliedDomainTag);
- SALOMEDS::GenericAttribute_var anAttr =
- theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeName");
- SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(theAppliedDomainMEN.toLatin1().data());
- anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeSelectable");
- SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr);
- aSelAttr->SetSelectable(false);
- anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributePixMap");
- SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
- aPixmap->SetPixMap(theAppliedDomainICON.toLatin1().data());
+ anAppliedDomainSO = theStudyBuilder->NewObjectToTag(aMeshOrSubMeshSO,theRefOnAppliedDomainTag);
+ SALOMEDS::GenericAttribute_var anAttr =
+ theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeName");
+ SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
+ aName->SetValue(theAppliedDomainMEN.toLatin1().data());
+ anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeSelectable");
+ SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr);
+ aSelAttr->SetSelectable(false);
+ anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributePixMap");
+ SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+ aPixmap->SetPixMap(theAppliedDomainICON.toLatin1().data());
}
SALOMEDS::SObject_var aSObject = theStudyBuilder->NewObject(anAppliedDomainSO);
theStudyBuilder->Addreference(aSObject,aHypothesisSO);
//---------------------------------------------------------------
void
SetHypothesis(const char* theMeshOrSubMeshEntry,
- const char* theDomainEntry,
- const SALOMEDS::Study_var& theStudy,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ const char* theDomainEntry,
+ const SALOMEDS::Study_var& theStudy,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
SetDomain(theMeshOrSubMeshEntry,
- theDomainEntry,
- theStudy,
- theStudyBuilder,
- SMESH::Tag_RefOnAppliedHypothesis,
- QObject::tr("SMESH_MEN_APPLIED_HYPOTHESIS"),
- "ICON_SMESH_TREE_HYPO");
+ theDomainEntry,
+ theStudy,
+ theStudyBuilder,
+ SMESH::Tag_RefOnAppliedHypothesis,
+ QObject::tr("SMESH_MEN_APPLIED_HYPOTHESIS"),
+ "ICON_SMESH_TREE_HYPO");
}
//---------------------------------------------------------------
void
SetAlgorithms(const char* theMeshOrSubMeshEntry,
- const char* theDomainEntry,
- const SALOMEDS::Study_var& theStudy,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ const char* theDomainEntry,
+ const SALOMEDS::Study_var& theStudy,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
SetDomain(theMeshOrSubMeshEntry,
- theDomainEntry,
- theStudy,
- theStudyBuilder,
- SMESH::Tag_RefOnAppliedAlgorithms,
- QObject::tr("SMESH_MEN_APPLIED_ALGORIHTMS"),
- "ICON_SMESH_TREE_ALGO");
+ theDomainEntry,
+ theStudy,
+ theStudyBuilder,
+ SMESH::Tag_RefOnAppliedAlgorithms,
+ QObject::tr("SMESH_MEN_APPLIED_ALGORIHTMS"),
+ "ICON_SMESH_TREE_ALGO");
}
}
Execute()
{
try {
- ORB_INIT &anORBInit = *SINGLETON_<ORB_INIT>::Instance();
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- myORB = anORBInit( 0, 0 );
+ ORB_INIT &anORBInit = *SINGLETON_<ORB_INIT>::Instance();
+ ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
+ myORB = anORBInit( 0, 0 );
} catch (...) {
- INFOS("internal error : orb not found");
+ INFOS("internal error : orb not found");
}
}
};
SALOMEDS::SComponent_var& mySComponentMesh;
public:
TEvent(int theStudyID,
- SALOMEDS::Study_var& theStudy,
- SALOMEDS::StudyBuilder_var& theStudyBuilder,
- SALOMEDS::SComponent_var& theSComponentMesh):
+ SALOMEDS::Study_var& theStudy,
+ SALOMEDS::StudyBuilder_var& theStudyBuilder,
+ SALOMEDS::SComponent_var& theSComponentMesh):
myStudyID(theStudyID),
myStudy(theStudy),
myStudyBuilder(theStudyBuilder),
SALOMEDS::SComponent_var aSComponent = myStudy->FindComponent("SMESH");
if(aSComponent->_is_nil()){
- bool aLocked = myStudy->GetProperties()->IsLocked();
- if (aLocked)
- myStudy->GetProperties()->SetLocked(false);
-
- aSComponent = myStudyBuilder->NewComponent("SMESH");
- anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributeName");
- aName = SALOMEDS::AttributeName::_narrow(anAttr);
-
- SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI(); //SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded
- if (!aSMESHGUI){
- CAM_Module* aModule = anApp->module("Mesh");
- if(!aModule)
- aModule = anApp->loadModule("Mesh");
- aSMESHGUI = dynamic_cast<SMESHGUI*>(aModule);
- } //SRN: BugID IPAL9186: end of a fix
- aName->SetValue(aSMESHGUI->moduleName().toLatin1().data());
- anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributePixMap");
- aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
- aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
- myStudyBuilder->DefineComponentInstance(aSComponent,aSMESHGen);
- if (aLocked)
- myStudy->GetProperties()->SetLocked(true);
+ bool aLocked = myStudy->GetProperties()->IsLocked();
+ if (aLocked)
+ myStudy->GetProperties()->SetLocked(false);
+
+ aSComponent = myStudyBuilder->NewComponent("SMESH");
+ anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributeName");
+ aName = SALOMEDS::AttributeName::_narrow(anAttr);
+
+ SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI(); //SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded
+ if (!aSMESHGUI){
+ CAM_Module* aModule = anApp->module("Mesh");
+ if(!aModule)
+ aModule = anApp->loadModule("Mesh");
+ aSMESHGUI = dynamic_cast<SMESHGUI*>(aModule);
+ } //SRN: BugID IPAL9186: end of a fix
+ aName->SetValue(aSMESHGUI->moduleName().toLatin1().data());
+ anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributePixMap");
+ aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+ aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
+ myStudyBuilder->DefineComponentInstance(aSComponent,aSMESHGen);
+ if (aLocked)
+ myStudy->GetProperties()->SetLocked(true);
}
mySComponentMesh = SALOMEDS::SComponent::_narrow(aSComponent);
MESSAGE("Init");
ProcessVoidEvent(new TEvent(theStudyID,
- myStudy,
- myStudyBuilder,
- mySComponentMesh));
+ myStudy,
+ myStudyBuilder,
+ mySComponentMesh));
}
MESSAGE("AddNewHypothesis");
SALOMEDS::SObject_var aSObject = ::AddHypothesis(theIOR,
- mySComponentMesh,
- myStudyBuilder);
+ mySComponentMesh,
+ myStudyBuilder);
CORBA::String_var anEntry = aSObject->GetID();
return anEntry._retn();
}
MESSAGE("AddNewAlgorithms");
SALOMEDS::SObject_var aSObject = ::AddAlgorithms(theIOR,
- mySComponentMesh,
- myStudyBuilder);
+ mySComponentMesh,
+ myStudyBuilder);
CORBA::String_var anEntry = aSObject->GetID();
return anEntry._retn();
}
const char* theDomainEntry)
{
::SetHypothesis(theMeshOrSubMeshEntry,
- theDomainEntry,
- myStudy,
- myStudyBuilder);
+ theDomainEntry,
+ myStudy,
+ myStudyBuilder);
}
const char* theDomainEntry)
{
::SetAlgorithms(theMeshOrSubMeshEntry,
- theDomainEntry,
- myStudy,
- myStudyBuilder);
+ theDomainEntry,
+ myStudy,
+ myStudyBuilder);
}
//================================================================================
void SMESH_Swig::SetMeshIcon(const char* theMeshEntry,
- const bool theIsComputed,
+ const bool theIsComputed,
const bool isEmpty)
{
class TEvent: public SALOME_Event
bool myIsComputed, myIsEmpty;
public:
TEvent(const SALOMEDS::Study_var& theStudy,
- const std::string& theMeshEntry,
- const bool theIsComputed,
+ const std::string& theMeshEntry,
+ const bool theIsComputed,
const bool isEmpty):
myStudy(theStudy),
myMeshEntry(theMeshEntry),
{
SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(myMeshEntry.c_str());
if(!aMeshSO->_is_nil())
- if(_PTR(SObject) aMesh = ClientFactory::SObject(aMeshSO))
- SMESH::ModifiedMesh(aMesh,myIsComputed,myIsEmpty);
+ if(_PTR(SObject) aMesh = ClientFactory::SObject(aMeshSO))
+ SMESH::ModifiedMesh(aMesh,myIsComputed,myIsEmpty);
}
};
ProcessVoidEvent(new TEvent(myStudy,
- theMeshEntry,
- theIsComputed,
+ theMeshEntry,
+ theIsComputed,
isEmpty));
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : GUI for SMESH component
// File : libSMESH_Swig.h
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : libSMESH_Swig.i
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH StdMeshers : implementaion of SMESH idl descriptions
# File : Makefile.in
# Author : Julia DOROVSKIKH
StdMeshers_CompositeHexa_3D.hxx \
StdMeshers_MaxLength.hxx \
StdMeshers_QuadrangleParams.hxx \
- StdMeshers_RadialQuadrangle_1D2D.hxx
+ StdMeshers_RadialQuadrangle_1D2D.hxx \
+ StdMeshers_HexaFromSkin_3D.hxx
# Libraries targets
StdMeshers_CompositeHexa_3D.cxx \
StdMeshers_MaxLength.cxx \
StdMeshers_QuadrangleParams.cxx \
- StdMeshers_RadialQuadrangle_1D2D.cxx
+ StdMeshers_RadialQuadrangle_1D2D.cxx \
+ StdMeshers_HexaFromSkin_3D.cxx
# additionnal information to compil and link file
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_StdMeshers.hxx
// Author : Alexander BORODIN
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Arithmetic1D.cxx
// Author : Damien COQUERET, OCC
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Arithmetic1D.hxx
// Author : Damien COQUERET, OCC
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_AutomaticLength.cxx
// Author : Edward AGAPOV, OCC
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_AutomaticLength.hxx
// Author : Edward AGAPOV, OCC
// Module : SMESH
-
+//
#ifndef _SMESH_AutomaticLength_HXX_
#define _SMESH_AutomaticLength_HXX_
-// SMESH SMESH : implementaion of SMESH idl descriptions
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
+// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_CompositeHexa_3D.cxx
// Module : SMESH
// Created : Tue Nov 25 11:04:59 2008
// Author : Edward AGAPOV (eap)
-
+//
#include "StdMeshers_CompositeHexa_3D.hxx"
#include "SMDS_Mesh.hxx"
-// SMESH SMESH : implementaion of SMESH idl descriptions
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// 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_CompositeBlock_3D.hxx
// Module : SMESH
-
+//
#ifndef _SMESH_CompositeSegment_1D_HXX_
#define _SMESH_CompositeSegment_1D_HXX_
//virtual ~StdMeshers_CompositeHexa_3D();
virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
+ const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Regular_1D.cxx
// Moved here from SMESH_Regular_1D.cxx
*/
//================================================================================
- TopoDS_Edge nextC1Edge(const TopoDS_Edge& edge,
- SMESH_Mesh & aMesh,
- const bool forward)
+ TopoDS_Edge nextC1Edge(TopoDS_Edge edge,
+ SMESH_Mesh & aMesh,
+ const bool forward)
{
+ if (edge.Orientation() > TopAbs_REVERSED) // INTERNAL
+ edge.Orientation( TopAbs_FORWARD );
TopoDS_Edge eNext;
TopTools_MapOfShape edgeCounter;
edgeCounter.Add( edge );
- TopoDS_Vertex v;
- v = forward ? TopExp::LastVertex( edge,1 ) : TopExp::FirstVertex( edge,1 );
+ TopoDS_Vertex v = forward ? TopExp::LastVertex(edge,true) : TopExp::FirstVertex(edge,true);
TopTools_ListIteratorOfListOfShape ancestIt = aMesh.GetAncestors( v );
for ( ; ancestIt.More(); ancestIt.Next() )
{
if ( edgeCounter.Extent() < 3 && !eNext.IsNull() ) {
if ( SMESH_Algo::IsContinuous( edge, eNext )) {
// care of orientation
- bool reverse;
- if ( forward )
- reverse = ( !v.IsSame( TopExp::FirstVertex( eNext, true )));
- else
- reverse = ( !v.IsSame( TopExp::LastVertex( eNext, true )));
+ if (eNext.Orientation() > TopAbs_REVERSED) // INTERNAL
+ eNext.Orientation( TopAbs_FORWARD );
+ TopoDS_Vertex vn =
+ forward ? TopExp::FirstVertex(eNext,true) : TopExp::LastVertex(eNext,true);
+ bool reverse = (!v.IsSame(vn));
if ( reverse )
eNext.Reverse();
return eNext;
const bool ignoreMeshed)
{
list< TopoDS_Edge > edges;
- edges.push_back( anEdge );
+ if ( anEdge.Orientation() <= TopAbs_REVERSED )
+ edges.push_back( anEdge );
+ else
+ edges.push_back( TopoDS::Edge( anEdge.Oriented( TopAbs_FORWARD ))); // PAL21718
list <const SMESHDS_Hypothesis *> hypList;
SMESH_Algo* theAlgo = aMesh.GetGen()->GetAlgo( aMesh, anEdge );
if ( theAlgo ) hypList = theAlgo->GetUsedHypothesis(aMesh, anEdge, false);
for ( int forward = 0; forward < 2; ++forward )
{
- TopoDS_Edge eNext = nextC1Edge( anEdge, aMesh, forward );
+ TopoDS_Edge eNext = nextC1Edge( edges.back(), aMesh, forward );
while ( !eNext.IsNull() ) {
if ( ignoreMeshed ) {
// eNext must not have computed mesh
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_CompositeSegment_1D.hxx
// Module : SMESH
virtual ~StdMeshers_CompositeSegment_1D();
virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
+ const TopoDS_Shape& aShape);
/*!
* \brief Sets event listener to submeshes if necessary
* \param subMesh - submesh where algo is set
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers_Deflection1D : implementaion of SMESH idl descriptions
// File : StdMeshers_Deflection1D.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers : implementaion of SMESH idl descriptions
// File : StdMeshers_Deflection1D.hxx
// Module : SMESH
//
-
#ifndef _StdMeshers_Deflection1D_HXX_
#define _StdMeshers_Deflection1D_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers : implementaion of point distribution algorithm
// File : StdMeshers_Distribution.cxx
// Author : Alexandre SOLOVYOV
}
bool buildDistribution( const TCollection_AsciiString& f, const int conv, const double start, const double end,
- const int nbSeg, vector<double>& data, const double eps )
+ const int nbSeg, vector<double>& data, const double eps )
{
FunctionExpr F( f.ToCString(), conv );
return buildDistribution( F, start, end, nbSeg, data, eps );
}
bool buildDistribution( const std::vector<double>& f, const int conv, const double start, const double end,
- const int nbSeg, vector<double>& data, const double eps )
+ const int nbSeg, vector<double>& data, const double eps )
{
FunctionTable F( f, conv );
return buildDistribution( F, start, end, nbSeg, data, eps );
}
bool buildDistribution( const Function& func, const double start, const double end, const int nbSeg,
- vector<double>& data, const double eps )
+ vector<double>& data, const double eps )
{
if( nbSeg<=0 )
return false;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers : implementaion of point distribution algorithm
// File : StdMeshers_Distribution.hxx
// Author : Alexandre SOLOVYOV
STDMESHERS_EXPORT
bool buildDistribution( const Function& f,
- const double start, const double end,
- const int nbSeg,
- std::vector<double>& data,
- const double eps );
+ const double start, const double end,
+ const int nbSeg,
+ std::vector<double>& data,
+ const double eps );
STDMESHERS_EXPORT
bool buildDistribution( const TCollection_AsciiString& f, const int conv, const double start, const double end,
- const int nbSeg, std::vector<double>& data, const double eps );
+ const int nbSeg, std::vector<double>& data, const double eps );
STDMESHERS_EXPORT
bool buildDistribution( const std::vector<double>& f, const int conv, const double start, const double end,
- const int nbSeg, std::vector<double>& data, const double eps );
+ const int nbSeg, std::vector<double>& data, const double eps );
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_FaceSide.hxx
// Created : Wed Jan 31 18:41:25 2007
#include "SMDS_MeshNode.hxx"
#include "SMESHDS_Mesh.hxx"
#include "SMESHDS_SubMesh.hxx"
-//#include "SMESH_Algo.hxx"
+#include "SMESH_Algo.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_ComputeError.hxx"
#include <BRep_Tool.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
+#include <GCPnts_AbscissaPoint.hxx>
+#include <Geom2dAdaptor_Curve.hxx>
+
#include <map>
#include "utilities.h"
int nbEdges = theEdges.size();
myEdge.resize( nbEdges );
myC2d.resize( nbEdges );
+ myC3dAdaptor.resize( nbEdges );
myFirst.resize( nbEdges );
myLast.resize( nbEdges );
myNormPar.resize( nbEdges );
+ myEdgeLength.resize( nbEdges );
+ myIsUniform.resize( nbEdges, true );
myLength = 0;
myNbPonits = myNbSegments = 0;
myMesh = theMesh;
if ( nbEdges == 0 ) return;
SMESHDS_Mesh* meshDS = theMesh->GetMeshDS();
- vector<double> len( nbEdges );
int nbDegen = 0;
list<TopoDS_Edge>::iterator edge = theEdges.begin();
+ TopoDS_Iterator vExp;
for ( int index = 0; edge != theEdges.end(); ++index, ++edge )
{
int i = theIsForward ? index : nbEdges - index - 1;
- len[i] = SMESH_Algo::EdgeLength( *edge );
- if ( len[i] < DBL_MIN ) nbDegen++;
- myLength += len[i];
+ myEdgeLength[i] = SMESH_Algo::EdgeLength( *edge );
+ if ( myEdgeLength[i] < DBL_MIN ) nbDegen++;
+ myLength += myEdgeLength[i];
myEdge[i] = *edge;
if ( !theIsForward ) myEdge[i].Reverse();
myNbPonits += nbN;
myNbSegments += sm->NbElements();
}
- if ( SMESH_Algo::VertexNode( TopExp::FirstVertex( *edge, 1), meshDS ))
+ // TopExp::FirstVertex() and TopExp::LastVertex() return NULL from INTERNAL edge
+ vExp.Initialize( *edge );
+ if ( vExp.Value().Orientation() == TopAbs_REVERSED ) vExp.Next();
+ if ( SMESH_Algo::VertexNode( TopoDS::Vertex( vExp.Value()), meshDS ))
myNbPonits += 1; // for the first end
else
myMissingVertexNodes = true;
- }
- if ( SMESH_Algo::VertexNode( TopExp::LastVertex( theEdges.back(), 1), meshDS ))
- myNbPonits++; // for the last end
- else
- myMissingVertexNodes = true;
+ // check if edge has non-uniform parametrization (issue 0020705)
+ if ( !myC2d[i].IsNull() && myEdgeLength[i] > DBL_MIN)
+ {
+ Geom2dAdaptor_Curve A2dC( myC2d[i] );
+ double p2 = myFirst[i]+(myLast[i]-myFirst[i])/2., p4 = myFirst[i]+(myLast[i]-myFirst[i])/4.;
+ double d2 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p2 );
+ double d4 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p4 );
+ //cout<<"len = "<<len<<" d2 = "<<d2<<" fabs(2*d2/len-1.0) = "<<fabs(2*d2/len-1.0)<<endl;
+ myIsUniform[i] = !( fabs(2*d2/myEdgeLength[i]-1.0) > 0.01 || fabs(2*d4/d2-1.0) > 0.01 );
+ if ( !myIsUniform[i] )
+ {
+ double fp,lp;
+ TopLoc_Location L;
+ Handle(Geom_Curve) C3d = BRep_Tool::Curve(myEdge[i],L,fp,lp);
+ myC3dAdaptor[i].Load( C3d, fp,lp );
+ }
+ }
+ }
+ vExp.Initialize( theEdges.back() );
+ if ( vExp.Value().Orientation() != TopAbs_REVERSED ) vExp.Next();
+ if ( vExp.More() )
+ {
+ if ( SMESH_Algo::VertexNode( TopoDS::Vertex( vExp.Value()), meshDS ))
+ myNbPonits++; // for the last end
+ else
+ myMissingVertexNodes = true;
+ }
if ( nbEdges > 1 && myLength > DBL_MIN ) {
const double degenNormLen = 1.e-5;
double totLength = myLength;
totLength += myLength * degenNormLen * nbDegen;
double prevNormPar = 0;
for ( int i = 0; i < nbEdges; ++i ) {
- if ( len[ i ] < DBL_MIN )
- len[ i ] = myLength * degenNormLen;
- myNormPar[ i ] = prevNormPar + len[i]/totLength;
+ if ( myEdgeLength[ i ] < DBL_MIN )
+ myEdgeLength[ i ] = myLength * degenNormLen;
+ myNormPar[ i ] = prevNormPar + myEdgeLength[i]/totLength;
prevNormPar = myNormPar[ i ];
}
}
if ( NbEdges() == 0 ) return myPoints;
SMESHDS_Mesh* meshDS = myMesh->GetMeshDS();
+ SMESH_MesherHelper helper(*myMesh);
+ bool paramOK;
// sort nodes of all edges putting them into a map
map< double, const SMDS_MeshNode*> u2node;
//int nbOnDegen = 0;
- for ( int i = 0; i < myEdge.size(); ++i ) {
- // put 1st vertex node
- TopoDS_Vertex VFirst, VLast;
- TopExp::Vertices( myEdge[i], VFirst, VLast, true);
- const SMDS_MeshNode* node = SMESH_Algo::VertexNode( VFirst, meshDS );
+ for ( int i = 0; i < myEdge.size(); ++i )
+ {
+ // Put 1st vertex node of a current edge
+ TopoDS_Vertex VV[2]; // TopExp::FirstVertex() returns NULL for INTERNAL edge
+ for ( TopoDS_Iterator vIt(myEdge[i]); vIt.More(); vIt.Next() )
+ VV[ VV[0].IsNull() ? 0 : 1 ] = TopoDS::Vertex(vIt.Value());
+ if ( VV[0].Orientation() == TopAbs_REVERSED ) std::swap ( VV[0], VV[1] );
+ const SMDS_MeshNode* node = SMESH_Algo::VertexNode( VV[0], meshDS );
double prevNormPar = ( i == 0 ? 0 : myNormPar[ i-1 ]); // normalized param
if ( node ) { // internal nodes may be missing
u2node.insert( make_pair( prevNormPar, node ));
return myPoints;
}
- // put 2nd vertex node for a last edge
+ // Put internal nodes
+ SMESHDS_SubMesh* sm = meshDS->MeshElements( myEdge[i] );
+ if ( !sm ) continue;
+ vector< pair< double, const SMDS_MeshNode*> > u2nodeVec;
+ u2nodeVec.reserve( sm->NbNodes() );
+ SMDS_NodeIteratorPtr nItr = sm->GetNodes();
+ double paramSize = myLast[i] - myFirst[i];
+ double r = myNormPar[i] - prevNormPar;
+ if ( !myIsUniform[i] )
+ while ( nItr->more() )
+ {
+ const SMDS_MeshNode* node = nItr->next();
+ if ( myIgnoreMediumNodes && SMESH_MeshEditor::IsMedium( node, SMDSAbs_Edge ))
+ continue;
+ double u = helper.GetNodeU( myEdge[i], node, 0, ¶mOK );
+ double aLenU = GCPnts_AbscissaPoint::Length
+ ( const_cast<GeomAdaptor_Curve&>( myC3dAdaptor[i]), myFirst[i], u );
+ if ( myEdgeLength[i] < aLenU ) // nonregression test "3D_mesh_NETGEN/G6"
+ {
+ u2nodeVec.clear();
+ break;
+ }
+ double normPar = prevNormPar + r*aLenU/myEdgeLength[i];
+ u2nodeVec.push_back( make_pair( normPar, node ));
+ }
+ nItr = sm->GetNodes();
+ if ( u2nodeVec.empty() )
+ while ( nItr->more() )
+ {
+ const SMDS_MeshNode* node = nItr->next();
+ if ( myIgnoreMediumNodes && SMESH_MeshEditor::IsMedium( node, SMDSAbs_Edge ))
+ continue;
+ double u = helper.GetNodeU( myEdge[i], node, 0, ¶mOK );
+
+ // paramSize is signed so orientation is taken into account
+ double normPar = prevNormPar + r * ( u - myFirst[i] ) / paramSize;
+ u2nodeVec.push_back( make_pair( normPar, node ));
+ }
+ u2node.insert( u2nodeVec.begin(), u2nodeVec.end() );
+
+ // Put 2nd vertex node for a last edge
if ( i+1 == myEdge.size() ) {
- node = SMESH_Algo::VertexNode( VLast, meshDS );
+ node = SMESH_Algo::VertexNode( VV[1], meshDS );
if ( !node ) {
MESSAGE(" NO NODE on VERTEX" );
return myPoints;
}
u2node.insert( make_pair( 1., node ));
}
-
- // put internal nodes
- SMESHDS_SubMesh* sm = meshDS->MeshElements( myEdge[i] );
- if ( !sm ) continue;
- SMDS_NodeIteratorPtr nItr = sm->GetNodes();
- double paramSize = myLast[i] - myFirst[i], r = myNormPar[i] - prevNormPar;
- while ( nItr->more() ) {
- const SMDS_MeshNode* node = nItr->next();
- if ( myIgnoreMediumNodes && SMESH_MeshEditor::IsMedium( node, SMDSAbs_Edge ))
- continue;
- const SMDS_EdgePosition* epos =
- static_cast<const SMDS_EdgePosition*>(node->GetPosition());
- double u = epos->GetUParameter();
- // paramSize is signed so orientation is taken into account
- double normPar = prevNormPar + r * ( u - myFirst[i] ) / paramSize;
-#ifdef _DEBUG_
- if ( normPar > 1 || normPar < 0) {
- dump("DEBUG");
- MESSAGE ( "WRONG normPar: "<<normPar<< " prevNormPar="<<prevNormPar
- << " u="<<u << " myFirst[i]="<<myFirst[i]<< " myLast[i]="<<myLast[i]
- << " paramSize="<<paramSize );
- }
-#endif
- u2node.insert( make_pair( normPar, node ));
- }
}
if ( u2node.size() != myNbPonits ) {
MESSAGE("Wrong node parameters on edges, u2node.size():"
if ( nbEdges > 1 ) {
reverse( myEdge );
reverse( myC2d );
+ reverse( myC3dAdaptor );
reverse( myFirst );
reverse( myLast );
reverse( myNormPar );
+ reverse( myEdgeLength );
+ reverse( myIsUniform );
}
myNormPar[nbEdges-1]=1.;
myPoints.clear();
return new BRepAdaptor_CompCurve( aWire );
}
+
//================================================================================
/*!
* \brief Return 2D point by normalized parameter
int i = EdgeIndex( U );
double prevU = i ? myNormPar[ i-1 ] : 0;
double r = ( U - prevU )/ ( myNormPar[ i ] - prevU );
- return myC2d[ i ]->Value( myFirst[i] * ( 1 - r ) + myLast[i] * r );
+
+ double par = myFirst[i] * ( 1 - r ) + myLast[i] * r;
+
+ // check parametrization of curve
+ if( !myIsUniform[i] )
+ {
+ double aLen3dU = r * myEdgeLength[i] * ( myFirst[i]>myLast[i] ? -1. : 1.);
+ GCPnts_AbscissaPoint AbPnt
+ ( const_cast<GeomAdaptor_Curve&>( myC3dAdaptor[i]), aLen3dU, myFirst[i] );
+ if( AbPnt.IsDone() ) {
+ par = AbPnt.Parameter();
+ }
+ }
+ return myC2d[ i ]->Value(par);
+
}
- //return gp_Pnt2d( 1e+100, 1e+100 );
return myDefaultPnt2d;
}
for ( int iW = 0; iW < nbWires; ++iW )
{
std::advance( to, *nbE++ );
+ if ( *nbE == 0 ) // Issue 0020676
+ {
+ --nbWires;
+ --iW;
+ wires.resize( nbWires );
+ continue;
+ }
list< TopoDS_Edge > wireEdges( from, to );
// assure that there is a node on the first vertex
// as StdMeshers_FaceSide::GetUVPtStruct() requires
- while ( !SMESH_Algo::VertexNode( TopExp::FirstVertex( wireEdges.front(), true),
- theMesh.GetMeshDS()))
- {
- wireEdges.splice(wireEdges.end(), wireEdges,
- wireEdges.begin(), ++wireEdges.begin());
- if ( from->IsSame( wireEdges.front() )) {
- theError = TError
- ( new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH,"No nodes on vertices"));
- return TSideVector(0);
+ if ( wireEdges.front().Orientation() != TopAbs_INTERNAL ) // Issue 0020676
+ while ( !SMESH_Algo::VertexNode( TopExp::FirstVertex( wireEdges.front(), true),
+ theMesh.GetMeshDS()))
+ {
+ wireEdges.splice(wireEdges.end(), wireEdges,
+ wireEdges.begin(), ++wireEdges.begin());
+ if ( from->IsSame( wireEdges.front() )) {
+ theError = TError
+ ( new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH,"No nodes on vertices"));
+ return TSideVector(0);
+ }
}
- }
const bool isForward = true;
StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, wireEdges, &theMesh,
isForward, theIgnoreMediumNodes);
return wires;
}
+//================================================================================
+/*!
+ * \brief Return 1st vertex of the i-the edge
+ */
+//================================================================================
+
+TopoDS_Vertex StdMeshers_FaceSide::FirstVertex(int i) const
+{
+ TopoDS_Vertex v;
+ if ( i < NbEdges() )
+ {
+ v = myEdge[i].Orientation() <= TopAbs_REVERSED ? // FORWARD || REVERSED
+ TopExp::FirstVertex( myEdge[i], 1 ) :
+ TopoDS::Vertex( TopoDS_Iterator( myEdge[i] ).Value() );
+ }
+ return v;
+}
+
+//================================================================================
+/*!
+ * \brief Return last vertex of the i-the edge
+ */
+//================================================================================
+
+TopoDS_Vertex StdMeshers_FaceSide::LastVertex(int i) const
+{
+ TopoDS_Vertex v;
+ if ( i < NbEdges() )
+ {
+ const TopoDS_Edge& edge = i<0 ? myEdge[ NbEdges() + i ] : myEdge[i];
+ if ( edge.Orientation() <= TopAbs_REVERSED ) // FORWARD || REVERSED
+ v = TopExp::LastVertex( edge, 1 );
+ else
+ for ( TopoDS_Iterator vIt( edge ); vIt.More(); vIt.Next() )
+ v = TopoDS::Vertex( vIt.Value() );
+ }
+ return v;
+}
+
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_FaceSide.hxx
// Created : Wed Jan 31 18:41:25 2007
#ifndef StdMeshers_FaceSide_HeaderFile
#define StdMeshers_FaceSide_HeaderFile
-#include <gp_Pnt2d.hxx>
+#include <Geom2d_Curve.hxx>
+#include <GeomAdaptor_Curve.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
-#include <Geom2d_Curve.hxx>
-#include <TopExp.hxx>
+#include <gp_Pnt2d.hxx>
#include "SMESH_StdMeshers.hxx"
-#include "SMESH_Algo.hxx"
#include <vector>
#include <list>
class Adaptor3d_Curve;
class BRepAdaptor_CompCurve;
class TopoDS_Face;
-class SMESH_ComputeError;
+struct SMESH_ComputeError;
typedef struct uvPtStruct
{
*/
SMESH_Mesh* GetMesh() const { return myMesh; }
/*!
- * \brief Return true if there vertices without nodes
+ * \brief Return true if there are vertices without nodes
*/
bool MissVertexNode() const { return myMissingVertexNodes; }
/*!
/*!
* \brief Return 1st vertex of the i-the edge (count starts from zero)
*/
- inline TopoDS_Vertex FirstVertex(int i=0) const;
+ TopoDS_Vertex FirstVertex(int i=0) const;
/*!
* \brief Return last vertex of the i-the edge (count starts from zero)
*/
- inline TopoDS_Vertex LastVertex(int i=-1) const;
+ TopoDS_Vertex LastVertex(int i=-1) const;
/*!
* \brief Return first normalized parameter of the i-the edge (count starts from zero)
*/
protected:
+
+ // DON't FORGET tO update Reverse() when adding one more vector!
std::vector<uvPtStruct> myPoints, myFalsePoints;
std::vector<TopoDS_Edge> myEdge;
std::vector<Handle(Geom2d_Curve)> myC2d;
+ std::vector<GeomAdaptor_Curve> myC3dAdaptor;
std::vector<double> myFirst, myLast;
std::vector<double> myNormPar;
+ std::vector<double> myEdgeLength;
+ std::vector<double> myIsUniform;
double myLength;
int myNbPonits, myNbSegments;
SMESH_Mesh* myMesh;
return myFirst[i] * ( 1 - r ) + myLast[i] * r;
}
-//================================================================================
-/*!
- * \brief Return 1st vertex of the i-the edge
- */
-//================================================================================
-
-inline TopoDS_Vertex StdMeshers_FaceSide::FirstVertex(int i) const
-{
- return i < myEdge.size() ? TopExp::FirstVertex( myEdge[i], 1 ) : TopoDS_Vertex();
-}
-
-//================================================================================
-/*!
- * \brief Return last vertex of the i-the edge
- */
-//================================================================================
-
-inline TopoDS_Vertex StdMeshers_FaceSide::LastVertex(int i) const
-{
- return i<0 ? TopExp::LastVertex( myEdge.back(), 1) : i<myEdge.size() ? TopExp::LastVertex( myEdge[i], 1 ) : TopoDS_Vertex();
-}
-
//================================================================================
/*!
* \brief Return first normalized parameter of the i-the edge
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_FixedPoints1D.cxx
// Author : Damien COQUERET, OCC
}
listSize = _nbsegs.size();
- save << listSize;
+ save << " " << listSize;
if ( listSize > 0 ) {
for ( int i = 0; i < listSize; i++) save << " " << _nbsegs[i];
}
listSize = _edgeIDs.size();
- save << listSize;
+ save << " " << listSize;
if ( listSize > 0 ) {
for ( int i = 0; i < listSize; i++)
save << " " << _edgeIDs[i];
isOK = (load >> intVal);
if (isOK && intVal > 0) {
+ _params.clear();
_params.reserve( intVal );
for (int i = 0; i < _params.capacity() && isOK; i++) {
isOK = (load >> dblVal);
isOK = (load >> intVal);
if (isOK && intVal > 0) {
+ _nbsegs.clear();
_nbsegs.reserve( intVal );
for (int i = 0; i < _nbsegs.capacity() && isOK; i++) {
isOK = (load >> intVal);
isOK = (load >> intVal);
if (isOK && intVal > 0) {
+ _edgeIDs.clear();
_edgeIDs.reserve( intVal );
for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
isOK = (load >> intVal);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_FixedPoints1D.hxx
// Author : Damien COQUERET, OCC
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : StdMeshers_HexaFromSkin_3D.cxx
+// Created : Wed Jan 27 12:28:07 2010
+// Author : Edward AGAPOV (eap)
+//
+#include "StdMeshers_HexaFromSkin_3D.hxx"
+
+#include "SMDS_VolumeOfNodes.hxx"
+#include "SMDS_VolumeTool.hxx"
+#include "SMESH_Block.hxx"
+#include "SMESH_MesherHelper.hxx"
+
+#include <gp_Ax2.hxx>
+
+//#include "utilities.h"
+
+// Define error message
+#ifdef _DEBUG_
+#define BAD_MESH_ERR \
+ error(SMESH_Comment("Can't detect block-wise structure of the input 2D mesh.\n" \
+ __FILE__ ":" )<<__LINE__)
+#else
+#define BAD_MESH_ERR \
+ error(SMESH_Comment("Can't detect block-wise structure of the input 2D mesh"))
+#endif
+
+// Debug output
+#define _DUMP_(msg) //cout << msg << endl
+
+
+
+namespace
+{
+ enum EBoxSides //!< sides of the block
+ {
+ B_BOTTOM=0, B_RIGHT, B_TOP, B_LEFT, B_FRONT, B_BACK, B_UNDEFINED
+ };
+ const char* SBoxSides[] = //!< names of block sides
+ {
+ "BOTTOM", "RIGHT", "TOP", "LEFT", "FRONT", "BACK", "UNDEFINED"
+ };
+ enum EQuadEdge //!< edges of quadrangle side
+ {
+ Q_BOTTOM, Q_RIGHT, Q_TOP, Q_LEFT, Q_UNDEFINED
+ };
+
+
+ //================================================================================
+ /*!
+ * \brief return logical coordinates (i.e. min or max) of ends of edge
+ */
+ //================================================================================
+
+ bool getEdgeEnds(EQuadEdge edge, bool& xMax1, bool& yMax1, bool& xMax2, bool& yMax2 )
+ {
+ xMax1=0, yMax1=0, xMax2=1, yMax2=1;
+ switch( edge )
+ {
+ case Q_BOTTOM: yMax2 = 0; break;
+ case Q_RIGHT: xMax1 = 1; break;
+ case Q_TOP: yMax1 = 1; break;
+ case Q_LEFT: xMax2 = 0; break;
+ default:
+ return false;
+ }
+ return true;
+ }
+
+ //================================================================================
+ /*!
+ * \brief return true if a node is at block corner
+ */
+ //================================================================================
+
+ bool isCornerNode( const SMDS_MeshNode* n )
+ {
+ return n && n->NbInverseElements( SMDSAbs_Face ) % 2;
+ }
+
+ //================================================================================
+ /*!
+ * \brief check element type
+ */
+ //================================================================================
+
+ bool isQuadrangle(const SMDS_MeshElement* e)
+ {
+ return ( e && e->NbNodes() == ( e->IsQuadratic() ? 8 : 4 ));
+ }
+
+ //================================================================================
+ /*!
+ * \brief return opposite node of a quadrangle face
+ */
+ //================================================================================
+
+ const SMDS_MeshNode* oppositeNode(const SMDS_MeshElement* quad, int iNode)
+ {
+ return quad->GetNode( (iNode+2) % 4 );
+ }
+
+ //================================================================================
+ /*!
+ * \brief Convertor of a pair of integers to a sole index
+ */
+ struct _Indexer
+ {
+ int _xSize, _ySize;
+ _Indexer( int xSize=0, int ySize=0 ): _xSize(xSize), _ySize(ySize) {}
+ int size() const { return _xSize * _ySize; }
+ int operator()(int x, int y) const { return y * _xSize + x; }
+ };
+ //================================================================================
+ /*!
+ * \brief Oriented convertor of a pair of integers to a sole index
+ */
+ class _OrientedIndexer : public _Indexer
+ {
+ public:
+ enum OriFlags //!< types of block side orientation
+ {
+ REV_X = 1, REV_Y = 2, SWAP_XY = 4, MAX_ORI = REV_X|REV_Y|SWAP_XY
+ };
+ _OrientedIndexer( const _Indexer& indexer, const int oriFlags ):
+ _Indexer( indexer._xSize, indexer._ySize ),
+ _xSize (indexer._xSize), _ySize(indexer._ySize),
+ _xRevFun((oriFlags & REV_X) ? & reverse : & lazy),
+ _yRevFun((oriFlags & REV_Y) ? & reverse : & lazy),
+ _swapFun((oriFlags & SWAP_XY ) ? & swap : & lazy)
+ {
+ (*_swapFun)( _xSize, _ySize );
+ }
+ //!< Return index by XY
+ int operator()(int x, int y) const
+ {
+ (*_xRevFun)( x, const_cast<int&>( _xSize ));
+ (*_yRevFun)( y, const_cast<int&>( _ySize ));
+ (*_swapFun)( x, y );
+ return _Indexer::operator()(x,y);
+ }
+ //!< Return index for a corner
+ int corner(bool xMax, bool yMax) const
+ {
+ int x = xMax, y = yMax, size = 2;
+ (*_xRevFun)( x, size );
+ (*_yRevFun)( y, size );
+ (*_swapFun)( x, y );
+ return _Indexer::operator()(x ? _Indexer::_xSize-1 : 0 , y ? _Indexer::_ySize-1 : 0);
+ }
+ int xSize() const { return _xSize; }
+ int ySize() const { return _ySize; }
+ private:
+ _Indexer _indexer;
+ int _xSize, _ySize;
+
+ typedef void (*TFun)(int& x, int& y);
+ TFun _xRevFun, _yRevFun, _swapFun;
+
+ static void lazy(int&, int&) {}
+ static void reverse(int& x, int& size) { x = size - x - 1; }
+ static void swap(int& x, int& y) { std::swap(x,y); }
+ };
+ //================================================================================
+ /*!
+ * \brief Structure corresponding to the meshed side of block
+ */
+ struct _BlockSide
+ {
+ vector<const SMDS_MeshNode*> _grid;
+ _Indexer _index;
+ int _nbBlocksExpected;
+ int _nbBlocksFound;
+
+#ifdef _DEBUG_
+#define _grid_access_(args) _grid.at( args )
+#else
+#define _grid_access_(args) _grid[ args ]
+#endif
+ //!< Return node at XY
+ const SMDS_MeshNode* getNode(int x, int y) const { return _grid_access_( _index( x, y )); }
+ //!< Set node at XY
+ void setNode(int x, int y, const SMDS_MeshNode* n) { _grid_access_( _index( x, y )) = n; }
+ //!< Return an edge
+ SMESH_OrientedLink getEdge(EQuadEdge edge) const
+ {
+ bool x1, y1, x2, y2; getEdgeEnds( edge, x1, y1, x2, y2 );
+ return SMESH_OrientedLink( getCornerNode ( x1, y1 ), getCornerNode( x2, y2 ));
+ }
+ //!< Return a corner node
+ const SMDS_MeshNode* getCornerNode(bool isXMax, bool isYMax) const
+ {
+ return getNode( isXMax ? _index._xSize-1 : 0 , isYMax ? _index._ySize-1 : 0 );
+ }
+ const SMDS_MeshElement* getCornerFace(const SMDS_MeshNode* cornerNode) const;
+ //!< True if all blocks this side belongs to have beem found
+ bool isBound() const { return _nbBlocksExpected <= _nbBlocksFound; }
+ //!< Return coordinates of node at XY
+ gp_XYZ getXYZ(int x, int y) const { return SMESH_MeshEditor::TNodeXYZ( getNode( x, y )); }
+ //!< Return gravity center of the four corners and the middle node
+ gp_XYZ getGC() const
+ {
+ gp_XYZ xyz =
+ getXYZ( 0, 0 ) +
+ getXYZ( _index._xSize-1, 0 ) +
+ getXYZ( 0, _index._ySize-1 ) +
+ getXYZ( _index._xSize-1, _index._ySize-1 ) +
+ getXYZ( _index._xSize/2, _index._ySize/2 );
+ return xyz / 5;
+ }
+ //!< Return number of mesh faces
+ int getNbFaces() const { return (_index._xSize-1) * (_index._ySize-1); }
+ };
+ //================================================================================
+ /*!
+ * \brief _BlockSide with changed orientation
+ */
+ struct _OrientedBlockSide
+ {
+ _BlockSide* _side;
+ _OrientedIndexer _index;
+
+ _OrientedBlockSide( _BlockSide* side=0, const int oriFlags=0 ):
+ _side(side), _index(side ? side->_index : _Indexer(), oriFlags ) {}
+ //!< return coordinates by XY
+ gp_XYZ xyz(int x, int y) const
+ {
+ return SMESH_MeshEditor::TNodeXYZ( _side->_grid_access_( _index( x, y )) );
+ }
+ //!< safely return a node by XY
+ const SMDS_MeshNode* node(int x, int y) const
+ {
+ int i = _index( x, y );
+ return ( i < 0 || i >= _side->_grid.size()) ? 0 : _side->_grid[i];
+ }
+ //!< Return an edge
+ SMESH_OrientedLink edge(EQuadEdge edge) const
+ {
+ bool x1, y1, x2, y2; getEdgeEnds( edge, x1, y1, x2, y2 );
+ return SMESH_OrientedLink( cornerNode ( x1, y1 ), cornerNode( x2, y2 ));
+ }
+ //!< Return a corner node
+ const SMDS_MeshNode* cornerNode(bool isXMax, bool isYMax) const
+ {
+ return _side->_grid_access_( _index.corner( isXMax, isYMax ));
+ }
+ //!< return its size in nodes
+ int getHoriSize() const { return _index.xSize(); }
+ int getVertSize() const { return _index.ySize(); }
+ //!< True if _side has been initialized
+ operator bool() const { return _side; }
+ //! Direct access to _side
+ const _BlockSide* operator->() const { return _side; }
+ _BlockSide* operator->() { return _side; }
+ };
+ //================================================================================
+ /*!
+ * \brief Meshed skin of block
+ */
+ struct _Block
+ {
+ _OrientedBlockSide _side[6]; // 6 sides of a sub-block
+
+ const _OrientedBlockSide& getSide(int i) const { return _side[i]; }
+ bool hasSide( const _OrientedBlockSide& s) const
+ {
+ if ( s ) for (int i=0;i<6;++i) if ( _side[i] && _side[i]._side == s._side ) return true;
+ return false;
+ }
+ };
+ //================================================================================
+ /*!
+ * \brief Skin mesh possibly containing several meshed blocks
+ */
+ class _Skin
+ {
+ public:
+
+ int findBlocks(SMESH_Mesh& mesh);
+ //!< return i-th block
+ const _Block& getBlock(int i) const { return _blocks[i]; }
+ //!< return error description
+ const SMESH_Comment& error() const { return _error; }
+
+ private:
+ bool fillSide( _BlockSide& side, const SMDS_MeshElement* cornerQuad);
+ bool fillRowsUntilCorner(const SMDS_MeshElement* quad,
+ const SMDS_MeshNode* n1,
+ const SMDS_MeshNode* n2,
+ vector<const SMDS_MeshNode*>& verRow1,
+ vector<const SMDS_MeshNode*>& verRow2,
+ bool alongN1N2 );
+ _OrientedBlockSide findBlockSide( EBoxSides startBlockSide,
+ EQuadEdge sharedSideEdge1,
+ EQuadEdge sharedSideEdge2);
+ //!< update own data and data of the side bound to block
+ void setSideBoundToBlock( _BlockSide& side )
+ {
+ side._nbBlocksFound++;
+ if ( side.isBound() )
+ {
+ for ( int e = 0; e < int(Q_UNDEFINED); ++e )
+ _edge2sides[ side.getEdge( (EQuadEdge) e ) ].erase( &side );
+ }
+ }
+ //!< store reason of error
+ int error(const SMESH_Comment& reason) { _error = reason; return 0; }
+
+ SMESH_Comment _error;
+
+ list< _BlockSide > _allSides;
+ vector< _Block > _blocks;
+
+ //map< const SMDS_MeshNode*, set< _BlockSide* > > _corner2sides;
+ map< SMESH_OrientedLink, set< _BlockSide* > > _edge2sides;
+ };
+
+ //================================================================================
+ /*!
+ * \brief Find and return number of submeshes corresponding to blocks
+ */
+ //================================================================================
+
+ int _Skin::findBlocks(SMESH_Mesh& mesh)
+ {
+ SMESHDS_Mesh* meshDS = mesh.GetMeshDS();
+
+ // Find a node at any block corner
+
+ SMDS_NodeIteratorPtr nIt = meshDS->nodesIterator(/*idInceasingOrder=*/true);
+ if ( !nIt->more() ) return error("Empty mesh");
+
+ const SMDS_MeshNode* nCorner = 0;
+ while ( nIt->more() )
+ {
+ nCorner = nIt->next();
+ if ( isCornerNode( nCorner ))
+ break;
+ else
+ nCorner = 0;
+ }
+ if ( !nCorner )
+ return BAD_MESH_ERR;
+
+ // --------------------------------------------------------------------
+ // Find all block sides starting from mesh faces sharing the corner node
+ // --------------------------------------------------------------------
+
+ int nbFacesOnSides = 0;
+ TIDSortedElemSet cornerFaces; // corner faces of found _BlockSide's
+ list< const SMDS_MeshNode* > corners( 1, nCorner );
+ list< const SMDS_MeshNode* >::iterator corner = corners.begin();
+ while ( corner != corners.end() )
+ {
+ SMDS_ElemIteratorPtr faceIt = (*corner)->GetInverseElementIterator( SMDSAbs_Face );
+ while ( faceIt->more() )
+ {
+ const SMDS_MeshElement* face = faceIt->next();
+ if ( !cornerFaces.insert( face ).second )
+ continue; // already loaded block side
+
+ if ( !isQuadrangle( face ))
+ return error("Non-quadrangle elements in the input mesh");
+
+ if ( _allSides.empty() || !_allSides.back()._grid.empty() )
+ _allSides.push_back( _BlockSide() );
+
+ _BlockSide& side = _allSides.back();
+ if ( !fillSide( side, face ) )
+ {
+ if ( !_error.empty() )
+ return false;
+ }
+ else
+ {
+ for ( int isXMax = 0; isXMax < 2; ++isXMax )
+ for ( int isYMax = 0; isYMax < 2; ++isYMax )
+ {
+ const SMDS_MeshNode* nCorner = side.getCornerNode(isXMax,isYMax );
+ if ( !isCornerNode( nCorner ))
+ return BAD_MESH_ERR;
+ //_corner2sides[ nCorner ].insert( &side );
+ corners.push_back( nCorner );
+ cornerFaces.insert( side.getCornerFace( nCorner ));
+ }
+ for ( int e = 0; e < int(Q_UNDEFINED); ++e )
+ _edge2sides[ side.getEdge( (EQuadEdge) e ) ].insert( &side );
+
+ nbFacesOnSides += side.getNbFaces();
+ }
+ }
+ ++corner;
+
+ // find block sides of other domains if any
+ if ( corner == corners.end() && nbFacesOnSides < mesh.NbQuadrangles() )
+ {
+ while ( nIt->more() )
+ {
+ nCorner = nIt->next();
+ if ( isCornerNode( nCorner ))
+ corner = corners.insert( corner, nCorner );
+ }
+ nbFacesOnSides = mesh.NbQuadrangles();
+ }
+ }
+
+ if ( _allSides.empty() )
+ return BAD_MESH_ERR;
+ if ( _allSides.back()._grid.empty() )
+ _allSides.pop_back();
+
+ // ---------------------------
+ // Organize sides into blocks
+ // ---------------------------
+
+ // analyse sharing of sides by blocks
+ int nbBlockSides = 0; // nb of block sides taking into account their sharing
+ list < _BlockSide >::iterator sideIt = _allSides.begin();
+ for ( ; sideIt != _allSides.end(); ++sideIt )
+ {
+ _BlockSide& side = *sideIt;
+ bool isSharedSide = true;
+ for ( int e = 0; e < int(Q_UNDEFINED) && isSharedSide; ++e )
+ isSharedSide = _edge2sides[ side.getEdge( (EQuadEdge) e ) ].size() > 2;
+ side._nbBlocksFound = 0;
+ side._nbBlocksExpected = isSharedSide ? 2 : 1;
+ nbBlockSides += side._nbBlocksExpected;
+ }
+
+ // find sides of each block
+ int nbBlocks = 0;
+ while ( nbBlockSides >= 6 )
+ {
+ // get any side not bound to all blocks it belongs to
+ sideIt = _allSides.begin();
+ while ( sideIt != _allSides.end() && sideIt->isBound())
+ ++sideIt;
+
+ // start searching for block sides from the got side
+ bool ok = true;
+ if ( _blocks.empty() || _blocks.back()._side[B_FRONT] )
+ _blocks.resize( _blocks.size() + 1 );
+
+ _Block& block = _blocks.back();
+ block._side[B_FRONT] = &(*sideIt);
+ setSideBoundToBlock( *sideIt );
+ nbBlockSides--;
+
+ // edges of neighbour sides of B_FRONT corresponding to front's edges
+ EQuadEdge edgeOfFront[4] = { Q_BOTTOM, Q_RIGHT, Q_TOP, Q_LEFT };
+ EQuadEdge edgeToFind [4] = { Q_BOTTOM, Q_LEFT, Q_BOTTOM, Q_LEFT };
+ for ( int i = Q_BOTTOM; ok && i <= Q_LEFT; ++i )
+ ok = ( block._side[i] = findBlockSide( B_FRONT, edgeOfFront[i], edgeToFind[i]));
+ if ( ok )
+ ok = ( block._side[B_BACK] = findBlockSide( B_TOP, Q_TOP, Q_TOP ));
+
+ if ( ok )
+ {
+ // check if just found block is same as one of previously found
+ bool isSame = false;
+ for ( int i = 1; i < _blocks.size() && !isSame; ++i )
+ {
+ _Block& prevBlock = _blocks[i-1];
+ isSame = true;
+ for ( int j = 0; j < 6 && isSame; ++j )
+ isSame = prevBlock.hasSide( block._side[ j ]);
+ }
+ ok = !isSame;
+ }
+
+ // count the found sides
+ _DUMP_(endl);
+ for (int i = 0; i < B_UNDEFINED; ++i )
+ {
+ _DUMP_("** Block side "<< SBoxSides[i] <<" "<< block._side[ i ]._side);
+ if ( block._side[ i ] )
+ {
+ if ( ok && i != B_FRONT)
+ {
+ setSideBoundToBlock( *block._side[ i ]._side );
+ nbBlockSides--;
+ }
+ _DUMP_("Corner 0,0 "<< block._side[ i ].cornerNode(0,0));
+ _DUMP_("Corner 1,0 "<< block._side[ i ].cornerNode(1,0));
+ _DUMP_("Corner 1,1 "<< block._side[ i ].cornerNode(1,1));
+ _DUMP_("Corner 0,1 "<< block._side[ i ].cornerNode(0,1));
+ }
+ else
+ {
+ _DUMP_("Not found"<<endl);
+ }
+ }
+ if ( !ok )
+ block._side[0] = block._side[1] = block._side[2] =
+ block._side[3] = block._side[4] = block._side[5] = 0;
+ else
+ nbBlocks++;
+ }
+ if ( nbBlocks == 0 && _error.empty() )
+ return BAD_MESH_ERR;
+
+ return nbBlocks;
+ }
+
+ //================================================================================
+ /*!
+ * \brief Fill block side data starting from its corner quadrangle
+ */
+ //================================================================================
+
+ bool _Skin::fillSide( _BlockSide& side, const SMDS_MeshElement* cornerQuad)
+ {
+ // Find out size of block side mesured in nodes and by the way find two rows
+ // of nodes in two directions.
+
+ int x, y, nbX, nbY;
+ const SMDS_MeshElement* firstQuad = cornerQuad;
+ {
+ // get corner node of cornerQuad
+ const SMDS_MeshNode* nCorner = 0;
+ for ( int i = 0; i < 4 && !nCorner; ++i )
+ if ( isCornerNode( firstQuad->GetNode(i)))
+ nCorner = firstQuad->GetNode(i);
+ if ( !nCorner ) return false;
+
+ // get a node on block edge
+ int iCorner = firstQuad->GetNodeIndex( nCorner );
+ const SMDS_MeshNode* nOnEdge = firstQuad->GetNode( (iCorner+1) % 4);
+
+ // find out size of block side
+ vector<const SMDS_MeshNode*> horRow1, horRow2, verRow1, verRow2;
+ if ( !fillRowsUntilCorner( firstQuad, nCorner, nOnEdge, horRow1, horRow2, true ) ||
+ !fillRowsUntilCorner( firstQuad, nCorner, nOnEdge, verRow1, verRow2, false ))
+ return false;
+ nbX = horRow1.size(), nbY = verRow1.size();
+
+ // store found nodes
+ side._index._xSize = horRow1.size();
+ side._index._ySize = verRow1.size();
+ side._grid.resize( side._index.size(), NULL );
+
+ for ( x = 0; x < horRow1.size(); ++x )
+ {
+ side.setNode( x, 0, horRow1[x] );
+ side.setNode( x, 1, horRow2[x] );
+ }
+ for ( y = 0; y < verRow1.size(); ++y )
+ {
+ side.setNode( 0, y, verRow1[y] );
+ side.setNode( 1, y, verRow2[y] );
+ }
+ }
+ // Find the rest nodes
+
+ y = 1; // y of the row to fill
+ TIDSortedElemSet emptySet, avoidSet;
+ while ( ++y < nbY )
+ {
+ // get next firstQuad in the next row of quadrangles
+ //
+ // n2up
+ // o---o <- y row
+ // | |
+ // o---o o o o o <- found nodes
+ //n1down n2down
+ //
+ int i1down, i2down, i2up;
+ const SMDS_MeshNode* n1down = side.getNode( 0, y-1 );
+ const SMDS_MeshNode* n2down = side.getNode( 1, y-1 );
+ avoidSet.clear(); avoidSet.insert( firstQuad );
+ firstQuad = SMESH_MeshEditor::FindFaceInSet( n1down, n2down, emptySet, avoidSet,
+ &i1down, &i2down);
+ if ( !isQuadrangle( firstQuad ))
+ return BAD_MESH_ERR;
+
+ const SMDS_MeshNode* n2up = oppositeNode( firstQuad, i1down );
+ avoidSet.clear(); avoidSet.insert( firstQuad );
+
+ // find the rest nodes in the y-th row by faces in the row
+
+ x = 1;
+ while ( ++x < nbX )
+ {
+ const SMDS_MeshElement* quad = SMESH_MeshEditor::FindFaceInSet( n2up, n2down, emptySet,
+ avoidSet, &i2up, &i2down);
+ if ( !isQuadrangle( quad ))
+ return BAD_MESH_ERR;
+
+ n2up = oppositeNode( quad, i2down );
+ n2down = oppositeNode( quad, i2up );
+ avoidSet.clear(); avoidSet.insert( quad );
+
+ side.setNode( x, y, n2up );
+ }
+ }
+
+ return true;
+ }
+
+ //================================================================================
+ /*!
+ * \brief Try to find a block side adjacent to the given side by given edge
+ */
+ //================================================================================
+
+ _OrientedBlockSide _Skin::findBlockSide( EBoxSides startBlockSide,
+ EQuadEdge sharedSideEdge1,
+ EQuadEdge sharedSideEdge2)
+ {
+ _Block& block = _blocks.back();
+ _OrientedBlockSide& side1 = block._side[ startBlockSide ];
+
+ // get corner nodes of the given block edge
+ SMESH_OrientedLink edge = side1.edge( sharedSideEdge1 );
+ const SMDS_MeshNode* n1 = edge.node1();
+ const SMDS_MeshNode* n2 = edge.node2();
+ if ( edge._reversed ) swap( n1, n2 );
+
+ // find all sides sharing both nodes n1 and n2
+ set< _BlockSide* > sidesOnEdge = _edge2sides[ edge ]; // copy a set
+
+ // exclude loaded sides of block from sidesOnEdge
+ int nbLoadedSides = 0;
+ for (int i = 0; i < B_UNDEFINED; ++i )
+ {
+ if ( block._side[ i ] )
+ {
+ nbLoadedSides++;
+ sidesOnEdge.erase( block._side[ i ]._side );
+ }
+ }
+ int nbSidesOnEdge = sidesOnEdge.size();
+ _DUMP_("nbSidesOnEdge "<< nbSidesOnEdge << " " << n1->GetID() << "-" << n2->GetID() );
+ if ( nbSidesOnEdge == 0 )
+ return 0;
+
+ _BlockSide* foundSide = 0;
+ if ( nbSidesOnEdge == 1 /*|| nbSidesOnEdge == 2 && nbLoadedSides == 1 */)
+ {
+ foundSide = *sidesOnEdge.begin();
+ }
+ else
+ {
+ // Select one of found sides most close to startBlockSide
+
+ // gravity center of already loaded block sides
+ gp_XYZ gc(0,0,0);
+ for (int i = 0; i < B_UNDEFINED; ++i )
+ if ( block._side[ i ] )
+ gc += block._side[ i ]._side->getGC();
+ gc /= nbLoadedSides;
+
+ gp_XYZ p1 ( n1->X(),n1->Y(),n1->Z()), p2 (n2->X(),n2->Y(),n2->Z());
+ gp_Vec p1p2( p1, p2 );
+
+ const SMDS_MeshElement* face1 = side1->getCornerFace( n1 );
+ gp_XYZ p1Op = SMESH_MeshEditor::TNodeXYZ( oppositeNode( face1, face1->GetNodeIndex(n1)));
+ gp_Vec side1Dir( p1, p1Op );
+ gp_Ax2 pln( p1, p1p2, side1Dir ); // plane with normal p1p2 and X dir side1Dir
+ _DUMP_(" Select adjacent for "<< side1._side << " - side dir ("
+ << side1Dir.X() << ", " << side1Dir.Y() << ", " << side1Dir.Z() << ")" );
+
+ map < double , _BlockSide* > angleOfSide;
+ set< _BlockSide* >::iterator sideIt = sidesOnEdge.begin();
+ for (; sideIt != sidesOnEdge.end(); ++sideIt )
+ {
+ _BlockSide* sideI = *sideIt;
+ const SMDS_MeshElement* faceI = sideI->getCornerFace( n1 );
+ gp_XYZ p1Op = SMESH_MeshEditor::TNodeXYZ( oppositeNode( faceI, faceI->GetNodeIndex(n1)));
+ gp_Vec sideIDir( p1, p1Op );
+ // compute angle of (sideIDir projection to pln) and (X dir of pln)
+ gp_Vec2d sideIDirProj( sideIDir * pln.XDirection(), sideIDir * pln.YDirection());
+ double angle = sideIDirProj.Angle( gp::DX2d() );
+ if ( angle < 0 ) angle += 2 * PI;
+ angleOfSide.insert( make_pair( angle, sideI ));
+ _DUMP_(" "<< sideI << " - side dir ("
+ << sideIDir.X() << ", " << sideIDir.Y() << ", " << sideIDir.Z() << ")"
+ << " angle " << angle);
+ }
+ gp_Vec gcDir( p1, gc );
+ gp_Vec2d gcDirProj( gcDir * pln.XDirection(), gcDir * pln.YDirection());
+ double gcAngle = gcDirProj.Angle( gp::DX2d() );
+ foundSide = gcAngle < 0 ? angleOfSide.rbegin()->second : angleOfSide.begin()->second;
+ _DUMP_(" selected "<< foundSide );
+ }
+
+ // Orient the found side correctly
+
+ // corners of found side corresponding to nodes n1 and n2
+ bool xMax1, yMax1, xMax2, yMax2;
+ if ( !getEdgeEnds( sharedSideEdge2, xMax1, yMax1, xMax2, yMax2 ))
+ return error(SMESH_Comment("Internal error at ")<<__FILE__<<":"<<__LINE__),
+ _OrientedBlockSide(0);
+
+ for ( int ori = 0; ori < _OrientedIndexer::MAX_ORI+1; ++ori )
+ {
+ _OrientedBlockSide orientedSide( foundSide, ori );
+ const SMDS_MeshNode* n12 = orientedSide.cornerNode( xMax1, yMax1);
+ const SMDS_MeshNode* n22 = orientedSide.cornerNode( xMax2, yMax2);
+ if ( n1 == n12 && n2 == n22 )
+ return orientedSide;
+ }
+ error(SMESH_Comment("Failed to orient a block side found by edge ")<<sharedSideEdge1
+ << " of side " << startBlockSide
+ << " of block " << _blocks.size());
+ return 0;
+ }
+
+ //================================================================================
+ /*!
+ * \brief: Fill rows (which are actually columns,if !alongN1N2) of nodes starting
+ * from the given quadrangle until another block corner encounters.
+ * n1 and n2 are at bottom of quad, n1 is at block corner.
+ */
+ //================================================================================
+
+ bool _Skin::fillRowsUntilCorner(const SMDS_MeshElement* quad,
+ const SMDS_MeshNode* n1,
+ const SMDS_MeshNode* n2,
+ vector<const SMDS_MeshNode*>& row1,
+ vector<const SMDS_MeshNode*>& row2,
+ const bool alongN1N2 )
+ {
+ const SMDS_MeshNode* corner1 = n1;
+
+ // Store nodes of quad in the rows and find new n1 and n2 to get
+ // the next face so that new n2 is on block edge
+ int i1 = quad->GetNodeIndex( n1 );
+ int i2 = quad->GetNodeIndex( n2 );
+ row1.clear(); row2.clear();
+ row1.push_back( n1 );
+ if ( alongN1N2 )
+ {
+ row1.push_back( n2 );
+ row2.push_back( oppositeNode( quad, i2 ));
+ row2.push_back( n1 = oppositeNode( quad, i1 ));
+ }
+ else
+ {
+ row2.push_back( n2 );
+ row1.push_back( n2 = oppositeNode( quad, i2 ));
+ row2.push_back( n1 = oppositeNode( quad, i1 ));
+ }
+
+ // Find the rest nodes
+ TIDSortedElemSet emptySet, avoidSet;
+ while ( !isCornerNode( n2 ))
+ {
+ avoidSet.clear(); avoidSet.insert( quad );
+ quad = SMESH_MeshEditor::FindFaceInSet( n1, n2, emptySet, avoidSet, &i1, &i2 );
+ if ( !isQuadrangle( quad ))
+ return BAD_MESH_ERR;
+
+ row1.push_back( n2 = oppositeNode( quad, i1 ));
+ row2.push_back( n1 = oppositeNode( quad, i2 ));
+ }
+ return n1 != corner1;
+ }
+
+ //================================================================================
+ /*!
+ * \brief Return a corner face by a corner node
+ */
+ //================================================================================
+
+ const SMDS_MeshElement* _BlockSide::getCornerFace(const SMDS_MeshNode* cornerNode) const
+ {
+ int x, y, isXMax, isYMax, found = 0;
+ for ( isXMax = 0; isXMax < 2; ++isXMax )
+ {
+ for ( isYMax = 0; isYMax < 2; ++isYMax )
+ {
+ x = isXMax ? _index._xSize-1 : 0;
+ y = isYMax ? _index._ySize-1 : 0;
+ found = ( getNode(x,y) == cornerNode );
+ if ( found ) break;
+ }
+ if ( found ) break;
+ }
+ if ( !found ) return 0;
+ int dx = isXMax ? -1 : +1;
+ int dy = isYMax ? -1 : +1;
+ const SMDS_MeshNode* n1 = getNode(x,y);
+ const SMDS_MeshNode* n2 = getNode(x+dx,y);
+ const SMDS_MeshNode* n3 = getNode(x,y+dy);
+ const SMDS_MeshNode* n4 = getNode(x+dx,y+dy);
+ return SMDS_Mesh::FindFace(n1, n2, n3, n4 );
+ }
+
+}
+
+//=======================================================================
+//function : StdMeshers_HexaFromSkin_3D
+//purpose :
+//=======================================================================
+
+StdMeshers_HexaFromSkin_3D::StdMeshers_HexaFromSkin_3D(int hypId, int studyId, SMESH_Gen* gen)
+ :SMESH_3D_Algo(hypId, studyId, gen)
+{
+ MESSAGE("StdMeshers_HexaFromSkin_3D::StdMeshers_HexaFromSkin_3D");
+ _name = "HexaFromSkin_3D";
+}
+
+StdMeshers_HexaFromSkin_3D::~StdMeshers_HexaFromSkin_3D()
+{
+ MESSAGE("StdMeshers_HexaFromSkin_3D::~StdMeshers_HexaFromSkin_3D");
+}
+
+//================================================================================
+/*!
+ * \brief Main method, which generates hexaheda
+ */
+//================================================================================
+
+bool StdMeshers_HexaFromSkin_3D::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper)
+{
+ _Skin skin;
+ int nbBlocks = skin.findBlocks(aMesh);
+ if ( nbBlocks == 0 )
+ return error( skin.error());
+
+ vector< vector< const SMDS_MeshNode* > > columns;
+ int x, xSize, y, ySize, z, zSize;
+ _Indexer colIndex;
+
+ for ( int i = 0; i < nbBlocks; ++i )
+ {
+ const _Block& block = skin.getBlock( i );
+
+ // ------------------------------------------
+ // Fill columns of nodes with existing nodes
+ // ------------------------------------------
+
+ xSize = block.getSide(B_BOTTOM).getHoriSize();
+ ySize = block.getSide(B_BOTTOM).getVertSize();
+ zSize = block.getSide(B_FRONT ).getVertSize();
+ int X = xSize - 1, Y = ySize - 1, Z = zSize - 1;
+ colIndex = _Indexer( xSize, ySize );
+ columns.resize( colIndex.size() );
+
+ // fill node columns by front and back box sides
+ for ( x = 0; x < xSize; ++x ) {
+ vector< const SMDS_MeshNode* >& column0 = columns[ colIndex( x, 0 )];
+ vector< const SMDS_MeshNode* >& column1 = columns[ colIndex( x, Y )];
+ column0.resize( zSize );
+ column1.resize( zSize );
+ for ( z = 0; z < zSize; ++z ) {
+ column0[ z ] = block.getSide(B_FRONT).node( x, z );
+ column1[ z ] = block.getSide(B_BACK) .node( x, z );
+ }
+ }
+ // fill node columns by left and right box sides
+ for ( y = 1; y < ySize-1; ++y ) {
+ vector< const SMDS_MeshNode* >& column0 = columns[ colIndex( 0, y )];
+ vector< const SMDS_MeshNode* >& column1 = columns[ colIndex( X, y )];
+ column0.resize( zSize );
+ column1.resize( zSize );
+ for ( z = 0; z < zSize; ++z ) {
+ column0[ z ] = block.getSide(B_LEFT) .node( y, z );
+ column1[ z ] = block.getSide(B_RIGHT).node( y, z );
+ }
+ }
+ // get nodes from top and bottom box sides
+ for ( x = 1; x < xSize-1; ++x ) {
+ for ( y = 1; y < ySize-1; ++y ) {
+ vector< const SMDS_MeshNode* >& column = columns[ colIndex( x, y )];
+ column.resize( zSize );
+ column.front() = block.getSide(B_BOTTOM).node( x, y );
+ column.back() = block.getSide(B_TOP) .node( x, y );
+ }
+ }
+
+ // ----------------------------
+ // Add internal nodes of a box
+ // ----------------------------
+ // projection points of internal nodes on box subshapes by which
+ // coordinates of internal nodes are computed
+ vector<gp_XYZ> pointOnShape( SMESH_Block::ID_Shell );
+
+ // projections on vertices are constant
+ pointOnShape[ SMESH_Block::ID_V000 ] = block.getSide(B_BOTTOM).xyz( 0, 0 );
+ pointOnShape[ SMESH_Block::ID_V100 ] = block.getSide(B_BOTTOM).xyz( X, 0 );
+ pointOnShape[ SMESH_Block::ID_V010 ] = block.getSide(B_BOTTOM).xyz( 0, Y );
+ pointOnShape[ SMESH_Block::ID_V110 ] = block.getSide(B_BOTTOM).xyz( X, Y );
+ pointOnShape[ SMESH_Block::ID_V001 ] = block.getSide(B_TOP).xyz( 0, 0 );
+ pointOnShape[ SMESH_Block::ID_V101 ] = block.getSide(B_TOP).xyz( X, 0 );
+ pointOnShape[ SMESH_Block::ID_V011 ] = block.getSide(B_TOP).xyz( 0, Y );
+ pointOnShape[ SMESH_Block::ID_V111 ] = block.getSide(B_TOP).xyz( X, Y );
+
+ for ( x = 1; x < xSize-1; ++x )
+ {
+ gp_XYZ params; // normalized parameters of internal node within a unit box
+ params.SetCoord( 1, x / double(X) );
+ for ( y = 1; y < ySize-1; ++y )
+ {
+ params.SetCoord( 2, y / double(Y) );
+ // column to fill during z loop
+ vector< const SMDS_MeshNode* >& column = columns[ colIndex( x, y )];
+ // projections on horizontal edges
+ pointOnShape[ SMESH_Block::ID_Ex00 ] = block.getSide(B_BOTTOM).xyz( x, 0 );
+ pointOnShape[ SMESH_Block::ID_Ex10 ] = block.getSide(B_BOTTOM).xyz( x, Y );
+ pointOnShape[ SMESH_Block::ID_E0y0 ] = block.getSide(B_BOTTOM).xyz( 0, y );
+ pointOnShape[ SMESH_Block::ID_E1y0 ] = block.getSide(B_BOTTOM).xyz( X, y );
+ pointOnShape[ SMESH_Block::ID_Ex01 ] = block.getSide(B_TOP).xyz( x, 0 );
+ pointOnShape[ SMESH_Block::ID_Ex11 ] = block.getSide(B_TOP).xyz( x, Y );
+ pointOnShape[ SMESH_Block::ID_E0y1 ] = block.getSide(B_TOP).xyz( 0, y );
+ pointOnShape[ SMESH_Block::ID_E1y1 ] = block.getSide(B_TOP).xyz( X, y );
+ // projections on horizontal sides
+ pointOnShape[ SMESH_Block::ID_Fxy0 ] = block.getSide(B_BOTTOM).xyz( x, y );
+ pointOnShape[ SMESH_Block::ID_Fxy1 ] = block.getSide(B_TOP) .xyz( x, y );
+ for ( z = 1; z < zSize-1; ++z ) // z loop
+ {
+ params.SetCoord( 3, z / double(Z) );
+ // projections on vertical edges
+ pointOnShape[ SMESH_Block::ID_E00z ] = block.getSide(B_FRONT).xyz( 0, z );
+ pointOnShape[ SMESH_Block::ID_E10z ] = block.getSide(B_FRONT).xyz( X, z );
+ pointOnShape[ SMESH_Block::ID_E01z ] = block.getSide(B_BACK).xyz( 0, z );
+ pointOnShape[ SMESH_Block::ID_E11z ] = block.getSide(B_BACK).xyz( X, z );
+ // projections on vertical sides
+ pointOnShape[ SMESH_Block::ID_Fx0z ] = block.getSide(B_FRONT).xyz( x, z );
+ pointOnShape[ SMESH_Block::ID_Fx1z ] = block.getSide(B_BACK) .xyz( x, z );
+ pointOnShape[ SMESH_Block::ID_F0yz ] = block.getSide(B_LEFT) .xyz( y, z );
+ pointOnShape[ SMESH_Block::ID_F1yz ] = block.getSide(B_RIGHT).xyz( y, z );
+
+ // compute internal node coordinates
+ gp_XYZ coords;
+ SMESH_Block::ShellPoint( params, pointOnShape, coords );
+ column[ z ] = aHelper->AddNode( coords.X(), coords.Y(), coords.Z() );
+
+#ifdef DEB_GRID
+ // debug
+ //cout << "----------------------------------------------------------------------"<<endl;
+ //for ( int id = SMESH_Block::ID_V000; id < SMESH_Block::ID_Shell; ++id)
+ //{
+ // gp_XYZ p = pointOnShape[ id ];
+ // SMESH_Block::DumpShapeID( id,cout)<<" ( "<<p.X()<<", "<<p.Y()<<", "<<p.Z()<<" )"<<endl;
+ //}
+ //cout << "Params: ( "<< params.X()<<", "<<params.Y()<<", "<<params.Z()<<" )"<<endl;
+ //cout << "coords: ( "<< coords.X()<<", "<<coords.Y()<<", "<<coords.Z()<<" )"<<endl;
+#endif
+ }
+ }
+ }
+ // ----------------
+ // Add hexahedrons
+ // ----------------
+
+ // find out orientation
+ const SMDS_MeshNode* n000 = block.getSide(B_BOTTOM).cornerNode( 0, 0 );
+ const SMDS_MeshNode* n100 = block.getSide(B_BOTTOM).cornerNode( 1, 0 );
+ const SMDS_MeshNode* n010 = block.getSide(B_BOTTOM).cornerNode( 0, 1 );
+ const SMDS_MeshNode* n110 = block.getSide(B_BOTTOM).cornerNode( 1, 1 );
+ const SMDS_MeshNode* n001 = block.getSide(B_TOP).cornerNode( 0, 0 );
+ const SMDS_MeshNode* n101 = block.getSide(B_TOP).cornerNode( 1, 0 );
+ const SMDS_MeshNode* n011 = block.getSide(B_TOP).cornerNode( 0, 1 );
+ const SMDS_MeshNode* n111 = block.getSide(B_TOP).cornerNode( 1, 1 );
+ SMDS_VolumeOfNodes probeVolume (n000,n010,n110,n100,
+ n001,n011,n111,n101);
+ bool isForw = SMDS_VolumeTool( &probeVolume ).IsForward();
+
+ // add elements
+ for ( x = 0; x < xSize-1; ++x ) {
+ for ( y = 0; y < ySize-1; ++y ) {
+ vector< const SMDS_MeshNode* >& col00 = columns[ colIndex( x, y )];
+ vector< const SMDS_MeshNode* >& col10 = columns[ colIndex( x+1, y )];
+ vector< const SMDS_MeshNode* >& col01 = columns[ colIndex( x, y+1 )];
+ vector< const SMDS_MeshNode* >& col11 = columns[ colIndex( x+1, y+1 )];
+ // bottom face normal of a hexa mush point outside the volume
+ if ( isForw )
+ for ( z = 0; z < zSize-1; ++z )
+ aHelper->AddVolume(col00[z], col01[z], col11[z], col10[z],
+ col00[z+1], col01[z+1], col11[z+1], col10[z+1]);
+ else
+ for ( z = 0; z < zSize-1; ++z )
+ aHelper->AddVolume(col00[z], col10[z], col11[z], col01[z],
+ col00[z+1], col10[z+1], col11[z+1], col01[z+1]);
+ }
+ }
+ } // loop on blocks
+
+ return true;
+}
+
+//================================================================================
+/*!
+ * \brief Evaluate nb of hexa
+ */
+//================================================================================
+
+bool StdMeshers_HexaFromSkin_3D::Evaluate(SMESH_Mesh & aMesh,
+ const TopoDS_Shape & aShape,
+ MapShapeNbElems& aResMap)
+{
+ _Skin skin;
+ int nbBlocks = skin.findBlocks(aMesh);
+ if ( nbBlocks == 0 )
+ return error( skin.error());
+
+ bool secondOrder = aMesh.NbFaces( ORDER_QUADRATIC );
+
+ int entity = secondOrder ? SMDSEntity_Quad_Hexa : SMDSEntity_Hexa;
+ vector<int>& nbByType = aResMap[ aMesh.GetSubMesh( aShape )];
+ if ( entity >= nbByType.size() )
+ nbByType.resize( SMDSEntity_Last, 0 );
+
+ for ( int i = 0; i < nbBlocks; ++i )
+ {
+ const _Block& block = skin.getBlock( i );
+
+ int nbX = block.getSide(B_BOTTOM).getHoriSize();
+ int nbY = block.getSide(B_BOTTOM).getVertSize();
+ int nbZ = block.getSide(B_FRONT ).getVertSize();
+
+ int nbHexa = (nbX-1) * (nbY-1) * (nbZ-1);
+ int nbNodes = (nbX-2) * (nbY-2) * (nbZ-2);
+ if ( secondOrder )
+ nbNodes +=
+ (nbX-2) * (nbY-2) * (nbZ-1) +
+ (nbX-2) * (nbY-1) * (nbZ-2) +
+ (nbX-1) * (nbY-2) * (nbZ-2);
+
+
+ nbByType[ entity ] += nbHexa;
+ nbByType[ SMDSEntity_Node ] += nbNodes;
+ }
+
+ return true;
+}
+
+//================================================================================
+/*!
+ * \brief Abstract method must be defined but does nothing
+ */
+//================================================================================
+
+bool StdMeshers_HexaFromSkin_3D::CheckHypothesis(SMESH_Mesh&, const TopoDS_Shape&,
+ Hypothesis_Status& aStatus)
+{
+ aStatus = SMESH_Hypothesis::HYP_OK;
+ return true;
+}
+
+//================================================================================
+/*!
+ * \brief Abstract method must be defined but just reports an error as this
+ * algo is not intended to work with shapes
+ */
+//================================================================================
+
+bool StdMeshers_HexaFromSkin_3D::Compute(SMESH_Mesh&, const TopoDS_Shape&)
+{
+ return error("Algorithm can't work with geometrical shapes");
+}
+
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : StdMeshers_HexaFromSkin_3D.hxx
+// Created : Wed Jan 27 12:23:21 2010
+// Author : Edward AGAPOV (eap)
+//
+#ifndef __StdMeshers_HexaFromSkin_3D_HXX__
+#define __StdMeshers_HexaFromSkin_3D_HXX__
+
+#include "SMESH_StdMeshers.hxx"
+#include "SMESH_3D_Algo.hxx"
+
+/*!
+ * \brief Alorithm generating hexahedral mesh from 2D skin of block
+ */
+
+class STDMESHERS_EXPORT StdMeshers_HexaFromSkin_3D : public SMESH_3D_Algo
+{
+public:
+ StdMeshers_HexaFromSkin_3D(int hypId, int studyId, SMESH_Gen* gen);
+ virtual ~StdMeshers_HexaFromSkin_3D();
+
+ virtual bool Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper);
+
+ virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
+ const TopoDS_Shape& aShape,
+ Hypothesis_Status& aStatus);
+
+ virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
+
+ virtual bool Evaluate(SMESH_Mesh & aMesh,
+ const TopoDS_Shape & aShape,
+ MapShapeNbElems& aResMap);
+
+};
+
+#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Hexa_3D.cxx
// Moved here from SMESH_Hexa_3D.cxx
// Module : SMESH
//
#include "StdMeshers_Hexa_3D.hxx"
+
#include "StdMeshers_CompositeHexa_3D.hxx"
#include "StdMeshers_FaceSide.hxx"
+#include "StdMeshers_HexaFromSkin_3D.hxx"
#include "StdMeshers_Penta_3D.hxx"
#include "StdMeshers_Prism_3D.hxx"
#include "StdMeshers_Quadrangle_2D.hxx"
MESSAGE("StdMeshers_Hexa_3D::StdMeshers_Hexa_3D");
_name = "Hexa_3D";
_shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit /shape type
+ _requireShape = false;
}
//=============================================================================
return true;
}
+//================================================================================
+/*!
+ * \brief Computes hexahedral mesh from 2D mesh of block
+ */
+//================================================================================
+
+bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper)
+{
+ static StdMeshers_HexaFromSkin_3D * algo = 0;
+ if ( !algo ) {
+ SMESH_Gen* gen = aMesh.GetGen();
+ algo = new StdMeshers_HexaFromSkin_3D( gen->GetANewId(), 0, gen );
+ }
+ algo->InitComputeError();
+ algo->Compute( aMesh, aHelper );
+ return error( algo->GetComputeError());
+}
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Hexa_3D.hxx
// Moved here from SMESH_Hexa_3D.hxx
const TopoDS_Shape& aShape,
SMESH_Hypothesis::Hypothesis_Status& aStatus);
- virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape)
- /*throw (SALOME_Exception)*/;
+ virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
+
+ virtual bool Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper);
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
protected:
TopoDS_Edge
EdgeNotInFace(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- const TopoDS_Face& aFace,
- const TopoDS_Vertex& aVertex,
- const TopTools_IndexedDataMapOfShapeListOfShape& MS);
+ const TopoDS_Shape& aShape,
+ const TopoDS_Face& aFace,
+ const TopoDS_Vertex& aVertex,
+ const TopTools_IndexedDataMapOfShapeListOfShape& MS);
int GetFaceIndex(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- const std::vector<SMESH_subMesh*>& meshFaces,
- const TopoDS_Vertex& V0,
- const TopoDS_Vertex& V1,
- const TopoDS_Vertex& V2,
- const TopoDS_Vertex& V3);
+ const TopoDS_Shape& aShape,
+ const std::vector<SMESH_subMesh*>& meshFaces,
+ const TopoDS_Vertex& V0,
+ const TopoDS_Vertex& V1,
+ const TopoDS_Vertex& V2,
+ const TopoDS_Vertex& V3);
void GetConv2DCoefs(const faceQuadStruct& quad,
- const TopoDS_Shape& aShape,
- const TopoDS_Vertex& V0,
- const TopoDS_Vertex& V1,
- const TopoDS_Vertex& V2,
- const TopoDS_Vertex& V3,
- Conv2DStruct& conv);
+ const TopoDS_Shape& aShape,
+ const TopoDS_Vertex& V0,
+ const TopoDS_Vertex& V1,
+ const TopoDS_Vertex& V2,
+ const TopoDS_Vertex& V3,
+ Conv2DStruct& conv);
void GetPoint(Pt3 p,
- int i, int j, int k,
- int nbx, int nby, int nbz,
- Point3DStruct *np,
- const SMESHDS_Mesh* meshDS);
+ int i, int j, int k,
+ int nbx, int nby, int nbz,
+ Point3DStruct *np,
+ const SMESHDS_Mesh* meshDS);
bool ClearAndReturn(FaceQuadStruct* theQuads[6], const bool res);
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_LayerDistribution.cxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_LayerDistribution.hxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_LayerDistribution2D.cxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_LayerDistribution2D.hxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_LengthFromEdges.cxx
// Moved here from SMESH_LengthFromEdges.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_LengthFromEdges.hxx
// Moved here from SMESH_LengthFromEdges.hxx
// Author : Paul RASCLE, EDF
// Module : SMESH
//
-
#ifndef _SMESH_LENGTHFROMEDGES_HXX_
#define _SMESH_LENGTHFROMEDGES_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_LocalLength.cxx
// Moved here from SMESH_LocalLength.cxx
// Author : Paul RASCLE, EDF
// Module : SMESH
//
-
#include "StdMeshers_LocalLength.hxx"
#include "SMESH_Mesh.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_LocalLength.hxx
// Moved here from SMESH_LocalLength.hxx
// Author : Paul RASCLE, EDF
// Module : SMESH
//
-
#ifndef _SMESH_LOCALLENGTH_HXX_
#define _SMESH_LOCALLENGTH_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_MEFISTO_2D.cxx
// Moved here from SMESH_MEFISTO_2D.cxx
//=============================================================================
bool StdMeshers_MEFISTO_2D::Evaluate(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape,
- MapShapeNbElems& aResMap)
+ const TopoDS_Shape & aShape,
+ MapShapeNbElems& aResMap)
{
MESSAGE("StdMeshers_MEFISTO_2D::Evaluate");
// set UV
uvslf[m].x = uvPt->u * scalex;
uvslf[m].y = uvPt->v * scaley;
- if ( uvPt->node->GetPosition()->GetTypeOfPosition() == SMDS_TOP_VERTEX )
+ switch ( uvPt->node->GetPosition()->GetTypeOfPosition())
+ {
+ case SMDS_TOP_VERTEX:
mOnVertex.push_back( m );
+ break;
+ case SMDS_TOP_EDGE:
+ // In order to detect degenerated faces easily, we replace
+ // nodes on a degenerated edge by node on the vertex of that edge
+ if ( myTool->IsDegenShape( uvPt->node->GetPosition()->GetShapeId() ))
+ {
+ int edgeID = uvPt->node->GetPosition()->GetShapeId();
+ SMESH_subMesh* edgeSM = myTool->GetMesh()->GetSubMeshContaining( edgeID );
+ SMESH_subMeshIteratorPtr smIt = edgeSM->getDependsOnIterator( /*includeSelf=*/0,
+ /*complexShapeFirst=*/0);
+ if ( smIt->more() )
+ {
+ SMESH_subMesh* vertexSM = smIt->next();
+ SMDS_NodeIteratorPtr nIt = vertexSM->GetSubMeshDS()->GetNodes();
+ if ( nIt->more() )
+ mefistoToDS[m] = nIt->next();
+ }
+ }
+ break;
+ default:;
+ }
m++;
}
fixOverlappedLinkUV (uvslf[ mB ], uvslf[ m ], uvslf[ mA ]);
}
}
+// cout << "MEFISTO INPUT************" << endl;
+// for ( int i =0; i < m; ++i )
+// cout << i << ": \t" << uvslf[i].x << ", " << uvslf[i].y << " Node " << mefistoToDS[i]->GetID()<< endl;
return true;
}
const SMDS_MeshNode * n2 = mefistoToDS[ nust[m++] - 1 ];
const SMDS_MeshNode * n3 = mefistoToDS[ nust[m++] - 1 ];
- SMDS_MeshElement * elt;
- if (triangleIsWellOriented)
- elt = myTool->AddFace(n1, n2, n3);
- else
- elt = myTool->AddFace(n1, n3, n2);
-
- meshDS->SetMeshElementOnShape(elt, faceID);
+ // avoid creating degenetrated faces
+ bool isDegen = ( myTool->HasDegeneratedEdges() && ( n1 == n2 || n1 == n3 || n2 == n3 ));
+ if ( !isDegen )
+ {
+ SMDS_MeshElement * elt;
+ if (triangleIsWellOriented)
+ elt = myTool->AddFace(n1, n2, n3);
+ else
+ elt = myTool->AddFace(n1, n3, n2);
+ meshDS->SetMeshElementOnShape(elt, faceID);
+ }
m++;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_MEFISTO_2D.hxx
// Moved here from SMESH_MEFISTO_2D.hxx
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
+ const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
typedef std::vector< StdMeshers_FaceSidePtr > TWireVector;
bool LoadPoints(TWireVector & wires,
- R2* uvslf,
- std::vector< const SMDS_MeshNode*>& mefistoToDS,
+ R2* uvslf,
+ std::vector< const SMDS_MeshNode*>& mefistoToDS,
double scalex, double scaley);
void ComputeScaleOnFace(SMESH_Mesh& aMesh,
- const TopoDS_Face& aFace,
- double& scalex,
- double& scaley);
+ const TopoDS_Face& aFace,
+ double& scalex,
+ double& scaley);
void StoreResult (Z nbst, R2* uvst, Z nbt, Z* nust,
- std::vector< const SMDS_MeshNode*>& mefistoToDS,
+ std::vector< const SMDS_MeshNode*>& mefistoToDS,
double scalex, double scaley);
-
+
protected:
double _edgeLength;
double _maxElementArea;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_MaxElementArea.cxx
// Moved here from SMESH_MaxElementArea.cxx
// Author : Paul RASCLE, EDF
// Module : SMESH
//
-
#include "StdMeshers_MaxElementArea.hxx"
#include "SMESH_ControlsDef.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_MaxElementArea.hxx
// Moved here from SMESH_MaxElementArea.hxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_MaxElementVolume.cxx
// Moved here from SMESH_MaxElementVolume.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_MaxElementVolume.hxx
// Moved here from SMESH_MaxElementVolume.hxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-
+//
#ifndef _SMESH_MAXELEMENTVOLUME_HXX_
#define _SMESH_MAXELEMENTVOLUME_HXX_
-// SMESH SMESH : implementaion of SMESH idl descriptions
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
+// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_MaxLength.cxx
// Module : SMESH
-
+//
#include "StdMeshers_MaxLength.hxx"
#include "SMESH_Mesh.hxx"
-// SMESH SMESH : implementaion of SMESH idl descriptions
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_MaxLength.hxx
// Module : SMESH
-
+//
#ifndef _SMESH_MaxLength_HXX_
#define _SMESH_MaxLength_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers : implementaion of SMESH idl descriptions
// File : StdMeshers_NotConformAllowed.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers : implementaion of SMESH idl descriptions
// File : StdMeshers_NotConformAllowed.hxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_NumberOfLayers.cxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_NumberOfLayers.hxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_NumberOfLayers2D.cxx
// Author : Edward AGAPOV
// Module : SMESH
//
-
#include "StdMeshers_NumberOfLayers2D.hxx"
#include "utilities.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_NumberOfLayers2D.hxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_NumberOfSegments.cxx
// Moved here from SMESH_NumberOfSegments.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_NumberOfSegments.hxx
// Moved here from SMESH_NumberOfSegments.hxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers_Penta_3D implementaion of SMESH idl descriptions
// File : StdMeshers_Penta_3D.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers : implementaion of SMESH idl descriptions
// File : StdMeshers_Penta_3D.hxx
// Module : SMESH
void Load (const TopoDS_Shell& theShell);
void Load (const TopoDS_Shell& theShell,
- const TopoDS_Vertex& theV000,
- const TopoDS_Vertex& theV001);
+ const TopoDS_Vertex& theV000,
+ const TopoDS_Vertex& theV001);
void ComputeParameters(const gp_Pnt& thePnt,
- gp_XYZ& theXYZ);
+ gp_XYZ& theXYZ);
void ComputeParameters(const gp_Pnt& thePnt,
- const TopoDS_Shape& theShape,
- gp_XYZ& theXYZ);
+ const TopoDS_Shape& theShape,
+ gp_XYZ& theXYZ);
void ComputeParameters(const double& theU,
- const TopoDS_Shape& theShape,
- gp_XYZ& theXYZ);
+ const TopoDS_Shape& theShape,
+ gp_XYZ& theXYZ);
void Point(const gp_XYZ& theParams,
- gp_Pnt& thePnt);
+ gp_Pnt& thePnt);
void Point(const gp_XYZ& theParams,
- const TopoDS_Shape& theShape,
- gp_Pnt& thePnt);
+ const TopoDS_Shape& theShape,
+ gp_Pnt& thePnt);
int ShapeID(const TopoDS_Shape& theShape);
// 0-the node on theBaseEdge.
bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
- MapShapeNbElems& aResMap);
+ MapShapeNbElems& aResMap);
protected: // methods
std::vector<const SMDS_MeshNode*>*& aCol2);
void ShapeSupportID(const bool theIsUpperLayer,
- const SMESH_Block::TShapeID theBNSSID,
- SMESH_Block::TShapeID& theSSID);
+ const SMESH_Block::TShapeID theBNSSID,
+ SMESH_Block::TShapeID& theSSID);
void FindNodeOnShape(const TopoDS_Shape& aS,
- const gp_XYZ& aParams,
+ const gp_XYZ& aParams,
const int z,
- StdMeshers_TNode& aTN);
+ StdMeshers_TNode& aTN);
void CreateNode(const bool theIsUpperLayer,
- const gp_XYZ& aParams,
- StdMeshers_TNode& aTN);
+ const gp_XYZ& aParams,
+ StdMeshers_TNode& aTN);
void ClearMeshOnFxy1();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Prism_3D.cxx
// Module : SMESH
#include "utilities.h"
#include <BRep_Tool.hxx>
+#include <Bnd_B3d.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2d_Line.hxx>
+#include <Geom_Curve.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TopTools_SequenceOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
+#include <TopTools_SequenceOfShape.hxx>
#include <TopoDS.hxx>
+#include <gp_Ax2.hxx>
+#include <gp_Ax3.hxx>
using namespace std;
}
params.push_back( parLast ); // 1.
}
+
+ //================================================================================
+ /*!
+ * \brief Return coordinate system for z-th layer of nodes
+ */
+ //================================================================================
+
+ gp_Ax2 getLayerCoordSys(const int z,
+ const vector< const TNodeColumn* >& columns,
+ int& xColumn)
+ {
+ // gravity center of a layer
+ gp_XYZ O(0,0,0);
+ int vertexCol = -1;
+ for ( int i = 0; i < columns.size(); ++i )
+ {
+ O += gpXYZ( (*columns[ i ])[ z ]);
+ if ( vertexCol < 0 &&
+ columns[ i ]->front()->GetPosition()->GetTypeOfPosition() == SMDS_TOP_VERTEX )
+ vertexCol = i;
+ }
+ O /= columns.size();
+
+ // Z axis
+ gp_Vec Z(0,0,0);
+ int iPrev = columns.size()-1;
+ for ( int i = 0; i < columns.size(); ++i )
+ {
+ gp_Vec v1( O, gpXYZ( (*columns[ iPrev ])[ z ]));
+ gp_Vec v2( O, gpXYZ( (*columns[ i ] )[ z ]));
+ Z += v1 ^ v2;
+ iPrev = i;
+ }
+
+ if ( vertexCol >= 0 )
+ {
+ O = gpXYZ( (*columns[ vertexCol ])[ z ]);
+ }
+ if ( xColumn < 0 || xColumn >= columns.size() )
+ {
+ // select a column for X dir
+ double maxDist = 0;
+ for ( int i = 0; i < columns.size(); ++i )
+ {
+ double dist = ( O - gpXYZ((*columns[ i ])[ z ])).SquareModulus();
+ if ( dist > maxDist )
+ {
+ xColumn = i;
+ maxDist = dist;
+ }
+ }
+ }
+
+ // X axis
+ gp_Vec X( O, gpXYZ( (*columns[ xColumn ])[ z ]));
+
+ return gp_Ax2( O, Z, X);
+ }
+
+ //================================================================================
+ /*!
+ * \brief Removes submeshes meshed with regular grid from given list
+ * \retval int - nb of removed submeshes
+ */
+ //================================================================================
+
+ int removeQuasiQuads(list< SMESH_subMesh* >& notQuadSubMesh)
+ {
+ int oldNbSM = notQuadSubMesh.size();
+ SMESHDS_Mesh* mesh = notQuadSubMesh.front()->GetFather()->GetMeshDS();
+ list< SMESH_subMesh* >::iterator smIt = notQuadSubMesh.begin();
+#define __NEXT_SM { ++smIt; continue; }
+ while ( smIt != notQuadSubMesh.end() )
+ {
+ SMESH_subMesh* faceSm = *smIt;
+ SMESHDS_SubMesh* faceSmDS = faceSm->GetSubMeshDS();
+ int nbQuads = faceSmDS->NbElements();
+ if ( nbQuads == 0 ) __NEXT_SM;
+
+ // get oredered edges
+ list< TopoDS_Edge > orderedEdges;
+ list< int > nbEdgesInWires;
+ TopoDS_Vertex V000;
+ int nbWires = SMESH_Block::GetOrderedEdges( TopoDS::Face( faceSm->GetSubShape() ),
+ V000, orderedEdges, nbEdgesInWires );
+ if ( nbWires != 1 || nbEdgesInWires.front() <= 4 )
+ __NEXT_SM;
+
+ // get nb of segements on edges
+ list<int> nbSegOnEdge;
+ list< TopoDS_Edge >::iterator edge = orderedEdges.begin();
+ for ( ; edge != orderedEdges.end(); ++edge )
+ {
+ if ( SMESHDS_SubMesh* edgeSmDS = mesh->MeshElements( *edge ))
+ nbSegOnEdge.push_back( edgeSmDS->NbElements() );
+ else
+ nbSegOnEdge.push_back(0);
+ }
+
+ // unite nbSegOnEdge of continues edges
+ int nbEdges = nbEdgesInWires.front();
+ list<int>::iterator nbSegIt = nbSegOnEdge.begin();
+ for ( edge = orderedEdges.begin(); edge != orderedEdges.end(); )
+ {
+ const TopoDS_Edge& e1 = *edge++;
+ const TopoDS_Edge& e2 = ( edge == orderedEdges.end() ? orderedEdges.front() : *edge );
+ if ( SMESH_Algo::IsContinuous( e1, e2 ))
+ {
+ // common vertex of continues edges must be shared by two 2D mesh elems of geom face
+ TopoDS_Vertex vCommon = TopExp::LastVertex( e1, true );
+ const SMDS_MeshNode* vNode = SMESH_Algo::VertexNode( vCommon, mesh );
+ int nbF = 0;
+ if ( vNode )
+ {
+ SMDS_ElemIteratorPtr fIt = vNode->GetInverseElementIterator(SMDSAbs_Face);
+ while ( fIt->more() )
+ nbF += faceSmDS->Contains( fIt->next() );
+ }
+ list<int>::iterator nbSegIt1 = nbSegIt++;
+ if ( !vNode || nbF == 2 ) // !vNode - two edges can be meshed as one
+ {
+ // unite
+ if ( nbSegIt == nbSegOnEdge.end() ) nbSegIt = nbSegOnEdge.begin();
+ *nbSegIt += *nbSegIt1;
+ nbSegOnEdge.erase( nbSegIt1 );
+ --nbEdges;
+ }
+ }
+ else
+ {
+ ++nbSegIt;
+ }
+ }
+ vector<int> nbSegVec( nbSegOnEdge.begin(), nbSegOnEdge.end());
+ if ( nbSegVec.size() == 4 &&
+ nbSegVec[0] == nbSegVec[2] &&
+ nbSegVec[1] == nbSegVec[3] &&
+ nbSegVec[0] * nbSegVec[1] == nbQuads
+ )
+ smIt = notQuadSubMesh.erase( smIt );
+ else
+ __NEXT_SM;
+ }
+
+ return oldNbSM - notQuadSubMesh.size();
+ }
}
//=======================================================================
:SMESH_3D_Algo(hypId, studyId, gen)
{
_name = "Prism_3D";
- _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit per shape type
+ _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit per shape type
myProjectTriangles = false;
}
// Projections on the top and bottom faces are taken from nodes existing
// on these faces; find correspondence between bottom and top nodes
myBotToColumnMap.clear();
- if ( !assocOrProjBottom2Top() ) // it also fill myBotToColumnMap
+ if ( !assocOrProjBottom2Top() ) // it also fills myBotToColumnMap
return false;
// Create nodes inside the block
- // loop on nodes inside the bottom face
- TNode2ColumnMap::iterator bot_column = myBotToColumnMap.begin();
- for ( ; bot_column != myBotToColumnMap.end(); ++bot_column )
+ // try to use transformation (issue 0020680)
+ vector<gp_Trsf> trsf;
+ if ( myBlock.GetLayersTransformation(trsf))
{
- const TNode& tBotNode = bot_column->first; // bottom TNode
- if ( tBotNode.GetPositionType() != SMDS_TOP_FACE )
- continue; // node is not inside face
-
- // column nodes; middle part of the column are zero pointers
- TNodeColumn& column = bot_column->second;
-
- // bottom node parameters and coords
- myShapeXYZ[ ID_BOT_FACE ] = tBotNode.GetCoords();
- gp_XYZ botParams = tBotNode.GetParams();
-
- // compute top node parameters
- myShapeXYZ[ ID_TOP_FACE ] = gpXYZ( column.back() );
- gp_XYZ topParams = botParams;
- topParams.SetZ( 1 );
- if ( column.size() > 2 ) {
- gp_Pnt topCoords = myShapeXYZ[ ID_TOP_FACE ];
- if ( !myBlock.ComputeParameters( topCoords, topParams, ID_TOP_FACE, topParams ))
- return error(TCom("Can't compute normalized parameters ")
- << "for node " << column.back()->GetID()
- << " on the face #"<< column.back()->GetPosition()->GetShapeId() );
- }
+ // loop on nodes inside the bottom face
+ TNode2ColumnMap::iterator bot_column = myBotToColumnMap.begin();
+ for ( ; bot_column != myBotToColumnMap.end(); ++bot_column )
+ {
+ const TNode& tBotNode = bot_column->first; // bottom TNode
+ if ( tBotNode.GetPositionType() != SMDS_TOP_FACE )
+ continue; // node is not inside face
+
+ // column nodes; middle part of the column are zero pointers
+ TNodeColumn& column = bot_column->second;
+ TNodeColumn::iterator columnNodes = column.begin();
+ for ( int z = 0; columnNodes != column.end(); ++columnNodes, ++z)
+ {
+ const SMDS_MeshNode* & node = *columnNodes;
+ if ( node ) continue; // skip bottom or top node
- // vertical loop
- TNodeColumn::iterator columnNodes = column.begin();
- for ( int z = 0; columnNodes != column.end(); ++columnNodes, ++z)
+ gp_XYZ coords = tBotNode.GetCoords();
+ trsf[z-1].Transforms( coords );
+ node = meshDS->AddNode( coords.X(), coords.Y(), coords.Z() );
+ meshDS->SetNodeInVolume( node, volumeID );
+ }
+ } // loop on bottom nodes
+ }
+ else // use block approach
+ {
+ // loop on nodes inside the bottom face
+ TNode prevBNode;
+ TNode2ColumnMap::iterator bot_column = myBotToColumnMap.begin();
+ for ( ; bot_column != myBotToColumnMap.end(); ++bot_column )
{
- const SMDS_MeshNode* & node = *columnNodes;
- if ( node ) continue; // skip bottom or top node
-
- // params of a node to create
- double rz = (double) z / (double) ( column.size() - 1 );
- gp_XYZ params = botParams * ( 1 - rz ) + topParams * rz;
-
- // set coords on all faces and nodes
- const int nbSideFaces = 4;
- int sideFaceIDs[nbSideFaces] = { SMESH_Block::ID_Fx0z,
- SMESH_Block::ID_Fx1z,
- SMESH_Block::ID_F0yz,
- SMESH_Block::ID_F1yz };
- for ( int iF = 0; iF < nbSideFaces; ++iF )
- if ( !setFaceAndEdgesXYZ( sideFaceIDs[ iF ], params, z ))
- return false;
-
- // compute coords for a new node
- gp_XYZ coords;
- if ( !SMESH_Block::ShellPoint( params, myShapeXYZ, coords ))
- return error("Can't compute coordinates by normalized parameters");
-
- SHOWYXZ("TOPFacePoint ",myShapeXYZ[ ID_TOP_FACE]);
- SHOWYXZ("BOT Node "<< tBotNode.myNode->GetID(),gpXYZ(tBotNode.myNode));
- SHOWYXZ("ShellPoint ",coords);
-
- // create a node
- node = meshDS->AddNode( coords.X(), coords.Y(), coords.Z() );
- meshDS->SetNodeInVolume( node, volumeID );
- }
- } // loop on bottom nodes
+ const TNode& tBotNode = bot_column->first; // bottom TNode
+ if ( tBotNode.GetPositionType() != SMDS_TOP_FACE )
+ continue; // node is not inside face
+ // column nodes; middle part of the column are zero pointers
+ TNodeColumn& column = bot_column->second;
+
+ // compute bottom node parameters
+ gp_XYZ paramHint(-1,-1,-1);
+ if ( prevBNode.IsNeighbor( tBotNode ))
+ paramHint = prevBNode.GetParams();
+ if ( !myBlock.ComputeParameters( tBotNode.GetCoords(), tBotNode.ChangeParams(),
+ ID_BOT_FACE, paramHint ))
+ return error(TCom("Can't compute normalized parameters for node ")
+ << tBotNode.myNode->GetID() << " on the face #"
+ << myBlock.SubMesh( ID_BOT_FACE )->GetId() );
+ prevBNode = tBotNode;
+
+ myShapeXYZ[ ID_BOT_FACE ] = tBotNode.GetCoords();
+ gp_XYZ botParams = tBotNode.GetParams();
+
+ // compute top node parameters
+ myShapeXYZ[ ID_TOP_FACE ] = gpXYZ( column.back() );
+ gp_XYZ topParams = botParams;
+ topParams.SetZ( 1 );
+ if ( column.size() > 2 ) {
+ gp_Pnt topCoords = myShapeXYZ[ ID_TOP_FACE ];
+ if ( !myBlock.ComputeParameters( topCoords, topParams, ID_TOP_FACE, topParams ))
+ return error(TCom("Can't compute normalized parameters ")
+ << "for node " << column.back()->GetID()
+ << " on the face #"<< column.back()->GetPosition()->GetShapeId() );
+ }
+
+ // vertical loop
+ TNodeColumn::iterator columnNodes = column.begin();
+ for ( int z = 0; columnNodes != column.end(); ++columnNodes, ++z)
+ {
+ const SMDS_MeshNode* & node = *columnNodes;
+ if ( node ) continue; // skip bottom or top node
+
+ // params of a node to create
+ double rz = (double) z / (double) ( column.size() - 1 );
+ gp_XYZ params = botParams * ( 1 - rz ) + topParams * rz;
+
+ // set coords on all faces and nodes
+ const int nbSideFaces = 4;
+ int sideFaceIDs[nbSideFaces] = { SMESH_Block::ID_Fx0z,
+ SMESH_Block::ID_Fx1z,
+ SMESH_Block::ID_F0yz,
+ SMESH_Block::ID_F1yz };
+ for ( int iF = 0; iF < nbSideFaces; ++iF )
+ if ( !setFaceAndEdgesXYZ( sideFaceIDs[ iF ], params, z ))
+ return false;
+
+ // compute coords for a new node
+ gp_XYZ coords;
+ if ( !SMESH_Block::ShellPoint( params, myShapeXYZ, coords ))
+ return error("Can't compute coordinates by normalized parameters");
+
+ SHOWYXZ("TOPFacePoint ",myShapeXYZ[ ID_TOP_FACE]);
+ SHOWYXZ("BOT Node "<< tBotNode.myNode->GetID(),gpXYZ(tBotNode.myNode));
+ SHOWYXZ("ShellPoint ",coords);
+
+ // create a node
+ node = meshDS->AddNode( coords.X(), coords.Y(), coords.Z() );
+ meshDS->SetNodeInVolume( node, volumeID );
+ }
+ } // loop on bottom nodes
+ }
// Create volumes
{
const SMDS_MeshNode* n = face->GetNode( i );
if ( n->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ) {
- bot_column = myBotToColumnMap.find( n );
+ TNode2ColumnMap::iterator bot_column = myBotToColumnMap.find( n );
if ( bot_column == myBotToColumnMap.end() )
return error(TCom("No nodes found above node ") << n->GetID() );
columns[ i ] = & bot_column->second;
//=======================================================================
bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh& theMesh,
- const TopoDS_Shape& theShape,
- MapShapeNbElems& aResMap)
+ const TopoDS_Shape& theShape,
+ MapShapeNbElems& aResMap)
{
// find face contains only triangles
vector < SMESH_subMesh * >meshFaces;
bool IsOpposite = true;
for(TopExp_Explorer exp(aFaces.Value(i), TopAbs_EDGE); exp.More(); exp.Next()) {
if( Edges1.Contains(exp.Current()) ) {
- IsOpposite = false;
- break;
+ IsOpposite = false;
+ break;
}
}
if(IsOpposite) {
// Fill myBotToColumnMap
int zSize = myBlock.VerticalSize();
- TNode prevTNode;
+ //TNode prevTNode;
TNodeNodeMap::iterator bN_tN = n2nMap.begin();
for ( ; bN_tN != n2nMap.end(); ++bN_tN )
{
const SMDS_MeshNode* topNode = bN_tN->second;
if ( botNode->GetPosition()->GetTypeOfPosition() != SMDS_TOP_FACE )
continue; // wall columns are contained in myBlock
- // compute bottom node params
- TNode bN( botNode );
- if ( zSize > 2 ) {
- gp_XYZ paramHint(-1,-1,-1);
- if ( prevTNode.IsNeighbor( bN ))
- paramHint = prevTNode.GetParams();
- if ( !myBlock.ComputeParameters( bN.GetCoords(), bN.ChangeParams(),
- ID_BOT_FACE, paramHint ))
- return error(TCom("Can't compute normalized parameters for node ")
- << botNode->GetID() << " on the face #"<< botSM->GetId() );
- prevTNode = bN;
- }
// create node column
+ TNode bN( botNode );
TNode2ColumnMap::iterator bN_col =
myBotToColumnMap.insert( make_pair ( bN, TNodeColumn() )).first;
TNodeColumn & column = bN_col->second;
SMESH_Block::GetFaceEdgesIDs( faceID, edgeVec );
myBlock.EdgePoint( edgeVec[ BASE ], params, myShapeXYZ[ edgeVec[ BASE ]]);
- myBlock.EdgePoint( edgeVec[ TOP ], params, myShapeXYZ[ edgeVec[ TOP ]]);
+ myBlock.EdgePoint( edgeVec[ TOP ], params, myShapeXYZ[ edgeVec[ TOP ]]);
SHOWYXZ("\nparams ", params);
- SHOWYXZ("TOP is "<<edgeVec[ TOP], myShapeXYZ[ edgeVec[ TOP]]);
+ SHOWYXZ("TOP is " <<edgeVec[ TOP ], myShapeXYZ[ edgeVec[ TOP]]);
SHOWYXZ("BASE is "<<edgeVec[ BASE], myShapeXYZ[ edgeVec[ BASE]]);
if ( faceID == SMESH_Block::ID_Fx0z || faceID == SMESH_Block::ID_Fx1z )
}
// ----------------------------------------------------------------------
- // Analyse faces mesh and topology: choose the bottom submesh.
+ // Analyse mesh and topology of faces: choose the bottom submesh.
// If there are not quadrangle geom faces, they are top and bottom ones.
// Not quadrangle geom faces must be only on top and bottom.
// ----------------------------------------------------------------------
bool hasNotQuad = ( nbNotQuad || nbNotQuadMeshed );
// detect bad cases
- if ( nbNotQuad > 0 && nbNotQuad != 2 )
- return error(COMPERR_BAD_SHAPE,
- TCom("More than 2 not quadrilateral faces: ")
- <<nbNotQuad);
if ( nbNotQuadMeshed > 2 )
+ {
return error(COMPERR_BAD_INPUT_MESH,
TCom("More than 2 faces with not quadrangle elements: ")
<<nbNotQuadMeshed);
+ }
+ int nbQuasiQuads = 0;
+ if ( nbNotQuad > 0 && nbNotQuad != 2 )
+ {
+ // Issue 0020843 - one of side faces is quasi-quadrilateral.
+ // Remove from notQuadGeomSubMesh faces meshed with regular grid
+ nbQuasiQuads = removeQuasiQuads( notQuadGeomSubMesh );
+ nbNotQuad -= nbQuasiQuads;
+ if ( nbNotQuad > 0 && nbNotQuad != 2 )
+ return error(COMPERR_BAD_SHAPE,
+ TCom("More than 2 not quadrilateral faces: ")
+ <<nbNotQuad);
+ }
// get found submeshes
if ( hasNotQuad )
break;
}
}
+ //sideFace->dumpNodes( 4 ); // debug
}
// horizontal faces geometry
{
return 0;
}
+//=======================================================================
+//function : GetLayersTransformation
+//purpose : Return transformations to get coordinates of nodes of each layer
+// by nodes of the bottom. Layer is a set of nodes at a certain step
+// from bottom to top.
+//=======================================================================
+
+bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector<gp_Trsf> & trsf) const
+{
+ const int zSize = VerticalSize();
+ if ( zSize < 3 ) return true;
+ trsf.resize( zSize - 2 );
+
+ // Select some node columns by which we will define coordinate system of layers
+
+ vector< const TNodeColumn* > columns;
+ {
+ const TopoDS_Shape& baseFace = Shape(ID_BOT_FACE);
+ list< TopoDS_Edge > orderedEdges;
+ list< int > nbEdgesInWires;
+ GetOrderedEdges( TopoDS::Face( baseFace ), TopoDS_Vertex(), orderedEdges, nbEdgesInWires );
+ bool isReverse;
+ list< TopoDS_Edge >::iterator edgeIt = orderedEdges.begin();
+ for ( int iE = 0; iE < nbEdgesInWires.front(); ++iE, ++edgeIt )
+ {
+ const TParam2ColumnMap& u2colMap =
+ GetParam2ColumnMap( myHelper->GetMeshDS()->ShapeToIndex( *edgeIt ), isReverse );
+ isReverse = ( edgeIt->Orientation() == TopAbs_REVERSED );
+ double f = u2colMap.begin()->first, l = u2colMap.rbegin()->first;
+ if ( isReverse ) swap ( f, l );
+ const int nbCol = 5;
+ for ( int i = 0; i < nbCol; ++i )
+ {
+ double u = f + i/double(nbCol) * ( l - f );
+ const TNodeColumn* col = & getColumn( & u2colMap, u )->second;
+ if ( columns.empty() || col != columns.back() )
+ columns.push_back( col );
+ }
+ }
+ }
+
+ // Find tolerance to check transformations
+
+ double tol2;
+ {
+ Bnd_B3d bndBox;
+ for ( int i = 0; i < columns.size(); ++i )
+ bndBox.Add( gpXYZ( columns[i]->front() ));
+ tol2 = bndBox.SquareExtent() * 4 * 1e-4;
+ }
+
+ // Compute transformations
+
+ int xCol = -1;
+ gp_Trsf fromCsZ, toCs0;
+ gp_Ax3 cs0 = getLayerCoordSys(0, columns, xCol );
+ //double dist0 = cs0.Location().Distance( gpXYZ( (*columns[0])[0]));
+ toCs0.SetTransformation( cs0 );
+ for ( int z = 1; z < zSize-1; ++z )
+ {
+ gp_Ax3 csZ = getLayerCoordSys(z, columns, xCol );
+ //double distZ = csZ.Location().Distance( gpXYZ( (*columns[0])[z]));
+ fromCsZ.SetTransformation( csZ );
+ fromCsZ.Invert();
+ gp_Trsf& t = trsf[ z-1 ];
+ t = fromCsZ * toCs0;
+ //t.SetScaleFactor( distZ/dist0 ); - it does not work properly, wrong base point
+
+ // check a transformation
+ for ( int i = 0; i < columns.size(); ++i )
+ {
+ gp_Pnt p0 = gpXYZ( (*columns[i])[0] );
+ gp_Pnt pz = gpXYZ( (*columns[i])[z] );
+ t.Transforms( p0.ChangeCoord() );
+ if ( p0.SquareDistance( pz ) > tol2 )
+ return false;
+ }
+ }
+ return true;
+}
+
//================================================================================
/*!
* \brief Check curve orientation of a bootom edge
}
//================================================================================
- /*!
- * \brief Find wall faces by bottom edges
- * \param mesh - the mesh
- * \param mainShape - the prism
- * \param bottomFace - the bottom face
- * \param bottomEdges - edges bounding the bottom face
- * \param wallFaces - faces list to fill in
- */
+/*!
+ * \brief Find wall faces by bottom edges
+ * \param mesh - the mesh
+ * \param mainShape - the prism
+ * \param bottomFace - the bottom face
+ * \param bottomEdges - edges bounding the bottom face
+ * \param wallFaces - faces list to fill in
+ */
//================================================================================
bool StdMeshers_PrismAsBlock::GetWallFaces( SMESH_Mesh* mesh,
r = 0.5;
}
else {
-// if ( !myIsForward )
-// std::swap( col1, col2 );
double uf = col1->first;
double ul = col2->first;
r = ( u - uf ) / ( ul - uf );
gp_Pnt StdMeshers_PrismAsBlock::TSideFace::Value(const Standard_Real U,
const Standard_Real V) const
{
- double u;
if ( !myComponents.empty() ) {
+ double u;
TSideFace * comp = GetComponent(U,u);
return comp->Value( u, V );
}
const SMDS_MeshNode* n2 = 0;
const SMDS_MeshNode* n3 = 0;
const SMDS_MeshNode* n4 = 0;
- gp_XYZ pnt;
+
+ // BEGIN issue 0020680: EDF 1252 SMESH: Bad cell created by Radial prism in center of torus
+ // Workaround for a wrongly located point returned by mySurface.Value() for
+ // UV located near boundary of BSpline surface.
+ // To bypass the problem, we take point from 3D curve of edge.
+ // It solves pb of the bloc_fiss_new.py
+ const double tol = 1e-3;
+ if ( V < tol || V+tol >= 1. )
+ {
+ n1 = V < tol ? u_col1->second.front() : u_col1->second.back();
+ n3 = V < tol ? u_col2->second.front() : u_col2->second.back();
+ TopoDS_Edge edge;
+ if ( V < tol )
+ {
+ edge = myBaseEdge;
+ }
+ else
+ {
+ TopoDS_Shape s = myHelper->GetSubShapeByNode( n1, myHelper->GetMeshDS() );
+ if ( s.ShapeType() != TopAbs_EDGE )
+ s = myHelper->GetSubShapeByNode( n3, myHelper->GetMeshDS() );
+ if ( s.ShapeType() == TopAbs_EDGE )
+ edge = TopoDS::Edge( s );
+ }
+ if ( !edge.IsNull() )
+ {
+ double u1 = myHelper->GetNodeU( edge, n1 );
+ double u3 = myHelper->GetNodeU( edge, n3 );
+ double u = u1 * ( 1 - hR ) + u3 * hR;
+ TopLoc_Location loc; double f,l;
+ Handle(Geom_Curve) curve = BRep_Tool::Curve( edge,loc,f,l );
+ return curve->Value( u ).Transformed( loc );
+ }
+ }
+ // END issue 0020680: EDF 1252 SMESH: Bad cell created by Radial prism in center of torus
vR = getRAndNodes( & u_col1->second, V, n1, n2 );
vR = getRAndNodes( & u_col2->second, V, n3, n4 );
gp_XY uv34 = uv3 * ( 1 - vR ) + uv4 * vR;
gp_XY uv = uv12 * ( 1 - hR ) + uv34 * hR;
-
- return mySurface.Value( uv.X(), uv.Y() );
+
+ gp_Pnt p = mySurface.Value( uv.X(), uv.Y() );
+ return p;
}
return nbInserted;
}
+//================================================================================
+/*!
+ * \brief Dump ids of nodes of sides
+ */
+//================================================================================
+
+void StdMeshers_PrismAsBlock::TSideFace::dumpNodes(int nbNodes) const
+{
+#ifdef _DEBUG_
+ cout << endl << "NODES OF FACE "; SMESH_Block::DumpShapeID( myID, cout ) << endl;
+ THorizontalEdgeAdaptor* hSize0 = (THorizontalEdgeAdaptor*) HorizCurve(0);
+ cout << "Horiz side 0: "; hSize0->dumpNodes(nbNodes); cout << endl;
+ THorizontalEdgeAdaptor* hSize1 = (THorizontalEdgeAdaptor*) HorizCurve(1);
+ cout << "Horiz side 1: "; hSize1->dumpNodes(nbNodes); cout << endl;
+ TVerticalEdgeAdaptor* vSide0 = (TVerticalEdgeAdaptor*) VertiCurve(0);
+ cout << "Verti side 0: "; vSide0->dumpNodes(nbNodes); cout << endl;
+ TVerticalEdgeAdaptor* vSide1 = (TVerticalEdgeAdaptor*) VertiCurve(1);
+ cout << "Verti side 1: "; vSide1->dumpNodes(nbNodes); cout << endl;
+ delete hSize0; delete hSize1; delete vSide0; delete vSide1;
+#endif
+}
+
//================================================================================
/*!
* \brief Creates TVerticalEdgeAdaptor
return gpXYZ(n1) * ( 1 - r ) + gpXYZ(n2) * r;
}
+//================================================================================
+/*!
+ * \brief Dump ids of nodes
+ */
+//================================================================================
+
+void StdMeshers_PrismAsBlock::TVerticalEdgeAdaptor::dumpNodes(int nbNodes) const
+{
+#ifdef _DEBUG_
+ for ( int i = 0; i < nbNodes && i < myNodeColumn->size(); ++i )
+ cout << (*myNodeColumn)[i]->GetID() << " ";
+ if ( nbNodes < myNodeColumn->size() )
+ cout << myNodeColumn->back()->GetID();
+#endif
+}
+
//================================================================================
/*!
* \brief Return coordinates for the given normalized parameter
return mySide->TSideFace::Value( U, myV );
}
+//================================================================================
+/*!
+ * \brief Dump ids of <nbNodes> first nodes and the last one
+ */
+//================================================================================
+
+void StdMeshers_PrismAsBlock::THorizontalEdgeAdaptor::dumpNodes(int nbNodes) const
+{
+#ifdef _DEBUG_
+ // Not bedugged code. Last node is sometimes incorrect
+ const TSideFace* side = mySide;
+ double u = 0;
+ if ( mySide->IsComplex() )
+ side = mySide->GetComponent(0,u);
+
+ TParam2ColumnIt col, col2;
+ TParam2ColumnMap* u2cols = side->GetColumns();
+ side->GetColumns( u , col, col2 );
+
+ int j, i = myV ? mySide->ColumnHeight()-1 : 0;
+
+ const SMDS_MeshNode* n = 0;
+ const SMDS_MeshNode* lastN
+ = side->IsForward() ? u2cols->rbegin()->second[ i ] : u2cols->begin()->second[ i ];
+ for ( j = 0; j < nbNodes && n != lastN; ++j )
+ {
+ n = col->second[ i ];
+ cout << n->GetID() << " ";
+ if ( side->IsForward() )
+ ++col;
+ else
+ --col;
+ }
+
+ // last node
+ u = 1;
+ if ( mySide->IsComplex() )
+ side = mySide->GetComponent(1,u);
+
+ side->GetColumns( u , col, col2 );
+ if ( n != col->second[ i ] )
+ cout << col->second[ i ]->GetID();
+#endif
+}
//================================================================================
/*!
* \brief Return UV on pcurve for the given normalized parameter
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Prism_3D.hxx
// Module : SMESH
#include <BRepAdaptor_Surface.hxx>
#include <TopTools_IndexedMapOfOrientedShape.hxx>
#include <gp_XYZ.hxx>
+#include <gp_Trsf.hxx>
class SMESHDS_SubMesh;
// map of bottom nodes to the column of nodes above them
// (the column includes the bottom nodes)
-typedef std::map< TNode, TNodeColumn > TNode2ColumnMap;
+typedef std::map< TNode, TNodeColumn > TNode2ColumnMap;
typedef std::map< double, TNodeColumn > TParam2ColumnMap;
typedef std::map< double, TNodeColumn >::const_iterator TParam2ColumnIt;
struct TNode
{
const SMDS_MeshNode* myNode;
- gp_XYZ myParams;
+ mutable gp_XYZ myParams;
gp_XYZ GetCoords() const { return gp_XYZ( myNode->X(), myNode->Y(), myNode->Z() ); }
gp_XYZ GetParams() const { return myParams; }
- gp_XYZ& ChangeParams() { return myParams; }
+ gp_XYZ& ChangeParams() const { return myParams; }
bool HasParams() const { return myParams.X() >= 0.0; }
SMDS_TypeOfPosition GetPositionType() const
{ return myNode ? myNode->GetPosition()->GetTypeOfPosition() : SMDS_TOP_UNSPEC; }
* \retval const TParam2ColumnMap& - map
*/
const TParam2ColumnMap& GetParam2ColumnMap(const int baseEdgeID,
- bool & isReverse)
+ bool & isReverse) const
{
- std::pair< TParam2ColumnMap*, bool > & col_frw =
- myShapeIndex2ColumnMap[ baseEdgeID ];
+ std::pair< TParam2ColumnMap*, bool > col_frw =
+ myShapeIndex2ColumnMap.find( baseEdgeID )->second;
isReverse = !col_frw.second;
return * col_frw.first;
}
+
+ /*!
+ * \brief Return transformations to get coordinates of nodes of each internal layer
+ * by nodes of the bottom. Layer is a set of nodes at a certain step
+ * from bottom to top.
+ */
+ bool GetLayersTransformation(std::vector<gp_Trsf> & trsf) const;
/*!
* \brief Return pointer to mesh
int InsertSubShapes( TBlockShapes& shapeMap ) const;
// redefine Adaptor methods
gp_Pnt Value(const Standard_Real U,const Standard_Real V) const;
+ // debug
+ void dumpNodes(int nbNodes) const;
};
// --------------------------------------------------------------------
gp_Pnt Value(const Standard_Real U) const;
Standard_Real FirstParameter() const { return 0; }
Standard_Real LastParameter() const { return 1; }
+ // debug
+ void dumpNodes(int nbNodes) const;
};
// --------------------------------------------------------------------
gp_Pnt Value(const Standard_Real U) const;
Standard_Real FirstParameter() const { return 0; }
Standard_Real LastParameter() const { return 1; }
+ // debug
+ void dumpNodes(int nbNodes) const;
};
// --------------------------------------------------------------------
Standard_Real FirstParameter() const { return 0; }
Standard_Real LastParameter() const { return 1; }
};
- // --------------------------------------------------------------------
- bool myNotQuadOnTop;
- SMESH_MesherHelper* myHelper;
- TBlockShapes myShapeIDMap;
+ bool myNotQuadOnTop;
+ SMESH_MesherHelper* myHelper;
+ TBlockShapes myShapeIDMap;
+ SMESH_ComputeErrorPtr myError;
// container of 4 side faces
- TSideFace* mySide;
+ TSideFace* mySide;
// node columns for each base edge
- std::vector< TParam2ColumnMap > myParam2ColumnMaps;
+ std::vector< TParam2ColumnMap > myParam2ColumnMaps;
// to find a column for a node by edge SMESHDS Index
std::map< int, std::pair< TParam2ColumnMap*, bool > > myShapeIndex2ColumnMap;
- SMESH_ComputeErrorPtr myError;
/*!
* \brief store error and comment and then return ( error == COMPERR_OK )
*/
myError = SMESH_ComputeError::New(error,comment);
return myError->IsOK();
}
- //std::vector< SMESH_subMesh* > mySubMeshesVec; // submesh by in-block id
};
// =============================================
StdMeshers_PrismAsBlock myBlock;
SMESH_MesherHelper* myHelper;
- std::vector<gp_XYZ> myShapeXYZ; // point on each sub-shape
+ std::vector<gp_XYZ> myShapeXYZ; // point on each sub-shape of the block
// map of bottom nodes to the column of nodes above them
// (the column includes the bottom node)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_ProjectionSource1D.cxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_ProjectionSource1D.hxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_ProjectionSource2D.cxx
// Author : Edward AGAPOV
// Module : SMESH
-
+//
#include "StdMeshers_ProjectionSource2D.hxx"
#include "SMESH_Mesh.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_ProjectionSource2D.hxx
// Author : Edward AGAPOV
// Module : SMESH
-
+//
#ifndef _SMESH_ProjectionSource2D_HXX_
#define _SMESH_ProjectionSource2D_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_ProjectionSource3D.cxx
// Author : Edward AGAPOV
// Module : SMESH
-
+//
#include "StdMeshers_ProjectionSource3D.hxx"
#include "utilities.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_ProjectionSource3D.hxx
// Author : Edward AGAPOV
// Module : SMESH
-
+//
#ifndef _SMESH_ProjectionSource3D_HXX_
#define _SMESH_ProjectionSource3D_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_ProjectionUtils.cxx
// Created : Fri Oct 27 10:24:28 2006
return false;
}
-//=======================================================================
-//function : IsSubShape
-//purpose :
-//=======================================================================
-
-bool StdMeshers_ProjectionUtils::IsSubShape( const TopoDS_Shape& shape,
- SMESH_Mesh* aMesh )
-{
- if ( shape.IsNull() || !aMesh )
- return false;
- return
- aMesh->GetMeshDS()->ShapeToIndex( shape ) ||
- // PAL16202
- shape.ShapeType() == TopAbs_COMPOUND && aMesh->GetMeshDS()->IsGroupOfSubShapes( shape );
-}
-
-//=======================================================================
-//function : IsSubShape
-//purpose :
-//=======================================================================
-
-bool StdMeshers_ProjectionUtils::IsSubShape( const TopoDS_Shape& shape,
- const TopoDS_Shape& mainShape )
-{
- if ( !shape.IsNull() && !mainShape.IsNull() )
- {
- for ( TopExp_Explorer exp( mainShape, shape.ShapeType());
- exp.More();
- exp.Next() )
- if ( shape.IsSame( exp.Current() ))
- return true;
- }
- SCRUTE((shape.IsNull()));
- SCRUTE((mainShape.IsNull()));
- return false;
-}
-
-
//=======================================================================
/*!
* \brief Finds an edge by its vertices in a main shape of the mesh
if ( !assocMap.IsBound( e2 ))
RETURN_BAD_RESULT("Association not found for edge " << meshDS2->ShapeToIndex( e2 ));
TopoDS_Edge e1 = TopoDS::Edge( assocMap( e2 ));
- if ( !IsSubShape( e1, face1 ))
+ if ( !helper1.IsSubShape( e1, face1 ))
RETURN_BAD_RESULT("Wrong association, edge " << meshDS1->ShapeToIndex( e1 ) <<
" isn't a subshape of face " << meshDS1->ShapeToIndex( face1 ));
// check that there are nodes on edges
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_ProjectionUtils.hxx
// Created : Thu Oct 26 15:37:24 2006
TShapeShapeMap & theAssociationMap,
const bool theBidirectional=true);
- static bool IsSubShape( const TopoDS_Shape& shape, SMESH_Mesh* aMesh );
-
- static bool IsSubShape( const TopoDS_Shape& shape, const TopoDS_Shape& mainShape );
-
/*!
* \brief Finds an edge by its vertices in a main shape of the mesh
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Projection_1D.cxx
// Module : SMESH
:SMESH_1D_Algo(hypId, studyId, gen)
{
_name = "Projection_1D";
- _shapeType = (1 << TopAbs_EDGE); // 1 bit per shape type
+ _shapeType = (1 << TopAbs_EDGE); // 1 bit per shape type
_compatibleHypothesis.push_back("ProjectionSource1D");
_sourceHypo = 0;
if ( _sourceHypo->HasVertexAssociation() )
{
// source and target vertices
- if ( !TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh ) ||
- !TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh ) ||
- !TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(),
- _sourceHypo->GetSourceEdge() ))
+ if ( !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh ) ||
+ !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh ) ||
+ !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceVertex(),
+ _sourceHypo->GetSourceEdge() ))
{
aStatus = HYP_BAD_PARAMETER;
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh )));
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh )));
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(),
- _sourceHypo->GetSourceEdge() )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceVertex(),
+ _sourceHypo->GetSourceEdge() )));
}
// PAL16202
- else
+ else
{
- bool isSub = TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), aShape );
+ bool isSub = SMESH_MesherHelper::IsSubShape( _sourceHypo->GetTargetVertex(), aShape );
if ( !_sourceHypo->IsCompoundSource() ) {
if ( !isSub ) {
aStatus = HYP_BAD_PARAMETER;
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), aShape)));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetTargetVertex(), aShape)));
}
}
else if ( isSub ) {
{
const TopoDS_Shape& ancestor = ancestIt.Value();
if ( ancestor.ShapeType() == TopAbs_EDGE &&
- TAssocTool::IsSubShape( ancestor, _sourceHypo->GetSourceEdge() ))
+ SMESH_MesherHelper::IsSubShape( ancestor, _sourceHypo->GetSourceEdge() ))
{
if ( sharingEdge.IsNull() || ancestor.IsSame( sharingEdge ))
sharingEdge = ancestor;
}
}
// check source edge
- if ( !TAssocTool::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh ) ||
+ if ( !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh ) ||
( srcMesh == tgtMesh && aShape == _sourceHypo->GetSourceEdge() ))
{
aStatus = HYP_BAD_PARAMETER;
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh )));
SCRUTE((srcMesh == tgtMesh));
SCRUTE(( aShape == _sourceHypo->GetSourceEdge() ));
}
//=======================================================================
bool StdMeshers_Projection_1D::Evaluate(SMESH_Mesh& theMesh,
- const TopoDS_Shape& theShape,
- MapShapeNbElems& aResMap)
+ const TopoDS_Shape& theShape,
+ MapShapeNbElems& aResMap)
{
if ( !_sourceHypo )
return false;
if ( !srcMesh )
srcMesh = tgtMesh;
- SMESHDS_Mesh * meshDS = theMesh.GetMeshDS();
+ //SMESHDS_Mesh * meshDS = theMesh.GetMeshDS();
// ---------------------------
// Make subshapes association
// Find out nodes distribution on the source edge
// -----------------------------------------------
- double srcLength = EdgeLength( srcEdge );
- double tgtLength = EdgeLength( tgtEdge );
+ //double srcLength = EdgeLength( srcEdge );
+ //double tgtLength = EdgeLength( tgtEdge );
vector< double > params; // sorted parameters of nodes on the source edge
if ( !SMESH_Algo::GetNodeParamOnEdge( srcMesh->GetMeshDS(), srcEdge, params ))
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Projection_1D.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Projection_2D.cxx
// Module : SMESH
#include <TopExp_Explorer.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopoDS.hxx>
+#include <gp_Ax2.hxx>
+#include <gp_Ax3.hxx>
using namespace std;
:SMESH_2D_Algo(hypId, studyId, gen)
{
_name = "Projection_2D";
- _shapeType = (1 << TopAbs_FACE); // 1 bit per shape type
+ _shapeType = (1 << TopAbs_FACE); // 1 bit per shape type
_compatibleHypothesis.push_back("ProjectionSource2D");
_sourceHypo = 0;
TopoDS_Shape edge = TAssocTool::GetEdgeByVertices
( srcMesh, _sourceHypo->GetSourceVertex(1), _sourceHypo->GetSourceVertex(2) );
if ( edge.IsNull() ||
- !TAssocTool::IsSubShape( edge, srcMesh ) ||
- !TAssocTool::IsSubShape( edge, _sourceHypo->GetSourceFace() ))
+ !SMESH_MesherHelper::IsSubShape( edge, srcMesh ) ||
+ !SMESH_MesherHelper::IsSubShape( edge, _sourceHypo->GetSourceFace() ))
{
theStatus = HYP_BAD_PARAMETER;
SCRUTE((edge.IsNull()));
- SCRUTE((TAssocTool::IsSubShape( edge, srcMesh )));
- SCRUTE((TAssocTool::IsSubShape( edge, _sourceHypo->GetSourceFace() )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, srcMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, _sourceHypo->GetSourceFace() )));
}
else
{
// target vertices
edge = TAssocTool::GetEdgeByVertices
( tgtMesh, _sourceHypo->GetTargetVertex(1), _sourceHypo->GetTargetVertex(2) );
- if ( edge.IsNull() || !TAssocTool::IsSubShape( edge, tgtMesh ))
+ if ( edge.IsNull() || !SMESH_MesherHelper::IsSubShape( edge, tgtMesh ))
{
theStatus = HYP_BAD_PARAMETER;
SCRUTE((edge.IsNull()));
- SCRUTE((TAssocTool::IsSubShape( edge, tgtMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, tgtMesh )));
}
// PAL16203
else if ( !_sourceHypo->IsCompoundSource() &&
- !TAssocTool::IsSubShape( edge, theShape ))
+ !SMESH_MesherHelper::IsSubShape( edge, theShape ))
{
theStatus = HYP_BAD_PARAMETER;
- SCRUTE((TAssocTool::IsSubShape( edge, theShape )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, theShape )));
}
}
}
// check a source face
- if ( !TAssocTool::IsSubShape( _sourceHypo->GetSourceFace(), srcMesh ) ||
+ if ( !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceFace(), srcMesh ) ||
( srcMesh == tgtMesh && theShape == _sourceHypo->GetSourceFace() ))
{
theStatus = HYP_BAD_PARAMETER;
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceFace(), srcMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceFace(), srcMesh )));
SCRUTE((srcMesh == tgtMesh));
SCRUTE(( theShape == _sourceHypo->GetSourceFace() ));
}
namespace {
-
//================================================================================
/*!
* \brief define if a node is new or old
- * \param node - node to check
- * \retval bool - true if the node existed before Compute() is called
+ * \param node - node to check
+ * \retval bool - true if the node existed before Compute() is called
*/
//================================================================================
//================================================================================
/*!
- * \brief Preform projection in case if tgtFace.IsPartner( srcFace )
+ * \brief Preform projection in case if tgtFace.IsPartner( srcFace ) and in case
+ * if projection by transformation is possible
* \param tgtFace - target face
* \param srcFace - source face
* \param tgtMesh - target mesh
SMESH_Mesh * srcMesh,
const TAssocTool::TShapeShapeMap& shape2ShapeMap)
{
- if ( !tgtFace.IsPartner( srcFace ))
- return false;
+ const double tol = 1e-6;
+
+ gp_Trsf trsf; // transformation to get location of target nodes from source ones
+ if ( tgtFace.IsPartner( srcFace ))
+ {
+ gp_Trsf srcTrsf = srcFace.Location();
+ gp_Trsf tgtTrsf = tgtFace.Location();
+ trsf = srcTrsf.Inverted() * tgtTrsf;
+ }
+ else
+ {
+ // Try to find the transformation
+
+ // make any local coord systems of src and tgt faces
+ vector<gp_Pnt> srcPP, tgtPP; // 3 points on face boundaries to make axes of CS
+ SMESH_subMesh * srcSM = srcMesh->GetSubMesh( srcFace );
+ SMESH_subMeshIteratorPtr smIt = srcSM->getDependsOnIterator(/*includeSelf=*/false,false);
+ srcSM = smIt->next(); // sm of a vertex
+ while ( smIt->more() && srcPP.size() < 3 )
+ {
+ srcSM = smIt->next();
+ SMESHDS_SubMesh* srcSmds = srcSM->GetSubMeshDS();
+ if ( !srcSmds ) continue;
+ SMDS_NodeIteratorPtr nIt = srcSmds->GetNodes();
+ while ( nIt->more() )
+ {
+ SMESH_MeshEditor::TNodeXYZ p ( nIt->next());
+ bool pOK = false;
+ switch ( srcPP.size() )
+ {
+ case 0: pOK = true; break;
+
+ case 1: pOK = ( srcPP[0].SquareDistance( p ) > tol ); break;
+
+ case 2:
+ {
+ gp_Vec p0p1( srcPP[0], srcPP[1] ), p0p( srcPP[0], p );
+ pOK = !p0p1.IsParallel( p0p, tol );
+ break;
+ }
+ }
+ if ( !pOK )
+ continue;
+
+ // find corresponding point on target shape
+ pOK = false;
+ gp_Pnt tgtP;
+ const TopoDS_Shape& tgtShape = shape2ShapeMap( srcSM->GetSubShape() );
+ if ( tgtShape.ShapeType() == TopAbs_VERTEX )
+ {
+ tgtP = BRep_Tool::Pnt( TopoDS::Vertex( tgtShape ));
+ pOK = true;
+ //cout << "V - nS " << p._node->GetID() << " - nT " << SMESH_Algo::VertexNode(TopoDS::Vertex( tgtShape),tgtMesh->GetMeshDS())->GetID() << endl;
+ }
+ else if ( tgtPP.size() > 0 )
+ {
+ if ( SMESHDS_SubMesh* tgtSmds = tgtMesh->GetMeshDS()->MeshElements( tgtShape ))
+ {
+ double srcDist = srcPP[0].Distance( p );
+ double eTol = BRep_Tool::Tolerance( TopoDS::Edge( tgtShape ));
+ SMDS_NodeIteratorPtr nItT = tgtSmds->GetNodes();
+ while ( nItT->more() && !pOK )
+ {
+ const SMDS_MeshNode* n = nItT->next();
+ tgtP = SMESH_MeshEditor::TNodeXYZ( n );
+ pOK = ( fabs( srcDist - tgtPP[0].Distance( tgtP )) < 2*eTol );
+ //cout << "E - nS " << p._node->GetID() << " - nT " << n->GetID()<< " OK - " << pOK<< " " << fabs( srcDist - tgtPP[0].Distance( tgtP ))<< " tol " << eTol<< endl;
+ }
+ }
+ }
+ if ( !pOK )
+ continue;
+
+ srcPP.push_back( p );
+ tgtPP.push_back( tgtP );
+ }
+ }
+ if ( srcPP.size() != 3 )
+ return false;
+
+ // make transformation
+ gp_Trsf fromTgtCS, toSrcCS; // from/to global CS
+ gp_Ax2 srcCS( srcPP[0], gp_Vec( srcPP[0], srcPP[1] ), gp_Vec( srcPP[0], srcPP[2]));
+ gp_Ax2 tgtCS( tgtPP[0], gp_Vec( tgtPP[0], tgtPP[1] ), gp_Vec( tgtPP[0], tgtPP[2]));
+ toSrcCS .SetTransformation( gp_Ax3( srcCS ));
+ fromTgtCS.SetTransformation( gp_Ax3( tgtCS ));
+ fromTgtCS.Invert();
+
+ trsf = fromTgtCS * toSrcCS;
+ }
// Fill map of src to tgt nodes with nodes on edges
for ( TopExp_Explorer srcEdge( srcFace, TopAbs_EDGE); srcEdge.More(); srcEdge.Next() )
{
const TopoDS_Shape& tgtEdge = shape2ShapeMap( srcEdge.Current() );
- if ( !tgtEdge.IsPartner( srcEdge.Current() ))
- return false;
map< double, const SMDS_MeshNode* > srcNodes, tgtNodes;
if ( !SMESH_Algo::GetSortedNodesOnEdge( srcMesh->GetMeshDS(),
srcNodes.size() != tgtNodes.size())
return false;
+ if ( !tgtEdge.IsPartner( srcEdge.Current() ))
+ {
+ // check that transormation is OK by three nodes
+ gp_Pnt p0S = SMESH_MeshEditor::TNodeXYZ( (srcNodes.begin()) ->second);
+ gp_Pnt p1S = SMESH_MeshEditor::TNodeXYZ( (srcNodes.rbegin()) ->second);
+ gp_Pnt p2S = SMESH_MeshEditor::TNodeXYZ( (++srcNodes.begin())->second);
+
+ gp_Pnt p0T = SMESH_MeshEditor::TNodeXYZ( (tgtNodes.begin()) ->second);
+ gp_Pnt p1T = SMESH_MeshEditor::TNodeXYZ( (tgtNodes.rbegin()) ->second);
+ gp_Pnt p2T = SMESH_MeshEditor::TNodeXYZ( (++tgtNodes.begin())->second);
+
+ // transform source points, they must coinside with target ones
+ if ( p0T.SquareDistance( p0S.Transformed( trsf )) > tol ||
+ p1T.SquareDistance( p1S.Transformed( trsf )) > tol ||
+ p2T.SquareDistance( p2S.Transformed( trsf )) > tol )
+ {
+ //cout << "KO trsf, 3 dist: "
+ //<< p0T.SquareDistance( p0S.Transformed( trsf ))<< ", "
+ //<< p1T.SquareDistance( p1S.Transformed( trsf ))<< ", "
+ //<< p2T.SquareDistance( p2S.Transformed( trsf ))<< ", "<<endl;
+ return false;
+ }
+ }
+
map< double, const SMDS_MeshNode* >::iterator u_tn = tgtNodes.begin();
map< double, const SMDS_MeshNode* >::iterator u_sn = srcNodes.begin();
for ( ; u_tn != tgtNodes.end(); ++u_tn, ++u_sn)
// Make new faces
- // transformation to get location of target nodes from source ones
- gp_Trsf srcTrsf = srcFace.Location();
- gp_Trsf tgtTrsf = tgtFace.Location();
- gp_Trsf trsf = srcTrsf.Inverted() * tgtTrsf;
-
// prepare the helper adding quadratic elements if necessary
SMESH_MesherHelper helper( *tgtMesh );
helper.IsQuadraticSubMesh( tgtFace );
RETURN_BAD_RESULT("Not associated vertices, srcV1 " << srcV1.TShape().operator->() );
TopoDS_Vertex tgtV1 = TopoDS::Vertex( shape2ShapeMap( srcV1 ));
- if ( !TAssocTool::IsSubShape( srcV1, srcFace ))
+ if ( !SMESH_MesherHelper::IsSubShape( srcV1, srcFace ))
RETURN_BAD_RESULT("Wrong srcV1 " << srcV1.TShape().operator->());
- if ( !TAssocTool::IsSubShape( tgtV1, tgtFace ))
+ if ( !SMESH_MesherHelper::IsSubShape( tgtV1, tgtFace ))
RETURN_BAD_RESULT("Wrong tgtV1 " << tgtV1.TShape().operator->());
// try to find out orientation by order of edges
//=======================================================================
bool StdMeshers_Projection_2D::Evaluate(SMESH_Mesh& theMesh,
- const TopoDS_Shape& theShape,
- MapShapeNbElems& aResMap)
+ const TopoDS_Shape& theShape,
+ MapShapeNbElems& aResMap)
{
if ( !_sourceHypo )
return false;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Projection_2D.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Projection_3D.cxx
// Module : SMESH
TopoDS_Shape edge = TAssocTool::GetEdgeByVertices
( srcMesh, _sourceHypo->GetSourceVertex(1), _sourceHypo->GetSourceVertex(2) );
if ( edge.IsNull() ||
- !TAssocTool::IsSubShape( edge, srcMesh ) ||
- !TAssocTool::IsSubShape( edge, _sourceHypo->GetSource3DShape() ))
+ !SMESH_MesherHelper::IsSubShape( edge, srcMesh ) ||
+ !SMESH_MesherHelper::IsSubShape( edge, _sourceHypo->GetSource3DShape() ))
{
SCRUTE((edge.IsNull()));
- SCRUTE((TAssocTool::IsSubShape( edge, srcMesh )));
- SCRUTE((TAssocTool::IsSubShape( edge, _sourceHypo->GetSource3DShape() )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, srcMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, _sourceHypo->GetSource3DShape() )));
aStatus = SMESH_Hypothesis::HYP_BAD_PARAMETER;
}
else
edge = TAssocTool::GetEdgeByVertices
( tgtMesh, _sourceHypo->GetTargetVertex(1), _sourceHypo->GetTargetVertex(2) );
if ( edge.IsNull() ||
- !TAssocTool::IsSubShape( edge, tgtMesh ) ||
- !TAssocTool::IsSubShape( edge, aShape ))
+ !SMESH_MesherHelper::IsSubShape( edge, tgtMesh ) ||
+ !SMESH_MesherHelper::IsSubShape( edge, aShape ))
{
SCRUTE((edge.IsNull()));
- SCRUTE((TAssocTool::IsSubShape( edge, tgtMesh )));
- SCRUTE((TAssocTool::IsSubShape( edge, aShape )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, tgtMesh )));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( edge, aShape )));
aStatus = SMESH_Hypothesis::HYP_BAD_PARAMETER;
}
}
}
// check a source shape
- if ( !TAssocTool::IsSubShape( _sourceHypo->GetSource3DShape(), srcMesh ) ||
+ if ( !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSource3DShape(), srcMesh ) ||
( srcMesh == tgtMesh && aShape == _sourceHypo->GetSource3DShape()))
{
- SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSource3DShape(), srcMesh)));
+ SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSource3DShape(), srcMesh)));
SCRUTE((srcMesh == tgtMesh));
SCRUTE((aShape == _sourceHypo->GetSource3DShape()));
aStatus = SMESH_Hypothesis::HYP_BAD_PARAMETER;
return error("Association of subshapes failed" );
srcV000 = TopoDS::Vertex( shape2ShapeMap( tgtV000 ));
srcV100 = TopoDS::Vertex( shape2ShapeMap( tgtV100 ));
- if ( !TAssocTool::IsSubShape( srcV000, srcShell ) ||
- !TAssocTool::IsSubShape( srcV100, srcShell ))
+ if ( !SMESH_MesherHelper::IsSubShape( srcV000, srcShell ) ||
+ !SMESH_MesherHelper::IsSubShape( srcV100, srcShell ))
return error("Incorrect association of subshapes" );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Projection_3D.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Propagation.cxx
// Module : SMESH
-
+//
#include "StdMeshers_Propagation.hxx"
#include "utilities.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Propagation.hxx
// Module : SMESH
-
+//
#ifndef _SMESH_PROPAGATION_HXX_
#define _SMESH_PROPAGATION_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_QuadToTriaAdaptor.cxx
// Module : SMESH
//
#include "StdMeshers_QuadToTriaAdaptor.hxx"
-#include <SMDS_FaceOfNodes.hxx>
#include <SMESH_Algo.hxx>
#include <SMESH_MesherHelper.hxx>
#include <IntAna_IntConicQuad.hxx>
#include <IntAna_Quadric.hxx>
-#include <TColStd_SequenceOfInteger.hxx>
+#include <TColgp_HArray1OfPnt.hxx>
+#include <TColgp_HArray1OfVec.hxx>
#include <TColgp_HSequenceOfPnt.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <gp_Lin.hxx>
#include <gp_Pln.hxx>
-#include <NCollection_Array1.hxx>
-typedef NCollection_Array1<TColStd_SequenceOfInteger> StdMeshers_Array1OfSequenceOfInteger;
-
+#include <numeric>
-//=======================================================================
-//function : StdMeshers_QuadToTriaAdaptor
-//purpose :
-//=======================================================================
+using namespace std;
-StdMeshers_QuadToTriaAdaptor::StdMeshers_QuadToTriaAdaptor()
-{
-}
+enum EQuadNature { NOT_QUAD, QUAD, DEGEN_QUAD };
+ // sdt-like iterator used to get coordinates of nodes of mesh element
+typedef SMDS_StdIterator< SMESH_MeshEditor::TNodeXYZ, SMDS_ElemIteratorPtr > TXyzIterator;
//================================================================================
/*!
StdMeshers_QuadToTriaAdaptor::~StdMeshers_QuadToTriaAdaptor()
{
// delete temporary faces
- map< const SMDS_MeshElement*, list<const SMDS_FaceOfNodes*> >::iterator
- f_f = myResMap.begin(), ffEnd = myResMap.end();
+ TQuad2Trias::iterator f_f = myResMap.begin(), ffEnd = myResMap.end();
for ( ; f_f != ffEnd; ++f_f )
{
- list<const SMDS_FaceOfNodes*>& fList = f_f->second;
- list<const SMDS_FaceOfNodes*>::iterator f = fList.begin(), fEnd = fList.end();
+ TTriaList& fList = f_f->second;
+ TTriaList::iterator f = fList.begin(), fEnd = fList.end();
for ( ; f != fEnd; ++f )
delete *f;
}
myResMap.clear();
-// TF2PyramMap::iterator itp = myMapFPyram.begin();
-// for(; itp!=myMapFPyram.end(); itp++)
+// TF2PyramMap::iterator itp = myPyram2Trias.begin();
+// for(; itp!=myPyram2Trias.end(); itp++)
// cout << itp->second << endl;
}
//=======================================================================
//function : FindBestPoint
-//purpose : Auxilare for Compute()
+//purpose : Return a point P laying on the line (PC,V) so that triangle
+// (P, P1, P2) to be equilateral as much as possible
// V - normal to (P1,P2,PC)
//=======================================================================
static gp_Pnt FindBestPoint(const gp_Pnt& P1, const gp_Pnt& P2,
if( a < (b+c)/2 )
return PC;
else {
- // find shift along V in order to a became equal to (b+c)/2
+ // find shift along V in order a to became equal to (b+c)/2
double shift = sqrt( a*a + (b*b-c*c)*(b*b-c*c)/16/a/a - (b*b+c*c)/2 );
gp_Dir aDir(V);
- gp_Pnt Pbest( PC.X() + aDir.X()*shift, PC.Y() + aDir.Y()*shift,
- PC.Z() + aDir.Z()*shift );
+ gp_Pnt Pbest = PC.XYZ() + aDir.XYZ() * shift;
return Pbest;
}
}
//function : HasIntersection
//purpose : Auxilare for CheckIntersection()
//=======================================================================
+
static bool HasIntersection(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint,
Handle(TColgp_HSequenceOfPnt)& aContour)
{
//=======================================================================
-//function : CompareTrias
+//function : EqualTriangles
//purpose : Auxilare for Compute()
//=======================================================================
-static bool CompareTrias(const SMDS_MeshElement* F1,const SMDS_MeshElement* F2)
+static bool EqualTriangles(const SMDS_MeshElement* F1,const SMDS_MeshElement* F2)
{
return
( F1->GetNode(1)==F2->GetNode(2) && F1->GetNode(2)==F2->GetNode(1) ) ||
( F1->GetNode(1)==F2->GetNode(1) && F1->GetNode(2)==F2->GetNode(2) );
}
+//================================================================================
+/*!
+ * \brief Prepare data for the given face
+ * \param PN - coordinates of face nodes
+ * \param VN - cross products of vectors (PC-PN(i)) ^ (PC-PN(i+1))
+ * \param FNodes - face nodes
+ * \param PC - gravity center of nodes
+ * \param VNorm - face normal (sum of VN)
+ * \param volumes - two volumes sharing the given face, the first is in VNorm direction
+ * \retval int - 0 if given face is not quad,
+ * 1 if given face is quad,
+ * 2 if given face is degenerate quad (two nodes are coincided)
+ */
+//================================================================================
-//=======================================================================
-//function : IsDegenarate
-//purpose : Auxilare for Preparation()
-//=======================================================================
-// static int IsDegenarate(const Handle(TColgp_HArray1OfPnt)& PN)
-// {
-// int i = 1;
-// for(; i<4; i++) {
-// int j = i+1;
-// for(; j<=4; j++) {
-// if( PN->Value(i).Distance(PN->Value(j)) < 1.e-6 )
-// return j;
-// }
-// }
-// return 0;
-// }
-
-
-//=======================================================================
-//function : Preparation
-//purpose : Auxilare for Compute()
-// : Return 0 if given face is not quad,
-// 1 if given face is quad,
-// 2 if given face is degenerate quad (two nodes are coincided)
-//=======================================================================
-int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face,
- Handle(TColgp_HArray1OfPnt)& PN,
- Handle(TColgp_HArray1OfVec)& VN,
- std::vector<const SMDS_MeshNode*>& FNodes,
- gp_Pnt& PC, gp_Vec& VNorm)
+int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face,
+ Handle(TColgp_HArray1OfPnt)& PN,
+ Handle(TColgp_HArray1OfVec)& VN,
+ vector<const SMDS_MeshNode*>& FNodes,
+ gp_Pnt& PC,
+ gp_Vec& VNorm,
+ const SMDS_MeshElement** volumes)
{
- int i = 0;
- double xc=0., yc=0., zc=0.;
- SMDS_ElemIteratorPtr nodeIt = face->nodesIterator();
- if( !face->IsQuadratic() ) {
+ if( face->NbNodes() != ( face->IsQuadratic() ? 8 : 4 ))
if( face->NbNodes() != 4 )
- return 0;
- while ( nodeIt->more() ) {
- i++;
- const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
- FNodes[i-1] = node;
- PN->SetValue( i, gp_Pnt(node->X(), node->Y(), node->Z()) );
- xc += node->X();
- yc += node->Y();
- zc += node->Z();
- }
- }
- else {
- if( face->NbNodes() != 8)
- return 0;
- while ( nodeIt->more() ) {
- i++;
- const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
- FNodes[i-1] = node;
- PN->SetValue( i, gp_Pnt(node->X(), node->Y(), node->Z()) );
- xc += node->X();
- yc += node->Y();
- zc += node->Z();
- if(i==4) break;
- }
+ return NOT_QUAD;
+
+ int i = 0;
+ gp_XYZ xyzC(0., 0., 0.);
+ for ( i = 0; i < 4; ++i )
+ {
+ gp_XYZ p = SMESH_MeshEditor::TNodeXYZ( FNodes[i] = face->GetNode(i) );
+ PN->SetValue( i+1, p );
+ xyzC += p;
}
+ PC = xyzC/4;
+ //cout<<" PC("<<PC.X()<<","<<PC.Y()<<","<<PC.Z()<<")"<<endl;
int nbp = 4;
hasdeg = true;
gp_Pnt Pdeg = PN->Value(i);
- std::list< const SMDS_MeshNode* >::iterator itdg = myDegNodes.begin();
+ list< const SMDS_MeshNode* >::iterator itdg = myDegNodes.begin();
const SMDS_MeshNode* DegNode = 0;
for(; itdg!=myDegNodes.end(); itdg++) {
const SMDS_MeshNode* N = (*itdg);
FNodes[i-1] = FNodes[i];
}
nbp = 3;
- //PC = gp_Pnt( PN->Value(1).X() + PN.Value
}
- PC = gp_Pnt(xc/4., yc/4., zc/4.);
- //cout<<" PC("<<PC.X()<<","<<PC.Y()<<","<<PC.Z()<<")"<<endl;
-
- //PN->SetValue(5,PN->Value(1));
PN->SetValue(nbp+1,PN->Value(1));
- //FNodes[4] = FNodes[0];
FNodes[nbp] = FNodes[0];
// find normal direction
- //gp_Vec V1(PC,PN->Value(4));
gp_Vec V1(PC,PN->Value(nbp));
gp_Vec V2(PC,PN->Value(1));
VNorm = V1.Crossed(V2);
- //VN->SetValue(4,VNorm);
VN->SetValue(nbp,VNorm);
- //for(i=1; i<4; i++) {
for(i=1; i<nbp; i++) {
V1 = gp_Vec(PC,PN->Value(i));
V2 = gp_Vec(PC,PN->Value(i+1));
VN->SetValue(i,Vtmp);
VNorm += Vtmp;
}
+
+ // find volumes sharing the face
+ if ( volumes )
+ {
+ volumes[0] = volumes[1] = 0;
+ SMDS_ElemIteratorPtr vIt = FNodes[0]->GetInverseElementIterator( SMDSAbs_Volume );
+ while ( vIt->more() )
+ {
+ const SMDS_MeshElement* vol = vIt->next();
+ bool volSharesAllNodes = true;
+ for ( int i = 1; i < face->NbNodes() && volSharesAllNodes; ++i )
+ volSharesAllNodes = ( vol->GetNodeIndex( FNodes[i] ) >= 0 );
+ if ( volSharesAllNodes )
+ volumes[ volumes[0] ? 1 : 0 ] = vol;
+ // we could additionally check that vol has all FNodes in its one face using SMDS_VolumeTool
+ }
+ // define volume position relating to the face normal
+ if ( volumes[0] )
+ {
+ // get volume gc
+ SMDS_ElemIteratorPtr nodeIt = volumes[0]->nodesIterator();
+ gp_XYZ volGC(0,0,0);
+ volGC = accumulate( TXyzIterator(nodeIt), TXyzIterator(), volGC ) / volumes[0]->NbNodes();
+
+ if ( VNorm * gp_Vec( PC, volGC ) < 0 )
+ swap( volumes[0], volumes[1] );
+ }
+ }
+
//cout<<" VNorm("<<VNorm.X()<<","<<VNorm.Y()<<","<<VNorm.Z()<<")"<<endl;
- if(hasdeg) return 2;
- return 1;
+ return hasdeg ? DEGEN_QUAD : QUAD;
}
bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
{
myResMap.clear();
- myMapFPyram.clear();
+ myPyram2Trias.clear();
SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
SMESH_MesherHelper helper(aMesh);
// preparation step using face info
Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5);
Handle(TColgp_HArray1OfVec) VN = new TColgp_HArray1OfVec(1,4);
- std::vector<const SMDS_MeshNode*> FNodes(5);
+ vector<const SMDS_MeshNode*> FNodes(5);
gp_Pnt PC;
gp_Vec VNorm;
int stat = Preparation(face, PN, VN, FNodes, PC, VNorm);
if(stat==2) {
// degenerate face
// add triangles to result map
- std::list<const SMDS_FaceOfNodes*> aList;
SMDS_FaceOfNodes* NewFace;
if(!isRev)
NewFace = new SMDS_FaceOfNodes( FNodes[0], FNodes[1], FNodes[2] );
else
NewFace = new SMDS_FaceOfNodes( FNodes[0], FNodes[2], FNodes[1] );
- aList.push_back(NewFace);
+ TTriaList aList( 1, NewFace );
myResMap.insert(make_pair(face,aList));
continue;
}
}
// create node for PCbest
SMDS_MeshNode* NewNode = helper.AddNode( PCbest.X(), PCbest.Y(), PCbest.Z() );
+
// add triangles to result map
- std::list<const SMDS_FaceOfNodes*> aList;
- for(i=0; i<4; i++) {
- SMDS_FaceOfNodes* NewFace = new SMDS_FaceOfNodes( NewNode, FNodes[i], FNodes[i+1] );
- aList.push_back(NewFace);
- }
- myResMap.insert(make_pair(face,aList));
+ TTriaList& triaList = myResMap.insert( make_pair( face, TTriaList() ))->second;
+ for(i=0; i<4; i++)
+ triaList.push_back( new SMDS_FaceOfNodes( NewNode, FNodes[i], FNodes[i+1] ));
+
// create pyramid
+ if ( isRev ) swap( FNodes[1], FNodes[3]);
SMDS_MeshVolume* aPyram =
helper.AddVolume( FNodes[0], FNodes[1], FNodes[2], FNodes[3], NewNode );
- myMapFPyram.insert(make_pair(face,aPyram));
- } // end loop on elements on a face
+ myPyram2Trias.insert(make_pair(aPyram, & triaList));
+ } // end loop on elements on a face submesh
}
} // end for(TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next()) {
bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
{
myResMap.clear();
- myMapFPyram.clear();
+ myPyram2Trias.clear();
SMESH_MesherHelper helper(aMesh);
helper.IsQuadraticSubMesh(aMesh.GetShapeToMesh());
helper.SetElementsOnShape( true );
const SMDS_MeshElement* face = *itFace;
if ( !face ) continue;
//cout<<endl<<"================= face->GetID() = "<<face->GetID()<<endl;
- // preparation step using face info
+ // retrieve needed information about a face
Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5);
Handle(TColgp_HArray1OfVec) VN = new TColgp_HArray1OfVec(1,4);
- std::vector<const SMDS_MeshNode*> FNodes(5);
+ vector<const SMDS_MeshNode*> FNodes(5);
gp_Pnt PC;
gp_Vec VNorm;
-
- int stat = Preparation(face, PN, VN, FNodes, PC, VNorm);
- if(stat==0)
+ const SMDS_MeshElement* volumes[2];
+ int what = Preparation(face, PN, VN, FNodes, PC, VNorm, volumes);
+ if ( what == NOT_QUAD )
continue;
+ if ( volumes[0] && volumes[1] )
+ continue; // face is shared by two volumes - no space for a pyramid
- if(stat==2) {
+ if ( what == DEGEN_QUAD )
+ {
// degenerate face
// add triangles to result map
- std::list<const SMDS_FaceOfNodes*> aList;
+ TTriaList aList;
SMDS_FaceOfNodes* NewFace;
// check orientation
- double tmp = PN->Value(1).Distance(PN->Value(2)) +
- PN->Value(2).Distance(PN->Value(3));
+ double tmp = PN->Value(1).Distance(PN->Value(2)) + PN->Value(2).Distance(PN->Value(3));
+ // far points in VNorm direction
gp_Pnt Ptmp1 = PC.XYZ() + VNorm.XYZ() * tmp * 1.e6;
gp_Pnt Ptmp2 = PC.XYZ() - VNorm.XYZ() * tmp * 1.e6;
// check intersection for Ptmp1 and Ptmp2
const SMDS_MeshElement* F = *itF;
if(F==face) continue;
Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
- SMDS_ElemIteratorPtr nodeIt = F->nodesIterator();
- if( !F->IsQuadratic() ) {
- while ( nodeIt->more() ) {
- const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
- aContour->Append(gp_Pnt(node->X(), node->Y(), node->Z()));
- }
- }
- else {
- int nn = 0;
- while ( nodeIt->more() ) {
- nn++;
- const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
- aContour->Append(gp_Pnt(node->X(), node->Y(), node->Z()));
- if(nn==face->NbNodes()/2) break;
- }
- }
+ for ( int i = 0; i < 4; ++i )
+ aContour->Append( SMESH_MeshEditor::TNodeXYZ( F->GetNode(i) ));
gp_Pnt PPP;
- if( HasIntersection(Ptmp1, PC, PPP, aContour) ) {
+ if( !volumes[0] && HasIntersection(Ptmp1, PC, PPP, aContour) ) {
IsOK1 = true;
double tmp = PC.Distance(PPP);
if(tmp<dist1) {
dist1 = tmp;
}
}
- if( HasIntersection(Ptmp2, PC, PPP, aContour) ) {
+ if( !volumes[1] && HasIntersection(Ptmp2, PC, PPP, aContour) ) {
IsOK2 = true;
double tmp = PC.Distance(PPP);
if(tmp<dist2) {
IsRev = true;
}
else { // IsOK1 && IsOK2
- double tmp1 = PC.Distance(Pres1)/3.;
- double tmp2 = PC.Distance(Pres2)/3.;
+ double tmp1 = PC.Distance(Pres1);
+ double tmp2 = PC.Distance(Pres2);
if(tmp1<tmp2) {
// using existed direction
}
myResMap.insert(make_pair(face,aList));
continue;
}
-
- double xc = 0., yc = 0., zc = 0.;
+
+ // Find pyramid peak
+
+ gp_XYZ PCbest(0., 0., 0.); // pyramid peak
int i = 1;
for(; i<=4; i++) {
gp_Pnt Pbest = FindBestPoint(PN->Value(i), PN->Value(i+1), PC, VN->Value(i));
- xc += Pbest.X();
- yc += Pbest.Y();
- zc += Pbest.Z();
+ PCbest += Pbest.XYZ();
}
- gp_Pnt PCbest(xc/4., yc/4., zc/4.);
- double height = PCbest.Distance(PC);
+ PCbest /= 4;
+
+ double height = PC.Distance(PCbest); // pyramid height to precise
if(height<1.e-6) {
// create new PCbest using a bit shift along VNorm
PCbest = PC.XYZ() + VNorm.XYZ() * 0.001;
- height = PCbest.Distance(PC);
+ height = PC.Distance(PCbest);
}
//cout<<" PCbest("<<PCbest.X()<<","<<PCbest.Y()<<","<<PCbest.Z()<<")"<<endl;
- gp_Vec V1(PC,PCbest);
- double tmp = PN->Value(1).Distance(PN->Value(3)) +
- PN->Value(2).Distance(PN->Value(4));
- gp_Dir tmpDir(V1);
- gp_Pnt Ptmp1 = PC.XYZ() + tmpDir.XYZ() * tmp * 1.e6;
- gp_Pnt Ptmp2 = PC.XYZ() - tmpDir.XYZ() * tmp * 1.e6;
- // check intersection for Ptmp1 and Ptmp2
- bool IsRev = false;
- bool IsOK1 = false;
- bool IsOK2 = false;
- double dist1 = RealLast();
- double dist2 = RealLast();
- gp_Pnt Pres1,Pres2;
- for (TIDSortedElemSet::iterator itF = sortedFaces.begin(); itF != fEnd; ++itF ) {
+ // Restrict pyramid height by intersection with other faces
+ gp_Vec tmpDir(PC,PCbest); tmpDir.Normalize();
+ double tmp = PN->Value(1).Distance(PN->Value(3)) + PN->Value(2).Distance(PN->Value(4));
+ // far points: in (PC, PCbest) direction and vice-versa
+ gp_Pnt farPnt[2] = { PC.XYZ() + tmpDir.XYZ() * tmp * 1.e6,
+ PC.XYZ() - tmpDir.XYZ() * tmp * 1.e6 };
+ // check intersection for farPnt1 and farPnt2
+ bool intersected[2] = { false, false };
+ double dist [2] = { RealLast(), RealLast() };
+ gp_Pnt intPnt[2];
+ for (TIDSortedElemSet::iterator itF = sortedFaces.begin(); itF != fEnd; ++itF )
+ {
const SMDS_MeshElement* F = *itF;
if(F==face) continue;
Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
- SMDS_ElemIteratorPtr nodeIt = F->nodesIterator();
- if( !F->IsQuadratic() ) {
- while ( nodeIt->more() ) {
- const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
- aContour->Append(gp_Pnt(node->X(), node->Y(), node->Z()));
- }
- }
- else {
- int nn = 0;
- while ( nodeIt->more() ) {
- nn++;
- const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
- aContour->Append(gp_Pnt(node->X(), node->Y(), node->Z()));
- if(nn==face->NbNodes()/2) break;
- }
- }
- gp_Pnt PPP;
- if( HasIntersection(Ptmp1, PC, PPP, aContour) ) {
- IsOK1 = true;
- double tmp = PC.Distance(PPP);
- if(tmp<dist1) {
- Pres1 = PPP;
- dist1 = tmp;
- }
- }
- if( HasIntersection(Ptmp2, PC, PPP, aContour) ) {
- IsOK2 = true;
- double tmp = PC.Distance(PPP);
- if(tmp<dist2) {
- Pres2 = PPP;
- dist2 = tmp;
+ int nbN = F->NbNodes() / ( F->IsQuadratic() ? 2 : 1 );
+ for ( i = 0; i < nbN; ++i )
+ aContour->Append( SMESH_MeshEditor::TNodeXYZ( F->GetNode(i) ));
+ gp_Pnt intP;
+ for ( int isRev = 0; isRev < 2; ++isRev )
+ {
+ if( !volumes[isRev] && HasIntersection(farPnt[isRev], PC, intP, aContour) ) {
+ intersected[isRev] = true;
+ double d = PC.Distance( intP );
+ if( d < dist[isRev] )
+ {
+ intPnt[isRev] = intP;
+ dist [isRev] = d;
+ }
}
}
}
- if( IsOK1 && !IsOK2 ) {
- // using existed direction
- double tmp = PC.Distance(Pres1)/3.;
- if( height > tmp ) {
- height = tmp;
- PCbest = PC.XYZ() + tmpDir.XYZ() * height;
- }
- }
- else if( !IsOK1 && IsOK2 ) {
- // using opposite direction
- IsRev = true;
- double tmp = PC.Distance(Pres2)/3.;
- if( height > tmp ) height = tmp;
- PCbest = PC.XYZ() - tmpDir.XYZ() * height;
- }
- else { // IsOK1 && IsOK2
- double tmp1 = PC.Distance(Pres1)/3.;
- double tmp2 = PC.Distance(Pres2)/3.;
- if(tmp1<tmp2) {
- // using existed direction
- if( height > tmp1 ) {
- height = tmp1;
- PCbest = PC.XYZ() + tmpDir.XYZ() * height;
- }
- }
- else {
- // using opposite direction
- IsRev = true;
- if( height > tmp2 ) height = tmp2;
- PCbest = PC.XYZ() - tmpDir.XYZ() * height;
- }
- }
+ // Create one or two pyramids
- // create node for PCbest
- SMDS_MeshNode* NewNode = helper.AddNode( PCbest.X(), PCbest.Y(), PCbest.Z() );
- // add triangles to result map
- std::list<const SMDS_FaceOfNodes*> aList;
- for(i=0; i<4; i++) {
- SMDS_FaceOfNodes* NewFace;
- if(IsRev)
- NewFace = new SMDS_FaceOfNodes( NewNode, FNodes[i], FNodes[i+1] );
+ for ( int isRev = 0; isRev < 2; ++isRev )
+ {
+ if( !intersected[isRev] ) continue;
+ double pyramidH = Min( height, PC.Distance(intPnt[isRev])/3.);
+ PCbest = PC.XYZ() + tmpDir.XYZ() * (isRev ? -pyramidH : pyramidH);
+
+ // create node for PCbest
+ SMDS_MeshNode* NewNode = helper.AddNode( PCbest.X(), PCbest.Y(), PCbest.Z() );
+
+ // add triangles to result map
+ TTriaList& aList = myResMap.insert( make_pair( face, TTriaList()))->second;
+ for(i=0; i<4; i++) {
+ SMDS_FaceOfNodes* NewFace;
+ if(isRev)
+ NewFace = new SMDS_FaceOfNodes( NewNode, FNodes[i], FNodes[i+1] );
+ else
+ NewFace = new SMDS_FaceOfNodes( NewNode, FNodes[i+1], FNodes[i] );
+ aList.push_back(NewFace);
+ }
+ // create a pyramid
+ SMDS_MeshVolume* aPyram;
+ if(isRev)
+ aPyram = helper.AddVolume( FNodes[0], FNodes[1], FNodes[2], FNodes[3], NewNode );
else
- NewFace = new SMDS_FaceOfNodes( NewNode, FNodes[i+1], FNodes[i] );
- aList.push_back(NewFace);
+ aPyram = helper.AddVolume( FNodes[0], FNodes[3], FNodes[2], FNodes[1], NewNode );
+ myPyram2Trias.insert(make_pair(aPyram, & aList));
}
- myResMap.insert(make_pair(face,aList));
- // create pyramid
- SMDS_MeshVolume* aPyram;
- if(IsRev)
- aPyram = helper.AddVolume( FNodes[0], FNodes[1], FNodes[2], FNodes[3], NewNode );
- else
- aPyram = helper.AddVolume( FNodes[0], FNodes[3], FNodes[2], FNodes[1], NewNode );
- myMapFPyram.insert(make_pair(face,aPyram));
- } // end loop on elements on a face
+ } // end loop on all faces
return Compute2ndPart(aMesh);
}
-
//=======================================================================
//function : Compute2ndPart
-//purpose :
+//purpose : Update created pyramids and faces to avoid their intersection
//=======================================================================
bool StdMeshers_QuadToTriaAdaptor::Compute2ndPart(SMESH_Mesh& aMesh)
SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
// check intersections between created pyramids
- int NbPyram = myMapFPyram.size();
- //cout<<"NbPyram = "<<NbPyram<<endl;
- if(NbPyram==0)
+
+ if(myPyram2Trias.empty())
return true;
- vector< const SMDS_MeshElement* > Pyrams(NbPyram);
- vector< const SMDS_MeshElement* > Faces(NbPyram);
- TF2PyramMap::iterator itp = myMapFPyram.begin();
- int i = 0;
- for(; itp!=myMapFPyram.end(); itp++, i++) {
- Faces[i] = (*itp).first;
- Pyrams[i] = (*itp).second;
- }
- StdMeshers_Array1OfSequenceOfInteger MergesInfo(0,NbPyram-1);
- for(i=0; i<NbPyram; i++) {
- TColStd_SequenceOfInteger aMerges;
- aMerges.Append(i);
- MergesInfo.SetValue(i,aMerges);
- }
- for(i=0; i<NbPyram-1; i++) {
- const SMDS_MeshElement* Prm1 = Pyrams[i];
- SMDS_ElemIteratorPtr nIt = Prm1->nodesIterator();
- std::vector<gp_Pnt> Ps1( Prm1->NbNodes() );
- vector< const SMDS_MeshNode* > Ns1( Prm1->NbNodes() );
- int k = 0;
- for ( ; k < Ns1.size(); ++k ) {
- const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nIt->next() );
- Ns1[k] = node;
- Ps1[k] = gp_Pnt(node->X(), node->Y(), node->Z());
- }
+ int k = 0;
+
+ // for each pyramid store list of merged pyramids with their faces
+ typedef map< const SMDS_MeshElement*, list< TPyram2Trias::iterator > > TPyram2Merged;
+ TPyram2Merged MergesInfo;
+
+ // iterate on all pyramids
+ TPyram2Trias::iterator itPi = myPyram2Trias.begin(), itPEnd = myPyram2Trias.end();
+ for ( ; itPi != itPEnd; ++itPi )
+ {
+ const SMDS_MeshElement* PrmI = itPi->first;
+ TPyram2Merged::iterator pMergesI = MergesInfo.find( PrmI );
+
+ TXyzIterator xyzIt( PrmI->nodesIterator() );
+ vector<gp_Pnt> PsI( xyzIt, TXyzIterator() );
+
+ // compare PrmI with all the rest pyramids
bool NeedMove = false;
- for(int j=i+1; j<NbPyram; j++) {
- //cout<<" i="<<i<<" j="<<j<<endl;
- const TColStd_SequenceOfInteger& aMergesI = MergesInfo.Value(i);
- int nbI = aMergesI.Length();
- const TColStd_SequenceOfInteger& aMergesJ = MergesInfo.Value(j);
- int nbJ = aMergesJ.Length();
+ TPyram2Trias::iterator itPj = itPi;
+ for ( ++itPj; itPj != itPEnd; ++itPj )
+ {
+ const SMDS_MeshElement* PrmJ = itPj->first;
+ TPyram2Merged::iterator pMergesJ = MergesInfo.find( PrmJ );
+
// check if two pyramids already merged
- bool NeedCont = false;
- for( k = 2; k<=nbI; k++) {
- if(aMergesI.Value(k)==j) {
- NeedCont = true;
- break;
- }
- }
- if(NeedCont) continue; // already merged
-
- const SMDS_MeshElement* Prm2 = Pyrams[j];
- nIt = Prm2->nodesIterator();
- vector<gp_Pnt> Ps2( Prm2->NbNodes() );
- vector<const SMDS_MeshNode*> Ns2( Prm2->NbNodes() );
- for ( k = 0; k < Ns2.size(); ++k ) {
- const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nIt->next() );
- Ns2[k] = node;
- Ps2[k] = gp_Pnt(node->X(), node->Y(), node->Z());
- }
+ if ( pMergesJ != MergesInfo.end() &&
+ find(pMergesJ->second.begin(),pMergesJ->second.end(), itPi )!=pMergesJ->second.end())
+ continue; // already merged
+
+ xyzIt = TXyzIterator( PrmJ->nodesIterator() );
+ vector<gp_Pnt> PsJ( xyzIt, TXyzIterator() );
bool hasInt = false;
gp_Pnt Pint;
- for(k=0; k<4; k++) {
- gp_Vec Vtmp(Ps1[k],Ps1[4]);
- gp_Pnt Pshift = Ps1[k].XYZ() + Vtmp.XYZ() * 0.01;
- int m=0;
- for(; m<3; m++) {
- if( HasIntersection3( Pshift, Ps1[4], Pint, Ps2[m], Ps2[m+1], Ps2[4]) ) {
- hasInt = true;
- break;
- }
- }
- if( HasIntersection3( Pshift, Ps1[4], Pint, Ps2[3], Ps2[0], Ps2[4]) ) {
- hasInt = true;
- }
- if(hasInt) break;
+ for(k=0; k<4 && !hasInt; k++) {
+ gp_Vec Vtmp(PsI[k],PsI[4]);
+ gp_Pnt Pshift = PsI[k].XYZ() + Vtmp.XYZ() * 0.01;
+ hasInt =
+ ( HasIntersection3( Pshift, PsI[4], Pint, PsJ[0], PsJ[1], PsJ[4]) ||
+ HasIntersection3( Pshift, PsI[4], Pint, PsJ[1], PsJ[2], PsJ[4]) ||
+ HasIntersection3( Pshift, PsI[4], Pint, PsJ[2], PsJ[3], PsJ[4]) ||
+ HasIntersection3( Pshift, PsI[4], Pint, PsJ[3], PsJ[0], PsJ[4]) );
}
- if(!hasInt) {
- for(k=0; k<4; k++) {
- gp_Vec Vtmp(Ps2[k],Ps2[4]);
- gp_Pnt Pshift = Ps2[k].XYZ() + Vtmp.XYZ() * 0.01;
- int m=0;
- for(; m<3; m++) {
- if( HasIntersection3( Pshift, Ps2[4], Pint, Ps1[m], Ps1[m+1], Ps1[4]) ) {
- hasInt = true;
- break;
- }
- }
- if( HasIntersection3( Pshift, Ps2[4], Pint, Ps1[3], Ps1[0], Ps1[4]) ) {
- hasInt = true;
- }
- if(hasInt) break;
- }
+ for(k=0; k<4 && !hasInt; k++) {
+ gp_Vec Vtmp(PsJ[k],PsJ[4]);
+ gp_Pnt Pshift = PsJ[k].XYZ() + Vtmp.XYZ() * 0.01;
+ hasInt =
+ ( HasIntersection3( Pshift, PsJ[4], Pint, PsI[0], PsI[1], PsI[4]) ||
+ HasIntersection3( Pshift, PsJ[4], Pint, PsI[1], PsI[2], PsI[4]) ||
+ HasIntersection3( Pshift, PsJ[4], Pint, PsI[2], PsI[3], PsI[4]) ||
+ HasIntersection3( Pshift, PsJ[4], Pint, PsI[3], PsI[0], PsI[4]) );
}
-
if(hasInt) {
- //cout<<" has intersec for i="<<i<<" j="<<j<<endl;
- // check if MeshFaces have 2 common node
+ // count common nodes of base faces of two pyramids
int nbc = 0;
- for(k=0; k<4; k++) {
- for(int m=0; m<4; m++) {
- if( Ns1[k]==Ns2[m] ) nbc++;
- }
- }
+ for(k=0; k<4; k++)
+ nbc += int ( PrmI->GetNodeIndex( PrmJ->GetNode(k) ) >= 0 );
//cout<<" nbc = "<<nbc<<endl;
- if(nbc>0) {
- // create common node
- SMDS_MeshNode* CommonNode = const_cast<SMDS_MeshNode*>(Ns1[4]);
- CommonNode->setXYZ( ( nbI*Ps1[4].X() + nbJ*Ps2[4].X() ) / (nbI+nbJ),
- ( nbI*Ps1[4].Y() + nbJ*Ps2[4].Y() ) / (nbI+nbJ),
- ( nbI*Ps1[4].Z() + nbJ*Ps2[4].Z() ) / (nbI+nbJ) );
- NeedMove = true;
- //cout<<" CommonNode: "<<CommonNode;
- const SMDS_MeshNode* Nrem = Ns2[4];
- Ns2[4] = CommonNode;
- meshDS->ChangeElementNodes(Prm2, &Ns2[0], Ns2.size());
- // update pyramids for J
- for(k=2; k<=nbJ; k++) {
- const SMDS_MeshElement* tmpPrm = Pyrams[aMergesJ.Value(k)];
- SMDS_ElemIteratorPtr tmpIt = tmpPrm->nodesIterator();
- vector< const SMDS_MeshNode* > Ns( tmpPrm->NbNodes() );
- for ( int m = 0; m < Ns.size(); ++m )
- Ns[m] = static_cast<const SMDS_MeshNode*>( tmpIt->next() );
- Ns[4] = CommonNode;
- meshDS->ChangeElementNodes(tmpPrm, &Ns[0], Ns.size());
- }
- // update MergesInfo
- for(k=1; k<=nbI; k++) {
- int num = aMergesI.Value(k);
- TColStd_SequenceOfInteger& aSeq = MergesInfo.ChangeValue(num);
- for(int m=1; m<=nbJ; m++)
- aSeq.Append(aMergesJ.Value(m));
+ if ( nbc == 4 )
+ continue; // pyrams have a common base face
+
+ if(nbc>0)
+ {
+ // Merge the two pyramids and others already merged with them
+
+ // initialize merge info of pyramids
+ if ( pMergesI == MergesInfo.end() ) // first merge of PrmI
+ {
+ pMergesI = MergesInfo.insert( make_pair( PrmI, list<TPyram2Trias::iterator >())).first;
+ pMergesI->second.push_back( itPi );
}
- for(k=1; k<=nbJ; k++) {
- int num = aMergesJ.Value(k);
- TColStd_SequenceOfInteger& aSeq = MergesInfo.ChangeValue(num);
- for(int m=1; m<=nbI; m++)
- aSeq.Append(aMergesI.Value(m));
+ if ( pMergesJ == MergesInfo.end() ) // first merge of PrmJ
+ {
+ pMergesJ = MergesInfo.insert( make_pair( PrmJ, list<TPyram2Trias::iterator >())).first;
+ pMergesJ->second.push_back( itPj );
}
+ int nbI = pMergesI->second.size(), nbJ = pMergesJ->second.size();
- // update triangles for aMergesJ
- for(k=1; k<=nbJ; k++) {
- list< list< const SMDS_MeshNode* > > aFNodes;
- list< const SMDS_MeshElement* > aFFaces;
- int num = aMergesJ.Value(k);
- map< const SMDS_MeshElement*,
- list<const SMDS_FaceOfNodes*> >::iterator itrm = myResMap.find(Faces[num]);
- list<const SMDS_FaceOfNodes*>& trias = itrm->second;
- list<const SMDS_FaceOfNodes*>::iterator itt = trias.begin();
- for(; itt!=trias.end(); itt++) {
- SMDS_ElemIteratorPtr nodeIt = (*itt)->nodesIterator();
- const SMDS_MeshNode* NF[3];
- int nn = 0;
- while ( nodeIt->more() )
- NF[nn++] = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
- NF[0] = CommonNode;
- SMDS_FaceOfNodes* Ftria = const_cast< SMDS_FaceOfNodes*>( (*itt) );
- Ftria->ChangeNodes(NF, 3);
+ // an apex node to make common to all merged pyramids
+ SMDS_MeshNode* CommonNode = const_cast<SMDS_MeshNode*>(PrmI->GetNode(4));
+ CommonNode->setXYZ( ( nbI*PsI[4].X() + nbJ*PsJ[4].X() ) / (nbI+nbJ),
+ ( nbI*PsI[4].Y() + nbJ*PsJ[4].Y() ) / (nbI+nbJ),
+ ( nbI*PsI[4].Z() + nbJ*PsJ[4].Z() ) / (nbI+nbJ) );
+ NeedMove = true;
+ const SMDS_MeshNode* Nrem = PrmJ->GetNode(4); // node to remove
+
+ list< TPyram2Trias::iterator >& aMergesI = pMergesI->second;
+ list< TPyram2Trias::iterator >& aMergesJ = pMergesJ->second;
+
+ // find and remove coincided faces of merged pyramids
+ list< TPyram2Trias::iterator >::iterator itPttI, itPttJ;
+ TTriaList::iterator trI, trJ;
+ for ( itPttI = aMergesI.begin(); itPttI != aMergesI.end(); ++itPttI )
+ {
+ TTriaList* triaListI = (*itPttI)->second;
+ for ( trI = triaListI->begin(); trI != triaListI->end(); )
+ {
+ const SMDS_FaceOfNodes* FI = *trI;
+
+ for ( itPttJ = aMergesJ.begin(); itPttJ != aMergesJ.end() && FI; ++itPttJ )
+ {
+ TTriaList* triaListJ = (*itPttJ)->second;
+ for ( trJ = triaListJ->begin(); trJ != triaListJ->end(); )
+ {
+ const SMDS_FaceOfNodes* FJ = *trJ;
+
+ if( EqualTriangles(FI,FJ) )
+ {
+ delete FI;
+ delete FJ;
+ FI = FJ = 0;
+ trI = triaListI->erase( trI );
+ trJ = triaListJ->erase( trJ );
+ break; // only one triangle of a pyramid can coincide with another pyramid
+ }
+ ++trJ;
+ }
+ }
+ if ( FI ) ++trI; // increament if triangle not deleted
}
}
- // check and remove coincided faces
- //TColStd_SequenceOfInteger IdRemovedTrias;
- int i1 = 1;
- for(; i1<=nbI; i1++) {
- int numI = aMergesI.Value(i1);
- map< const SMDS_MeshElement*,
- list<const SMDS_FaceOfNodes*> >::iterator itrmI = myResMap.find(Faces[numI]);
- list<const SMDS_FaceOfNodes*>& triasI = (*itrmI).second;
- list<const SMDS_FaceOfNodes*>::iterator ittI = triasI.begin();
- int nbfI = triasI.size();
- vector<const SMDS_FaceOfNodes*> FsI(nbfI);
- k = 0;
- for(; ittI!=triasI.end(); ittI++) {
- FsI[k] = (*ittI);
- k++;
+ // set the common apex node to pyramids and triangles merged with J
+ for ( itPttJ = aMergesJ.begin(); itPttJ != aMergesJ.end(); ++itPttJ )
+ {
+ const SMDS_MeshElement* Prm = (*itPttJ)->first;
+ TTriaList* triaList = (*itPttJ)->second;
+
+ vector< const SMDS_MeshNode* > nodes( Prm->begin_nodes(), Prm->end_nodes() );
+ nodes[4] = CommonNode;
+ meshDS->ChangeElementNodes( Prm, &nodes[0], nodes.size());
+
+ for ( TTriaList::iterator trIt = triaList->begin(); trIt != triaList->end(); ++trIt )
+ {
+ SMDS_FaceOfNodes* Ftria = const_cast< SMDS_FaceOfNodes*>( *trIt );
+ const SMDS_MeshNode* NF[3] = { CommonNode, Ftria->GetNode(1), Ftria->GetNode(2)};
+ Ftria->ChangeNodes(NF, 3);
}
- int i2 = 0;
- for(; i2<nbfI; i2++) {
- const SMDS_FaceOfNodes* FI = FsI[i2];
- if(FI==0) continue;
- int j1 = 1;
- for(; j1<=nbJ; j1++) {
- int numJ = aMergesJ.Value(j1);
- map< const SMDS_MeshElement*,
- list<const SMDS_FaceOfNodes*> >::iterator itrmJ = myResMap.find(Faces[numJ]);
- list<const SMDS_FaceOfNodes*>& triasJ = (*itrmJ).second;
- list<const SMDS_FaceOfNodes*>::iterator ittJ = triasJ.begin();
- int nbfJ = triasJ.size();
- vector<const SMDS_FaceOfNodes*> FsJ(nbfJ);
- k = 0;
- for(; ittJ!=triasJ.end(); ittJ++) {
- FsJ[k] = (*ittJ);
- k++;
- }
- int j2 = 0;
- for(; j2<nbfJ; j2++) {
- const SMDS_FaceOfNodes* FJ = FsJ[j2];
- // compare triangles
- if( CompareTrias(FI,FJ) ) {
- //IdRemovedTrias.Append( FI->GetID() );
- //IdRemovedTrias.Append( FJ->GetID() );
- FsI[i2] = 0;
- FsJ[j2] = 0;
- list<const SMDS_FaceOfNodes*> new_triasI;
- for(k=0; k<nbfI; k++) {
- if( FsI[k]==0 ) continue;
- new_triasI.push_back( FsI[k] );
- }
- (*itrmI).second = new_triasI;
- triasI = new_triasI;
- list<const SMDS_FaceOfNodes*> new_triasJ;
- for(k=0; k<nbfJ; k++) {
- if( FsJ[k]==0 ) continue;
- new_triasJ.push_back( FsJ[k] );
- }
- (*itrmJ).second = new_triasJ;
- triasJ = new_triasJ;
- // remove faces
- delete FI;
- delete FJ;
- // close for j2 and j1
- j1 = nbJ;
- break;
- }
- } // j2
- } // j1
- } // i2
- } // i1
+ }
+
+ // join MergesInfo of merged pyramids
+ for ( k = 0, itPttI = aMergesI.begin(); k < nbI; ++itPttI, ++k )
+ {
+ const SMDS_MeshElement* PrmI = (*itPttI)->first;
+ list< TPyram2Trias::iterator >& merges = MergesInfo[ PrmI ];
+ merges.insert( merges.end(), aMergesJ.begin(), aMergesJ.end() );
+ }
+ for ( k = 0, itPttJ = aMergesJ.begin(); k < nbJ; ++itPttJ, ++k )
+ {
+ const SMDS_MeshElement* PrmJ = (*itPttJ)->first;
+ list< TPyram2Trias::iterator >& merges = MergesInfo[ PrmJ ];
+ merges.insert( merges.end(), aMergesI.begin(), aMergesI.end() );
+ }
+
// removing node
meshDS->RemoveNode(Nrem);
}
else { // nbc==0
- //cout<<"decrease height of pyramids"<<endl;
+
// decrease height of pyramids
- double xc1 = 0., yc1 = 0., zc1 = 0.;
- double xc2 = 0., yc2 = 0., zc2 = 0.;
+ gp_XYZ PC1(0,0,0), PC2(0,0,0);
for(k=0; k<4; k++) {
- xc1 += Ps1[k].X();
- yc1 += Ps1[k].Y();
- zc1 += Ps1[k].Z();
- xc2 += Ps2[k].X();
- yc2 += Ps2[k].Y();
- zc2 += Ps2[k].Z();
+ PC1 += PsI[k].XYZ();
+ PC2 += PsJ[k].XYZ();
}
- gp_Pnt PC1(xc1/4.,yc1/4.,zc1/4.);
- gp_Pnt PC2(xc2/4.,yc2/4.,zc2/4.);
- gp_Vec VN1(PC1,Ps1[4]);
+ PC1 /= 4; PC2 /= 4;
+ gp_Vec VN1(PC1,PsI[4]);
gp_Vec VI1(PC1,Pint);
- gp_Vec VN2(PC2,Ps2[4]);
+ gp_Vec VN2(PC2,PsJ[4]);
gp_Vec VI2(PC2,Pint);
double ang1 = fabs(VN1.Angle(VI1));
double ang2 = fabs(VN2.Angle(VI2));
if(ang2<PI/3)
coef2 -= cos(ang1)*0.25;
- SMDS_MeshNode* aNode1 = const_cast<SMDS_MeshNode*>(Ns1[4]);
VN1.Scale(coef1);
- aNode1->setXYZ( PC1.X()+VN1.X(), PC1.Y()+VN1.Y(), PC1.Z()+VN1.Z() );
- SMDS_MeshNode* aNode2 = const_cast<SMDS_MeshNode*>(Ns2[4]);
VN2.Scale(coef2);
+ SMDS_MeshNode* aNode1 = const_cast<SMDS_MeshNode*>(PrmI->GetNode(4));
+ aNode1->setXYZ( PC1.X()+VN1.X(), PC1.Y()+VN1.Y(), PC1.Z()+VN1.Z() );
+ SMDS_MeshNode* aNode2 = const_cast<SMDS_MeshNode*>(PrmJ->GetNode(4));
aNode2->setXYZ( PC2.X()+VN2.X(), PC2.Y()+VN2.Y(), PC2.Z()+VN2.Z() );
NeedMove = true;
}
} // end if(hasInt)
- else {
- //cout<<" no intersec for i="<<i<<" j="<<j<<endl;
- }
-
}
- if( NeedMove && !meshDS->IsEmbeddedMode() ) {
- meshDS->MoveNode( Ns1[4], Ns1[4]->X(), Ns1[4]->Y(), Ns1[4]->Z() );
+ if( NeedMove && !meshDS->IsEmbeddedMode() )
+ {
+ const SMDS_MeshNode* apex = PrmI->GetNode( 4 );
+ meshDS->MoveNode( apex, apex->X(), apex->Y(), apex->Z() );
}
}
+ // rebind triangles of pyramids sharing the same base quadrangle to the first
+ // entrance of the base quadrangle
+ TQuad2Trias::iterator q2t = myResMap.begin(), q2tPrev = q2t;
+ for ( ++q2t; q2t != myResMap.end(); ++q2t, ++q2tPrev )
+ {
+ if ( q2t->first == q2tPrev->first )
+ q2tPrev->second.splice( q2tPrev->second.end(), q2t->second );
+ }
+
+ myPyram2Trias.clear(); // no more needed
+ myDegNodes.clear();
+
return true;
}
-
//================================================================================
/*!
* \brief Return list of created triangles for given face
*/
//================================================================================
-const list<const SMDS_FaceOfNodes*>* StdMeshers_QuadToTriaAdaptor::GetTriangles
- (const SMDS_MeshElement* aFace)
+
+const list<const SMDS_FaceOfNodes* >* StdMeshers_QuadToTriaAdaptor::GetTriangles (const SMDS_MeshElement* aQuad)
{
- map< const SMDS_MeshElement*,
- list<const SMDS_FaceOfNodes*> >::iterator it = myResMap.find(aFace);
+ TQuad2Trias::iterator it = myResMap.find(aQuad);
if( it != myResMap.end() ) {
return & it->second;
}
return 0;
}
-
-
-//================================================================================
-/*!
- * \brief Remove all create auxilary faces
- */
-//================================================================================
-//void StdMeshers_QuadToTriaAdaptor::RemoveFaces(SMESH_Mesh& aMesh)
-//{
-// SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
-// map< const SMDS_MeshElement*,
-// list<const SMDS_MeshElement*> >::iterator it = myResMap.begin();
-// for(; it != myResMap.end(); it++ ) {
-// list<const SMDS_MeshElement*> aFaces = (*it).second;
-// list<const SMDS_MeshElement*>::iterator itf = aFaces.begin();
-// for(; itf!=aFaces.end(); itf++ ) {
-// meshDS->RemoveElement( (*itf) );
-// }
-// }
-//}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_QuadToTriaAdaptor.hxx
// Module : SMESH
#ifndef _SMESH_QuadToTriaAdaptor_HXX_
#define _SMESH_QuadToTriaAdaptor_HXX_
-#include <SMESH_Mesh.hxx>
#include "SMESH_StdMeshers.hxx"
-#include <SMDS_FaceOfNodes.hxx>
-#include <TColgp_HArray1OfPnt.hxx>
-#include <TColgp_HArray1OfVec.hxx>
+#include "SMDS_FaceOfNodes.hxx"
+
+class SMESH_Mesh;
+class SMDS_MeshElement;
+class SMDS_MeshNode;
+class Handle(TColgp_HArray1OfPnt);
+class Handle(TColgp_HArray1OfVec);
+class TopoDS_Shape;
+class gp_Pnt;
+class gp_Vec;
+
#include <map>
#include <list>
{
public:
- StdMeshers_QuadToTriaAdaptor();
-
~StdMeshers_QuadToTriaAdaptor();
bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
Handle(TColgp_HArray1OfPnt)& PN,
Handle(TColgp_HArray1OfVec)& VN,
std::vector<const SMDS_MeshNode*>& FNodes,
- gp_Pnt& PC, gp_Vec& VNorm);
+ gp_Pnt& PC, gp_Vec& VNorm,
+ const SMDS_MeshElement** volumes=0);
bool CheckIntersection(const gp_Pnt& P, const gp_Pnt& PC,
gp_Pnt& Pint, SMESH_Mesh& aMesh,
bool Compute2ndPart(SMESH_Mesh& aMesh);
- typedef std::map< const SMDS_MeshElement*, const SMDS_MeshElement*, TIDCompare > TF2PyramMap;
+ typedef std::list<const SMDS_FaceOfNodes* > TTriaList;
+ typedef std::multimap<const SMDS_MeshElement*, TTriaList > TQuad2Trias;
+ typedef std::map<const SMDS_MeshElement*, TTriaList *, TIDCompare> TPyram2Trias;
+
+ TQuad2Trias myResMap;
+ TPyram2Trias myPyram2Trias;
- std::map< const SMDS_MeshElement*, std::list<const SMDS_FaceOfNodes*> > myResMap;
- TF2PyramMap myMapFPyram;
std::list< const SMDS_MeshNode* > myDegNodes;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_QuadrangleParams.cxx
// Author : Sergey KUUL, OCC
//=============================================================================
StdMeshers_QuadrangleParams::StdMeshers_QuadrangleParams(int hypId, int studyId,
- SMESH_Gen * gen)
+ SMESH_Gen * gen)
:SMESH_Hypothesis(hypId, studyId, gen)
{
_name = "QuadrangleParams";
//================================================================================
bool StdMeshers_QuadrangleParams::SetParametersByMesh(const SMESH_Mesh* theMesh,
- const TopoDS_Shape& theShape)
+ const TopoDS_Shape& theShape)
{
if ( !theMesh || theShape.IsNull() )
return false;
//================================================================================
bool StdMeshers_QuadrangleParams::SetParametersByDefaults(const TDefaults& dflts,
- const SMESH_Mesh* /*mesh*/)
+ const SMESH_Mesh* /*mesh*/)
{
return true;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_QuadrangleParams.hxx
// Author : Sergey KUUL, OCC
virtual std::ostream & SaveTo(std::ostream & save);
virtual std::istream & LoadFrom(std::istream & load);
friend std::ostream& operator << (std::ostream & save,
- StdMeshers_QuadrangleParams & hyp);
+ StdMeshers_QuadrangleParams & hyp);
friend std::istream& operator >> (std::istream & load,
- StdMeshers_QuadrangleParams & hyp);
+ StdMeshers_QuadrangleParams & hyp);
/*!
* \brief Initialize start and end length by the mesh built on the geometry
* \retval bool - true if parameter values have been successfully defined
*/
virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh,
- const TopoDS_Shape& theShape);
+ 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);
+ const SMESH_Mesh* theMesh=0);
protected:
int _triaVertexID;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers_QuadranglePreference : implementaion of SMESH idl descriptions
// File : StdMeshers_QuadranglePreference.cxx
// Module : SMESH
-
+//
#include "StdMeshers_QuadranglePreference.hxx"
#include "utilities.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers : implementaion of SMESH idl descriptions
// File : StdMeshers_QuadranglePreference.hxx
// Module : SMESH
-
+//
#ifndef _StdMeshers_QuadranglePreference_HXX_
#define _StdMeshers_QuadranglePreference_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Quadrangle_2D.cxx
// Moved here from SMESH_Quadrangle_2D.cxx
#include "SMDS_EdgePosition.hxx"
#include "SMDS_FacePosition.hxx"
-#include <BRepTools_WireExplorer.hxx>
#include <BRep_Tool.hxx>
#include <Geom_Surface.hxx>
#include <NCollection_DefineArray2.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <TColgp_SequenceOfXY.hxx>
#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
#include <TopoDS.hxx>
#include "utilities.h"
int nbSides = 0;
list< TopoDS_Edge >::iterator edgeIt = edges.begin();
- if ( nbEdgesInWire.front() == 3 ) { // exactly 3 edges
- if(myTriaVertexID>0) {
- SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
+ if ( nbEdgesInWire.front() == 3 ) // exactly 3 edges
+ {
+ SMESH_Comment comment;
+ SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
+ if ( myTriaVertexID == -1)
+ {
+ comment << "No Base vertex parameter provided for a trilateral geometrical face";
+ }
+ else
+ {
TopoDS_Vertex V = TopoDS::Vertex(meshDS->IndexToShape(myTriaVertexID));
- if(!V.IsNull()) {
+ if ( !V.IsNull() ) {
TopoDS_Edge E1,E2,E3;
for(; edgeIt != edges.end(); ++edgeIt) {
- TopoDS_Edge E = TopoDS::Edge(*edgeIt);
+ TopoDS_Edge E = *edgeIt;
TopoDS_Vertex VF, VL;
TopExp::Vertices(E, VF, VL, true);
if( VF.IsSame(V) )
else
E2 = E;
}
- quad->side.reserve(4);
- quad->side.push_back( new StdMeshers_FaceSide(F, E1, &aMesh, true, ignoreMediumNodes));
- quad->side.push_back( new StdMeshers_FaceSide(F, E2, &aMesh, true, ignoreMediumNodes));
- quad->side.push_back( new StdMeshers_FaceSide(F, E3, &aMesh, false, ignoreMediumNodes));
- std::vector<UVPtStruct> UVPSleft = quad->side[0]->GetUVPtStruct(true,0);
- std::vector<UVPtStruct> UVPStop = quad->side[1]->GetUVPtStruct(false,1);
- std::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 );
- StdMeshers_FaceSide* VertFS =
- new StdMeshers_FaceSide(aNode, aPnt2d, quad->side[1]);
- quad->side.push_back(VertFS);
- return quad;
+ if ( !E1.IsNull() && !E2.IsNull() && !E3.IsNull() )
+ {
+ quad->side.push_back( new StdMeshers_FaceSide(F, E1, &aMesh, true, ignoreMediumNodes));
+ quad->side.push_back( new StdMeshers_FaceSide(F, E2, &aMesh, true, ignoreMediumNodes));
+ quad->side.push_back( new StdMeshers_FaceSide(F, E3, &aMesh, false,ignoreMediumNodes));
+ 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(aNode, aPnt2d, quad->side[1]));
+ return quad;
+ }
}
+ comment << "Invalid Base vertex parameter: " << myTriaVertexID << " is not among [";
+ TopTools_MapOfShape vMap;
+ for ( TopExp_Explorer v( aShape, TopAbs_VERTEX ); v.More(); v.Next())
+ if ( vMap.Add( v.Current() ))
+ comment << meshDS->ShapeToIndex( v.Current() ) << ( vMap.Extent()==3 ? "]" : ", ");
}
- return 0;
+ error( comment );
+ delete quad;
+ return quad = 0;
}
else if ( nbEdgesInWire.front() == 4 ) { // exactly 4 edges
for ( ; edgeIt != edges.end(); ++edgeIt, nbSides++ )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Quadrangle_2D.hxx
// Moved here from SMESH_Quadrangle_2D.hxx
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
+ const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
FaceQuadStruct* CheckAnd2Dcompute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
+ const TopoDS_Shape& aShape,
const bool CreateQuadratic);
protected:
const TopoDS_Shape& aShape);
bool CheckNbEdgesForEvaluate(SMESH_Mesh& aMesh,
- const TopoDS_Shape & aShape,
- MapShapeNbElems& aResMap,
- std::vector<int>& aNbNodes,
+ const TopoDS_Shape & aShape,
+ MapShapeNbElems& aResMap,
+ std::vector<int>& aNbNodes,
bool& IsQuadratic);
bool SetNormalizedGrid(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- FaceQuadStruct*& quad);
+ const TopoDS_Shape& aShape,
+ FaceQuadStruct*& quad);
void SplitQuad(SMESHDS_Mesh *theMeshDS,
const int theFaceID,
FaceQuadStruct* quad);
bool EvaluateQuadPref(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- std::vector<int>& aNbNodes,
- MapShapeNbElems& aResMap,
+ const TopoDS_Shape& aShape,
+ std::vector<int>& aNbNodes,
+ MapShapeNbElems& aResMap,
bool IsQuadratic);
UVPtStruct* LoadEdgePoints2(SMESH_Mesh& aMesh,
- const TopoDS_Face& F, const TopoDS_Edge& E,
+ const TopoDS_Face& F, const TopoDS_Edge& E,
bool IsReverse);
UVPtStruct* LoadEdgePoints(SMESH_Mesh& aMesh,
- const TopoDS_Face& F, const TopoDS_Edge& E,
- double first, double last);
+ const TopoDS_Face& F, const TopoDS_Edge& E,
+ double first, double last);
UVPtStruct* MakeEdgePoints(SMESH_Mesh& aMesh,
- const TopoDS_Face& F, const TopoDS_Edge& E,
- double first, double last, int nb_segm);
+ const TopoDS_Face& F, const TopoDS_Edge& E,
+ double first, double last, int nb_segm);
// true if QuadranglePreference hypothesis is assigned that forces
// construction of quadrangles if the number of nodes on opposite edges
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers_QuadraticMesh : implementaion of SMESH idl descriptions
// File : StdMeshers_QuadraticMesh.cxx
// Module : SMESH
-
+//
#include "StdMeshers_QuadraticMesh.hxx"
#include "utilities.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers : implementaion of SMESH idl descriptions
// File : StdMeshers_QuadraticMesh.hxx
// Module : SMESH
-
+//
#ifndef _StdMeshers_QuadraticMesh_HXX_
#define _StdMeshers_QuadraticMesh_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_RadialPrism_3D.cxx
// Module : SMESH
:SMESH_3D_Algo(hypId, studyId, gen)
{
_name = "RadialPrism_3D";
- _shapeType = (1 << TopAbs_SOLID); // 1 bit per shape type
+ _shapeType = (1 << TopAbs_SOLID); // 1 bit per shape type
_compatibleHypothesis.push_back("LayerDistribution");
_compatibleHypothesis.push_back("NumberOfLayers");
//=======================================================================
bool StdMeshers_RadialPrism_3D::Evaluate(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- MapShapeNbElems& aResMap)
+ const TopoDS_Shape& aShape,
+ MapShapeNbElems& aResMap)
{
// get 2 shells
TopoDS_Solid solid = TopoDS::Solid( aShape );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_RadialPrism_3D.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_RadialQuadrangle_1D2D.cxx
// Module : SMESH
//
#include "StdMeshers_RadialQuadrangle_1D2D.hxx"
-//#include "StdMeshers_ProjectionUtils.hxx"
#include "StdMeshers_NumberOfLayers.hxx"
#include "StdMeshers_LayerDistribution.hxx"
-//#include "StdMeshers_Prism_3D.hxx"
#include "StdMeshers_Regular_1D.hxx"
+#include "StdMeshers_NumberOfSegments.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMESHDS_SubMesh.hxx"
#include "SMESH_Gen.hxx"
+#include "SMESH_HypoFilter.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
#include <TColgp_SequenceOfPnt.hxx>
#include <TColgp_SequenceOfPnt2d.hxx>
#include <TopExp_Explorer.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopoDS.hxx>
#define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
#define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z())
-//typedef StdMeshers_ProjectionUtils TAssocTool;
-
//=======================================================================
//function : StdMeshers_RadialQuadrangle_1D2D
myNbLayerHypo = 0;
myDistributionHypo = 0;
_requireDescretBoundary = false;
+ _supportSubmeshes = true;
}
const list <const SMESHDS_Hypothesis * >&hyps = GetUsedHypothesis(aMesh, aShape);
if ( hyps.size() == 0 ) {
- aStatus = SMESH_Hypothesis::HYP_MISSING;
- return false; // can't work with no hypothesis
+ aStatus = SMESH_Hypothesis::HYP_OK;
+ return true; // can work with no hypothesis
}
if ( hyps.size() > 1 ) {
/*!
* \brief Listener used to mark edges meshed by StdMeshers_RadialQuadrangle_1D2D
*/
- class TLinEdgeMarker : public SMESH_subMeshEventListener
+ class TEdgeMarker : public SMESH_subMeshEventListener
{
- TLinEdgeMarker(): SMESH_subMeshEventListener(/*isDeletable=*/false) {}
+ TEdgeMarker(): SMESH_subMeshEventListener(/*isDeletable=*/false) {}
public:
+ //!< Return static listener
static SMESH_subMeshEventListener* getListener()
{
- static TLinEdgeMarker theEdgeMarker;
+ static TEdgeMarker theEdgeMarker;
return &theEdgeMarker;
}
+ //! Clear face sumbesh if something happens on edges
+ void ProcessEvent(const int event,
+ const int eventType,
+ SMESH_subMesh* edgeSubMesh,
+ EventListenerData* data,
+ const SMESH_Hypothesis* /*hyp*/)
+ {
+ if ( data && !data->mySubMeshes.empty() && eventType == SMESH_subMesh::ALGO_EVENT)
+ {
+ ASSERT( data->mySubMeshes.front() != edgeSubMesh );
+ SMESH_subMesh* faceSubMesh = data->mySubMeshes.front();
+ faceSubMesh->ComputeStateEngine( SMESH_subMesh::CLEAN );
+ }
+ }
};
-
+
// ------------------------------------------------------------------------------
/*!
* \brief Mark an edge as computed by StdMeshers_RadialQuadrangle_1D2D
*/
- void markLinEdgeAsComputedByMe(const TopoDS_Edge& edge, SMESH_subMesh* faceSubMesh)
+ void markEdgeAsComputedByMe(const TopoDS_Edge& edge, SMESH_subMesh* faceSubMesh)
{
if ( SMESH_subMesh* edgeSM = faceSubMesh->GetFather()->GetSubMeshContaining( edge ))
{
- if ( !edgeSM->GetEventListenerData( TLinEdgeMarker::getListener() ))
- faceSubMesh->SetEventListener( TLinEdgeMarker::getListener(),
+ if ( !edgeSM->GetEventListenerData( TEdgeMarker::getListener() ))
+ faceSubMesh->SetEventListener( TEdgeMarker::getListener(),
SMESH_subMeshEventListenerData::MakeData(faceSubMesh),
edgeSM);
}
* \brief Return true if a radial edge was meshed with StdMeshers_RadialQuadrangle_1D2D with
* the same radial distribution
*/
- bool isEdgeCompitaballyMeshed(const TopoDS_Edge& edge, SMESH_subMesh* faceSubMesh)
- {
- if ( SMESH_subMesh* edgeSM = faceSubMesh->GetFather()->GetSubMeshContaining( edge ))
- {
- if ( SMESH_subMeshEventListenerData* otherFaceData =
- edgeSM->GetEventListenerData( TLinEdgeMarker::getListener() ))
- {
- // compare hypothesis aplied to two disk faces sharing radial edges
- SMESH_Mesh& mesh = *faceSubMesh->GetFather();
- SMESH_Algo* radialQuadAlgo = mesh.GetGen()->GetAlgo(mesh, faceSubMesh->GetSubShape() );
- SMESH_subMesh* otherFaceSubMesh = otherFaceData->mySubMeshes.front();
- const list <const SMESHDS_Hypothesis *> & hyps1 =
- radialQuadAlgo->GetUsedHypothesis( mesh, faceSubMesh->GetSubShape());
- const list <const SMESHDS_Hypothesis *> & hyps2 =
- radialQuadAlgo->GetUsedHypothesis( mesh, otherFaceSubMesh->GetSubShape());
- if( hyps1.empty() && hyps2.empty() )
- return true; // defaul hyps
- if ( hyps1.size() != hyps2.size() ||
- strcmp( hyps1.front()->GetName(), hyps2.front()->GetName() ))
- return false;
- ostringstream hypDump1, hypDump2;
- list <const SMESHDS_Hypothesis*>::const_iterator hyp1 = hyps1.begin();
- for ( ; hyp1 != hyps1.end(); ++hyp1 )
- const_cast<SMESHDS_Hypothesis*>(*hyp1)->SaveTo( hypDump1 );
- list <const SMESHDS_Hypothesis*>::const_iterator hyp2 = hyps2.begin();
- for ( ; hyp2 != hyps2.end(); ++hyp2 )
- const_cast<SMESHDS_Hypothesis*>(*hyp2)->SaveTo( hypDump2 );
- return hypDump1.str() == hypDump2.str();
- }
- }
- return false;
- }
+// bool isEdgeCompatiballyMeshed(const TopoDS_Edge& edge, SMESH_subMesh* faceSubMesh)
+// {
+// if ( SMESH_subMesh* edgeSM = faceSubMesh->GetFather()->GetSubMeshContaining( edge ))
+// {
+// if ( SMESH_subMeshEventListenerData* otherFaceData =
+// edgeSM->GetEventListenerData( TEdgeMarker::getListener() ))
+// {
+// // compare hypothesis aplied to two disk faces sharing radial edges
+// SMESH_Mesh& mesh = *faceSubMesh->GetFather();
+// SMESH_Algo* radialQuadAlgo = mesh.GetGen()->GetAlgo(mesh, faceSubMesh->GetSubShape() );
+// SMESH_subMesh* otherFaceSubMesh = otherFaceData->mySubMeshes.front();
+// list <const SMESHDS_Hypothesis *> hyps1 =
+// radialQuadAlgo->GetUsedHypothesis( mesh, faceSubMesh->GetSubShape());
+// list <const SMESHDS_Hypothesis *> hyps2 =
+// radialQuadAlgo->GetUsedHypothesis( mesh, otherFaceSubMesh->GetSubShape());
+// if( hyps1.empty() && hyps2.empty() )
+// return true; // defaul hyps
+// if ( hyps1.size() != hyps2.size() )
+// return false;
+// return *hyps1.front() == *hyps2.front();
+// }
+// }
+// return false;
+// }
//================================================================================
/*!
}
return nbe;
}
+
+//================================================================================
+//================================================================================
+/*!
+ * \brief Class computing layers distribution using data of
+ * StdMeshers_LayerDistribution hypothesis
+ */
+//================================================================================
+//================================================================================
+
+class TNodeDistributor: public StdMeshers_Regular_1D
+{
+ list <const SMESHDS_Hypothesis *> myUsedHyps;
+public:
+ // -----------------------------------------------------------------------------
+ static TNodeDistributor* GetDistributor(SMESH_Mesh& aMesh)
+ {
+ const int myID = -1000;
+ map < int, SMESH_1D_Algo * > & algoMap = aMesh.GetGen()->_map1D_Algo;
+ map < int, SMESH_1D_Algo * >::iterator id_algo = algoMap.find( myID );
+ if ( id_algo == algoMap.end() )
+ return new TNodeDistributor( myID, 0, aMesh.GetGen() );
+ return static_cast< TNodeDistributor* >( id_algo->second );
+ }
+ // -----------------------------------------------------------------------------
+ //! Computes distribution of nodes on a straight line ending at pIn and pOut
+ bool Compute( vector< double > & positions,
+ gp_Pnt pIn,
+ gp_Pnt pOut,
+ SMESH_Mesh& aMesh,
+ const SMESH_Hypothesis* hyp1d)
+ {
+ if ( !hyp1d ) return error( "Invalid LayerDistribution hypothesis");
+
+ double len = pIn.Distance( pOut );
+ if ( len <= DBL_MIN ) return error("Too close points of inner and outer shells");
+
+ myUsedHyps.clear();
+ myUsedHyps.push_back( hyp1d );
+
+ TopoDS_Edge edge = BRepBuilderAPI_MakeEdge( pIn, pOut );
+ SMESH_Hypothesis::Hypothesis_Status aStatus;
+ if ( !StdMeshers_Regular_1D::CheckHypothesis( aMesh, edge, aStatus ))
+ return error( "StdMeshers_Regular_1D::CheckHypothesis() failed "
+ "with LayerDistribution hypothesis");
+
+ BRepAdaptor_Curve C3D(edge);
+ double f = C3D.FirstParameter(), l = C3D.LastParameter();
+ list< double > params;
+ if ( !StdMeshers_Regular_1D::computeInternalParameters( aMesh, C3D, len, f, l, params, false ))
+ return error("StdMeshers_Regular_1D failed to compute layers distribution");
+
+ positions.clear();
+ positions.reserve( params.size() );
+ for (list<double>::iterator itU = params.begin(); itU != params.end(); itU++)
+ positions.push_back( *itU / len );
+ return true;
+ }
+ // -----------------------------------------------------------------------------
+ //! Make mesh on an adge using assigned 1d hyp or defaut nb of segments
+ bool ComputeCircularEdge(SMESH_Mesh& aMesh,
+ const TopoDS_Edge& anEdge)
+ {
+ _gen->Compute( aMesh, anEdge);
+ SMESH_subMesh *sm = aMesh.GetSubMesh(anEdge);
+ if ( sm->GetComputeState() != SMESH_subMesh::COMPUTE_OK)
+ {
+ // find any 1d hyp assigned (there can be a hyp w/o algo)
+ myUsedHyps = SMESH_Algo::GetUsedHypothesis(aMesh, anEdge, /*ignoreAux=*/true);
+ Hypothesis_Status aStatus;
+ if ( !StdMeshers_Regular_1D::CheckHypothesis( aMesh, anEdge, aStatus ))
+ {
+ // no valid 1d hyp assigned, use default nb of segments
+ _hypType = NB_SEGMENTS;
+ _ivalue[ DISTR_TYPE_IND ] = StdMeshers_NumberOfSegments::DT_Regular;
+ _ivalue[ NB_SEGMENTS_IND ] = _gen->GetDefaultNbSegments();
+ }
+ return StdMeshers_Regular_1D::Compute( aMesh, anEdge );
+ }
+ return true;
+ }
+ // -----------------------------------------------------------------------------
+ //! Make mesh on an adge using assigned 1d hyp or defaut nb of segments
+ bool EvaluateCircularEdge(SMESH_Mesh& aMesh,
+ const TopoDS_Edge& anEdge,
+ MapShapeNbElems& aResMap)
+ {
+ _gen->Evaluate( aMesh, anEdge, aResMap );
+ if ( aResMap.count( aMesh.GetSubMesh( anEdge )))
+ return true;
+
+ // find any 1d hyp assigned
+ myUsedHyps = SMESH_Algo::GetUsedHypothesis(aMesh, anEdge, /*ignoreAux=*/true);
+ Hypothesis_Status aStatus;
+ if ( !StdMeshers_Regular_1D::CheckHypothesis( aMesh, anEdge, aStatus ))
+ {
+ // no valid 1d hyp assigned, use default nb of segments
+ _hypType = NB_SEGMENTS;
+ _ivalue[ DISTR_TYPE_IND ] = StdMeshers_NumberOfSegments::DT_Regular;
+ _ivalue[ NB_SEGMENTS_IND ] = _gen->GetDefaultNbSegments();
+ }
+ return StdMeshers_Regular_1D::Evaluate( aMesh, anEdge, aResMap );
+ }
+protected:
+ // -----------------------------------------------------------------------------
+ TNodeDistributor( int hypId, int studyId, SMESH_Gen* gen)
+ : StdMeshers_Regular_1D( hypId, studyId, gen)
+ {
+ }
+ // -----------------------------------------------------------------------------
+ virtual const list <const SMESHDS_Hypothesis *> &
+ GetUsedHypothesis(SMESH_Mesh &, const TopoDS_Shape &, const bool)
+ {
+ return myUsedHyps;
+ }
+ // -----------------------------------------------------------------------------
+};
}
//=======================================================================
* \brief Allow algo to do something after persistent restoration
* \param subMesh - restored submesh
*
- * call markLinEdgeAsComputedByMe()
+ * call markEdgeAsComputedByMe()
*/
//=======================================================================
{
TopoDS_Edge CircEdge, LinEdge1, LinEdge2;
analyseFace( faceSubMesh->GetSubShape(), CircEdge, LinEdge1, LinEdge2 );
- if ( !LinEdge1.IsNull() ) markLinEdgeAsComputedByMe( LinEdge1, faceSubMesh );
- if ( !LinEdge2.IsNull() ) markLinEdgeAsComputedByMe( LinEdge2, faceSubMesh );
+ if ( !CircEdge.IsNull() ) markEdgeAsComputedByMe( CircEdge, faceSubMesh );
+ if ( !LinEdge1.IsNull() ) markEdgeAsComputedByMe( LinEdge1, faceSubMesh );
+ if ( !LinEdge2.IsNull() ) markEdgeAsComputedByMe( LinEdge2, faceSubMesh );
}
}
// to delete helper at exit from Compute()
auto_ptr<SMESH_MesherHelper> helperDeleter( myHelper );
- myLayerPositions.clear();
+ TNodeDistributor* algo1d = TNodeDistributor::GetDistributor(aMesh);
TopoDS_Edge CircEdge, LinEdge1, LinEdge2;
int nbe = analyseFace( aShape, CircEdge, LinEdge1, LinEdge2 );
- if( nbe>3 || nbe < 1 || CircEdge.IsNull() )
- return error(COMPERR_BAD_SHAPE);
+ Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast( getCurve( CircEdge ));
+ if( nbe>3 || nbe < 1 || aCirc.IsNull() )
+ return error("The face must be a full circle or a part of circle (i.e. the number of edges is less or equal to 3 and one of them is a circle curve)");
- gp_Pnt P0,P1;
+ gp_Pnt P0, P1;
// points for rotation
TColgp_SequenceOfPnt Points;
// angles for rotation
TopoDS_Face F = TopoDS::Face(aShape);
Handle(Geom_Surface) S = BRep_Tool::Surface(F);
+
if(nbe==1)
{
- Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast( getCurve( CircEdge ));
-
- bool ok = _gen->Compute( aMesh, CircEdge );
- if( !ok ) return false;
+ if (!algo1d->ComputeCircularEdge( aMesh, CircEdge ))
+ return error( algo1d->GetComputeError() );
map< double, const SMDS_MeshNode* > theNodes;
- ok = GetSortedNodesOnEdge(aMesh.GetMeshDS(),CircEdge,true,theNodes);
- if( !ok ) return false;
+ if ( !GetSortedNodesOnEdge(aMesh.GetMeshDS(),CircEdge,true,theNodes))
+ return error("Circular edge is incorrectly meshed");
CNodes.clear();
map< double, const SMDS_MeshNode* >::iterator itn = theNodes.begin();
P1 = gp_Pnt( NF->X(), NF->Y(), NF->Z() );
P0 = aCirc->Location();
- myLayerPositions.clear();
- computeLayerPositions(P0,P1);
+ if ( !computeLayerPositions(P0,P1))
+ return false;
exp.Init( CircEdge, TopAbs_VERTEX );
TopoDS_Vertex V1 = TopoDS::Vertex( exp.Current() );
// other curve not line
return error(COMPERR_BAD_SHAPE);
}
- bool linEdgeComputed = false;
- if( SMESH_subMesh* sm1 = aMesh.GetSubMesh(LinEdge1) ) {
- if( !sm1->IsEmpty() )
- if( isEdgeCompitaballyMeshed( LinEdge1, aMesh.GetSubMesh(F) ))
- linEdgeComputed = true;
- else
- return error("Invalid set of hypotheses");
- }
- bool ok = _gen->Compute( aMesh, CircEdge );
- if( !ok ) return false;
+ if ( !algo1d->ComputeCircularEdge( aMesh, CircEdge ))
+ return error( algo1d->GetComputeError() );
map< double, const SMDS_MeshNode* > theNodes;
- GetSortedNodesOnEdge(aMesh.GetMeshDS(),CircEdge,true,theNodes);
+ if ( !GetSortedNodesOnEdge(aMesh.GetMeshDS(),CircEdge,true,theNodes) )
+ return error("Circular edge is incorrectly meshed");
- CNodes.clear();
map< double, const SMDS_MeshNode* >::iterator itn = theNodes.begin();
+ CNodes.clear();
+ CNodes.push_back( itn->second );
double fang = (*itn).first;
itn++;
for(; itn != theNodes.end(); itn++ ) {
}
const SMDS_MeshNode* NF = theNodes.begin()->second;
const SMDS_MeshNode* NL = theNodes.rbegin()->second;
- CNodes.push_back( NF );
P1 = gp_Pnt( NF->X(), NF->Y(), NF->Z() );
gp_Pnt P2( NL->X(), NL->Y(), NL->Z() );
P0 = aCirc->Location();
- myLayerPositions.clear();
- computeLayerPositions(P0,P1);
+ bool linEdgeComputed;
+ if ( !computeLayerPositions(P0,P1,LinEdge1,&linEdgeComputed))
+ return false;
if ( linEdgeComputed )
{
SMDS_MeshEdge* ME = myHelper->AddEdge( tmpNodes[i-1], tmpNodes[i] );
if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
}
- markLinEdgeAsComputedByMe( LinEdge1, aMesh.GetSubMesh( F ));
+ markEdgeAsComputedByMe( LinEdge1, aMesh.GetSubMesh( F ));
}
}
else // nbe==3 or ( nbe==2 && linEdge is INTERNAL )
// segments of line
double fp, lp;
Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast( getCurve( CircEdge ));
- Handle(Geom_Line) aLine1 = Handle(Geom_Line)::DownCast( getCurve( LinEdge1 ));
- Handle(Geom_Line) aLine2 = Handle(Geom_Line)::DownCast( getCurve( LinEdge2 ));
- if( aLine1.IsNull() || aLine2.IsNull() ) {
- // other curve not line
+ Handle(Geom_Line) aLine1 = Handle(Geom_Line)::DownCast( getCurve( LinEdge1 ));
+ Handle(Geom_Line) aLine2 = Handle(Geom_Line)::DownCast( getCurve( LinEdge2 ));
+ if( aCirc.IsNull() || aLine1.IsNull() || aLine2.IsNull() )
return error(COMPERR_BAD_SHAPE);
- }
-
- bool linEdge1Computed = false;
- if ( SMESH_subMesh* sm1 = aMesh.GetSubMesh(LinEdge1))
- if( !sm1->IsEmpty() )
- if( isEdgeCompitaballyMeshed( LinEdge1, aMesh.GetSubMesh(F) ))
- linEdge1Computed = true;
- else
- return error("Invalid set of hypotheses");
-
- bool linEdge2Computed = false;
- if ( SMESH_subMesh* sm2 = aMesh.GetSubMesh(LinEdge2))
- if( !sm2->IsEmpty() )
- if( isEdgeCompitaballyMeshed( LinEdge2, aMesh.GetSubMesh(F) ))
- linEdge2Computed = true;
- else
- return error("Invalid set of hypotheses");
- bool ok = _gen->Compute( aMesh, CircEdge );
- if( !ok ) return false;
+ if ( !algo1d->ComputeCircularEdge( aMesh, CircEdge ))
+ return error( algo1d->GetComputeError() );
map< double, const SMDS_MeshNode* > theNodes;
- GetSortedNodesOnEdge(aMesh.GetMeshDS(),CircEdge,true,theNodes);
+ if ( !GetSortedNodesOnEdge(aMesh.GetMeshDS(),CircEdge,true,theNodes))
+ return error("Circular edge is incorrectly meshed");
const SMDS_MeshNode* NF = theNodes.begin()->second;
const SMDS_MeshNode* NL = theNodes.rbegin()->second;
gp_Pnt P2( NL->X(), NL->Y(), NL->Z() );
P0 = aCirc->Location();
- myLayerPositions.clear();
- computeLayerPositions(P0,P1);
+ bool linEdge1Computed, linEdge2Computed;
+ if ( !computeLayerPositions(P0,P1,LinEdge1,&linEdge1Computed))
+ return false;
Nodes1.resize( myLayerPositions.size()+1 );
Nodes2.resize( myLayerPositions.size()+1 );
+ // check that both linear edges have same hypotheses
+ if ( !computeLayerPositions(P0,P1,LinEdge2, &linEdge2Computed))
+ return false;
+ if ( Nodes1.size() != myLayerPositions.size()+1 )
+ return error("Different hypotheses apply to radial edges");
+
exp.Init( LinEdge1, TopAbs_VERTEX );
TopoDS_Vertex V1 = TopoDS::Vertex( exp.Current() );
exp.Next();
if (nbe==2 && LinEdge1.Orientation() == TopAbs_INTERNAL )
Nodes2 = Nodes1;
}
- markLinEdgeAsComputedByMe( LinEdge1, aMesh.GetSubMesh( F ));
+ markEdgeAsComputedByMe( LinEdge1, aMesh.GetSubMesh( F ));
// LinEdge2
if ( linEdge2Computed )
if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
}
}
- markLinEdgeAsComputedByMe( LinEdge2, aMesh.GetSubMesh( F ));
+ markEdgeAsComputedByMe( LinEdge2, aMesh.GetSubMesh( F ));
}
+ markEdgeAsComputedByMe( CircEdge, aMesh.GetSubMesh( F ));
// orientation
bool IsForward = ( CircEdge.Orientation()==TopAbs_FORWARD );
return true;
}
-
-//================================================================================
//================================================================================
/*!
- * \brief Class computing layers distribution using data of
- * StdMeshers_LayerDistribution hypothesis
+ * \brief Compute positions of nodes on the radial edge
+ * \retval bool - is a success
*/
//================================================================================
-//================================================================================
-class TNodeDistributor: public StdMeshers_Regular_1D
+bool StdMeshers_RadialQuadrangle_1D2D::computeLayerPositions(const gp_Pnt& p1,
+ const gp_Pnt& p2,
+ const TopoDS_Edge& linEdge,
+ bool* linEdgeComputed)
{
- list <const SMESHDS_Hypothesis *> myUsedHyps;
-public:
- // -----------------------------------------------------------------------------
- static TNodeDistributor* GetDistributor(SMESH_Mesh& aMesh)
- {
- const int myID = -1000;
- map < int, SMESH_1D_Algo * > & algoMap = aMesh.GetGen()->_map1D_Algo;
- map < int, SMESH_1D_Algo * >::iterator id_algo = algoMap.find( myID );
- if ( id_algo == algoMap.end() )
- return new TNodeDistributor( myID, 0, aMesh.GetGen() );
- return static_cast< TNodeDistributor* >( id_algo->second );
- }
- // -----------------------------------------------------------------------------
- bool Compute( vector< double > & positions,
- gp_Pnt pIn,
- gp_Pnt pOut,
- SMESH_Mesh& aMesh,
- const StdMeshers_LayerDistribution* hyp)
- {
- double len = pIn.Distance( pOut );
- if ( len <= DBL_MIN ) return error("Too close points of inner and outer shells");
+ // First, try to compute positions of layers
- if ( !hyp || !hyp->GetLayerDistribution() )
- return error( "Invalid LayerDistribution hypothesis");
- myUsedHyps.clear();
- myUsedHyps.push_back( hyp->GetLayerDistribution() );
+ myLayerPositions.clear();
- TopoDS_Edge edge = BRepBuilderAPI_MakeEdge( pIn, pOut );
- SMESH_Hypothesis::Hypothesis_Status aStatus;
- if ( !StdMeshers_Regular_1D::CheckHypothesis( aMesh, edge, aStatus ))
- return error( "StdMeshers_Regular_1D::CheckHypothesis() failed "
- "with LayerDistribution hypothesis");
+ SMESH_Mesh * mesh = myHelper->GetMesh();
- BRepAdaptor_Curve C3D(edge);
- double f = C3D.FirstParameter(), l = C3D.LastParameter();
- list< double > params;
- if ( !StdMeshers_Regular_1D::computeInternalParameters( aMesh, C3D, len, f, l, params, false ))
- return error("StdMeshers_Regular_1D failed to compute layers distribution");
+ const SMESH_Hypothesis* hyp1D = myDistributionHypo ? myDistributionHypo->GetLayerDistribution() : 0;
+ int nbLayers = myNbLayerHypo ? myNbLayerHypo->GetNumberOfLayers() : 0;
- positions.clear();
- positions.reserve( params.size() );
- for (list<double>::iterator itU = params.begin(); itU != params.end(); itU++)
- positions.push_back( *itU / len );
- return true;
+ if ( !hyp1D && !nbLayers )
+ {
+ // No own algo hypotheses assigned, so first try to find any 1D hypothesis.
+ // We need some edge
+ TopoDS_Shape edge = linEdge;
+ if ( edge.IsNull() && !myHelper->GetSubShape().IsNull())
+ for ( TopExp_Explorer e(myHelper->GetSubShape(), TopAbs_EDGE); e.More(); e.Next())
+ edge = e.Current();
+ if ( !edge.IsNull() )
+ {
+ // find a hyp usable by TNodeDistributor
+ SMESH_HypoFilter hypKind;
+ TNodeDistributor::GetDistributor(*mesh)->InitCompatibleHypoFilter(hypKind,/*ignoreAux=*/1);
+ hyp1D = mesh->GetHypothesis( edge, hypKind, /*fromAncestors=*/true);
+ }
}
-protected:
- // -----------------------------------------------------------------------------
- TNodeDistributor( int hypId, int studyId, SMESH_Gen* gen)
- : StdMeshers_Regular_1D( hypId, studyId, gen)
+ if ( hyp1D ) // try to compute with hyp1D
{
+ if ( !TNodeDistributor::GetDistributor(*mesh)->Compute( myLayerPositions,p1,p2,*mesh,hyp1D ))
+ if ( myDistributionHypo ) { // bad hyp assigned
+ return error( TNodeDistributor::GetDistributor(*mesh)->GetComputeError() );
+ }
+ else {
+ // bad hyp found, its Ok, lets try with default nb of segnents
+ }
}
- // -----------------------------------------------------------------------------
- virtual const list <const SMESHDS_Hypothesis *> &
- GetUsedHypothesis(SMESH_Mesh &, const TopoDS_Shape &, const bool)
+
+ if ( myLayerPositions.empty() ) // try to use nb of layers
{
- return myUsedHyps;
+ if ( !nbLayers )
+ nbLayers = _gen->GetDefaultNbSegments();
+
+ if ( nbLayers )
+ {
+ myLayerPositions.resize( nbLayers - 1 );
+ for ( int z = 1; z < nbLayers; ++z )
+ myLayerPositions[ z - 1 ] = double( z )/ double( nbLayers );
+ }
}
- // -----------------------------------------------------------------------------
-};
-//================================================================================
-/*!
- * \brief Compute positions of nodes between the internal and the external surfaces
- * \retval bool - is a success
- */
-//================================================================================
+ // Second, check presence of a mesh built by other algo on linEdge
+ // and mesh conformity to my hypothesis
-bool StdMeshers_RadialQuadrangle_1D2D::computeLayerPositions(const gp_Pnt& pIn,
- const gp_Pnt& pOut)
-{
- if ( myNbLayerHypo )
+ bool meshComputed = (!linEdge.IsNull() && !mesh->GetSubMesh(linEdge)->IsEmpty() );
+ if ( linEdgeComputed ) *linEdgeComputed = meshComputed;
+
+ if ( meshComputed )
{
- int nbSegments = myNbLayerHypo->GetNumberOfLayers();
- myLayerPositions.resize( nbSegments - 1 );
- for ( int z = 1; z < nbSegments; ++z )
- myLayerPositions[ z - 1 ] = double( z )/ double( nbSegments );
- return true;
- }
- if ( myDistributionHypo ) {
- SMESH_Mesh * mesh = myHelper->GetMesh();
- if ( !TNodeDistributor::GetDistributor(*mesh)->Compute( myLayerPositions, pIn, pOut,
- *mesh, myDistributionHypo ))
+ vector< double > nodeParams;
+ GetNodeParamOnEdge( mesh->GetMeshDS(), linEdge, nodeParams );
+
+ if ( myLayerPositions.empty() )
{
- error( TNodeDistributor::GetDistributor(*mesh)->GetComputeError() );
- return false;
+ myLayerPositions.resize( nodeParams.size() - 2 );
+ }
+ else if ( myDistributionHypo || myNbLayerHypo )
+ {
+ // linEdge is computed by other algo. Check if there is a meshed face
+ // using nodes on linEdge
+ bool nodesAreUsed = false;
+ TopTools_ListIteratorOfListOfShape ancestIt = mesh->GetAncestors( linEdge );
+ for ( ; ancestIt.More() && !nodesAreUsed; ancestIt.Next() )
+ if ( ancestIt.Value().ShapeType() == TopAbs_FACE )
+ nodesAreUsed = (!mesh->GetSubMesh( ancestIt.Value() )->IsEmpty());
+ if ( !nodesAreUsed ) {
+ // rebuild them
+ mesh->GetSubMesh( linEdge )->ComputeStateEngine( SMESH_subMesh::CLEAN );
+ if ( linEdgeComputed ) *linEdgeComputed = false;
+ }
+ else if ( myLayerPositions.size() != nodeParams.size()-2 ) {
+ return error("Radial edge is meshed by other algorithm");
+ }
}
}
- RETURN_BAD_RESULT("Bad hypothesis");
+
+ return !myLayerPositions.empty();
}
if( aShape.ShapeType() != TopAbs_FACE ) {
return false;
}
- SMESH_subMesh * smf = aMesh.GetSubMesh(aShape);
- MapShapeNbElemsItr anIt = aResMap.find(smf);
- if( anIt != aResMap.end() ) {
+ SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
+ if( aResMap.count(sm) )
return false;
- }
- myLayerPositions.clear();
- gp_Pnt P0(0,0,0);
- gp_Pnt P1(100,0,0);
- computeLayerPositions(P0,P1);
-
- TopoDS_Edge E1,E2,E3;
- Handle(Geom_Curve) C1,C2,C3;
- double f1,l1,f2,l2,f3,l3;
- int nbe = 0;
- TopExp_Explorer exp;
- for ( exp.Init( aShape, TopAbs_EDGE ); exp.More(); exp.Next() ) {
- nbe++;
- TopoDS_Edge E = TopoDS::Edge( exp.Current() );
- if(nbe==1) {
- E1 = E;
- C1 = BRep_Tool::Curve(E,f1,l1);
- }
- else if(nbe==2) {
- E2 = E;
- C2 = BRep_Tool::Curve(E,f2,l2);
- }
- else if(nbe==3) {
- E3 = E;
- C3 = BRep_Tool::Curve(E,f3,l3);
- }
- }
+ vector<int>& aResVec =
+ aResMap.insert( make_pair(sm, vector<int>(SMDSEntity_Last,0))).first->second;
+
+ myHelper = new SMESH_MesherHelper( aMesh );
+ myHelper->SetSubShape( aShape );
+ auto_ptr<SMESH_MesherHelper> helperDeleter( myHelper );
+
+ TNodeDistributor* algo1d = TNodeDistributor::GetDistributor(aMesh);
TopoDS_Edge CircEdge, LinEdge1, LinEdge2;
+ int nbe = analyseFace( aShape, CircEdge, LinEdge1, LinEdge2 );
+ if( nbe>3 || nbe < 1 || CircEdge.IsNull() )
+ return false;
+
+ Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast( getCurve( CircEdge ));
+ if( aCirc.IsNull() )
+ return error(COMPERR_BAD_SHAPE);
+
+ gp_Pnt P0 = aCirc->Location();
+ gp_Pnt P1 = aCirc->Value(0.);
+ computeLayerPositions( P0, P1, LinEdge1 );
+
int nb0d=0, nb2d_tria=0, nb2d_quad=0;
- bool isQuadratic = false;
- if(nbe==1) {
+ bool isQuadratic = false, ok = true;
+ if(nbe==1)
+ {
// C1 must be a circle
- Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast(C1);
- if( !aCirc.IsNull() ) {
- bool ok = _gen->Evaluate( aMesh, CircEdge, aResMap );
- if(ok) {
- SMESH_subMesh * sm = aMesh.GetSubMesh(CircEdge);
- MapShapeNbElemsItr anIt = aResMap.find(sm);
- vector<int> aVec = (*anIt).second;
- isQuadratic = aVec[SMDSEntity_Quad_Edge]>aVec[SMDSEntity_Edge];
- if(isQuadratic) {
- // main nodes
- nb0d = (aVec[SMDSEntity_Node]+1) * myLayerPositions.size();
- // radial medium nodes
- nb0d += (aVec[SMDSEntity_Node]+1) * (myLayerPositions.size()+1);
- // other medium nodes
- nb0d += (aVec[SMDSEntity_Node]+1) * myLayerPositions.size();
- }
- else {
- nb0d = (aVec[SMDSEntity_Node]+1) * myLayerPositions.size();
- }
- nb2d_tria = aVec[SMDSEntity_Node] + 1;
- nb2d_quad = nb0d;
+ ok = algo1d->EvaluateCircularEdge( aMesh, CircEdge, aResMap );
+ if(ok) {
+ const vector<int>& aVec = aResMap[aMesh.GetSubMesh(CircEdge)];
+ isQuadratic = aVec[SMDSEntity_Quad_Edge]>aVec[SMDSEntity_Edge];
+ if(isQuadratic) {
+ // main nodes
+ nb0d = (aVec[SMDSEntity_Node]+1) * myLayerPositions.size();
+ // radial medium nodes
+ nb0d += (aVec[SMDSEntity_Node]+1) * (myLayerPositions.size()+1);
+ // other medium nodes
+ nb0d += (aVec[SMDSEntity_Node]+1) * myLayerPositions.size();
}
+ else {
+ nb0d = (aVec[SMDSEntity_Node]+1) * myLayerPositions.size();
+ }
+ nb2d_tria = aVec[SMDSEntity_Node] + 1;
+ nb2d_quad = nb0d;
}
}
- else if(nbe==2) {
+ else if(nbe==2 && LinEdge1.Orientation() != TopAbs_INTERNAL)
+ {
// one curve must be a half of circle and other curve must be
// a segment of line
- Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(C1);
- while( !tc.IsNull() ) {
- C1 = tc->BasisCurve();
- tc = Handle(Geom_TrimmedCurve)::DownCast(C1);
- }
- tc = Handle(Geom_TrimmedCurve)::DownCast(C2);
- while( !tc.IsNull() ) {
- C2 = tc->BasisCurve();
- tc = Handle(Geom_TrimmedCurve)::DownCast(C2);
- }
- Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast(C1);
- Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast(C2);
- CircEdge = E1;
- LinEdge1 = E2;
- double fp = f1;
- double lp = l1;
- if( aCirc.IsNull() ) {
- aCirc = Handle(Geom_Circle)::DownCast(C2);
- CircEdge = E2;
- LinEdge1 = E1;
- fp = f2;
- lp = l2;
- aLine = Handle(Geom_Line)::DownCast(C3);
- }
- bool ok = !aCirc.IsNull() && !aLine.IsNull();
+ double fp, lp;
+ Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast( getCurve( CircEdge, &fp, &lp ));
if( fabs(fabs(lp-fp)-PI) > Precision::Confusion() ) {
// not half of circle
- ok = false;
+ return error(COMPERR_BAD_SHAPE);
+ }
+ Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast( getCurve( LinEdge1 ));
+ if( aLine.IsNull() ) {
+ // other curve not line
+ return error(COMPERR_BAD_SHAPE);
}
- SMESH_subMesh* sm1 = aMesh.GetSubMesh(LinEdge1);
- MapShapeNbElemsItr anIt = aResMap.find(sm1);
- if( anIt!=aResMap.end() ) {
- ok = false;
+ ok = !aResMap.count( aMesh.GetSubMesh(LinEdge1) );
+ if ( !ok ) {
+ const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge1) ];
+ ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() );
}
if(ok) {
- ok = _gen->Evaluate( aMesh, CircEdge, aResMap );
+ ok = algo1d->EvaluateCircularEdge( aMesh, CircEdge, aResMap );
}
if(ok) {
- SMESH_subMesh * sm = aMesh.GetSubMesh(CircEdge);
- MapShapeNbElemsItr anIt = aResMap.find(sm);
- vector<int> aVec = (*anIt).second;
- isQuadratic = aVec[SMDSEntity_Quad_Edge]>aVec[SMDSEntity_Edge];
+ const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(CircEdge) ];
+ isQuadratic = aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge];
if(isQuadratic) {
// main nodes
nb0d = aVec[SMDSEntity_Node] * myLayerPositions.size();
nb2d_tria = aVec[SMDSEntity_Node] + 1;
nb2d_quad = nb2d_tria * myLayerPositions.size();
// add evaluation for edges
- vector<int> aResVec(SMDSEntity_Last);
- for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
+ vector<int> aResVec(SMDSEntity_Last,0);
if(isQuadratic) {
aResVec[SMDSEntity_Node] = 4*myLayerPositions.size() + 3;
aResVec[SMDSEntity_Quad_Edge] = 2*myLayerPositions.size() + 2;
aResVec[SMDSEntity_Node] = 2*myLayerPositions.size() + 1;
aResVec[SMDSEntity_Edge] = 2*myLayerPositions.size() + 2;
}
- sm = aMesh.GetSubMesh(LinEdge1);
- aResMap.insert(make_pair(sm,aResVec));
+ aResMap[ aMesh.GetSubMesh(LinEdge1) ] = aResVec;
}
}
- else { // nbe==3
+ else // nbe==3 or ( nbe==2 && linEdge is INTERNAL )
+ {
+ if (nbe==2 && LinEdge1.Orientation() == TopAbs_INTERNAL )
+ LinEdge2 = LinEdge1;
+
// one curve must be a part of circle and other curves must be
// segments of line
- Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(C1);
- while( !tc.IsNull() ) {
- C1 = tc->BasisCurve();
- tc = Handle(Geom_TrimmedCurve)::DownCast(C1);
- }
- tc = Handle(Geom_TrimmedCurve)::DownCast(C2);
- while( !tc.IsNull() ) {
- C2 = tc->BasisCurve();
- tc = Handle(Geom_TrimmedCurve)::DownCast(C2);
- }
- tc = Handle(Geom_TrimmedCurve)::DownCast(C3);
- while( !tc.IsNull() ) {
- C3 = tc->BasisCurve();
- tc = Handle(Geom_TrimmedCurve)::DownCast(C3);
+ Handle(Geom_Line) aLine1 = Handle(Geom_Line)::DownCast( getCurve( LinEdge1 ));
+ Handle(Geom_Line) aLine2 = Handle(Geom_Line)::DownCast( getCurve( LinEdge2 ));
+ if( aLine1.IsNull() || aLine2.IsNull() ) {
+ // other curve not line
+ return error(COMPERR_BAD_SHAPE);
}
- Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast(C1);
- Handle(Geom_Line) aLine1 = Handle(Geom_Line)::DownCast(C2);
- Handle(Geom_Line) aLine2 = Handle(Geom_Line)::DownCast(C3);
- CircEdge = E1;
- LinEdge1 = E2;
- LinEdge2 = E3;
- double fp = f1;
- double lp = l1;
- if( aCirc.IsNull() ) {
- aCirc = Handle(Geom_Circle)::DownCast(C2);
- CircEdge = E2;
- LinEdge1 = E3;
- LinEdge2 = E1;
- fp = f2;
- lp = l2;
- aLine1 = Handle(Geom_Line)::DownCast(C3);
- aLine2 = Handle(Geom_Line)::DownCast(C1);
- if( aCirc.IsNull() ) {
- aCirc = Handle(Geom_Circle)::DownCast(C3);
- CircEdge = E3;
- LinEdge1 = E1;
- LinEdge2 = E2;
- fp = f3;
- lp = l3;
- aLine1 = Handle(Geom_Line)::DownCast(C1);
- aLine2 = Handle(Geom_Line)::DownCast(C2);
+ int nbLayers = myLayerPositions.size();
+ computeLayerPositions( P0, P1, LinEdge2 );
+ if ( nbLayers != myLayerPositions.size() )
+ return error("Different hypotheses apply to radial edges");
+
+ bool ok = !aResMap.count( aMesh.GetSubMesh(LinEdge1));
+ if ( !ok ) {
+ if ( myDistributionHypo || myNbLayerHypo )
+ ok = true; // override other 1d hyps
+ else {
+ const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge1) ];
+ ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() );
}
}
- bool ok = !aCirc.IsNull() && !aLine1.IsNull() && !aLine1.IsNull();
- SMESH_subMesh* sm = aMesh.GetSubMesh(LinEdge1);
- MapShapeNbElemsItr anIt = aResMap.find(sm);
- if( anIt!=aResMap.end() ) {
- ok = false;
- }
- sm = aMesh.GetSubMesh(LinEdge2);
- anIt = aResMap.find(sm);
- if( anIt!=aResMap.end() ) {
- ok = false;
+ if( ok && aResMap.count( aMesh.GetSubMesh(LinEdge2) )) {
+ if ( myDistributionHypo || myNbLayerHypo )
+ ok = true; // override other 1d hyps
+ else {
+ const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge2) ];
+ ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() );
+ }
}
if(ok) {
- ok = _gen->Evaluate( aMesh, CircEdge, aResMap );
+ ok = algo1d->EvaluateCircularEdge( aMesh, CircEdge, aResMap );
}
if(ok) {
- SMESH_subMesh * sm = aMesh.GetSubMesh(CircEdge);
- MapShapeNbElemsItr anIt = aResMap.find(sm);
- vector<int> aVec = (*anIt).second;
+ const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(CircEdge) ];
isQuadratic = aVec[SMDSEntity_Quad_Edge]>aVec[SMDSEntity_Edge];
if(isQuadratic) {
// main nodes
nb2d_tria = aVec[SMDSEntity_Node] + 1;
nb2d_quad = nb2d_tria * myLayerPositions.size();
// add evaluation for edges
- vector<int> aResVec(SMDSEntity_Last);
- for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
+ vector<int> aResVec(SMDSEntity_Last, 0);
if(isQuadratic) {
aResVec[SMDSEntity_Node] = 2*myLayerPositions.size() + 1;
aResVec[SMDSEntity_Quad_Edge] = myLayerPositions.size() + 1;
aResVec[SMDSEntity_Edge] = myLayerPositions.size() + 1;
}
sm = aMesh.GetSubMesh(LinEdge1);
- aResMap.insert(make_pair(sm,aResVec));
+ aResMap[sm] = aResVec;
sm = aMesh.GetSubMesh(LinEdge2);
- aResMap.insert(make_pair(sm,aResVec));
+ aResMap[sm] = aResVec;
}
}
- vector<int> aResVec(SMDSEntity_Last);
- for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
- SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
-
- //cout<<"nb0d = "<<nb0d<<" nb2d_tria = "<<nb2d_tria<<" nb2d_quad = "<<nb2d_quad<<endl;
if(nb0d>0) {
aResVec[0] = nb0d;
if(isQuadratic) {
aResVec[SMDSEntity_Triangle] = nb2d_tria;
aResVec[SMDSEntity_Quadrangle] = nb2d_quad;
}
- aResMap.insert(make_pair(sm,aResVec));
return true;
}
// invalid case
- aResMap.insert(make_pair(sm,aResVec));
+ sm = aMesh.GetSubMesh(aShape);
SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,
"Submesh can not be evaluated",this));
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_RadialQuadrangle_1D2D.hxx
// Module : SMESH
#include "SMESH_StdMeshers.hxx"
#include "SMESH_2D_Algo.hxx"
-//#include "SMDS_MeshNode.hxx"
-//#include <vector>
-//#include <map>
+#include <TopoDS_Edge.hxx>
+
+#include <vector>
class StdMeshers_NumberOfLayers;
class StdMeshers_LayerDistribution;
protected:
- bool computeLayerPositions(const gp_Pnt& pIn,
- const gp_Pnt& pOut);
+ bool computeLayerPositions(const gp_Pnt& p1,
+ const gp_Pnt& p2,
+ const TopoDS_Edge& linEdge=TopoDS_Edge(),
+ bool* linEdgeComputed = 0);
const StdMeshers_NumberOfLayers* myNbLayerHypo;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Regular_1D.cxx
// Moved here from SMESH_Regular_1D.cxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-
+//
#include "StdMeshers_Regular_1D.hxx"
#include "StdMeshers_Distribution.hxx"
return false;
prevU = U;
}
+ if ( theReverse )
+ theParams.reverse();
return true;
}
}
if(!IsExist) Params.InsertBefore(j,aPnts[i]);
}
- double pf, pl, par2, par1, psize;
- if (theReverse) {
- pf = l;
- pl = f;
+ double par2, par1, lp;
+ par1 = f;
+ lp = l;
+ double sign = 1.0;
+ if(theReverse) {
+ par1 = l;
+ lp = f;
+ sign = -1.0;
}
- else {
- pf = f;
- pl = l;
- }
- psize = pl - pf;
- par1 = pf;
- //cout<<"aPnts.size() = "<<aPnts.size()<<" Params.Length() = "
- // <<Params.Length()<<" nbsegs.size() = "<<nbsegs.size()<<endl;
+ double eltSize, segmentSize = 0.;
+ double currAbscissa = 0;
for(i=0; i<Params.Length(); i++) {
- par2 = pf + Params.Value(i+1)*psize;
int nbseg = ( i > nbsegs.size()-1 ) ? nbsegs[0] : nbsegs[i];
- double dp = (par2-par1)/nbseg;
- int j = 1;
- for(; j<=nbseg; j++) {
- double param = par1 + dp*j;
- theParams.push_back( param );
+ segmentSize = Params.Value(i+1)*theLength - currAbscissa;
+ currAbscissa += segmentSize;
+ GCPnts_AbscissaPoint APnt(theC3d, sign*segmentSize, par1);
+ if( !APnt.IsDone() )
+ return error( "GCPnts_AbscissaPoint failed");
+ par2 = APnt.Parameter();
+ eltSize = segmentSize/nbseg;
+ GCPnts_UniformAbscissa Discret(theC3d, eltSize, par1, par2);
+ if(theReverse)
+ Discret.Initialize(theC3d, eltSize, par2, par1);
+ else
+ Discret.Initialize(theC3d, eltSize, par1, par2);
+ if ( !Discret.IsDone() )
+ return error( "GCPnts_UniformAbscissa failed");
+ int NbPoints = Discret.NbPoints();
+ list<double> tmpParams;
+ for(int i=2; i<NbPoints; i++) {
+ double param = Discret.Parameter(i);
+ tmpParams.push_back( param );
+ }
+ if (theReverse) {
+ compensateError( eltSize, eltSize, par2, par1, segmentSize, theC3d, tmpParams );
+ tmpParams.reverse();
+ }
+ else {
+ compensateError( eltSize, eltSize, par1, par2, segmentSize, theC3d, tmpParams );
+ }
+ list<double>::iterator itP = tmpParams.begin();
+ for(; itP != tmpParams.end(); itP++) {
+ theParams.push_back( *(itP) );
}
+ theParams.push_back( par2 );
+
par1 = par2;
}
// add for last
int nbseg = ( nbsegs.size() > Params.Length() ) ? nbsegs[Params.Length()] : nbsegs[0];
- double dp = (pl-par1)/nbseg;
- int j = 1;
- for(; j<nbseg; j++) {
- double param = par1 + dp*j;
- theParams.push_back( param );
+ segmentSize = theLength - currAbscissa;
+ eltSize = segmentSize/nbseg;
+ GCPnts_UniformAbscissa Discret;
+ if(theReverse)
+ Discret.Initialize(theC3d, eltSize, par1, lp);
+ else
+ Discret.Initialize(theC3d, eltSize, lp, par1);
+ if ( !Discret.IsDone() )
+ return error( "GCPnts_UniformAbscissa failed");
+ int NbPoints = Discret.NbPoints();
+ list<double> tmpParams;
+ for(int i=2; i<NbPoints; i++) {
+ double param = Discret.Parameter(i);
+ tmpParams.push_back( param );
}
+ if (theReverse) {
+ compensateError( eltSize, eltSize, lp, par1, segmentSize, theC3d, tmpParams );
+ tmpParams.reverse();
+ }
+ else {
+ compensateError( eltSize, eltSize, par1, lp, segmentSize, theC3d, tmpParams );
+ }
+ list<double>::iterator itP = tmpParams.begin();
+ for(; itP != tmpParams.end(); itP++) {
+ theParams.push_back( *(itP) );
+ }
+
if (theReverse) {
theParams.reverse(); // NPAL18025
}
ASSERT(!VFirst.IsNull());
ASSERT(!VLast.IsNull());
- std::vector<int> aVec(SMDSEntity_Last);
- for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i] = 0;
+ std::vector<int> aVec(SMDSEntity_Last,0);
if (!Curve.IsNull()) {
list< double > params;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Regular_1D.hxx
// Moved here from SMESH_Regular_1D.hxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-
+//
#ifndef _SMESH_REGULAR_1D_HXX_
#define _SMESH_REGULAR_1D_HXX_
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
+ const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_SegmentAroundVertex_0D.cxx
// Module : SMESH
{
_name = "SegmentAroundVertex_0D";
// it is assigned to vertices but influence a state of EDGE submeshes
- _shapeType = (1 << TopAbs_VERTEX); // 1 bit per shape type
+ _shapeType = (1 << TopAbs_VERTEX); // 1 bit per shape type
_compatibleHypothesis.push_back("SegmentLengthAroundVertex");
}
//=======================================================================
bool StdMeshers_SegmentAroundVertex_0D::Evaluate(SMESH_Mesh&,
- const TopoDS_Shape&,
- MapShapeNbElems&)
+ const TopoDS_Shape&,
+ MapShapeNbElems&)
{
// This algorithm exists in order just to enable assignation of
// StdMeshers_SegmentLengthAroundVertex hypothesis
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_SegmentAroundVertex_0D.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_SegmentLengthAroundVertex.cxx
// Module : SMESH
-
+//
#include "StdMeshers_SegmentLengthAroundVertex.hxx"
#include "SMESH_Mesh.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_SegmentLengthAroundVertex.hxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-
+//
#ifndef _SMESH_SegmentLengthAroundVertex_HXX_
#define _SMESH_SegmentLengthAroundVertex_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers_StartEndLength : implementaion of SMESH idl descriptions
// File : StdMeshers_StartEndLength.cxx
// Module : SMESH
-
+//
#include "StdMeshers_StartEndLength.hxx"
#include "SMESH_Algo.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers : implementaion of SMESH idl descriptions
// File : StdMeshers_StartEndLength.hxx
// Module : SMESH
-
+//
#ifndef _STDMESHERS_STARTENDLENGTH_HXX_
#define _STDMESHERS_STARTENDLENGTH_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers_TrianglePreference
// File : StdMeshers_TrianglePreference.cxx
// Module : SMESH
-
+//
#include "StdMeshers_TrianglePreference.hxx"
#include "utilities.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers : implementaion of SMESH idl descriptions
// File : StdMeshers_TrianglePreference.hxx
// Module : SMESH
-
+//
#ifndef _StdMeshers_TrianglePreference_HXX_
#define _StdMeshers_TrianglePreference_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_UseExisting_1D2D.cxx
// Module : SMESH
//=======================================================================
bool StdMeshers_UseExisting_1D::Evaluate(SMESH_Mesh&,
- const TopoDS_Shape&,
- MapShapeNbElems&)
+ const TopoDS_Shape&,
+ MapShapeNbElems&)
{
// This algorithm exists to allow mesh generation by mesh
// edition functions in TUI mode
//=======================================================================
bool StdMeshers_UseExisting_2D::Evaluate(SMESH_Mesh&,
- const TopoDS_Shape&,
- MapShapeNbElems&)
+ const TopoDS_Shape&,
+ MapShapeNbElems&)
{
// This algorithm exists to allow mesh generation by mesh edition
// functions in TUI mode
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_UseExisting_1D2D.hxx
// Module : SMESH
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH StdMeshersGUI : GUI for StdMeshers plugin
# File : Makefile.in
# Author : Julia DOROVSKIKH
../SMESHGUI/libSMESH.la \
../OBJECT/libSMESHObject.la \
$(GUI_LDFLAGS) -lSalomeApp \
- $(CAS_LDPATH) -lTKernel -lTKBO -lTKAdvTools
+ $(CAS_LDPATH) -lTKernel -lTKBO -lTKAdvTools \
+ $(QWT_LIBS)
# resources files
nodist_salomeres_DATA= \
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_StdMeshersGUI.hxx
// Author : Alexander BORODIN, Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI.cxx
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
// SMESH includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_DistrPreview.cxx
// Author : Open CASCADE S.A.S.
// SMESH includes
{
SMESH::double_array* arr = 0;
if( isTableFunc() )
- arr = h->BuildDistributionTab( myTableFunc, myNbSeg, ( int )myConv );
+ arr = h->BuildDistributionTab( myTableFunc, myNbSeg, ( int )myConv );
else
- arr = h->BuildDistributionExpr( myFunction.toLatin1().data(), myNbSeg, ( int )myConv );
+ arr = h->BuildDistributionExpr( myFunction.toLatin1().data(), myNbSeg, ( int )myConv );
if( arr )
{
- distr = *arr;
- delete arr;
+ distr = *arr;
+ delete arr;
}
}
}
if( !name.IsNull() )
{
if( name->GetName()!="t" )
- res = false;
+ res = false;
}
else
res = isCorrectArg( sub );
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS;
#endif
- // in StdMeshers_NumberOfSegments.cc
- // const double PRECISION = 1e-7;
- //
- if(v < -7) v = -7.0;
- v = pow( 10.0, v );
+ // in StdMeshers_NumberOfSegments.cc
+ // const double PRECISION = 1e-7;
+ //
+ if(v < -7) v = -7.0;
+ v = pow( 10.0, v );
} catch(Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- v = 0.0;
- ok = false;
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ v = 0.0;
+ ok = false;
}
}
break;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_DistrPreview.h
// Author : Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_DistrTable.cxx
// Author : Open CASCADE S.A.S.
// SMESH includes
//
#include "StdMeshersGUI_DistrTable.h"
+#include <SMESHGUI_SpinBox.h>
+
// Qt incldues
#include <QItemDelegate>
#include <QTableWidget>
-#include <QDoubleSpinBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
~SpinBoxDelegate();
QWidget* createEditor( QWidget*,
- const QStyleOptionViewItem&,
- const QModelIndex& ) const;
+ const QStyleOptionViewItem&,
+ const QModelIndex& ) const;
void setEditorData( QWidget*, const QModelIndex&) const;
void setModelData( QWidget*, QAbstractItemModel*,
- const QModelIndex& ) const;
+ const QModelIndex& ) const;
void updateEditorGeometry( QWidget*,
- const QStyleOptionViewItem&,
- const QModelIndex& ) const;
+ const QStyleOptionViewItem&,
+ const QModelIndex& ) const;
private:
StdMeshersGUI_DistrTableFrame::Table* myTable;
struct EditorData
{
int r, c;
- QDoubleSpinBox* sb;
+ SMESHGUI_SpinBox* sb;
EditorData() { reset(); }
void reset() { r = -1; c = -1; sb = 0; }
};
void addRow();
void deleteRow();
- void setEditor( int, int, QDoubleSpinBox* );
+ void setEditor( int, int, SMESHGUI_SpinBox* );
protected:
void closeEditor( QWidget*, QAbstractItemDelegate::EndEditHint );
QWidget*
StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
createEditor( QWidget* parent,
- const QStyleOptionViewItem& /*option*/,
- const QModelIndex& index ) const
+ const QStyleOptionViewItem& /*option*/,
+ const QModelIndex& index ) const
{
- QDoubleSpinBox* sb = new QDoubleSpinBox( parent );
+ SMESHGUI_SpinBox* sb = new SMESHGUI_SpinBox( parent );
+
+ sb->setAcceptNames(false); // No Notebook variables allowed
+ double aMin = index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ?
+ myTable->argMinimum( index.row() ) :
+ myTable->funcMinimum( index.row() );
+ double aMax = index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ?
+ myTable->argMaximum( index.row() ) :
+ myTable->funcMaximum( index.row() );
+ double aStep = index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ?
+ myTable->argStep( index.row() ) :
+ myTable->funcStep( index.row() );
+ sb->RangeStepAndValidator( aMin, aMax, aStep, "parametric_precision" );
sb->setFrame(false);
- sb->setMinimum( index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ?
- myTable->argMinimum( index.row() ) :
- myTable->funcMinimum( index.row() ) );
- sb->setMaximum( index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ?
- myTable->argMaximum( index.row() ) :
- myTable->funcMaximum( index.row() ) );
- sb->setSingleStep( index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ?
- myTable->argStep( index.row() ) :
- myTable->funcStep( index.row() ) );
- myTable->setEditor( index.row(), index.column(), sb );
+
+ myTable->setEditor( index.row(), index.column(), sb );
return sb;
}
setEditorData( QWidget* editor, const QModelIndex& index ) const
{
QString value = index.model()->data(index, Qt::DisplayRole).toString();
- QDoubleSpinBox* sb = static_cast<QDoubleSpinBox*>(editor);
+ SMESHGUI_SpinBox* sb = static_cast<SMESHGUI_SpinBox*>(editor);
bool bOk = false;
double v = value.toDouble( &bOk );
void
StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
setModelData( QWidget* editor, QAbstractItemModel* model,
- const QModelIndex& index ) const
+ const QModelIndex& index ) const
{
- QDoubleSpinBox* sb = static_cast<QDoubleSpinBox*>(editor);
+ SMESHGUI_SpinBox* sb = static_cast<SMESHGUI_SpinBox*>(editor);
model->setData( index, QString::number( sb->value() ), Qt::DisplayRole );
}
void
StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
updateEditorGeometry( QWidget* editor,
- const QStyleOptionViewItem& option,
- const QModelIndex& /*index*/ ) const
+ const QStyleOptionViewItem& option,
+ const QModelIndex& /*index*/ ) const
{
editor->setGeometry( option.rect );
}
void
StdMeshersGUI_DistrTableFrame::Table::
-setEditor( int r, int c, QDoubleSpinBox* sb )
+setEditor( int r, int c, SMESHGUI_SpinBox* sb )
{
myEditorData.r = r;
myEditorData.c = c;
connect( myButtons[ InsertRowBtn ], SIGNAL( clicked() ), this, SLOT( onInsert() ) );
connect( myButtons[ RemoveRowBtn ], SIGNAL( clicked() ), this, SLOT( onRemove() ) );
connect( myTable, SIGNAL( currentCellChanged( int, int, int, int ) ),
- this, SIGNAL( currentChanged( int, int ) ) );
+ this, SIGNAL( currentChanged( int, int ) ) );
connect( myTable, SIGNAL( cellChanged( int, int ) ),
- this, SIGNAL( valueChanged( int, int ) ) );
+ this, SIGNAL( valueChanged( int, int ) ) );
}
StdMeshersGUI_DistrTableFrame::
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_DistrTable.h
// Author : Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_FixedPointsParamWdg.cxx
// Author : Open CASCADE S.A.S.
// SMESH includes
//
#include "StdMeshersGUI_FixedPointsParamWdg.h"
-#include <QtxIntSpinBox.h>
-#include <QtxDoubleSpinBox.h>
+#include <SMESHGUI_SpinBox.h>
+
+#include <SalomeApp_IntSpinBox.h>
// Qt includes
#include <QPushButton>
}
QWidget* StdMeshersGUI_FixedPointsParamWdg::LineDelegate::createEditor( QWidget* parent,
- const QStyleOptionViewItem& option,
- const QModelIndex& index ) const
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index ) const
{
QWidget* w = 0;
if ( (index.column() == 1 ) ) {
- QtxIntSpinBox* sb = new QtxIntSpinBox( parent );
+ SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( parent );
+ sb->setAcceptNames( false ); // No Notebook variables allowed
sb->setFrame( false );
sb->setRange( 1, 999);
w = sb;
}
void StdMeshersGUI_FixedPointsParamWdg::LineDelegate::setModelData( QWidget* editor,
- QAbstractItemModel* model,
- const QModelIndex& index ) const
+ QAbstractItemModel* model,
+ const QModelIndex& index ) const
{
- model->setData( index, qobject_cast<QtxIntSpinBox*>( editor )->value(), Qt::EditRole );
- model->setData( index, qobject_cast<QtxIntSpinBox*>( editor )->value(), Qt::UserRole );
+ model->setData( index, qobject_cast<SalomeApp_IntSpinBox*>( editor )->value(), Qt::EditRole );
+ model->setData( index, qobject_cast<SalomeApp_IntSpinBox*>( editor )->value(), Qt::UserRole );
}
//================================================================================
myListWidget = new QListWidget( this );
myTreeWidget = new QTreeWidget( this );
- mySpinBox = new QtxDoubleSpinBox( this );
+ mySpinBox = new SMESHGUI_SpinBox( this );
myAddButton = new QPushButton( tr( "SMESH_BUT_ADD" ), this );
myRemoveButton = new QPushButton( tr( "SMESH_BUT_REMOVE" ), this );
mySameValues = new QCheckBox( tr("SMESH_SAME_NB_SEGMENTS"), this);
myListWidget->setMinimumWidth( 80 );
myTreeWidget->setMinimumWidth( 200 );
- mySpinBox->setRange( 0, 1 );
- mySpinBox->setSingleStep( 0.1 );
- mySpinBox->setDecimals( 4 );
- mySpinBox->setPrecision( 4 );
+ mySpinBox->setAcceptNames( false ); // No Notebook variables allowed
+ mySpinBox->RangeStepAndValidator( 0., 1., .1, "parametric_precision" );
myListWidget->setMinimumWidth( 70 );
connect( myAddButton, SIGNAL( clicked() ), SLOT( onAdd() ) );
{
addPoint( mySpinBox->value() );
}
-
+
//=================================================================================
// function : onRemove()
// purpose : Called when Remove Button Clicked
double lv = point( i );
if ( EQUAL_DBL(lv, v) ) { toInsert = false; break; }
else if ( GT_DBL(lv, v) ) {
- idx = i; break;
+ idx = i; break;
}
}
if ( toInsert ) {
delete myTreeWidget->topLevelItem( idx );
delete item;
myTreeWidget->topLevelItem( idx )->setText( 0, treeItemText( idx == 0 ? 0 : point( idx-1 ),
- idx > myListWidget->count()-1 ? 1 : point( idx ) ) );
+ idx > myListWidget->count()-1 ? 1 : point( idx ) ) );
}
onCheckBoxChanged();
updateState();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_FixedPointsParamWdg.h
// Author : Open CASCADE S.A.S. (dmv)
//
#include <QStringList>
class SMESHGUI;
-class QtxDoubleSpinBox;
+class SMESHGUI_SpinBox;
class QPushButton;
class QLineEdit;
class QCheckBox;
private:
QListWidget* myListWidget;
QTreeWidget* myTreeWidget;
- QtxDoubleSpinBox* mySpinBox;
+ SMESHGUI_SpinBox* mySpinBox;
QPushButton* myAddButton;
QPushButton* myRemoveButton;
QCheckBox* mySameValues;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_LayerDistributionParamWdg.cxx
// Author : Open CASCADE S.A.S.
// SMESH includes
StdMeshersGUI_LayerDistributionParamWdg
::StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr hyp,
- const QString& theName,
+ const QString& theName,
QDialog* dlg):
QWidget(), myName(theName), myDlg( dlg )
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_LayerDistributionParamWdg.h
// Author : Open CASCADE S.A.S.
//
public:
StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr,
- const QString&,
+ const QString&,
QDialog*);
~StdMeshersGUI_LayerDistributionParamWdg();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_NbSegmentsCreator.cxx
// Author : Open CASCADE S.A.S.
// SMESH includes
// 3) scale
myGroupLayout->addWidget( myLScale = new QLabel( tr( "SMESH_NB_SEGMENTS_SCALE_PARAM" ), GroupC1 ), row, 0 );
myScale = new SMESHGUI_SpinBox( GroupC1 );
- myScale->RangeStepAndValidator( 1E-5, 1E+5, 0.1, 6 );
+ myScale->RangeStepAndValidator( 1E-5, 1E+5, 0.1, "parametric_precision" );
myGroupLayout->addWidget( myScale, row, 1 );
row++;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_NbSegmentsCreator.h
// Author : Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_ObjectReferenceParamWdg.cxx
// Author : Open CASCADE S.A.S.
// SMESH includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_ObjectReferenceParamWdg.h
// Author : Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_StdHypothesisCreator.cxx
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
// SMESH includes
anEntry = h->GetObjectEntry();
aDirectionWidget->SetGeomShapeEntry( anEntry );
aDirectionWidget->SetMainShapeEntry( aMainEntry );
- SMESH::long_array_var aVec = new SMESH::long_array;
- int vertID = h->GetTriaVertex();
- if(vertID>0) {
- aVec->length(1);
- aVec[0] = vertID;
+ 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->SetListOfIDs( aVec );
aDirectionWidget->showPreview( true );
customWidgets()->append ( aDirectionWidget );
}
if( hypType()=="LocalLength" && sb )
{
if (sb->objectName() == tr("SMESH_LOCAL_LENGTH_PARAM"))
- sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 );
+ sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
else if (sb->objectName() == tr("SMESH_LOCAL_LENGTH_PRECISION"))
- sb->RangeStepAndValidator( 0.0, 1.0, 0.05, 7 );
+ sb->RangeStepAndValidator( 0.0, 1.0, 0.05, "len_tol_precision" );
}
else if( hypType()=="Arithmetic1D" && sb )
{
- sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 );
+ sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "parametric_precision" );
}
else if( hypType()=="MaxLength" && sb )
{
- sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 );
+ sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
sb->setEnabled( !widget< QCheckBox >( 1 )->isChecked() );
}
else if( hypType()=="MaxElementArea" && sb )
{
- sb->RangeStepAndValidator( VALUE_SMALL_2, VALUE_MAX_2, 1.0, 6 );
+ sb->RangeStepAndValidator( VALUE_SMALL_2, VALUE_MAX_2, 1.0, "area_precision" );
}
else if( hypType()=="MaxElementVolume" && sb )
{
- sb->RangeStepAndValidator( VALUE_SMALL_3, VALUE_MAX_3, 1.0, 6 );
+ sb->RangeStepAndValidator( VALUE_SMALL_3, VALUE_MAX_3, 1.0, "vol_precision" );
}
else if( hypType()=="StartEndLength" && sb )
{
- sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 );
+ sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
}
else if( hypType()=="Deflection1D" && sb )
{
- sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 );
+ sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "parametric_precision" );
}
else if ( sb ) // default validator for possible ancestors
{
- sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 );
+ sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_StdHypothesisCreator.h
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_SubShapeSelectorWdg.cxx
// Author : Open CASCADE S.A.S. (dmv)
// SMESH includes
//
-
#include "StdMeshersGUI_SubShapeSelectorWdg.h"
// SMESH Includes
::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent ):
QWidget( parent ),
myPreviewActor( 0 ),
- myMaxSize( 0 )
+ myMaxSize( -1 )
{
QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) );
myListOfIDs.clear();
mySelectedIDs.clear();
+ myAddButton->setEnabled( false );
+ myRemoveButton->setEnabled( false );
+
mySMESHGUI = SMESHGUI::GetSMESHGUI();
mySelectionMgr = SMESH::GetSelectionMgr( mySMESHGUI );
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
mySelectionMgr->selectedObjects( aList );
int nbSel = aList.Extent();
- if (nbSel < 1)
- return;
-
- SALOME_ListIteratorOfListIO anIt (aList);
+ if (nbSel > 0) {
+ SALOME_ListIteratorOfListIO anIt (aList);
- for ( ; anIt.More(); anIt.Next()) { // Loop on selected objects
- Handle(SALOME_InteractiveObject) IO = anIt.Value();
-
- GEOM::GEOM_Object_var aGeomObj = GetGeomObjectByEntry( IO->getEntry() );
- if ( !CORBA::is_nil( aGeomObj ) ) { // Selected Object From Study
- GEOM::GEOM_Object_ptr aGeomFatherObj = aGeomObj->GetMainShape();
- QString aFatherEntry = "";
- QString aMainFatherEntry = "";
- TopoDS_Shape shape;
- if ( !CORBA::is_nil( aGeomFatherObj ) ) {
- // Get Main Shape
- GEOM::GEOM_Object_var aGeomMain = GetGeomObjectByEntry( myEntry );
- if ( !CORBA::is_nil( aGeomMain ) && aGeomMain->GetType() == 37 ) { // Main Shape is a Group
- GEOM::GEOM_Object_ptr aMainFatherObj = aGeomMain->GetMainShape();
- if ( !CORBA::is_nil( aMainFatherObj ) )
- aMainFatherEntry = aMainFatherObj->GetStudyEntry();
- }
- aFatherEntry = aGeomFatherObj->GetStudyEntry();
- }
+ for ( ; anIt.More(); anIt.Next()) { // Loop on selected objects
+ Handle(SALOME_InteractiveObject) IO = anIt.Value();
- if ( aFatherEntry != "" && ( aFatherEntry == myEntry || aFatherEntry == aMainFatherEntry ) ) {
- if ( aGeomObj->GetType() == 37 /*GEOM_GROUP*/ ) { // Selected Group that belongs the main object
- GEOMBase::GetShape(aGeomObj, shape);
- if ( !shape.IsNull() ) {
- TopExp_Explorer exp( shape, mySubShType );
- for ( ; exp.More(); exp.Next() ) {
- int index = myPreviewActor->GetIndexByShape( exp.Current() );
- if ( index ) {
- mySelectedIDs.append( index );
- myPreviewActor->HighlightID( index );
- }
- }
- }
- } else if ( aGeomObj->GetType() == 28 /*GEOM_SUBSHAPE*/ ) {
- GEOMBase::GetShape(aGeomObj, shape);
- if ( !shape.IsNull() && shape.ShapeType() == mySubShType ) {
- int index = myPreviewActor->GetIndexByShape( shape );
- if ( index ) {
- mySelectedIDs.append( index );
- myPreviewActor->HighlightID( index );
- }
- }
- }
+ GEOM::GEOM_Object_var aGeomObj = GetGeomObjectByEntry( IO->getEntry() );
+ if ( !CORBA::is_nil( aGeomObj ) ) { // Selected Object From Study
+ GEOM::GEOM_Object_ptr aGeomFatherObj = aGeomObj->GetMainShape();
+ QString aFatherEntry = "";
+ QString aMainFatherEntry = "";
+ TopoDS_Shape shape;
+ if ( !CORBA::is_nil( aGeomFatherObj ) ) {
+ // Get Main Shape
+ GEOM::GEOM_Object_var aGeomMain = GetGeomObjectByEntry( myEntry );
+ if ( !CORBA::is_nil( aGeomMain ) && aGeomMain->GetType() == 37 ) { // Main Shape is a Group
+ GEOM::GEOM_Object_ptr aMainFatherObj = aGeomMain->GetMainShape();
+ if ( !CORBA::is_nil( aMainFatherObj ) )
+ aMainFatherEntry = aMainFatherObj->GetStudyEntry();
+ }
+ aFatherEntry = aGeomFatherObj->GetStudyEntry();
+ }
+
+ if ( aFatherEntry != "" && ( aFatherEntry == myEntry || aFatherEntry == aMainFatherEntry ) ) {
+ if ( aGeomObj->GetType() == 37 /*GEOM_GROUP*/ ) { // Selected Group that belongs the main object
+ GEOMBase::GetShape(aGeomObj, shape);
+ if ( !shape.IsNull() ) {
+ TopExp_Explorer exp( shape, mySubShType );
+ for ( ; exp.More(); exp.Next() ) {
+ int index = myPreviewActor->GetIndexByShape( exp.Current() );
+ if ( index ) {
+ mySelectedIDs.append( index );
+ myPreviewActor->HighlightID( index );
+ }
+ }
+ }
+ } else if ( aGeomObj->GetType() == 28 /*GEOM_SUBSHAPE*/ ) {
+ GEOMBase::GetShape(aGeomObj, shape);
+ if ( !shape.IsNull() && shape.ShapeType() == mySubShType ) {
+ int index = myPreviewActor->GetIndexByShape( shape );
+ if ( index ) {
+ mySelectedIDs.append( index );
+ myPreviewActor->HighlightID( index );
+ }
+ }
+ }
+ }
+ } else { // Selected Actor from Actor Collection
+ QString anEntry = IO->getEntry();
+ QString str = "_";
+ int index = anEntry.lastIndexOf( str );
+ anEntry.remove(0, index+1);
+ int ind = anEntry.toInt();
+ if ( ind )
+ mySelectedIDs.append( ind );
}
- } else { // Selected Actor from Actor Collection
- QString anEntry = IO->getEntry();
- QString str = "_";
- int index = anEntry.lastIndexOf( str );
- anEntry.remove(0, index+1);
- int ind = anEntry.toInt();
- if ( ind )
- mySelectedIDs.append( ind );
+ }
+ }
+ // update add button
+ myAddButton->setEnabled( myListWidget->count() < myMaxSize && mySelectedIDs.size() > 0 && ( mySelectedIDs.size() <= myMaxSize || myMaxSize == -1 ) );
+
+ //Connect Selected Ids in viewer and dialog's Ids list
+ myListWidget->clearSelection();
+ if ( mySelectedIDs.size() > 0 ) {
+ for (int i = 0; i < mySelectedIDs.size(); i++) {
+ QString anID = QString(" %1").arg( mySelectedIDs.at(i) );
+ QList<QListWidgetItem*> anItems = myListWidget->findItems ( anID, Qt::MatchExactly );
+ QListWidgetItem* item;
+ foreach(item, anItems)
+ item->setSelected(true);
}
}
}
return;
myListWidget->blockSignals( true );
- for (int i = 0; i < mySelectedIDs.size() && (myMaxSize < 1 || myListOfIDs.size() < myMaxSize); i++) {
+ for (int i = 0; i < mySelectedIDs.size() && (myMaxSize == -1 || myListOfIDs.size() < myMaxSize); i++) {
if ( myListOfIDs.indexOf( mySelectedIDs.at(i) ) == -1 ) {
QString anID = QString(" %1").arg( mySelectedIDs.at(i) );
}
onListSelectionChanged();
myListWidget->blockSignals( false );
- myAddButton->setEnabled( myListOfIDs.size() < myMaxSize );
+ myAddButton->setEnabled( myMaxSize == -1 || myListOfIDs.size() < myMaxSize );
}
-
+
//=================================================================================
// function : onRemove()
// purpose : Called when Remove Button Clicked
QListWidgetItem* anItem;
foreach(anItem, selItems)
myPreviewActor->HighlightID( anItem->text().toInt() );
+
+ // update remove button
+ myRemoveButton->setEnabled( selItems.size() > 0 );
}
//=================================================================================
state = true;
myListWidget->setEnabled( state );
- myAddButton->setEnabled( state );
- myRemoveButton->setEnabled( state );
+ myAddButton->setEnabled( mySelectedIDs.size() > 0 );
if (state) {
myPreviewActor = new SMESH_PreviewActorsCollection();
anArray->length( size );
if ( size ) {
for (int i = 0; i < size; i++) {
- anArray[i] = myListOfIDs.at(i);
+ anArray[i] = myListOfIDs.at(i);
}
}
return anArray;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshersGUI_SubShapeSelectorWdg.h
// Author : Open CASCADE S.A.S. (dmv)
//
<!DOCTYPE TS>
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
<!DOCTYPE TS>
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SMESH StdMeshers_I : idl implementation based on 'StdMeshersPlugin' unit's classes
# File : Makefile.in
# Author : Julia DOROVSKIKH
# Modified by : Alexander BORODIN (OCN) - autotools usage
# Module : SMESH
-
+#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
# header files
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SMESH_StdMeshers_I.hxx
// Author : Alexander BORODIN
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Arithmetic1D_i.cxx
// Author : Damien COQUERET, OCC
//=============================================================================
StdMeshers_Arithmetic1D_i::StdMeshers_Arithmetic1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_Arithmetic1D_i::StdMeshers_Arithmetic1D_i" );
myBaseImpl = new ::StdMeshers_Arithmetic1D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
//=============================================================================
void StdMeshers_Arithmetic1D_i::SetLength(CORBA::Double theLength,
- CORBA::Boolean theIsStart )
+ CORBA::Boolean theIsStart )
throw ( SALOME::SALOME_Exception )
{
MESSAGE( "StdMeshers_StartEndLength_i::SetLength" );
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Arithmetic1D_i.hxx
// Author : Damien COQUERET, OCC
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_AutomaticLength_i.cxx
// Author : Edward AGAPOV
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
SMESH::TPythonDump() << _this() << ".SetFineness( " << theFineness << " )";
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_AutomaticLength_i.hxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_CompositeSegment_1D_i.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_CompositeSegment_1D_i.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Deflection1D_i.cxx
// Moved here from SMESH_LocalLength_i.cxx
//=============================================================================
StdMeshers_Deflection1D_i::StdMeshers_Deflection1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_Deflection1D_i::StdMeshers_Deflection1D_i" );
myBaseImpl = new ::StdMeshers_Deflection1D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Deflection1D_i.hxx
// Moved here from SMESH_LocalLength_i.hxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// 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_FixedPoints1D_i.cxx
// Author : Damien COQUERET, OCC
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// 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_FixedPoints1D_i.hxx
// Author : Damien COQUERET, OCC
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Hexa_3D_i.cxx
// Moved here from SMESH_Hexa_3D_i.cxx
//=============================================================================
StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
{
MESSAGE( "StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i" );
myBaseImpl = new ::StdMeshers_Hexa_3D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Hexa_3D_i.hxx
// Moved here from SMESH_Hexa_3D_i.hxx
// Constructor
StdMeshers_Hexa_3D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_Hexa_3D_i();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_LayerDistribution2D_i.cxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// 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_LayerDistribution2D_i.hxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_LayerDistribution_i.cxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_LayerDistribution_i.hxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_LengthFromEdges_i.cxx
// Moved here from SMESH_LengthFromEdges_i.cxx
//=============================================================================
StdMeshers_LengthFromEdges_i::StdMeshers_LengthFromEdges_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_LengthFromEdges_i::StdMeshers_LengthFromEdges_i" );
myBaseImpl = new ::StdMeshers_LengthFromEdges( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_LengthFromEdges_i.hxx
// Moved here from SMESH_LengthFromEdges_i.hxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_LocalLength_i.cxx
// Moved here from SMESH_LocalLength_i.cxx
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_LocalLength_i.hxx
// Moved here from SMESH_LocalLength_i.hxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_MEFISTO_2D_i.cxx
// Moved here from SMESH_MEFISTO_2D_i.cxx
//=============================================================================
StdMeshers_MEFISTO_2D_i::StdMeshers_MEFISTO_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
{
MESSAGE( "StdMeshers_MEFISTO_2D_i::StdMeshers_MEFISTO_2D_i" );
myBaseImpl = new ::StdMeshers_MEFISTO_2D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_MEFISTO_2D_i.hxx
// Moved here from SMESH_MEFISTO_2D_i.hxx
// Constructor
StdMeshers_MEFISTO_2D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_MEFISTO_2D_i();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_MaxElementArea_i.cxx
// Moved here from SMESH_MaxElementArea_i.cxx
//=============================================================================
StdMeshers_MaxElementArea_i::StdMeshers_MaxElementArea_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_MaxElementArea_i::StdMeshers_MaxElementArea_i" );
myBaseImpl = new ::StdMeshers_MaxElementArea( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
}
catch (SALOME_Exception& S_ex) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_MaxElementArea_i.hxx
// Moved here from SMESH_MaxElementArea_i.hxx
// Constructor
StdMeshers_MaxElementArea_i( PortableServer::POA_ptr thePOA,
int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_MaxElementArea_i();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_MaxElementVolume_i.cxx
// Moved here from SMESH_MaxElementVolume_i.cxx
//=============================================================================
StdMeshers_MaxElementVolume_i::StdMeshers_MaxElementVolume_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_MaxElementVolume_i::StdMeshers_MaxElementVolume_i" );
myBaseImpl = new ::StdMeshers_MaxElementVolume( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
}
catch (SALOME_Exception& S_ex) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_MaxElementVolume_i.hxx
// Moved here from SMESH_MaxElementVolume_i.hxx
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// 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_MaxLength_i.cxx
// Module : SMESH
-
+//
#include "StdMeshers_MaxLength_i.hxx"
#include "SMESH_Gen_i.hxx"
#include "SMESH_Gen.hxx"
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// this is an internal kitchen call - no Python dump
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// this is an internal kitchen call - no Python dump
// Update Python script
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// 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_MaxLength_i.hxx
// Module : SMESH
-
+//
#ifndef _SMESH_MaxLength_I_HXX_
#define _SMESH_MaxLength_I_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers_I : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_NotConformAllowed_i.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers_I : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_NotConformAllowed_i.hxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_NumberOfLayers2D_i.cxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// 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_NumberOfLayers2D_i.hxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_NumberOfLayers_i.cxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_NumberOfLayers_i.hxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_NumberOfSegments_i.cxx
// Moved here from SMESH_NumberOfSegments_i.cxx
//=============================================================================
StdMeshers_NumberOfSegments_i::StdMeshers_NumberOfSegments_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_NumberOfSegments_i::StdMeshers_NumberOfSegments_i" );
myBaseImpl = new ::StdMeshers_NumberOfSegments( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
*/
//=============================================================================
SMESH::double_array* StdMeshers_NumberOfSegments_i::BuildDistributionExpr( const char* func,
- CORBA::Long nbSeg,
- CORBA::Long conv )
+ CORBA::Long nbSeg,
+ CORBA::Long conv )
throw ( SALOME::SALOME_Exception )
{
ASSERT( myBaseImpl );
}
SMESH::double_array* StdMeshers_NumberOfSegments_i::BuildDistributionTab( const SMESH::double_array& func,
- CORBA::Long nbSeg,
- CORBA::Long conv )
+ CORBA::Long nbSeg,
+ CORBA::Long conv )
throw ( SALOME::SALOME_Exception )
{
ASSERT( myBaseImpl );
}
catch (SALOME_Exception& S_ex) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
return scale;
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
SMESH::double_array_var aRes = new SMESH::double_array();
aRes->length(tbl->size());
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
return CORBA::string_dup(expr);
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
return conv;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_NumberOfSegments_i.hxx
// Moved here from SMESH_NumberOfSegments_i.hxx
// Constructor
StdMeshers_NumberOfSegments_i( PortableServer::POA_ptr thePOA,
int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_NumberOfSegments_i();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_ObjRefUlils.cxx
// Created : Wed Oct 18 15:38:22 2006
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_ObjRefUlils.hxx
// Created : Wed Oct 18 15:15:27 2006
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Prism_3D_i.cxx
// Moved here from SMESH_Prism_3D_i.cxx
//=============================================================================
StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
//=============================================================================
StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
{
MESSAGE( "StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i" );
myBaseImpl = new ::StdMeshers_RadialPrism_3D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//-----------------------------------------------------------------------------
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Prism_3D_i.hxx
// Moved here from SMESH_Prism_3D_i.hxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_ProjectionSource1D_i.cxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_ProjectionSource1D_i.hxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_ProjectionSource2D_i.cxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_ProjectionSource2D_i.hxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_ProjectionSource3D_i.cxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_ProjectionSource3D_i.hxx
// Author : Edward AGAPOV
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Projection_3D_i.cxx
// Moved here from SMESH_Projection_3D_i.cxx
{
MESSAGE( "StdMeshers_Projection_3D_i::StdMeshers_Projection_3D_i" );
myBaseImpl = new ::StdMeshers_Projection_3D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//-----------------------------------------------------------------------------
{
MESSAGE( "StdMeshers_Projection_2D_i::StdMeshers_Projection_2D_i" );
myBaseImpl = new ::StdMeshers_Projection_2D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//-----------------------------------------------------------------------------
{
MESSAGE( "StdMeshers_Projection_1D_i::StdMeshers_Projection_1D_i" );
myBaseImpl = new ::StdMeshers_Projection_1D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//-----------------------------------------------------------------------------
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Hexa_3D_i.hxx
// Moved here from SMESH_Hexa_3D_i.hxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Propagation_i.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Propagation_i.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// 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_QuadrangleParams_i.cxx
// Author : Sergey KUUL, OCC
StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i
(PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i" );
myBaseImpl = new ::StdMeshers_QuadrangleParams(theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl);
+ theStudyId,
+ theGenImpl);
}
//=============================================================================
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
- /* SMESH::TPythonDump() << _this() << ".SetEdgesToReverse( "
- << theList << " )";*/
+ SMESH::TPythonDump() << _this() << ".SetTriaVertex( "
+ << vertID << " )";
}
//=============================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// 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_QuadrangleParams_i.hxx
// Author : Sergey KUUL, OCC
public:
// Constructor
StdMeshers_QuadrangleParams_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_QuadrangleParams_i();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_QuadranglePreference_i.cxx
// Moved here from SMESH_LocalLength_i.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_QuadranglePreference_i.hxx
// Moved here from SMESH_LocalLength_i.hxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Quadrangle_2D_i.cxx
// Moved here from SMESH_Quadrangle_2D_i.cxx
//=============================================================================
StdMeshers_Quadrangle_2D_i::StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
{
MESSAGE( "StdMeshers_Quadrangle_2D_i::StdMeshers_Quadrangle_2D_i" );
myBaseImpl = new ::StdMeshers_Quadrangle_2D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Quadrangle_2D_i.hxx
// Moved here from SMESH_Quadrangle_2D_i.hxx
// Constructor
StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_Quadrangle_2D_i();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_QuadraticMesh_i.cxx
// Moved here from SMESH_LocalLength_i.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_QuadraticMesh_i.hxx
// Moved here from SMESH_LocalLength_i.hxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// 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_RadialQuadrangle_1D2D_i.cxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// 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_RadialQuadrangle_1D2D_i.hxx
// Author : Paul RASCLE, EDF
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Regular_1D_i.cxx
// Moved here from SMESH_Regular_1D_i.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Regular_1D_i.hxx
// Moved here from SMESH_Regular_1D_i.hxx
// Constructor
StdMeshers_Regular_1D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_Regular_1D_i();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_Projection_3D_i.cxx
// Moved here from SMESH_Projection_3D_i.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_SegmentAroundVertex_0D.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_SegmentLengthAroundVertex_i.cxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_SegmentLengthAroundVertex_i.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_StartEndLength_i.cxx
// Moved here from SMESH_LocalLength_i.cxx
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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_StartEndLength_i.hxx
// Moved here from SMESH_LocalLength_i.hxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshers_TrianglePreference_i.cxx
// Author :
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : StdMeshers_TrianglePreference_i.hxx
// Author :
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// 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_Projection_3D_i.cxx
// Moved here from SMESH_Projection_3D_i.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// 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_UseExisting_1D2D.hxx
// Module : SMESH
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH StdMeshers : implementaion of SMESH idl descriptions
// File : StdMeshers_i.cxx
// Author : Julia DOROVSKIKH
// Module : SMESH
-
+//
#include "SMESH_StdMeshers_I.hxx"
#include "SMESH_Gen_i.hxx"