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

@ -597,4 +597,4 @@ function window_OnLoad()
} }
//--> //-->
</script> </script>
</html> </html>

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");

View File

@ -15,4 +15,4 @@ iTM(0,82,"whftdata0.htm");
//--> //-->
</script> </script>
</body> </body>
</html> </html>

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

@ -133,4 +133,4 @@ else
//--> //-->
</script> </script>
</body> </body>
</html> </html>

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

@ -88,4 +88,4 @@ else
//--> //-->
</script> </script>
</body> </body>
</html> </html>

View File

@ -22,4 +22,4 @@ window.onload=window_Onload;
</head> </head>
<frameset id="whPfset" cols="260,*"><noframes><p>Your browser does not support frames. We recommend that you update your browser to a version that supports frames.</p><p>To view the Help system without frames click on this<a href="whgdata/whnvp30.htm">hyperlink.</a></p></noframes><frame src="whgdata/whnvp30.htm" title="navigation pane" name="navigation pane" scrolling="no"><frame src="geometry.htm" title="topic pane" name="bsscright" scrolling="yes"></frameset> <frameset id="whPfset" cols="260,*"><noframes><p>Your browser does not support frames. We recommend that you update your browser to a version that supports frames.</p><p>To view the Help system without frames click on this<a href="whgdata/whnvp30.htm">hyperlink.</a></p></noframes><frame src="whgdata/whnvp30.htm" title="navigation pane" name="navigation pane" scrolling="no"><frame src="geometry.htm" title="topic pane" name="bsscright" scrolling="yes"></frameset>
</html> </html>

View File

@ -253,4 +253,4 @@
<indent attr="9pt" /> <indent attr="9pt" />
</glossary> </glossary>
</paneskin> </paneskin>
</resource> </resource>

View File

@ -17,4 +17,4 @@
<tr><td> Authoring Tool Name </td><td>RoboHelp X5</td></tr> <tr><td> Authoring Tool Name </td><td>RoboHelp X5</td></tr>
<table> <table>
</body> </body>
</html> </html>

View File

@ -226,4 +226,4 @@ writeStyle();
</body> </body>
</html> </html>

View File

@ -429,4 +429,4 @@ function isAPane(sPaneName)
return true; return true;
else else
return false; return false;
} }

View File

@ -46,4 +46,4 @@ TocInitPage();
//--> //-->
</script> </script>
</body> </body>
</html> </html>

View File

@ -722,4 +722,4 @@ setButtonFont("hide","","","","","","");
gbWhTopic=true; gbWhTopic=true;
} }
else else
document.location.reload(); document.location.reload();

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
@ -1105,6 +1139,23 @@ 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 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
@ -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,38 +137,41 @@ 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() ) );
gp_Pnt aPnt; }
else
{
OCCViewer_ViewPort3d* vp = ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort();
aPnt = ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
}
ic->InitSelected(); aPntDlg->OnPointSelected( aPnt ); // "feed" the point to point construction dialog
if( pe->state() == Qt::ShiftButton ) } // acceptMouseEvent()
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

@ -1,23 +1,23 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// 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()
@ -114,13 +114,13 @@ BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* th
myData[ DY2 ] = new DlgRef_SpinBox( anYAxisGrp ); myData[ DY2 ] = new DlgRef_SpinBox( anYAxisGrp );
new QLabel( tr( "DZ" ), anYAxisGrp ); new QLabel( tr( "DZ" ), anYAxisGrp );
myData[ DZ2 ] = new DlgRef_SpinBox( anYAxisGrp ); myData[ DZ2 ] = new DlgRef_SpinBox( anYAxisGrp );
Layout1->addWidget( aMainGrp, 2, 0 ); Layout1->addWidget( aMainGrp, 2, 0 );
Layout1->addWidget( Group1, 2, 0 ); Layout1->addWidget( Group1, 2, 0 );
Layout1->addWidget( Group2, 2, 0 ); Layout1->addWidget( Group2, 2, 0 );
setHelpFileName("local_coordinate_system.htm"); setHelpFileName("local_coordinate_system.htm");
Init(); Init();
} }
@ -147,7 +147,7 @@ void BasicGUI_MarkerDlg::Init()
Group2->LineEdit1->setReadOnly( true ); Group2->LineEdit1->setReadOnly( true );
Group2->LineEdit2->setReadOnly( true ); Group2->LineEdit2->setReadOnly( true );
Group2->LineEdit3->setReadOnly( true ); Group2->LineEdit3->setReadOnly( true );
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int))); connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
@ -166,17 +166,17 @@ void BasicGUI_MarkerDlg::Init()
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( onOk() ) ); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( onOk() ) );
connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onApply() ) ); connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onApply() ) );
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionDone() ) ); SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionDone() ) );
initName( tr( "LCS_NAME" ) ); initName( tr( "LCS_NAME" ) );
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
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 );
@ -267,7 +267,7 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
} }
} }
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionDone())); SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionDone()));
onSelectionDone(); onSelectionDone();
} }
@ -302,7 +302,7 @@ bool BasicGUI_MarkerDlg::onApply()
initName(); initName();
ConstructorsClicked( getConstructorId() ); ConstructorsClicked( getConstructorId() );
return true; return true;
} }
@ -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,22 +349,21 @@ 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 )
{ {
@ -386,12 +387,10 @@ 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;
if ( !aMap.IsEmpty() ) { Ox = Oy = Oz = Zx = Zy = Xy = Xz = Yx = Yz = 0;
int anIndex = aMap( 1 ); Zz = Xx = Yy = 1.;
TopTools_IndexedMapOfShape aShapes;
TopExp::MapShapes( aShape, aShapes );
aShape = aShapes.FindKey( anIndex );
}
if ( getConstructorId() == 1 ) { GEOM::GEOM_IMeasureOperations_ptr aMeasureOp =
if ( !aShape.IsNull() ) { myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId());
gp_Pnt aPnt; aMeasureOp->GetPosition(aSelectedObj, Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz);
if (aShape.ShapeType() == TopAbs_VERTEX) {
aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShape)); // Calculate Y direction
} if (aMeasureOp->IsDone()) {
else { gp_Pnt aPnt (Ox,Oy,Oz);
GProp_GProps aSystem; gp_Dir aDirN (Zx,Zy,Zz);
if (aShape.ShapeType() == TopAbs_EDGE || aShape.ShapeType() == TopAbs_WIRE) gp_Dir aDirX (Xx,Xy,Xz);
BRepGProp::LinearProperties(aShape, aSystem); gp_Ax3 anAx3 (aPnt, aDirN, aDirX);
else if (aShape.ShapeType() == TopAbs_FACE || aShape.ShapeType() == TopAbs_SHELL)
BRepGProp::SurfaceProperties(aShape, aSystem); gp_Dir aDirY = anAx3.YDirection();
else aDirY.Coord(Yx,Yy,Yz);
BRepGProp::VolumeProperties(aShape, aSystem); }
aPnt = aSystem.CentreOfMass(); // Set values
} myData[ X ]->SetValue( Ox );
myData[ Y ]->SetValue( Oy );
gp_Ax3 anAx3; myData[ Z ]->SetValue( Oz );
anAx3.Transform(aShape.Location().Transformation());
if(aShape.ShapeType() == TopAbs_FACE) { myData[ DX1 ]->SetValue( Xx );
Handle(Geom_Surface) aGS = BRep_Tool::Surface( TopoDS::Face( aShape ) ); myData[ DY1 ]->SetValue( Xy );
if (!aGS.IsNull() && aGS->IsKind( STANDARD_TYPE( Geom_Plane ) ) ) { myData[ DZ1 ]->SetValue( Xz );
Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast( aGS );
gp_Pln aPln = aGPlane->Pln(); myData[ DX2 ]->SetValue( Yx );
anAx3 = aPln.Position(); myData[ DY2 ]->SetValue( Yy );
} myData[ DZ2 ]->SetValue( Yz );
}
myEditCurrentArgument->setText( aName );
gp_Dir aDirX = anAx3.XDirection(); }
gp_Dir aDirY = anAx3.YDirection(); else if ( getConstructorId() == 2 ) { // by point and two vectors
TopoDS_Shape aShape;
myData[ X ]->SetValue( aPnt.X() ); if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) ) {
myData[ Y ]->SetValue( aPnt.Y() ); GEOM::short_array anIndexes;
myData[ Z ]->SetValue( aPnt.Z() );
TColStd_IndexedMapOfInteger aMap;
myData[ DX1 ]->SetValue( aDirX.X() ); LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
myData[ DY1 ]->SetValue( aDirX.Y() ); aSelMgr->GetIndexes( anIO, aMap );
myData[ DZ1 ]->SetValue( aDirX.Z() );
if ( !aMap.IsEmpty() ) {
myData[ DX2 ]->SetValue( aDirY.X() ); int anIndex = aMap( 1 );
myData[ DY2 ]->SetValue( aDirY.Y() ); TopTools_IndexedMapOfShape aShapes;
myData[ DZ2 ]->SetValue( aDirY.Z() ); TopExp::MapShapes( aShape, aShapes );
aShape = aShapes.FindKey( anIndex );
myEditCurrentArgument->setText( aName ); }
}
else { if (myEditCurrentArgument == Group2->LineEdit1) {
myData[ X ]->SetValue( 0 );
myData[ Y ]->SetValue( 0 );
myData[ Z ]->SetValue( 0 );
myData[ DX1 ]->SetValue( 0 );
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() );
@ -497,7 +474,7 @@ void BasicGUI_MarkerDlg::onSelectionDone()
gp_Pnt aP1 = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(aShape))); gp_Pnt aP1 = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(aShape)));
gp_Pnt aP2 = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(aShape))); gp_Pnt aP2 = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(aShape)));
gp_Dir aDir(gp_Vec(aP1, aP2)); gp_Dir aDir(gp_Vec(aP1, aP2));
myData[ DX1 ]->SetValue( aDir.X() ); myData[ DX1 ]->SetValue( aDir.X() );
myData[ DY1 ]->SetValue( aDir.Y() ); myData[ DY1 ]->SetValue( aDir.Y() );
myData[ DZ1 ]->SetValue( aDir.Z() ); myData[ DZ1 ]->SetValue( aDir.Z() );
@ -514,7 +491,7 @@ void BasicGUI_MarkerDlg::onSelectionDone()
gp_Pnt aP1 = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(aShape))); gp_Pnt aP1 = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(aShape)));
gp_Pnt aP2 = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(aShape))); gp_Pnt aP2 = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(aShape)));
gp_Dir aDir(gp_Vec(aP1, aP2)); gp_Dir aDir(gp_Vec(aP1, aP2));
myData[ DX2 ]->SetValue( aDir.X() ); myData[ DX2 ]->SetValue( aDir.X() );
myData[ DY2 ]->SetValue( aDir.Y() ); myData[ DY2 ]->SetValue( aDir.Y() );
myData[ DZ2 ]->SetValue( aDir.Z() ); myData[ DZ2 ]->SetValue( aDir.Z() );
@ -535,11 +512,11 @@ void BasicGUI_MarkerDlg::onSelectionDone()
myData[ X ]->SetValue( 0 ); myData[ X ]->SetValue( 0 );
myData[ Y ]->SetValue( 0 ); myData[ Y ]->SetValue( 0 );
myData[ Z ]->SetValue( 0 ); myData[ Z ]->SetValue( 0 );
myData[ DX1 ]->SetValue( 0 ); myData[ DX1 ]->SetValue( 0 );
myData[ DY1 ]->SetValue( 0 ); myData[ DY1 ]->SetValue( 0 );
myData[ DZ1 ]->SetValue( 0 ); myData[ DZ1 ]->SetValue( 0 );
myData[ DX2 ]->SetValue( 0 ); myData[ DX2 ]->SetValue( 0 );
myData[ DY2 ]->SetValue( 0 ); myData[ DY2 ]->SetValue( 0 );
myData[ DZ2 ]->SetValue( 0 ); myData[ DZ2 ]->SetValue( 0 );
@ -560,9 +537,9 @@ void BasicGUI_MarkerDlg::onSelectionDone()
myData[ DY2 ]->SetValue( 0 ); myData[ DY2 ]->SetValue( 0 );
myData[ DZ2 ]->SetValue( 0 ); myData[ DZ2 ]->SetValue( 0 );
} }
} }
} }
displayPreview(); displayPreview();
} }
@ -573,7 +550,7 @@ void BasicGUI_MarkerDlg::onSelectionDone()
void BasicGUI_MarkerDlg::SetEditCurrentArgument() void BasicGUI_MarkerDlg::SetEditCurrentArgument()
{ {
QPushButton* send = (QPushButton*)sender(); QPushButton* send = (QPushButton*)sender();
if(send == Group1->PushButton1) { if(send == Group1->PushButton1) {
myEditCurrentArgument = Group1->LineEdit1; myEditCurrentArgument = Group1->LineEdit1;
globalSelection( GEOM_ALLGEOM ); globalSelection( GEOM_ALLGEOM );
@ -590,7 +567,7 @@ void BasicGUI_MarkerDlg::SetEditCurrentArgument()
myEditCurrentArgument = Group2->LineEdit3; myEditCurrentArgument = Group2->LineEdit3;
globalSelection( GEOM_LINE ); globalSelection( GEOM_LINE );
} }
myEditCurrentArgument->setFocus(); myEditCurrentArgument->setFocus();
onSelectionDone(); onSelectionDone();
} }
@ -614,7 +591,7 @@ void BasicGUI_MarkerDlg::LineEditReturnPressed()
void BasicGUI_MarkerDlg::onActivate() void BasicGUI_MarkerDlg::onActivate()
{ {
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( onSelectionDone() ) ); SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionDone() ) );
ConstructorsClicked( getConstructorId() ); ConstructorsClicked( getConstructorId() );
@ -634,7 +611,7 @@ void BasicGUI_MarkerDlg::onDeactivate()
// purpose : // purpose :
//================================================================================= //=================================================================================
void BasicGUI_MarkerDlg::enterEvent(QEvent* e) void BasicGUI_MarkerDlg::enterEvent(QEvent* e)
{ {
if ( !GroupConstructors->isEnabled() ) if ( !GroupConstructors->isEnabled() )
onActivate(); onActivate();
} }
@ -674,8 +651,8 @@ bool BasicGUI_MarkerDlg::isValid( QString& msg )
case 1: case 1:
return !Group1->LineEdit1->text().isEmpty() && isOk; return !Group1->LineEdit1->text().isEmpty() && isOk;
case 2: case 2:
return !Group2->LineEdit1->text().isEmpty() && return !Group2->LineEdit1->text().isEmpty() &&
!Group2->LineEdit2->text().isEmpty() && !Group2->LineEdit2->text().isEmpty() &&
!Group2->LineEdit3->text().isEmpty() && isOk; !Group2->LineEdit3->text().isEmpty() && isOk;
} }
return false; return false;
@ -734,17 +711,3 @@ void BasicGUI_MarkerDlg::displayPreview ( const bool activate,
} }
} }
} }

View File

@ -1,22 +1,22 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// 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
// //
// //
@ -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"
@ -41,7 +43,7 @@ using namespace std;
//================================================================================= //=================================================================================
// class : BasicGUI_PlaneDlg() // class : BasicGUI_PlaneDlg()
// purpose : Constructs a BasicGUI_PlaneDlg which is a child of 'parent', with the // purpose : Constructs a BasicGUI_PlaneDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'. // name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to // The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog. // TRUE to construct a modal dialog.
@ -89,20 +91,20 @@ 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);
GroupFace->LineEdit1->setReadOnly( true ); GroupFace->LineEdit1->setReadOnly( true );
Layout1->addWidget(GroupPntDir, 2, 0); Layout1->addWidget(GroupPntDir, 2, 0);
Layout1->addWidget(Group3Pnts, 2, 0); Layout1->addWidget(Group3Pnts, 2, 0);
Layout1->addWidget(GroupFace, 2, 0); Layout1->addWidget(GroupFace, 2, 0);
/***************************************************************/ /***************************************************************/
setHelpFileName("plane.htm"); setHelpFileName("plane.htm");
Init(); Init();
} }
@ -112,7 +114,7 @@ BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(GeometryGUI* theGeometryGUI, QWidget* paren
// purpose : Destroys the object and frees any allocated resources // purpose : Destroys the object and frees any allocated resources
//================================================================================= //=================================================================================
BasicGUI_PlaneDlg::~BasicGUI_PlaneDlg() BasicGUI_PlaneDlg::~BasicGUI_PlaneDlg()
{ {
} }
@ -132,15 +134,15 @@ void BasicGUI_PlaneDlg::Init()
/* Get setting of step value from file configuration */ /* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
double aStep = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); double aStep = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
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 */
@ -196,7 +198,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId)
switch ( constructorId ) switch ( constructorId )
{ {
case 0: /* plane from a point and a direction (vector, edge...) */ case 0: /* plane from a point and a direction (vector, edge...) */
{ {
Group3Pnts->hide(); Group3Pnts->hide();
GroupFace->hide(); GroupFace->hide();
resize(0, 0); resize(0, 0);
@ -225,7 +227,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId)
/* for the first argument */ /* for the first argument */
globalSelection( GEOM_POINT ); globalSelection( GEOM_POINT );
break; break;
} }
case 2: /* plane from a planar face selection */ case 2: /* plane from a planar face selection */
{ {
GroupPntDir->hide(); GroupPntDir->hide();
@ -237,13 +239,17 @@ 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;
} }
} }
myEditCurrentArgument->setFocus(); myEditCurrentArgument->setFocus();
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()));
} }
@ -289,8 +295,8 @@ void BasicGUI_PlaneDlg::ClickOnCancel()
void BasicGUI_PlaneDlg::SelectionIntoArgument() void BasicGUI_PlaneDlg::SelectionIntoArgument()
{ {
myEditCurrentArgument->setText(""); myEditCurrentArgument->setText("");
if ( IObjectCount() != 1 ) if ( IObjectCount() != 1 )
{ {
if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = GEOM::GEOM_Object::_nil(); if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = GEOM::GEOM_Object::_nil(); else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = GEOM::GEOM_Object::_nil();
@ -305,7 +311,7 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument()
Standard_Boolean aRes = Standard_False; Standard_Boolean aRes = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes ); GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{ {
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) ); myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = aSelectedObject; if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = aSelectedObject;
else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = aSelectedObject; else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = aSelectedObject;
@ -325,7 +331,7 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument()
//================================================================================= //=================================================================================
void BasicGUI_PlaneDlg::SetEditCurrentArgument() void BasicGUI_PlaneDlg::SetEditCurrentArgument()
{ {
QPushButton* send = (QPushButton*)sender(); QPushButton* send = (QPushButton*)sender();
if ( send == GroupPntDir->PushButton1 ) myEditCurrentArgument = GroupPntDir->LineEdit1; if ( send == GroupPntDir->PushButton1 ) myEditCurrentArgument = GroupPntDir->LineEdit1;
else if ( send == GroupPntDir->PushButton2 ) myEditCurrentArgument = GroupPntDir->LineEdit2; else if ( send == GroupPntDir->PushButton2 ) myEditCurrentArgument = GroupPntDir->LineEdit2;
@ -335,14 +341,19 @@ void BasicGUI_PlaneDlg::SetEditCurrentArgument()
else if ( send == GroupFace->PushButton1 ) myEditCurrentArgument = GroupFace->LineEdit1; else if ( send == GroupFace->PushButton1 ) myEditCurrentArgument = GroupFace->LineEdit1;
myEditCurrentArgument->setFocus(); myEditCurrentArgument->setFocus();
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();
} }
@ -374,7 +385,7 @@ void BasicGUI_PlaneDlg::LineEditReturnPressed()
void BasicGUI_PlaneDlg::ActivateThisDialog() void BasicGUI_PlaneDlg::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()));
// myGeomGUI->SetState( 0 ); // myGeomGUI->SetState( 0 );

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;
//================================================================================= //=================================================================================
@ -158,7 +156,7 @@ void BasicGUI_WorkingPlaneDlg::Init()
connect(Group3->GroupBox1, SIGNAL(clicked(int)), this, SLOT(GroupClicked(int))); connect(Group3->GroupBox1, SIGNAL(clicked(int)), this, SLOT(GroupClicked(int)));
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()));
initName( tr( "GEOM_WPLANE" ) ); initName( tr( "GEOM_WPLANE" ) );
@ -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;
} }
//================================================================================= //=================================================================================
@ -425,7 +437,7 @@ void BasicGUI_WorkingPlaneDlg::LineEditReturnPressed()
void BasicGUI_WorkingPlaneDlg::ActivateThisDialog( ) void BasicGUI_WorkingPlaneDlg::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()));
ConstructorsClicked( getConstructorId() ); ConstructorsClicked( getConstructorId() );

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
@ -91,7 +75,7 @@ bool BooleanGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
QDialog* aDlg = new BooleanGUI_Dialog( anOperation, getGeometryGUI(), parent, ""); QDialog* aDlg = new BooleanGUI_Dialog( anOperation, getGeometryGUI(), parent, "");
aDlg->show(); aDlg->show();
return true; return true;
} }
@ -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
@ -80,7 +67,7 @@ BuildGUI::~BuildGUI()
bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
{ {
getGeometryGUI()->EmitSignalDeactivateDialog(); getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL; QDialog* aDlg = NULL;
switch ( theCommandID ) switch ( theCommandID )
@ -91,15 +78,15 @@ bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
case 4084: aDlg = new BuildGUI_ShellDlg ( getGeometryGUI(), parent, "" ); break; case 4084: aDlg = new BuildGUI_ShellDlg ( getGeometryGUI(), parent, "" ); break;
case 4085: aDlg = new BuildGUI_SolidDlg ( getGeometryGUI(), parent, "" ); break; case 4085: aDlg = new BuildGUI_SolidDlg ( getGeometryGUI(), parent, "" ); break;
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;
} }
if ( aDlg != NULL ) if ( aDlg != NULL )
aDlg->show(); aDlg->show();
return true; return true;
} }
@ -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 ) {
@ -232,28 +222,28 @@ void DisplayGUI::DisplayOnly()
void DisplayGUI::Display() 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() );
if ( !anActiveStudy ) return; if ( !anActiveStudy ) return;
//get SalomeApp selection manager //get SalomeApp selection manager
LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
if ( !aSelMgr ) return; if ( !aSelMgr ) return;
SALOME_ListIO aList; SALOME_ListIO aList;
aSelMgr->selectedObjects( aList ); aSelMgr->selectedObjects( aList );
SALOME_ListIteratorOfListIO It( aList ); SALOME_ListIteratorOfListIO It( aList );
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();
@ -263,8 +253,10 @@ 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();
} }
break; break;
@ -289,27 +281,27 @@ 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() );
if ( !anActiveStudy ) return; if ( !anActiveStudy ) return;
//get SalomeApp selection manager //get SalomeApp selection manager
LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
if ( !aSelMgr ) return; if ( !aSelMgr ) return;
SALOME_ListIO aList; SALOME_ListIO aList;
aSelMgr->selectedObjects( aList ); aSelMgr->selectedObjects( aList );
SALOME_ListIteratorOfListIO It( aList ); SALOME_ListIteratorOfListIO It( aList );
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,8 +311,10 @@ 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();
} }
break; break;
@ -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 );
@ -360,7 +354,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
AIS_ListOfInteractive List1; AIS_ListOfInteractive List1;
ic->ObjectsInCollector( List1 ); ic->ObjectsInCollector( List1 );
List.Append( List1 ); List.Append( List1 );
AIS_ListIteratorOfListOfInteractive ite( List ); AIS_ListIteratorOfListOfInteractive ite( List );
while( ite.More() ) { while( ite.More() ) {
if( ite.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) { if( ite.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
@ -369,7 +363,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
} }
ite.Next(); ite.Next();
} }
ic->SetDisplayMode( newmode, Standard_False ); ic->SetDisplayMode( newmode, Standard_False );
} }
} }
@ -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,19 +407,19 @@ 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;
SUIT_OverrideCursor(); SUIT_OverrideCursor();
SALOME_ListIO aList; SALOME_ListIO aList;
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow ); SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
SVTK_View* aView = vw->getView(); SVTK_View* aView = vw->getView();
@ -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;
@ -129,7 +126,7 @@ void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shap
mySimulationShape1 = new AIS_Shape(TopoDS_Shape()); mySimulationShape1 = new AIS_Shape(TopoDS_Shape());
mySimulationShape1->Set(S1); mySimulationShape1->Set(S1);
mySimulationShape1->SetColor(Quantity_NOC_RED); mySimulationShape1->SetColor(Quantity_NOC_RED);
ic->Deactivate(mySimulationShape1); ic->Deactivate(mySimulationShape1);
ic->Display(mySimulationShape1, Standard_False); ic->Display(mySimulationShape1, Standard_False);
mySimulationShape1->UnsetColor(); mySimulationShape1->UnsetColor();
@ -160,15 +157,18 @@ 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() ) {
if ( vw->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { if ( vw->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(vw->getViewManager()))->getOCCViewer(); OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(vw->getViewManager()))->getOCCViewer();
@ -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

@ -1,30 +1,30 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// 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"
@ -58,7 +58,7 @@ using namespace std;
//================================================================================= //=================================================================================
// class : EntityGUI_SketcherDlg() // class : EntityGUI_SketcherDlg()
// purpose : Constructs a EntityGUI_SketcherDlg which is a child of 'parent', with the // purpose : Constructs a EntityGUI_SketcherDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'. // name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to // The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog. // TRUE to construct a modal dialog.
@ -80,7 +80,7 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent,
buttonClose->setText(tr("GEOM_BUT_CLOSE_SKETCH")); buttonClose->setText(tr("GEOM_BUT_CLOSE_SKETCH"));
buttonHelp->setText(tr("GEOM_BUT_HELP")); buttonHelp->setText(tr("GEOM_BUT_HELP"));
GroupVal->close(TRUE); GroupVal->close(TRUE);
GroupDest2->close(TRUE); GroupDest2->close(TRUE);
GroupDest3->close(TRUE); GroupDest3->close(TRUE);
@ -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);
@ -217,7 +235,19 @@ 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();
@ -460,7 +531,7 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y3")); Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y3"));
Group2Spin->SpinBox_DY->SetValue(myY); Group2Spin->SpinBox_DY->SetValue(myY);
} }
} }
else if ( myConstructorDirId == 0 ) else if ( myConstructorDirId == 0 )
{ // Perpendicular { // Perpendicular
Group1Spin->show(); Group1Spin->show();
@ -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;
@ -651,7 +722,7 @@ void EntityGUI_SketcherDlg::ClickOnEnd()
tr( "GEOM_ERROR_STATUS" ), tr( "CANNOT_CLOSE" ), tr( "BUT_OK" ) ); tr( "GEOM_ERROR_STATUS" ), tr( "CANNOT_CLOSE" ), tr( "BUT_OK" ) );
return; return;
} }
QString Command = myCommand.join( "" ) + GetNewCommand(); QString Command = myCommand.join( "" ) + GetNewCommand();
Sketcher_Profile aProfile (Command.ascii()); Sketcher_Profile aProfile (Command.ascii());
@ -660,11 +731,11 @@ void EntityGUI_SketcherDlg::ClickOnEnd()
TopoDS_Shape myShape; TopoDS_Shape myShape;
if ( aProfile.IsDone() ) if ( aProfile.IsDone() )
myShape = aProfile.GetShape(); myShape = aProfile.GetShape();
if(myShape.ShapeType() != TopAbs_VERTEX) if(myShape.ShapeType() != TopAbs_VERTEX)
myCommand.append( ":WW" ); myCommand.append( ":WW" );
} }
else else
myIsAllAdded = true; myIsAllAdded = true;
if( myCommand.size() > 2 ) if( myCommand.size() > 2 )
@ -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;
} }
@ -705,7 +794,7 @@ bool EntityGUI_SketcherDlg::ClickOnApply()
void EntityGUI_SketcherDlg::ClickOnHelp() void EntityGUI_SketcherDlg::ClickOnHelp()
{ {
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app) if (app)
app->onHelpContextModule(myGeometryGUI ? app->moduleName(myGeometryGUI->moduleName()) : QString(""), myHelpFileName); app->onHelpContextModule(myGeometryGUI ? app->moduleName(myGeometryGUI->moduleName()) : QString(""), myHelpFileName);
else { else {
QString platform; QString platform;
@ -733,7 +822,7 @@ void EntityGUI_SketcherDlg::ClickOnUndo()
if(myCommand.count() == 1) { if(myCommand.count() == 1) {
mySketchState = FIRST_POINT; mySketchState = FIRST_POINT;
RadioButton1->setChecked(true); RadioButton1->setChecked(true);
TypeClicked(0); TypeClicked(0);
@ -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,26 +1391,26 @@ 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();
} }
} }
gp_Ax3 myWPlane = myGeometryGUI->GetWorkingPlane(); gp_Ax3 myWPlane = myGeometryGUI->GetWorkingPlane();
GEOM::ListOfDouble_var WPlane = new GEOM::ListOfDouble; GEOM::ListOfDouble_var WPlane = new GEOM::ListOfDouble;
WPlane->length(9); WPlane->length(9);
@ -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

@ -1,23 +1,23 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// 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
// //
// //
// //
@ -96,7 +96,7 @@ bool GeometryGUI::InitGeomGen()
//======================================================================= //=======================================================================
// function : ClientSObjectToObject // function : ClientSObjectToObject
// purpose : // purpose :
//======================================================================= //=======================================================================
CORBA::Object_var GeometryGUI::ClientSObjectToObject (_PTR(SObject) theSObject) CORBA::Object_var GeometryGUI::ClientSObjectToObject (_PTR(SObject) theSObject)
{ {
@ -116,7 +116,7 @@ CORBA::Object_var GeometryGUI::ClientSObjectToObject (_PTR(SObject) theSObject)
//======================================================================= //=======================================================================
// function : ClientStudyToStudy // function : ClientStudyToStudy
// purpose : // purpose :
//======================================================================= //=======================================================================
SALOMEDS::Study_var GeometryGUI::ClientStudyToStudy (_PTR(Study) theStudy) SALOMEDS::Study_var GeometryGUI::ClientStudyToStudy (_PTR(Study) theStudy)
{ {
@ -171,12 +171,12 @@ GeometryGUI::GeometryGUI() :
SalomeApp_Module( "GEOM" ) SalomeApp_Module( "GEOM" )
{ {
if ( CORBA::is_nil( myComponentGeom ) ) if ( CORBA::is_nil( myComponentGeom ) )
{ {
SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA( getApp()->namingService() ); SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA( getApp()->namingService() );
Engines::Component_var comp = ls->FindOrLoad_Component( "FactoryServer", "GEOM" ); Engines::Component_var comp = ls->FindOrLoad_Component( "FactoryServer", "GEOM" );
myComponentGeom = GEOM::GEOM_Gen::_narrow( comp ); myComponentGeom = GEOM::GEOM_Gen::_narrow( comp );
} }
myState = -1; myState = -1;
myActiveDialogBox = 0; myActiveDialogBox = 0;
myFatherior = ""; myFatherior = "";
@ -350,7 +350,7 @@ void GeometryGUI::OnGUIEvent( int id )
bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() ); bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
// if current viewframe is not of OCC and not of VTK type - return immediately // if current viewframe is not of OCC and not of VTK type - return immediately
// fix for IPAL8958 - allow some commands to execute even when NO viewer is active (rename for example) // fix for IPAL8958 - allow some commands to execute even when NO viewer is active (rename for example)
bool NotViewerDependentCommand = ( id == 901 || id == 216 || id == 213 ); bool NotViewerDependentCommand = ( id == 901 || id == 216 || id == 213 );
if ( !ViewOCC && !ViewVTK && !NotViewerDependentCommand ) if ( !ViewOCC && !ViewVTK && !NotViewerDependentCommand )
return; return;
@ -486,7 +486,7 @@ void GeometryGUI::OnGUIEvent( int id )
else if( id == 503 || // MENU OPERATION - PARTITION else if( id == 503 || // MENU OPERATION - PARTITION
id == 504 || // MENU OPERATION - ARCHIMEDE id == 504 || // MENU OPERATION - ARCHIMEDE
id == 505 || // MENU OPERATION - FILLET id == 505 || // MENU OPERATION - FILLET
id == 506 || // MENU OPERATION - CHAMFER id == 506 || // MENU OPERATION - CHAMFER
id == 507 ) { // MENU OPERATION - CLIPPING RANGE id == 507 ) { // MENU OPERATION - CLIPPING RANGE
#ifndef WNT #ifndef WNT
library = getLibrary( "libOperationGUI.so" ); library = getLibrary( "libOperationGUI.so" );
@ -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" );
@ -548,9 +549,9 @@ void GeometryGUI::OnGUIEvent( int id )
} }
// call method of corresponding GUI library // call method of corresponding GUI library
if ( library ) if ( library )
library->OnGUIEvent( id, desk ); library->OnGUIEvent( id, desk );
else else
SUIT_MessageBox::error1( desk, tr( "GEOM_ERROR" ), tr( "GEOM_ERR_LIB_NOT_FOUND" ), tr( "GEOM_BUT_OK" ) ); SUIT_MessageBox::error1( desk, tr( "GEOM_ERROR" ), tr( "GEOM_ERR_LIB_NOT_FOUND" ), tr( "GEOM_BUT_OK" ) );
} }
@ -577,7 +578,7 @@ void GeometryGUI::OnKeyPress( SUIT_ViewWindow* win, QKeyEvent* pe )
// purpose : Manages mouse move events [static] // purpose : Manages mouse move events [static]
//================================================================================= //=================================================================================
void GeometryGUI::OnMouseMove( SUIT_ViewWindow* win, QMouseEvent* pe ) void GeometryGUI::OnMouseMove( SUIT_ViewWindow* win, QMouseEvent* pe )
{ {
GUIMap::Iterator it; GUIMap::Iterator it;
bool bOk = true; bool bOk = true;
for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it ) { for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it ) {
@ -636,7 +637,7 @@ bool GeometryGUI::SetSettings()
{ {
QMenuBar* Mb = parent->getMainMenuBar(); QMenuBar* Mb = parent->getMainMenuBar();
SUIT_Study* ActiveStudy = application()->activeStudy(); SUIT_Study* ActiveStudy = application()->activeStudy();
// Wireframe or Shading // Wireframe or Shading
int DisplayMode = 0; int DisplayMode = 0;
SUIT_ViewWindow* window = application()->desktop()->activeWindow(); SUIT_ViewWindow* window = application()->desktop()->activeWindow();
@ -670,16 +671,16 @@ bool GeometryGUI::SetSettings()
// if(!AddInStudy.isEmpty()) // if(!AddInStudy.isEmpty())
// Settings_AddInStudy = AddInStudy.toInt(); // Settings_AddInStudy = AddInStudy.toInt();
// else // else
Settings_AddInStudy = 1; Settings_AddInStudy = 1;
Mb->setItemChecked(411, Settings_AddInStudy); Mb->setItemChecked(411, Settings_AddInStudy);
// step value // step value
QString S = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep"); QString S = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
if(S.isEmpty()) if(S.isEmpty())
QAD_CONFIG->addSetting("Geometry:SettingsGeomStep", "100"); QAD_CONFIG->addSetting("Geometry:SettingsGeomStep", "100");
// isos // isos
int count = ActiveStudy->getStudyFramesCount(); int count = ActiveStudy->getStudyFramesCount();
for(int i = 0; i < count; i++) { for(int i = 0; i < count; i++) {
if(ActiveStudy->getStudyFrame(i)->getTypeView() == VIEW_OCC) { if(ActiveStudy->getStudyFrame(i)->getTypeView() == VIEW_OCC) {
@ -703,22 +704,22 @@ bool GeometryGUI::SetSettings()
GUIMap::Iterator it; GUIMap::Iterator it;
for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it ) for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it )
bOk = bOk && it.data()->SetSettings( parent ); bOk = bOk && it.data()->SetSettings( parent );
// MZN: Enable/disable "Clipping range" menu item(from GEOM_CLIPPING variable) // MZN: Enable/disable "Clipping range" menu item(from GEOM_CLIPPING variable)
if (getenv( "GEOM_CLIPPING" ) == NULL) if (getenv( "GEOM_CLIPPING" ) == NULL)
{ {
QMenuItem* mi = Mb->findItem(50); QMenuItem* mi = Mb->findItem(50);
if (mi && mi->popup()) if (mi && mi->popup())
mi->popup()->removeItem(507); mi->popup()->removeItem(507);
} }
return bOk; return bOk;
} }
*/ */
//======================================================================= //=======================================================================
// function : createGeomAction // function : createGeomAction
// purpose : // purpose :
//======================================================================= //=======================================================================
void GeometryGUI::createGeomAction( const int id, const QString& po_id, const QString& icon_id, const int key, const bool toggle ) void GeometryGUI::createGeomAction( const int id, const QString& po_id, const QString& icon_id, const int key, const bool toggle )
{ {
@ -726,7 +727,7 @@ void GeometryGUI::createGeomAction( const int id, const QString& po_id, const QS
QWidget* parent = application()->desktop(); QWidget* parent = application()->desktop();
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
QPixmap pix; QPixmap pix;
if ( icon_id.length() ) if ( icon_id.length() )
pix = resMgr->loadPixmap( "GEOM", tr( icon_id ) ); pix = resMgr->loadPixmap( "GEOM", tr( icon_id ) );
else else
pix = resMgr->loadPixmap( "GEOM", tr( QString( "ICO_" )+po_id ), false ); pix = resMgr->loadPixmap( "GEOM", tr( QString( "ICO_" )+po_id ), false );
@ -829,7 +830,8 @@ 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" );
createGeomAction( 702, "MASS_CENTER" ); createGeomAction( 702, "MASS_CENTER" );
@ -843,7 +845,7 @@ void GeometryGUI::initialize( CAM_Application* app )
createGeomAction( 7072, "CHECK_COMPOUND" ); createGeomAction( 7072, "CHECK_COMPOUND" );
createGeomAction( 5103, "CHECK_GEOMETRY" ); createGeomAction( 5103, "CHECK_GEOMETRY" );
createGeomAction( 412, "SHADING_COLOR" ); createGeomAction( 412, "SHADING_COLOR" );
createGeomAction( 413, "ISOS" ); createGeomAction( 413, "ISOS" );
createGeomAction( 414, "STEP_VALUE" ); createGeomAction( 414, "STEP_VALUE" );
@ -894,124 +896,125 @@ void GeometryGUI::initialize( CAM_Application* app )
createMenu( 4020, basicId, -1 ); createMenu( 4020, basicId, -1 );
int primId = createMenu( tr( "MEN_PRIMITIVES" ), newEntId, -1 ); int primId = createMenu( tr( "MEN_PRIMITIVES" ), newEntId, -1 );
createMenu( 4021, primId, -1 ); createMenu( 4021, primId, -1 );
createMenu( 4022, primId, -1 ); createMenu( 4022, primId, -1 );
createMenu( 4023, primId, -1 ); createMenu( 4023, primId, -1 );
createMenu( 4024, primId, -1 ); createMenu( 4024, primId, -1 );
createMenu( 4025, primId, -1 ); createMenu( 4025, primId, -1 );
int genId = createMenu( tr( "MEN_GENERATION" ), newEntId, -1 ); int genId = createMenu( tr( "MEN_GENERATION" ), newEntId, -1 );
createMenu( 4031, genId, -1 ); createMenu( 4031, genId, -1 );
createMenu( 4032, genId, -1 ); createMenu( 4032, genId, -1 );
createMenu( 4033, genId, -1 ); createMenu( 4033, genId, -1 );
createMenu( 4034, genId, -1 ); createMenu( 4034, genId, -1 );
createMenu( separator(), newEntId, -1 ); createMenu( separator(), newEntId, -1 );
int groupId = createMenu( tr( "MEN_GROUP" ), newEntId, -1 ); int groupId = createMenu( tr( "MEN_GROUP" ), newEntId, -1 );
createMenu( 800, groupId, -1 ); createMenu( 800, groupId, -1 );
createMenu( 801, groupId, -1 ); createMenu( 801, groupId, -1 );
createMenu( separator(), newEntId, -1 ); createMenu( separator(), newEntId, -1 );
int blocksId = createMenu( tr( "MEN_BLOCKS" ), newEntId, -1 ); int blocksId = createMenu( tr( "MEN_BLOCKS" ), newEntId, -1 );
createMenu( 9997, blocksId, -1 ); createMenu( 9997, blocksId, -1 );
createMenu( 9999, blocksId, -1 ); createMenu( 9999, blocksId, -1 );
createMenu( separator(), newEntId, -1 ); createMenu( separator(), newEntId, -1 );
createMenu( 404, newEntId, -1 ); createMenu( 404, newEntId, -1 );
createMenu( separator(), newEntId, -1 ); createMenu( separator(), newEntId, -1 );
createMenu( 407, newEntId, -1 ); createMenu( 407, newEntId, -1 );
int buildId = createMenu( tr( "MEN_BUILD" ), newEntId, -1 ); int buildId = createMenu( tr( "MEN_BUILD" ), newEntId, -1 );
createMenu( 4081, buildId, -1 ); createMenu( 4081, buildId, -1 );
createMenu( 4082, buildId, -1 ); createMenu( 4082, buildId, -1 );
createMenu( 4083, buildId, -1 ); createMenu( 4083, buildId, -1 );
createMenu( 4084, buildId, -1 ); createMenu( 4084, buildId, -1 );
createMenu( 4085, buildId, -1 ); createMenu( 4085, buildId, -1 );
createMenu( 4086, buildId, -1 ); createMenu( 4086, buildId, -1 );
int operId = createMenu( tr( "MEN_OPERATIONS" ), -1, -1, 10 ); int operId = createMenu( tr( "MEN_OPERATIONS" ), -1, -1, 10 );
int boolId = createMenu( tr( "MEN_BOOLEAN" ), operId, -1 ); int boolId = createMenu( tr( "MEN_BOOLEAN" ), operId, -1 );
createMenu( 5011, boolId, -1 ); createMenu( 5011, boolId, -1 );
createMenu( 5012, boolId, -1 ); createMenu( 5012, boolId, -1 );
createMenu( 5013, boolId, -1 ); createMenu( 5013, boolId, -1 );
createMenu( 5014, boolId, -1 ); createMenu( 5014, boolId, -1 );
int transId = createMenu( tr( "MEN_TRANSFORMATION" ), operId, -1 ); int transId = createMenu( tr( "MEN_TRANSFORMATION" ), operId, -1 );
createMenu( 5021, transId, -1 ); createMenu( 5021, transId, -1 );
createMenu( 5022, transId, -1 ); createMenu( 5022, transId, -1 );
createMenu( 5023, transId, -1 ); createMenu( 5023, transId, -1 );
createMenu( 5024, transId, -1 ); createMenu( 5024, transId, -1 );
createMenu( 5025, transId, -1 ); createMenu( 5025, transId, -1 );
createMenu( 5026, transId, -1 ); createMenu( 5026, transId, -1 );
createMenu( separator(), transId, -1 ); createMenu( separator(), transId, -1 );
createMenu( 5027, transId, -1 ); createMenu( 5027, transId, -1 );
createMenu( 5028, transId, -1 ); createMenu( 5028, transId, -1 );
createMenu( 503, operId, -1 ); createMenu( 503, operId, -1 );
createMenu( 504, operId, -1 ); createMenu( 504, operId, -1 );
createMenu( separator(), operId, -1 ); createMenu( separator(), operId, -1 );
createMenu( 505, transId, -1 ); createMenu( 505, transId, -1 );
createMenu( 506, transId, -1 ); createMenu( 506, transId, -1 );
//createMenu( 507, transId, -1 ); //createMenu( 507, transId, -1 );
int blockId = createMenu( tr( "MEN_BLOCKS" ), operId, -1 ); int blockId = createMenu( tr( "MEN_BLOCKS" ), operId, -1 );
createMenu( 9998, blockId, -1 ); createMenu( 9998, blockId, -1 );
createMenu( 9995, blockId, -1 ); createMenu( 9995, blockId, -1 );
createMenu( 99991, blockId, -1 ); createMenu( 99991, blockId, -1 );
int repairId = createMenu( tr( "MEN_REPAIR" ), -1, -1, 10 ); int repairId = createMenu( tr( "MEN_REPAIR" ), -1, -1, 10 );
createMenu( 605, repairId, -1 ); createMenu( 605, repairId, -1 );
createMenu( 603, repairId, -1 ); createMenu( 603, repairId, -1 );
createMenu( 606, repairId, -1 ); createMenu( 606, repairId, -1 );
createMenu( 607, repairId, -1 ); createMenu( 607, repairId, -1 );
createMenu( 604, repairId, -1 ); createMenu( 604, repairId, -1 );
createMenu( 601, repairId, -1 ); createMenu( 601, repairId, -1 );
createMenu( 602, repairId, -1 ); createMenu( 602, repairId, -1 );
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 );
createMenu( 701, measurId, -1 ); createMenu( 701, measurId, -1 );
createMenu( separator(), measurId, -1 ); createMenu( separator(), measurId, -1 );
createMenu( 702, measurId, -1 ); createMenu( 702, measurId, -1 );
createMenu( 703, measurId, -1 ); createMenu( 703, measurId, -1 );
createMenu( separator(), measurId, -1 ); createMenu( separator(), measurId, -1 );
int dimId = createMenu( tr( "MEN_DIMENSIONS" ), measurId, -1 ); int dimId = createMenu( tr( "MEN_DIMENSIONS" ), measurId, -1 );
createMenu( 7041, dimId, -1 ); createMenu( 7041, dimId, -1 );
createMenu( 7042, dimId, -1 ); createMenu( 7042, dimId, -1 );
createMenu( separator(), measurId, -1 ); createMenu( separator(), measurId, -1 );
createMenu( 705, measurId, -1 ); createMenu( 705, measurId, -1 );
createMenu( separator(), measurId, -1 ); createMenu( separator(), measurId, -1 );
createMenu( 706, measurId, -1 ); createMenu( 706, measurId, -1 );
createMenu( 707, measurId, -1 ); createMenu( 707, measurId, -1 );
createMenu( 7072, measurId, -1 ); createMenu( 7072, measurId, -1 );
int toolsId = createMenu( tr( "MEN_TOOLS" ), -1, -1, 50 ); int toolsId = createMenu( tr( "MEN_TOOLS" ), -1, -1, 50 );
createMenu( separator(), toolsId, -1 ); createMenu( separator(), toolsId, -1 );
createMenu( 5103, toolsId, -1 ); createMenu( 5103, toolsId, -1 );
//int prefId = createMenu( tr( "MEN_PREFERENCES" ), -1, -1, 50 ); //int prefId = createMenu( tr( "MEN_PREFERENCES" ), -1, -1, 50 );
//createMenu( separator(), prefId, -1 ); //createMenu( separator(), prefId, -1 );
//int geomId = createMenu( tr( "MEN_PREFERENCES_GEOM" ), prefId, -1 ); //int geomId = createMenu( tr( "MEN_PREFERENCES_GEOM" ), prefId, -1 );
//createMenu( 412, geomId, -1 ); //createMenu( 412, geomId, -1 );
//createMenu( 413, geomId, -1 ); //createMenu( 413, geomId, -1 );
//createMenu( 414, geomId, -1 ); //createMenu( 414, geomId, -1 );
//createMenu( separator(), prefId, -1 ); //createMenu( separator(), prefId, -1 );
int viewId = createMenu( tr( "MEN_VIEW" ), -1, -1 ); int viewId = createMenu( tr( "MEN_VIEW" ), -1, -1 );
createMenu( separator(), viewId, -1 ); createMenu( separator(), viewId, -1 );
int dispmodeId = createMenu( tr( "MEN_DISPLAY_MODE" ), viewId, -1 ); int dispmodeId = createMenu( tr( "MEN_DISPLAY_MODE" ), viewId, -1 );
createMenu( 211, dispmodeId, -1 ); createMenu( 211, dispmodeId, -1 );
createMenu( separator(), viewId, -1 ); createMenu( separator(), viewId, -1 );
createMenu( 212, viewId, -1 ); createMenu( 212, viewId, -1 );
createMenu( 214, viewId, -1 ); createMenu( 214, viewId, -1 );
createMenu( separator(), viewId, -1 ); createMenu( separator(), viewId, -1 );
/* /*
@ -1019,8 +1022,8 @@ void GeometryGUI::initialize( CAM_Application* app )
because of these items are accessible through object browser and viewers because of these items are accessible through object browser and viewers
we have removed they from main menu we have removed they from main menu
createMenu( 216, viewId, -1 ); createMenu( 216, viewId, -1 );
createMenu( 213, viewId, -1 ); createMenu( 213, viewId, -1 );
createMenu( 215, viewId, -1 ); createMenu( 215, viewId, -1 );
*/ */
@ -1039,59 +1042,63 @@ void GeometryGUI::initialize( CAM_Application* app )
createTool( 4020, basicTbId ); createTool( 4020, basicTbId );
int primTbId = createTool( tr( "TOOL_PRIMITIVES" ) ); int primTbId = createTool( tr( "TOOL_PRIMITIVES" ) );
createTool( 4021, primTbId ); createTool( 4021, primTbId );
createTool( 4022, primTbId ); createTool( 4022, primTbId );
createTool( 4023, primTbId ); createTool( 4023, primTbId );
createTool( 4024, primTbId ); createTool( 4024, primTbId );
createTool( 4025, primTbId ); createTool( 4025, primTbId );
int boolTbId = createTool( tr( "TOOL_BOOLEAN" ) ); int boolTbId = createTool( tr( "TOOL_BOOLEAN" ) );
createTool( 5011, boolTbId ); createTool( 5011, boolTbId );
createTool( 5012, boolTbId ); createTool( 5012, boolTbId );
createTool( 5013, boolTbId ); createTool( 5013, boolTbId );
createTool( 5014, boolTbId ); createTool( 5014, boolTbId );
int genTbId = createTool( tr( "TOOL_GENERATION" ) ); int genTbId = createTool( tr( "TOOL_GENERATION" ) );
createTool( 4031, genTbId ); createTool( 4031, genTbId );
createTool( 4032, genTbId ); createTool( 4032, genTbId );
createTool( 4033, genTbId ); createTool( 4033, genTbId );
createTool( 4034, genTbId ); createTool( 4034, genTbId );
int transTbId = createTool( tr( "TOOL_TRANSFORMATION" ) ); int transTbId = createTool( tr( "TOOL_TRANSFORMATION" ) );
createTool( 5021, transTbId ); createTool( 5021, transTbId );
createTool( 5022, transTbId ); createTool( 5022, transTbId );
createTool( 5023, transTbId ); createTool( 5023, transTbId );
createTool( 5024, transTbId ); createTool( 5024, transTbId );
createTool( 5025, transTbId ); createTool( 5025, transTbId );
createTool( 5026, transTbId ); createTool( 5026, transTbId );
createTool( separator(), transTbId ); createTool( separator(), transTbId );
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 );
@ -1178,14 +1185,20 @@ bool GeometryGUI::deactivateModule( SUIT_Study* study )
setMenuShown( false ); setMenuShown( false );
setToolShown( false ); setToolShown( false );
disconnect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ), disconnect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) ); this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
EmitSignalCloseAllDialogs(); EmitSignalCloseAllDialogs();
GUIMap::Iterator it; GUIMap::Iterator it;
for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it ) for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it )
it.data()->deactivate(); it.data()->deactivate();
// Unset actions accelerator keys
//action(111)->setAccel(QKeySequence()); // Import
//action(121)->setAccel(QKeySequence()); // Export
action(111)->setEnabled(false); // Import
action(121)->setEnabled(false); // Export
// Unset actions accelerator keys // Unset actions accelerator keys
//action(111)->setAccel(QKeySequence()); // Import //action(111)->setAccel(QKeySequence()); // Import
@ -1279,7 +1292,7 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr
if( nbSel == 0 ) { if( nbSel == 0 ) {
////// NOTHING SELECTED ////// NOTHING SELECTED
popup->clear(); popup->clear();
} }
else if ( nbSel == 1 ) { else if ( nbSel == 1 ) {
////// SINGLE OBJECT SELECTION ////// SINGLE OBJECT SELECTION
if ( parentComponent != parent->getActiveComponent() ) { if ( parentComponent != parent->getActiveComponent() ) {
@ -1506,7 +1519,7 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr
//======================================================================= //=======================================================================
// function : GeometryGUI::BuildPresentation() // function : GeometryGUI::BuildPresentation()
// purpose : // purpose :
//======================================================================= //=======================================================================
void GeometryGUI::BuildPresentation( const Handle(SALOME_InteractiveObject)& io, SUIT_ViewWindow* win ) void GeometryGUI::BuildPresentation( const Handle(SALOME_InteractiveObject)& io, SUIT_ViewWindow* win )
{ {
@ -1524,7 +1537,7 @@ void GeometryGUI::onWindowActivated( SUIT_ViewWindow* win )
const bool ViewOCC = ( win->getViewManager()->getType() == OCCViewer_Viewer::Type() ); const bool ViewOCC = ( win->getViewManager()->getType() == OCCViewer_Viewer::Type() );
// const bool ViewVTK = ( win->getViewManager()->getType() == SVTK_Viewer::Type() ); // const bool ViewVTK = ( win->getViewManager()->getType() == SVTK_Viewer::Type() );
// disable non-OCC viewframe menu commands // disable non-OCC viewframe menu commands
// action( 404 )->setEnabled( ViewOCC ); // SKETCHER // action( 404 )->setEnabled( ViewOCC ); // SKETCHER
action( 603 )->setEnabled( ViewOCC ); // SuppressFace action( 603 )->setEnabled( ViewOCC ); // SuppressFace
@ -1645,34 +1658,60 @@ 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;
aModesList.append( tr("MEN_WIREFRAME") ); aModesList.append( tr("MEN_WIREFRAME") );
aModesList.append( tr("MEN_SHADING") ); aModesList.append( tr("MEN_SHADING") );
QValueList<QVariant> anIndexesList; QValueList<QVariant> anIndexesList;
anIndexesList.append(0); anIndexesList.append(0);
anIndexesList.append(1); anIndexesList.append(1);
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

@ -1,23 +1,23 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// 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,23 +30,44 @@
#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);
bool initGeomGen(); bool initGeomGen();
}; };

View File

@ -1,36 +1,42 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful // This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// 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
// //
#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;

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