First stable version after merging with V3_2_2

This commit is contained in:
abd 2006-10-19 06:49:48 +00:00
parent 5c0bf61bcf
commit 98ce5736d1
201 changed files with 7934 additions and 4830 deletions

View File

@ -63,6 +63,7 @@ chamfer.png \
chamferall.png \ chamferall.png \
chamferedge.png \ chamferedge.png \
chamferface.png \ chamferface.png \
change_orientation.png \
check.png \ check.png \
circle.png \ circle.png \
circlepointvector.png \ circlepointvector.png \
@ -122,6 +123,7 @@ point2.png \
pointonedge.png \ pointonedge.png \
polyline.png \ polyline.png \
prism.png \ prism.png \
prism2.png \
revol.png \ revol.png \
rotate.png \ rotate.png \
scale.png \ scale.png \

View File

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

View File

@ -23,11 +23,15 @@ AC_CANONICAL_HOST
PACKAGE=salome PACKAGE=salome
AC_SUBST(PACKAGE) AC_SUBST(PACKAGE)
VERSION=3.2.0 VERSION=3.2.2
XVERSION=0x030200 XVERSION=0x030202
AC_SUBST(VERSION) AC_SUBST(VERSION)
AC_SUBST(XVERSION) AC_SUBST(XVERSION)
# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
MODULE_NAME=geom
AC_SUBST(MODULE_NAME)
dnl dnl
dnl Initialize source and build root directories dnl Initialize source and build root directories
dnl dnl
@ -325,7 +329,7 @@ else
fi fi
# make other build directories # 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 do
# if test ! -d $rep ; then # if test ! -d $rep ; then
# eval mkdir $rep # eval mkdir $rep

View File

@ -15,6 +15,7 @@ if (navigator.appName !="Netscape")
<style type="text/css"> <style type="text/css">
<!-- <!--
p.whs1 { font-family:'Lucida Console' , monospace; } p.whs1 { font-family:'Lucida Console' , monospace; }
p.whs2 { font-family:'Times New Roman' , serif; }
--> -->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript"> </style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!-- <!--
@ -79,15 +80,18 @@ if (window.writeIntopicBar)
<h3><a name=bookmark4>Multi Transformation</a></h3> <h3><a name=bookmark4>Multi Transformation</a></h3>
<p class="whs1">import geompy</p> <p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import
geompy</span></p>
<p class="whs1">import salome</p> <p class="whs1">import salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p> <p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># create vertices</p> <p class="whs2"># create vertices</p>
<p class="whs1">p_25_25_50 = geompy.MakeVertex(25., <p class="whs1">p_25_25_50 = geompy.MakeVertex(25.,
25., 50.)</p> 25., 50.)</p>
@ -98,9 +102,13 @@ if (window.writeIntopicBar)
<p class="whs1">p_25_50_25 = geompy.MakeVertex(25., <p class="whs1">p_25_50_25 = geompy.MakeVertex(25.,
50., 25.)</p> 50., 25.)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">box = geompy.MakeBoxDXDYDZ(50, <p class="whs1">box = geompy.MakeBoxDXDYDZ(50,
50, 50)</p> 50, 50)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">top_face = geompy.GetFaceNearPoint(box, <p class="whs1">top_face = geompy.GetFaceNearPoint(box,
p_25_25_50)</p> p_25_25_50)</p>
@ -110,18 +118,21 @@ if (window.writeIntopicBar)
<p class="whs1">xz_face = geompy.GetFaceNearPoint(box, <p class="whs1">xz_face = geompy.GetFaceNearPoint(box,
p_25_50_25)</p> p_25_50_25)</p>
<p class="whs1">top_face_ind = geompy.LocalOp.GetSubShapeIndex(box, <p class="whs1">&nbsp;</p>
<p class="whs1">top_face_ind = geompy.GetSubShapeID(box,
top_face)</p> top_face)</p>
<p class="whs1">yz_face_ind = geompy.LocalOp.GetSubShapeIndex(box, <p class="whs1">yz_face_ind = geompy.GetSubShapeID(box,
yz_face)</p> yz_face)</p>
<p class="whs1">xz_face_ind = geompy.LocalOp.GetSubShapeIndex(box, <p class="whs1">xz_face_ind = geompy.GetSubShapeID(box,
xz_face)</p> xz_face)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># Multi-transformate block and glue the result</p> <p class="whs2"># Multi-transformate
block and glue the result</p>
<p class="whs1">box_tr1 = geompy.MakeMultiTransformation1D(box, <p class="whs1">box_tr1 = geompy.MakeMultiTransformation1D(box,
yz_face_ind, top_face_ind, 3)</p> yz_face_ind, top_face_ind, 3)</p>
@ -129,9 +140,10 @@ if (window.writeIntopicBar)
<p class="whs1">box_tr2 = geompy.MakeMultiTransformation2D(box, <p class="whs1">box_tr2 = geompy.MakeMultiTransformation2D(box,
xz_face_ind, yz_face_ind, 3, top_face_ind, 0, 2)</p> xz_face_ind, yz_face_ind, 3, top_face_ind, 0, 2)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># add objects in the study</p> <p class="whs2"># add objects in the
study</p>
<p class="whs1">id_box = geompy.addToStudy(box, <p class="whs1">id_box = geompy.addToStudy(box,
&quot;Box&quot;)</p> &quot;Box&quot;)</p>
@ -142,9 +154,9 @@ if (window.writeIntopicBar)
<p class="whs1">id_box_tr2 = geompy.addToStudy(box_tr2, <p class="whs1">id_box_tr2 = geompy.addToStudy(box_tr2,
&quot;Multi-transformed Block 2D&quot;)</p> &quot;Multi-transformed Block 2D&quot;)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># display the results</p> <p class="whs2"># display the results</p>
<p class="whs1">gg.createAndDisplayGO(id_box)</p> <p class="whs1">gg.createAndDisplayGO(id_box)</p>
@ -152,10 +164,10 @@ if (window.writeIntopicBar)
<p class="whs1">gg.createAndDisplayGO(id_box_tr1)</p> <p class="whs1">gg.createAndDisplayGO(id_box_tr1)</p>
<p><span style="font-family: 'Lucida Console', monospace;">gg.createAndDisplayGO(id_box_tr2)</span> <p class="whs1">gg.createAndDisplayGO(id_box_tr2)
</p> </p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<h3><a name=bookmark5>Explode on Blocks</a></h3> <h3><a name=bookmark5>Explode on Blocks</a></h3>
@ -163,11 +175,14 @@ if (window.writeIntopicBar)
<p class="whs1">import salome</p> <p class="whs1">import salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p> <p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># create a box and a sphere</p> <p class="whs2"># create a box and a
sphere</p>
<p class="whs1">box = geompy.MakeBoxDXDYDZ(200, <p class="whs1">box = geompy.MakeBoxDXDYDZ(200,
200, 200)</p> 200, 200)</p>
@ -176,31 +191,38 @@ if (window.writeIntopicBar)
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># make a compound</p> <p class="whs2"># make a compound</p>
<p class="whs1">compound = geompy.MakeCompound([box, <p class="whs1">compound = geompy.MakeCompound([box,
sphere])</p> sphere])</p>
<p>&nbsp;</p> <p class="whs2">&nbsp;</p>
<p># get all the blocks, contained in the given compound</p> <p class="whs2"># get all the blocks
of the given compound, by criteria: min_nb_faces &lt;= nb. of faces &lt;=
max_nb_faces</p>
<p class="whs1">min_nb_faces = 6</p>
<p class="whs1">max_nb_faces = 6</p>
<p class="whs1">make_block_explode <p class="whs1">make_block_explode
= geompy.MakeBlockExplode(compound, 1, 1)</p> = geompy.MakeBlockExplode(compound, min_nb_faces, max_nb_faces)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># add objects in the study</p> <p class="whs2"># add objects in the
study</p>
<p class="whs1">id_compound = geompy.addToStudy(compound, <p class="whs1">id_compound = geompy.addToStudy(compound,
&quot;Compound&quot;)</p> &quot;Compound&quot;)</p>
<p class="whs1">id_make_block_explode <p class="whs1">id_make_block_explode
= geompy.addToStudy(make_block_explode[0], &quot;MakeBlockExplode&quot;)</p> = geompy.addToStudyInFather(compound, make_block_explode[0], &quot;MakeBlockExplode&quot;)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># display the results</p> <p class="whs2"># display the results</p>
<p class="whs1">gg.createAndDisplayGO(id_compound)</p> <p class="whs1">gg.createAndDisplayGO(id_compound)</p>
@ -217,42 +239,45 @@ if (window.writeIntopicBar)
<p class="whs1">import salome</p> <p class="whs1">import salome</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># create a box and a sphere</p> <p class="whs2"># create a box</p>
<p class="whs1">box = geompy.MakeBoxDXDYDZ(200, <p class="whs1">box = geompy.MakeBoxDXDYDZ(200,
200, 200)</p> 200, 200)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># check and improve</p> <p class="whs2"># build all possible
propagation groups</p>
<p class="whs1">check_box = geompy.CheckAndImprove(box)</p>
<p>&nbsp;&nbsp;</p>
<p># build all possible propagation groups</p>
<p class="whs1">listChains = geompy.Propagate(check_box)</p> <p class="whs1">listChains = geompy.Propagate(check_box)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># add objects in the study</p> <p class="whs2"># add objects in the
study</p>
<p class="whs1">geompy.addToStudy(check_box, <p class="whs1">geompy.addToStudy(check_box,
&quot;Box&quot;)</p> &quot;Box&quot;)</p>
<p class="whs1">ii = 1</p>
<p class="whs1">for chain in listChains:</p> <p class="whs1">for chain in listChains:</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;geompy.addToStudyInFather(check_box, <p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;geompy.addToStudyInFather(check_box,
chain, &quot;propagation chain&quot;)</p> chain, &quot;propagation chain &quot; + `ii`)</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;ii
= ii + 1</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;pass</p>
<p>&nbsp;</p>
<p><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> <p><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span>
</p> </p>
<p>&nbsp;</p>
<script type="text/javascript" language="javascript1.2"> <script type="text/javascript" language="javascript1.2">
<!-- <!--
if (window.writeIntopicBar) if (window.writeIntopicBar)

View File

@ -104,8 +104,9 @@ if (window.writeIntopicBar)
<p>&nbsp;</p> <p>&nbsp;</p>
<p>Firstly, you can define a <span style="font-weight: bold;"><B>Box</B></span> <p>Firstly, you can define a <span style="font-weight: bold;"><B>Box</B></span>
by two specified <span style="font-weight: bold;"><B>Vertices (</B></span>its by two specified <span style="font-weight: bold;"><B>Vertices </B></span>(its
opposite corners), and with edges, parallel to the coordinate axes. </p> opposite corners). The edges of the box will be parallel to the coordinate
axes.</p>
<p><span style="font-weight: bold;"><B><b style="font-weight: bold;">TUI Command <p><span style="font-weight: bold;"><B><b style="font-weight: bold;">TUI Command
:</b> </B></span><span style="font-style: italic;"><I>geompy.MakeBoxTwoPnt(Point1, :</b> </B></span><span style="font-style: italic;"><I>geompy.MakeBoxTwoPnt(Point1,

View File

@ -15,6 +15,7 @@ if (navigator.appName !="Netscape")
<style type="text/css"> <style type="text/css">
<!-- <!--
p.whs1 { font-family:'Lucida Console' , monospace; } p.whs1 { font-family:'Lucida Console' , monospace; }
p.whs2 { font-family:'Times New Roman' , serif; }
--> -->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript"> </style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!-- <!--
@ -200,8 +201,6 @@ if (window.writeIntopicBar)
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_qface3,1)</span> <p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_qface3,1)</span>
</p> </p>
<p>&nbsp;</p>
<h3>Hexagonal Solid</h3> <h3>Hexagonal Solid</h3>
<p class="whs1">import geompy</p> <p class="whs1">import geompy</p>
@ -210,120 +209,141 @@ if (window.writeIntopicBar)
<p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p> <p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># create vertices</p> <p class="whs2"># create vertices</p>
<p class="whs1">p1 = geompy.MakeVertex( <p class="whs1">p0 &nbsp;=
&nbsp;0., &nbsp;&nbsp;0., geompy.MakeVertex( &nbsp;0.,
&nbsp;&nbsp;0.,
&nbsp;&nbsp;0.)</p> &nbsp;&nbsp;0.)</p>
<p class="whs1">p2 = geompy.MakeVertex(150., <p class="whs1">p1 &nbsp;=
&nbsp;30., &nbsp;&nbsp;0.)</p> geompy.MakeVertex( &nbsp;0.,
&nbsp;&nbsp;0.,
&nbsp;40.)</p>
<p class="whs1">p3 = geompy.MakeVertex( <p class="whs1">p2 &nbsp;=
&nbsp;0., 120., geompy.MakeVertex( 70., -15., &nbsp;&nbsp;0.)</p>
&nbsp;50.)</p>
<p class="whs1">p4 = geompy.MakeVertex( <p class="whs1">p3 &nbsp;=
&nbsp;0., &nbsp;40., geompy.MakeVertex( 70., -15., &nbsp;70.)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">p4 &nbsp;=
geompy.MakeVertex( &nbsp;0.,
&nbsp;70., &nbsp;&nbsp;0.)</p>
<p class="whs1">p5 &nbsp;=
geompy.MakeVertex( &nbsp;0.,
&nbsp;70., &nbsp;40.)</p>
<p class="whs1">p6 &nbsp;=
geompy.MakeVertex( 70., &nbsp;70.,
&nbsp;&nbsp;0.)</p>
<p class="whs1">p7 &nbsp;=
geompy.MakeVertex( 70., &nbsp;70.,
&nbsp;70.)</p> &nbsp;70.)</p>
<p class="whs1">p5 = geompy.MakeVertex(100., <p class="whs1">&nbsp;</p>
&nbsp;20., &nbsp;45.)</p>
<p class="whs1">p6 = geompy.MakeVertex( <p class="whs1">p8 &nbsp;=
&nbsp;0., 70., geompy.MakeVertex( &nbsp;0.,
&nbsp;40.)</p> -50., &nbsp;&nbsp;0.)</p>
<p class="whs1">p7 = geompy.MakeVertex( <p class="whs1">p9 &nbsp;=
70., 70., &nbsp;70.)</p> geompy.MakeVertex( &nbsp;0.,
-50., &nbsp;40.)</p>
<p class="whs1">p8 = geompy.MakeVertex(
70.,-15., &nbsp;70.)</p>
<p class="whs1">p9 = geompy.MakeVertex(
&nbsp;0., &nbsp;0.,
&nbsp;40.)</p>
<p class="whs1">p10 = geompy.MakeVertex( <p class="whs1">p10 = geompy.MakeVertex(
&nbsp;0., 70., 70., -35., &nbsp;&nbsp;0.)</p>
&nbsp;&nbsp;0.)</p>
<p class="whs1">p11 = geompy.MakeVertex( <p class="whs1">p11 = geompy.MakeVertex(
70., 70., &nbsp;&nbsp;0.)</p> 70., -35., &nbsp;70.)</p>
<p class="whs1">p12 = geompy.MakeVertex( <p class="whs1">&nbsp;</p>
70., -15., &nbsp;&nbsp;0.)</p>
<p class="whs1">p13 = geompy.MakeVertex( <p class="whs2"># create faces</p>
&nbsp;0., &nbsp;0.,
&nbsp;&nbsp;0.)</p>
<p>&nbsp;</p> <p class="whs1">qface1 = geompy.MakeQuad4Vertices(p0,
p1, p2, p3)</p>
<p># create faces</p> <p class="whs1">qface2 = geompy.MakeQuad4Vertices(p4,
p5, p6, p7)</p>
<p class="whs1">qface1 = geompy.MakeQuad4Vertices(p1, <p class="whs1">qface3 = geompy.MakeQuad4Vertices(p0,
p2, p3, p4)</p> p1, p4, p5)</p>
<p class="whs1">qface2 = geompy.MakeQuad4Vertices(p1, <p class="whs1">qface4 = geompy.MakeQuad4Vertices(p2,
p2, p5, p4)</p> p3, p6, p7)</p>
<p class="whs1">qface3 = geompy.MakeQuad4Vertices(p13, <p class="whs1">qface5 = geompy.MakeQuad4Vertices(p0,
p12, p11, p10)</p> p2, p4, p6)</p>
<p class="whs1">qface4 = geompy.MakeQuad4Vertices(p9, <p class="whs1">qface6 = geompy.MakeQuad4Vertices(p1,
p8, p7, p6)</p> p3, p5, p7)</p>
<p class="whs1">qface5 = geompy.MakeQuad4Vertices(p13, <p class="whs1">&nbsp;</p>
p9, p6, p10)</p>
<p class="whs1">qface6 = geompy.MakeQuad4Vertices(p13, <p class="whs1">qface7 = geompy.MakeQuad4Vertices(p8,
p9, p8, p12)</p> p9, p10, p11)</p>
<p class="whs1">qface7 = geompy.MakeQuad4Vertices(p12, <p class="whs1">&nbsp;</p>
p8, p7, p11)</p>
<p class="whs1">qface8 = geompy.MakeQuad4Vertices(p11, <p class="whs2"># create a hexahedral
p7, p6, p10)</p> solid between two given faces</p>
<p>&nbsp;</p>
<p># create a hexahedral solid between two given faces</p>
<p class="whs1">solid1 = geompy.MakeHexa2Faces(qface1, <p class="whs1">solid1 = geompy.MakeHexa2Faces(qface1,
qface2)</p> qface7)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># create a hexahedral solids, bounded by six given faces</p> <p class="whs2"># create a hexahedral
solid, bounded by six given faces</p>
<p class="whs1">solid2 = geompy.MakeHexa(qface3, <p class="whs1">solid2 = geompy.MakeHexa(qface1,
qface4, qface5, qface6, qface7, qface8)</p> qface2, qface3, qface4, qface5, qface6)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># add objects in the study</p> <p class="whs2"># add objects in the
study</p>
<p class="whs1">geompy.addToStudy(qface1,&quot;qface1&quot;)</p>
<p class="whs1">geompy.addToStudy(qface2,&quot;qface2&quot;)</p>
<p class="whs1">geompy.addToStudy(qface3,&quot;qface3&quot;)</p>
<p class="whs1">geompy.addToStudy(qface4,&quot;qface4&quot;)</p>
<p class="whs1">geompy.addToStudy(qface5,&quot;qface5&quot;)</p>
<p class="whs1">geompy.addToStudy(qface6,&quot;qface6&quot;)</p>
<p class="whs1">geompy.addToStudy(qface7,&quot;qface7&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">id_solid1 = geompy.addToStudy(solid1,&quot;Solid1&quot;)</p> <p class="whs1">id_solid1 = geompy.addToStudy(solid1,&quot;Solid1&quot;)</p>
<p class="whs1">id_solid2 = geompy.addToStudy(solid2,&quot;Solid2&quot;)</p> <p class="whs1">id_solid2 = geompy.addToStudy(solid2,&quot;Solid2&quot;)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># display solids</p> <p class="whs2"># display solids</p>
<p class="whs1">gg.createAndDisplayGO(id_solid1)</p> <p class="whs1">gg.createAndDisplayGO(id_solid1)</p>
<p class="whs1">gg.setDisplayMode(id_solid1,1)</p> <p class="whs1">gg.setDisplayMode(id_solid1,
1)</p>
<p class="whs1">gg.createAndDisplayGO(id_solid2)</p> <p class="whs1">gg.createAndDisplayGO(id_solid2)</p>
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_solid2,1)</span> <p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_solid2,
</p> 1)</span> </p>
<p>&nbsp;</p>
<script type="text/javascript" language="javascript1.2"> <script type="text/javascript" language="javascript1.2">
<!-- <!--

View File

@ -0,0 +1,155 @@
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
<head>
<title>Change Orientation</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">
<link rel="stylesheet" href="default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">
<!--
if (navigator.appName !="Netscape")
{ document.write("<link rel='stylesheet' href='default.css'>");}
//-->
</script>
<style type="text/css">
<!--
img_whs1 { border:none; width:23px; height:24px; }
p.whs2 { font-size:12pt; }
p.whs3 { font-size:12pt; font-weight:bold; }
p.whs4 { font-size:12pt; margin-left:40px; }
img_whs5 { border:none; width:400px; height:315px; float:none; border-style:none; }
table.whs6 { x-cell-content-align:top; border-spacing:0px; width:46.327%; }
col.whs7 { width:52.644%; }
col.whs8 { width:47.356%; }
tr.whs9 { x-cell-content-align:top; }
td.whs10 { width:52.644%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-right-style:none; border-left-style:none; border-top-style:none; }
img_whs11 { border:none; width:138px; height:143px; border-style:none; }
td.whs12 { width:47.356%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-top-style:none; border-right-style:none; }
img_whs13 { border:none; width:139px; height:144px; border-style:none; }
td.whs14 { width:52.644%; padding-right:10px; padding-left:10px; border-right-style:none; border-left-style:none; border-bottom-style:none; }
td.whs15 { width:47.356%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-right-style:none; }
-->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
origWidth = innerWidth;
origHeight = innerHeight;
onresize = reDo;
}
onerror = null;
//-->
</script>
<style type="text/css">
<!--
div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
p.WebHelpNavBar { text-align:right; }
-->
</style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
<script type="text/javascript" language="javascript" src="whver.js"></script>
<script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
<script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
<script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.gbWhTopic)
{
if (window.setRelStartPage)
{
addTocInfo("Geometry module\nTransforming geometrical objects\nRepairing Operations\nChange Orientation");
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><img src="image43.gif" width="23px" height="24px" border="0" class="img_whs1"> Change Orientation</h1>
<p class="whs2"><b style="font-weight: normal;">T</b>o <span
style="font-weight: bold;"><B>Change Orientation</B></span> in the Main Menu
select <span style="font-weight: bold;"><B>Repair - &gt; Change Orientation</B></span>.</p>
<p class="whs2">This operation reverses the normals of faces
composing the selected shell. </p>
<p class="whs2">&nbsp;</p>
<p class="whs2"><b style="font-weight: bold;">TUI Command :</b><i><span
style="font-style: italic;"><I> geompy.ChangeOrientation(shape)</I></span></i></p>
<p class="whs2"><b style="font-weight: bold;">Arguments: <span
style="font-weight: normal;">Name + 1 shape (shell) </span></b></p>
<p class="whs3"><span style="font-weight: normal;">Uncheck</span>
Create a copy<span style="font-weight: normal;"> checkbox if you don't
wish to leave the initial object in the project (</span>Result name<span
style="font-weight: normal;"> field will be locked).</span></p>
<p class="whs2">&nbsp;</p>
<p class="whs4"><img src="pics/changeorientation.png" x-maintain-ratio="TRUE" width="400px" height="315px" border="0" class="img_whs5"></p>
<p class="whs2">&nbsp;</p>
<p class="whs2"><span style="font-weight: bold;"><B>Example:</B></span>
</p>
<p class="whs2">&nbsp;</p>
<table x-use-null-cells cellspacing="0" width="46.327%" class="whs6">
<col class="whs7">
<col class="whs8">
<tr valign="top" class="whs9">
<td width="52.644%" class="whs10">
<p><img src="image38.gif" width="138px" height="143px" border="0" class="img_whs11"></td>
<td width="47.356%" class="whs12">
<p><img src="image40.gif" width="139px" height="144px" border="0" class="img_whs13"></td></tr>
<tr valign="top" class="whs9">
<td width="52.644%" class="whs14">
<p>Inward orientation. </td>
<td width="47.356%" class="whs15">
<p>Outward orientation</td></tr>
</table>
<p class="whs2">&nbsp;</p>
<p class="whs2">&nbsp;</p>
<p class="whs2">&nbsp;</p>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
writeIntopicBar(0);
//-->
</script>
</body>
</html>

View File

@ -17,11 +17,13 @@ if (navigator.appName !="Netscape")
img_whs1 { width:20px; height:20px; border-style:none; } img_whs1 { width:20px; height:20px; border-style:none; }
p.whs2 { font-size:12pt; } p.whs2 { font-size:12pt; }
p.whs3 { font-size:12pt; margin-left:40px; } p.whs3 { font-size:12pt; margin-left:40px; }
img_whs4 { border:none; width:312px; height:350px; float:none; border-style:none; } img_whs4 { border:none; width:400px; height:350px; float:none; border-style:none; }
p.whs5 { font-size:12pt; font-weight:bold; } p.whs5 { font-size:12pt; font-weight:bold; }
p.whs6 { font-size:12pt; font-style:italic; margin-left:40px; } p.whs6 { font-size:12pt; margin-left:40px; font-weight:normal; font-style:italic; }
img_whs7 { border:none; float:none; width:300px; height:175px; border-style:none; } img_whs7 { border:none; width:400px; height:359px; float:none; border-style:none; }
img_whs8 { border:none; width:350px; height:175px; float:none; border-style:none; } p.whs8 { font-size:12pt; font-style:italic; margin-left:40px; }
img_whs9 { border:none; float:none; width:300px; height:175px; border-style:none; }
img_whs10 { border:none; width:350px; height:175px; float:none; border-style:none; }
--> -->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript"> </style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!-- <!--
@ -92,10 +94,13 @@ if (window.writeIntopicBar)
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>
<p class="whs2">To create an Extrusion (Prism) you should define <p>There are 2 algorithms for creation of <span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">an
the <span style="font-weight: bold;"><B>Base Shape </B></span>(a basis of the Extrusion (Prism)</font></span>. </p>
extrusion)<span style="font-weight: bold;"><B>, </B></span>the <span style="font-weight: bold;"><B>Vector</B></span>
(a direction of the extrusion) and the <span style="font-weight: bold;"><B>Height</B></span> <p class="whs2">Firstly, you can define the <span style="font-weight: bold;"><B>Base
Shape </B></span>(a basis of the extrusion)<span style="font-weight: bold;"><B>,
</B></span>the <span style="font-weight: bold;"><B>Vector</B></span> (a direction
of the extrusion) and the <span style="font-weight: bold;"><B>Height</B></span>
of extrusion. &nbsp;</p> of extrusion. &nbsp;</p>
<p class="whs2"><b style="font-weight: bold;"><span style="font-weight: normal;">The</span> <p class="whs2"><b style="font-weight: bold;"><span style="font-weight: normal;">The</span>
@ -112,16 +117,12 @@ if (window.writeIntopicBar)
<p>&nbsp;</p> <p>&nbsp;</p>
<p class="whs3"><img src="pics/extrusion.png" x-maintain-ratio="TRUE" width="312px" height="350px" border="0" class="img_whs4"></p> <p class="whs3"><img src="pics/extrusion1.png" x-maintain-ratio="TRUE" width="400px" height="350px" border="0" class="img_whs4"></p>
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>
<p class="whs5">NB! <span style="font-weight: normal;">The <p class="whs5"><span style="font-weight: normal;">Secondly,
is another way to create an</span> Extrusion, <span style="font-weight: normal;">which you can define the</span> Extrusion <span style="font-weight: normal;">by
is currently accessible only via</span> TUI commands.</p>
<p class="whs5"><span style="font-weight: normal;">You
can define the</span> Extrusion <span style="font-weight: normal;">by
the </span>Base Shape<span style="font-weight: normal;"> and the </span>Start<span the </span>Base Shape<span style="font-weight: normal;"> and the </span>Start<span
style="font-weight: normal;"> and </span>End Point<span style="font-weight: normal;"> style="font-weight: normal;"> and </span>End Point<span style="font-weight: normal;">
of the </span>Vector<span style="font-weight: normal;"> &nbsp;(in of the </span>Vector<span style="font-weight: normal;"> &nbsp;(in
@ -131,17 +132,23 @@ if (window.writeIntopicBar)
Command:</b> <span style="font-weight: normal; font-style: italic;"><I>geompy.MakePrism(Base, Command:</b> <span style="font-weight: normal; font-style: italic;"><I>geompy.MakePrism(Base,
Point1, Point2) </I></span></p> Point1, Point2) </I></span></p>
<p class="whs2"><b style="font-weight: bold;">Arguments:</b>
Name + 1 shape (vertex, edge, wire, face or shell) serving as base object
+ 2 vertices.</p>
<p>&nbsp;</p> <p>&nbsp;</p>
<p class="whs3">&nbsp;</p> <p class="whs6"><img src="pics/extrusion2.png" x-maintain-ratio="TRUE" width="400px" height="359px" border="0" class="img_whs7"></p>
<p class="whs6">&nbsp;</p>
<p class="whs2"><b style="font-weight: bold;">Examples:</b></p> <p class="whs2"><b style="font-weight: bold;">Examples:</b></p>
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>
<p class="whs6">Base Shape &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prisms</p> <p class="whs8">Base Shape &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prisms</p>
<p class="whs3"><img src="pics/prisms_basessn.png" x-maintain-ratio="TRUE" width="300px" height="175px" border="0" class="img_whs7"> <img src="pics/prismssn.png" x-maintain-ratio="TRUE" width="350px" height="175px" border="0" class="img_whs8"> &nbsp;</p> <p class="whs3"><img src="pics/prisms_basessn.png" x-maintain-ratio="TRUE" width="300px" height="175px" border="0" class="img_whs9"> <img src="pics/prismssn.png" x-maintain-ratio="TRUE" width="350px" height="175px" border="0" class="img_whs10"> &nbsp;</p>
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>

View File

@ -3,7 +3,7 @@
<html> <html>
<head> <head>
<title>Titre</title> <title>Using Boolean Operations</title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252"> <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"> <meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">
<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss"> <link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">
@ -98,7 +98,7 @@ if (window.writeIntopicBar)
writeIntopicBar(4); writeIntopicBar(4);
//--> //-->
</script> </script>
<h1 class="whs1">Using boolean operations</h1> <h1 class="whs1">Using Boolean Operations</h1>
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>

View File

@ -3,7 +3,7 @@
<html> <html>
<head> <head>
<title>Titre</title> <title>Importing and exporting geometrical objects</title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252"> <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"> <meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">
<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss"> <link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">

View File

@ -3,7 +3,7 @@
<html> <html>
<head> <head>
<title>Titre</title> <title>Using Measurement Tools</title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252"> <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"> <meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">
<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss"> <link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">
@ -38,7 +38,7 @@ img_whs16 { border:none; width:360px; height:328px; float:none; border-style:non
p.whs17 { font-size:12pt; font-weight:normal; } p.whs17 { font-size:12pt; font-weight:normal; }
img_whs18 { border:none; width:360px; height:290px; float:none; border-style:none; } img_whs18 { border:none; width:360px; height:290px; float:none; border-style:none; }
img_whs19 { border:none; width:360px; height:405px; float:none; border-style:none; } img_whs19 { border:none; width:360px; height:405px; float:none; border-style:none; }
img_whs20 { border:none; width:360px; height:309px; float:none; border-style:none; } img_whs20 { border:none; width:360px; height:337px; float:none; border-style:none; }
p.whs21 { font-size:12pt; margin-left:40px; text-indent:-40px; } p.whs21 { font-size:12pt; margin-left:40px; text-indent:-40px; }
img_whs22 { border:none; width:25px; height:23px; border-style:none; } img_whs22 { border:none; width:25px; height:23px; border-style:none; }
ul.whs23 { list-style:disc; } ul.whs23 { list-style:disc; }
@ -174,16 +174,14 @@ if (window.writeIntopicBar)
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p class="whs1"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><b style="font-weight: bold;">Description:</b> <p class="whs1"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Returns the
Returns the coordinates of a point.</font></span></p> coordinates of a point.</font></span></p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Result:</b> Point <p class="whs1"><b style="font-weight: bold;">Result:</b> Point
coordinates (X, Y, Z) in 3D space in the form of Python Tuple.</p> coordinates (X, Y, Z) in 3D space in the form of Python Tuple.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><span style="font-weight: bold;"><B>TUI command:</B></span> <p class="whs1"><span style="font-weight: bold;"><B>TUI command:</B></span>
<span style="font-style: italic;"><I>geompy.PointCoordinates(Point)</I></span>, <span style="font-style: italic;"><I>geompy.PointCoordinates(Point)</I></span>,
where Point is a point whose coordinates are inquired.</p> where Point is a point whose coordinates are inquired.</p>
@ -203,17 +201,14 @@ if (window.writeIntopicBar)
<p class="whs9">&nbsp;</p> <p class="whs9">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b> <p class="whs1">Returns the properties (Length, Surface &amp;
Return the properties (Length, Surface &amp; Volume) of a definite geometrical Volume) for the selected geometrical object.</p>
object.</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Result:</b> Display <p class="whs1"><b style="font-weight: bold;">Result:</b> Display
Length, Surface &amp; Volume in the form of Python Tuple.</p> Length, Surface &amp; Volume in the form of Python Tuple.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><span style="font-weight: bold;"><B>TUI command:</B></span> <p class="whs1"><span style="font-weight: bold;"><B>TUI command:</B></span>
<span style="font-style: italic;"><I>geompy.BasicProperties(Shape)</I></span>, <span style="font-style: italic;"><I>geompy.BasicProperties(Shape)</I></span>,
where Shape is a shape whose properties are inquired.</p> where Shape is a shape whose properties are inquired.</p>
@ -232,16 +227,14 @@ if (window.writeIntopicBar)
<p class="whs9">&nbsp;</p> <p class="whs9">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b> <p class="whs1">Calculates and returns the coordinates of the
Creates a gravity center of a shape and returns its coordinates.</p> gravity center for the selected geometrical object.</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Result:</b> GEOM_Object <p class="whs1"><b style="font-weight: bold;">Result:</b> GEOM_Object
(vertex).</p> (vertex).</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">TUI Command:</b><i> <p class="whs1"><b style="font-weight: bold;">TUI Command:</b><i>
</i><span style="font-style: italic;"><I>geompy.MakeCDG(Shape)</I></span>, where </i><span style="font-style: italic;"><I>geompy.MakeCDG(Shape)</I></span>, where
Shape is the shape for which a center of gravity is computed.</p> Shape is the shape for which a center of gravity is computed.</p>
@ -261,12 +254,12 @@ if (window.writeIntopicBar)
<p class="whs7">&nbsp;</p> <p class="whs7">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b> <p class="whs1">Returns the axis of inertia for the selected
Returns the inertia axis of a geometrical object.</p> geometrical object.</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Result:</b> Display <p class="whs1"><b style="font-weight: bold;">Result:</b> Displays
the matrix and moments of inertia in the form of Python Tuple (I11, I12, the matrix and moments of inertia in the form of Python Tuple (I11, I12,
I13, </p> I13, </p>
@ -301,8 +294,8 @@ if (window.writeIntopicBar)
<p class="whs7">&nbsp;</p> <p class="whs7">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b> <p class="whs1">Returns the dimensions of the bounding box
Returns the dimensions of the bounding box of a geometrical object.</p> for the selected geometrical object.</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
@ -310,8 +303,6 @@ if (window.writeIntopicBar)
the dimensions of the bounding box of a geometrical object in the form the dimensions of the bounding box of a geometrical object in the form
of Python Tuple (Xmin, Xmax, Ymin, Ymax, Zmin, Zmax).</p> of Python Tuple (Xmin, Xmax, Ymin, Ymax, Zmin, Zmax).</p>
<p class="whs1">&nbsp;</p>
<p class="whs15">TUI command: <span style="font-weight: normal; font-style: italic;"><I>geompy.BoundingBox(Shape)</I></span><span <p class="whs15">TUI command: <span style="font-weight: normal; font-style: italic;"><I>geompy.BoundingBox(Shape)</I></span><span
style="font-weight: normal;">, where Shape is a shape for which a bounding style="font-weight: normal;">, where Shape is a shape for which a bounding
box is computed.</span></p> box is computed.</span></p>
@ -330,13 +321,8 @@ if (window.writeIntopicBar)
<p class="whs7">&nbsp;</p> <p class="whs7">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b> <p class="whs1">Returns the minimum distance between two geometrical
Returns the min. distance between 2 geometrical objects.</p> objects.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Result:</b> Displays
the min. distance.</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
@ -358,8 +344,8 @@ if (window.writeIntopicBar)
<p class="whs9">&nbsp;</p> <p class="whs9">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b> <p class="whs1">Returns the maximum and the minimum tolerance
Returns the tolerance of a geometrical object.</p> for the selected geometrical object.</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
@ -367,8 +353,6 @@ if (window.writeIntopicBar)
the tolerance values (FaceMinTol, FaceMaxTol, EgdeMinTol, EgdeMaxTol, the tolerance values (FaceMinTol, FaceMaxTol, EgdeMinTol, EgdeMaxTol,
VertexMinTol, VertexMaxTol).</p> VertexMinTol, VertexMaxTol).</p>
<p class="whs1">&nbsp;</p>
<p class="whs15">TUI command: <span style="font-weight: normal; font-style: italic;"><I>geompy.Tolerance(Shape)</I></span><span <p class="whs15">TUI command: <span style="font-weight: normal; font-style: italic;"><I>geompy.Tolerance(Shape)</I></span><span
style="font-weight: normal;">, where Shape is a shape for which minimal style="font-weight: normal;">, where Shape is a shape for which minimal
and maximal tolerances are returned.</span></p> and maximal tolerances are returned.</span></p>
@ -387,13 +371,8 @@ if (window.writeIntopicBar)
<p class="whs9">&nbsp;</p> <p class="whs9">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b> <p class="whs1">Displays types and quantities of all elements
Returns the type of a geometrical object.</p> composing the selected geometrical object.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Result:</b> Displays
all elements composing your geometrical object.</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
@ -416,24 +395,21 @@ if (window.writeIntopicBar)
<p class="whs7">&nbsp;</p> <p class="whs7">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b> <p class="whs1">Checks the topology of the selected geometrical
Returns True if this geometrical object is valid.</p> object and returns True if it is valid. <span style="font-weight: bold;"><B>Check
also geometry</B></span> checkbox allows to test the geometry as well. </p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Result:</b> Boolean.</p> <p class="whs1"><b style="font-weight: bold;">Result:</b> Boolean.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">TUI Command:</b><i> <p class="whs1"><b style="font-weight: bold;">TUI Command:</b><i>
</i><span style="font-style: italic;"><I>geompy.CheckShape(Shape)</I></span>, </i><span style="font-style: italic;"><I>geompy.(theShape, theIsCheckGeom
where is shape which is checked for validity.</p> = 0)</I></span>, where is shape which is checked for validity.</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p class="whs11"><img src="../pics/measures9.png" x-maintain-ratio="TRUE" width="360px" height="309px" border="0" class="img_whs20"></p> <p class="whs11"><img src="../pics/measures9.png" x-maintain-ratio="TRUE" width="360px" height="337px" border="0" class="img_whs20"></p>
<p class="whs11">&nbsp;</p>
<p class="whs21">&nbsp;</p> <p class="whs21">&nbsp;</p>
@ -444,9 +420,9 @@ if (window.writeIntopicBar)
<p class="whs21">&nbsp;</p> <p class="whs21">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b> <p class="whs1">Checks whether a shape is a compound of glued
Checks whether a shape is a compound of glued blocks. To be considered blocks. To be considered as a compound of blocks, the given shape must
as a compound of blocks, the given shape must satisfy the following conditions:</p> satisfy the following conditions:</p>
<ul type="disc" class="whs23"> <ul type="disc" class="whs23">
@ -485,8 +461,6 @@ if (window.writeIntopicBar)
<p class="whs1"><b style="font-weight: bold;">Result:</b> Boolean; <p class="whs1"><b style="font-weight: bold;">Result:</b> Boolean;
highlight in the viewer.</p> highlight in the viewer.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">TUI Command:</b><i> <p class="whs1"><b style="font-weight: bold;">TUI Command:</b><i>
</i><span style="font-style: italic;"><I>geompy.CheckCompoundOfBlocks(Compound). </i><span style="font-style: italic;"><I>geompy.CheckCompoundOfBlocks(Compound).
</I></span>Checks if the<span style="font-style: italic;"> <I></I></span>shape is </I></span>Checks if the<span style="font-style: italic;"> <I></I></span>shape is

View File

@ -17,7 +17,7 @@ if (navigator.appName !="Netscape")
img_whs1 { width:20px; height:20px; border-style:none; } img_whs1 { width:20px; height:20px; border-style:none; }
p.whs2 { font-size:12pt; } p.whs2 { font-size:12pt; }
p.whs3 { font-size:12pt; margin-left:40px; } p.whs3 { font-size:12pt; margin-left:40px; }
img_whs4 { border:none; width:312px; height:367px; float:none; border-style:none; } img_whs4 { border:none; width:400px; height:367px; border-style:none; float:none; }
img_whs5 { border:none; float:none; width:260px; height:230px; border-style:none; } img_whs5 { border:none; float:none; width:260px; height:230px; border-style:none; }
--> -->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript"> </style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
@ -80,7 +80,7 @@ if (window.writeIntopicBar)
//--> //-->
</script> </script>
<h1><span style="font-size: 14pt;"><font size=4 style="font-size:14pt;"><img src="files/salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image58.gif" width="20px" height="20px" border="0" class="img_whs1"> &nbsp;</font></span>Filling <h1><span style="font-size: 14pt;"><font size=4 style="font-size:14pt;"><img src="files/salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image58.gif" width="20px" height="20px" border="0" class="img_whs1"> &nbsp;</font></span>Filling
Surface with Curves</h1> Surface with Edges</h1>
<p><b><span style="font-weight: normal;">T</b>o</span> <span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">generate <p><b><span style="font-weight: normal;">T</b>o</span> <span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">generate
a </font></span><span style="font-size: 12pt; font-weight: bold;"><font size=3 style="font-size:12pt;"><B>Filling</B></font></span><span a </font></span><span style="font-size: 12pt; font-weight: bold;"><font size=3 style="font-size:12pt;"><B>Filling</B></font></span><span
@ -91,9 +91,9 @@ if (window.writeIntopicBar)
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>
<p class="whs2">To create a curving face using several curves <p class="whs2">To create a curving face using several edges
you need to define the <span style="font-weight: bold;"><B>Curves</B></span>, you need to define the <span style="font-weight: bold;"><B>Edges Compound,</B></span>
which will be the components of your face, <span style="font-weight: bold;"><B>Minimum</B></span> &nbsp;<span style="font-weight: bold;"><B>Minimum</B></span>
and <span style="font-weight: bold;"><B>Maximum Degree</B></span>, <span style="font-weight: bold;"><B>Tolerance and <span style="font-weight: bold;"><B>Maximum Degree</B></span>, <span style="font-weight: bold;"><B>Tolerance
</B></span>for<span style="font-weight: bold;"><B> 2D</B></span> and for <span style="font-weight: bold;"><B>3D </B></span>for<span style="font-weight: bold;"><B> 2D</B></span> and for <span style="font-weight: bold;"><B>3D
</B></span>&nbsp;and </B></span>&nbsp;and
@ -115,7 +115,7 @@ if (window.writeIntopicBar)
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>
<p class="whs3"><img src="pics/filling.png" x-maintain-ratio="TRUE" width="312px" height="367px" border="0" class="img_whs4"></p> <p class="whs3"><img src="pics/filling.png" x-maintain-ratio="TRUE" width="400px" height="367px" border="0" class="img_whs4"></p>
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>

View File

@ -125,6 +125,7 @@ boolean_operations.htm
box.htm box.htm
building_by_blocks.htm building_by_blocks.htm
chamfer.htm chamfer.htm
change_orientation.htm
changing_display_parameters.htm changing_display_parameters.htm
check_free_boundaries.htm check_free_boundaries.htm
check_free_faces.htm check_free_faces.htm
@ -267,6 +268,7 @@ image37.gif
files\salome2_sp3_operationgui_functions_salome2_sp3_operationgui_functions_image87.gif files\salome2_sp3_operationgui_functions_salome2_sp3_operationgui_functions_image87.gif
files\salome2_sp3_measuregui_functions_salome2_sp3_measuregui_functions_image76.gif files\salome2_sp3_measuregui_functions_salome2_sp3_measuregui_functions_image76.gif
files\salome2_sp3_basicgui_functions_salome2_sp3_basicgui_functions_image31.gif files\salome2_sp3_basicgui_functions_salome2_sp3_basicgui_functions_image31.gif
image38.gif
pics\multi_transformationsn1d.png pics\multi_transformationsn1d.png
pics\fillingsn.png pics\fillingsn.png
pics\spheres.png pics\spheres.png
@ -330,13 +332,14 @@ image29.gif
image160.jpg image160.jpg
files\salome2_sp3_transformationgui_functions_salome2_sp3_transformationgui_functions_image133.gif files\salome2_sp3_transformationgui_functions_salome2_sp3_transformationgui_functions_image133.gif
files\salome2_sp3_basicgui_functions_salome2_sp3_basicgui_functions_image34.gif files\salome2_sp3_basicgui_functions_salome2_sp3_basicgui_functions_image34.gif
pics\changeorientation.png
pics\pipesn.png
pics\pipe_wire_edgesn.png
image2.gif image2.gif
pics\chamfer_faces.png pics\chamfer_faces.png
pics\fillet_prism.png pics\fillet_prism.png
pics\rotationsn1.png pics\rotationsn1.png
pics\disp_mode1sn.png pics\disp_mode1sn.png
pics\pipesn.png
pics\pipe_wire_edgesn.png
pics\cones.png pics\cones.png
pics\planes1.png pics\planes1.png
pics\lines.png pics\lines.png
@ -364,6 +367,7 @@ pics\ellipse.png
pics\circle1.png pics\circle1.png
image3.gif image3.gif
files\salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image56.gif files\salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image56.gif
pics\extrusion1.png
image4.gif image4.gif
pics\isos_u12_v12sn.png pics\isos_u12_v12sn.png
pics\free_boudaries1.png pics\free_boudaries1.png
@ -383,6 +387,7 @@ pics\circle2.png
pics\point3.png pics\point3.png
image185.jpg image185.jpg
files\salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image57.gif files\salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image57.gif
pics\extrusion2.png
image5.gif image5.gif
pics\free_boudaries2.png pics\free_boudaries2.png
pics\multi_rotation2d1.png pics\multi_rotation2d1.png
@ -415,6 +420,7 @@ image61.gif
image154.jpg image154.jpg
image110.jpg image110.jpg
files\salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image59.gif files\salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image59.gif
image40.gif
pics\scale_transformsn2.png pics\scale_transformsn2.png
pics\translationsn1.png pics\translationsn1.png
pics\facesn1.png pics\facesn1.png
@ -473,6 +479,7 @@ image113.jpg
files\salome2_sp3_primitivegui_functions_salome2_sp3_primitivegui_functions_image101.gif files\salome2_sp3_primitivegui_functions_salome2_sp3_primitivegui_functions_image101.gif
files\salome2_sp3_booleangui_functions_salome2_sp3_booleangui_functions_image1.gif files\salome2_sp3_booleangui_functions_salome2_sp3_booleangui_functions_image1.gif
salome2_sp3_buildgui_functions_salome2_sp3_buildgui_functions_image14.gif salome2_sp3_buildgui_functions_salome2_sp3_buildgui_functions_image14.gif
image43.gif
pics\image95.gif pics\image95.gif
pics\mirror_planesn2.png pics\mirror_planesn2.png
pics\neo-scetcher2.png pics\neo-scetcher2.png
@ -499,7 +506,6 @@ pics\repair10.png
pics\transformation2.png pics\transformation2.png
pics\mtransf1.png pics\mtransf1.png
pics\editgroup.png pics\editgroup.png
pics\extrusion.png
pics\box2.png pics\box2.png
image44.gif image44.gif
files\salome2_sp3_primitivegui_functions_salome2_sp3_primitivegui_functions_image103.gif files\salome2_sp3_primitivegui_functions_salome2_sp3_primitivegui_functions_image103.gif
@ -576,6 +582,7 @@ whgdata\whlstf10.htm
whgdata\whlstf11.htm whgdata\whlstf11.htm
whgdata\whlstf12.htm whgdata\whlstf12.htm
whgdata\whlstf13.htm whgdata\whlstf13.htm
whgdata\whlstf14.htm
whgdata\whlstg0.htm whgdata\whlstg0.htm
index.htm index.htm
index_csh.htm index_csh.htm

View File

@ -491,88 +491,73 @@ if (window.writeIntopicBar)
<h3><a name=bookmark4>Creation of a Compound</a></h3> <h3><a name=bookmark4>Creation of a Compound</a></h3>
<p class="whs1">import geompy</p> <p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import
geompy</span></p>
<p class="whs1">import salome</p> <p class="whs1">import salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p> <p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p class="whs2">#create vertices</p> <p class="whs2"># create a vertex and
a vector</p>
<p class="whs1">p0 = geompy.MakeVertex( <p class="whs1">p1 = geompy.MakeVertex(
0., &nbsp;0., &nbsp;-30., &nbsp;-30.,
&nbsp;0.)</p> &nbsp;50.)</p>
<p class="whs1">pz = geompy.MakeVertex( <p class="whs1">p2 = geompy.MakeVertex(
0., &nbsp;0., &nbsp;-60., &nbsp;-60.,
40.)</p> &nbsp;30.)</p>
<p class="whs1">p3 = geompy.MakeVertex(
&nbsp;-30., &nbsp;-30.,
&nbsp;10.)</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p class="whs2"># create sketchers</p> <p class="whs2"># create an arc from
three points</p>
<p class="whs1">sketcher = geompy.MakeSketcher(&quot;Sketcher:F <p class="whs1">arc = geompy.MakeArc(p1,
-50 -50:TT 100 -50:R 0:C 50 70:R 0:L 100:WW&quot;)</p> p2, p3)</p>
<p class="whs1">ShapeListCompound
= []</p>
<p class="whs1">i = 0</p>
<p class="whs1">while i &lt;= 3 :</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;S
= geompy.MakeTranslation(arc, i * 50., 0., 0.)</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;ShapeListCompound.append(S)</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;i
= i + 1</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p class="whs2"># create faces from two <p class="whs2"># create a compund of
wires</p> the given shapes</p>
<p class="whs1">face = geompy.MakeFace(sketcher,1)</p> <p class="whs1">compound = geompy.MakeCompound(ShapeListCompound)</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p class="whs2"># create a prism</p> <p class="whs2"># add object in the study</p>
<p class="whs1">prism = geompy.MakePrism(face, <p class="whs1">id_compound = geompy.addToStudy(compound,&quot;Compound&quot;)</p>
p0, pz)</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p class="whs2"># explode the prism into <p class="whs2"># display the compound</p>
faces</p>
<p class="whs1">prism_faces = geompy.SubShapeAllSorted(prism, <p class="whs1">gg.createAndDisplayGO(id_compound)
geompy.ShapeType[&quot;FACE&quot;])</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># create a shell from
a set of faces</p>
<p class="whs1">shell = geompy.MakeShell([prism_faces[0],
prism_faces[1],</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prism_faces[3],
prism_faces[4],</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prism_faces[5],
prism_faces[2]])</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># create a solid, bounded
by the given shells</p>
<p class="whs1">solid = geompy.MakeSolid([shell])</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># add objects in the
study</p>
<p class="whs1">id_solid = geompy.addToStudy(solid,&quot;Solid&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># display the solid</p>
<p class="whs1">gg.createAndDisplayGO(id_solid)</p>
<p class="whs1">gg.setDisplayMode(id_solid,1)
</p> </p>
<script type="text/javascript" language="javascript1.2"> <script type="text/javascript" language="javascript1.2">

BIN
doc/salome/gui/GEOM/image38.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
doc/salome/gui/GEOM/image40.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
doc/salome/gui/GEOM/image43.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -132,10 +132,9 @@ if (window.writeIntopicBar)
<p class="whs5">&nbsp;</p> <p class="whs5">&nbsp;</p>
<p class="whs6">Secondly, you can simply <p class="whs6">Secondly, you can simply
select a point in the object browser or 3D viewer, in this case the coordinates select any object in the object browser or 3D viewer, in this case the
of origin are automatically filled in with the coordinates of the selected coordinates of origin and axes direction of the LCS are calculated automatically
point and X and Y axes direction will be parallel to the X and Y direction basing on the selected object. </p>
of the Global CS. &nbsp;</p>
<p class="whs6"><b style="font-weight: bold;">Arguments: <p class="whs6"><b style="font-weight: bold;">Arguments:
</b>Name + reference object.</p> </b>Name + reference object.</p>
@ -146,9 +145,9 @@ if (window.writeIntopicBar)
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>
<p class="whs2">The last algorithm also presumes that you select <p class="whs2">The last algorithm of LCS construction allows
a point in the object browser or 3D viewer, but in this case you define to define the coordinates of origin by a point and axes directions by
X and Y axes direction yourselves. </p> a line or a vector. </p>
<p class="whs8"><b style="font-weight: bold;">Arguments:</b> <p class="whs8"><b style="font-weight: bold;">Arguments:</b>
<span style="font-weight: normal;">Name + 1 point of origin + X axis direction, <span style="font-weight: normal;">Name + 1 point of origin + X axis direction,

View File

@ -80,32 +80,52 @@ if (window.writeIntopicBar)
<h3>Point Coordinates</h3> <h3>Point Coordinates</h3>
<p class="whs1">import math</p>
<p class="whs1">import geompy</p> <p class="whs1">import geompy</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># create a point</p> <p class="whs2"># create a point</p>
<p class="whs1">point = geompy.MakeVertex(15, <p class="whs1">point = geompy.MakeVertex(15.,
23, 80)</p> 23., 80.)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># get the coordinates of the point and check its values</p> <p class="whs2"># get the coordinates
of the point and check its values</p>
<p class="whs1">coords = geompy.PointCoordinates(point)</p> <p class="whs1">coords = geompy.PointCoordinates(point)</p>
<p class="whs1">if coords[0] != 15 <p class="whs1">&nbsp;</p>
or coords[1] != 23 or coords[2] != 80 :</p>
<p class="whs2"># check the obtained
coordinate values </p>
<p class="whs1">tolerance = 1.e-07</p>
<p class="whs1">def IsEqual(val1,
val2): return (math.fabs(val1 - val2) &lt; tolerance)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">if IsEqual(coords[0],
15.) and IsEqual(coords[1], 23.) and IsEqual(coords[2], 80.):</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;print <p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;Coordinates of point must be (15, 23, 80), but returned (&quot;, &quot;All values are OK.&quot;</p>
coords[0], &quot;, &quot;, coords[1], &quot;, &quot;, coords[2], &quot;)&quot;</p>
<p class="whs1">else :</p> <p class="whs1">else :</p>
<p><span style="font-family: 'Lucida Console', monospace;">&nbsp;&nbsp;&nbsp;&nbsp;print <p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;All values are OK.&quot;</span> </p> &quot;Coordinates of point must be (15, 23, 80), but returned (&quot;,</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;print
coords[0], &quot;, &quot;, coords[1], &quot;, &quot;, coords[2], &quot;)&quot;</p>
<p><span style="font-family: 'Lucida Console', monospace;">&nbsp;&nbsp;&nbsp;&nbsp;pass</span>
</p>
<h3>Basic Properties</h3> <h3>Basic Properties</h3>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -86,7 +86,7 @@ if (window.writeIntopicBar)
a </font></span><span style="font-size: 12pt; font-weight: bold;"><font size=3 style="font-size:12pt;"><B>Pipe</B></font></span> a </font></span><span style="font-size: 12pt; font-weight: bold;"><font size=3 style="font-size:12pt;"><B>Pipe</B></font></span>
in the <span style="font-weight: bold;"><B>Main Menu</B></span> select <span in the <span style="font-weight: bold;"><B>Main Menu</B></span> select <span
style="font-weight: bold;"><B>New Entity - &gt; Generation &nbsp;- style="font-weight: bold;"><B>New Entity - &gt; Generation &nbsp;-
&gt; Pipe</B></span></p> &gt; Extrusion along a path</B></span></p>
<p>&nbsp;</p> <p>&nbsp;</p>

View File

@ -20,7 +20,7 @@ p.whs3 { font-size:12pt; margin-left:40px; }
img_whs4 { border:none; width:312px; height:346px; float:none; border-style:none; } img_whs4 { border:none; width:312px; height:346px; float:none; border-style:none; }
p.whs5 { font-size:12pt; font-weight:bold; } p.whs5 { font-size:12pt; font-weight:bold; }
img_whs6 { border:none; width:312px; height:385px; float:none; border-style:none; } img_whs6 { border:none; width:312px; height:385px; float:none; border-style:none; }
p.whs7 { margin-left:40px; } img_whs7 { border:none; width:400px; height:315px; float:none; }
table.whs8 { x-cell-content-align:top; width:72.604%; border-spacing:0px; } table.whs8 { x-cell-content-align:top; width:72.604%; border-spacing:0px; }
col.whs9 { width:32.089%; } col.whs9 { width:32.089%; }
col.whs10 { width:32.008%; } col.whs10 { width:32.008%; }
@ -100,7 +100,7 @@ if (window.writeIntopicBar)
<p>&nbsp;</p> <p>&nbsp;</p>
<p>There are three algorithms to <span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">create <p>There are three algorithms to <span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">create
a point in the 3D space.</font></span></p> a plane in the 3D space.</font></span></p>
<p><b style="font-weight: bold;"><span style="font-weight: normal;">The</span><span <p><b style="font-weight: bold;"><span style="font-weight: normal;">The</span><span
style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> Result </font></span><span style="font-weight: normal;">of style="font-size: 12pt;"><font size=3 style="font-size:12pt;"> Result </font></span><span style="font-weight: normal;">of
@ -130,7 +130,7 @@ if (window.writeIntopicBar)
<p class="whs2">Secondly, you can define a <span style="font-weight: bold;"><B>Plane</B></span> <p class="whs2">Secondly, you can define a <span style="font-weight: bold;"><B>Plane</B></span>
by three <span style="font-weight: bold;"><B>Points </B></span>through which by three <span style="font-weight: bold;"><B>Points </B></span>through which
&nbsp;the plane &nbsp;the plane
passes.</p> passes and a <span style="font-weight: bold;"><B>Size of the Plane</B></span>.</p>
<p class="whs5"><b style="font-weight: bold;">TUI <p class="whs5"><b style="font-weight: bold;">TUI
Command:</b> <span style="font-weight: normal; font-style: italic;"><I>geompy.MakePlaneThreePnt(Point1, Command:</b> <span style="font-weight: normal; font-style: italic;"><I>geompy.MakePlaneThreePnt(Point1,
@ -146,19 +146,20 @@ if (window.writeIntopicBar)
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>
<p class="whs2">Finally, you can define a <span style="font-weight: bold;"><B>Plane</B></span>, <p class="whs2">Finally, you can define a <span style="font-weight: bold;"><B>Plane
similar to the existing one, but with another size of representing face. </B></span>by another <span style="font-weight: bold;"><B>Plane</B></span> or <span
</p> style="font-weight: bold;"><B>Local Coordinate System</B></span> and a <span
style="font-weight: bold;"><B>Size of the Plane</B></span>. </p>
<p class="whs2"><span style="font-weight: bold;"><B><b style="font-weight: bold;">TUI <p class="whs2"><span style="font-weight: bold;"><B><b style="font-weight: bold;">TUI
Command:</b> </B></span>geompy.MakePlaneFace(Face, TrimSize) </p> Command:</b> </B></span>geompy.MakePlaneFace(Face, TrimSize) </p>
<p class="whs2"><b style="font-weight: bold;">Arguments: </b>Name <p class="whs2"><b>Arguments: </b>Name + 1 face + 1 value (to
+ 1 face + 1 value (to define the size of the plane).</p> define the size of the plane).</p>
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>
<p class="whs7"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><img src="pics/plane3.png" x-maintain-ratio="TRUE" width="312px" height="385px" border="0" class="img_whs6"></font></span> </p> <p class="whs3"><img src="pics/plane3.png" x-maintain-ratio="TRUE" width="400px" height="315px" border="0" class="img_whs7"></p>
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>

View File

@ -143,50 +143,62 @@ if (window.writeIntopicBar)
<p class="whs1">import salome</p> <p class="whs1">import salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p> <p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># create a vertex and a vector</p> <p># create a vertex and a vector</p>
<p class="whs1">p1 = geompy.MakeVertex(35, <p class="whs1">p1 = geompy.MakeVertex(25,
35, 0)</p> 35, 45)</p>
<p class="whs1">p2 = geompy.MakeVertex(35, <p class="whs1">p2 = geompy.MakeVertex(70,
35, 70)</p> 70, 70)</p>
<p class="whs1">v = geompy.MakeVector(p1, <p class="whs1">v = geompy.MakeVector(p1,
p2)</p> p2)</p>
<p>&nbsp;</p> <p>&nbsp;</p>
<p># create cones</p> <p># create cylinders</p>
<p class="whs1">cone1 = geompy.MakeCone(p1, <p class="whs1">height = 40</p>
v, 17, 1, 20)</p>
<p class="whs1">cone2 = geompy.MakeConeR1R2H(30, <p class="whs1">&nbsp;</p>
10, 30)</p>
<p class="whs1">radius1 = 15</p>
<p class="whs1">cylinder1 = geompy.MakeCylinder(p1,
v, radius1, height)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">radius2 = 30</p>
<p class="whs1">cylinder2 = geompy.MakeCylinderRH(radius2,
height)</p>
<p class="whs1">&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># add objects in the study</p> <p># add objects in the study</p>
<p class="whs1">id_cone1 = geompy.addToStudy(cone1,&quot;Cone1&quot;)</p> <p class="whs1">id_cylinder1 = geompy.addToStudy(cylinder1,&quot;Cylinder1&quot;)</p>
<p class="whs1">id_cone2 = geompy.addToStudy(cone2,&quot;Cone2&quot;)</p> <p class="whs1">id_cylinder2 = geompy.addToStudy(cylinder2,&quot;Cylinder2&quot;)</p>
<p>&nbsp;</p> <p>&nbsp;</p>
<p># display cones</p> <p># display the cylinders</p>
<p class="whs1">gg.createAndDisplayGO(id_cone1)</p> <p class="whs1">gg.createAndDisplayGO(id_cylinder1)</p>
<p class="whs1">gg.setDisplayMode(id_cone1,1)</p> <p class="whs1">gg.setDisplayMode(id_cylinder1,1)</p>
<p class="whs1">gg.createAndDisplayGO(id_cone2)</p> <p class="whs1">gg.createAndDisplayGO(id_cylinder2)</p>
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_cone2,1)</span> <p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_cylinder2,1)</span>
</p> </p>
<p>&nbsp;</p> <p>&nbsp;</p>

View File

@ -81,11 +81,13 @@ if (window.writeIntopicBar)
</script> </script>
<h1><span style="font-size: 14pt;"><font size=4 style="font-size:14pt;"><img src="files/salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image57.gif" width="20px" height="20px" border="0" class="img_whs1"></font></span>Revolution</h1> <h1><span style="font-size: 14pt;"><font size=4 style="font-size:14pt;"><img src="files/salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image57.gif" width="20px" height="20px" border="0" class="img_whs1"></font></span>Revolution</h1>
<p><b><span style="font-weight: normal;">T</b>o</span> <span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">create <p><b><span style="font-weight: normal;">T</span></b><b><span style="font-weight: normal;">o</span>
an extruded shape by </font></span><span style="font-size: 12pt; font-weight: bold;"><font size=3 style="font-size:12pt;"><B>Revolution</B></font></span> <span style="font-weight: normal; font-size: 12pt;"><font size=3 style="font-size:12pt;">create an extruded
in the <span style="font-weight: bold;"><B>Main Menu</B></span> select <span shape by</font></span><span style="font-size: 12pt;"> <font size=3 style="font-size:12pt;"></font></span><span style="font-size: 12pt; font-weight: bold;"><font size=3 style="font-size:12pt;"><B>Revolution</B></font></span><span
style="font-weight: bold;"><B>New Entity - &gt; Generation &nbsp;- style="font-weight: normal;"> in the </span><span style="font-weight: bold;"><B>Main
&gt; Revolution</B></span></p> Menu</B></span><span style="font-weight: normal;"> select </span><span style="font-weight: bold;"><B>New
Entity - &gt; Generation &nbsp;-
&gt; Revolution</B></span></b></p>
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>

View File

@ -15,6 +15,7 @@ if (navigator.appName !="Netscape")
<style type="text/css"> <style type="text/css">
<!-- <!--
p.whs1 { font-family:'Lucida Console' , monospace; } p.whs1 { font-family:'Lucida Console' , monospace; }
p.whs2 { font-family:'Times New Roman' , serif; }
--> -->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript"> </style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!-- <!--
@ -347,7 +348,7 @@ if (window.writeIntopicBar)
<p>&nbsp;</p> <p>&nbsp;</p>
<p># create an object, symmetrical to the given one relatively the given <p># create an object, symmetrical to another object through the given
plane</p> plane</p>
<p class="whs1">p1 = geompy.MakeVertex( <p class="whs1">p1 = geompy.MakeVertex(
@ -367,7 +368,7 @@ if (window.writeIntopicBar)
<p>&nbsp;</p> <p>&nbsp;</p>
<p># create an object, symmetrical to the given one relatively the given <p># create an object, symmetrical to another object through the given
axis</p> axis</p>
<p class="whs1">p4 = geompy.MakeVertex( <p class="whs1">p4 = geompy.MakeVertex(
@ -384,7 +385,7 @@ if (window.writeIntopicBar)
<p>&nbsp;</p> <p>&nbsp;</p>
<p># create an object, symmetrical to the given one relatively the given <p># create an object, symmetrical to another object through the given
point</p> point</p>
<p class="whs1">mirror3 = geompy.MakeMirrorByPoint(box, <p class="whs1">mirror3 = geompy.MakeMirrorByPoint(box,
@ -450,18 +451,22 @@ if (window.writeIntopicBar)
<p class="whs1">import salome</p> <p class="whs1">import salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p> <p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># create a box and a sphere</p> <p class="whs2"># create a box and a
sphere</p>
<p class="whs1">box = geompy.MakeBoxDXDYDZ(200, <p class="whs1">box = geompy.MakeBoxDXDYDZ(200,
200, 200)</p> 200, 200)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># scale the given object by the factor</p> <p class="whs2"># scale the given object
by the factor</p>
<p class="whs1">p0 = geompy.MakeVertex(100, <p class="whs1">p0 = geompy.MakeVertex(100,
100, 100)</p> 100, 100)</p>
@ -471,9 +476,10 @@ if (window.writeIntopicBar)
<p class="whs1">scale = geompy.MakeScaleTransform(box, <p class="whs1">scale = geompy.MakeScaleTransform(box,
p0, factor)</p> p0, factor)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># add objects in the study</p> <p class="whs2"># add objects in the
study</p>
<p class="whs1">id_box = geompy.addToStudy(box, <p class="whs1">id_box = geompy.addToStudy(box,
&quot;Box&quot;)</p> &quot;Box&quot;)</p>
@ -481,14 +487,16 @@ if (window.writeIntopicBar)
<p class="whs1">id_scale = geompy.addToStudy(scale, <p class="whs1">id_scale = geompy.addToStudy(scale,
&quot;Scale&quot;)</p> &quot;Scale&quot;)</p>
<p>&nbsp;</p> <p class="whs1">&nbsp;</p>
<p># display the results</p> <p class="whs2"># display the results</p>
<p class="whs1">gg.createAndDisplayGO(id_box)</p> <p class="whs1">gg.createAndDisplayGO(id_box)</p>
<p class="whs1">gg.setDisplayMode(id_box,1)</p> <p class="whs1">gg.setDisplayMode(id_box,1)</p>
<p class="whs1">gg.setTransparency(id_box,0.5)</p>
<p class="whs1">gg.createAndDisplayGO(id_scale)</p> <p class="whs1">gg.createAndDisplayGO(id_scale)</p>
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_scale,1)</span> <p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_scale,1)</span>

View File

@ -22,6 +22,7 @@ aTE("Boolean Operations","boolean_operations.htm");
aTE("Box","box.htm"); aTE("Box","box.htm");
aTE("Building by Blocks","building_by_blocks.htm"); aTE("Building by Blocks","building_by_blocks.htm");
aTE("Chamfer","chamfer.htm"); aTE("Chamfer","chamfer.htm");
aTE("Change Orientation","change_orientation.htm");
aTE("Changing Display Parameters","changing_display_parameters.htm"); aTE("Changing Display Parameters","changing_display_parameters.htm");
aTE("Check Free Boundaries","check_free_boundaries.htm"); aTE("Check Free Boundaries","check_free_boundaries.htm");
aTE("Check Free Faces","check_free_faces.htm"); aTE("Check Free Faces","check_free_faces.htm");
@ -42,9 +43,9 @@ aTE("Explode on Blocks","explode_on_blocks.htm");
aTE("Extrusion","extrusion.htm"); aTE("Extrusion","extrusion.htm");
aTE("Face","face.htm"); aTE("Face","face.htm");
aTE("Introduction to GEOM","files/introduction_to_geom.htm"); aTE("Introduction to GEOM","files/introduction_to_geom.htm");
aTE("Titre","files/salome2_sp3_booleangui_functions.htm"); aTE("Using Boolean Operations","files/salome2_sp3_booleangui_functions.htm");
aTE("Titre","files/salome2_sp3_geomtoolsgui_functions.htm"); aTE("Importing and exporting geometrical objects","files/salome2_sp3_geomtoolsgui_functions.htm");
aTE("Titre","files/salome2_sp3_measuregui_functions.htm"); aTE("Using Measurement Tools","files/salome2_sp3_measuregui_functions.htm");
aTE("Fillet","fillet.htm"); aTE("Fillet","fillet.htm");
aTE("Filling","filling.htm"); aTE("Filling","filling.htm");
aTE("Fuse","fuse.htm"); aTE("Fuse","fuse.htm");

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
<script language="javascript" src="whtdata.js"></script> <script language="javascript" src="whtdata.js"></script>
<script language="javascript"> <script language="javascript">
<!-- <!--
aTE(1,97,"Geometry module"); aTE(1,98,"Geometry module");
aTE(2,0,"Introduction to Geometry","geometry.htm"); aTE(2,0,"Introduction to Geometry","geometry.htm");
aTE(2,0,"Importing/exporting geometrical objects","files/salome2_sp3_geomtoolsgui_functions.htm"); aTE(2,0,"Importing/exporting geometrical objects","files/salome2_sp3_geomtoolsgui_functions.htm");
aTE(1,33,"Creating geometrical objects"); aTE(1,33,"Creating geometrical objects");
@ -33,7 +33,7 @@
aTE(2,0,"Extrusion","extrusion.htm"); aTE(2,0,"Extrusion","extrusion.htm");
aTE(2,0,"Revolution","revolution.htm"); aTE(2,0,"Revolution","revolution.htm");
aTE(2,0,"Filling","filling.htm"); aTE(2,0,"Filling","filling.htm");
aTE(2,0,"Pipe","pipe_creation.htm"); aTE(2,0,"Extrusion along a path","pipe_creation.htm");
aTE(2,0,"Working with groups","working_with_groups.htm"); aTE(2,0,"Working with groups","working_with_groups.htm");
aTE(2,0,"Building by blocks","newentity_blocks.htm"); aTE(2,0,"Building by blocks","newentity_blocks.htm");
aTE(2,0,"Sketcher","sketcher.htm"); aTE(2,0,"Sketcher","sketcher.htm");
@ -52,7 +52,7 @@
aTE(2,0,"Color","color.htm"); aTE(2,0,"Color","color.htm");
aTE(2,0,"Transparency","transparency.htm"); aTE(2,0,"Transparency","transparency.htm");
aTE(2,0,"Isolines","isos.htm"); aTE(2,0,"Isolines","isos.htm");
aTE(1,35,"Transforming geometrical objects"); aTE(1,36,"Transforming geometrical objects");
aTE(1,2,"Basic Operations"); aTE(1,2,"Basic Operations");
aTE(2,0,"Partition","partition.htm"); aTE(2,0,"Partition","partition.htm");
aTE(2,0,"Archimede","archimede.htm"); aTE(2,0,"Archimede","archimede.htm");
@ -77,7 +77,7 @@
aTE(2,0,"Multi Transformation","multi_transformation.htm"); aTE(2,0,"Multi Transformation","multi_transformation.htm");
aTE(2,0,"Explode on Blocks","explode_on_blocks.htm"); aTE(2,0,"Explode on Blocks","explode_on_blocks.htm");
aTE(2,0,"Propagate","propagate.htm"); aTE(2,0,"Propagate","propagate.htm");
aTE(1,10,"Repairing Operations"); aTE(1,11,"Repairing Operations");
aTE(2,0,"Shape Processing","shape_processing.htm"); aTE(2,0,"Shape Processing","shape_processing.htm");
aTE(2,0,"Suppress Faces","suppress_faces.htm"); aTE(2,0,"Suppress Faces","suppress_faces.htm");
aTE(2,0,"Close Contour","close_contour.htm"); aTE(2,0,"Close Contour","close_contour.htm");
@ -88,8 +88,9 @@
aTE(2,0,"Add Point on Edge","add_point_on_edge.htm"); aTE(2,0,"Add Point on Edge","add_point_on_edge.htm");
aTE(2,0,"Check Free Boundaries","check_free_boundaries.htm"); aTE(2,0,"Check Free Boundaries","check_free_boundaries.htm");
aTE(2,0,"Check Free Faces","check_free_faces.htm"); aTE(2,0,"Check Free Faces","check_free_faces.htm");
aTE(2,0,"Change Orientation","change_orientation.htm");
aTE(2,0,"Using measurement tools","files/salome2_sp3_measuregui_functions.htm"); aTE(2,0,"Using measurement tools","files/salome2_sp3_measuregui_functions.htm");
aTE(2,0,"Access to Geometry module functionality from Python (using geompy.py)","geompy_doc/namespacegeompy.html"); aTE(2,0,"Python interface geompy.py" , geompy_doc/namespacegeompy.html");
aTE(1,16,"TUI Scripts"); aTE(1,16,"TUI Scripts");
aTE(2,0,"Viewing Geometrical Objects","changing_display_parameters.htm"); aTE(2,0,"Viewing Geometrical Objects","changing_display_parameters.htm");
aTE(1,7,"Creating Geometric Objects"); aTE(1,7,"Creating Geometric Objects");

View File

@ -49,7 +49,7 @@ img {vertial-align:middle;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a name="15"></a><a href="whlstt15.htm#15" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Creating Geometric Objects</a></nobr><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a name="15"></a><a href="whlstt15.htm#15" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Creating Geometric Objects</a></nobr><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a name="16"></a><a href="whlstt16.htm#16" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Transformation</a></nobr><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a name="16"></a><a href="whlstt16.htm#16" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Transformation</a></nobr><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../measurement_tools.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Measurement Tools</a></nobr><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../measurement_tools.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Measurement Tools</a></nobr><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../geompy_doc/namespacegeompy.html"><img src="../wht_toc3.gif" border="0" align="absmiddle"> Access to Geometry module functionality from Python (using geompy.py)</a></nobr><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../geompy_doc/namespacegeompy.html"><img src="../wht_toc3.gif" border="0" align="absmiddle"> Python interface geompy.py</a></nobr><br>
</p> </p>
</td></tr> </td></tr>

View File

@ -10,6 +10,7 @@
<topic name="Box" url="box.htm" /> <topic name="Box" url="box.htm" />
<topic name="Building by Blocks" url="building_by_blocks.htm" /> <topic name="Building by Blocks" url="building_by_blocks.htm" />
<topic name="Chamfer" url="chamfer.htm" /> <topic name="Chamfer" url="chamfer.htm" />
<topic name="Change Orientation" url="change_orientation.htm" />
<topic name="Changing Display Parameters" url="changing_display_parameters.htm" /> <topic name="Changing Display Parameters" url="changing_display_parameters.htm" />
<topic name="Check Free Boundaries" url="check_free_boundaries.htm" /> <topic name="Check Free Boundaries" url="check_free_boundaries.htm" />
<topic name="Check Free Faces" url="check_free_faces.htm" /> <topic name="Check Free Faces" url="check_free_faces.htm" />
@ -30,9 +31,9 @@
<topic name="Extrusion" url="extrusion.htm" /> <topic name="Extrusion" url="extrusion.htm" />
<topic name="Face" url="face.htm" /> <topic name="Face" url="face.htm" />
<topic name="Introduction to GEOM" url="files/introduction_to_geom.htm" /> <topic name="Introduction to GEOM" url="files/introduction_to_geom.htm" />
<topic name="Titre" url="files/salome2_sp3_booleangui_functions.htm" /> <topic name="Using Boolean Operations" url="files/salome2_sp3_booleangui_functions.htm" />
<topic name="Titre" url="files/salome2_sp3_geomtoolsgui_functions.htm" /> <topic name="Importing and exporting geometrical objects" url="files/salome2_sp3_geomtoolsgui_functions.htm" />
<topic name="Titre" url="files/salome2_sp3_measuregui_functions.htm" /> <topic name="Using Measurement Tools" url="files/salome2_sp3_measuregui_functions.htm" />
<topic name="Fillet" url="fillet.htm" /> <topic name="Fillet" url="fillet.htm" />
<topic name="Filling" url="filling.htm" /> <topic name="Filling" url="filling.htm" />
<topic name="Fuse" url="fuse.htm" /> <topic name="Fuse" url="fuse.htm" />

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,7 @@
<item name="Extrusion" url="extrusion.htm" /> <item name="Extrusion" url="extrusion.htm" />
<item name="Revolution" url="revolution.htm" /> <item name="Revolution" url="revolution.htm" />
<item name="Filling" url="filling.htm" /> <item name="Filling" url="filling.htm" />
<item name="Pipe" url="pipe_creation.htm" /> <item name="Extrusion along a path" url="pipe_creation.htm" />
</book> </book>
<item name="Working with groups" url="working_with_groups.htm" /> <item name="Working with groups" url="working_with_groups.htm" />
<item name="Building by blocks" url="newentity_blocks.htm" /> <item name="Building by blocks" url="newentity_blocks.htm" />
@ -90,10 +90,12 @@
<item name="Add Point on Edge" url="add_point_on_edge.htm" /> <item name="Add Point on Edge" url="add_point_on_edge.htm" />
<item name="Check Free Boundaries" url="check_free_boundaries.htm" /> <item name="Check Free Boundaries" url="check_free_boundaries.htm" />
<item name="Check Free Faces" url="check_free_faces.htm" /> <item name="Check Free Faces" url="check_free_faces.htm" />
<item name="Change Orientation" url="change_orientation.htm" />
</book> </book>
</book> </book>
<item name="Using measurement tools" url="files/salome2_sp3_measuregui_functions.htm" /> <item name="Using measurement tools" url="files/salome2_sp3_measuregui_functions.htm" />
<item name="Access to Geometry module functionality from Python (using geompy.py)" url="geompy_doc/namespacegeompy.html" /> <item name="Python Interface geompy.py" url="geompy_doc/namespacegeompy.html" />
<book name="TUI Scripts" > <book name="TUI Scripts" >
<item name="Viewing Geometrical Objects" url="changing_display_parameters.htm" /> <item name="Viewing Geometrical Objects" url="changing_display_parameters.htm" />
<book name="Creating Geometric Objects" > <book name="Creating Geometric Objects" >

View File

@ -17,7 +17,7 @@ if (navigator.appName !="Netscape")
img_whs1 { width:20px; height:20px; border-style:none; } img_whs1 { width:20px; height:20px; border-style:none; }
p.whs2 { font-size:12pt; } p.whs2 { font-size:12pt; }
p.whs3 { font-size:12pt; margin-left:40px; } p.whs3 { font-size:12pt; margin-left:40px; }
img_whs4 { border:none; width:312px; height:231px; float:none; border-style:none; } img_whs4 { border:none; width:400px; height:231px; float:none; }
img_whs5 { border:none; width:312px; height:266px; float:none; border-style:none; } img_whs5 { border:none; width:312px; height:266px; float:none; border-style:none; }
img_whs6 { border:none; width:312px; height:274px; float:none; border-style:none; } img_whs6 { border:none; width:312px; height:274px; float:none; border-style:none; }
--> -->
@ -93,14 +93,17 @@ if (window.writeIntopicBar)
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>
<p class="whs2">Firstly, you can select a <span style="font-weight: bold;"><B>Plane</B></span> <p class="whs2">Firstly, you can select a <span style="font-weight: bold;"><B>Plane</B></span>,<span
or a <span style="font-weight: bold;"><B>Planar Face</B></span> to be your <span style="font-weight: bold;"> <B></B></span>a <span style="font-weight: bold;"><B>Planar
style="font-weight: bold;"><B>Working Plane</B></span></p> Face</B></span> or a <span style="font-weight: bold;"><B>Local Coordinate System</B></span>
to be your <span style="font-weight: bold;"><B>Working Plane</B></span></p>
<p class="whs2"><b style="font-weight: bold;">Arguments:</b> <p class="whs2"><b>Arguments:</b> Name + 1 selection (face
Name + 1 selection (face or planar face), </p> or planar face), </p>
<p class="whs3"><img src="pics/workplane4.png" x-maintain-ratio="TRUE" width="312px" height="231px" border="0" class="img_whs4"></p> <p class="whs2">&nbsp;</p>
<p class="whs3"><img src="pics/workplane4.png" x-maintain-ratio="TRUE" width="400px" height="231px" border="0" class="img_whs4"></p>
<p class="whs2">&nbsp;</p> <p class="whs2">&nbsp;</p>

View File

@ -339,7 +339,7 @@ module GEOM
/*! /*!
* Create a plane, similar to the existing one, but with another size of representing face. * Create a plane, similar to the existing one, but with another size of representing face.
* \param theFace Referenced plane. * \param theFace Referenced plane or LCS(Marker).
* \param theTrimSize New half size of a side of quadrangle face, representing the plane. * \param theTrimSize New half size of a side of quadrangle face, representing the plane.
* \return New GEOM_Object, containing the created plane. * \return New GEOM_Object, containing the created plane.
*/ */
@ -616,15 +616,31 @@ module GEOM
in double theFactor); in double theFactor);
/*! /*!
* Modify the Location of the given object by LCS * Modify the Location of the given object by LCS.
* \param theObject The object to be displaced.
* \param theStartLCS Coordinate system to perform displacement from it.
* If \a theStartLCS is NULL, displacement
* will be performed from global CS.
* If \a theObject itself is used as \a theStartLCS,
* its location will be changed to \a theEndLCS.
* \param theEndLCS Coordinate system to perform displacement to it.
* \return theObject.
*/ */
GEOM_Object PositionShape (in GEOM_Object theObject, GEOM_Object PositionShape (in GEOM_Object theObject,
in GEOM_Object theStartLCS, in GEOM_Object theStartLCS,
in GEOM_Object theEndLCS); in GEOM_Object theEndLCS);
/*! /*!
* Modify the Location of the given object by LCS * Modify the Location of the given object by LCS,
* creating its copy before the setting * creating its copy before the setting.
* \param theObject The object to be displaced.
* \param theStartLCS Coordinate system to perform displacement from it.
* If \a theStartLCS is NULL, displacement
* will be performed from global CS.
* If \a theObject itself is used as \a theStartLCS,
* its location will be changed to \a theEndLCS.
* \param theEndLCS Coordinate system to perform displacement to it.
* \return New GEOM_Object, containing the displaced shape.
*/ */
GEOM_Object PositionShapeCopy (in GEOM_Object theObject, GEOM_Object PositionShapeCopy (in GEOM_Object theObject,
in GEOM_Object theStartLCS, in GEOM_Object theStartLCS,
@ -868,7 +884,7 @@ module GEOM
/*! /*!
* Create a face on the given wire. * Create a face on the given wire.
* \param theWire Wire to build the face on. * \param theWire closed Wire or Edge to build the face on.
* \param isPlanarWanted If TRUE, only planar face will be built. * \param isPlanarWanted If TRUE, only planar face will be built.
* If impossible, NULL object will be returned. * If impossible, NULL object will be returned.
* \return New GEOM_Object, containing the created face. * \return New GEOM_Object, containing the created face.
@ -877,7 +893,7 @@ module GEOM
/*! /*!
* Create a face on the given wires set. * Create a face on the given wires set.
* \param theWires List of wires to build the face on. * \param theWires List of closed wires or edges to build the face on.
* \param isPlanarWanted If TRUE, only planar face will be built. * \param isPlanarWanted If TRUE, only planar face will be built.
* If impossible, NULL object will be returned. * If impossible, NULL object will be returned.
* \return New GEOM_Object, containing the created face. * \return New GEOM_Object, containing the created face.
@ -1037,6 +1053,24 @@ module GEOM
in long theShapeType, in long theShapeType,
in GEOM_Object theAx1, in GEOM_Object theAx1,
in shape_state theState); in shape_state theState);
/*!
* Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
* the specified plane by the certain way, defined through \a theState parameter.
* \param theShape Shape to find sub-shapes of.
* \param theShapeType Type of sub-shapes to be retrieved.
* \param theAx1 Vector (or line, or linear edge), specifying normal
* direction of the plane to find shapes on.
* \param thePnt Point specifying location of the plane to find shapes on.
* \param theState The state of the subshapes to find.
* \return List of all found sub-shapes.
*/
ListOfGO GetShapesOnPlaneWithLocation (in GEOM_Object theShape,
in long theShapeType,
in GEOM_Object theAx1,
in GEOM_Object thePnt,
in shape_state theState);
/*! /*!
* Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
@ -1106,6 +1140,23 @@ module GEOM
in GEOM_Object theAx1, in GEOM_Object theAx1,
in shape_state theState); in shape_state theState);
/*!
* Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
* the specified plane by the certain way, defined through \a theState parameter.
* \param theShape Shape to find sub-shapes of.
* \param theShapeType Type of sub-shapes to be retrieved.
* \param theAx1 Vector (or line, or linear edge), specifying normal
* direction of the plane to find shapes on.
* \param thePnt Point specifying location of the plane to find shapes on.
* \param theState The state of the subshapes to find.
* \return List of IDs of all found sub-shapes.
*/
ListOfLong GetShapesOnPlaneWithLocationIDs (in GEOM_Object theShape,
in long theShapeType,
in GEOM_Object theAx1,
in GEOM_Object thePnt,
in shape_state theState);
/*! /*!
* Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
* the specified cylinder by the certain way, defined through \a theState parameter. * the specified cylinder by the certain way, defined through \a theState parameter.
@ -1667,7 +1718,7 @@ module GEOM
* For format of the description string see the previous method.\n * For format of the description string see the previous method.\n
* \param theCommand String, defining the sketcher in local * \param theCommand String, defining the sketcher in local
* coordinates of the working plane. * coordinates of the working plane.
* \param theWorkingPlane Planar Face of the working plane. * \param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
* \return New GEOM_Object, containing the created wire. * \return New GEOM_Object, containing the created wire.
*/ */
GEOM_Object MakeSketcherOnPlane (in string theCommand, in GEOM_Object theWorkingPlane); GEOM_Object MakeSketcherOnPlane (in string theCommand, in GEOM_Object theWorkingPlane);
@ -1894,6 +1945,15 @@ module GEOM
boolean GetFreeBoundary (in GEOM_Object theObject, boolean GetFreeBoundary (in GEOM_Object theObject,
out ListOfGO theClosedWires, out ListOfGO theClosedWires,
out ListOfGO theOpenWires); out ListOfGO theOpenWires);
/*!
* Change orientation of the given object.
* \param theObject Shape to be processed.
* \return New GEOM_Object, containing processed shape.
*/
GEOM_Object ChangeOrientation (in GEOM_Object theObject);
GEOM_Object ChangeOrientationCopy (in GEOM_Object theObject);
}; };
/*! /*!
@ -1952,6 +2012,22 @@ module GEOM
*/ */
interface GEOM_IMeasureOperations : GEOM_IOperations interface GEOM_IMeasureOperations : GEOM_IOperations
{ {
/*!
* Get position (LCS) of theShape.
* \param theShape Shape to calculate position of.
* \param Ox,Oy,Oz Output. Coordinates of shape's location origin.
* Origin of the LCS is situated at the shape's center of mass.
* \param Zx,Zy,Zz Output. Coordinates of shape's location normal(main) direction.
* \param Xx,Xy,Xz Output. Coordinates of shape's location X direction.
* Axes of the LCS are obtained from shape's location or,
* if the shape is a planar face, from position of its plane.
* \return Returns position of the shape through the last nine arguments.
*/
void GetPosition (in GEOM_Object theShape,
out double Ox, out double Oy, out double Oz,
out double Zx, out double Zy, out double Zz,
out double Xx, out double Xy, out double Xz);
/*! /*!
* Get summarized length of all wires, * Get summarized length of all wires,
* area of surface and volume of the given shape. * area of surface and volume of the given shape.
@ -2021,6 +2097,15 @@ module GEOM
boolean CheckShape (in GEOM_Object theShape, boolean CheckShape (in GEOM_Object theShape,
out string theDescription); out string theDescription);
/*!
* Check a topology and a geometry of the given shape.
* \param theShape Shape to check validity of.
* \param theDescription Output. Description of problems in the shape, if they are.
* \return TRUE, if the shape "seems to be valid".
*/
boolean CheckShapeWithGeometry (in GEOM_Object theShape,
out string theDescription);
/*! /*!
* Obtain description of the given shape * Obtain description of the given shape
* \param theShape Shape to be described. * \param theShape Shape to be described.

View File

@ -6,12 +6,17 @@
</section> </section>
<section name="resources"> <section name="resources">
<!-- Module resources --> <!-- Module resources -->
<parameter name="GEOM" value="${GEOM_ROOT_DIR}/share/salome/resources"/> <parameter name="GEOM" value="${GEOM_ROOT_DIR}/share/salome/resources/geom"/>
</section> </section>
<section name="Geometry" > <section name="Geometry" >
<!-- Other module preferences --> <!-- Other module preferences -->
<parameter name="SettingsGeomStep" value="10" /> <parameter name="SettingsGeomStep" value="10" />
<parameter name="display_mode" value="0" /> <parameter name="display_mode" value="0" />
<parameter name="shading_color" value="255, 255, 0" /> <parameter name="shading_color" value="255, 255, 0" />
<parameter name="wireframe_color" value="255, 255, 0" />
<parameter name="free_bound_color" value="0, 255, 0" />
<parameter name="line_color" value="255, 0, 0" />
<parameter name="point_color" value="255, 255, 0" />
<parameter name="isos_color" value="200, 200, 200" />
</section> </section>
</document> </document>

BIN
resources/change_orientation.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

BIN
resources/prism2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

View File

@ -57,15 +57,6 @@
using namespace std; using namespace std;
//=======================================================================
// function : GetBasicGUI()
// purpose : Get the only BasicGUI object [ static ]
//=======================================================================
BasicGUI* BasicGUI::GetBasicGUI( GeometryGUI* parent )
{
return new BasicGUI( parent );
}
//======================================================================= //=======================================================================
// function : BasicGUI() // function : BasicGUI()
// purpose : Constructor // purpose : Constructor
@ -146,37 +137,40 @@ bool BasicGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin
QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox(); QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox();
// Create Point dialog, OCC viewer // Create Point dialog, OCC viewer
if ( aDlg && aDlg->isA( "BasicGUI_PointDlg" ) && theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() && pe->state() != Qt::ControlButton ) if ( aDlg && aDlg->isA( "BasicGUI_PointDlg" ) &&
theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() &&
pe->state() != Qt::ControlButton )
{ {
BasicGUI_PointDlg* aPntDlg = (BasicGUI_PointDlg*) aDlg; BasicGUI_PointDlg* aPntDlg = (BasicGUI_PointDlg*) aDlg;
if ( aPntDlg->acceptMouseEvent() ) if ( aPntDlg->acceptMouseEvent() )
{
OCCViewer_Viewer* anOCCViewer =
((OCCViewer_ViewManager*)(theViewWindow->getViewManager()))->getOCCViewer();
Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();
gp_Pnt aPnt;
ic->InitSelected();
if ( pe->state() == Qt::ShiftButton )
ic->ShiftSelect(); // Append selection
else
ic->Select(); // New selection
ic->InitSelected();
if ( ic->MoreSelected() )
{ {
OCCViewer_Viewer* anOCCViewer = ((OCCViewer_ViewManager*)(theViewWindow->getViewManager()))->getOCCViewer(); TopoDS_Shape aShape = ic->SelectedShape();
Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext(); if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
}
else
{
OCCViewer_ViewPort3d* vp = ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort();
aPnt = ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
}
gp_Pnt aPnt; aPntDlg->OnPointSelected( aPnt ); // "feed" the point to point construction dialog
} // acceptMouseEvent()
ic->InitSelected();
if( pe->state() == Qt::ShiftButton )
ic->ShiftSelect(); // Append selection
else
ic->Select(); // New selection
ic->InitSelected();
if( ic->MoreSelected() )
{
TopoDS_Shape aShape = ic->SelectedShape();
if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
}
else
{
OCCViewer_ViewPort3d* vp = ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort();
aPnt = ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
}
aPntDlg->OnPointSelected( aPnt ); // "feed" the point to point construction dialog
} // acceptMouseEvent()
} }
return false; return false;
} }
@ -216,6 +210,6 @@ extern "C"
GEOM_BASICGUI_EXPORT GEOM_BASICGUI_EXPORT
GEOMGUI* GetLibGUI( GeometryGUI* parent ) GEOMGUI* GetLibGUI( GeometryGUI* parent )
{ {
return BasicGUI::GetBasicGUI( parent ); return new BasicGUI( parent );
} }
} }

View File

@ -40,15 +40,10 @@
//================================================================================= //=================================================================================
class GEOM_BASICGUI_EXPORT BasicGUI : public GEOMGUI class GEOM_BASICGUI_EXPORT BasicGUI : public GEOMGUI
{ {
protected:
BasicGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
public: public:
BasicGUI( GeometryGUI* parent );
~BasicGUI(); ~BasicGUI();
// Get the only BasicGUI object
static BasicGUI* GetBasicGUI( GeometryGUI* parent );
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent); bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
bool OnMousePress(QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow); bool OnMousePress(QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow);

View File

@ -125,7 +125,7 @@ void BasicGUI_CircleDlg::Init()
double aStep = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); double aStep = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes & initial values */ /* min, max, step and decimals for spin boxes & initial values */
GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, aStep, 3); GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
GroupPntVecR->SpinBox_DX->SetValue( 100 ); GroupPntVecR->SpinBox_DX->SetValue( 100 );
/* signals and slots connections */ /* signals and slots connections */

View File

@ -40,7 +40,7 @@
// class : BasicGUI_CircleDlg // class : BasicGUI_CircleDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class BasicGUI_CircleDlg : public GEOMBase_Skeleton class GEOM_BASICGUI_EXPORT BasicGUI_CircleDlg : public GEOMBase_Skeleton
{ {
Q_OBJECT Q_OBJECT

View File

@ -114,8 +114,8 @@ void BasicGUI_EllipseDlg::Init()
double aMajorR( 200. ), aMinorR( 100. ); double aMajorR( 200. ), aMinorR( 100. );
/* min, max, step and decimals for spin boxes & initial values */ /* min, max, step and decimals for spin boxes & initial values */
GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, 999.999, step, 3 ); GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 );
GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, 999.999, step, 3 ); GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 );
GroupPoints->SpinBox_DX->SetValue( aMajorR ); GroupPoints->SpinBox_DX->SetValue( aMajorR );
GroupPoints->SpinBox_DY->SetValue( aMinorR ); GroupPoints->SpinBox_DY->SetValue( aMinorR );

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // 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
// //
// //
// //
@ -37,21 +37,21 @@
#include <qlabel.h> #include <qlabel.h>
#include "GEOMImpl_Types.hxx" #include "GEOMImpl_Types.hxx"
#include "utilities.h" #include "utilities.h"
// OCCT Includes
#include <BRep_Tool.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
#include <TopAbs.hxx> #include <TopAbs.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <TColStd_IndexedMapOfInteger.hxx> #include <Geom_Plane.hxx>
#include <TopTools_IndexedMapOfShape.hxx> #include <TopTools_IndexedMapOfShape.hxx>
#include <BRep_Tool.hxx> #include <TColStd_IndexedMapOfInteger.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
#include <Geom_Plane.hxx>
#include <GProp_GProps.hxx>
#include <BRepGProp.hxx>
//================================================================================= //=================================================================================
// class : BasicGUI_MarkerDlg() // class : BasicGUI_MarkerDlg()
@ -176,7 +176,7 @@ void BasicGUI_MarkerDlg::Init()
for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter ) for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter )
{ {
anIter.data()->RangeStepAndValidator( -999.999, 999.999, step, 3 ); anIter.data()->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, 3 );
connect( anIter.data(), SIGNAL( valueChanged( double ) ), connect( anIter.data(), SIGNAL( valueChanged( double ) ),
this, SLOT( onValueChanged( double ) ) ); this, SLOT( onValueChanged( double ) ) );
} }
@ -243,7 +243,7 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
{ {
Group2->hide(); Group2->hide();
aMainGrp->hide(); aMainGrp->hide();
resize(0, 0); //PAL6669: resize(0, 0);
Group1->show(); Group1->show();
globalSelection( GEOM_ALLGEOM ); globalSelection( GEOM_ALLGEOM );
@ -255,7 +255,7 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
{ {
aMainGrp->hide(); aMainGrp->hide();
Group1->show(); Group1->show();
resize(0, 0); //PAL6669: resize(0, 0);
Group2->show(); Group2->show();
globalSelection( GEOM_POINT ); globalSelection( GEOM_POINT );
@ -314,16 +314,18 @@ void BasicGUI_MarkerDlg::onSelectionDone0()
{ {
if ( IObjectCount() == 1 ) if ( IObjectCount() == 1 )
{ {
Standard_Boolean aRes = Standard_False; Standard_Boolean aRes = Standard_False;
Handle(SALOME_InteractiveObject) anIO = firstIObject(); Handle(SALOME_InteractiveObject) anIO = firstIObject();
GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO, aRes ); GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
if ( aRes && !aSelectedObj->_is_nil() ) if ( aRes && !aSelectedObj->_is_nil() )
{ {
TopoDS_Shape aShape; TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{ {
// Existing LCS selected
if ( aSelectedObj->GetType() == GEOM_MARKER && aShape.ShapeType() == TopAbs_FACE ) if ( aSelectedObj->GetType() == GEOM_MARKER && aShape.ShapeType() == TopAbs_FACE )
{ {
TopoDS_Face aFace = TopoDS::Face( aShape ); TopoDS_Face aFace = TopoDS::Face( aShape );
@ -347,23 +349,22 @@ void BasicGUI_MarkerDlg::onSelectionDone0()
myData[ DX2 ]->SetValue( aYDir.X() ); myData[ DX2 ]->SetValue( aYDir.X() );
myData[ DY2 ]->SetValue( aYDir.Y() ); myData[ DY2 ]->SetValue( aYDir.Y() );
myData[ DZ2 ]->SetValue( aYDir.Z() ); myData[ DZ2 ]->SetValue( aYDir.Z() );
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->clearSelected(); aSelMgr->clearSelected();
} }
} }
else else
{ {
TColStd_IndexedMapOfInteger aMap; TColStd_IndexedMapOfInteger aMap;
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( anIO, aMap ); aSelMgr->GetIndexes( anIO, aMap );
if ( aMap.Extent() == 1 ) if ( aMap.Extent() == 1 )
{ {
int anIndex = aMap( 1 ); int anIndex = aMap( 1 );
TopTools_IndexedMapOfShape aShapes; TopTools_IndexedMapOfShape aShapes;
TopExp::MapShapes( aShape, aShapes ); TopExp::MapShapes( aShape, aShapes );
aShape = aShapes.FindKey( anIndex ); aShape = aShapes.FindKey( anIndex );
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->clearSelected(); aSelMgr->clearSelected();
} }
if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
{ {
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) ); gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
@ -386,13 +387,11 @@ void BasicGUI_MarkerDlg::onSelectionDone0()
//================================================================================= //=================================================================================
void BasicGUI_MarkerDlg::onSelectionDone() void BasicGUI_MarkerDlg::onSelectionDone()
{ {
if ( getConstructorId() == 0 ) if ( getConstructorId() == 0 ) {
{
onSelectionDone0(); onSelectionDone0();
return; return;
} }
myEditCurrentArgument->setText(""); myEditCurrentArgument->setText("");
QString aName; QString aName;
@ -403,82 +402,60 @@ void BasicGUI_MarkerDlg::onSelectionDone()
if ( !CORBA::is_nil( aSelectedObj ) && aRes ) { if ( !CORBA::is_nil( aSelectedObj ) && aRes ) {
aName = GEOMBase::GetName( aSelectedObj ); aName = GEOMBase::GetName( aSelectedObj );
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) ) {
GEOM::short_array anIndexes;
TColStd_IndexedMapOfInteger aMap; if ( getConstructorId() == 1 ) { // by shape position
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( anIO, aMap ); // Get shape's position
CORBA::Double Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz, Yx,Yy,Yz;
Ox = Oy = Oz = Zx = Zy = Xy = Xz = Yx = Yz = 0;
Zz = Xx = Yy = 1.;
if ( !aMap.IsEmpty() ) { GEOM::GEOM_IMeasureOperations_ptr aMeasureOp =
int anIndex = aMap( 1 ); myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId());
TopTools_IndexedMapOfShape aShapes; aMeasureOp->GetPosition(aSelectedObj, Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz);
TopExp::MapShapes( aShape, aShapes );
aShape = aShapes.FindKey( anIndex );
}
if ( getConstructorId() == 1 ) { // Calculate Y direction
if ( !aShape.IsNull() ) { if (aMeasureOp->IsDone()) {
gp_Pnt aPnt; gp_Pnt aPnt (Ox,Oy,Oz);
if (aShape.ShapeType() == TopAbs_VERTEX) { gp_Dir aDirN (Zx,Zy,Zz);
aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShape)); gp_Dir aDirX (Xx,Xy,Xz);
} gp_Ax3 anAx3 (aPnt, aDirN, aDirX);
else {
GProp_GProps aSystem;
if (aShape.ShapeType() == TopAbs_EDGE || aShape.ShapeType() == TopAbs_WIRE)
BRepGProp::LinearProperties(aShape, aSystem);
else if (aShape.ShapeType() == TopAbs_FACE || aShape.ShapeType() == TopAbs_SHELL)
BRepGProp::SurfaceProperties(aShape, aSystem);
else
BRepGProp::VolumeProperties(aShape, aSystem);
aPnt = aSystem.CentreOfMass(); gp_Dir aDirY = anAx3.YDirection();
} aDirY.Coord(Yx,Yy,Yz);
}
gp_Ax3 anAx3; // Set values
anAx3.Transform(aShape.Location().Transformation()); myData[ X ]->SetValue( Ox );
if(aShape.ShapeType() == TopAbs_FACE) { myData[ Y ]->SetValue( Oy );
Handle(Geom_Surface) aGS = BRep_Tool::Surface( TopoDS::Face( aShape ) ); myData[ Z ]->SetValue( Oz );
if (!aGS.IsNull() && aGS->IsKind( STANDARD_TYPE( Geom_Plane ) ) ) {
Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast( aGS );
gp_Pln aPln = aGPlane->Pln();
anAx3 = aPln.Position();
}
}
gp_Dir aDirX = anAx3.XDirection(); myData[ DX1 ]->SetValue( Xx );
gp_Dir aDirY = anAx3.YDirection(); myData[ DY1 ]->SetValue( Xy );
myData[ DZ1 ]->SetValue( Xz );
myData[ X ]->SetValue( aPnt.X() ); myData[ DX2 ]->SetValue( Yx );
myData[ Y ]->SetValue( aPnt.Y() ); myData[ DY2 ]->SetValue( Yy );
myData[ Z ]->SetValue( aPnt.Z() ); myData[ DZ2 ]->SetValue( Yz );
myData[ DX1 ]->SetValue( aDirX.X() ); myEditCurrentArgument->setText( aName );
myData[ DY1 ]->SetValue( aDirX.Y() ); }
myData[ DZ1 ]->SetValue( aDirX.Z() ); else if ( getConstructorId() == 2 ) { // by point and two vectors
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) ) {
GEOM::short_array anIndexes;
myData[ DX2 ]->SetValue( aDirY.X() ); TColStd_IndexedMapOfInteger aMap;
myData[ DY2 ]->SetValue( aDirY.Y() ); LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
myData[ DZ2 ]->SetValue( aDirY.Z() ); aSelMgr->GetIndexes( anIO, aMap );
myEditCurrentArgument->setText( aName ); if ( !aMap.IsEmpty() ) {
} int anIndex = aMap( 1 );
else { TopTools_IndexedMapOfShape aShapes;
myData[ X ]->SetValue( 0 ); TopExp::MapShapes( aShape, aShapes );
myData[ Y ]->SetValue( 0 ); aShape = aShapes.FindKey( anIndex );
myData[ Z ]->SetValue( 0 ); }
myData[ DX1 ]->SetValue( 0 ); if (myEditCurrentArgument == Group2->LineEdit1) {
myData[ DY1 ]->SetValue( 0 );
myData[ DZ1 ]->SetValue( 0 );
myData[ DX2 ]->SetValue( 0 );
myData[ DY2 ]->SetValue( 0 );
myData[ DZ2 ]->SetValue( 0 );
}
}
else if ( getConstructorId() == 2 ) {
if (myEditCurrentArgument == Group2->LineEdit1) {
if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) { if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) {
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) ); gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
myData[ X ]->SetValue( aPnt.X() ); myData[ X ]->SetValue( aPnt.X() );
@ -734,17 +711,3 @@ void BasicGUI_MarkerDlg::displayPreview ( const bool activate,
} }
} }
} }

View File

@ -33,6 +33,8 @@
#include "SalomeApp_Application.h" #include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h" #include "LightApp_SelectionMgr.h"
#include <TColStd_MapOfInteger.hxx>
#include <qlabel.h> #include <qlabel.h>
#include "GEOMImpl_Types.hxx" #include "GEOMImpl_Types.hxx"
@ -89,7 +91,7 @@ BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(GeometryGUI* theGeometryGUI, QWidget* paren
Group3Pnts->LineEdit3->setReadOnly( true ); Group3Pnts->LineEdit3->setReadOnly( true );
GroupFace = new DlgRef_1Sel1Spin(this, "GroupFace"); GroupFace = new DlgRef_1Sel1Spin(this, "GroupFace");
GroupFace->GroupBox1->setTitle(tr("GEOM_FACE")); GroupFace->GroupBox1->setTitle(tr("GEOM_FACE_OR_LCS"));
GroupFace->TextLabel1->setText(tr("GEOM_SELECTION")); GroupFace->TextLabel1->setText(tr("GEOM_SELECTION"));
GroupFace->TextLabel2->setText(tr("GEOM_PLANE_SIZE")); GroupFace->TextLabel2->setText(tr("GEOM_PLANE_SIZE"));
GroupFace->PushButton1->setPixmap(image3); GroupFace->PushButton1->setPixmap(image3);
@ -136,11 +138,11 @@ void BasicGUI_PlaneDlg::Init()
double aTrimSize = 2000.0; double aTrimSize = 2000.0;
/* min, max, step and decimals for spin boxes */ /* min, max, step and decimals for spin boxes */
GroupPntDir->SpinBox_DX->RangeStepAndValidator( 0.001, 10000000.0, aStep, 3 ); GroupPntDir->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, aStep, 3 );
GroupPntDir->SpinBox_DX->SetValue( aTrimSize ); GroupPntDir->SpinBox_DX->SetValue( aTrimSize );
Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, 10000000.0, aStep, 3); Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
Group3Pnts->SpinBox_DX->SetValue( aTrimSize ); Group3Pnts->SpinBox_DX->SetValue( aTrimSize );
GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, 10000000.0, aStep, 3); GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
GroupFace->SpinBox_DX->SetValue( aTrimSize ); GroupFace->SpinBox_DX->SetValue( aTrimSize );
/* signals and slots connections */ /* signals and slots connections */
@ -237,7 +239,11 @@ void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId)
GroupFace->LineEdit1->setText(tr("")); GroupFace->LineEdit1->setText(tr(""));
/* for the first argument */ /* for the first argument */
globalSelection( GEOM_PLANE ); //globalSelection( GEOM_PLANE );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_PLANE );
aMap.Add( GEOM_MARKER );
globalSelection( aMap );
break; break;
} }
} }
@ -338,10 +344,15 @@ void BasicGUI_PlaneDlg::SetEditCurrentArgument()
if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) if ( myEditCurrentArgument == GroupPntDir->LineEdit2 )
globalSelection( GEOM_LINE ); globalSelection( GEOM_LINE );
else if ( myEditCurrentArgument == GroupFace->LineEdit1 ) else if ( myEditCurrentArgument == GroupFace->LineEdit1 ) {
globalSelection( GEOM_PLANE ); //globalSelection( GEOM_PLANE );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_PLANE );
aMap.Add( GEOM_MARKER );
globalSelection( aMap );
}
else else
globalSelection( GEOM_POINT ); globalSelection( GEOM_POINT );
SelectionIntoArgument(); SelectionIntoArgument();
} }

View File

@ -157,16 +157,16 @@ void BasicGUI_PointDlg::Init()
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes */ /* min, max, step and decimals for spin boxes */
GroupXYZ->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); GroupXYZ->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupXYZ->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); GroupXYZ->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupXYZ->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); GroupXYZ->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupXYZ->SpinBox_DX->SetValue(0.0); GroupXYZ->SpinBox_DX->SetValue(0.0);
GroupXYZ->SpinBox_DY->SetValue(0.0); GroupXYZ->SpinBox_DY->SetValue(0.0);
GroupXYZ->SpinBox_DZ->SetValue(0.0); GroupXYZ->SpinBox_DZ->SetValue(0.0);
GroupRefPoint->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); GroupRefPoint->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupRefPoint->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); GroupRefPoint->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupRefPoint->SpinBox_DX->SetValue(0.0); GroupRefPoint->SpinBox_DX->SetValue(0.0);
GroupRefPoint->SpinBox_DY->SetValue(0.0); GroupRefPoint->SpinBox_DY->SetValue(0.0);
GroupRefPoint->SpinBox_DZ->SetValue(0.0); GroupRefPoint->SpinBox_DZ->SetValue(0.0);

View File

@ -118,9 +118,9 @@ void BasicGUI_VectorDlg::Init()
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes */ /* min, max, step and decimals for spin boxes */
GroupDimensions->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
double dx( 0. ), dy( 0. ), dz( 200. ); double dx( 0. ), dy( 0. ), dz( 200. );
GroupDimensions->SpinBox_DX->SetValue( dx ); GroupDimensions->SpinBox_DX->SetValue( dx );

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // 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
// //
// //
// //
@ -34,24 +34,22 @@
#include "SalomeApp_Application.h" #include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h" #include "LightApp_SelectionMgr.h"
#include <Geom_Surface.hxx> // OCCT Includes
#include <Geom_Plane.hxx> #include <BRep_Tool.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
#include <BRep_Tool.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
#include <gp_Pln.hxx> #include <TColStd_MapOfInteger.hxx>
#include <V3d_View.hxx>
#include "GEOMImpl_Types.hxx"
// QT Includes
#include <qcheckbox.h> #include <qcheckbox.h>
#include <qlabel.h> #include <qlabel.h>
#include "GEOMImpl_Types.hxx"
using namespace std; using namespace std;
//================================================================================= //=================================================================================
@ -171,14 +169,19 @@ void BasicGUI_WorkingPlaneDlg::Init()
//================================================================================= //=================================================================================
void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId) void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId)
{ {
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0); LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
// myGeomGUI->SetState( 0 );
disconnect(aSelMgr, 0, this, 0);
switch (constructorId) switch (constructorId)
{ {
case 0: case 0:
{ {
globalSelection( GEOM_PLANE ); //globalSelection( GEOM_PLANE );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_PLANE );
aMap.Add( GEOM_MARKER );
globalSelection( aMap );
Group2->hide(); Group2->hide();
Group3->hide(); Group3->hide();
@ -189,8 +192,7 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId)
Group1->LineEdit1->setText(""); Group1->LineEdit1->setText("");
myFace = GEOM::GEOM_Object::_nil(); myFace = GEOM::GEOM_Object::_nil();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect(aSelMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break; break;
} }
case 1: case 1:
@ -208,8 +210,7 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId)
myVectX = GEOM::GEOM_Object::_nil(); myVectX = GEOM::GEOM_Object::_nil();
myVectZ = GEOM::GEOM_Object::_nil(); myVectZ = GEOM::GEOM_Object::_nil();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect(aSelMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break; break;
} }
case 2: case 2:
@ -221,7 +222,7 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId)
Group3->RadioButton1->setChecked(true); Group3->RadioButton1->setChecked(true);
aOriginType = 1; aOriginType = 1;
break; break;
} }
} }
displayPreview(); displayPreview();
@ -256,87 +257,98 @@ bool BasicGUI_WorkingPlaneDlg::ClickOnApply()
myGeomGUI->application()->putInfo(tr("")); myGeomGUI->application()->putInfo(tr(""));
const int id = getConstructorId(); const int id = getConstructorId();
if (id == 0) { if (id == 0) { // by planar face selection
if ( !CORBA::is_nil( myFace ) ) { if (CORBA::is_nil(myFace)) {
TopoDS_Face aPlaneShape; showError( "Face has to be selected" );
if ( GEOMBase::GetShape( myFace, aPlaneShape, TopAbs_FACE ) ) { return false;
Handle(Geom_Surface) aGS = BRep_Tool::Surface( TopoDS::Face( aPlaneShape ) );
if ( !aGS.IsNull() && aGS->IsKind( STANDARD_TYPE( Geom_Plane ) ) ) {
Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast( aGS );
gp_Pln aPln = aGPlane->Pln();
myWPlane = aPln.Position();
myGeomGUI->SetWorkingPlane(myWPlane);
myGeomGUI->ActiveWorkingPlane();
return true;
}
}
} }
} else if (id == 1) {
// PAL12781: set center of WPL to face's center of mass
// like it is done for LCS creation
CORBA::Double Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz;
Ox = Oy = Oz = Zx = Zy = Xy = Xz = 0.;
Zz = Xx = 1.;
GEOM::GEOM_IMeasureOperations_ptr aMeasureOp =
myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId());
aMeasureOp->GetPosition(myFace, Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz);
if (aMeasureOp->IsDone()) {
gp_Pnt aPnt (Ox,Oy,Oz);
gp_Dir aDirN (Zx,Zy,Zz);
gp_Dir aDirX (Xx,Xy,Xz);
myWPlane = gp_Ax3(aPnt, aDirN, aDirX);
} else {
showError( "Wrong shape selected (has to be a planar face)" );
return false;
}
} else if (id == 1) { // by two vectors (Ox & Oz)
if ( CORBA::is_nil( myVectX ) || CORBA::is_nil( myVectZ ) ) { if ( CORBA::is_nil( myVectX ) || CORBA::is_nil( myVectZ ) ) {
showError( "Two vectors have to be selected" ); showError( "Two vectors have to be selected" );
return false; return false;
} }
TopoDS_Edge aVectX, aVectZ; TopoDS_Edge aVectX, aVectZ;
TopoDS_Vertex V1, V2; TopoDS_Vertex VX1, VX2, VZ1, VZ2;
gp_Vec aVX, aVZ; gp_Vec aVX, aVZ;
if (GEOMBase::GetShape( myVectX, aVectX, TopAbs_EDGE ) &&
GEOMBase::GetShape( myVectZ, aVectZ, TopAbs_EDGE )) {
TopExp::Vertices(aVectZ, V1, V2, Standard_True);
if (!V1.IsNull() && !V2.IsNull())
aVZ = gp_Vec(BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
else {
showError( "Bad OZ vector" );
return false;
}
TopExp::Vertices(aVectX, V1, V2, Standard_True); if (!GEOMBase::GetShape( myVectX, aVectX, TopAbs_EDGE ) ||
if (!V1.IsNull() && !V2.IsNull()) !GEOMBase::GetShape( myVectZ, aVectZ, TopAbs_EDGE )) {
aVX = gp_Vec(BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2)); showError( "Wrong shape selected (two vectors(edges) have to be selected)" );
else { return false;
showError( "Bad OX vector" );
return false;
}
gp_Dir aDirZ = gp_Dir(aVZ.X(), aVZ.Y(), aVZ.Z());
gp_Dir aDirX = gp_Dir(aVX.X(), aVX.Y(), aVX.Z());
if (aDirX.IsParallel(aDirZ, Precision::Confusion())) {
showError( "Parallel vectors selected" );
return false;
}
myWPlane = gp_Ax3(BRep_Tool::Pnt(V1), aDirZ, aDirX);
myGeomGUI->SetWorkingPlane(myWPlane);
myGeomGUI->ActiveWorkingPlane();
return true;
}
} else if (id == 2) {
gp_Pnt P1 = gp_Pnt(0., 0., 0.);
gp_Dir aDirZ, aDirX;
if (aOriginType == 1) {
aDirZ = gp_Dir(0., 0., 1.);
aDirX = gp_Dir(1., 0., 0.);
}
else if (aOriginType == 2) {
aDirZ = gp_Dir(1., 0., 0.);
aDirX = gp_Dir(0., 1., 0.);
}
else if (aOriginType == 0) {
aDirZ = gp_Dir(0., 1., 0.);
aDirX = gp_Dir(0., 0., 1.);
} }
myWPlane = gp_Ax3(P1, aDirZ, aDirX); TopExp::Vertices(aVectX, VX1, VX2, Standard_True);
TopExp::Vertices(aVectZ, VZ1, VZ2, Standard_True);
myGeomGUI->SetWorkingPlane(myWPlane); if (VX1.IsNull() || VX2.IsNull()) {
myGeomGUI->ActiveWorkingPlane(); showError( "Bad OX vector" );
return true; return false;
}
if (VZ1.IsNull() || VZ2.IsNull()) {
showError( "Bad OZ vector" );
return false;
}
aVX = gp_Vec(BRep_Tool::Pnt(VX1), BRep_Tool::Pnt(VX2));
aVZ = gp_Vec(BRep_Tool::Pnt(VZ1), BRep_Tool::Pnt(VZ2));
if (aVX.Magnitude() < Precision::Confusion()) {
showError( "Bad OX vector" );
return false;
}
if (aVZ.Magnitude() < Precision::Confusion()) {
showError( "Bad OZ vector" );
return false;
}
gp_Dir aDirX = gp_Dir(aVX.X(), aVX.Y(), aVX.Z());
gp_Dir aDirZ = gp_Dir(aVZ.X(), aVZ.Y(), aVZ.Z());
if (aDirX.IsParallel(aDirZ, Precision::Angular())) {
showError( "Parallel vectors selected" );
return false;
}
myWPlane = gp_Ax3(BRep_Tool::Pnt(VX1), aDirZ, aDirX);
} else if (id == 2) { // by selection from standard (OXY or OYZ, or OZX)
gp_Ax2 anAx2;
if (aOriginType == 1) anAx2 = gp::XOY();
else if (aOriginType == 2) anAx2 = gp::YOZ();
else if (aOriginType == 0) anAx2 = gp::ZOX();
myWPlane = gp_Ax3(anAx2);
} else {
return false;
} }
return false;
myGeomGUI->SetWorkingPlane(myWPlane);
myGeomGUI->ActiveWorkingPlane();
return true;
} }
//================================================================================= //=================================================================================

View File

@ -41,20 +41,6 @@
#include "SalomeApp_Application.h" #include "SalomeApp_Application.h"
BlocksGUI* BlocksGUI::myGUIObject = 0;
//=======================================================================
// function : GetBlocksGUI()
// purpose : Get the only BlocksGUI object [ static ]
//=======================================================================
BlocksGUI* BlocksGUI::GetBlocksGUI( GeometryGUI* parent )
{
if ( myGUIObject == 0 )
myGUIObject = new BlocksGUI( parent );
return myGUIObject;
}
//======================================================================= //=======================================================================
// function : BlocksGUI() // function : BlocksGUI()
// purpose : Constructor // purpose : Constructor
@ -108,6 +94,6 @@ extern "C"
GEOM_BLOCKSGUI_EXPORT GEOM_BLOCKSGUI_EXPORT
GEOMGUI* GetLibGUI( GeometryGUI* parent ) GEOMGUI* GetLibGUI( GeometryGUI* parent )
{ {
return BlocksGUI::GetBlocksGUI( parent ); return new BlocksGUI( parent );
} }
} }

View File

@ -23,7 +23,6 @@
// File : BuildGUI.h // File : BuildGUI.h
// Author : Julia DOROVSKIKH // Author : Julia DOROVSKIKH
// Module : GEOM // Module : GEOM
// $Header$
#ifndef BLOCKSGUI_H #ifndef BLOCKSGUI_H
#define BLOCKSGUI_H #define BLOCKSGUI_H
@ -38,19 +37,11 @@
//================================================================================= //=================================================================================
class GEOM_BLOCKSGUI_EXPORT BlocksGUI : public GEOMGUI class GEOM_BLOCKSGUI_EXPORT BlocksGUI : public GEOMGUI
{ {
protected:
BlocksGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
public: public:
BlocksGUI( GeometryGUI* parent );
~BlocksGUI(); ~BlocksGUI();
// Get the only BuildGUI object
static BlocksGUI* GetBlocksGUI( GeometryGUI* parent );
bool OnGUIEvent (int theCommandID, SUIT_Desktop* parent); bool OnGUIEvent (int theCommandID, SUIT_Desktop* parent);
private:
static BlocksGUI* myGUIObject; // the only BlocksGUI object
}; };
#endif #endif

View File

@ -143,7 +143,8 @@ void BlocksGUI_TrsfDlg::Init()
double SpecificStep = 1.0; double SpecificStep = 1.0;
QMap<int, DlgRef_SpinBox*>::iterator anIter; QMap<int, DlgRef_SpinBox*>::iterator anIter;
for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) { for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) {
anIter.data()->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3); //anIter.data()->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3);
anIter.data()->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 3);
} }
// signals and slots connections // signals and slots connections

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // 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
// //
// //
// //
@ -36,21 +36,6 @@
using namespace std; using namespace std;
BooleanGUI* BooleanGUI::myGUIObject = 0;
//=======================================================================
// function : GetBooleanGUI()
// purpose : Get the only BooleanGUI object [ static ]
//=======================================================================
BooleanGUI* BooleanGUI::GetBooleanGUI( GeometryGUI* parent )
{
if ( myGUIObject == 0 ) {
// init BooleanGUI only once
myGUIObject = new BooleanGUI( parent );
}
return myGUIObject;
}
//======================================================================= //=======================================================================
// function : BooleanGUI() // function : BooleanGUI()
// purpose : Constructor // purpose : Constructor
@ -59,7 +44,6 @@ BooleanGUI::BooleanGUI( GeometryGUI* parent ) : GEOMGUI( parent )
{ {
} }
//======================================================================= //=======================================================================
// function : ~BooleanGUI() // function : ~BooleanGUI()
// purpose : Destructor // purpose : Destructor
@ -103,6 +87,6 @@ extern "C"
GEOM_BOOLEANGUI_EXPORT GEOM_BOOLEANGUI_EXPORT
GEOMGUI* GetLibGUI( GeometryGUI* parent ) GEOMGUI* GetLibGUI( GeometryGUI* parent )
{ {
return BooleanGUI::GetBooleanGUI( parent ); return new BooleanGUI( parent );
} }
} }

View File

@ -17,14 +17,13 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// //
// //
// File : BooleanGUI.h // File : BooleanGUI.h
// Author : Damien COQUERET // Author : Damien COQUERET
// Module : GEOM // Module : GEOM
// $Header$
#ifndef BOOLEANGUI_H #ifndef BOOLEANGUI_H
#define BOOLEANGUI_H #define BOOLEANGUI_H
@ -55,21 +54,13 @@
//================================================================================= //=================================================================================
class GEOM_BOOLEANGUI_EXPORT BooleanGUI : public GEOMGUI class GEOM_BOOLEANGUI_EXPORT BooleanGUI : public GEOMGUI
{ {
protected:
BooleanGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
public: public:
enum BooleanOperation { COMMON = 1, CUT = 2, FUSE = 3, SECTION = 4 }; enum BooleanOperation { COMMON = 1, CUT = 2, FUSE = 3, SECTION = 4 };
BooleanGUI( GeometryGUI* parent );
~BooleanGUI(); ~BooleanGUI();
// Get the only BooleanGUI object
static BooleanGUI* GetBooleanGUI( GeometryGUI* parent );
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent); bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
private:
static BooleanGUI* myGUIObject; // the only BooleanGUI object
}; };
#endif #endif

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // 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
// //
// //
// //
@ -31,6 +31,8 @@
#include "SUIT_Desktop.h" #include "SUIT_Desktop.h"
#include "SUIT_Session.h" #include "SUIT_Session.h"
#include "SalomeApp_Application.h"
#include "BuildGUI_EdgeDlg.h" // Method EDGE #include "BuildGUI_EdgeDlg.h" // Method EDGE
#include "BuildGUI_WireDlg.h" // Method WIRE #include "BuildGUI_WireDlg.h" // Method WIRE
#include "BuildGUI_FaceDlg.h" // Method FACE #include "BuildGUI_FaceDlg.h" // Method FACE
@ -40,20 +42,6 @@
#include "GeometryGUI.h" #include "GeometryGUI.h"
BuildGUI* BuildGUI::myGUIObject = 0;
//=======================================================================
// function : GetBuildGUI()
// purpose : Get the only BuildGUI object [ static ]
//=======================================================================
BuildGUI* BuildGUI::GetBuildGUI( GeometryGUI* parent )
{
if ( myGUIObject == 0 )
myGUIObject = new BuildGUI( parent );
return myGUIObject;
}
//======================================================================= //=======================================================================
// function : BuildGUI() // function : BuildGUI()
// purpose : Constructor // purpose : Constructor
@ -63,7 +51,6 @@ BuildGUI::BuildGUI( GeometryGUI* parent )
{ {
} }
//======================================================================= //=======================================================================
// function : ~BuildGUI() // function : ~BuildGUI()
// purpose : Destructor // purpose : Destructor
@ -93,7 +80,7 @@ bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
case 4086: aDlg = new BuildGUI_CompoundDlg( getGeometryGUI(), parent, "" ); break; case 4086: aDlg = new BuildGUI_CompoundDlg( getGeometryGUI(), parent, "" ); break;
default: default:
SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); getGeometryGUI()->getApp()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
break; break;
} }
@ -111,6 +98,6 @@ extern "C"
GEOM_BUILDGUI_EXPORT GEOM_BUILDGUI_EXPORT
GEOMGUI* GetLibGUI( GeometryGUI* parent ) GEOMGUI* GetLibGUI( GeometryGUI* parent )
{ {
return BuildGUI::GetBuildGUI( parent ); return new BuildGUI( parent );
} }
} }

View File

@ -17,14 +17,13 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// //
// //
// File : BuildGUI.h // File : BuildGUI.h
// Author : Damien COQUERET // Author : Damien COQUERET
// Module : GEOM // Module : GEOM
// $Header$
#ifndef BUILDGUI_H #ifndef BUILDGUI_H
#define BUILDGUI_H #define BUILDGUI_H
@ -39,19 +38,11 @@
//================================================================================= //=================================================================================
class GEOM_BUILDGUI_EXPORT BuildGUI : public GEOMGUI class GEOM_BUILDGUI_EXPORT BuildGUI : public GEOMGUI
{ {
protected:
BuildGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
public : public :
BuildGUI( GeometryGUI* parent );
~BuildGUI(); ~BuildGUI();
// Get the only BuildGUI object
static BuildGUI* GetBuildGUI( GeometryGUI* parent );
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent ); bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
private:
static BuildGUI* myGUIObject; // the only BuildGUI object
}; };
#endif #endif

View File

@ -28,6 +28,7 @@
#include "BuildGUI_FaceDlg.h" #include "BuildGUI_FaceDlg.h"
#include "GEOMImpl_Types.hxx" #include "GEOMImpl_Types.hxx"
#include "TColStd_MapOfInteger.hxx"
#include "SUIT_Session.h" #include "SUIT_Session.h"
#include "SalomeApp_Application.h" #include "SalomeApp_Application.h"
@ -64,7 +65,7 @@ BuildGUI_FaceDlg::BuildGUI_FaceDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
GroupWire = new DlgRef_1Sel1Check_QTD(this, "GroupWire"); GroupWire = new DlgRef_1Sel1Check_QTD(this, "GroupWire");
GroupWire->GroupBox1->setTitle(tr("GEOM_FACE_FFW")); GroupWire->GroupBox1->setTitle(tr("GEOM_FACE_FFW"));
GroupWire->TextLabel1->setText(tr("GEOM_WIRES")); GroupWire->TextLabel1->setText(tr("GEOM_OBJECTS"));
GroupWire->CheckButton1->setText(tr("GEOM_FACE_OPT")); GroupWire->CheckButton1->setText(tr("GEOM_FACE_OPT"));
GroupWire->PushButton1->setPixmap(image1); GroupWire->PushButton1->setPixmap(image1);
@ -100,7 +101,10 @@ void BuildGUI_FaceDlg::Init()
GroupWire->CheckButton1->setChecked(TRUE); GroupWire->CheckButton1->setChecked(TRUE);
globalSelection( GEOM_WIRE ); TColStd_MapOfInteger aMap;
aMap.Add( GEOM_EDGE );
aMap.Add( GEOM_WIRE );
globalSelection( aMap );
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
@ -160,7 +164,7 @@ void BuildGUI_FaceDlg::SelectionIntoArgument()
if (!myWires.length()) if (!myWires.length())
return; return;
if(aNbSel != 1) if(aNbSel != 1)
aName = tr("%1_wires").arg(aNbSel); aName = tr("%1_objects").arg(aNbSel);
myEditCurrentArgument->setText( aName ); myEditCurrentArgument->setText( aName );
@ -178,7 +182,11 @@ void BuildGUI_FaceDlg::SetEditCurrentArgument()
if (send != GroupWire->PushButton1) if (send != GroupWire->PushButton1)
return; return;
globalSelection( GEOM_WIRE ); TColStd_MapOfInteger aMap;
aMap.Add( GEOM_EDGE );
aMap.Add( GEOM_WIRE );
globalSelection( aMap );
myEditCurrentArgument = GroupWire->LineEdit1; myEditCurrentArgument = GroupWire->LineEdit1;
myEditCurrentArgument->setFocus(); myEditCurrentArgument->setFocus();
@ -195,7 +203,10 @@ void BuildGUI_FaceDlg::ActivateThisDialog()
GEOMBase_Skeleton::ActivateThisDialog(); GEOMBase_Skeleton::ActivateThisDialog();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
globalSelection( GEOM_WIRE ); TColStd_MapOfInteger aMap;
aMap.Add( GEOM_EDGE );
aMap.Add( GEOM_WIRE );
globalSelection( aMap );
} }

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // 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
// //
// //
// //
@ -59,21 +59,6 @@
#include <qmenubar.h> #include <qmenubar.h>
DisplayGUI* DisplayGUI::myGUIObject = 0;
//=======================================================================
// function : DisplayGUI::GetDisplayGUI()
// purpose : Get the only DisplayGUI object [ static ]
//=======================================================================
DisplayGUI* DisplayGUI::GetDisplayGUI( GeometryGUI* parent )
{
if ( myGUIObject == 0 ) {
// init DisplayGUI only once
myGUIObject = new DisplayGUI( parent );
}
return myGUIObject;
}
//======================================================================= //=======================================================================
// function : DisplayGUI::DisplayGUI() // function : DisplayGUI::DisplayGUI()
// purpose : Constructor // purpose : Constructor
@ -82,7 +67,6 @@ DisplayGUI::DisplayGUI( GeometryGUI* parent ) : GEOMGUI( parent )
{ {
} }
//======================================================================= //=======================================================================
// function : DisplayGUI::~DisplayGUI() // function : DisplayGUI::~DisplayGUI()
// purpose : Destructor // purpose : Destructor
@ -98,63 +82,64 @@ DisplayGUI::~DisplayGUI()
//======================================================================= //=======================================================================
bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
{ {
DisplayGUI* myDisplayGUI = GetDisplayGUI( getGeometryGUI() ); SalomeApp_Application* app = getGeometryGUI()->getApp();
LightApp_SelectionMgr *Sel = getGeometryGUI()->getApp()->selectionMgr(); if (!app) return false;
LightApp_SelectionMgr *Sel = app->selectionMgr();
SALOME_ListIO selected; SALOME_ListIO selected;
Sel->selectedObjects( selected ); Sel->selectedObjects( selected );
switch (theCommandID) { switch (theCommandID) {
case 211: // MENU VIEW - WIREFRAME/SHADING case 211: // MENU VIEW - WIREFRAME/SHADING
{ {
myDisplayGUI->InvertDisplayMode(); InvertDisplayMode();
int newMode = myDisplayGUI->GetDisplayMode(); int newMode = GetDisplayMode();
getGeometryGUI()->action( 211 )->setMenuText( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") ); getGeometryGUI()->action( 211 )->setMenuText
( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
getGeometryGUI()->menuMgr()->update(); getGeometryGUI()->menuMgr()->update();
// SUIT_Session::session()->activeApplication()->desktop()->menuBar()->
// changeItem( 211, newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
break; break;
} }
case 212: // MENU VIEW - DISPLAY ALL case 212: // MENU VIEW - DISPLAY ALL
{ {
getGeometryGUI()->EmitSignalDeactivateDialog(); getGeometryGUI()->EmitSignalDeactivateDialog();
myDisplayGUI->DisplayAll(); DisplayAll();
break; break;
} }
case 213: // MENU VIEW - DISPLAY ONLY case 213: // MENU VIEW - DISPLAY ONLY
{ {
getGeometryGUI()->EmitSignalDeactivateDialog(); getGeometryGUI()->EmitSignalDeactivateDialog();
myDisplayGUI->DisplayOnly(); DisplayOnly();
break; break;
} }
case 214: // MENU VIEW - ERASE ALL case 214: // MENU VIEW - ERASE ALL
{ {
myDisplayGUI->EraseAll(); EraseAll();
break; break;
} }
case 215: // MENU VIEW - ERASE case 215: // MENU VIEW - ERASE
{ {
myDisplayGUI->Erase(); Erase();
break; break;
} }
case 216: // MENU VIEW - DISPLAY case 216: // MENU VIEW - DISPLAY
{ {
getGeometryGUI()->EmitSignalDeactivateDialog(); getGeometryGUI()->EmitSignalDeactivateDialog();
myDisplayGUI->Display(); Display();
break; break;
} }
case 80311: // POPUP VIEWER - WIREFRAME case 80311: // POPUP VIEWER - WIREFRAME
{ {
myDisplayGUI->ChangeDisplayMode( 0 ); ChangeDisplayMode( 0 );
break; break;
} }
case 80312: // POPUP VIEWER - SHADING case 80312: // POPUP VIEWER - SHADING
{ {
myDisplayGUI->ChangeDisplayMode( 1 ); ChangeDisplayMode( 1 );
break; break;
} }
default: default:
{ {
SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break; break;
} }
} }
@ -168,7 +153,10 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
//===================================================================================== //=====================================================================================
void DisplayGUI::DisplayAll() void DisplayGUI::DisplayAll()
{ {
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() ); SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
if ( !appStudy ) return; if ( !appStudy ) return;
_PTR(Study) aStudy = appStudy->studyDS(); _PTR(Study) aStudy = appStudy->studyDS();
if ( !aStudy ) return; if ( !aStudy ) return;
@ -186,7 +174,9 @@ void DisplayGUI::DisplayAll()
_PTR(SObject) valSO ( anIter->Value() ); _PTR(SObject) valSO ( anIter->Value() );
_PTR(SObject) refSO; _PTR(SObject) refSO;
if ( !valSO->ReferencedObject( refSO ) ) { if ( !valSO->ReferencedObject( refSO ) ) {
listIO.Append( new SALOME_InteractiveObject( valSO->GetID().c_str(), SC->ComponentDataType().c_str() ,valSO->GetName().c_str() ) ); listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
SC->ComponentDataType().c_str(),
valSO->GetName().c_str()) );
} }
anIter->Next(); anIter->Next();
} }
@ -201,7 +191,7 @@ void DisplayGUI::EraseAll()
{ {
SUIT_OverrideCursor(); SUIT_OverrideCursor();
SUIT_Application* app = SUIT_Session::session()->activeApplication(); SUIT_Application* app = getGeometryGUI()->getApp();
if ( app ) { if ( app ) {
SUIT_ViewWindow* vw = app->desktop()->activeWindow(); SUIT_ViewWindow* vw = app->desktop()->activeWindow();
if ( vw ) { if ( vw ) {
@ -233,7 +223,7 @@ void DisplayGUI::Display()
{ {
SALOME_ListIO listIO; SALOME_ListIO listIO;
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return; if ( !app ) return;
SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() ); SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
@ -253,7 +243,7 @@ void DisplayGUI::Display()
Handle(SALOME_InteractiveObject) anIObject = It.Value(); Handle(SALOME_InteractiveObject) anIObject = It.Value();
if ( anIObject->hasEntry() ) { if ( anIObject->hasEntry() ) {
_PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) ); _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
if ( SO && QString( SO->GetID().c_str() ) == QString( SO->GetFatherComponent()->GetID().c_str() ) ) { if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
_PTR(SComponent) SC ( SO->GetFatherComponent() ); _PTR(SComponent) SC ( SO->GetFatherComponent() );
// if component is selected // if component is selected
listIO.Clear(); listIO.Clear();
@ -263,7 +253,9 @@ void DisplayGUI::Display()
_PTR(SObject) valSO ( anIter->Value() ); _PTR(SObject) valSO ( anIter->Value() );
_PTR(SObject) refSO; _PTR(SObject) refSO;
if ( !valSO->ReferencedObject( refSO ) ) { if ( !valSO->ReferencedObject( refSO ) ) {
listIO.Append( new SALOME_InteractiveObject( valSO->GetID().c_str(), SC->ComponentDataType().c_str() ,valSO->GetName().c_str() ) ); listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
SC->ComponentDataType().c_str(),
valSO->GetName().c_str()) );
} }
anIter->Next(); anIter->Next();
} }
@ -289,7 +281,7 @@ void DisplayGUI::Erase()
{ {
SALOME_ListIO listIO; SALOME_ListIO listIO;
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return; if ( !app ) return;
SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() ); SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
@ -305,11 +297,11 @@ void DisplayGUI::Erase()
SUIT_OverrideCursor(); SUIT_OverrideCursor();
for( ;It.More();It.Next() ) { for( ; It.More(); It.Next() ) {
Handle(SALOME_InteractiveObject) anIObject = It.Value(); Handle(SALOME_InteractiveObject) anIObject = It.Value();
if ( anIObject->hasEntry() ) { if ( anIObject->hasEntry() ) {
_PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) ); _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
if ( SO && QString( SO->GetID().c_str() ) == QString( SO->GetFatherComponent()->GetID().c_str() ) ) { if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
_PTR(SComponent) SC ( SO->GetFatherComponent() ); _PTR(SComponent) SC ( SO->GetFatherComponent() );
// if component is selected // if component is selected
listIO.Clear(); listIO.Clear();
@ -319,7 +311,9 @@ void DisplayGUI::Erase()
_PTR(SObject) valSO ( anIter->Value() ); _PTR(SObject) valSO ( anIter->Value() );
_PTR(SObject) refSO; _PTR(SObject) refSO;
if ( !valSO->ReferencedObject( refSO ) ) { if ( !valSO->ReferencedObject( refSO ) ) {
listIO.Append( new SALOME_InteractiveObject( valSO->GetID().c_str(), SC->ComponentDataType().c_str() ,valSO->GetName().c_str() ) ); listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
SC->ComponentDataType().c_str(),
valSO->GetName().c_str()) );
} }
anIter->Next(); anIter->Next();
} }
@ -334,7 +328,7 @@ void DisplayGUI::Erase()
} }
} }
GEOM_Displayer(anActiveStudy).Erase( listIO, true ); GEOM_Displayer(anActiveStudy).Erase( listIO, true );
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->clearSelected(); getGeometryGUI()->getApp()->selectionMgr()->clearSelected();
} }
//===================================================================================== //=====================================================================================
@ -346,7 +340,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
SUIT_OverrideCursor(); SUIT_OverrideCursor();
if ( !viewWindow ) if ( !viewWindow )
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView(); SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
aView->SetDisplayMode( mode ); aView->SetDisplayMode( mode );
@ -382,7 +376,7 @@ int DisplayGUI::GetDisplayMode( SUIT_ViewWindow* viewWindow )
{ {
int dispMode = 0; int dispMode = 0;
if ( !viewWindow ) if ( !viewWindow )
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView(); SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
dispMode = aView->GetDisplayMode(); dispMode = aView->GetDisplayMode();
@ -413,12 +407,12 @@ void DisplayGUI::InvertDisplayMode( SUIT_ViewWindow* viewWindow )
//===================================================================================== //=====================================================================================
void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
{ {
if ( !viewWindow ) SalomeApp_Application* app = getGeometryGUI()->getApp();
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
if ( !app ) return; if ( !app ) return;
if ( !viewWindow )
viewWindow = app->desktop()->activeWindow();
LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
if ( !aSelMgr ) return; if ( !aSelMgr ) return;
@ -435,7 +429,8 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
for( ;It.More(); It.Next() ) { for( ;It.More(); It.Next() ) {
SVTK_Viewer* stvkViewer = dynamic_cast<SVTK_Viewer*>(vw->getViewManager()->getViewModel()); SVTK_Viewer* stvkViewer = dynamic_cast<SVTK_Viewer*>(vw->getViewManager()->getViewModel());
SVTK_Prs* vtkPrs = stvkViewer ? dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0; SVTK_Prs* vtkPrs =
stvkViewer ? dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0;
if ( vtkPrs && !vtkPrs->IsNull() ) { if ( vtkPrs && !vtkPrs->IsNull() ) {
if ( mode == 0 ) if ( mode == 0 )
aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() ); aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
@ -478,6 +473,6 @@ extern "C"
GEOM_DISPLAYGUI_EXPORT GEOM_DISPLAYGUI_EXPORT
GEOMGUI* GetLibGUI( GeometryGUI* parent ) GEOMGUI* GetLibGUI( GeometryGUI* parent )
{ {
return DisplayGUI::GetDisplayGUI( parent ); return new DisplayGUI( parent );
} }
} }

View File

@ -17,14 +17,13 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// //
// //
// File : DisplayGUI.h // File : DisplayGUI.h
// Author : Damien COQUERET // Author : Damien COQUERET
// Module : GEOM // Module : GEOM
// $Header$
#ifndef DISPLAYGUI_H #ifndef DISPLAYGUI_H
#define DISPLAYGUI_H #define DISPLAYGUI_H
@ -33,22 +32,15 @@
#include "GEOMBase.h" #include "GEOMBase.h"
#ifdef WNT #ifdef WNT
#if defined DISPLAYGUI_EXPORTS # if defined DISPLAYGUI_EXPORTS
#if defined WIN32 # define GEOM_DISPLAYGUI_EXPORT __declspec( dllexport )
#define GEOM_DISPLAYGUI_EXPORT __declspec( dllexport ) # else
#else # define GEOM_DISPLAYGUI_EXPORT __declspec( dllimport )
#define GEOM_DISPLAYGUI_EXPORT # endif
#endif
#else
#if defined WIN32
#define GEOM_DISPLAYGUI_EXPORT __declspec( dllimport )
#else
#define GEOM_DISPLAYGUI_EXPORT
#endif
#endif
#else #else
#define GEOM_DISPLAYGUI_EXPORT # define GEOM_DISPLAYGUI_EXPORT
#endif #endif
//================================================================================= //=================================================================================
// class : GEOMBase_Display // class : GEOMBase_Display
// purpose : // purpose :
@ -57,15 +49,10 @@
class SUIT_ViewWindow; class SUIT_ViewWindow;
class GEOM_DISPLAYGUI_EXPORT DisplayGUI : public GEOMGUI class GEOM_DISPLAYGUI_EXPORT DisplayGUI : public GEOMGUI
{ {
protected: public:
DisplayGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation DisplayGUI( GeometryGUI* parent );
public :
~DisplayGUI(); ~DisplayGUI();
// Get the only DisplayGUI object
static DisplayGUI* GetDisplayGUI( GeometryGUI* parent );
// Dispatch menu command // Dispatch menu command
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent); bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
@ -92,9 +79,6 @@ public :
// Set display mode for selected objects in the viewer given // Set display mode for selected objects in the viewer given
// (current viewer if <viewWindow> = 0 ) // (current viewer if <viewWindow> = 0 )
void ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindo = 0 ); void ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindo = 0 );
private:
static DisplayGUI* myGUIObject; // the only DisplayGUI object
}; };
#endif #endif

View File

@ -96,6 +96,8 @@ QString DlgRef_SpinBox::GetString()
void DlgRef_SpinBox::RangeStepAndValidator(double min, double max,double step, void DlgRef_SpinBox::RangeStepAndValidator(double min, double max,double step,
unsigned short decimals) unsigned short decimals)
{ {
setPrecision(-decimals); // PAL12789. Minus is for using 'g' double->string conversion specifier,
// see QtxDblSpinBox::mapValueToText( double v )
setRange(min, max); setRange(min, max);
setLineStep(step); setLineStep(step);
((QDoubleValidator*)validator())->setRange(min, max, decimals); ((QDoubleValidator*)validator())->setRange(min, max, decimals);

View File

@ -33,6 +33,10 @@
#include "QtxDblSpinBox.h" #include "QtxDblSpinBox.h"
#define COORD_MIN -1e+15
#define COORD_MAX +1e+15
#define MAX_NUMBER 100000
//================================================================================= //=================================================================================
// class : DlgRef_SpinBox // class : DlgRef_SpinBox
// purpose : Derivated from QSpinBox class and modified to accept floats // purpose : Derivated from QSpinBox class and modified to accept floats

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // 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
// //
// //
// //
@ -37,6 +37,7 @@
#include "OCCViewer_ViewManager.h" #include "OCCViewer_ViewManager.h"
#include "SalomeApp_Study.h" #include "SalomeApp_Study.h"
#include "SalomeApp_Tools.h" #include "SalomeApp_Tools.h"
#include "SalomeApp_Application.h"
#include <TopoDS_Compound.hxx> #include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
@ -50,15 +51,6 @@
using namespace boost; using namespace boost;
using namespace std; using namespace std;
//=======================================================================
// function : GetEntityGUI()
// purpose : Get the only EntityGUI object [ static ]
//=======================================================================
EntityGUI* EntityGUI::GetEntityGUI( GeometryGUI* parent )
{
return new EntityGUI( parent );
}
//======================================================================= //=======================================================================
// function : EntityGUI() // function : EntityGUI()
// purpose : Constructor // purpose : Constructor
@ -84,6 +76,9 @@ EntityGUI::~EntityGUI()
//======================================================================= //=======================================================================
bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
{ {
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
getGeometryGUI()->EmitSignalDeactivateDialog(); getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL; QDialog* aDlg = NULL;
@ -97,7 +92,7 @@ bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
aDlg = new EntityGUI_SubShapeDlg(getGeometryGUI(), parent, ""); aDlg = new EntityGUI_SubShapeDlg(getGeometryGUI(), parent, "");
break; break;
default: default:
SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break; break;
} }
if ( aDlg ) if ( aDlg )
@ -113,8 +108,10 @@ bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
//===================================================================================== //=====================================================================================
void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2) void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2)
{ {
SUIT_ViewManager* aVM = SalomeApp_Application* app = getGeometryGUI()->getApp();
SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager(); if ( !app ) return;
SUIT_ViewManager* aVM = app->desktop()->activeWindow()->getViewManager();
if (aVM->getType() != OCCViewer_Viewer::Type()) if (aVM->getType() != OCCViewer_Viewer::Type())
return; return;
@ -160,13 +157,16 @@ void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shap
//================================================================================== //==================================================================================
void EntityGUI::EraseSimulationShape() void EntityGUI::EraseSimulationShape()
{ {
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
// get all view windows at the desktop // get all view windows at the desktop
QPtrList<SUIT_ViewWindow> aWndLst = SUIT_Session::session()->activeApplication()->desktop()->windows(); QPtrList<SUIT_ViewWindow> aWndLst = app->desktop()->windows();
//get all view windows, which belong to the active study //get all view windows, which belong to the active study
QPtrList<SUIT_ViewWindow> aWndLstAS; QPtrList<SUIT_ViewWindow> aWndLstAS;
SUIT_ViewWindow* vw; SUIT_ViewWindow* vw;
for ( vw = aWndLst.first(); vw; vw = aWndLst.next() ) for ( vw = aWndLst.first(); vw; vw = aWndLst.next() )
if ( vw->getViewManager()->study() == SUIT_Session::session()->activeApplication()->activeStudy() ) if ( vw->getViewManager()->study() == app->activeStudy() )
aWndLstAS.append( vw ); aWndLstAS.append( vw );
for ( vw = aWndLstAS.first(); vw; vw = aWndLstAS.next() ) { for ( vw = aWndLstAS.first(); vw; vw = aWndLstAS.next() ) {
@ -188,9 +188,11 @@ void EntityGUI::EraseSimulationShape()
//===================================================================================== //=====================================================================================
bool EntityGUI::SObjectExist(const _PTR(SObject)& theFatherObject, const char* IOR) bool EntityGUI::SObjectExist(const _PTR(SObject)& theFatherObject, const char* IOR)
{ {
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*> SalomeApp_Application* app = getGeometryGUI()->getApp();
( SUIT_Session::session()->activeApplication()->activeStudy() ); if ( !app ) return false;
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
if ( !appStudy ) return false; if ( !appStudy ) return false;
_PTR(Study) aStudy = appStudy->studyDS(); _PTR(Study) aStudy = appStudy->studyDS();
_PTR(ChildIterator) it ( aStudy->NewChildIterator(theFatherObject) ); _PTR(ChildIterator) it ( aStudy->NewChildIterator(theFatherObject) );
_PTR(SObject) RefSO; _PTR(SObject) RefSO;
@ -222,6 +224,6 @@ extern "C"
GEOM_ENTITYGUI_EXPORT GEOM_ENTITYGUI_EXPORT
GEOMGUI* GetLibGUI( GeometryGUI* parent ) GEOMGUI* GetLibGUI( GeometryGUI* parent )
{ {
return EntityGUI::GetEntityGUI( parent ); return new EntityGUI( parent );
} }
} }

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // 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
// //
// //
// //
@ -43,15 +43,10 @@
//================================================================================= //=================================================================================
class GEOM_ENTITYGUI_EXPORT EntityGUI : public GEOMGUI class GEOM_ENTITYGUI_EXPORT EntityGUI : public GEOMGUI
{ {
protected:
EntityGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
public : public :
EntityGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
~EntityGUI(); ~EntityGUI();
// Get the only EntityGUI object
static EntityGUI* GetEntityGUI( GeometryGUI* parent );
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent); bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2); void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2);

View File

@ -17,14 +17,14 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// //
// //
// File : EntityGUI_SketcherDlg.cxx // File : EntityGUI_SketcherDlg.cxx
// Author : Damien COQUERET // Author : Damien COQUERET
// Module : GEOM // Module : GEOM
// $Header: // $Header$
#include "EntityGUI_SketcherDlg.h" #include "EntityGUI_SketcherDlg.h"
#include "Sketcher_Profile.hxx" #include "Sketcher_Profile.hxx"
@ -132,24 +132,42 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent,
Group1Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY")); Group1Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
Group1Spin->buttonUndo->setPixmap(image1); Group1Spin->buttonUndo->setPixmap(image1);
Group1Spin->buttonRedo->setPixmap(image2); Group1Spin->buttonRedo->setPixmap(image2);
QWidget::setTabOrder(Group1Spin->SpinBox_DX , Group1Spin->buttonApply);
QWidget::setTabOrder(Group1Spin->buttonApply, Group1Spin->buttonUndo);
QWidget::setTabOrder(Group1Spin->buttonUndo , Group1Spin->buttonRedo);
Group2Spin = new EntityGUI_2Spin(this, "Group2Spin"); Group2Spin = new EntityGUI_2Spin(this, "Group2Spin");
Group2Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES")); Group2Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
Group2Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY")); Group2Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
Group2Spin->buttonUndo->setPixmap(image1); Group2Spin->buttonUndo->setPixmap(image1);
Group2Spin->buttonRedo->setPixmap(image2); Group2Spin->buttonRedo->setPixmap(image2);
QWidget::setTabOrder(Group2Spin->SpinBox_DX , Group2Spin->SpinBox_DY);
QWidget::setTabOrder(Group2Spin->SpinBox_DY , Group2Spin->buttonApply);
QWidget::setTabOrder(Group2Spin->buttonApply, Group2Spin->buttonUndo);
QWidget::setTabOrder(Group2Spin->buttonUndo , Group2Spin->buttonRedo);
Group3Spin = new EntityGUI_3Spin(this, "Group3Spin"); Group3Spin = new EntityGUI_3Spin(this, "Group3Spin");
Group3Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES")); Group3Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
Group3Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY")); Group3Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
Group3Spin->buttonUndo->setPixmap(image1); Group3Spin->buttonUndo->setPixmap(image1);
Group3Spin->buttonRedo->setPixmap(image2); Group3Spin->buttonRedo->setPixmap(image2);
QWidget::setTabOrder(Group3Spin->SpinBox_DX , Group3Spin->SpinBox_DY);
QWidget::setTabOrder(Group3Spin->SpinBox_DY , Group3Spin->SpinBox_DZ);
QWidget::setTabOrder(Group3Spin->SpinBox_DZ , Group3Spin->buttonApply);
QWidget::setTabOrder(Group3Spin->buttonApply, Group3Spin->buttonUndo);
QWidget::setTabOrder(Group3Spin->buttonUndo , Group3Spin->buttonRedo);
Group4Spin = new EntityGUI_4Spin(this, "Group4Spin"); Group4Spin = new EntityGUI_4Spin(this, "Group4Spin");
Group4Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES")); Group4Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
Group4Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY")); Group4Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
Group4Spin->buttonUndo->setPixmap(image1); Group4Spin->buttonUndo->setPixmap(image1);
Group4Spin->buttonRedo->setPixmap(image2); Group4Spin->buttonRedo->setPixmap(image2);
QWidget::setTabOrder(Group4Spin->SpinBox_DX , Group4Spin->SpinBox_DY);
QWidget::setTabOrder(Group4Spin->SpinBox_DY , Group4Spin->SpinBox_DZ);
QWidget::setTabOrder(Group4Spin->SpinBox_DZ , Group4Spin->SpinBox_DS);
QWidget::setTabOrder(Group4Spin->SpinBox_DS , Group4Spin->buttonApply);
QWidget::setTabOrder(Group4Spin->buttonApply, Group4Spin->buttonUndo);
QWidget::setTabOrder(Group4Spin->buttonUndo , Group4Spin->buttonRedo);
Layout5->addMultiCellWidget(GroupPt, 1, 1, 0, 1); Layout5->addMultiCellWidget(GroupPt, 1, 1, 0, 1);
Layout5->addWidget(GroupD1, 1, 0); Layout5->addWidget(GroupD1, 1, 0);
@ -218,6 +236,18 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent,
connect(myGeometryGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(myGeometryGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(myGeometryGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(myGeometryGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
// install event filter on spin-boxes to provide Apply action on Return pressed
Group1Spin->SpinBox_DX->installEventFilter(this);
Group2Spin->SpinBox_DX->installEventFilter(this);
Group2Spin->SpinBox_DY->installEventFilter(this);
Group3Spin->SpinBox_DX->installEventFilter(this);
Group3Spin->SpinBox_DY->installEventFilter(this);
Group3Spin->SpinBox_DZ->installEventFilter(this);
Group4Spin->SpinBox_DX->installEventFilter(this);
Group4Spin->SpinBox_DY->installEventFilter(this);
Group4Spin->SpinBox_DZ->installEventFilter(this);
Group4Spin->SpinBox_DS->installEventFilter(this);
Init(); Init();
} }
@ -228,7 +258,42 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent,
//================================================================================= //=================================================================================
EntityGUI_SketcherDlg::~EntityGUI_SketcherDlg() EntityGUI_SketcherDlg::~EntityGUI_SketcherDlg()
{ {
myGeometryGUI->SetActiveDialogBox( 0 ); myGeometryGUI->SetActiveDialogBox( 0 );
}
//=================================================================================
// function : eventFilter()
// purpose : event filter for spin-boxes to provide Apply action on Return pressed
//=================================================================================
bool EntityGUI_SketcherDlg::eventFilter (QObject* object, QEvent* event)
{
if (event->type() == QEvent::KeyPress) {
QKeyEvent* ke = (QKeyEvent*)event;
if (ke->key() == Key_Return) {
if (object == Group1Spin->SpinBox_DX) {
Group1Spin->buttonApply->animateClick();
return true;
} else if (object == Group2Spin->SpinBox_DX ||
object == Group2Spin->SpinBox_DY) {
Group2Spin->buttonApply->animateClick();
return true;
} else if (object == Group3Spin->SpinBox_DX ||
object == Group3Spin->SpinBox_DY ||
object == Group3Spin->SpinBox_DZ) {
Group3Spin->buttonApply->animateClick();
return true;
} else if (object == Group4Spin->SpinBox_DX ||
object == Group4Spin->SpinBox_DY ||
object == Group4Spin->SpinBox_DZ ||
object == Group4Spin->SpinBox_DS) {
Group4Spin->buttonApply->animateClick();
return true;
}
}
}
return EntityGUI_Skeleton_QTD::eventFilter(object, event);
} }
@ -257,16 +322,16 @@ void EntityGUI_SketcherDlg::Init()
double step = SUIT_Session::session()->resourceMgr()->doubleValue( "Geometry", "SettingsGeomStep", 100.0 ); double step = SUIT_Session::session()->resourceMgr()->doubleValue( "Geometry", "SettingsGeomStep", 100.0 );
/* min, max, step and decimals for spin boxes */ /* min, max, step and decimals for spin boxes */
Group1Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, step, 3); Group1Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, step, 3); Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, step, 3); Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group3Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, step, 3); Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group3Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, step, 3); Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, step, 3); Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group4Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3); Group4Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
Group4Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3); Group4Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
Group4Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, step, 3); Group4Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group4Spin->SpinBox_DS->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); Group4Spin->SpinBox_DS->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
/* displays Dialog */ /* displays Dialog */
GroupConstructors->setEnabled(false); GroupConstructors->setEnabled(false);
@ -289,7 +354,7 @@ void EntityGUI_SketcherDlg::Init()
//================================================================================= //=================================================================================
void EntityGUI_SketcherDlg::InitClick() void EntityGUI_SketcherDlg::InitClick()
{ {
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0); disconnect(myGeometryGUI->getApp()->selectionMgr(), 0, this, 0);
Group1Sel->hide(); Group1Sel->hide();
Group1Spin->hide(); Group1Spin->hide();
@ -359,13 +424,16 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId)
{ {
InitClick(); InitClick();
// Get setting of step value from file configuration
double step = SUIT_Session::session()->resourceMgr()->doubleValue("Geometry", "SettingsGeomStep", 100.0);
if ( myConstructorId == 0 ) if ( myConstructorId == 0 )
{ // SEGMENT { // SEGMENT
if ( constructorId == 1 ) if ( constructorId == 1 )
{ // XY { // XY
mySketchType = PT_ABS; mySketchType = PT_ABS;
Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X2")); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X2"));
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y2")); Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y2"));
myX = 0.0; myX = 0.0;
@ -380,8 +448,8 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId)
else if ( constructorId == 0 ) else if ( constructorId == 0 )
{ // DXDY { // DXDY
mySketchType = PT_RELATIVE; mySketchType = PT_RELATIVE;
Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_DX2")); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_DX2"));
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_DY2")); Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_DY2"));
myDX = 0.0; myDX = 0.0;
@ -397,8 +465,8 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId)
{ // Selection { // Selection
mySketchType = PT_SEL; mySketchType = PT_SEL;
myEditCurrentArgument = Group1Sel->LineEdit1; myEditCurrentArgument = Group1Sel->LineEdit1;
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect(myGeometryGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
Group1Sel->show(); Group1Sel->show();
Group1Sel->buttonApply->setFocus(); Group1Sel->buttonApply->setFocus();
SelectionIntoArgument(); SelectionIntoArgument();
@ -428,6 +496,9 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
InitClick(); InitClick();
myAngle = 0.0; myAngle = 0.0;
// Get setting of step value from file configuration
double step = SUIT_Session::session()->resourceMgr()->doubleValue("Geometry", "SettingsGeomStep", 100.0);
if ( myConstructorId == 0 ) if ( myConstructorId == 0 )
{ // SEGMENT { // SEGMENT
myX = 0.0; myX = 0.0;
@ -435,8 +506,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
myLength = 100.0; myLength = 100.0;
if ( myConstructorDirId == 2 ) if ( myConstructorDirId == 2 )
{ // Angle { // Angle
Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2")); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
Group2Spin->SpinBox_DX->SetValue(myAngle); Group2Spin->SpinBox_DX->SetValue(myAngle);
Group2Spin->buttonApply->setFocus(); Group2Spin->buttonApply->setFocus();
@ -511,9 +582,9 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
} }
else if ( myConstructorDirId == 3 ) else if ( myConstructorDirId == 3 )
{ // DXDY { // DXDY
Group3Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3); Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
Group3Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3); Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2")); Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2"));
Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2")); Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2"));
myDX = 0.0; myDX = 0.0;
@ -550,9 +621,9 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
if ( constructorId == 2 ) if ( constructorId == 2 )
{ // Length { // Length
mySketchType = DIR_ANGLE_LENGTH; mySketchType = DIR_ANGLE_LENGTH;
Group3Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
Group3Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2")); Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_RADIUS2")); Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_RADIUS2"));
Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_ANGLE2")); Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_ANGLE2"));
@ -570,8 +641,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
if ( constructorId == 2 ) if ( constructorId == 2 )
{ // Length { // Length
mySketchType = DIR_PER_LENGTH; mySketchType = DIR_PER_LENGTH;
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2")); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2")); Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
myRadius = 100.0; myRadius = 100.0;
@ -587,8 +658,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
if ( constructorId == 2 ) if ( constructorId == 2 )
{ // Length { // Length
mySketchType = DIR_TAN_LENGTH; mySketchType = DIR_TAN_LENGTH;
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2")); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2")); Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
myRadius = 100.0; myRadius = 100.0;
@ -680,7 +751,7 @@ void EntityGUI_SketcherDlg::ClickOnEnd()
//================================================================================= //=================================================================================
bool EntityGUI_SketcherDlg::ClickOnApply() bool EntityGUI_SketcherDlg::ClickOnApply()
{ {
((QPushButton*)sender())->setFocus(); ((QPushButton*)sender())->setFocus(); // to update value of currently edited spin-box (PAL11948)
myCommand.append( GetNewCommand() ); myCommand.append( GetNewCommand() );
mySketchState = NEXT_POINT; mySketchState = NEXT_POINT;
@ -695,6 +766,24 @@ bool EntityGUI_SketcherDlg::ClickOnApply()
GEOMBase_Helper::displayPreview(); GEOMBase_Helper::displayPreview();
// Set focus to SpinBox_DX
if (sender() == Group1Spin->buttonApply) {
(Group1Spin->SpinBox_DX)->setFocus();
(Group1Spin->SpinBox_DX)->selectAll();
}
else if (sender() == Group2Spin->buttonApply) {
(Group2Spin->SpinBox_DX)->setFocus();
(Group2Spin->SpinBox_DX)->selectAll();
}
else if (sender() == Group3Spin->buttonApply) {
(Group3Spin->SpinBox_DX)->setFocus();
(Group3Spin->SpinBox_DX)->selectAll();
}
else if (sender() == Group4Spin->buttonApply) {
(Group4Spin->SpinBox_DX)->setFocus();
(Group4Spin->SpinBox_DX)->selectAll();
}
return true; return true;
} }
@ -879,7 +968,7 @@ void EntityGUI_SketcherDlg::DeactivateActiveDialog()
setEnabled( false ); setEnabled( false );
globalSelection(); globalSelection();
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0); disconnect(myGeometryGUI->getApp()->selectionMgr(), 0, this, 0);
myGeometryGUI->SetActiveDialogBox(0); myGeometryGUI->SetActiveDialogBox(0);
} }
@ -894,8 +983,8 @@ void EntityGUI_SketcherDlg::ActivateThisDialog()
setEnabled(true); setEnabled(true);
myGeometryGUI->SetActiveDialogBox((QDialog*)this); myGeometryGUI->SetActiveDialogBox((QDialog*)this);
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect(myGeometryGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
//myGeometryGUI->SetState( 0 ); //myGeometryGUI->SetState( 0 );
globalSelection( GEOM_POINT ); globalSelection( GEOM_POINT );
@ -925,7 +1014,7 @@ void EntityGUI_SketcherDlg::enterEvent(QEvent* e)
void EntityGUI_SketcherDlg::closeEvent(QCloseEvent* e) void EntityGUI_SketcherDlg::closeEvent(QCloseEvent* e)
{ {
//myGeometryGUI->SetState( -1 ); //myGeometryGUI->SetState( -1 );
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0); disconnect(myGeometryGUI->getApp()->selectionMgr(), 0, this, 0);
QDialog::closeEvent( e ); QDialog::closeEvent( e );
} }
@ -1272,28 +1361,29 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects )
} }
QString cmd; QString cmd;
if( ( mySketchState != FIRST_POINT && myLastX1 == myLastX2 && myLastY1 == myLastY2 ) || myIsAllAdded ) { if( ( mySketchState != FIRST_POINT &&
myLastX1 == myLastX2 && myLastY1 == myLastY2 ) || myIsAllAdded ) {
cmd = myCommand.join( "" ); cmd = myCommand.join( "" );
if ( Group1Sel->isVisible() ) { if ( Group1Sel->isVisible() ) {
Group1Sel->buttonApply->setEnabled(false); Group1Sel->buttonApply->setEnabled(false);
Group1Sel->buttonApply->setFocus(); //Group1Sel->buttonApply->setFocus();
} }
if ( Group1Spin->isVisible() ) { if ( Group1Spin->isVisible() ) {
Group1Spin->buttonApply->setEnabled(false); Group1Spin->buttonApply->setEnabled(false);
Group1Spin->buttonApply->setFocus(); //Group1Spin->buttonApply->setFocus();
} }
if ( Group2Spin->isVisible() ) { if ( Group2Spin->isVisible() ) {
Group2Spin->buttonApply->setEnabled(false); Group2Spin->buttonApply->setEnabled(false);
Group2Spin->buttonApply->setFocus(); //Group2Spin->buttonApply->setFocus();
} }
if ( Group3Spin->isVisible() ) { if ( Group3Spin->isVisible() ) {
Group3Spin->buttonApply->setEnabled(false); Group3Spin->buttonApply->setEnabled(false);
Group3Spin->buttonApply->setFocus(); //Group3Spin->buttonApply->setFocus();
} }
if ( Group4Spin->isVisible() ) { if ( Group4Spin->isVisible() ) {
Group4Spin->buttonApply->setEnabled(false); Group4Spin->buttonApply->setEnabled(false);
Group4Spin->buttonApply->setFocus(); //Group4Spin->buttonApply->setFocus();
} }
} }
else { else {
@ -1301,23 +1391,23 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects )
if ( Group1Sel->isVisible() ) { if ( Group1Sel->isVisible() ) {
Group1Sel->buttonApply->setEnabled(true); Group1Sel->buttonApply->setEnabled(true);
Group1Sel->buttonApply->setFocus(); //Group1Sel->buttonApply->setFocus();
} }
if ( Group1Spin->isVisible() ) { if ( Group1Spin->isVisible() ) {
Group1Spin->buttonApply->setEnabled(true); Group1Spin->buttonApply->setEnabled(true);
Group1Spin->buttonApply->setFocus(); //Group1Spin->buttonApply->setFocus();
} }
if ( Group2Spin->isVisible() ) { if ( Group2Spin->isVisible() ) {
Group2Spin->buttonApply->setEnabled(true); Group2Spin->buttonApply->setEnabled(true);
Group2Spin->buttonApply->setFocus(); //Group2Spin->buttonApply->setFocus();
} }
if ( Group3Spin->isVisible() ) { if ( Group3Spin->isVisible() ) {
Group3Spin->buttonApply->setEnabled(true); Group3Spin->buttonApply->setEnabled(true);
Group3Spin->buttonApply->setFocus(); //Group3Spin->buttonApply->setFocus();
} }
if ( Group4Spin->isVisible() ) { if ( Group4Spin->isVisible() ) {
Group4Spin->buttonApply->setEnabled(true); Group4Spin->buttonApply->setEnabled(true);
Group4Spin->buttonApply->setFocus(); //Group4Spin->buttonApply->setFocus();
} }
} }
@ -1336,7 +1426,8 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects )
WPlane[7] = myWPlane.XDirection().Y(); WPlane[7] = myWPlane.XDirection().Y();
WPlane[8] = myWPlane.XDirection().Z(); WPlane[8] = myWPlane.XDirection().Z();
GEOM::GEOM_Object_var anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeSketcher( cmd.latin1(), WPlane ); GEOM::GEOM_Object_var anObj =
GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeSketcher( cmd.latin1(), WPlane );
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() ); objects.push_back( anObj._retn() );
@ -1433,9 +1524,19 @@ bool EntityGUI_SketcherDlg::createShapes( GEOM::GEOM_Object_ptr theObject,
return true; return true;
} }
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void EntityGUI_SketcherDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
ClickOnHelp();
}
}

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // 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
// //
// //
// //
@ -68,6 +68,8 @@ public:
const char* name = 0, bool modal = FALSE, WFlags fl = 0); const char* name = 0, bool modal = FALSE, WFlags fl = 0);
~EntityGUI_SketcherDlg(); ~EntityGUI_SketcherDlg();
bool eventFilter (QObject* object, QEvent* event);
protected: protected:
// redefined from GEOMBase_Helper // redefined from GEOMBase_Helper
virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual GEOM::GEOM_IOperations_ptr createOperation();
@ -75,6 +77,7 @@ protected:
virtual bool execute( ObjectList& objects ); virtual bool execute( ObjectList& objects );
void closeEvent( QCloseEvent* e ); void closeEvent( QCloseEvent* e );
void keyPressEvent( QKeyEvent* e );
private : private :
void Init(); void Init();

View File

@ -55,6 +55,7 @@
#include <map> #include <map>
#include <string> #include <string>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
static GEOM_Engine* TheEngine = NULL; static GEOM_Engine* TheEngine = NULL;
@ -214,6 +215,9 @@ Handle(GEOM_Object) GEOM_Engine::AddSubShape(Handle(GEOM_Object) theMainShape,
aSSI.SetIndices(theIndices); aSSI.SetIndices(theIndices);
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
GEOM_Solver aSolver (GEOM_Engine::GetEngine()); GEOM_Solver aSolver (GEOM_Engine::GetEngine());
if (!aSolver.ComputeFunction(aFunction)) { if (!aSolver.ComputeFunction(aFunction)) {
MESSAGE("GEOM_Engine::AddSubShape Error: Can't build a sub shape"); MESSAGE("GEOM_Engine::AddSubShape Error: Can't build a sub shape");

View File

@ -54,6 +54,7 @@
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx> #include <TCollection_ExtendedString.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
#define ARGUMENT_LABEL 1 #define ARGUMENT_LABEL 1
@ -165,7 +166,10 @@ TopoDS_Shape GEOM_Function::GetValue()
if(anObject.IsNull()) return aShape; if(anObject.IsNull()) return aShape;
if(!anObject->IsMainShape()) { if(!anObject->IsMainShape()) {
try { try {
GEOM_Solver aSolver(GEOM_Engine::GetEngine()); #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
GEOM_Solver aSolver(GEOM_Engine::GetEngine());
if (!aSolver.ComputeFunction(this)) { if (!aSolver.ComputeFunction(this)) {
MESSAGE("GEOM_Object::GetValue Error : Can't build a sub shape"); MESSAGE("GEOM_Object::GetValue Error : Can't build a sub shape");
return aShape; return aShape;

View File

@ -104,9 +104,13 @@ namespace GEOM
TPythonDump& TPythonDump::operator<< (const Handle(GEOM_Object)& theObject) TPythonDump& TPythonDump::operator<< (const Handle(GEOM_Object)& theObject)
{ {
TCollection_AsciiString anEntry; if (theObject.IsNull()) {
TDF_Tool::Entry(theObject->GetEntry(), anEntry); myStream << "None";
myStream << anEntry.ToCString(); } else {
TCollection_AsciiString anEntry;
TDF_Tool::Entry(theObject->GetEntry(), anEntry);
myStream << anEntry.ToCString();
}
return *this; return *this;
} }

View File

@ -249,3 +249,20 @@ void GEOMBase_Skeleton::setHelpFileName(const QString& theName)
{ {
myHelpFileName = theName; myHelpFileName = theName;
} }
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void GEOMBase_Skeleton::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
ClickOnHelp();
}
}

View File

@ -58,6 +58,7 @@ private:
protected: protected:
void closeEvent(QCloseEvent* e); void closeEvent(QCloseEvent* e);
void keyPressEvent(QKeyEvent* e);
/*! initialize "Name" field with a string "thePrefix_X" (Vertex_3) /*! initialize "Name" field with a string "thePrefix_X" (Vertex_3)
*/ */

View File

@ -58,6 +58,7 @@ LIB_CLIENT_IDL = SALOME_Exception.idl \
SALOMEDS.idl \ SALOMEDS.idl \
SALOMEDS_Attributes.idl \ SALOMEDS_Attributes.idl \
SALOME_GenericObj.idl \ SALOME_GenericObj.idl \
SALOME_Component.idl \
GEOM_Gen.idl GEOM_Gen.idl
LIB_SERVER_IDL = LIB_SERVER_IDL =

View File

@ -337,6 +337,10 @@ msgstr "supresshole.png"
msgid "ICON_DLG_SUPRESS_HOLE_FACE_SHELL" msgid "ICON_DLG_SUPRESS_HOLE_FACE_SHELL"
msgstr "supressHolesOnFaceShell.png" msgstr "supressHolesOnFaceShell.png"
#ChangeOrientationDlg
msgid "ICON_DLG_CHANGE_ORIENTATION"
msgstr "change_orientation.png"
#MultiTranslationDlg #MultiTranslationDlg
msgid "ICON_DLG_MULTITRANSLATION_SIMPLE" msgid "ICON_DLG_MULTITRANSLATION_SIMPLE"
msgstr "multitranslationsimple.png" msgstr "multitranslationsimple.png"

View File

@ -992,6 +992,10 @@ msgstr "Prism Construction"
msgid "GEOM_PRISM_BSV" msgid "GEOM_PRISM_BSV"
msgstr "Base Shape + Vector" msgstr "Base Shape + Vector"
#: GeometryGUI_PrismDlg.cxx:83
msgid "GEOM_PRISM_BSV_2P"
msgstr "Base Shape + 2 Points"
#: GeometryGUI_PropertiesDlg.cxx:56 #: GeometryGUI_PropertiesDlg.cxx:56
msgid "GEOM_PROPERTIES_TITLE" msgid "GEOM_PROPERTIES_TITLE"
msgstr "Basic Properties Informations" msgstr "Basic Properties Informations"

View File

@ -994,6 +994,10 @@ msgstr "Extruder une Shape de base"
msgid "GEOM_PRISM_BSV" msgid "GEOM_PRISM_BSV"
msgstr "Shape de base + Vecteur" msgstr "Shape de base + Vecteur"
#: GeometryGUI_PrismDlg.cxx:83
msgid "GEOM_PRISM_BSV_2P"
msgstr "Shape de base + 2 Points"
#: GeometryGUI_PropertiesDlg.cxx:56 #: GeometryGUI_PropertiesDlg.cxx:56
msgid "GEOM_PROPERTIES_TITLE" msgid "GEOM_PROPERTIES_TITLE"
msgstr "Proprietes Basiques" msgstr "Proprietes Basiques"

View File

@ -39,6 +39,9 @@
#include <SelectMgr_IndexedMapOfOwner.hxx> #include <SelectMgr_IndexedMapOfOwner.hxx>
#include <NCollection_DataMap.hxx> #include <NCollection_DataMap.hxx>
#include <SUIT_Session.h>
#include <SalomeApp_Study.h>
//================================================================ //================================================================
// Function : GEOMGUI_OCCSelector // Function : GEOMGUI_OCCSelector
@ -209,7 +212,10 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() ); const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
if ( owner ) if ( owner )
{ {
globalSelMap[owner->entry()] = 1; SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
QString anEntry = appStudy->referencedToEntry( owner->entry() );
globalSelMap[anEntry] = 1;
} }
} }
} }

View File

@ -69,6 +69,7 @@
// OCCT Includes // OCCT Includes
#include <AIS_Drawer.hxx> #include <AIS_Drawer.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx> #include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_PointAspect.hxx> #include <Prs3d_PointAspect.hxx>
#include <Graphic3d_AspectMarker3d.hxx> #include <Graphic3d_AspectMarker3d.hxx>
#include <StdSelect_TypeOfEdge.hxx> #include <StdSelect_TypeOfEdge.hxx>
@ -520,6 +521,19 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
AISShape->SetDisplayMode( myDisplayMode ); AISShape->SetDisplayMode( myDisplayMode );
AISShape->SetShadingColor( myShadingColor ); AISShape->SetShadingColor( myShadingColor );
// Set color for iso lines
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
QColor col = aResMgr->colorValue( "Geometry", "isos_color", QColor(int(0.5*255), int(0.5*255), int(0.5*255)) );
Quantity_Color aColor = SalomeApp_Tools::color( col );
Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect();
anAspect->SetColor( aColor );
AISShape->Attributes()->SetUIsoAspect( anAspect );
anAspect = AISShape->Attributes()->VIsoAspect();
anAspect->SetColor( aColor );
AISShape->Attributes()->SetVIsoAspect( anAspect );
if ( HasColor() ) if ( HasColor() )
{ {
AISShape->SetColor( (Quantity_NameOfColor)GetColor() ); AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
@ -530,6 +544,49 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
AISShape->Attributes()->SetPointAspect( anAspect ); AISShape->Attributes()->SetPointAspect( anAspect );
} }
} }
else
{
if ( myShape.ShapeType() == TopAbs_VERTEX )
{
col = aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) );
aColor = SalomeApp_Tools::color( col );
Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
anAspect->SetColor( aColor );
AISShape->Attributes()->SetPointAspect( anAspect );
}
else
{
// Set line aspect
col = aResMgr->colorValue( "Geometry", "wireframe_color", QColor( 255, 255, 0 ) );
aColor = SalomeApp_Tools::color( col );
Handle(Prs3d_LineAspect) anAspect = AISShape->Attributes()->LineAspect();
anAspect->SetColor( aColor );
AISShape->Attributes()->SetLineAspect( anAspect );
// Set unfree boundaries aspect
anAspect = AISShape->Attributes()->UnFreeBoundaryAspect();
anAspect->SetColor( aColor );
AISShape->Attributes()->SetUnFreeBoundaryAspect( anAspect );
// Set free boundaries aspect
col = aResMgr->colorValue( "Geometry", "free_bound_color", QColor( 0, 255, 0 ) );
aColor = SalomeApp_Tools::color( col );
anAspect = AISShape->Attributes()->FreeBoundaryAspect();
anAspect->SetColor( aColor );
AISShape->Attributes()->SetFreeBoundaryAspect( anAspect );
// Set wire aspect
col = aResMgr->colorValue( "Geometry", "line_color", QColor( 255, 0, 0 ) );
aColor = SalomeApp_Tools::color( col );
anAspect = AISShape->Attributes()->WireAspect();
anAspect->SetColor( aColor );
AISShape->Attributes()->SetWireAspect( anAspect );
}
}
if ( HasWidth() ) if ( HasWidth() )
AISShape->SetWidth( GetWidth() ); AISShape->SetWidth( GetWidth() );

View File

@ -307,6 +307,10 @@ msgstr "pointonedge.png"
msgid "ICON_DLG_SEWING" msgid "ICON_DLG_SEWING"
msgstr "sewing.png" msgstr "sewing.png"
#ChangeOrientationDlg
msgid "ICON_DLG_CHANGE_ORIENTATION"
msgstr "change_orientation.png"
#PipeDlg #PipeDlg
msgid "ICON_DLG_PIPE" msgid "ICON_DLG_PIPE"
msgstr "pipe.png" msgstr "pipe.png"
@ -315,6 +319,9 @@ msgstr "pipe.png"
msgid "ICON_DLG_PRISM" msgid "ICON_DLG_PRISM"
msgstr "prism.png" msgstr "prism.png"
msgid "ICON_DLG_PRISM_2P"
msgstr "prism2.png"
#RevolutionDlg #RevolutionDlg
msgid "ICON_DLG_REVOL" msgid "ICON_DLG_REVOL"
msgstr "revol.png" msgstr "revol.png"
@ -698,6 +705,9 @@ msgstr "free_bound.png"
msgid "ICO_CHECK_FREE_FACES" msgid "ICO_CHECK_FREE_FACES"
msgstr "free_faces.png" msgstr "free_faces.png"
msgid "ICO_CHANGE_ORIENTATION"
msgstr "change_orientation.png"
msgid "ICO_POINT_COORDS" msgid "ICO_POINT_COORDS"
msgstr "point_coord.png" msgstr "point_coord.png"

View File

@ -522,8 +522,8 @@ msgid "GEOM_MIRROR"
msgstr "Mirror" msgstr "Mirror"
#Prism #Prism
msgid "GEOM_PRISM" msgid "GEOM_EXTRUSION"
msgstr "Prism" msgstr "Extrusion"
#Sub Shapes #Sub Shapes
msgid "GEOM_SUB_SHAPE" msgid "GEOM_SUB_SHAPE"
@ -651,6 +651,10 @@ msgstr "Face"
msgid "GEOM_FACES" msgid "GEOM_FACES"
msgstr "Faces" msgstr "Faces"
#Face or LCS
msgid "GEOM_FACE_OR_LCS"
msgstr "Face or LCS"
#Line #Line
msgid "GEOM_LINE" msgid "GEOM_LINE"
msgstr "Line" msgstr "Line"
@ -899,7 +903,7 @@ msgstr "Create A Face"
#: GeometryGUI_FaceDlg.cxx:78 #: GeometryGUI_FaceDlg.cxx:78
msgid "GEOM_FACE_FFW" msgid "GEOM_FACE_FFW"
msgstr "Face from a wire" msgstr "Face from a closed wire and edge"
#: GeometryGUI_FaceDlg.cxx:103 #: GeometryGUI_FaceDlg.cxx:103
msgid "GEOM_FACE_OPT" msgid "GEOM_FACE_OPT"
@ -907,7 +911,7 @@ msgstr "Try to create a planar face"
#: GeometryGUI_FillingDlg.cxx:53 #: GeometryGUI_FillingDlg.cxx:53
msgid "GEOM_FILLING_TITLE" msgid "GEOM_FILLING_TITLE"
msgstr "Filling Surface With Curves" msgstr "Filling Surface With Edges"
#: GeometryGUI_FillingDlg.cxx:112 #: GeometryGUI_FillingDlg.cxx:112
msgid "GEOM_FILLING_ARG" msgid "GEOM_FILLING_ARG"
@ -927,7 +931,7 @@ msgstr "Tol. 2D :"
#: GeometryGUI_FillingDlg.cxx:170 #: GeometryGUI_FillingDlg.cxx:170
msgid "GEOM_FILLING_COMPOUND" msgid "GEOM_FILLING_COMPOUND"
msgstr "Curves Comp." msgstr "Edges compound"
#: GeometryGUI_FillingDlg.cxx:184 #: GeometryGUI_FillingDlg.cxx:184
msgid "GEOM_FILLING_TOL_3D" msgid "GEOM_FILLING_TOL_3D"
@ -1052,13 +1056,16 @@ msgid "GEOM_PLANE_PV"
msgstr "Point + Vector" msgstr "Point + Vector"
#: GeometryGUI_PrismDlg.cxx:54 #: GeometryGUI_PrismDlg.cxx:54
msgid "GEOM_PRISM_TITLE" msgid "GEOM_EXTRUSION_TITLE"
msgstr "Prism Construction" msgstr "Construction by Extrusion"
#: GeometryGUI_PrismDlg.cxx:83 #: GeometryGUI_PrismDlg.cxx:83
msgid "GEOM_PRISM_BSV" msgid "GEOM_EXTRUSION_BSV"
msgstr "Base Shape + Vector" msgstr "Base Shape + Vector"
msgid "GEOM_EXTRUSION_BSV_2P"
msgstr "Base Shape + 2 Points"
#: GeometryGUI_PropertiesDlg.cxx:56 #: GeometryGUI_PropertiesDlg.cxx:56
msgid "GEOM_PROPERTIES_TITLE" msgid "GEOM_PROPERTIES_TITLE"
msgstr "Basic Properties Informations" msgstr "Basic Properties Informations"
@ -1226,7 +1233,7 @@ msgstr "Working Plane Selection"
#: GeometryGUI_WorkingPlaneDlg.cxx:107 #: GeometryGUI_WorkingPlaneDlg.cxx:107
msgid "GEOM_WPLANE_FACE" msgid "GEOM_WPLANE_FACE"
msgstr "Plane Or Planar Face" msgstr "Plane, Planar Face or LCS"
#: GeometryGUI_WorkingPlaneDlg.cxx:107 #: GeometryGUI_WorkingPlaneDlg.cxx:107
msgid "GEOM_WPLANE_VECTOR" msgid "GEOM_WPLANE_VECTOR"
@ -1639,6 +1646,12 @@ msgstr "Free boundaries"
msgid "GEOM_FREE_FACES" msgid "GEOM_FREE_FACES"
msgstr "Free faces" msgstr "Free faces"
msgid "GEOM_CHANGE_ORIENTATION_TITLE"
msgstr "Change orientation"
msgid "GEOM_CHANGE_ORIENTATION"
msgstr "Objects to change orientation"
msgid "GEOM_BY_PARAMETER" msgid "GEOM_BY_PARAMETER"
msgstr "By parameter" msgstr "By parameter"
@ -1711,6 +1724,9 @@ msgstr "Point Coordinates"
msgid "MeasureGUI_PointDlg::COORDINATES" msgid "MeasureGUI_PointDlg::COORDINATES"
msgstr "Point and its coordinates" msgstr "Point and its coordinates"
msgid "MeasureGUI_1Sel1TextView1Check_QTD::CHECK_SHAPE_GEOMETRY"
msgstr "Check also geometry"
msgid "GroupGUI_GroupDlg::CREATE_GROUP_TITLE" msgid "GroupGUI_GroupDlg::CREATE_GROUP_TITLE"
msgstr "Create Group" msgstr "Create Group"
@ -1982,6 +1998,9 @@ msgstr "ProcessShape"
msgid "SUPRESS_FACE_NEW_OBJ_NAME" msgid "SUPRESS_FACE_NEW_OBJ_NAME"
msgstr "SupressFaces" msgstr "SupressFaces"
msgid "CHANGE_ORIENTATION_NEW_OBJ_NAME"
msgstr "Invert"
msgid "NON_GEOM_OBJECTS_SELECTED" msgid "NON_GEOM_OBJECTS_SELECTED"
msgstr "There are objects selected which do not belong to %1 component." msgstr "There are objects selected which do not belong to %1 component."
@ -2200,13 +2219,13 @@ msgid "STB_FILLING"
msgstr "Create a filling" msgstr "Create a filling"
msgid "TOP_PIPE" msgid "TOP_PIPE"
msgstr "Create a pipe" msgstr "Extrusion along a path"
msgid "MEN_PIPE" msgid "MEN_PIPE"
msgstr "Pipe" msgstr "Extrusion along a path"
msgid "STB_PIPE" msgid "STB_PIPE"
msgstr "Create a pipe" msgstr "Create a shape by Extrusion along a path"
msgid "MEN_GROUP" msgid "MEN_GROUP"
msgstr "Group" msgstr "Group"
@ -2607,6 +2626,15 @@ msgstr "Check free faces"
msgid "STB_CHECK_FREE_FACES" msgid "STB_CHECK_FREE_FACES"
msgstr "Check free faces" msgstr "Check free faces"
msgid "TOP_CHANGE_ORIENTATION"
msgstr "Change orientation"
msgid "MEN_CHANGE_ORIENTATION"
msgstr "Change orientation"
msgid "STB_CHANGE_ORIENTATION"
msgstr "Change orientation"
msgid "MEN_MEASURES" msgid "MEN_MEASURES"
msgstr "Measures" msgstr "Measures"
@ -2907,6 +2935,21 @@ msgstr "General"
msgid "PREF_SHADING_COLOR" msgid "PREF_SHADING_COLOR"
msgstr "Default shading color" msgstr "Default shading color"
msgid "PREF_WIREFRAME_COLOR"
msgstr "Default wireframe color"
msgid "PREF_FREE_BOUND_COLOR"
msgstr "Color of free boundaries"
msgid "PREF_LINE_COLOR"
msgstr "Color of edges, vectors, wires"
msgid "PREF_POINT_COLOR"
msgstr "Color of points"
msgid "PREF_ISOS_COLOR"
msgstr "Color of isolines"
msgid "PREF_STEP_VALUE" msgid "PREF_STEP_VALUE"
msgstr "Step value for spin boxes" msgstr "Step value for spin boxes"
@ -2915,3 +2958,9 @@ msgstr "Default display mode"
msgid "PREF_TAB_SETTINGS" msgid "PREF_TAB_SETTINGS"
msgstr "Settings" msgstr "Settings"
msgid "ERROR_SHAPE_TYPE"
msgstr "Object of incorrect type selected!\nPlease, select face, shell or solid and try again"
msgid "DEP_OBJECT"
msgstr "Selected object has been used to create another one\n It can't be deleted "

View File

@ -481,7 +481,7 @@ msgstr "Distance"
#Filling #Filling
msgid "GEOM_FILLING" msgid "GEOM_FILLING"
msgstr "Surface Par Courbes" msgstr "Surface Par Edges"
#Fuse #Fuse
msgid "GEOM_FUSE" msgid "GEOM_FUSE"
@ -512,7 +512,7 @@ msgid "GEOM_MIRROR"
msgstr "Miroir" msgstr "Miroir"
#Prism #Prism
msgid "GEOM_PRISM" msgid "GEOM_EXTRUSION"
msgstr "Extrusion" msgstr "Extrusion"
#Sub Shapes #Sub Shapes
@ -891,7 +891,7 @@ msgstr "Création d'une Face plane"
#: GeometryGUI_FillingDlg.cxx:53 #: GeometryGUI_FillingDlg.cxx:53
msgid "GEOM_FILLING_TITLE" msgid "GEOM_FILLING_TITLE"
msgstr "Surface Par Courbes" msgstr "Surface Par Edges"
#: GeometryGUI_FillingDlg.cxx:112 #: GeometryGUI_FillingDlg.cxx:112
msgid "GEOM_FILLING_ARG" msgid "GEOM_FILLING_ARG"
@ -911,7 +911,7 @@ msgstr "Tol. 2D"
#: GeometryGUI_FillingDlg.cxx:170 #: GeometryGUI_FillingDlg.cxx:170
msgid "GEOM_FILLING_COMPOUND" msgid "GEOM_FILLING_COMPOUND"
msgstr "Compound de Courbes" msgstr "Compound de Edges"
#: GeometryGUI_FillingDlg.cxx:184 #: GeometryGUI_FillingDlg.cxx:184
msgid "GEOM_FILLING_TOL_3D" msgid "GEOM_FILLING_TOL_3D"
@ -1036,13 +1036,16 @@ msgid "GEOM_PLANE_PV"
msgstr "Point + Vecteur" msgstr "Point + Vecteur"
#: GeometryGUI_PrismDlg.cxx:54 #: GeometryGUI_PrismDlg.cxx:54
msgid "GEOM_PRISM_TITLE" msgid "GEOM_EXTRUSION_TITLE"
msgstr "Extruder une Shape de base" msgstr "Extruder une Shape de base"
#: GeometryGUI_PrismDlg.cxx:83 #: GeometryGUI_PrismDlg.cxx:83
msgid "GEOM_PRISM_BSV" msgid "GEOM_EXTRUSION_BSV"
msgstr "Shape de base + Vecteur" msgstr "Shape de base + Vecteur"
msgid "GEOM_EXTRUSION_BSV_2P"
msgstr "Shape de base + 2 Points"
#: GeometryGUI_PropertiesDlg.cxx:56 #: GeometryGUI_PropertiesDlg.cxx:56
msgid "GEOM_PROPERTIES_TITLE" msgid "GEOM_PROPERTIES_TITLE"
msgstr "Proprietes Basiques" msgstr "Proprietes Basiques"

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // 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
// //
// //
// //
@ -503,6 +503,7 @@ void GeometryGUI::OnGUIEvent( int id )
id == 608 || // MENU REPAIR - ADD POINT ON EDGE id == 608 || // MENU REPAIR - ADD POINT ON EDGE
id == 609 || // MENU REPAIR - FREE BOUNDARIES id == 609 || // MENU REPAIR - FREE BOUNDARIES
id == 610 || // MENU REPAIR - FREE FACES id == 610 || // MENU REPAIR - FREE FACES
id == 611 || // MENU REPAIR - CHANGE ORIENTATION
id == 602 ) { // MENU REPAIR - GLUE FACES id == 602 ) { // MENU REPAIR - GLUE FACES
#ifndef WNT #ifndef WNT
library = getLibrary( "libRepairGUI.so" ); library = getLibrary( "libRepairGUI.so" );
@ -829,6 +830,7 @@ void GeometryGUI::initialize( CAM_Application* app )
createGeomAction( 608, "POINT_ON_EDGE" ); createGeomAction( 608, "POINT_ON_EDGE" );
createGeomAction( 609, "CHECK_FREE_BNDS" ); createGeomAction( 609, "CHECK_FREE_BNDS" );
createGeomAction( 610, "CHECK_FREE_FACES" ); createGeomAction( 610, "CHECK_FREE_FACES" );
createGeomAction( 611, "CHANGE_ORIENTATION" );
createGeomAction( 708, "POINT_COORDS" ); createGeomAction( 708, "POINT_COORDS" );
createGeomAction( 701, "BASIC_PROPS" ); createGeomAction( 701, "BASIC_PROPS" );
@ -971,6 +973,7 @@ void GeometryGUI::initialize( CAM_Application* app )
createMenu( 608, repairId, -1 ); createMenu( 608, repairId, -1 );
createMenu( 609, repairId, -1 ); createMenu( 609, repairId, -1 );
createMenu( 610, repairId, -1 ); createMenu( 610, repairId, -1 );
createMenu( 611, repairId, -1 );
int measurId = createMenu( tr( "MEN_MEASURES" ), -1, -1, 10 ); int measurId = createMenu( tr( "MEN_MEASURES" ), -1, -1, 10 );
createMenu( 708, measurId, -1 ); createMenu( 708, measurId, -1 );
@ -1068,30 +1071,34 @@ void GeometryGUI::initialize( CAM_Application* app )
createTool( 5027, transTbId ); createTool( 5027, transTbId );
createTool( 5028, transTbId ); createTool( 5028, transTbId );
// ---- create popup menus --------------------------
QString clientOCCorVTK = "(client='OCCViewer' or client='VTKViewer')";
QString clientOCCorVTK_AndSomeVisible = clientOCCorVTK + " and selcount>0 and isVisible";
QtxPopupMgr* mgr = popupMgr(); QtxPopupMgr* mgr = popupMgr();
mgr->insert( action( 901 ), -1, -1 ); // rename mgr->insert( action( 901 ), -1, -1 ); // rename
mgr->setRule( action( 901 ), "$type in {'Shape' 'Group'} and selcount=1", true ); mgr->setRule( action( 901 ), "$type in {'Shape' 'Group'} and selcount=1", true );
mgr->insert( action( 8001 ), -1, -1 ); // create group mgr->insert( action( 8001 ), -1, -1 ); // create group
mgr->setRule( action( 8001 ), "client='ObjectBrowser' and type='Shape' and selcount=1 and isOCC=true", true ); mgr->setRule( action( 8001 ), "client='ObjectBrowser' and type='Shape' and selcount=1 and isOCC=true", true );
mgr->insert( action( 801 ), -1, -1 ); // edit group mgr->insert( action( 801 ), -1, -1 ); // edit group
mgr->setRule( action( 801 ), "client='ObjectBrowser' and type='Group' and selcount=1 and isOCC=true", true ); mgr->setRule( action( 801 ), "client='ObjectBrowser' and type='Group' and selcount=1 and isOCC=true", true );
mgr->insert( separator(), -1, -1 ); // ----------- mgr->insert( separator(), -1, -1 ); // -----------
dispmodeId = mgr->insert( tr( "MEN_DISPLAY_MODE" ), -1, -1 ); // display mode menu dispmodeId = mgr->insert( tr( "MEN_DISPLAY_MODE" ), -1, -1 ); // display mode menu
mgr->insert( action( 80311 ), dispmodeId, -1 ); // wireframe mgr->insert( action( 80311 ), dispmodeId, -1 ); // wireframe
mgr->setRule( action( 80311 ), "(client='OCCViewer' or client='VTKViewer') and selcount>0 and isVisible", true ); mgr->setRule( action( 80311 ), clientOCCorVTK_AndSomeVisible, true );
mgr->setRule( action( 80311 ), "(client='OCCViewer' or client='VTKViewer') and displaymode='Wireframe'", false ); mgr->setRule( action( 80311 ), clientOCCorVTK + " and displaymode='Wireframe'", false );
mgr->insert( action( 80312 ), dispmodeId, -1 ); // shading mgr->insert( action( 80312 ), dispmodeId, -1 ); // shading
mgr->setRule( action( 80312 ), "(client='OCCViewer' or client='VTKViewer') and selcount>0 and isVisible", true ); mgr->setRule( action( 80312 ), clientOCCorVTK_AndSomeVisible, true );
mgr->setRule( action( 80312 ), "(client='OCCViewer' or client='VTKViewer') and displaymode='Shading'", false ); mgr->setRule( action( 80312 ), clientOCCorVTK + " and displaymode='Shading'", false );
mgr->insert( separator(), -1, -1 ); // ----------- mgr->insert( separator(), -1, -1 ); // -----------
mgr->insert( action( 8032 ), -1, -1 ); // color mgr->insert( action( 8032 ), -1, -1 ); // color
mgr->setRule( action( 8032 ), "(client='OCCViewer' or client='VTKViewer') and selcount>0 and isVisible", true ); mgr->setRule( action( 8032 ), clientOCCorVTK_AndSomeVisible + " and ($component={'GEOM'})", true );
mgr->insert( action( 8033 ), -1, -1 ); // transparency mgr->insert( action( 8033 ), -1, -1 ); // transparency
mgr->setRule( action( 8033 ), "(client='OCCViewer' or client='VTKViewer') and selcount>0 and isVisible", true ); mgr->setRule( action( 8033 ), clientOCCorVTK_AndSomeVisible, true );
mgr->insert( action( 8034 ), -1, -1 ); // isos mgr->insert( action( 8034 ), -1, -1 ); // isos
mgr->setRule( action( 8034 ), "client='OCCViewer' and selcount>0 and isVisible", true ); mgr->setRule( action( 8034 ), "client='OCCViewer' and selcount>0 and isVisible", true );
mgr->insert( separator(), -1, -1 ); // ----------- mgr->insert( separator(), -1, -1 ); // -----------
QString canDisplay = "($component={'GEOM'}) and (selcount>0) and ({true} in $canBeDisplayed) ", QString canDisplay = "($component={'GEOM'}) and (selcount>0) and ({true} in $canBeDisplayed) ",
@ -1106,7 +1113,7 @@ void GeometryGUI::initialize( CAM_Application* app )
mgr->setRule( action( 215 ), rule.arg( types ).arg( "isVisible" ), true ); mgr->setRule( action( 215 ), rule.arg( types ).arg( "isVisible" ), true );
mgr->insert( action( 214 ), -1, -1 ); // erase All mgr->insert( action( 214 ), -1, -1 ); // erase All
mgr->setRule( action( 214 ), "client='OCCViewer' or client='VTKViewer'", true ); mgr->setRule( action( 214 ), clientOCCorVTK, true );
mgr->insert( action( 213 ), -1, -1 ); // display only mgr->insert( action( 213 ), -1, -1 ); // display only
mgr->setRule( action( 213 ), rule.arg( types ).arg( "true" ), true ); mgr->setRule( action( 213 ), rule.arg( types ).arg( "true" ), true );
@ -1193,6 +1200,12 @@ bool GeometryGUI::deactivateModule( SUIT_Study* study )
action(111)->setEnabled(false); // Import action(111)->setEnabled(false); // Import
action(121)->setEnabled(false); // Export action(121)->setEnabled(false); // Export
// Unset actions accelerator keys
//action(111)->setAccel(QKeySequence()); // Import
//action(121)->setAccel(QKeySequence()); // Export
action(111)->setEnabled(false); // Import
action(121)->setEnabled(false); // Export
myOCCSelectors.clear(); myOCCSelectors.clear();
getApp()->selectionMgr()->setEnabled( true, OCCViewer_Viewer::Type() ); getApp()->selectionMgr()->setEnabled( true, OCCViewer_Viewer::Type() );
@ -1645,18 +1658,31 @@ void GeometryGUI::createPreferences()
int tabId = addPreference( tr( "PREF_TAB_SETTINGS" ) ); int tabId = addPreference( tr( "PREF_TAB_SETTINGS" ) );
int genGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), tabId ); int genGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), tabId );
addPreference( tr( "PREF_SHADING_COLOR" ), genGroup, setPreferenceProperty( genGroup, "columns", 1 );
LightApp_Preferences::Color, "Geometry", "shading_color" );
int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), genGroup, int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), genGroup,
LightApp_Preferences::Selector, "Geometry", "display_mode" ); LightApp_Preferences::Selector, "Geometry", "display_mode" );
setPreferenceProperty( genGroup, "columns", 1 ); addPreference( tr( "PREF_SHADING_COLOR" ), genGroup,
LightApp_Preferences::Color, "Geometry", "shading_color" );
setPreferenceProperty( step, "min", 0.001 ); addPreference( tr( "PREF_WIREFRAME_COLOR" ), genGroup,
setPreferenceProperty( step, "max", 10000 ); LightApp_Preferences::Color, "Geometry", "wireframe_color" );
setPreferenceProperty( step, "precision", 3 );
addPreference( tr( "PREF_FREE_BOUND_COLOR" ), genGroup,
LightApp_Preferences::Color, "Geometry", "free_bound_color" );
addPreference( tr( "PREF_LINE_COLOR"), genGroup,
LightApp_Preferences::Color, "Geometry", "line_color" );
addPreference( tr( "PREF_POINT_COLOR"), genGroup,
LightApp_Preferences::Color, "Geometry", "point_color" );
addPreference( tr( "PREF_ISOS_COLOR" ), genGroup,
LightApp_Preferences::Color, "Geometry", "isos_color" );
int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
// Set property for default display mode // Set property for default display mode
QStringList aModesList; QStringList aModesList;
@ -1669,10 +1695,23 @@ void GeometryGUI::createPreferences()
setPreferenceProperty( dispmode, "strings", aModesList ); setPreferenceProperty( dispmode, "strings", aModesList );
setPreferenceProperty( dispmode, "indexes", anIndexesList ); setPreferenceProperty( dispmode, "indexes", anIndexesList );
// Set property for step value for spinboxes
setPreferenceProperty( step, "min", 0.001 );
setPreferenceProperty( step, "max", 10000 );
setPreferenceProperty( step, "precision", 3 );
} }
void GeometryGUI::preferencesChanged( const QString& section, const QString& param ) void GeometryGUI::preferencesChanged( const QString& section, const QString& param )
{ {
if (section == "Geometry") {
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
if (param == QString("SettingsGeomStep")) {
double spin_step = aResourceMgr->doubleValue(section, param, 100.);
EmitSignalDefaultStepValueChanged(spin_step);
}
}
} }
LightApp_Displayer* GeometryGUI::displayer() LightApp_Displayer* GeometryGUI::displayer()

View File

@ -110,14 +110,16 @@ GEOM_Swig::~GEOM_Swig()
// MESSAGE("Destructeur"); // MESSAGE("Destructeur");
} }
void GEOM_Swig::createAndDisplayGO (const char* Entry) void GEOM_Swig::createAndDisplayGO (const char* Entry, bool isUpdated)
{ {
class TEvent: public SALOME_Event class TEvent: public SALOME_Event
{ {
std::string myEntry; std::string myEntry;
bool myUpdateViewer;
public: public:
TEvent(const char* theEntry): TEvent(const char* theEntry, bool toUpdateViewer):
myEntry(theEntry) myEntry(theEntry),
myUpdateViewer(toUpdateViewer)
{} {}
virtual void Execute() virtual void Execute()
{ {
@ -179,7 +181,7 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
"GEOM", "GEOM",
const_cast<char*>( obj->GetID().c_str())); const_cast<char*>( obj->GetID().c_str()));
GEOM_Displayer(ActiveStudy).Display(anIO, true); GEOM_Displayer(ActiveStudy).Display(anIO, myUpdateViewer);
/*if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(app)) { /*if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(app)) {
SVTK_View* aView = aViewWindow->getView(); SVTK_View* aView = aViewWindow->getView();
int aMode = aView->GetDisplayMode(); int aMode = aView->GetDisplayMode();
@ -217,7 +219,7 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
}; };
// MESSAGE("createAndDisplayGO"); // MESSAGE("createAndDisplayGO");
ProcessVoidEvent(new TEvent (Entry)); ProcessVoidEvent(new TEvent (Entry, isUpdated));
class TEventUpdateBrowser: public SALOME_Event class TEventUpdateBrowser: public SALOME_Event
{ {
@ -234,7 +236,8 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
} }
}; };
ProcessVoidEvent(new TEventUpdateBrowser ()); if (isUpdated)
ProcessVoidEvent(new TEventUpdateBrowser ());
} }
void GEOM_Swig::createAndDisplayFitAllGO (const char* Entry) void GEOM_Swig::createAndDisplayFitAllGO (const char* Entry)
@ -267,6 +270,25 @@ void GEOM_Swig::createAndDisplayFitAllGO (const char* Entry)
ProcessVoidEvent(new TEventFitAll()); ProcessVoidEvent(new TEventFitAll());
} }
void GEOM_Swig::UpdateViewer()
{
class TEventUpdateViewer: public SALOME_Event
{
public:
TEventUpdateViewer() {}
virtual void Execute() {
SUIT_Application* app = SUIT_Session::session()->activeApplication();
if (!app) return;
SalomeApp_Study* ActiveStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
if (!ActiveStudy) return;
GEOM_Displayer(ActiveStudy).UpdateViewer();
}
};
ProcessVoidEvent(new TEventUpdateViewer());
}
int GEOM_Swig::getIndexTopology(const char* SubIOR, const char* IOR) int GEOM_Swig::getIndexTopology(const char* SubIOR, const char* IOR)
{ {
GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen(); GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen();
@ -345,14 +367,15 @@ const char* GEOM_Swig::getShapeTypeIcon(const char* IOR)
return "None"; return "None";
} }
void GEOM_Swig::setDisplayMode(const char* theEntry, int theMode) void GEOM_Swig::setDisplayMode(const char* theEntry, int theMode, bool isUpdated)
{ {
class TEvent: public SALOME_Event { class TEvent: public SALOME_Event {
std::string myEntry; std::string myEntry;
int myMode; int myMode;
bool myUpdateViewer;
public: public:
TEvent(const char* theEntryArg, int theModeArg): TEvent(const char* theEntryArg, int theModeArg, bool theUpdated):
myEntry(theEntryArg), myMode(theModeArg) myEntry(theEntryArg), myMode(theModeArg), myUpdateViewer(theUpdated)
{} {}
virtual void Execute() { virtual void Execute() {
SUIT_Application* anApp = SUIT_Session::session()->activeApplication(); SUIT_Application* anApp = SUIT_Session::session()->activeApplication();
@ -364,29 +387,31 @@ void GEOM_Swig::setDisplayMode(const char* theEntry, int theMode)
if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(anApp)) { if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(anApp)) {
SVTK_View* aView = aViewWindow->getView(); SVTK_View* aView = aViewWindow->getView();
aView->SetDisplayMode(anIO, myMode); aView->SetDisplayMode(anIO, myMode);
aView->Repaint(); if (myUpdateViewer)
aView->Repaint();
} }
else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) { else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) {
SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>(occViewer); SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>(occViewer);
if (soccViewer) if (soccViewer)
soccViewer->switchRepresentation(anIO, myMode); soccViewer->switchRepresentation(anIO, myMode, myUpdateViewer);
} }
} }
}; };
ProcessVoidEvent(new TEvent (theEntry, theMode)); ProcessVoidEvent(new TEvent (theEntry, theMode, isUpdated));
} }
void GEOM_Swig::setColor(const char* theEntry, int red, int green, int blue) void GEOM_Swig::setColor(const char* theEntry, int red, int green, int blue, bool isUpdated)
{ {
class TEvent: public SALOME_Event { class TEvent: public SALOME_Event {
std::string myEntry; std::string myEntry;
int myRed; int myRed;
int myGreen; int myGreen;
int myBlue; int myBlue;
bool myUpdateViewer;
public: public:
TEvent(const char* theEntryArg, int theR, int theG, int theB): TEvent(const char* theEntryArg, int theR, int theG, int theB, bool theUpdated):
myEntry(theEntryArg), myRed(theR), myGreen(theG), myBlue(theB) myEntry(theEntryArg), myRed(theR), myGreen(theG), myBlue(theB), myUpdateViewer(theUpdated)
{} {}
virtual void Execute() { virtual void Execute() {
SUIT_Application* anApp = SUIT_Session::session()->activeApplication(); SUIT_Application* anApp = SUIT_Session::session()->activeApplication();
@ -399,7 +424,8 @@ void GEOM_Swig::setColor(const char* theEntry, int red, int green, int blue)
SVTK_View* aView = aViewWindow->getView(); SVTK_View* aView = aViewWindow->getView();
QColor aColor (myRed, myGreen, myBlue); QColor aColor (myRed, myGreen, myBlue);
aView->SetColor(anIO, aColor); aView->SetColor(anIO, aColor);
aView->Repaint(); if (myUpdateViewer)
aView->Repaint();
} else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) { } else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) {
Handle(AIS_InteractiveContext) ic = occViewer->getAISContext(); Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
AIS_ListOfInteractive List; AIS_ListOfInteractive List;
@ -414,25 +440,27 @@ void GEOM_Swig::setColor(const char* theEntry, int red, int green, int blue)
ite.Value()->SetColor(CSFColor); ite.Value()->SetColor(CSFColor);
if (ite.Value()->IsKind(STANDARD_TYPE(GEOM_AISShape))) if (ite.Value()->IsKind(STANDARD_TYPE(GEOM_AISShape)))
Handle(GEOM_AISShape)::DownCast(ite.Value())->SetShadingColor(CSFColor); Handle(GEOM_AISShape)::DownCast(ite.Value())->SetShadingColor(CSFColor);
ite.Value()->Redisplay(Standard_True); ic->Redisplay(ite.Value(), true, true);
occViewer->update(); if (myUpdateViewer)
occViewer->update();
break; break;
} }
} }
} }
} }
}; };
ProcessVoidEvent(new TEvent(theEntry, red, green, blue)); ProcessVoidEvent(new TEvent(theEntry, red, green, blue, isUpdated));
} }
void GEOM_Swig::setTransparency(const char* theEntry, float transp) void GEOM_Swig::setTransparency(const char* theEntry, float transp, bool isUpdated)
{ {
class TEvent: public SALOME_Event { class TEvent: public SALOME_Event {
std::string myEntry; std::string myEntry;
float myParam; float myParam;
bool myUpdateViewer;
public: public:
TEvent(const char* theEntryArg, float theParam): TEvent(const char* theEntryArg, float theParam, bool theUpdated):
myEntry(theEntryArg), myParam(theParam) myEntry(theEntryArg), myParam(theParam), myUpdateViewer(theUpdated)
{} {}
virtual void Execute() { virtual void Execute() {
SUIT_Application* anApp = SUIT_Session::session()->activeApplication(); SUIT_Application* anApp = SUIT_Session::session()->activeApplication();
@ -444,16 +472,17 @@ void GEOM_Swig::setTransparency(const char* theEntry, float transp)
if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(anApp)) { if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(anApp)) {
SVTK_View* aView = aViewWindow->getView(); SVTK_View* aView = aViewWindow->getView();
aView->SetTransparency(anIO, myParam); aView->SetTransparency(anIO, myParam);
aView->Repaint(); if (myUpdateViewer)
aView->Repaint();
} else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) { } else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) {
SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>(occViewer); SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>(occViewer);
if (soccViewer) if (soccViewer)
soccViewer->setTransparency(anIO, myParam); soccViewer->setTransparency(anIO, myParam, myUpdateViewer);
} }
} }
}; };
ProcessVoidEvent(new TEvent (theEntry, transp)); ProcessVoidEvent(new TEvent (theEntry, transp, isUpdated));
} }

View File

@ -45,12 +45,13 @@ public:
GEOM_Swig(); GEOM_Swig();
~GEOM_Swig(); ~GEOM_Swig();
void createAndDisplayGO(const char* Entry); void createAndDisplayGO(const char* Entry, bool isUpdated = true);
void eraseGO(const char* Entry, bool allWindows); void eraseGO(const char* Entry, bool allWindows);
void createAndDisplayFitAllGO(const char* Entry); void createAndDisplayFitAllGO(const char* Entry);
void setDisplayMode(const char* Entry, int mode); void UpdateViewer();
void setColor(const char* Entry, int red, int green, int blue); void setDisplayMode(const char* Entry, int mode, bool isUpdated = true);
void setTransparency(const char* Entry, float transp); void setColor(const char* Entry, int red, int green, int blue, bool isUpdated = true);
void setTransparency(const char* Entry, float transp, bool isUpdated = true);
void setDeflection(const char* Entry, float deflect); void setDeflection(const char* Entry, float deflect);
int getIndexTopology(const char *SubEntry, const char *Entry); int getIndexTopology(const char *SubEntry, const char *Entry);

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // 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
// //
// //
// //
@ -30,21 +30,42 @@
#include "GeometryGUI_Swig.hxx" #include "GeometryGUI_Swig.hxx"
%} %}
/*
managing C++ exception in the Python API
*/
%exception
{
class PyAllowThreadsGuard {
public:
// Py_BEGIN_ALLOW_THREADS
PyAllowThreadsGuard() { _save = PyEval_SaveThread(); }
// Py_END_ALLOW_THREADS
~PyAllowThreadsGuard() { PyEval_RestoreThread(_save); }
private:
PyThreadState *_save;
};
PyAllowThreadsGuard guard;
$action
}
class GEOM_Swig class GEOM_Swig
{ {
public: public:
GEOM_Swig(); GEOM_Swig();
~GEOM_Swig(); ~GEOM_Swig();
void createAndDisplayGO(const char* Entry); void createAndDisplayGO(const char* Entry, bool isUpdated =true);
void eraseGO(const char* Entry, bool allWindows); void eraseGO(const char* Entry, bool allWindows);
void createAndDisplayFitAllGO(const char* Entry); void createAndDisplayFitAllGO(const char* Entry);
void UpdateViewer();
int getIndexTopology(const char *SubEntry, const char *Entry); int getIndexTopology(const char *SubEntry, const char *Entry);
const char* getShapeTypeString(const char *Entry); const char* getShapeTypeString(const char *Entry);
void setDisplayMode(const char* Entry, int mode); void setDisplayMode(const char* Entry, int mode, bool isUpdated =true);
void setColor(const char* Entry, int red, int green, int blue); void setColor(const char* Entry, int red, int green, int blue, bool isUpdated =true);
void setTransparency(const char* Entry, float transp); void setTransparency(const char* Entry, float transp, bool isUpdated =true);
void setDeflection(const char* Entry, float deflect); void setDeflection(const char* Entry, float deflect);
const char* getShapeTypeIcon(const char *Ior); const char* getShapeTypeIcon(const char *Ior);

View File

@ -18,19 +18,25 @@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
#include <Standard_Stream.hxx>
#include <GEOMImpl_BooleanDriver.hxx> #include <GEOMImpl_BooleanDriver.hxx>
#include <GEOMImpl_IBoolean.hxx> #include <GEOMImpl_IBoolean.hxx>
#include <GEOMImpl_Types.hxx> #include <GEOMImpl_Types.hxx>
#include <GEOMImpl_GlueDriver.hxx>
#include <GEOM_Function.hxx> #include <GEOM_Function.hxx>
#include <BRep_Builder.hxx>
#include <BRepAlgo.hxx> #include <BRepAlgo.hxx>
#include <BRepAlgoAPI_Common.hxx> #include <BRepAlgoAPI_Common.hxx>
#include <BRepAlgoAPI_Cut.hxx> #include <BRepAlgoAPI_Cut.hxx>
#include <BRepAlgoAPI_Fuse.hxx> #include <BRepAlgoAPI_Fuse.hxx>
#include <BRepAlgoAPI_Section.hxx> #include <BRepAlgoAPI_Section.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <Precision.hxx>
#include <Standard_ConstructionError.hxx> #include <Standard_ConstructionError.hxx>
#include <StdFail_NotDone.hxx> #include <StdFail_NotDone.hxx>
@ -54,6 +60,30 @@ GEOMImpl_BooleanDriver::GEOMImpl_BooleanDriver()
{ {
} }
void AddSimpleShapes(TopoDS_Shape theShape, TopTools_ListOfShape& theList)
{
if (theShape.ShapeType() != TopAbs_COMPOUND &&
theShape.ShapeType() != TopAbs_COMPSOLID) {
theList.Append(theShape);
return;
}
TopTools_MapOfShape mapShape;
TopoDS_Iterator It (theShape, Standard_True, Standard_True);
for (; It.More(); It.Next()) {
TopoDS_Shape aShape_i = It.Value();
if (mapShape.Add(aShape_i)) {
if (aShape_i.ShapeType() == TopAbs_COMPOUND ||
aShape_i.ShapeType() == TopAbs_COMPSOLID) {
AddSimpleShapes(aShape_i, theList);
} else {
theList.Append(aShape_i);
}
}
}
}
//======================================================================= //=======================================================================
//function : Execute //function : Execute
//purpose : //purpose :
@ -73,38 +103,200 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
TopoDS_Shape aShape1 = aRefShape1->GetValue(); TopoDS_Shape aShape1 = aRefShape1->GetValue();
TopoDS_Shape aShape2 = aRefShape2->GetValue(); TopoDS_Shape aShape2 = aRefShape2->GetValue();
if (!aShape1.IsNull() && !aShape2.IsNull()) { if (!aShape1.IsNull() && !aShape2.IsNull()) {
// perform COMMON operation
if (aType == BOOLEAN_COMMON) { if (aType == BOOLEAN_COMMON) {
BRepAlgoAPI_Common BO (aShape1, aShape2); BRep_Builder B;
// BO.Build(); TopoDS_Compound C;
if (!BO.IsDone()) { B.MakeCompound(C);
StdFail_NotDone::Raise("Requested boolean operation can not be performed on the given shapes");
TopTools_ListOfShape listShape1, listShape2;
AddSimpleShapes(aShape1, listShape1);
AddSimpleShapes(aShape2, listShape2);
Standard_Boolean isCompound =
(listShape1.Extent() > 1 || listShape2.Extent() > 1);
TopTools_ListIteratorOfListOfShape itSub1 (listShape1);
for (; itSub1.More(); itSub1.Next()) {
TopoDS_Shape aValue1 = itSub1.Value();
TopTools_ListIteratorOfListOfShape itSub2 (listShape2);
for (; itSub2.More(); itSub2.Next()) {
TopoDS_Shape aValue2 = itSub2.Value();
BRepAlgoAPI_Common BO (aValue1, aValue2);
if (!BO.IsDone()) {
StdFail_NotDone::Raise("Common operation can not be performed on the given shapes");
}
if (isCompound) {
TopoDS_Shape aStepResult = BO.Shape();
// check result of this step: if it is a compound (boolean operations
// allways return a compound), we add all sub-shapes of it.
// This allows to avoid adding empty compounds,
// resulting from COMMON on two non-intersecting shapes.
if (aStepResult.ShapeType() == TopAbs_COMPOUND) {
TopoDS_Iterator aCompIter (aStepResult);
for (; aCompIter.More(); aCompIter.Next()) {
// add shape in a result
B.Add(C, aCompIter.Value());
}
}
else {
// add shape in a result
B.Add(C, aStepResult);
}
}
else
aShape = BO.Shape();
}
} }
aShape = BO.Shape();
} else if (aType == BOOLEAN_CUT) { if (isCompound) {
BRepAlgoAPI_Cut BO (aShape1, aShape2); TopTools_ListOfShape listShapeC;
if (!BO.IsDone()) { AddSimpleShapes(C, listShapeC);
StdFail_NotDone::Raise("Requested boolean operation can not be performed on the given shapes"); TopTools_ListIteratorOfListOfShape itSubC (listShapeC);
bool isOnlySolids = true;
for (; itSubC.More(); itSubC.Next()) {
TopoDS_Shape aValueC = itSubC.Value();
if (aValueC.ShapeType() != TopAbs_SOLID) isOnlySolids = false;
}
if (isOnlySolids)
aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion());
else
aShape = C;
} }
aShape = BO.Shape(); }
} else if (aType == BOOLEAN_FUSE) {
// perform CUT operation
else if (aType == BOOLEAN_CUT) {
BRep_Builder B;
TopoDS_Compound C;
B.MakeCompound(C);
TopTools_ListOfShape listShapes, listTools;
AddSimpleShapes(aShape1, listShapes);
AddSimpleShapes(aShape2, listTools);
Standard_Boolean isCompound = (listShapes.Extent() > 1);
TopTools_ListIteratorOfListOfShape itSub1 (listShapes);
for (; itSub1.More(); itSub1.Next()) {
TopoDS_Shape aCut = itSub1.Value();
// tools
TopTools_ListIteratorOfListOfShape itSub2 (listTools);
for (; itSub2.More(); itSub2.Next()) {
TopoDS_Shape aTool = itSub2.Value();
BRepAlgoAPI_Cut BO (aCut, aTool);
if (!BO.IsDone()) {
StdFail_NotDone::Raise("Cut operation can not be performed on the given shapes");
}
aCut = BO.Shape();
}
if (isCompound) {
// check result of this step: if it is a compound (boolean operations
// allways return a compound), we add all sub-shapes of it.
// This allows to avoid adding empty compounds,
// resulting from CUT of parts
if (aCut.ShapeType() == TopAbs_COMPOUND) {
TopoDS_Iterator aCompIter (aCut);
for (; aCompIter.More(); aCompIter.Next()) {
// add shape in a result
B.Add(C, aCompIter.Value());
}
}
else {
// add shape in a result
B.Add(C, aCut);
}
}
else
aShape = aCut;
}
if (isCompound) {
TopTools_ListOfShape listShapeC;
AddSimpleShapes(C, listShapeC);
TopTools_ListIteratorOfListOfShape itSubC (listShapeC);
bool isOnlySolids = true;
for (; itSubC.More(); itSubC.Next()) {
TopoDS_Shape aValueC = itSubC.Value();
if (aValueC.ShapeType() != TopAbs_SOLID) isOnlySolids = false;
}
if (isOnlySolids)
aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion());
else
aShape = C;
}
}
// perform FUSE operation
else if (aType == BOOLEAN_FUSE) {
BRepAlgoAPI_Fuse BO (aShape1, aShape2); BRepAlgoAPI_Fuse BO (aShape1, aShape2);
if (!BO.IsDone()) { if (!BO.IsDone()) {
StdFail_NotDone::Raise("Requested boolean operation can not be performed on the given shapes"); StdFail_NotDone::Raise("Fuse operation can not be performed on the given shapes");
} }
aShape = BO.Shape(); aShape = BO.Shape();
} else if (aType == BOOLEAN_SECTION) { }
BRepAlgoAPI_Section BO (aShape1, aShape2);
if (!BO.IsDone()) { // perform SECTION operation
StdFail_NotDone::Raise("Requested boolean operation can not be performed on the given shapes"); else if (aType == BOOLEAN_SECTION) {
BRep_Builder B;
TopoDS_Compound C;
B.MakeCompound(C);
TopTools_ListOfShape listShape1, listShape2;
AddSimpleShapes(aShape1, listShape1);
AddSimpleShapes(aShape2, listShape2);
Standard_Boolean isCompound =
(listShape1.Extent() > 1 || listShape2.Extent() > 1);
TopTools_ListIteratorOfListOfShape itSub1 (listShape1);
for (; itSub1.More(); itSub1.Next()) {
TopoDS_Shape aValue1 = itSub1.Value();
TopTools_ListIteratorOfListOfShape itSub2 (listShape2);
for (; itSub2.More(); itSub2.Next()) {
TopoDS_Shape aValue2 = itSub2.Value();
BRepAlgoAPI_Section BO (aValue1, aValue2);
if (!BO.IsDone()) {
StdFail_NotDone::Raise("Section operation can not be performed on the given shapes");
}
if (isCompound) {
TopoDS_Shape aStepResult = BO.Shape();
// check result of this step: if it is a compound (boolean operations
// allways return a compound), we add all sub-shapes of it.
// This allows to avoid adding empty compounds,
// resulting from SECTION on two non-intersecting shapes.
if (aStepResult.ShapeType() == TopAbs_COMPOUND) {
TopoDS_Iterator aCompIter (aStepResult);
for (; aCompIter.More(); aCompIter.Next()) {
// add shape in a result
B.Add(C, aCompIter.Value());
}
}
else {
// add shape in a result
B.Add(C, aStepResult);
}
}
else
aShape = BO.Shape();
}
} }
aShape = BO.Shape();
} else { if (isCompound)
aShape = C;
}
// UNKNOWN operation
else {
} }
} }
if (aShape.IsNull()) return 0; if (aShape.IsNull()) return 0;
if (!BRepAlgo::IsValid(aShape)) { if (!BRepAlgo::IsValid(aShape)) {
Standard_ConstructionError::Raise("Boolean aborted : non valid shape result"); Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result");
} }
aFunction->SetValue(aShape); aFunction->SetValue(aShape);

View File

@ -54,37 +54,6 @@ typedef int (*funcPoint)(const TopoDS_Shape&,
const TCollection_AsciiString&, const TCollection_AsciiString&,
const TCollection_AsciiString&); const TCollection_AsciiString&);
//This class is workaround of BUG OCC13051 ( SWP13103 )
//It's stored all loaded libraries for export and unload that in destructor
class DLL_Collector
{
typedef NCollection_DataMap<TCollection_AsciiString,LibHandle> DLL_Collector_Map;
DLL_Collector_Map myMapOfDLL;
public:
DLL_Collector(){};
~DLL_Collector()
{
DLL_Collector_Map::Iterator Iter( myMapOfDLL );
for( ; Iter.More(); Iter.Next() )
UnLoadLib( Iter.Value() );
}
public:
LibHandle LoadDLL( const TCollection_AsciiString& theLibName )
{
if ( myMapOfDLL.IsBound( theLibName ) )
return myMapOfDLL( theLibName );
LibHandle res = LoadLib( theLibName.ToCString() );
if ( res )
myMapOfDLL.Bind( theLibName, res );
return res;
}
};
static DLL_Collector GlobalCollector;
//======================================================================= //=======================================================================
//function : GetID //function : GetID
//purpose : //purpose :
@ -132,7 +101,7 @@ Standard_Integer GEOMImpl_ExportDriver::Execute(TFunction_Logbook& log) const
return 0; return 0;
// load plugin library // load plugin library
LibHandle anExportLib = GlobalCollector.LoadDLL( aLibName ); //This is workaround of BUG OCC13051 LibHandle anExportLib = LoadLib( aLibName.ToCString() ); //This is workaround of BUG OCC13051
funcPoint fp = 0; funcPoint fp = 0;
if ( anExportLib ) if ( anExportLib )
fp = (funcPoint)GetProc( anExportLib, "Export" ); fp = (funcPoint)GetProc( anExportLib, "Export" );

View File

@ -32,6 +32,7 @@
#include <ShHealOper_FillHoles.hxx> #include <ShHealOper_FillHoles.hxx>
#include <ShHealOper_Sewing.hxx> #include <ShHealOper_Sewing.hxx>
#include <ShHealOper_EdgeDivide.hxx> #include <ShHealOper_EdgeDivide.hxx>
#include <ShHealOper_ChangeOrientation.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
@ -115,6 +116,9 @@ Standard_Integer GEOMImpl_HealingDriver::Execute(TFunction_Logbook& log) const
case DIVIDE_EDGE: case DIVIDE_EDGE:
AddPointOnEdge(&HI, anOriginalShape, aShape); AddPointOnEdge(&HI, anOriginalShape, aShape);
break; break;
case CHANGE_ORIENTATION:
ChangeOrientation(&HI, anOriginalShape, aShape);
break;
default: default:
return 0; return 0;
} }
@ -379,6 +383,27 @@ Standard_Boolean GEOMImpl_HealingDriver::AddPointOnEdge (GEOMImpl_IHealing* theH
} }
//=======================================================================
//function : ChangeOrientation
//purpose :
//=======================================================================
Standard_Boolean GEOMImpl_HealingDriver::ChangeOrientation (GEOMImpl_IHealing* theHI,
const TopoDS_Shape& theOriginalShape,
TopoDS_Shape& theOutShape) const
{
ShHealOper_ChangeOrientation aHealer (theOriginalShape);
Standard_Boolean aResult = aHealer.Perform();
if (aResult)
theOutShape = aHealer.GetResultShape();
else
raiseNotDoneExeption( aHealer.GetErrorStatus() );
return aResult;
}
//======================================================================= //=======================================================================
//function : GEOMImpl_HealingDriver_Type_ //function : GEOMImpl_HealingDriver_Type_
//purpose : //purpose :

View File

@ -163,7 +163,7 @@ Standard_Boolean RemoveIntWires( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS
Standard_Boolean RemoveHoles ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; Standard_Boolean RemoveHoles ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
Standard_Boolean Sew ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; Standard_Boolean Sew ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
Standard_Boolean AddPointOnEdge( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; Standard_Boolean AddPointOnEdge( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
Standard_Boolean ChangeOrientation( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
}; };

View File

@ -60,6 +60,7 @@
#include <GEOMImpl_IThruSections.hxx> #include <GEOMImpl_IThruSections.hxx>
#include <GEOMImpl_IPipeDiffSect.hxx> #include <GEOMImpl_IPipeDiffSect.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
//============================================================================= //=============================================================================
@ -111,6 +112,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxDXDYDZ (double theDX, dou
//Compute the box value //Compute the box value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Box driver failed"); SetErrorCode("Box driver failed");
return NULL; return NULL;
@ -165,6 +169,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxTwoPnt (Handle(GEOM_Objec
//Compute the Box value //Compute the Box value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Box driver failed"); SetErrorCode("Box driver failed");
return NULL; return NULL;
@ -211,6 +218,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRH (double theR, dou
//Compute the Cylinder value //Compute the Cylinder value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Cylinder driver failed"); SetErrorCode("Cylinder driver failed");
return NULL; return NULL;
@ -269,6 +279,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRH (Handle(GEO
//Compute the Cylinder value //Compute the Cylinder value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Cylinder driver failed"); SetErrorCode("Cylinder driver failed");
return NULL; return NULL;
@ -318,6 +331,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConeR1R2H (double theR1, dou
//Compute the Cone value //Compute the Cone value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Cone driver failed"); SetErrorCode("Cone driver failed");
return NULL; return NULL;
@ -378,6 +394,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConePntVecR1R2H (Handle(GEOM
//Compute the Cone value //Compute the Cone value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Cone driver failed"); SetErrorCode("Cone driver failed");
return NULL; return NULL;
@ -423,6 +442,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSphereR (double theR)
//Compute the Sphere value //Compute the Sphere value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Sphere driver failed"); SetErrorCode("Sphere driver failed");
return NULL; return NULL;
@ -475,6 +497,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSpherePntR (Handle(GEOM_Obje
//Compute the Sphere value //Compute the Sphere value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Sphere driver failed"); SetErrorCode("Sphere driver failed");
return NULL; return NULL;
@ -523,6 +548,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusRR
//Compute the Torus value //Compute the Torus value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Torus driver failed"); SetErrorCode("Torus driver failed");
return NULL; return NULL;
@ -580,6 +608,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusPntVecRR
//Compute the Torus value //Compute the Torus value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Torus driver failed"); SetErrorCode("Torus driver failed");
return NULL; return NULL;
@ -637,8 +668,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Objec
//Compute the Prism value //Compute the Prism value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Prism driver failed"); //SetErrorCode("Prism driver failed");
SetErrorCode("Extrusion can not be created, check input data");
return NULL; return NULL;
} }
} }
@ -694,8 +729,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
//Compute the Prism value //Compute the Prism value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Prism driver failed"); //SetErrorCode("Prism driver failed");
SetErrorCode("Extrusion can not be created, check input data");
return NULL; return NULL;
} }
} }
@ -749,6 +788,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipe (Handle(GEOM_Object) th
//Compute the Pipe value //Compute the Pipe value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Pipe driver failed"); SetErrorCode("Pipe driver failed");
return NULL; return NULL;
@ -806,6 +848,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle(
//Compute the Revolution value //Compute the Revolution value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Revolution driver failed"); SetErrorCode("Revolution driver failed");
return NULL; return NULL;
@ -858,6 +903,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSolidShell (Handle(GEOM_Obje
//Compute the Solid value //Compute the Solid value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Solid driver failed"); SetErrorCode("Solid driver failed");
return NULL; return NULL;
@ -914,6 +962,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
//Compute the Solid value //Compute the Solid value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Filling driver failed"); SetErrorCode("Filling driver failed");
return NULL; return NULL;
@ -1000,6 +1051,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
//Compute the ThruSections value //Compute the ThruSections value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("ThruSections driver failed"); SetErrorCode("ThruSections driver failed");
return anObj; return anObj;
@ -1122,6 +1176,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
//Compute the Pipe value //Compute the Pipe value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Pipe with defferent section driver failed"); SetErrorCode("Pipe with defferent section driver failed");
return anObj; return anObj;

View File

@ -47,6 +47,7 @@
#include <GEOMImpl_Types.hxx> #include <GEOMImpl_Types.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
//============================================================================= //=============================================================================
@ -100,6 +101,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointXYZ
//Compute the point value //Compute the point value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Point driver failed"); SetErrorCode("Point driver failed");
return NULL; return NULL;
@ -152,6 +156,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointWithReference
//Compute the point value //Compute the point value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Point driver failed"); SetErrorCode("Point driver failed");
return NULL; return NULL;
@ -202,6 +209,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurve
//Compute the point value //Compute the point value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Point driver failed"); SetErrorCode("Point driver failed");
return NULL; return NULL;
@ -252,6 +262,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentOnCurve
//Compute the vector value //Compute the vector value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Vector driver failed"); SetErrorCode("Vector driver failed");
return NULL; return NULL;
@ -300,6 +313,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorDXDYDZ
//Compute the Vector value //Compute the Vector value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Vector driver failed"); SetErrorCode("Vector driver failed");
return NULL; return NULL;
@ -352,6 +368,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorTwoPnt
//Compute the Vector value //Compute the Vector value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Vector driver failed"); SetErrorCode("Vector driver failed");
return NULL; return NULL;
@ -405,6 +424,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLine
//Compute the Line value //Compute the Line value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Line driver failed"); SetErrorCode("Line driver failed");
return NULL; return NULL;
@ -457,6 +479,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLineTwoPnt
//Compute the Line value //Compute the Line value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Line driver failed"); SetErrorCode("Line driver failed");
return NULL; return NULL;
@ -514,6 +539,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneThreePnt
//Compute the Plane value //Compute the Plane value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Plane driver failed"); SetErrorCode("Plane driver failed");
return NULL; return NULL;
@ -568,6 +596,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlanePntVec
//Compute the Plane value //Compute the Plane value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Plane driver failed"); SetErrorCode("Plane driver failed");
return NULL; return NULL;
@ -619,6 +650,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneFace
//Compute the Plane value //Compute the Plane value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Plane driver failed"); SetErrorCode("Plane driver failed");
return NULL; return NULL;
@ -670,6 +704,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarker
//Compute the marker value //Compute the marker value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Marker driver failed"); SetErrorCode("Marker driver failed");
return NULL; return NULL;
@ -728,6 +765,9 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentPlaneOnFace(const Hand
//Compute the Plane value //Compute the Plane value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Plane driver failed"); SetErrorCode("Plane driver failed");
return NULL; return NULL;

View File

@ -94,6 +94,7 @@
#include <Precision.hxx> #include <Precision.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
//============================================================================= //=============================================================================
@ -161,6 +162,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad
//Compute the Face value //Compute the Face value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to compute a face"); SetErrorCode("Block driver failed to compute a face");
return NULL; return NULL;
@ -216,6 +220,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad2Edges
//Compute the Face value //Compute the Face value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to compute a face"); SetErrorCode("Block driver failed to compute a face");
return NULL; return NULL;
@ -278,6 +285,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad4Vertices
//Compute the Face value //Compute the Face value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to compute a face"); SetErrorCode("Block driver failed to compute a face");
return NULL; return NULL;
@ -347,6 +357,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeHexa
//Compute the Block value //Compute the Block value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to compute a block"); SetErrorCode("Block driver failed to compute a block");
return NULL; return NULL;
@ -403,6 +416,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeHexa2Faces
//Compute the Block value //Compute the Block value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to compute a block"); SetErrorCode("Block driver failed to compute a block");
return NULL; return NULL;
@ -456,6 +472,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeBlockCompound
//Compute the Blocks Compound value //Compute the Blocks Compound value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to compute a blocks compound"); SetErrorCode("Block driver failed to compute a blocks compound");
return NULL; return NULL;
@ -585,6 +604,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetEdge
//Compute the Edge value //Compute the Edge value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
TopTools_IndexedDataMapOfShapeListOfShape MVE; TopTools_IndexedDataMapOfShapeListOfShape MVE;
GEOMImpl_Block6Explorer::MapShapesAndAncestors GEOMImpl_Block6Explorer::MapShapesAndAncestors
(aBlockOrComp, TopAbs_VERTEX, TopAbs_EDGE, MVE); (aBlockOrComp, TopAbs_VERTEX, TopAbs_EDGE, MVE);
@ -688,6 +710,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetEdgeNearPoint
//Compute the Edge value //Compute the Edge value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
TopoDS_Shape aShape; TopoDS_Shape aShape;
TopoDS_Vertex aVert = TopoDS::Vertex(anArg); TopoDS_Vertex aVert = TopoDS::Vertex(anArg);
@ -817,6 +842,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByPoints
//Compute the Face value //Compute the Face value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
TopoDS_Shape aShape; TopoDS_Shape aShape;
TopTools_IndexedDataMapOfShapeListOfShape MVF; TopTools_IndexedDataMapOfShapeListOfShape MVF;
@ -934,12 +962,6 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByEdges
SetErrorCode("Block or compound is null"); SetErrorCode("Block or compound is null");
return NULL; return NULL;
} }
if (aBlockOrComp.ShapeType() != TopAbs_SOLID &&
aBlockOrComp.ShapeType() != TopAbs_COMPOUND &&
aBlockOrComp.ShapeType() != TopAbs_COMPSOLID) {
SetErrorCode("Shape is neither a block, nor a compound of blocks");
return NULL;
}
TopoDS_Shape anArg1 = theEdge1->GetValue(); TopoDS_Shape anArg1 = theEdge1->GetValue();
TopoDS_Shape anArg2 = theEdge2->GetValue(); TopoDS_Shape anArg2 = theEdge2->GetValue();
@ -955,6 +977,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByEdges
//Compute the Face value //Compute the Face value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
TopoDS_Shape aShape; TopoDS_Shape aShape;
TopTools_IndexedDataMapOfShapeListOfShape MEF; TopTools_IndexedDataMapOfShapeListOfShape MEF;
@ -1077,6 +1102,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetOppositeFace
//Compute the Face value //Compute the Face value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
TopoDS_Shape aShape; TopoDS_Shape aShape;
GEOMImpl_Block6Explorer aBlockTool; GEOMImpl_Block6Explorer aBlockTool;
@ -1127,12 +1155,6 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceNearPoint
SetErrorCode("Block or compound is null"); SetErrorCode("Block or compound is null");
return NULL; return NULL;
} }
if (aBlockOrComp.ShapeType() != TopAbs_SOLID &&
aBlockOrComp.ShapeType() != TopAbs_COMPOUND &&
aBlockOrComp.ShapeType() != TopAbs_COMPSOLID) {
SetErrorCode("Shape is neither a block, nor a compound of blocks");
return NULL;
}
TopoDS_Shape anArg = thePoint->GetValue(); TopoDS_Shape anArg = thePoint->GetValue();
if (anArg.IsNull()) { if (anArg.IsNull()) {
@ -1146,6 +1168,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceNearPoint
//Compute the Face value //Compute the Face value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
TopoDS_Shape aShape; TopoDS_Shape aShape;
TopoDS_Vertex aVert = TopoDS::Vertex(anArg); TopoDS_Vertex aVert = TopoDS::Vertex(anArg);
@ -1322,12 +1347,6 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByNormale
SetErrorCode("Block or compound is null"); SetErrorCode("Block or compound is null");
return NULL; return NULL;
} }
if (aBlockOrComp.ShapeType() != TopAbs_SOLID &&
aBlockOrComp.ShapeType() != TopAbs_COMPOUND &&
aBlockOrComp.ShapeType() != TopAbs_COMPSOLID) {
SetErrorCode("Shape is neither a block, nor a compound of blocks");
return NULL;
}
TopoDS_Shape anArg = theVector->GetValue(); TopoDS_Shape anArg = theVector->GetValue();
if (anArg.IsNull()) { if (anArg.IsNull()) {
@ -1341,6 +1360,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByNormale
//Compute the Face value //Compute the Face value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
TopoDS_Shape aShape; TopoDS_Shape aShape;
TopoDS_Edge anEdge = TopoDS::Edge(anArg); TopoDS_Edge anEdge = TopoDS::Edge(anArg);
@ -1454,6 +1476,9 @@ Standard_Boolean GEOMImpl_IBlocksOperations::IsCompoundOfBlocks
//Check //Check
isCompOfBlocks = Standard_True; isCompOfBlocks = Standard_True;
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
TopTools_MapOfShape mapShape; TopTools_MapOfShape mapShape;
TopExp_Explorer exp (aBlockOrComp, TopAbs_SOLID); TopExp_Explorer exp (aBlockOrComp, TopAbs_SOLID);
for (; exp.More(); exp.Next()) { for (; exp.More(); exp.Next()) {
@ -2306,6 +2331,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::RemoveExtraEdges
//Compute the fixed shape //Compute the fixed shape
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to remove extra edges of the given shape"); SetErrorCode("Block driver failed to remove extra edges of the given shape");
return NULL; return NULL;
@ -2355,6 +2383,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::CheckAndImprove
//Compute the fixed shape //Compute the fixed shape
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to improve the given blocks compound"); SetErrorCode("Block driver failed to improve the given blocks compound");
return NULL; return NULL;
@ -2404,6 +2435,9 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IBlocksOperations::ExplodeCompound
// Explode // Explode
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
TopExp_Explorer exp (aBlockOrComp, TopAbs_SOLID); TopExp_Explorer exp (aBlockOrComp, TopAbs_SOLID);
for (; exp.More(); exp.Next()) { for (; exp.More(); exp.Next()) {
if (mapShape.Add(exp.Current())) { if (mapShape.Add(exp.Current())) {
@ -2496,6 +2530,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetBlockNearPoint
//Compute the Block value //Compute the Block value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
TopoDS_Shape aShape; TopoDS_Shape aShape;
TopoDS_Vertex aVert = TopoDS::Vertex(anArg); TopoDS_Vertex aVert = TopoDS::Vertex(anArg);
@ -2672,6 +2709,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetBlockByParts
//Compute the Block value //Compute the Block value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
// 1. Explode compound on solids // 1. Explode compound on solids
TopTools_MapOfShape mapShape; TopTools_MapOfShape mapShape;
Standard_Integer nbSolids = 0; Standard_Integer nbSolids = 0;
@ -2788,6 +2828,9 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IBlocksOperations::GetBlocksByPart
//Get the Blocks //Get the Blocks
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
TopTools_MapOfShape mapShape; TopTools_MapOfShape mapShape;
Standard_Integer nbSolids = 0; Standard_Integer nbSolids = 0;
TopExp_Explorer exp (aBlockOrComp, TopAbs_SOLID); TopExp_Explorer exp (aBlockOrComp, TopAbs_SOLID);
@ -2908,6 +2951,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeMultiTransformation1D
//Compute the transformation //Compute the transformation
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to make multi-transformation"); SetErrorCode("Block driver failed to make multi-transformation");
return NULL; return NULL;
@ -2969,6 +3015,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeMultiTransformation2D
//Compute the transformation //Compute the transformation
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to make multi-transformation"); SetErrorCode("Block driver failed to make multi-transformation");
return NULL; return NULL;

View File

@ -36,6 +36,7 @@
#include "utilities.h" #include "utilities.h"
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
//============================================================================= //=============================================================================
@ -105,6 +106,9 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeBoolean (Handle(GEOM_Object
//Compute the Boolean value //Compute the Boolean value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Boolean driver failed"); SetErrorCode("Boolean driver failed");
return NULL; return NULL;
@ -251,6 +255,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition
if (theMaterials.IsNull()) { if (theMaterials.IsNull()) {
Handle(TColStd_HArray1OfInteger) aMaterials = Handle(TColStd_HArray1OfInteger) aMaterials =
new TColStd_HArray1OfInteger (1, aShapesSeq->Length()); new TColStd_HArray1OfInteger (1, aShapesSeq->Length());
aMaterials->Init(0);
aCI.SetMaterials(aMaterials); aCI.SetMaterials(aMaterials);
} else { } else {
aCI.SetMaterials(theMaterials); aCI.SetMaterials(theMaterials);
@ -259,6 +264,9 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition
//Compute the Partition //Compute the Partition
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Partition driver failed"); SetErrorCode("Partition driver failed");
return NULL; return NULL;
@ -329,6 +337,9 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeHalfPartition
//Compute the Partition value //Compute the Partition value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Partition driver failed"); SetErrorCode("Partition driver failed");
return NULL; return NULL;

View File

@ -44,6 +44,7 @@
#include <TDF_Tool.hxx> #include <TDF_Tool.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
//============================================================================= //=============================================================================
@ -106,6 +107,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline (list<Handle(GEOM_O
//Compute the Polyline value //Compute the Polyline value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Polyline driver failed"); SetErrorCode("Polyline driver failed");
return NULL; return NULL;
@ -170,6 +174,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCircleThreePnt (Handle(GEOM_
//Compute the Circle value //Compute the Circle value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Circle driver failed"); SetErrorCode("Circle driver failed");
return NULL; return NULL;
@ -225,6 +232,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCirclePntVecR
//Compute the Circle value //Compute the Circle value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Circle driver failed"); SetErrorCode("Circle driver failed");
return NULL; return NULL;
@ -282,6 +292,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeEllipse
//Compute the Ellipse value //Compute the Ellipse value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Ellipse driver failed"); SetErrorCode("Ellipse driver failed");
return NULL; return NULL;
@ -339,6 +352,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeArc (Handle(GEOM_Object) the
//Compute the Arc value //Compute the Arc value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Arc driver failed"); SetErrorCode("Arc driver failed");
return NULL; return NULL;
@ -396,6 +412,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineBezier
//Compute the Spline value //Compute the Spline value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Spline driver failed"); SetErrorCode("Spline driver failed");
return NULL; return NULL;
@ -460,6 +479,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
//Compute the Spline value //Compute the Spline value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Spline driver failed"); SetErrorCode("Spline driver failed");
return NULL; return NULL;
@ -521,6 +543,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSketcher
//Compute the Sketcher value //Compute the Sketcher value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Sketcher driver failed"); SetErrorCode("Sketcher driver failed");
return NULL; return NULL;
@ -580,6 +605,9 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSketcherOnPlane
//Compute the Sketcher value //Compute the Sketcher value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Sketcher driver failed"); SetErrorCode("Sketcher driver failed");
return NULL; return NULL;

View File

@ -38,6 +38,7 @@
#include <TDataStd_Integer.hxx> #include <TDataStd_Integer.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_IndexedMapOfShape.hxx> #include <TopTools_IndexedMapOfShape.hxx>
#include <TColStd_HArray1OfInteger.hxx> #include <TColStd_HArray1OfInteger.hxx>
@ -45,8 +46,6 @@
#include <TColStd_ListOfInteger.hxx> #include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx> #include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
//============================================================================= //=============================================================================
/*! /*!
* constructor: * constructor:
@ -195,20 +194,18 @@ void GEOMImpl_IGroupOperations::RemoveObject (Handle(GEOM_Object) theGroup, int
else { else {
aNewSeq = new TColStd_HArray1OfInteger(1, aLength-1); aNewSeq = new TColStd_HArray1OfInteger(1, aLength-1);
Standard_Boolean isFound = Standard_False; Standard_Boolean isFound = Standard_False;
for(Standard_Integer i = 1, k=1; i<=aLength; i++) { for (Standard_Integer i = 1, k = 1; i <= aLength; i++) {
if(i == aLength && !isFound) { if (aSeq->Value(i) == theSubShapeID) {
SetErrorCode(NOT_EXISTS);
return;
}
if(aSeq->Value(i) == theSubShapeID) {
isFound = Standard_True; isFound = Standard_True;
continue; } else {
} if (k < aLength) { // this check is to avoid sequence <aNewSeq> overflow
aNewSeq->SetValue(k, aSeq->Value(i)); aNewSeq->SetValue(k, aSeq->Value(i));
k++; k++;
}
}
} }
if(!isFound) { if (!isFound) {
SetErrorCode(NOT_EXISTS); SetErrorCode(NOT_EXISTS);
return; return;
} }
@ -276,78 +273,66 @@ void GEOMImpl_IGroupOperations::UnionList (Handle(GEOM_Object) theGroup,
TopTools_IndexedMapOfShape mapIndices; TopTools_IndexedMapOfShape mapIndices;
TopExp::MapShapes(aMainShape, mapIndices); TopExp::MapShapes(aMainShape, mapIndices);
// Get group type
TopAbs_ShapeEnum aType = GetType(theGroup);
// Get IDs of sub-shapes to add // Get IDs of sub-shapes to add
Standard_Integer i, new_id; Standard_Integer i, new_id;
for (i = 1; i <= aLen; i++) { for (i = 1; i <= aLen; i++) {
Handle(GEOM_Object) anObj_i = Handle(GEOM_Object)::DownCast(theSubShapes->Value(i)); Handle(GEOM_Object) anObj_i = Handle(GEOM_Object)::DownCast(theSubShapes->Value(i));
TopoDS_Shape aShape_i = anObj_i->GetValue();
TopAbs_ShapeEnum aType_i = aShape_i.ShapeType();
// 1. If aShape_i is sub-shape of aMainShape - add it
if (anObj_i->IsMainShape()) { if (anObj_i->IsMainShape()) {
TopoDS_Shape aShape_i = anObj_i->GetValue(); if (aType_i != aType && aType != TopAbs_SHAPE && aType != TopAbs_COMPOUND) {
if (mapIndices.Contains(aShape_i)) { SetErrorCode("Operation aborted: one of given objects has a wrong type");
new_id = mapIndices.FindIndex(aShape_i); return;
}
if (!mapIndices.Contains(aShape_i)) {
SetErrorCode("Operation aborted: not a sub-shape given");
return;
}
new_id = mapIndices.FindIndex(aShape_i);
if (mapIDs.Add(new_id)) {
aNewIDs.Append(new_id);
}
}
// 2. If type of group is not defined - add all sub-shapes of aShape_i
else if (aType == TopAbs_SHAPE || aType == TopAbs_COMPOUND) {
TopTools_IndexedMapOfShape mapIndices_i;
TopExp::MapShapes(aShape_i, mapIndices_i);
Standard_Integer ii = 1, nbSubSh = mapIndices_i.Extent();
Standard_Boolean someGood = Standard_False;
for (; ii <= nbSubSh; ii++) {
TopoDS_Shape aSubShape_i = mapIndices_i.FindKey(ii);
if (mapIndices.Contains(aSubShape_i)) {
someGood = Standard_True;
new_id = mapIndices.FindIndex(aSubShape_i);
if (mapIDs.Add(new_id)) {
aNewIDs.Append(new_id);
}
}
}
if (!someGood) {
SetErrorCode("Operation aborted: not a sub-shape given");
return;
}
}
// 3. If type of group is defined - add all sub-shapes of aShape_i of that type
else {
TopExp_Explorer aSubShapes_i (aShape_i, aType);
for (; aSubShapes_i.More(); aSubShapes_i.Next()) {
TopoDS_Shape aSubShape_i = aSubShapes_i.Current();
if (!mapIndices.Contains(aSubShape_i)) {
SetErrorCode("Operation aborted: not a sub-shape given");
return;
}
new_id = mapIndices.FindIndex(aSubShape_i);
if (mapIDs.Add(new_id)) { if (mapIDs.Add(new_id)) {
aNewIDs.Append(new_id); aNewIDs.Append(new_id);
} }
} else {
SetErrorCode("One of given objects can not be added to the group, because it is not a sub-shape of the group's main shape");
return;
}
} else {
// Check main shape of sub-shape to add
Handle(GEOM_Function) aFunc_i = anObj_i->GetFunction(1);
if (aFunc_i.IsNull()) return;
GEOM_ISubShape aSSI_i (aFunc_i);
Handle(GEOM_Function) aMainShapeFunc_i = aSSI_i.GetMainShape();
if (aMainShapeFunc_i.IsNull()) return;
TDF_Label aLabel_i = aMainShapeFunc_i->GetOwnerEntry();
if (aLabel_i.IsRoot()) return;
Handle(GEOM_Object) aMainObj_i = GEOM_Object::GetObject(aLabel);
if (aMainObj_i.IsNull()) return;
TopoDS_Shape aMainShape_i = aMainObj_i->GetValue();
if (aMainShape_i.IsNull()) return;
if (aMainShape_i.IsSame(aMainShape)) {
// add all sub-shape IDs to the list
// Get IDs
Handle(TColStd_HArray1OfInteger) aSeq_i = aSSI_i.GetIndices();
if (aSeq_i.IsNull()) return;
Standard_Integer aLength_i = aSeq_i->Length();
for (Standard_Integer i_j = 1; i_j <= aLength_i; i_j++) {
new_id = aSeq_i->Value(i_j);
if (new_id > 0) {
if (mapIDs.Add(new_id)) {
aNewIDs.Append(new_id);
}
}
}
} else if (mapIndices.Contains(aMainShape_i)) {
// compute new IDs and add them to the list
TopTools_IndexedMapOfShape mapIndices_i;
TopExp::MapShapes(aMainShape_i, mapIndices_i);
// Get IDs
Handle(TColStd_HArray1OfInteger) aSeq_i = aSSI_i.GetIndices();
if (aSeq_i.IsNull()) return;
Standard_Integer aLength_i = aSeq_i->Length();
for (Standard_Integer i_j = 1; i_j <= aLength_i; i_j++) {
if (aSeq_i->Value(i_j) > 0) {
TopoDS_Shape aShape_i_j = mapIndices_i.FindKey(i_j);
new_id = mapIndices.FindIndex(aShape_i_j);
if (mapIDs.Add(new_id)) {
aNewIDs.Append(new_id);
}
}
}
} else {
SetErrorCode("One of given objects can not be added to the group, because it is not a sub-shape of the group's main shape");
return;
} }
} }
} }
@ -431,78 +416,50 @@ void GEOMImpl_IGroupOperations::DifferenceList (Handle(GEOM_Object) theGroup,
TopTools_IndexedMapOfShape mapIndices; TopTools_IndexedMapOfShape mapIndices;
TopExp::MapShapes(aMainShape, mapIndices); TopExp::MapShapes(aMainShape, mapIndices);
// Get group type
TopAbs_ShapeEnum aType = GetType(theGroup);
// Get IDs of sub-shapes to be removed // Get IDs of sub-shapes to be removed
Standard_Integer i, rem_id; Standard_Integer i, rem_id;
for (i = 1; i <= aLen; i++) { for (i = 1; i <= aLen; i++) {
Handle(GEOM_Object) anObj_i = Handle(GEOM_Object)::DownCast(theSubShapes->Value(i)); Handle(GEOM_Object) anObj_i = Handle(GEOM_Object)::DownCast(theSubShapes->Value(i));
if (anObj_i->IsMainShape()) { TopoDS_Shape aShape_i = anObj_i->GetValue();
TopoDS_Shape aShape_i = anObj_i->GetValue();
if (mapIndices.Contains(aShape_i)) { // 1. If aShape_i is sub-shape of aMainShape - remove it
rem_id = mapIndices.FindIndex(aShape_i); if (mapIndices.Contains(aShape_i)) {
if (mapIDsCurrent.Contains(rem_id)) { rem_id = mapIndices.FindIndex(aShape_i);
mapIDsToRemove.Add(rem_id); if (mapIDsCurrent.Contains(rem_id)) {
} mapIDsToRemove.Add(rem_id);
} else {
SetErrorCode("One of given objects can not be removed from the group, because it is not a sub-shape of the group's main shape");
return;
} }
} else { }
// Check main shape of sub-shape to be removed // 2. If type of group is not defined - remove all sub-shapes of aShape_i
Handle(GEOM_Function) aFunc_i = anObj_i->GetFunction(1); else if (aType == TopAbs_SHAPE || aType == TopAbs_COMPOUND) {
if (aFunc_i.IsNull()) return; TopTools_IndexedMapOfShape mapIndices_i;
TopExp::MapShapes(aShape_i, mapIndices_i);
GEOM_ISubShape aSSI_i (aFunc_i); Standard_Integer nbSubSh = mapIndices_i.Extent();
Standard_Integer ii = 1;
Handle(GEOM_Function) aMainShapeFunc_i = aSSI_i.GetMainShape(); for (; ii <= nbSubSh; ii++) {
if (aMainShapeFunc_i.IsNull()) return; TopoDS_Shape aSubShape_i = mapIndices_i.FindKey(ii);
TDF_Label aLabel_i = aMainShapeFunc_i->GetOwnerEntry(); if (mapIndices.Contains(aSubShape_i)) {
if (aLabel_i.IsRoot()) return; rem_id = mapIndices.FindIndex(aSubShape_i);
Handle(GEOM_Object) aMainObj_i = GEOM_Object::GetObject(aLabel); if (mapIDsCurrent.Contains(rem_id)) {
if (aMainObj_i.IsNull()) return; mapIDsToRemove.Add(rem_id);
TopoDS_Shape aMainShape_i = aMainObj_i->GetValue();
if (aMainShape_i.IsNull()) return;
if (aMainShape_i.IsSame(aMainShape)) {
// remove all sub-shapes
// Get IDs
Handle(TColStd_HArray1OfInteger) aSeq_i = aSSI_i.GetIndices();
if (aSeq_i.IsNull()) return;
Standard_Integer aLength_i = aSeq_i->Length();
for (Standard_Integer i_j = 1; i_j <= aLength_i; i_j++) {
rem_id = aSeq_i->Value(i_j);
if (rem_id > 0) {
if (mapIDsCurrent.Contains(rem_id)) {
mapIDsToRemove.Add(rem_id);
}
} }
} }
}
} else if (mapIndices.Contains(aMainShape_i)) { }
// compute new IDs and add them to the map of ids to be removed // 3. If type of group is defined - remove all sub-shapes of aShape_i of that type
TopTools_IndexedMapOfShape mapIndices_i; else {
TopExp::MapShapes(aMainShape_i, mapIndices_i); TopExp_Explorer aSubShapes_i (aShape_i, aType);
for (; aSubShapes_i.More(); aSubShapes_i.Next()) {
// Get IDs TopoDS_Shape aSubShape_i = aSubShapes_i.Current();
Handle(TColStd_HArray1OfInteger) aSeq_i = aSSI_i.GetIndices(); if (mapIndices.Contains(aSubShape_i)) {
if (aSeq_i.IsNull()) return; rem_id = mapIndices.FindIndex(aSubShape_i);
Standard_Integer aLength_i = aSeq_i->Length(); if (mapIDsCurrent.Contains(rem_id)) {
mapIDsToRemove.Add(rem_id);
for (Standard_Integer i_j = 1; i_j <= aLength_i; i_j++) {
if (aSeq_i->Value(i_j) > 0) {
TopoDS_Shape aShape_i_j = mapIndices_i.FindKey(i_j);
rem_id = mapIndices.FindIndex(aShape_i_j);
if (mapIDsCurrent.Contains(rem_id)) {
mapIDsToRemove.Add(rem_id);
}
} }
} }
} else {
SetErrorCode("One of given objects can not be removed from the group, because it is not a sub-shape of the group's main shape");
return;
} }
} }
} }

View File

@ -49,6 +49,7 @@
#include <TDF_Tool.hxx> #include <TDF_Tool.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
@ -134,8 +135,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ShapeProcess (Handle(GEOM_Objec
} }
//Compute the translation //Compute the translation
try try {
{ #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) if (!GetSolver()->ComputeFunction(aFunction))
{ {
SetErrorCode("Shape Healing algorithm failed"); SetErrorCode("Shape Healing algorithm failed");
@ -341,8 +344,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::SuppressFaces
HI.SetOriginal( aLastFunction ); HI.SetOriginal( aLastFunction );
//Compute the translation //Compute the translation
try try {
{ #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) if (!GetSolver()->ComputeFunction(aFunction))
{ {
SetErrorCode("Healing driver failed"); SetErrorCode("Healing driver failed");
@ -410,8 +415,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::CloseContour
HI.SetOriginal( aLastFunction ); HI.SetOriginal( aLastFunction );
//Compute the translation //Compute the translation
try try {
{ #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) if (!GetSolver()->ComputeFunction(aFunction))
{ {
SetErrorCode("Healing driver failed"); SetErrorCode("Healing driver failed");
@ -477,8 +484,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::RemoveIntWires
HI.SetOriginal( aLastFunction ); HI.SetOriginal( aLastFunction );
//Compute the translation //Compute the translation
try try {
{ #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) if (!GetSolver()->ComputeFunction(aFunction))
{ {
SetErrorCode("Healing driver failed"); SetErrorCode("Healing driver failed");
@ -543,8 +552,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::FillHoles (Handle(GEOM_Object)
HI.SetOriginal( aLastFunction ); HI.SetOriginal( aLastFunction );
//Compute the translation //Compute the translation
try try {
{ #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) if (!GetSolver()->ComputeFunction(aFunction))
{ {
SetErrorCode("Healing driver failed"); SetErrorCode("Healing driver failed");
@ -609,8 +620,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::Sew (Handle(GEOM_Object) theObj
HI.SetOriginal( aLastFunction ); HI.SetOriginal( aLastFunction );
//Compute the translation //Compute the translation
try try {
{ #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) if (!GetSolver()->ComputeFunction(aFunction))
{ {
SetErrorCode("Healing driver failed"); SetErrorCode("Healing driver failed");
@ -670,8 +683,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::DivideEdge (Handle(GEOM_Object)
HI.SetOriginal( aLastFunction ); HI.SetOriginal( aLastFunction );
//Compute the translation //Compute the translation
try try {
{ #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) if (!GetSolver()->ComputeFunction(aFunction))
{ {
SetErrorCode("Healing driver failed"); SetErrorCode("Healing driver failed");
@ -773,3 +788,122 @@ bool GEOMImpl_IHealingOperations::GetFreeBoundary (Handle(GEOM_Object) theObject
SetErrorCode(OK); SetErrorCode(OK);
return true; return true;
} }
//=============================================================================
/*!
* ChangeOrientation
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientation (Handle(GEOM_Object) theObject)
{
// set error code, check parameters
SetErrorCode(KO);
if (theObject.IsNull())
return NULL;
if (!theObject->IsMainShape()) {
SetErrorCode("Sub shape cannot be transformed - need to create a copy");
return NULL;
}
Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction();
if (aLastFunction.IsNull())
return NULL; //There is no function which creates an object to be processed
//Add the function
aFunction = theObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CHANGE_ORIENTATION);
if (aFunction.IsNull())
return NULL;
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL;
// prepare "data container" class IHealing
GEOMImpl_IHealing HI(aFunction);
HI.SetOriginal( aLastFunction );
//Compute the translation
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Healing driver failed");
return NULL;
}
}
catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return NULL;
}
//Make a Python command
GEOM::TPythonDump(aFunction) << "geompy.ChangeOrientationShell("
<< theObject << ")";
SetErrorCode(OK);
return theObject;
}
//=============================================================================
/*!
* ChangeOrientationCopy
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(GEOM_Object) theObject)
{
// set error code, check parameters
SetErrorCode(KO);
if (theObject.IsNull())
return NULL;
Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction();
if (aLastFunction.IsNull())
return NULL; //There is no function which creates an object to be processed
// Add a new object
Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CHANGE_ORIENTATION);
if (aFunction.IsNull())
return NULL;
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL;
// prepare "data container" class IHealing
GEOMImpl_IHealing HI(aFunction);
HI.SetOriginal( aLastFunction );
//Compute the translation
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Healing driver failed");
return NULL;
}
}
catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return NULL;
}
//Make a Python command
GEOM::TPythonDump(aFunction) << aNewObject << " = geompy.ChangeOrientationShellCopy("
<< theObject << ")";
SetErrorCode(OK);
return aNewObject;
}

View File

@ -81,6 +81,10 @@ class GEOMImpl_IHealingOperations : public GEOM_IOperations {
Standard_EXPORT bool GetFreeBoundary ( Handle(GEOM_Object) theObject, Standard_EXPORT bool GetFreeBoundary ( Handle(GEOM_Object) theObject,
Handle(TColStd_HSequenceOfTransient)& theOutClosedWires, Handle(TColStd_HSequenceOfTransient)& theOutClosedWires,
Handle(TColStd_HSequenceOfTransient)& theOutOpenWires ); Handle(TColStd_HSequenceOfTransient)& theOutOpenWires );
Standard_EXPORT Handle(GEOM_Object) ChangeOrientation( Handle(GEOM_Object) theObject);
Standard_EXPORT Handle(GEOM_Object) ChangeOrientationCopy( Handle(GEOM_Object) theObject);
}; };
#endif #endif

View File

@ -42,6 +42,7 @@
#include <GEOMImpl_Types.hxx> #include <GEOMImpl_Types.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
//============================================================================= //=============================================================================
@ -98,6 +99,9 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::MakeCopy(Handle(GEOM_Object) the
//Compute the Copy value //Compute the Copy value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Copy driver failed"); SetErrorCode("Copy driver failed");
return NULL; return NULL;
@ -155,6 +159,9 @@ void GEOMImpl_IInsertOperations::Export
//Perform the Export //Perform the Export
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Export driver failed"); SetErrorCode("Export driver failed");
return; return;
@ -210,6 +217,9 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::Import
//Perform the Import //Perform the Import
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Import driver failed"); SetErrorCode("Import driver failed");
return NULL; return NULL;
@ -388,9 +398,9 @@ Standard_Boolean GEOMImpl_IInsertOperations::InitResMgr()
// Initialize the Resource Manager // Initialize the Resource Manager
TCollection_AsciiString aResDir (getenv("GEOM_ROOT_DIR")); TCollection_AsciiString aResDir (getenv("GEOM_ROOT_DIR"));
#ifdef WNT #ifdef WNT
aResDir += "\\share\\salome\\resources"; aResDir += "\\share\\salome\\resources\\geom";
#else #else
aResDir += "/share/salome/resources"; aResDir += "/share/salome/resources/geom";
#endif #endif
char * dir = getenv("GEOM_ENGINE_RESOURCES_DIR"); char * dir = getenv("GEOM_ENGINE_RESOURCES_DIR");
TCollection_AsciiString aUserResDir; TCollection_AsciiString aUserResDir;

View File

@ -51,6 +51,7 @@
#include <TopoDS_TShape.hxx> #include <TopoDS_TShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx> #include <TopTools_IndexedMapOfShape.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
//============================================================================= //=============================================================================
@ -106,6 +107,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletAll
//Compute the Fillet value //Compute the Fillet value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Fillet driver failed"); SetErrorCode("Fillet driver failed");
return NULL; return NULL;
@ -164,6 +168,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletEdges
//Compute the Fillet value //Compute the Fillet value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Fillet driver failed"); SetErrorCode("Fillet driver failed");
return NULL; return NULL;
@ -230,6 +237,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletFaces
//Compute the Fillet value //Compute the Fillet value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Fillet driver failed"); SetErrorCode("Fillet driver failed");
return NULL; return NULL;
@ -287,6 +297,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferAll (Handle(GEOM_Objec
//Compute the Chamfer value //Compute the Chamfer value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Chamfer driver failed"); SetErrorCode("Chamfer driver failed");
return NULL; return NULL;
@ -341,6 +354,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdge
//Compute the Chamfer value //Compute the Chamfer value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Chamfer driver failed"); SetErrorCode("Chamfer driver failed");
return NULL; return NULL;
@ -402,6 +418,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferFaces
//Compute the Chamfer value //Compute the Chamfer value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Chamfer driver failed"); SetErrorCode("Chamfer driver failed");
return NULL; return NULL;
@ -463,6 +482,9 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeArchimede (Handle(GEOM_Object
//Compute the Archimede value //Compute the Archimede value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Archimede driver failed"); SetErrorCode("Archimede driver failed");
return NULL; return NULL;

View File

@ -32,6 +32,7 @@
#include <OpUtil.hxx> #include <OpUtil.hxx>
#include <Utils_ExceptHandlers.hxx> #include <Utils_ExceptHandlers.hxx>
// OCCT Includes
#include <TFunction_DriverTable.hxx> #include <TFunction_DriverTable.hxx>
#include <TFunction_Driver.hxx> #include <TFunction_Driver.hxx>
#include <TFunction_Logbook.hxx> #include <TFunction_Logbook.hxx>
@ -62,6 +63,11 @@
#include <TopTools_ListOfShape.hxx> #include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx> #include <TopTools_ListIteratorOfListOfShape.hxx>
#include <Geom_Surface.hxx>
#include <Geom_Plane.hxx>
#include <gp_Pln.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
//============================================================================= //=============================================================================
@ -86,6 +92,106 @@ GEOMImpl_IMeasureOperations::~GEOMImpl_IMeasureOperations()
} }
//=============================================================================
/*! Get LCS, corresponding to the given shape.
* Origin of the LCS is situated at the shape's center of mass.
* Axes of the LCS are obtained from shape's location or,
* if the shape is a planar face, from position of its plane.
*/
//=============================================================================
gp_Ax3 GEOMImpl_IMeasureOperations::GetPosition (const TopoDS_Shape& theShape)
{
gp_Ax3 aResult;
if (theShape.IsNull())
return aResult;
// Axes
aResult.Transform(theShape.Location().Transformation());
if (theShape.ShapeType() == TopAbs_FACE) {
Handle(Geom_Surface) aGS = BRep_Tool::Surface(TopoDS::Face(theShape));
if (!aGS.IsNull() && aGS->IsKind(STANDARD_TYPE(Geom_Plane))) {
Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast(aGS);
gp_Pln aPln = aGPlane->Pln();
aResult = aPln.Position();
}
}
// Origin
gp_Pnt aPnt;
if (theShape.ShapeType() == TopAbs_VERTEX) {
aPnt = BRep_Tool::Pnt(TopoDS::Vertex(theShape));
}
else {
GProp_GProps aSystem;
if (theShape.ShapeType() == TopAbs_EDGE || theShape.ShapeType() == TopAbs_WIRE)
BRepGProp::LinearProperties(theShape, aSystem);
else if (theShape.ShapeType() == TopAbs_FACE || theShape.ShapeType() == TopAbs_SHELL)
BRepGProp::SurfaceProperties(theShape, aSystem);
else
BRepGProp::VolumeProperties(theShape, aSystem);
aPnt = aSystem.CentreOfMass();
}
aResult.SetLocation(aPnt);
return aResult;
}
//=============================================================================
/*!
* GetPosition
*/
//=============================================================================
void GEOMImpl_IMeasureOperations::GetPosition
(Handle(GEOM_Object) theShape,
Standard_Real& Ox, Standard_Real& Oy, Standard_Real& Oz,
Standard_Real& Zx, Standard_Real& Zy, Standard_Real& Zz,
Standard_Real& Xx, Standard_Real& Xy, Standard_Real& Xz)
{
SetErrorCode(KO);
//Set default values: global CS
Ox = Oy = Oz = Zx = Zy = Xy = Xz = 0.;
Zz = Xx = 1.;
if (theShape.IsNull()) return;
Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
if (aRefShape.IsNull()) return;
TopoDS_Shape aShape = aRefShape->GetValue();
if (aShape.IsNull()) {
SetErrorCode("The Objects has NULL Shape");
return;
}
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
gp_Ax3 anAx3 = GetPosition(aShape);
gp_Pnt anOri = anAx3.Location();
gp_Dir aDirZ = anAx3.Direction();
gp_Dir aDirX = anAx3.XDirection();
// Output values
anOri.Coord(Ox, Oy, Oz);
aDirZ.Coord(Zx, Zy, Zz);
aDirX.Coord(Xx, Xy, Xz);
}
catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return;
}
SetErrorCode(OK);
}
//============================================================================= //=============================================================================
/*! /*!
* GetCentreOfMass * GetCentreOfMass
@ -118,6 +224,9 @@ Handle(GEOM_Object) GEOMImpl_IMeasureOperations::GetCentreOfMass
//Compute the CentreOfMass value //Compute the CentreOfMass value
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) { if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Measure driver failed to compute centre of mass"); SetErrorCode("Measure driver failed to compute centre of mass");
return NULL; return NULL;
@ -162,6 +271,9 @@ void GEOMImpl_IMeasureOperations::GetBasicProperties (Handle(GEOM_Object) theSha
//Compute the parameters //Compute the parameters
GProp_GProps LProps, SProps; GProp_GProps LProps, SProps;
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
BRepGProp::LinearProperties(aShape, LProps); BRepGProp::LinearProperties(aShape, LProps);
theLength = LProps.Mass(); theLength = LProps.Mass();
@ -215,6 +327,9 @@ void GEOMImpl_IMeasureOperations::GetInertia
GProp_GProps System; GProp_GProps System;
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (aShape.ShapeType() == TopAbs_VERTEX || if (aShape.ShapeType() == TopAbs_VERTEX ||
aShape.ShapeType() == TopAbs_EDGE || aShape.ShapeType() == TopAbs_EDGE ||
aShape.ShapeType() == TopAbs_WIRE) { aShape.ShapeType() == TopAbs_WIRE) {
@ -279,6 +394,9 @@ void GEOMImpl_IMeasureOperations::GetBoundingBox
Bnd_Box B; Bnd_Box B;
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
BRepBndLib::Add(aShape, B); BRepBndLib::Add(aShape, B);
B.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); B.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);
} }
@ -321,6 +439,9 @@ void GEOMImpl_IMeasureOperations::GetTolerance
FaceMax = EdgeMax = VertMax = -RealLast(); FaceMax = EdgeMax = VertMax = -RealLast();
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
for (TopExp_Explorer ExF (aShape, TopAbs_FACE); ExF.More(); ExF.Next()) { for (TopExp_Explorer ExF (aShape, TopAbs_FACE); ExF.More(); ExF.Next()) {
TopoDS_Face Face = TopoDS::Face(ExF.Current()); TopoDS_Face Face = TopoDS::Face(ExF.Current());
T = BRep_Tool::Tolerance(Face); T = BRep_Tool::Tolerance(Face);
@ -361,6 +482,7 @@ void GEOMImpl_IMeasureOperations::GetTolerance
*/ */
//============================================================================= //=============================================================================
bool GEOMImpl_IMeasureOperations::CheckShape (Handle(GEOM_Object) theShape, bool GEOMImpl_IMeasureOperations::CheckShape (Handle(GEOM_Object) theShape,
const Standard_Boolean theIsCheckGeom,
TCollection_AsciiString& theDump) TCollection_AsciiString& theDump)
{ {
SetErrorCode(KO); SetErrorCode(KO);
@ -379,7 +501,10 @@ bool GEOMImpl_IMeasureOperations::CheckShape (Handle(GEOM_Object) theShape,
//Compute the parameters //Compute the parameters
bool isValid = false; bool isValid = false;
try { try {
BRepCheck_Analyzer ana (aShape, false); #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
BRepCheck_Analyzer ana (aShape, theIsCheckGeom);
if (ana.IsValid()) { if (ana.IsValid()) {
theDump.Clear(); theDump.Clear();
isValid = true; isValid = true;
@ -429,6 +554,9 @@ TCollection_AsciiString GEOMImpl_IMeasureOperations::WhatIs (Handle(GEOM_Object)
Astr = Astr + " Number of sub-shapes : \n"; Astr = Astr + " Number of sub-shapes : \n";
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
int iType, nbTypes [TopAbs_SHAPE]; int iType, nbTypes [TopAbs_SHAPE];
for (iType = 0; iType < TopAbs_SHAPE; ++iType) for (iType = 0; iType < TopAbs_SHAPE; ++iType)
nbTypes[iType] = 0; nbTypes[iType] = 0;
@ -499,6 +627,9 @@ Standard_Real GEOMImpl_IMeasureOperations::GetMinDistance
//Compute the parameters //Compute the parameters
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
BRepExtrema_DistShapeShape dst (aShape1, aShape2); BRepExtrema_DistShapeShape dst (aShape1, aShape2);
if (dst.IsDone()) { if (dst.IsDone()) {
gp_Pnt PMin1, PMin2, P1, P2; gp_Pnt PMin1, PMin2, P1, P2;
@ -552,8 +683,10 @@ void GEOMImpl_IMeasureOperations::PointCoordinates( Handle(GEOM_Object) theShape
return; return;
} }
try try {
{ #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) ); gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
theX = aPnt.X(); theX = aPnt.X();
theY = aPnt.Y(); theY = aPnt.Y();

View File

@ -24,9 +24,11 @@
#include "GEOM_IOperations.hxx" #include "GEOM_IOperations.hxx"
#include <BRepCheck_Analyzer.hxx> #include <BRepCheck_Analyzer.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_HSequenceOfShape.hxx> #include <TopTools_HSequenceOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx> #include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
#include <gp_Ax3.hxx>
class GEOM_Engine; class GEOM_Engine;
class Handle(GEOM_Object); class Handle(GEOM_Object);
@ -36,40 +38,50 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine, int theDocID); Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine, int theDocID);
Standard_EXPORT ~GEOMImpl_IMeasureOperations(); Standard_EXPORT ~GEOMImpl_IMeasureOperations();
Standard_EXPORT void GetPosition (Handle(GEOM_Object) theShape,
Standard_Real& Ox, Standard_Real& Oy, Standard_Real& Oz,
Standard_Real& Zx, Standard_Real& Zy, Standard_Real& Zz,
Standard_Real& Xx, Standard_Real& Xy, Standard_Real& Xz);
Standard_EXPORT Handle(GEOM_Object) GetCentreOfMass (Handle(GEOM_Object) theShape); Standard_EXPORT Handle(GEOM_Object) GetCentreOfMass (Handle(GEOM_Object) theShape);
Standard_EXPORT void GetBasicProperties (Handle(GEOM_Object) theShape, Standard_EXPORT void GetBasicProperties (Handle(GEOM_Object) theShape,
Standard_Real& theLength, Standard_Real& theLength,
Standard_Real& theSurfArea, Standard_Real& theSurfArea,
Standard_Real& theVolume); Standard_Real& theVolume);
Standard_EXPORT void GetInertia (Handle(GEOM_Object) theShape, Standard_EXPORT void GetInertia (Handle(GEOM_Object) theShape,
Standard_Real& I11, Standard_Real& I12, Standard_Real& I13, Standard_Real& I11, Standard_Real& I12, Standard_Real& I13,
Standard_Real& I21, Standard_Real& I22, Standard_Real& I23, Standard_Real& I21, Standard_Real& I22, Standard_Real& I23,
Standard_Real& I31, Standard_Real& I32, Standard_Real& I33, Standard_Real& I31, Standard_Real& I32, Standard_Real& I33,
Standard_Real& Ix , Standard_Real& Iy , Standard_Real& Iz); Standard_Real& Ix , Standard_Real& Iy , Standard_Real& Iz);
Standard_EXPORT void GetBoundingBox (Handle(GEOM_Object) theShape, Standard_EXPORT void GetBoundingBox (Handle(GEOM_Object) theShape,
Standard_Real& Xmin, Standard_Real& Xmax, Standard_Real& Xmin, Standard_Real& Xmax,
Standard_Real& Ymin, Standard_Real& Ymax, Standard_Real& Ymin, Standard_Real& Ymax,
Standard_Real& Zmin, Standard_Real& Zmax); Standard_Real& Zmin, Standard_Real& Zmax);
Standard_EXPORT void GetTolerance (Handle(GEOM_Object) theShape, Standard_EXPORT void GetTolerance (Handle(GEOM_Object) theShape,
Standard_Real& FaceMin, Standard_Real& FaceMax, Standard_Real& FaceMin, Standard_Real& FaceMax,
Standard_Real& EdgeMin, Standard_Real& EdgeMax, Standard_Real& EdgeMin, Standard_Real& EdgeMax,
Standard_Real& VertMin, Standard_Real& VertMax); Standard_Real& VertMin, Standard_Real& VertMax);
Standard_EXPORT bool CheckShape (Handle(GEOM_Object) theShape, Standard_EXPORT bool CheckShape (Handle(GEOM_Object) theShape,
TCollection_AsciiString& theDump); const Standard_Boolean theIsCheckGeom,
TCollection_AsciiString& theDump);
Standard_EXPORT TCollection_AsciiString WhatIs (Handle(GEOM_Object) theShape); Standard_EXPORT TCollection_AsciiString WhatIs (Handle(GEOM_Object) theShape);
Standard_EXPORT Standard_Real GetMinDistance (Handle(GEOM_Object) theShape1, Handle(GEOM_Object) theShape2, Standard_EXPORT Standard_Real GetMinDistance (Handle(GEOM_Object) theShape1,
Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Handle(GEOM_Object) theShape2,
Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2); Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1,
Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2);
Standard_EXPORT void PointCoordinates( Handle(GEOM_Object) theShape, Standard_EXPORT void PointCoordinates(Handle(GEOM_Object) theShape,
Standard_Real& theX, Standard_Real& theY, Standard_Real& theZ ); Standard_Real& theX, Standard_Real& theY, Standard_Real& theZ );
public:
Standard_EXPORT static gp_Ax3 GetPosition (const TopoDS_Shape& theShape);
private: private:
void StructuralDump (const BRepCheck_Analyzer& theAna, void StructuralDump (const BRepCheck_Analyzer& theAna,

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