Merging from V3_2_6pre4

This commit is contained in:
abd 2007-04-18 15:44:59 +00:00
parent 82decf21b0
commit 358f8ddd54
218 changed files with 20286 additions and 10824 deletions

View File

@ -0,0 +1,117 @@
dnl Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
dnl See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
dnl
dnl
dnl
AC_DEFUN([CHECK_PLATFORM],[
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
AC_CHECKING(for Platform)
AC_SUBST(PLATFORM_INCLUDES)
PLATFORM_INCLUDES="PCLINUX"
SUFFIXES=""
f77int="F77INT32"
case $host_os in
irix5.* | irix6.* | osf4.* | osf5.* | linux* )
linux64="true"
expr "$host_os" : 'linux' >/dev/null && test ! x"$host_cpu" = x"x86_64" && linux64="false"
if test ! x"$linux64" = "xfalse" ; then
echo "$as_me:$LINENO: checking for 64bits integers size in F77/F90" >&5
echo $ECHO_N "checking for 64bits integers size in F77/F90... $ECHO_C" >&6
# Check whether --enable-int64 or --disable-int64 was given.
if test "${enable_int64+set}" = set; then
enableval="$enable_int64"
fi;
case "X-$enable_int64" in
X-no)
echo "$as_me:$LINENO: result: \"disabled\"" >&5
echo "${ECHO_T}\"disabled\"" >&6
SUFFIXES="_32"
;;
*)
echo "$as_me:$LINENO: result: \"enabled\"" >&5
echo "${ECHO_T}\"enabled\"" >&6
SUFFIXES=""
f77int="F77INT64"
;;
esac
fi
;;
*)
;;
esac
case $host_os in
linux*)
test x"$linux64" = x"true" && \
MACHINE="PCLINUX64${SUFFIXES}" || \
MACHINE=PCLINUX
;;
hpux*)
MACHINE=HP9000
;;
aix4.*)
MACHINE=RS6000
host_os_novers=aix4.x
;;
irix5.*)
MACHINE="IRIX64${SUFFIXES}"
host_os_novers=irix5.x
;;
irix6.*)
MACHINE="IRIX64${SUFFIXES}"
host_os_novers=irix6.x
;;
osf4.*)
MACHINE="OSF1${SUFFIXES}"
host_os_novers=osf4.x
;;
osf5.*)
MACHINE="OSF1${SUFFIXES}"
host_os_novers=osf5.x
;;
solaris2.*)
MACHINE=SUN4SOL2
host_os_novers=solaris2.x
;;
uxpv*)
MACHINE=VPP5000
;;
*)
MACHINE=
host_os_novers=$host_os
;;
esac
case $host_cpu in
ia64*)
MACHINE="PCLINUX64"
;;
esac
PLATFORM_INCLUDES=" -D$MACHINE "
])dnl

View File

@ -1,427 +0,0 @@
#
# PLEASE DO NOT MODIFY configure.in FILE
#
# ALL CHANGES WILL BE DISCARDED BY THE NEXT
# build_configure COMMAND
#
# CHANGES MUST BE MADE IN configure.in.base FILE
#
#
# Author : Marc Tajchman (CEA)
# Date : 28/06/2001
# Modified by : Patrick GOLDBRONN (CEA)
# Modified by : Marc Tajchman (CEA)
#
# Created from configure.in.base
#
AC_INIT(src)
AC_CONFIG_AUX_DIR(${KERNEL_ROOT_DIR}/salome_adm/unix/config_files)
AC_CANONICAL_HOST
PACKAGE=salome
AC_SUBST(PACKAGE)
VERSION=4.0.0
XVERSION=0x040000
AC_SUBST(VERSION)
AC_SUBST(XVERSION)
# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
MODULE_NAME=smesh
AC_SUBST(MODULE_NAME)
dnl
dnl Initialize source and build root directories
dnl
ROOT_BUILDDIR=`pwd`
ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
cd $ROOT_SRCDIR
ROOT_SRCDIR=`pwd`
cd $ROOT_BUILDDIR
AC_SUBST(ROOT_SRCDIR)
AC_SUBST(ROOT_BUILDDIR)
echo
echo Source root directory : $ROOT_SRCDIR
echo Build root directory : $ROOT_BUILDDIR
echo
echo
if test -z "$AR"; then
AC_CHECK_PROGS(AR,ar xar,:,$PATH)
fi
AC_SUBST(AR)
dnl Export the AR macro so that it will be placed in the libtool file
dnl correctly.
export AR
echo
echo ---------------------------------------------
echo testing make
echo ---------------------------------------------
echo
AC_PROG_MAKE_SET
AC_PROG_INSTALL
dnl
dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
AC_ENABLE_DEBUG(yes)
AC_DISABLE_PRODUCTION
echo ---------------------------------------------
echo testing libtool
echo ---------------------------------------------
dnl first, we set static to no!
dnl if we want it, use --enable-static
AC_ENABLE_STATIC(no)
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
dnl Fix up the INSTALL macro if it s a relative path. We want the
dnl full-path to the binary instead.
case "$INSTALL" in
*install-sh*)
INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh
;;
esac
echo
echo ---------------------------------------------
echo testing C/C++
echo ---------------------------------------------
echo
cc_ok=no
dnl inutil car libtool
dnl AC_PROG_CC
AC_PROG_CXX
AC_DEPEND_FLAG
# AC_CC_WARNINGS([ansi])
cc_ok=yes
dnl Library libdl :
AC_CHECK_LIB(dl,dlopen)
dnl add library libm :
AC_CHECK_LIB(m,ceil)
dnl
dnl Well we use sstream which is not in gcc pre-2.95.3
dnl We must test if it exists. If not, add it in include !
dnl
AC_CXX_HAVE_SSTREAM
dnl
dnl ---------------------------------------------
dnl testing MPICH
dnl ---------------------------------------------
dnl
CHECK_MPICH
echo
echo ---------------------------------------------
echo testing LEX \& YACC
echo ---------------------------------------------
echo
lex_yacc_ok=no
AC_PROG_YACC
AC_PROG_LEX
lex_yacc_ok=yes
echo
echo ---------------------------------------------
echo testing python
echo ---------------------------------------------
echo
CHECK_PYTHON
echo
echo ---------------------------------------------
echo Testing qwt
echo ---------------------------------------------
echo
CHECK_QWT
dnl echo
dnl echo ---------------------------------------------
dnl echo testing java
dnl echo ---------------------------------------------
dnl echo
dnl CHECK_JAVA
echo
echo ---------------------------------------------
echo testing swig
echo ---------------------------------------------
echo
CHECK_SWIG
echo
echo ---------------------------------------------
echo testing threads
echo ---------------------------------------------
echo
ENABLE_PTHREADS
echo
echo ---------------------------------------------
echo testing omniORB
echo ---------------------------------------------
echo
CHECK_OMNIORB
dnl echo
dnl echo ---------------------------------------------
dnl echo testing mico
dnl echo ---------------------------------------------
dnl echo
dnl CHECK_MICO
echo
echo ---------------------------------------------
echo default ORB : omniORB
echo ---------------------------------------------
echo
DEFAULT_ORB=omniORB
CHECK_CORBA
AC_SUBST_FILE(CORBA)
corba=make_$ORB
CORBA=adm_local/unix/$corba
echo
echo ---------------------------------------------
echo testing openGL
echo ---------------------------------------------
echo
CHECK_OPENGL
echo
echo ---------------------------------------------
echo testing QT
echo ---------------------------------------------
echo
CHECK_QT
echo
echo ---------------------------------------------
echo testing MSG2QM
echo ---------------------------------------------
echo
CHECK_MSG2QM
echo
echo ---------------------------------------------
echo testing VTK
echo ---------------------------------------------
echo
CHECK_VTK
echo
echo ---------------------------------------------
echo testing HDF5
echo ---------------------------------------------
echo
CHECK_HDF5
echo
echo ---------------------------------------------
echo BOOST Library
echo ---------------------------------------------
echo
CHECK_BOOST
echo
echo ---------------------------------------------
echo Testing OpenCascade
echo ---------------------------------------------
echo
CHECK_CAS
echo
echo ---------------------------------------------
echo Testing html generators
echo ---------------------------------------------
echo
CHECK_HTML_GENERATORS
echo
echo ---------------------------------------------
echo Testing GUI
echo ---------------------------------------------
echo
CHECK_SALOME_GUI
echo
echo ---------------------------------------------
echo Testing full GUI
echo ---------------------------------------------
echo
CHECK_CORBA_IN_GUI
if test "x${CORBA_IN_GUI}" != "xyes"; then
echo "failed : For configure SMESH module necessary full GUI !"
exit
fi
echo
echo ---------------------------------------------
echo Testing Kernel
echo ---------------------------------------------
echo
CHECK_KERNEL
echo
echo ---------------------------------------------
echo Testing Geom
echo ---------------------------------------------
echo
CHECK_GEOM
echo
echo ---------------------------------------------
echo Testing Med
echo ---------------------------------------------
echo
CHECK_MED
echo
echo ---------------------------------------------
echo Summary
echo ---------------------------------------------
echo
echo Configure
variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok qwt_ok Kernel_ok Geom_ok Med_ok"
for var in $variables
do
printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
eval echo \$$var
done
echo
echo "Default ORB : $DEFAULT_ORB"
echo
dnl generals files which could be included in every makefile
AC_SUBST_FILE(COMMENCE) COMMENCE=adm_local/unix/make_commence
AC_SUBST_FILE(CONCLUDE) CONCLUDE=adm_local/unix/make_conclude
AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
dnl les dependences
AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
dnl We don t need to say when we re entering directories if we re using
dnl GNU make becuase make does it for us.
if test "X$GMAKE" = "Xyes"; then
AC_SUBST(SETX) SETX=":"
else
AC_SUBST(SETX) SETX="set -x"
fi
# make other build directories
for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources/${MODULE_NAME} idl
do
# if test ! -d $rep ; then
# eval mkdir $rep
# fi
$INSTALL -d $rep
done
echo
echo ---------------------------------------------
echo copying resource files, shell scripts, and
echo xml files
echo ---------------------------------------------
echo
dnl copy resources directories
#for i in `find $ROOT_SRCDIR -name 'resources' -print`
#do
# local_res=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
# local_res_dir=`echo $local_res | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
# mkdir -p $local_res_dir
# cd $local_res_dir
# ln -fs $i
# echo $local_res
# cd $ROOT_BUILDDIR
#done
dnl copy shells and utilities contained in the bin directory
dnl excluding .in files (treated in AC-OUTPUT below) and CVS
dnl directory
mkdir -p bin/salome
cd bin/salome
for i in $ROOT_SRCDIR/bin/*
do
local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
case "$local_bin" in
*.in | *~) ;;
./bin/CVS | ./bin/salome) ;;
*) /usr/bin/install $i .; echo $local_bin ;;
esac
done
cd $ROOT_BUILDDIR
AC_SUBST_FILE(ENVSCRIPT) ENVSCRIPT=salome_adm/unix/envScript
dnl copy xml files to the build tree (lib directory)
dnl pourquoi ????
#cd lib
#for i in `find $ROOT_SRCDIR -name "*.xml" -print`
#do
# ln -fs $i
# echo `echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
#done
#cd $ROOT_BUILDDIR
echo
echo ---------------------------------------------
echo generating Makefiles and configure files
echo ---------------------------------------------
echo
AC_OUTPUT_COMMANDS([ \
chmod +x ./bin/* \
])
## do not delete this line

View File

@ -15,10 +15,11 @@ if (navigator.appName !="Netscape")
<style type="text/css"> <style type="text/css">
<!-- <!--
img_whs1 { border:none; width:25px; height:24px; border-style:none; } img_whs1 { border:none; width:25px; height:24px; border-style:none; }
p.whs2 { margin-left:40px; } p.whs2 { font-weight:normal; }
img_whs3 { border:none; width:404px; height:413px; border-style:none; } p.whs3 { margin-left:40px; }
ul.whs4 { list-style:disc; } img_whs4 { border:none; width:404px; height:413px; border-style:none; }
p.whs5 { font-weight:bold; } ul.whs5 { list-style:disc; }
p.whs6 { font-weight:bold; }
--> -->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript"> </style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!-- <!--
@ -84,12 +85,16 @@ if (window.writeIntopicBar)
<p>After definition of algorithms and hypotheses a new mesh is listed in <p>After definition of algorithms and hypotheses a new mesh is listed in
the Object Browser. Right-click on it and select <img src="image28.gif" width="25px" height="24px" border="0" class="img_whs1"> <span the Object Browser. Right-click on it and select <img src="image28.gif" width="25px" height="24px" border="0" class="img_whs1"> <span
style="font-weight: bold;"><B>Compute</B></span> - the mesh will be automatically style="font-weight: bold;"><B>Compute</B></span> - the mesh will be automatically
displayed in the <span style="font-weight: bold;"><B><a href="files/vtk_3d_viewer.htm">VTK displayed in the <span style="font-weight: bold;"><B>VTK 3D Viewer.</B></span>
3D Viewer</a>.</B></span> Alternatively click<span style="font-weight: bold;"><B> Alternatively click<span style="font-weight: bold;"><B> Display only</B></span>
Display only</B></span> to hide all other objects at the same time. </p> to hide all other objects at the same time. </p>
<p>&nbsp;</p> <p>&nbsp;</p>
<p class="whs2"><span style="font-weight: bold;"><B>VTK 3D
Viewer</B></span> is detailly described in the documentation on <span style="font-weight: bold;"><B>GUI
module</B></span>.</p>
<p>After the mesh has appeared in the Viewer, you can select it with left <p>After the mesh has appeared in the Viewer, you can select it with left
mouse click and &nbsp;get mouse click and &nbsp;get
information about it, change its presentation parameters and access to information about it, change its presentation parameters and access to
@ -97,11 +102,11 @@ if (window.writeIntopicBar)
<p>&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;</p>
<p class="whs2"><img src="image15.jpg" width="404px" height="413px" border="0" class="img_whs3"></p> <p class="whs3"><img src="image15.jpg" width="404px" height="413px" border="0" class="img_whs4"></p>
<p>&nbsp;</p> <p>&nbsp;</p>
<ul type="disc" class="whs4"> <ul type="disc" class="whs5">
<li class=kadov-p><p><span style="font-weight: bold;"><B>Erase all</B></span> <li class=kadov-p><p><span style="font-weight: bold;"><B>Erase all</B></span>
&nbsp;- allows &nbsp;- allows
@ -115,7 +120,7 @@ if (window.writeIntopicBar)
- &nbsp;provides - &nbsp;provides
more detailed information about the mesh. </p></li> more detailed information about the mesh. </p></li>
<li class=kadov-p><p class="whs5"><a href="files/viewing_mesh_info.htm#standard_infos">Standard <li class=kadov-p><p class="whs6"><a href="files/viewing_mesh_info.htm#standard_infos">Standard
Mesh Infos</a> - <span style="font-weight: normal;">provides basic information Mesh Infos</a> - <span style="font-weight: normal;">provides basic information
about the mesh.</span></p></li> about the mesh.</span></p></li>
@ -124,7 +129,7 @@ if (window.writeIntopicBar)
to display the ID numbers of all meshing elements or nodes composing your to display the ID numbers of all meshing elements or nodes composing your
mesh in the viewer.</p></li> mesh in the viewer.</p></li>
<li class=kadov-p><p class="whs5"><a href="presentation.htm" style="font-weight: bold;">Display <li class=kadov-p><p class="whs6"><a href="presentation.htm" style="font-weight: bold;">Display
Mode</a> - <span style="font-weight: normal;">allows to select between Mode</a> - <span style="font-weight: normal;">allows to select between
Wireframe, Shading and Nodes presentation.</span></p></li> Wireframe, Shading and Nodes presentation.</span></p></li>

View File

@ -0,0 +1,160 @@
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
<head>
<title>Building Compounds</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style type="text/css">
<!--
p.whs1 { font-family:'Arial Black' , sans-serif; font-style:italic; }
p.whs2 { margin-left:40px; }
img_whs3 { border:none; width:25px; height:24px; border-style:none; }
p.whs4 { margin-left:80px; }
img_whs5 { border:none; width:420px; height:367px; float:none; border-style:none; }
ul.whs6 { list-style:disc; }
p.whs7 { margin-left:80px; margin-top:0pt; margin-bottom:0pt; }
p.whs8 { margin-top:0pt; margin-bottom:0pt; margin-left:120px; }
p.whs9 { margin-left:80px; margin-top:0pt; margin-bottom:0pt; font-weight:bold; }
p.whs10 { margin-top:0pt; margin-bottom:0pt; font-style:italic; margin-left:24px; }
img_whs11 { border:none; width:245px; height:257px; border-style:none; }
-->
</style><script type="text/javascript" language="JavaScript">
<!--
if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
{
var strNSS = "<style type='text/css'>";
strNSS += "p.whs7 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs8 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs9 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs10 {margin-top:1pt;margin-bottom:1pt; }";
strNSS +="</style>";
document.write(strNSS);
}
//-->
</script>
<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
origWidth = innerWidth;
origHeight = innerHeight;
onresize = reDo;
}
onerror = null;
//-->
</script>
<style type="text/css">
<!--
div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
p.WebHelpNavBar { text-align:right; }
-->
</style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
<script type="text/javascript" language="javascript" src="whver.js"></script>
<script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
<script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
<script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.gbWhTopic)
{
if (window.setRelStartPage)
{
addTocInfo("MESH module\nCreating meshes\nBuilding Compounds");
addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");
addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");
}
if (window.setRelStartPage)
{
setRelStartPage("index.htm");
autoSync(1);
sendSyncInfo();
sendAveInfoOut();
}
}
else
if (window.gbIE4)
document.location.reload();
//-->
</script>
</head>
<body><script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
writeIntopicBar(4);
//-->
</script>
<h1>Building Compounds</h1>
<p>Compound Mesh is a combination of several meshes.</p>
<p class="whs1">&nbsp;To
Build a compound:</p>
<p class="whs2">From the <span style="font-weight: bold;"><B>Mesh</B></span>
menu select <span style="font-weight: bold;"><B>Build Compound</B></span> or
click <img src="image161.gif" width="25px" height="24px" border="0" class="img_whs3"> button in the toolbar. The following dialog box will
appear: </p>
<p class="whs4"><img src="pics/buildcompound.png" x-maintain-ratio="TRUE" width="420px" height="367px" border="0" class="img_whs5"></p>
<ul type="disc" class="whs6">
<li class=kadov-p><p class="whs7"><span style="font-weight: bold;"><B>Name</B></span>
- allows selecting the name of the resulting <span style="font-weight: bold;"><B>Compound</B></span></p></li>
<li class=kadov-p><p class="whs7"><span style="font-weight: bold;"><B>Meshes
</B></span>- allows selecting the meshes which will be concatenated. They
can be chosen in the Object Browser while holding <span style="font-weight: bold;"><B>Ctrl</B></span>
button.</p></li>
<li class=kadov-p><p class="whs7"><span style="font-weight: bold;"><B>Processing
identical groups</B></span> - allows selecting the method of processing the
namesake existing on the united meshes. They can be either </p></li>
<li class=kadov-p><p class="whs8"><span style="font-weight: bold;"><B>United</B></span>
- all elements of Group1
on Mesh_1 and
Group1 on Mesh_2
become the elements of Group1
on the Compound_Mesh,
or</p></li>
<li class=kadov-p><p class="whs8"><span style="font-weight: bold;"><B>Renamed</B></span>
- Group1 on
Mesh_1 becomes
Group1_1 and
Group1 on Mesh_2
becomes Group1_2.
See <span style="font-weight: bold;"><B><a href="grouping_elements.htm">Creating
Groups</a></B></span> for more information about groups. </p></li>
<li class=kadov-p><p class="whs9"><span style="font-weight: normal;">You
can simply unite meshes or choose to</span> Merge coincident nodes and
elements, <span style="font-weight: normal;">in which case it is possible
to define the</span> Tolerance <span style="font-weight: normal;">for
this operation.</span> &nbsp;</p></li>
</ul>
<p class="whs10">Example:</p>
<p class="whs4"><img src="image160.gif" width="245px" height="257px" border="0" class="img_whs11"></p>
<p>&nbsp;</p>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
writeIntopicBar(0);
//-->
</script>
</body>
</html>

View File

@ -16,34 +16,35 @@ if (navigator.appName !="Netscape")
<!-- <!--
img_whs1 { border:none; width:30px; height:30px; float:none; border-style:none; } img_whs1 { border:none; width:30px; height:30px; float:none; border-style:none; }
ul.whs2 { list-style:disc; } ul.whs2 { list-style:disc; }
ul.whs3 { list-style:circle; } ol.whs3 { list-style:disc; }
table.whs4 { x-cell-content-align:top; width:45.771%; border-spacing:0px; } ul.whs4 { list-style:circle; }
col.whs5 { width:42.826%; } table.whs5 { x-cell-content-align:top; width:45.771%; border-spacing:0px; }
col.whs6 { width:57.174%; } col.whs6 { width:42.826%; }
tr.whs7 { x-cell-content-align:top; } col.whs7 { width:57.174%; }
td.whs8 { width:42.826%; padding-right:10px; padding-left:10px; border-right-style:none; border-left-style:none; border-top-style:none; border-bottom-style:none; } tr.whs8 { x-cell-content-align:top; }
p.whs9 { margin-right:2px; } td.whs9 { width:42.826%; padding-right:10px; padding-left:10px; border-right-style:none; border-left-style:none; border-top-style:none; border-bottom-style:none; }
img_whs10 { border:none; width:170px; height:170px; border-style:none; } p.whs10 { margin-right:2px; }
td.whs11 { width:57.174%; padding-right:10px; padding-left:10px; border-top-style:none; border-bottom-style:none; border-right-style:none; } img_whs11 { border:none; width:170px; height:170px; border-style:none; }
p.whs12 { margin-right:240px; } td.whs12 { width:57.174%; padding-right:10px; padding-left:10px; border-top-style:none; border-bottom-style:none; border-right-style:none; }
img_whs13 { border:none; width:182px; height:177px; border-style:none; } p.whs13 { margin-right:240px; }
table.whs14 { x-cell-content-align:top; width:30.595%; border-spacing:0px; } img_whs14 { border:none; width:182px; height:177px; border-style:none; }
col.whs15 { width:50.334%; } table.whs15 { x-cell-content-align:top; width:30.595%; border-spacing:0px; }
col.whs16 { width:49.666%; } col.whs16 { width:50.334%; }
td.whs17 { width:50.334%; padding-right:10px; padding-left:10px; border-right-style:none; border-left-style:none; border-top-style:none; border-bottom-style:none; } col.whs17 { width:49.666%; }
img_whs18 { border:none; width:119px; height:299px; border-style:none; } td.whs18 { width:50.334%; padding-right:10px; padding-left:10px; border-right-style:none; border-left-style:none; border-top-style:none; border-bottom-style:none; }
td.whs19 { width:49.666%; padding-right:10px; padding-left:10px; border-top-style:none; border-bottom-style:none; border-right-style:none; } img_whs19 { border:none; width:119px; height:299px; border-style:none; }
img_whs20 { border:none; width:127px; height:298px; border-style:none; } td.whs20 { width:49.666%; padding-right:10px; padding-left:10px; border-top-style:none; border-bottom-style:none; border-right-style:none; }
h4.whs21 { margin-left:0px; } img_whs21 { border:none; width:127px; height:298px; border-style:none; }
p.whs22 { margin-left:0px; } h4.whs22 { margin-left:0px; }
p.whs23 { margin-left:0px; }
--> -->
</style><script type="text/javascript" language="JavaScript"> </style><script type="text/javascript" language="JavaScript">
<!-- <!--
if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4)) if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
{ {
var strNSS = "<style type='text/css'>"; var strNSS = "<style type='text/css'>";
strNSS += "h4.whs21 {margin-left:1pt; }"; strNSS += "h4.whs22 {margin-left:1pt; }";
strNSS += "p.whs22 {margin-left:1pt; }"; strNSS += "p.whs23 {margin-left:1pt; }";
strNSS +="</style>"; strNSS +="</style>";
document.write(strNSS); document.write(strNSS);
} }
@ -123,15 +124,24 @@ if (window.writeIntopicBar)
<p>&nbsp;</p> <p>&nbsp;</p>
<ul type="disc" class="whs2"> <ol type="disc" class="whs3">
<ul type="disc" class="whs2"> <ul type="disc" class="whs2">
<li style="list-style: circle;" <li style="list-style: circle;"
type=circle type=circle
class=kadov-p><p>Wire Discretization meshing algorithm</p></li> class=kadov-p><p>Wire Discretisation meshing algorithm - splits
a wire into a number of mesh segments following any 1D hypothesis.</p></li>
<li style="list-style: circle;"
type=circle
class=kadov-p><p>Composite Side Discretisation algorithm -
allows to apply any 1D hypothesis to a whole side of a geometrical face
even if it is composed of several edges provided that they form C1 curve,
have the same hypotheses assigned and form one side in all faces of the
main shape of a mesh.</p></li>
</ul> </ul>
</ul> </ol>
<p>&nbsp;</p> <p>&nbsp;</p>
@ -142,9 +152,9 @@ if (window.writeIntopicBar)
<p>&nbsp;</p> <p>&nbsp;</p>
<ul type="disc" class="whs2"> <ol type="disc" class="whs3">
<ul type="circle" class="whs3"> <ul type="circle" class="whs4">
<li class=kadov-p><p>Triangle meshing algorithms (Mefisto and Netgen <li class=kadov-p><p>Triangle meshing algorithms (Mefisto and Netgen
1D-2D ) - Faces are split into triangular elements.</p></li> 1D-2D ) - Faces are split into triangular elements.</p></li>
@ -152,19 +162,19 @@ if (window.writeIntopicBar)
<li class=kadov-p><p>Quadrangle meshing algorithm (Mapping) - Faces <li class=kadov-p><p>Quadrangle meshing algorithm (Mapping) - Faces
are split into quadrangular elements.</p></li> are split into quadrangular elements.</p></li>
</ul> </ul>
</ul> </ol>
<p>&nbsp;</p> <p>&nbsp;</p>
<table x-use-null-cells cellspacing="0" width="45.771%" class="whs4"> <table x-use-null-cells cellspacing="0" width="45.771%" class="whs5">
<col class="whs5">
<col class="whs6"> <col class="whs6">
<col class="whs7">
<tr valign="top" class="whs7"> <tr valign="top" class="whs8">
<td width="42.826%" class="whs8"> <td width="42.826%" class="whs9">
<p class="whs9"><img src="../image123.gif" width="170px" height="170px" border="0" class="img_whs10"></td> <p class="whs10"><img src="../image123.gif" width="170px" height="170px" border="0" class="img_whs11"></td>
<td width="57.174%" class="whs11"> <td width="57.174%" class="whs12">
<p class="whs12"><img src="../image124.gif" width="182px" height="177px" border="0" class="img_whs13"></td></tr> <p class="whs13"><img src="../image124.gif" width="182px" height="177px" border="0" class="img_whs14"></td></tr>
</table> </table>
<p>&nbsp;</p> <p>&nbsp;</p>
@ -179,9 +189,9 @@ if (window.writeIntopicBar)
<p>&nbsp;</p> <p>&nbsp;</p>
<ul type="disc" class="whs2"> <ol type="disc" class="whs3">
<ul type="circle" class="whs3"> <ul type="circle" class="whs4">
<li class=kadov-p><p>Hexahedron meshing algorithm (i,j,k) - Volumes <li class=kadov-p><p>Hexahedron meshing algorithm (i,j,k) - Volumes
are split into hexahedral (cubic) elements. </p></li> are split into hexahedral (cubic) elements. </p></li>
@ -189,19 +199,19 @@ if (window.writeIntopicBar)
<li class=kadov-p><p>Tetrahedron (Netgen) meshing algorithm - Volumes <li class=kadov-p><p>Tetrahedron (Netgen) meshing algorithm - Volumes
are split into tetrahedral (pyramidal) elements. </p></li> are split into tetrahedral (pyramidal) elements. </p></li>
</ul> </ul>
</ul> </ol>
<p>&nbsp;</p> <p>&nbsp;</p>
<table x-use-null-cells cellspacing="0" width="30.595%" class="whs14"> <table x-use-null-cells cellspacing="0" width="30.595%" class="whs15">
<col class="whs15">
<col class="whs16"> <col class="whs16">
<col class="whs17">
<tr valign="top" class="whs7"> <tr valign="top" class="whs8">
<td width="50.334%" class="whs17"> <td width="50.334%" class="whs18">
<p><img src="../image125.gif" width="119px" height="299px" border="0" class="img_whs18"> </td> <p><img src="../image125.gif" width="119px" height="299px" border="0" class="img_whs19"> </td>
<td width="49.666%" class="whs19"> <td width="49.666%" class="whs20">
<p><img src="../image126.gif" width="127px" height="298px" border="0" class="img_whs20"></td></tr> <p><img src="../image126.gif" width="127px" height="298px" border="0" class="img_whs21"></td></tr>
</table> </table>
<p>&nbsp;</p> <p>&nbsp;</p>
@ -222,12 +232,12 @@ if (window.writeIntopicBar)
prismatic shapes.</a> </p></li> prismatic shapes.</a> </p></li>
</ul> </ul>
<h4 class="whs21"><a href="constructing_meshes.htm">Constructing <h4 class="whs22"><a href="constructing_meshes.htm">Constructing
meshes</a> <span style="font-weight: normal;">page describes in detail meshes</a> <span style="font-weight: normal;">page describes in detail
how to apply meshing algorithms.</span><a href="constructing_meshes.htm" style="font-weight: bold;"> how to apply meshing algorithms.</span><a href="constructing_meshes.htm" style="font-weight: bold;">
</a></h4> </a></h4>
<p class="whs22"><span style="font-weight: bold;"><B>See Also</B></span> <p class="whs23"><span style="font-weight: bold;"><B>See Also</B></span>
a sample TUI Script of a <a href="../defining_hypotheses_tui.htm#bookmark8">Define a sample TUI Script of a <a href="../defining_hypotheses_tui.htm#bookmark8">Define
Meshing Algorithm</a> operation. &nbsp;</p> Meshing Algorithm</a> operation. &nbsp;</p>

View File

@ -19,7 +19,7 @@ ul.whs2 { list-style:disc; }
p.whs3 { margin-left:40px; } p.whs3 { margin-left:40px; }
img_whs4 { border:none; width:22px; height:24px; border-style:none; } img_whs4 { border:none; width:22px; height:24px; border-style:none; }
p.whs5 { margin-left:80px; } p.whs5 { margin-left:80px; }
img_whs6 { border:none; border-style:none; width:355px; height:296px; float:none; } img_whs6 { border:none; width:370px; height:296px; float:none; }
img_whs7 { border:none; width:173px; height:88px; border-style:none; } img_whs7 { border:none; width:173px; height:88px; border-style:none; }
img_whs8 { border:none; width:34px; height:29px; border-style:none; } img_whs8 { border:none; width:34px; height:29px; border-style:none; }
img_whs9 { border:none; width:29px; height:28px; border-style:none; } img_whs9 { border:none; width:29px; height:28px; border-style:none; }
@ -124,7 +124,7 @@ if (window.writeIntopicBar)
<p class="whs3">&nbsp;</p> <p class="whs3">&nbsp;</p>
<p class="whs5"><img src="../pics/createmesh-inv.png" x-maintain-ratio="TRUE" width="355px" height="296px" border="0" class="img_whs6"></p> <p class="whs5"><img src="../pics/createmesh-inv.png" x-maintain-ratio="TRUE" width="370px" height="296px" border="0" class="img_whs6"></p>
<p class="whs5">&nbsp;</p> <p class="whs5">&nbsp;</p>

View File

@ -19,7 +19,7 @@ ul.whs2 { list-style:disc; }
p.whs3 { margin-left:40px; } p.whs3 { margin-left:40px; }
img_whs4 { border:none; width:27px; height:25px; border-style:none; } img_whs4 { border:none; width:27px; height:25px; border-style:none; }
p.whs5 { margin-left:80px; } p.whs5 { margin-left:80px; }
img_whs6 { border:none; border-style:none; width:355px; height:326px; float:none; } img_whs6 { border:none; width:370px; height:326px; float:none; }
p.whs7 { margin-left:38px; } p.whs7 { margin-left:38px; }
img_whs8 { border:none; width:224px; height:212px; border-style:none; } img_whs8 { border:none; width:224px; height:212px; border-style:none; }
--> -->
@ -125,7 +125,7 @@ if (window.writeIntopicBar)
<p class="whs3">&nbsp;</p> <p class="whs3">&nbsp;</p>
<p class="whs5"><img src="../pics/createmesh-inv2.png" x-maintain-ratio="TRUE" width="355px" height="326px" border="0" class="img_whs6"></p> <p class="whs5"><img src="../pics/createmesh-inv2.png" x-maintain-ratio="TRUE" width="370px" height="326px" border="0" class="img_whs6"></p>
<p class="whs7">&nbsp;</p> <p class="whs7">&nbsp;</p>

View File

@ -16,7 +16,7 @@ if (navigator.appName !="Netscape")
<!-- <!--
img_whs1 { border:none; width:30px; height:30px; float:none; border-style:none; } img_whs1 { border:none; width:30px; height:30px; float:none; border-style:none; }
p.whs2 { margin-left:40px; } p.whs2 { margin-left:40px; }
img_whs3 { border:none; width:312px; height:488px; float:none; border-style:none; } img_whs3 { border:none; width:400px; height:488px; float:none; }
img_whs4 { border:none; width:341px; height:375px; float:none; border-style:none; } img_whs4 { border:none; width:341px; height:375px; float:none; border-style:none; }
img_whs5 { border:none; float:none; width:347px; height:376px; border-style:none; } img_whs5 { border:none; float:none; width:347px; height:376px; border-style:none; }
--> -->
@ -98,7 +98,7 @@ if (window.writeIntopicBar)
<p>&nbsp;</p> <p>&nbsp;</p>
<p class="whs2"><img src="../pics/mergenodes.png" x-maintain-ratio="TRUE" width="312px" height="488px" border="0" class="img_whs3"></p> <p class="whs2"><img src="../pics/mergenodes.png" x-maintain-ratio="TRUE" width="400px" height="488px" border="0" class="img_whs3"></p>
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>

View File

@ -14,7 +14,7 @@ if (navigator.appName !="Netscape")
</script> </script>
<style type="text/css"> <style type="text/css">
<!-- <!--
img_whs1 { border:none; border-style:none; width:355px; height:296px; float:none; } img_whs1 { border:none; width:370px; height:296px; float:none; }
img_whs2 { border:none; width:30px; height:29px; border-style:none; } img_whs2 { border:none; width:30px; height:29px; border-style:none; }
p.whs3 { margin-left:40px; } p.whs3 { margin-left:40px; }
img_whs4 { border:none; float:none; width:386px; height:336px; border-style:none; } img_whs4 { border:none; float:none; width:386px; height:336px; border-style:none; }
@ -105,7 +105,7 @@ if (window.writeIntopicBar)
<p>&nbsp;</p> <p>&nbsp;</p>
<p class=TODO <p class=TODO
style="margin-left: 40px;"><img src="../pics/createmesh-inv3.png" x-maintain-ratio="TRUE" width="355px" height="296px" border="0" class="img_whs1"></p> style="margin-left: 40px;"><img src="../pics/createmesh-inv3.png" x-maintain-ratio="TRUE" width="370px" height="296px" border="0" class="img_whs1"></p>
<p>You can also change values for the current hypothesis by clicking the <p>You can also change values for the current hypothesis by clicking the
<img src="../image122.gif" width="30px" height="29px" border="0" class="img_whs2"> button. </p> <img src="../image122.gif" width="30px" height="29px" border="0" class="img_whs2"> button. </p>

View File

@ -1,265 +0,0 @@
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
<head>
<title>VTK 3D Viewer</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style type="text/css">
<!--
p.whs1 { margin-top:0pt; margin-bottom:0pt; }
p.whs2 { margin-top:0pt; margin-bottom:0pt; margin-left:48px; }
img_whs3 { border:none; width:301px; height:26px; float:none; }
ul.whs4 { list-style:disc; }
img_whs5 { border:none; width:26px; height:25px; float:none; border-style:none; }
img_whs6 { border:none; width:27px; height:25px; float:none; border-style:none; }
img_whs7 { border:none; width:24px; height:23px; float:none; border-style:none; }
img_whs8 { border:none; width:24px; height:24px; float:none; border-style:none; }
img_whs9 { border:none; width:25px; height:24px; float:none; border-style:none; }
img_whs10 { border:none; width:23px; height:23px; float:none; border-style:none; }
img_whs11 { border:none; width:20px; height:20px; float:none; }
p.whs12 { margin-top:0pt; margin-bottom:0pt; margin-left:80px; }
img_whs13 { border:none; width:410px; height:255px; float:none; }
img_whs14 { border:none; width:26px; height:26px; float:none; border-style:none; }
img_whs15 { border:none; width:78px; height:147px; float:none; border-style:none; }
img_whs16 { border:none; width:28px; height:25px; float:none; border-style:none; }
img_whs17 { border:none; width:27px; height:27px; float:none; border-style:none; }
p.whs18 { font-weight:bold; margin-left:80px; margin-top:0pt; margin-bottom:0pt; }
img_whs19 { border:none; width:350px; height:453px; float:none; border-style:none; }
p.whs20 { font-weight:bold; margin-top:0pt; margin-bottom:0pt; }
p.whs21 { font-weight:bold; margin-left:36px; margin-top:0pt; margin-bottom:0pt; }
p.whs22 { font-weight:bold; margin-left:0px; margin-top:0pt; margin-bottom:0pt; }
p.whs23 { margin-left:0px; font-weight:bold; margin-top:0pt; margin-bottom:0pt; }
-->
</style><script type="text/javascript" language="JavaScript">
<!--
if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
{
var strNSS = "<style type='text/css'>";
strNSS += "p.whs1 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs2 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs12 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs18 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs20 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs21 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs22 {margin-left:1pt;margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs23 {margin-left:1pt;margin-top:1pt;margin-bottom:1pt; }";
strNSS +="</style>";
document.write(strNSS);
}
//-->
</script>
<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
origWidth = innerWidth;
origHeight = innerHeight;
onresize = reDo;
}
onerror = null;
//-->
</script>
<style type="text/css">
<!--
div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
p.WebHelpNavBar { text-align:right; }
-->
</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>
<script type="text/javascript" language="javascript" src="../whver.js"></script>
<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>
<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>
<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.gbWhTopic)
{
if (window.setRelStartPage)
{
addTocInfo("MESH module\nViewing meshes\nVTK 3D Viewer");
addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");
addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");
}
if (window.setRelStartPage)
{
setRelStartPage("../index.htm");
autoSync(1);
sendSyncInfo();
sendAveInfoOut();
}
}
else
if (window.gbIE4)
document.location.reload();
//-->
</script>
</head>
<body><script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
writeIntopicBar(4);
//-->
</script>
<h1>VTK 3D Viewer</h1>
<p class="whs1"><span style="font-weight: bold;"><B>VTK
3D viewer</B></span> is the default viewer for Mesh Module, allowing to visualize
meshes. It is also used in Post-Pro module for all 3D presentations except
for Gauss Points.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">The functionalities of
VTK viewer are available via its Viewer Toolbar. Buttons marked with small
downward triangles have extended functionality which can be accessed by
locking on them with left mouse button. &nbsp;</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"><img src="../pics/image157.gif" x-maintain-ratio="TRUE" width="301px" height="26px" border="0" class="img_whs3"></p>
<ul type="disc" class="whs4">
<li class=kadov-p><p class="whs1"><img src="../pics/image77.gif" x-maintain-ratio="TRUE" width="26px" height="25px" border="0" class="img_whs5"> <span style="font-weight: bold;"><B>Dump View</B></span> - exports
an object from the viewer in bmp, png, jpg or jpeg image format. </p></li>
<li class=kadov-p><p class="whs1"><img src="../pics/image78.gif" x-maintain-ratio="TRUE" width="27px" height="25px" border="0" class="img_whs6"> <span style="font-weight: bold;"><B>Show/Hide Trihedron</B></span>
- shows or hides coordinate axes. </p></li>
<li class=kadov-p><p class="whs1"><img src="../pics/image96.gif" x-maintain-ratio="TRUE" width="24px" height="23px" border="0" class="img_whs7"> &nbsp;<span style="font-weight: bold;"><B>Fit
all - </B></span>allows to select a point to be the center of a scene representing
all displayed objects in the visible area.<span style="font-weight: bold;">
<B></B></span></p></li>
<li class=kadov-p><p class="whs1">&nbsp;<img src="../pics/image97.gif" x-maintain-ratio="TRUE" width="24px" height="24px" border="0" class="img_whs8"> <span style="font-weight: bold;"><B>Fit area</B></span> - resizes
the view to place in the visible area only the contents of a frame drawn
with pressed left mouse button.</p></li>
<li class=kadov-p><p class="whs1"><img src="../pics/image98.gif" x-maintain-ratio="TRUE" width="25px" height="24px" border="0" class="img_whs9"> <span style="font-weight: bold;"><B>Zoom</B></span> - &nbsp;allows
to zoom in and out. </p></li>
<li class=kadov-p><p class="whs1"><img src="../pics/image99.gif" x-maintain-ratio="TRUE" width="23px" height="23px" border="0" class="img_whs10"> <span style="font-weight: bold;"><B>Panning</B></span> - if the
represented objects are greater that the visible area and you don't wish
to use <span style="font-weight: bold;"><B>Fit all</B></span> functionality,
click on this button and you'll be able to drag the scene to see its remote
parts. </p></li>
<li class=kadov-p><p class="whs1"><img src="../pics/image100.gif" x-maintain-ratio="TRUE" width="24px" height="24px" border="0" class="img_whs8"> <span style="font-weight: bold;"><B>Global panning</B></span> -
represents all displayed objects in the visible area. </p></li>
<li class=kadov-p><p class="whs1"><img src="../pics/view_rotation_point.png" x-maintain-ratio="TRUE" width="20px" height="20px" border="0" class="img_whs11"> <span style="font-weight: bold;"><B>Change rotation point</B></span>
- allows to to choose the point around which the rotation is performed</p></li>
</ul>
<p class="whs12"><img src="../pics/set_rotation_point_dialog1.png" x-maintain-ratio="TRUE" width="410px" height="255px" border="0" class="img_whs13"></p>
<p class="whs12">&nbsp;</p>
<p class="whs12">By default the rotation point is located
in the Center of the bounding box of an object. </p>
<p class="whs12">&nbsp;</p>
<p class="whs12"><img src="../pics/set_rotation_point_dialog2.png" x-maintain-ratio="TRUE" width="410px" height="255px" border="0" class="img_whs13"></p>
<p class="whs12">&nbsp;</p>
<p class="whs12">Unchecking <span style="font-weight: bold;"><B>Use
Bounding Box Center</B></span> box allows you to define the coordinates of
the rotation point manually. </p>
<p class="whs12">&nbsp;</p>
<p class="whs12"><span style="font-weight: bold;"><B>Set to
Origin</B></span> button restores the default rotation point coordinates.</p>
<p class="whs12"><span style="font-weight: bold;"><B>Select
Point from View</B></span> button allows to select the rotation point in the
3D Viewer</p>
<ul type="disc" class="whs4">
<li class=kadov-p><p class="whs1"><img src="../pics/image89.gif" x-maintain-ratio="TRUE" width="26px" height="26px" border="0" class="img_whs14"> <span style="font-weight: bold;"><B>Rotation</B></span> - allows
to rotate the selected object using the mouse. </p></li>
<li class=kadov-p><p class="whs1"><img src="../pics/image102.gif" x-maintain-ratio="TRUE" width="78px" height="147px" border="0" class="img_whs15"> These buttons orientate the scene strictly about coordinate
axes.</p></li>
<li class=kadov-p><p class="whs1"><img src="../pics/image91.gif" x-maintain-ratio="TRUE" width="26px" height="26px" border="0" class="img_whs14"> <span style="font-weight: bold;"><B>Reset</B></span> - restores
the default position (isometric) of objects in the scene.</p></li>
<li class=kadov-p><p class="whs1"><img src="../pics/image108.gif" x-maintain-ratio="TRUE" width="28px" height="25px" border="0" class="img_whs16"> <span style="font-weight: bold;"><B>Scaling</B></span> - represents
objects deformed (stretched or stuffed) along the axes of coordinates</p></li>
<li class=kadov-p><p class="whs1">&nbsp;<span
style="font-weight: bold;
margin-top: 0pt;
margin-bottom: 0pt;"><B><img src="../pics/image109.gif" x-maintain-ratio="TRUE" width="27px" height="27px" border="0" class="img_whs17">Graduated axes - </B></span><span style="margin-top: 0pt;
margin-bottom: 0pt;
font-weight: normal;">allows
to define parameters of axes and graduate them.</span></p></li>
</ul>
<p class="whs1">&nbsp;</p>
<p class="whs18"><img src="../pics/graduatedaxes1.png" x-maintain-ratio="TRUE" width="350px" height="453px" border="0" class="img_whs19"></p>
<ul type="disc" class="whs4">
<li class=kadov-p><p class="whs20">Axis name </p></li>
<li class=kadov-p><p class="whs21">Is visible - <span
style="font-weight: normal;">if checked the axis name is displayed in
the viewer.</span></p></li>
<li class=kadov-p><p class="whs21">Name<span style="font-weight: normal;">
- allows to redefine the name of the axis.</span></p></li>
<li class=kadov-p><p class="whs21">Font<span style="font-weight: normal;">
- allows to define color and properties of the font of axis name. </span></p></li>
<li class=kadov-p><p class="whs22">Labels<span style="font-weight: normal;">
</span></p></li>
<li class=kadov-p><p class="whs21">Is visible - <span
style="font-weight: normal;">if checked the labels are displayed in the
viewer.</span></p></li>
<li class=kadov-p><p class="whs21">Number<span style="font-weight: normal;">
- allows to define the number of labels.</span></p></li>
<li class=kadov-p><p class="whs21">Offset<span style="font-weight: normal;">
- allows to define the distance between labels.</span></p></li>
<li class=kadov-p><p class="whs21">Font<span style="font-weight: normal;">
- allows to define color and properties of the font of labels names.</span></p></li>
<li class=kadov-p><p class="whs23">Tick marks </p></li>
<li class=kadov-p><p class="whs21">Is visible - <span
style="font-weight: normal;">if checked the tick marks are displayed in
the viewer.</span></p></li>
<li class=kadov-p><p class="whs21">Length<span style="font-weight: normal;">
- allows to define the length of tick marks</span></p></li>
<li class=kadov-p><p class="whs23">Is visible <span style="font-weight: normal;">if
checked the axis is displayed in the viewer.</span></p></li>
</ul>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
writeIntopicBar(0);
//-->
</script>
</body>
</html>

BIN
doc/salome/gui/SMESH/image159.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

BIN
doc/salome/gui/SMESH/image160.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
doc/salome/gui/SMESH/image161.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

View File

@ -0,0 +1,132 @@
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
<head>
<title>Mesh through point</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style type="text/css">
<!--
p.whs1 { font-family:'Arial Black' , sans-serif; font-style:italic; margin-left:0px; }
p.whs2 { margin-left:36px; }
img_whs3 { border:none; width:27px; height:29px; border-style:none; }
img_whs4 { border:none; width:355px; height:366px; float:none; border-style:none; }
p.whs5 { margin-left:40px; font-family:'Times New Roman' , serif; font-style:normal; }
-->
</style><script type="text/javascript" language="JavaScript">
<!--
if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
{
var strNSS = "<style type='text/css'>";
strNSS += "p.whs1 {margin-left:1pt; }";
strNSS +="</style>";
document.write(strNSS);
}
//-->
</script>
<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
origWidth = innerWidth;
origHeight = innerHeight;
onresize = reDo;
}
onerror = null;
//-->
</script>
<style type="text/css">
<!--
div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
p.WebHelpNavBar { text-align:right; }
-->
</style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
<script type="text/javascript" language="javascript" src="whver.js"></script>
<script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
<script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
<script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.gbWhTopic)
{
if (window.setRelStartPage)
{
addTocInfo("MESH module\nModifying meshes\nMesh through point");
addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");
addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");
}
if (window.setRelStartPage)
{
setRelStartPage("index.htm");
autoSync(1);
sendSyncInfo();
sendAveInfoOut();
}
}
else
if (window.gbIE4)
document.location.reload();
//-->
</script>
</head>
<body><script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
writeIntopicBar(4);
//-->
</script>
<h1>Mesh through point</h1>
<p>In mesh you can define a node at a certain point either by creation
of a new node, by movement of the node closest to the point or by movement
of any node to the point.</p>
<p class="whs1">To create a mesh passing through a point:</p>
<p class="whs2">1. From the <span style="font-weight: bold;"><B>Modification
</B></span>menu choose the <span style="font-weight: bold;"><B>Mesh through point
</B></span>item or click <img src="image159.gif" width="27px" height="29px" border="0" class="img_whs3"> button in the toolbar. The following
dialog box shall appear:</p>
<p class="whs2"><img src="pics/meshtopass.png" x-maintain-ratio="TRUE" width="355px" height="366px" border="0" class="img_whs4"></p>
<p class="whs2">2. Enter the coordinates of the point</p>
<p class="whs2">3. Choose one of several methods: you can
either <span style="font-weight: bold;"><B>Create</B></span> a new node at the
indicated point or Move the existing node to the point. In the latter
case you can check in <span style="font-weight: bold;"><B>Automatic search</B></span>
of the closest node or select the necessary node manually. <span style="font-weight: bold;"><B>Preview</B></span>
check-box allows to see the results of the operation. </p>
<p class="whs2">4. Click the <span style="font-weight: bold;"><B>Apply
</B></span>or <span style="font-weight: bold;"><B>OK </B></span>button.</p>
<p>&nbsp;<span style="font-weight: bold;"><B>See
Also</B></span> a sample TUI Script of a <a href="modifying_meshes.htm#bookmark14">Mesh
through point</a> operation. &nbsp;</p>
<p>&nbsp;</p>
<p class="whs2">&nbsp;</p>
<p>&nbsp;</p>
<p class="whs5">&nbsp;</p>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
writeIntopicBar(0);
//-->
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -3,7 +3,7 @@
<html> <html>
<head> <head>
<title>Prism 3D Algorithm</title> <title>3D extrusion meshing algorithm</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1252"> <meta http-equiv="content-type" content="text/html; charset=windows-1252">
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style type="text/css"> <meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style type="text/css">
<!-- <!--
@ -53,7 +53,7 @@ if (window.gbWhTopic)
{ {
if (window.setRelStartPage) if (window.setRelStartPage)
{ {
addTocInfo("MESH module\nCreating meshes\nDefining Algorithms\nPrism 3D Algorithm"); addTocInfo("MESH module\nCreating meshes\nDefining Algorithms\n3D extrusion meshing algorithm");
addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif"); addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");
addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif"); addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");
@ -82,27 +82,25 @@ if (window.writeIntopicBar)
writeIntopicBar(4); writeIntopicBar(4);
//--> //-->
</script> </script>
<h1>Prism 3D Algorithm</h1> <h1>3D extrusion meshing algorithm</h1>
<p>Prism 3D algorithm can be used for meshing prisms, i.e. <span style="font-weight: bold;"><B>3D <p>3D extrusion algorithm can be used for meshing prisms, i.e.
Shapes</B></span> defined by<span style="margin-left: 24px; <span style="font-weight: bold;"><B>3D Shapes</B></span> defined by
margin-top: 0pt; two opposing faces having the same number of vertices and edges and meshed using the
margin-bottom: 0pt;"> two opposing
faces having the same number of vertices and edges and meshed using the
<a href="projection_algorithms.htm">2D Projection</a> algorithm. These <a href="projection_algorithms.htm">2D Projection</a> algorithm. These
two faces should be connected by quadrangle &quot;side&quot; faces.</span></p> two faces should be connected by quadrangle &quot;side&quot; faces.</p>
<p><span style="margin-left: 24px; <p><span style="margin-left: 24px;
margin-top: 0pt; margin-top: 0pt;
margin-bottom: 0pt;">The opposing faces can be meshed with margin-bottom: 0pt;">The opposing faces can be meshed with
either quadrangles or triangles, while the side faces should be meshed either quadrangles or triangles, while the side faces should be meshed
with quadranglees only. </span></p> with quadrangles only. </span></p>
<p class="whs1"><img src="image157.gif" width="324px" height="337px" border="0" class="img_whs2"></p> <p class="whs1"><img src="image157.gif" width="324px" height="337px" border="0" class="img_whs2"></p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p class="whs3">As you can see, the <span style="font-weight: bold;"><B>Prism3D</B></span> <p class="whs3">As you can see, the <span style="font-weight: bold;"><B>3D extrusion</B></span>
algorithm permits to build and to have in the same 3D mesh such elements algorithm permits to build and to have in the same 3D mesh such elements
as hexahedrons, prisms and polyhedrons.</p> as hexahedrons, prisms and polyhedrons.</p>

View File

@ -0,0 +1,98 @@
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
<head>
<title>Segments around Vertex Algorithm</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style type="text/css">
<!--
p.whs1 { margin-left:40px; }
img_whs2 { border:none; width:270px; height:179px; float:none; border-style:none; }
-->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
origWidth = innerWidth;
origHeight = innerHeight;
onresize = reDo;
}
onerror = null;
//-->
</script>
<style type="text/css">
<!--
div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
p.WebHelpNavBar { text-align:right; }
-->
</style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
<script type="text/javascript" language="javascript" src="whver.js"></script>
<script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
<script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
<script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.gbWhTopic)
{
if (window.setRelStartPage)
{
addTocInfo("MESH module\nCreating meshes\nDefining Algorithms\nSegments around Vertex Algorithm");
addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");
addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");
}
if (window.setRelStartPage)
{
setRelStartPage("index.htm");
autoSync(1);
sendSyncInfo();
sendAveInfoOut();
}
}
else
if (window.gbIE4)
document.location.reload();
//-->
</script>
</head>
<body><script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
writeIntopicBar(4);
//-->
</script>
<h1>Segments around Vertex</h1>
<p><span style="font-weight: bold;"><B>Segments around Vertex</B></span> algorithm
is considered to be a 0D
meshing algorithm, but, of course, it doesn't mesh nodes. It allows to
define the local size of the elements in the neighborhood of a certain
node. If we choose an object of higher dimension, it applies to all its
tops, i.e. corners of a box. &nbsp;The
0D algorithm combines with the algorithms of higher dimensions, but it
is not necessarily required for their successful implementation. </p>
<p>This algorithm allows only one hypothesis. </p>
<p class="whs1"><img src="pics/lengthnearvertex.png" x-maintain-ratio="TRUE" width="270px" height="179px" border="0" class="img_whs2"></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
writeIntopicBar(0);
//-->
</script>
</body>
</html>

View File

@ -120,6 +120,7 @@ adding_quadratic_nodes_and_elements.htm
aspect_ratio_3d.htm aspect_ratio_3d.htm
borders_at_multi-connection.htm borders_at_multi-connection.htm
borders_at_multiconnection_2d.htm borders_at_multiconnection_2d.htm
building_compounds.htm
clipping.htm clipping.htm
constructing_meshes.htm constructing_meshes.htm
convert_to_from_quadratic_mesh.htm convert_to_from_quadratic_mesh.htm
@ -176,13 +177,18 @@ grouping_elements.htm
length.htm length.htm
merge_elements.htm merge_elements.htm
mesh.htm mesh.htm
mesh_through_point.htm
modifying_meshes.htm modifying_meshes.htm
namespacesmesh.html namespacesmesh.html
netgen_2d_and_3d_hypotheses.htm netgen_2d_and_3d_hypotheses.htm
pattern_mapping.htm pattern_mapping.htm
presentation.htm presentation.htm
prism_3d_algorithm.htm
projection_algorithms.htm
quality_controls.htm quality_controls.htm
radial_prism.htm
revolution.htm revolution.htm
segments_around_vertex_algorithm.htm
selection_filter_library.htm selection_filter_library.htm
smesh.py_introduction.htm smesh.py_introduction.htm
transforming_meshes.htm transforming_meshes.htm
@ -193,36 +199,46 @@ ehelp.xml
texture_horiz_ltbluebubbles.jpg texture_horiz_ltbluebubbles.jpg
index.glo index.glo
default.css default.css
pics\add_node.png pics\curvi_simple_after.png
pics\image89.gif
pics\image100.gif
pics\image78.gif
pics\image23.gif
pics\b-mesh_infos.png
pics\remove_nodes2.png pics\remove_nodes2.png
pics\merging_nodes2.png pics\moving_nodes1.png
pics\moving_nodes2.png
pics\smoothing2.png pics\smoothing2.png
pics\b-mberofsegments.png pics\a-maxelarea.png
pics\b-flection1d.png pics\patternmapping1.png
pics\a-cuttingofquadrangles.png image94.jpg
image106.gif
image91.gif
image80.gif
pics\distributionwithtabledensity.png
pics\moving_nodes2.png
image7.jpg
pics\patternmapping2.png
pics\extrusionalongaline1.png
pics\addquadrangle.png pics\addquadrangle.png
pics\intersectgroups.png
pics\editgroup.png
image95.jpg image95.jpg
pics\sewing1.png pics\sewing1.png
image92.gif image92.gif
image51.jpg image51.jpg
image70.gif image70.gif
pics\netgen2d.png pics\meshtopass.png
pics\circle_simple_after.png pics\image157.gif
pics\curvi_simple_after.png pics\extrusion1.png
pics\image138.gif pics\curvi_angles_after.png
pics\create_group.png pics\straight_before.png
pics\edit_mesh_change_value_hyp.png pics\image102.gif
pics\length2d.png
pics\free_borders1.png pics\free_borders1.png
pics\add_triangle.png
pics\b-art_end_length.png
pics\a-creategroup.png pics\a-creategroup.png
pics\a-clipping2.png pics\a-startendlength.png
pics\a-transparency.png pics\a-patterntype.png
pics\diagonalinversion.png pics\extrusionalongaline2.png
pics\translation1.png pics\orientaation1.png
pics\unionoftwotriangles.png
image96.jpg image96.jpg
pics\sewing2.png pics\sewing2.png
image119.gif image119.gif
@ -231,15 +247,12 @@ image52.jpg
image82.gif image82.gif
image71.gif image71.gif
image30.jpg image30.jpg
pics\extrusion1.png pics\lengthnearvertex.png
pics\distributionwithanalyticdensity.png pics\straight_after.png
pics\image139.gif pics\cut_groups1.png
pics\rotation1.png pics\uniting_a_set_of_triangles1.png
pics\a-createpolyhedralvolume.png pics\b-erage_length.png
pics\a-patterntype.png pics\removeelements.png
pics\orientaation1.png
pics\translation2.png
pics\cutgroups.png
image97.jpg image97.jpg
pics\sewing3.png pics\sewing3.png
image86.jpg image86.jpg
@ -247,33 +260,38 @@ image50.gif
image94.gif image94.gif
image83.gif image83.gif
image31.jpg image31.jpg
pics\circle_angles_after.png pics\aqt.png
pics\circle_simple_before.png pics\distributionwithanalyticdensity.png
pics\curvi_angles_after.png pics\meshexportmesh.png
pics\graduatedaxes1.png
pics\image107.gif
pics\automaticlength.png
pics\image27.gif pics\image27.gif
pics\add_polyhedron.png pics\cut_groups2.png
pics\add_edge.png pics\edit_mesh_change_value_hyp.png
pics\rotation2.png pics\add_node.png
pics\b-ithmetic1d.png pics\uniting_a_set_of_triangles2.png
pics\max_el_area.png
image10.jpg image10.jpg
pics\a-maxelarea.png pics\a-filteronedges.png
pics\revolution1.png
pics\addhexahedron.png pics\addhexahedron.png
pics\addtetrahedron.png pics\addtriangle.png
image5.jpg pics\editgroup.png
pics\sewing4.png pics\sewing4.png
image95.gif image95.gif
image76.jpg image76.jpg
image84.gif image84.gif
image32.jpg image32.jpg
image40.gif image40.gif
pics\curvi_simple_before.png i_blue.jpg
pics\image108.gif image160.gif
pics\aqt.png pics\number_of_layers.png
pics\distributionwithtabledensity.png pics\netgen2d.png
pics\smoothing.png pics\mesh_for_extr_along_path.png
pics\meshtrianglemergeelem1.png
pics\image138.gif
pics\cut_groups3.png
pics\revolution2.png
pics\renumberelements.png
pics\intersectgroups.png
image88.jpg image88.jpg
image30.gif image30.gif
image96.gif image96.gif
@ -282,18 +300,13 @@ image74.gif
image63.gif image63.gif
image22.jpg image22.jpg
image41.gif image41.gif
pics\edge_wire_3d_before.png image161.gif
pics\image109.gif pics\createmesh-inv.png
pics\meshimportmesh.png pics\image139.gif
pics\deletegroups.png pics\b-art_end_length.png
pics\editing_groups1.png pics\b-mberofsegments.png
pics\uniting_two_triangles1.png pics\b-flection1d.png
image7.jpg pics\a-unionoftriangles.png
pics\a-averagelength.png
pics\a-patterntype1.png
pics\extrusionalongaline1.png
pics\movenodes.png
pics\rotation.png
image56.jpg image56.jpg
image53.gif image53.gif
image20.gif image20.gif
@ -301,43 +314,54 @@ image97.gif
image78.jpg image78.jpg
image64.gif image64.gif
image23.jpg image23.jpg
pics\edge_wire_after.png pics\buildcompound.png
pics\edge_wire_before.png pics\projection_3d.png
image151.gif image151.gif
pics\cut_groups1.png pics\selectionfilterlibrary.png
pics\editing_groups2.png pics\intersect_groups1.png
pics\uniting_two_triangles2.png pics\create_group.png
pics\a-unionoftriangles.png pics\add_triangle.png
pics\a-arithmetic1d.png pics\add_edge.png
pics\extrusionalongaline2.png pics\rotation1.png
pics\merging_nodes1.png
pics\translation1.png
pics\cutgroups.png
image79.jpg image79.jpg
image98.gif image98.gif
image32.gif image32.gif
pics\projection_2d.png
pics\advanced_mesh_infos.png
pics\image108.gif
pics\image91.gif pics\image91.gif
image152.gif image152.gif
pics\cut_groups2.png pics\automaticlength.png
pics\intersect_groups2.png
image130.gif image130.gif
pics\max_el_area.png pics\rotation2.png
pics\merging_nodes2.png
pics\a-cuttingofquadrangles.png
pics\a-transparency.png
pics\a-viewgeneral.png pics\a-viewgeneral.png
pics\revolution1.png pics\smoothing.png
pics\addtriangle.png pics\translation2.png
image99.gif image99.gif
image55.gif image55.gif
image88.gif image88.gif
image36.jpg image36.jpg
image33.gif image33.gif
image25.jpg image25.jpg
i_blue.jpg pics\projection_1d.png
pics\view_rotation_point.png
image153.gif image153.gif
pics\image109.gif
image15.jpg image15.jpg
image142.gif image142.gif
pics\cut_groups3.png pics\intersect_groups3.png
image131.gif image131.gif
pics\add_quadrangle.png pics\edit_mesh1.png
pics\uniting_a_set_of_triangles1.png pics\b-ithmetic1d.png
pics\a-deflection1d.png pics\mergenodes.png
pics\revolution2.png pics\rotation.png
pics\unionoftwotriangles.png
pics\addnode.png pics\addnode.png
image120.gif image120.gif
image56.gif image56.gif
@ -346,13 +370,18 @@ image67.gif
image34.gif image34.gif
pics\convert.png pics\convert.png
image154.gif image154.gif
pics\edge_wire_3d_after.png
pics\graduatedaxes1.png
pics\length-crit.png
image143.gif image143.gif
pics\editing_groups1.png
image132.gif image132.gif
pics\edit_mesh1.png pics\a-maxelvolume.png
pics\remove_elements1.png pics\a-averagelength.png
pics\uniting_a_set_of_triangles2.png pics\movenodes.png
pics\mergenodes.png pics\removenodes.png
pics\symmetry1.png pics\addtetrahedron.png
pics\uniongroups.png
image121.gif image121.gif
image79.gif image79.gif
image38.jpg image38.jpg
@ -360,107 +389,99 @@ image46.gif
image35.gif image35.gif
image27.jpg image27.jpg
image24.gif image24.gif
note1.gif
pics\distribution_of_layers.png
image155.gif image155.gif
pics\mesh_for_extr_along_path.png pics\edge_wire_after.png
pics\createmesh-inv2.png pics\edge_wire_before.png
image144.gif image144.gif
pics\intersect_groups1.png pics\deletegroups.png
pics\editing_groups2.png
image133.gif image133.gif
pics\add_polygone.png pics\add_polyhedron.png
pics\remove_elements2.png pics\addedge.png
pics\a-maxelvolume.png pics\creategroup.png
pics\symmetry2.png
image122.gif image122.gif
image58.gif image58.gif
image36.gif image36.gif
image25.gif image25.gif
note1.gif
image156.gif image156.gif
pics\edge_wire_3d_after.png pics\circle_simple_after.png
pics\createmesh-inv3.png
image145.gif image145.gif
pics\intersect_groups2.png
image134.gif image134.gif
pics\b-mesh_infos.png pics\edit_mesh_remove_hyp.png
pics\symmetry3.png pics\a-patterntype1.png
pics\addedge.png
image123.gif image123.gif
image101.gif image101.gif
image37.gif image37.gif
pics\straight_after.png image157.gif
pics\image96.gif pics\image96.gif
image146.gif image146.gif
pics\intersect_groups3.png pics\meshimportmesh.png
image135.gif image135.gif
pics\b-erage_length.png pics\uniting_two_triangles1.png
pics\a-standmeshinfo.png
pics\a-nbsegments1.png pics\a-nbsegments1.png
pics\patternmapping1.png pics\a-arithmetic1d.png
pics\symmetry1.png
image90.jpg image90.jpg
image124.gif image124.gif
image49.gif image49.gif
pics\exemple.gif
image38.gif image38.gif
pics\image100.gif pics\set_rotation_point_dialog1.png
pics\image97.gif pics\image97.gif
pics\length-crit.png
image147.gif image147.gif
pics\union_groups1.png
image136.gif image136.gif
pics\free_edges.png
pics\uniting_two_triangles2.png
pics\a-nbsegments2.png pics\a-nbsegments2.png
pics\a-startendlength.png pics\symmetry2.png
pics\patternmapping2.png
pics\removeelements.png
pics\removenodes.png
pics\uniongroups.png
image125.gif image125.gif
image103.gif image103.gif
pics\exemple.gif
image39.gif image39.gif
image28.gif image28.gif
pics\advanced_mesh_infos.png image159.gif
pics\set_rotation_point_dialog2.png
pics\circle_angles_after.png
pics\createmesh-inv2.png
pics\image98.gif pics\image98.gif
pics\mergeelems.png
image148.gif image148.gif
pics\meshexportmesh.png
pics\image21.gif pics\image21.gif
pics\union_groups1.png pics\union_groups2.png
image137.gif image137.gif
pics\free_edges.png pics\add_quadrangle.png
pics\creategroup.png pics\remove_elements1.png
pics\a-createpolyhedralvolume.png
pics\a-clipping2.png
pics\a-deflection1d.png
pics\diagonalinversion.png
pics\symmetry3.png
pics\renumbernodes.png
image92.jpg image92.jpg
image126.gif image126.gif
image18.gif image18.gif
image70.jpg image70.jpg
pics\straight_before.png pics\circle_simple_before.png
pics\createmesh-inv.png pics\edge_wire_3d_before.png
pics\image102.gif pics\curvi_simple_before.png
pics\createmesh-inv3.png
pics\image99.gif pics\image99.gif
pics\image77.gif pics\image77.gif
pics\meshtrianglemergeelem1.png pics\union_groups3.png
pics\mergeelems.png pics\add_polygone.png
pics\union_groups2.png pics\remove_elements2.png
pics\length2d.png pics\remove_nodes1.png
pics\renumbernodes.png pics\smoothing1.png
pics\a-standmeshinfo.png
pics\addpolygon.png
image5.jpg
image127.gif image127.gif
image93.jpg image93.jpg
image105.gif image105.gif
image19.gif image19.gif
image71.jpg image71.jpg
pics\image89.gif
pics\image78.gif
pics\image23.gif
pics\selectionfilterlibrary.png
pics\union_groups3.png
pics\edit_mesh_remove_hyp.png
pics\remove_nodes1.png
pics\merging_nodes1.png
pics\moving_nodes1.png
pics\smoothing1.png
pics\a-filteronedges.png
pics\renumberelements.png
pics\addpolygon.png
image94.jpg
image106.gif
image91.gif
image80.gif
index.ppf index.ppf
ehlpdhtm.js ehlpdhtm.js
default_ns.css default_ns.css
@ -482,6 +503,7 @@ whgdata\whlstt6.htm
whgdata\whlstt7.htm whgdata\whlstt7.htm
whgdata\whlstt8.htm whgdata\whlstt8.htm
whgdata\whlstt9.htm whgdata\whlstt9.htm
whgdata\whlstt10.htm
whgdata\whlsti0.htm whgdata\whlsti0.htm
whgdata\whlstfl0.htm whgdata\whlstfl0.htm
whgdata\whlstfl1.htm whgdata\whlstfl1.htm
@ -509,6 +531,7 @@ whgdata\whlstfl22.htm
whgdata\whlstfl23.htm whgdata\whlstfl23.htm
whgdata\whlstfl24.htm whgdata\whlstfl24.htm
whgdata\whlstfl25.htm whgdata\whlstfl25.htm
whgdata\whlstfl26.htm
whgdata\whlstf0.htm whgdata\whlstf0.htm
whgdata\whlstf1.htm whgdata\whlstf1.htm
whgdata\whlstf2.htm whgdata\whlstf2.htm

View File

@ -17,6 +17,7 @@ aTE("Adding Quadratic Nodes and Elements","adding_quadratic_nodes_and_elements.h
aTE("Aspect ratio 3D","aspect_ratio_3d.htm"); aTE("Aspect ratio 3D","aspect_ratio_3d.htm");
aTE("Borders at multi-connection","borders_at_multi-connection.htm"); aTE("Borders at multi-connection","borders_at_multi-connection.htm");
aTE("Borders at multiconnection 2D","borders_at_multiconnection_2d.htm"); aTE("Borders at multiconnection 2D","borders_at_multiconnection_2d.htm");
aTE("Building Compounds","building_compounds.htm");
aTE("Clipping","clipping.htm"); aTE("Clipping","clipping.htm");
aTE("Constructing Meshes","constructing_meshes.htm"); aTE("Constructing Meshes","constructing_meshes.htm");
aTE("Convert to/from Quadratic Mesh","convert_to_from_quadratic_mesh.htm"); aTE("Convert to/from Quadratic Mesh","convert_to_from_quadratic_mesh.htm");
@ -73,6 +74,7 @@ aTE("Grouping Elements","grouping_elements.htm");
aTE("Length","length.htm"); aTE("Length","length.htm");
aTE("Merge Elements","merge_elements.htm"); aTE("Merge Elements","merge_elements.htm");
aTE("mesh","mesh.htm"); aTE("mesh","mesh.htm");
aTE("Mesh through point","mesh_through_point.htm");
aTE("Modifying Meshes","modifying_meshes.htm"); aTE("Modifying Meshes","modifying_meshes.htm");
aTE("SALOME - SMESH - v.version: Package smesh","namespacesmesh.html"); aTE("SALOME - SMESH - v.version: Package smesh","namespacesmesh.html");
aTE("Netgen 2D and 3D hypotheses","netgen_2d_and_3d_hypotheses.htm"); aTE("Netgen 2D and 3D hypotheses","netgen_2d_and_3d_hypotheses.htm");
@ -83,6 +85,7 @@ aTE("Projection Algorithms","projection_algorithms.htm");
aTE("Quality Controls","quality_controls.htm"); aTE("Quality Controls","quality_controls.htm");
aTE("Radial Prism","radial_prism.htm"); aTE("Radial Prism","radial_prism.htm");
aTE("Revolution","revolution.htm"); aTE("Revolution","revolution.htm");
aTE("Segments around Vertex Algorithm","segments_around_vertex_algorithm.htm");
aTE("Selection filter library","selection_filter_library.htm"); aTE("Selection filter library","selection_filter_library.htm");
aTE("smesh.py_introduction","smesh.py_introduction.htm"); aTE("smesh.py_introduction","smesh.py_introduction.htm");
aTE("Transforming Meshes","transforming_meshes.htm"); aTE("Transforming Meshes","transforming_meshes.htm");

File diff suppressed because it is too large Load Diff

View File

@ -8,18 +8,19 @@
<script language="javascript" src="whtdata.js"></script> <script language="javascript" src="whtdata.js"></script>
<script language="javascript"> <script language="javascript">
<!-- <!--
aTE(1,85,"MESH module"); aTE(1,87,"MESH module");
aTE(2,0,"Introduction to Mesh","mesh.htm"); aTE(2,0,"Introduction to Mesh","mesh.htm");
aTE(2,0,"Running MESH module","files/running_smesh_module.htm"); aTE(2,0,"Running MESH module","files/running_smesh_module.htm");
aTE(2,0,"Introduction to MESH module python interface","smesh.py_introduction.htm"); aTE(2,0,"Introduction to MESH module python interface","smesh.py_introduction.htm");
aTE(1,17,"Creating meshes"); aTE(1,19,"Creating meshes");
aTE(2,0,"About meshes","files/about_meshes.htm"); aTE(2,0,"About meshes","files/about_meshes.htm");
aTE(2,0,"Importing and exporting meshes","files/importing_and_exporting_meshes.htm"); aTE(2,0,"Importing and exporting meshes","files/importing_and_exporting_meshes.htm");
aTE(2,0,"Constructing meshes","files/constructing_meshes.htm"); aTE(2,0,"Constructing meshes","files/constructing_meshes.htm");
aTE(1,4,"Defining Algorithms"); aTE(1,5,"Defining Algorithms");
aTE(2,0,"Basic meshing algorithms","files/about_meshing_algorithms.htm"); aTE(2,0,"Basic meshing algorithms","files/about_meshing_algorithms.htm");
aTE(2,0,"Projection Algorithms","projection_algorithms.htm"); aTE(2,0,"Projection Algorithms","projection_algorithms.htm");
aTE(2,0,"Radial Prism Algorithm","radial_prism.htm"); aTE(2,0,"Radial Prism Algorithm","radial_prism.htm");
aTE(2,0,"Segments around Vertex Algorithm","segments_around_vertex_algorithm.htm");
aTE(2,0,"Prism 3D Algorithm","prism_3d_algorithm.htm"); aTE(2,0,"Prism 3D Algorithm","prism_3d_algorithm.htm");
aTE(1,6,"Defining hypotheses"); aTE(1,6,"Defining hypotheses");
aTE(2,0,"About Hypotheses","files/about_hypotheses.htm"); aTE(2,0,"About Hypotheses","files/about_hypotheses.htm");
@ -29,10 +30,10 @@
aTE(2,0,"Netgen 2D and 3D hypotheses","netgen_2d_and_3d_hypotheses.htm"); aTE(2,0,"Netgen 2D and 3D hypotheses","netgen_2d_and_3d_hypotheses.htm");
aTE(2,0,"Additional Hypotheses","files/non_conform_mesh_allowed_hypothesis.htm"); aTE(2,0,"Additional Hypotheses","files/non_conform_mesh_allowed_hypothesis.htm");
aTE(2,0,"Constructing submeshes","files/constructing_submeshes.htm"); aTE(2,0,"Constructing submeshes","files/constructing_submeshes.htm");
aTE(2,0,"Building Compounds","building_compounds.htm");
aTE(2,0,"Editing Meshes","files/reassigning_hypotheses_and_algorithms.htm"); aTE(2,0,"Editing Meshes","files/reassigning_hypotheses_and_algorithms.htm");
aTE(1,8,"Viewing meshes"); aTE(1,7,"Viewing meshes");
aTE(2,0,"Viewing meshes","about_viewing_meshes.htm"); aTE(2,0,"Viewing meshes","about_viewing_meshes.htm");
aTE(2,0,"VTK 3D Viewer","files/vtk_3d_viewer.htm");
aTE(2,0,"Mesh infos","files/viewing_mesh_info.htm"); aTE(2,0,"Mesh infos","files/viewing_mesh_info.htm");
aTE(2,0,"Numbering","files/displaying_nodes_numbers.htm"); aTE(2,0,"Numbering","files/displaying_nodes_numbers.htm");
aTE(2,0,"Display Mode","presentation.htm"); aTE(2,0,"Display Mode","presentation.htm");
@ -62,7 +63,7 @@
aTE(2,0,"Constructing groups of specific elements","files/constructing_groups_of_specific_elements.htm"); aTE(2,0,"Constructing groups of specific elements","files/constructing_groups_of_specific_elements.htm");
aTE(2,0,"Deleting Groups","deleting_groups.htm"); aTE(2,0,"Deleting Groups","deleting_groups.htm");
aTE(2,0,"Selection filter library","selection_filter_library.htm"); aTE(2,0,"Selection filter library","selection_filter_library.htm");
aTE(1,23,"Modifying meshes"); aTE(1,24,"Modifying meshes");
aTE(2,0,"Adding nodes and elements","files/adding_nodes_and_elements.htm"); aTE(2,0,"Adding nodes and elements","files/adding_nodes_and_elements.htm");
aTE(2,0,"Adding quadratic elements","adding_quadratic_nodes_and_elements.htm"); aTE(2,0,"Adding quadratic elements","adding_quadratic_nodes_and_elements.htm");
aTE(2,0,"Removing nodes and elements","files/removing_nodes_and_elements.htm"); aTE(2,0,"Removing nodes and elements","files/removing_nodes_and_elements.htm");
@ -75,6 +76,7 @@
aTE(2,0,"Merging nodes","files/merging_nodes.htm"); aTE(2,0,"Merging nodes","files/merging_nodes.htm");
aTE(2,0,"Merging Elements","merge_elements.htm"); aTE(2,0,"Merging Elements","merge_elements.htm");
aTE(2,0,"Moving nodes","files/displacing_nodes.htm"); aTE(2,0,"Moving nodes","files/displacing_nodes.htm");
aTE(2,0,"Mesh through point","mesh_through_point.htm");
aTE(2,0,"Diagonal inversion of elements","files/diagonal_iversion_of_elements.htm"); aTE(2,0,"Diagonal inversion of elements","files/diagonal_iversion_of_elements.htm");
aTE(2,0,"Uniting two triangles","files/uniting_two_triangles.htm"); aTE(2,0,"Uniting two triangles","files/uniting_two_triangles.htm");
aTE(2,0,"Uniting a set of triangles","files/uniting_a_set_of_triangles.htm"); aTE(2,0,"Uniting a set of triangles","files/uniting_a_set_of_triangles.htm");
@ -86,8 +88,8 @@
aTE(2,0,"Revolution","revolution.htm"); aTE(2,0,"Revolution","revolution.htm");
aTE(2,0,"Pattern mapping","pattern_mapping.htm"); aTE(2,0,"Pattern mapping","pattern_mapping.htm");
aTE(2,0,"Convert to/from Quadratic Mesh","convert_to_from_quadratic_mesh.htm"); aTE(2,0,"Convert to/from Quadratic Mesh","convert_to_from_quadratic_mesh.htm");
aTE(2,0,"Python interface smesh.py" ,"smeshpy_doc/namespacesmesh.html"); aTE(2,0,"Python interface smesh.py", "smeshpy_doc/namespacesmesh.html");
aTE(1,7,"TUI Scripts"); aTE(1,7,"TUI Scripts");
aTE(2,0,"Creating Meshes","constructing_meshes.htm"); aTE(2,0,"Creating Meshes","constructing_meshes.htm");
aTE(2,0,"Viewing Meshes","viewing_meshes.htm"); aTE(2,0,"Viewing Meshes","viewing_meshes.htm");
aTE(2,0,"Defining Hypotheses","defining_hypotheses_tui.htm"); aTE(2,0,"Defining Hypotheses","defining_hypotheses_tui.htm");

View File

@ -5,6 +5,7 @@
<topic name="Aspect ratio 3D" url="aspect_ratio_3d.htm" /> <topic name="Aspect ratio 3D" url="aspect_ratio_3d.htm" />
<topic name="Borders at multi-connection" url="borders_at_multi-connection.htm" /> <topic name="Borders at multi-connection" url="borders_at_multi-connection.htm" />
<topic name="Borders at multiconnection 2D" url="borders_at_multiconnection_2d.htm" /> <topic name="Borders at multiconnection 2D" url="borders_at_multiconnection_2d.htm" />
<topic name="Building Compounds" url="building_compounds.htm" />
<topic name="Clipping" url="clipping.htm" /> <topic name="Clipping" url="clipping.htm" />
<topic name="Constructing Meshes" url="constructing_meshes.htm" /> <topic name="Constructing Meshes" url="constructing_meshes.htm" />
<topic name="Convert to/from Quadratic Mesh" url="convert_to_from_quadratic_mesh.htm" /> <topic name="Convert to/from Quadratic Mesh" url="convert_to_from_quadratic_mesh.htm" />
@ -61,6 +62,7 @@
<topic name="Length" url="length.htm" /> <topic name="Length" url="length.htm" />
<topic name="Merge Elements" url="merge_elements.htm" /> <topic name="Merge Elements" url="merge_elements.htm" />
<topic name="mesh" url="mesh.htm" /> <topic name="mesh" url="mesh.htm" />
<topic name="Mesh through point" url="mesh_through_point.htm" />
<topic name="Modifying Meshes" url="modifying_meshes.htm" /> <topic name="Modifying Meshes" url="modifying_meshes.htm" />
<topic name="SALOME - SMESH - v.version: Package smesh" url="namespacesmesh.html" /> <topic name="SALOME - SMESH - v.version: Package smesh" url="namespacesmesh.html" />
<topic name="Netgen 2D and 3D hypotheses" url="netgen_2d_and_3d_hypotheses.htm" /> <topic name="Netgen 2D and 3D hypotheses" url="netgen_2d_and_3d_hypotheses.htm" />
@ -71,6 +73,7 @@
<topic name="Quality Controls" url="quality_controls.htm" /> <topic name="Quality Controls" url="quality_controls.htm" />
<topic name="Radial Prism" url="radial_prism.htm" /> <topic name="Radial Prism" url="radial_prism.htm" />
<topic name="Revolution" url="revolution.htm" /> <topic name="Revolution" url="revolution.htm" />
<topic name="Segments around Vertex Algorithm" url="segments_around_vertex_algorithm.htm" />
<topic name="Selection filter library" url="selection_filter_library.htm" /> <topic name="Selection filter library" url="selection_filter_library.htm" />
<topic name="smesh.py_introduction" url="smesh.py_introduction.htm" /> <topic name="smesh.py_introduction" url="smesh.py_introduction.htm" />
<topic name="Transforming Meshes" url="transforming_meshes.htm" /> <topic name="Transforming Meshes" url="transforming_meshes.htm" />

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,7 @@
<item name="Basic meshing algorithms" url="files/about_meshing_algorithms.htm" /> <item name="Basic meshing algorithms" url="files/about_meshing_algorithms.htm" />
<item name="Projection Algorithms" url="projection_algorithms.htm" /> <item name="Projection Algorithms" url="projection_algorithms.htm" />
<item name="Radial Prism Algorithm" url="radial_prism.htm" /> <item name="Radial Prism Algorithm" url="radial_prism.htm" />
<item name="Segments around Vertex Algorithm" url="segments_around_vertex_algorithm.htm" />
<item name="Prism 3D Algorithm" url="prism_3d_algorithm.htm" /> <item name="Prism 3D Algorithm" url="prism_3d_algorithm.htm" />
</book> </book>
<book name="Defining hypotheses" > <book name="Defining hypotheses" >
@ -23,11 +24,11 @@
<item name="Additional Hypotheses" url="files/non_conform_mesh_allowed_hypothesis.htm" /> <item name="Additional Hypotheses" url="files/non_conform_mesh_allowed_hypothesis.htm" />
</book> </book>
<item name="Constructing submeshes" url="files/constructing_submeshes.htm" /> <item name="Constructing submeshes" url="files/constructing_submeshes.htm" />
<item name="Building Compounds" url="building_compounds.htm" />
<item name="Editing Meshes" url="files/reassigning_hypotheses_and_algorithms.htm" /> <item name="Editing Meshes" url="files/reassigning_hypotheses_and_algorithms.htm" />
</book> </book>
<book name="Viewing meshes" > <book name="Viewing meshes" >
<item name="Viewing meshes" url="about_viewing_meshes.htm" /> <item name="Viewing meshes" url="about_viewing_meshes.htm" />
<item name="VTK 3D Viewer" url="files/vtk_3d_viewer.htm" />
<item name="Mesh infos" url="files/viewing_mesh_info.htm" /> <item name="Mesh infos" url="files/viewing_mesh_info.htm" />
<item name="Numbering" url="files/displaying_nodes_numbers.htm" /> <item name="Numbering" url="files/displaying_nodes_numbers.htm" />
<item name="Display Mode" url="presentation.htm" /> <item name="Display Mode" url="presentation.htm" />
@ -74,6 +75,7 @@
<item name="Merging Elements" url="merge_elements.htm" /> <item name="Merging Elements" url="merge_elements.htm" />
</book> </book>
<item name="Moving nodes" url="files/displacing_nodes.htm" /> <item name="Moving nodes" url="files/displacing_nodes.htm" />
<item name="Mesh through point" url="mesh_through_point.htm" />
<item name="Diagonal inversion of elements" url="files/diagonal_iversion_of_elements.htm" /> <item name="Diagonal inversion of elements" url="files/diagonal_iversion_of_elements.htm" />
<item name="Uniting two triangles" url="files/uniting_two_triangles.htm" /> <item name="Uniting two triangles" url="files/uniting_two_triangles.htm" />
<item name="Uniting a set of triangles" url="files/uniting_a_set_of_triangles.htm" /> <item name="Uniting a set of triangles" url="files/uniting_a_set_of_triangles.htm" />
@ -87,7 +89,7 @@
<item name="Convert to/from Quadratic Mesh" url="convert_to_from_quadratic_mesh.htm" /> <item name="Convert to/from Quadratic Mesh" url="convert_to_from_quadratic_mesh.htm" />
</book> </book>
<item name="Python Interface smesh.py" url="smeshpy_doc/namespacesmesh.html" /> <item name="Python Interface smesh.py" url="smeshpy_doc/namespacesmesh.html" />
<book name="TUI Scripts" > <book name="TUI Scripts" >
<item name="Creating Meshes" url="constructing_meshes.htm" /> <item name="Creating Meshes" url="constructing_meshes.htm" />
<item name="Viewing Meshes" url="viewing_meshes.htm" /> <item name="Viewing Meshes" url="viewing_meshes.htm" />
<item name="Defining Hypotheses" url="defining_hypotheses_tui.htm" /> <item name="Defining Hypotheses" url="defining_hypotheses_tui.htm" />

View File

@ -33,7 +33,8 @@ BASEIDL_FILES = \
SMESH_BasicHypothesis.idl \ SMESH_BasicHypothesis.idl \
SMESH_Filter.idl \ SMESH_Filter.idl \
SMESH_Group.idl \ SMESH_Group.idl \
SMESH_Pattern.idl SMESH_Pattern.idl \
SMESH_MeshEditor.idl
EXTRA_DIST+= $(BASEIDL_FILES) EXTRA_DIST+= $(BASEIDL_FILES)
@ -51,7 +52,8 @@ nodist_libSalomeIDLSMESH_la_SOURCES = \
SMESH_BasicHypothesisSK.cc \ SMESH_BasicHypothesisSK.cc \
SMESH_FilterSK.cc \ SMESH_FilterSK.cc \
SMESH_GroupSK.cc \ SMESH_GroupSK.cc \
SMESH_PatternSK.cc SMESH_PatternSK.cc \
SMESH_MeshEditorSK.cc
# header files must be exported: other modules have to use this library # header files must be exported: other modules have to use this library
nodist_salomeinclude_HEADERS= $(BASEIDL_FILES:%.idl=%.hh) nodist_salomeinclude_HEADERS= $(BASEIDL_FILES:%.idl=%.hh)

View File

@ -507,6 +507,32 @@ module StdMeshers
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
}; };
/*!
* interface of "SegmentLengthAroundVertex" hypothesis.
* This hypothesis specifies length of segments adjacent to the vertex the
* hypothesis is assigned to
*/
interface StdMeshers_SegmentLengthAroundVertex : SMESH::SMESH_Hypothesis
{
/*!
* Sets <length> parameter value
*/
void SetLength(in double length)
raises (SALOME::SALOME_Exception);
/*!
* Returns <length> parameter value
*/
double GetLength();
};
/*!
* StdMeshers_SegmentAroundVertex_0D: interface of "SegmentAroundVertex" algorithm
*/
interface StdMeshers_SegmentAroundVertex_0D : SMESH::SMESH_0D_Algo
{
};
/*! /*!
* StdMeshers_Regular_1D: interface of "Wire discretisation" algorithm * StdMeshers_Regular_1D: interface of "Wire discretisation" algorithm
*/ */
@ -514,6 +540,13 @@ module StdMeshers
{ {
}; };
/*!
* StdMeshers_CompositeSegment_1D: interface of "Composite side discretisation" algorithm
*/
interface StdMeshers_CompositeSegment_1D : SMESH::SMESH_1D_Algo
{
};
/*! /*!
* StdMeshers_MEFISTO_2D: interface of "Triangle (Mefisto)" algorithm * StdMeshers_MEFISTO_2D: interface of "Triangle (Mefisto)" algorithm
*/ */
@ -536,7 +569,7 @@ module StdMeshers
}; };
/*! /*!
* StdMeshers_Prism_3D: interface of "Prism 3D" algorithm * StdMeshers_Prism_3D: interface of "3D extrusion" algorithm
*/ */
interface StdMeshers_Prism_3D : SMESH::SMESH_3D_Algo interface StdMeshers_Prism_3D : SMESH::SMESH_3D_Algo
{ {

View File

@ -55,6 +55,7 @@ module SMESH
FT_BelongToGeom, FT_BelongToGeom,
FT_BelongToPlane, FT_BelongToPlane,
FT_BelongToCylinder, FT_BelongToCylinder,
FT_BelongToGenSurface,
FT_LyingOnGeom, FT_LyingOnGeom,
FT_RangeOfIds, FT_RangeOfIds,
FT_BadOrientedVolume, FT_BadOrientedVolume,
@ -158,22 +159,28 @@ module SMESH
/*! /*!
* Logical functor (predicate) "Belong To Surface". * Logical functor (predicate) "Belong To Surface".
* Base interface for "belong to plane" and "belong to cylinder interfaces" * Base interface for "belong to plane" and "belong to cylinder"
* and "Belong To Generic Surface" interfaces
*/ */
interface BelongToSurface: Predicate interface BelongToSurface: Predicate
{ {
void SetTolerance( in double theToler ); void SetTolerance( in double theToler );
double GetTolerance(); double GetTolerance();
void SetShapeName( in string theName, in ElementType theType ); void SetShapeName( in string theName, in ElementType theType );
void SetShape( in string theID, in string theName, in ElementType theType ); void SetShape( in string theID, in string theName, in ElementType theType );
string GetShapeName(); string GetShapeName();
string GetShapeID(); string GetShapeID();
/*!
* Limit surface extent to bounding box of boundaries (edges)
* in surface parametric space. Boundaries are ignored by default
*/
void SetUseBoundaries( in boolean theUseBndRestrictions );
boolean GetUseBoundaries();
}; };
/*! /*!
* Logical functor (predicate) "Belong To Plane". * Logical functor (predicate) "Belong To Plane".
* Verify whether mesh element lie in pointed Geom planar object * Verify whether mesh element lie on pointed Geom planar object
*/ */
interface BelongToPlane: BelongToSurface interface BelongToPlane: BelongToSurface
{ {
@ -181,14 +188,23 @@ module SMESH
}; };
/*! /*!
* Logical functor (predicate) "Belong To Culinder". * Logical functor (predicate) "Belong To Cylinder".
* Verify whether mesh element lie in pointed Geom cylindrical object * Verify whether mesh element lie on pointed Geom cylindrical object
*/ */
interface BelongToCylinder: BelongToSurface interface BelongToCylinder: BelongToSurface
{ {
void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType ); void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
}; };
/*!
* Logical functor (predicate) "Belong To Generic Surface".
* Verify whether mesh element lie in pointed Geom cylindrical object
*/
interface BelongToGenSurface: BelongToSurface
{
void SetSurface( in GEOM::GEOM_Object theGeom, in ElementType theType );
};
/*! /*!
* Logical functor (predicate) "Lying On Geometry". * Logical functor (predicate) "Lying On Geometry".
* Verify whether mesh element or node lying or partially lying on the pointed Geom Object * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
@ -391,6 +407,7 @@ module SMESH
BelongToGeom CreateBelongToGeom(); BelongToGeom CreateBelongToGeom();
BelongToPlane CreateBelongToPlane(); BelongToPlane CreateBelongToPlane();
BelongToCylinder CreateBelongToCylinder(); BelongToCylinder CreateBelongToCylinder();
BelongToGenSurface CreateBelongToGenSurface();
LyingOnGeom CreateLyingOnGeom(); LyingOnGeom CreateLyingOnGeom();

View File

@ -38,20 +38,48 @@
module SMESH module SMESH
{ {
typedef sequence<GEOM::GEOM_Object> object_array; typedef sequence<GEOM::GEOM_Object> object_array;
typedef sequence<SMESH_Mesh> mesh_array; typedef sequence<SMESH_Mesh> mesh_array;
interface FilterManager; interface FilterManager;
interface SMESH_Pattern; interface SMESH_Pattern;
enum AlgoStateErrorName { MISSING_ALGO, MISSING_HYPO, NOT_CONFORM_MESH, BAD_PARAM_VALUE }; /*!
struct AlgoStateError { * Hypothesis definintion error
AlgoStateErrorName name; */
struct AlgoStateError
{
Hypothesis_Status state;
string algoName; string algoName;
long algoDim; long algoDim;
boolean isGlobalAlgo; boolean isGlobalAlgo;
}; };
typedef sequence<AlgoStateError> algo_error_array; typedef sequence<AlgoStateError> algo_error_array;
/*!
* Mesh computation error
*/
enum ComputeErrorName
{
COMPERR_OK ,
COMPERR_BAD_INPUT_MESH, // wrong mesh on lower submesh
COMPERR_STD_EXCEPTION , // some std exception raised
COMPERR_OCC_EXCEPTION , // OCC exception raised
COMPERR_SLM_EXCEPTION , // SALOME exception raised
COMPERR_EXCEPTION , // other exception raised
COMPERR_MEMORY_PB , // memory allocation problem
COMPERR_ALGO_FAILED , // computation failed
COMPERR_BAD_SHAPE // bad geometry
};
struct ComputeError
{
short code; // ComputeErrorName or, if negative, algo specific code
string comment; // textual problem description
string algoName;
short subShapeID; // id of subshape of a shape to mesh
};
typedef sequence<ComputeError> compute_error_array;
interface SMESH_Gen : Engines::Component, SALOMEDS::Driver interface SMESH_Gen : Engines::Component, SALOMEDS::Driver
{ {
@ -169,6 +197,14 @@ module SMESH
in GEOM::GEOM_Object theSubObject ) in GEOM::GEOM_Object theSubObject )
raises ( SALOME::SALOME_Exception ); raises ( SALOME::SALOME_Exception );
/*!
* Return errors of mesh computation
* compute_error_array is empty if everything is OK
*/
compute_error_array GetComputeErrors( in SMESH_Mesh theMesh,
in GEOM::GEOM_Object theSubObject )
raises ( SALOME::SALOME_Exception );
/*! /*!
* Return indeces of faces, edges and vertices of given subshapes * Return indeces of faces, edges and vertices of given subshapes
* within theMainObject * within theMainObject
@ -195,6 +231,19 @@ module SMESH
in long theElementID) in long theElementID)
raises ( SALOME::SALOME_Exception ); raises ( SALOME::SALOME_Exception );
/*!
* Concatenate the given meshes into one mesh.
* Union groups with the same name and type if
* theUniteIdenticalGroups flag is true.
* Merge coincident nodes and elements if
* theMergeNodesAndElements flag is true.
*/
SMESH_Mesh Concatenate(in mesh_array theMeshesArray,
in boolean theUniteIdenticalGroups,
in boolean theMergeNodesAndElements,
in double theMergeTolerance)
raises ( SALOME::SALOME_Exception );
}; };
}; };

View File

@ -33,6 +33,7 @@ module SMESH
{ {
enum Dimension enum Dimension
{ {
DIM_0D,
DIM_1D, DIM_1D,
DIM_2D, DIM_2D,
DIM_3D DIM_3D
@ -72,6 +73,13 @@ module SMESH
}; };
interface SMESH_0D_Algo : SMESH_Algo
{
/*!
*
*/
};
interface SMESH_1D_Algo : SMESH_Algo interface SMESH_1D_Algo : SMESH_Algo
{ {
/*! /*!

View File

@ -38,9 +38,9 @@ module SMESH
interface SMESH_GroupBase; interface SMESH_GroupBase;
typedef sequence<SMESH_GroupBase> ListOfGroups; typedef sequence<SMESH_GroupBase> ListOfGroups;
typedef sequence<double> double_array ; typedef sequence<double > double_array ;
typedef sequence<long> long_array ; typedef sequence<long > long_array ;
typedef sequence<string> string_array ; typedef sequence<string > string_array ;
typedef sequence<long_array> array_of_long_array ; typedef sequence<long_array> array_of_long_array ;
enum log_command enum log_command
@ -81,6 +81,9 @@ module SMESH
struct PointStruct { double x; struct PointStruct { double x;
double y; double y;
double z; } ; double z; } ;
typedef sequence<PointStruct> nodes_array;
struct DirStruct { PointStruct PS ; } ; // analog to Occ Direction struct DirStruct { PointStruct PS ; } ; // analog to Occ Direction
struct AxisStruct { double x; struct AxisStruct { double x;
@ -121,6 +124,8 @@ module SMESH
HYP_MISSING, // algo misses a hypothesis HYP_MISSING, // algo misses a hypothesis
HYP_CONCURENT, // several applicable hypotheses HYP_CONCURENT, // several applicable hypotheses
HYP_BAD_PARAMETER,// hypothesis has a bad parameter value HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
HYP_HIDDEN_ALGO, // an algo is hidden by an upper dim algo generating all-dim elements
HYP_HIDING_ALGO, // an algo hides lower dim algos by generating all-dim elements
HYP_UNKNOWN_FATAL,// --- all statuses below should be considered as fatal HYP_UNKNOWN_FATAL,// --- all statuses below should be considered as fatal
// for Add/RemoveHypothesis operations // for Add/RemoveHypothesis operations
HYP_INCOMPATIBLE, // hypothesis does not fit algo HYP_INCOMPATIBLE, // hypothesis does not fit algo
@ -178,11 +183,19 @@ module SMESH
interface SMESH_MeshEditor; interface SMESH_MeshEditor;
interface SMESH_Mesh : SALOME::GenericObj, SMESH_IDSource interface SMESH_Mesh : SALOME::GenericObj, SMESH_IDSource
{ {
///*! /*!
// * Associate a Shape to a Mesh created with NewEmpty * Return true if there is a geometry to be meshed
// */ */
//boolean SetMesh(in GEOM::GEOM_Object anObject) boolean HasShapeToMesh()
// raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*!
* Get geom shape to mesh. A result sould not be nil. Use HasShapeToMesh()
* to know if a returned shape
*/
GEOM::GEOM_Object GetShapeToMesh()
raises (SALOME::SALOME_Exception);
/*! /*!
* Get the subMesh object associated to a subShape. The subMesh object * Get the subMesh object associated to a subShape. The subMesh object
@ -193,24 +206,13 @@ module SMESH
SMESH_subMesh GetSubMesh(in GEOM::GEOM_Object aSubObject, in string name) SMESH_subMesh GetSubMesh(in GEOM::GEOM_Object aSubObject, in string name)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
///*!
// * Create a subMesh without reference to a subShape
// */
//SMESH_subMesh NewEmpty()
// raises (SALOME::SALOME_Exception);
/*!
* Get geom shape to mesh. A result may be nil
*/
GEOM::GEOM_Object GetShapeToMesh()
raises (SALOME::SALOME_Exception);
/*! /*!
* Remove a submesh * Remove a submesh
*/ */
void RemoveSubMesh(in SMESH_subMesh aSubMesh) void RemoveSubMesh(in SMESH_subMesh aSubMesh)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* Create a group * Create a group
*/ */
@ -349,6 +351,13 @@ module SMESH
SMESH_MeshEditor GetMeshEditor() SMESH_MeshEditor GetMeshEditor()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*!
* Return SMESH_MeshEditor that would not modify the mesh but
* fill MeshPreviewStruct
*/
SMESH_MeshEditor GetMeshEditPreviewer()
raises (SALOME::SALOME_Exception);
/*! Check group names for duplications. /*! Check group names for duplications.
* Consider maximum group name length stored in MED file. * Consider maximum group name length stored in MED file.
*/ */
@ -494,7 +503,7 @@ module SMESH
/*! /*!
* Get mesh pointer * Get mesh pointer
*/ */
long GetMeshPtr(); long long GetMeshPtr();
/*! /*!
* Get XYZ coordinates of node as list of double * Get XYZ coordinates of node as list of double
@ -642,348 +651,6 @@ module SMESH
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
}; };
/*!
* This interface makes modifications on the Mesh - removing elements and nodes etc.
*/
interface NumericalFunctor;
interface SMESH_MeshEditor
{
boolean RemoveElements(in long_array IDsOfElements);
boolean RemoveNodes(in long_array IDsOfNodes);
long AddNode(in double x, in double y, in double z);
/*!
* Create edge, either linear and quadratic (this is determed
* by number of given nodes).
* \param IdsOfNodes List of node IDs for creation of element.
* Needed order of nodes in this list corresponds to description
* of MED. This description is located by the following link:
* http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
*/
long AddEdge(in long_array IDsOfNodes);
/*!
* Create face, either linear and quadratic (this is determed
* by number of given nodes).
* \param IdsOfNodes List of node IDs for creation of element.
* Needed order of nodes in this list corresponds to description
* of MED. This description is located by the following link:
* http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
*/
long AddFace(in long_array IDsOfNodes);
long AddPolygonalFace(in long_array IdsOfNodes);
/*!
* Create volume, either linear and quadratic (this is determed
* by number of given nodes).
* \param IdsOfNodes List of node IDs for creation of element.
* Needed order of nodes in this list corresponds to description
* of MED. This description is located by the following link:
* http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
*/
long AddVolume(in long_array IDsOfNodes);
/*!
* Create volume of many faces, giving nodes for each face.
* \param IdsOfNodes List of node IDs for volume creation face by face.
* \param Quantities List of integer values, Quantities[i]
* gives quantity of nodes in face number i.
*/
long AddPolyhedralVolume (in long_array IdsOfNodes,
in long_array Quantities);
/*!
* Create volume of many faces, giving IDs of existing faces.
* \param IdsOfFaces List of face IDs for volume creation.
* \note The created volume will refer only to nodes
* of the given faces, not to the faces itself.
*/
long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces);
boolean MoveNode(in long NodeID, in double x, in double y, in double z);
boolean InverseDiag(in long NodeID1, in long NodeID2);
boolean DeleteDiag(in long NodeID1, in long NodeID2);
boolean Reorient(in long_array IDsOfElements);
boolean ReorientObject(in SMESH_IDSource theObject);
/*!
* \brief Fuse neighbour triangles into quadrangles.
* \param theElems The triangles to be fused.
* \param theCriterion Is used to choose a neighbour to fuse with.
* \param theMaxAngle Is a max angle between element normals at which fusion
* is still performed; theMaxAngle is mesured in radians.
* \return TRUE in case of success, FALSE otherwise.
*/
boolean TriToQuad (in long_array IDsOfElements,
in NumericalFunctor Criterion,
in double MaxAngle);
/*!
* \brief Fuse neighbour triangles into quadrangles.
*
* Behaves like the above method, taking list of elements from \a theObject
*/
boolean TriToQuadObject (in SMESH_IDSource theObject,
in NumericalFunctor Criterion,
in double MaxAngle);
/*!
* \brief Split quadrangles into triangles.
* \param theElems The faces to be splitted.
* \param theCriterion Is used to choose a diagonal for splitting.
* \return TRUE in case of success, FALSE otherwise.
*/
boolean QuadToTri (in long_array IDsOfElements,
in NumericalFunctor Criterion);
/*!
* \brief Split quadrangles into triangles.
*
* Behaves like the above method, taking list of elements from \a theObject
*/
boolean QuadToTriObject (in SMESH_IDSource theObject,
in NumericalFunctor Criterion);
/*!
* \brief Split quadrangles into triangles.
* \param theElems The faces to be splitted.
* \param the13Diag Is used to choose a diagonal for splitting.
* \return TRUE in case of success, FALSE otherwise.
*/
boolean SplitQuad (in long_array IDsOfElements,
in boolean Diag13);
/*!
* \brief Split quadrangles into triangles.
*
* Behaves like the above method, taking list of elements from \a theObject
*/
boolean SplitQuadObject (in SMESH_IDSource theObject,
in boolean Diag13);
/*!
* Find better splitting of the given quadrangle.
* \param IDOfQuad ID of the quadrangle to be splitted.
* \param Criterion A criterion to choose a diagonal for splitting.
* \return 1 if 1-3 diagonal is better, 2 if 2-4
* diagonal is better, 0 if error occurs.
*/
long BestSplit (in long IDOfQuad,
in NumericalFunctor Criterion);
enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
boolean Smooth(in long_array IDsOfElements,
in long_array IDsOfFixedNodes,
in long MaxNbOfIterations,
in double MaxAspectRatio,
in Smooth_Method Method);
boolean SmoothObject(in SMESH_IDSource theObject,
in long_array IDsOfFixedNodes,
in long MaxNbOfIterations,
in double MaxAspectRatio,
in Smooth_Method Method);
boolean SmoothParametric(in long_array IDsOfElements,
in long_array IDsOfFixedNodes,
in long MaxNbOfIterations,
in double MaxAspectRatio,
in Smooth_Method Method);
boolean SmoothParametricObject(in SMESH_IDSource theObject,
in long_array IDsOfFixedNodes,
in long MaxNbOfIterations,
in double MaxAspectRatio,
in Smooth_Method Method);
void ConvertToQuadratic(in boolean theForce3d);
boolean ConvertFromQuadratic();
void RenumberNodes();
void RenumberElements();
void RotationSweep(in long_array IDsOfElements,
in AxisStruct Axix,
in double AngleInRadians,
in long NbOfSteps,
in double Tolerance);
void RotationSweepObject(in SMESH_IDSource theObject,
in AxisStruct Axix,
in double AngleInRadians,
in long NbOfSteps,
in double Tolerance);
void ExtrusionSweep(in long_array IDsOfElements,
in DirStruct StepVector,
in long NbOfSteps);
/*!
* Generate new elements by extrusion of theElements
* by StepVector by NbOfSteps
* param ExtrFlags set flags for performing extrusion
* param SewTolerance - uses for comparing locations of nodes if flag
* EXTRUSION_FLAG_SEW is set
*/
void AdvancedExtrusion(in long_array IDsOfElements,
in DirStruct StepVector,
in long NbOfSteps,
in long ExtrFlags,
in double SewTolerance);
void ExtrusionSweepObject(in SMESH_IDSource theObject,
in DirStruct StepVector,
in long NbOfSteps);
void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
in DirStruct StepVector,
in long NbOfSteps);
void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
in DirStruct StepVector,
in long NbOfSteps);
enum Extrusion_Error {
EXTR_OK,
EXTR_NO_ELEMENTS,
EXTR_PATH_NOT_EDGE,
EXTR_BAD_PATH_SHAPE,
EXTR_BAD_STARTING_NODE,
EXTR_BAD_ANGLES_NUMBER,
EXTR_CANT_GET_TANGENT
};
Extrusion_Error ExtrusionAlongPath(in long_array IDsOfElements,
in SMESH_Mesh PathMesh,
in GEOM::GEOM_Object PathShape,
in long NodeStart,
in boolean HasAngles,
in double_array Angles,
in boolean HasRefPoint,
in PointStruct RefPoint);
Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource theObject,
in SMESH_Mesh PathMesh,
in GEOM::GEOM_Object PathShape,
in long NodeStart,
in boolean HasAngles,
in double_array Angles,
in boolean HasRefPoint,
in PointStruct RefPoint);
enum MirrorType { POINT, AXIS, PLANE };
void Mirror (in long_array IDsOfElements,
in AxisStruct Mirror,
in MirrorType theMirrorType,
in boolean Copy);
void MirrorObject (in SMESH_IDSource theObject,
in AxisStruct Mirror,
in MirrorType theMirrorType,
in boolean Copy);
void Translate (in long_array IDsOfElements,
in DirStruct Vector,
in boolean Copy);
void TranslateObject (in SMESH_IDSource theObject,
in DirStruct Vector,
in boolean Copy);
void Rotate (in long_array IDsOfElements,
in AxisStruct Axis,
in double AngleInRadians,
in boolean Copy);
void RotateObject (in SMESH_IDSource theObject,
in AxisStruct Axis,
in double AngleInRadians,
in boolean Copy);
void FindCoincidentNodes (in double Tolerance,
out array_of_long_array GroupsOfNodes);
void MergeNodes (in array_of_long_array GroupsOfNodes);
void MergeEqualElements();
enum Sew_Error {
SEW_OK,
SEW_BORDER1_NOT_FOUND,
SEW_BORDER2_NOT_FOUND,
SEW_BOTH_BORDERS_NOT_FOUND,
SEW_BAD_SIDE_NODES,
SEW_VOLUMES_TO_SPLIT,
// for SewSideElements() only:
SEW_DIFF_NB_OF_ELEMENTS,
SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
SEW_BAD_SIDE1_NODES,
SEW_BAD_SIDE2_NODES
};
Sew_Error SewFreeBorders (in long FirstNodeID1,
in long SecondNodeID1,
in long LastNodeID1,
in long FirstNodeID2,
in long SecondNodeID2,
in long LastNodeID2,
in boolean CreatePolygons,
in boolean CreatePolyedrs);
Sew_Error SewConformFreeBorders (in long FirstNodeID1,
in long SecondNodeID1,
in long LastNodeID1,
in long FirstNodeID2,
in long SecondNodeID2);
Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
in long SecondNodeIDOnFreeBorder,
in long LastNodeIDOnFreeBorder,
in long FirstNodeIDOnSide,
in long LastNodeIDOnSide,
in boolean CreatePolygons,
in boolean CreatePolyedrs);
Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
in long_array IDsOfSide2Elements,
in long NodeID1OfSide1ToMerge,
in long NodeID1OfSide2ToMerge,
in long NodeID2OfSide1ToMerge,
in long NodeID2OfSide2ToMerge);
/*!
* Set new nodes for given element.
* If number of nodes is not corresponded to type of
* element - returns false
*/
boolean ChangeElemNodes(in long ide, in long_array newIDs);
/*!
* If during last operation of MeshEditor some nodes were
* created this method returns list of it's IDs, if new nodes
* not creared - returns empty list
*/
long_array GetLastCreatedNodes();
/*!
* If during last operation of MeshEditor some elements were
* created this method returns list of it's IDs, if new elements
* not creared - returns empty list
*/
long_array GetLastCreatedElems();
};
}; };
#endif #endif

437
idl/SMESH_MeshEditor.idl Normal file
View File

@ -0,0 +1,437 @@
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : SMESH_MeshEditor.idl
// $Header$
#ifndef _SMESH_MESHEDITOR_IDL_
#define _SMESH_MESHEDITOR_IDL_
#include "SMESH_Mesh.idl"
module SMESH
{
/*!
* Structure used in mesh edit preview data
*/
struct ElementSubType { ElementType SMDS_ElementType;
boolean isPoly;
long nbNodesInElement; };
typedef sequence<ElementSubType> types_array;
/*!
* Structure containing mesh edit preview data
*/
struct MeshPreviewStruct { nodes_array nodesXYZ;
long_array elementConnectivities;
types_array elementTypes; };
/*!
* This interface makes modifications on the Mesh - removing elements and nodes etc.
*/
interface NumericalFunctor;
interface SMESH_MeshEditor
{
boolean RemoveElements(in long_array IDsOfElements);
boolean RemoveNodes(in long_array IDsOfNodes);
long AddNode(in double x, in double y, in double z);
/*!
* Create edge, either linear and quadratic (this is determed
* by number of given nodes).
* \param IdsOfNodes List of node IDs for creation of element.
* Needed order of nodes in this list corresponds to description
* of MED. This description is located by the following link:
* http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
*/
long AddEdge(in long_array IDsOfNodes);
/*!
* Create face, either linear and quadratic (this is determed
* by number of given nodes).
* \param IdsOfNodes List of node IDs for creation of element.
* Needed order of nodes in this list corresponds to description
* of MED. This description is located by the following link:
* http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
*/
long AddFace(in long_array IDsOfNodes);
long AddPolygonalFace(in long_array IdsOfNodes);
/*!
* Create volume, either linear and quadratic (this is determed
* by number of given nodes).
* \param IdsOfNodes List of node IDs for creation of element.
* Needed order of nodes in this list corresponds to description
* of MED. This description is located by the following link:
* http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
*/
long AddVolume(in long_array IDsOfNodes);
/*!
* Create volume of many faces, giving nodes for each face.
* \param IdsOfNodes List of node IDs for volume creation face by face.
* \param Quantities List of integer values, Quantities[i]
* gives quantity of nodes in face number i.
*/
long AddPolyhedralVolume (in long_array IdsOfNodes,
in long_array Quantities);
/*!
* Create volume of many faces, giving IDs of existing faces.
* \param IdsOfFaces List of face IDs for volume creation.
* \note The created volume will refer only to nodes
* of the given faces, not to the faces itself.
*/
long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces);
boolean MoveNode(in long NodeID, in double x, in double y, in double z);
boolean InverseDiag(in long NodeID1, in long NodeID2);
boolean DeleteDiag(in long NodeID1, in long NodeID2);
boolean Reorient(in long_array IDsOfElements);
boolean ReorientObject(in SMESH_IDSource theObject);
/*!
* \brief Fuse neighbour triangles into quadrangles.
* \param theElems The triangles to be fused.
* \param theCriterion Is used to choose a neighbour to fuse with.
* \param theMaxAngle Is a max angle between element normals at which fusion
* is still performed; theMaxAngle is mesured in radians.
* \return TRUE in case of success, FALSE otherwise.
*/
boolean TriToQuad (in long_array IDsOfElements,
in NumericalFunctor Criterion,
in double MaxAngle);
/*!
* \brief Fuse neighbour triangles into quadrangles.
*
* Behaves like the above method, taking list of elements from \a theObject
*/
boolean TriToQuadObject (in SMESH_IDSource theObject,
in NumericalFunctor Criterion,
in double MaxAngle);
/*!
* \brief Split quadrangles into triangles.
* \param theElems The faces to be splitted.
* \param theCriterion Is used to choose a diagonal for splitting.
* \return TRUE in case of success, FALSE otherwise.
*/
boolean QuadToTri (in long_array IDsOfElements,
in NumericalFunctor Criterion);
/*!
* \brief Split quadrangles into triangles.
*
* Behaves like the above method, taking list of elements from \a theObject
*/
boolean QuadToTriObject (in SMESH_IDSource theObject,
in NumericalFunctor Criterion);
/*!
* \brief Split quadrangles into triangles.
* \param theElems The faces to be splitted.
* \param the13Diag Is used to choose a diagonal for splitting.
* \return TRUE in case of success, FALSE otherwise.
*/
boolean SplitQuad (in long_array IDsOfElements,
in boolean Diag13);
/*!
* \brief Split quadrangles into triangles.
*
* Behaves like the above method, taking list of elements from \a theObject
*/
boolean SplitQuadObject (in SMESH_IDSource theObject,
in boolean Diag13);
/*!
* Find better splitting of the given quadrangle.
* \param IDOfQuad ID of the quadrangle to be splitted.
* \param Criterion A criterion to choose a diagonal for splitting.
* \return 1 if 1-3 diagonal is better, 2 if 2-4
* diagonal is better, 0 if error occurs.
*/
long BestSplit (in long IDOfQuad,
in NumericalFunctor Criterion);
enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
boolean Smooth(in long_array IDsOfElements,
in long_array IDsOfFixedNodes,
in long MaxNbOfIterations,
in double MaxAspectRatio,
in Smooth_Method Method);
boolean SmoothObject(in SMESH_IDSource theObject,
in long_array IDsOfFixedNodes,
in long MaxNbOfIterations,
in double MaxAspectRatio,
in Smooth_Method Method);
boolean SmoothParametric(in long_array IDsOfElements,
in long_array IDsOfFixedNodes,
in long MaxNbOfIterations,
in double MaxAspectRatio,
in Smooth_Method Method);
boolean SmoothParametricObject(in SMESH_IDSource theObject,
in long_array IDsOfFixedNodes,
in long MaxNbOfIterations,
in double MaxAspectRatio,
in Smooth_Method Method);
void ConvertToQuadratic(in boolean theForce3d);
boolean ConvertFromQuadratic();
void RenumberNodes();
void RenumberElements();
void RotationSweep(in long_array IDsOfElements,
in AxisStruct Axix,
in double AngleInRadians,
in long NbOfSteps,
in double Tolerance);
void RotationSweepObject(in SMESH_IDSource theObject,
in AxisStruct Axix,
in double AngleInRadians,
in long NbOfSteps,
in double Tolerance);
void ExtrusionSweep(in long_array IDsOfElements,
in DirStruct StepVector,
in long NbOfSteps);
/*!
* Generate new elements by extrusion of theElements
* by StepVector by NbOfSteps
* param ExtrFlags set flags for performing extrusion
* param SewTolerance - uses for comparing locations of nodes if flag
* EXTRUSION_FLAG_SEW is set
*/
void AdvancedExtrusion(in long_array IDsOfElements,
in DirStruct StepVector,
in long NbOfSteps,
in long ExtrFlags,
in double SewTolerance);
void ExtrusionSweepObject(in SMESH_IDSource theObject,
in DirStruct StepVector,
in long NbOfSteps);
void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
in DirStruct StepVector,
in long NbOfSteps);
void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
in DirStruct StepVector,
in long NbOfSteps);
enum Extrusion_Error {
EXTR_OK,
EXTR_NO_ELEMENTS,
EXTR_PATH_NOT_EDGE,
EXTR_BAD_PATH_SHAPE,
EXTR_BAD_STARTING_NODE,
EXTR_BAD_ANGLES_NUMBER,
EXTR_CANT_GET_TANGENT
};
Extrusion_Error ExtrusionAlongPath(in long_array IDsOfElements,
in SMESH_Mesh PathMesh,
in GEOM::GEOM_Object PathShape,
in long NodeStart,
in boolean HasAngles,
in double_array Angles,
in boolean HasRefPoint,
in PointStruct RefPoint);
Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource theObject,
in SMESH_Mesh PathMesh,
in GEOM::GEOM_Object PathShape,
in long NodeStart,
in boolean HasAngles,
in double_array Angles,
in boolean HasRefPoint,
in PointStruct RefPoint);
/*!
* Compute rotation angles for ExtrusionAlongPath as linear variation
* of given angles along path steps
* param PathMesh mesh containing a 1D sub-mesh on the edge, along
* which proceeds the extrusion
* param PathShape is shape(edge); as the mesh can be complex, the edge
* is used to define the sub-mesh for the path
*/
double_array LinearAnglesVariation(in SMESH_Mesh PathMesh,
in GEOM::GEOM_Object PathShape,
in double_array Angles);
enum MirrorType { POINT, AXIS, PLANE };
void Mirror (in long_array IDsOfElements,
in AxisStruct Mirror,
in MirrorType theMirrorType,
in boolean Copy);
void MirrorObject (in SMESH_IDSource theObject,
in AxisStruct Mirror,
in MirrorType theMirrorType,
in boolean Copy);
void Translate (in long_array IDsOfElements,
in DirStruct Vector,
in boolean Copy);
void TranslateObject (in SMESH_IDSource theObject,
in DirStruct Vector,
in boolean Copy);
void Rotate (in long_array IDsOfElements,
in AxisStruct Axis,
in double AngleInRadians,
in boolean Copy);
void RotateObject (in SMESH_IDSource theObject,
in AxisStruct Axis,
in double AngleInRadians,
in boolean Copy);
void FindCoincidentNodes (in double Tolerance,
out array_of_long_array GroupsOfNodes);
void FindCoincidentNodesOnPart (in SMESH_IDSource SubMeshOrGroup,
in double Tolerance,
out array_of_long_array GroupsOfNodes);
void MergeNodes (in array_of_long_array GroupsOfNodes);
/*!
* \brief Find elements built on the same nodes.
* \param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching.
* \return List of groups of equal elements.
*/
void FindEqualElements (in SMESH_IDSource MeshOrSubMeshOrGroup,
out array_of_long_array GroupsOfElementsID);
/*!
* \brief Merge elements in each given group.
* \param GroupsOfElementsID Groups of elements for merging.
*/
void MergeElements(in array_of_long_array GroupsOfElementsID);
/*!
* \brief Merge equal elements in the whole mesh.
*/
void MergeEqualElements();
/*!
* If the given ID is a valid node ID (nodeID > 0), just move this node, else
* move the node closest to the point to point's location and return ID of the node
*/
long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID);
enum Sew_Error {
SEW_OK,
SEW_BORDER1_NOT_FOUND,
SEW_BORDER2_NOT_FOUND,
SEW_BOTH_BORDERS_NOT_FOUND,
SEW_BAD_SIDE_NODES,
SEW_VOLUMES_TO_SPLIT,
// for SewSideElements() only:
SEW_DIFF_NB_OF_ELEMENTS,
SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
SEW_BAD_SIDE1_NODES,
SEW_BAD_SIDE2_NODES
};
Sew_Error SewFreeBorders (in long FirstNodeID1,
in long SecondNodeID1,
in long LastNodeID1,
in long FirstNodeID2,
in long SecondNodeID2,
in long LastNodeID2,
in boolean CreatePolygons,
in boolean CreatePolyedrs);
Sew_Error SewConformFreeBorders (in long FirstNodeID1,
in long SecondNodeID1,
in long LastNodeID1,
in long FirstNodeID2,
in long SecondNodeID2);
Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
in long SecondNodeIDOnFreeBorder,
in long LastNodeIDOnFreeBorder,
in long FirstNodeIDOnSide,
in long LastNodeIDOnSide,
in boolean CreatePolygons,
in boolean CreatePolyedrs);
Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
in long_array IDsOfSide2Elements,
in long NodeID1OfSide1ToMerge,
in long NodeID1OfSide2ToMerge,
in long NodeID2OfSide1ToMerge,
in long NodeID2OfSide2ToMerge);
/*!
* Set new nodes for given element.
* If number of nodes is not corresponded to type of
* element - returns false
*/
boolean ChangeElemNodes(in long ide, in long_array newIDs);
/*!
* Return data of mesh edition preview which is computed provided
* that the editor was obtained trough SMESH_Mesh::GetMeshEditPreviewer()
*/
MeshPreviewStruct GetPreviewData();
/*!
* If during last operation of MeshEditor some nodes were
* created this method returns list of it's IDs, if new nodes
* not creared - returns empty list
*/
long_array GetLastCreatedNodes();
/*!
* If during last operation of MeshEditor some elements were
* created this method returns list of it's IDs, if new elements
* not creared - returns empty list
*/
long_array GetLastCreatedElems();
};
};
#endif

View File

@ -168,6 +168,9 @@ dist_salomeres_DATA = \
mesh_tree_hypo_source_edge.png \ mesh_tree_hypo_source_edge.png \
mesh_tree_hypo_source_3d_shape.png \ mesh_tree_hypo_source_3d_shape.png \
mesh_tree_hypo_projection_3d.png \ mesh_tree_hypo_projection_3d.png \
mesh_tree_hypo_projection_2d.png mesh_tree_hypo_projection_2d.png \
mesh_build_compound.png \
mesh_node_to_point.png \
mesh_tree_mesh_partial.png
nodist_salomeres_DATA = SMESHCatalog.xml nodist_salomeres_DATA = SMESHCatalog.xml

View File

@ -24,6 +24,7 @@
<popup-item item-id="121" pos-id="" label-id="DAT File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/> <popup-item item-id="121" pos-id="" label-id="DAT File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="122" pos-id="" label-id="MED File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/> <popup-item item-id="122" pos-id="" label-id="MED File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="123" pos-id="" label-id="UNV File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/> <popup-item item-id="123" pos-id="" label-id="UNV File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="140" pos-id="" label-id="STL File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu> </submenu>
<endsubmenu /> <endsubmenu />
<separator pos-id="10"/> <separator pos-id="10"/>
@ -185,6 +186,7 @@
<separator pos-id=""/> <separator pos-id=""/>
<popup-item item-id="122" pos-id="" label-id="Export to MED" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/> <popup-item item-id="122" pos-id="" label-id="Export to MED" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="123" pos-id="" label-id="Export to UNV" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/> <popup-item item-id="123" pos-id="" label-id="Export to UNV" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="140" pos-id="" label-id="Export to STL" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</popupmenu> </popupmenu>
<popupmenu label-id="Popup for ObjectBrowser" context-id="" parent-id="ObjectBrowser" object-id="SubMesh"> <popupmenu label-id="Popup for ObjectBrowser" context-id="" parent-id="ObjectBrowser" object-id="SubMesh">

View File

@ -24,6 +24,7 @@
<popup-item item-id="121" pos-id="" label-id="DAT File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/> <popup-item item-id="121" pos-id="" label-id="DAT File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="122" pos-id="" label-id="MED File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/> <popup-item item-id="122" pos-id="" label-id="MED File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="123" pos-id="" label-id="UNV File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/> <popup-item item-id="123" pos-id="" label-id="UNV File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="140" pos-id="" label-id="STL File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu> </submenu>
<endsubmenu /> <endsubmenu />
<separator pos-id="10"/> <separator pos-id="10"/>

View File

@ -11,6 +11,11 @@
gui-lib="StdMeshersGUI"> gui-lib="StdMeshersGUI">
<hypotheses> <hypotheses>
<hypothesis type="SegmentLengthAroundVertex"
label-id="Length Near Vertex"
icon-id="mesh_hypo_length.png"
dim="0"/>
<hypothesis type="LocalLength" <hypothesis type="LocalLength"
label-id="Average length" label-id="Average length"
icon-id="mesh_hypo_length.png" icon-id="mesh_hypo_length.png"
@ -107,6 +112,13 @@
<algorithms> <algorithms>
<algorithm type="SegmentAroundVertex_0D"
label-id="Segments around vertex"
icon-id="mesh_algo_regular.png"
hypos="SegmentLengthAroundVertex"
output="VERTEX"
dim="0"/>
<algorithm type="Regular_1D" <algorithm type="Regular_1D"
label-id="Wire discretisation" label-id="Wire discretisation"
icon-id="mesh_algo_regular.png" icon-id="mesh_algo_regular.png"
@ -116,6 +128,15 @@
output="EDGE" output="EDGE"
dim="1"/> dim="1"/>
<algorithm type="CompositeSegment_1D"
label-id="Composite side discretisation"
icon-id="mesh_algo_regular.png"
hypos="LocalLength,Arithmetic1D,StartEndLength,NumberOfSegments,Deflection1D,AutomaticLength"
opt-hypos="Propagation,QuadraticMesh"
input="VERTEX"
output="EDGE"
dim="1"/>
<algorithm type="MEFISTO_2D" <algorithm type="MEFISTO_2D"
label-id="Triangle (Mefisto)" label-id="Triangle (Mefisto)"
icon-id="mesh_algo_mefisto.png" icon-id="mesh_algo_mefisto.png"
@ -161,7 +182,7 @@
dim="3"/> dim="3"/>
<algorithm type="Prism_3D" <algorithm type="Prism_3D"
label-id="Prism 3D" label-id="3D extrusion"
icon-id="mesh_algo_hexa.png" icon-id="mesh_algo_hexa.png"
input="QUAD,TRIA" input="QUAD,TRIA"
dim="3"/> dim="3"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

View File

@ -21,25 +21,27 @@
#include <set> #include <set>
#include <BRepAdaptor_Surface.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <gp_Ax3.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <gp_XYZ.hxx>
#include <Geom_Plane.hxx>
#include <Geom_CylindricalSurface.hxx> #include <Geom_CylindricalSurface.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#include <TColgp_Array1OfXYZ.hxx> #include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx> #include <TColStd_MapOfInteger.hxx>
#include <TColStd_SequenceOfAsciiString.hxx> #include <TColStd_SequenceOfAsciiString.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx> #include <TColgp_Array1OfXYZ.hxx>
#include <TopAbs.hxx> #include <TopAbs.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <gp_Ax3.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Dir.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_XYZ.hxx>
#include "SMDS_Mesh.hxx" #include "SMDS_Mesh.hxx"
#include "SMDS_Iterator.hxx" #include "SMDS_Iterator.hxx"
@ -2531,6 +2533,7 @@ ElementsOnSurface::ElementsOnSurface()
myType = SMDSAbs_All; myType = SMDSAbs_All;
mySurf.Nullify(); mySurf.Nullify();
myToler = Precision::Confusion(); myToler = Precision::Confusion();
myUseBoundaries = false;
} }
ElementsOnSurface::~ElementsOnSurface() ElementsOnSurface::~ElementsOnSurface()
@ -2543,7 +2546,6 @@ void ElementsOnSurface::SetMesh( const SMDS_Mesh* theMesh )
if ( myMesh == theMesh ) if ( myMesh == theMesh )
return; return;
myMesh = theMesh; myMesh = theMesh;
myIds.Clear();
process(); process();
} }
@ -2556,25 +2558,41 @@ SMDSAbs_ElementType ElementsOnSurface::GetType() const
{ return myType; } { return myType; }
void ElementsOnSurface::SetTolerance( const double theToler ) void ElementsOnSurface::SetTolerance( const double theToler )
{ myToler = theToler; } {
if ( myToler != theToler )
myIds.Clear();
myToler = theToler;
}
double ElementsOnSurface::GetTolerance() const double ElementsOnSurface::GetTolerance() const
{ return myToler; }
void ElementsOnSurface::SetUseBoundaries( bool theUse )
{ {
return myToler; if ( myUseBoundaries != theUse ) {
myUseBoundaries = theUse;
SetSurface( mySurf, myType );
}
} }
void ElementsOnSurface::SetSurface( const TopoDS_Shape& theShape, void ElementsOnSurface::SetSurface( const TopoDS_Shape& theShape,
const SMDSAbs_ElementType theType ) const SMDSAbs_ElementType theType )
{ {
myIds.Clear();
myType = theType; myType = theType;
mySurf.Nullify(); mySurf.Nullify();
if ( theShape.IsNull() || theShape.ShapeType() != TopAbs_FACE ) if ( theShape.IsNull() || theShape.ShapeType() != TopAbs_FACE )
{
mySurf.Nullify();
return; return;
} mySurf = TopoDS::Face( theShape );
TopoDS_Face aFace = TopoDS::Face( theShape ); BRepAdaptor_Surface SA( mySurf, myUseBoundaries );
mySurf = BRep_Tool::Surface( aFace ); Standard_Real
u1 = SA.FirstUParameter(),
u2 = SA.LastUParameter(),
v1 = SA.FirstVParameter(),
v2 = SA.LastVParameter();
Handle(Geom_Surface) surf = BRep_Tool::Surface( mySurf );
myProjector.Init( surf, u1,u2, v1,v2 );
process();
} }
void ElementsOnSurface::process() void ElementsOnSurface::process()
@ -2588,6 +2606,7 @@ void ElementsOnSurface::process()
if ( myType == SMDSAbs_Face || myType == SMDSAbs_All ) if ( myType == SMDSAbs_Face || myType == SMDSAbs_All )
{ {
myIds.ReSize( myMesh->NbFaces() );
SMDS_FaceIteratorPtr anIter = myMesh->facesIterator(); SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
for(; anIter->more(); ) for(; anIter->more(); )
process( anIter->next() ); process( anIter->next() );
@ -2595,6 +2614,7 @@ void ElementsOnSurface::process()
if ( myType == SMDSAbs_Edge || myType == SMDSAbs_All ) if ( myType == SMDSAbs_Edge || myType == SMDSAbs_All )
{ {
myIds.ReSize( myMesh->NbEdges() );
SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator(); SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
for(; anIter->more(); ) for(; anIter->more(); )
process( anIter->next() ); process( anIter->next() );
@ -2602,6 +2622,7 @@ void ElementsOnSurface::process()
if ( myType == SMDSAbs_Node ) if ( myType == SMDSAbs_Node )
{ {
myIds.ReSize( myMesh->NbNodes() );
SMDS_NodeIteratorPtr anIter = myMesh->nodesIterator(); SMDS_NodeIteratorPtr anIter = myMesh->nodesIterator();
for(; anIter->more(); ) for(; anIter->more(); )
process( anIter->next() ); process( anIter->next() );
@ -2625,32 +2646,34 @@ void ElementsOnSurface::process( const SMDS_MeshElement* theElemPtr )
myIds.Add( theElemPtr->GetID() ); myIds.Add( theElemPtr->GetID() );
} }
bool ElementsOnSurface::isOnSurface( const SMDS_MeshNode* theNode ) const bool ElementsOnSurface::isOnSurface( const SMDS_MeshNode* theNode )
{ {
if ( mySurf.IsNull() ) if ( mySurf.IsNull() )
return false; return false;
gp_Pnt aPnt( theNode->X(), theNode->Y(), theNode->Z() ); gp_Pnt aPnt( theNode->X(), theNode->Y(), theNode->Z() );
double aToler2 = myToler * myToler; // double aToler2 = myToler * myToler;
if ( mySurf->IsKind(STANDARD_TYPE(Geom_Plane))) // if ( mySurf->IsKind(STANDARD_TYPE(Geom_Plane)))
{ // {
gp_Pln aPln = Handle(Geom_Plane)::DownCast(mySurf)->Pln(); // gp_Pln aPln = Handle(Geom_Plane)::DownCast(mySurf)->Pln();
if ( aPln.SquareDistance( aPnt ) > aToler2 ) // if ( aPln.SquareDistance( aPnt ) > aToler2 )
return false; // return false;
} // }
else if ( mySurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) // else if ( mySurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface)))
{ // {
gp_Cylinder aCyl = Handle(Geom_CylindricalSurface)::DownCast(mySurf)->Cylinder(); // gp_Cylinder aCyl = Handle(Geom_CylindricalSurface)::DownCast(mySurf)->Cylinder();
double aRad = aCyl.Radius(); // double aRad = aCyl.Radius();
gp_Ax3 anAxis = aCyl.Position(); // gp_Ax3 anAxis = aCyl.Position();
gp_XYZ aLoc = aCyl.Location().XYZ(); // gp_XYZ aLoc = aCyl.Location().XYZ();
double aXDist = anAxis.XDirection().XYZ() * ( aPnt.XYZ() - aLoc ); // double aXDist = anAxis.XDirection().XYZ() * ( aPnt.XYZ() - aLoc );
double aYDist = anAxis.YDirection().XYZ() * ( aPnt.XYZ() - aLoc ); // double aYDist = anAxis.YDirection().XYZ() * ( aPnt.XYZ() - aLoc );
if ( fabs(aXDist*aXDist + aYDist*aYDist - aRad*aRad) > aToler2 ) // if ( fabs(aXDist*aXDist + aYDist*aYDist - aRad*aRad) > aToler2 )
return false; // return false;
} // }
else // else
return false; // return false;
myProjector.Perform( aPnt );
bool isOn = ( myProjector.IsDone() && myProjector.LowerDistance() <= myToler );
return true; return isOn;
} }

View File

@ -25,10 +25,12 @@
#include <vector> #include <vector>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <gp_XYZ.hxx> #include <gp_XYZ.hxx>
#include <Geom_Surface.hxx> //#include <Geom_Surface.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <TColStd_SequenceOfInteger.hxx> #include <TColStd_SequenceOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx> #include <TColStd_MapOfInteger.hxx>
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
#include <TopoDS_Face.hxx>
#include "SMDSAbs_ElementType.hxx" #include "SMDSAbs_ElementType.hxx"
#include "SMDS_MeshNode.hxx" #include "SMDS_MeshNode.hxx"
@ -54,7 +56,7 @@ class SMESHDS_Mesh;
class SMESHDS_SubMesh; class SMESHDS_SubMesh;
class gp_Pnt; class gp_Pnt;
class TopoDS_Shape; //class TopoDS_Shape;
namespace SMESH{ namespace SMESH{
namespace Controls{ namespace Controls{
@ -621,18 +623,23 @@ namespace SMESH{
double GetTolerance() const; double GetTolerance() const;
void SetSurface( const TopoDS_Shape& theShape, void SetSurface( const TopoDS_Shape& theShape,
const SMDSAbs_ElementType theType ); const SMDSAbs_ElementType theType );
void SetUseBoundaries( bool theUse );
bool GetUseBoundaries() const { return myUseBoundaries; }
private: private:
void process(); void process();
void process( const SMDS_MeshElement* theElem ); void process( const SMDS_MeshElement* theElem );
bool isOnSurface( const SMDS_MeshNode* theNode ) const; bool isOnSurface( const SMDS_MeshNode* theNode );
private: private:
const SMDS_Mesh* myMesh; const SMDS_Mesh* myMesh;
TColStd_MapOfInteger myIds; TColStd_MapOfInteger myIds;
SMDSAbs_ElementType myType; SMDSAbs_ElementType myType;
Handle(Geom_Surface) mySurf; //Handle(Geom_Surface) mySurf;
TopoDS_Face mySurf;
double myToler; double myToler;
bool myUseBoundaries;
GeomAPI_ProjectPointOnSurf myProjector;
}; };
typedef boost::shared_ptr<ElementsOnSurface> ElementsOnSurfacePtr; typedef boost::shared_ptr<ElementsOnSurface> ElementsOnSurfacePtr;

View File

@ -295,17 +295,21 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
// Storing SMDS groups and sub-meshes // Storing SMDS groups and sub-meshes
//----------------------------------- //-----------------------------------
int myNodesDefaultFamilyId = 0; int myNodesDefaultFamilyId = 0;
int myEdgesDefaultFamilyId = 0; int myEdgesDefaultFamilyId = 0;
int myFacesDefaultFamilyId = 0; int myFacesDefaultFamilyId = 0;
int myVolumesDefaultFamilyId = 0; int myVolumesDefaultFamilyId = 0;
if (myDoGroupOfNodes) int nbNodes = myMesh->NbNodes();
int nbEdges = myMesh->NbEdges();
int nbFaces = myMesh->NbFaces();
int nbVolumes = myMesh->NbVolumes();
if (myDoGroupOfNodes && nbNodes)
myNodesDefaultFamilyId = REST_NODES_FAMILY; myNodesDefaultFamilyId = REST_NODES_FAMILY;
if (myDoGroupOfEdges) if (myDoGroupOfEdges && nbEdges)
myEdgesDefaultFamilyId = REST_EDGES_FAMILY; myEdgesDefaultFamilyId = REST_EDGES_FAMILY;
if (myDoGroupOfFaces) if (myDoGroupOfFaces && nbFaces)
myFacesDefaultFamilyId = REST_FACES_FAMILY; myFacesDefaultFamilyId = REST_FACES_FAMILY;
if (myDoGroupOfVolumes) if (myDoGroupOfVolumes && nbVolumes)
myVolumesDefaultFamilyId = REST_VOLUMES_FAMILY; myVolumesDefaultFamilyId = REST_VOLUMES_FAMILY;
MESSAGE("Perform - aFamilyInfo"); MESSAGE("Perform - aFamilyInfo");
@ -314,11 +318,17 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
if (myAllSubMeshes) { if (myAllSubMeshes) {
aFamilies = DriverMED_Family::MakeFamilies aFamilies = DriverMED_Family::MakeFamilies
(myMesh->SubMeshes(), myGroups, (myMesh->SubMeshes(), myGroups,
myDoGroupOfNodes, myDoGroupOfEdges, myDoGroupOfFaces, myDoGroupOfVolumes); myDoGroupOfNodes && nbNodes,
myDoGroupOfEdges && nbEdges,
myDoGroupOfFaces && nbFaces,
myDoGroupOfVolumes && nbVolumes);
} else { } else {
aFamilies = DriverMED_Family::MakeFamilies aFamilies = DriverMED_Family::MakeFamilies
(mySubMeshes, myGroups, (mySubMeshes, myGroups,
myDoGroupOfNodes, myDoGroupOfEdges, myDoGroupOfFaces, myDoGroupOfVolumes); myDoGroupOfNodes && nbNodes,
myDoGroupOfEdges && nbEdges,
myDoGroupOfFaces && nbFaces,
myDoGroupOfVolumes && nbVolumes);
} }
list<DriverMED_FamilyPtr>::iterator aFamsIter = aFamilies.begin(); list<DriverMED_FamilyPtr>::iterator aFamsIter = aFamilies.begin();

View File

@ -22,10 +22,10 @@
#include "DriverUNV_W_SMDS_Mesh.h" #include "DriverUNV_W_SMDS_Mesh.h"
#include "SMDS_Mesh.hxx" #include "SMDS_Mesh.hxx"
#include "SMESHDS_GroupBase.hxx"
//#include "SMESH_Group.hxx"
#include "SMDS_QuadraticEdge.hxx" #include "SMDS_QuadraticEdge.hxx"
#include "SMDS_QuadraticFaceOfNodes.hxx" #include "SMDS_QuadraticFaceOfNodes.hxx"
#include "SMDS_PolyhedralVolumeOfNodes.hxx"
#include "SMESHDS_GroupBase.hxx"
#include "utilities.h" #include "utilities.h"
@ -158,9 +158,16 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
TElementLab aLabel = anElem->GetID(); TElementLab aLabel = anElem->GetID();
int aNbNodes = anElem->NbNodes(); int aNbNodes = anElem->NbNodes();
aConnect.resize(aNbNodes);
SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator(); SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
if ( anElem->IsPoly() ) {
if ( const SMDS_PolyhedralVolumeOfNodes* ph =
dynamic_cast<const SMDS_PolyhedralVolumeOfNodes*> (anElem))
{
aNbNodes = ph->NbUniqueNodes();
aNodesIter = ph->uniqueNodesIterator();
}
}
aConnect.resize(aNbNodes);
GetConnect(aNodesIter,aConnect); GetConnect(aNodesIter,aConnect);
int anId = -1; int anId = -1;

View File

@ -1,6 +1,6 @@
// MEFISTO : library to compute 2D triangulation from segmented boundaries // MEFISTO : library to compute 2D triangulation from segmented boundaries
// //
// Copyright (C) 2003 Laboratoire J.-L. Lions UPMC Paris // Copyright (C) 2006 Laboratoire J.-L. Lions UPMC Paris
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -23,7 +23,7 @@
// File : Rn.h // File : Rn.h
// Module : SMESH // Module : SMESH
// Authors: Frederic HECHT & Alain PERRONNET // Authors: Frederic HECHT & Alain PERRONNET
// // Date : 13 novembre 2006
#ifndef Rn__h #ifndef Rn__h
#define Rn__h #define Rn__h
@ -62,19 +62,19 @@ typedef char Nom[1+24];
//le type N des nombres entiers positifs //le type N des nombres entiers positifs
//========= //=========
#ifndef PCLINUX64
typedef unsigned long int N; typedef unsigned long int N;
#else
typedef unsigned int N;
#endif
//le type Z des nombres entiers relatifs //le type Z des nombres entiers relatifs
//========= //=========
// 64-bit porting: "long" replaced with "int". #ifndef PCLINUX64
// On 64-bit, C++ long type is 8 byte long. MEFISTO2D C code calls several Fortran subroutines passing typedef long int Z;
// arguments of this type, however Fortran knows nothing about changed size of arguments, #else
// therefore stack gets corrupted. With "int" used instead of "long", Fortran calls from C do no harm to the stack
// After this modification, behavior on 32-bit platforms does not change: on all platforms supported by
// SALOME 3, "int" and "long" have the same size of 4 bytes.
//========
//typedef long int Z;
typedef int Z; typedef int Z;
#endif
//le type R des nombres "reels" //le type R des nombres "reels"
//========= //=========

View File

@ -1,5 +1,6 @@
// MEFISTO2: a library to compute 2D triangulation from segmented boundaries // MEFISTO2: a library to compute 2D triangulation from segmented boundaries
// //
//
// Copyright (C) 2006 Laboratoire J.-L. Lions UPMC Paris // Copyright (C) 2006 Laboratoire J.-L. Lions UPMC Paris
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
@ -21,7 +22,7 @@
// File : aptrte.cxx le C++ de l'appel du trianguleur plan // File : aptrte.cxx le C++ de l'appel du trianguleur plan
// Module : SMESH // Module : SMESH
// Author : Alain PERRONNET // Author : Alain PERRONNET
// Date : 16 mars 2006 // Date : 13 novembre 2006
#include "Rn.h" #include "Rn.h"
#include "aptrte.h" #include "aptrte.h"
@ -144,15 +145,14 @@ void aptrte( Z nutysu, R aretmx,
R3 comxmi[2]; //coordonnees UV Min et Maximales R3 comxmi[2]; //coordonnees UV Min et Maximales
R aremin, aremax; //longueur minimale et maximale des aretes R aremin, aremax; //longueur minimale et maximale des aretes
R airemx; //aire maximale souhaitee d'un triangle
R quamoy, quamin; R quamoy, quamin;
Z noar0, noar, na; Z noar0, noar, na;
Z i, l, n, ns, ns0, ns1, ns2, nosotr[3], nt; Z i, l, n, ns, ns0, ns1, ns2, nosotr[3], nt;
Z mxsomm, nbsomm, nbarpi, nbarli, ndtri0, mn; Z mxsomm, nbsomm, nbarpi, nbarli, ndtri0, mn;
Z moins1=-1; Z moins1=-1;
R dist; Z nuds = 0;
aretemaxface_ = aretmx;
// initialisation du temps cpu // initialisation du temps cpu
deltacpu_( d ); deltacpu_( d );
@ -166,7 +166,8 @@ void aptrte( Z nutysu, R aretmx,
i = 4*nbarfr/10; i = 4*nbarfr/10;
mxsomm = Max( 20000, 64*nbpti+i*i ); mxsomm = Max( 20000, 64*nbpti+i*i );
MESSAGE( "APTRTE: Debut de la triangulation plane avec " ); MESSAGE( "APTRTE: Debut de la triangulation plane avec " );
MESSAGE( "nutysu=" << nutysu << " aretmx=" << aretmx << " mxsomm=" << mxsomm ); MESSAGE( "nutysu=" << nutysu << " aretmx=" << aretmx
<< " mxsomm=" << mxsomm );
MESSAGE( nbarfr << " sommets sur la frontiere et " << nbpti << " points internes"); MESSAGE( nbarfr << " sommets sur la frontiere et " << nbpti << " points internes");
NEWDEPART: NEWDEPART:
@ -277,6 +278,9 @@ void aptrte( Z nutysu, R aretmx,
//l'arete precedente est dotee de sa suivante:celle cree ensuite //l'arete precedente est dotee de sa suivante:celle cree ensuite
//les 2 coordonnees du sommet ns2 de la ligne //les 2 coordonnees du sommet ns2 de la ligne
ns = ns1 - 1; ns = ns1 - 1;
//debut ajout 5/10/2006 ................................................
nuds = Max( nuds, ns ); //le numero du dernier sommet traite
//fin ajout 5/10/2006 ................................................
mnpxyd[ns].x = uvslf[ns].x; mnpxyd[ns].x = uvslf[ns].x;
mnpxyd[ns].y = uvslf[ns].y; mnpxyd[ns].y = uvslf[ns].y;
mnpxyd[ns].z = areteideale();//( mnpxyd[ns], direction ); mnpxyd[ns].z = areteideale();//( mnpxyd[ns], direction );
@ -289,6 +293,14 @@ void aptrte( Z nutysu, R aretmx,
aremin = Min( aremin, d ); aremin = Min( aremin, d );
aremax = Max( aremax, d ); aremax = Max( aremax, d );
//debut ajout du 5/10/2006 .............................................
//la longueur de l'arete ns1-ns2
d = sqrt( d );
//longueur arete = Min ( aretmx, aretes incidentes )
mnpxyd[ns ].z = Min( mnpxyd[ns ].z, d );
mnpxyd[ns2-1].z = Min( mnpxyd[ns2-1].z, d );
//fin ajout du 5/10/2006 ...............................................
//le numero n de la ligne du sommet et son numero ns1 dans la ligne //le numero n de la ligne du sommet et son numero ns1 dans la ligne
mnslig[ns] = 1000000 * n + ns1-nudslf[n-1]; mnslig[ns] = 1000000 * n + ns1-nudslf[n-1];
@ -312,9 +324,34 @@ void aptrte( Z nutysu, R aretmx,
aremin = sqrt( aremin ); //longueur minimale d'une arete des lignes fermees aremin = sqrt( aremin ); //longueur minimale d'une arete des lignes fermees
aremax = sqrt( aremax ); //longueur maximale d'une arete aremax = sqrt( aremax ); //longueur maximale d'une arete
aretmx = Min( aretmx, aremax ); //pour homogeneiser //debut ajout 9/11/2006 ................................................
MESSAGE("nutysu=" << nutysu << " aretmx=" << aretmx // devenu un commentaire aretmx = Min( aretmx, aremax ); //pour homogeneiser
<< " arete min=" << aremin << " arete max=" << aremax);
// protection contre une arete max desiree trop grande ou trop petite
if( aretmx > aremax*2.05 ) aretmx = aremax;
// protection contre une arete max desiree trop petite
if( (aremax-aremin) > (aremin+aremax)*0.05 && aretmx < aremin*0.5 )
aretmx =(aremin+aremax*2)/3.0;
if( aretmx < aremin && aremin > 0 )
aretmx = aremin;
//sauvegarde pour la fonction areteideale_
aretemaxface_ = aretmx;
//aire maximale souhaitee des triangles
airemx = aretmx * aretmx * sqrt(3.0) / 2.0; //Aire triangle equilateral
for(i=0; i<=nuds; i++ )
mnpxyd[i].z = Min( mnpxyd[i].z, aretmx );
//MESSAGE("Numero du dernier sommet frontalier=" << nuds+1);
//fin ajout 9/11/2006 .................................................
MESSAGE("Sur le bord: arete min=" << aremin << " arete max=" << aremax );
MESSAGE("Triangulation: arete mx=" << aretmx
<< " triangle aire mx=" << airemx );
//chainage des aretes frontalieres : la derniere arete frontaliere //chainage des aretes frontalieres : la derniere arete frontaliere
mnsoar[ mosoar * noar - mosoar + 5 ] = 0; mnsoar[ mosoar * noar - mosoar + 5 ] = 0;
@ -438,8 +475,8 @@ void aptrte( Z nutysu, R aretmx,
if( ierr != 0 ) goto ERREUR; if( ierr != 0 ) goto ERREUR;
//qualites de la triangulation actuelle //qualites de la triangulation actuelle
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr, 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) // boucle sur les aretes internes (non sur une ligne de la frontiere)
// avec echange des 2 diagonales afin de rendre la triangulation delaunay // avec echange des 2 diagonales afin de rendre la triangulation delaunay
@ -457,8 +494,8 @@ void aptrte( Z nutysu, R aretmx,
<< d << " secondes"); << d << " secondes");
//qualites de la triangulation actuelle //qualites de la triangulation actuelle
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr, qualitetrte_( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
nbt, quamoy, quamin ); nbt, quamoy, quamin );
// detection des aretes frontalieres initiales perdues // detection des aretes frontalieres initiales perdues
// triangulation frontale pour les restaurer // triangulation frontale pour les restaurer
@ -479,11 +516,11 @@ void aptrte( Z nutysu, R aretmx,
terefr( nbarpi, mnpxyd, terefr( nbarpi, mnpxyd,
mosoar, mxsoar, n1soar, mnsoar, mosoar, mxsoar, n1soar, mnsoar,
moartr, n1artr, mnartr, mnarst, moartr, mxartr, n1artr, mnartr, mnarst,
mxarcf, mn1arcf, mnarcf, mnarcf1, mnarcf2, mxarcf, mn1arcf, mnarcf, mnarcf1, mnarcf2,
n, ierr ); n, ierr );
MESSAGE( "Restauration de " << n << " aretes perdues de la frontiere" ); MESSAGE( "Restauration de " << n << " aretes perdues de la frontiere ierr=" << ierr );
deltacpu_( d ); deltacpu_( d );
tcpu += d; tcpu += d;
MESSAGE("Temps de la recuperation des aretes perdues de la frontiere=" MESSAGE("Temps de la recuperation des aretes perdues de la frontiere="
@ -492,8 +529,8 @@ void aptrte( Z nutysu, R aretmx,
if( ierr != 0 ) goto ERREUR; if( ierr != 0 ) goto ERREUR;
//qualites de la triangulation actuelle //qualites de la triangulation actuelle
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr, qualitetrte_( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
nbt, quamoy, quamin ); nbt, quamoy, quamin );
// fin de la triangulation avec respect des aretes initiales frontalieres // fin de la triangulation avec respect des aretes initiales frontalieres
@ -529,12 +566,12 @@ void aptrte( Z nutysu, R aretmx,
deltacpu_( d ); deltacpu_( d );
tcpu += d; tcpu += d;
MESSAGE( "Temps de la suppression des triangles externes=" << d ); MESSAGE( "Temps de la suppression des triangles externes=" << d << "ierr=" << ierr );
if( ierr != 0 ) goto ERREUR; if( ierr != 0 ) goto ERREUR;
//qualites de la triangulation actuelle //qualites de la triangulation actuelle
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr, qualitetrte_( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
nbt, quamoy, quamin ); nbt, quamoy, quamin );
// amelioration de la qualite de la triangulation par // amelioration de la qualite de la triangulation par
// barycentrage des sommets internes a la triangulation // barycentrage des sommets internes a la triangulation
@ -548,12 +585,12 @@ void aptrte( Z nutysu, R aretmx,
cout << "aptrte: MC saturee mnarcf3=" << mnarcf3 << endl; cout << "aptrte: MC saturee mnarcf3=" << mnarcf3 << endl;
goto ERREUR; goto ERREUR;
} }
teamqt( nutysu, teamqt_( nutysu, aretmx, airemx,
mnarst, mosoar, mxsoar, n1soar, mnsoar, mnarst, mosoar, mxsoar, n1soar, mnsoar,
moartr, mxartr, n1artr, mnartr, moartr, mxartr, n1artr, mnartr,
mxarcf, mnarcf2, mnarcf3, mxarcf, mnarcf2, mnarcf3,
mn1arcf, mnarcf, mnarcf1, mn1arcf, mnarcf, mnarcf1,
comxmi, nbarpi, nbsomm, mxsomm, mnpxyd, mnslig, nbarpi, nbsomm, mxsomm, mnpxyd, mnslig,
ierr ); ierr );
if( mnarcf3 != NULL ) {delete [] mnarcf3; mnarcf3=NULL;} if( mnarcf3 != NULL ) {delete [] mnarcf3; mnarcf3=NULL;}
if( mn1arcf != NULL ) {delete [] mn1arcf; mn1arcf=NULL;} if( mn1arcf != NULL ) {delete [] mn1arcf; mn1arcf=NULL;}
@ -564,11 +601,12 @@ void aptrte( Z nutysu, R aretmx,
deltacpu_( d ); deltacpu_( d );
tcpu += d; tcpu += d;
MESSAGE( "Temps de l'amelioration de la qualite de la triangulation=" << d ); MESSAGE( "Temps de l'amelioration de la qualite de la triangulation=" << d );
if( ierr != 0 ) goto ERREUR; if( ierr == -13 ) ierr=0; //6/10/2006 arret de l'amelioration apres boucle infinie dans caetoi
if( ierr != 0 ) goto ERREUR;
//qualites de la triangulation finale //qualites de la triangulation finale
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr, qualitetrte_( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
nbt, quamoy, quamin ); nbt, quamoy, quamin );
// renumerotation des sommets internes: mnarst(i)=numero final du sommet // renumerotation des sommets internes: mnarst(i)=numero final du sommet
// =================================== // ===================================
@ -657,7 +695,7 @@ void aptrte( Z nutysu, R aretmx,
} }
nbt /= nbsttria; //le nombre final de triangles de la surface nbt /= nbsttria; //le nombre final de triangles de la surface
MESSAGE( "APTRTE: Fin de la triangulation plane avec "<<nbst<<" sommets et " MESSAGE( "APTRTE: Fin de la triangulation plane avec "<<nbst<<" sommets et "
<< nbt << " triangles=" << nbt); << nbt << " triangles" );
deltacpu_( d ); deltacpu_( d );
tcpu += d; tcpu += d;
MESSAGE( "APTRTE: Temps total de la triangulation plane=" << tcpu << " secondes" ); MESSAGE( "APTRTE: Temps total de la triangulation plane=" << tcpu << " secondes" );
@ -698,10 +736,10 @@ void aptrte( Z nutysu, R aretmx,
} }
void qualitetrte( R3 *mnpxyd, void qualitetrte_( R3 *mnpxyd,
Z & mosoar, Z & mxsoar, Z *mnsoar, Z & mosoar, Z & mxsoar, Z *mnsoar,
Z & moartr, Z & mxartr, Z *mnartr, Z & moartr, Z & mxartr, Z *mnartr,
Z & nbtria, R & quamoy, R & quamin ) Z & nbtria, R & quamoy, R & quamin )
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// but : calculer la qualite moyenne et minimale de la triangulation // but : calculer la qualite moyenne et minimale de la triangulation
// ----- actuelle definie par les tableaux mnsoar et mnartr // ----- actuelle definie par les tableaux mnsoar et mnartr
@ -732,13 +770,14 @@ void qualitetrte( R3 *mnpxyd,
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{ {
R d, aire, qualite; R d, aire, qualite;
Z nosotr[3], mn, nbtrianeg, nt; Z nosotr[3], mn, nbtrianeg, nt, ntqmin;
aire = 0; aire = 0;
quamoy = 0; quamoy = 0;
quamin = 2.0; quamin = 2.0;
nbtria = 0; nbtria = 0;
nbtrianeg = 0; nbtrianeg = 0;
ntqmin = 0;
mn = -moartr; mn = -moartr;
for ( nt=1; nt<=mxartr; nt++ ) for ( nt=1; nt<=mxartr; nt++ )
@ -760,7 +799,11 @@ void qualitetrte( R3 *mnpxyd,
quamoy += qualite; quamoy += qualite;
//la qualite minimale //la qualite minimale
quamin = Min( quamin, qualite ); if( qualite < quamin )
{
quamin = qualite;
ntqmin = nt;
}
//aire signee du triangle nt //aire signee du triangle nt
d = surtd2( mnpxyd[nosotr[0]-1], mnpxyd[nosotr[1]-1], mnpxyd[nosotr[2]-1] ); d = surtd2( mnpxyd[nosotr[0]-1], mnpxyd[nosotr[1]-1], mnpxyd[nosotr[2]-1] );
@ -785,7 +828,20 @@ void qualitetrte( R3 *mnpxyd,
<< " des " << nbtria << " triangles de surface plane totale=" << " des " << nbtria << " triangles de surface plane totale="
<< aire); << aire);
if( quamin<0.3 )
{
//le numero des 3 sommets du triangle ntqmin de qualite minimale
nusotr_( ntqmin, mosoar, mnsoar, moartr, mnartr, nosotr );
MESSAGE("Triangle de qualite minimale "<<quamin<<" de sommets:"
<<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);
}
if( nbtrianeg>0 ) if( nbtrianeg>0 )
MESSAGE( "ATTENTION: nombre de triangles d'aire negative=" << nbtrianeg ); MESSAGE( "ATTENTION: "<< nbtrianeg << " TRIANGLES d'AIRE NEGATIVE" );
MESSAGE(" ");
return; return;
} }

View File

@ -1,6 +1,6 @@
// SMESH MEFISTO2 : algorithm for meshing // SMESH MEFISTO2 : algorithm for meshing
// //
// Copyright (C) 2003 Laboratoire J.-L. Lions UPMC Paris // Copyright (C) 2006 Laboratoire J.-L. Lions UPMC Paris
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -21,8 +21,9 @@
// //
// //
// File : aptrte.h // File : aptrte.h
// Author: Alain PERRONNET // Author : Alain PERRONNET
// Module : SMESH // Module : SMESH
// Date : 13 novembre 2006
#ifndef aptrte__h #ifndef aptrte__h
#define aptrte__h #define aptrte__h
@ -57,10 +58,11 @@
#define MEFISTO2D_EXPORT #define MEFISTO2D_EXPORT
#endif #endif
void qualitetrte( R3 *mnpxyd, extern "C" {
Z & mosoar, Z & mxsoar, Z *mnsoar, void qualitetrte_( R3 *mnpxyd,
Z & moartr, Z & mxartr, Z *mnartr, Z & mosoar, Z & mxsoar, Z *mnsoar,
Z & nbtria, R & quamoy, R & quamin ); Z & moartr, Z & mxartr, Z *mnartr,
Z & nbtria, R & quamoy, R & quamin ); }
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// but : calculer la qualite moyenne et minimale de la triangulation // but : calculer la qualite moyenne et minimale de la triangulation
// ----- actuelle definie par les tableaux nosoar et noartr // ----- actuelle definie par les tableaux nosoar et noartr

View File

@ -1,6 +1,6 @@
c MEFISTO : library to compute 2D triangulation from segmented boundaries c MEFISTO : library to compute 2D triangulation from segmented boundaries
c c
c Copyright (C) 2003 Laboratoire J.-L. Lions UPMC Paris c Copyright (C) 2006 Laboratoire J.-L. Lions UPMC Paris
c c
c This library is free software; you can redistribute it and/or c This library is free software; you can redistribute it and/or
c modify it under the terms of the GNU Lesser General Public c modify it under the terms of the GNU Lesser General Public
@ -21,7 +21,8 @@ c
c c
c File : areteideale.f c File : areteideale.f
c Module : SMESH c Module : SMESH
c Author: Alain PERRONNET c Author : Alain PERRONNET
c Date : 13 novembre 2006
double precision function areteideale( xyz, direction ) double precision function areteideale( xyz, direction )
double precision xyz(3), direction(3) double precision xyz(3), direction(3)

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,7 @@
#include "SMESH_ActorUtils.h" #include "SMESH_ActorUtils.h"
#include "SMDS_Mesh.hxx" #include "SMDS_Mesh.hxx"
#include "SMDS_PolyhedralVolumeOfNodes.hxx"
#include "SMESH_Actor.h" #include "SMESH_Actor.h"
#include "SMESH_ControlsDef.hxx" #include "SMESH_ControlsDef.hxx"
#include "SalomeApp_Application.h" #include "SalomeApp_Application.h"
@ -345,15 +346,21 @@ void SMESH_VisualObjDef::buildElemPrs()
SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator(); SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
switch(aType){ switch(aType){
case SMDSAbs_Volume:{ case SMDSAbs_Volume:{
aConnect.clear();
std::vector<int> aConnectivities; std::vector<int> aConnectivities;
GetConnect(aNodesIter,aConnect);
// Convertions connectivities from SMDS to VTK // Convertions connectivities from SMDS to VTK
if (anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE if (anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE
for (int k = 0; k < aNbNodes; k++) {
aConnectivities.push_back(k);
}
} else if (aNbNodes == 4) { if ( const SMDS_PolyhedralVolumeOfNodes* ph =
dynamic_cast<const SMDS_PolyhedralVolumeOfNodes*> (anElem))
{
aNbNodes = GetConnect(ph->uniqueNodesIterator(),aConnect);
anIdList->SetNumberOfIds( aNbNodes );
}
for (int k = 0; k < aNbNodes; k++)
aConnectivities.push_back(k);
} else if (aNbNodes == 4) {
static int anIds[] = {0,2,1,3}; static int anIds[] = {0,2,1,3};
for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
@ -395,6 +402,9 @@ void SMESH_VisualObjDef::buildElemPrs()
else { else {
} }
if ( aConnect.empty() )
GetConnect(aNodesIter,aConnect);
if (aConnectivities.size() > 0) { if (aConnectivities.size() > 0) {
for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++) for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++)
SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]); SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]);

View File

@ -27,6 +27,8 @@
#include "SMDS_FaceOfNodes.hxx" #include "SMDS_FaceOfNodes.hxx"
#include "SMDS_IteratorOfElements.hxx" #include "SMDS_IteratorOfElements.hxx"
#include "SMDS_MeshNode.hxx" #include "SMDS_MeshNode.hxx"
#include "SMDS_Mesh.hxx"
#include "utilities.h" #include "utilities.h"
using namespace std; using namespace std;
@ -76,6 +78,33 @@ class SMDS_FaceOfNodes_MyIterator:public SMDS_NodeArrayElemIterator
SMDS_NodeArrayElemIterator( s, & s[ l ] ) {} SMDS_NodeArrayElemIterator( s, & s[ l ] ) {}
}; };
/// ===================================================================
/*!
* \brief Iterator on edges of face
*/
/// ===================================================================
class _MyEdgeIterator : public SMDS_ElemIterator
{
vector< const SMDS_MeshElement* > myElems;
int myIndex;
public:
_MyEdgeIterator(const SMDS_FaceOfNodes* face):myIndex(0) {
myElems.reserve( face->NbNodes() );
for ( int i = 0; i < face->NbNodes(); ++i ) {
const SMDS_MeshElement* edge =
SMDS_Mesh::FindEdge( face->GetNode( i ), face->GetNode( i + 1 ));
if ( edge )
myElems.push_back( edge );
}
}
/// Return true if and only if there are other object in this iterator
virtual bool more() { return myIndex < myElems.size(); }
/// Return the current object and step to the next one
virtual const SMDS_MeshElement* next() { return myElems[ myIndex++ ]; }
};
SMDS_ElemIteratorPtr SMDS_FaceOfNodes::elementsIterator SMDS_ElemIteratorPtr SMDS_FaceOfNodes::elementsIterator
(SMDSAbs_ElementType type) const (SMDSAbs_ElementType type) const
{ {
@ -86,7 +115,7 @@ SMDS_ElemIteratorPtr SMDS_FaceOfNodes::elementsIterator
case SMDSAbs_Node: case SMDSAbs_Node:
return SMDS_ElemIteratorPtr(new SMDS_FaceOfNodes_MyIterator(myNodes,myNbNodes)); return SMDS_ElemIteratorPtr(new SMDS_FaceOfNodes_MyIterator(myNodes,myNbNodes));
case SMDSAbs_Edge: case SMDSAbs_Edge:
MESSAGE("Error : edge iterator for SMDS_FaceOfNodes not implemented"); return SMDS_ElemIteratorPtr(new _MyEdgeIterator( this ));
break; break;
default: default:
return SMDS_ElemIteratorPtr return SMDS_ElemIteratorPtr

View File

@ -1259,20 +1259,18 @@ const SMDS_MeshEdge* SMDS_Mesh::FindEdge(int idnode1, int idnode2) const
const SMDS_MeshEdge* SMDS_Mesh::FindEdge(const SMDS_MeshNode * node1, const SMDS_MeshEdge* SMDS_Mesh::FindEdge(const SMDS_MeshNode * node1,
const SMDS_MeshNode * node2) const SMDS_MeshNode * node2)
{ {
if ( !node1 ) return 0;
const SMDS_MeshEdge * toReturn=NULL; const SMDS_MeshEdge * toReturn=NULL;
//PROFILER_Init(); //PROFILER_Init();
//PROFILER_Set(); //PROFILER_Set();
SMDS_ElemIteratorPtr it1=node1->edgesIterator(); SMDS_ElemIteratorPtr it1=node1->GetInverseElementIterator(SMDSAbs_Edge);
//PROFILER_Get(0); //PROFILER_Get(0);
//PROFILER_Set(); //PROFILER_Set();
while(it1->more()) { while(it1->more()) {
const SMDS_MeshEdge * e=static_cast<const SMDS_MeshEdge *> (it1->next()); const SMDS_MeshElement * e = it1->next();
SMDS_ElemIteratorPtr it2=e->nodesIterator(); if ( e->NbNodes() == 2 && e->GetNodeIndex( node2 ) >= 0 ) {
while(it2->more()) { toReturn = static_cast<const SMDS_MeshEdge*>( e );
if(it2->next()->GetID()==node2->GetID()) { break;
toReturn = e;
break;
}
} }
} }
//PROFILER_Get(1); //PROFILER_Get(1);
@ -1317,25 +1315,27 @@ const SMDS_MeshEdge* SMDS_Mesh::FindEdge(const SMDS_MeshNode * node1,
const SMDS_MeshNode * node2, const SMDS_MeshNode * node2,
const SMDS_MeshNode * node3) const SMDS_MeshNode * node3)
{ {
if ( !node1 || !node2 || !node3 ) return 0; if ( !node1 ) return 0;
const SMDS_MeshEdge * toReturn = NULL; SMDS_ElemIteratorPtr it1 = node1->GetInverseElementIterator(SMDSAbs_Edge);
SMDS_ElemIteratorPtr it1 = node1->edgesIterator();
while(it1->more()) { while(it1->more()) {
const SMDS_MeshEdge * e = static_cast<const SMDS_MeshEdge *> (it1->next()); const SMDS_MeshElement * e = it1->next();
SMDS_ElemIteratorPtr it2 = e->nodesIterator(); if ( e->NbNodes() == 3 ) {
int tmp = 0; SMDS_ElemIteratorPtr it2 = e->nodesIterator();
while(it2->more()) { while(it2->more()) {
int nID = it2->next()->GetID(); const SMDS_MeshElement* n = it2->next();
if( nID==node2->GetID() || nID==node3->GetID() ) { if( n!=node1 &&
tmp++; n!=node2 &&
if(tmp==2) { n!=node3 )
toReturn = e; {
e = 0;
break; break;
} }
} }
if ( e )
return static_cast<const SMDS_MeshEdge *> (e);
} }
} }
return toReturn; return 0;
} }
@ -1357,27 +1357,27 @@ const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1,
const SMDS_MeshNode *node2, const SMDS_MeshNode *node2,
const SMDS_MeshNode *node3) const SMDS_MeshNode *node3)
{ {
if ( !node1 || !node2 || !node3 ) return 0; if ( !node1 ) return 0;
const SMDS_MeshFace * face; SMDS_ElemIteratorPtr it1 = node1->GetInverseElementIterator(SMDSAbs_Face);
const SMDS_MeshElement * node;
bool node2found, node3found;
SMDS_ElemIteratorPtr it1 = node1->facesIterator();
while(it1->more()) { while(it1->more()) {
face = static_cast<const SMDS_MeshFace*>(it1->next()); const SMDS_MeshElement * e = it1->next();
if(face->NbNodes()!=3) continue; if ( e->NbNodes() == 3 ) {
SMDS_ElemIteratorPtr it2 = face->nodesIterator(); SMDS_ElemIteratorPtr it2 = e->nodesIterator();
node2found = false; while(it2->more()) {
node3found = false; const SMDS_MeshElement* n = it2->next();
while(it2->more()) { if( n!=node1 &&
node = it2->next(); n!=node2 &&
if(node->GetID()==node2->GetID()) node2found = true; n!=node3 )
if(node->GetID()==node3->GetID()) node3found = true; {
e = 0;
break;
}
}
if ( e )
return static_cast<const SMDS_MeshFace *> (e);
} }
if( node2found && node3found )
return face;
} }
return NULL; return 0;
} }
SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate(const SMDS_MeshNode *node1, SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate(const SMDS_MeshNode *node1,
@ -1413,29 +1413,28 @@ const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1,
const SMDS_MeshNode *node3, const SMDS_MeshNode *node3,
const SMDS_MeshNode *node4) const SMDS_MeshNode *node4)
{ {
if( (node1==NULL) || (node2==NULL) || (node3==NULL) || (node4==NULL) ) if ( !node1 ) return 0;
return NULL; SMDS_ElemIteratorPtr it1 = node1->GetInverseElementIterator(SMDSAbs_Face);
const SMDS_MeshFace * face;
const SMDS_MeshElement * node;
bool node2found, node3found, node4found;
SMDS_ElemIteratorPtr it1 = node1->facesIterator();
while(it1->more()) { while(it1->more()) {
face = static_cast<const SMDS_MeshFace *>(it1->next()); const SMDS_MeshElement * e = it1->next();
if(face->NbNodes()!=4) continue; if ( e->NbNodes() == 4 ) {
SMDS_ElemIteratorPtr it2 = face->nodesIterator(); SMDS_ElemIteratorPtr it2 = e->nodesIterator();
node2found = false; while(it2->more()) {
node3found = false; const SMDS_MeshElement* n = it2->next();
node4found = false; if( n!=node1 &&
while(it2->more()) { n!=node2 &&
node=it2->next(); n!=node3 &&
if(node->GetID()==node2->GetID()) node2found = true; n!=node4 )
if(node->GetID()==node3->GetID()) node3found = true; {
if(node->GetID()==node4->GetID()) node4found = true; e = 0;
break;
}
}
if ( e )
return static_cast<const SMDS_MeshFace *> (e);
} }
if( node2found && node3found && node4found )
return face;
} }
return NULL; return 0;
} }
SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate(const SMDS_MeshNode *node1, SMDS_MeshFace* SMDS_Mesh::FindFaceOrCreate(const SMDS_MeshNode *node1,
@ -1477,28 +1476,30 @@ const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1,
const SMDS_MeshNode *node5, const SMDS_MeshNode *node5,
const SMDS_MeshNode *node6) const SMDS_MeshNode *node6)
{ {
if( (node1==NULL) || (node2==NULL) || (node3==NULL) || if ( !node1 ) return 0;
(node4==NULL) || (node5==NULL) || (node6==NULL) ) return NULL; SMDS_ElemIteratorPtr it1 = node1->GetInverseElementIterator(SMDSAbs_Face);
const SMDS_MeshFace * face;
const SMDS_MeshElement * node;
SMDS_ElemIteratorPtr it1 = node1->facesIterator();
while(it1->more()) { while(it1->more()) {
face = static_cast<const SMDS_MeshFace*>(it1->next()); const SMDS_MeshElement * e = it1->next();
if(face->NbNodes()!=6) continue; if ( e->NbNodes() == 6 ) {
SMDS_ElemIteratorPtr it2 = face->nodesIterator(); SMDS_ElemIteratorPtr it2 = e->nodesIterator();
int tmp = 0; while(it2->more()) {
while(it2->more()) { const SMDS_MeshElement* n = it2->next();
node = it2->next(); if( n!=node1 &&
if(node->GetID()==node2->GetID()) tmp++; n!=node2 &&
if(node->GetID()==node3->GetID()) tmp++; n!=node3 &&
if(node->GetID()==node4->GetID()) tmp++; n!=node4 &&
if(node->GetID()==node5->GetID()) tmp++; n!=node5 &&
if(node->GetID()==node6->GetID()) tmp++; n!=node6 )
{
e = 0;
break;
}
}
if ( e )
return static_cast<const SMDS_MeshFace *> (e);
} }
if( tmp==5 )
return static_cast<const SMDS_MeshFace*>(face);
} }
return NULL; return 0;
} }
@ -1532,31 +1533,32 @@ const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1,
const SMDS_MeshNode *node7, const SMDS_MeshNode *node7,
const SMDS_MeshNode *node8) const SMDS_MeshNode *node8)
{ {
if( (node1==NULL) || (node2==NULL) || (node3==NULL) || (node4==NULL) || if ( !node1 ) return 0;
(node5==NULL) || (node6==NULL) || (node7==NULL) || (node8==NULL) ) SMDS_ElemIteratorPtr it1 = node1->GetInverseElementIterator(SMDSAbs_Face);
return NULL;
const SMDS_MeshFace * face;
const SMDS_MeshElement * node;
SMDS_ElemIteratorPtr it1 = node1->facesIterator();
while(it1->more()) { while(it1->more()) {
face = static_cast<const SMDS_MeshFace *>(it1->next()); const SMDS_MeshElement * e = it1->next();
if(face->NbNodes()!=8) continue; if ( e->NbNodes() == 8 ) {
SMDS_ElemIteratorPtr it2 = face->nodesIterator(); SMDS_ElemIteratorPtr it2 = e->nodesIterator();
int tmp = 0; while(it2->more()) {
while(it2->more()) { const SMDS_MeshElement* n = it2->next();
node = it2->next(); if( n!=node1 &&
if(node->GetID()==node2->GetID()) tmp++; n!=node2 &&
if(node->GetID()==node3->GetID()) tmp++; n!=node3 &&
if(node->GetID()==node4->GetID()) tmp++; n!=node4 &&
if(node->GetID()==node5->GetID()) tmp++; n!=node5 &&
if(node->GetID()==node6->GetID()) tmp++; n!=node6 &&
if(node->GetID()==node7->GetID()) tmp++; n!=node7 &&
if(node->GetID()==node8->GetID()) tmp++; n!=node8 )
{
e = 0;
break;
}
}
if ( e )
return static_cast<const SMDS_MeshFace *> (e);
} }
if( tmp==7 )
return face;
} }
return NULL; return 0;
} }
@ -1588,36 +1590,23 @@ const SMDS_MeshFace* SMDS_Mesh::FindFace (std::vector<int> nodes_ids) const
const SMDS_MeshFace* SMDS_Mesh::FindFace (std::vector<const SMDS_MeshNode *> nodes) const SMDS_MeshFace* SMDS_Mesh::FindFace (std::vector<const SMDS_MeshNode *> nodes)
{ {
int nbNodes = nodes.size(); if ( nodes.size() > 2 && nodes[0] ) {
if (nbNodes < 1) return NULL; SMDS_ElemIteratorPtr itF = nodes[0]->GetInverseElementIterator(SMDSAbs_Face);
bool isFound = true;
const SMDS_MeshFace * face;
set<const SMDS_MeshFace *> faces;
for (int inode = 0; inode < nbNodes && isFound; inode++) {
if ( !nodes[ inode ]) return 0;
set<const SMDS_MeshFace *> new_faces;
SMDS_ElemIteratorPtr itF = nodes[inode]->facesIterator();
while (itF->more()) { while (itF->more()) {
face = static_cast<const SMDS_MeshFace *>(itF->next()); const SMDS_MeshElement* f = itF->next();
if (face->NbNodes() == nbNodes) { if ( f->NbNodes() == nodes.size() ) {
if (inode == 0 || faces.find(face) != faces.end()) { SMDS_ElemIteratorPtr it2 = f->nodesIterator();
new_faces.insert(face); while(it2->more()) {
if ( find( nodes.begin(), nodes.end(), it2->next() ) == nodes.end() ) {
f = 0;
break;
}
} }
if ( f )
return static_cast<const SMDS_MeshFace *> (f);
} }
} }
faces = new_faces;
if (new_faces.size() == 0) {
isFound = false;
}
} }
if (isFound)
return face;
return NULL; return NULL;
} }

View File

@ -88,16 +88,28 @@ const SMDS_PositionPtr& SMDS_MeshNode::GetPosition() const
return myPosition; return myPosition;
} }
//=======================================================================
/*!
* \brief Iterator on list of elements
*/
//=======================================================================
class SMDS_MeshNode_MyInvIterator:public SMDS_ElemIterator class SMDS_MeshNode_MyInvIterator:public SMDS_ElemIterator
{ {
NCollection_List<const SMDS_MeshElement*>::Iterator myIterator; NCollection_List<const SMDS_MeshElement*>::Iterator myIterator;
SMDSAbs_ElementType myType;
public: public:
SMDS_MeshNode_MyInvIterator(const NCollection_List<const SMDS_MeshElement*>& s): SMDS_MeshNode_MyInvIterator(const NCollection_List<const SMDS_MeshElement*>& s,
myIterator(s) SMDSAbs_ElementType type):
myIterator(s), myType(type)
{} {}
bool more() bool more()
{ {
if ( myType != SMDSAbs_All ) {
while ( myIterator.More() && myIterator.Value()->GetType() != myType)
myIterator.Next();
}
return myIterator.More() != Standard_False; return myIterator.More() != Standard_False;
} }
@ -110,9 +122,9 @@ class SMDS_MeshNode_MyInvIterator:public SMDS_ElemIterator
}; };
SMDS_ElemIteratorPtr SMDS_MeshNode:: SMDS_ElemIteratorPtr SMDS_MeshNode::
GetInverseElementIterator() const GetInverseElementIterator(SMDSAbs_ElementType type) const
{ {
return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(myInverseElements)); return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(myInverseElements,type));
} }
// Same as GetInverseElementIterator but the create iterator only return // Same as GetInverseElementIterator but the create iterator only return
@ -228,6 +240,24 @@ bool SMDS_MeshNode::emptyInverseElements()
return myInverseElements.IsEmpty() != Standard_False; return myInverseElements.IsEmpty() != Standard_False;
} }
//================================================================================
/*!
* \brief Count inverse elements of given type
*/
//================================================================================
int SMDS_MeshNode::NbInverseNodes(SMDSAbs_ElementType type) const
{
if ( type == SMDSAbs_All )
return myInverseElements.Extent();
int nb = 0;
NCollection_List<const SMDS_MeshElement*>::Iterator it( myInverseElements );
for ( ; it.More(); it.Next() )
if ( it.Value()->GetType() == type )
nb++;
return nb;
}
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// To be used with STL set /// To be used with STL set
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -46,7 +46,8 @@ class SMDS_EXPORT SMDS_MeshNode:public SMDS_MeshElement
void RemoveInverseElement(const SMDS_MeshElement * parent); void RemoveInverseElement(const SMDS_MeshElement * parent);
void ClearInverseElements(); void ClearInverseElements();
bool emptyInverseElements(); bool emptyInverseElements();
SMDS_ElemIteratorPtr GetInverseElementIterator() const; SMDS_ElemIteratorPtr GetInverseElementIterator(SMDSAbs_ElementType type=SMDSAbs_All) const;
int NbInverseNodes(SMDSAbs_ElementType type=SMDSAbs_All) const;
void SetPosition(const SMDS_PositionPtr& aPos); void SetPosition(const SMDS_PositionPtr& aPos);
const SMDS_PositionPtr& GetPosition() const; const SMDS_PositionPtr& GetPosition() const;
SMDSAbs_ElementType GetType() const; SMDSAbs_ElementType GetType() const;

View File

@ -27,6 +27,8 @@
#include "SMDS_IteratorOfElements.hxx" #include "SMDS_IteratorOfElements.hxx"
#include "SMDS_SetIterator.hxx" #include "SMDS_SetIterator.hxx"
#include "SMDS_Mesh.hxx"
#include "utilities.h" #include "utilities.h"
using namespace std; using namespace std;
@ -135,6 +137,33 @@ class SMDS_PolygonalFaceOfNodes_MyIterator:public SMDS_NodeVectorElemIterator
SMDS_NodeVectorElemIterator( s.begin(), s.end() ) {} SMDS_NodeVectorElemIterator( s.begin(), s.end() ) {}
}; };
/// ===================================================================
/*!
* \brief Iterator on edges of face
*/
/// ===================================================================
class _MyEdgeIterator : public SMDS_ElemIterator
{
vector< const SMDS_MeshElement* > myElems;
int myIndex;
public:
_MyEdgeIterator(const SMDS_MeshFace* face):myIndex(0) {
myElems.reserve( face->NbNodes() );
for ( int i = 0; i < face->NbNodes(); ++i ) {
const SMDS_MeshElement* edge =
SMDS_Mesh::FindEdge( face->GetNode( i ), face->GetNode( i + 1 ));
if ( edge )
myElems.push_back( edge );
}
}
/// Return true if and only if there are other object in this iterator
virtual bool more() { return myIndex < myElems.size(); }
/// Return the current object and step to the next one
virtual const SMDS_MeshElement* next() { return myElems[ myIndex++ ]; }
};
SMDS_ElemIteratorPtr SMDS_PolygonalFaceOfNodes::elementsIterator SMDS_ElemIteratorPtr SMDS_PolygonalFaceOfNodes::elementsIterator
(SMDSAbs_ElementType type) const (SMDSAbs_ElementType type) const
{ {
@ -145,7 +174,7 @@ SMDS_ElemIteratorPtr SMDS_PolygonalFaceOfNodes::elementsIterator
case SMDSAbs_Node: case SMDSAbs_Node:
return SMDS_ElemIteratorPtr(new SMDS_PolygonalFaceOfNodes_MyIterator(myNodes)); return SMDS_ElemIteratorPtr(new SMDS_PolygonalFaceOfNodes_MyIterator(myNodes));
case SMDSAbs_Edge: case SMDSAbs_Edge:
MESSAGE("Error : edge iterator for SMDS_PolygonalFaceOfNodes not implemented"); return SMDS_ElemIteratorPtr(new _MyEdgeIterator( this ));
break; break;
default: default:
return SMDS_ElemIteratorPtr return SMDS_ElemIteratorPtr

View File

@ -25,6 +25,8 @@
#include "SMDS_PolyhedralVolumeOfNodes.hxx" #include "SMDS_PolyhedralVolumeOfNodes.hxx"
#include "SMDS_MeshNode.hxx" #include "SMDS_MeshNode.hxx"
#include "SMDS_SetIterator.hxx"
#include "SMDS_VolumeTool.hxx"
#include "utilities.h" #include "utilities.h"
#include <set> #include <set>
@ -36,8 +38,8 @@ using namespace std;
//purpose : Create a volume of many faces //purpose : Create a volume of many faces
//======================================================================= //=======================================================================
SMDS_PolyhedralVolumeOfNodes::SMDS_PolyhedralVolumeOfNodes SMDS_PolyhedralVolumeOfNodes::SMDS_PolyhedralVolumeOfNodes
(std::vector<const SMDS_MeshNode *> nodes, (vector<const SMDS_MeshNode *> nodes,
std::vector<int> quantities) vector<int> quantities)
: SMDS_VolumeOfNodes(NULL, NULL, NULL, NULL) : SMDS_VolumeOfNodes(NULL, NULL, NULL, NULL)
{ {
ChangeNodes(nodes, quantities); ChangeNodes(nodes, quantities);
@ -57,51 +59,36 @@ SMDSAbs_ElementType SMDS_PolyhedralVolumeOfNodes::GetType() const
//function : ChangeNodes //function : ChangeNodes
//purpose : //purpose :
//======================================================================= //=======================================================================
bool SMDS_PolyhedralVolumeOfNodes::ChangeNodes (std::vector<const SMDS_MeshNode *> nodes, bool SMDS_PolyhedralVolumeOfNodes::ChangeNodes (const vector<const SMDS_MeshNode *>& nodes,
std::vector<int> quantities) const vector<int>& quantities)
{ {
myNodesByFaces = nodes; myNodesByFaces = nodes;
myQuantities = quantities; myQuantities = quantities;
// Init fields of parent class // Init fields of parent class, it allows to get only unique nodes(?)
int aNbNodes = 0;
std::set<const SMDS_MeshNode *> aSet;
int nodes_len = nodes.size();
for (int j = 0; j < nodes_len; j++) {
if (aSet.find(nodes[j]) == aSet.end()) {
aSet.insert(nodes[j]);
aNbNodes++;
}
}
int k = 0;
#ifndef WNT
const SMDS_MeshNode* aNodes [aNbNodes];
#else
const SMDS_MeshNode** aNodes = (const SMDS_MeshNode **)new SMDS_MeshNode*[aNbNodes];
#endif
std::set<const SMDS_MeshNode *>::iterator anIter = aSet.begin();
for (; anIter != aSet.end(); anIter++, k++) {
aNodes[k] = *anIter;
}
set<const SMDS_MeshNode *> aSet;
aSet.insert( nodes.begin(), nodes.end());
//SMDS_VolumeOfNodes::ChangeNodes(aNodes, aNbNodes); //SMDS_VolumeOfNodes::ChangeNodes(aNodes, aNbNodes);
delete [] myNodes; delete [] myNodes;
//myNbNodes = nodes.size(); myNbNodes = aSet.size();
myNbNodes = aNbNodes;
myNodes = new const SMDS_MeshNode* [myNbNodes]; myNodes = new const SMDS_MeshNode* [myNbNodes];
for (int i = 0; i < myNbNodes; i++) { set<const SMDS_MeshNode *>::iterator anIter = aSet.begin();
//myNodes[i] = nodes[i]; for (int k=0; anIter != aSet.end(); anIter++, k++)
myNodes[i] = aNodes[i]; myNodes[k] = *anIter;
}
#ifdef WNT
delete [] aNodes;
#endif
return true; return true;
} }
//=======================================================================
//function : NbEdges
//purpose :
//=======================================================================
int SMDS_PolyhedralVolumeOfNodes::NbNodes() const
{
return myNodesByFaces.size();
}
//======================================================================= //=======================================================================
//function : NbEdges //function : NbEdges
//purpose : //purpose :
@ -188,3 +175,87 @@ bool SMDS_PolyhedralVolumeOfNodes::ChangeNodes (const SMDS_MeshNode* nodes[],
{ {
return false; return false;
} }
/// ===================================================================
/*!
* \brief Iterator on node of volume
*/
/// ===================================================================
struct _MyIterator:public SMDS_NodeVectorElemIterator
{
_MyIterator(const vector<const SMDS_MeshNode *>& nodes):
SMDS_NodeVectorElemIterator( nodes.begin(), nodes.end()) {}
};
/// ===================================================================
/*!
* \brief Iterator on faces or edges of volume
*/
/// ===================================================================
class _MySubIterator : public SMDS_ElemIterator
{
vector< const SMDS_MeshElement* > myElems;
int myIndex;
public:
_MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) {
SMDS_VolumeTool vTool(vol);
if (type == SMDSAbs_Face)
vTool.GetAllExistingFaces( myElems );
else
vTool.GetAllExistingFaces( myElems );
}
/// Return true if and only if there are other object in this iterator
virtual bool more() { return myIndex < myElems.size(); }
/// Return the current object and step to the next one
virtual const SMDS_MeshElement* next() { return myElems[ myIndex++ ]; }
};
//================================================================================
/*!
* \brief Return Iterator of sub elements
*/
//================================================================================
SMDS_ElemIteratorPtr SMDS_PolyhedralVolumeOfNodes::elementsIterator(SMDSAbs_ElementType type) const
{
switch(type)
{
case SMDSAbs_Volume:
return SMDS_MeshElement::elementsIterator(SMDSAbs_Volume);
case SMDSAbs_Node:
return SMDS_ElemIteratorPtr(new _MyIterator(myNodesByFaces));
case SMDSAbs_Face:
return SMDS_ElemIteratorPtr(new _MySubIterator(this,SMDSAbs_Face));
case SMDSAbs_Edge:
return SMDS_ElemIteratorPtr(new _MySubIterator(this,SMDSAbs_Edge));
default:
MESSAGE("ERROR : Iterator not implemented");
return SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL);
}
}
//================================================================================
/*!
* \brief Return iterator on unique nodes
*/
//================================================================================
SMDS_ElemIteratorPtr SMDS_PolyhedralVolumeOfNodes::uniqueNodesIterator() const
{
return SMDS_ElemIteratorPtr
(new SMDS_NodeArrayElemIterator( myNodes, & myNodes[ myNbNodes ]));
}
//================================================================================
/*!
* \brief Return node by its index
*/
//================================================================================
const SMDS_MeshNode* SMDS_PolyhedralVolumeOfNodes::GetNode(const int ind) const
{
return myNodesByFaces[ WrappedIndex( ind )];
}

View File

@ -42,10 +42,10 @@ class SMDS_EXPORT SMDS_PolyhedralVolumeOfNodes:public SMDS_VolumeOfNodes
virtual SMDSAbs_ElementType GetType() const; virtual SMDSAbs_ElementType GetType() const;
virtual bool IsPoly() const { return true; }; virtual bool IsPoly() const { return true; };
bool ChangeNodes (std::vector<const SMDS_MeshNode *> nodes, bool ChangeNodes (const std::vector<const SMDS_MeshNode *> & nodes,
std::vector<int> quantities); const std::vector<int> & quantities);
//virtual int NbNodes() const; virtual int NbNodes() const;
virtual int NbEdges() const; virtual int NbEdges() const;
virtual int NbFaces() const; virtual int NbFaces() const;
@ -56,10 +56,26 @@ class SMDS_EXPORT SMDS_PolyhedralVolumeOfNodes:public SMDS_VolumeOfNodes
// 1 <= face_ind <= NbFaces() // 1 <= face_ind <= NbFaces()
// 1 <= node_ind <= NbFaceNodes() // 1 <= node_ind <= NbFaceNodes()
const std::vector<int> & GetQuanities() const { return myQuantities; }
virtual void Print (std::ostream & OS) const; virtual void Print (std::ostream & OS) const;
protected: /*!
//virtual SMDS_ElemIteratorPtr elementsIterator (SMDSAbs_ElementType type) const; * \brief Return node by its index
*/
virtual const SMDS_MeshNode* GetNode(const int ind) const;
/*!
* \brief Return iterator on unique nodes
*/
SMDS_ElemIteratorPtr uniqueNodesIterator() const;
/*!
* \brief Return nb of unique nodes
*/
int NbUniqueNodes() const { return myNbNodes; }
protected:
SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const;
private: private:
// usage disabled // usage disabled

View File

@ -30,6 +30,7 @@
#include "SMDS_SetIterator.hxx" #include "SMDS_SetIterator.hxx"
#include "SMDS_IteratorOfElements.hxx" #include "SMDS_IteratorOfElements.hxx"
#include "SMDS_MeshNode.hxx" #include "SMDS_MeshNode.hxx"
#include "SMDS_Mesh.hxx"
#include "utilities.h" #include "utilities.h"
@ -241,6 +242,35 @@ SMDS_ElemIteratorPtr SMDS_QuadraticFaceOfNodes::interlacedNodesElemIterator() co
return SMDS_ElemIteratorPtr return SMDS_ElemIteratorPtr
(new _MyInterlacedNodeElemIterator ( interlacedNodesIterator() )); (new _MyInterlacedNodeElemIterator ( interlacedNodesIterator() ));
} }
/// ===================================================================
/*!
* \brief Iterator on edges of face
*/
/// ===================================================================
class _MyEdgeIterator : public SMDS_ElemIterator
{
vector< const SMDS_MeshElement* > myElems;
int myIndex;
public:
_MyEdgeIterator(const SMDS_QuadraticFaceOfNodes* face):myIndex(0) {
myElems.reserve( face->NbNodes() );
SMDS_ElemIteratorPtr nIt = face->interlacedNodesElemIterator();
const SMDS_MeshNode* n0 = face->GetNode( -1 );
while ( nIt->more() ) {
const SMDS_MeshNode* n1 = static_cast<const SMDS_MeshNode*>( nIt->next() );
const SMDS_MeshElement* edge = SMDS_Mesh::FindEdge( n0, n1 );
if ( edge )
myElems.push_back( edge );
n0 = n1;
}
}
/// Return true if and only if there are other object in this iterator
virtual bool more() { return myIndex < myElems.size(); }
/// Return the current object and step to the next one
virtual const SMDS_MeshElement* next() { return myElems[ myIndex++ ]; }
};
//======================================================================= //=======================================================================
//function : elementsIterator //function : elementsIterator
@ -257,7 +287,7 @@ SMDS_ElemIteratorPtr SMDS_QuadraticFaceOfNodes::elementsIterator
case SMDSAbs_Node: case SMDSAbs_Node:
return SMDS_ElemIteratorPtr(new _MyNodeIterator(myNodes)); return SMDS_ElemIteratorPtr(new _MyNodeIterator(myNodes));
case SMDSAbs_Edge: case SMDSAbs_Edge:
MESSAGE("Error : edge iterator for SMDS_QuadraticFaceOfNodes not implemented"); return SMDS_ElemIteratorPtr(new _MyEdgeIterator( this ));
break; break;
default: default:
return SMDS_ElemIteratorPtr return SMDS_ElemIteratorPtr

View File

@ -30,6 +30,7 @@
#include "SMDS_IteratorOfElements.hxx" #include "SMDS_IteratorOfElements.hxx"
#include "SMDS_MeshNode.hxx" #include "SMDS_MeshNode.hxx"
#include "SMDS_SetIterator.hxx" #include "SMDS_SetIterator.hxx"
#include "SMDS_VolumeTool.hxx"
#include "utilities.h" #include "utilities.h"
@ -304,6 +305,31 @@ public:
SMDS_NodeVectorElemIterator( s.begin(), s.end() ) {} SMDS_NodeVectorElemIterator( s.begin(), s.end() ) {}
}; };
/// ===================================================================
/*!
* \brief Iterator on faces or edges of volume
*/
/// ===================================================================
class _MySubIterator : public SMDS_ElemIterator
{
vector< const SMDS_MeshElement* > myElems;
int myIndex;
public:
_MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) {
SMDS_VolumeTool vTool(vol);
if (type == SMDSAbs_Face)
vTool.GetAllExistingFaces( myElems );
else
vTool.GetAllExistingFaces( myElems );
}
/// Return true if and only if there are other object in this iterator
virtual bool more() { return myIndex < myElems.size(); }
/// Return the current object and step to the next one
virtual const SMDS_MeshElement* next() { return myElems[ myIndex++ ]; }
};
//======================================================================= //=======================================================================
//function : elementsIterator //function : elementsIterator
//purpose : //purpose :
@ -319,10 +345,10 @@ SMDS_ElemIteratorPtr SMDS_QuadraticVolumeOfNodes::elementsIterator
case SMDSAbs_Node: case SMDSAbs_Node:
return SMDS_ElemIteratorPtr(new SMDS_QuadraticVolumeOfNodes_MyIterator(myNodes)); return SMDS_ElemIteratorPtr(new SMDS_QuadraticVolumeOfNodes_MyIterator(myNodes));
case SMDSAbs_Edge: case SMDSAbs_Edge:
MESSAGE("Error : edge iterator for SMDS_QuadraticVolumeOfNodes not implemented"); return SMDS_ElemIteratorPtr(new _MySubIterator(this,SMDSAbs_Edge));
break; break;
case SMDSAbs_Face: case SMDSAbs_Face:
MESSAGE("Error : face iterator for SMDS_QuadraticVolumeOfNodes not implemented"); return SMDS_ElemIteratorPtr(new _MySubIterator(this,SMDSAbs_Face));
break; break;
default: default:
return SMDS_ElemIteratorPtr return SMDS_ElemIteratorPtr

View File

@ -32,13 +32,37 @@
#include "SMDS_Iterator.hxx" #include "SMDS_Iterator.hxx"
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// specific SMDS_Iterator iterating over abstract set of values like STL containers /// Accessors to value pointed by iterator
///////////////////////////////////////////////////////////////////////////////
namespace SMDS {
template<typename VALUE,typename VALUE_SET_ITERATOR>
struct SimpleAccessor {
static VALUE value(VALUE_SET_ITERATOR it) { return (VALUE) *it; }
};
template<typename VALUE,typename VALUE_SET_ITERATOR>
struct KeyAccessor {
static VALUE value(VALUE_SET_ITERATOR it) { return (VALUE) it->first; }
};
template<typename VALUE,typename VALUE_SET_ITERATOR>
struct ValueAccessor {
static VALUE value(VALUE_SET_ITERATOR it) { return (VALUE) it->second; }
};
}
///////////////////////////////////////////////////////////////////////////////
/// SMDS_Iterator iterating over abstract set of values like STL containers
/// ///
/// BE CAREFUL: iterator pointed value is static_cast'ed to VALUE /// BE CAREFUL: iterator pointed value is static_cast'ed to VALUE
/// ///
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
template<typename VALUE, typename VALUE_SET_ITERATOR> template<typename VALUE,
typename VALUE_SET_ITERATOR,
typename ACCESOR=SMDS::SimpleAccessor<VALUE,VALUE_SET_ITERATOR> >
class SMDS_SetIterator : public SMDS_Iterator<VALUE> class SMDS_SetIterator : public SMDS_Iterator<VALUE>
{ {
protected: protected:
@ -57,11 +81,67 @@ public:
virtual bool more() { return _beg != _end; } virtual bool more() { return _beg != _end; }
/// Return the current object and step to the next one /// Return the current object and step to the next one
virtual VALUE next() { return static_cast<VALUE>( *_beg++ ); } virtual VALUE next() { return ACCESOR::value( _beg++ ); }
}; };
///////////////////////////////////////////////////////////////////////////////
/// map iterators
///////////////////////////////////////////////////////////////////////////////
#include <map>
/*!
* \brief iterator on values of a map
*/
template<typename M>
struct SMDS_mapIterator : public SMDS_SetIterator< typename M::mapped_type, typename M::const_iterator,
SMDS::ValueAccessor<typename M::mapped_type,
typename M::const_iterator> > {
typedef SMDS_SetIterator< typename M::mapped_type, typename M::const_iterator,
SMDS::ValueAccessor<typename M::mapped_type,
typename M::const_iterator> > parent_type;
SMDS_mapIterator(const M& m):parent_type(m.begin(),m.end()) {}
};
/*!
* \brief reverse iterator on values of a map
*/
template<typename M>
struct SMDS_mapReverseIterator : public SMDS_SetIterator< typename M::mapped_type,
typename M::const_reverse_iterator,
SMDS::ValueAccessor<typename M::mapped_type,
typename M::const_reverse_iterator> > {
typedef SMDS_SetIterator< typename M::mapped_type, typename M::const_reverse_iterator,
SMDS::ValueAccessor<typename M::mapped_type,
typename M::const_reverse_iterator> > parent_type;
SMDS_mapReverseIterator(const M& m):parent_type(m.rbegin(),m.rend()) {}
};
/*!
* \brief iterator on keys of a map
*/
template<typename M>
struct SMDS_mapKeyIterator : public SMDS_SetIterator< typename M::key_type, typename M::const_iterator,
SMDS::KeyAccessor<typename M::key_type,
typename M::const_iterator> > {
typedef SMDS_SetIterator< typename M::key_type, typename M::const_iterator,
SMDS::KeyAccessor<typename M::key_type,
typename M::const_iterator> > parent_type;
SMDS_mapKeyIterator(const M& m):parent_type(m.begin(),m.end()) {}
};
/*!
* \brief reverse iterator on keys of a map
*/
template<typename M>
struct SMDS_mapKeyReverseIterator : public SMDS_SetIterator< typename M::key_type, typename M::const_iterator,
SMDS::KeyAccessor<typename M::key_type,
typename M::const_iterator> > {
typedef SMDS_SetIterator< typename M::key_type, typename M::const_iterator,
SMDS::KeyAccessor<typename M::key_type,
typename M::const_iterator> > parent_type;
SMDS_mapKeyReverseIterator(const M& m):parent_type(m.rbegin(),m.rend()) {}
};
///////////////////////////////////////////////////////////////////////////////
// useful specifications // useful specifications
///////////////////////////////////////////////////////////////////////////////
#include <vector> #include <vector>

View File

@ -26,8 +26,11 @@
#include "SMDS_VolumeOfNodes.hxx" #include "SMDS_VolumeOfNodes.hxx"
#include "SMDS_MeshNode.hxx" #include "SMDS_MeshNode.hxx"
#include "SMDS_SetIterator.hxx" #include "SMDS_SetIterator.hxx"
#include "SMDS_VolumeTool.hxx"
#include "utilities.h" #include "utilities.h"
#include <vector>
using namespace std; using namespace std;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -171,6 +174,12 @@ int SMDS_VolumeOfNodes::NbEdges() const
return 0; return 0;
} }
/// ===================================================================
/*!
* \brief Iterator on node of volume
*/
/// ===================================================================
class SMDS_VolumeOfNodes_MyIterator:public SMDS_NodeArrayElemIterator class SMDS_VolumeOfNodes_MyIterator:public SMDS_NodeArrayElemIterator
{ {
public: public:
@ -178,6 +187,31 @@ class SMDS_VolumeOfNodes_MyIterator:public SMDS_NodeArrayElemIterator
SMDS_NodeArrayElemIterator( s, & s[ l ]) {} SMDS_NodeArrayElemIterator( s, & s[ l ]) {}
}; };
/// ===================================================================
/*!
* \brief Iterator on faces or edges of volume
*/
/// ===================================================================
class _MySubIterator : public SMDS_ElemIterator
{
vector< const SMDS_MeshElement* > myElems;
int myIndex;
public:
_MySubIterator(const SMDS_VolumeOfNodes* vol, SMDSAbs_ElementType type):myIndex(0) {
SMDS_VolumeTool vTool(vol);
if (type == SMDSAbs_Face)
vTool.GetAllExistingFaces( myElems );
else
vTool.GetAllExistingFaces( myElems );
}
/// Return true if and only if there are other object in this iterator
virtual bool more() { return myIndex < myElems.size(); }
/// Return the current object and step to the next one
virtual const SMDS_MeshElement* next() { return myElems[ myIndex++ ]; }
};
SMDS_ElemIteratorPtr SMDS_VolumeOfNodes::elementsIterator(SMDSAbs_ElementType type) const SMDS_ElemIteratorPtr SMDS_VolumeOfNodes::elementsIterator(SMDSAbs_ElementType type) const
{ {
switch(type) switch(type)
@ -186,6 +220,10 @@ SMDS_ElemIteratorPtr SMDS_VolumeOfNodes::elementsIterator(SMDSAbs_ElementType ty
return SMDS_MeshElement::elementsIterator(SMDSAbs_Volume); return SMDS_MeshElement::elementsIterator(SMDSAbs_Volume);
case SMDSAbs_Node: case SMDSAbs_Node:
return SMDS_ElemIteratorPtr(new SMDS_VolumeOfNodes_MyIterator(myNodes,myNbNodes)); return SMDS_ElemIteratorPtr(new SMDS_VolumeOfNodes_MyIterator(myNodes,myNbNodes));
case SMDSAbs_Face:
return SMDS_ElemIteratorPtr(new _MySubIterator(this,SMDSAbs_Face));
case SMDSAbs_Edge:
return SMDS_ElemIteratorPtr(new _MySubIterator(this,SMDSAbs_Edge));
default: default:
MESSAGE("ERROR : Iterator not implemented"); MESSAGE("ERROR : Iterator not implemented");
return SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL); return SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL);

View File

@ -31,6 +31,7 @@
#include "SMDS_MeshElement.hxx" #include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx" #include "SMDS_MeshNode.hxx"
#include "SMDS_PolyhedralVolumeOfNodes.hxx" #include "SMDS_PolyhedralVolumeOfNodes.hxx"
#include "SMDS_Mesh.hxx"
#include "utilities.h" #include "utilities.h"
@ -1111,8 +1112,8 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
return IsLinked(myVolumeNodes[theNode1Index], myVolumeNodes[theNode2Index]); return IsLinked(myVolumeNodes[theNode1Index], myVolumeNodes[theNode2Index]);
} }
int minInd = theNode1Index < theNode2Index ? theNode1Index : theNode2Index; int minInd = min( theNode1Index, theNode2Index );
int maxInd = theNode1Index < theNode2Index ? theNode2Index : theNode1Index; int maxInd = max( theNode1Index, theNode2Index );
if ( minInd < 0 || maxInd > myVolumeNbNodes - 1 || maxInd == minInd ) if ( minInd < 0 || maxInd > myVolumeNbNodes - 1 || maxInd == minInd )
return false; return false;
@ -1217,6 +1218,65 @@ int SMDS_VolumeTool::GetNodeIndex(const SMDS_MeshNode* theNode) const
return -1; return -1;
} }
//================================================================================
/*!
* \brief Fill vector with boundary faces existing in the mesh
* \param faces - vector of found nodes
* \retval int - nb of found faces
*/
//================================================================================
int SMDS_VolumeTool::GetAllExistingFaces(vector<const SMDS_MeshElement*> & faces)
{
faces.clear();
faces.reserve( NbFaces() );
for ( int iF = 0; iF < NbFaces(); ++iF ) {
const SMDS_MeshFace* face = 0;
const SMDS_MeshNode** nodes = GetFaceNodes( iF );
switch ( NbFaceNodes( iF )) {
case 3:
face = SMDS_Mesh::FindFace( nodes[0], nodes[1], nodes[2] ); break;
case 4:
face = SMDS_Mesh::FindFace( nodes[0], nodes[1], nodes[2], nodes[3] ); break;
case 6:
face = SMDS_Mesh::FindFace( nodes[0], nodes[1], nodes[2],
nodes[3], nodes[4], nodes[5]); break;
case 8:
face = SMDS_Mesh::FindFace( nodes[0], nodes[1], nodes[2], nodes[3],
nodes[4], nodes[5], nodes[6], nodes[7]); break;
}
if ( face )
faces.push_back( face );
}
return faces.size();
}
//================================================================================
/*!
* \brief Fill vector with boundary edges existing in the mesh
* \param edges - vector of found edges
* \retval int - nb of found faces
*/
//================================================================================
int SMDS_VolumeTool::GetAllExistingEdges(vector<const SMDS_MeshElement*> & edges) const
{
edges.clear();
edges.reserve( myVolumeNbNodes * 2 );
for ( int i = 0; i < myVolumeNbNodes; ++i ) {
for ( int j = i + 1; j < myVolumeNbNodes; ++j ) {
if ( IsLinked( i, j )) {
const SMDS_MeshElement* edge =
SMDS_Mesh::FindEdge( myVolumeNodes[i], myVolumeNodes[j] );
if ( edge )
edges.push_back( edge );
}
}
}
return edges.size();
}
//======================================================================= //=======================================================================
//function : IsFreeFace //function : IsFreeFace
//purpose : check that only one volume is build on the face nodes //purpose : check that only one volume is build on the face nodes
@ -1276,7 +1336,7 @@ bool SMDS_VolumeTool::IsFreeFace( int faceIndex )
continue; // opposite side continue; // opposite side
} }
// remove a volume from volNbShared map // remove a volume from volNbShared map
volNbShared.erase( vNbIt ); volNbShared.erase( vNbIt-- );
} }
// here volNbShared contains only volumes laying on the // here volNbShared contains only volumes laying on the

View File

@ -105,6 +105,9 @@ class SMDS_EXPORT SMDS_VolumeTool
int GetNodeIndex(const SMDS_MeshNode* theNode) const; int GetNodeIndex(const SMDS_MeshNode* theNode) const;
// Return an index of theNode // Return an index of theNode
int GetAllExistingEdges(std::vector<const SMDS_MeshElement*> & edges) const;
// Fill vector with boundary edges existing in the mesh
// ------------- // -------------
// info on faces // info on faces
// ------------- // -------------
@ -161,6 +164,9 @@ class SMDS_EXPORT SMDS_VolumeTool
// Return index of a face formed by theFaceNodesIndices // Return index of a face formed by theFaceNodesIndices
// Return -1 if a face not found // Return -1 if a face not found
int GetAllExistingFaces(std::vector<const SMDS_MeshElement*> & faces);
// Fill vector with boundary faces existing in the mesh
// ------------------------ // ------------------------
// static methods for faces // static methods for faces
// ------------------------ // ------------------------

View File

@ -38,6 +38,7 @@ salomeinclude_HEADERS = \
SMESH_Hypothesis.hxx \ SMESH_Hypothesis.hxx \
SMESH_HypoFilter.hxx \ SMESH_HypoFilter.hxx \
SMESH_Algo.hxx \ SMESH_Algo.hxx \
SMESH_0D_Algo.hxx \
SMESH_1D_Algo.hxx \ SMESH_1D_Algo.hxx \
SMESH_2D_Algo.hxx \ SMESH_2D_Algo.hxx \
SMESH_3D_Algo.hxx \ SMESH_3D_Algo.hxx \
@ -50,6 +51,10 @@ salomeinclude_HEADERS = \
SMESH_SequenceOfElemPtr.hxx \ SMESH_SequenceOfElemPtr.hxx \
SMESH_SequenceOfNode.hxx \ SMESH_SequenceOfNode.hxx \
SMESH_MesherHelper.hxx \ SMESH_MesherHelper.hxx \
SMESH_Octree.hxx \
SMESH_OctreeNode.hxx \
SMESH_Comment.hxx \
SMESH_ComputeError.hxx \
SMESH_SMESH.hxx SMESH_SMESH.hxx
# Libraries targets # Libraries targets
@ -62,6 +67,7 @@ dist_libSMESHimpl_la_SOURCES = \
SMESH_subMesh.cxx \ SMESH_subMesh.cxx \
SMESH_Hypothesis.cxx \ SMESH_Hypothesis.cxx \
SMESH_Algo.cxx \ SMESH_Algo.cxx \
SMESH_0D_Algo.cxx \
SMESH_1D_Algo.cxx \ SMESH_1D_Algo.cxx \
SMESH_2D_Algo.cxx \ SMESH_2D_Algo.cxx \
SMESH_3D_Algo.cxx \ SMESH_3D_Algo.cxx \
@ -70,7 +76,9 @@ dist_libSMESHimpl_la_SOURCES = \
SMESH_Block.cxx \ SMESH_Block.cxx \
SMESH_Pattern.cxx \ SMESH_Pattern.cxx \
SMESH_HypoFilter.cxx \ SMESH_HypoFilter.cxx \
SMESH_MesherHelper.cxx SMESH_MesherHelper.cxx \
SMESH_Octree.cxx \
SMESH_OctreeNode.cxx
# additionnal information to compile and link file # additionnal information to compile and link file
libSMESHimpl_la_CPPFLAGS = \ libSMESHimpl_la_CPPFLAGS = \

View File

@ -0,0 +1,53 @@
// SMESH SMESH : implementaion of SMESH idl descriptions
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : SMESH_0D_Algo.cxx
// Module : SMESH
// $Header$
#include "SMESH_0D_Algo.hxx"
#include "SMESH_Gen.hxx"
//=============================================================================
/*!
*
*/
//=============================================================================
SMESH_0D_Algo::SMESH_0D_Algo(int hypId, int studyId, SMESH_Gen* gen)
: SMESH_Algo(hypId, studyId, gen)
{
_type = ALGO_0D;
gen->_map0D_Algo[hypId] = this;
}
//=============================================================================
/*!
*
*/
//=============================================================================
SMESH_0D_Algo::~SMESH_0D_Algo()
{
}

View File

@ -0,0 +1,40 @@
// SMESH SMESH : implementaion of SMESH idl descriptions
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : SMESH_0D_Algo.hxx
// Module : SMESH
// $Header$
#ifndef _SMESH_0D_ALGO_HXX_
#define _SMESH_0D_ALGO_HXX_
#include "SMESH_Algo.hxx"
class SMESH_0D_Algo: public SMESH_Algo
{
public:
SMESH_0D_Algo(int hypId, int studyId, SMESH_Gen* gen);
virtual ~SMESH_0D_Algo();
};
#endif

View File

@ -27,6 +27,7 @@
// $Header$ // $Header$
#include "SMESH_Algo.hxx" #include "SMESH_Algo.hxx"
#include "SMESH_Comment.hxx"
#include "SMESH_Gen.hxx" #include "SMESH_Gen.hxx"
#include "SMESH_Mesh.hxx" #include "SMESH_Mesh.hxx"
#include "SMESH_HypoFilter.hxx" #include "SMESH_HypoFilter.hxx"
@ -37,19 +38,27 @@
#include "SMESHDS_Mesh.hxx" #include "SMESHDS_Mesh.hxx"
#include "SMESHDS_SubMesh.hxx" #include "SMESHDS_SubMesh.hxx"
#include <BRepAdaptor_Curve.hxx>
#include <BRepLProp.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <GCPnts_AbscissaPoint.hxx> #include <GCPnts_AbscissaPoint.hxx>
#include <GeomAdaptor_Curve.hxx> #include <GeomAdaptor_Curve.hxx>
#include <Geom_Surface.hxx> #include <Geom_Surface.hxx>
#include <TopExp.hxx>
#include <TopLoc_Location.hxx> #include <TopLoc_Location.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx> #include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx> #include <TopTools_ListOfShape.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx> #include <gp_Pnt2d.hxx>
#include <gp_Vec.hxx> #include <gp_Vec.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include "utilities.h" #include "utilities.h"
#include <algorithm> #include <algorithm>
@ -65,12 +74,11 @@ using namespace std;
SMESH_Algo::SMESH_Algo(int hypId, int studyId, SMESH_Algo::SMESH_Algo(int hypId, int studyId,
SMESH_Gen * gen):SMESH_Hypothesis(hypId, studyId, gen) SMESH_Gen * gen):SMESH_Hypothesis(hypId, studyId, gen)
{ {
// _compatibleHypothesis.push_back("hypothese_bidon"); gen->_mapAlgo[hypId] = this;
_type = ALGO;
gen->_mapAlgo[hypId] = this;
_onlyUnaryInput = _requireDescretBoundary = true; _onlyUnaryInput = _requireDescretBoundary = _requireShape = true;
_quadraticMesh = false; _quadraticMesh = false;
_error = COMPERR_OK;
} }
//============================================================================= //=============================================================================
@ -164,8 +172,7 @@ double SMESH_Algo::EdgeLength(const TopoDS_Edge & E)
TopLoc_Location L; TopLoc_Location L;
Handle(Geom_Curve) C = BRep_Tool::Curve(E, L, UMin, UMax); Handle(Geom_Curve) C = BRep_Tool::Curve(E, L, UMin, UMax);
GeomAdaptor_Curve AdaptCurve(C); GeomAdaptor_Curve AdaptCurve(C);
GCPnts_AbscissaPoint gabs; double length = GCPnts_AbscissaPoint::Length(AdaptCurve, UMin, UMax);
double length = gabs.Length(AdaptCurve, UMin, UMax);
return length; return length;
} }
@ -378,10 +385,60 @@ bool SMESH_Algo::InitCompatibleHypoFilter( SMESH_HypoFilter & theFilter,
return false; return false;
} }
//================================================================================
/*!
* \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
*/
//================================================================================
GeomAbs_Shape SMESH_Algo::Continuity(const TopoDS_Edge & E1,
const TopoDS_Edge & E2)
{
TopoDS_Vertex V = TopExp::LastVertex (E1, true);
if ( !V.IsSame( TopExp::FirstVertex(E2, true )))
if ( !TopExp::CommonVertex( E1, E2, V ))
return GeomAbs_C0;
Standard_Real u1 = BRep_Tool::Parameter( V, E1 );
Standard_Real u2 = BRep_Tool::Parameter( V, E2 );
BRepAdaptor_Curve C1( E1 ), C2( E2 );
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
return BRepLProp::Continuity(C1, C2, u1, u2);
}
catch (Standard_Failure) {
}
return GeomAbs_C0;
}
//================================================================================
/*!
* \brief Return the node built on a vertex
* \param V - the vertex
* \param meshDS - mesh
* \retval const SMDS_MeshNode* - found node or NULL
*/
//================================================================================
const SMDS_MeshNode* SMESH_Algo::VertexNode(const TopoDS_Vertex& V,
SMESHDS_Mesh* meshDS)
{
if ( SMESHDS_SubMesh* sm = meshDS->MeshElements(V) ) {
SMDS_NodeIteratorPtr nIt= sm->GetNodes();
if (nIt->more())
return nIt->next();
}
return 0;
}
//================================================================================ //================================================================================
/*! /*!
* \brief Sets event listener to submeshes if necessary * \brief Sets event listener to submeshes if necessary
* \param subMesh - submesh where algo is set * \param subMesh - submesh where algo is set
* *
* After being set, event listener is notified on each event of a submesh. * After being set, event listener is notified on each event of a submesh.
* By default non listener is set * By default non listener is set
@ -391,3 +448,83 @@ bool SMESH_Algo::InitCompatibleHypoFilter( SMESH_HypoFilter & theFilter,
void SMESH_Algo::SetEventListener(SMESH_subMesh* /*subMesh*/) void SMESH_Algo::SetEventListener(SMESH_subMesh* /*subMesh*/)
{ {
} }
//================================================================================
/*!
* \brief Allow algo to do something after persistent restoration
* \param subMesh - restored submesh
*
* This method is called only if a submesh has HYP_OK algo_state.
*/
//================================================================================
void SMESH_Algo::SubmeshRestored(SMESH_subMesh* /*subMesh*/)
{
}
//================================================================================
/*!
* \brief Computes mesh without geometry
* \param aMesh - the mesh
* \param aHelper - helper that must be used for adding elements to \aaMesh
* \retval bool - is a success
*/
//================================================================================
bool SMESH_Algo::Compute(SMESH_Mesh & /*aMesh*/, SMESH_MesherHelper* /*aHelper*/)
{
return error( COMPERR_BAD_INPUT_MESH, "Mesh built on shape expected");
}
//================================================================================
/*!
* \brief store error and comment and then return ( error == COMPERR_OK )
*/
//================================================================================
bool SMESH_Algo::error(int error, const SMESH_Comment& comment)
{
_error = error;
_comment = comment;
return ( error == COMPERR_OK );
}
//================================================================================
/*!
* \brief store error and return ( error == COMPERR_OK )
*/
//================================================================================
bool SMESH_Algo::error(SMESH_ComputeErrorPtr error)
{
if ( error ) {
_error = error->myName;
_comment = error->myComment;
return error->IsOK();
}
return true;
}
//================================================================================
/*!
* \brief return compute error
*/
//================================================================================
SMESH_ComputeErrorPtr SMESH_Algo::GetComputeError() const
{
return SMESH_ComputeError::New( _error, _comment, this );
}
//================================================================================
/*!
* \brief initialize compute error
*/
//================================================================================
void SMESH_Algo::InitComputeError()
{
_error = COMPERR_OK;
_comment.clear();
}

View File

@ -32,24 +32,28 @@
#include "SMESH_SMESH.hxx" #include "SMESH_SMESH.hxx"
#include "SMESH_Hypothesis.hxx" #include "SMESH_Hypothesis.hxx"
#include "SMESH_ComputeError.hxx"
#include "SMESH_Comment.hxx"
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#include <gp_XY.hxx> #include <GeomAbs_Shape.hxx>
#include <string> #include <string>
#include <vector> #include <vector>
#include <list> #include <list>
#include <map>
class SMESH_Gen; class SMESH_Gen;
class SMESH_Mesh; class SMESH_Mesh;
class SMESH_HypoFilter; class SMESH_HypoFilter;
class TopoDS_Vertex;
class TopoDS_Face; class TopoDS_Face;
class TopoDS_Shape; class TopoDS_Shape;
class SMESHDS_Mesh; class SMESHDS_Mesh;
class SMDS_MeshNode; class SMDS_MeshNode;
class SMESH_subMesh; class SMESH_subMesh;
class SMESH_MesherHelper;
class SMESH_EXPORT SMESH_Algo:public SMESH_Hypothesis class SMESH_EXPORT SMESH_Algo:public SMESH_Hypothesis
{ {
@ -101,9 +105,23 @@ public:
* \param aMesh - the mesh * \param aMesh - the mesh
* \param aShape - the shape * \param aShape - the shape
* \retval bool - is a success * \retval bool - is a success
*
* Algorithms that !NeedDescretBoundary() || !OnlyUnaryInput() are
* to set SMESH_ComputeError returned by SMESH_submesh::GetComputeError()
* to report problematic subshapes
*/ */
virtual bool Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) = 0; virtual bool Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) = 0;
/*!
* \brief Computes mesh without geometry
* \param aMesh - the mesh
* \param aHelper - helper that must be used for adding elements to \aaMesh
* \retval bool - is a success
*
* The method is called if ( !aMesh->HasShapeToMesh() )
*/
virtual bool Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper);
/*! /*!
* \brief Returns a list of compatible hypotheses used to mesh a shape * \brief Returns a list of compatible hypotheses used to mesh a shape
* \param aMesh - the mesh * \param aMesh - the mesh
@ -146,15 +164,19 @@ public:
const bool ignoreAuxiliary) const; const bool ignoreAuxiliary) const;
/*! /*!
* \brief Initialize my parameter values by the mesh built on the geometry * \brief Initialize my parameter values by the mesh built on the geometry
* \param theMesh - the built mesh
* \param theShape - the geometry of interest
* \retval bool - true if parameter values have been successfully defined
* *
* Just return false as the algorithm does not hold parameters values * Just return false as the algorithm does not hold parameters values
*/ */
virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh,
const TopoDS_Shape& theShape); const TopoDS_Shape& theShape);
/*!
* \brief return compute error
*/
SMESH_ComputeErrorPtr GetComputeError() const;
/*!
* \brief initialize compute error
*/
void InitComputeError();
public: public:
// ================================================================== // ==================================================================
@ -176,6 +198,9 @@ public:
bool NeedDescretBoundary() const { return _requireDescretBoundary; } bool NeedDescretBoundary() const { return _requireDescretBoundary; }
// 3 - is a Dim-1 mesh prerequisite // 3 - is a Dim-1 mesh prerequisite
bool NeedShape() const { return _requireShape; }
// 4 - is shape existance required
public: public:
// ================================================================== // ==================================================================
// Methods to track non hierarchical dependencies between submeshes // Methods to track non hierarchical dependencies between submeshes
@ -191,6 +216,14 @@ public:
*/ */
virtual void SetEventListener(SMESH_subMesh* subMesh); virtual void SetEventListener(SMESH_subMesh* subMesh);
/*!
* \brief Allow algo to do something after persistent restoration
* \param subMesh - restored submesh
*
* This method is called only if a submesh has HYP_OK algo_state.
*/
virtual void SubmeshRestored(SMESH_subMesh* subMesh);
public: public:
// ================================================================== // ==================================================================
// Common algo utilities // Common algo utilities
@ -221,16 +254,55 @@ public:
*/ */
static double EdgeLength(const TopoDS_Edge & E); static double EdgeLength(const TopoDS_Edge & E);
/*!
* \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);
/*!
* \brief Return the node built on a vertex
* \param V - the vertex
* \param meshDS - mesh
* \retval const SMDS_MeshNode* - found node or NULL
*/
static const SMDS_MeshNode* VertexNode(const TopoDS_Vertex& V,
SMESHDS_Mesh* meshDS);
protected: protected:
bool _onlyUnaryInput;
bool _requireDescretBoundary; /*!
std::vector<std::string> _compatibleHypothesis; * \brief store error and comment and then return ( error == COMPERR_OK )
*/
bool error(int error, const SMESH_Comment& comment = "");
/*!
* \brief To be used as error in previous method
*/
SMESH_ComputeErrorName dfltErr() const { return COMPERR_ALGO_FAILED; }
/*!
* \brief store error and return error->IsOK()
*/
bool error(SMESH_ComputeErrorPtr error);
protected:
std::vector<std::string> _compatibleHypothesis;
std::list<const SMESHDS_Hypothesis *> _appliedHypList; std::list<const SMESHDS_Hypothesis *> _appliedHypList;
std::list<const SMESHDS_Hypothesis *> _usedHypList; std::list<const SMESHDS_Hypothesis *> _usedHypList;
// quadratic mesh creation required bool _onlyUnaryInput;
bool _requireDescretBoundary;
bool _requireShape;
// quadratic mesh creation required,
// is usually set trough SMESH_MesherHelper::IsQuadraticSubMesh()
bool _quadraticMesh; bool _quadraticMesh;
int _error; //!< SMESH_ComputeErrorName or anything algo specific
std::string _comment; //!< any text explaining what is wrong in Compute()
}; };
#endif #endif

View File

@ -304,6 +304,9 @@ public:
// Note: to compute params of a point on a face, it is enough to set // Note: to compute params of a point on a face, it is enough to set
// TFace, TEdge's and points for that face only // TFace, TEdge's and points for that face only
// Note 2: curve adaptors need to have only Value(double), FirstParameter() and
// LastParameter() defined to be used by Block algoritms
class SMESH_EXPORT TEdge { class SMESH_EXPORT TEdge {
int myCoordInd; int myCoordInd;
double myFirst; double myFirst;

View File

@ -0,0 +1,69 @@
// SMESH SMESH : implementaion of SMESH idl descriptions
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : SMESH_Comment.hxx
// Created : Wed Mar 14 18:28:45 2007
// Author : Edward AGAPOV (eap)
// Module : SMESH
// $Header:
#ifndef SMESH_Comment_HeaderFile
#define SMESH_Comment_HeaderFile
# include <string>
# include <sstream>
using namespace std;
/*!
* \brief Class to generate string from any type
*/
class SMESH_Comment : public string
{
ostringstream _s ;
public :
SMESH_Comment():string("") {}
SMESH_Comment(const SMESH_Comment& c):string() {
_s << c.c_str() ;
this->string::operator=( _s.str() );
}
template <class T>
SMESH_Comment( const T &anything ) {
_s << anything ;
this->string::operator=( _s.str() );
}
template <class T>
SMESH_Comment & operator<<( const T &anything ) {
_s << anything ;
this->string::operator=( _s.str() );
return *this ;
}
};
#endif

View File

@ -0,0 +1,103 @@
// SMESH SMESH : implementaion of SMESH idl descriptions
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : SMESH_Hypothesis.hxx
// Author : Edward AGAPOV (eap)
// Module : SMESH
// $Header:
#ifndef SMESH_ComputeError_HeaderFile
#define SMESH_ComputeError_HeaderFile
#include <string>
#include <boost/shared_ptr.hpp>
class SMESH_Algo;
struct SMESH_ComputeError;
typedef boost::shared_ptr<SMESH_ComputeError> SMESH_ComputeErrorPtr;
// =============================================================
enum SMESH_ComputeErrorName
{
// If you modify it, pls update SMESH_ComputeError::CommonName() below.
// Positive values are for algo specific errors
COMPERR_OK = -1,
COMPERR_BAD_INPUT_MESH = -2, //!< wrong mesh on lower submesh
COMPERR_STD_EXCEPTION = -3, //!< some std exception raised
COMPERR_OCC_EXCEPTION = -4, //!< OCC exception raised
COMPERR_SLM_EXCEPTION = -5, //!< SALOME exception raised
COMPERR_EXCEPTION = -6, //!< other exception raised
COMPERR_MEMORY_PB = -7, //!< std::bad_alloc exception
COMPERR_ALGO_FAILED = -8, //!< algo failed for some reason
COMPERR_BAD_SHAPE = -9 //!< bad geometry
};
// =============================================================
/*!
* \brief Contains algorithm and description of occured error
*/
// =============================================================
struct SMESH_ComputeError
{
int myName; //!< SMESH_ComputeErrorName or anything algo specific
std::string myComment;
const SMESH_Algo* myAlgo;
static SMESH_ComputeErrorPtr New( int error = COMPERR_OK,
std::string comment = "",
const SMESH_Algo* algo = 0)
{ return SMESH_ComputeErrorPtr( new SMESH_ComputeError( error, comment, algo )); }
SMESH_ComputeError(int error = COMPERR_OK,
std::string comment = "",
const SMESH_Algo* algo = 0)
:myName(error),myComment(comment),myAlgo(algo) {}
bool IsOK() { return myName == COMPERR_OK; }
bool IsCommon() { return myName < 0; }
inline std::string CommonName() const;
};
#define case2char(err) case err: return #err;
std::string SMESH_ComputeError::CommonName() const
{
switch( myName ) {
case2char(COMPERR_OK );
case2char(COMPERR_BAD_INPUT_MESH);
case2char(COMPERR_STD_EXCEPTION );
case2char(COMPERR_OCC_EXCEPTION );
case2char(COMPERR_SLM_EXCEPTION );
case2char(COMPERR_EXCEPTION );
case2char(COMPERR_MEMORY_PB );
case2char(COMPERR_ALGO_FAILED );
default:;
}
return "";
}
#endif

View File

@ -124,122 +124,65 @@ SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode)
//============================================================================= //=============================================================================
/*! /*!
* * Compute a mesh
*/ */
//============================================================================= //=============================================================================
bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape)
{ {
MESSAGE("SMESH_Gen::Compute"); MESSAGE("SMESH_Gen::Compute");
// bool isDone = false;
/*
Algo : s'appuie ou non sur une geometrie
Si geometrie:
Vertex : rien à faire (range le point)
Edge, Wire, collection d'edge et wire : 1D
Face, Shell, collection de Face et Shells : 2D
Solid, Collection de Solid : 3D
*/
// *** corriger commentaires
// check hypothesis associated to the mesh :
// - only one algo : type compatible with the type of the shape
// - hypothesis = compatible with algo
// - check if hypothesis are applicable to this algo
// - check contradictions within hypothesis
// (test if enough hypothesis is done further)
bool ret = true; bool ret = true;
// if ( !CheckAlgoState( aMesh, aShape ))
// {
// INFOS( "ABORT MESHING: some algos or hypothesis are missing");
// return false;
// }
SMESH_subMesh *sm = aMesh.GetSubMesh(aShape); SMESH_subMesh *sm = aMesh.GetSubMesh(aShape);
if ( sm->GetComputeState() == SMESH_subMesh::COMPUTE_OK )
return true; // already computed
// ----------------------------------------------------------------- // -----------------------------------------------------------------
// apply algos that do not require descretized boundaries, starting // apply algos that do not require descretized boundaries, starting
// from the most complex shapes // from the most complex shapes
// ----------------------------------------------------------------- // -----------------------------------------------------------------
// map containing all subshapes in the order: vertices, edges, faces... const bool includeSelf = true;
const map<int, SMESH_subMesh*>& smMap = sm->DependsOn(); const bool complexShapeFirst = true;
map<int, SMESH_subMesh*>::const_reverse_iterator revItSub = smMap.rbegin();
SMESH_subMesh* smToCompute = sm; SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(includeSelf,
while ( smToCompute ) complexShapeFirst);
while ( smIt->more() )
{ {
SMESH_subMesh* smToCompute = smIt->next();
const TopoDS_Shape& aSubShape = smToCompute->GetSubShape(); const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
if ( GetShapeDim( aSubShape ) < 1 ) break; if ( GetShapeDim( aSubShape ) < 1 ) break;
SMESH_Algo* algo = GetAlgo( aMesh, aSubShape ); SMESH_Algo* algo = GetAlgo( aMesh, aSubShape );
if (algo && !algo->NeedDescretBoundary()) { if (algo && !algo->NeedDescretBoundary())
if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE) {
ret = smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
} else if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE) {
// JFA for PAL6524
ret = false;
} else {
}
}
if (!ret)
return false;
// next subMesh
if (revItSub != smMap.rend())
{ {
smToCompute = (*revItSub).second; if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
revItSub++; smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE)
ret = false;;
} }
else
smToCompute = 0;
} }
// ----------------------------------------------- // -----------------------------------------------
// mesh the rest subshapes starting from vertices // mesh the rest subshapes starting from vertices
// ----------------------------------------------- // -----------------------------------------------
smIt = sm->getDependsOnIterator(includeSelf, !complexShapeFirst);
int i, nbSub = smMap.size(); while ( smIt->more() )
map<int, SMESH_subMesh*>::const_iterator itSub = smMap.begin();
for ( i = 0; i <= nbSub; ++i ) // loop on the whole map plus <sm>
{ {
if ( itSub == smMap.end() ) SMESH_subMesh* smToCompute = smIt->next();
smToCompute = sm;
else if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
smToCompute = (itSub++)->second; smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
if (smToCompute->GetComputeState() != SMESH_subMesh::READY_TO_COMPUTE) {
if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE) if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE)
ret = false; ret = false;
continue;
}
TopoDS_Shape subShape = smToCompute->GetSubShape();
if ( subShape.ShapeType() != TopAbs_VERTEX )
{
if ( !smToCompute->ComputeStateEngine(SMESH_subMesh::COMPUTE) )
ret = false;
}
else
{
TopoDS_Vertex V1 = TopoDS::Vertex(subShape);
gp_Pnt P1 = BRep_Tool::Pnt(V1);
SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
SMDS_MeshNode * node = meshDS->AddNode(P1.X(), P1.Y(), P1.Z());
if ( node ) { // san - increase robustness
meshDS->SetNodeOnVertex(node, V1);
smToCompute->ComputeStateEngine(SMESH_subMesh::COMPUTE);
}
}
} }
MESSAGE( "VSR - SMESH_Gen::Compute() finished, OK = " << ret); MESSAGE( "VSR - SMESH_Gen::Compute() finished, OK = " << ret);
return ret; return ret;
} }
//======================================================================= //=======================================================================
//function : checkConformIgnoredAlgos //function : checkConformIgnoredAlgos
//purpose : //purpose :
@ -301,7 +244,7 @@ static bool checkConformIgnoredAlgos(SMESH_Mesh& aMesh,
"> would produce not conform mesh: " "> would produce not conform mesh: "
"<Not Conform Mesh Allowed> hypotesis is missing"); "<Not Conform Mesh Allowed> hypotesis is missing");
theErrors.push_back( SMESH_Gen::TAlgoStateError() ); theErrors.push_back( SMESH_Gen::TAlgoStateError() );
theErrors.back().Set( SMESH_Gen::NOT_CONFORM_MESH, algo, false ); theErrors.back().Set( SMESH_Hypothesis::HYP_NOTCONFORM, algo, false );
} }
// sub-algos will be hidden by a local <algo> // sub-algos will be hidden by a local <algo>
@ -361,7 +304,7 @@ static bool checkMissing(SMESH_Gen* aGen,
INFOS( "ERROR: " << shapeDim << "D algorithm is missing" ); INFOS( "ERROR: " << shapeDim << "D algorithm is missing" );
ret = false; ret = false;
theErrors.push_back( SMESH_Gen::TAlgoStateError() ); theErrors.push_back( SMESH_Gen::TAlgoStateError() );
theErrors.back().Set( SMESH_Gen::MISSING_ALGO, shapeDim, true ); theErrors.back().Set( SMESH_Hypothesis::HYP_MISSING, shapeDim, true );
} }
} }
return ret; return ret;
@ -373,13 +316,13 @@ static bool checkMissing(SMESH_Gen* aGen,
bool IsGlobalHypothesis = aGen->IsGlobalHypothesis( algo, aMesh ); bool IsGlobalHypothesis = aGen->IsGlobalHypothesis( algo, aMesh );
if (!IsGlobalHypothesis || !globalChecked[ algo->GetDim() ]) if (!IsGlobalHypothesis || !globalChecked[ algo->GetDim() ])
{ {
SMESH_Gen::TAlgoStateErrorName errName = SMESH_Gen::MISSING_HYPO; TAlgoStateErrorName errName = SMESH_Hypothesis::HYP_MISSING;
SMESH_Hypothesis::Hypothesis_Status status; SMESH_Hypothesis::Hypothesis_Status status;
algo->CheckHypothesis( aMesh, aSubMesh->GetSubShape(), status ); algo->CheckHypothesis( aMesh, aSubMesh->GetSubShape(), status );
if ( status == SMESH_Hypothesis::HYP_BAD_PARAMETER ) { if ( status == SMESH_Hypothesis::HYP_BAD_PARAMETER ) {
INFOS( "ERROR: hypothesis of " << (IsGlobalHypothesis ? "Global " : "Local ") INFOS( "ERROR: hypothesis of " << (IsGlobalHypothesis ? "Global " : "Local ")
<< "<" << algo->GetName() << "> has a bad parameter value"); << "<" << algo->GetName() << "> has a bad parameter value");
errName = SMESH_Gen::BAD_PARAM_VALUE; errName = SMESH_Hypothesis::HYP_BAD_PARAMETER;
} else { } else {
INFOS( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ") INFOS( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ")
<< "<" << algo->GetName() << "> misses some hypothesis"); << "<" << algo->GetName() << "> misses some hypothesis");
@ -496,7 +439,7 @@ bool SMESH_Gen::GetAlgoState(SMESH_Mesh& theMesh,
// -------------------------------------------------------- // --------------------------------------------------------
// find a global algo possibly hidding sub-algos // find a global algo possibly hiding sub-algos
int dim; int dim;
const SMESH_Algo* aGlobIgnoAlgo = 0; const SMESH_Algo* aGlobIgnoAlgo = 0;
for (dim = 3; dim > 0; dim--) for (dim = 3; dim > 0; dim--)
@ -564,7 +507,7 @@ bool SMESH_Gen::GetAlgoState(SMESH_Mesh& theMesh,
aCheckedMap.clear(); aCheckedMap.clear();
smToCheck = sm; smToCheck = sm;
revItSub = smMap.rbegin(); revItSub = smMap.rbegin();
bool checkNoAlgo = (bool) aTopAlgoDim; bool checkNoAlgo = theMesh.HasShapeToMesh() ? bool( aTopAlgoDim ) : false;
bool globalChecked[] = { false, false, false, false }; bool globalChecked[] = { false, false, false, false };
// loop on theShape and its sub-shapes // loop on theShape and its sub-shapes
@ -597,7 +540,7 @@ bool SMESH_Gen::GetAlgoState(SMESH_Mesh& theMesh,
ret = false; ret = false;
INFOS( "None algorithm attached" ); INFOS( "None algorithm attached" );
theErrors.push_back( TAlgoStateError() ); theErrors.push_back( TAlgoStateError() );
theErrors.back().Set( MISSING_ALGO, 1, true ); theErrors.back().Set( SMESH_Hypothesis::HYP_MISSING, 1, true );
} }
return ret; return ret;

View File

@ -34,7 +34,9 @@
#include "Utils_SALOME_Exception.hxx" #include "Utils_SALOME_Exception.hxx"
#include "SMESH_Hypothesis.hxx" #include "SMESH_Hypothesis.hxx"
#include "SMESH_ComputeError.hxx"
#include "SMESH_Algo.hxx" #include "SMESH_Algo.hxx"
#include "SMESH_0D_Algo.hxx"
#include "SMESH_1D_Algo.hxx" #include "SMESH_1D_Algo.hxx"
#include "SMESH_2D_Algo.hxx" #include "SMESH_2D_Algo.hxx"
#include "SMESH_3D_Algo.hxx" #include "SMESH_3D_Algo.hxx"
@ -46,12 +48,13 @@
#include <map> #include <map>
typedef SMESH_Hypothesis::Hypothesis_Status TAlgoStateErrorName;
typedef struct studyContextStruct typedef struct studyContextStruct
{ {
std::map < int, SMESH_Hypothesis * >mapHypothesis; std::map < int, SMESH_Hypothesis * >mapHypothesis;
std::map < int, SMESH_Mesh * >mapMesh; std::map < int, SMESH_Mesh * >mapMesh;
SMESHDS_Document * myDocument; SMESHDS_Document * myDocument;
} StudyContextStruct; } StudyContextStruct;
class SMESH_EXPORT SMESH_Gen class SMESH_EXPORT SMESH_Gen
@ -60,10 +63,9 @@ class SMESH_EXPORT SMESH_Gen
SMESH_Gen(); SMESH_Gen();
~SMESH_Gen(); ~SMESH_Gen();
// SMESH_Hypothesis *CreateHypothesis(const char *anHyp, int studyId)
// throw(SALOME_Exception);
SMESH_Mesh* CreateMesh(int theStudyId, bool theIsEmbeddedMode) SMESH_Mesh* CreateMesh(int theStudyId, bool theIsEmbeddedMode)
throw(SALOME_Exception); throw(SALOME_Exception);
bool Compute(::SMESH_Mesh & aMesh, const TopoDS_Shape & aShape); bool Compute(::SMESH_Mesh & aMesh, const TopoDS_Shape & aShape);
bool CheckAlgoState(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape); bool CheckAlgoState(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
@ -71,11 +73,6 @@ class SMESH_EXPORT SMESH_Gen
// if Compute() would fail because of some algo bad state // if Compute() would fail because of some algo bad state
enum TAlgoStateErrorName { NONE=0,
MISSING_ALGO,
MISSING_HYPO,
NOT_CONFORM_MESH,
BAD_PARAM_VALUE };
struct TAlgoStateError struct TAlgoStateError
{ {
TAlgoStateErrorName _name; TAlgoStateErrorName _name;
@ -83,7 +80,7 @@ class SMESH_EXPORT SMESH_Gen
int _algoDim; int _algoDim;
bool _isGlobalAlgo; bool _isGlobalAlgo;
TAlgoStateError(): _algoDim(0),_algo(0),_name(NONE) {} TAlgoStateError(): _algoDim(0),_algo(0),_name(SMESH_Hypothesis::HYP_OK) {}
void Set(TAlgoStateErrorName name, const SMESH_Algo* algo, bool isGlobal) void Set(TAlgoStateErrorName name, const SMESH_Algo* algo, bool isGlobal)
{ _name = name; _algo = algo; _algoDim = algo->GetDim(); _isGlobalAlgo = isGlobal; } { _name = name; _algo = algo; _algoDim = algo->GetDim(); _isGlobalAlgo = isGlobal; }
void Set(TAlgoStateErrorName name, const int algoDim, bool isGlobal) void Set(TAlgoStateErrorName name, const int algoDim, bool isGlobal)
@ -96,7 +93,6 @@ class SMESH_EXPORT SMESH_Gen
// if Compute() would fail because of some algo bad state // if Compute() would fail because of some algo bad state
// theErrors list contains problems description // theErrors list contains problems description
StudyContextStruct *GetStudyContext(int studyId); StudyContextStruct *GetStudyContext(int studyId);
static int GetShapeDim(const TopAbs_ShapeEnum & aShapeType); static int GetShapeDim(const TopAbs_ShapeEnum & aShapeType);
@ -118,6 +114,7 @@ class SMESH_EXPORT SMESH_Gen
int GetANewId(); int GetANewId();
std::map < int, SMESH_Algo * >_mapAlgo; std::map < int, SMESH_Algo * >_mapAlgo;
std::map < int, SMESH_0D_Algo * >_map0D_Algo;
std::map < int, SMESH_1D_Algo * >_map1D_Algo; std::map < int, SMESH_1D_Algo * >_map1D_Algo;
std::map < int, SMESH_2D_Algo * >_map2D_Algo; std::map < int, SMESH_2D_Algo * >_map2D_Algo;
std::map < int, SMESH_3D_Algo * >_map3D_Algo; std::map < int, SMESH_3D_Algo * >_map3D_Algo;

View File

@ -126,14 +126,6 @@ void SMESH_Hypothesis::NotifySubMeshesHypothesisModification()
{ {
SMESH_Mesh* mesh = (*itm).second; SMESH_Mesh* mesh = (*itm).second;
mesh->NotifySubMeshesHypothesisModification( this ); mesh->NotifySubMeshesHypothesisModification( this );
// const list<SMESH_subMesh*>& subMeshes =
// mesh->GetSubMeshUsingHypothesis(this);
// //for all subMeshes using hypothesis
// list<SMESH_subMesh*>::const_iterator its;
// for (its = subMeshes.begin(); its != subMeshes.end(); its++)
// (*its)->ComputeStateEngine(SMESH_subMesh::MODIF_HYP);
} }
} }
@ -145,9 +137,6 @@ void SMESH_Hypothesis::NotifySubMeshesHypothesisModification()
const char* SMESH_Hypothesis::GetLibName() const const char* SMESH_Hypothesis::GetLibName() const
{ {
// MESSAGE("SMESHDS_Hypothesis::GetLibName");
// SCRUTE(_LibName);
// SCRUTE(&_LibName);
return _libName.c_str(); return _libName.c_str();
} }
@ -159,6 +148,5 @@ const char* SMESH_Hypothesis::GetLibName() const
void SMESH_Hypothesis::SetLibName(const char* theLibName) void SMESH_Hypothesis::SetLibName(const char* theLibName)
{ {
// MESSAGE("SMESHDS_Hypothesis::SetLibName");
_libName = string(theLibName); _libName = string(theLibName);
} }

View File

@ -42,10 +42,12 @@ class SMESH_EXPORT SMESH_Hypothesis: public SMESHDS_Hypothesis
public: public:
enum Hypothesis_Status // in the order of severity enum Hypothesis_Status // in the order of severity
{ {
HYP_OK, HYP_OK = 0,
HYP_MISSING, // algo misses a hypothesis HYP_MISSING, // algo misses a hypothesis
HYP_CONCURENT, // several applicable hypotheses HYP_CONCURENT, // several applicable hypotheses
HYP_BAD_PARAMETER,// hypothesis has a bad parameter value HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
HYP_HIDDEN_ALGO, // an algo is hidden by an upper dim algo generating all-dim elements
HYP_HIDING_ALGO, // an algo hides lower dim algos by generating all-dim elements
HYP_UNKNOWN_FATAL,// --- all statuses below should be considered as fatal HYP_UNKNOWN_FATAL,// --- all statuses below should be considered as fatal
// for Add/RemoveHypothesis operations // for Add/RemoveHypothesis operations
HYP_INCOMPATIBLE, // hypothesis does not fit algo HYP_INCOMPATIBLE, // hypothesis does not fit algo
@ -84,7 +86,7 @@ public:
* dimention can be assigned to the shape * dimention can be assigned to the shape
*/ */
virtual bool IsAuxiliary() const virtual bool IsAuxiliary() const
{ return GetType() == PARAM_ALGO && _param_algo_dim <= 0; } { return GetType() == PARAM_ALGO && _param_algo_dim < 0; }
protected: protected:
SMESH_Gen* _gen; SMESH_Gen* _gen;

View File

@ -49,6 +49,7 @@
#include "DriverSTL_R_SMDS_Mesh.h" #include "DriverSTL_R_SMDS_Mesh.h"
#include <BRepTools_WireExplorer.hxx> #include <BRepTools_WireExplorer.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
@ -80,21 +81,22 @@ static int MYDEBUG = 0;
*/ */
//============================================================================= //=============================================================================
SMESH_Mesh::SMESH_Mesh(int theLocalId, SMESH_Mesh::SMESH_Mesh(int theLocalId,
int theStudyId, int theStudyId,
SMESH_Gen* theGen, SMESH_Gen* theGen,
bool theIsEmbeddedMode, bool theIsEmbeddedMode,
SMESHDS_Document* theDocument): SMESHDS_Document* theDocument):
_groupId( 0 ) _groupId( 0 )
{ {
INFOS("SMESH_Mesh::SMESH_Mesh(int localId)"); MESSAGE("SMESH_Mesh::SMESH_Mesh(int localId)");
_id = theLocalId; _id = theLocalId;
_studyId = theStudyId; _studyId = theStudyId;
_gen = theGen; _gen = theGen;
_myDocument = theDocument; _myDocument = theDocument;
_idDoc = theDocument->NewMesh(theIsEmbeddedMode); _idDoc = theDocument->NewMesh(theIsEmbeddedMode);
_myMeshDS = theDocument->GetMesh(_idDoc); _myMeshDS = theDocument->GetMesh(_idDoc);
_isShapeToMesh = false; _isShapeToMesh = false;
_myMeshDS->ShapeToMesh( PseudoShape() );
} }
//============================================================================= //=============================================================================
@ -117,7 +119,7 @@ SMESH_Mesh::~SMESH_Mesh()
//============================================================================= //=============================================================================
/*! /*!
* * \brief Set geometry to be meshed
*/ */
//============================================================================= //=============================================================================
@ -125,7 +127,11 @@ void SMESH_Mesh::ShapeToMesh(const TopoDS_Shape & aShape)
{ {
if(MYDEBUG) MESSAGE("SMESH_Mesh::ShapeToMesh"); if(MYDEBUG) MESSAGE("SMESH_Mesh::ShapeToMesh");
if ( !_myMeshDS->ShapeToMesh().IsNull() && aShape.IsNull() ) if ( !aShape.IsNull() && _isShapeToMesh )
throw SALOME_Exception(LOCALIZED ("a shape to mesh has already been defined"));
// clear current data
if ( !_myMeshDS->ShapeToMesh().IsNull() )
{ {
// removal of a shape to mesh, delete objects referring to sub-shapes: // removal of a shape to mesh, delete objects referring to sub-shapes:
// - sub-meshes // - sub-meshes
@ -144,28 +150,57 @@ void SMESH_Mesh::ShapeToMesh(const TopoDS_Shape & aShape)
else else
i_gr++; i_gr++;
} }
_mapAncestors.Clear();
_mapPropagationChains.Clear(); _mapPropagationChains.Clear();
// clear SMESHDS
TopoDS_Shape aNullShape;
_myMeshDS->ShapeToMesh( aNullShape );
} }
else
// set a new geometry
if ( !aShape.IsNull() )
{ {
if (_isShapeToMesh) _myMeshDS->ShapeToMesh(aShape);
throw SALOME_Exception(LOCALIZED ("a shape to mesh has already been defined")); _isShapeToMesh = true;
// 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 );
} }
_isShapeToMesh = true; }
_myMeshDS->ShapeToMesh(aShape);
// fill _mapAncestors //=======================================================================
_mapAncestors.Clear(); /*!
int desType, ancType; * \brief Return geometry to be meshed. (It may be a PseudoShape()!)
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 );
// NRI : 24/02/03 TopoDS_Shape SMESH_Mesh::GetShapeToMesh() const
//EAP: 1/9/04 TopExp::MapShapes(aShape, _subShapes); USE the same map of _myMeshDS {
return _myMeshDS->ShapeToMesh();
}
//=======================================================================
/*!
* \brief Return a solid which is returned by GetShapeToMesh() if
* a real geometry to be meshed was not set
*/
//=======================================================================
const TopoDS_Solid& SMESH_Mesh::PseudoShape()
{
static TopoDS_Solid aSolid;
if ( aSolid.IsNull() )
{
aSolid = BRepPrimAPI_MakeBox(1,1,1);
}
return aSolid;
} }
//======================================================================= //=======================================================================
@ -379,11 +414,11 @@ SMESH_Hypothesis::Hypothesis_Status
// check concurent hypotheses on ansestors // check concurent hypotheses on ansestors
if (ret < SMESH_Hypothesis::HYP_CONCURENT && !isGlobalHyp ) if (ret < SMESH_Hypothesis::HYP_CONCURENT && !isGlobalHyp )
{ {
const map < int, SMESH_subMesh * >& smMap = subMesh->DependsOn(); SMESH_subMeshIteratorPtr smIt = subMesh->getDependsOnIterator(false,false);
map < int, SMESH_subMesh * >::const_iterator smIt = smMap.begin(); while ( smIt->more() ) {
for ( ; smIt != smMap.end(); smIt++ ) { SMESH_subMesh* sm = smIt->next();
if ( smIt->second->IsApplicableHypotesis( anHyp )) { if ( sm->IsApplicableHypotesis( anHyp )) {
ret2 = smIt->second->CheckConcurentHypothesis( anHyp->GetType() ); ret2 = sm->CheckConcurentHypothesis( anHyp->GetType() );
if (ret2 > ret) { if (ret2 > ret) {
ret = ret2; ret = ret2;
break; break;
@ -469,11 +504,11 @@ SMESH_Hypothesis::Hypothesis_Status
// check concurent hypotheses on ansestors // check concurent hypotheses on ansestors
if (ret < SMESH_Hypothesis::HYP_CONCURENT && !IsMainShape( aSubShape ) ) if (ret < SMESH_Hypothesis::HYP_CONCURENT && !IsMainShape( aSubShape ) )
{ {
const map < int, SMESH_subMesh * >& smMap = subMesh->DependsOn(); SMESH_subMeshIteratorPtr smIt = subMesh->getDependsOnIterator(false,false);
map < int, SMESH_subMesh * >::const_iterator smIt = smMap.begin(); while ( smIt->more() ) {
for ( ; smIt != smMap.end(); smIt++ ) { SMESH_subMesh* sm = smIt->next();
if ( smIt->second->IsApplicableHypotesis( anHyp )) { if ( sm->IsApplicableHypotesis( anHyp )) {
ret2 = smIt->second->CheckConcurentHypothesis( anHyp->GetType() ); ret2 = sm->CheckConcurentHypothesis( anHyp->GetType() );
if (ret2 > ret) { if (ret2 > ret) {
ret = ret2; ret = ret2;
break; break;
@ -494,17 +529,6 @@ SMESH_Hypothesis::Hypothesis_Status
*/ */
//============================================================================= //=============================================================================
SMESHDS_Mesh * SMESH_Mesh::GetMeshDS()
{
return _myMeshDS;
}
//=============================================================================
/*!
*
*/
//=============================================================================
const list<const SMESHDS_Hypothesis*>& const list<const SMESHDS_Hypothesis*>&
SMESH_Mesh::GetHypothesisList(const TopoDS_Shape & aSubShape) const SMESH_Mesh::GetHypothesisList(const TopoDS_Shape & aSubShape) const
throw(SALOME_Exception) throw(SALOME_Exception)
@ -649,29 +673,6 @@ void SMESH_Mesh::ClearLog() throw(SALOME_Exception)
_myMeshDS->GetScript()->Clear(); _myMeshDS->GetScript()->Clear();
} }
//=============================================================================
/*!
*
*/
//=============================================================================
int SMESH_Mesh::GetId()
{
if(MYDEBUG) MESSAGE("SMESH_Mesh::GetId");
return _id;
}
//=============================================================================
/*!
*
*/
//=============================================================================
SMESH_Gen *SMESH_Mesh::GetGen()
{
return _gen;
}
//============================================================================= //=============================================================================
/*! /*!
* Get or Create the SMESH_subMesh object implementation * Get or Create the SMESH_subMesh object implementation
@ -814,12 +815,10 @@ SMESH_Mesh::GetSubMeshUsingHypothesis(SMESHDS_Hypothesis * anHyp)
//purpose : Say all submeshes using theChangedHyp that it has been modified //purpose : Say all submeshes using theChangedHyp that it has been modified
//======================================================================= //=======================================================================
void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* theChangedHyp) void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* hyp)
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
const SMESH_Hypothesis* hyp = cSMESH_Hyp(theChangedHyp);
const SMESH_Algo *foundAlgo = 0; const SMESH_Algo *foundAlgo = 0;
SMESH_HypoFilter algoKind( SMESH_HypoFilter::IsAlgo() ); SMESH_HypoFilter algoKind( SMESH_HypoFilter::IsAlgo() );
SMESH_HypoFilter compatibleHypoKind; SMESH_HypoFilter compatibleHypoKind;
@ -857,7 +856,8 @@ void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* t
if ( GetHypotheses( aSubShape, compatibleHypoKind, usedHyps, true ) && if ( GetHypotheses( aSubShape, compatibleHypoKind, usedHyps, true ) &&
find( usedHyps.begin(), usedHyps.end(), hyp ) != usedHyps.end() ) find( usedHyps.begin(), usedHyps.end(), hyp ) != usedHyps.end() )
{ {
aSubMesh->ComputeStateEngine(SMESH_subMesh::MODIF_HYP); aSubMesh->AlgoStateEngine(SMESH_subMesh::MODIF_HYP,
const_cast< SMESH_Hypothesis*>( hyp ));
if ( algo->GetDim() == 1 && IsPropagationHypothesis( aSubShape )) if ( algo->GetDim() == 1 && IsPropagationHypothesis( aSubShape ))
CleanMeshOnPropagationChain( aSubShape ); CleanMeshOnPropagationChain( aSubShape );

View File

@ -72,24 +72,39 @@ class SMESH_Group;
class TopTools_ListOfShape; class TopTools_ListOfShape;
class SMESH_subMesh; class SMESH_subMesh;
class SMESH_HypoFilter; class SMESH_HypoFilter;
class TopoDS_Solid;
//typedef NMTTools_IndexedDataMapOfShapeIndexedMapOfShape IndexedMapOfChain;
typedef SMESH_IndexedDataMapOfShapeIndexedMapOfShape IndexedMapOfChain; typedef SMESH_IndexedDataMapOfShapeIndexedMapOfShape IndexedMapOfChain;
class SMESH_EXPORT SMESH_Mesh class SMESH_EXPORT SMESH_Mesh
{ {
SMESH_Mesh();
SMESH_Mesh(const SMESH_Mesh&);
public: public:
SMESH_Mesh(int theLocalId, SMESH_Mesh(int theLocalId,
int theStudyId, int theStudyId,
SMESH_Gen* theGen, SMESH_Gen* theGen,
bool theIsEmbeddedMode, bool theIsEmbeddedMode,
SMESHDS_Document* theDocument); SMESHDS_Document* theDocument);
virtual ~SMESH_Mesh(); virtual ~SMESH_Mesh();
/*!
* \brief Set geometry to be meshed
*/
void ShapeToMesh(const TopoDS_Shape & aShape); void ShapeToMesh(const TopoDS_Shape & aShape);
/*!
* \brief Return geometry to be meshed. (It may be a PseudoShape()!)
*/
TopoDS_Shape GetShapeToMesh() const;
/*!
* \brief Return true if there is a geometry to be meshed, not PseudoShape()
*/
bool HasShapeToMesh() const { return _isShapeToMesh; }
/*!
* \brief Return a solid which is returned by GetShapeToMesh() if
* a real geometry to be meshed was not set
*/
static const TopoDS_Solid& PseudoShape();
int UNVToMesh(const char* theFileName); int UNVToMesh(const char* theFileName);
/*! /*!
@ -124,11 +139,11 @@ public:
void ClearLog() throw(SALOME_Exception); void ClearLog() throw(SALOME_Exception);
int GetId(); int GetId() { return _id; }
SMESHDS_Mesh * GetMeshDS(); SMESHDS_Mesh * GetMeshDS() { return _myMeshDS; }
SMESH_Gen *GetGen(); SMESH_Gen *GetGen() { return _gen; }
SMESH_subMesh *GetSubMesh(const TopoDS_Shape & aSubShape) SMESH_subMesh *GetSubMesh(const TopoDS_Shape & aSubShape)
throw(SALOME_Exception); throw(SALOME_Exception);
@ -257,7 +272,7 @@ private:
void CleanMeshOnPropagationChain(const TopoDS_Shape& theMainEdge); void CleanMeshOnPropagationChain(const TopoDS_Shape& theMainEdge);
// //
private: protected:
int _id; // id given by creator (unique within the creator instance) int _id; // id given by creator (unique within the creator instance)
int _studyId; int _studyId;
int _idDoc; // id given by SMESHDS_Document int _idDoc; // id given by SMESHDS_Document
@ -273,6 +288,10 @@ private:
TopTools_IndexedDataMapOfShapeListOfShape _mapAncestors; TopTools_IndexedDataMapOfShapeListOfShape _mapAncestors;
IndexedMapOfChain _mapPropagationChains; // Propagation hypothesis management IndexedMapOfChain _mapPropagationChains; // Propagation hypothesis management
protected:
SMESH_Mesh() {};
SMESH_Mesh(const SMESH_Mesh&) {};
}; };
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -36,20 +36,18 @@
#include "SMESH_Controls.hxx" #include "SMESH_Controls.hxx"
#include "SMESH_SequenceOfNode.hxx" #include "SMESH_SequenceOfNode.hxx"
#include "SMESH_SequenceOfElemPtr.hxx" #include "SMESH_SequenceOfElemPtr.hxx"
#include "gp_Dir.hxx"
#include "TColStd_HSequenceOfReal.hxx" #include "TColStd_HSequenceOfReal.hxx"
#include "SMESH_MesherHelper.hxx" #include "SMESH_MesherHelper.hxx"
#include "SMDS_MeshElement.hxx" #include "SMDS_MeshElement.hxx"
#include <gp_Dir.hxx>
#include <list> #include <list>
#include <map> #include <map>
typedef map<const SMDS_MeshElement*, typedef std::map<const SMDS_MeshElement*,
list<const SMDS_MeshElement*> > TElemOfElemListMap; std::list<const SMDS_MeshElement*> > TElemOfElemListMap;
typedef map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap; typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap;
typedef map<const SMDS_MeshNode*, SMESHDS_SubMesh*> RemoveQuadNodeMap;
typedef map<const SMDS_MeshNode*, SMESHDS_SubMesh*>::iterator ItRemoveQuadNodeMap;
class SMDS_MeshFace; class SMDS_MeshFace;
class SMDS_MeshNode; class SMDS_MeshNode;
@ -57,31 +55,58 @@ class gp_Ax1;
class gp_Vec; class gp_Vec;
class gp_Pnt; class gp_Pnt;
// ============================================================
/*!
* \brief Set of elements sorted by ID, to be used to assure
* predictability of edition
*/
// ============================================================
template < class TMeshElem = SMDS_MeshElement>
struct TIDCompare {
bool operator () (const TMeshElem* e1, const TMeshElem* e2) const
{ return e1->GetID() < e2->GetID(); }
};
typedef std::set< const SMDS_MeshElement*, TIDCompare< SMDS_MeshElement> > TIDSortedElemSet;
// ============================================================
/*!
* \brief Searcher for the node closest to point
*/
// ============================================================
struct SMESH_NodeSearcher
{
virtual const SMDS_MeshNode* FindClosestTo( const gp_Pnt& pnt ) = 0;
};
// ============================================================
/*!
* \brief Editor of a mesh
*/
// ============================================================
class SMESH_EXPORT SMESH_MeshEditor { class SMESH_EXPORT SMESH_MeshEditor {
public:
// define a set of elements sorted by ID, to be used to assure
// predictability of edition
struct TIDCompare {
bool operator () (const SMDS_MeshElement* e1, const SMDS_MeshElement* e2)
{ return e1->GetID() < e2->GetID(); }
};
typedef set< const SMDS_MeshElement*, TIDCompare > TIDSortedElemSet;
/*!
* \brief Insert element in a map of elements sorted by ID
* \param elem - element to insert
* \param elemMap - the map to fill in
*/
static void Insert(const SMDS_MeshElement* elem,
std::map<int,const SMDS_MeshElement*> & elemMap) {
elemMap.insert( make_pair( elem->GetID(), elem ));
}
public: public:
SMESH_MeshEditor( SMESH_Mesh* theMesh ); SMESH_MeshEditor( SMESH_Mesh* theMesh );
/*!
* \brief Add element
*/
SMDS_MeshElement* AddElement(const std::vector<const SMDS_MeshNode*> & nodes,
const SMDSAbs_ElementType type,
const bool isPoly,
const int ID = 0);
/*!
* \brief Add element
*/
SMDS_MeshElement* AddElement(const std::vector<int> & nodeIDs,
const SMDSAbs_ElementType type,
const bool isPoly,
const int ID = 0);
bool Remove (const std::list< int >& theElemIDs, const bool isNodes); bool Remove (const std::list< int >& theElemIDs, const bool isNodes);
// Remove a node or an element. // Remove a node or an element.
// Modify a compute state of sub-meshes which become empty // Modify a compute state of sub-meshes which become empty
@ -116,7 +141,7 @@ public:
* is still performed; theMaxAngle is mesured in radians. * is still performed; theMaxAngle is mesured in radians.
* \retval bool - Success or not. * \retval bool - Success or not.
*/ */
bool TriToQuad (std::map<int,const SMDS_MeshElement*> & theElems, bool TriToQuad (TIDSortedElemSet & theElems,
SMESH::Controls::NumericalFunctorPtr theCriterion, SMESH::Controls::NumericalFunctorPtr theCriterion,
const double theMaxAngle); const double theMaxAngle);
@ -126,7 +151,7 @@ public:
* \param theCriterion - Is used to choose a diagonal for splitting. * \param theCriterion - Is used to choose a diagonal for splitting.
* \retval bool - Success or not. * \retval bool - Success or not.
*/ */
bool QuadToTri (std::map<int,const SMDS_MeshElement*> & theElems, bool QuadToTri (TIDSortedElemSet & theElems,
SMESH::Controls::NumericalFunctorPtr theCriterion); SMESH::Controls::NumericalFunctorPtr theCriterion);
/*! /*!
@ -135,8 +160,8 @@ public:
* \param the13Diag - Is used to choose a diagonal for splitting. * \param the13Diag - Is used to choose a diagonal for splitting.
* \retval bool - Success or not. * \retval bool - Success or not.
*/ */
bool QuadToTri (std::map<int,const SMDS_MeshElement*> & theElems, bool QuadToTri (TIDSortedElemSet & theElems,
const bool the13Diag); const bool the13Diag);
/*! /*!
* \brief Find better diagonal for splitting. * \brief Find better diagonal for splitting.
@ -150,12 +175,12 @@ public:
enum SmoothMethod { LAPLACIAN = 0, CENTROIDAL }; enum SmoothMethod { LAPLACIAN = 0, CENTROIDAL };
void Smooth (std::map<int,const SMDS_MeshElement*> & theElements, void Smooth (TIDSortedElemSet & theElements,
std::set<const SMDS_MeshNode*> & theFixedNodes, std::set<const SMDS_MeshNode*> & theFixedNodes,
const SmoothMethod theSmoothMethod, const SmoothMethod theSmoothMethod,
const int theNbIterations, const int theNbIterations,
double theTgtAspectRatio = 1.0, double theTgtAspectRatio = 1.0,
const bool the2D = true); const bool the2D = true);
// Smooth theElements using theSmoothMethod during theNbIterations // Smooth theElements using theSmoothMethod during theNbIterations
// or until a worst element has aspect ratio <= theTgtAspectRatio. // or until a worst element has aspect ratio <= theTgtAspectRatio.
// Aspect Ratio varies in range [1.0, inf]. // Aspect Ratio varies in range [1.0, inf].
@ -166,11 +191,12 @@ public:
// on geometrical faces // on geometrical faces
void RotationSweep (std::map<int,const SMDS_MeshElement*> & theElements, void RotationSweep (TIDSortedElemSet & theElements,
const gp_Ax1& theAxis, const gp_Ax1& theAxis,
const double theAngle, const double theAngle,
const int theNbSteps, const int theNbSteps,
const double theToler); const double theToler,
const bool theMakeWalls=true);
// Generate new elements by rotation of theElements around theAxis // Generate new elements by rotation of theElements around theAxis
// by theAngle by theNbSteps // by theAngle by theNbSteps
@ -216,12 +242,12 @@ public:
* EXTRUSION_FLAG_SEW is set * EXTRUSION_FLAG_SEW is set
*/ */
void ExtrusionSweep void ExtrusionSweep
(map<int,const SMDS_MeshElement*> & theElems, (TIDSortedElemSet & theElems,
const gp_Vec& theStep, const gp_Vec& theStep,
const int theNbSteps, const int theNbSteps,
TElemOfElemListMap& newElemsMap, TElemOfElemListMap& newElemsMap,
const int theFlags = EXTRUSION_FLAG_BOUNDARY, const int theFlags = EXTRUSION_FLAG_BOUNDARY,
const double theTolerance = 1.e-6); const double theTolerance = 1.e-6);
/*! /*!
* Generate new elements by extrusion of theElements * Generate new elements by extrusion of theElements
@ -233,11 +259,11 @@ public:
* EXTRUSION_FLAG_SEW is set * EXTRUSION_FLAG_SEW is set
* param theParams - special structure for manage of extrusion * param theParams - special structure for manage of extrusion
*/ */
void ExtrusionSweep (map<int,const SMDS_MeshElement*> & theElems, void ExtrusionSweep (TIDSortedElemSet & theElems,
ExtrusParam& theParams, ExtrusParam& theParams,
TElemOfElemListMap& newElemsMap, TElemOfElemListMap& newElemsMap,
const int theFlags, const int theFlags,
const double theTolerance); const double theTolerance);
// Generate new elements by extrusion of theElements // Generate new elements by extrusion of theElements
@ -253,19 +279,19 @@ public:
EXTR_CANT_GET_TANGENT EXTR_CANT_GET_TANGENT
}; };
Extrusion_Error ExtrusionAlongTrack (std::map<int,const SMDS_MeshElement*> & theElements, Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet & theElements,
SMESH_subMesh* theTrackPattern, SMESH_subMesh* theTrackPattern,
const SMDS_MeshNode* theNodeStart, const SMDS_MeshNode* theNodeStart,
const bool theHasAngles, const bool theHasAngles,
std::list<double>& theAngles, std::list<double>& theAngles,
const bool theHasRefPoint, const bool theHasRefPoint,
const gp_Pnt& theRefPoint); const gp_Pnt& theRefPoint);
// Generate new elements by extrusion of theElements along path given by theTrackPattern, // Generate new elements by extrusion of theElements along path given by theTrackPattern,
// theHasAngles are the rotation angles, base point can be given by theRefPoint // theHasAngles are the rotation angles, base point can be given by theRefPoint
void Transform (std::map<int,const SMDS_MeshElement*> & theElements, void Transform (TIDSortedElemSet & theElements,
const gp_Trsf& theTrsf, const gp_Trsf& theTrsf,
const bool theCopy); const bool theCopy);
// Move or copy theElements applying theTrsf to their nodes // Move or copy theElements applying theTrsf to their nodes
typedef std::list< std::list< const SMDS_MeshNode* > > TListOfListOfNodes; typedef std::list< std::list< const SMDS_MeshNode* > > TListOfListOfNodes;
@ -276,6 +302,11 @@ public:
// Return list of group of nodes close to each other within theTolerance. // Return list of group of nodes close to each other within theTolerance.
// Search among theNodes or in the whole mesh if theNodes is empty. // Search among theNodes or in the whole mesh if theNodes is empty.
/*!
* \brief Return SMESH_NodeSearcher
*/
SMESH_NodeSearcher* GetNodeSearcher();
int SimplifyFace (const vector<const SMDS_MeshNode *> faceNodes, int SimplifyFace (const vector<const SMDS_MeshNode *> faceNodes,
vector<const SMDS_MeshNode *>& poly_nodes, vector<const SMDS_MeshNode *>& poly_nodes,
vector<int>& quantities) const; vector<int>& quantities) const;
@ -286,6 +317,16 @@ public:
// In each group, the cdr of nodes are substituted by the first one // In each group, the cdr of nodes are substituted by the first one
// in all elements. // in all elements.
typedef std::list< std::list< int > > TListOfListOfElementsID;
void FindEqualElements(std::set<const SMDS_MeshElement*> & theElements,
TListOfListOfElementsID & theGroupsOfElementsID);
// Return list of group of elements build on the same nodes.
// Search among theElements or in the whole mesh if theElements is empty.
void MergeElements(TListOfListOfElementsID & theGroupsOfElementsID);
// In each group remove all but first of elements.
void MergeEqualElements(); void MergeEqualElements();
// Remove all but one of elements built on the same nodes. // Remove all but one of elements built on the same nodes.
// Return nb of successfully merged groups. // Return nb of successfully merged groups.
@ -348,12 +389,12 @@ public:
// nodes are inserted. // nodes are inserted.
// Return false, if sewing failed. // Return false, if sewing failed.
Sew_Error SewSideElements (std::map<int,const SMDS_MeshElement*>& theSide1, Sew_Error SewSideElements (TIDSortedElemSet& theSide1,
std::map<int,const SMDS_MeshElement*>& theSide2, TIDSortedElemSet& theSide2,
const SMDS_MeshNode* theFirstNode1ToMerge, const SMDS_MeshNode* theFirstNode1ToMerge,
const SMDS_MeshNode* theFirstNode2ToMerge, const SMDS_MeshNode* theFirstNode2ToMerge,
const SMDS_MeshNode* theSecondNode1ToMerge, const SMDS_MeshNode* theSecondNode1ToMerge,
const SMDS_MeshNode* theSecondNode2ToMerge); const SMDS_MeshNode* theSecondNode2ToMerge);
// Sew two sides of a mesh. Nodes belonging to theSide1 are // Sew two sides of a mesh. Nodes belonging to theSide1 are
// merged with nodes of elements of theSide2. // merged with nodes of elements of theSide2.
// Number of elements in theSide1 and in theSide2 must be // Number of elements in theSide1 and in theSide2 must be
@ -404,11 +445,18 @@ public:
SMESHDS_Mesh * aMesh); SMESHDS_Mesh * aMesh);
// remove elemToAdd from the groups // remove elemToAdd from the groups
/*!
* \brief Return nodes linked to the given one in elements of the type
*/
static void GetLinkedNodes( const SMDS_MeshNode* node,
TIDSortedElemSet & linkedNodes,
SMDSAbs_ElementType type = SMDSAbs_All );
static const SMDS_MeshElement* static const SMDS_MeshElement*
FindFaceInSet(const SMDS_MeshNode* n1, FindFaceInSet(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
const std::map<int,const SMDS_MeshElement*>& elemSet, const TIDSortedElemSet& elemSet,
const std::map<int,const SMDS_MeshElement*>& avoidSet); const TIDSortedElemSet& avoidSet);
// Return a face having linked nodes n1 and n2 and which is // Return a face having linked nodes n1 and n2 and which is
// - not in avoidSet, // - not in avoidSet,
// - in elemSet provided that !elemSet.empty() // - in elemSet provided that !elemSet.empty()
@ -449,23 +497,28 @@ public:
SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); } SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
SMESH_SequenceOfElemPtr GetLastCreatedNodes() { return myLastCreatedNodes; } const SMESH_SequenceOfElemPtr& GetLastCreatedNodes() const { return myLastCreatedNodes; }
SMESH_SequenceOfElemPtr GetLastCreatedElems() { return myLastCreatedElems; } const SMESH_SequenceOfElemPtr& GetLastCreatedElems() const { return myLastCreatedElems; }
private: private:
void ConvertElemToQuadratic(SMESHDS_SubMesh *theSm, /*!
SMESH_MesherHelper* theHelper, * \brief Convert elements contained in a submesh to quadratic
const bool theForce3d); * \retval int - nb of checked elements
//Auxiliary function for "ConvertToQuadratic" is intended to convert */
//elements contained in submesh to quadratic int ConvertElemToQuadratic(SMESHDS_SubMesh * theSm,
SMESH_MesherHelper& theHelper,
const bool theForce3d);
void RemoveQuadElem( SMESHDS_SubMesh *theSm, /*!
SMDS_ElemIteratorPtr theItr, * \brief Convert quadratic elements to linear ones and remove quadratic nodes
RemoveQuadNodeMap& theRemoveNodeMap); * \retval int - nb of checked elements
//Auxiliary function for "ConvertFromQuadratic" is intended to convert quadratic */
//element to ordinary and for removing quadratic nodes int RemoveQuadElem( SMESHDS_SubMesh * theSm,
SMDS_ElemIteratorPtr theItr,
const int theShapeID);
//Auxiliary function for "ConvertFromQuadratic" is intended to
private: private:

View File

@ -44,6 +44,18 @@
#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; } #define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; }
//================================================================================
/*!
* \brief Constructor
*/
//================================================================================
SMESH_MesherHelper::SMESH_MesherHelper(SMESH_Mesh& theMesh)
: myMesh(&theMesh), myShapeID(-1), myCreateQuadratic(false)
{
mySetElemOnShape = ( ! myMesh->HasShapeToMesh() );
}
//======================================================================= //=======================================================================
//function : CheckShape //function : CheckShape
//purpose : //purpose :
@ -115,7 +127,7 @@ void SMESH_MesherHelper::SetSubShape(const int aShID)
if ( aShID == myShapeID ) if ( aShID == myShapeID )
return; return;
if ( aShID > 1 ) if ( aShID > 1 )
SetSubShape( GetMesh()->GetMeshDS()->IndexToShape( aShID )); SetSubShape( GetMeshDS()->IndexToShape( aShID ));
else else
SetSubShape( TopoDS_Shape() ); SetSubShape( TopoDS_Shape() );
} }
@ -282,7 +294,7 @@ gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face& F,
// edge and recieve value from this pcurve // edge and recieve value from this pcurve
const SMDS_EdgePosition* epos = const SMDS_EdgePosition* epos =
static_cast<const SMDS_EdgePosition*>(n->GetPosition().get()); static_cast<const SMDS_EdgePosition*>(n->GetPosition().get());
SMESHDS_Mesh* meshDS = GetMesh()->GetMeshDS(); SMESHDS_Mesh* meshDS = GetMeshDS();
int edgeID = Pos->GetShapeId(); int edgeID = Pos->GetShapeId();
TopoDS_Edge E = TopoDS::Edge(meshDS->IndexToShape(edgeID)); TopoDS_Edge E = TopoDS::Edge(meshDS->IndexToShape(edgeID));
double f, l; double f, l;
@ -326,7 +338,7 @@ double SMESH_MesherHelper::GetNodeU(const TopoDS_Edge& E,
param = epos->GetUParameter(); param = epos->GetUParameter();
} }
else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX) { else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX) {
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
int vertexID = n->GetPosition()->GetShapeId(); int vertexID = n->GetPosition()->GetShapeId();
const TopoDS_Vertex& V = TopoDS::Vertex(meshDS->IndexToShape(vertexID)); const TopoDS_Vertex& V = TopoDS::Vertex(meshDS->IndexToShape(vertexID));
param = BRep_Tool::Parameter( V, E ); param = BRep_Tool::Parameter( V, E );
@ -478,68 +490,108 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
} }
//======================================================================= //=======================================================================
//function : AddQuadraticEdge /*!
//purpose : * Creates a node
//=======================================================================
/**
* Special function for creation quadratic edge
*/ */
SMDS_QuadraticEdge* SMESH_MesherHelper::AddQuadraticEdge(const SMDS_MeshNode* n1, //=======================================================================
const SMDS_MeshNode* n2,
const int id, SMDS_MeshNode* SMESH_MesherHelper::AddNode(double x, double y, double z, int ID)
const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshNode* node = 0;
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d); if ( ID )
node = meshDS->AddNodeWithID( x, y, z, ID );
myCreateQuadratic = true;
if(id)
return (SMDS_QuadraticEdge*)(meshDS->AddEdgeWithID(n1, n2, n12, id));
else else
return (SMDS_QuadraticEdge*)(meshDS->AddEdge(n1, n2, n12)); node = meshDS->AddNode( x, y, z );
if ( mySetElemOnShape && myShapeID > 0 ) {
switch ( myShape.ShapeType() ) {
case TopAbs_SOLID: meshDS->SetNodeInVolume( node, myShapeID); break;
case TopAbs_SHELL: meshDS->SetNodeInVolume( node, myShapeID); break;
case TopAbs_FACE: meshDS->SetNodeOnFace( node, myShapeID); break;
case TopAbs_EDGE: meshDS->SetNodeOnEdge( node, myShapeID); break;
case TopAbs_VERTEX: meshDS->SetNodeOnVertex( node, myShapeID); break;
default: ;
}
}
return node;
} }
//======================================================================= //=======================================================================
//function : AddFace /*!
//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)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshEdge* edge = 0;
if (myCreateQuadratic) {
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
if(id)
edge = meshDS->AddEdgeWithID(n1, n2, n12, id);
else
edge = meshDS->AddEdge(n1, n2, n12);
}
else {
if(id)
edge = meshDS->AddEdgeWithID(n1, n2, id);
else
edge = meshDS->AddEdge(n1, n2);
}
if ( mySetElemOnShape && myShapeID > 0 )
meshDS->SetMeshElementOnShape( edge, myShapeID );
return edge;
}
//======================================================================= //=======================================================================
/*! /*!
* Special function for creation quadratic triangle * Creates quadratic or linear triangle
*/ */
//=======================================================================
SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1, SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3, const SMDS_MeshNode* n3,
const int id, const int id,
const bool force3d) const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshFace* elem = 0;
if(!myCreateQuadratic) { if(!myCreateQuadratic) {
if(id) if(id)
return meshDS->AddFaceWithID(n1, n2, n3, id); elem = meshDS->AddFaceWithID(n1, n2, n3, id);
else else
return meshDS->AddFace(n1, n2, n3); elem = meshDS->AddFace(n1, n2, n3);
} }
else {
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d);
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d); if(id)
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d); elem = meshDS->AddFaceWithID(n1, n2, n3, n12, n23, n31, id);
const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d); else
elem = meshDS->AddFace(n1, n2, n3, n12, n23, n31);
}
if ( mySetElemOnShape && myShapeID > 0 )
meshDS->SetMeshElementOnShape( elem, myShapeID );
if(id) return elem;
return meshDS->AddFaceWithID(n1, n2, n3, n12, n23, n31, id);
else
return meshDS->AddFace(n1, n2, n3, n12, n23, n31);
} }
//=======================================================================
//function : AddFace
//purpose :
//======================================================================= //=======================================================================
/*! /*!
* Special function for creation quadratic quadrangle * Creates quadratic or linear quadrangle
*/ */
//=======================================================================
SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1, SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3, const SMDS_MeshNode* n3,
@ -547,33 +599,37 @@ SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
const int id, const int id,
const bool force3d) const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshFace* elem = 0;
if(!myCreateQuadratic) { if(!myCreateQuadratic) {
if(id) if(id)
return meshDS->AddFaceWithID(n1, n2, n3, n4, id); elem = meshDS->AddFaceWithID(n1, n2, n3, n4, id);
else else
return meshDS->AddFace(n1, n2, n3, n4); elem = meshDS->AddFace(n1, n2, n3, n4);
} }
else {
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d);
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d); if(id)
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d); elem = meshDS->AddFaceWithID(n1, n2, n3, n4, n12, n23, n34, n41, id);
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d); else
const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d); elem = meshDS->AddFace(n1, n2, n3, n4, n12, n23, n34, n41);
}
if ( mySetElemOnShape && myShapeID > 0 )
meshDS->SetMeshElementOnShape( elem, myShapeID );
if(id) return elem;
return meshDS->AddFaceWithID(n1, n2, n3, n4, n12, n23, n34, n41, id);
else
return meshDS->AddFace(n1, n2, n3, n4, n12, n23, n34, n41);
} }
//=======================================================================
//function : AddVolume
//purpose :
//======================================================================= //=======================================================================
/*! /*!
* Special function for creation quadratic volume * Creates quadratic or linear volume
*/ */
//=======================================================================
SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3, const SMDS_MeshNode* n3,
@ -583,37 +639,43 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
const int id, const int id,
const bool force3d) const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshVolume* elem = 0;
if(!myCreateQuadratic) { if(!myCreateQuadratic) {
if(id) if(id)
return meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, id); elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, id);
else else
return meshDS->AddVolume(n1, n2, n3, n4, n5, n6); elem = meshDS->AddVolume(n1, n2, n3, n4, n5, n6);
} }
else {
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d);
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d); const SMDS_MeshNode* n45 = GetMediumNode(n4,n5,force3d);
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d); const SMDS_MeshNode* n56 = GetMediumNode(n5,n6,force3d);
const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d); const SMDS_MeshNode* n64 = GetMediumNode(n6,n4,force3d);
const SMDS_MeshNode* n45 = GetMediumNode(n4,n5,force3d); const SMDS_MeshNode* n14 = GetMediumNode(n1,n4,force3d);
const SMDS_MeshNode* n56 = GetMediumNode(n5,n6,force3d); const SMDS_MeshNode* n25 = GetMediumNode(n2,n5,force3d);
const SMDS_MeshNode* n64 = GetMediumNode(n6,n4,force3d); const SMDS_MeshNode* n36 = GetMediumNode(n3,n6,force3d);
const SMDS_MeshNode* n14 = GetMediumNode(n1,n4,force3d); if(id)
const SMDS_MeshNode* n25 = GetMediumNode(n2,n5,force3d); elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6,
const SMDS_MeshNode* n36 = GetMediumNode(n3,n6,force3d); n12, n23, n31, n45, n56, n64, n14, n25, n36, id);
else
elem = meshDS->AddVolume(n1, n2, n3, n4, n5, n6,
n12, n23, n31, n45, n56, n64, n14, n25, n36);
}
if ( mySetElemOnShape && myShapeID > 0 )
meshDS->SetMeshElementOnShape( elem, myShapeID );
if(id) return elem;
return meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6,
n12, n23, n31, n45, n56, n64, n14, n25, n36, id);
else
return meshDS->AddVolume(n1, n2, n3, n4, n5, n6,
n12, n23, n31, n45, n56, n64, n14, n25, n36);
} }
//======================================================================= //=======================================================================
/*! /*!
* Special function for creation quadratic volume * Creates quadratic or linear volume
*/ */
//======================================================================= //=======================================================================
@ -624,31 +686,37 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
const int id, const int id,
const bool force3d) const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshVolume* elem = 0;
if(!myCreateQuadratic) { if(!myCreateQuadratic) {
if(id) if(id)
return meshDS->AddVolumeWithID(n1, n2, n3, n4, id); elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, id);
else else
return meshDS->AddVolume(n1, n2, n3, n4); elem = meshDS->AddVolume(n1, n2, n3, n4);
} }
else {
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d);
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d); const SMDS_MeshNode* n14 = GetMediumNode(n1,n4,force3d);
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d); const SMDS_MeshNode* n24 = GetMediumNode(n2,n4,force3d);
const SMDS_MeshNode* n31 = GetMediumNode(n3,n1,force3d); const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
const SMDS_MeshNode* n14 = GetMediumNode(n1,n4,force3d); if(id)
const SMDS_MeshNode* n24 = GetMediumNode(n2,n4,force3d); elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, n12, n23, n31, n14, n24, n34, id);
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d); else
elem = meshDS->AddVolume(n1, n2, n3, n4, n12, n23, n31, n14, n24, n34);
}
if ( mySetElemOnShape && myShapeID > 0 )
meshDS->SetMeshElementOnShape( elem, myShapeID );
if(id) return elem;
return meshDS->AddVolumeWithID(n1, n2, n3, n4, n12, n23, n31, n14, n24, n34, id);
else
return meshDS->AddVolume(n1, n2, n3, n4, n12, n23, n31, n14, n24, n34);
} }
//======================================================================= //=======================================================================
/*! /*!
* Special function for creation quadratic pyramid * Creates quadratic or linear pyramid
*/ */
//======================================================================= //=======================================================================
@ -660,37 +728,43 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
const int id, const int id,
const bool force3d) const bool force3d)
{ {
SMDS_MeshVolume* elem = 0;
if(!myCreateQuadratic) { if(!myCreateQuadratic) {
if(id) if(id)
return GetMeshDS()->AddVolumeWithID(n1, n2, n3, n4, n5, id); elem = GetMeshDS()->AddVolumeWithID(n1, n2, n3, n4, n5, id);
else else
return GetMeshDS()->AddVolume(n1, n2, n3, n4, n5); elem = GetMeshDS()->AddVolume(n1, n2, n3, n4, n5);
} }
else {
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d);
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d); const SMDS_MeshNode* n15 = GetMediumNode(n1,n5,force3d);
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d); const SMDS_MeshNode* n25 = GetMediumNode(n2,n5,force3d);
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d); const SMDS_MeshNode* n35 = GetMediumNode(n3,n5,force3d);
const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d); const SMDS_MeshNode* n45 = GetMediumNode(n4,n5,force3d);
const SMDS_MeshNode* n15 = GetMediumNode(n1,n5,force3d); if(id)
const SMDS_MeshNode* n25 = GetMediumNode(n2,n5,force3d); elem = GetMeshDS()->AddVolumeWithID ( n1, n2, n3, n4, n5,
const SMDS_MeshNode* n35 = GetMediumNode(n3,n5,force3d); n12, n23, n34, n41,
const SMDS_MeshNode* n45 = GetMediumNode(n4,n5,force3d); n15, n25, n35, n45,
id);
else
elem = GetMeshDS()->AddVolume( n1, n2, n3, n4, n5,
n12, n23, n34, n41,
n15, n25, n35, n45);
}
if ( mySetElemOnShape && myShapeID > 0 )
GetMeshDS()->SetMeshElementOnShape( elem, myShapeID );
if(id) return elem;
return GetMeshDS()->AddVolumeWithID ( n1, n2, n3, n4, n5,
n12, n23, n34, n41,
n15, n25, n35, n45,
id);
else
return GetMeshDS()->AddVolume( n1, n2, n3, n4, n5,
n12, n23, n34, n41,
n15, n25, n35, n45);
} }
//======================================================================= //=======================================================================
/*! /*!
* Special function for creation of quadratic hexahedron * Creates quadratic or linear hexahedron
*/ */
//======================================================================= //=======================================================================
@ -705,37 +779,43 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
const int id, const int id,
const bool force3d) const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshVolume* elem = 0;
if(!myCreateQuadratic) { if(!myCreateQuadratic) {
if(id) if(id)
return meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, id); elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, id);
else else
return meshDS->AddVolume(n1, n2, n3, n4, n5, n6, n7, n8); elem = meshDS->AddVolume(n1, n2, n3, n4, n5, n6, n7, n8);
} }
else {
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d);
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d);
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d);
const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d);
const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d); const SMDS_MeshNode* n56 = GetMediumNode(n5,n6,force3d);
const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d); const SMDS_MeshNode* n67 = GetMediumNode(n6,n7,force3d);
const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d); const SMDS_MeshNode* n78 = GetMediumNode(n7,n8,force3d);
const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d); const SMDS_MeshNode* n85 = GetMediumNode(n8,n5,force3d);
const SMDS_MeshNode* n56 = GetMediumNode(n5,n6,force3d); const SMDS_MeshNode* n15 = GetMediumNode(n1,n5,force3d);
const SMDS_MeshNode* n67 = GetMediumNode(n6,n7,force3d); const SMDS_MeshNode* n26 = GetMediumNode(n2,n6,force3d);
const SMDS_MeshNode* n78 = GetMediumNode(n7,n8,force3d); const SMDS_MeshNode* n37 = GetMediumNode(n3,n7,force3d);
const SMDS_MeshNode* n85 = GetMediumNode(n8,n5,force3d); const SMDS_MeshNode* n48 = GetMediumNode(n4,n8,force3d);
const SMDS_MeshNode* n15 = GetMediumNode(n1,n5,force3d); if(id)
const SMDS_MeshNode* n26 = GetMediumNode(n2,n6,force3d); elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8,
const SMDS_MeshNode* n37 = GetMediumNode(n3,n7,force3d); n12, n23, n34, n41, n56, n67,
const SMDS_MeshNode* n48 = GetMediumNode(n4,n8,force3d); n78, n85, n15, n26, n37, n48, id);
else
elem = meshDS->AddVolume(n1, n2, n3, n4, n5, n6, n7, n8,
n12, n23, n34, n41, n56, n67,
n78, n85, n15, n26, n37, n48);
}
if ( mySetElemOnShape && myShapeID > 0 )
meshDS->SetMeshElementOnShape( elem, myShapeID );
if(id) return elem;
return meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8,
n12, n23, n34, n41, n56, n67,
n78, n85, n15, n26, n37, n48, id);
else
return meshDS->AddVolume(n1, n2, n3, n4, n5, n6, n7, n8,
n12, n23, n34, n41, n56, n67,
n78, n85, n15, n26, n37, n48);
} }
//======================================================================= //=======================================================================
@ -871,7 +951,7 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
const SMDS_MeshNode* node; const SMDS_MeshNode* node;
while ( nIt->more() ) { while ( nIt->more() ) {
node = nIt->next(); node = nIt->next();
if(IsMedium(node)) if(IsMedium(node, SMDSAbs_Edge))
continue; continue;
const SMDS_EdgePosition* pos = const SMDS_EdgePosition* pos =
dynamic_cast<const SMDS_EdgePosition*>( node->GetPosition().get() ); dynamic_cast<const SMDS_EdgePosition*>( node->GetPosition().get() );
@ -914,12 +994,12 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
// try to load the rest nodes // try to load the rest nodes
// get all faces from theFace // get all faces from theFace
map<int,const SMDS_MeshElement*> allFaces, foundFaces; TIDSortedElemSet allFaces, foundFaces;
eIt = smFace->GetElements(); eIt = smFace->GetElements();
while ( eIt->more() ) { while ( eIt->more() ) {
const SMDS_MeshElement* e = eIt->next(); const SMDS_MeshElement* e = eIt->next();
if ( e->GetType() == SMDSAbs_Face ) if ( e->GetType() == SMDSAbs_Face )
allFaces.insert( make_pair(e->GetID(),e) ); allFaces.insert( e );
} }
// Starting from 2 neighbour nodes on theBaseEdge, look for a face // Starting from 2 neighbour nodes on theBaseEdge, look for a face
// the nodes belong to, and between the nodes of the found face, // the nodes belong to, and between the nodes of the found face,
@ -967,7 +1047,7 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
RETURN_BAD_RESULT( "Too many nodes in column "<< col <<": "<< row+1); RETURN_BAD_RESULT( "Too many nodes in column "<< col <<": "<< row+1);
} }
par_nVec_2->second[ row ] = node; par_nVec_2->second[ row ] = node;
foundFaces.insert( make_pair(face->GetID(),face) ); foundFaces.insert( face );
n2 = node; n2 = node;
if ( nbFaceNodes==4 ) { if ( nbFaceNodes==4 ) {
n1 = par_nVec_1->second[ row ]; n1 = par_nVec_1->second[ row ];

View File

@ -57,6 +57,15 @@ class SMESH_EXPORT SMESH_MesherHelper
public: public:
// ---------- PUBLIC UTILITIES ---------- // ---------- PUBLIC UTILITIES ----------
/*!
* \brief Returns true if given node is medium
* \param n - node to check
* \param typeToCheck - type of elements containing the node to ask about node status
* \retval bool - check result
*/
static bool IsMedium(const SMDS_MeshNode* node,
const SMDSAbs_ElementType typeToCheck = SMDSAbs_All);
/*! /*!
* \brief Load nodes bound to face into a map of node columns * \brief Load nodes bound to face into a map of node columns
* \param theParam2ColumnMap - map of node columns to fill * \param theParam2ColumnMap - map of node columns to fill
@ -97,119 +106,73 @@ public:
} }
public: public:
// ---------- PUBLIC METHODS ---------- // ---------- PUBLIC INSTANCE METHODS ----------
/// Empty constructor // constructor
SMESH_MesherHelper(SMESH_Mesh& theMesh) SMESH_MesherHelper(SMESH_Mesh& theMesh);
{ myMesh=(void *)&theMesh; myCreateQuadratic = false; myShapeID=-1;}
SMESH_Mesh* GetMesh() const { return (SMESH_Mesh*)myMesh; } SMESH_Mesh* GetMesh() const { return myMesh; }
SMESHDS_Mesh* GetMeshDS() const { return GetMesh()->GetMeshDS(); } SMESHDS_Mesh* GetMeshDS() const { return GetMesh()->GetMeshDS(); }
/// Copy constructor /*!
//Standard_EXPORT SMESH_MesherHelper (const SMESH_MesherHelper& theOther); * Check submesh for given shape: if all elements on this shape are quadratic,
* quadratic elements will be created. Also fill myNLinkNodeMap
/// Destructor
//Standard_EXPORT virtual ~SMESH_MesherHelper ();
/**
* Check submesh for given shape
* Check if all elements on this shape
* are quadratic, if yes => set true to myCreateQuadratic
* (default value is false). Also fill myNLinkNodeMap
* Returns myCreateQuadratic
*/ */
bool IsQuadraticSubMesh(const TopoDS_Shape& theShape); bool IsQuadraticSubMesh(const TopoDS_Shape& theShape);
/*!
* \brief Set order of elements to create without calling IsQuadraticSubMesh()
*/
void SetIsQuadratic(const bool theBuildQuadratic)
{ myCreateQuadratic = theBuildQuadratic; }
/*!
* \brief Return myCreateQuadratic flag
*/
bool GetIsQuadratic() const { return myCreateQuadratic; }
/*! /*!
* \brief Returns true if given node is medium * \brief To set created elements on the shape set by IsQuadraticSubMesh()
* \param n - node to check * or the next methods. By defaul elements are set on the shape if
* \param typeToCheck - type of elements containing the node to ask about node status * a mesh has no shape to be meshed
* \retval bool - check result
*/ */
static bool IsMedium(const SMDS_MeshNode* node, void SetElementsOnShape(bool toSet) { mySetElemOnShape = toSet; }
const SMDSAbs_ElementType typeToCheck = SMDSAbs_All);
/**
* Auxilary function for filling myNLinkNodeMap
*/
void AddNLinkNode(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n12);
/**
* Auxilary function for filling myNLinkNodeMap
*/
void AddNLinkNodeMap(const NLinkNodeMap& aMap)
{ myNLinkNodeMap.insert(aMap.begin(), aMap.end()); }
/**
* Returns myNLinkNodeMap
*/
const NLinkNodeMap& GetNLinkNodeMap() { return myNLinkNodeMap; }
/*! /*!
* \brief Return node UV on face * \brief Set shape to make elements on without calling IsQuadraticSubMesh()
* \param F - the face
* \param n - the node
* \param inFaceNode - a node of element being created located inside a face
* \retval gp_XY - resulting UV
*
* Auxilary function called form GetMediumNode()
*/ */
gp_XY GetNodeUV(const TopoDS_Face& F, void SetSubShape(const int subShapeID);//!==SMESHDS_Mesh::ShapeToIndex(shape)
const SMDS_MeshNode* n, void SetSubShape(const TopoDS_Shape& subShape);
const SMDS_MeshNode* inFaceNode=0) const; /*!
* \brief Return ID of the shape set by IsQuadraticSubMesh() or SetSubShape()
* \retval int - shape index in SMESHDS
*/
int GetSubShapeID() const { return myShapeID; }
/*!
* \brief Return the shape set by IsQuadraticSubMesh() or SetSubShape()
*/
TopoDS_Shape GetSubShape() const { return myShape; }
/*! /*!
* \brief Check if inFaceNode argument is necessary for call GetNodeUV(F,..) * Creates a node
* \param F - the face
* \retval bool - return true if the face is periodic
*
* if F is Null, answer about subshape set through IsQuadraticSubMesh() or
* SetSubShape()
*/ */
bool GetNodeUVneedInFaceNode(const TopoDS_Face& F = TopoDS_Face()) const; SMDS_MeshNode* AddNode(double x, double y, double z, int ID = 0);
/*! /*!
* \brief Return U on edge * Creates quadratic or linear edge
* \param F - the edge
* \param n - the node
* \retval double - resulting U
*
* Auxilary function called from GetMediumNode()
*/ */
double GetNodeU(const TopoDS_Edge& E, SMDS_MeshEdge* AddEdge(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n); const SMDS_MeshNode* n2,
const int id = 0,
const bool force3d = true);
/** /*!
* Special function for search or creation medium node * Creates quadratic or linear triangle
*/
const SMDS_MeshNode* GetMediumNode(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const bool force3d);
/**
* Special function for creation quadratic edge
*/
SMDS_QuadraticEdge* AddQuadraticEdge(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const int id = 0,
const bool force3d = true);
/**
* Special function for creation quadratic triangle
*/ */
SMDS_MeshFace* AddFace(const SMDS_MeshNode* n1, SMDS_MeshFace* AddFace(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3, const SMDS_MeshNode* n3,
const int id=0, const int id=0,
const bool force3d = false); const bool force3d = false);
/*!
/** * Creates quadratic or linear quadrangle
* Special function for creation quadratic quadrangle
*/ */
SMDS_MeshFace* AddFace(const SMDS_MeshNode* n1, SMDS_MeshFace* AddFace(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
@ -217,9 +180,8 @@ public:
const SMDS_MeshNode* n4, const SMDS_MeshNode* n4,
const int id = 0, const int id = 0,
const bool force3d = false); const bool force3d = false);
/*!
/** * Creates quadratic or linear tetraahedron
* Special function for creation quadratic tetraahedron
*/ */
SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1, SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
@ -227,10 +189,8 @@ public:
const SMDS_MeshNode* n4, const SMDS_MeshNode* n4,
const int id = 0, const int id = 0,
const bool force3d = true); const bool force3d = true);
/*!
* Creates quadratic or linear pyramid
/**
* Special function for creation quadratic pyramid
*/ */
SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1, SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
@ -239,9 +199,8 @@ public:
const SMDS_MeshNode* n5, const SMDS_MeshNode* n5,
const int id = 0, const int id = 0,
const bool force3d = true); const bool force3d = true);
/*!
/** * Creates quadratic or linear pentahedron
* Special function for creation quadratic pentahedron
*/ */
SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1, SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
@ -251,9 +210,8 @@ public:
const SMDS_MeshNode* n6, const SMDS_MeshNode* n6,
const int id = 0, const int id = 0,
const bool force3d = true); const bool force3d = true);
/*!
/** * Creates quadratic or linear hexahedron
* Special function for creation quadratic hexahedron
*/ */
SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1, SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
@ -265,45 +223,26 @@ public:
const SMDS_MeshNode* n8, const SMDS_MeshNode* n8,
const int id = 0, const int id = 0,
bool force3d = true); bool force3d = true);
/*! /*!
* \brief Set order of elements to create * \brief Return U of the given node on the edge
* \param theBuildQuadratic - to build quadratic or not
*
* To be used for quadratic elements creation without preceding
* IsQuadraticSubMesh() or AddQuadraticEdge() call
*/ */
void SetKeyIsQuadratic(const bool theBuildQuadratic) double GetNodeU(const TopoDS_Edge& theEdge,
{ myCreateQuadratic = theBuildQuadratic; } const SMDS_MeshNode* theNode);
/*! /*!
* \brief Return myCreateQuadratic flag * \brief Return node UV on face
* \retval bool - myCreateQuadratic value * \param inFaceNode - a node of element being created located inside a face
*/ */
bool GetIsQuadratic() const { return myCreateQuadratic; } gp_XY GetNodeUV(const TopoDS_Face& F,
const SMDS_MeshNode* n,
const SMDS_MeshNode* inFaceNode=0) const;
/*! /*!
* \brief Set shape to make elements on * \brief Check if inFaceNode argument is necessary for call GetNodeUV(F,..)
* \param subShape, subShapeID - shape or its ID (==SMESHDS_Mesh::ShapeToIndex(shape)) * \retval bool - return true if the face is periodic
*/
void SetSubShape(const int subShapeID);
void SetSubShape(const TopoDS_Shape& subShape);
/*!
* \brief Return shape or its ID, on which created elements are added
* \retval int - shape index in SMESHDS
* *
* Shape is set by calling either IsQuadraticSubMesh() or SetSubShape() * if F is Null, answer about subshape set through IsQuadraticSubMesh() or
* SetSubShape()
*/ */
int GetSubShapeID() const { return myShapeID; } bool GetNodeUVneedInFaceNode(const TopoDS_Face& F = TopoDS_Face()) const;
/*!
* \brief Return shape or its ID, on which created elements are added
* \retval TopoDS_Shape - shape
*
* Shape is set by calling either IsQuadraticSubMesh() or SetSubShape()
*/
TopoDS_Shape GetSubShape() const { return myShape; }
/*! /*!
* \brief Check if shape is a seam edge or it's vertex * \brief Check if shape is a seam edge or it's vertex
@ -323,21 +262,42 @@ public:
*/ */
bool IsSeamShape(const TopoDS_Shape& subShape) const bool IsSeamShape(const TopoDS_Shape& subShape) const
{ return IsSeamShape( GetMeshDS()->ShapeToIndex( subShape )); } { return IsSeamShape( GetMeshDS()->ShapeToIndex( subShape )); }
/*! /*!
* \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape() * \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape()
* has a seam edge * has a seam edge
* \retval bool - true if it has * \retval bool - true if it has
*/ */
bool HasSeam() const { return !mySeamShapeIds.empty(); } bool HasSeam() const { return !mySeamShapeIds.empty(); }
/*! /*!
* \brief Return index of periodic parametric direction of a closed face * \brief Return index of periodic parametric direction of a closed face
* \retval int - 1 for U, 2 for V direction * \retval int - 1 for U, 2 for V direction
*/ */
int GetPeriodicIndex() const { return myParIndex; } int GetPeriodicIndex() const { return myParIndex; }
protected: /**
* Special function for search or creation medium node
*/
const SMDS_MeshNode* GetMediumNode(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const bool force3d);
/*!
* Auxilary function for filling myNLinkNodeMap
*/
void AddNLinkNode(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n12);
/**
* Auxilary function for filling myNLinkNodeMap
*/
void AddNLinkNodeMap(const NLinkNodeMap& aMap)
{ myNLinkNodeMap.insert(aMap.begin(), aMap.end()); }
/**
* Returns myNLinkNodeMap
*/
const NLinkNodeMap& GetNLinkNodeMap() const { return myNLinkNodeMap; }
protected:
/*! /*!
* \brief Select UV on either of 2 pcurves of a seam edge, closest to the given UV * \brief Select UV on either of 2 pcurves of a seam edge, closest to the given UV
@ -349,20 +309,23 @@ public:
private: private:
void* myMesh; // Forbiden copy constructor
SMESH_MesherHelper (const SMESH_MesherHelper& theOther) {};
int myShapeID;
// Key for creation quadratic faces
bool myCreateQuadratic;
// special map for using during creation quadratic faces // special map for using during creation quadratic faces
NLinkNodeMap myNLinkNodeMap; NLinkNodeMap myNLinkNodeMap;
std::set< int > mySeamShapeIds; std::set< int > mySeamShapeIds;
double myPar1, myPar2; // bounds of a closed periodic surface double myPar1, myPar2; // bounds of a closed periodic surface
int myParIndex; // bounds' index (1-U, 2-V) int myParIndex; // bounds' index (1-U, 2-V)
TopoDS_Shape myShape; TopoDS_Shape myShape;
SMESH_Mesh* myMesh;
int myShapeID;
// to create quadratic elements
bool myCreateQuadratic;
bool mySetElemOnShape;
}; };

View File

@ -71,8 +71,9 @@ SMESH_Octree::~SMESH_Octree ()
//=========================================================================== //===========================================================================
void SMESH_Octree::setBox(const Bnd_B3d* box) void SMESH_Octree::setBox(const Bnd_B3d* box)
{ {
delete myBox; // delete myBox;
myBox=new Bnd_B3d(*box); // myBox=new Bnd_B3d(*box);
*myBox = *box;
} }
//=========================================================================== //===========================================================================
@ -81,11 +82,12 @@ void SMESH_Octree::setBox(const Bnd_B3d* box)
* \param box - Set box to the 3d Bounding Box of the Octree * \param box - Set box to the 3d Bounding Box of the Octree
*/ */
//=========================================================================== //===========================================================================
void SMESH_Octree::getBox(Bnd_B3d* box) void SMESH_Octree::getBox(Bnd_B3d& box)
{ {
if(box != NULL) // if(box != NULL)
delete box; // delete box;
box = new Bnd_B3d (*myBox); // box = new Bnd_B3d (*myBox);
box = *myBox;
} }
//=========================================================================== //===========================================================================
@ -135,7 +137,7 @@ void SMESH_Octree::Compute()
//================================================================= //=================================================================
void SMESH_Octree::buildChildren() void SMESH_Octree::buildChildren()
{ {
myChildren = new (SMESH_Octree*)[8]; myChildren = new SMESH_Octree*[8];
gp_XYZ min = myBox->CornerMin(); gp_XYZ min = myBox->CornerMin();
gp_XYZ max = myBox->CornerMax(); gp_XYZ max = myBox->CornerMax();

View File

@ -56,11 +56,14 @@ public:
void setBox(const Bnd_B3d* box); void setBox(const Bnd_B3d* box);
// Set box to the 3d Bounding Box of the Octree // Set box to the 3d Bounding Box of the Octree
void getBox(Bnd_B3d* box); void getBox(Bnd_B3d & box);
// Compute the bigger dimension of the box // Compute the bigger dimension of the box
static double maxSize(const Bnd_B3d* box); static double maxSize(const Bnd_B3d* box);
// Return its level
int level() const { return myLevel; }
protected: protected:
// Constructor for children (has to be implemented in inherited classes) // Constructor for children (has to be implemented in inherited classes)
virtual SMESH_Octree* allocateOctreeChild() = 0; virtual SMESH_Octree* allocateOctreeChild() = 0;

View File

@ -28,8 +28,10 @@
// Module : SMESH // Module : SMESH
#include "SMESH_OctreeNode.hxx" #include "SMESH_OctreeNode.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_SetIterator.hxx"
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <SMDS_MeshNode.hxx>
using namespace std; using namespace std;
@ -42,7 +44,7 @@ using namespace std;
* \param minBoxSize - Minimal size of the Octree Box * \param minBoxSize - Minimal size of the Octree Box
*/ */
//================================================================ //================================================================
SMESH_OctreeNode::SMESH_OctreeNode (set<const SMDS_MeshNode*> theNodes, const int maxLevel, SMESH_OctreeNode::SMESH_OctreeNode (const set<const SMDS_MeshNode*> & theNodes, const int maxLevel,
const int maxNbNodes , const double minBoxSize ) const int maxNbNodes , const double minBoxSize )
:SMESH_Octree(maxLevel,minBoxSize), :SMESH_Octree(maxLevel,minBoxSize),
myMaxNbNodes(maxNbNodes), myMaxNbNodes(maxNbNodes),
@ -119,11 +121,10 @@ const bool SMESH_OctreeNode::isInside(const SMDS_MeshNode * Node, const double p
bool Out = 1 ; bool Out = 1 ;
if (precision<=0.) if (precision<=0.)
return !(myBox->IsOut(gp_XYZ(X,Y,Z))); return !(myBox->IsOut(gp_XYZ(X,Y,Z)));
Bnd_B3d * BoxWithPrecision = new Bnd_B3d(); Bnd_B3d BoxWithPrecision;
getBox(BoxWithPrecision); getBox(BoxWithPrecision);
BoxWithPrecision->Enlarge(precision); BoxWithPrecision.Enlarge(precision);
Out=BoxWithPrecision->IsOut(gp_XYZ(X,Y,Z)); Out=BoxWithPrecision.IsOut(gp_XYZ(X,Y,Z));
delete BoxWithPrecision;
return !(Out); return !(Out);
} }
@ -325,3 +326,28 @@ void SMESH_OctreeNode::FindCoincidentNodes( const SMDS_MeshNode * Node,
} }
} }
//================================================================================
/*!
* \brief Return iterator over children
*/
//================================================================================
SMESH_OctreeNodeIteratorPtr SMESH_OctreeNode::GetChildrenIterator()
{
return SMESH_OctreeNodeIteratorPtr
( new SMDS_SetIterator< SMESH_OctreeNode*, SMESH_Octree** >
( myChildren, ( isLeaf() ? myChildren : &myChildren[ 8 ] )));
}
//================================================================================
/*!
* \brief Return nodes iterator
*/
//================================================================================
SMDS_NodeIteratorPtr SMESH_OctreeNode::GetNodeIterator()
{
return SMDS_NodeIteratorPtr
( new SMDS_SetIterator< SMDS_pNode, set< SMDS_pNode >::const_iterator >
( myNodes.begin(), myNodes.end() ));
}

View File

@ -32,18 +32,24 @@
#include "SMESH_Octree.hxx" #include "SMESH_Octree.hxx"
//forward declaration
class SMDS_MeshNode;
#include <list> #include <list>
#include <set> #include <set>
#include "SMDS_ElemIterator.hxx"
//forward declaration
class SMDS_MeshNode;
class SMESH_OctreeNode;
typedef SMDS_Iterator<SMESH_OctreeNode*> SMESH_OctreeNodeIterator;
typedef boost::shared_ptr<SMESH_OctreeNodeIterator> SMESH_OctreeNodeIteratorPtr;
class SMESH_OctreeNode : public SMESH_Octree{ class SMESH_OctreeNode : public SMESH_Octree{
public: public:
// Constructor // Constructor
SMESH_OctreeNode (set<const SMDS_MeshNode*> theNodes, const int maxLevel = -1, SMESH_OctreeNode (const set<const SMDS_MeshNode*>& theNodes, const int maxLevel = -1,
const int maxNbNodes = 5 , const double minBoxSize = 0.); const int maxNbNodes = 5 , const double minBoxSize = 0.);
//============================= //=============================
@ -75,8 +81,20 @@ public:
list< list< const SMDS_MeshNode*> >* theGroupsOfNodes, list< list< const SMDS_MeshNode*> >* theGroupsOfNodes,
const double theTolerance = 0.00001, const int maxLevel = -1, const double theTolerance = 0.00001, const int maxLevel = -1,
const int maxNbNodes = 5); const int maxNbNodes = 5);
/*!
* \brief Return iterator over children
*/
SMESH_OctreeNodeIteratorPtr GetChildrenIterator();
/*!
* \brief Return nodes iterator
*/
SMDS_NodeIteratorPtr GetNodeIterator();
/*!
* \brief Return nb nodes in a tree
*/
int NbNodes() const { return myNbNodes; }
protected: protected:
//============================= //=============================
/*! /*!

View File

@ -3257,11 +3257,11 @@ void SMESH_Pattern::
myPolyElems.reserve( myIdsOnBoundary.size() ); myPolyElems.reserve( myIdsOnBoundary.size() );
// make a set of refined elements // make a set of refined elements
map<int,const SMDS_MeshElement* > avoidSet, elemSet; TIDSortedElemSet avoidSet, elemSet;
std::vector<const SMDS_MeshElement*>::iterator itv = myElements.begin(); std::vector<const SMDS_MeshElement*>::iterator itv = myElements.begin();
for(; itv!=myElements.end(); itv++) { for(; itv!=myElements.end(); itv++) {
const SMDS_MeshElement* el = (*itv); const SMDS_MeshElement* el = (*itv);
avoidSet.insert( make_pair(el->GetID(),el) ); avoidSet.insert( el );
} }
//avoidSet.insert( myElements.begin(), myElements.end() ); //avoidSet.insert( myElements.begin(), myElements.end() );
@ -3293,7 +3293,7 @@ void SMESH_Pattern::
SMESH_MeshEditor::FindFaceInSet( n1, n2, elemSet, avoidSet ); SMESH_MeshEditor::FindFaceInSet( n1, n2, elemSet, avoidSet );
if ( face ) if ( face )
{ {
avoidSet.insert ( make_pair(face->GetID(),face) ); avoidSet.insert ( face );
myPolyElems.push_back( face ); myPolyElems.push_back( face );
// some links of <face> are split; // some links of <face> are split;
@ -3414,7 +3414,7 @@ void SMESH_Pattern::
while ( eIt->more() ) while ( eIt->more() )
{ {
const SMDS_MeshElement* elem = eIt->next(); const SMDS_MeshElement* elem = eIt->next();
if ( !volTool.Set( elem ) || !avoidSet.insert( make_pair(elem->GetID(),elem) ).second ) if ( !volTool.Set( elem ) || !avoidSet.insert( elem ).second )
continue; // skip faces or refined elements continue; // skip faces or refined elements
// add polyhedron definition // add polyhedron definition
myPolyhedronQuantities.push_back(vector<int> ()); myPolyhedronQuantities.push_back(vector<int> ());

File diff suppressed because it is too large Load Diff

View File

@ -34,12 +34,12 @@
#include "SMESHDS_Mesh.hxx" #include "SMESHDS_Mesh.hxx"
#include "SMESHDS_SubMesh.hxx" #include "SMESHDS_SubMesh.hxx"
#include "SMESH_Hypothesis.hxx" #include "SMESH_Hypothesis.hxx"
#include "Utils_SALOME_Exception.hxx" #include "SMESH_ComputeError.hxx"
#include <TopoDS_Shape.hxx>
#include <TColStd_IndexedMapOfTransient.hxx> #include "Utils_SALOME_Exception.hxx"
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopoDS_Shape.hxx>
#include <set>
#include <list> #include <list>
#include <map> #include <map>
@ -49,10 +49,14 @@ class SMESH_Algo;
class SMESH_Gen; class SMESH_Gen;
class SMESH_subMeshEventListener; class SMESH_subMeshEventListener;
class SMESH_subMeshEventListenerData; class SMESH_subMeshEventListenerData;
class SMESH_subMesh;
typedef SMESH_subMeshEventListener EventListener; typedef SMESH_subMeshEventListener EventListener;
typedef SMESH_subMeshEventListenerData EventListenerData; typedef SMESH_subMeshEventListenerData EventListenerData;
typedef boost::shared_ptr< SMDS_Iterator<SMESH_subMesh*> > SMESH_subMeshIteratorPtr;
class SMESH_EXPORT SMESH_subMesh class SMESH_EXPORT SMESH_subMesh
{ {
public: public:
@ -62,9 +66,6 @@ class SMESH_EXPORT SMESH_subMesh
int GetId() const; int GetId() const;
// bool Contains(const TopoDS_Shape & aSubShape)
// throw (SALOME_Exception);
SMESH_Mesh* GetFather() { return _father; } SMESH_Mesh* GetFather() { return _father; }
SMESHDS_SubMesh * GetSubMeshDS(); SMESHDS_SubMesh * GetSubMeshDS();
@ -74,8 +75,13 @@ class SMESH_EXPORT SMESH_subMesh
SMESH_subMesh *GetFirstToCompute(); SMESH_subMesh *GetFirstToCompute();
const map < int, SMESH_subMesh * >&DependsOn(); const map < int, SMESH_subMesh * >& DependsOn();
//const map < int, SMESH_subMesh * >&Dependants(); //const map < int, SMESH_subMesh * >&Dependants();
/*!
* \brief Return iterator on the submeshes this one depends on
*/
SMESH_subMeshIteratorPtr getDependsOnIterator(const bool includeSelf,
const bool complexShapeFirst);
const TopoDS_Shape & GetSubShape() const; const TopoDS_Shape & GetSubShape() const;
@ -90,14 +96,15 @@ class SMESH_EXPORT SMESH_subMesh
}; };
enum algo_event enum algo_event
{ {
ADD_HYP, ADD_ALGO, ADD_HYP , ADD_ALGO,
REMOVE_HYP, REMOVE_ALGO, REMOVE_HYP , REMOVE_ALGO,
ADD_FATHER_HYP, ADD_FATHER_ALGO, ADD_FATHER_HYP , ADD_FATHER_ALGO,
REMOVE_FATHER_HYP, REMOVE_FATHER_ALGO REMOVE_FATHER_HYP, REMOVE_FATHER_ALGO,
MODIF_HYP
}; };
enum compute_event enum compute_event
{ {
MODIF_HYP, MODIF_ALGO_STATE, COMPUTE, MODIF_ALGO_STATE, COMPUTE,
CLEAN, SUBMESH_COMPUTED, SUBMESH_RESTORED, CLEAN, SUBMESH_COMPUTED, SUBMESH_RESTORED,
MESH_ENTITY_REMOVED, CHECK_COMPUTE_STATE MESH_ENTITY_REMOVED, CHECK_COMPUTE_STATE
}; };
@ -115,12 +122,10 @@ class SMESH_EXPORT SMESH_subMesh
* \param listener - the listener to store * \param listener - the listener to store
* \param data - the listener data to store * \param data - the listener data to store
* \param where - the submesh to store the listener and it's data * \param where - the submesh to store the listener and it's data
* \param deleteListener - if true then the listener will be deleted as
* it is removed from where submesh
* *
* It remembers the submesh where it puts the listener in order to delete * The method remembers the submesh \awhere it puts the listener in order to delete
* them when HYP_OK algo_state is lost * them when HYP_OK algo_state is lost
* After being set, event listener is notified on each event of where submesh. * After being set, event listener is notified on each event of \awhere submesh.
*/ */
void SetEventListener(EventListener* listener, void SetEventListener(EventListener* listener,
EventListenerData* data, EventListenerData* data,
@ -182,6 +187,7 @@ public:
int GetAlgoState() const { return _algoState; } int GetAlgoState() const { return _algoState; }
int GetComputeState() const { return _computeState; }; int GetComputeState() const { return _computeState; };
SMESH_ComputeErrorPtr& GetComputeError() { return _computeError; }
void DumpAlgoState(bool isMain); void DumpAlgoState(bool isMain);
@ -208,6 +214,13 @@ public:
bool IsMeshComputed() const; bool IsMeshComputed() const;
// check if _subMeshDS contains mesh elements // check if _subMeshDS contains mesh elements
/*!
* \brief Allow algo->Compute() if a subshape of lower dim is meshed but
* none mesh entity is bound to it
*/
void SetIsAlwaysComputed(bool isAlCo);
protected: protected:
// ================================================================== // ==================================================================
void InsertDependence(const TopoDS_Shape aSubShape); void InsertDependence(const TopoDS_Shape aSubShape);
@ -224,32 +237,54 @@ protected:
void CleanDependsOn(); void CleanDependsOn();
void SetAlgoState(int state); void SetAlgoState(int state);
/*!
* \brief Return a shape containing all sub-shapes of the MainShape that can be
* meshed at once along with _subShape
*/
TopoDS_Shape GetCollection(SMESH_Gen * theGen, SMESH_Algo* theAlgo); TopoDS_Shape GetCollection(SMESH_Gen * theGen, SMESH_Algo* theAlgo);
// return a shape containing all sub-shapes of the MainShape that can be
// meshed at once along with _subShape
/*!
* \brief Apply theAlgo to all subshapes in theCollection
*/
bool ApplyToCollection (SMESH_Algo* theAlgo, bool ApplyToCollection (SMESH_Algo* theAlgo,
const TopoDS_Shape& theCollection); const TopoDS_Shape& theCollection);
// Apply theAlgo to all subshapes in theCollection
/*!
* \brief Update compute_state by _computeError
* \retval bool - false if there are errors
*/
bool CheckComputeError(SMESH_Algo* theAlgo);
/*!
* \brief Return a hypothesis attached to theShape.
*
* If theHyp is provided, similar but not same hypotheses
* is returned; else an applicable ones having theHypType
* is returned
*/
const SMESH_Hypothesis* GetSimilarAttached(const TopoDS_Shape& theShape, const SMESH_Hypothesis* GetSimilarAttached(const TopoDS_Shape& theShape,
const SMESH_Hypothesis * theHyp, const SMESH_Hypothesis * theHyp,
const int theHypType = 0); const int theHypType = 0);
// return a hypothesis attached to theShape. //
// If theHyp is provided, similar but not same hypotheses
// is returned; else an applicable ones having theHypType protected:
// is returned
TopoDS_Shape _subShape;
SMESHDS_SubMesh * _subMeshDS;
SMESH_Mesh * _father;
int _Id;
TopoDS_Shape _subShape;
SMESHDS_Mesh * _meshDS;
SMESHDS_SubMesh * _subMeshDS;
int _Id;
SMESH_Mesh *_father;
map < int, SMESH_subMesh * >_mapDepend; map < int, SMESH_subMesh * >_mapDepend;
bool _dependenceAnalysed; bool _dependenceAnalysed;
int _algoState; int _algoState;
int _computeState; int _computeState;
SMESH_ComputeErrorPtr _computeError;
// allow algo->Compute() if a subshape of lower dim is meshed but
// none mesh entity is bound to it. Eg StdMeshers_CompositeSegment_1D can
// mesh several edges as a whole and leave some of them without mesh entities
bool _alwaysComputed;
}; };

View File

@ -64,7 +64,7 @@ public:
const int eventType, const int eventType,
SMESH_subMesh* subMesh, SMESH_subMesh* subMesh,
SMESH_subMeshEventListenerData* data, SMESH_subMeshEventListenerData* data,
SMESH_Hypothesis* hyp = 0); const SMESH_Hypothesis* hyp = 0);
}; };
// ------------------------------------------------------------------ // ------------------------------------------------------------------

View File

@ -621,7 +621,11 @@ SMESH_Client::SMESH_Client(CORBA::ORB_ptr theORB,
if ( MYDEBUG ) if ( MYDEBUG )
MESSAGE("Info: The same process, update mesh by pointer "); MESSAGE("Info: The same process, update mesh by pointer ");
// just set client mesh pointer to server mesh pointer // just set client mesh pointer to server mesh pointer
SMESH_Mesh* aMesh = reinterpret_cast<SMESH_Mesh*>(theMesh->GetMeshPtr()); //SMESH_Mesh* aMesh = reinterpret_cast<SMESH_Mesh*>(theMesh->GetMeshPtr());
CORBA::LongLong pointeur = theMesh->GetMeshPtr();
cerr <<"SMESH_Client::SMESH_Client pointeur " << pointeur << endl;
SMESH_Mesh* aMesh = reinterpret_cast<SMESH_Mesh*> (pointeur);
cerr <<"SMESH_Client::SMESH_Client aMesh " << aMesh << endl;
if(aMesh->GetMeshDS()->IsEmbeddedMode()){ if(aMesh->GetMeshDS()->IsEmbeddedMode()){
mySMESHDSMesh = aMesh->GetMeshDS(); mySMESHDSMesh = aMesh->GetMeshDS();
mySMDSMesh = mySMESHDSMesh; mySMDSMesh = mySMESHDSMesh;

View File

@ -47,7 +47,7 @@ public:
virtual std::ostream & SaveTo(std::ostream & save)=0; virtual std::ostream & SaveTo(std::ostream & save)=0;
virtual std::istream & LoadFrom(std::istream & load)=0; virtual std::istream & LoadFrom(std::istream & load)=0;
enum hypothesis_type {PARAM_ALGO, ALGO, ALGO_1D, ALGO_2D, ALGO_3D}; enum hypothesis_type {PARAM_ALGO, ALGO_0D, ALGO_1D, ALGO_2D, ALGO_3D};
protected: protected:
std::string _name; std::string _name;

View File

@ -110,25 +110,18 @@ void SMESHDS_Mesh::ShapeToMesh(const TopoDS_Shape & S)
//======================================================================= //=======================================================================
bool SMESHDS_Mesh::AddHypothesis(const TopoDS_Shape & SS, bool SMESHDS_Mesh::AddHypothesis(const TopoDS_Shape & SS,
const SMESHDS_Hypothesis * H) const SMESHDS_Hypothesis * H)
{ {
//list<const SMESHDS_Hypothesis *>& alist=myShapeToHypothesis[SS]; list<const SMESHDS_Hypothesis *>& alist=
myShapeToHypothesis[SS.Oriented(TopAbs_FORWARD)]; // ignore orientation of SS
if ( !myShapeToHypothesis.IsBound( SS ) ) //Check if the Hypothesis is still present
myShapeToHypothesis.Bind( SS, list<const SMESHDS_Hypothesis *>() ); list<const SMESHDS_Hypothesis*>::iterator ith=find(alist.begin(),alist.end(), H );
list<const SMESHDS_Hypothesis *>& alist = myShapeToHypothesis.ChangeFind( SS ); if (alist.end() != ith) return false;
alist.push_back(H);
return true;
//Check if the Hypothesis is still present
list<const SMESHDS_Hypothesis*>::iterator ith=alist.begin();
for (; ith!=alist.end(); ith++)
if (H == *ith) return false;
alist.push_back(H);
return true;
} }
//======================================================================= //=======================================================================
@ -136,34 +129,23 @@ bool SMESHDS_Mesh::AddHypothesis(const TopoDS_Shape & SS,
//purpose : //purpose :
//======================================================================= //=======================================================================
bool SMESHDS_Mesh::RemoveHypothesis(const TopoDS_Shape & S, bool SMESHDS_Mesh::RemoveHypothesis(const TopoDS_Shape & S,
const SMESHDS_Hypothesis * H) const SMESHDS_Hypothesis * H)
{ {
/*ShapeToHypothesis::iterator its=myShapeToHypothesis.find(S); ShapeToHypothesis::iterator its=
if(its!=myShapeToHypothesis.end()) myShapeToHypothesis.find(S.Oriented(TopAbs_FORWARD)); // ignore orientation of S
{
list<const SMESHDS_Hypothesis*>::iterator ith=(*its).second.begin();
for (; ith!=(*its).second.end(); ith++) if(its!=myShapeToHypothesis.end())
if (H == *ith)
{
(*its).second.erase(ith);
return true;
}
}*/
if ( myShapeToHypothesis.IsBound( S ) )
{ {
list<const SMESHDS_Hypothesis *>& alist = myShapeToHypothesis.ChangeFind( S ); list<const SMESHDS_Hypothesis *>& alist=(*its).second;
list<const SMESHDS_Hypothesis*>::iterator ith = alist.begin(); list<const SMESHDS_Hypothesis*>::iterator ith=find(alist.begin(),alist.end(), H );
if (ith != alist.end())
for (; ith != alist.end(); ith++) {
if (H == *ith) alist.erase(ith);
{ return true;
alist.erase(ith); }
return true;
}
} }
return false; return false;
} }
//======================================================================= //=======================================================================
@ -1039,14 +1021,16 @@ list<int> SMESHDS_Mesh::SubMeshIndices()
//purpose : //purpose :
//======================================================================= //=======================================================================
const list<const SMESHDS_Hypothesis*>& SMESHDS_Mesh::GetHypothesis( const list<const SMESHDS_Hypothesis*>&
const TopoDS_Shape & S) const SMESHDS_Mesh::GetHypothesis(const TopoDS_Shape & S) const
{ {
if ( myShapeToHypothesis.IsBound(S) ) ShapeToHypothesis::const_iterator its=
return myShapeToHypothesis.Find(S); myShapeToHypothesis.find(S.Oriented(TopAbs_FORWARD)); // ignore orientation of S
if (its!=myShapeToHypothesis.end())
return its->second;
static list<const SMESHDS_Hypothesis*> empty; static list<const SMESHDS_Hypothesis*> empty;
return empty; return empty;
} }
//======================================================================= //=======================================================================
@ -1084,7 +1068,7 @@ bool SMESHDS_Mesh::HasMeshElements(const TopoDS_Shape & S)
//======================================================================= //=======================================================================
bool SMESHDS_Mesh::HasHypothesis(const TopoDS_Shape & S) bool SMESHDS_Mesh::HasHypothesis(const TopoDS_Shape & S)
{ {
return myShapeToHypothesis.IsBound(S); return myShapeToHypothesis.find(S.Oriented(TopAbs_FORWARD))!=myShapeToHypothesis.end();
} }
//======================================================================= //=======================================================================

View File

@ -62,6 +62,7 @@ public:
bool IsEmbeddedMode(); bool IsEmbeddedMode();
void ShapeToMesh(const TopoDS_Shape & S); void ShapeToMesh(const TopoDS_Shape & S);
TopoDS_Shape ShapeToMesh() const;
bool AddHypothesis(const TopoDS_Shape & SS, const SMESHDS_Hypothesis * H); bool AddHypothesis(const TopoDS_Shape & SS, const SMESHDS_Hypothesis * H);
bool RemoveHypothesis(const TopoDS_Shape & S, const SMESHDS_Hypothesis * H); bool RemoveHypothesis(const TopoDS_Shape & S, const SMESHDS_Hypothesis * H);
@ -401,12 +402,11 @@ public:
const TopoDS_Shape & S); const TopoDS_Shape & S);
void UnSetMeshElementOnShape(const SMDS_MeshElement * anElt, void UnSetMeshElementOnShape(const SMDS_MeshElement * anElt,
const TopoDS_Shape & S); const TopoDS_Shape & S);
TopoDS_Shape ShapeToMesh() const;
bool HasMeshElements(const TopoDS_Shape & S); bool HasMeshElements(const TopoDS_Shape & S);
SMESHDS_SubMesh * MeshElements(const TopoDS_Shape & S) const; SMESHDS_SubMesh * MeshElements(const TopoDS_Shape & S) const;
SMESHDS_SubMesh * MeshElements(const int Index); SMESHDS_SubMesh * MeshElements(const int Index);
std::list<int> SubMeshIndices(); std::list<int> SubMeshIndices();
const std::map<int,SMESHDS_SubMesh*>& SubMeshes() const std::map<int,SMESHDS_SubMesh*>& SubMeshes() const
{ return myShapeIndexToSubMesh; } { return myShapeIndexToSubMesh; }
bool HasHypothesis(const TopoDS_Shape & S); bool HasHypothesis(const TopoDS_Shape & S);

View File

@ -103,7 +103,11 @@ dist_libSMESH_la_SOURCES = \
SMESHGUI_ShapeByMeshDlg.cxx \ SMESHGUI_ShapeByMeshDlg.cxx \
SMESHGUI_AddQuadraticElementDlg.cxx \ SMESHGUI_AddQuadraticElementDlg.cxx \
SMESHGUI_ConvToQuadDlg.cxx \ SMESHGUI_ConvToQuadDlg.cxx \
SMESHGUI_ConvToQuadOp.cxx SMESHGUI_ConvToQuadOp.cxx \
SMESHGUI_BuildCompoundDlg.cxx \
SMESHGUI_ComputeDlg.cxx \
SMESHGUI_MakeNodeAtPointDlg.cxx \
SMESHGUI_MeshEditPreview.cxx
MOC_FILES = \ MOC_FILES = \
SMESHGUI_moc.cxx \ SMESHGUI_moc.cxx \
@ -151,7 +155,10 @@ MOC_FILES = \
SMESHGUI_ShapeByMeshDlg_moc.cxx \ SMESHGUI_ShapeByMeshDlg_moc.cxx \
SMESHGUI_AddQuadraticElementDlg_moc.cxx \ SMESHGUI_AddQuadraticElementDlg_moc.cxx \
SMESHGUI_ConvToQuadDlg_moc.cxx \ SMESHGUI_ConvToQuadDlg_moc.cxx \
SMESHGUI_ConvToQuadOp_moc.cxx SMESHGUI_ConvToQuadOp_moc.cxx \
SMESHGUI_BuildCompoundDlg_moc.cxx \
SMESHGUI_ComputeDlg_moc.cxx \
SMESHGUI_MakeNodeAtPointDlg_moc.cxx
nodist_libSMESH_la_SOURCES= \ nodist_libSMESH_la_SOURCES= \
$(MOC_FILES) $(MOC_FILES)

Some files were not shown because too many files have changed in this diff Show More