First stable version after merging with V3_2_2

This commit is contained in:
abd 2006-10-19 06:52:32 +00:00
parent 961309c8a4
commit e36717feb0
154 changed files with 8945 additions and 7629 deletions

View File

@ -1,6 +1,8 @@
# common directories to put headerfiles
inc_builddir=$(top_builddir)/include/salome
MODULE_NAME=@MODULE_NAME@
@SET_MAKE@
SHELL=/bin/sh

View File

@ -131,7 +131,7 @@ $(DEST_HEADERS): $(inc_builddir)/%: %
cp -f $< $@
# build resources file (icons and messages) : .qm file from .po file
resources: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
resources: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
# Make installation directories if they don't exist.
$(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir):
@ -187,10 +187,10 @@ $(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: %
# generic rule to install .qm files :
install-qm: resources
$(INSTALL) -d $(datadir)/resources
@for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm); do \
$(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
@for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm); do \
if test $$f != X; then \
($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1); \
($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1); \
fi; \
done
@ -234,7 +234,7 @@ uninstall:
# Uninstall qm files
@for f in X $(PO_FILES:%.po=%.qm); do \
if test $$f != X; then \
$(LT_UNINSTALL) $(datadir)/resources/$$f ; \
$(LT_UNINSTALL) $(datadir)/resources/$(MODULE_NAME)/$$f ; \
fi; \
done
@ -279,7 +279,7 @@ clean: mostlyclean
#
distclean: clean
#remove qm file !
-$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
-$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
#remove include files
-$(RM) $(DEST_HEADERS)
-$(RM) $(DISTCLEAN) *.bak *.old *.new .dep*
@ -326,7 +326,7 @@ distclean: clean
%_wrap.cxx : %.i
$(SWIG) $(SWIG_FLAGS) -o $@ $<
$(top_builddir)/share/salome/resources/%.qm: %.po
$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm: %.po
$(MSG2QM) $< $@ ; \
#------------------------------------------------------------------------------

View File

@ -22,11 +22,15 @@ AC_CANONICAL_HOST
PACKAGE=salome
AC_SUBST(PACKAGE)
VERSION=3.2.0
XVERSION=0x030200
VERSION=3.2.2
XVERSION=0x030202
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
@ -350,7 +354,7 @@ else
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 idl
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

View File

@ -83,10 +83,10 @@
The SALOME automatically locates XML files, searching them in the following directories:
${<PLUGINNAME>_ROOT_DIR}/share/salome/resources
${<PLUGINNAME>_ROOT_DIR}/share/salome/resources/<plugin>
${SALOME_<PluginName>Resources}
${HOME}/.salome/resources
${KERNEL_ROOT_DIR}/share/salome/resources
${KERNEL_ROOT_DIR}/share/salome/resources/kernel
where <PluginName> is a name of each mesher plugin package
@ -148,7 +148,7 @@
4.2.2. Define environment variable SALOME_<MyResourceKey>Resources to point to the
directory where resources are situated.
Example: setenv SALOME_StdMeshersResources ${SMESH_ROOT_DIR}/share/salome/resources
Example: setenv SALOME_StdMeshersResources ${SMESH_ROOT_DIR}/share/salome/resources/smesh
4.3. Implement your Hypothesis Creator and being exported method

View File

@ -7,11 +7,13 @@
<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; font-family:'Lucida Console' , monospace; }
p.whs2 { margin-top:0pt; margin-bottom:0pt; }
p.whs3 { font-family:'Lucida Console' , monospace; margin-top:0px; margin-bottom:0px; }
p.whs4 { margin-top:0px; margin-bottom:0px; }
p.whs1 { margin-top:0pt; margin-bottom:0pt; }
p.whs2 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }
p.whs3 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }
p.whs4 { font-family:'Lucida Console' , monospace; margin-top:0px; margin-bottom:0px; }
p.whs5 { margin-top:0px; margin-bottom:0px; font-family:'Times New Roman' , serif; }
p.whs6 { margin-top:0px; margin-bottom:0px; }
p.whs7 { margin-top:0px; margin-bottom:0px; font-family:'Lucida Console' , monospace; }
-->
</style><script type="text/javascript" language="JavaScript">
<!--
@ -23,6 +25,8 @@ if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
strNSS += "p.whs3 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs4 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs5 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs6 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs7 {margin-top:1pt;margin-bottom:1pt; }";
strNSS +="</style>";
document.write(strNSS);
}
@ -89,638 +93,350 @@ if (window.writeIntopicBar)
</script>
<h1>Creating Meshes</h1>
<p class="whs1">First of all see <a href="smesh.py_introduction.htm">Example
of 3d mesh generation</a>, which is an example of good python script style
for Mesh module. </p>
<p class="whs1">Other examples of python
scripts will be also updated soon to use smesh package instead of direct
usage of idl interface. </p>
<h3><a name=bookmark>Construction of a Mesh</a></h3>
<p class="whs1">import salome</p>
<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import
geompy</span></p>
<p class="whs1">import geompy</p>
<p class="whs1">import StdMeshers</p>
<p class="whs1">smesh = salome.lcc.FindOrLoadComponent(&quot;FactoryServer&quot;,
&quot;SMESH&quot;)</p>
<p class="whs1">smeshgui = salome.ImportComponentGUI(&quot;SMESH&quot;)</p>
<p class="whs1">smeshgui.Init(salome.myStudyId);</p>
<p class="whs2">import smesh</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># create a box</p>
<p class="whs3"># create a box</p>
<p class="whs1">box = geompy.MakeBox(0.,
<p class="whs2">box = geompy.MakeBox(0.,
0., 0., 100., 200., 300.)</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># add box to the study</p>
<p class="whs1">idbox = geompy.addToStudy(box,
<p class="whs2">idbox = geompy.addToStudy(box,
&quot;box&quot;)</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># create a hypothesis</p>
<p class="whs3"># create a mesh</p>
<p class="whs1">print &quot;--------------------------
create Hypothesis&quot;</p>
<p class="whs1">print &quot;--------------------------
NumberOfSegments&quot;</p>
<p class="whs1">numberOfSegments
= 7</p>
<p class="whs1">hypNbSeg = smesh.CreateHypothesis(&quot;NumberOfSegments&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">hypNbSeg.SetNumberOfSegments(numberOfSegments)</p>
<p class="whs1">print hypNbSeg.GetName()</p>
<p class="whs1">print hypNbSeg.GetId()</p>
<p class="whs1">print hypNbSeg.GetNumberOfSegments()</p>
<p class="whs1">smeshgui.SetName(salome.ObjectToID(hypNbSeg),
&quot;NumberOfSegments_10&quot;)</p>
<p class="whs1">print &quot;--------------------------
MaxElementArea&quot;</p>
<p class="whs1">maxElementArea =
800</p>
<p class="whs1">hypArea = smesh.CreateHypothesis(&quot;MaxElementArea&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">hypArea.SetMaxElementArea(maxElementArea)</p>
<p class="whs1">print hypArea.GetName()</p>
<p class="whs1">print hypArea.GetId()</p>
<p class="whs1">print hypArea.GetMaxElementArea()</p>
<p class="whs1">smeshgui.SetName(salome.ObjectToID(hypArea),
&quot;MaxElementArea_500&quot;)</p>
<p class="whs1">print &quot;--------------------------
MaxElementVolume&quot;</p>
<p class="whs1">maxElementVolume
= 900</p>
<p class="whs1">hypVolume = smesh.CreateHypothesis(&quot;MaxElementVolume&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">hypVolume.SetMaxElementVolume(maxElementVolume)</p>
<p class="whs1">print hypVolume.GetName()</p>
<p class="whs1">print hypVolume.GetId()</p>
<p class="whs1">print hypVolume.GetMaxElementVolume()</p>
<p class="whs1">smeshgui.SetName(salome.ObjectToID(hypVolume),
&quot;MaxElementVolume_500&quot;)</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># create algorithms</p>
<p class="whs1">print &quot;--------------------------
create Algorithms&quot;</p>
<p class="whs1">print &quot;--------------------------
Regular_1D&quot;</p>
<p class="whs1">regular1D = smesh.CreateHypothesis(&quot;Regular_1D&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">smeshgui.SetName(salome.ObjectToID(regular1D),
&quot;Wire Discretisation&quot;)</p>
<p class="whs1">print &quot;--------------------------
MEFISTO_2D&quot;</p>
<p class="whs1">mefisto2D = smesh.CreateHypothesis(&quot;MEFISTO_2D&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">smeshgui.SetName(salome.ObjectToID(mefisto2D),
&quot;MEFISTO_2D&quot;)</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># initialize a mesh with
the box</p>
<p class="whs1">mesh = smesh.CreateMesh(box)</p>
<p class="whs1">smeshgui.SetName(salome.ObjectToID(mesh),
<p class="whs2">tetra = smesh.Mesh(box,
&quot;MeshBox&quot;)</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># add the hypothesis to
the box</p>
<p class="whs2">algo1D = tetra.Segment()</p>
<p class="whs1">print &quot;--------------------------
add hypothesis to the box&quot;</p>
<p class="whs1">mesh.AddHypothesis(box,hypNbSeg)</p>
<p class="whs1">mesh.AddHypothesis(box,hypArea)</p>
<p class="whs1">mesh.AddHypothesis(box,hypVolume)</p>
<p class="whs1">mesh.AddHypothesis(box,regular1D)</p>
<p class="whs1">mesh.AddHypothesis(box,mefisto2D)</p>
<p class="whs2">algo1D.NumberOfSegments(7)</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># compute the mesh</p>
<p class="whs2">algo2D = tetra.Triangle()</p>
<p class="whs1">print &quot;--------------------------
compute the mesh of the box&quot;</p>
<p class="whs2">algo2D.MaxElementArea(800.)</p>
<p class="whs1">ret = smesh.Compute(mesh,box)</p>
<p class="whs2">&nbsp;</p>
<p class="whs1">print ret</p>
<p class="whs2">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>
<p class="whs1">if ret == 0:</p>
<p class="whs2">algo3D.MaxElementVolume(900.)</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;probleme when computing the mesh&quot;</p>
<p class="whs2">&nbsp;</p>
<p class="whs1">salome.sg.updateObjBrowser(1)</p>
<p class="whs3"># compute the mesh</p>
<p class="whs1">&nbsp;</p>
<p class="whs2">ret = tetra.Compute()</p>
<p class="whs2">if ret == 0:</p>
<p class="whs2">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;problem when computing the mesh&quot;</p>
<p class="whs2">else:</p>
<p class="whs2">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;mesh computed&quot;</p>
<p class="whs2">&nbsp;&nbsp;&nbsp;&nbsp;pass
</p>
<p class="whs2">&nbsp;</p>
<p class="whs2">&nbsp;</p>
<h3><a name=bookmark1>Construction of a Submesh</a></h3>
<p class="whs3">&nbsp;</p>
<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">from
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">from
geompy import *</span></p>
<p class="whs3">import smesh</p>
<p class="whs4">import smesh</p>
<p class="whs4">&nbsp;</p>
<p class="whs4"># create vertices</p>
<p class="whs5"># create a box</p>
<p class="whs3">Point111 = MakeVertex( 0, &nbsp;0,
&nbsp;0)</p>
<p class="whs4">box = MakeBoxDXDYDZ(10., 10., 10.)</p>
<p class="whs3">Point211 = MakeVertex(10, &nbsp;0,
&nbsp;0)</p>
<p class="whs3">Point121 = MakeVertex( 0, 10, &nbsp;0)</p>
<p class="whs3">Point221 = MakeVertex(10, 10, &nbsp;0)</p>
<p class="whs3">Point112 = MakeVertex( 0, &nbsp;0,
10)</p>
<p class="whs3">Point212 = MakeVertex(10, &nbsp;0,
10)</p>
<p class="whs3">Point122 = MakeVertex( 0, 10, 10)</p>
<p class="whs3">Point222 = MakeVertex(10, 10, 10)</p>
<p class="whs4">addToStudy(box, &quot;Box&quot;)</p>
<p class="whs4">&nbsp;</p>
<p class="whs4"># create edges</p>
<p class="whs5"># select one edge of
the box for definition of a local hypothesis</p>
<p class="whs3">EdgeX111 = MakeEdge(Point111, Point211)</p>
<p class="whs4">p5 = MakeVertex(5., 0., 0.)</p>
<p class="whs3">EdgeX121 = MakeEdge(Point121, Point221)</p>
<p class="whs4">EdgeX = GetEdgeNearPoint(box, p5)</p>
<p class="whs3">EdgeX112 = MakeEdge(Point112, Point212)</p>
<p class="whs3">EdgeX122 = MakeEdge(Point122, Point222)</p>
<p class="whs3">EdgeY11 = MakeEdge(Point111, Point121)</p>
<p class="whs3">EdgeY21 = MakeEdge(Point211, Point221)</p>
<p class="whs3">EdgeY12 = MakeEdge(Point112, Point122)</p>
<p class="whs3">EdgeY22 = MakeEdge(Point212, Point222)</p>
<p class="whs3">EdgeZ111 = MakeEdge(Point111, Point112)</p>
<p class="whs3">EdgeZ211 = MakeEdge(Point211, Point212)</p>
<p class="whs3">EdgeZ121 = MakeEdge(Point121, Point122)</p>
<p class="whs3">EdgeZ221 = MakeEdge(Point221, Point222)</p>
<p class="whs4">addToStudyInFather(box, EdgeX, &quot;Edge
[0,0,0 - 10,0,0]&quot;)</p>
<p class="whs4">&nbsp;</p>
<p class="whs4"># create faces</p>
<p class="whs5"># create a hexahedral
mesh on the box</p>
<p class="whs3">FaceX11 = MakeQuad(EdgeY11, EdgeZ111,
EdgeY12, EdgeZ121)</p>
<p class="whs3">FaceX21 = MakeQuad(EdgeY21, EdgeZ211,
EdgeY22, EdgeZ221)</p>
<p class="whs3">FaceY111 = MakeQuad(EdgeX111, EdgeZ111,
EdgeX112, EdgeZ211)</p>
<p class="whs3">FaceY121 = MakeQuad(EdgeX121, EdgeZ121,
EdgeX122, EdgeZ221)</p>
<p class="whs3">FaceZ11 = MakeQuad(EdgeX111, EdgeY11,
EdgeX121, EdgeY21)</p>
<p class="whs3">FaceZ12 = MakeQuad(EdgeX112, EdgeY12,
EdgeX122, EdgeY22)</p>
<p class="whs4">quadra = smesh.Mesh(box, &quot;Box : quadrangle
2D mesh&quot;)</p>
<p class="whs4">&nbsp;</p>
<p class="whs4"># create a solid</p>
<p class="whs5"># create a regular
1D algorithm for the faces</p>
<p class="whs3">Block = MakeHexa(FaceX11, FaceX21, FaceY111,
FaceY121, FaceZ11, FaceZ12)</p>
<p class="whs4">algo1D = quadra.Segment()</p>
<p class="whs4">&nbsp;</p>
<p class="whs4"># create a compound</p>
<p class="whs5"># define &quot;NumberOfSegments&quot;
hypothesis to cut</p>
<p class="whs3">box = MakeCompound([Block])</p>
<p class="whs5"># all the edges in
a fixed number of segments</p>
<p class="whs4">algo1D.NumberOfSegments(4)</p>
<p class="whs4">&nbsp;</p>
<p class="whs4"># add in the study</p>
<p class="whs3">box_id = addToStudy(box, &quot;Box compound&quot;)</p>
<p class="whs4">&nbsp;</p>
<p class="whs4"># create hexahedral mesh
on the box</p>
<p class="whs3">hexa = smesh.Mesh(box, &quot;Box compound
: hexahedrical mesh&quot;)</p>
<p class="whs3">algo = hexa.Segment()</p>
<p class="whs4">&nbsp;</p>
<p class="whs4"># define &quot;NumberOfSegments&quot;
hypothesis to cut the edge in a fixed number of segments</p>
<p class="whs3">algo.NumberOfSegments(4)</p>
<p class="whs4">&nbsp;</p>
<p class="whs4"># creates a quadrangle
<p class="whs5"># create a quadrangle
2D algorithm for the faces</p>
<p class="whs3">hexa.Quadrangle()</p>
<p class="whs4">quadra.Quadrangle()</p>
<p class="whs4">&nbsp;</p>
<p class="whs4"># construct a submesh with
a local hypothesis</p>
<p class="whs5"># construct a submesh
on the edge with a local hypothesis</p>
<p class="whs3">algo = hexa.Segment(EdgeX111)</p>
<p class="whs4">algo_local = quadra.Segment(EdgeX)</p>
<p class="whs4">&nbsp;</p>
<p class="whs4"># define &quot;Arithmetic1D&quot;
hypothesis to cut an edge in several segments with increasing arithmetic
length </p>
<p class="whs5"># define &quot;Arithmetic1D&quot;
hypothesis to cut the edge<span style="margin-top: 0px;
margin-bottom: 0px;
font-family: 'Times New Roman', serif;">
in several segments with increasing arithmetic length</span></p>
<p class="whs3">algo.Arithmetic1D(1, 4)</p>
<p class="whs4">algo_local.Arithmetic1D(1, 4)</p>
<p class="whs4">&nbsp;</p>
<p class="whs4"># define &quot;Propagation&quot;
hypothesis that propagates all other hypothesis on all edges on the opposite
side in case of quadrangular faces</p>
<p class="whs5"># define &quot;Propagation&quot;
hypothesis that propagates all other hypotheses</p>
<p class="whs3">algo.Propagation()</p>
<p class="whs5"># on all edges of the
opposite side in case of quadrangular faces</p>
<p class="whs4">algo_local.Propagation()</p>
<p class="whs4">&nbsp;</p>
<p class="whs4"># compute the mesh</p>
<p class="whs5"># compute the mesh</p>
<p class="whs3">hexa.Compute() </p>
<p class="whs4">quadra.Compute() </p>
<p class="whs3">&nbsp;</p>
<p class="whs4">&nbsp;</p>
<h3><a name=bookmark2>Editing of a mesh</a></h3>
<p class="whs3">&nbsp;</p>
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import
geompy</span></p>
<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">import
salome</span></p>
<p class="whs3">import geompy</p>
<p class="whs3">import SMESH</p>
<p class="whs3">import StdMeshers</p>
<p class="whs3">&nbsp;</p>
<p class="whs3">smesh = salome.lcc.FindOrLoadComponent(&quot;FactoryServer&quot;,
&quot;SMESH&quot;)</p>
<p class="whs3">smesh.SetCurrentStudy(salome.myStudy)</p>
<p class="whs3">&nbsp;</p>
<p class="whs3">box &nbsp;&nbsp;=
geompy.MakeBox(0., 0., 0., 20., 20., 20.)</p>
<p class="whs3">idbox = geompy.addToStudy(box, &quot;box&quot;)</p>
<p class="whs3">&nbsp;</p>
<p class="whs3">subShapeList = geompy.SubShapeAll(box,
geompy.ShapeType[&quot;EDGE&quot;])</p>
<p class="whs3">edge &nbsp;&nbsp;=
subShapeList[0]</p>
<p class="whs3">name &nbsp;&nbsp;=
geompy.SubShapeName(edge, box)</p>
<p class="whs3">idedge = geompy.addToStudyInFather(box,
edge, name)</p>
<p class="whs3">&nbsp;</p>
<p class="whs3">box &nbsp;=
salome.IDToObject(idbox)</p>
<p class="whs3">edge = salome.IDToObject(idedge)</p>
<p class="whs3">&nbsp;</p>
<p class="whs3">hyp1 = smesh.CreateHypothesis(&quot;NumberOfSegments&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs3">hyp1.SetNumberOfSegments(3)</p>
<p class="whs3">hyp2 = smesh.CreateHypothesis(&quot;MaxElementArea&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs3">hyp2.SetMaxElementArea(10)</p>
<p class="whs3">hyp3 = smesh.CreateHypothesis(&quot;Arithmetic1D&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs3">hyp3.SetLength(1,1)</p>
<p class="whs3">hyp3.SetLength(6,0)</p>
<p class="whs3">hyp4 = smesh.CreateHypothesis(&quot;Propagation&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs3">&nbsp;</p>
<p class="whs3">algo1 = smesh.CreateHypothesis(&quot;Regular_1D&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs3">algo2 = smesh.CreateHypothesis(&quot;MEFISTO_2D&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs3">&nbsp;</p>
<p class="whs3">mesh = smesh.CreateMesh(box)</p>
<p class="whs3">mesh.AddHypothesis(box,hyp1)</p>
<p class="whs3">mesh.AddHypothesis(box,hyp2)</p>
<p class="whs3">mesh.AddHypothesis(box,algo1)</p>
<p class="whs3">mesh.AddHypothesis(box,algo2)</p>
<p class="whs3">mesh.AddHypothesis(edge,hyp3)</p>
<p class="whs3">mesh.AddHypothesis(edge,hyp4)</p>
<p class="whs3">mesh.AddHypothesis(edge,algo1)</p>
<p class="whs3">&nbsp;</p>
<p class="whs3">smesh.Compute(mesh,box)</p>
<p class="whs3">salome.sg.updateObjBrowser(1)</p>
<p class="whs3">&nbsp;</p>
<p class="whs5"># remove a hypothesis</p>
<p class="whs3">mesh.RemoveHypothesis(edge,hyp4)</p>
<p class="whs3">&nbsp;</p>
<p class="whs3">smesh.Compute(mesh,box)</p>
<p class="whs3">salome.sg.updateObjBrowser(1)</p>
<p class="whs3">&nbsp;</p>
<p class="whs5"># change the value
of the hypothesis</p>
<p class="whs3">hyp2.SetMaxElementArea(2)</p>
<p class="whs3">mesh.AddHypothesis(box,hyp2)</p>
<p class="whs3">&nbsp;</p>
<p class="whs3">smesh.Compute(mesh,box)</p>
<p class="whs3">salome.sg.updateObjBrowser(1) </p>
<p class="whs4">import smesh</p>
<p class="whs4">&nbsp;</p>
<p class="whs4">def PrintMeshInfo(theMesh):</p>
<p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;aMesh
= theMesh.GetMesh()</p>
<p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;Information about mesh:&quot;</p>
<p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;Number of nodes &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
&quot;, aMesh.NbNodes()</p>
<p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;Number of edges &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
&quot;, aMesh.NbEdges()</p>
<p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;Number of faces &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
&quot;, aMesh.NbFaces()</p>
<p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;Number of volumes &nbsp;&nbsp;&nbsp;&nbsp;:
&quot;, aMesh.NbVolumes()</p>
<p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;pass</p>
<p class="whs4">&nbsp;</p>
<p class="whs5"># create a box</p>
<p class="whs4">box = geompy.MakeBox(0., 0., 0., 20.,
20., 20.)</p>
<p class="whs4">geompy.addToStudy(box, &quot;box&quot;)</p>
<p class="whs4">&nbsp;</p>
<p class="whs5"># select one edge of
the box for definition of a local hypothesis</p>
<p class="whs4">subShapeList = geompy.SubShapeAll(box,
geompy.ShapeType[&quot;EDGE&quot;])</p>
<p class="whs4">edge = subShapeList[0]</p>
<p class="whs4">name = geompy.SubShapeName(edge, box)</p>
<p class="whs4">geompy.addToStudyInFather(box, edge, name)</p>
<p class="whs4">&nbsp;</p>
<p class="whs5"># create a mesh</p>
<p class="whs4">tria = smesh.Mesh(box, &quot;Mesh 2D&quot;)</p>
<p class="whs4">algo1D = tria.Segment()</p>
<p class="whs4">hyp1 = algo1D.NumberOfSegments(3)</p>
<p class="whs4">algo2D = tria.Triangle()</p>
<p class="whs4">hyp2 = algo2D.MaxElementArea(10.)</p>
<p class="whs4">&nbsp;</p>
<p class="whs5"># create a sub-mesh</p>
<p class="whs4">algo_local = tria.Segment(edge)</p>
<p class="whs4">hyp3 = algo_local.Arithmetic1D(1, 6)</p>
<p class="whs4">hyp4 = algo_local.Propagation()</p>
<p class="whs4">&nbsp;</p>
<p class="whs5"># compute the mesh</p>
<p class="whs4">tria.Compute()</p>
<p class="whs4">PrintMeshInfo(tria)</p>
<p class="whs4">&nbsp;</p>
<p class="whs5"># remove a local hypothesis</p>
<p class="whs4">mesh = tria.GetMesh()</p>
<p class="whs4">mesh.RemoveHypothesis(edge, hyp4)</p>
<p class="whs4">&nbsp;</p>
<p class="whs5"># compute the mesh</p>
<p class="whs4">tria.Compute()</p>
<p class="whs4">PrintMeshInfo(tria)</p>
<p class="whs4">&nbsp;</p>
<p class="whs5"># change the value
of the 2D hypothesis</p>
<p class="whs4">hyp2.SetMaxElementArea(2.)</p>
<p class="whs4">&nbsp;</p>
<p class="whs5"># compute the mesh</p>
<p class="whs4">tria.Compute()</p>
<p class="whs4">PrintMeshInfo(tria) </p>
<p class="whs6">&nbsp;</p>
<h3><a name=bookmark3>Export of a Mesh</a></h3>
<p class="whs4">&nbsp;</p>
<p class="whs7">import geompy</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import
salome</span></p>
<p class="whs7">import smesh</p>
<p class="whs1">import geompy</p>
<p class="whs6">&nbsp;</p>
<p class="whs1">import StdMeshers</p>
<p class="whs6"># create a box</p>
<p class="whs1">smesh = salome.lcc.FindOrLoadComponent(&quot;FactoryServer&quot;,
&quot;SMESH&quot;)</p>
<p class="whs1">smeshgui = salome.ImportComponentGUI(&quot;SMESH&quot;)</p>
<p class="whs1">smeshgui.Init(salome.myStudyId);</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># create a box</p>
<p class="whs1">box = geompy.MakeBox(0.,
<p class="whs7">box = geompy.MakeBox(0.,
0., 0., 100., 200., 300.)</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># add the box to the study</p>
<p class="whs1">idbox = geompy.addToStudy(box,
<p class="whs7">idbox = geompy.addToStudy(box,
&quot;box&quot;)</p>
<p class="whs2">&nbsp;</p>
<p class="whs6">&nbsp;</p>
<p class="whs2"># create a hypothesis</p>
<p class="whs6"># create a mesh</p>
<p class="whs1">print &quot;--------------------------
create Hypothesis&quot;</p>
<p class="whs1">print &quot;--------------------------
NumberOfSegments&quot;</p>
<p class="whs1">numberOfSegments
= 7</p>
<p class="whs1">hypNbSeg = smesh.CreateHypothesis(&quot;NumberOfSegments&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">hypNbSeg.SetNumberOfSegments(numberOfSegments)</p>
<p class="whs1">print hypNbSeg.GetName()</p>
<p class="whs1">print hypNbSeg.GetId()</p>
<p class="whs1">print hypNbSeg.GetNumberOfSegments()</p>
<p class="whs1">smeshgui.SetName(salome.ObjectToID(hypNbSeg),
&quot;NumberOfSegments_10&quot;)</p>
<p class="whs1">print &quot;--------------------------
MaxElementArea&quot;</p>
<p class="whs1">maxElementArea =
800</p>
<p class="whs1">hypArea = smesh.CreateHypothesis(&quot;MaxElementArea&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">hypArea.SetMaxElementArea(maxElementArea)</p>
<p class="whs1">print hypArea.GetName()</p>
<p class="whs1">print hypArea.GetId()</p>
<p class="whs1">print hypArea.GetMaxElementArea()</p>
<p class="whs1">smeshgui.SetName(salome.ObjectToID(hypArea),
&quot;MaxElementArea_500&quot;)</p>
<p class="whs1">print &quot;--------------------------
MaxElementVolume&quot;</p>
<p class="whs1">maxElementVolume
= 900</p>
<p class="whs1">hypVolume = smesh.CreateHypothesis(&quot;MaxElementVolume&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">hypVolume.SetMaxElementVolume(maxElementVolume)</p>
<p class="whs1">print hypVolume.GetName()</p>
<p class="whs1">print hypVolume.GetId()</p>
<p class="whs1">print hypVolume.GetMaxElementVolume()</p>
<p class="whs1">smeshgui.SetName(salome.ObjectToID(hypVolume),
&quot;MaxElementVolume_500&quot;)</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># create algorithms</p>
<p class="whs1">print &quot;--------------------------
create Algorithms&quot;</p>
<p class="whs1">print &quot;--------------------------
Regular_1D&quot;</p>
<p class="whs1">regular1D = smesh.CreateHypothesis(&quot;Regular_1D&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">smeshgui.SetName(salome.ObjectToID(regular1D),
&quot;Wire Discretisation&quot;)</p>
<p class="whs1">print &quot;--------------------------
MEFISTO_2D&quot;</p>
<p class="whs1">mefisto2D = smesh.CreateHypothesis(&quot;MEFISTO_2D&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">smeshgui.SetName(salome.ObjectToID(mefisto2D),
&quot;MEFISTO_2D&quot;)</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># initialize a mesh with
the box</p>
<p class="whs1">mesh = smesh.CreateMesh(box)</p>
<p class="whs1">smeshgui.SetName(salome.ObjectToID(mesh),
<p class="whs7">tetra = smesh.Mesh(box,
&quot;MeshBox&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs6">&nbsp;</p>
<p class="whs2"># add the hypothesis to
the box</p>
<p class="whs7">algo1D = tetra.Segment()</p>
<p class="whs1">print &quot;--------------------------
add hypothesis to the box&quot;</p>
<p class="whs7">algo1D.NumberOfSegments(7)</p>
<p class="whs1">mesh.AddHypothesis(box,hypNbSeg)</p>
<p class="whs7">&nbsp;</p>
<p class="whs1">mesh.AddHypothesis(box,hypArea)</p>
<p class="whs7">algo2D = tetra.Triangle()</p>
<p class="whs1">mesh.AddHypothesis(box,hypVolume)</p>
<p class="whs7">algo2D.MaxElementArea(800.)</p>
<p class="whs1">mesh.AddHypothesis(box,regular1D)</p>
<p class="whs7">&nbsp;</p>
<p class="whs1">mesh.AddHypothesis(box,mefisto2D)</p>
<p class="whs7">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>
<p class="whs2">&nbsp;</p>
<p class="whs7">algo3D.MaxElementVolume(900.)</p>
<p class="whs2"># compute the mesh</p>
<p class="whs6">&nbsp;</p>
<p class="whs1">print &quot;--------------------------
compute the mesh of the box&quot;</p>
<p class="whs6"># compute the mesh</p>
<p class="whs1">ret = smesh.Compute(mesh,box)</p>
<p class="whs7">tetra.Compute()</p>
<p class="whs1">print ret</p>
<p class="whs6">&nbsp;</p>
<p class="whs1">if ret == 0:</p>
<p class="whs6"># export the mesh in a
MED file</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;probleme when computing the mesh&quot;</p>
<p class="whs1">salome.sg.updateObjBrowser(1)</p>
<p class="whs1">mesh.ExportMED(&quot;/tmp/meshMED.med&quot;,0)</p>
<p class="whs2">&nbsp;</p>
<p class="whs4">&nbsp;</p>
<p class="whs7">tetra.ExportMED(&quot;/tmp/meshMED.med&quot;,
0) </p>
<script type="text/javascript" language="javascript1.2">
<!--

File diff suppressed because it is too large Load Diff

View File

@ -14,22 +14,48 @@ if (navigator.appName !="Netscape")
</script>
<style type="text/css">
<!--
table.whs1 { x-cell-content-align:top; width:100%; border-spacing:0px; }
col.whs2 { width:50%; }
tr.whs3 { x-cell-content-align:top; }
td.whs4 { width:50%; padding-right:10px; padding-left:10px; border-right-style:none; border-left-style:none; border-top-style:none; border-bottom-style:none; }
img_whs5 { border:none; width:335px; height:323px; border-style:none; }
td.whs6 { width:50%; padding-right:10px; padding-left:10px; border-top-style:none; border-bottom-style:none; border-right-style:none; }
img_whs7 { border:none; width:350px; height:323px; border-style:none; }
p.whs8 { margin-left:40px; }
img_whs9 { border:none; width:27px; height:24px; border-style:none; }
img_whs10 { border:none; width:434px; height:541px; float:none; border-style:none; }
ul.whs11 { list-style:disc; }
p.whs12 { margin-left:84px; }
img_whs13 { border:none; width:26px; height:25px; border-style:none; }
img_whs14 { border:none; width:29px; height:28px; border-style:none; }
img_whs1 { border:none; width:27px; height:24px; border-style:none; }
img_whs2 { border:none; width:387px; height:334px; float:none; border-style:none; }
ul.whs3 { list-style:disc; }
table.whs4 { x-cell-content-align:top; width:100%; border-spacing:0px; }
col.whs5 { width:50%; }
tr.whs6 { x-cell-content-align:top; }
td.whs7 { width:50%; padding-right:10px; padding-left:10px; border-right-style:none; border-left-style:none; border-top-style:none; border-bottom-style:none; }
p.whs8 { margin-left:0px; margin-right:53px; }
img_whs9 { border:none; width:389px; height:334px; float:none; border-style:none; }
td.whs10 { width:50%; padding-right:10px; padding-left:10px; border-top-style:none; border-bottom-style:none; border-right-style:none; }
p.whs11 { margin-left:0px; }
p.whs12 { margin-left:40px; }
col.whs13 { width:33.333%; }
td.whs14 { width:33.333%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-right-style:none; border-left-style:none; border-top-style:none; }
td.whs15 { width:33.333%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-right-style:none; border-top-style:none; }
td.whs16 { width:33.333%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-top-style:none; border-right-style:none; }
td.whs17 { width:33.333%; padding-right:10px; padding-left:10px; border-right-style:none; border-left-style:none; border-bottom-style:none; }
td.whs18 { width:33.333%; padding-right:10px; padding-left:10px; border-right-style:none; border-bottom-style:none; }
td.whs19 { width:33.333%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-right-style:none; }
p.whs20 { font-weight:bold; margin-left:0px; }
p.whs21 { font-weight:bold; }
img_whs22 { border:none; width:441px; height:541px; float:none; border-style:none; }
p.whs23 { margin-left:84px; }
p.whs24 { margin-left:156px; }
p.whs25 { margin-left:156px; font-weight:bold; }
img_whs26 { border:none; width:26px; height:25px; border-style:none; }
img_whs27 { border:none; width:29px; height:28px; border-style:none; }
-->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
</style><script type="text/javascript" language="JavaScript">
<!--
if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
{
var strNSS = "<style type='text/css'>";
strNSS += "p.whs8 {margin-left:1pt; }";
strNSS += "p.whs11 {margin-left:1pt; }";
strNSS += "p.whs20 {margin-left:1pt; }";
strNSS +="</style>";
document.write(strNSS);
}
//-->
</script>
<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
@ -88,96 +114,251 @@ if (window.writeIntopicBar)
writeIntopicBar(4);
//-->
</script>
<h1>Extrusion along a path</h1>
<h1><img src="image101.gif" width="27px" height="24px" border="0" class="img_whs1">Extrusion along a path</h1>
<p>In principle, Extrusion along a path works in the same way as Extrusion,
<p>In principle, <span style="font-weight: bold;"><B>Extrusion along a path</B></span>
works in the same way as <span style="font-weight: bold;"><B>Extrusion</B></span>,
the main difference is that we define not a vector, but a path of extrusion
which must be a meshed edge or wire. To get an idea of how this algorithm
works, let's see the left image, where we have a 1D circle edge and &nbsp;a
2D hexagon to be extruded along this path (in the picture they are angular
because we show the wireframe of the mesh). And now let's see the right
image, showing the result of the operation. &nbsp;</p>
which must be a meshed edge. To get an idea of how this algorithm works,
examine several examples, starting from the most simple case of extrusion
along a straight edge. In all examples the same mesh will be extruded
along different paths and with different parameters. This sample 2D mesh
has two quadrangle faces and seven edges. Look at the picture, where white
digits are the node numbers and green are the element numbers:</p>
<p><span style="margin-left: 40px;"><img src="pics/mesh_for_extr_along_path.png" x-maintain-ratio="TRUE" width="387px" height="334px" border="0" class="img_whs2"> .</span></p>
<p>&nbsp;</p>
<table x-use-null-cells cellspacing="0" width="100%" class="whs1">
<col class="whs2">
<col class="whs2">
<ul type="disc" class="whs3">
<tr valign="top" class="whs3">
<td width="50%" class="whs4">
<p><img src="image102.gif" width="335px" height="323px" border="0" class="img_whs5"></td>
<td width="50%" class="whs6">
<p><img src="image104.gif" width="350px" height="323px" border="0" class="img_whs7"></td></tr>
<li class=kadov-p><p><span style="font-weight: bold;"><B>Extrusion along
a straight edge</B></span> (not using base point or angles)</p></li>
</ul>
<table x-use-null-cells cellspacing="0" width="100%" class="whs4">
<col class="whs5">
<col class="whs5">
<tr valign="top" class="whs6">
<td width="50%" class="whs7">
<p class="whs8"><img src="pics/straight_before.png" x-maintain-ratio="TRUE" width="389px" height="334px" border="0" class="img_whs9"></td>
<td width="50%" class="whs10">
<p class="whs11"><img src="pics/straight_after.png" x-maintain-ratio="TRUE" width="389px" height="334px" border="0" class="img_whs9"></td></tr>
</table>
<p>&nbsp;</p>
<p class="whs12">&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p class="whs12">The left image shows a 1D path mesh, built
on a linear edge, and the initial 2D mesh. The right image shows the result
of extrusion of two edges (#1 and #2) of the initial mesh along the path.
Node #1 of path mesh has been selected as <span style="font-weight: bold;"><B>Start
node</B></span>.</p>
<p class="whs12">&nbsp;</p>
<ul type="disc" class="whs3">
<li class=kadov-p><p><span style="font-weight: bold;"><B>Extrusion along
a curvilinear edge</B></span> (with and without angles)</p></li>
</ul>
<table x-use-null-cells cellspacing="0" width="100%" class="whs4">
<col class="whs13">
<col class="whs13">
<col class="whs13">
<tr valign="top" class="whs6">
<td width="33.333%" class="whs14">
<p><img src="pics/curvi_simple_before.png" x-maintain-ratio="TRUE" width="389px" height="334px" border="0" class="img_whs9"></td>
<td width="33.333%" class="whs15">
<p><img src="pics/curvi_simple_after.png" x-maintain-ratio="TRUE" width="389px" height="334px" border="0" class="img_whs9"></td>
<td width="33.333%" class="whs16">
<p><img src="pics/curvi_angles_after.png" x-maintain-ratio="TRUE" width="389px" height="334px" border="0" class="img_whs9"></td></tr>
<tr valign="top" class="whs6">
<td width="33.333%" class="whs17">
<p>The left image shows a 1D path mesh, built on curvilinear edge, and
the initial &nbsp;2D
mesh.</td>
<td width="33.333%" class="whs18">
<p>The central image shows the result of extrusion of one edge (#2) of
the initial mesh along the path. &nbsp;Node
#1 of path mesh has been selected as <span style="font-weight: bold;"><B>Start
node</B></span>.</td>
<td width="33.333%" class="whs19">
<p>The same, but using angles {45, 45, 45, 0, -45, -45, -45}</td></tr>
</table>
<p class="whs11">&nbsp;</p>
<ul type="disc" class="whs3">
<li class=kadov-p><p class="whs11"><span style="font-weight: bold;"><B>Extrusion
along a sub-mesh.</B></span></p></li>
</ul>
<table x-use-null-cells cellspacing="0" width="100%" class="whs4">
<col class="whs5">
<col class="whs5">
<tr valign="top" class="whs6">
<td width="50%" class="whs7">
<p><img src="pics/edge_wire_before.png" x-maintain-ratio="TRUE" width="389px" height="334px" border="0" class="img_whs9"></td>
<td width="50%" class="whs10">
<p><img src="pics/edge_wire_after.png" x-maintain-ratio="TRUE" width="389px" height="334px" border="0" class="img_whs9"></td></tr>
</table>
<p class="whs12">&nbsp;</p>
<p class="whs12">In this example the path mesh has been built
on a wire (polyline with six edges). The first edge of the wire was used
as <span style="font-weight: bold;"><B>Shape (edge)</B></span>, node #1 as <span
style="font-weight: bold;"><B>Start node</B></span>. The angles have been defined
as {10, 10, 10}. The middle edge (#4) of the initial mesh has been extruded.</p>
<p class="whs12">&nbsp;</p>
<ul type="disc" class="whs3">
<li class=kadov-p><p class="whs20">Extrusion
of 2d elements along a sub-mesh.</p></li>
</ul>
<table x-use-null-cells cellspacing="0" width="100%" class="whs4">
<col class="whs5">
<col class="whs5">
<tr valign="top" class="whs6">
<td width="50%" class="whs7">
<p><img src="pics/edge_wire_3d_before.png" x-maintain-ratio="TRUE" width="389px" height="334px" border="0" class="img_whs9"></td>
<td width="50%" class="whs10">
<p><img src="pics/edge_wire_3d_after.png" x-maintain-ratio="TRUE" width="389px" height="334px" border="0" class="img_whs9"></td></tr>
</table>
<p class="whs12">&nbsp;</p>
<p class="whs12">This extrusion bases on the same path mesh
as in the previous example but the third edge of the wire was set as <span
style="font-weight: bold;"><B>Shape (edge)</B></span> and node #4 as <span style="font-weight: bold;"><B>Start
node</B></span>. Please note, that the extrusion has been done in direction
from node #4 to node #3, i.e. against the wire direction. In this example
both faces of the initial mesh have been extruded.</p>
<p class="whs12">&nbsp;</p>
<ul type="disc" class="whs3">
<li class=kadov-p><p class="whs21">Extrusion of 2d elements
along a closed path.</p></li>
</ul>
<table x-use-null-cells cellspacing="0" width="100%" class="whs4">
<col class="whs13">
<col class="whs13">
<col class="whs13">
<tr valign="top" class="whs6">
<td width="33.333%" class="whs14">
<p><img src="pics/circle_simple_before.png" x-maintain-ratio="TRUE" width="389px" height="334px" border="0" class="img_whs9"></td>
<td width="33.333%" class="whs15">
<p><img src="pics/circle_simple_after.png" x-maintain-ratio="TRUE" width="389px" height="334px" border="0" class="img_whs9"></td>
<td width="33.333%" class="whs16">
<p><img src="pics/circle_angles_after.png" x-maintain-ratio="TRUE" width="389px" height="334px" border="0" class="img_whs9"></td></tr>
<tr valign="top" class="whs6">
<td width="33.333%" class="whs17">
<p>The left image shows a path mesh built on a closed edge (circle).</td>
<td width="33.333%" class="whs18">
<p>The central image shows the result of extrusion of both faces of the
initial mesh. Note, that no sewing has been done, so, there are six coincident
nodes and two coincident faces in the resulting mesh.</td>
<td width="33.333%" class="whs19">
<p>The same, but using angles {45, -45, 45, -45, 45, -45, 45, -45}</td></tr>
</table>
<p class="whs12">&nbsp;</p>
<p>&nbsp;</p>
<p class=TODO>To use Extrusion along a path:</p>
<p class="whs8">1. From the <span style="font-weight: bold;"><B>Modification
<p class="whs12">1. From the <span style="font-weight: bold;"><B>Modification
</B></span>menu choose the <span style="font-weight: bold;"><B>Extrusion along
a path </B></span>item or click <img src="image101.gif" width="27px" height="24px" border="0" class="img_whs9"> button in the toolbar. The
a path </B></span>item or click <img src="image101.gif" width="27px" height="24px" border="0" class="img_whs1"> button in the toolbar. The
following dialog box will appear:</p>
<p class="whs8">&nbsp;</p>
<p class="whs12">&nbsp;</p>
<p class=TODO
style="margin-left: 80px;"><img src="pics/a-extusionalongapath2.png" x-maintain-ratio="TRUE" width="434px" height="541px" border="0" class="img_whs10"></p>
style="margin-left: 80px;"><img src="pics/extrusion1.png" x-maintain-ratio="TRUE" width="441px" height="541px" border="0" class="img_whs22"></p>
<p class="whs8">&nbsp;</p>
<p class="whs12">&nbsp;</p>
<p class="whs8">2. In the dialog box you should &nbsp;</p>
<p class="whs12">2. In the dialog box you should &nbsp;</p>
<ul type="disc" class="whs11">
<ul type="disc" class="whs3">
<li class=kadov-p><p class="whs12">select the type of
<li class=kadov-p><p class="whs23">select the type of
elements which will be extruded (1D or 2D),</p></li>
<li class=kadov-p><p class="whs12">specify the IDs of
the elements which will be extruded by selecting them in the 3D viewer
or <span style="font-weight: bold;"><B>Select the whole mesh, submesh or
grou</B></span>p,</p></li>
<li class=kadov-p><p class="whs23">specify the <span style="font-weight: bold;"><B>IDs
of the elements</B></span> which will be extruded by selecting them in the
3D viewer or <span style="font-weight: bold;"><B>Select the whole mesh, submesh
or group</B></span>,</p></li>
<li class=kadov-p><p class="whs12">specify the path along
which the elements will be extruded, for this you should specify the <span
style="font-weight: bold;"><B>Mesh</B></span>, the <span style="font-weight: bold;"><B>Shape</B></span>,
and the <span style="font-weight: bold;"><B>Start point</B></span> for the extrusion.
</p></li>
<li class=kadov-p><p class="whs23">define the <span style="font-weight: bold;"><B>Path</B></span>
along which the elements will be extruded, </p></li>
</ul>
<p class="whs8">&nbsp;</p>
<p class="whs24">Path definition consists of several elements
</p>
<p class="whs8">3. There are two optional parameters, which
<ul type="disc" class="whs3">
<li class=kadov-p><p class="whs25">Mesh
- <span style="font-weight: normal;">containing a 1D sub-mesh on the edge,
along which proceeds the extrusion.</span></p></li>
<li class=kadov-p><p class="whs25">Shape
(edge) - <span style="font-weight: normal;">as the mesh can be complex,
the edge is used to define the sub-mesh for the path.</span></p></li>
<li class=kadov-p><p class="whs25">Start
node - <span style="font-weight: normal;">&nbsp;the
first or the last node on the edge. It is used to define the direction
of extrusion.</span></p></li>
</ul>
<p class="whs12">&nbsp;</p>
<p class="whs12">3. There are two optional parameters, which
can be very useful.</p>
<ul type="disc" class="whs11">
<ul type="disc" class="whs3">
<li class=kadov-p><p class="whs12">If the path of extrusion
<li class=kadov-p><p class="whs23">If the path of extrusion
is curvilinear, at each iteration the extruded shape is rotated to keep
its initial angularity to the curve. By default, the <span style="font-weight: bold;"><B>Base
point</B></span> around which the shape is rotated is the mass center of the
Point</B></span> around which the shape is rotated is the mass center of the
shape, however, you can specify any point as the <span style="font-weight: bold;"><B>Base
Point</B></span> and the shape will be rotated with respect to this point.</p></li>
<li class=kadov-p><p class="whs12">The shape can also
<li class=kadov-p><p class="whs23">The shape can also
be rotated around the path to get the resulting mesh in a helical fashion.
At the picture above we see both &quot;oblique-angled&quot; and &quot;right-angled&quot;
mesh elements because <span style="font-weight: bold;"><B>Rotation Angles</B></span>
have not been set for all iterations. You set the values of the angles
at the right and add them to the list of angles at the left by pressing
the <img src="image105.gif" width="26px" height="25px" border="0" class="img_whs13"> button and remove the values from the list by pressing
the <img src="image106.gif" width="29px" height="28px" border="0" class="img_whs14"> button. </p></li>
You can set the values of angles at the right, add them to the list of
angles at the left by pressing the <img src="image105.gif" width="26px" height="25px" border="0" class="img_whs26"> button and remove them
from the list by pressing the <img src="image106.gif" width="29px" height="28px" border="0" class="img_whs27"> button. </p></li>
</ul>
<p class="whs8">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 class="whs12">4. Click the <span style="font-weight: bold;"><B>Apply
</B></span>or <span style="font-weight: bold;"><B>OK </B></span>button. Mesh edges
will be extruded into faces, faces into volumes. The external surface
of the resulting 3d mesh (if faces have been extruded) is covered with
faces, and corners with edges. If the path is closed, the resulting mesh
can contain duplicated nodes and faces, because no sewing is done.</p>
<p class="whs8">&nbsp;</p>
<p class="whs12">&nbsp;</p>
<p>&nbsp;<span style="font-weight: bold;"><B>See
Also</B></span> a sample TUI Script of an <a href="modifying_meshes.htm#bookmark10">Extrusion

View File

@ -93,8 +93,8 @@ if (window.writeIntopicBar)
<h1>Importing and exporting meshes</h1>
<p><img src="../i_blue.jpg" x-maintain-ratio="TRUE" width="30px" height="30px" border="0" class="img_whs1"> In MESH there is a functionality allowing importation/exportation
of meshes from <span style="font-weight: bold;"><B>MED</B></span>, <span style="font-weight: bold;"><B>UNV</B></span>
format files. </p>
of meshes from <span style="font-weight: bold;"><B>MED</B></span> and <span style="font-weight: bold;"><B>UNV
</B></span>(I-DEAS 10) format files. </p>
<p>&nbsp;</p>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

File diff suppressed because it is too large Load Diff

View File

@ -122,6 +122,7 @@ borders_at_multi-connection.htm
borders_at_multiconnection_2d.htm
clipping.htm
constructing_meshes.htm
convert_to_from_quadratic_mesh.htm
defining_hypotheses_tui.htm
deleting_groups.htm
display_entity.htm
@ -176,11 +177,14 @@ length.htm
merge_elements.htm
mesh.htm
modifying_meshes.htm
namespacesmesh.html
netgen_2d_and_3d_hypotheses.htm
pattern_mapping.htm
presentation.htm
quality_controls.htm
revolution.htm
selection_filter_library.htm
smesh.py_introduction.htm
transforming_meshes.htm
transparency.htm
viewing_meshes.htm
@ -205,6 +209,9 @@ pics\sewing1.png
image92.gif
image51.jpg
image70.gif
pics\netgen2d.png
pics\circle_simple_after.png
pics\curvi_simple_after.png
pics\image138.gif
pics\create_group.png
pics\edit_mesh_change_value_hyp.png
@ -224,6 +231,7 @@ image52.jpg
image82.gif
image71.gif
image30.jpg
pics\extrusion1.png
pics\distributionwithanalyticdensity.png
pics\image139.gif
pics\rotation1.png
@ -239,6 +247,9 @@ image50.gif
image94.gif
image83.gif
image31.jpg
pics\circle_angles_after.png
pics\circle_simple_before.png
pics\curvi_angles_after.png
pics\graduatedaxes1.png
pics\image107.gif
pics\automaticlength.png
@ -258,6 +269,7 @@ image76.jpg
image84.gif
image32.jpg
image40.gif
pics\curvi_simple_before.png
pics\image108.gif
pics\aqt.png
pics\distributionwithtabledensity.png
@ -270,6 +282,7 @@ image74.gif
image63.gif
image22.jpg
image41.gif
pics\edge_wire_3d_before.png
pics\image109.gif
pics\meshimportmesh.png
pics\deletegroups.png
@ -288,6 +301,8 @@ image97.gif
image78.jpg
image64.gif
image23.jpg
pics\edge_wire_after.png
pics\edge_wire_before.png
image151.gif
pics\cut_groups1.png
pics\editing_groups2.png
@ -303,7 +318,6 @@ image152.gif
pics\cut_groups2.png
image130.gif
pics\max_el_area.png
pics\a-extusionalongapath2.png
pics\a-viewgeneral.png
pics\revolution1.png
pics\addtriangle.png
@ -314,6 +328,7 @@ image36.jpg
image33.gif
image25.jpg
i_blue.jpg
image153.gif
image15.jpg
image142.gif
pics\cut_groups3.png
@ -329,6 +344,8 @@ image56.gif
image37.jpg
image67.gif
image34.gif
pics\convert.png
image154.gif
image143.gif
image132.gif
pics\edit_mesh1.png
@ -343,6 +360,8 @@ image46.gif
image35.gif
image27.jpg
image24.gif
image155.gif
pics\mesh_for_extr_along_path.png
pics\createmesh-inv2.png
image144.gif
pics\intersect_groups1.png
@ -356,6 +375,8 @@ image58.gif
image36.gif
image25.gif
note1.gif
image156.gif
pics\edge_wire_3d_after.png
pics\createmesh-inv3.png
image145.gif
pics\intersect_groups2.png
@ -366,6 +387,7 @@ pics\addedge.png
image123.gif
image101.gif
image37.gif
pics\straight_after.png
pics\image96.gif
image146.gif
pics\intersect_groups3.png
@ -376,7 +398,6 @@ pics\a-nbsegments1.png
pics\patternmapping1.png
image90.jpg
image124.gif
image102.gif
image49.gif
image38.gif
pics\image100.gif
@ -406,9 +427,9 @@ pics\free_edges.png
pics\creategroup.png
image92.jpg
image126.gif
image104.gif
image18.gif
image70.jpg
pics\straight_before.png
pics\createmesh-inv.png
pics\image102.gif
pics\image99.gif
@ -502,6 +523,7 @@ whgdata\whlstf10.htm
whgdata\whlstf11.htm
whgdata\whlstf12.htm
whgdata\whlstf13.htm
whgdata\whlstf14.htm
whgdata\whlstg0.htm
index.htm
index_csh.htm

View File

@ -0,0 +1,270 @@
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
<head>
<title>smesh.py_introduction</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; font-family:'Lucida Console' , monospace; }
-->
</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 +="</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\nIntroduction to MESH module python interface");
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>Introduction to MESH module python interface</h1>
<p class="whs1">Package smesh provides
a standard API for creation and edition of meshes . </p>
<p class="whs1">Below you can see an example
of usage of the package smesh for 3d mesh generation. </p>
<p class="whs1">&nbsp;&nbsp;</p>
<p class="whs1">Example of 3d mesh generation
with NETGEN</p>
<p class="whs1">from geompy import * </p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import
smesh</span> </p>
<p class="whs1"># Geometry </p>
<p class="whs1"># an assembly of a box,
a cylinder and a truncated cone meshed with tetrahedral. </p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Define values </p>
<p class="whs2">name = &quot;ex21_lamp&quot;
</p>
<p class="whs2">cote = 60 </p>
<p class="whs2">section = 20 </p>
<p class="whs2">size = 200 </p>
<p class="whs2">radius_1 = 80 </p>
<p class="whs2">radius_2 = 40 </p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">height
= 100</span> </p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Build a box </p>
<p class="whs2">box = MakeBox(-cote,
-cote, -cote, +cote, +cote, +cote) </p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Build a cylinder </p>
<p class="whs2">pt1 = MakeVertex(0,
0, cote/3) </p>
<p class="whs2">di1 = MakeVectorDXDYDZ(0,
0, 1) </p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">cyl
= MakeCylinder(pt1, di1, section, size)</span> </p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Build a truncated cone
</p>
<p class="whs2">pt2 = MakeVertex(0,
0, size) </p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">cone
= MakeCone(pt2, di1, radius_1, radius_2, height)</span> </p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Fuse </p>
<p class="whs2">box_cyl = MakeFuse(box,
cyl) </p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">piece
= MakeFuse(box_cyl, cone)</span> </p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Add in study </p>
<p class="whs2">addToStudy(piece,
name) </p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Create a group of faces
</p>
<p class="whs2">group = CreateGroup(piece,
ShapeType[&quot;FACE&quot;]) </p>
<p class="whs2">group_name = name
+ &quot;_grp&quot; </p>
<p class="whs2">addToStudy(group,
group_name) </p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">group.SetName(group_name)</span>
</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Add faces in the group
</p>
<p class="whs2">faces = SubShapeAllIDs(piece,
ShapeType[&quot;FACE&quot;]) </p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">UnionIDs(group,
faces)</span> </p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Create a mesh </p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Define a mesh on a geometry
</p>
<p class="whs2">tetra = smesh.Mesh(piece,
name) </p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Define 1D hypothesis
</p>
<p class="whs2">algo1d = tetra.Segment()
</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">algo1d.LocalLength(10)</span>
</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Define 2D hypothesis
</p>
<p class="whs2">algo2d = tetra.Triangle()
</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">algo2d.LengthFromEdges()</span>
</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Define 3D hypothesis
</p>
<p class="whs2">algo3d = tetra.Tetrahedron(smesh.NETGEN)
</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">algo3d.MaxElementVolume(100)</span>
</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Compute the mesh </p>
<p class="whs2">tetra.Compute()
</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"># Create a groupe of faces
</p>
<p class="whs2">tetra.Group(group)
</p>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
writeIntopicBar(0);
//-->
</script>
</body>
</html>

View File

@ -7,6 +7,9 @@
<!-- Generated by Doxygen 1.4.6 -->
<h1>Package smesh</h1>
<p>
Python package smesh defines several classes, destined for easy and clear mesh creation and edition.
<p class="whs2"><a href="../smesh.py_introduction.htm">Example.</a></p>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>

File diff suppressed because it is too large Load Diff

View File

@ -85,121 +85,56 @@ if (window.writeIntopicBar)
<h3>Viewing Mesh Infos</h3>
<p class="whs1">import salome</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import
geompy</span></p>
<p class="whs1">import geompy</p>
<p class="whs1">import SMESH</p>
<p class="whs1">import StdMeshers</p>
<p class="whs1">import smesh</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">smesh = salome.lcc.FindOrLoadComponent(&quot;FactoryServer&quot;,
&quot;SMESH&quot;)</p>
<p class="whs2"># create a box</p>
<p class="whs1">smesh.SetCurrentStudy(salome.myStudy)</p>
<p class="whs1">box = geompy.MakeBox(0., 0., 0., 20.,
20., 20.)</p>
<p class="whs1">geompy.addToStudy(box, &quot;box&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">box &nbsp;&nbsp;=
geompy.MakeBox(0., 0., 0., 20., 20., 20.)</p>
<p class="whs2"># create a mesh</p>
<p class="whs1">idbox = geompy.addToStudy(box, &quot;box&quot;)</p>
<p class="whs1">tetra = smesh.Mesh(box, &quot;MeshBox&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">subShapeList = geompy.SubShapeAll(box,
geompy.ShapeType[&quot;EDGE&quot;])</p>
<p class="whs1">algo1D = tetra.Segment()</p>
<p class="whs1">edge &nbsp;&nbsp;=
subShapeList[0]</p>
<p class="whs1">name &nbsp;&nbsp;=
geompy.SubShapeName(edge, box)</p>
<p class="whs1">idedge = geompy.addToStudyInFather(box,
edge, name)</p>
<p class="whs1">algo1D.NumberOfSegments(3)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">box &nbsp;=
salome.IDToObject(idbox)</p>
<p class="whs1">algo2D = tetra.Triangle()</p>
<p class="whs1">edge = salome.IDToObject(idedge)</p>
<p class="whs1">algo2D.MaxElementArea(10.)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">hyp1 = smesh.CreateHypothesis(&quot;NumberOfSegments&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>
<p class="whs1">hyp1.SetNumberOfSegments(3)</p>
<p class="whs1">hyp2 = smesh.CreateHypothesis(&quot;MaxElementArea&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">hyp2.SetMaxElementArea(10)</p>
<p class="whs1">hyp3 = smesh.CreateHypothesis(&quot;Arithmetic1D&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">hyp3.SetLength(1,1)</p>
<p class="whs1">hyp3.SetLength(6,0)</p>
<p class="whs1">hyp4 = smesh.CreateHypothesis(&quot;Propagation&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">algo3D.MaxElementVolume(900.)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">algo1 = smesh.CreateHypothesis(&quot;Regular_1D&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs2"># compute the mesh</p>
<p class="whs1">algo2 = smesh.CreateHypothesis(&quot;MEFISTO_2D&quot;,
&quot;libStdMeshersEngine.so&quot;)</p>
<p class="whs1">mesh = smesh.CreateMesh(box)</p>
<p class="whs1">tetra.Compute()</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">mesh.AddHypothesis(box,hyp1)</p>
<p class="whs2"># print informations
about the mesh</p>
<p class="whs1">mesh.AddHypothesis(box,hyp2)</p>
<p class="whs1">mesh.AddHypothesis(box,algo1)</p>
<p class="whs1">mesh.AddHypothesis(box,algo2)</p>
<p class="whs1">mesh.AddHypothesis(edge,hyp3)</p>
<p class="whs1">mesh.AddHypothesis(edge,hyp4)</p>
<p class="whs1">mesh.AddHypothesis(edge,algo1)</p>
<p class="whs1">smesh.Compute(mesh,box)</p>
<p class="whs1">salome.sg.updateObjBrowser(1)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># remove one hypothesis</p>
<p class="whs1">mesh.RemoveHypothesis(edge,hyp4)</p>
<p class="whs1">smesh.Compute(mesh,box)</p>
<p class="whs1">salome.sg.updateObjBrowser(1)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># change the value
of the hypothesis</p>
<p class="whs1">hyp2.SetMaxElementArea(2)</p>
<p class="whs1">mesh.AddHypothesis(box,hyp2)</p>
<p class="whs1">smesh.Compute(mesh,box)</p>
<p class="whs1">mesh = tetra.GetMesh()</p>
<p class="whs1">print &quot;Information about mesh:&quot;</p>
@ -212,36 +147,36 @@ if (window.writeIntopicBar)
<p class="whs1">print &quot;Number of faces &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
&quot;, mesh.NbFaces()</p>
<p class="whs1">print &quot;Number of triangles &nbsp;&nbsp;:
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;triangles
&nbsp;&nbsp;:
&quot;, mesh.NbTriangles()</p>
<p class="whs1">print &quot;Number of quadrangles : &quot;,
mesh.NbQuadrangles()</p>
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;quadrangles
: &quot;, mesh.NbQuadrangles()</p>
<p class="whs1">print &quot;Number of polygons &nbsp;&nbsp;&nbsp;:
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;polygons
&nbsp;&nbsp;&nbsp;:
&quot;, mesh.NbPolygons()</p>
<p class="whs1">print &quot;Number of volumes &nbsp;&nbsp;&nbsp;&nbsp;:
&quot;, mesh.NbVolumes()</p>
<p class="whs1">print &quot;Number of tetrahedrons: &quot;,
mesh.NbTetras()</p>
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tetrahedrons:
&quot;, mesh.NbTetras()</p>
<p class="whs1">print &quot;Number of hexahedrons : &quot;,
mesh.NbHexas()</p>
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hexahedrons
: &quot;, mesh.NbHexas()</p>
<p class="whs1">print &quot;Number of prisms &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prisms
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
&quot;, mesh.NbPrisms()</p>
<p class="whs1">print &quot;Number of pyramids &nbsp;&nbsp;&nbsp;:
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pyramids
&nbsp;&nbsp;&nbsp;:
&quot;, mesh.NbPyramids()</p>
<p class="whs1">print &quot;Number of polyhedrons : &quot;,
mesh.NbPolyhedrons()</p>
<p class="whs1">salome.sg.updateObjBrowser(1) </p>
<p class="whs1">&nbsp;</p>
<p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;polyhedrons
: &quot;, mesh.NbPolyhedrons() </p>
<script type="text/javascript" language="javascript1.2">
<!--

View File

@ -19,6 +19,7 @@ aTE("Borders at multi-connection","borders_at_multi-connection.htm");
aTE("Borders at multiconnection 2D","borders_at_multiconnection_2d.htm");
aTE("Clipping","clipping.htm");
aTE("Constructing Meshes","constructing_meshes.htm");
aTE("Convert to/from Quadratic Mesh","convert_to_from_quadratic_mesh.htm");
aTE("Defining hypotheses TUI","defining_hypotheses_tui.htm");
aTE("Deleting Groups","deleting_groups.htm");
aTE("Display Entity","display_entity.htm");
@ -73,11 +74,14 @@ aTE("Length","length.htm");
aTE("Merge Elements","merge_elements.htm");
aTE("mesh","mesh.htm");
aTE("Modifying Meshes","modifying_meshes.htm");
aTE("SALOME - SMESH - v.version: Package smesh","namespacesmesh.html");
aTE("Netgen 2D and 3D hypotheses","netgen_2d_and_3d_hypotheses.htm");
aTE("Pattern mapping","pattern_mapping.htm");
aTE("Presentation","presentation.htm");
aTE("Quality Controls","quality_controls.htm");
aTE("Revolution","revolution.htm");
aTE("Selection filter library","selection_filter_library.htm");
aTE("smesh.py_introduction","smesh.py_introduction.htm");
aTE("Transforming Meshes","transforming_meshes.htm");
aTE("Transparency","transparency.htm");
aTE("Viewing Meshes","viewing_meshes.htm");

File diff suppressed because it is too large Load Diff

View File

@ -8,19 +8,21 @@
<script language="javascript" src="whtdata.js"></script>
<script language="javascript">
<!--
aTE(1,78,"MESH module");
aTE(1,81,"MESH module");
aTE(2,0,"Introduction to Mesh","mesh.htm");
aTE(2,0,"Running MESH module","files/running_smesh_module.htm");
aTE(1,12,"Creating meshes");
aTE(2,0,"Introduction to MESH module python interface","smesh.py_introduction.htm");
aTE(1,13,"Creating meshes");
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,"Constructing meshes","files/constructing_meshes.htm");
aTE(2,0,"Defining meshing algorithms","files/about_meshing_algorithms.htm");
aTE(1,5,"Defining hypotheses");
aTE(1,6,"Defining hypotheses");
aTE(2,0,"About Hypotheses","files/about_hypotheses.htm");
aTE(2,0,"1D Meshing Hypotheses","files/arithmetic_1d.htm");
aTE(2,0,"2D Meshing Hypotheses","files/max._element_area_hypothesis.htm");
aTE(2,0,"Max Element Volume hypothesis","files/max._element_volume_hypothsis.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,"Constructing submeshes","files/constructing_submeshes.htm");
aTE(2,0,"Editing Meshes","files/reassigning_hypotheses_and_algorithms.htm");
@ -56,7 +58,7 @@
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,"Selection filter library","selection_filter_library.htm");
aTE(1,22,"Modifying meshes");
aTE(1,23,"Modifying meshes");
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,"Removing nodes and elements","files/removing_nodes_and_elements.htm");
@ -79,11 +81,12 @@
aTE(2,0,"Extrusion along a path","extrusion_along_a_path.htm");
aTE(2,0,"Revolution","revolution.htm");
aTE(2,0,"Pattern mapping","pattern_mapping.htm");
aTE(2,0,"Access to Mesh module functionality from Python (using smesh.py)","smeshpy_doc/namespacesmesh.html");
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(1,7,"TUI Scripts");
aTE(2,0,"Creating Meshes","constructing_meshes.htm");
aTE(2,0,"Defining Hypotheses","defining_hypotheses_tui.htm");
aTE(2,0,"Viewing Meshes","viewing_meshes.htm");
aTE(2,0,"Defining Hypotheses","defining_hypotheses_tui.htm");
aTE(2,0,"Quality Controls","quality_controls.htm");
aTE(2,0,"Grouping Elements","grouping_elements.htm");
aTE(2,0,"Modifying Meshes","modifying_meshes.htm");

View File

@ -62,7 +62,7 @@ img {vertial-align:middle;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../revolution.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Revolution</a></nobr><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../pattern_mapping.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Pattern mapping</a></nobr><br>
&nbsp;&nbsp;&nbsp;<nobr><a name="9"></a><a href="whlstt9.htm#9" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> TUI Scripts</a></nobr><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../smeshpy_doc/namespacesmesh.html"><img src="../wht_toc3.gif" border="0" align="absmiddle"> Access to Mesh module functionality from Python (using smesh.py)</a></nobr><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../smeshpy_doc/namespacesmesh.html"><img src="../wht_toc3.gif" border="0" align="absmiddle"> Python interface smesh.py</a></nobr><br>
</p>
</td></tr>

View File

@ -46,6 +46,7 @@ img {vertial-align:middle;}
&nbsp;&nbsp;&nbsp;<nobr><a name="6"></a><a href="whlstt6.htm#6" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Grouping elements</a></nobr><br>
&nbsp;&nbsp;&nbsp;<nobr><a name="7"></a><a href="whlstt7.htm#7" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Modifying meshes</a></nobr><br>
&nbsp;&nbsp;&nbsp;<nobr><a name="9"></a><a href="whlstt1.htm#9" target="_self"><img src="../whd_toc2.gif" border="0" align="absmiddle"> TUI Scripts</a></nobr><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../smesh_py_introduction.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Introduction to MESH module python interface</a></nobr><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../constructing_meshes.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Creating Meshes</a></nobr><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../defining_hypotheses_tui.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Defining Hypotheses</a></nobr><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../viewing_meshes.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Viewing Meshes</a></nobr><br>

View File

@ -7,6 +7,7 @@
<topic name="Borders at multiconnection 2D" url="borders_at_multiconnection_2d.htm" />
<topic name="Clipping" url="clipping.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="Defining hypotheses TUI" url="defining_hypotheses_tui.htm" />
<topic name="Deleting Groups" url="deleting_groups.htm" />
<topic name="Display Entity" url="display_entity.htm" />
@ -61,11 +62,14 @@
<topic name="Merge Elements" url="merge_elements.htm" />
<topic name="mesh" url="mesh.htm" />
<topic name="Modifying Meshes" url="modifying_meshes.htm" />
<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="Pattern mapping" url="pattern_mapping.htm" />
<topic name="Presentation" url="presentation.htm" />
<topic name="Quality Controls" url="quality_controls.htm" />
<topic name="Revolution" url="revolution.htm" />
<topic name="Selection filter library" url="selection_filter_library.htm" />
<topic name="smesh.py_introduction" url="smesh.py_introduction.htm" />
<topic name="Transforming Meshes" url="transforming_meshes.htm" />
<topic name="Transparency" url="transparency.htm" />
<topic name="Viewing Meshes" url="viewing_meshes.htm" />

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='windows-1252' ?>
<fts>
<chunkinfo url="whfwdata0.xml" first="0" last="zoom"/>
<chunkinfo url="whfwdata0.xml" first="_grp" last="zoom"/>
<tchunkinfo first="0" last="69" url="whftdata0.xml" />
<tchunkinfo first="0" last="73" url="whftdata0.xml" />
</fts>

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@
<book name="MESH module" >
<item name="Introduction to Mesh" url="mesh.htm" />
<item name="Running MESH module" url="files/running_smesh_module.htm" />
<item name="Introduction to MESH module python interface" url="smesh.py_introduction.htm" />
<book name="Creating meshes" >
<item name="About meshes" url="files/about_meshes.htm" />
<item name="Importing and exporting meshes" url="files/importing_and_exporting_meshes.htm" />
@ -13,6 +14,7 @@
<item name="1D Meshing Hypotheses" url="files/arithmetic_1d.htm" />
<item name="2D Meshing Hypotheses" url="files/max._element_area_hypothesis.htm" />
<item name="Max Element Volume hypothesis" url="files/max._element_volume_hypothsis.htm" />
<item name="Netgen 2D and 3D hypotheses" url="netgen_2d_and_3d_hypotheses.htm" />
<item name="Additional Hypotheses" url="files/non_conform_mesh_allowed_hypothesis.htm" />
</book>
<item name="Constructing submeshes" url="files/constructing_submeshes.htm" />
@ -77,12 +79,13 @@
<item name="Extrusion along a path" url="extrusion_along_a_path.htm" />
<item name="Revolution" url="revolution.htm" />
<item name="Pattern mapping" url="pattern_mapping.htm" />
<item name="Convert to/from Quadratic Mesh" url="convert_to_from_quadratic_mesh.htm" />
</book>
<item name="Access to Mesh module functionality from Python (using smesh.py)" url="smeshpy_doc/namespacesmesh.html" />
<item name="Python Interface smesh.py" url="smeshpy_doc/namespacesmesh.html" />
<book name="TUI Scripts" >
<item name="Creating Meshes" url="constructing_meshes.htm" />
<item name="Defining Hypotheses" url="defining_hypotheses_tui.htm" />
<item name="Viewing Meshes" url="viewing_meshes.htm" />
<item name="Defining Hypotheses" url="defining_hypotheses_tui.htm" />
<item name="Quality Controls" url="quality_controls.htm" />
<item name="Grouping Elements" url="grouping_elements.htm" />
<item name="Modifying Meshes" url="modifying_meshes.htm" />

View File

@ -202,10 +202,10 @@ SMESH module.<br>
The SALOME automatically locates XML files, searching them in the following
directories:<br>
<tt><br>
&nbsp;&nbsp;&nbsp; ${&lt;PLUGINNAME&gt;_ROOT_DIR}/share/salome/resources<br>
&nbsp;&nbsp;&nbsp; ${&lt;PLUGINNAME&gt;_ROOT_DIR}/share/salome/resources/&lt;pluginname&gt;<br>
&nbsp;&nbsp;&nbsp; ${SALOME_&lt;PluginName&gt;Resources}<br>
&nbsp;&nbsp;&nbsp; ${HOME}/.salome/resources<br>
&nbsp;&nbsp;&nbsp; ${KERNEL_ROOT_DIR}/share/salome/resources</tt><br>
&nbsp;&nbsp;&nbsp; ${KERNEL_ROOT_DIR}/share/salome/resources/kernel</tt><br>
<br>
where &lt;PluginName&gt; is a name of each mesher plugin package<br>
</blockquote>
@ -280,7 +280,7 @@ See paragraph 2 for definition of MyResourceKey, MyHypType1, MyAlgType1.<tt><br>
<h5> <a name="2_4_2_2"></a>2.4.2.2. Define environment variable SALOME_&lt;MyResourceKey&gt;Resources</h5>
<blockquote>It should point to the directory where resources are situated.</blockquote>
<blockquote><tt>Example: setenv SALOME_StdMeshersResources ${SMESH_ROOT_DIR}/share/salome/resources</tt></blockquote>
<blockquote><tt>Example: setenv SALOME_StdMeshersResources ${SMESH_ROOT_DIR}/share/salome/resources/smesh</tt></blockquote>
<h4> <a name="2_4_3"></a>2.4.3. Implement your Hypothesis Creator and being
exported method</h4>

View File

@ -30,9 +30,6 @@
#include "GEOM_Gen.idl"
#include "SMESH_Mesh.idl"
#include "GEOM_Gen.idl"
module SMESH
{

View File

@ -121,6 +121,7 @@ module SMESH
/*!
* Create Mesh object importing data from given UNV file
* (UNV supported version is I-DEAS 10)
*/
SMESH_Mesh CreateMeshesFromUNV( in string theFileName )
raises ( SALOME::SALOME_Exception );
@ -169,7 +170,8 @@ module SMESH
raises ( SALOME::SALOME_Exception );
/*!
*
* Return indeces of faces, edges and vertices of given subshapes
* within theMainObject
*/
long_array GetSubShapesId( in GEOM::GEOM_Object theMainObject,
in object_array theListOfSubObjects )

View File

@ -374,6 +374,7 @@ module SMESH
/*!
* Export Mesh to DAT, UNV and STL Formats
* (UNV supported version is I-DEAS 10)
*/
void ExportDAT( in string file )
raises (SALOME::SALOME_Exception);
@ -642,6 +643,16 @@ module SMESH
long AddNode(in double x, in double y, in double z);
/*!
* Following methods are intented for creation edges, faces
* and volumes both similar 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);
long AddFace(in long_array IDsOfNodes);

View File

@ -41,7 +41,13 @@
</section>
<section name="resources">
<!-- Module resources -->
<parameter name="SMESH" value="${SMESH_ROOT_DIR}/share/salome/resources"/>
<parameter name="StdMeshers" value="${SMESH_ROOT_DIR}/share/salome/resources"/>
<parameter name="SMESH" value="${SMESH_ROOT_DIR}/share/salome/resources/smesh"/>
<parameter name="StdMeshers" value="${SMESH_ROOT_DIR}/share/salome/resources/smesh"/>
<!-- NETGENPlugin and GHS3DPlugin -->
<!-- Here the environment variables are used as case-sensitive, -->
<!-- In GUI/src/SalomeApp/resources/SalomeApp.xml upper-case notation is used. -->
<!-- As a result, both variants are acceptable. -->
<parameter name="NETGENPlugin" value="${NETGENPlugin_ROOT_DIR}/share/salome/resources/netgenplugin"/>
<parameter name="GHS3DPlugin" value="${GHS3DPlugin_ROOT_DIR}/share/salome/resources/ghs3dplugin"/>
</section>
</document>

View File

@ -350,36 +350,49 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
if ( nbNodes < 3 )
return 0;
// Compute lengths of the sides
vector< double > aLen (nbNodes);
for ( int i = 0; i < nbNodes - 1; i++ )
aLen[ i ] = getDistance( P( i + 1 ), P( i + 2 ) );
aLen[ nbNodes - 1 ] = getDistance( P( 1 ), P( nbNodes ) );
// Compute aspect ratio
if ( nbNodes == 3 )
{
if ( nbNodes == 3 ) {
// Compute lengths of the sides
vector< double > aLen (nbNodes);
for ( int i = 0; i < nbNodes - 1; i++ )
aLen[ i ] = getDistance( P( i + 1 ), P( i + 2 ) );
aLen[ nbNodes - 1 ] = getDistance( P( 1 ), P( nbNodes ) );
// Q = alfa * h * p / S, where
//
// alfa = sqrt( 3 ) / 6
// h - length of the longest edge
// p - half perimeter
// S - triangle surface
const double alfa = sqrt( 3. ) / 6.;
double maxLen = Max( aLen[ 0 ], Max( aLen[ 1 ], aLen[ 2 ] ) );
double half_perimeter = ( aLen[0] + aLen[1] + aLen[2] ) / 2.;
double anArea = getArea( P( 1 ), P( 2 ), P( 3 ) );
if ( anArea <= Precision::Confusion() )
return 0.;
return alfa * maxLen * half_perimeter / anArea;
}
else
{
else if ( nbNodes == 6 ) { // quadratic triangles
// Compute lengths of the sides
vector< double > aLen (3);
aLen[0] = getDistance( P(1), P(3) );
aLen[1] = getDistance( P(3), P(5) );
aLen[2] = getDistance( P(5), P(1) );
// Q = alfa * h * p / S, where
//
// alfa = sqrt( 3 ) / 6
// h - length of the longest edge
// p - half perimeter
// S - triangle surface
const double alfa = sqrt( 3. ) / 6.;
double maxLen = Max( aLen[ 0 ], Max( aLen[ 1 ], aLen[ 2 ] ) );
double half_perimeter = ( aLen[0] + aLen[1] + aLen[2] ) / 2.;
double anArea = getArea( P(1), P(3), P(5) );
if ( anArea <= Precision::Confusion() )
return 0.;
return alfa * maxLen * half_perimeter / anArea;
}
else if( nbNodes == 4 ) { // quadrangle
// return aspect ratio of the worst triange which can be built
// taking three nodes of the quadrangle
TSequenceOfXYZ triaPnts(3);
@ -398,6 +411,27 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
triaPnts(1) = P(3);
ar = Max ( ar, GetValue( triaPnts ));
return ar;
}
else { // nbNodes==8 - quadratic quadrangle
// return aspect ratio of the worst triange which can be built
// taking three nodes of the quadrangle
TSequenceOfXYZ triaPnts(3);
// triangle on nodes 1 3 2
triaPnts(1) = P(1);
triaPnts(2) = P(5);
triaPnts(3) = P(3);
double ar = GetValue( triaPnts );
// triangle on nodes 1 3 4
triaPnts(3) = P(7);
ar = Max ( ar, GetValue( triaPnts ));
// triangle on nodes 1 2 4
triaPnts(2) = P(3);
ar = Max ( ar, GetValue( triaPnts ));
// triangle on nodes 3 2 4
triaPnts(1) = P(5);
ar = Max ( ar, GetValue( triaPnts ));
return ar;
}
}
@ -486,7 +520,17 @@ double AspectRatio3D::GetValue( const TSequenceOfXYZ& P )
{
double aQuality = 0.0;
if(myCurrElement->IsPoly()) return aQuality;
int nbNodes = P.size();
if(myCurrElement->IsQuadratic()) {
if(nbNodes==10) nbNodes=4; // quadratic tetrahedron
else if(nbNodes==13) nbNodes=5; // quadratic pyramid
else if(nbNodes==15) nbNodes=6; // quadratic pentahedron
else if(nbNodes==20) nbNodes=8; // quadratic hexahedron
else return aQuality;
}
switch(nbNodes){
case 4:{
double aLen[6] = {

View File

@ -130,9 +130,11 @@ DriverMED_R_SMESHDS_Mesh
// Reading MED nodes to the corresponding SMDS structure
//------------------------------------------------------
PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
if(!aNodeInfo)
PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
if (!aNodeInfo) {
aResult = DRS_FAIL;
continue;
}
PCoordHelper aCoordHelper = GetCoordHelper(aNodeInfo);
@ -915,18 +917,17 @@ bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
for(MED::TInt iDim=0;iDim<aMeshDim;iDim++)
aCoords[(int)iDim] = aMEDNodeCoord[(int)iDim];
aNode = myMesh->AddNodeWithID(aCoords[0],aCoords[1],aCoords[2],(int)iNode);
}
/* not implemented FAMILY
TInt aFamNum = aNodeInfo->GetFamNum(iElem);
if ( checkFamilyID ( aFamily, aFamNum ))
{
aFamily->AddElement(aNode);
aFamily->SetType(SMDSAbs_Node);
if((aGrilleInfo->myFamNumNode).size() > 0){
TInt aFamNum = aGrilleInfo->GetFamNumNode(iNode);
if ( checkFamilyID ( aFamily, aFamNum ))
{
aFamily->AddElement(aNode);
aFamily->SetType(SMDSAbs_Node);
}
}
*/
}
SMDS_MeshElement* anElement = NULL;
MED::TIntVector aNodeIds;
@ -971,6 +972,14 @@ bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
default:
break;
}
if((aGrilleInfo->myFamNum).size() > 0){
TInt aFamNum = aGrilleInfo->GetFamNum(iCell);
if ( checkFamilyID ( aFamily, aFamNum )){
aFamily->AddElement(anElement);
aFamily->SetType(anElement->GetType());
}
}
}
return res;

View File

@ -454,7 +454,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
if ( edge_fam != anElemFamMap.end() )
aFamilyNums->push_back( edge_fam->second );
else
aFamilyNums->push_back( myFacesDefaultFamilyId );
aFamilyNums->push_back( myEdgesDefaultFamilyId );
}
if ( aNbSeg2 ) {

View File

@ -31,6 +31,9 @@ class SMDS_Mesh;
class SMDS_MeshGroup;
typedef std::map<SMDS_MeshGroup*, std::string> TGroupNamesMap;
typedef std::map<SMDS_MeshGroup*, int> TGroupIdMap;
typedef std::map<SMDS_MeshGroup*, std::string> TGroupNamesMap;
typedef std::map<SMDS_MeshGroup*, int> TGroupIdMap;

View File

@ -66,7 +66,15 @@ typedef unsigned long int N;
//le type Z des nombres entiers relatifs
//=========
typedef long int Z;
// 64-bit porting: "long" replaced with "int".
// On 64-bit, C++ long type is 8 byte long. MEFISTO2D C code calls several Fortran subroutines passing
// arguments of this type, however Fortran knows nothing about changed size of arguments,
// 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;
//le type R des nombres "reels"
//=========

View File

@ -51,6 +51,7 @@ LIB_SRC = \
LIB_CLIENT_IDL = SALOME_Exception.idl \
SALOME_GenericObj.idl \
SALOME_Comm.idl \
SALOME_Component.idl \
MED.idl \
SMESH_Mesh.idl \
SMESH_Group.idl \

View File

@ -1582,7 +1582,7 @@ void SMESH_ActorDef::UpdateScalarBar()
aScalarBarLabelProp->SetFontFamilyToArial();
if( mgr->hasValue( "SMESH", "scalar_bar_label_font" ) )
{
QFont f = mgr->stringValue( "SMESH", "scalar_bar_label_font" );
QFont f = mgr->fontValue( "SMESH", "scalar_bar_label_font" );
if( f.family() == "Arial" )
aScalarBarLabelProp->SetFontFamilyToArial();
else if( f.family() == "Courier" )

View File

@ -70,6 +70,7 @@ SMESHOBJECT_EXPORT
void
WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid,
const char* theFileName);
}
#endif

View File

@ -93,7 +93,7 @@ public:
* \retval int - valid node index
*/
int WrappedIndex(const int ind) const {
if ( ind < 0 ) return -( ind % NbNodes());
if ( ind < 0 ) return NbNodes() + ind % NbNodes();
if ( ind >= NbNodes() ) return ind % NbNodes();
return ind;
}

View File

@ -1266,7 +1266,7 @@ bool SMDS_VolumeTool::IsFreeFace( int faceIndex )
if ( IsFaceExternal( faceIndex ))
intNormal = XYZ( -intNormal.x, -intNormal.y, -intNormal.z );
XYZ p0 ( nodes[0] ), baryCenter;
for ( vNbIt = volNbShared.begin(); vNbIt != volNbShared.end(); ) {
for ( vNbIt = volNbShared.begin(); vNbIt != volNbShared.end(); vNbIt++ ) {
int nbShared = (*vNbIt).second;
if ( nbShared >= 3 ) {
SMDS_VolumeTool volume( (*vNbIt).first );

View File

@ -1576,54 +1576,67 @@ const TopTools_ListOfShape& SMESH_Mesh::GetAncestors(const TopoDS_Shape& theS) c
//=======================================================================
ostream& SMESH_Mesh::Dump(ostream& save)
{
save << "========================== Dump contents of mesh ==========================" << endl;
save << "1) Total number of nodes: " << NbNodes() << endl;
save << "2) Total number of edges: " << NbEdges() << endl;
save << "3) Total number of faces: " << NbFaces() << endl;
if ( NbFaces() > 0 ) {
int nb3 = NbTriangles();
int nb4 = NbQuadrangles();
save << "3.1.) Number of triangles: " << nb3 << endl;
save << "3.2.) Number of quadrangles: " << nb4 << endl;
if ( nb3 + nb4 != NbFaces() ) {
map<int,int> myFaceMap;
SMDS_FaceIteratorPtr itFaces=_myMeshDS->facesIterator();
while( itFaces->more( ) ) {
int nbNodes = itFaces->next()->NbNodes();
if ( myFaceMap.find( nbNodes ) == myFaceMap.end() )
myFaceMap[ nbNodes ] = 0;
myFaceMap[ nbNodes ] = myFaceMap[ nbNodes ] + 1;
int clause = 0;
save << "========================== Dump contents of mesh ==========================" << endl << endl;
save << ++clause << ") Total number of nodes: \t" << NbNodes() << endl;
save << ++clause << ") Total number of edges: \t" << NbEdges() << endl;
save << ++clause << ") Total number of faces: \t" << NbFaces() << endl;
save << ++clause << ") Total number of polygons:\t" << NbPolygons() << endl;
save << ++clause << ") Total number of volumes:\t" << NbVolumes() << endl;
save << ++clause << ") Total number of polyhedrons:\t" << NbPolyhedrons() << endl << endl;
for ( int isQuadratic = 0; isQuadratic < 2; ++isQuadratic )
{
string orderStr = isQuadratic ? "quadratic" : "linear";
ElementOrder order = isQuadratic ? ORDER_QUADRATIC : ORDER_LINEAR;
save << ++clause << ") Total number of " << orderStr << " edges:\t" << NbEdges(order) << endl;
save << ++clause << ") Total number of " << orderStr << " faces:\t" << NbFaces(order) << endl;
if ( NbFaces(order) > 0 ) {
int nb3 = NbTriangles(order);
int nb4 = NbQuadrangles(order);
save << clause << ".1) Number of " << orderStr << " triangles: \t" << nb3 << endl;
save << clause << ".2) Number of " << orderStr << " quadrangles:\t" << nb4 << endl;
if ( nb3 + nb4 != NbFaces(order) ) {
map<int,int> myFaceMap;
SMDS_FaceIteratorPtr itFaces=_myMeshDS->facesIterator();
while( itFaces->more( ) ) {
int nbNodes = itFaces->next()->NbNodes();
if ( myFaceMap.find( nbNodes ) == myFaceMap.end() )
myFaceMap[ nbNodes ] = 0;
myFaceMap[ nbNodes ] = myFaceMap[ nbNodes ] + 1;
}
save << clause << ".3) Faces in detail: " << endl;
map <int,int>::iterator itF;
for (itF = myFaceMap.begin(); itF != myFaceMap.end(); itF++)
save << "--> nb nodes: " << itF->first << " - nb elemens:\t" << itF->second << endl;
}
save << "3.3.) Faces in detail: " << endl;
map <int,int>::iterator itF;
for (itF = myFaceMap.begin(); itF != myFaceMap.end(); itF++)
save << "--> nb nodes: " << itF->first << " - nb elemens: " << itF->second << endl;
}
}
save << "4) Total number of volumes: " << NbVolumes() << endl;
if ( NbVolumes() > 0 ) {
int nb8 = NbHexas();
int nb4 = NbTetras();
int nb5 = NbPyramids();
int nb6 = NbPrisms();
save << "4.1.) Number of hexahedrons: " << nb8 << endl;
save << "4.2.) Number of tetrahedrons: " << nb4 << endl;
save << "4.3.) Number of prisms: " << nb6 << endl;
save << "4.4.) Number of pyramides: " << nb5 << endl;
if ( nb8 + nb4 + nb5 + nb6 != NbVolumes() ) {
map<int,int> myVolumesMap;
SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator();
while( itVolumes->more( ) ) {
int nbNodes = itVolumes->next()->NbNodes();
if ( myVolumesMap.find( nbNodes ) == myVolumesMap.end() )
myVolumesMap[ nbNodes ] = 0;
myVolumesMap[ nbNodes ] = myVolumesMap[ nbNodes ] + 1;
save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl;
if ( NbVolumes(order) > 0 ) {
int nb8 = NbHexas(order);
int nb4 = NbTetras(order);
int nb5 = NbPyramids(order);
int nb6 = NbPrisms(order);
save << clause << ".1) Number of " << orderStr << " hexahedrons:\t" << nb8 << endl;
save << clause << ".2) Number of " << orderStr << " tetrahedrons:\t" << nb4 << endl;
save << clause << ".3) Number of " << orderStr << " prisms: \t" << nb6 << endl;
save << clause << ".4) Number of " << orderStr << " pyramids:\t" << nb5 << endl;
if ( nb8 + nb4 + nb5 + nb6 != NbVolumes(order) ) {
map<int,int> myVolumesMap;
SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator();
while( itVolumes->more( ) ) {
int nbNodes = itVolumes->next()->NbNodes();
if ( myVolumesMap.find( nbNodes ) == myVolumesMap.end() )
myVolumesMap[ nbNodes ] = 0;
myVolumesMap[ nbNodes ] = myVolumesMap[ nbNodes ] + 1;
}
save << clause << ".5) Volumes in detail: " << endl;
map <int,int>::iterator itV;
for (itV = myVolumesMap.begin(); itV != myVolumesMap.end(); itV++)
save << "--> nb nodes: " << itV->first << " - nb elemens:\t" << itV->second << endl;
}
save << "4.5.) Volumes in detail: " << endl;
map <int,int>::iterator itV;
for (itV = myVolumesMap.begin(); itV != myVolumesMap.end(); itV++)
save << "--> nb nodes: " << itV->first << " - nb elemens: " << itV->second << endl;
}
save << endl;
}
save << "===========================================================================" << endl;
return save;

View File

@ -57,7 +57,17 @@ class gp_Vec;
class gp_Pnt;
class SMESH_EXPORT SMESH_MeshEditor {
public:
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;
public:
SMESH_MeshEditor( SMESH_Mesh* theMesh );

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
@ -481,9 +481,18 @@ bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis,
switch ( theShapeType ) {
case TopAbs_EDGE:
case TopAbs_FACE:
case TopAbs_SHELL:
case TopAbs_SOLID:
return SMESH_Gen::GetShapeDim( theShapeType ) == theHypothesis->GetDim();
case TopAbs_SHELL:
// Special case for algorithms, building 2D mesh on a whole shell.
// Before this fix there was a problem after restoring from study,
// because in that case algorithm is assigned before hypothesis
// (on shell in problem case) and hypothesis is checked on faces
// (because it is 2D), where we have NO_ALGO state.
// Now 2D hypothesis is also applicable to shells.
return (theHypothesis->GetDim() == 2 || theHypothesis->GetDim() == 3);
// case TopAbs_WIRE:
// case TopAbs_COMPSOLID:
// case TopAbs_COMPOUND:
@ -1264,6 +1273,9 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
RemoveSubMeshElementsAndNodes();
{
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!algo->NeedDescretBoundary() && !algo->OnlyUnaryInput())
ret = ApplyToCollection( algo, GetCollection( gen, algo ) );
else

View File

@ -53,9 +53,9 @@ class SMESHDS_EXPORT SMESHDS_Group : public SMESHDS_GroupBase
virtual SMDS_ElemIteratorPtr GetElements();
bool SMESHDS_Group::Add (const int theID);
bool Add (const int theID);
bool SMESHDS_Group::Remove (const int theID);
bool Remove (const int theID);
void Clear();

View File

@ -415,6 +415,7 @@ public:
void ClearScript();
int ShapeToIndex(const TopoDS_Shape & aShape) const;
const TopoDS_Shape& IndexToShape(int ShapeIndex) const;
int MaxShapeIndex() const { return myIndexToShape.Extent(); }
SMESHDS_SubMesh * NewSubMesh(int Index);
int AddCompoundSubmesh(const TopoDS_Shape& S, TopAbs_ShapeEnum type = TopAbs_SHAPE);

View File

@ -145,7 +145,7 @@
using namespace std;
namespace{
//namespace{
// Declarations
//=============================================================
void ImportMeshesFromFile(SMESH::SMESH_Gen_ptr theComponentMesh,
@ -685,7 +685,137 @@ namespace{
return RefType;
}
}
void SMESHGUI::OnEditDelete()
{
// VSR 17/11/04: check if all objects selected belong to SMESH component --> start
LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
SALOME_ListIO selected; aSel->selectedObjects( selected, QString::null, false );
QString aParentComponent = QString::null;
for( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() )
{
QString cur = anIt.Value()->getComponentDataType();
if( aParentComponent.isNull() )
aParentComponent = cur;
else if( !aParentComponent.isEmpty() && aParentComponent!=cur )
aParentComponent = "";
}
if ( aParentComponent != SMESHGUI::GetSMESHGUI()->name() ) {
SUIT_MessageBox::warn1 ( SMESHGUI::desktop(),
QObject::tr("ERR_ERROR"),
QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ),
QObject::tr("BUT_OK") );
return;
}
// VSR 17/11/04: check if all objects selected belong to SMESH component <-- finish
if (SUIT_MessageBox::warn2
(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_REALLY_DELETE"),
QObject::tr("SMESH_BUT_YES"), QObject::tr("SMESH_BUT_NO"), 1, 0, 0) != 1)
return;
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
SUIT_ViewManager* vm = anApp->activeViewManager();
int nbSf = vm->getViewsCount();
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
_PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
_PTR(GenericAttribute) anAttr;
_PTR(AttributeIOR) anIOR;
SALOME_ListIteratorOfListIO It(selected);
aStudyBuilder->NewCommand(); // There is a transaction
for(; It.More(); It.Next()){ // loop on selected IO's
Handle(SALOME_InteractiveObject) IObject = It.Value();
if(IObject->hasEntry()) {
_PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry());
// disable removal of "SMESH" component object
if(aSO->FindAttribute(anAttr, "AttributeIOR")){
anIOR = anAttr;
if ( !strcmp( (char*)anIOR->Value().c_str(), engineIOR().latin1() ) )
continue;
}
// put the whole hierarchy of sub-objects of the selected SO into a list and
// then treat them all starting from the deepest objects (at list back)
list< _PTR(SObject) > listSO;
listSO.push_back( aSO );
list< _PTR(SObject) >::iterator itSO = listSO.begin();
for ( ; itSO != listSO.end(); ++itSO ) {
_PTR(ChildIterator) it = aStudy->NewChildIterator( *itSO );
for (it->InitEx(false); it->More(); it->Next())
listSO.push_back( it->Value() );
}
// treat SO's in the list starting from the back
list< _PTR(SObject) >::reverse_iterator ritSO = listSO.rbegin();
for ( ; ritSO != listSO.rend(); ++ritSO ) {
_PTR(SObject) SO = *ritSO;
if ( !SO ) continue;
string anEntry = SO->GetID();
/** Erase graphical object **/
if(SO->FindAttribute(anAttr, "AttributeIOR")){
QPtrVector<SUIT_ViewWindow> aViews = vm->getViews();
for(int i = 0; i < nbSf; i++){
SUIT_ViewWindow *sf = aViews[i];
if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){
SMESH::RemoveActor(sf,anActor);
}
}
}
/** Remove an object from data structures **/
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO ));
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( SO ));
if ( !aGroup->_is_nil() ) { // DELETE GROUP
SMESH::SMESH_Mesh_var aMesh = aGroup->GetMesh();
aMesh->RemoveGroup( aGroup );
}
else if ( !aSubMesh->_is_nil() ) { // DELETE SUBMESH
SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
aMesh->RemoveSubMesh( aSubMesh );
_PTR(SObject) aMeshSO = SMESH::FindSObject(aMesh);
if (aMeshSO)
SMESH::ModifiedMesh(aMeshSO, false);
}
else {
IObject = new SALOME_InteractiveObject
( anEntry.c_str(), engineIOR().latin1(), SO->GetName().c_str() );
QString objType = CheckTypeObject(IObject);
if ( objType == "Hypothesis" || objType == "Algorithm" ) {// DELETE HYPOTHESIS
SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
aStudyBuilder->RemoveObjectWithChildren( SO );
}
else {// default action: remove SObject from the study
// san - it's no use opening a transaction here until UNDO/REDO is provided in SMESH
//SUIT_Operation *op = new SALOMEGUI_ImportOperation(myActiveStudy);
//op->start();
aStudyBuilder->RemoveObjectWithChildren( SO );
//op->finish();
}
}
} /* listSO back loop */
} /* IObject->hasEntry() */
} /* more/next */
aStudyBuilder->CommitCommand();
/* Clear any previous selection */
SALOME_ListIO l1;
aSel->setSelectedObjects( l1 );
SMESHGUI::GetSMESHGUI()->updateObjBrowser();
}
//}
extern "C" {
SMESHGUI_EXPORT CAM_Module* createModule()
@ -1088,12 +1218,18 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
}
}
// PAL13338 -->
if ( ( theCommandID==301 || theCommandID==302 ) && !checkLock(aStudy) && !automaticUpdate() )
SMESH::UpdateView();
// PAL13338 <--
if (anAction == SMESH::eErase) {
SALOME_ListIO l1;
aSel->setSelectedObjects( l1 );
}
else
aSel->setSelectedObjects( to_process );
break;
}
@ -1149,6 +1285,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
if ( vtkwnd ) {
int nbSel = selected.Extent();
if (nbSel != 1){
SUIT_MessageBox::warn1(desktop(),
tr("SMESH_WRN_WARNING"),
tr("SMESH_WRN_NO_AVAILABLE_DATA"),
tr("SMESH_BUT_OK"));
break;
}
@ -1213,7 +1353,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
}
SMESH::RepaintCurrentView();
}
}else{
}
else{
SUIT_MessageBox::warn1(desktop(),
tr("SMESH_WRN_WARNING"),
tr("SMESH_WRN_VIEWER_VTK"),
@ -1453,13 +1594,20 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
}
updateObjBrowser();
}catch(const SALOME::SALOME_Exception & S_ex){
}
catch(const SALOME::SALOME_Exception & S_ex){
SalomeApp_Tools::QtCatchCorbaException(S_ex);
}
}
}
}
}
else if(nbSel==0) {
SUIT_MessageBox::warn1(desktop(),
tr("SMESH_WRN_WARNING"),
tr("SMESH_WRN_NO_AVAILABLE_DATA"),
tr("SMESH_BUT_OK"));
}
break;
}
@ -2214,7 +2362,7 @@ void SMESHGUI::initialize( CAM_Application* app )
createSMESHAction( 4051, "RENUM_NODES", "ICON_DLG_RENUMBERING_NODES" );
createSMESHAction( 4052, "RENUM_ELEMENTS", "ICON_DLG_RENUMBERING_ELEMENTS" );
createSMESHAction( 4061, "TRANS", "ICON_SMESH_TRANSLATION_VECTOR" );
createSMESHAction( 4062, "ROT", "ICON_DLG_ROTATION" );
createSMESHAction( 4062, "ROT", "ICON_DLG_MESH_ROTATION" );
createSMESHAction( 4063, "SYM", "ICON_SMESH_SYMMETRY_PLANE" );
createSMESHAction( 4064, "SEW", "ICON_SMESH_SEWING_FREEBORDERS" );
createSMESHAction( 4065, "MERGE", "ICON_SMESH_MERGE_NODES" );
@ -2905,9 +3053,9 @@ void SMESHGUI::createPreferences()
int fontGr = addPreference( tr( "SMESH_FONT_SCALARBAR" ), sbarTab );
int tfont = addPreference( tr( "SMESH_TITLE" ), fontGr, LightApp_Preferences::Font, "SMESH", "scalar_bar_title_font" );
addPreference( tr( "SMESH_TITLE" ), fontGr, LightApp_Preferences::Color, "SMESH", "scalar_bar_title_color" );
addPreference( tr( "PREF_TITLE_COLOR" ), fontGr, LightApp_Preferences::Color, "SMESH", "scalar_bar_title_color" );
int lfont = addPreference( tr( "SMESH_LABELS" ), fontGr, LightApp_Preferences::Font, "SMESH", "scalar_bar_label_font" );
addPreference( tr( "SMESH_LABELS" ), fontGr, LightApp_Preferences::Color, "SMESH", "scalar_bar_label_color" );
addPreference( tr( "PREF_LABELS_COLOR" ), fontGr, LightApp_Preferences::Color, "SMESH", "scalar_bar_label_color" );
QStringList fam;
fam.append( tr( "SMESH_FONT_ARIAL" ) );
@ -3015,8 +3163,8 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_width", sbW);
if(sbX1+sbW > aTol){
aWarning = "Origin and Size Horizontal: X+Width > 1\n";
sbX1=0.2;
sbW=0.6;
sbX1=0.01;
sbW=0.05;
aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_x", sbX1);
aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_width", sbW);
}
@ -3027,7 +3175,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
if(sbY1+sbH > aTol){
aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
sbY1=0.01;
sbH=0.12;
sbH=0.05;
aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_y", sbY1);
aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_height",sbH);
}
@ -3148,131 +3296,3 @@ LightApp_Displayer* SMESHGUI::displayer()
return myDisplayer;
}
void SMESHGUI::OnEditDelete()
{
// VSR 17/11/04: check if all objects selected belong to SMESH component --> start
LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
SALOME_ListIO selected; aSel->selectedObjects( selected, QString::null, false );
QString aParentComponent = QString::null;
for( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() )
{
QString cur = anIt.Value()->getComponentDataType();
if( aParentComponent.isNull() )
aParentComponent = cur;
else if( !aParentComponent.isEmpty() && aParentComponent!=cur )
aParentComponent = "";
}
if ( aParentComponent != SMESHGUI::GetSMESHGUI()->name() ) {
SUIT_MessageBox::warn1 ( SMESHGUI::desktop(),
QObject::tr("ERR_ERROR"),
QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ),
QObject::tr("BUT_OK") );
return;
}
// VSR 17/11/04: check if all objects selected belong to SMESH component <-- finish
if (SUIT_MessageBox::warn2
(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_REALLY_DELETE"),
QObject::tr("SMESH_BUT_YES"), QObject::tr("SMESH_BUT_NO"), 1, 0, 0) != 1)
return;
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
SUIT_ViewManager* vm = anApp->activeViewManager();
int nbSf = vm->getViewsCount();
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
_PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
_PTR(GenericAttribute) anAttr;
_PTR(AttributeIOR) anIOR;
SALOME_ListIteratorOfListIO It(selected);
aStudyBuilder->NewCommand(); // There is a transaction
for(; It.More(); It.Next()){ // loop on selected IO's
Handle(SALOME_InteractiveObject) IObject = It.Value();
if(IObject->hasEntry()) {
_PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry());
// disable removal of "SMESH" component object
if(aSO->FindAttribute(anAttr, "AttributeIOR")){
anIOR = anAttr;
if ( !strcmp( (char*)anIOR->Value().c_str(), engineIOR().latin1() ) )
continue;
}
// put the whole hierarchy of sub-objects of the selected SO into a list and
// then treat them all starting from the deepest objects (at list back)
list< _PTR(SObject) > listSO;
listSO.push_back( aSO );
list< _PTR(SObject) >::iterator itSO = listSO.begin();
for ( ; itSO != listSO.end(); ++itSO ) {
_PTR(ChildIterator) it = aStudy->NewChildIterator( *itSO );
for (it->InitEx(false); it->More(); it->Next())
listSO.push_back( it->Value() );
}
// treat SO's in the list starting from the back
list< _PTR(SObject) >::reverse_iterator ritSO = listSO.rbegin();
for ( ; ritSO != listSO.rend(); ++ritSO ) {
_PTR(SObject) SO = *ritSO;
if ( !SO ) continue;
string anEntry = SO->GetID();
/** Erase graphical object **/
if(SO->FindAttribute(anAttr, "AttributeIOR")){
QPtrVector<SUIT_ViewWindow> aViews = vm->getViews();
for(int i = 0; i < nbSf; i++){
SUIT_ViewWindow *sf = aViews[i];
if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){
SMESH::RemoveActor(sf,anActor);
}
}
}
/** Remove an object from data structures **/
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO ));
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( SO ));
if ( !aGroup->_is_nil() ) { // DELETE GROUP
SMESH::SMESH_Mesh_var aMesh = aGroup->GetMesh();
aMesh->RemoveGroup( aGroup );
}
else if ( !aSubMesh->_is_nil() ) { // DELETE SUBMESH
SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
aMesh->RemoveSubMesh( aSubMesh );
_PTR(SObject) aMeshSO = SMESH::FindSObject(aMesh);
if (aMeshSO)
SMESH::ModifiedMesh(aMeshSO, false);
}
else {
IObject = new SALOME_InteractiveObject
( anEntry.c_str(), engineIOR().latin1(), SO->GetName().c_str() );
QString objType = CheckTypeObject(IObject);
if ( objType == "Hypothesis" || objType == "Algorithm" ) {// DELETE HYPOTHESIS
SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
aStudyBuilder->RemoveObjectWithChildren( SO );
}
else {// default action: remove SObject from the study
// san - it's no use opening a transaction here until UNDO/REDO is provided in SMESH
//SUIT_Operation *op = new SALOMEGUI_ImportOperation(myActiveStudy);
//op->start();
aStudyBuilder->RemoveObjectWithChildren( SO );
//op->finish();
}
}
} /* listSO back loop */
} /* IObject->hasEntry() */
} /* more/next */
aStudyBuilder->CommitCommand();
/* Clear any previous selection */
SALOME_ListIO l1;
aSel->setSelectedObjects( l1 );
SMESHGUI::GetSMESHGUI()->updateObjBrowser();
}

View File

@ -803,3 +803,20 @@ void SMESHGUI_AddMeshElementDlg::CheckBox (int state)
displaySimulation();
}
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_AddMeshElementDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
ClickOnHelp();
}
}

View File

@ -84,6 +84,7 @@ private:
void closeEvent (QCloseEvent*);
void hideEvent (QHideEvent*); /* ESC key */
void enterEvent (QEvent*); /* mouse enter the QWidget */
void keyPressEvent(QKeyEvent*);
void displaySimulation();
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */

View File

@ -1105,3 +1105,20 @@ QWidget* SMESHGUI_IdEditItem::createEditor() const
aLineEdit->setValidator( new SMESHGUI_IdValidator(table()->viewport(), "validator", 1) );
return aLineEdit;
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_AddQuadraticElementDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
ClickOnHelp();
}
}

View File

@ -67,6 +67,7 @@ private:
void closeEvent (QCloseEvent*);
void hideEvent (QHideEvent*); /* ESC key */
void enterEvent (QEvent*); /* mouse enter the QWidget */
void keyPressEvent(QKeyEvent*);
void displaySimulation();
void UpdateTable( bool theConersValidity = true );
bool IsValid();

View File

@ -775,3 +775,20 @@ void SMESHGUI_ClippingDlg::OnPreviewToggle (bool theIsToggled)
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(theIsToggled));
SMESH::RenderViewWindow(SMESH::GetCurrentVtkView());
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_ClippingDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
ClickOnHelp();
}
}

View File

@ -87,6 +87,8 @@ public:
void setRotation (const double theRot1, const double theRot2);
void Sinchronize();
void keyPressEvent(QKeyEvent*);
~SMESHGUI_ClippingDlg();
private:

View File

@ -93,6 +93,8 @@ void SMESHGUI_ConvToQuadOp::startOperation()
}
connect( myDlg, SIGNAL( onClicked( int ) ), SLOT( ConnectRadioButtons( int ) ) );
myHelpFileName = "/files/convert_to_from_quadratic.htm";
SMESHGUI_SelectionOp::startOperation();
myDlg->SetMediumNdsOnGeom( false );

View File

@ -750,3 +750,20 @@ void SMESHGUI_CreatePatternDlg::onTypeChanged (int theType)
else
myPicture2d->hide();
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_CreatePatternDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
onHelp();
}
}

View File

@ -86,6 +86,7 @@ private:
void closeEvent (QCloseEvent* e);
void enterEvent (QEvent*);
void keyPressEvent(QKeyEvent*);
private slots:

View File

@ -324,7 +324,7 @@ SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI
mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_polyhedrons?";
myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_polyhedrons";
Init();
}
@ -1104,3 +1104,20 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onListSelectionChanged()
busy = false;
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_CreatePolyhedralVolumeDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
ClickOnHelp();
}
}

View File

@ -75,6 +75,7 @@ private:
void closeEvent( QCloseEvent* e ) ;
void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
void hideEvent ( QHideEvent * ); /* ESC key */
void keyPressEvent( QKeyEvent* e );
int GetConstructorId();
void displaySimulation();

View File

@ -331,3 +331,20 @@ void SMESHGUI_DeleteGroupDlg::closeEvent (QCloseEvent*)
{
onClose();
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_DeleteGroupDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
onHelp();
}
}

View File

@ -63,6 +63,7 @@ private:
void closeEvent (QCloseEvent*);
void enterEvent (QEvent*);
void keyPressEvent(QKeyEvent*);
private slots:

View File

@ -369,3 +369,21 @@ void SMESHGUI_EditMeshDlg::hideEvent (QHideEvent * e)
if (!isMinimized())
ClickOnCancel();
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_EditMeshDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
ClickOnHelp();
}
}

View File

@ -64,6 +64,7 @@ class SMESHGUI_EXPORT SMESHGUI_EditMeshDlg : public QDialog
void closeEvent (QCloseEvent*);
void enterEvent (QEvent*); /* mouse enter the QWidget */
void hideEvent (QHideEvent*); /* ESC key */
void keyPressEvent(QKeyEvent*);
private:
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */

View File

@ -317,10 +317,10 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
/***************************************************************/
// Initialisations
XSpin->RangeStepAndValidator(-999999.999, +999999.999, 10.0, 3);
YSpin->RangeStepAndValidator(-999999.999, +999999.999, 10.0, 3);
ZSpin->RangeStepAndValidator(-999999.999, +999999.999, 10.0, 3);
AngleSpin->RangeStepAndValidator(-999999.999, +999999.999, 5.0, 3);
XSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
YSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
ZSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
AngleSpin->RangeStepAndValidator(-180.0, 180.0, 5.0, 3);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
@ -684,7 +684,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::ClickOnHelp()
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
QObject::tr("BUT_OK"));
}
}
}
//=================================================================================
@ -1202,3 +1202,20 @@ bool SMESHGUI_ExtrusionAlongPathDlg::eventFilter (QObject* object, QEvent* event
}
return QDialog::eventFilter(object, event);
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_ExtrusionAlongPathDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
ClickOnHelp();
}
}

View File

@ -85,6 +85,7 @@ public:
private:
void Init (bool ResetControls = true);
void enterEvent (QEvent*); /* mouse enter the QWidget */
void keyPressEvent(QKeyEvent*);
int GetConstructorId();
void SetEditCurrentArgument (QToolButton* button);

View File

@ -227,9 +227,9 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule,
SMESHGUI_ExtrusionDlgLayout->addWidget(GroupArguments, 1, 0);
/* Initialisations */
SpinBox_Dx->RangeStepAndValidator(-999999.999, +999999.999, 10.0, 3);
SpinBox_Dy->RangeStepAndValidator(-999999.999, +999999.999, 10.0, 3);
SpinBox_Dz->RangeStepAndValidator(-999999.999, +999999.999, 10.0, 3);
SpinBox_Dx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
SpinBox_Dy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
SpinBox_Dz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
QIntValidator* anIntValidator = new QIntValidator(SpinBox_NbSteps);
SpinBox_NbSteps->setValidator(anIntValidator);
@ -796,3 +796,20 @@ int SMESHGUI_ExtrusionDlg::GetConstructorId()
return GroupConstructors->id(GroupConstructors->selected());
return -1;
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_ExtrusionDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
ClickOnHelp();
}
}

View File

@ -73,6 +73,7 @@ public:
private:
void Init (bool ResetControls = true);
void enterEvent (QEvent*); /* mouse enter the QWidget */
void keyPressEvent(QKeyEvent*);
int GetConstructorId();
//void closeEvent (QCloseEvent*);
//void hideEvent (QHideEvent*); /* ESC key */

View File

@ -833,10 +833,13 @@ void SMESHGUI_FilterTable::SetCriterion (const int theRow,
aTable->SetEditable(false, theRow, 4);
if (theCriterion.Type != FT_RangeOfIds &&
theCriterion.Type != FT_BelongToGeom &&
theCriterion.Type != FT_BelongToPlane &&
theCriterion.Type != FT_BelongToCylinder &&
theCriterion.Type != FT_LyingOnGeom)
theCriterion.Type != FT_BelongToGeom &&
theCriterion.Type != FT_BelongToPlane &&
theCriterion.Type != FT_BelongToCylinder &&
theCriterion.Type != FT_LyingOnGeom &&
theCriterion.Type != FT_FreeBorders &&
theCriterion.Type != FT_FreeEdges &&
theCriterion.Type != FT_BadOrientedVolume)
aTable->setText(theRow, 2, QString("%1").arg(theCriterion.Threshold, 0, 'g', 15));
else
{
@ -2292,9 +2295,11 @@ void SMESHGUI_FilterDlg::insertFilterInViewer()
myFilter[ myTable->GetType() ]->GetPredicate()->_is_nil() ||
!mySetInViewer->isChecked()) {
SMESH::RemoveFilter(getFilterId(anEntType), aSelector);
} else {
}
else {
Handle(SMESHGUI_PredicateFilter) aFilter = new SMESHGUI_PredicateFilter();
aFilter->SetPredicate(myFilter[ myTable->GetType() ]->GetPredicate());
SMESH::RemoveFilter(getFilterId(anEntType), aSelector); //skl for IPAL12631
SMESH::SetFilter(aFilter, aSelector);
}
}
@ -2591,3 +2596,21 @@ void SMESHGUI_FilterDlg::updateSelection()
}
}
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_FilterDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
onHelp();
}
}

View File

@ -265,6 +265,7 @@ private:
void closeEvent (QCloseEvent*);
void enterEvent (QEvent*);
void keyPressEvent(QKeyEvent*);
// dialog creation
QFrame* createButtonFrame (QWidget*);

View File

@ -1157,3 +1157,20 @@ void SMESHGUI_FilterLibraryDlg::onNeedValidation()
}
}
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_FilterLibraryDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
onHelp();
}
}

View File

@ -90,6 +90,7 @@ private:
void closeEvent( QCloseEvent* e ) ;
void enterEvent ( QEvent * ) ;
void keyPressEvent( QKeyEvent* e );
private slots:

View File

@ -1605,3 +1605,20 @@ void SMESHGUI_GroupDlg::hideEvent (QHideEvent*)
if (!isMinimized())
onClose();
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_GroupDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
onHelp();
}
}

View File

@ -116,6 +116,7 @@ private:
void closeEvent(QCloseEvent* e);
void enterEvent (QEvent*);
void hideEvent (QHideEvent*); /* ESC key */
void keyPressEvent(QKeyEvent*);
void setSelectionMode(int theMode);
void updateButtons();

View File

@ -418,3 +418,20 @@ void SMESHGUI_GroupOpDlg::reset()
myFocusWg = myEdit1;
myNameEdit->setFocus();
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_GroupOpDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
onHelp();
}
}

View File

@ -66,6 +66,7 @@ private:
void closeEvent( QCloseEvent* e ) ;
void enterEvent ( QEvent * ) ;
void keyPressEvent(QKeyEvent*);
private slots:

View File

@ -246,7 +246,7 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char*
SMESHGUI_MergeNodesDlgLayout->addWidget(GroupEdit, 3, 0);
/* Initialisations */
SpinBoxTolerance->RangeStepAndValidator(0.0, 999999.999, 0.1, 3);
SpinBoxTolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.1, 3);
SpinBoxTolerance->SetValue(1e-05);
RadioButton1->setChecked(TRUE);
@ -733,3 +733,20 @@ void SMESHGUI_MergeNodesDlg::hideEvent (QHideEvent*)
if (!isMinimized())
ClickOnCancel();
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_MergeNodesDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
ClickOnHelp();
}
}

View File

@ -81,6 +81,7 @@ private:
void closeEvent( QCloseEvent* e );
void enterEvent ( QEvent * ); /* mouse enter the QWidget */
void hideEvent ( QHideEvent * ); /* ESC key */
void keyPressEvent( QKeyEvent* e );
void onEditNodesGroup();
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */

View File

@ -644,3 +644,20 @@ void SMESHGUI_MeshInfosDlg::onHelp()
QObject::tr("BUT_OK"));
}
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_MeshInfosDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
onHelp();
}
}

View File

@ -55,6 +55,7 @@ public:
protected:
void closeEvent( QCloseEvent* e );
void keyPressEvent( QKeyEvent* e );
void windowActivationChange( bool oldActive );
void DumpMeshInfos();

View File

@ -852,6 +852,10 @@ void SMESHGUI_MeshOp::createHypothesis (const int theDim,
const int theType,
const QString& theTypeName)
{
// During a hypothesis creation we might need to select some objects.
// Main dialog must not update it's own selected objects in this case.
dlg()->deactivateAll();
HypothesisData* aData = SMESH::GetHypothesisData(theTypeName.latin1());
if (!aData)
return;
@ -1011,23 +1015,16 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex,
// set new available algoritms
availableHyps( dim, Algo, anAvailable, myAvailableHypData[dim][Algo], prevAlgo );
HypothesisData* soleCompatible = 0;
// bug SWP13024 need save following state
bool onlyOne = ( anAvailable.count() == 1 );
if ( onlyOne )
if ( anAvailable.count() == 1 )
soleCompatible = myAvailableHypData[dim][Algo][0];
if ( dim == aTopDim && prevAlgo ) // all available algoritms should be selectable any way
{
availableHyps( dim, Algo, anAvailable, myAvailableHypData[dim][Algo], 0 );
if ( onlyOne )
soleCompatible = 0;
}
myDlg->tab( dim )->setAvailableHyps( Algo, anAvailable );
noCompatible = anAvailable.isEmpty();
// restore previously selected algo
algoIndex = myAvailableHypData[dim][Algo].findIndex( curAlgo );
if ( !isSubmesh && algoIndex < 0 && soleCompatible )
if ( !isSubmesh && algoIndex < 0 && soleCompatible && !forward )
// select the sole compatible algo
algoIndex = myAvailableHypData[dim][Algo].findIndex( soleCompatible );
setCurrentHyp( dim, Algo, algoIndex );
@ -1179,44 +1176,51 @@ bool SMESHGUI_MeshOp::createMesh( QString& theMess )
{
theMess = "";
QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
_PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.latin1() );
GEOM::GEOM_Object_var aGeomVar =
GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
//QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
//QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
if ( aSMESHGen->_is_nil() )
return false;
QStringList aList;
myDlg->selectedObject( SMESHGUI_MeshDlg::Geom, aList );
QStringList::Iterator it = aList.begin();
for(; it!=aList.end(); it++) {
SUIT_OverrideCursor aWaitCursor;
QString aGeomEntry = *it;
_PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.latin1() );
GEOM::GEOM_Object_var aGeomVar =
GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
// create mesh
SMESH::SMESH_Mesh_var aMeshVar = aSMESHGen->CreateMesh( aGeomVar );
if ( aMeshVar->_is_nil() )
return false;
_PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshVar.in() );
if ( aMeshSO )
SMESH::SetName( aMeshSO, myDlg->objectText( SMESHGUI_MeshDlg::Obj ).latin1() );
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
if ( aSMESHGen->_is_nil() )
return false;
for ( int aDim = SMESH::DIM_1D; aDim <= SMESH::DIM_3D; aDim++ )
{
if ( !isAccessibleDim( aDim )) continue;
SUIT_OverrideCursor aWaitCursor;
// assign hypotheses
for ( int aHypType = MainHyp; aHypType <= AddHyp; aHypType++ )
{
int aHypIndex = currentHyp( aDim, aHypType );
if ( aHypIndex >= 0 && aHypIndex < myExistingHyps[ aDim ][ aHypType ].count() )
{
SMESH::SMESH_Hypothesis_var aHypVar = myExistingHyps[ aDim ][ aHypType ][ aHypIndex ];
if ( !aHypVar->_is_nil() )
SMESH::AddHypothesisOnMesh( aMeshVar, aHypVar );
// create mesh
SMESH::SMESH_Mesh_var aMeshVar = aSMESHGen->CreateMesh( aGeomVar );
if ( aMeshVar->_is_nil() )
return false;
_PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshVar.in() );
if ( aMeshSO )
SMESH::SetName( aMeshSO, myDlg->objectText( SMESHGUI_MeshDlg::Obj ).latin1() );
for ( int aDim = SMESH::DIM_1D; aDim <= SMESH::DIM_3D; aDim++ ) {
if ( !isAccessibleDim( aDim )) continue;
// assign hypotheses
for ( int aHypType = MainHyp; aHypType <= AddHyp; aHypType++ ) {
int aHypIndex = currentHyp( aDim, aHypType );
if ( aHypIndex >= 0 && aHypIndex < myExistingHyps[ aDim ][ aHypType ].count() ) {
SMESH::SMESH_Hypothesis_var aHypVar = myExistingHyps[ aDim ][ aHypType ][ aHypIndex ];
if ( !aHypVar->_is_nil() )
SMESH::AddHypothesisOnMesh( aMeshVar, aHypVar );
}
}
// find or create algorithm
SMESH::SMESH_Hypothesis_var anAlgoVar = getAlgo( aDim );
if ( !anAlgoVar->_is_nil() )
SMESH::AddHypothesisOnMesh( aMeshVar, anAlgoVar );
}
// find or create algorithm
SMESH::SMESH_Hypothesis_var anAlgoVar = getAlgo( aDim );
if ( !anAlgoVar->_is_nil() )
SMESH::AddHypothesisOnMesh( aMeshVar, anAlgoVar );
}
return true;
}

View File

@ -383,6 +383,13 @@ bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
return false;
}
if ( myName->text()=="" ) {
if (theMess)
QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
tr("SMESHGUI_INVALID_PARAMETERS"), QMessageBox::Ok);
return false;
}
return true;
}
@ -1367,3 +1374,20 @@ int SMESHGUI_MeshPatternDlg::getNode (bool second) const
{
return second ? myNode2->value() - 1 : myNode1->value() - 1;
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_MeshPatternDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
onHelp();
}
}

View File

@ -116,6 +116,7 @@ private:
QString autoExtension( const QString& theFileName ) const;
void closeEvent( QCloseEvent* e ) ;
void enterEvent ( QEvent * ) ;
void keyPressEvent(QKeyEvent*);
bool isValid( const bool theMess = true );
void resetSelInput();
bool isRefine() const;

View File

@ -185,9 +185,9 @@ QFrame* SMESHGUI_MoveNodesDlg::createMainFrame (QWidget* theParent)
new QLabel(tr("SMESH_Z"), aCoordGrp);
myZ = new SMESHGUI_SpinBox(aCoordGrp);
myX->RangeStepAndValidator(-999999.999, +999999.999, 25.0, 3);
myY->RangeStepAndValidator(-999999.999, +999999.999, 25.0, 3);
myZ->RangeStepAndValidator(-999999.999, +999999.999, 25.0, 3);
myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, 3);
myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, 3);
myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, 3);
QVBoxLayout* aLay = new QVBoxLayout(aFrame);
aLay->addWidget(aPixGrp);
@ -592,3 +592,20 @@ void SMESHGUI_MoveNodesDlg::redisplayPreview()
aViewWindow->Repaint();
}
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_MoveNodesDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
onHelp();
}
}

View File

@ -81,6 +81,7 @@ private:
void closeEvent( QCloseEvent* e ) ;
void enterEvent ( QEvent * ) ;
void hideEvent ( QHideEvent * );
void keyPressEvent( QKeyEvent* );
void erasePreview();
QFrame* createButtonFrame( QWidget* );
QFrame* createMainFrame ( QWidget* );

View File

@ -1052,6 +1052,23 @@ int SMESHGUI_MultiEditDlg::entityType()
return myEntityType;
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void SMESHGUI_MultiEditDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
onHelp();
}
}
/*!
* Class : SMESHGUI_ChangeOrientationDlg
* Description : Modification of orientation of faces

View File

@ -110,6 +110,7 @@ protected:
void closeEvent( QCloseEvent* e ) ;
void enterEvent ( QEvent * ) ;
void hideEvent ( QHideEvent * ); /* ESC key */
void keyPressEvent( QKeyEvent* );
QFrame* createButtonFrame( QWidget* );
QFrame* createMainFrame ( QWidget*, const bool );
bool isValid( const bool ) const;

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