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 \
chamferedge.png \
chamferface.png \
change_orientation.png \
check.png \
circle.png \
circlepointvector.png \
@ -122,6 +123,7 @@ point2.png \
pointonedge.png \
polyline.png \
prism.png \
prism2.png \
revol.png \
rotate.png \
scale.png \

View File

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

View File

@ -23,11 +23,15 @@ AC_CANONICAL_HOST
PACKAGE=salome
AC_SUBST(PACKAGE)
VERSION=3.2.0
XVERSION=0x030200
VERSION=3.2.2
XVERSION=0x030202
AC_SUBST(VERSION)
AC_SUBST(XVERSION)
# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
MODULE_NAME=geom
AC_SUBST(MODULE_NAME)
dnl
dnl Initialize source and build root directories
dnl
@ -325,7 +329,7 @@ else
fi
# make other build directories
for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources idl
for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources/${MODULE_NAME} idl
do
# if test ! -d $rep ; then
# eval mkdir $rep

View File

@ -15,6 +15,7 @@ if (navigator.appName !="Netscape")
<style type="text/css">
<!--
p.whs1 { font-family:'Lucida Console' , monospace; }
p.whs2 { font-family:'Times New Roman' , serif; }
-->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
@ -79,15 +80,18 @@ if (window.writeIntopicBar)
<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">&nbsp;</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.,
25., 50.)</p>
@ -98,9 +102,13 @@ if (window.writeIntopicBar)
<p class="whs1">p_25_50_25 = geompy.MakeVertex(25.,
50., 25.)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">box = geompy.MakeBoxDXDYDZ(50,
50, 50)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">top_face = geompy.GetFaceNearPoint(box,
p_25_25_50)</p>
@ -110,18 +118,21 @@ if (window.writeIntopicBar)
<p class="whs1">xz_face = geompy.GetFaceNearPoint(box,
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>
<p class="whs1">yz_face_ind = geompy.LocalOp.GetSubShapeIndex(box,
<p class="whs1">yz_face_ind = geompy.GetSubShapeID(box,
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>
<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,
yz_face_ind, top_face_ind, 3)</p>
@ -129,9 +140,10 @@ if (window.writeIntopicBar)
<p class="whs1">box_tr2 = geompy.MakeMultiTransformation2D(box,
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,
&quot;Box&quot;)</p>
@ -142,9 +154,9 @@ if (window.writeIntopicBar)
<p class="whs1">id_box_tr2 = geompy.addToStudy(box_tr2,
&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>
@ -152,10 +164,10 @@ if (window.writeIntopicBar)
<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>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<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">&nbsp;</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,
200, 200)</p>
@ -176,31 +191,38 @@ if (window.writeIntopicBar)
<p class="whs1">&nbsp;</p>
<p># make a compound</p>
<p class="whs2"># make a compound</p>
<p class="whs1">compound = geompy.MakeCompound([box,
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
= 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,
&quot;Compound&quot;)</p>
<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>
@ -217,42 +239,45 @@ if (window.writeIntopicBar)
<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,
200, 200)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># check and improve</p>
<p class="whs1">check_box = geompy.CheckAndImprove(box)</p>
<p>&nbsp;&nbsp;</p>
<p># build all possible propagation groups</p>
<p class="whs2"># build all possible
propagation groups</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,
&quot;Box&quot;)</p>
<p class="whs1">ii = 1</p>
<p class="whs1">for chain in listChains:</p>
<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>
<p>&nbsp;</p>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)

View File

@ -104,8 +104,9 @@ if (window.writeIntopicBar)
<p>&nbsp;</p>
<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
opposite corners), and with edges, parallel to the coordinate axes. </p>
by two specified <span style="font-weight: bold;"><B>Vertices </B></span>(its
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
:</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">
<!--
p.whs1 { font-family:'Lucida Console' , monospace; }
p.whs2 { font-family:'Times New Roman' , serif; }
-->
</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>
<p>&nbsp;</p>
<h3>Hexagonal Solid</h3>
<p class="whs1">import geompy</p>
@ -210,120 +209,141 @@ if (window.writeIntopicBar)
<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(
&nbsp;0., &nbsp;&nbsp;0.,
<p class="whs1">p0 &nbsp;=
geompy.MakeVertex( &nbsp;0.,
&nbsp;&nbsp;0.,
&nbsp;&nbsp;0.)</p>
<p class="whs1">p2 = geompy.MakeVertex(150.,
&nbsp;30., &nbsp;&nbsp;0.)</p>
<p class="whs1">p1 &nbsp;=
geompy.MakeVertex( &nbsp;0.,
&nbsp;&nbsp;0.,
&nbsp;40.)</p>
<p class="whs1">p3 = geompy.MakeVertex(
&nbsp;0., 120.,
&nbsp;50.)</p>
<p class="whs1">p2 &nbsp;=
geompy.MakeVertex( 70., -15., &nbsp;&nbsp;0.)</p>
<p class="whs1">p4 = geompy.MakeVertex(
&nbsp;0., &nbsp;40.,
<p class="whs1">p3 &nbsp;=
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>
<p class="whs1">p5 = geompy.MakeVertex(100.,
&nbsp;20., &nbsp;45.)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">p6 = geompy.MakeVertex(
&nbsp;0., 70.,
&nbsp;40.)</p>
<p class="whs1">p8 &nbsp;=
geompy.MakeVertex( &nbsp;0.,
-50., &nbsp;&nbsp;0.)</p>
<p class="whs1">p7 = geompy.MakeVertex(
70., 70., &nbsp;70.)</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">p9 &nbsp;=
geompy.MakeVertex( &nbsp;0.,
-50., &nbsp;40.)</p>
<p class="whs1">p10 = geompy.MakeVertex(
&nbsp;0., 70.,
&nbsp;&nbsp;0.)</p>
70., -35., &nbsp;&nbsp;0.)</p>
<p class="whs1">p11 = geompy.MakeVertex(
70., 70., &nbsp;&nbsp;0.)</p>
70., -35., &nbsp;70.)</p>
<p class="whs1">p12 = geompy.MakeVertex(
70., -15., &nbsp;&nbsp;0.)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">p13 = geompy.MakeVertex(
&nbsp;0., &nbsp;0.,
&nbsp;&nbsp;0.)</p>
<p class="whs2"># create faces</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,
p2, p3, p4)</p>
<p class="whs1">qface3 = geompy.MakeQuad4Vertices(p0,
p1, p4, p5)</p>
<p class="whs1">qface2 = geompy.MakeQuad4Vertices(p1,
p2, p5, p4)</p>
<p class="whs1">qface4 = geompy.MakeQuad4Vertices(p2,
p3, p6, p7)</p>
<p class="whs1">qface3 = geompy.MakeQuad4Vertices(p13,
p12, p11, p10)</p>
<p class="whs1">qface5 = geompy.MakeQuad4Vertices(p0,
p2, p4, p6)</p>
<p class="whs1">qface4 = geompy.MakeQuad4Vertices(p9,
p8, p7, p6)</p>
<p class="whs1">qface6 = geompy.MakeQuad4Vertices(p1,
p3, p5, p7)</p>
<p class="whs1">qface5 = geompy.MakeQuad4Vertices(p13,
p9, p6, p10)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">qface6 = geompy.MakeQuad4Vertices(p13,
p9, p8, p12)</p>
<p class="whs1">qface7 = geompy.MakeQuad4Vertices(p8,
p9, p10, p11)</p>
<p class="whs1">qface7 = geompy.MakeQuad4Vertices(p12,
p8, p7, p11)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">qface8 = geompy.MakeQuad4Vertices(p11,
p7, p6, p10)</p>
<p>&nbsp;</p>
<p># create a hexahedral solid between two given faces</p>
<p class="whs2"># create a hexahedral
solid between two given faces</p>
<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,
qface4, qface5, qface6, qface7, qface8)</p>
<p class="whs1">solid2 = geompy.MakeHexa(qface1,
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_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.setDisplayMode(id_solid1,1)</p>
<p class="whs1">gg.setDisplayMode(id_solid1,
1)</p>
<p class="whs1">gg.createAndDisplayGO(id_solid2)</p>
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_solid2,1)</span>
</p>
<p>&nbsp;</p>
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_solid2,
1)</span> </p>
<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; }
p.whs2 { font-size:12pt; }
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.whs6 { font-size:12pt; font-style:italic; margin-left:40px; }
img_whs7 { border:none; float:none; width:300px; height:175px; border-style:none; }
img_whs8 { border:none; width:350px; height:175px; float:none; border-style:none; }
p.whs6 { font-size:12pt; margin-left:40px; font-weight:normal; font-style:italic; }
img_whs7 { border:none; width:400px; height:359px; 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">
<!--
@ -92,10 +94,13 @@ if (window.writeIntopicBar)
<p class="whs2">&nbsp;</p>
<p class="whs2">To create an Extrusion (Prism) you should 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>
<p>There are 2 algorithms for creation of <span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">an
Extrusion (Prism)</font></span>. </p>
<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>
<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 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="whs5">NB! <span style="font-weight: normal;">The
is another way to create an</span> Extrusion, <span style="font-weight: normal;">which
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
<p class="whs5"><span style="font-weight: normal;">Secondly,
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
style="font-weight: normal;"> and </span>End Point<span style="font-weight: normal;">
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,
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 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">&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>

View File

@ -3,7 +3,7 @@
<html>
<head>
<title>Titre</title>
<title>Using Boolean Operations</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">
@ -98,7 +98,7 @@ if (window.writeIntopicBar)
writeIntopicBar(4);
//-->
</script>
<h1 class="whs1">Using boolean operations</h1>
<h1 class="whs1">Using Boolean Operations</h1>
<p class="whs2">&nbsp;</p>

View File

@ -3,7 +3,7 @@
<html>
<head>
<title>Titre</title>
<title>Importing and exporting geometrical objects</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">

View File

@ -3,7 +3,7 @@
<html>
<head>
<title>Titre</title>
<title>Using Measurement Tools</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">
@ -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; }
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_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; }
img_whs22 { border:none; width:25px; height:23px; border-style:none; }
ul.whs23 { list-style:disc; }
@ -174,16 +174,14 @@ if (window.writeIntopicBar)
<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>
Returns the coordinates of a point.</font></span></p>
<p class="whs1"><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">Returns the
coordinates of a point.</font></span></p>
<p class="whs1">&nbsp;</p>
<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>
<p class="whs1">&nbsp;</p>
<p class="whs1"><span style="font-weight: bold;"><B>TUI command:</B></span>
<span style="font-style: italic;"><I>geompy.PointCoordinates(Point)</I></span>,
where Point is a point whose coordinates are inquired.</p>
@ -203,17 +201,14 @@ if (window.writeIntopicBar)
<p class="whs9">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b>
Return the properties (Length, Surface &amp; Volume) of a definite geometrical
object.</p>
<p class="whs1">Returns the properties (Length, Surface &amp;
Volume) for the selected geometrical object.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Result:</b> Display
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>
<span style="font-style: italic;"><I>geompy.BasicProperties(Shape)</I></span>,
where Shape is a shape whose properties are inquired.</p>
@ -232,16 +227,14 @@ if (window.writeIntopicBar)
<p class="whs9">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b>
Creates a gravity center of a shape and returns its coordinates.</p>
<p class="whs1">Calculates and returns the coordinates of the
gravity center for the selected geometrical object.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Result:</b> GEOM_Object
(vertex).</p>
<p class="whs1">&nbsp;</p>
<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
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="whs1"><b style="font-weight: bold;">Description:</b>
Returns the inertia axis of a geometrical object.</p>
<p class="whs1">Returns the axis of inertia for the selected
geometrical object.</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,
I13, </p>
@ -301,8 +294,8 @@ if (window.writeIntopicBar)
<p class="whs7">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b>
Returns the dimensions of the bounding box of a geometrical object.</p>
<p class="whs1">Returns the dimensions of the bounding box
for the selected geometrical object.</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
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
style="font-weight: normal;">, where Shape is a shape for which a bounding
box is computed.</span></p>
@ -330,13 +321,8 @@ if (window.writeIntopicBar)
<p class="whs7">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b>
Returns the min. distance between 2 geometrical 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">Returns the minimum distance between two geometrical
objects.</p>
<p class="whs1">&nbsp;</p>
@ -358,8 +344,8 @@ if (window.writeIntopicBar)
<p class="whs9">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b>
Returns the tolerance of a geometrical object.</p>
<p class="whs1">Returns the maximum and the minimum tolerance
for the selected geometrical object.</p>
<p class="whs1">&nbsp;</p>
@ -367,8 +353,6 @@ if (window.writeIntopicBar)
the tolerance values (FaceMinTol, FaceMaxTol, EgdeMinTol, EgdeMaxTol,
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
style="font-weight: normal;">, where Shape is a shape for which minimal
and maximal tolerances are returned.</span></p>
@ -387,13 +371,8 @@ if (window.writeIntopicBar)
<p class="whs9">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b>
Returns the type of a 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">Displays types and quantities of all elements
composing the selected geometrical object.</p>
<p class="whs1">&nbsp;</p>
@ -416,24 +395,21 @@ if (window.writeIntopicBar)
<p class="whs7">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b>
Returns True if this geometrical object is valid.</p>
<p class="whs1">Checks the topology of the selected geometrical
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"><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>
</i><span style="font-style: italic;"><I>geompy.CheckShape(Shape)</I></span>,
where is shape which is checked for validity.</p>
</i><span style="font-style: italic;"><I>geompy.(theShape, theIsCheckGeom
= 0)</I></span>, where is shape which is checked for validity.</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">&nbsp;</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="whs21">&nbsp;</p>
@ -444,9 +420,9 @@ if (window.writeIntopicBar)
<p class="whs21">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">Description:</b>
Checks whether a shape is a compound of glued blocks. To be considered
as a compound of blocks, the given shape must satisfy the following conditions:</p>
<p class="whs1">Checks whether a shape is a compound of glued
blocks. To be considered as a compound of blocks, the given shape must
satisfy the following conditions:</p>
<ul type="disc" class="whs23">
@ -485,8 +461,6 @@ if (window.writeIntopicBar)
<p class="whs1"><b style="font-weight: bold;">Result:</b> Boolean;
highlight in the viewer.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><b style="font-weight: bold;">TUI Command:</b><i>
</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

View File

@ -17,7 +17,7 @@ if (navigator.appName !="Netscape")
img_whs1 { width:20px; height:20px; border-style:none; }
p.whs2 { font-size:12pt; }
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; }
-->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
@ -80,7 +80,7 @@ if (window.writeIntopicBar)
//-->
</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
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
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">To create a curving face using several curves
you need to define the <span style="font-weight: bold;"><B>Curves</B></span>,
which will be the components of your face, <span style="font-weight: bold;"><B>Minimum</B></span>
<p class="whs2">To create a curving face using several edges
you need to define the <span style="font-weight: bold;"><B>Edges Compound,</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
</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
@ -115,7 +115,7 @@ if (window.writeIntopicBar)
<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>

View File

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

View File

@ -491,88 +491,73 @@ if (window.writeIntopicBar)
<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">&nbsp;</p>
<p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</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(
0., &nbsp;0.,
&nbsp;0.)</p>
<p class="whs1">p1 = geompy.MakeVertex(
&nbsp;-30., &nbsp;-30.,
&nbsp;50.)</p>
<p class="whs1">pz = geompy.MakeVertex(
0., &nbsp;0.,
40.)</p>
<p class="whs1">p2 = geompy.MakeVertex(
&nbsp;-60., &nbsp;-60.,
&nbsp;30.)</p>
<p class="whs1">p3 = geompy.MakeVertex(
&nbsp;-30., &nbsp;-30.,
&nbsp;10.)</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
-50 -50:TT 100 -50:R 0:C 50 70:R 0:L 100:WW&quot;)</p>
<p class="whs1">arc = geompy.MakeArc(p1,
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="whs2"># create faces from two
wires</p>
<p class="whs2"># create a compund of
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="whs2"># create a prism</p>
<p class="whs2"># add object in the study</p>
<p class="whs1">prism = geompy.MakePrism(face,
p0, pz)</p>
<p class="whs1">id_compound = geompy.addToStudy(compound,&quot;Compound&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># explode the prism into
faces</p>
<p class="whs2"># display the compound</p>
<p class="whs1">prism_faces = geompy.SubShapeAllSorted(prism,
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 class="whs1">gg.createAndDisplayGO(id_compound)
</p>
<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="whs6">Secondly, you can simply
select a point in the object browser or 3D viewer, in this case the coordinates
of origin are automatically filled in with the coordinates of the selected
point and X and Y axes direction will be parallel to the X and Y direction
of the Global CS. &nbsp;</p>
select any object in the object browser or 3D viewer, in this case the
coordinates of origin and axes direction of the LCS are calculated automatically
basing on the selected object. </p>
<p class="whs6"><b style="font-weight: bold;">Arguments:
</b>Name + reference object.</p>
@ -146,9 +145,9 @@ if (window.writeIntopicBar)
<p class="whs2">&nbsp;</p>
<p class="whs2">The last algorithm also presumes that you select
a point in the object browser or 3D viewer, but in this case you define
X and Y axes direction yourselves. </p>
<p class="whs2">The last algorithm of LCS construction allows
to define the coordinates of origin by a point and axes directions by
a line or a vector. </p>
<p class="whs8"><b style="font-weight: bold;">Arguments:</b>
<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>
<p class="whs1">import math</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,
23, 80)</p>
<p class="whs1">point = geompy.MakeVertex(15.,
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">if coords[0] != 15
or coords[1] != 23 or coords[2] != 80 :</p>
<p class="whs1">&nbsp;</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
&quot;Coordinates of point must be (15, 23, 80), but returned (&quot;,
coords[0], &quot;, &quot;, coords[1], &quot;, &quot;, coords[2], &quot;)&quot;</p>
&quot;All values are OK.&quot;</p>
<p class="whs1">else :</p>
<p><span style="font-family: 'Lucida Console', monospace;">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;All values are OK.&quot;</span> </p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;print
&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>

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>
in the <span style="font-weight: bold;"><B>Main Menu</B></span> select <span
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>

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; }
p.whs5 { font-size:12pt; font-weight:bold; }
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; }
col.whs9 { width:32.089%; }
col.whs10 { width:32.008%; }
@ -100,7 +100,7 @@ if (window.writeIntopicBar)
<p>&nbsp;</p>
<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
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>
by three <span style="font-weight: bold;"><B>Points </B></span>through which
&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
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">Finally, you can define a <span style="font-weight: bold;"><B>Plane</B></span>,
similar to the existing one, but with another size of representing face.
</p>
<p class="whs2">Finally, you can define a <span style="font-weight: bold;"><B>Plane
</B></span>by another <span style="font-weight: bold;"><B>Plane</B></span> or <span
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
Command:</b> </B></span>geompy.MakePlaneFace(Face, TrimSize) </p>
<p class="whs2"><b style="font-weight: bold;">Arguments: </b>Name
+ 1 face + 1 value (to define the size of the plane).</p>
<p class="whs2"><b>Arguments: </b>Name + 1 face + 1 value (to
define the size of the plane).</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>

View File

@ -143,50 +143,62 @@ if (window.writeIntopicBar)
<p class="whs1">import salome</p>
<p class="whs1">&nbsp;</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 class="whs1">p1 = geompy.MakeVertex(35,
35, 0)</p>
<p class="whs1">p1 = geompy.MakeVertex(25,
35, 45)</p>
<p class="whs1">p2 = geompy.MakeVertex(35,
35, 70)</p>
<p class="whs1">p2 = geompy.MakeVertex(70,
70, 70)</p>
<p class="whs1">v = geompy.MakeVector(p1,
p2)</p>
<p>&nbsp;</p>
<p># create cones</p>
<p># create cylinders</p>
<p class="whs1">cone1 = geompy.MakeCone(p1,
v, 17, 1, 20)</p>
<p class="whs1">height = 40</p>
<p class="whs1">cone2 = geompy.MakeConeR1R2H(30,
10, 30)</p>
<p class="whs1">&nbsp;</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># 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># 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>&nbsp;</p>

View File

@ -81,11 +81,13 @@ if (window.writeIntopicBar)
</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>
<p><b><span style="font-weight: normal;">T</b>o</span> <span style="font-size: 12pt;"><font size=3 style="font-size:12pt;">create
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>
in the <span style="font-weight: bold;"><B>Main Menu</B></span> select <span
style="font-weight: bold;"><B>New Entity - &gt; Generation &nbsp;-
&gt; Revolution</B></span></p>
<p><b><span style="font-weight: normal;">T</span></b><b><span style="font-weight: normal;">o</span>
<span style="font-weight: normal; font-size: 12pt;"><font size=3 style="font-size:12pt;">create an extruded
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: normal;"> in the </span><span style="font-weight: bold;"><B>Main
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>

View File

@ -15,6 +15,7 @@ if (navigator.appName !="Netscape")
<style type="text/css">
<!--
p.whs1 { font-family:'Lucida Console' , monospace; }
p.whs2 { font-family:'Times New Roman' , serif; }
-->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
@ -347,7 +348,7 @@ if (window.writeIntopicBar)
<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>
<p class="whs1">p1 = geompy.MakeVertex(
@ -367,7 +368,7 @@ if (window.writeIntopicBar)
<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>
<p class="whs1">p4 = geompy.MakeVertex(
@ -384,7 +385,7 @@ if (window.writeIntopicBar)
<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>
<p class="whs1">mirror3 = geompy.MakeMirrorByPoint(box,
@ -450,18 +451,22 @@ if (window.writeIntopicBar)
<p class="whs1">import salome</p>
<p class="whs1">&nbsp;</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,
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,
100, 100)</p>
@ -471,9 +476,10 @@ if (window.writeIntopicBar)
<p class="whs1">scale = geompy.MakeScaleTransform(box,
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,
&quot;Box&quot;)</p>
@ -481,14 +487,16 @@ if (window.writeIntopicBar)
<p class="whs1">id_scale = geompy.addToStudy(scale,
&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.setDisplayMode(id_box,1)</p>
<p class="whs1">gg.setTransparency(id_box,0.5)</p>
<p class="whs1">gg.createAndDisplayGO(id_scale)</p>
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_scale,1)</span>

View File

@ -22,6 +22,7 @@ aTE("Boolean Operations","boolean_operations.htm");
aTE("Box","box.htm");
aTE("Building by Blocks","building_by_blocks.htm");
aTE("Chamfer","chamfer.htm");
aTE("Change Orientation","change_orientation.htm");
aTE("Changing Display Parameters","changing_display_parameters.htm");
aTE("Check Free Boundaries","check_free_boundaries.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("Face","face.htm");
aTE("Introduction to GEOM","files/introduction_to_geom.htm");
aTE("Titre","files/salome2_sp3_booleangui_functions.htm");
aTE("Titre","files/salome2_sp3_geomtoolsgui_functions.htm");
aTE("Titre","files/salome2_sp3_measuregui_functions.htm");
aTE("Using Boolean Operations","files/salome2_sp3_booleangui_functions.htm");
aTE("Importing and exporting geometrical objects","files/salome2_sp3_geomtoolsgui_functions.htm");
aTE("Using Measurement Tools","files/salome2_sp3_measuregui_functions.htm");
aTE("Fillet","fillet.htm");
aTE("Filling","filling.htm");
aTE("Fuse","fuse.htm");

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
<script language="javascript" src="whtdata.js"></script>
<script language="javascript">
<!--
aTE(1,97,"Geometry module");
aTE(1,98,"Geometry module");
aTE(2,0,"Introduction to Geometry","geometry.htm");
aTE(2,0,"Importing/exporting geometrical objects","files/salome2_sp3_geomtoolsgui_functions.htm");
aTE(1,33,"Creating geometrical objects");
@ -33,7 +33,7 @@
aTE(2,0,"Extrusion","extrusion.htm");
aTE(2,0,"Revolution","revolution.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,"Building by blocks","newentity_blocks.htm");
aTE(2,0,"Sketcher","sketcher.htm");
@ -52,7 +52,7 @@
aTE(2,0,"Color","color.htm");
aTE(2,0,"Transparency","transparency.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(2,0,"Partition","partition.htm");
aTE(2,0,"Archimede","archimede.htm");
@ -77,7 +77,7 @@
aTE(2,0,"Multi Transformation","multi_transformation.htm");
aTE(2,0,"Explode on Blocks","explode_on_blocks.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,"Suppress Faces","suppress_faces.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,"Check Free Boundaries","check_free_boundaries.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,"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(2,0,"Viewing Geometrical Objects","changing_display_parameters.htm");
aTE(1,7,"Creating Geometric Objects");

View File

@ -49,7 +49,7 @@ img {vertial-align:middle;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a name="15"></a><a href="whlstt15.htm#15" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Creating Geometric Objects</a></nobr><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a name="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="../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>
</td></tr>

View File

@ -10,6 +10,7 @@
<topic name="Box" url="box.htm" />
<topic name="Building by Blocks" url="building_by_blocks.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="Check Free Boundaries" url="check_free_boundaries.htm" />
<topic name="Check Free Faces" url="check_free_faces.htm" />
@ -30,9 +31,9 @@
<topic name="Extrusion" url="extrusion.htm" />
<topic name="Face" url="face.htm" />
<topic name="Introduction to GEOM" url="files/introduction_to_geom.htm" />
<topic name="Titre" url="files/salome2_sp3_booleangui_functions.htm" />
<topic name="Titre" url="files/salome2_sp3_geomtoolsgui_functions.htm" />
<topic name="Titre" url="files/salome2_sp3_measuregui_functions.htm" />
<topic name="Using Boolean Operations" url="files/salome2_sp3_booleangui_functions.htm" />
<topic name="Importing and exporting geometrical objects" url="files/salome2_sp3_geomtoolsgui_functions.htm" />
<topic name="Using Measurement Tools" url="files/salome2_sp3_measuregui_functions.htm" />
<topic name="Fillet" url="fillet.htm" />
<topic name="Filling" url="filling.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="Revolution" url="revolution.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>
<item name="Working with groups" url="working_with_groups.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="Check Free Boundaries" url="check_free_boundaries.htm" />
<item name="Check Free Faces" url="check_free_faces.htm" />
<item name="Change Orientation" url="change_orientation.htm" />
</book>
</book>
<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" >
<item name="Viewing Geometrical Objects" url="changing_display_parameters.htm" />
<book name="Creating Geometric Objects" >

View File

@ -17,7 +17,7 @@ if (navigator.appName !="Netscape")
img_whs1 { width:20px; height:20px; border-style:none; }
p.whs2 { font-size:12pt; }
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_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">Firstly, you can select a <span style="font-weight: bold;"><B>Plane</B></span>
or a <span style="font-weight: bold;"><B>Planar Face</B></span> to be your <span
style="font-weight: bold;"><B>Working Plane</B></span></p>
<p class="whs2">Firstly, you can select a <span style="font-weight: bold;"><B>Plane</B></span>,<span
style="font-weight: bold;"> <B></B></span>a <span style="font-weight: bold;"><B>Planar
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>
Name + 1 selection (face or planar face), </p>
<p class="whs2"><b>Arguments:</b> Name + 1 selection (face
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>

View File

@ -339,7 +339,7 @@ module GEOM
/*!
* 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.
* \return New GEOM_Object, containing the created plane.
*/
@ -616,15 +616,31 @@ module GEOM
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,
in GEOM_Object theStartLCS,
in GEOM_Object theEndLCS);
/*!
* Modify the Location of the given object by LCS
* creating its copy before the setting
* Modify the Location of the given object by LCS,
* 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,
in GEOM_Object theStartLCS,
@ -868,7 +884,7 @@ module GEOM
/*!
* 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.
* If impossible, NULL object will be returned.
* \return New GEOM_Object, containing the created face.
@ -877,7 +893,7 @@ module GEOM
/*!
* 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.
* If impossible, NULL object will be returned.
* \return New GEOM_Object, containing the created face.
@ -1037,6 +1053,24 @@ module GEOM
in long theShapeType,
in GEOM_Object theAx1,
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
@ -1106,6 +1140,23 @@ module GEOM
in GEOM_Object theAx1,
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
* the specified cylinder by the certain way, defined through \a theState parameter.
@ -1667,7 +1718,7 @@ module GEOM
* For format of the description string see the previous method.\n
* \param theCommand String, defining the sketcher in local
* 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.
*/
GEOM_Object MakeSketcherOnPlane (in string theCommand, in GEOM_Object theWorkingPlane);
@ -1894,6 +1945,15 @@ module GEOM
boolean GetFreeBoundary (in GEOM_Object theObject,
out ListOfGO theClosedWires,
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
{
/*!
* 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,
* area of surface and volume of the given shape.
@ -2021,6 +2097,15 @@ module GEOM
boolean CheckShape (in GEOM_Object theShape,
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
* \param theShape Shape to be described.

View File

@ -6,12 +6,17 @@
</section>
<section name="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 name="Geometry" >
<!-- Other module preferences -->
<parameter name="SettingsGeomStep" value="10" />
<parameter name="display_mode" value="0" />
<parameter name="shading_color" value="255, 255, 0" />
<parameter name="SettingsGeomStep" value="10" />
<parameter name="display_mode" value="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>
</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;
//=======================================================================
// function : GetBasicGUI()
// purpose : Get the only BasicGUI object [ static ]
//=======================================================================
BasicGUI* BasicGUI::GetBasicGUI( GeometryGUI* parent )
{
return new BasicGUI( parent );
}
//=======================================================================
// function : BasicGUI()
// purpose : Constructor
@ -146,37 +137,40 @@ bool BasicGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin
QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox();
// 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;
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();
Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();
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() );
}
gp_Pnt aPnt;
ic->InitSelected();
if( pe->state() == Qt::ShiftButton )
ic->ShiftSelect(); // Append selection
else
ic->Select(); // New selection
ic->InitSelected();
if( ic->MoreSelected() )
{
TopoDS_Shape aShape = ic->SelectedShape();
if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
}
else
{
OCCViewer_ViewPort3d* vp = ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort();
aPnt = ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
}
aPntDlg->OnPointSelected( aPnt ); // "feed" the point to point construction dialog
} // acceptMouseEvent()
aPntDlg->OnPointSelected( aPnt ); // "feed" the point to point construction dialog
} // acceptMouseEvent()
}
return false;
}
@ -216,6 +210,6 @@ extern "C"
GEOM_BASICGUI_EXPORT
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
{
protected:
BasicGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
public:
BasicGUI( GeometryGUI* parent );
~BasicGUI();
// Get the only BasicGUI object
static BasicGUI* GetBasicGUI( GeometryGUI* parent );
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
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);
/* 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 );
/* signals and slots connections */

View File

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

View File

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

View File

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

View File

@ -33,6 +33,8 @@
#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include <TColStd_MapOfInteger.hxx>
#include <qlabel.h>
#include "GEOMImpl_Types.hxx"
@ -89,7 +91,7 @@ BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(GeometryGUI* theGeometryGUI, QWidget* paren
Group3Pnts->LineEdit3->setReadOnly( true );
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->TextLabel2->setText(tr("GEOM_PLANE_SIZE"));
GroupFace->PushButton1->setPixmap(image3);
@ -136,11 +138,11 @@ void BasicGUI_PlaneDlg::Init()
double aTrimSize = 2000.0;
/* 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 );
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 );
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 );
/* signals and slots connections */
@ -237,7 +239,11 @@ void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId)
GroupFace->LineEdit1->setText(tr(""));
/* for the first argument */
globalSelection( GEOM_PLANE );
//globalSelection( GEOM_PLANE );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_PLANE );
aMap.Add( GEOM_MARKER );
globalSelection( aMap );
break;
}
}
@ -338,10 +344,15 @@ void BasicGUI_PlaneDlg::SetEditCurrentArgument()
if ( myEditCurrentArgument == GroupPntDir->LineEdit2 )
globalSelection( GEOM_LINE );
else if ( myEditCurrentArgument == GroupFace->LineEdit1 )
globalSelection( GEOM_PLANE );
else if ( myEditCurrentArgument == GroupFace->LineEdit1 ) {
//globalSelection( GEOM_PLANE );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_PLANE );
aMap.Add( GEOM_MARKER );
globalSelection( aMap );
}
else
globalSelection( GEOM_POINT );
globalSelection( GEOM_POINT );
SelectionIntoArgument();
}

View File

@ -157,16 +157,16 @@ void BasicGUI_PointDlg::Init()
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes */
GroupXYZ->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupXYZ->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupXYZ->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupXYZ->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupXYZ->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupXYZ->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupXYZ->SpinBox_DX->SetValue(0.0);
GroupXYZ->SpinBox_DY->SetValue(0.0);
GroupXYZ->SpinBox_DZ->SetValue(0.0);
GroupRefPoint->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupRefPoint->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupRefPoint->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupRefPoint->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupRefPoint->SpinBox_DX->SetValue(0.0);
GroupRefPoint->SpinBox_DY->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);
/* min, max, step and decimals for spin boxes */
GroupDimensions->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
double dx( 0. ), dy( 0. ), dz( 200. );
GroupDimensions->SpinBox_DX->SetValue( dx );

View File

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

View File

@ -41,20 +41,6 @@
#include "SalomeApp_Application.h"
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()
// purpose : Constructor
@ -108,6 +94,6 @@ extern "C"
GEOM_BLOCKSGUI_EXPORT
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
return BlocksGUI::GetBlocksGUI( parent );
return new BlocksGUI( parent );
}
}

View File

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

View File

@ -143,7 +143,8 @@ void BlocksGUI_TrsfDlg::Init()
double SpecificStep = 1.0;
QMap<int, DlgRef_SpinBox*>::iterator 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

View File

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

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
@ -31,6 +31,8 @@
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
#include "SalomeApp_Application.h"
#include "BuildGUI_EdgeDlg.h" // Method EDGE
#include "BuildGUI_WireDlg.h" // Method WIRE
#include "BuildGUI_FaceDlg.h" // Method FACE
@ -40,20 +42,6 @@
#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()
// purpose : Constructor
@ -63,7 +51,6 @@ BuildGUI::BuildGUI( GeometryGUI* parent )
{
}
//=======================================================================
// function : ~BuildGUI()
// purpose : Destructor
@ -93,7 +80,7 @@ bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
case 4086: aDlg = new BuildGUI_CompoundDlg( getGeometryGUI(), parent, "" ); break;
default:
SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
getGeometryGUI()->getApp()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
break;
}
@ -111,6 +98,6 @@ extern "C"
GEOM_BUILDGUI_EXPORT
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
// 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
// Author : Damien COQUERET
// Module : GEOM
// $Header$
#ifndef BUILDGUI_H
#define BUILDGUI_H
@ -39,19 +38,11 @@
//=================================================================================
class GEOM_BUILDGUI_EXPORT BuildGUI : public GEOMGUI
{
protected:
BuildGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
public :
BuildGUI( GeometryGUI* parent );
~BuildGUI();
// Get the only BuildGUI object
static BuildGUI* GetBuildGUI( GeometryGUI* parent );
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
private:
static BuildGUI* myGUIObject; // the only BuildGUI object
};
#endif

View File

@ -28,6 +28,7 @@
#include "BuildGUI_FaceDlg.h"
#include "GEOMImpl_Types.hxx"
#include "TColStd_MapOfInteger.hxx"
#include "SUIT_Session.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->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->PushButton1->setPixmap(image1);
@ -100,7 +101,10 @@ void BuildGUI_FaceDlg::Init()
GroupWire->CheckButton1->setChecked(TRUE);
globalSelection( GEOM_WIRE );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_EDGE );
aMap.Add( GEOM_WIRE );
globalSelection( aMap );
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
@ -160,7 +164,7 @@ void BuildGUI_FaceDlg::SelectionIntoArgument()
if (!myWires.length())
return;
if(aNbSel != 1)
aName = tr("%1_wires").arg(aNbSel);
aName = tr("%1_objects").arg(aNbSel);
myEditCurrentArgument->setText( aName );
@ -178,7 +182,11 @@ void BuildGUI_FaceDlg::SetEditCurrentArgument()
if (send != GroupWire->PushButton1)
return;
globalSelection( GEOM_WIRE );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_EDGE );
aMap.Add( GEOM_WIRE );
globalSelection( aMap );
myEditCurrentArgument = GroupWire->LineEdit1;
myEditCurrentArgument->setFocus();
@ -195,7 +203,10 @@ void BuildGUI_FaceDlg::ActivateThisDialog()
GEOMBase_Skeleton::ActivateThisDialog();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
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
// 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>
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()
// purpose : Constructor
@ -82,7 +67,6 @@ DisplayGUI::DisplayGUI( GeometryGUI* parent ) : GEOMGUI( parent )
{
}
//=======================================================================
// function : DisplayGUI::~DisplayGUI()
// purpose : Destructor
@ -98,63 +82,64 @@ DisplayGUI::~DisplayGUI()
//=======================================================================
bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
{
DisplayGUI* myDisplayGUI = GetDisplayGUI( getGeometryGUI() );
LightApp_SelectionMgr *Sel = getGeometryGUI()->getApp()->selectionMgr();
SalomeApp_Application* app = getGeometryGUI()->getApp();
if (!app) return false;
LightApp_SelectionMgr *Sel = app->selectionMgr();
SALOME_ListIO selected;
Sel->selectedObjects( selected );
switch (theCommandID) {
case 211: // MENU VIEW - WIREFRAME/SHADING
{
myDisplayGUI->InvertDisplayMode();
int newMode = myDisplayGUI->GetDisplayMode();
getGeometryGUI()->action( 211 )->setMenuText( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
InvertDisplayMode();
int newMode = GetDisplayMode();
getGeometryGUI()->action( 211 )->setMenuText
( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
getGeometryGUI()->menuMgr()->update();
// SUIT_Session::session()->activeApplication()->desktop()->menuBar()->
// changeItem( 211, newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
break;
}
case 212: // MENU VIEW - DISPLAY ALL
{
getGeometryGUI()->EmitSignalDeactivateDialog();
myDisplayGUI->DisplayAll();
DisplayAll();
break;
}
case 213: // MENU VIEW - DISPLAY ONLY
{
getGeometryGUI()->EmitSignalDeactivateDialog();
myDisplayGUI->DisplayOnly();
DisplayOnly();
break;
}
case 214: // MENU VIEW - ERASE ALL
{
myDisplayGUI->EraseAll();
EraseAll();
break;
}
case 215: // MENU VIEW - ERASE
{
myDisplayGUI->Erase();
Erase();
break;
}
case 216: // MENU VIEW - DISPLAY
{
getGeometryGUI()->EmitSignalDeactivateDialog();
myDisplayGUI->Display();
Display();
break;
}
case 80311: // POPUP VIEWER - WIREFRAME
{
myDisplayGUI->ChangeDisplayMode( 0 );
ChangeDisplayMode( 0 );
break;
}
case 80312: // POPUP VIEWER - SHADING
{
myDisplayGUI->ChangeDisplayMode( 1 );
ChangeDisplayMode( 1 );
break;
}
default:
{
SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break;
}
}
@ -168,7 +153,10 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
//=====================================================================================
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;
_PTR(Study) aStudy = appStudy->studyDS();
if ( !aStudy ) return;
@ -186,7 +174,9 @@ void DisplayGUI::DisplayAll()
_PTR(SObject) valSO ( anIter->Value() );
_PTR(SObject) 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();
}
@ -201,7 +191,7 @@ void DisplayGUI::EraseAll()
{
SUIT_OverrideCursor();
SUIT_Application* app = SUIT_Session::session()->activeApplication();
SUIT_Application* app = getGeometryGUI()->getApp();
if ( app ) {
SUIT_ViewWindow* vw = app->desktop()->activeWindow();
if ( vw ) {
@ -233,7 +223,7 @@ void DisplayGUI::Display()
{
SALOME_ListIO listIO;
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
@ -253,7 +243,7 @@ void DisplayGUI::Display()
Handle(SALOME_InteractiveObject) anIObject = It.Value();
if ( anIObject->hasEntry() ) {
_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() );
// if component is selected
listIO.Clear();
@ -263,7 +253,9 @@ void DisplayGUI::Display()
_PTR(SObject) valSO ( anIter->Value() );
_PTR(SObject) 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();
}
@ -289,7 +281,7 @@ void DisplayGUI::Erase()
{
SALOME_ListIO listIO;
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
@ -305,11 +297,11 @@ void DisplayGUI::Erase()
SUIT_OverrideCursor();
for( ;It.More();It.Next() ) {
for( ; It.More(); It.Next() ) {
Handle(SALOME_InteractiveObject) anIObject = It.Value();
if ( anIObject->hasEntry() ) {
_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() );
// if component is selected
listIO.Clear();
@ -319,7 +311,9 @@ void DisplayGUI::Erase()
_PTR(SObject) valSO ( anIter->Value() );
_PTR(SObject) 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();
}
@ -334,7 +328,7 @@ void DisplayGUI::Erase()
}
}
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();
if ( !viewWindow )
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
aView->SetDisplayMode( mode );
@ -382,7 +376,7 @@ int DisplayGUI::GetDisplayMode( SUIT_ViewWindow* viewWindow )
{
int dispMode = 0;
if ( !viewWindow )
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
dispMode = aView->GetDisplayMode();
@ -413,12 +407,12 @@ void DisplayGUI::InvertDisplayMode( SUIT_ViewWindow* viewWindow )
//=====================================================================================
void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
{
if ( !viewWindow )
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
if ( !viewWindow )
viewWindow = app->desktop()->activeWindow();
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
if ( !aSelMgr ) return;
@ -435,7 +429,8 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
for( ;It.More(); It.Next() ) {
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 ( mode == 0 )
aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
@ -478,6 +473,6 @@ extern "C"
GEOM_DISPLAYGUI_EXPORT
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
// 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
// Author : Damien COQUERET
// Module : GEOM
// $Header$
#ifndef DISPLAYGUI_H
#define DISPLAYGUI_H
@ -33,22 +32,15 @@
#include "GEOMBase.h"
#ifdef WNT
#if defined DISPLAYGUI_EXPORTS
#if defined WIN32
#define GEOM_DISPLAYGUI_EXPORT __declspec( dllexport )
#else
#define GEOM_DISPLAYGUI_EXPORT
#endif
#else
#if defined WIN32
#define GEOM_DISPLAYGUI_EXPORT __declspec( dllimport )
#else
#define GEOM_DISPLAYGUI_EXPORT
#endif
#endif
# if defined DISPLAYGUI_EXPORTS
# define GEOM_DISPLAYGUI_EXPORT __declspec( dllexport )
# else
# define GEOM_DISPLAYGUI_EXPORT __declspec( dllimport )
# endif
#else
#define GEOM_DISPLAYGUI_EXPORT
# define GEOM_DISPLAYGUI_EXPORT
#endif
//=================================================================================
// class : GEOMBase_Display
// purpose :
@ -57,15 +49,10 @@
class SUIT_ViewWindow;
class GEOM_DISPLAYGUI_EXPORT DisplayGUI : public GEOMGUI
{
protected:
DisplayGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
public :
public:
DisplayGUI( GeometryGUI* parent );
~DisplayGUI();
// Get the only DisplayGUI object
static DisplayGUI* GetDisplayGUI( GeometryGUI* parent );
// Dispatch menu command
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
@ -92,9 +79,6 @@ public :
// Set display mode for selected objects in the viewer given
// (current viewer if <viewWindow> = 0 )
void ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindo = 0 );
private:
static DisplayGUI* myGUIObject; // the only DisplayGUI object
};
#endif

View File

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

View File

@ -33,6 +33,10 @@
#include "QtxDblSpinBox.h"
#define COORD_MIN -1e+15
#define COORD_MAX +1e+15
#define MAX_NUMBER 100000
//=================================================================================
// class : DlgRef_SpinBox
// 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
// 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 "SalomeApp_Study.h"
#include "SalomeApp_Tools.h"
#include "SalomeApp_Application.h"
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
@ -50,15 +51,6 @@
using namespace boost;
using namespace std;
//=======================================================================
// function : GetEntityGUI()
// purpose : Get the only EntityGUI object [ static ]
//=======================================================================
EntityGUI* EntityGUI::GetEntityGUI( GeometryGUI* parent )
{
return new EntityGUI( parent );
}
//=======================================================================
// function : EntityGUI()
// purpose : Constructor
@ -84,6 +76,9 @@ EntityGUI::~EntityGUI()
//=======================================================================
bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL;
@ -97,7 +92,7 @@ bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
aDlg = new EntityGUI_SubShapeDlg(getGeometryGUI(), parent, "");
break;
default:
SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break;
}
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)
{
SUIT_ViewManager* aVM =
SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager();
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
SUIT_ViewManager* aVM = app->desktop()->activeWindow()->getViewManager();
if (aVM->getType() != OCCViewer_Viewer::Type())
return;
@ -160,13 +157,16 @@ void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shap
//==================================================================================
void EntityGUI::EraseSimulationShape()
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
// 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
QPtrList<SUIT_ViewWindow> aWndLstAS;
SUIT_ViewWindow* vw;
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 );
for ( vw = aWndLstAS.first(); vw; vw = aWndLstAS.next() ) {
@ -188,9 +188,11 @@ void EntityGUI::EraseSimulationShape()
//=====================================================================================
bool EntityGUI::SObjectExist(const _PTR(SObject)& theFatherObject, const char* IOR)
{
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>
( SUIT_Session::session()->activeApplication()->activeStudy() );
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
if ( !appStudy ) return false;
_PTR(Study) aStudy = appStudy->studyDS();
_PTR(ChildIterator) it ( aStudy->NewChildIterator(theFatherObject) );
_PTR(SObject) RefSO;
@ -222,6 +224,6 @@ extern "C"
GEOM_ENTITYGUI_EXPORT
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
// 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
{
protected:
EntityGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
public :
EntityGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
~EntityGUI();
// Get the only EntityGUI object
static EntityGUI* GetEntityGUI( GeometryGUI* parent );
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2);

View File

@ -17,14 +17,14 @@
// License along with this library; if not, write to the Free Software
// 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
// Author : Damien COQUERET
// Module : GEOM
// $Header:
// $Header$
#include "EntityGUI_SketcherDlg.h"
#include "Sketcher_Profile.hxx"
@ -132,24 +132,42 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent,
Group1Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
Group1Spin->buttonUndo->setPixmap(image1);
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->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
Group2Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
Group2Spin->buttonUndo->setPixmap(image1);
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->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
Group3Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
Group3Spin->buttonUndo->setPixmap(image1);
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->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
Group4Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
Group4Spin->buttonUndo->setPixmap(image1);
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->addWidget(GroupD1, 1, 0);
@ -218,6 +236,18 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent,
connect(myGeometryGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(myGeometryGUI, SIGNAL(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();
}
@ -228,7 +258,42 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent,
//=================================================================================
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 );
/* min, max, step and decimals for spin boxes */
Group1Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, step, 3);
Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, step, 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, step, 3);
Group3Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, step, 3);
Group3Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, step, 3);
Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, step, 3);
Group4Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3);
Group4Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3);
Group4Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, step, 3);
Group4Spin->SpinBox_DS->RangeStepAndValidator(-999999.999, 999999.999, 5., 3);
Group1Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group4Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
Group4Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
Group4Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group4Spin->SpinBox_DS->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
/* displays Dialog */
GroupConstructors->setEnabled(false);
@ -289,7 +354,7 @@ void EntityGUI_SketcherDlg::Init()
//=================================================================================
void EntityGUI_SketcherDlg::InitClick()
{
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
disconnect(myGeometryGUI->getApp()->selectionMgr(), 0, this, 0);
Group1Sel->hide();
Group1Spin->hide();
@ -359,13 +424,16 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId)
{
InitClick();
// Get setting of step value from file configuration
double step = SUIT_Session::session()->resourceMgr()->doubleValue("Geometry", "SettingsGeomStep", 100.0);
if ( myConstructorId == 0 )
{ // SEGMENT
if ( constructorId == 1 )
{ // XY
mySketchType = PT_ABS;
Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 100., 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3);
Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X2"));
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y2"));
myX = 0.0;
@ -380,8 +448,8 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId)
else if ( constructorId == 0 )
{ // DXDY
mySketchType = PT_RELATIVE;
Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 100., 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3);
Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_DX2"));
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_DY2"));
myDX = 0.0;
@ -397,8 +465,8 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId)
{ // Selection
mySketchType = PT_SEL;
myEditCurrentArgument = Group1Sel->LineEdit1;
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
connect(myGeometryGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
Group1Sel->show();
Group1Sel->buttonApply->setFocus();
SelectionIntoArgument();
@ -428,6 +496,9 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
InitClick();
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 )
{ // SEGMENT
myX = 0.0;
@ -435,8 +506,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
myLength = 100.0;
if ( myConstructorDirId == 2 )
{ // Angle
Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 5., 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3);
Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
Group2Spin->SpinBox_DX->SetValue(myAngle);
Group2Spin->buttonApply->setFocus();
@ -511,9 +582,9 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
}
else if ( myConstructorDirId == 3 )
{ // DXDY
Group3Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3);
Group3Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3);
Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, 100., 3);
Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2"));
Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2"));
myDX = 0.0;
@ -550,9 +621,9 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
if ( constructorId == 2 )
{ // Length
mySketchType = DIR_ANGLE_LENGTH;
Group3Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 5., 3);
Group3Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3);
Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, 5., 3);
Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_RADIUS2"));
Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_ANGLE2"));
@ -570,8 +641,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
if ( constructorId == 2 )
{ // Length
mySketchType = DIR_PER_LENGTH;
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 5., 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
myRadius = 100.0;
@ -587,8 +658,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
if ( constructorId == 2 )
{ // Length
mySketchType = DIR_TAN_LENGTH;
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 5., 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
myRadius = 100.0;
@ -680,7 +751,7 @@ void EntityGUI_SketcherDlg::ClickOnEnd()
//=================================================================================
bool EntityGUI_SketcherDlg::ClickOnApply()
{
((QPushButton*)sender())->setFocus();
((QPushButton*)sender())->setFocus(); // to update value of currently edited spin-box (PAL11948)
myCommand.append( GetNewCommand() );
mySketchState = NEXT_POINT;
@ -695,6 +766,24 @@ bool EntityGUI_SketcherDlg::ClickOnApply()
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;
}
@ -879,7 +968,7 @@ void EntityGUI_SketcherDlg::DeactivateActiveDialog()
setEnabled( false );
globalSelection();
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
disconnect(myGeometryGUI->getApp()->selectionMgr(), 0, this, 0);
myGeometryGUI->SetActiveDialogBox(0);
}
@ -894,8 +983,8 @@ void EntityGUI_SketcherDlg::ActivateThisDialog()
setEnabled(true);
myGeometryGUI->SetActiveDialogBox((QDialog*)this);
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
connect(myGeometryGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
//myGeometryGUI->SetState( 0 );
globalSelection( GEOM_POINT );
@ -925,7 +1014,7 @@ void EntityGUI_SketcherDlg::enterEvent(QEvent* e)
void EntityGUI_SketcherDlg::closeEvent(QCloseEvent* e)
{
//myGeometryGUI->SetState( -1 );
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
disconnect(myGeometryGUI->getApp()->selectionMgr(), 0, this, 0);
QDialog::closeEvent( e );
}
@ -1272,28 +1361,29 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects )
}
QString cmd;
if( ( mySketchState != FIRST_POINT && myLastX1 == myLastX2 && myLastY1 == myLastY2 ) || myIsAllAdded ) {
if( ( mySketchState != FIRST_POINT &&
myLastX1 == myLastX2 && myLastY1 == myLastY2 ) || myIsAllAdded ) {
cmd = myCommand.join( "" );
if ( Group1Sel->isVisible() ) {
Group1Sel->buttonApply->setEnabled(false);
Group1Sel->buttonApply->setFocus();
//Group1Sel->buttonApply->setFocus();
}
if ( Group1Spin->isVisible() ) {
Group1Spin->buttonApply->setEnabled(false);
Group1Spin->buttonApply->setFocus();
//Group1Spin->buttonApply->setFocus();
}
if ( Group2Spin->isVisible() ) {
Group2Spin->buttonApply->setEnabled(false);
Group2Spin->buttonApply->setFocus();
//Group2Spin->buttonApply->setFocus();
}
if ( Group3Spin->isVisible() ) {
Group3Spin->buttonApply->setEnabled(false);
Group3Spin->buttonApply->setFocus();
//Group3Spin->buttonApply->setFocus();
}
if ( Group4Spin->isVisible() ) {
Group4Spin->buttonApply->setEnabled(false);
Group4Spin->buttonApply->setFocus();
//Group4Spin->buttonApply->setFocus();
}
}
else {
@ -1301,23 +1391,23 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects )
if ( Group1Sel->isVisible() ) {
Group1Sel->buttonApply->setEnabled(true);
Group1Sel->buttonApply->setFocus();
//Group1Sel->buttonApply->setFocus();
}
if ( Group1Spin->isVisible() ) {
Group1Spin->buttonApply->setEnabled(true);
Group1Spin->buttonApply->setFocus();
//Group1Spin->buttonApply->setFocus();
}
if ( Group2Spin->isVisible() ) {
Group2Spin->buttonApply->setEnabled(true);
Group2Spin->buttonApply->setFocus();
//Group2Spin->buttonApply->setFocus();
}
if ( Group3Spin->isVisible() ) {
Group3Spin->buttonApply->setEnabled(true);
Group3Spin->buttonApply->setFocus();
//Group3Spin->buttonApply->setFocus();
}
if ( Group4Spin->isVisible() ) {
Group4Spin->buttonApply->setEnabled(true);
Group4Spin->buttonApply->setFocus();
//Group4Spin->buttonApply->setFocus();
}
}
@ -1336,7 +1426,8 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects )
WPlane[7] = myWPlane.XDirection().Y();
WPlane[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() )
objects.push_back( anObj._retn() );
@ -1433,9 +1524,19 @@ bool EntityGUI_SketcherDlg::createShapes( GEOM::GEOM_Object_ptr theObject,
return true;
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void EntityGUI_SketcherDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Key_F1 )
{
e->accept();
ClickOnHelp();
}
}

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software
// 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);
~EntityGUI_SketcherDlg();
bool eventFilter (QObject* object, QEvent* event);
protected:
// redefined from GEOMBase_Helper
virtual GEOM::GEOM_IOperations_ptr createOperation();
@ -75,6 +77,7 @@ protected:
virtual bool execute( ObjectList& objects );
void closeEvent( QCloseEvent* e );
void keyPressEvent( QKeyEvent* e );
private :
void Init();

View File

@ -55,6 +55,7 @@
#include <map>
#include <string>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
static GEOM_Engine* TheEngine = NULL;
@ -214,6 +215,9 @@ Handle(GEOM_Object) GEOM_Engine::AddSubShape(Handle(GEOM_Object) theMainShape,
aSSI.SetIndices(theIndices);
try {
#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(aFunction)) {
MESSAGE("GEOM_Engine::AddSubShape Error: Can't build a sub shape");

View File

@ -54,6 +54,7 @@
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
#define ARGUMENT_LABEL 1
@ -165,7 +166,10 @@ TopoDS_Shape GEOM_Function::GetValue()
if(anObject.IsNull()) return aShape;
if(!anObject->IsMainShape()) {
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)) {
MESSAGE("GEOM_Object::GetValue Error : Can't build a sub shape");
return aShape;

View File

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

View File

@ -249,3 +249,20 @@ void GEOMBase_Skeleton::setHelpFileName(const QString& 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:
void closeEvent(QCloseEvent* e);
void keyPressEvent(QKeyEvent* e);
/*! 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_Attributes.idl \
SALOME_GenericObj.idl \
SALOME_Component.idl \
GEOM_Gen.idl
LIB_SERVER_IDL =

View File

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

View File

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

View File

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

View File

@ -39,6 +39,9 @@
#include <SelectMgr_IndexedMapOfOwner.hxx>
#include <NCollection_DataMap.hxx>
#include <SUIT_Session.h>
#include <SalomeApp_Study.h>
//================================================================
// 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->() );
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
#include <AIS_Drawer.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <StdSelect_TypeOfEdge.hxx>
@ -520,6 +521,19 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
AISShape->SetDisplayMode( myDisplayMode );
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() )
{
AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
@ -530,6 +544,49 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
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() )
AISShape->SetWidth( GetWidth() );

View File

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

View File

@ -522,8 +522,8 @@ msgid "GEOM_MIRROR"
msgstr "Mirror"
#Prism
msgid "GEOM_PRISM"
msgstr "Prism"
msgid "GEOM_EXTRUSION"
msgstr "Extrusion"
#Sub Shapes
msgid "GEOM_SUB_SHAPE"
@ -651,6 +651,10 @@ msgstr "Face"
msgid "GEOM_FACES"
msgstr "Faces"
#Face or LCS
msgid "GEOM_FACE_OR_LCS"
msgstr "Face or LCS"
#Line
msgid "GEOM_LINE"
msgstr "Line"
@ -899,7 +903,7 @@ msgstr "Create A Face"
#: GeometryGUI_FaceDlg.cxx:78
msgid "GEOM_FACE_FFW"
msgstr "Face from a wire"
msgstr "Face from a closed wire and edge"
#: GeometryGUI_FaceDlg.cxx:103
msgid "GEOM_FACE_OPT"
@ -907,7 +911,7 @@ msgstr "Try to create a planar face"
#: GeometryGUI_FillingDlg.cxx:53
msgid "GEOM_FILLING_TITLE"
msgstr "Filling Surface With Curves"
msgstr "Filling Surface With Edges"
#: GeometryGUI_FillingDlg.cxx:112
msgid "GEOM_FILLING_ARG"
@ -927,7 +931,7 @@ msgstr "Tol. 2D :"
#: GeometryGUI_FillingDlg.cxx:170
msgid "GEOM_FILLING_COMPOUND"
msgstr "Curves Comp."
msgstr "Edges compound"
#: GeometryGUI_FillingDlg.cxx:184
msgid "GEOM_FILLING_TOL_3D"
@ -1052,13 +1056,16 @@ msgid "GEOM_PLANE_PV"
msgstr "Point + Vector"
#: GeometryGUI_PrismDlg.cxx:54
msgid "GEOM_PRISM_TITLE"
msgstr "Prism Construction"
msgid "GEOM_EXTRUSION_TITLE"
msgstr "Construction by Extrusion"
#: GeometryGUI_PrismDlg.cxx:83
msgid "GEOM_PRISM_BSV"
msgid "GEOM_EXTRUSION_BSV"
msgstr "Base Shape + Vector"
msgid "GEOM_EXTRUSION_BSV_2P"
msgstr "Base Shape + 2 Points"
#: GeometryGUI_PropertiesDlg.cxx:56
msgid "GEOM_PROPERTIES_TITLE"
msgstr "Basic Properties Informations"
@ -1226,7 +1233,7 @@ msgstr "Working Plane Selection"
#: GeometryGUI_WorkingPlaneDlg.cxx:107
msgid "GEOM_WPLANE_FACE"
msgstr "Plane Or Planar Face"
msgstr "Plane, Planar Face or LCS"
#: GeometryGUI_WorkingPlaneDlg.cxx:107
msgid "GEOM_WPLANE_VECTOR"
@ -1639,6 +1646,12 @@ msgstr "Free boundaries"
msgid "GEOM_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"
msgstr "By parameter"
@ -1711,6 +1724,9 @@ msgstr "Point Coordinates"
msgid "MeasureGUI_PointDlg::COORDINATES"
msgstr "Point and its coordinates"
msgid "MeasureGUI_1Sel1TextView1Check_QTD::CHECK_SHAPE_GEOMETRY"
msgstr "Check also geometry"
msgid "GroupGUI_GroupDlg::CREATE_GROUP_TITLE"
msgstr "Create Group"
@ -1982,6 +1998,9 @@ msgstr "ProcessShape"
msgid "SUPRESS_FACE_NEW_OBJ_NAME"
msgstr "SupressFaces"
msgid "CHANGE_ORIENTATION_NEW_OBJ_NAME"
msgstr "Invert"
msgid "NON_GEOM_OBJECTS_SELECTED"
msgstr "There are objects selected which do not belong to %1 component."
@ -2200,13 +2219,13 @@ msgid "STB_FILLING"
msgstr "Create a filling"
msgid "TOP_PIPE"
msgstr "Create a pipe"
msgstr "Extrusion along a path"
msgid "MEN_PIPE"
msgstr "Pipe"
msgstr "Extrusion along a path"
msgid "STB_PIPE"
msgstr "Create a pipe"
msgstr "Create a shape by Extrusion along a path"
msgid "MEN_GROUP"
msgstr "Group"
@ -2607,6 +2626,15 @@ msgstr "Check free faces"
msgid "STB_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"
msgstr "Measures"
@ -2907,6 +2935,21 @@ msgstr "General"
msgid "PREF_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"
msgstr "Step value for spin boxes"
@ -2915,3 +2958,9 @@ msgstr "Default display mode"
msgid "PREF_TAB_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
msgid "GEOM_FILLING"
msgstr "Surface Par Courbes"
msgstr "Surface Par Edges"
#Fuse
msgid "GEOM_FUSE"
@ -512,7 +512,7 @@ msgid "GEOM_MIRROR"
msgstr "Miroir"
#Prism
msgid "GEOM_PRISM"
msgid "GEOM_EXTRUSION"
msgstr "Extrusion"
#Sub Shapes
@ -891,7 +891,7 @@ msgstr "Création d'une Face plane"
#: GeometryGUI_FillingDlg.cxx:53
msgid "GEOM_FILLING_TITLE"
msgstr "Surface Par Courbes"
msgstr "Surface Par Edges"
#: GeometryGUI_FillingDlg.cxx:112
msgid "GEOM_FILLING_ARG"
@ -911,7 +911,7 @@ msgstr "Tol. 2D"
#: GeometryGUI_FillingDlg.cxx:170
msgid "GEOM_FILLING_COMPOUND"
msgstr "Compound de Courbes"
msgstr "Compound de Edges"
#: GeometryGUI_FillingDlg.cxx:184
msgid "GEOM_FILLING_TOL_3D"
@ -1036,13 +1036,16 @@ msgid "GEOM_PLANE_PV"
msgstr "Point + Vecteur"
#: GeometryGUI_PrismDlg.cxx:54
msgid "GEOM_PRISM_TITLE"
msgid "GEOM_EXTRUSION_TITLE"
msgstr "Extruder une Shape de base"
#: GeometryGUI_PrismDlg.cxx:83
msgid "GEOM_PRISM_BSV"
msgid "GEOM_EXTRUSION_BSV"
msgstr "Shape de base + Vecteur"
msgid "GEOM_EXTRUSION_BSV_2P"
msgstr "Shape de base + 2 Points"
#: GeometryGUI_PropertiesDlg.cxx:56
msgid "GEOM_PROPERTIES_TITLE"
msgstr "Proprietes Basiques"

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
@ -503,6 +503,7 @@ void GeometryGUI::OnGUIEvent( int id )
id == 608 || // MENU REPAIR - ADD POINT ON EDGE
id == 609 || // MENU REPAIR - FREE BOUNDARIES
id == 610 || // MENU REPAIR - FREE FACES
id == 611 || // MENU REPAIR - CHANGE ORIENTATION
id == 602 ) { // MENU REPAIR - GLUE FACES
#ifndef WNT
library = getLibrary( "libRepairGUI.so" );
@ -829,6 +830,7 @@ void GeometryGUI::initialize( CAM_Application* app )
createGeomAction( 608, "POINT_ON_EDGE" );
createGeomAction( 609, "CHECK_FREE_BNDS" );
createGeomAction( 610, "CHECK_FREE_FACES" );
createGeomAction( 611, "CHANGE_ORIENTATION" );
createGeomAction( 708, "POINT_COORDS" );
createGeomAction( 701, "BASIC_PROPS" );
@ -971,6 +973,7 @@ void GeometryGUI::initialize( CAM_Application* app )
createMenu( 608, repairId, -1 );
createMenu( 609, repairId, -1 );
createMenu( 610, repairId, -1 );
createMenu( 611, repairId, -1 );
int measurId = createMenu( tr( "MEN_MEASURES" ), -1, -1, 10 );
createMenu( 708, measurId, -1 );
@ -1068,30 +1071,34 @@ void GeometryGUI::initialize( CAM_Application* app )
createTool( 5027, 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();
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->insert( action( 8001 ), -1, -1 ); // create group
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->insert( separator(), -1, -1 ); // -----------
mgr->insert( separator(), -1, -1 ); // -----------
dispmodeId = mgr->insert( tr( "MEN_DISPLAY_MODE" ), -1, -1 ); // display mode menu
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 ), "(client='OCCViewer' or client='VTKViewer') and displaymode='Wireframe'", false );
mgr->setRule( action( 80311 ), clientOCCorVTK_AndSomeVisible, true );
mgr->setRule( action( 80311 ), clientOCCorVTK + " and displaymode='Wireframe'", false );
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 ), "(client='OCCViewer' or client='VTKViewer') and displaymode='Shading'", false );
mgr->insert( separator(), -1, -1 ); // -----------
mgr->setRule( action( 80312 ), clientOCCorVTK_AndSomeVisible, true );
mgr->setRule( action( 80312 ), clientOCCorVTK + " and displaymode='Shading'", false );
mgr->insert( separator(), -1, -1 ); // -----------
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->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->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) ",
@ -1106,7 +1113,7 @@ void GeometryGUI::initialize( CAM_Application* app )
mgr->setRule( action( 215 ), rule.arg( types ).arg( "isVisible" ), true );
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->setRule( action( 213 ), rule.arg( types ).arg( "true" ), true );
@ -1193,6 +1200,12 @@ bool GeometryGUI::deactivateModule( SUIT_Study* study )
action(111)->setEnabled(false); // Import
action(121)->setEnabled(false); // Export
// Unset actions accelerator keys
//action(111)->setAccel(QKeySequence()); // Import
//action(121)->setAccel(QKeySequence()); // Export
action(111)->setEnabled(false); // Import
action(121)->setEnabled(false); // Export
myOCCSelectors.clear();
getApp()->selectionMgr()->setEnabled( true, OCCViewer_Viewer::Type() );
@ -1645,18 +1658,31 @@ void GeometryGUI::createPreferences()
int tabId = addPreference( tr( "PREF_TAB_SETTINGS" ) );
int genGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), tabId );
addPreference( tr( "PREF_SHADING_COLOR" ), genGroup,
LightApp_Preferences::Color, "Geometry", "shading_color" );
int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
setPreferenceProperty( genGroup, "columns", 1 );
int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), genGroup,
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 );
setPreferenceProperty( step, "max", 10000 );
setPreferenceProperty( step, "precision", 3 );
addPreference( tr( "PREF_WIREFRAME_COLOR" ), genGroup,
LightApp_Preferences::Color, "Geometry", "wireframe_color" );
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
QStringList aModesList;
@ -1669,10 +1695,23 @@ void GeometryGUI::createPreferences()
setPreferenceProperty( dispmode, "strings", aModesList );
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 )
{
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()

View File

@ -110,14 +110,16 @@ GEOM_Swig::~GEOM_Swig()
// MESSAGE("Destructeur");
}
void GEOM_Swig::createAndDisplayGO (const char* Entry)
void GEOM_Swig::createAndDisplayGO (const char* Entry, bool isUpdated)
{
class TEvent: public SALOME_Event
{
std::string myEntry;
bool myUpdateViewer;
public:
TEvent(const char* theEntry):
myEntry(theEntry)
TEvent(const char* theEntry, bool toUpdateViewer):
myEntry(theEntry),
myUpdateViewer(toUpdateViewer)
{}
virtual void Execute()
{
@ -179,7 +181,7 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
"GEOM",
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)) {
SVTK_View* aView = aViewWindow->getView();
int aMode = aView->GetDisplayMode();
@ -217,7 +219,7 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
};
// MESSAGE("createAndDisplayGO");
ProcessVoidEvent(new TEvent (Entry));
ProcessVoidEvent(new TEvent (Entry, isUpdated));
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)
@ -267,6 +270,25 @@ void GEOM_Swig::createAndDisplayFitAllGO (const char* Entry)
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)
{
GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen();
@ -345,14 +367,15 @@ const char* GEOM_Swig::getShapeTypeIcon(const char* IOR)
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 {
std::string myEntry;
int myMode;
bool myUpdateViewer;
public:
TEvent(const char* theEntryArg, int theModeArg):
myEntry(theEntryArg), myMode(theModeArg)
TEvent(const char* theEntryArg, int theModeArg, bool theUpdated):
myEntry(theEntryArg), myMode(theModeArg), myUpdateViewer(theUpdated)
{}
virtual void Execute() {
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)) {
SVTK_View* aView = aViewWindow->getView();
aView->SetDisplayMode(anIO, myMode);
aView->Repaint();
if (myUpdateViewer)
aView->Repaint();
}
else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) {
SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>(occViewer);
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 {
std::string myEntry;
int myRed;
int myGreen;
int myBlue;
bool myUpdateViewer;
public:
TEvent(const char* theEntryArg, int theR, int theG, int theB):
myEntry(theEntryArg), myRed(theR), myGreen(theG), myBlue(theB)
TEvent(const char* theEntryArg, int theR, int theG, int theB, bool theUpdated):
myEntry(theEntryArg), myRed(theR), myGreen(theG), myBlue(theB), myUpdateViewer(theUpdated)
{}
virtual void Execute() {
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();
QColor aColor (myRed, myGreen, myBlue);
aView->SetColor(anIO, aColor);
aView->Repaint();
if (myUpdateViewer)
aView->Repaint();
} else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) {
Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
AIS_ListOfInteractive List;
@ -414,25 +440,27 @@ void GEOM_Swig::setColor(const char* theEntry, int red, int green, int blue)
ite.Value()->SetColor(CSFColor);
if (ite.Value()->IsKind(STANDARD_TYPE(GEOM_AISShape)))
Handle(GEOM_AISShape)::DownCast(ite.Value())->SetShadingColor(CSFColor);
ite.Value()->Redisplay(Standard_True);
occViewer->update();
ic->Redisplay(ite.Value(), true, true);
if (myUpdateViewer)
occViewer->update();
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 {
std::string myEntry;
float myParam;
bool myUpdateViewer;
public:
TEvent(const char* theEntryArg, float theParam):
myEntry(theEntryArg), myParam(theParam)
TEvent(const char* theEntryArg, float theParam, bool theUpdated):
myEntry(theEntryArg), myParam(theParam), myUpdateViewer(theUpdated)
{}
virtual void Execute() {
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)) {
SVTK_View* aView = aViewWindow->getView();
aView->SetTransparency(anIO, myParam);
aView->Repaint();
if (myUpdateViewer)
aView->Repaint();
} else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) {
SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>(occViewer);
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();
void createAndDisplayGO(const char* Entry);
void createAndDisplayGO(const char* Entry, bool isUpdated = true);
void eraseGO(const char* Entry, bool allWindows);
void createAndDisplayFitAllGO(const char* Entry);
void setDisplayMode(const char* Entry, int mode);
void setColor(const char* Entry, int red, int green, int blue);
void setTransparency(const char* Entry, float transp);
void UpdateViewer();
void setDisplayMode(const char* Entry, int mode, bool isUpdated = true);
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);
int getIndexTopology(const char *SubEntry, const char *Entry);

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
@ -30,21 +30,42 @@
#include "GeometryGUI_Swig.hxx"
%}
/*
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
{
public:
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 createAndDisplayFitAllGO(const char* Entry);
void UpdateViewer();
int getIndexTopology(const char *SubEntry, const char *Entry);
const char* getShapeTypeString(const char *Entry);
void setDisplayMode(const char* Entry, int mode);
void setColor(const char* Entry, int red, int green, int blue);
void setTransparency(const char* Entry, float transp);
void setDisplayMode(const char* Entry, int mode, bool isUpdated =true);
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);
const char* getShapeTypeIcon(const char *Ior);

View File

@ -18,19 +18,25 @@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>
#include <GEOMImpl_BooleanDriver.hxx>
#include <GEOMImpl_IBoolean.hxx>
#include <GEOMImpl_Types.hxx>
#include <GEOMImpl_GlueDriver.hxx>
#include <GEOM_Function.hxx>
#include <BRep_Builder.hxx>
#include <BRepAlgo.hxx>
#include <BRepAlgoAPI_Common.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#include <BRepAlgoAPI_Fuse.hxx>
#include <BRepAlgoAPI_Section.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 <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
//purpose :
@ -73,38 +103,200 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
TopoDS_Shape aShape1 = aRefShape1->GetValue();
TopoDS_Shape aShape2 = aRefShape2->GetValue();
if (!aShape1.IsNull() && !aShape2.IsNull()) {
// perform COMMON operation
if (aType == BOOLEAN_COMMON) {
BRepAlgoAPI_Common BO (aShape1, aShape2);
// BO.Build();
if (!BO.IsDone()) {
StdFail_NotDone::Raise("Requested boolean operation can not be performed on the given shapes");
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_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) {
BRepAlgoAPI_Cut BO (aShape1, aShape2);
if (!BO.IsDone()) {
StdFail_NotDone::Raise("Requested boolean operation can not be performed on the given shapes");
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;
}
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);
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();
} else if (aType == BOOLEAN_SECTION) {
BRepAlgoAPI_Section BO (aShape1, aShape2);
if (!BO.IsDone()) {
StdFail_NotDone::Raise("Requested boolean operation can not be performed on the given shapes");
}
// perform SECTION operation
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 (!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);

View File

@ -54,37 +54,6 @@ typedef int (*funcPoint)(const TopoDS_Shape&,
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
//purpose :
@ -132,7 +101,7 @@ Standard_Integer GEOMImpl_ExportDriver::Execute(TFunction_Logbook& log) const
return 0;
// 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;
if ( anExportLib )
fp = (funcPoint)GetProc( anExportLib, "Export" );

View File

@ -32,6 +32,7 @@
#include <ShHealOper_FillHoles.hxx>
#include <ShHealOper_Sewing.hxx>
#include <ShHealOper_EdgeDivide.hxx>
#include <ShHealOper_ChangeOrientation.hxx>
#include <TopoDS.hxx>
#include <TopExp.hxx>
@ -115,6 +116,9 @@ Standard_Integer GEOMImpl_HealingDriver::Execute(TFunction_Logbook& log) const
case DIVIDE_EDGE:
AddPointOnEdge(&HI, anOriginalShape, aShape);
break;
case CHANGE_ORIENTATION:
ChangeOrientation(&HI, anOriginalShape, aShape);
break;
default:
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_
//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 Sew ( 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_IPipeDiffSect.hxx>
#include <Standard_Failure.hxx>
#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
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Box driver failed");
return NULL;
@ -165,6 +169,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxTwoPnt (Handle(GEOM_Objec
//Compute the Box value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Box driver failed");
return NULL;
@ -211,6 +218,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRH (double theR, dou
//Compute the Cylinder value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Cylinder driver failed");
return NULL;
@ -269,6 +279,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRH (Handle(GEO
//Compute the Cylinder value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Cylinder driver failed");
return NULL;
@ -318,6 +331,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConeR1R2H (double theR1, dou
//Compute the Cone value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Cone driver failed");
return NULL;
@ -378,6 +394,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConePntVecR1R2H (Handle(GEOM
//Compute the Cone value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Cone driver failed");
return NULL;
@ -423,6 +442,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSphereR (double theR)
//Compute the Sphere value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Sphere driver failed");
return NULL;
@ -475,6 +497,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSpherePntR (Handle(GEOM_Obje
//Compute the Sphere value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Sphere driver failed");
return NULL;
@ -523,6 +548,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusRR
//Compute the Torus value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Torus driver failed");
return NULL;
@ -580,6 +608,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusPntVecRR
//Compute the Torus value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Torus driver failed");
return NULL;
@ -637,8 +668,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Objec
//Compute the Prism value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Prism driver failed");
//SetErrorCode("Prism driver failed");
SetErrorCode("Extrusion can not be created, check input data");
return NULL;
}
}
@ -694,8 +729,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt
//Compute the Prism value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Prism driver failed");
//SetErrorCode("Prism driver failed");
SetErrorCode("Extrusion can not be created, check input data");
return NULL;
}
}
@ -749,6 +788,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipe (Handle(GEOM_Object) th
//Compute the Pipe value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Pipe driver failed");
return NULL;
@ -806,6 +848,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle(
//Compute the Revolution value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Revolution driver failed");
return NULL;
@ -858,6 +903,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSolidShell (Handle(GEOM_Obje
//Compute the Solid value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Solid driver failed");
return NULL;
@ -914,6 +962,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
//Compute the Solid value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Filling driver failed");
return NULL;
@ -1000,6 +1051,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
//Compute the ThruSections value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("ThruSections driver failed");
return anObj;
@ -1122,6 +1176,9 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
//Compute the Pipe value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Pipe with defferent section driver failed");
return anObj;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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