AC_OUTPUT_COMMANDS([ \
chmod +x ./bin/*; \
- chmod +x ./bin/salome/*; \
])
# This list is initiated using autoscan and must be updated manually
<!--
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:359px; float:none; border-style:none; }
-p.whs5 { color:#808080; font-size:12pt; }
-p.whs6 { font-size:12pt; color:#000000; }
-p.whs7 { color:#808080; font-size:12pt; margin-left:40px; }
-img_whs8 { border:none; width:330px; height:283px; float:none; border-style:none; }
+p.whs3 { font-size:12pt; font-weight:normal; }
+p.whs4 { font-size:12pt; margin-left:40px; }
+img_whs5 { border:none; width:312px; height:359px; float:none; border-style:none; }
+p.whs6 { color:#808080; font-size:12pt; }
+p.whs7 { font-size:12pt; color:#000000; font-weight:normal; }
+img_whs8 { border:none; width:400px; height:385px; float:none; border-style:none; }
+p.whs9 { font-size:12pt; color:#000000; }
+table.whs10 { x-cell-content-align:top; width:86.687%; border-spacing:0px; }
+col.whs11 { width:38.452%; }
+col.whs12 { width:28.09%; }
+col.whs13 { width:16.729%; }
+tr.whs14 { x-cell-content-align:top; }
+td.whs15 { width:38.452%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-right-style:none; border-left-style:none; border-top-style:none; }
+td.whs16 { width:28.09%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-right-style:none; border-top-style:none; }
+td.whs17 { width:16.729%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-top-style:none; border-right-style:none; }
+td.whs18 { width:38.452%; padding-right:10px; padding-left:10px; border-right-style:none; border-left-style:none; border-bottom-style:none; }
+img_whs19 { border:none; float:none; width:316px; height:270px; border-style:none; }
+td.whs20 { width:28.09%; padding-right:10px; padding-left:10px; border-right-style:none; border-bottom-style:none; }
+img_whs21 { border:none; width:212px; height:270px; float:none; border-style:none; }
+td.whs22 { width:16.729%; padding-right:10px; padding-left:10px; border-right-style:none; border-bottom-style:none; }
+table.whs23 { x-cell-content-align:top; width:100%; border-spacing:0px; }
+col.whs24 { width:100%; }
+tr.whs25 { x-cell-content-align:top; height:40px; }
+td.whs26 { width:100%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-left-style:none; border-top-style:none; border-right-style:none; }
+p.whs27 { margin-right:-6px; }
+tr.whs28 { x-cell-content-align:top; height:22px; }
+td.whs29 { width:100%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-left-style:none; border-right-style:none; }
+tr.whs30 { x-cell-content-align:top; height:41px; }
+tr.whs31 { x-cell-content-align:top; height:30px; }
+td.whs32 { width:100%; padding-right:10px; padding-left:10px; border-left-style:none; border-bottom-style:none; border-right-style:none; }
+p.whs33 { margin-left:0px; }
+img_whs34 { border:none; float:none; border-style:none; width:318px; height:269px; }
+p.whs35 { color:#808080; font-size:12pt; margin-left:40px; }
-->
-</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
+</style><script type="text/javascript" language="JavaScript">
+<!--
+if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
+{
+ var strNSS = "<style type='text/css'>";
+ strNSS += "p.whs27 {margin-right:1pt; }";
+ strNSS += "p.whs33 {margin-left:1pt; }";
+ strNSS +="</style>";
+ document.write(strNSS);
+}
+//-->
+</script>
+<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
<p class="whs2"> </p>
-<p class="whs2"><b style="font-weight: bold;"><span style="font-weight: normal;">You
- can define an</span> Arc <span style="font-weight: normal;">by</span>
- <span style="font-weight: normal;">three</span><span style="font-weight: bold;"><B>
- Points </B></span><span style="font-weight: normal;">that lie on it, where
- </span></b>Point1 is the starting point, Point2 is a middle point of the
- arc and Point3 is the ending point of the arc.</p>
+<p class="whs3"><b style="font-weight: bold;"><span
+ style="font-weight: normal;">There are 2 algorithms to create an </span><span
+ style="font-weight: bold;"><B>Arc</B></span><span style="font-weight: normal;">
+ in the 3D space. </span></b></p>
-<p class="whs2"><b><span style="font-weight: normal;">The</span>
- Result <span style="font-weight: normal;">of the operation will be a</span></b><b>
- <span style="font-weight: normal;">GEOM_Object (edge).</span></b></p>
+<p class="whs2"><b><span style="font-weight: normal;">The Result
+ of each operation will be a</span></b><b> <span style="font-weight: normal;">GEOM_Object
+ (edge).</span></b></p>
<p class="whs2"> </p>
-<p class="whs2"><b style="font-weight: bold;">TUI Command:</b>
- <span style="font-style: italic;"><I>geompy.MakeArc(Point1, Point2, Point3)</I></span></p>
+<p class="whs2"><b style="font-weight: bold;"><span style="font-weight: normal;">Firstly,
+ you can define an</span> Arc <span style="font-weight: normal;">by</span>
+ <span style="font-weight: normal;">three</span><span style="font-weight: bold;"><B>
+ Points </B></span><span style="font-weight: normal;">that lie on it, where
+ </span></b>Point1
+ is the starting point, Point2
+ is a middle point of the arc and Point3
+ is the ending point of the arc.</p>
+
+<p class="whs2"><b style="font-weight: bold;">TUI
+ Command:</b> <span style="font-style: italic;"><I>geompy.MakeArc(Point1,
+ Point2, Point3)</I></span></p>
<p class="whs2"><b style="font-weight: bold;">Arguments:</b>
Name + 3 vertices.</p>
<p class="whs2"> </p>
-<p class="whs3"><img src="pics/arc.png" x-maintain-ratio="TRUE" width="312px" height="359px" border="0" class="img_whs4"></p>
+<p class="whs4"><img src="pics/arc.png" x-maintain-ratio="TRUE" width="312px" height="359px" border="0" class="img_whs5"></p>
-<p class="whs5"> </p>
+<p class="whs6"> </p>
-<p class="whs6"><b style="font-weight: bold;">Example:</b></p>
+<p class="whs7"><b style="font-weight: normal;">Secondly,
+ you can define an <span style="font-weight: bold;"><B>Arc</B></span> by </b><span
+ style="font-weight: bold;"><B>Center, Start</B></span> and <span style="font-weight: bold;"><B>End</B></span>
+ points. The arc is built from the <span style="font-weight: bold;"><B>Start</B></span>
+ point to the <span style="font-weight: bold;"><B>End</B></span> point. The radius
+ of the arc is defined by the distance between the <span style="font-weight: bold;"><B>Center</B></span>
+ point and the <span style="font-weight: bold;"><B>Start</B></span> point. The
+ <span style="font-weight: bold;"><B>End</B></span> point defines the angle of
+ the arc. If the distance between the <span style="font-weight: bold;"><B>Center</B></span>
+ point and the <span style="font-weight: bold;"><B>End</B></span> point is not
+ equal to the radius, the arc will be built anyway.</p>
-<p class="whs5"> </p>
+<p class="whs7"><span style="font-weight: bold;"><B>Reverse</B></span>
+ radio button allows to change the direction of the arc.</p>
-<p class="whs7"><img src="pics/arcsn.png" x-maintain-ratio="TRUE" width="330px" height="283px" border="0" class="img_whs8"></p>
+<p class="whs7"><b style="font-weight: bold;">TUI Command:</b>
+ <span style="font-style: italic;"><I>geompy.MakeArcCenter(Center Point, Start
+ Point, End Point, boolean Sense)</I></span></p>
+
+<p class="whs7"><span style="font-style: italic;"><I><b
+ style="font-weight: bold;">A</I></span>rguments:</b> Name + 3 vertices + Boolean.</p>
<p class="whs7"> </p>
+<p class="whs4"><img src="pics/arc2.png" x-maintain-ratio="TRUE" width="400px" height="385px" border="0" class="img_whs8"></p>
+
+<p class="whs9"> </p>
+
+<p class="whs9"><b style="font-weight: bold;">Example:</b></p>
+
+<p class="whs9"> </p>
+
+<table x-use-null-cells cellspacing="0" width="86.687%" class="whs10">
+<col class="whs11">
+<col class="whs12">
+<col class="whs13">
+<col class="whs13">
+
+<tr valign="top" class="whs14">
+<td width="38.452%" class="whs15">
+<p>Arc by three points lying on it.</td>
+<td width="28.09%" class="whs16">
+<p>Arc by Start, End and Center.</td>
+<td colspan="1" rowspan="1" width="16.729%" class="whs17">
+<p> </td>
+<td width="16.729%" class="whs17">
+<p>Reversed arc.</td></tr>
+
+<tr valign="top" class="whs14">
+<td width="38.452%" class="whs18">
+<p class="whs6"><img src="pics/arcsn.png" x-maintain-ratio="TRUE" width="316px" height="270px" border="0" class="img_whs19"></td>
+<td width="28.09%" class="whs20">
+<p><img src="pics/arcsn1.png" x-maintain-ratio="TRUE" width="212px" height="270px" border="0" class="img_whs21"></td>
+<td colspan="1" rowspan="1" width="16.729%" class="whs22">
+<table x-use-null-cells cellspacing="0" width="100%" class="whs23">
+<col class="whs24">
+
+<tr valign="top" class="whs25">
+<td width="100%" class="whs26">
+<p class="whs27">Start Point</td></tr>
+
+<tr valign="top" class="whs28">
+<td width="100%" class="whs29">
+<p> </td></tr>
+
+<tr valign="top" class="whs30">
+<td width="100%" class="whs29">
+<p> </td></tr>
+
+<tr valign="top" class="whs25">
+<td width="100%" class="whs29">
+<p>Center Point</td></tr>
+
+<tr valign="top" class="whs31">
+<td width="100%" class="whs29">
+<p> </td></tr>
+
+<tr valign="top" class="whs25">
+<td width="100%" class="whs32">
+<p>End Point</td></tr>
+</table>
+<p class="whs33"> </p>
+<p> </td>
+<td width="16.729%" class="whs22">
+<p><img src="pics/arcsn2.png" x-maintain-ratio="TRUE" width="318px" height="269px" border="0" class="img_whs34"></td></tr>
+</table>
+
+<p class="whs35"> </p>
+
<p class="whs2">Our TUI Scripts provide you with useful examples
of creation of <a href="basic_geometrical_objects.htm">Basic Geometric
Objects</a>. </p>
files\salome2_sp3_measuregui_functions_salome2_sp3_measuregui_functions_image73.gif
files\salome2_sp3_booleangui_functions_salome2_sp3_booleangui_functions_image4.gif
salome2_sp3_buildgui_functions_salome2_sp3_buildgui_functions_image17.gif
+pics\view_rotation_point.png
pics\clipping.png
pics\image98.gif
pics\archimedesn1.png
pics\fusesn2.png
pics\toruses.png
pics\circles.png
-pics\neo-materials.png
pics\neo-obj3.png
pics\neo-localcs2.png
pics\measures1.png
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\partition2.png
pics\changeorientation.png
pics\pipesn.png
pics\pipe_wire_edgesn.png
pics\neo-localcs3.png
pics\repair4.png
pics\bool2.png
-pics\partition2.png
pics\block5.png
pics\sphere2.png
pics\point1.png
pics\circle1.png
image3.gif
files\salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image56.gif
+pics\set_rotation_point_dialog1.png
pics\extrusion1.png
image4.gif
pics\isos_u12_v12sn.png
pics\point3.png
image185.jpg
files\salome2_sp3_generationgui_functions_salome2_sp3_generationgui_functions_image57.gif
+pics\set_rotation_point_dialog2.png
pics\extrusion2.png
image5.gif
pics\free_boudaries2.png
files\salome2_sp3_primitivegui_functions_salome2_sp3_primitivegui_functions_image100.gif
files\salome2_sp3_primitivegui_functions_salome2_sp3_primitivegui_functions_image99.gif
salome2_sp3_buildgui_functions_salome2_sp3_buildgui_functions_image13.gif
+pics\transformation4a.png
pics\image100.gif
pics\geomcreategroup.png
pics\commonsn.png
+++ /dev/null
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
-
-<html>
-
-<head>
-<title>OCC_Viewer</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:313px; height:26px; float:none; }
-ul.whs2 { list-style:disc; }
-img_whs3 { border:none; width:26px; height:25px; float:none; border-style:none; }
-img_whs4 { border:none; width:27px; height:25px; float:none; border-style:none; }
-img_whs5 { border:none; width:24px; height:23px; float:none; border-style:none; }
-img_whs6 { border:none; width:24px; height:24px; float:none; border-style:none; }
-img_whs7 { border:none; width:25px; height:24px; float:none; border-style:none; }
-img_whs8 { border:none; width:23px; height:23px; float:none; border-style:none; }
-p.whs9 { margin-top:0pt; margin-bottom:0pt; }
-img_whs10 { border:none; border-style:none; width:20px; height:20px; float:none; }
-p.whs11 { margin-left:80px; }
-img_whs12 { border:none; border-style:none; width:410px; height:255px; float:none; }
-img_whs13 { border:none; width:26px; height:26px; float:none; border-style:none; }
-img_whs14 { border:none; width:78px; height:147px; float:none; border-style:none; }
-img_whs15 { border:none; height:26px; float:none; width:29px; border-style:none; }
-img_whs16 { border:none; width:26px; height:24px; float:none; border-style:none; }
-img_whs17 { border:none; width:28px; height:29px; float:none; border-style:none; }
-img_whs18 { border:none; width:29px; height:26px; float:none; border-style:none; }
-img_whs19 { border:none; width:395px; height:280px; float:none; border-style:none; }
-p.whs20 { margin-left:40px; }
-p.whs21 { margin-left:84px; }
--->
-</style><script type="text/javascript" language="JavaScript">
-<!--
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
-{
- var strNSS = "<style type='text/css'>";
- strNSS += "p.whs9 {margin-top:1pt;margin-bottom:1pt; }";
- strNSS +="</style>";
- document.write(strNSS);
-}
-//-->
-</script>
-<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
-<!--
-function reDo() {
- if (innerWidth != origWidth || innerHeight != origHeight)
- location.reload();
-}
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
- origWidth = innerWidth;
- origHeight = innerHeight;
- onresize = reDo;
-}
-onerror = null;
-//-->
-</script>
-<style type="text/css">
-<!--
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
-p.WebHelpNavBar { text-align:right; }
--->
-</style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
-<script type="text/javascript" language="javascript" src="whver.js"></script>
-<script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
-<script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
-<script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
-<script type="text/javascript" language="javascript1.2">
-<!--
-if (window.gbWhTopic)
-{
- if (window.setRelStartPage)
- {
- addTocInfo("Geometry module\nViewing geometrical objects\nOCC 3D Viewer");
-addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");
-
- }
-
-
- if (window.setRelStartPage)
- {
- setRelStartPage("index.htm");
-
- autoSync(1);
- sendSyncInfo();
- sendAveInfoOut();
- }
-
-}
-else
- if (window.gbIE4)
- document.location.reload();
-//-->
-</script>
-</head>
-<body><script type="text/javascript" language="javascript1.2">
-<!--
-if (window.writeIntopicBar)
- writeIntopicBar(4);
-//-->
-</script>
-<h1>OCC 3D Viewer</h1>
-
-<p><span style="font-weight: bold;"><B>OCC (Open CasCade) 3D viewer</B></span>
- has been developed on the basis of Open CASCADE Technology. This is the
- default viewer for Geometry Module, providing good representation of construction
- and transformation of geometrical objects. Only this viewer allows to
- work with groups and sub-shapes. This viewer can also work in Mesh module,
- however, it doesn't allow to visualize meshes. </p>
-
-<p> </p>
-
-<p>The functions of OCC viewer are available via its Viewer Toolbar. Buttons
- marked with small downward triangles have extended functionality which
- can be accessed by locking on them with left mouse button. </p>
-
-<p> </p>
-
-<p><img src="pics/image95.gif" x-maintain-ratio="TRUE" width="313px" height="26px" border="0" class="img_whs1"></p>
-
-<p> </p>
-
-<ul type="disc" class="whs2">
-
- <li class=kadov-p><p><img src="pics/image77.gif" x-maintain-ratio="TRUE" width="26px" height="25px" border="0" class="img_whs3"> <span style="font-weight: bold;"><B>Dump
- View</B></span> - exports an object from the viewer in bmp, png, jpg or jpeg
- image format. </p></li>
-
- <li class=kadov-p><p><img src="pics/image88.gif" x-maintain-ratio="TRUE" width="27px" height="25px" border="0" class="img_whs4"> <span style="font-weight: bold;"><B>Show/Hide
- Trihedron</B></span> - shows or hides coordinate axes. </p></li>
-
- <li class=kadov-p><p><img src="pics/image96.gif" x-maintain-ratio="TRUE" width="24px" height="23px" border="0" class="img_whs5"> <span
- style="font-weight: bold;"><B>Fit all - </B></span>allows
- to select a point to be the center of a scene representing all displayed
- objects in the visible area.<span style="font-weight: bold;"> <B></B></span></p></li>
-
- <li class=kadov-p><p> <img src="pics/image97.gif" x-maintain-ratio="TRUE" width="24px" height="24px" border="0" class="img_whs6"> <span style="font-weight: bold;"><B>Fit area</B></span> - resizes
- the view to place in the visible area only the contents of a frame drawn
- with pressed left mouse button.</p></li>
-
- <li class=kadov-p><p><img src="pics/image98.gif" x-maintain-ratio="TRUE" width="25px" height="24px" border="0" class="img_whs7"> <span style="font-weight: bold;"><B>Zoom</B></span>
- - allows
- to zoom in and out. </p></li>
-
- <li class=kadov-p><p><img src="pics/image99.gif" x-maintain-ratio="TRUE" width="23px" height="23px" border="0" class="img_whs8"> <span style="font-weight: bold;"><B>Panning</B></span>
- - if the represented objects are greater that the visible area and you
- don't wish to use <span style="font-weight: bold;"><B>Fit all</B></span> functionality,
- click on this button and you'll be able to drag the scene to see its remote
- parts. </p></li>
-
- <li class=kadov-p><p><img src="pics/image100.gif" x-maintain-ratio="TRUE" width="24px" height="24px" border="0" class="img_whs6"> <span style="font-weight: bold;"><B>Global
- panning</B></span> - represents all displayed objects in the visible area.
- </p></li>
-</ul>
-
-<ul type="disc" class="whs2">
-
- <li class=kadov-p><p class="whs9"><img src="pics/view_rotation_point.png" x-maintain-ratio="TRUE" width="20px" height="20px" border="0" class="img_whs10"> <span style="font-weight: bold;"><B>Change rotation point</B></span>
- - allows to to choose the point around which the rotation is performed</p></li>
-</ul>
-
-<p class="whs11"><img src="pics/set_rotation_point_dialog1.png" x-maintain-ratio="TRUE" width="410px" height="255px" border="0" class="img_whs12"></p>
-
-<p class="whs11"> </p>
-
-<p class="whs11">By default the rotation point is located
- in the Center of the bounding box of an object. </p>
-
-<p class="whs11"> </p>
-
-<p class="whs11"><img src="pics/set_rotation_point_dialog2.png" x-maintain-ratio="TRUE" width="410px" height="255px" border="0" class="img_whs12"></p>
-
-<p class="whs11"> </p>
-
-<p class="whs11">Unchecking <span style="font-weight: bold;"><B>Use
- Bounding Box Center</B></span> box allows you to define the coordinates of
- the rotation point manually. </p>
-
-<p class="whs11"> </p>
-
-<p class="whs11"><span style="font-weight: bold;"><B>Set to Origin</B></span>
- button restores the default rotation point coordinates.</p>
-
-<p class="whs11"><span style="font-weight: bold;"><B>Select Point
- from View</B></span> button allows to select the rotation point in the 3D
- Viewer</p>
-
-<p> </p>
-
-<ul type="disc" class="whs2">
-
- <li class=kadov-p><p><img src="pics/image89.gif" x-maintain-ratio="TRUE" width="26px" height="26px" border="0" class="img_whs13"> <span style="font-weight: bold;"><B>Rotation</B></span>
- - allows to rotate the selected object using the mouse. </p></li>
-
- <li class=kadov-p><p><img src="pics/image102.gif" x-maintain-ratio="TRUE" width="78px" height="147px" border="0" class="img_whs14"> These buttons orientate the scene
- strictly about coordinate axes.</p></li>
-
- <li class=kadov-p><p><img src="pics/image91.gif" x-maintain-ratio="TRUE" height="26px" width="29px" border="0" class="img_whs15"> <span style="font-weight: bold;"><B>Reset</B></span>
- - restores the default position (isometric) of objects in the scene.</p></li>
-
- <li class=kadov-p><p><img src="pics/image103.gif" x-maintain-ratio="TRUE" width="26px" height="24px" border="0" class="img_whs16"> <span style="font-weight: bold;"><B>Memorise
- view</B></span> - saves the current position of objects in the scene</p></li>
-
- <li class=kadov-p><p><img src="pics/image105.gif" x-maintain-ratio="TRUE" width="26px" height="25px" border="0" class="img_whs3"> <span style="font-weight: bold;"><B>Restore
- view - </B></span>restores the<span style="font-weight: bold;"> <B></B></span>saved
- position of objects in the scene</p></li>
-
- <li class=kadov-p><p><img src="pics/image86.gif" x-maintain-ratio="TRUE" width="28px" height="29px" border="0" class="img_whs17"> <span style="font-weight: bold;"><B>Clone
- view</B></span> - opens a new duplicate scene.</p></li>
-
- <li class=kadov-p><p><img src="pics/image106.gif" x-maintain-ratio="TRUE" width="29px" height="26px" border="0" class="img_whs18"> <span style="font-weight: bold;"><B>Clipping
- -</B></span> allows to create cross-section views (clipping planes) of geometrical
- objects.</p></li>
-</ul>
-
-<p> </p>
-
-<p class="whs11"><img src="pics/clipping.png" x-maintain-ratio="TRUE" width="395px" height="280px" border="0" class="img_whs19"></p>
-
-<p class="whs20"> </p>
-
-<ul type="disc" class="whs2">
-
- <li class=kadov-p><p class="whs20"><span style="font-weight: bold;"><B>Base
- point</B></span> - allows to define the coordinates of the base point for
- the clipping plane. Click </p></li>
-
- <li class=kadov-p><p class="whs21"><span style="font-weight: bold;"><B>Reset</B></span>
- - returns the base point to coordinate origin. </p></li>
-
- <li class=kadov-p><p class="whs20"><span style="font-weight: bold;"><B>Direction</B></span>
- - allows to define the orientation of the clipping plane.</p></li>
-
- <li class=kadov-p><p class="whs21"><span style="font-weight: bold;"><B>Invert</B></span>
- - allows to select which part of the object will be removed and which
- will remain after clipping. </p></li>
-
- <li class=kadov-p><p class="whs20"><span style="font-weight: bold;"><B>Preview</B></span>
- - allows to see the results of clipping in the viewer.</p></li>
-</ul>
-
-<p> </p>
-
-<script type="text/javascript" language="javascript1.2">
-<!--
-if (window.writeIntopicBar)
- writeIntopicBar(0);
-//-->
-</script>
-</body>
-</html>
p.whs5 { font-size:12pt; margin-left:40px; }
img_whs6 { border:none; width:312px; height:324px; float:none; border-style:none; }
img_whs7 { border:none; width:312px; height:358px; float:none; border-style:none; }
-img_whs8 { border:none; width:298px; height:302px; float:none; border-style:none; }
+p.whs8 { font-size:12pt; margin-left:40px; font-weight:bold; }
+img_whs9 { border:none; width:156px; height:203px; }
-->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
<p class="whs2"> </p>
-<p class="whs5"><b style="font-weight: bold;"><img src="pics/vectors.png" x-maintain-ratio="TRUE" width="298px" height="302px" border="0" class="img_whs8"></b></p>
+<p class="whs8"><img src="image34.gif" width="156px" height="203px" border="0" class="img_whs9"></p>
<p class="whs2"> </p>
p.whs3 { font-weight:bold; }
img_whs4 { border:none; width:26px; height:26px; border-style:none; }
img_whs5 { border:none; width:23px; height:24px; border-style:none; }
+img_whs6 { border:none; width:279px; height:230px; border-style:none; }
-->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
<h1>Viewing Geometrical Objects</h1>
<p>Newly created geometrical objects are automatically displayed in the
- <span style="font-weight: bold;"><B><a href="occ_viewer.htm">OCC 3D Viewer</a></B></span>.
- </p>
+ <span style="font-weight: bold;"><B>OCC 3D Viewer</B></span>. </p>
<p> </p>
+<p><span style="font-weight: bold;"><B>OCC 3D Viewer</B></span> is described in
+ the documentation on <span style="font-weight: bold;"><B>GUI module</B></span>.</p>
+
<p>After the object has appeared in the Viewer, you can select it with
left mouse click to change its presentation parameters and access to other
useful options by right-clicking on the selected object<span style="font-weight: bold;"><B>.</B></span></p>
all recent changes.</p></li>
<li class=kadov-p><p><span style="font-weight: bold;"><B>Dump view</B></span>
- - exports an object from the viewer in bmp, png, jpg or jpeg image format.
- </p></li>
+ - exports an object from the viewer in bmp,
+ png, jpg or
+ jpeg image format. </p></li>
<li class=kadov-p><p><span style="font-weight: bold;"><B>Change background</B></span>
- allows to redefine the background color. By default it is black. </p></li>
<p> </p>
+<p>Some of these functionalities are available through right-clicking on
+ the viewer background:</p>
+
+<p> </p>
+
+<p><img src="image2.jpg" width="279px" height="230px" border="0" class="img_whs6"></p>
+
+<p> </p>
+
+<ul type="disc" class="whs2">
+
+ <li class=kadov-p><p><span style="font-weight: bold;"><B>Select Only</B></span>
+ provides a filter for exclusive selection of objects of a certain type.
+ </p></li>
+</ul>
+
+<p> </p>
+
+<p> </p>
+
<script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
aWE("25",3,5,6,57,74);
aWE("250",37,44,59,68);
aWE("2d",5,35,59,65,74,31);
-aWE("3",1,2,5,7,11,14,18,20,37,40,44,48,55,56,59,67,74,75,31,78);
+aWE("3",1,2,5,7,11,14,18,20,37,40,44,48,55,56,59,61,67,74,75,31,78);
aWE("30",3,8,11,18,37,44,57,59,68,74);
aWE("300",37,68);
aWE("300000",44);
aWE("32",59);
aWE("32000",44);
aWE("35",6,8,57,59,74);
-aWE("3d",14,21,35,43,51,53,55,56,59,65,71,31,33,78,79,81,83);
+aWE("3d",14,21,35,43,51,55,56,59,65,71,31,33,78,79,81,83);
aWE("4",50,37,40,44,48,67,74,31);
aWE("40",6,8,18,37,57,59,74);
aWE("41",59);
aWE("addtostudy",3,4,5,6,8,11,18,37,40,57,59,68,74);
aWE("addtostudyinfath",5,59);
aWE("advanc",7,19,24,28,29,37,66,69,70,80);
-aWE("algorithm",7,14,20,21,23,28,43,46,53,55,56,67,70,77,78,82);
+aWE("algorithm",7,14,20,21,23,28,43,46,55,56,61,67,70,77,78,82);
aWE("all_fac",59);
-aWE("allow",50,9,26,45,46,47,51,61,64,65,67,72,75,33,79);
+aWE("allow",50,9,26,43,45,46,47,51,53,61,64,65,67,72,75,33,79);
aWE("along",7,9,46,49,52,54,74,75);
aWE("alongsid",31);
aWE("already",40);
aWE("although",46);
aWE("angl",47,59,60,61,65,67,74);
aWE("anoth",22,42,55,56,70,74);
-aWE("any",53,61,65,75);
+aWE("any",43,53,61,65,75);
aWE("ap",43,74,83);
aWE("appear",79,83);
aWE("append",18,37,74);
aWE("archimed",2,4);
aWE("area",44,51);
aWE("argument",0,1,2,50,7,9,10,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,41,42,43,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,66,67,69,70,71,72,73,75,77,31,78,80,82,83);
-aWE("around",47,60,74);
+aWE("around",47,51,60,74);
aWE("automatical",50,43,79);
aWE("availabl",0,50,15,32,51,67,71,72,73,83);
aWE("ax",7,43,49,51,75);
aWE("axi",18,20,23,43,45,46,47,60,61,74,33);
aWE("b",3,21,65);
aWE("background",79);
-aWE("bas",20,23,28,47,51,54,59,60,62,65,75,77);
+aWE("bas",20,23,28,43,47,51,54,59,60,62,65,75,77);
aWE("baseshap",54);
aWE("basi",28,51);
aWE("basic",1,2,3,4,14,21,25,38,30,42,43,44,53,55,56,67,33,78,82);
aWE("boolean",6,17,22,36,38,30,63,31,33);
aWE("both",7,20,48,49,65);
aWE("boudari",59);
-aWE("bound",8,37,44,33);
+aWE("bound",8,37,44,51,33);
aWE("boundari",12,59,64,72);
aWE("boundary",12,59,73);
aWE("boundingbox",44,33);
-aWE("box",4,50,5,7,11,16,22,27,40,32,44,57,59,65,67,73,74,76,33,80,83);
+aWE("box",4,50,5,7,11,16,22,27,40,32,44,51,53,57,59,65,67,73,74,76,33,80,83);
aWE("box_tr1",5);
aWE("box_tr2",5);
aWE("box1",44,57,59);
aWE("c1",65);
aWE("c2",65);
aWE("cad",38,30);
-aWE("calculat",33);
+aWE("calculat",43,33);
aWE("camera",82);
-aWE("cas",50,43,48,73);
+aWE("cas",50,43,48,61,73);
aWE("cascad",51);
aWE("catia",32);
-aWE("cent",7,14,20,25,44,46,47,51,67,70,77,33);
+aWE("cc",51);
+aWE("cent",7,14,20,25,44,46,47,51,67,70,74,77,33);
aWE("center",26);
aWE("centerofscal",62);
-aWE("central",20,23,62,65);
+aWE("central",20,23,61,62,65);
+aWE("centralpoint",61);
aWE("certain",65,83);
aWE("chain",5);
aWE("chamf",9,74);
aWE("chamfer_all",74);
aWE("chamfer_f",74);
aWE("chamfer_f1",74);
-aWE("chang",10,11,16,41,76,79,81);
+aWE("chang",10,11,16,41,51,76,79,81);
aWE("changeorientation",10);
aWE("check",12,13,27,29,44,59,65,73,33);
aWE("check_box",5);
aWE("checkbox",10,45,46,47,61,72,75,33);
aWE("checkcompoundofblock",44,33);
-aWE("checkshap",44,59);
+aWE("checkshap",44,59,33);
aWE("choic",21);
-aWE("choos",27,32,43);
+aWE("choos",27,32,43,51,53);
aWE("circl",3,14,67);
aWE("circle1",3);
aWE("circle2",3);
aWE("consol",33);
aWE("constraint",50);
aWE("construct",50,69);
-aWE("construction",21,38,30,51,31);
+aWE("construction",21,38,30,43,51,31);
aWE("contain",0,13,15,58);
aWE("content",40,32,51);
aWE("continuiti",65);
aWE("conversion",65);
aWE("convert",65);
aWE("coord",44);
-aWE("coordinat",7,20,23,26,43,44,46,51,56,67,70,74,75,77,33,78,82);
+aWE("coordinat",7,20,23,26,43,44,46,51,55,56,67,70,74,75,77,33,78,82);
aWE("copy",10,45,46,61,75);
aWE("corn",65);
aWE("corner",7,8);
aWE("creation",1,3,7,14,15,18,19,20,21,23,24,25,28,29,35,37,38,40,30,42,54,55,56,57,59,60,66,69,70,77,78,80,83);
aWE("criteria",5);
aWE("cros",51);
-aWE("cs",43);
aWE("cs1",74);
aWE("cs2",74);
aWE("cub",46);
-aWE("current",7,42,51,67,70);
+aWE("current",7,42,51,53,67,70);
aWE("curv",3,21,35,65,67);
aWE("curvatur",65);
aWE("curve2dmod",65);
aWE("definit",72);
aWE("definition",54);
aWE("deflection",2);
+aWE("defn",61);
aWE("degenerat",33);
aWE("degre",35,60,65,67);
-aWE("delet",53,83);
+aWE("delet",83);
aWE("density",2);
aWE("depend",48,65);
aWE("derivativ",65);
aWE("descr",44);
+aWE("describ",79);
aWE("description",50,44,67,68,33);
aWE("design",83);
aWE("destin",38,30);
aWE("destination",67);
+aWE("detail",79);
aWE("detect",12,64,72);
aWE("detection",65);
aWE("develop",51);
aWE("dir",47,49);
aWE("dir1",49);
aWE("dir2",49);
-aWE("direct",43);
+aWE("direct",43,61);
aWE("direction",2,14,20,25,28,43,47,48,49,51,60,61,65,67,77);
aWE("dirfaceid1",48);
aWE("dirfaceid1u",48);
aWE("distanc",39,44,52,65,33);
aWE("divid",0,59);
aWE("divideedg",0,59);
+aWE("documentation",79);
aWE("doesn",40,51);
aWE("don",7,10,15,28,49,51,70);
aWE("doubl",47,48,49,67,76);
aWE("dx",7,44,67,75,78);
aWE("dy",7,44,67,75,78);
aWE("dz",7,44,75,78);
-aWE("e",44,65);
+aWE("e",44,53,65);
aWE("e1",50);
aWE("e2",50);
aWE("e3",50);
aWE("eraseall",79);
aWE("eraseon",79);
aWE("error",12,40,33);
-aWE("etc",26,65);
+aWE("etc",26,53,65);
aWE("exampl",0,1,2,50,7,9,10,12,13,14,15,16,17,19,20,21,22,23,24,25,27,28,29,34,35,36,39,32,41,42,43,45,46,47,48,49,52,53,54,55,56,58,59,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,78,80,81,83);
aWE("except",73);
-aWE("exist",55,67,83);
+aWE("exist",67,83);
aWE("expand",32);
aWE("explod",5,26,27,37);
aWE("export",38,32,30,51,79);
aWE("factor",62,74);
aWE("fail",44,59);
aWE("fals",12);
+aWE("far",53);
aWE("field",10);
-aWE("fil",16,18,35,32,43,79,81);
+aWE("fil",16,18,35,32,79,81);
aWE("fill",72);
aWE("fillet",9,34,74);
aWE("filletall",74);
aWE("final",45,46,55,56,75,82,83);
-aWE("first",7,14,20,23,24,28,43,45,46,48,49,53,55,56,65,68,70,75,77,31,78,82);
+aWE("first",7,14,20,23,24,28,43,45,46,48,49,53,55,56,61,65,68,70,75,77,31,78,82);
aWE("fit",51);
aWE("fix",65);
aWE("fixfacesiz",65);
aWE("fre",12,13,59,64,72);
aWE("function",38,30,51,74);
aWE("functionaliti",50);
-aWE("functionality",51,67,83);
+aWE("functionality",51,53,67,83);
aWE("fus",6,11,36,31);
aWE("fuse_id",11);
aWE("g1",65);
aWE("geom",3,4,5,6,8,11,18,37,40,44,57,58,59,68,74,33);
aWE("geom_object",0,1,2,50,7,9,12,13,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,42,45,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,33,78,80,83);
aWE("geometric",1,50,14,19,21,24,25,28,29,35,42,54,55,56,60,65,66,69,78,79,80);
-aWE("geometrical",3,11,17,37,38,32,30,47,51,31,33,79,81,83);
+aWE("geometrical",3,11,17,37,38,32,30,47,51,53,31,33,79,81,83);
aWE("geometry",38,32,30,51,59,65,33);
aWE("geompy",0,1,2,3,4,50,5,6,7,8,9,10,11,12,14,15,17,18,19,20,21,23,24,25,26,27,28,29,34,35,36,37,39,40,42,43,44,45,46,47,48,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,77,31,33,78,80,83);
aWE("get",5,44,59,74,33);
aWE("gg",3,4,5,6,8,11,16,18,37,40,44,57,59,68,74,76,81);
aWE("giv",14,25,32,55,65);
aWE("given",3,5,8,9,13,18,23,26,27,29,34,37,39,42,47,52,56,59,65,68,74,77,33);
-aWE("global",43,46,51);
-aWE("glu",5,39,44,53,59,33);
+aWE("global",46,51);
+aWE("glu",5,39,44,59,33);
aWE("good",51);
aWE("gravity",26,44,47,33);
aWE("great",51);
aWE("group",5,38,40,30,51,58,83);
aWE("group_n",83);
aWE("group1",40);
+aWE("gui",79);
aWE("handl",83);
aWE("hav",65,66);
aWE("height",6,20,23,28,57,59,74);
aWE("hol",59,72);
aWE("hold",80);
aWE("how",33);
-aWE("i",18,37,40,59,65);
+aWE("i",18,37,40,53,59,65);
aWE("i11",33);
aWE("i12",33);
aWE("i13",33);
aWE("id_p",59);
aWE("id_p_on_arc",3);
aWE("id_p0",3);
-aWE("id_p1",3,8);
+aWE("id_p1",3,8,74);
aWE("id_p100",3);
-aWE("id_p2",3,8);
+aWE("id_p2",3,8,74);
aWE("id_p3",3,8);
aWE("id_p4",3,8,74);
aWE("id_partition1",4);
aWE("id_revolution",18);
aWE("id_rot1d",74);
aWE("id_rot2d",74);
-aWE("id_rotation",74);
+aWE("id_rotation1",74);
+aWE("id_rotation2",74);
aWE("id_scal",74);
aWE("id_section",6);
aWE("id_sew",59);
aWE("idlist",59,74);
aWE("idlist_",74);
aWE("idlist_f",74);
-aWE("if",0,10,12,15,20,29,40,44,51,53,59,65,72,73,33);
+aWE("if",0,10,12,15,20,29,40,44,51,59,65,72,73,33);
aWE("ig",38,32,30);
+aWE("ignor",53);
aWE("ii",5);
aWE("imag",45,51,74,79);
aWE("imp",65);
aWE("implement",32);
+aWE("implementation",53);
aWE("impli",65);
aWE("import",3,4,5,6,8,11,18,37,38,40,32,30,44,57,59,68,74,33);
aWE("importation",32);
aWE("increas",15);
aWE("independent",17);
aWE("index",26,83);
-aWE("indic",9,26,53,59);
+aWE("indic",9,26,59);
aWE("indicat",49,56);
aWE("inertia",44,33);
aWE("inform",33);
aWE("initial",10,45,46,47,61,62,75);
aWE("inquir",33);
aWE("insert",15);
-aWE("insid",53);
aWE("instead",20);
aWE("integ",48);
aWE("integer",27,48);
aWE("length",0,44,67,33);
aWE("li",1,14);
aWE("limit",53);
-aWE("lin",2,3,42,67,83);
+aWE("lin",2,3,42,43,67,83);
aWE("line1",3);
aWE("line2",3);
aWE("linear",67);
aWE("listofwireid",72);
aWE("listshap",34);
aWE("ll",51);
-aWE("local",43,46,52,67,74);
+aWE("local",43,46,52,55,67,74,82);
aWE("localcs1",46);
aWE("localcs2",46);
-aWE("locat",56);
+aWE("locat",51,56);
aWE("location",32,43,46,74);
aWE("lock",10,51);
aWE("lsc",46);
aWE("main",0,1,2,50,7,9,10,12,13,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,42,43,44,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,33,78,80,82,83);
aWE("mainshap",83);
aWE("major",25,77);
-aWE("mak",5,6,9,44,48,49,53,59,74,75,83);
+aWE("mak",5,6,9,44,48,49,59,74,75,83);
aWE("make_block_explod",5);
aWE("makearc",1,3,18,37,59,68,74);
aWE("makebezi",3,21);
aWE("makequad4vertic",50,8);
aWE("makerevolution",18,60);
aWE("makerotation",59,61,74);
+aWE("makerotationthreepoint",61,74);
aWE("makescaletransform",62,74);
aWE("makesection",6,63);
aWE("makesew",59,64);
aWE("makevertexoncurv",3,56);
aWE("makevertexwithref",3,56);
aWE("makewir",3,18,37,59,68,74,80);
-aWE("manual",83);
+aWE("manual",51,83);
aWE("mark",51);
aWE("mas",44,33);
-aWE("material",53);
aWE("math",44,59,74);
aWE("matrix",44,33);
aWE("max",27,35,44,65);
aWE("model",2,38,30);
aWE("modifi",15,46);
aWE("modify",46,74);
-aWE("modul",38,32,30,51);
+aWE("modul",38,32,30,51,79);
aWE("moment",44,33);
aWE("mous",51,79);
aWE("mov",46,49);
aWE("nbtimesv",48);
aWE("ncentr",44);
aWE("ncompound",44);
-aWE("ne",7,9,26,28,29,34,35,47,49,54,60,61,62,65,70,75);
+aWE("ne",7,9,26,28,29,34,35,47,49,54,60,62,65,70,75);
aWE("necessari",65);
aWE("necessary",9,34,65,67,33);
-aWE("need",15);
+aWE("need",15,61);
aWE("negativ",52);
aWE("neighbour",65);
-aWE("new",1,50,7,14,15,19,20,21,23,24,25,26,28,29,35,42,43,51,54,55,56,60,66,67,69,70,74,77,78,79,80,82,83);
+aWE("new",1,50,7,14,15,19,20,21,23,24,25,26,28,29,35,42,43,51,53,54,55,56,60,66,67,69,70,74,77,78,79,80,82,83);
aWE("ninertia",44);
aWE("nminimal",44);
aWE("nod",21);
aWE("nth",65);
aWE("numb",27,35,41,47,48,49,52,59,64,65,72,74,79);
aWE("number",48);
-aWE("object",1,2,3,4,5,6,8,9,10,11,14,16,17,18,19,21,24,25,26,28,29,34,35,37,38,40,32,30,42,43,45,46,47,51,52,54,55,56,57,58,59,60,61,65,66,68,69,73,74,75,31,33,78,79,80,81,83);
+aWE("object",1,2,3,4,5,6,8,9,10,11,14,16,17,18,19,21,24,25,26,28,29,34,35,37,38,40,32,30,42,43,45,46,47,51,52,53,54,55,56,57,58,59,60,61,65,66,68,69,73,74,75,31,33,78,79,80,81,83);
aWE("obtain",26,44,46,65);
aWE("occ",0,9,15,34,51,71,72,73,79,83);
aWE("occur",12);
aWE("offset",52,74);
aWE("ok",43,44,59,83);
-aWE("old",56);
-aWE("on",0,15,22,47,48,49,55,56,59,65,67,82);
+aWE("old",53,56);
+aWE("on",0,15,22,47,48,49,56,59,65,67,82);
aWE("opaqu",76);
aWE("open",12,15,32,51,59,83);
aWE("openwir",12,59);
aWE("orientat",51);
aWE("orientation",10,51);
aWE("origin",7,20,23,43,51,70,77,78);
+aWE("orthogonal",61);
aWE("os",59);
aWE("otherwis",0,15,45,46,61,75);
aWE("our",0,1,2,50,7,9,12,13,14,15,16,17,19,20,21,22,23,24,25,27,28,29,34,35,36,39,42,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,33,78,80,81,83);
aWE("out",51,65);
-aWE("outsid",53);
aWE("outward",10);
aWE("ox",43,67);
aWE("oy",43);
aWE("p8",8,18);
aWE("p9",8);
aWE("pan",51);
-aWE("parallel",7,42,43,65);
+aWE("parallel",7,42,65);
aWE("paramet",0,15,56,65);
-aWE("parameter",4,16,35,59,65,67,76,79,81);
+aWE("parameter",4,16,35,53,59,65,67,76,79,81);
aWE("parameterization",65);
aWE("parametric",65);
aWE("paramt",0);
aWE("partition1",4);
aWE("partition2",4);
aWE("partition3",4);
-aWE("pas",5,21,42,44,47,55,67);
+aWE("partitionalgo",53);
+aWE("pas",5,21,42,44,47,55,61,67);
aWE("path",18,54);
aWE("pathshap",54);
-aWE("perform",4,26,53,74);
+aWE("perform",4,26,51,74);
aWE("perpendicular",67);
aWE("pi",47,59,74);
aWE("pictur",46);
aWE("pip",18,54);
aWE("plac",46,51,65);
-aWE("plan",2,3,4,45,51,53,55,67,74,82,83);
+aWE("plan",2,3,4,45,51,53,55,61,67,74,82,83);
aWE("planar",29,67,68,74,82);
aWE("plane1",3);
aWE("plane2",3);
aWE("plug",32);
aWE("plung",2);
aWE("png",51,79);
-aWE("point",0,1,3,4,50,7,8,14,15,18,20,21,23,24,25,28,37,40,42,43,44,45,47,51,52,55,56,59,62,65,67,68,70,74,75,77,33,78,83);
-aWE("point1",1,3,7,8,14,24,28,42,55,75,78);
-aWE("point2",1,3,7,8,14,24,28,42,55,75,78);
+aWE("point",0,1,3,4,50,7,8,14,15,18,20,21,23,24,25,28,37,40,42,43,44,45,47,51,52,55,56,59,61,62,65,67,68,70,74,75,77,33,78,83);
+aWE("point1",1,3,7,8,14,24,28,42,55,61,75,78);
+aWE("point2",1,3,7,8,14,24,28,42,55,61,75,78);
aWE("point3",1,3,8,14,55);
aWE("point4",3,8);
aWE("point5",3);
aWE("possibl",5,21,58,65,33);
aWE("precision",59,64);
aWE("predefin",67);
+aWE("preferrabl",53);
aWE("pres",43,51);
aWE("presentation",79);
-aWE("presum",43);
aWE("preview",51);
aWE("previou",65,67);
aWE("primitiv",7,20,23,38,30,57,70,77);
aWE("regard",56);
aWE("relativ",67);
aWE("relevant",81);
-aWE("remain",51,81);
+aWE("remain",51,53,81);
aWE("remaind",46);
aWE("remot",51);
aWE("remov",40,45,46,51,59,61,65,71,72,73,75,83);
aWE("rot2d",74);
aWE("rotat",47,51,60,61,74);
aWE("rotation",47,51,59,61,74);
+aWE("rotation1",74);
+aWE("rotation2",74);
aWE("rul",65);
aWE("runtimeerror",44,59);
aWE("s",12,14,15,18,37,48,59,62,71,72,73,83);
aWE("script",0,1,2,50,7,9,12,13,14,15,16,17,19,20,21,22,23,24,25,27,28,29,34,35,36,39,42,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,33,78,80,81,83);
aWE("se",46,51,81);
aWE("search",32);
-aWE("second",7,14,20,23,28,43,45,46,48,49,53,55,56,65,68,70,75,77,31,78,82);
+aWE("second",7,14,20,23,28,43,45,46,48,49,53,55,56,61,65,68,70,75,77,31,78,82);
aWE("section",2,6,51,63,31);
aWE("seem",59);
aWE("segment",65,67);
aWE("select",0,1,2,4,7,9,10,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,40,32,42,43,45,46,47,48,49,51,52,53,54,55,56,58,59,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,33,78,79,80,81,82,83);
aWE("selection",34,67,82,83);
-aWE("sens",53);
aWE("separat",31);
aWE("serv",21,28,54,60);
-aWE("set",0,15,27,29,37,47,52,56,82);
+aWE("set",0,15,27,29,37,47,51,52,56,82);
aWE("setcolor",11,16);
aWE("setdisplaymod",3,4,5,6,8,11,18,37,57,59,68,74,81);
aWE("settransparency",3,11,37,68,74,76);
aWE("shar",13);
aWE("sharp",65);
aWE("shel",13,19,37,52,66,69,81);
-aWE("shell",50,10,28,37,52,54,60,66,69);
+aWE("shell",50,10,28,37,52,53,54,60,66,69);
aWE("shift",46,56,80,83);
aWE("short",16,81);
aWE("shortcut",29);
aWE("shown",43);
aWE("sid",55);
aWE("sign",52);
-aWE("similar",55);
aWE("simp",43);
aWE("simpl",47,48,49);
+aWE("sinc",53);
aWE("singl",29);
aWE("six",50,8);
aWE("siz",9,55,65);
aWE("skip",83);
aWE("small",51,65);
aWE("so",29,46);
-aWE("solid",50,7,8,20,23,26,28,37,48,52,54,60,69,70,77);
+aWE("solid",50,7,8,20,23,26,28,37,48,52,53,54,60,69,70,77);
aWE("solid1",8);
aWE("solid2",8);
aWE("sort",26);
aWE("subtraction",46);
aWE("successful",44);
aWE("sup_fac",59);
+aWE("support",53);
aWE("suppres",59,71,72,73);
aWE("suppressfac",59,71);
aWE("suppresshol",59,72);
aWE("symmetric",74);
aWE("symmetrical",45,74);
aWE("symmetry",45);
-aWE("system",20,23,43,46,70,74,82);
+aWE("system",20,23,43,46,55,70,74,82);
aWE("t",7,10,28,40,51,70);
aWE("tak",65);
aWE("tangent",65,67);
aWE("theshap",39,59,33);
aWE("thestartlc",46);
aWE("thetoleranc",39);
-aWE("third",7);
-aWE("thre",1,3,14,18,21,37,43,45,55,56,68,74,82);
+aWE("third",7,61);
+aWE("thre",1,3,14,18,21,37,43,45,55,56,61,68,74,82);
aWE("thu",65,76);
aWE("tim",21,47,49,56,74);
aWE("tobezi",65);
aWE("triangl",51);
aWE("trihedron",51);
aWE("trimsiz",3,4,55);
-aWE("tru",0,15,53,59,33);
+aWE("tru",0,15,59,33);
aWE("truncat",20);
aWE("try",29);
aWE("tt",37,68);
aWE("tui",0,1,2,50,7,9,10,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,42,43,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,33,78,79,80,81,83);
aWE("tupl",33);
-aWE("two",0,3,4,50,7,8,9,13,17,18,20,24,36,37,39,40,46,47,48,49,53,65,68,70,74,77,33,82,83);
+aWE("two",0,3,4,50,7,8,9,13,17,18,20,24,36,37,39,40,46,47,48,49,53,61,65,68,70,74,77,33,82,83);
aWE("typ",21,26,27,53,65,67,31,33,83);
aWE("u",65);
-aWE("uncheck",10);
+aWE("uncheck",10,51);
aWE("underly",15,65);
aWE("unionlist",40);
aWE("up",16,20,81);
aWE("vector2_arc2",18);
aWE("vector3",18);
aWE("versa",65);
+aWE("version",53);
aWE("vertex",3,4,6,14,15,18,20,23,24,25,28,37,44,45,54,55,56,57,59,60,62,70,74,77,33);
aWE("vertex_n",56);
aWE("vertex1",24);
aWE("whil",12,18,37,44,65,81);
aWE("whos",29,33);
aWE("wid",38,30);
-aWE("will",0,1,2,50,7,9,10,12,13,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,32,42,43,45,46,47,48,49,51,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,78,80,83);
+aWE("will",0,1,2,50,7,9,10,12,13,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,32,42,45,46,47,48,49,51,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,78,80,83);
aWE("wir",3,50,12,15,18,26,28,29,37,44,54,59,60,67,68,72,73,74,80);
aWE("wire_clos",59);
aWE("wire_nam",59);
aWE("ymax",44,33);
aWE("ymin",44,33);
aWE("your",16,32,64,72,79,82,83);
-aWE("yourselv",43);
aWE("yz_fac",5);
aWE("yz_face_ind",5);
aWE("z",2,3,7,43,56,70,33);
<script language="javascript" src="whtdata.js"></script>
<script language="javascript">
<!--
- aTE(1,98,"Geometry module");
+ aTE(1,97,"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");
aTE(2,0,"Shell","shell.htm");
aTE(2,0,"Solid","solid.htm");
aTE(2,0,"Compound","compound.htm");
- aTE(1,6,"Viewing geometrical objects");
+ aTE(1,5,"Viewing geometrical objects");
aTE(2,0,"Viewing Geometrical Objects","viewing_geometrical_objects.htm");
- aTE(2,0,"OCC 3D Viewer","occ_viewer.htm");
aTE(2,0,"Display Mode","wireframe_and_shading.htm");
aTE(2,0,"Color","color.htm");
aTE(2,0,"Transparency","transparency.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,"Python interface geompy.py" , geompy_doc/namespacegeompy.html");
- aTE(1,16,"TUI Scripts");
+ 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");
aTE(2,0,"Basic Geometrical Objects","basic_geometrical_objects.htm");
<key name="25"> 3,5,6,57,74, </key>
<key name="250"> 37,44,59,68, </key>
<key name="2d"> 5,35,59,65,74,31, </key>
-<key name="3"> 1,2,5,7,11,14,18,20,37,40,44,48,55,56,59,67,74,75,31,78, </key>
+<key name="3"> 1,2,5,7,11,14,18,20,37,40,44,48,55,56,59,61,67,74,75,31,78, </key>
<key name="30"> 3,8,11,18,37,44,57,59,68,74, </key>
<key name="300"> 37,68, </key>
<key name="300000"> 44, </key>
<key name="32"> 59, </key>
<key name="32000"> 44, </key>
<key name="35"> 6,8,57,59,74, </key>
-<key name="3d"> 14,21,35,43,51,53,55,56,59,65,71,31,33,78,79,81,83, </key>
+<key name="3d"> 14,21,35,43,51,55,56,59,65,71,31,33,78,79,81,83, </key>
<key name="4"> 50,37,40,44,48,67,74,31, </key>
<key name="40"> 6,8,18,37,57,59,74, </key>
<key name="41"> 59, </key>
<key name="addtostudy"> 3,4,5,6,8,11,18,37,40,57,59,68,74, </key>
<key name="addtostudyinfath"> 5,59, </key>
<key name="advanc"> 7,19,24,28,29,37,66,69,70,80, </key>
-<key name="algorithm"> 7,14,20,21,23,28,43,46,53,55,56,67,70,77,78,82, </key>
+<key name="algorithm"> 7,14,20,21,23,28,43,46,55,56,61,67,70,77,78,82, </key>
<key name="all_fac"> 59, </key>
-<key name="allow"> 50,9,26,45,46,47,51,61,64,65,67,72,75,33,79, </key>
+<key name="allow"> 50,9,26,43,45,46,47,51,53,61,64,65,67,72,75,33,79, </key>
<key name="along"> 7,9,46,49,52,54,74,75, </key>
<key name="alongsid"> 31, </key>
<key name="already"> 40, </key>
<key name="although"> 46, </key>
<key name="angl"> 47,59,60,61,65,67,74, </key>
<key name="anoth"> 22,42,55,56,70,74, </key>
-<key name="any"> 53,61,65,75, </key>
+<key name="any"> 43,53,61,65,75, </key>
<key name="ap"> 43,74,83, </key>
<key name="appear"> 79,83, </key>
<key name="append"> 18,37,74, </key>
<key name="archimed"> 2,4, </key>
<key name="area"> 44,51, </key>
<key name="argument"> 0,1,2,50,7,9,10,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,41,42,43,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,66,67,69,70,71,72,73,75,77,31,78,80,82,83, </key>
-<key name="around"> 47,60,74, </key>
+<key name="around"> 47,51,60,74, </key>
<key name="automatical"> 50,43,79, </key>
<key name="availabl"> 0,50,15,32,51,67,71,72,73,83, </key>
<key name="ax"> 7,43,49,51,75, </key>
<key name="axi"> 18,20,23,43,45,46,47,60,61,74,33, </key>
<key name="b"> 3,21,65, </key>
<key name="background"> 79, </key>
-<key name="bas"> 20,23,28,47,51,54,59,60,62,65,75,77, </key>
+<key name="bas"> 20,23,28,43,47,51,54,59,60,62,65,75,77, </key>
<key name="baseshap"> 54, </key>
<key name="basi"> 28,51, </key>
<key name="basic"> 1,2,3,4,14,21,25,38,30,42,43,44,53,55,56,67,33,78,82, </key>
<key name="boolean"> 6,17,22,36,38,30,63,31,33, </key>
<key name="both"> 7,20,48,49,65, </key>
<key name="boudari"> 59, </key>
-<key name="bound"> 8,37,44,33, </key>
+<key name="bound"> 8,37,44,51,33, </key>
<key name="boundari"> 12,59,64,72, </key>
<key name="boundary"> 12,59,73, </key>
<key name="boundingbox"> 44,33, </key>
-<key name="box"> 4,50,5,7,11,16,22,27,40,32,44,57,59,65,67,73,74,76,33,80,83, </key>
+<key name="box"> 4,50,5,7,11,16,22,27,40,32,44,51,53,57,59,65,67,73,74,76,33,80,83, </key>
<key name="box_tr1"> 5, </key>
<key name="box_tr2"> 5, </key>
<key name="box1"> 44,57,59, </key>
<key name="c1"> 65, </key>
<key name="c2"> 65, </key>
<key name="cad"> 38,30, </key>
-<key name="calculat"> 33, </key>
+<key name="calculat"> 43,33, </key>
<key name="camera"> 82, </key>
-<key name="cas"> 50,43,48,73, </key>
+<key name="cas"> 50,43,48,61,73, </key>
<key name="cascad"> 51, </key>
<key name="catia"> 32, </key>
-<key name="cent"> 7,14,20,25,44,46,47,51,67,70,77,33, </key>
+<key name="cc"> 51, </key>
+<key name="cent"> 7,14,20,25,44,46,47,51,67,70,74,77,33, </key>
<key name="center"> 26, </key>
<key name="centerofscal"> 62, </key>
-<key name="central"> 20,23,62,65, </key>
+<key name="central"> 20,23,61,62,65, </key>
+<key name="centralpoint"> 61, </key>
<key name="certain"> 65,83, </key>
<key name="chain"> 5, </key>
<key name="chamf"> 9,74, </key>
<key name="chamfer_all"> 74, </key>
<key name="chamfer_f"> 74, </key>
<key name="chamfer_f1"> 74, </key>
-<key name="chang"> 10,11,16,41,76,79,81, </key>
+<key name="chang"> 10,11,16,41,51,76,79,81, </key>
<key name="changeorientation"> 10, </key>
<key name="check"> 12,13,27,29,44,59,65,73,33, </key>
<key name="check_box"> 5, </key>
<key name="checkbox"> 10,45,46,47,61,72,75,33, </key>
<key name="checkcompoundofblock"> 44,33, </key>
-<key name="checkshap"> 44,59, </key>
+<key name="checkshap"> 44,59,33, </key>
<key name="choic"> 21, </key>
-<key name="choos"> 27,32,43, </key>
+<key name="choos"> 27,32,43,51,53, </key>
<key name="circl"> 3,14,67, </key>
<key name="circle1"> 3, </key>
<key name="circle2"> 3, </key>
<key name="consol"> 33, </key>
<key name="constraint"> 50, </key>
<key name="construct"> 50,69, </key>
-<key name="construction"> 21,38,30,51,31, </key>
+<key name="construction"> 21,38,30,43,51,31, </key>
<key name="contain"> 0,13,15,58, </key>
<key name="content"> 40,32,51, </key>
<key name="continuiti"> 65, </key>
<key name="conversion"> 65, </key>
<key name="convert"> 65, </key>
<key name="coord"> 44, </key>
-<key name="coordinat"> 7,20,23,26,43,44,46,51,56,67,70,74,75,77,33,78,82, </key>
+<key name="coordinat"> 7,20,23,26,43,44,46,51,55,56,67,70,74,75,77,33,78,82, </key>
<key name="copy"> 10,45,46,61,75, </key>
<key name="corn"> 65, </key>
<key name="corner"> 7,8, </key>
<key name="creation"> 1,3,7,14,15,18,19,20,21,23,24,25,28,29,35,37,38,40,30,42,54,55,56,57,59,60,66,69,70,77,78,80,83, </key>
<key name="criteria"> 5, </key>
<key name="cros"> 51, </key>
-<key name="cs"> 43, </key>
<key name="cs1"> 74, </key>
<key name="cs2"> 74, </key>
<key name="cub"> 46, </key>
-<key name="current"> 7,42,51,67,70, </key>
+<key name="current"> 7,42,51,53,67,70, </key>
<key name="curv"> 3,21,35,65,67, </key>
<key name="curvatur"> 65, </key>
<key name="curve2dmod"> 65, </key>
<key name="definit"> 72, </key>
<key name="definition"> 54, </key>
<key name="deflection"> 2, </key>
+<key name="defn"> 61, </key>
<key name="degenerat"> 33, </key>
<key name="degre"> 35,60,65,67, </key>
-<key name="delet"> 53,83, </key>
+<key name="delet"> 83, </key>
<key name="density"> 2, </key>
<key name="depend"> 48,65, </key>
<key name="derivativ"> 65, </key>
<key name="descr"> 44, </key>
+<key name="describ"> 79, </key>
<key name="description"> 50,44,67,68,33, </key>
<key name="design"> 83, </key>
<key name="destin"> 38,30, </key>
<key name="destination"> 67, </key>
+<key name="detail"> 79, </key>
<key name="detect"> 12,64,72, </key>
<key name="detection"> 65, </key>
<key name="develop"> 51, </key>
<key name="dir"> 47,49, </key>
<key name="dir1"> 49, </key>
<key name="dir2"> 49, </key>
-<key name="direct"> 43, </key>
+<key name="direct"> 43,61, </key>
<key name="direction"> 2,14,20,25,28,43,47,48,49,51,60,61,65,67,77, </key>
<key name="dirfaceid1"> 48, </key>
<key name="dirfaceid1u"> 48, </key>
<key name="distanc"> 39,44,52,65,33, </key>
<key name="divid"> 0,59, </key>
<key name="divideedg"> 0,59, </key>
+<key name="documentation"> 79, </key>
<key name="doesn"> 40,51, </key>
<key name="don"> 7,10,15,28,49,51,70, </key>
<key name="doubl"> 47,48,49,67,76, </key>
<key name="dx"> 7,44,67,75,78, </key>
<key name="dy"> 7,44,67,75,78, </key>
<key name="dz"> 7,44,75,78, </key>
-<key name="e"> 44,65, </key>
+<key name="e"> 44,53,65, </key>
<key name="e1"> 50, </key>
<key name="e2"> 50, </key>
<key name="e3"> 50, </key>
<key name="eraseall"> 79, </key>
<key name="eraseon"> 79, </key>
<key name="error"> 12,40,33, </key>
-<key name="etc"> 26,65, </key>
+<key name="etc"> 26,53,65, </key>
<key name="exampl"> 0,1,2,50,7,9,10,12,13,14,15,16,17,19,20,21,22,23,24,25,27,28,29,34,35,36,39,32,41,42,43,45,46,47,48,49,52,53,54,55,56,58,59,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,78,80,81,83, </key>
<key name="except"> 73, </key>
-<key name="exist"> 55,67,83, </key>
+<key name="exist"> 67,83, </key>
<key name="expand"> 32, </key>
<key name="explod"> 5,26,27,37, </key>
<key name="export"> 38,32,30,51,79, </key>
<key name="factor"> 62,74, </key>
<key name="fail"> 44,59, </key>
<key name="fals"> 12, </key>
+<key name="far"> 53, </key>
<key name="field"> 10, </key>
-<key name="fil"> 16,18,35,32,43,79,81, </key>
+<key name="fil"> 16,18,35,32,79,81, </key>
<key name="fill"> 72, </key>
<key name="fillet"> 9,34,74, </key>
<key name="filletall"> 74, </key>
<key name="final"> 45,46,55,56,75,82,83, </key>
-<key name="first"> 7,14,20,23,24,28,43,45,46,48,49,53,55,56,65,68,70,75,77,31,78,82, </key>
+<key name="first"> 7,14,20,23,24,28,43,45,46,48,49,53,55,56,61,65,68,70,75,77,31,78,82, </key>
<key name="fit"> 51, </key>
<key name="fix"> 65, </key>
<key name="fixfacesiz"> 65, </key>
<key name="fre"> 12,13,59,64,72, </key>
<key name="function"> 38,30,51,74, </key>
<key name="functionaliti"> 50, </key>
-<key name="functionality"> 51,67,83, </key>
+<key name="functionality"> 51,53,67,83, </key>
<key name="fus"> 6,11,36,31, </key>
<key name="fuse_id"> 11, </key>
<key name="g1"> 65, </key>
<key name="geom"> 3,4,5,6,8,11,18,37,40,44,57,58,59,68,74,33, </key>
<key name="geom_object"> 0,1,2,50,7,9,12,13,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,42,45,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,33,78,80,83, </key>
<key name="geometric"> 1,50,14,19,21,24,25,28,29,35,42,54,55,56,60,65,66,69,78,79,80, </key>
-<key name="geometrical"> 3,11,17,37,38,32,30,47,51,31,33,79,81,83, </key>
+<key name="geometrical"> 3,11,17,37,38,32,30,47,51,53,31,33,79,81,83, </key>
<key name="geometry"> 38,32,30,51,59,65,33, </key>
<key name="geompy"> 0,1,2,3,4,50,5,6,7,8,9,10,11,12,14,15,17,18,19,20,21,23,24,25,26,27,28,29,34,35,36,37,39,40,42,43,44,45,46,47,48,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,77,31,33,78,80,83, </key>
<key name="get"> 5,44,59,74,33, </key>
<key name="gg"> 3,4,5,6,8,11,16,18,37,40,44,57,59,68,74,76,81, </key>
<key name="giv"> 14,25,32,55,65, </key>
<key name="given"> 3,5,8,9,13,18,23,26,27,29,34,37,39,42,47,52,56,59,65,68,74,77,33, </key>
-<key name="global"> 43,46,51, </key>
-<key name="glu"> 5,39,44,53,59,33, </key>
+<key name="global"> 46,51, </key>
+<key name="glu"> 5,39,44,59,33, </key>
<key name="good"> 51, </key>
<key name="gravity"> 26,44,47,33, </key>
<key name="great"> 51, </key>
<key name="group"> 5,38,40,30,51,58,83, </key>
<key name="group_n"> 83, </key>
<key name="group1"> 40, </key>
+<key name="gui"> 79, </key>
<key name="handl"> 83, </key>
<key name="hav"> 65,66, </key>
<key name="height"> 6,20,23,28,57,59,74, </key>
<key name="hol"> 59,72, </key>
<key name="hold"> 80, </key>
<key name="how"> 33, </key>
-<key name="i"> 18,37,40,59,65, </key>
+<key name="i"> 18,37,40,53,59,65, </key>
<key name="i11"> 33, </key>
<key name="i12"> 33, </key>
<key name="i13"> 33, </key>
<key name="id_p"> 59, </key>
<key name="id_p_on_arc"> 3, </key>
<key name="id_p0"> 3, </key>
-<key name="id_p1"> 3,8, </key>
+<key name="id_p1"> 3,8,74, </key>
<key name="id_p100"> 3, </key>
-<key name="id_p2"> 3,8, </key>
+<key name="id_p2"> 3,8,74, </key>
<key name="id_p3"> 3,8, </key>
<key name="id_p4"> 3,8,74, </key>
<key name="id_partition1"> 4, </key>
<key name="id_revolution"> 18, </key>
<key name="id_rot1d"> 74, </key>
<key name="id_rot2d"> 74, </key>
-<key name="id_rotation"> 74, </key>
+<key name="id_rotation1"> 74, </key>
+<key name="id_rotation2"> 74, </key>
<key name="id_scal"> 74, </key>
<key name="id_section"> 6, </key>
<key name="id_sew"> 59, </key>
<key name="idlist"> 59,74, </key>
<key name="idlist_"> 74, </key>
<key name="idlist_f"> 74, </key>
-<key name="if"> 0,10,12,15,20,29,40,44,51,53,59,65,72,73,33, </key>
+<key name="if"> 0,10,12,15,20,29,40,44,51,59,65,72,73,33, </key>
<key name="ig"> 38,32,30, </key>
+<key name="ignor"> 53, </key>
<key name="ii"> 5, </key>
<key name="imag"> 45,51,74,79, </key>
<key name="imp"> 65, </key>
<key name="implement"> 32, </key>
+<key name="implementation"> 53, </key>
<key name="impli"> 65, </key>
<key name="import"> 3,4,5,6,8,11,18,37,38,40,32,30,44,57,59,68,74,33, </key>
<key name="importation"> 32, </key>
<key name="increas"> 15, </key>
<key name="independent"> 17, </key>
<key name="index"> 26,83, </key>
-<key name="indic"> 9,26,53,59, </key>
+<key name="indic"> 9,26,59, </key>
<key name="indicat"> 49,56, </key>
<key name="inertia"> 44,33, </key>
<key name="inform"> 33, </key>
<key name="initial"> 10,45,46,47,61,62,75, </key>
<key name="inquir"> 33, </key>
<key name="insert"> 15, </key>
-<key name="insid"> 53, </key>
<key name="instead"> 20, </key>
<key name="integ"> 48, </key>
<key name="integer"> 27,48, </key>
<key name="length"> 0,44,67,33, </key>
<key name="li"> 1,14, </key>
<key name="limit"> 53, </key>
-<key name="lin"> 2,3,42,67,83, </key>
+<key name="lin"> 2,3,42,43,67,83, </key>
<key name="line1"> 3, </key>
<key name="line2"> 3, </key>
<key name="linear"> 67, </key>
<key name="listofwireid"> 72, </key>
<key name="listshap"> 34, </key>
<key name="ll"> 51, </key>
-<key name="local"> 43,46,52,67,74, </key>
+<key name="local"> 43,46,52,55,67,74,82, </key>
<key name="localcs1"> 46, </key>
<key name="localcs2"> 46, </key>
-<key name="locat"> 56, </key>
+<key name="locat"> 51,56, </key>
<key name="location"> 32,43,46,74, </key>
<key name="lock"> 10,51, </key>
<key name="lsc"> 46, </key>
<key name="main"> 0,1,2,50,7,9,10,12,13,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,42,43,44,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,33,78,80,82,83, </key>
<key name="mainshap"> 83, </key>
<key name="major"> 25,77, </key>
-<key name="mak"> 5,6,9,44,48,49,53,59,74,75,83, </key>
+<key name="mak"> 5,6,9,44,48,49,59,74,75,83, </key>
<key name="make_block_explod"> 5, </key>
<key name="makearc"> 1,3,18,37,59,68,74, </key>
<key name="makebezi"> 3,21, </key>
<key name="makequad4vertic"> 50,8, </key>
<key name="makerevolution"> 18,60, </key>
<key name="makerotation"> 59,61,74, </key>
+<key name="makerotationthreepoint"> 61,74, </key>
<key name="makescaletransform"> 62,74, </key>
<key name="makesection"> 6,63, </key>
<key name="makesew"> 59,64, </key>
<key name="makevertexoncurv"> 3,56, </key>
<key name="makevertexwithref"> 3,56, </key>
<key name="makewir"> 3,18,37,59,68,74,80, </key>
-<key name="manual"> 83, </key>
+<key name="manual"> 51,83, </key>
<key name="mark"> 51, </key>
<key name="mas"> 44,33, </key>
-<key name="material"> 53, </key>
<key name="math"> 44,59,74, </key>
<key name="matrix"> 44,33, </key>
<key name="max"> 27,35,44,65, </key>
<key name="model"> 2,38,30, </key>
<key name="modifi"> 15,46, </key>
<key name="modify"> 46,74, </key>
-<key name="modul"> 38,32,30,51, </key>
+<key name="modul"> 38,32,30,51,79, </key>
<key name="moment"> 44,33, </key>
<key name="mous"> 51,79, </key>
<key name="mov"> 46,49, </key>
<key name="nbtimesv"> 48, </key>
<key name="ncentr"> 44, </key>
<key name="ncompound"> 44, </key>
-<key name="ne"> 7,9,26,28,29,34,35,47,49,54,60,61,62,65,70,75, </key>
+<key name="ne"> 7,9,26,28,29,34,35,47,49,54,60,62,65,70,75, </key>
<key name="necessari"> 65, </key>
<key name="necessary"> 9,34,65,67,33, </key>
-<key name="need"> 15, </key>
+<key name="need"> 15,61, </key>
<key name="negativ"> 52, </key>
<key name="neighbour"> 65, </key>
-<key name="new"> 1,50,7,14,15,19,20,21,23,24,25,26,28,29,35,42,43,51,54,55,56,60,66,67,69,70,74,77,78,79,80,82,83, </key>
+<key name="new"> 1,50,7,14,15,19,20,21,23,24,25,26,28,29,35,42,43,51,53,54,55,56,60,66,67,69,70,74,77,78,79,80,82,83, </key>
<key name="ninertia"> 44, </key>
<key name="nminimal"> 44, </key>
<key name="nod"> 21, </key>
<key name="nth"> 65, </key>
<key name="numb"> 27,35,41,47,48,49,52,59,64,65,72,74,79, </key>
<key name="number"> 48, </key>
-<key name="object"> 1,2,3,4,5,6,8,9,10,11,14,16,17,18,19,21,24,25,26,28,29,34,35,37,38,40,32,30,42,43,45,46,47,51,52,54,55,56,57,58,59,60,61,65,66,68,69,73,74,75,31,33,78,79,80,81,83, </key>
+<key name="object"> 1,2,3,4,5,6,8,9,10,11,14,16,17,18,19,21,24,25,26,28,29,34,35,37,38,40,32,30,42,43,45,46,47,51,52,53,54,55,56,57,58,59,60,61,65,66,68,69,73,74,75,31,33,78,79,80,81,83, </key>
<key name="obtain"> 26,44,46,65, </key>
<key name="occ"> 0,9,15,34,51,71,72,73,79,83, </key>
<key name="occur"> 12, </key>
<key name="offset"> 52,74, </key>
<key name="ok"> 43,44,59,83, </key>
-<key name="old"> 56, </key>
-<key name="on"> 0,15,22,47,48,49,55,56,59,65,67,82, </key>
+<key name="old"> 53,56, </key>
+<key name="on"> 0,15,22,47,48,49,56,59,65,67,82, </key>
<key name="opaqu"> 76, </key>
<key name="open"> 12,15,32,51,59,83, </key>
<key name="openwir"> 12,59, </key>
<key name="orientat"> 51, </key>
<key name="orientation"> 10,51, </key>
<key name="origin"> 7,20,23,43,51,70,77,78, </key>
+<key name="orthogonal"> 61, </key>
<key name="os"> 59, </key>
<key name="otherwis"> 0,15,45,46,61,75, </key>
<key name="our"> 0,1,2,50,7,9,12,13,14,15,16,17,19,20,21,22,23,24,25,27,28,29,34,35,36,39,42,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,33,78,80,81,83, </key>
<key name="out"> 51,65, </key>
-<key name="outsid"> 53, </key>
<key name="outward"> 10, </key>
<key name="ox"> 43,67, </key>
<key name="oy"> 43, </key>
<key name="p8"> 8,18, </key>
<key name="p9"> 8, </key>
<key name="pan"> 51, </key>
-<key name="parallel"> 7,42,43,65, </key>
+<key name="parallel"> 7,42,65, </key>
<key name="paramet"> 0,15,56,65, </key>
-<key name="parameter"> 4,16,35,59,65,67,76,79,81, </key>
+<key name="parameter"> 4,16,35,53,59,65,67,76,79,81, </key>
<key name="parameterization"> 65, </key>
<key name="parametric"> 65, </key>
<key name="paramt"> 0, </key>
<key name="partition1"> 4, </key>
<key name="partition2"> 4, </key>
<key name="partition3"> 4, </key>
-<key name="pas"> 5,21,42,44,47,55,67, </key>
+<key name="partitionalgo"> 53, </key>
+<key name="pas"> 5,21,42,44,47,55,61,67, </key>
<key name="path"> 18,54, </key>
<key name="pathshap"> 54, </key>
-<key name="perform"> 4,26,53,74, </key>
+<key name="perform"> 4,26,51,74, </key>
<key name="perpendicular"> 67, </key>
<key name="pi"> 47,59,74, </key>
<key name="pictur"> 46, </key>
<key name="pip"> 18,54, </key>
<key name="plac"> 46,51,65, </key>
-<key name="plan"> 2,3,4,45,51,53,55,67,74,82,83, </key>
+<key name="plan"> 2,3,4,45,51,53,55,61,67,74,82,83, </key>
<key name="planar"> 29,67,68,74,82, </key>
<key name="plane1"> 3, </key>
<key name="plane2"> 3, </key>
<key name="plug"> 32, </key>
<key name="plung"> 2, </key>
<key name="png"> 51,79, </key>
-<key name="point"> 0,1,3,4,50,7,8,14,15,18,20,21,23,24,25,28,37,40,42,43,44,45,47,51,52,55,56,59,62,65,67,68,70,74,75,77,33,78,83, </key>
-<key name="point1"> 1,3,7,8,14,24,28,42,55,75,78, </key>
-<key name="point2"> 1,3,7,8,14,24,28,42,55,75,78, </key>
+<key name="point"> 0,1,3,4,50,7,8,14,15,18,20,21,23,24,25,28,37,40,42,43,44,45,47,51,52,55,56,59,61,62,65,67,68,70,74,75,77,33,78,83, </key>
+<key name="point1"> 1,3,7,8,14,24,28,42,55,61,75,78, </key>
+<key name="point2"> 1,3,7,8,14,24,28,42,55,61,75,78, </key>
<key name="point3"> 1,3,8,14,55, </key>
<key name="point4"> 3,8, </key>
<key name="point5"> 3, </key>
<key name="possibl"> 5,21,58,65,33, </key>
<key name="precision"> 59,64, </key>
<key name="predefin"> 67, </key>
+<key name="preferrabl"> 53, </key>
<key name="pres"> 43,51, </key>
<key name="presentation"> 79, </key>
-<key name="presum"> 43, </key>
<key name="preview"> 51, </key>
<key name="previou"> 65,67, </key>
<key name="primitiv"> 7,20,23,38,30,57,70,77, </key>
<key name="regard"> 56, </key>
<key name="relativ"> 67, </key>
<key name="relevant"> 81, </key>
-<key name="remain"> 51,81, </key>
+<key name="remain"> 51,53,81, </key>
<key name="remaind"> 46, </key>
<key name="remot"> 51, </key>
<key name="remov"> 40,45,46,51,59,61,65,71,72,73,75,83, </key>
<key name="rot2d"> 74, </key>
<key name="rotat"> 47,51,60,61,74, </key>
<key name="rotation"> 47,51,59,61,74, </key>
+<key name="rotation1"> 74, </key>
+<key name="rotation2"> 74, </key>
<key name="rul"> 65, </key>
<key name="runtimeerror"> 44,59, </key>
<key name="s"> 12,14,15,18,37,48,59,62,71,72,73,83, </key>
<key name="script"> 0,1,2,50,7,9,12,13,14,15,16,17,19,20,21,22,23,24,25,27,28,29,34,35,36,39,42,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,33,78,80,81,83, </key>
<key name="se"> 46,51,81, </key>
<key name="search"> 32, </key>
-<key name="second"> 7,14,20,23,28,43,45,46,48,49,53,55,56,65,68,70,75,77,31,78,82, </key>
+<key name="second"> 7,14,20,23,28,43,45,46,48,49,53,55,56,61,65,68,70,75,77,31,78,82, </key>
<key name="section"> 2,6,51,63,31, </key>
<key name="seem"> 59, </key>
<key name="segment"> 65,67, </key>
<key name="select"> 0,1,2,4,7,9,10,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,40,32,42,43,45,46,47,48,49,51,52,53,54,55,56,58,59,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,33,78,79,80,81,82,83, </key>
<key name="selection"> 34,67,82,83, </key>
-<key name="sens"> 53, </key>
<key name="separat"> 31, </key>
<key name="serv"> 21,28,54,60, </key>
-<key name="set"> 0,15,27,29,37,47,52,56,82, </key>
+<key name="set"> 0,15,27,29,37,47,51,52,56,82, </key>
<key name="setcolor"> 11,16, </key>
<key name="setdisplaymod"> 3,4,5,6,8,11,18,37,57,59,68,74,81, </key>
<key name="settransparency"> 3,11,37,68,74,76, </key>
<key name="shar"> 13, </key>
<key name="sharp"> 65, </key>
<key name="shel"> 13,19,37,52,66,69,81, </key>
-<key name="shell"> 50,10,28,37,52,54,60,66,69, </key>
+<key name="shell"> 50,10,28,37,52,53,54,60,66,69, </key>
<key name="shift"> 46,56,80,83, </key>
<key name="short"> 16,81, </key>
<key name="shortcut"> 29, </key>
<key name="shown"> 43, </key>
<key name="sid"> 55, </key>
<key name="sign"> 52, </key>
-<key name="similar"> 55, </key>
<key name="simp"> 43, </key>
<key name="simpl"> 47,48,49, </key>
+<key name="sinc"> 53, </key>
<key name="singl"> 29, </key>
<key name="six"> 50,8, </key>
<key name="siz"> 9,55,65, </key>
<key name="skip"> 83, </key>
<key name="small"> 51,65, </key>
<key name="so"> 29,46, </key>
-<key name="solid"> 50,7,8,20,23,26,28,37,48,52,54,60,69,70,77, </key>
+<key name="solid"> 50,7,8,20,23,26,28,37,48,52,53,54,60,69,70,77, </key>
<key name="solid1"> 8, </key>
<key name="solid2"> 8, </key>
<key name="sort"> 26, </key>
<key name="subtraction"> 46, </key>
<key name="successful"> 44, </key>
<key name="sup_fac"> 59, </key>
+<key name="support"> 53, </key>
<key name="suppres"> 59,71,72,73, </key>
<key name="suppressfac"> 59,71, </key>
<key name="suppresshol"> 59,72, </key>
<key name="symmetric"> 74, </key>
<key name="symmetrical"> 45,74, </key>
<key name="symmetry"> 45, </key>
-<key name="system"> 20,23,43,46,70,74,82, </key>
+<key name="system"> 20,23,43,46,55,70,74,82, </key>
<key name="t"> 7,10,28,40,51,70, </key>
<key name="tak"> 65, </key>
<key name="tangent"> 65,67, </key>
<key name="theshap"> 39,59,33, </key>
<key name="thestartlc"> 46, </key>
<key name="thetoleranc"> 39, </key>
-<key name="third"> 7, </key>
-<key name="thre"> 1,3,14,18,21,37,43,45,55,56,68,74,82, </key>
+<key name="third"> 7,61, </key>
+<key name="thre"> 1,3,14,18,21,37,43,45,55,56,61,68,74,82, </key>
<key name="thu"> 65,76, </key>
<key name="tim"> 21,47,49,56,74, </key>
<key name="tobezi"> 65, </key>
<key name="triangl"> 51, </key>
<key name="trihedron"> 51, </key>
<key name="trimsiz"> 3,4,55, </key>
-<key name="tru"> 0,15,53,59,33, </key>
+<key name="tru"> 0,15,59,33, </key>
<key name="truncat"> 20, </key>
<key name="try"> 29, </key>
<key name="tt"> 37,68, </key>
<key name="tui"> 0,1,2,50,7,9,10,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,42,43,45,46,47,48,49,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,76,77,31,33,78,79,80,81,83, </key>
<key name="tupl"> 33, </key>
-<key name="two"> 0,3,4,50,7,8,9,13,17,18,20,24,36,37,39,40,46,47,48,49,53,65,68,70,74,77,33,82,83, </key>
+<key name="two"> 0,3,4,50,7,8,9,13,17,18,20,24,36,37,39,40,46,47,48,49,53,61,65,68,70,74,77,33,82,83, </key>
<key name="typ"> 21,26,27,53,65,67,31,33,83, </key>
<key name="u"> 65, </key>
-<key name="uncheck"> 10, </key>
+<key name="uncheck"> 10,51, </key>
<key name="underly"> 15,65, </key>
<key name="unionlist"> 40, </key>
<key name="up"> 16,20,81, </key>
<key name="vector2_arc2"> 18, </key>
<key name="vector3"> 18, </key>
<key name="versa"> 65, </key>
+<key name="version"> 53, </key>
<key name="vertex"> 3,4,6,14,15,18,20,23,24,25,28,37,44,45,54,55,56,57,59,60,62,70,74,77,33, </key>
<key name="vertex_n"> 56, </key>
<key name="vertex1"> 24, </key>
<key name="whil"> 12,18,37,44,65,81, </key>
<key name="whos"> 29,33, </key>
<key name="wid"> 38,30, </key>
-<key name="will"> 0,1,2,50,7,9,10,12,13,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,32,42,43,45,46,47,48,49,51,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,78,80,83, </key>
+<key name="will"> 0,1,2,50,7,9,10,12,13,14,15,17,19,20,21,22,23,24,25,26,27,28,29,34,35,36,39,32,42,45,46,47,48,49,51,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,75,77,78,80,83, </key>
<key name="wir"> 3,50,12,15,18,26,28,29,37,44,54,59,60,67,68,72,73,74,80, </key>
<key name="wire_clos"> 59, </key>
<key name="wire_nam"> 59, </key>
<key name="ymax"> 44,33, </key>
<key name="ymin"> 44,33, </key>
<key name="your"> 16,32,64,72,79,82,83, </key>
-<key name="yourselv"> 43, </key>
<key name="yz_fac"> 5, </key>
<key name="yz_face_ind"> 5, </key>
<key name="z"> 2,3,7,43,56,70,33, </key>
</book>
<book name="Viewing geometrical objects" >
<item name="Viewing Geometrical Objects" url="viewing_geometrical_objects.htm" />
- <item name="OCC 3D Viewer" url="occ_viewer.htm" />
<item name="Display Mode" url="wireframe_and_shading.htm" />
<item name="Color" url="color.htm" />
<item name="Transparency" url="transparency.htm" />
</book>
</book>
<item name="Using measurement tools" url="files/salome2_sp3_measuregui_functions.htm" />
- <item name="Python Interface 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" />
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: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; }
+img_whs4 { border:none; width:400px; height:277px; float:none; border-style:none; }
+img_whs5 { border:none; width:400px; height:312px; float:none; border-style:none; }
+img_whs6 { border:none; width:400px; height:320px; float:none; border-style:none; }
+table.whs7 { x-cell-content-align:top; width:39.231%; border-spacing:0px; }
+col.whs8 { width:52.696%; }
+col.whs9 { width:47.304%; }
+tr.whs10 { x-cell-content-align:top; }
+td.whs11 { width:52.696%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-right-style:none; border-left-style:none; border-top-style:none; }
+p.whs12 { font-style:italic; }
+td.whs13 { width:47.304%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-top-style:none; border-right-style:none; }
+td.whs14 { width:52.696%; padding-right:10px; padding-left:10px; border-right-style:none; border-left-style:none; border-bottom-style:none; }
+img_whs15 { border:none; width:176px; height:217px; border-style:none; }
+td.whs16 { width:47.304%; padding-right:10px; padding-left:10px; border-bottom-style:none; border-right-style:none; }
+img_whs17 { border:none; width:191px; height:217px; border-style:none; }
-->
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
</script>
<h1><b style="font-weight: bold;"><span style="font-size: 14pt;"><font size=4 style="font-size:14pt;"><img src="files/salome2_sp3_basicgui_functions_salome2_sp3_basicgui_functions_image34.gif" width="20px" height="20px" border="0" class="img_whs1"></font></span></b>Working Plane</h1>
+<p>Definition of a <span style="font-weight: bold;"><B>Working Plane</B></span>
+ is necessary for work with <span style="font-weight: bold;"><B><a href="sketcher.htm">Sketcher</a></B></span>.
+ </p>
+
+<p> </p>
+
<p>To create a <span style="font-weight: bold;"><B>Working Plane</B></span> in
the <span style="font-weight: bold;"><B>Main Menu</B></span> select <span style="font-weight: bold;"><B>New
Entity - > Basic - > Working Plane</B></span></p>
<p class="whs2"> </p>
-<p class="whs2">There are some algorithms to set the <span
- style="font-weight: bold;"><B>Working Plane</B></span> and the Camera Position.</p>
+<p class="whs2">There is a number of algorithms to set the
+ <span style="font-weight: bold;"><B>Working Plane</B></span> and the Camera Position.</p>
<p class="whs2"> </p>
Face</B></span> or a <span style="font-weight: bold;"><B>Local Coordinate System</B></span>
to be your <span style="font-weight: bold;"><B>Working Plane</B></span></p>
-<p class="whs2"><b>Arguments:</b> Name + 1 selection (face
- or planar face), </p>
+<p class="whs2"><b style="font-weight: bold;">Arguments:</b>
+ Name + 1 selection (face or planar face), </p>
<p class="whs2"> </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="whs3"><img src="pics/workplane4.png" x-maintain-ratio="TRUE" width="400px" height="277px" border="0" class="img_whs4"></p>
<p class="whs2"> </p>
<p class="whs2"><b style="font-weight: bold;">Arguments:</b>
Name + 2
- vectors, </p>
+ vectors.</p>
+
+<p class="whs2"> </p>
-<p class="whs3"><img src="pics/workplane5.png" x-maintain-ratio="TRUE" width="312px" height="266px" border="0" class="img_whs5"></p>
+<p class="whs3"><img src="pics/workplane5.png" x-maintain-ratio="TRUE" width="400px" height="312px" border="0" class="img_whs5"></p>
<p class="whs2"> </p>
<p class="whs2"> </p>
-<p class="whs3"><img src="pics/workplane6.png" x-maintain-ratio="TRUE" width="312px" height="274px" border="0" class="img_whs6"></p>
+<p class="whs3"><img src="pics/workplane6.png" x-maintain-ratio="TRUE" width="400px" height="320px" border="0" class="img_whs6"></p>
-<p class="whs2"> </p>
+<p> </p>
+
+<p><span style="font-weight: bold;"><B>Reverse the plane normal</B></span> checkbox
+ allows changing the direction of the working plane.</p>
+
+<p> </p>
+
+<p><span style="font-weight: bold;"><B>Example:</B></span> Working plane on the
+ upper face of a box. </p>
+
+<p> </p>
+
+<table x-use-null-cells cellspacing="0" width="39.231%" class="whs7">
+<col class="whs8">
+<col class="whs9">
+
+<tr valign="top" class="whs10">
+<td width="52.696%" class="whs11">
+<p class="whs12">Normal Direction</td>
+<td width="47.304%" class="whs13">
+<p class="whs12">Reversed Direction</td></tr>
+
+<tr valign="top" class="whs10">
+<td width="52.696%" class="whs14">
+<p><img src="image36.gif" width="176px" height="217px" border="0" class="img_whs15"></td>
+<td width="47.304%" class="whs16">
+<p><img src="image47.gif" width="191px" height="217px" border="0" class="img_whs17"></td></tr>
+</table>
+
+<p> </p>
<p> </p>
/*!
* Get the TopoDS_Shape, for colocated case only.
*/
- long getShape();
+ long long getShape();
/*!
######################################################################
in boolean theWithContact ,
in boolean theWithCorrection );
+ /*!
+ * Create a shape by extrusion of the profile shape along
+ * the path shape. The path shape can be a shell or a face.
+ * the several profiles can be specified in the several locations of path.
+ * \param theSeqBases - list of Bases shape to be extruded.
+ * \param theSeqSubBases - list of corresponding subshapes of section shapes.
+ * \param theLocations - list of locations on the path corresponding
+ * specified list of the Bases shapes. Number of locations
+ * should be equal to number of bases or list of locations can be empty.
+ * \param thePath - Path shape to extrude the base shape along it.
+ * \param theWithContact - the mode defining that the section is translated to be in
+ * contact with the spine.
+ * \param - WithCorrection - defining that the section is rotated to be
+ * orthogonal to the spine tangent in the correspondent point
+ * \return New GEOM_Object, containing the created pipe.
+ */
+ GEOM_Object MakePipeWithShellSections (in ListOfGO theSeqBases,
+ in ListOfGO theSeqSubBases,
+ in ListOfGO theLocations,
+ in GEOM_Object thePath,
+ in boolean theWithContact ,
+ in boolean theWithCorrection );
+
};
/*!
*/
GEOM_Object MakeGlueFaces (in GEOM_Object theShape, in double theTolerance);
+ /*!
+ * Find coincident faces in theShape for possible gluing.
+ * \param theShape Initial shape.
+ * \param theTolerance Maximum distance between faces, which can be considered as coincident.
+ * \return ListOfGO
+ */
+ ListOfGO GetGlueFaces (in GEOM_Object theShape, in double theTolerance);
+
+ /*!
+ * Replace coincident faces in theShape by one face
+ * in compliance with given list of faces
+ * \param theShape Initial shape.
+ * \param theTolerance Maximum distance between faces, which can be considered as coincident.
+ * \param theFaces List of faces for gluing.
+ * \return New GEOM_Object, containing a copy of theShape without some faces.
+ */
+ GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape, in double theTolerance,
+ in ListOfGO theFaces);
+
/*!
* Explode a shape on subshapes of a given type.
* \param theShape Shape to be exploded.
in GEOM_Object thePnt2,
in GEOM_Object thePnt3);
+ /*!
+ * Create an arc of circle of center C from one point to another
+ * \param theCenter Center point of the arc.
+ * \param thePnt1 Start point of the arc.
+ * \param thePnt2 End point of the arc.
+ * \param theSense Orientation of the arc
+ * \return New GEOM_Object, containing the created arc.
+ */
+ GEOM_Object MakeArcCenter (in GEOM_Object theCenter,
+ in GEOM_Object thePnt1,
+ in GEOM_Object thePnt2,
+ in boolean theSense);
+
+
/*!
* Create a polyline on the set of points.
* \param thePoints Sequence of points for the polyline.
out string_array thePatterns);
};
+ /*!
+ * GEOM_IKindOfShape: namespace for shape_kind enumeration.
+ */
+ interface GEOM_IKindOfShape
+ {
+ enum shape_kind {
+ NO_SHAPE,
+ // COMPOSITEs
+ COMPOUND,
+ COMPSOLID,
+ SHELL,
+ WIRE,
+ // SOLIDs
+ SPHERE, // full sphere
+ CYLINDER, // cylinder
+ BOX, // box with faces, parallel to global coordinate planes
+ ROTATED_BOX, // other box
+ TORUS, // full torus
+ CONE, // cone
+ POLYHEDRON, // solid, bounded by polygons
+ SOLID, // other solid
+ // FACEs
+ SPHERE2D, // spherical face (closed)
+ CYLINDER2D, // cylindrical face with defined height
+ TORUS2D, // toroidal face (closed)
+ CONE2D, // conical face with defined height
+ DISK_CIRCLE, // planar, bounded by circle
+ DISK_ELLIPSE, // planar, bounded by ellipse
+ POLYGON, // planar, bounded by segments
+ PLANE, // infinite planar
+ PLANAR, // other planar
+ FACE, // other face
+ // EDGEs
+ CIRCLE, // full circle
+ ARC_CIRCLE, // arc of circle
+ ELLIPSE, // full ellipse
+ ARC_ELLIPSE, // arc of ellipse
+ LINE, // infinite segment
+ SEGMENT, // segment
+ EDGE, // other edge
+ // VERTEX
+ VERTEX
+ };
+ };
+
+
/*!
* GEOM_IMeasureOperations: Interface for measurement (distance, whatis) and
* properties calculation (like Centre of Mass, Inertia, etc.).
*/
interface GEOM_IMeasureOperations : GEOM_IOperations
{
+ /*!
+ * Get kind of theShape.
+ * \param theShape Shape to get a kind of.
+ * \param theIntegers Output. Integer and enumerated shape's parameters
+ * (kind of surface, closed/unclosed, number of edges, etc.)
+ * \param theDoubles Output. Double shape's parameters (coordinates, dimensions, etc.)
+ * \note Concrete meaning of each value, returned via \a theIntegers
+ * or \a theDoubles list depends on the kind of the shape.
+ * \return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration.
+ */
+ //short KindOfShape (in GEOM_Object theShape,
+ GEOM_IKindOfShape::shape_kind KindOfShape (in GEOM_Object theShape,
+ out ListOfLong theIntegers,
+ out ListOfDouble theDoubles);
+
/*!
* Get position (LCS) of theShape.
* \param theShape Shape to calculate position of.
in boolean theWithContact ,
in boolean theWithCorrection );
+ GEOM_Object MakePipeWithShellSections (in ListOfGO theSeqBases,
+ in ListOfGO theSeqSubBases,
+ in ListOfGO theLocations,
+ in GEOM_Object thePath,
+ in boolean theWithContact ,
+ in boolean theWithCorrection );
+
//-----------------------------------------------------------//
// BooleanOperations //
//-----------------------------------------------------------//
GEOM_Object MakeSolidShells (in GEOM_List theShells) ;
GEOM_Object MakeCompound (in GEOM_List theShapes) ;
GEOM_Object MakeGlueFaces (in GEOM_Object theShape,
- in double theTolerance) ;
+ in double theTolerance);
+ GEOM_List GetGlueFaces (in GEOM_Object theShape,
+ in double theTolerance);
+ GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape,
+ in double theTolerance,
+ in ListOfGO theFaces);
GEOM_List MakeExplode (in GEOM_Object theShape,
in long theShapeType,
in boolean isSorted) ;
GEOM_Object MakeArc (in GEOM_Object thePnt1,
in GEOM_Object thePnt2,
in GEOM_Object thePnt3) ;
+ GEOM_Object MakeArcCenter (in GEOM_Object theCenter,
+ in GEOM_Object thePnt1,
+ in GEOM_Object thePnt2,
+ in boolean theSense) ;
GEOM_Object MakePolyline (in GEOM_List thePoints) ;
GEOM_Object MakeSplineBezier (in GEOM_List thePoints) ;
GEOM_Object MakeSplineInterpolation (in GEOM_List thePoints) ;
<DataStream-list></DataStream-list>
</component-service>
<component-service>
+ <service-name>MakeArcCenter</service-name>
+ <service-author>ngr</service-author>
+ <service-version>3.2.6</service-version>
+ <service-comment>unknown</service-comment>
+ <service-by-default>0</service-by-default>
+ <inParameter-list>
+ <inParameter>
+ <inParameter-name>theCenter</inParameter-name>
+ <inParameter-type>GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt1</inParameter-name>
+ <inParameter-type>GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt2</inParameter-name>
+ <inParameter-type>GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theSense</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service> <component-service>
<service-name>MakePolyline</service-name>
<service-author>mkr</service-author>
<service-version>2.1.0</service-version>
-Import: BREP|IGES|STEP
-Export: BREP|IGES|IGES_5_3|STEP
+Import: BREP|IGES|STEP|ACIS
+Export: BREP|IGES|IGES_5_3|STEP|STL_Bin|STL_ASCII|ACIS
BREP.Import: libBREPImport
BREP.Export: libBREPExport
STEP.Import: libSTEPImport
STEP.Export: libSTEPExport
STEP.Pattern: STEP Files ( *.step *.stp )
+
+STL_Bin.Export: libSTLExport.so
+STL_Bin.Pattern: STL Binary Files ( *.stl )
+
+STL_ASCII.Export: libSTLExport.so
+STL_ASCII.Pattern: STL ASCII Files ( *.stl )
+
+ACIS.Import: libACISImport.so
+ACIS.Export: libACISExport.so
+ACIS.Pattern: ACIS Files ( *.sat )
\ No newline at end of file
free_faces.png \
propagate.png \
redo.png \
-undo.png
+undo.png \
+arccenter.png \
+glue2.png
nodist_salomeres_DATA = GEOMCatalog.xml
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ARC")));
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ARC_CENTER")));
+ QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
setCaption(tr("GEOM_ARC_TITLE"));
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_ARC"));
RadioButton1->setPixmap(image0);
- RadioButton2->close(TRUE);
+ RadioButton2->setPixmap(image1);
RadioButton3->close(TRUE);
Group3Pnts = new DlgRef_3Sel_QTD(this, "Group3Pnts");
Group3Pnts->LineEdit2->setReadOnly( true );
Group3Pnts->LineEdit3->setReadOnly( true );
- Group3Pnts->PushButton1->setPixmap(image1);
- Group3Pnts->PushButton2->setPixmap(image1);
- Group3Pnts->PushButton3->setPixmap(image1);
+ Group3Pnts->PushButton1->setPixmap(image2);
+ Group3Pnts->PushButton2->setPixmap(image2);
+ Group3Pnts->PushButton3->setPixmap(image2);
+
+
+ Group3Pnts2 = new DlgRef_3Sel1Check_QTD(this, "Group3Pnts2");
+ Group3Pnts2->GroupBox1->setTitle(tr("GEOM_POINTS"));
+ Group3Pnts2->TextLabel1->setText(tr("GEOM_CENTER_POINT"));
+ Group3Pnts2->TextLabel2->setText(tr("GEOM_POINT_I").arg("Start"));
+ Group3Pnts2->TextLabel3->setText(tr("GEOM_POINT_I").arg("End"));
+
+ Group3Pnts2->LineEdit1->setReadOnly( true );
+ Group3Pnts2->LineEdit2->setReadOnly( true );
+ Group3Pnts2->LineEdit3->setReadOnly( true );
+
+ Group3Pnts2->PushButton1->setPixmap(image2);
+ Group3Pnts2->PushButton2->setPixmap(image2);
+ Group3Pnts2->PushButton3->setPixmap(image2);
+
+ Group3Pnts2->radioButton4->setText(tr("GEOM_REVERSE"));
Layout1->addWidget( Group3Pnts, 2, 0 );
+ Layout1->addWidget( Group3Pnts2, 2, 0 );
setHelpFileName("arc.htm");
/* init variables */
// myGeomGUI->SetState( 0 );
globalSelection( GEOM_POINT );
-
+
+ myConstructorId = -1;
myEditCurrentArgument = Group3Pnts->LineEdit1;
myEditCurrentArgument->setFocus();
myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
+ Group3Pnts2->radioButton4->setChecked(FALSE);
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
-
+
+ connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
+
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(Group3Pnts->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3Pnts->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3Pnts->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+
+ connect(Group3Pnts2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(Group3Pnts2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(Group3Pnts2->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+
+ connect(Group3Pnts2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect(Group3Pnts2->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect(Group3Pnts2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+
+ connect(Group3Pnts2->radioButton4, SIGNAL(stateChanged(int)), this, SLOT(ReverseSense(int)));
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- initName( tr( "GEOM_ARC" ) );
+ initName( tr( "GEOM_ARC" ));
+
+
+ ConstructorsClicked( 0 );
}
Group3Pnts->LineEdit1->setText( "" );
Group3Pnts->LineEdit2->setText( "" );
Group3Pnts->LineEdit3->setText( "" );
- myEditCurrentArgument = Group3Pnts->LineEdit1;
+ Group3Pnts2->LineEdit1->setText( "" );
+ Group3Pnts2->LineEdit2->setText( "" );
+ Group3Pnts2->LineEdit3->setText( "" );
+ if (getConstructorId() == 0) myEditCurrentArgument = Group3Pnts->LineEdit1;
+ if (getConstructorId() == 1) myEditCurrentArgument = Group3Pnts2->LineEdit1;
+ ConstructorsClicked( getConstructorId() );
return true;
}
//=================================================================================
void BasicGUI_ArcDlg::SelectionIntoArgument()
{
- myEditCurrentArgument->setText("");
-
- if ( IObjectCount() != 1 )
- {
- if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
+ if ((getConstructorId() != 0) && (getConstructorId() != 1))
return;
- }
-
+
+ myEditCurrentArgument->setText("");
+ if ( IObjectCount() != 1 ){
+ switch (getConstructorId())
+ {
+ case 0:
+ {
+ if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
+ else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
+ else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
+ return;
+ break;
+ }
+ case 1:
+ {
+ if ( myEditCurrentArgument == Group3Pnts2->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
+ else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
+ else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
+ return;
+ break;
+ }
+ }
+ }
// nbSel == 1
Standard_Boolean aRes = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
- if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = aSelectedObject;
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = aSelectedObject;
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = aSelectedObject;
+ switch (getConstructorId())
+ {
+ case 0:
+ {
+ myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = aSelectedObject;
+ else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = aSelectedObject;
+ else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = aSelectedObject;
+ break;
+ }
+ case 1:
+ {
+ myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ if ( myEditCurrentArgument == Group3Pnts2->LineEdit1 ) myPoint1 = aSelectedObject;
+ else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 ) myPoint2 = aSelectedObject;
+ else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 ) myPoint3 = aSelectedObject;
+ break;
+ }
+ }
}
displayPreview();
void BasicGUI_ArcDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
-
- if ( send == Group3Pnts->PushButton1 ) myEditCurrentArgument = Group3Pnts->LineEdit1;
- else if ( send == Group3Pnts->PushButton2 ) myEditCurrentArgument = Group3Pnts->LineEdit2;
- else if ( send == Group3Pnts->PushButton3 ) myEditCurrentArgument = Group3Pnts->LineEdit3;
-
+ switch (getConstructorId())
+ {
+ case 0:
+ {
+ if ( send == Group3Pnts->PushButton1 ) myEditCurrentArgument = Group3Pnts->LineEdit1;
+ else if ( send == Group3Pnts->PushButton2 ) myEditCurrentArgument = Group3Pnts->LineEdit2;
+ else if ( send == Group3Pnts->PushButton3 ) myEditCurrentArgument = Group3Pnts->LineEdit3;
+ break;
+ }
+ case 1:
+ {
+ if ( send == Group3Pnts2->PushButton1 ) myEditCurrentArgument = Group3Pnts2->LineEdit1;
+ else if ( send == Group3Pnts2->PushButton2 ) myEditCurrentArgument = Group3Pnts2->LineEdit2;
+ else if ( send == Group3Pnts2->PushButton3 ) myEditCurrentArgument = Group3Pnts2->LineEdit3;
+ break;
+ }
+ }
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
void BasicGUI_ArcDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if ( send == Group3Pnts->LineEdit1 ||
- send == Group3Pnts->LineEdit2 ||
- send == Group3Pnts->LineEdit3 )
+ if ( send == Group3Pnts->LineEdit1 || send == Group3Pnts->LineEdit2 || send == Group3Pnts->LineEdit3 ||
+ send == Group3Pnts2->LineEdit1 || send == Group3Pnts2->LineEdit2 || send == Group3Pnts2->LineEdit3 )
{
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
Group3Pnts->LineEdit2->setText( "" );
Group3Pnts->LineEdit3->setText( "" );
myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
+
+ ConstructorsClicked( getConstructorId() );
+
}
//=================================================================================
//=================================================================================
bool BasicGUI_ArcDlg::execute( ObjectList& objects )
{
- GEOM::GEOM_Object_var anObj =
- GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->MakeArc(myPoint1, myPoint2, myPoint3);
- if ( !anObj->_is_nil() )
+ bool res = false;
+ GEOM::GEOM_Object_var anObj;
+
+ switch (getConstructorId())
+ {
+ case 0:
+ {
+ if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) ){
+ anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->MakeArc(myPoint1, myPoint2, myPoint3);
+ res = true;
+ }
+ break;
+ }
+ case 1:
+ {
+ bool Sense;
+ (Group3Pnts2->radioButton4->isChecked()) ? Sense=true : Sense = false;
+ if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) ){
+ anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->MakeArcCenter(myPoint1, myPoint2, myPoint3,Sense);
+ res = true;
+ }
+ break;
+ }
+ }
+ if ( !anObj->_is_nil() ){
objects.push_back( anObj._retn() );
- return true;
+ }
+ return res;
}
//=================================================================================
{
GEOMBase_Skeleton::closeEvent( e );
}
+
+//=================================================================================
+// function : ConstructorsClicked()
+// purpose : Radio button management
+//=================================================================================
+void BasicGUI_ArcDlg::ConstructorsClicked( int constructorId )
+{
+
+ disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
+
+ switch (constructorId)
+ {
+ case 0:
+ {
+ Group3Pnts->show();
+ resize(0, 0);
+ Group3Pnts2->hide();
+
+ connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ break;
+ }
+ case 1:
+ {
+ Group3Pnts->hide();
+ resize(0, 0);
+ Group3Pnts2->show();
+ connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+ break;
+ }
+ }
+ displayPreview();
+}
+
+//=================================================================================
+// function : ReverseSense()
+// purpose : Orientation of the arc
+//=================================================================================
+void BasicGUI_ArcDlg::ReverseSense(int sense)
+{
+ displayPreview();
+}
#include "GEOMBase_Skeleton.h"
#include "DlgRef_3Sel_QTD.h"
+#include "DlgRef_3Sel1Check_QTD.h"
//=================================================================================
// class : BasicGUI_ArcDlg
private :
void Init();
void enterEvent(QEvent* e);
-
+ int myConstructorId;
GEOM::GEOM_Object_var myPoint1, myPoint2, myPoint3;
DlgRef_3Sel_QTD* Group3Pnts;
+ DlgRef_3Sel1Check_QTD* Group3Pnts2;
private slots:
void ClickOnOk();
void ActivateThisDialog();
void DeactivateActiveDialog();
-
+ void ConstructorsClicked( int );
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
-
+ void ReverseSense(int);
};
#endif // DIALOGBOX_ARC_H
Layout1->addWidget(Group2, 1, 0);
Layout1->addWidget(Group3, 1, 0);
/***************************************************************/
+ QGroupBox* aReverseGroupBox = new QGroupBox(this, "aReverseGroupBox");
+ aReverseGroupBox->setTitle(tr(""));
+ aReverseGroupBox->setColumnLayout(1, Qt::Horizontal);
+ aReverseGroupBox->setInsideMargin(10);
+
+ myReverseCB = new QCheckBox(aReverseGroupBox, "myReverseCB");
+ myReverseCB->setText(tr("GEOM_REVERSE_PLANE"));
+
+ Layout1->addWidget(aReverseGroupBox, 2, 0);
+
setHelpFileName("working_plane.htm");
connect(Group3->GroupBox1, SIGNAL(clicked(int)), this, SLOT(GroupClicked(int)));
+ connect(myReverseCB, SIGNAL(clicked()), this, SLOT(onReverse()));
+
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
}
}
- displayPreview();
+
+ updateWPlane();
}
//=================================================================================
void BasicGUI_WorkingPlaneDlg::GroupClicked(int groupId)
{
aOriginType = groupId;
+ updateWPlane();
}
//=================================================================================
{
buttonApply->setFocus();
myGeomGUI->application()->putInfo(tr(""));
- const int id = getConstructorId();
-
- if (id == 0) { // by planar face selection
- if (CORBA::is_nil(myFace)) {
- showError( "Face has to be selected" );
- return false;
- }
-
- // 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 VX1, VX2, VZ1, VZ2;
- gp_Vec aVX, aVZ;
-
- 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;
- }
-
- TopExp::Vertices(aVectX, VX1, VX2, Standard_True);
- TopExp::Vertices(aVectZ, VZ1, VZ2, Standard_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;
+
+ if (updateWPlane(false)){
+ myGeomGUI->SetWorkingPlane(myWPlane);
+ myGeomGUI->ActiveWorkingPlane();
}
-
- myGeomGUI->SetWorkingPlane(myWPlane);
- myGeomGUI->ActiveWorkingPlane();
+
return true;
}
myVectZ = aSelectedObject;
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+
+ updateWPlane();
}
}
+//=================================================================================
+// function : onReverse()
+// purpose :
+//=================================================================================
+void BasicGUI_WorkingPlaneDlg::onReverse()
+{
+ updateWPlane();
+}
+
+
//=================================================================================
// function : ActivateThisDialog()
// purpose :
{
GEOMBase_Skeleton::closeEvent( e );
}
+
+
+//=================================================================================
+// function : updateWPlane
+// purpose :
+//=================================================================================
+bool BasicGUI_WorkingPlaneDlg::updateWPlane( const bool showPreview )
+{
+ erasePreview();
+
+ const int id = getConstructorId();
+
+ if (id == 0) { // by planar face selection
+ if (CORBA::is_nil(myFace)) {
+ if(!showPreview)
+ showError( "Face has to be selected" );
+ return false;
+ }
+
+ // 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 {
+ if(!showPreview)
+ showError( "Wrong shape selected (has to be a planar face)" );
+ return false;
+ }
+
+ } else if (id == 1) { // by two vectors (Ox & Oz)
+ if ( CORBA::is_nil( myVectX ) || CORBA::is_nil( myVectZ ) ) {
+ if(!showPreview)
+ showError( "Two vectors have to be selected" );
+ return false;
+ }
+
+ TopoDS_Edge aVectX, aVectZ;
+ TopoDS_Vertex VX1, VX2, VZ1, VZ2;
+ gp_Vec aVX, aVZ;
+
+ if (!GEOMBase::GetShape( myVectX, aVectX, TopAbs_EDGE ) ||
+ !GEOMBase::GetShape( myVectZ, aVectZ, TopAbs_EDGE )) {
+ if(!showPreview)
+ showError( "Wrong shape selected (two vectors(edges) have to be selected)" );
+ return false;
+ }
+
+ TopExp::Vertices(aVectX, VX1, VX2, Standard_True);
+ TopExp::Vertices(aVectZ, VZ1, VZ2, Standard_True);
+
+ if (VX1.IsNull() || VX2.IsNull()) {
+ if(!showPreview)
+ showError( "Bad OX vector" );
+ return false;
+ }
+ if (VZ1.IsNull() || VZ2.IsNull()) {
+ if(!showPreview)
+ 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()) {
+ if(!showPreview)
+ showError( "Bad OX vector" );
+ return false;
+ }
+ if (aVZ.Magnitude() < Precision::Confusion()) {
+ if(!showPreview)
+ 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())) {
+ if(!showPreview)
+ 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;
+ }
+
+ if (myReverseCB->isChecked())
+ {
+ myWPlane.YReverse();
+ myWPlane.ZReverse();
+ }
+
+ if (showPreview)
+ {
+ GEOM::GEOM_IBasicOperations_var aBasicOp = getGeomEngine()->GetIBasicOperations( getStudyId() );
+ GEOM::GEOM_Object_var anObj = aBasicOp->MakeMarker( myWPlane.Location().X(), myWPlane.Location().Y(), myWPlane.Location().Z(),
+ myWPlane.XDirection().X(), myWPlane.XDirection().Y(), myWPlane.XDirection().Z(),
+ myWPlane.YDirection().X(), myWPlane.YDirection().Y(), myWPlane.YDirection().Z() );
+ displayPreview(anObj);
+ }
+
+ return true;
+}
#include "DlgRef_2Sel_QTD.h"
#include "DlgRef_3Check_QTD.h"
+class QCheckBox;
+
//=================================================================================
// class : BasicGUI_WorkingPlaneDlg
// purpose :
void Init();
void enterEvent(QEvent* e);
+ bool updateWPlane(const bool showPreview = true);
+
GEOM::GEOM_Object_var myFace;
GEOM::GEOM_Object_var myVectX;
GEOM::GEOM_Object_var myVectZ;
DlgRef_2Sel_QTD* Group2;
DlgRef_3Check_QTD* Group3;
+ QCheckBox* myReverseCB;
+
gp_Ax3 myWPlane;
private slots:
void SetEditCurrentArgument();
void SelectionIntoArgument();
void LineEditReturnPressed();
+ void onReverse();
void ActivateThisDialog();
void DeactivateActiveDialog();
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'UIFiles/DlgRef_3Sel1Check_QTD.ui'
+**
+** Created: Wed Feb 21 10:49:18 2007
+** by: The User Interface Compiler ($Id$)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+
+#include "DlgRef_3Sel1Check_QTD.h"
+
+#include <qvariant.h>
+#include <qpushbutton.h>
+#include <qgroupbox.h>
+#include <qlineedit.h>
+#include <qlabel.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a DlgRef_3Sel1Check_QTD as a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+DlgRef_3Sel1Check_QTD::DlgRef_3Sel1Check_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "DlgRef_3Sel1Check_QTD" );
+ setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
+ DlgRef_3Sel1Check_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_3Sel1Check_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, GroupBox1->sizePolicy().hasHeightForWidth() ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
+ PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
+
+ GroupBox1Layout->addWidget( PushButton1, 0, 1 );
+
+ LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
+
+ GroupBox1Layout->addWidget( LineEdit1, 0, 2 );
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+
+ GroupBox1Layout->addWidget( TextLabel1, 0, 0 );
+
+ PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
+ PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
+
+ GroupBox1Layout->addWidget( PushButton2, 1, 1 );
+
+ LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
+
+ GroupBox1Layout->addWidget( LineEdit2, 1, 2 );
+
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+
+ GroupBox1Layout->addWidget( TextLabel2, 1, 0 );
+
+ PushButton3 = new QPushButton( GroupBox1, "PushButton3" );
+ PushButton3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton3->sizePolicy().hasHeightForWidth() ) );
+
+ GroupBox1Layout->addWidget( PushButton3, 2, 1 );
+
+ LineEdit3 = new QLineEdit( GroupBox1, "LineEdit3" );
+
+ GroupBox1Layout->addWidget( LineEdit3, 2, 2 );
+
+ TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
+ TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
+
+ GroupBox1Layout->addWidget( TextLabel3, 2, 0 );
+
+ radioButton4 = new QRadioButton( GroupBox1, "radioButton4" );
+
+ GroupBox1Layout->addMultiCellWidget( radioButton4, 3, 3, 0, 1 );
+ Spacer3 = new QSpacerItem( 16, 721, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ GroupBox1Layout->addItem( Spacer3, 4, 2 );
+
+ DlgRef_3Sel1Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
+ languageChange();
+ resize( QSize(490, 878).expandedTo(minimumSizeHint()) );
+ clearWState( WState_Polished );
+
+ // tab order
+ setTabOrder( PushButton1, LineEdit1 );
+ setTabOrder( LineEdit1, PushButton2 );
+ setTabOrder( PushButton2, LineEdit2 );
+ setTabOrder( LineEdit2, PushButton3 );
+ setTabOrder( PushButton3, LineEdit3 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+DlgRef_3Sel1Check_QTD::~DlgRef_3Sel1Check_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ * Sets the strings of the subwidgets using the current
+ * language.
+ */
+void DlgRef_3Sel1Check_QTD::languageChange()
+{
+ setCaption( tr( "DlgRef_3Sel3Spin1Check_QTD" ) );
+ GroupBox1->setTitle( QString::null );
+ PushButton1->setText( QString::null );
+ TextLabel1->setText( tr( "TL1" ) );
+ PushButton2->setText( QString::null );
+ TextLabel2->setText( tr( "TL2" ) );
+ PushButton3->setText( QString::null );
+ TextLabel3->setText( tr( "TL3" ) );
+ radioButton4->setText( tr( "radioButton4" ) );
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'UIFiles/DlgRef_3Sel1Check_QTD.ui'
+**
+** Created: Wed Feb 21 10:48:39 2007
+** by: The User Interface Compiler ($Id$)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+
+#ifndef DLGREF_3SEL1CHECK_QTD_H
+#define DLGREF_3SEL1CHECK_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QSpacerItem;
+class QGroupBox;
+class QPushButton;
+class QLineEdit;
+class QLabel;
+class QRadioButton;
+
+class DlgRef_3Sel1Check_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ DlgRef_3Sel1Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~DlgRef_3Sel1Check_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* PushButton1;
+ QLineEdit* LineEdit1;
+ QLabel* TextLabel1;
+ QPushButton* PushButton2;
+ QLineEdit* LineEdit2;
+ QLabel* TextLabel2;
+ QPushButton* PushButton3;
+ QLineEdit* LineEdit3;
+ QLabel* TextLabel3;
+ QRadioButton* radioButton4;
+
+protected:
+ QGridLayout* DlgRef_3Sel1Check_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QSpacerItem* Spacer3;
+
+protected slots:
+ virtual void languageChange();
+
+};
+
+#endif // DLGREF_3SEL1CHECK_QTD_H
DlgRef_3Sel1Spin.cxx \
DlgRef_3Check_QTD.cxx \
DlgRef_6Sel_QTD.cxx \
- DlgRef_4Sel1Spin2Check.cxx
+ DlgRef_4Sel1Spin2Check.cxx \
+ DlgRef_3Sel1Check_QTD.cxx
MOC_FILES = \
DlgRef_Skeleton_QTD_moc.cxx \
DlgRef_1Sel_Ext_moc.cxx \
DlgRef_3Check_QTD_moc.cxx \
DlgRef_6Sel_QTD_moc.cxx \
- DlgRef_4Sel1Spin2Check_moc.cxx
+ DlgRef_4Sel1Spin2Check_moc.cxx \
+ DlgRef_3Sel1Check_QTD_moc.cxx
# header files
salomeinclude_HEADERS = \
DlgRef_3Check_QTD.h \
DlgRef_6Sel_QTD.h \
DlgRef_4Sel1Spin2Check.h \
+ DlgRef_3Sel1Check_QTD.h \
GEOM_DlgRef.hxx
nodist_libDlgRef_la_SOURCES= \
--- /dev/null
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>DlgRef_3Sel1Check_QTD</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>DlgRef_3Sel1Check_QTD</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>490</width>
+ <height>878</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>DlgRef_3Sel3Spin1Check_QTD</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="2">
+ <property name="name">
+ <cstring>LineEdit1</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL1</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="1" column="2">
+ <property name="name">
+ <cstring>LineEdit2</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL2</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="2" column="2">
+ <property name="name">
+ <cstring>LineEdit3</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL3</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>radioButton4</cstring>
+ </property>
+ <property name="text">
+ <string>radioButton4</string>
+ </property>
+ </widget>
+ <spacer row="4" column="2">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>721</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<tabstops>
+ <tabstop>PushButton1</tabstop>
+ <tabstop>LineEdit1</tabstop>
+ <tabstop>PushButton2</tabstop>
+ <tabstop>LineEdit2</tabstop>
+ <tabstop>PushButton3</tabstop>
+ <tabstop>LineEdit3</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
// TRUE to construct a modal dialog.
//=================================================================================
EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent,
- const char* name, bool modal, WFlags fl)
+ const char* name, bool modal, WFlags fl,
+ const double lineWidth)
:EntityGUI_Skeleton_QTD(parent, name, modal, WStyle_Customize |
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
myIsAllAdded( false ),
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
- myGeometryGUI( GUI )
+ myGeometryGUI( GUI ),
+ myLineWidth( lineWidth )
{
myGeometryGUI->SetActiveDialogBox(this);
resize( 0, 0 );
TypeClicked(0);
- GEOMBase_Helper::displayPreview();
+ GEOMBase_Helper::displayPreview(false, true, true, myLineWidth);
}
Group2Spin->show();
Group2Spin->buttonApply->setFocus();
- GEOMBase_Helper::displayPreview();
+ GEOMBase_Helper::displayPreview(false, true, true, myLineWidth);
}
else if ( constructorId == 0 )
{ // DXDY
Group2Spin->show();
Group2Spin->buttonApply->setFocus();
- GEOMBase_Helper::displayPreview();
+ GEOMBase_Helper::displayPreview(false, true, true, myLineWidth);
}
else if ( constructorId == 2 )
{ // Selection
}
}
- GEOMBase_Helper::displayPreview();
+ GEOMBase_Helper::displayPreview(false, true, true, myLineWidth);
}
setEnabledUndo(true);
setEnabledRedo(false);
- GEOMBase_Helper::displayPreview();
+ GEOMBase_Helper::displayPreview(false, true, true, myLineWidth);
// Set focus to SpinBox_DX
if (sender() == Group1Spin->buttonApply) {
setEnabledRedo(true);
- GEOMBase_Helper::displayPreview();
+ GEOMBase_Helper::displayPreview(false, true, true, myLineWidth);
}
//=================================================================================
if(myUndoCommand.count() == 1)
setEnabledRedo(false);
- GEOMBase_Helper::displayPreview();
+ GEOMBase_Helper::displayPreview(false, true, true, myLineWidth);
}
//=================================================================================
}
}
- GEOMBase_Helper::displayPreview();
+ GEOMBase_Helper::displayPreview(false, true, true, myLineWidth);
}
myEditCurrentArgument = Group1Sel->LineEdit1;
myEditCurrentArgument->setFocus();
- GEOMBase_Helper::displayPreview();
+ GEOMBase_Helper::displayPreview(false, true, true, myLineWidth);
}
}
}
- GEOMBase_Helper::displayPreview();
+ GEOMBase_Helper::displayPreview(false, true, true, myLineWidth);
}
getDisplayer()->SetColor( Quantity_NOC_RED );
// set width of displayed shape
- getDisplayer()->SetWidth( lineWidth );
+ getDisplayer()->SetWidth( (lineWidth == -1)?myLineWidth:lineWidth );
// Disable activation of selection
getDisplayer()->SetToActivate( activate );
public:
EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent = 0,
- const char* name = 0, bool modal = FALSE, WFlags fl = 0);
+ const char* name = 0, bool modal = FALSE, WFlags fl = 0,
+ const double lineWidth = 2.);
~EntityGUI_SketcherDlg();
bool eventFilter (QObject* object, QEvent* event);
DIR_TAN_LENGTH, DIR_TAN_X, DIR_TAN_Y,
DIR_DXDY_LENGTH, DIR_DXDY_X, DIR_DXDY_Y};
+ double myLineWidth;
virtual void displayPreview ( GEOM::GEOM_Object_ptr obj,
const bool append = false,
const bool activate = false,
bool EntityGUI_SubShapeDlg::execute( ObjectList& objects )
{
GEOM::ListOfGO_var aList = GEOM::GEOM_IShapesOperations::_narrow(
- getOperation() )->MakeExplode( myObject, shapeType(), false );
+ getOperation() )->MakeExplode( myObject, shapeType(), true );
if ( !aList->length() )
return false;
ST_INOUT
end State;
--
+ enumeration KindOfShape is
+ KS_UNKNOWN,
+ KS_SPHERE,
+ KS_CYLINDER,
+ KS_BOX,
+ KS_TORUS,
+ KS_CONE,
+ KS_ELLIPSE,
+ KS_PLANE,
+ KS_CIRCLE,
+ KS_LINE,
+ KS_DEGENERATED
+ end KindOfShape;
+ --
+ enumeration KindOfName is
+ KN_UNKNOWN,
+ KN_SPHERE,
+ KN_CYLINDER,
+ KN_TORUS,
+ KN_CONE,
+ KN_ELLIPSE,
+ KN_CIRCLE,
+ KN_PLANE,
+ KN_LINE,
+ KN_BOX,
+ KN_SEGMENT,
+ KN_ARCCIRCLE,
+ KN_POLYGON,
+ KN_POLYHEDRON,
+ KN_DISKCIRCLE,
+ KN_DISKELLIPSE,
+ KN_RECTANGLE,
+ KN_TRIANGLE,
+ KN_QUADRANGLE,
+ KN_ARCELLIPSE
+ end KindOfName;
+ --
+ enumeration KindOfBounds is
+ KB_UNKNOWN,
+ KB_TRIMMED,
+ KB_INFINITE
+ end KindOfBounds;
+ --
+ enumeration KindOfClosed is
+ KC_UNKNOWN,
+ KC_CLOSED,
+ KC_NOTCLOSED
+ end KindOfClosed;
+ --
deferred class HAlgo;
deferred class Clsf;
class ClsfSurf;
deferred class Algo;
deferred class ShapeAlgo;
--
+ class ShapeInfo;
+ class ShapeInfoFiller;
+ --
-- gluer
class Gluer;
+ class Gluer1;
class GlueAnalyser;
class CoupleOfShapes;
class PassKey;
--
class FinderShapeOn1;
class StateCollector;
-
+ -- adds
+ deferred class HAlgo;
+ deferred class Clsf;
+ class ClsfSurf;
+ class ClsfBox;
+ --modified by NIZNHY-PKV Mon Jan 29 10:27:44 2007f
+ class ClsfSolid;
+ --modified by NIZNHY-PKV Mon Jan 29 10:27:46 2007t
+ class FinderShapeOn2;
+ class PassKeyShapeMapHasher;
--
-- Builder/Splitter
deferred class BuilderShape;
instantiates List from TCollection (CoupleOfShapes from GEOMAlgo);
- class IndexedDataMapOfShapeState
+ class IndexedDataMapOfShapeState
instantiates IndexedDataMap from TCollection (Shape from TopoDS,
State from TopAbs,
ShapeMapHasher from TopTools);
- class ListOfPnt
+ class ListOfPnt
instantiates List from TCollection (Pnt from gp);
- class DataMapOfPassKeyInteger
+ class DataMapOfPassKeyInteger
instantiates DataMap from TCollection (PassKey from GEOMAlgo,
Integer from Standard,
PassKeyMapHasher from GEOMAlgo);
- class IndexedDataMapOfPassKeyShapeListOfShape
+ class IndexedDataMapOfPassKeyShapeListOfShape
instantiates IndexedDataMap from TCollection (PassKeyShape from GEOMAlgo,
ListOfShape from TopTools,
PassKeyShapeMapHasher from GEOMAlgo);
+ class IndexedDataMapOfShapeShapeInfo
+ instantiates IndexedDataMap from TCollection (Shape from TopoDS,
+ ShapeInfo from GEOMAlgo,
+ ShapeMapHasher from TopTools);
+
+ class DataMapOfPassKeyShapeShape
+ instantiates DataMap from TCollection (PassKeyShape from GEOMAlgo,
+ Shape from TopoDS,
+ PassKeyShapeMapHasher from GEOMAlgo);
+
+ class DataMapOfShapeShapeSet instantiates
+ DataMap from TCollection(Shape from TopoDS,
+ ShapeSet from GEOMAlgo,
+ ShapeMapHasher from TopTools);
+
+ class DataMapOfShapeReal instantiates
+ DataMap from TCollection(Shape from TopoDS,
+ Real from Standard,
+ ShapeMapHasher from TopTools);
+
+
+ class DataMapOfRealListOfShape instantiates
+ DataMap from TCollection(Real from Standard,
+ ListOfShape from TopTools,
+ MapRealHasher from TColStd);
+
end GEOMAlgo;
--
-- protected methods
--
+ --
+ PerformInternal(me:out;
+ theDSF: DSFiller from NMTTools)
+ ---Purpose: Performs calculations using prepared DSFiller
+ -- object theDSF
+ is protected;
+ --
PrepareHistory (me:out)
---Purpose: Prepare information for history support
is redefined protected;
mySameDomainShapes: IndexedDataMapOfShapeShape from TopTools is protected;
-- solids
myDraftSolids : IndexedDataMapOfShapeShape from TopTools is protected;
-
+ myEntryPoint : Integer from Standard is protected;
--
end Builder;
{
myNbTypes=9;
myDSFiller=NULL;
+ myEntryPoint=0; // Entry point through PerformWithFiller ()
}
//=======================================================================
//function : ~
//=======================================================================
GEOMAlgo_Builder::~GEOMAlgo_Builder()
{
+ if (myEntryPoint==1) {
+ if (myDSFiller) {
+ delete myDSFiller;
+ myDSFiller=NULL;
+ }
+ }
}
//=======================================================================
//function : AddCompound
aBB.Add(aCS, aS);
}
//
+ if (myDSFiller) {
+ delete myDSFiller;
+ myDSFiller=NULL;
+ }
NMTTools_DSFiller* pDSF=new NMTTools_DSFiller;
//
pDSF->SetCompositeShape(aCS);
pDSF->Perform();
//
- PerformWithFiller(*pDSF);
+ myEntryPoint=1;
+ PerformInternal(*pDSF);
}
//=======================================================================
//function : PerformWithFiller
//purpose :
//=======================================================================
void GEOMAlgo_Builder::PerformWithFiller(const NMTTools_DSFiller& theDSF)
+{
+ myEntryPoint=0;
+ //
+ PerformInternal(theDSF);
+}
+//=======================================================================
+//function : PerformInternal
+//purpose :
+//=======================================================================
+ void GEOMAlgo_Builder::PerformInternal(const NMTTools_DSFiller& theDSF)
{
myErrorStatus=0;
//
// Methods PROTECTED
//
+//! Performs calculations using prepared DSFiller <br>
+//! object theDSF <br>
+Standard_EXPORT void PerformInternal(const NMTTools_DSFiller& theDSF) ;
+
//! Prepare information for history support <br>
Standard_EXPORT virtual void PrepareHistory() ;
BRepAlgo_Image mySplitFaces;
TopTools_IndexedDataMapOfShapeShape mySameDomainShapes;
TopTools_IndexedDataMapOfShapeShape myDraftSolids;
+Standard_Integer myEntryPoint;
private:
theWires.Append(aW);
}
}
-
//=======================================================================
//function : IsInside
//purpose :
const TopoDS_Shape& theF2,
IntTools_PContext& theContext)
{
+ Standard_Boolean bRet;
Standard_Real aT, aU, aV;
+
+ TopAbs_State aState;
TopExp_Explorer aExp;
- TopAbs_State aState=TopAbs_UNKNOWN;
+ TopTools_IndexedMapOfShape aME2;
gp_Pnt2d aP2D;
//
+ bRet=Standard_False;
+ aState=TopAbs_UNKNOWN;
const TopoDS_Face& aF2=TopoDS::Face(theF2);
//
+ TopExp::MapShapes(aF2, TopAbs_EDGE, aME2);
+ //
aExp.Init(theHole, TopAbs_EDGE);
- if (aExp.More()){
+ if (aExp.More()) {
const TopoDS_Edge& aE = TopoDS::Edge(aExp.Current());
+ if (aME2.Contains(aE)) {
+ return bRet;
+ }
+ //
aT=BOPTools_Tools2D::IntermediatePoint(aE);
BOPTools_Tools2D::PointOnSurface(aE, aF2, aT, aU, aV);
aP2D.SetCoord(aU, aV);
//
IntTools_FClass2d& aClsf=theContext->FClass2d(aF2);
aState=aClsf.Perform(aP2D);
+ bRet=(aState==TopAbs_IN);
}
- return (aState==TopAbs_IN);
+ //
+ return bRet;
}
+
//=======================================================================
//function : IsGrowthWire
//purpose :
}
return bRet;
}
-//modified by NIZNHY-PKV Mon Sep 18 13:18:27 2006f
-/*
-static
- Standard_Boolean IsHole(const TopoDS_Shape& ,
- const TopoDS_Face& ,
- IntTools_PContext& );
-*/
-//modified by NIZNHY-PKV Mon Sep 18 13:18:34 2006t
-//modified by NIZNHY-PKV Mon Sep 18 13:18:13 2006f
+
+//BRepTools::Write(aFF, "ff");
+//
+// ErrorStatus :
+// 11 - Null Context
+// 12 - Null face generix
+
/*
//=======================================================================
-//function : IsHole
+//function : IsInside
//purpose :
//=======================================================================
-Standard_Boolean IsHole(const TopoDS_Shape& theS2,
- const TopoDS_Face& theFace,
- IntTools_PContext& theContext)
+Standard_Boolean IsInside(const TopoDS_Shape& theHole,
+ const TopoDS_Shape& theF2,
+ IntTools_PContext& theContext)
{
- Standard_Boolean bIsHole;
- Standard_Real aTol;
- Handle(Geom_Surface) aS;
- TopLoc_Location aLoc;
- TopoDS_Face aF;
- BRep_Builder aBB;
- //
- aTol=BRep_Tool::Tolerance(theFace);
- aS=BRep_Tool::Surface(theFace, aLoc);
- aBB.MakeFace(aF, aS, aLoc, aTol);
- aBB.Add (aF, theS2);
- //
- IntTools_FClass2d& aClsf=theContext->FClass2d(aF);
- //
- bIsHole=aClsf.IsHole();
+ Standard_Real aT, aU, aV;
+ TopExp_Explorer aExp;
+ TopAbs_State aState=TopAbs_UNKNOWN;
+ gp_Pnt2d aP2D;
//
- return bIsHole;
+ const TopoDS_Face& aF2=TopoDS::Face(theF2);
//
+ aExp.Init(theHole, TopAbs_EDGE);
+ if (aExp.More()){
+ const TopoDS_Edge& aE = TopoDS::Edge(aExp.Current());
+ aT=BOPTools_Tools2D::IntermediatePoint(aE);
+ BOPTools_Tools2D::PointOnSurface(aE, aF2, aT, aU, aV);
+ aP2D.SetCoord(aU, aV);
+ //
+ IntTools_FClass2d& aClsf=theContext->FClass2d(aF2);
+ aState=aClsf.Perform(aP2D);
+ }
+ return (aState==TopAbs_IN);
}
*/
-//modified by NIZNHY-PKV Mon Sep 18 13:18:06 2006t
-
-//BRepTools::Write(aFF, "ff");
-//
-// ErrorStatus :
-// 11 - Null Context
-// 12 - Null face generix
-
--- /dev/null
+-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either
+-- version 2.1 of the License.
+--
+-- This library is distributed in the hope that it will be useful
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File: GEOMAlgo_ClsfSolid.cdl
+-- Created: Mon Jan 29 10:28:07 2007
+-- Author: Peter KURNEV
+-- <pkv@irinox>
+
+
+class ClsfSolid from GEOMAlgo
+ inherits Clsf from GEOMAlgo
+
+ ---Purpose:
+
+uses
+ Shape from TopoDS
+
+--raises
+
+is
+ Create
+ returns mutable ClsfSolid from GEOMAlgo;
+ ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_ClsfSolid();"
+
+ SetShape(me:mutable;
+ aS:Shape from TopoDS);
+
+ Shape(me)
+ returns Shape from TopoDS;
+ ---C++: return const &
+
+ Perform(me:mutable)
+ is redefined;
+
+ CheckData(me:mutable)
+ is redefined;
+
+
+fields
+ myShape: Shape from TopoDS is protected;
+ myPClsf: Address from Standard is protected;
+
+end ClsfSolid;
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File: GEOMAlgo_ClsfSolid.cxx
+// Created: Mon Jan 29 10:35:46 2007
+// Author: Peter KURNEV
+// <pkv@irinox>
+
+
+#include <GEOMAlgo_ClsfSolid.ixx>
+
+#include <TopAbs_ShapeEnum.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Solid.hxx>
+#include <BRep_Builder.hxx>
+#include <BRepClass3d_SolidClassifier.hxx>
+
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+ GEOMAlgo_ClsfSolid::GEOMAlgo_ClsfSolid()
+:
+ GEOMAlgo_Clsf()
+{
+ myPClsf=NULL;
+}
+//=======================================================================
+//function : ~
+//purpose :
+//=======================================================================
+ GEOMAlgo_ClsfSolid::~GEOMAlgo_ClsfSolid()
+{
+ if (myPClsf) {
+ BRepClass3d_SolidClassifier* pSC;
+ //
+ pSC=(BRepClass3d_SolidClassifier*)myPClsf;
+ delete pSC;
+ }
+}
+//=======================================================================
+//function : SetShape
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ClsfSolid::SetShape(const TopoDS_Shape& aS)
+{
+ myShape=aS;
+}
+//=======================================================================
+//function : Shape
+//purpose :
+//=======================================================================
+ const TopoDS_Shape& GEOMAlgo_ClsfSolid::Shape()const
+{
+ return myShape;
+}
+//=======================================================================
+//function : CheckData
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ClsfSolid::CheckData()
+{
+ myErrorStatus=0;
+ //
+ BRepClass3d_SolidClassifier* pSC;
+ TopAbs_ShapeEnum aType;
+ BRep_Builder aBB;
+ TopoDS_Solid aS;
+ //
+ if (myShape.IsNull()) {
+ myErrorStatus=10; // mySolid=NULL
+ return;
+ }
+ //
+ aType=myShape.ShapeType();
+ if (!(aType==TopAbs_SOLID || aType==TopAbs_SHELL)) {
+ myErrorStatus=12;
+ return;
+ }
+ //
+ //===
+ if (aType==TopAbs_SOLID) {
+ aS=TopoDS::Solid(myShape);
+ }
+ else {
+ aBB.MakeSolid(aS);
+ aBB.Add(aS, myShape);
+ }
+ //
+ if (myPClsf) {
+ pSC=(BRepClass3d_SolidClassifier*)myPClsf;
+ delete pSC;
+ }
+ //
+ pSC=new BRepClass3d_SolidClassifier(aS);
+ myPClsf=pSC;
+}
+//=======================================================================
+//function : Perform
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ClsfSolid::Perform()
+{
+ myErrorStatus=0;
+ //
+ if (!myPClsf) {
+ myErrorStatus=11;
+ return;
+ }
+ //
+ BRepClass3d_SolidClassifier* pSC;
+ //
+ pSC=(BRepClass3d_SolidClassifier*)myPClsf;
+ pSC->Perform(myPnt, myTolerance);
+ myState=pSC->State();
+}
+//
+// myErrorStatus :
+//
+// 10 - mySolid=NULL
+// 11 - myPClsf=NULL
+// 12 - unallowed type of myShape
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_ClsfSolid_HeaderFile
+#define _GEOMAlgo_ClsfSolid_HeaderFile
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Handle_GEOMAlgo_ClsfSolid_HeaderFile
+#include <Handle_GEOMAlgo_ClsfSolid.hxx>
+#endif
+
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _Standard_Address_HeaderFile
+#include <Standard_Address.hxx>
+#endif
+#ifndef _GEOMAlgo_Clsf_HeaderFile
+#include <GEOMAlgo_Clsf.hxx>
+#endif
+class TopoDS_Shape;
+
+
+
+class GEOMAlgo_ClsfSolid : public GEOMAlgo_Clsf {
+
+public:
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT GEOMAlgo_ClsfSolid();
+Standard_EXPORT virtual ~GEOMAlgo_ClsfSolid();
+
+
+Standard_EXPORT void SetShape(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT const TopoDS_Shape& Shape() const;
+
+
+Standard_EXPORT virtual void Perform() ;
+
+
+Standard_EXPORT virtual void CheckData() ;
+//Standard_EXPORT ~GEOMAlgo_ClsfSolid();
+
+
+
+
+ // Type management
+ //
+ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+TopoDS_Shape myShape;
+Standard_Address myPClsf;
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <GEOMAlgo_ClsfSolid.jxx>
+
+#ifndef _Standard_TypeMismatch_HeaderFile
+#include <Standard_TypeMismatch.hxx>
+#endif
+
+//GEOMAlgo_ClsfSolid::~GEOMAlgo_ClsfSolid() {}
+
+
+
+Standard_EXPORT Handle_Standard_Type& GEOMAlgo_ClsfSolid_Type_()
+{
+
+ static Handle_Standard_Type aType1 = STANDARD_TYPE(GEOMAlgo_Clsf);
+ static Handle_Standard_Type aType2 = STANDARD_TYPE(GEOMAlgo_HAlgo);
+ static Handle_Standard_Type aType3 = STANDARD_TYPE(MMgt_TShared);
+ static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient);
+
+
+ static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
+ static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_ClsfSolid",
+ sizeof(GEOMAlgo_ClsfSolid),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
+
+ return _aType;
+}
+
+
+// DownCast method
+// allow safe downcasting
+//
+const Handle(GEOMAlgo_ClsfSolid) Handle(GEOMAlgo_ClsfSolid)::DownCast(const Handle(Standard_Transient)& AnObject)
+{
+ Handle(GEOMAlgo_ClsfSolid) _anOtherObject;
+
+ if (!AnObject.IsNull()) {
+ if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_ClsfSolid))) {
+ _anOtherObject = Handle(GEOMAlgo_ClsfSolid)((Handle(GEOMAlgo_ClsfSolid)&)AnObject);
+ }
+ }
+
+ return _anOtherObject ;
+}
+const Handle(Standard_Type)& GEOMAlgo_ClsfSolid::DynamicType() const
+{
+ return STANDARD_TYPE(GEOMAlgo_ClsfSolid) ;
+}
+//Standard_Boolean GEOMAlgo_ClsfSolid::IsKind(const Handle(Standard_Type)& AType) const
+//{
+// return (STANDARD_TYPE(GEOMAlgo_ClsfSolid) == AType || GEOMAlgo_Clsf::IsKind(AType));
+//}
+//Handle_GEOMAlgo_ClsfSolid::~Handle_GEOMAlgo_ClsfSolid() {}
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _GEOMAlgo_ClsfSolid_HeaderFile
+#include <GEOMAlgo_ClsfSolid.hxx>
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape_HeaderFile
+#define _GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape_HeaderFile
+
+#ifndef _TCollection_BasicMapIterator_HeaderFile
+#include <TCollection_BasicMapIterator.hxx>
+#endif
+#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_HeaderFile
+#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx>
+#endif
+class Standard_NoSuchObject;
+class GEOMAlgo_PassKeyShape;
+class TopoDS_Shape;
+class GEOMAlgo_PassKeyShapeMapHasher;
+class GEOMAlgo_DataMapOfPassKeyShapeShape;
+class GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape : public TCollection_BasicMapIterator {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape();
+
+
+Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape(const GEOMAlgo_DataMapOfPassKeyShapeShape& aMap);
+
+
+Standard_EXPORT void Initialize(const GEOMAlgo_DataMapOfPassKeyShapeShape& aMap) ;
+
+
+Standard_EXPORT const GEOMAlgo_PassKeyShape& Key() const;
+
+
+Standard_EXPORT const TopoDS_Shape& Value() const;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape.hxx>
+
+#ifndef _Standard_NoSuchObject_HeaderFile
+#include <Standard_NoSuchObject.hxx>
+#endif
+#ifndef _GEOMAlgo_PassKeyShape_HeaderFile
+#include <GEOMAlgo_PassKeyShape.hxx>
+#endif
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _GEOMAlgo_PassKeyShapeMapHasher_HeaderFile
+#include <GEOMAlgo_PassKeyShapeMapHasher.hxx>
+#endif
+#ifndef _GEOMAlgo_DataMapOfPassKeyShapeShape_HeaderFile
+#include <GEOMAlgo_DataMapOfPassKeyShapeShape.hxx>
+#endif
+#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_HeaderFile
+#include <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx>
+#endif
+
+
+#define TheKey GEOMAlgo_PassKeyShape
+#define TheKey_hxx <GEOMAlgo_PassKeyShape.hxx>
+#define TheItem TopoDS_Shape
+#define TheItem_hxx <TopoDS_Shape.hxx>
+#define Hasher GEOMAlgo_PassKeyShapeMapHasher
+#define Hasher_hxx <GEOMAlgo_PassKeyShapeMapHasher.hxx>
+#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape
+#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx>
+#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape
+#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape.hxx>
+#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape
+#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_Type_()
+#define TCollection_DataMap GEOMAlgo_DataMapOfPassKeyShapeShape
+#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfPassKeyShapeShape.hxx>
+#include <TCollection_DataMapIterator.gxx>
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_HeaderFile
+#define _GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_HeaderFile
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_HeaderFile
+#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx>
+#endif
+
+#ifndef _GEOMAlgo_PassKeyShape_HeaderFile
+#include <GEOMAlgo_PassKeyShape.hxx>
+#endif
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _TCollection_MapNode_HeaderFile
+#include <TCollection_MapNode.hxx>
+#endif
+#ifndef _TCollection_MapNodePtr_HeaderFile
+#include <TCollection_MapNodePtr.hxx>
+#endif
+class GEOMAlgo_PassKeyShape;
+class TopoDS_Shape;
+class GEOMAlgo_PassKeyShapeMapHasher;
+class GEOMAlgo_DataMapOfPassKeyShapeShape;
+class GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape;
+
+
+
+class GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape : public TCollection_MapNode {
+
+public:
+ // Methods PUBLIC
+ //
+
+GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape(const GEOMAlgo_PassKeyShape& K,const TopoDS_Shape& I,const TCollection_MapNodePtr& n);
+
+ GEOMAlgo_PassKeyShape& Key() const;
+
+ TopoDS_Shape& Value() const;
+//Standard_EXPORT ~GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape();
+
+
+
+
+ // Type management
+ //
+ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+GEOMAlgo_PassKeyShape myKey;
+TopoDS_Shape myValue;
+
+
+};
+
+#define TheKey GEOMAlgo_PassKeyShape
+#define TheKey_hxx <GEOMAlgo_PassKeyShape.hxx>
+#define TheItem TopoDS_Shape
+#define TheItem_hxx <TopoDS_Shape.hxx>
+#define Hasher GEOMAlgo_PassKeyShapeMapHasher
+#define Hasher_hxx <GEOMAlgo_PassKeyShapeMapHasher.hxx>
+#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape
+#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx>
+#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape
+#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape.hxx>
+#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape
+#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_Type_()
+#define TCollection_DataMap GEOMAlgo_DataMapOfPassKeyShapeShape
+#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfPassKeyShapeShape.hxx>
+
+#include <TCollection_DataMapNode.lxx>
+
+#undef TheKey
+#undef TheKey_hxx
+#undef TheItem
+#undef TheItem_hxx
+#undef Hasher
+#undef Hasher_hxx
+#undef TCollection_DataMapNode
+#undef TCollection_DataMapNode_hxx
+#undef TCollection_DataMapIterator
+#undef TCollection_DataMapIterator_hxx
+#undef Handle_TCollection_DataMapNode
+#undef TCollection_DataMapNode_Type_
+#undef TCollection_DataMap
+#undef TCollection_DataMap_hxx
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx>
+
+#ifndef _Standard_TypeMismatch_HeaderFile
+#include <Standard_TypeMismatch.hxx>
+#endif
+
+#ifndef _GEOMAlgo_PassKeyShape_HeaderFile
+#include <GEOMAlgo_PassKeyShape.hxx>
+#endif
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _GEOMAlgo_PassKeyShapeMapHasher_HeaderFile
+#include <GEOMAlgo_PassKeyShapeMapHasher.hxx>
+#endif
+#ifndef _GEOMAlgo_DataMapOfPassKeyShapeShape_HeaderFile
+#include <GEOMAlgo_DataMapOfPassKeyShapeShape.hxx>
+#endif
+#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape_HeaderFile
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape.hxx>
+#endif
+//GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape::~GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape() {}
+
+
+
+Standard_EXPORT Handle_Standard_Type& GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_Type_()
+{
+
+ static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
+ static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
+ static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
+
+
+ static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
+ static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape",
+ sizeof(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
+
+ return _aType;
+}
+
+
+// DownCast method
+// allow safe downcasting
+//
+const Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape) Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape)::DownCast(const Handle(Standard_Transient)& AnObject)
+{
+ Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape) _anOtherObject;
+
+ if (!AnObject.IsNull()) {
+ if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape))) {
+ _anOtherObject = Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape)((Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape)&)AnObject);
+ }
+ }
+
+ return _anOtherObject ;
+}
+const Handle(Standard_Type)& GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape::DynamicType() const
+{
+ return STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape) ;
+}
+//Standard_Boolean GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape::IsKind(const Handle(Standard_Type)& AType) const
+//{
+// return (STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape) == AType || TCollection_MapNode::IsKind(AType));
+//}
+//Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape::~Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape() {}
+#define TheKey GEOMAlgo_PassKeyShape
+#define TheKey_hxx <GEOMAlgo_PassKeyShape.hxx>
+#define TheItem TopoDS_Shape
+#define TheItem_hxx <TopoDS_Shape.hxx>
+#define Hasher GEOMAlgo_PassKeyShapeMapHasher
+#define Hasher_hxx <GEOMAlgo_PassKeyShapeMapHasher.hxx>
+#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape
+#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx>
+#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape
+#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape.hxx>
+#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape
+#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_Type_()
+#define TCollection_DataMap GEOMAlgo_DataMapOfPassKeyShapeShape
+#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfPassKeyShapeShape.hxx>
+#include <TCollection_DataMapNode.gxx>
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_DataMapOfPassKeyShapeShape_HeaderFile
+#define _GEOMAlgo_DataMapOfPassKeyShapeShape_HeaderFile
+
+#ifndef _TCollection_BasicMap_HeaderFile
+#include <TCollection_BasicMap.hxx>
+#endif
+#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_HeaderFile
+#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class Standard_DomainError;
+class Standard_NoSuchObject;
+class GEOMAlgo_PassKeyShape;
+class TopoDS_Shape;
+class GEOMAlgo_PassKeyShapeMapHasher;
+class GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape;
+class GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class GEOMAlgo_DataMapOfPassKeyShapeShape : public TCollection_BasicMap {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT GEOMAlgo_DataMapOfPassKeyShapeShape(const Standard_Integer NbBuckets = 1);
+
+
+Standard_EXPORT GEOMAlgo_DataMapOfPassKeyShapeShape& Assign(const GEOMAlgo_DataMapOfPassKeyShapeShape& Other) ;
+ GEOMAlgo_DataMapOfPassKeyShapeShape& operator =(const GEOMAlgo_DataMapOfPassKeyShapeShape& Other)
+{
+ return Assign(Other);
+}
+
+
+
+Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
+
+
+Standard_EXPORT void Clear() ;
+~GEOMAlgo_DataMapOfPassKeyShapeShape()
+{
+ Clear();
+}
+
+
+
+Standard_EXPORT Standard_Boolean Bind(const GEOMAlgo_PassKeyShape& K,const TopoDS_Shape& I) ;
+
+
+Standard_EXPORT Standard_Boolean IsBound(const GEOMAlgo_PassKeyShape& K) const;
+
+
+Standard_EXPORT Standard_Boolean UnBind(const GEOMAlgo_PassKeyShape& K) ;
+
+
+Standard_EXPORT const TopoDS_Shape& Find(const GEOMAlgo_PassKeyShape& K) const;
+ const TopoDS_Shape& operator()(const GEOMAlgo_PassKeyShape& K) const
+{
+ return Find(K);
+}
+
+
+
+Standard_EXPORT TopoDS_Shape& ChangeFind(const GEOMAlgo_PassKeyShape& K) ;
+ TopoDS_Shape& operator()(const GEOMAlgo_PassKeyShape& K)
+{
+ return ChangeFind(K);
+}
+
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+Standard_EXPORT GEOMAlgo_DataMapOfPassKeyShapeShape(const GEOMAlgo_DataMapOfPassKeyShapeShape& Other);
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <GEOMAlgo_DataMapOfPassKeyShapeShape.hxx>
+
+#ifndef _Standard_DomainError_HeaderFile
+#include <Standard_DomainError.hxx>
+#endif
+#ifndef _Standard_NoSuchObject_HeaderFile
+#include <Standard_NoSuchObject.hxx>
+#endif
+#ifndef _GEOMAlgo_PassKeyShape_HeaderFile
+#include <GEOMAlgo_PassKeyShape.hxx>
+#endif
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _GEOMAlgo_PassKeyShapeMapHasher_HeaderFile
+#include <GEOMAlgo_PassKeyShapeMapHasher.hxx>
+#endif
+#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_HeaderFile
+#include <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx>
+#endif
+#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape_HeaderFile
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape.hxx>
+#endif
+
+
+#define TheKey GEOMAlgo_PassKeyShape
+#define TheKey_hxx <GEOMAlgo_PassKeyShape.hxx>
+#define TheItem TopoDS_Shape
+#define TheItem_hxx <TopoDS_Shape.hxx>
+#define Hasher GEOMAlgo_PassKeyShapeMapHasher
+#define Hasher_hxx <GEOMAlgo_PassKeyShapeMapHasher.hxx>
+#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape
+#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx>
+#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape
+#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape.hxx>
+#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape
+#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_Type_()
+#define TCollection_DataMap GEOMAlgo_DataMapOfPassKeyShapeShape
+#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfPassKeyShapeShape.hxx>
+#include <TCollection_DataMap.gxx>
+
#include <GEOMAlgo_Gluer.ixx>
+#include <NMTDS_BoxBndTree.hxx>
+#include <NCollection_UBTreeFiller.hxx>
+
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TColStd_MapOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
-#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx> //qft
-#include <GEOMAlgo_PassKeyShape.hxx>//qft
+#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
+#include <GEOMAlgo_PassKeyShape.hxx>
#include <GEOMAlgo_Tools.hxx>
//
{
myErrorStatus=0;
//
- Standard_Integer j, i, aNbV, aIndex, aNbVSD;
+ Standard_Integer j, i, aNbV, aNbVSD;
TColStd_ListIteratorOfListOfInteger aIt;
- Handle(Bnd_HArray1OfBox) aHAB;
- Bnd_BoundSortBox aBSB;
- TopoDS_Shape aSTmp, aVF;
+ TopoDS_Shape aVF;
TopoDS_Vertex aVnew;
TopTools_IndexedMapOfShape aMV, aMVProcessed;
TopTools_ListIteratorOfListOfShape aItS;
GEOMAlgo_IndexedDataMapOfIntegerShape aMIS;
GEOMAlgo_IndexedDataMapOfShapeBox aMSB;
//
+ NMTDS_BoxBndTreeSelector aSelector;
+ NMTDS_BoxBndTree aBBTree;
+ NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
+ //
+ //
TopExp::MapShapes(myShape, TopAbs_VERTEX, aMV);
aNbV=aMV.Extent();
if (!aNbV) {
return;
}
//
- aHAB=new Bnd_HArray1OfBox(1, aNbV);
- //
for (i=1; i<=aNbV; ++i) {
const TopoDS_Shape& aV=aMV(i);
Bnd_Box aBox;
//
aBox.SetGap(myTol);
BRepBndLib::Add(aV, aBox);
- aHAB->SetValue(i, aBox);
+ //
+ aTreeFiller.Add(i, aBox);
+ //
aMIS.Add(i, aV);
aMSB.Add(aV, aBox);
}
//
- aBSB.Initialize(aHAB);
+ aTreeFiller.Fill();
//
+ //------------------------------
+ // Chains
for (i=1; i<=aNbV; ++i) {
const TopoDS_Shape& aV=aMV(i);
//
continue;
}
//
- const Bnd_Box& aBoxV=aMSB.FindFromKey(aV);
- const TColStd_ListOfInteger& aLI=aBSB.Compare(aBoxV);
- aNbVSD=aLI.Extent();
- if (!aNbVSD) {
- myErrorStatus=3; // it must not be
- return;
- }
+ Standard_Integer aNbIP, aIP, aNbIP1, aIP1;
+ TopTools_ListOfShape aLVSD;
+ TColStd_MapOfInteger aMIP, aMIP1, aMIPC;
+ TColStd_MapIteratorOfMapOfInteger aIt1;
//
- // Images
+ aMIP.Add(i);
+ while(1) {
+ aNbIP=aMIP.Extent();
+ aIt1.Initialize(aMIP);
+ for(; aIt1.More(); aIt1.Next()) {
+ aIP=aIt1.Key();
+ if (aMIPC.Contains(aIP)) {
+ continue;
+ }
+ //
+ const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
+ const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
+ //
+ aSelector.Clear();
+ aSelector.SetBox(aBoxVP);
+ //
+ aNbVSD=aBBTree.Select(aSelector);
+ if (!aNbVSD) {
+ continue; // it must not be
+ }
+ //
+ const TColStd_ListOfInteger& aLI=aSelector.Indices();
+ aIt.Initialize(aLI);
+ for (; aIt.More(); aIt.Next()) {
+ aIP1=aIt.Value();
+ if (aMIP.Contains(aIP1)) {
+ continue;
+ }
+ aMIP1.Add(aIP1);
+ } //for (; aIt.More(); aIt.Next()) {
+ }//for(; aIt1.More(); aIt1.Next()) {
+ //
+ aNbIP1=aMIP1.Extent();
+ if (!aNbIP1) {
+ break;
+ }
+ //
+ aIt1.Initialize(aMIP);
+ for(; aIt1.More(); aIt1.Next()) {
+ aIP=aIt1.Key();
+ aMIPC.Add(aIP);
+ }
+ //
+ aMIP.Clear();
+ aIt1.Initialize(aMIP1);
+ for(; aIt1.More(); aIt1.Next()) {
+ aIP=aIt1.Key();
+ aMIP.Add(aIP);
+ }
+ aMIP1.Clear();
+ }// while(1)
//
- TopTools_ListOfShape aLVSD;
+ // Fill myImages
+ aNbIP=aMIPC.Extent();
//
- aIt.Initialize(aLI);
- for (j=0; aIt.More(); aIt.Next(), ++j) {
- aIndex=aIt.Value();
- const TopoDS_Shape& aVx=aMIS.FindFromKey(aIndex);
- if(!j) {
- aVF=aVx;
+ if (!aNbIP) {// no SD vertices founded
+ aVF=aV;
+ aLVSD.Append(aV);
+ aMVProcessed.Add(aV);
+ }
+ else { // SD vertices founded [ aMIPC ]
+ aIt1.Initialize(aMIPC);
+ for(j=0; aIt1.More(); aIt1.Next(), ++j) {
+ aIP=aIt1.Key();
+ const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
+ if (!j) {
+ aVF=aVP;
+ }
+ aLVSD.Append(aVP);
+ aMVProcessed.Add(aVP);
}
- aLVSD.Append(aVx);
- aMVProcessed.Add(aVx);
}
- //
myImages.Bind(aVF, aLVSD);
- }
+ }// for (i=1; i<=aNbV; ++i) {
+ //------------------------------
//
// Make new vertices
aMV.Clear();
for (; aItIm.More(); aItIm.Next()) {
const TopoDS_Shape& aV=aItIm.Key();
const TopTools_ListOfShape& aLVSD=aItIm.Value();
- //
aItS.Initialize(aLVSD);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aVSD=aItS.Value();
TopoDS_Shape aNewShape;
TopTools_IndexedMapOfShape aMF;
TopTools_ListIteratorOfListOfShape aItS;
- GEOMAlgo_PassKeyShape aPKF;//qft
- GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape aMPKLF;//qft
+ GEOMAlgo_PassKeyShape aPKF;
+ GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape aMPKLF;
//
TopExp::MapShapes(myShape, aType, aMF);
//
for (i=1; i<=aNbF; ++i) {
const TopoDS_Shape& aS=aMF(i);
//
- //aPKF.Clear();//qft
if (aType==TopAbs_FACE) {
const TopoDS_Face& aF=TopoDS::Face(aS);
FacePassKey(aF, aPKF);
void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
GEOMAlgo_PassKeyShape& aPK)
{
- Standard_Integer i, aNbE;//, aNbMax;//qft
+ Standard_Integer i, aNbE;
TopTools_ListOfShape aLE;
TopTools_IndexedMapOfShape aME;
//
TopExp::MapShapes(aF, TopAbs_EDGE, aME);
aNbE=aME.Extent();
- //qf
- /*
- aNbMax=aPK.NbMax();
- if (!aNbE || aNbE>aNbMax) {
- myErrorStatus=101; // temprorary
- return;
- }
- */
- //qt
//
for (i=1; i<=aNbE; ++i) {
const TopoDS_Shape& aE=aME(i);
const TopoDS_Shape& aER=myOrigins.Find(aE);
aLE.Append(aER);
}
- //qf
- //aPK.SetIds(aLE);
aPK.SetShapes(aLE);
- //qt
}
//=======================================================================
//function : EdgePassKey
}
const TopoDS_Shape& aVR1=myOrigins.Find(aV1);
const TopoDS_Shape& aVR2=myOrigins.Find(aV2);
- //qf
- //aPK.SetIds(aVR1, aVR2);
aPK.SetShapes(aVR1, aVR2);
- //qt
}
//=======================================================================
//function : MakeVertex
BOPTools_Tools::MakeSplitEdge(aEx, aVR1, aT1, aVR2, aT2, aNewEdge);
}
}
-//
//=======================================================================
//function : MakeFace
//purpose :
//
aBB.Add(newWire, aER);
}
- //modified by NIZNHY-PKV Mon Jan 31 17:26:36 2005f
- //
+ // xf
TopTools_ListOfShape aLW;
//
aLW.Append(aW);
myImages.Bind(newWire, aLW);
myOrigins.Bind(aW, newWire);
- //
- //modified by NIZNHY-PKV Mon Jan 31 17:26:41 2005 t
+ // xt
aBB.Add(newFace, newWire);
}
aNewFace=newFace;
aType=aS.ShapeType();
if (aType==TopAbs_VERTEX ||
aType==TopAbs_EDGE ||
- aType==TopAbs_WIRE || //modified by NIZNHY-PKV Mon Jan 31 17:18:36 2005ft
+ aType==TopAbs_WIRE ||
aType==TopAbs_FACE ||
- aType==TopAbs_SHELL || //modified by NIZNHY-PKV Mon Jan 31 17:18:36 2005ft
- aType==TopAbs_SOLID) { //modified by NIZNHY-PKV Mon Jan 31 17:18:36 2005ft
+ aType==TopAbs_SHELL ||
+ aType==TopAbs_SOLID) {
if(myOrigins.IsBound(aS)) {
const TopoDS_Shape& aSnew=myOrigins.Find(aS);
if (!aSnew.IsSame(aS)) {
--- /dev/null
+-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either
+-- version 2.1 of the License.
+--
+-- This library is distributed in the hope that it will be useful
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File: GEOMAlgo_Gluer1.cdl
+-- Created: Wed Jan 24 11:37:31 2007
+-- Author: Peter KURNEV
+-- <pkv@irinox>
+
+
+class Gluer1 from GEOMAlgo
+ inherits Gluer from GEOMAlgo
+
+ ---Purpose:
+
+uses
+ ListOfCoupleOfShapes from GEOMAlgo,
+ DataMapOfPassKeyShapeShape from GEOMAlgo
+
+--raises
+
+is
+ Create
+ returns Gluer1 from GEOMAlgo;
+ ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_Gluer1();"
+
+ SetFacesToUnglue(me:out;
+ aLCS:ListOfCoupleOfShapes from GEOMAlgo);
+
+ FacesToUnglue(me)
+ returns ListOfCoupleOfShapes from GEOMAlgo;
+ ---C++: return const&
+
+ GluedFaces(me)
+ returns ListOfCoupleOfShapes from GEOMAlgo;
+ ---C++: return const&
+
+ RejectedFaces(me)
+ returns ListOfCoupleOfShapes from GEOMAlgo;
+ ---C++: return const&
+
+ Perform(me:out)
+ is redefined;
+
+ UnglueFaces(me:out);
+
+ FillGluedFaces(me:out)
+ is protected;
+
+fields
+ myGluedFaces :ListOfCoupleOfShapes from GEOMAlgo is protected;
+ myFacesToUnglue :ListOfCoupleOfShapes from GEOMAlgo is protected;
+ myRejectedFaces :ListOfCoupleOfShapes from GEOMAlgo is protected;
+ myMapGN :DataMapOfPassKeyShapeShape from GEOMAlgo is protected;
+
+end Gluer1;
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File: GEOMAlgo_Gluer1.cxx
+// Created: Wed Jan 24 11:52:27 2007
+// Author: Peter KURNEV
+// <pkv@irinox>
+
+
+#include <GEOMAlgo_Gluer1.ixx>
+
+#include <Geom_Surface.hxx>
+
+#include <TopLoc_Location.hxx>
+
+#include <TopoDS.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Iterator.hxx>
+
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+
+#include <TopExp.hxx>
+
+#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopTools_DataMapOfShapeShape.hxx>
+
+#include <GEOMAlgo_CoupleOfShapes.hxx>
+#include <GEOMAlgo_PassKeyShape.hxx>
+#include <GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx>
+#include <GEOMAlgo_DataMapOfPassKeyShapeShape.hxx>
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape.hxx>
+
+//=======================================================================
+//class : GEOMAlgo_CoupleOfInteger
+//purpose :
+//=======================================================================
+class GEOMAlgo_CoupleOfInteger {
+ //
+ public:
+ //
+ GEOMAlgo_CoupleOfInteger() {
+ myInt1=0;
+ myInt2=0;
+ }
+ //
+ ~GEOMAlgo_CoupleOfInteger() {
+ }
+ //
+ void SetValues(const Standard_Integer aI1,
+ const Standard_Integer aI2) {
+ myInt1=aI1;
+ myInt2=aI2;
+ }
+ //
+ void SetValue1(const Standard_Integer aI1) {
+ myInt1=aI1;
+ }
+ //
+ void SetValue2(const Standard_Integer aI1) {
+ myInt1=aI1;
+ }
+ //
+ void Values(Standard_Integer& aI1,
+ Standard_Integer& aI2) const {
+ aI1=myInt1;
+ aI2=myInt2;
+ }
+ //
+ Standard_Integer Value1()const {
+ return myInt1;
+ }
+ //
+ Standard_Integer Value2()const {
+ return myInt2;
+ }
+ //
+ protected:
+ Standard_Integer myInt1;
+ Standard_Integer myInt2;
+};
+//
+//=======================================================================
+//
+static
+ void SortShell(const Standard_Integer ,
+ GEOMAlgo_CoupleOfInteger* );
+static
+ void RefineSolid(const TopoDS_Shape& ,
+ const TopTools_DataMapOfShapeShape& ,
+ TopTools_DataMapOfShapeShape& );
+static
+ void MakeFaceToReplace(const TopoDS_Face& ,
+ TopoDS_Face& );
+//
+//=======================================================================
+//function : GEOMAlgo_Gluer1
+//purpose :
+//=======================================================================
+ GEOMAlgo_Gluer1::GEOMAlgo_Gluer1()
+:
+ GEOMAlgo_Gluer()
+{
+}
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+ GEOMAlgo_Gluer1::~GEOMAlgo_Gluer1()
+{
+}
+//=======================================================================
+//function : SetFacesToUnglue
+//purpose :
+//=======================================================================
+ void GEOMAlgo_Gluer1::SetFacesToUnglue(const GEOMAlgo_ListOfCoupleOfShapes& aLCS)
+{
+ myFacesToUnglue=aLCS;
+}
+//=======================================================================
+//function : FacesToUnglue
+//purpose :
+//=======================================================================
+ const GEOMAlgo_ListOfCoupleOfShapes& GEOMAlgo_Gluer1::FacesToUnglue()const
+{
+ return myFacesToUnglue;
+}
+//=======================================================================
+//function : GluedFaces
+//purpose :
+//=======================================================================
+ const GEOMAlgo_ListOfCoupleOfShapes& GEOMAlgo_Gluer1::GluedFaces()const
+{
+ return myGluedFaces;
+}
+//=======================================================================
+//function : RejectedFaces
+//purpose :
+//=======================================================================
+ const GEOMAlgo_ListOfCoupleOfShapes& GEOMAlgo_Gluer1::RejectedFaces()const
+{
+ return myRejectedFaces;
+}
+//=======================================================================
+//function : Perform
+//purpose :
+//=======================================================================
+ void GEOMAlgo_Gluer1::Perform()
+{
+ // 1.
+ GEOMAlgo_Gluer::Perform();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ FillGluedFaces();
+ if (myErrorStatus) {
+ return;
+ }
+}
+//=======================================================================
+//function : FillGluedFaces
+//purpose :
+//=======================================================================
+ void GEOMAlgo_Gluer1::FillGluedFaces()
+{
+ myErrorStatus=0;
+ //
+ Standard_Integer aNbIm, aNbS, i;
+ TopAbs_ShapeEnum aType;
+ TopTools_ListIteratorOfListOfShape aItLS;
+ TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
+ GEOMAlgo_CoupleOfShapes aCS;
+ GEOMAlgo_PassKeyShape aPKS;
+ //
+ myMapGN.Clear();
+ myGluedFaces.Clear();
+ //
+ aNbIm=myImages.Extent();
+ aItIm.Initialize(myImages);
+ for (; aItIm.More(); aItIm.Next()) {
+ const TopoDS_Shape& aSnew=aItIm.Key();
+ aType=aSnew.ShapeType();
+ if (aType!=TopAbs_FACE) {
+ continue;
+ }
+ //
+ const TopTools_ListOfShape& aLS=aItIm.Value();
+ aNbS=aLS.Extent();
+ if (aNbS!=2) {
+ continue;
+ }
+ //
+ TopoDS_Shape aSold[2];
+ aItLS.Initialize(aLS);
+ for (i=0; aItLS.More(); aItLS.Next(), ++i) {
+ const TopoDS_Shape& aSi=aItLS.Value();
+ aSold[i]=aItLS.Value();
+ }
+ //
+ aCS.SetShapes(aSold[0], aSold[1]);
+ myGluedFaces.Append(aCS);
+ //
+ aPKS.Clear();
+ aPKS.SetShapes(aSold[0], aSold[1]);
+ myMapGN.Bind(aPKS, aSnew);
+ }
+}
+//=======================================================================
+//function : UnglueFaces
+//purpose :
+//=======================================================================
+ void GEOMAlgo_Gluer1::UnglueFaces()
+{
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ Standard_Boolean bFound;
+ Standard_Integer i, aNbUN, aNbS, aNbF, iX;
+ TopTools_IndexedDataMapOfShapeListOfShape aMFSR, aMFS, aMSF;
+ TopTools_ListIteratorOfListOfShape aItLS, aItLS1;
+ GEOMAlgo_PassKeyShape aPKS;
+ GEOMAlgo_ListIteratorOfListOfCoupleOfShapes aItCS;
+ GEOMAlgo_DataMapOfPassKeyShapeShape aMapUN;
+ GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape aItUN;
+ GEOMAlgo_CoupleOfInteger *pIx;
+ //
+ if (myResult.IsNull()) {
+ myErrorStatus=200; // no result
+ return;
+ }
+ myWarningStatus=0;
+ myRejectedFaces.Clear();
+ //
+ // 0. Fill map [Face]/Solid for myResult: aMFSR
+ TopExp::MapShapesAndAncestors(myResult, TopAbs_FACE, TopAbs_SOLID, aMFSR);
+ //
+ // 1. Fill Faces to process: aMapUN : [Fold1, Fold2] / Fnew
+ aNbUN=myFacesToUnglue.Extent();
+ if (!aNbUN) {
+ // all faces that can be unglued will be unglued
+ aMapUN=myMapGN;
+ myFacesToUnglue=myGluedFaces;
+ }
+ else {
+ aItCS.Initialize(myFacesToUnglue);
+ for (; aItCS.More(); aItCS.Next()) {
+ const GEOMAlgo_CoupleOfShapes& aCS=aItCS.Value();
+ const TopoDS_Shape& aS1=aCS.Shape1();
+ const TopoDS_Shape& aS2=aCS.Shape2();
+ aPKS.Clear();
+ aPKS.SetShapes(aS1, aS2);
+ if (!myMapGN.IsBound(aPKS)) {
+ //some faces, wanted to unglue, are not glued at all;
+ myWarningStatus=2;
+ myRejectedFaces.Append(aCS);
+ continue;
+ }
+ //
+ const TopoDS_Shape& aFN=myMapGN.Find(aPKS);
+ aMapUN.Bind(aPKS, aFN);
+ }
+ }
+ //
+ // 2 Fill map FN/Solids for myResult: aMFS
+ aNbUN=aMapUN.Extent();
+ aItUN.Initialize(aMapUN);
+ for (; aItUN.More(); aItUN.Next()) {
+ const TopoDS_Shape& aFN=aItUN.Value();
+ if (!aMFSR.Contains(aFN)) {
+ myWarningStatus=3; // how can it be
+ continue;
+ }
+ //
+ const TopTools_ListOfShape& aLS=aMFSR.FindFromKey(aFN);
+ aNbS=aLS.Extent();
+ if (aNbS!=2) {
+ // wrong result: More than 2 solids shared one face
+ myWarningStatus=4;
+ continue;
+ }
+ aMFS.Add(aFN, aLS);
+ }
+ //
+ // 3 Fill map Solids/FN for myResult: aMSF
+ aNbUN=aMFS.Extent();
+ for (i=1; i<=aNbUN; ++i) {
+ const TopoDS_Shape& aFN=aMFS.FindKey(i);
+ const TopTools_ListOfShape& aLS=aMFS(i);
+ aItLS.Initialize(aLS);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aS=aItLS.Value();
+ if (aMSF.Contains(aS)) {
+ TopTools_ListOfShape& aLF=aMSF.ChangeFromKey(aS);
+ aLF.Append(aFN);
+ }
+ else {
+ TopTools_ListOfShape aLF;
+ aLF.Append(aFN);
+ aMSF.Add(aS, aLF);
+ }
+ }
+ }
+ //
+ // 4 Sort indices of aMSF
+ aNbS=aMSF.Extent();
+ if (aNbS<2) {
+ // wrong number of solids that have shared face
+ myWarningStatus=5;
+ }
+ //
+ pIx=new GEOMAlgo_CoupleOfInteger[aNbS];
+ //
+ for (i=1; i<=aNbS; ++i) {
+ const TopTools_ListOfShape& aLF=aMSF(i);
+ aNbF=aLF.Extent();
+ pIx[i-1].SetValues(aNbF, i);
+ }
+ SortShell(aNbS, pIx);
+ //
+ // 5 Refine solids
+ //
+ TopTools_DataMapOfShapeShape aMFNFN2, aMFNFD;
+ TopTools_DataMapIteratorOfDataMapOfShapeShape aItMSS;
+ TopTools_MapOfShape aMFNP;
+ TopTools_IndexedMapOfShape aMFD;
+ //
+ for (iX=aNbS-1; iX>=0; --iX) {
+ i=pIx[iX].Value2();
+ // solid from myResult aSN
+ const TopoDS_Shape& aSN=aMSF.FindKey(i);
+ //
+ // candidates to be faces to replace for aSN
+ const TopTools_ListOfShape& aLFN=aMSF(i);
+ aNbF=aLFN.Extent();
+ //
+ // original solid for aSN -> aSD
+ const TopTools_ListOfShape& aLSD=myImages.Find(aSN);
+ const TopoDS_Shape& aSD=aLSD.First();
+ //
+ // faces of original solid -> aMFD
+ aMFD.Clear();
+ TopExp::MapShapes(aSD, TopAbs_FACE, aMFD);
+ //
+ // faces to replace for aSN [FN]/FD -> aMFNFD
+ aMFNFD.Clear();
+ aItLS.Initialize(aLFN);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aFN=aItLS.Value();
+ if (!aMFNP.Add(aFN)) {
+ continue;
+ }
+ //
+ // original face from original solid -> FD
+ TopoDS_Shape aFD;
+ //
+ bFound=Standard_False;
+ const TopTools_ListOfShape& aLFD=myImages.Find(aFN);
+ aItLS1.Initialize(aLFD);
+ for (; aItLS1.More(); aItLS1.Next()) {
+ const TopoDS_Shape& aFDx=aItLS1.Value();
+ if (aMFD.Contains(aFDx)) {
+ aFD=aFDx;
+ bFound=Standard_True;
+ break;
+ }
+ }
+ //if (!bFound) {...}
+ aMFNFD.Bind(aFN, aFD);
+ } // for (; aItLS.More(); aItLS.Next()) {
+ //
+ aNbF=aMFNFD.Extent();
+ if (!aNbF) {
+ // nothing to do here
+ continue;
+ }
+ // update solid SN (and its shells)
+ RefineSolid(aSN, aMFNFD, aMFNFN2);
+ //
+ // update myOrigins / myImages
+ aItMSS.Initialize(aMFNFD);
+ for (; aItMSS.More(); aItMSS.Next()) {
+ const TopoDS_Shape& aFN=aItMSS.Key(); // face removed from aSN
+ const TopoDS_Shape& aFD=aItMSS.Value(); // old face from aSD
+ const TopoDS_Shape& aFN2=aMFNFN2.Find(aFN);// face added to aSN
+ //
+ // myOrigins
+ myOrigins.ChangeFind(aFD)=aFN2;
+ //
+ // myImages
+ TopTools_ListOfShape aLFDx;
+ //
+ TopTools_ListOfShape& aLFD=myImages.ChangeFind(aFN);
+ aItLS.Initialize(aLFD);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aFDx=aItLS.Value();
+ if (!aFDx.IsSame(aFD)) {
+ aLFDx.Append(aFDx);
+ }
+ }
+ aLFD=aLFDx;
+ //
+ aLFDx.Clear();
+ aLFDx.Append(aFD);
+ myImages.Bind(aFN2, aLFDx);
+ } // for (; aItMSS.More(); aItMSS.Next()) {
+ } // for (iX=aNbS-1; iX>=0; --iX) {
+ //
+ delete [] pIx;
+}
+//=======================================================================
+// function: RefineSolid
+// purpose : replace faces (aMFN) of solid aSd by new ones
+//=======================================================================
+void RefineSolid(const TopoDS_Shape& aSd,
+ const TopTools_DataMapOfShapeShape& aMFNFD,
+ TopTools_DataMapOfShapeShape& aMFNFN2)
+{
+ TopoDS_Shape *pSh;
+ TopoDS_Face aF2;
+ TopoDS_Iterator aItSd, aItSh;
+ BRep_Builder aBB;
+ TopTools_ListOfShape aLF;
+ TopTools_ListIteratorOfListOfShape aItLF;
+ //
+ aItSd.Initialize(aSd);
+ for (; aItSd.More(); aItSd.Next()) {
+ const TopoDS_Shape& aSh=aItSd.Value();
+ pSh=(TopoDS_Shape *)&aSh;
+ pSh->Free(Standard_True);
+ aLF.Clear();
+ aItSh.Initialize(*pSh);
+ for (; aItSh.More(); aItSh.Next()) {
+ const TopoDS_Shape& aF=aItSh.Value();
+ if (aMFNFD.IsBound(aF)) {
+ aLF.Append(aF);
+ }
+ }
+ //
+ aItLF.Initialize(aLF);
+ for (; aItLF.More(); aItLF.Next()) {
+ const TopoDS_Face& aF=TopoDS::Face(aItLF.Value());
+ //
+ MakeFaceToReplace(aF, aF2);
+ //
+ aMFNFN2.Bind(aF, aF2);
+ aBB.Remove(*pSh, aF);
+ aBB.Add(*pSh, aF2);
+ }
+ pSh->Free(Standard_False);
+ }
+}
+//=======================================================================
+//function : MakeFaceToReplace
+//purpose :
+//=======================================================================
+void MakeFaceToReplace(const TopoDS_Face& aF,
+ TopoDS_Face& aFR)
+{
+ Standard_Real aTol;
+ Handle(Geom_Surface) aS;
+ TopLoc_Location aLoc;
+ TopoDS_Face aFFWD, aFnew;
+ TopoDS_Iterator aItF;
+ BRep_Builder aBB;
+ //
+ aFFWD=aF;
+ aFFWD.Orientation(TopAbs_FORWARD);
+ aS=BRep_Tool::Surface(aFFWD, aLoc);
+ aTol=BRep_Tool::Tolerance(aFFWD);
+ //
+ aBB.MakeFace (aFnew, aS, aLoc, aTol);
+ aItF.Initialize(aFFWD);
+ for (; aItF.More(); aItF.Next()) {
+ const TopoDS_Shape& aW=aItF.Value();
+ aBB.Add(aFnew, aW);
+ }
+ aFnew.Orientation(aF.Orientation());
+ aFR=aFnew;
+}
+//=======================================================================
+// function: SortShell
+// purpose :
+//=======================================================================
+void SortShell(const Standard_Integer n,
+ GEOMAlgo_CoupleOfInteger* a)
+{
+ Standard_Integer nd, i, j, l, d=1;
+ GEOMAlgo_CoupleOfInteger x;
+ //
+ while(d<=n) {
+ d*=2;
+ }
+ //
+ while (d) {
+ d=(d-1)/2;
+ //
+ nd=n-d;
+ for (i=0; i<nd; ++i) {
+ j=i;
+ m30:;
+ l=j+d;
+ if (a[l].Value1() < a[j].Value1()) {
+ x=a[j];
+ a[j]=a[l];
+ a[l]=x;
+ j-=d;
+ if (j > -1) {
+ goto m30;
+ }
+ }//if (a[l] < a[j]){
+ }//for (i=0; i<nd; ++i)
+ }//while (1)
+}
+//
+// ErrorStatus
+//
+// 200; - result shape is Null
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_Gluer1_HeaderFile
+#define _GEOMAlgo_Gluer1_HeaderFile
+
+#ifndef _GEOMAlgo_ListOfCoupleOfShapes_HeaderFile
+#include <GEOMAlgo_ListOfCoupleOfShapes.hxx>
+#endif
+#ifndef _GEOMAlgo_DataMapOfPassKeyShapeShape_HeaderFile
+#include <GEOMAlgo_DataMapOfPassKeyShapeShape.hxx>
+#endif
+#ifndef _GEOMAlgo_Gluer_HeaderFile
+#include <GEOMAlgo_Gluer.hxx>
+#endif
+class GEOMAlgo_ListOfCoupleOfShapes;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class GEOMAlgo_Gluer1 : public GEOMAlgo_Gluer {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT GEOMAlgo_Gluer1();
+Standard_EXPORT virtual ~GEOMAlgo_Gluer1();
+
+
+Standard_EXPORT void SetFacesToUnglue(const GEOMAlgo_ListOfCoupleOfShapes& aLCS) ;
+
+
+Standard_EXPORT const GEOMAlgo_ListOfCoupleOfShapes& FacesToUnglue() const;
+
+
+Standard_EXPORT const GEOMAlgo_ListOfCoupleOfShapes& GluedFaces() const;
+
+
+Standard_EXPORT const GEOMAlgo_ListOfCoupleOfShapes& RejectedFaces() const;
+
+
+Standard_EXPORT virtual void Perform() ;
+
+
+Standard_EXPORT void UnglueFaces() ;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+Standard_EXPORT void FillGluedFaces() ;
+
+
+ // Fields PROTECTED
+ //
+GEOMAlgo_ListOfCoupleOfShapes myGluedFaces;
+GEOMAlgo_ListOfCoupleOfShapes myFacesToUnglue;
+GEOMAlgo_ListOfCoupleOfShapes myRejectedFaces;
+GEOMAlgo_DataMapOfPassKeyShapeShape myMapGN;
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <GEOMAlgo_Gluer1.jxx>
+
+
+
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_ListOfCoupleOfShapes_HeaderFile
+#include <GEOMAlgo_ListOfCoupleOfShapes.hxx>
+#endif
+#ifndef _GEOMAlgo_Gluer1_HeaderFile
+#include <GEOMAlgo_Gluer1.hxx>
+#endif
--- /dev/null
+// File generated by CPPExt (Transient)
+//
+//
+// Copyright (C) 1991 - 2000 by
+// Matra Datavision SA. All rights reserved.
+//
+// Copyright (C) 2001 - 2004 by
+// Open CASCADE SA. All rights reserved.
+//
+// This file is part of the Open CASCADE Technology software.
+//
+// This software may be distributed and/or modified under the terms and
+// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
+// and appearing in the file LICENSE included in the packaging of this file.
+//
+// This software is distributed on an "AS IS" basis, without warranty of any
+// kind, and Open CASCADE SA hereby disclaims all such warranties,
+// including without limitation, any warranties of merchantability, fitness
+// for a particular purpose or non-infringement. Please see the License for
+// the specific terms and conditions governing rights and limitations under the
+// License.
+
+#ifndef _GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_HeaderFile
+#define _GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_HeaderFile
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_HeaderFile
+#include <Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx>
+#endif
+
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _GEOMAlgo_ShapeInfo_HeaderFile
+#include <GEOMAlgo_ShapeInfo.hxx>
+#endif
+#ifndef _TCollection_MapNodePtr_HeaderFile
+#include <TCollection_MapNodePtr.hxx>
+#endif
+#ifndef _TCollection_MapNode_HeaderFile
+#include <TCollection_MapNode.hxx>
+#endif
+class TopoDS_Shape;
+class GEOMAlgo_ShapeInfo;
+class TopTools_ShapeMapHasher;
+class GEOMAlgo_IndexedDataMapOfShapeShapeInfo;
+
+
+
+class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo : public TCollection_MapNode {
+
+public:
+ // Methods PUBLIC
+ //
+
+GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo(const TopoDS_Shape& K1,const Standard_Integer K2,const GEOMAlgo_ShapeInfo& I,const TCollection_MapNodePtr& n1,const TCollection_MapNodePtr& n2);
+
+ TopoDS_Shape& Key1() const;
+
+ Standard_Integer& Key2() const;
+
+ TCollection_MapNodePtr& Next2() const;
+
+ GEOMAlgo_ShapeInfo& Value() const;
+//Standard_EXPORT ~GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo();
+
+
+
+
+ // Type management
+ //
+ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+TopoDS_Shape myKey1;
+Standard_Integer myKey2;
+GEOMAlgo_ShapeInfo myValue;
+TCollection_MapNodePtr myNext2;
+
+
+};
+
+#define TheKey TopoDS_Shape
+#define TheKey_hxx <TopoDS_Shape.hxx>
+#define TheItem GEOMAlgo_ShapeInfo
+#define TheItem_hxx <GEOMAlgo_ShapeInfo.hxx>
+#define Hasher TopTools_ShapeMapHasher
+#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
+#define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo
+#define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx>
+#define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo
+#define TCollection_IndexedDataMapNode_Type_() GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_Type_()
+#define TCollection_IndexedDataMap GEOMAlgo_IndexedDataMapOfShapeShapeInfo
+#define TCollection_IndexedDataMap_hxx <GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx>
+
+#include <TCollection_IndexedDataMapNode.lxx>
+
+#undef TheKey
+#undef TheKey_hxx
+#undef TheItem
+#undef TheItem_hxx
+#undef Hasher
+#undef Hasher_hxx
+#undef TCollection_IndexedDataMapNode
+#undef TCollection_IndexedDataMapNode_hxx
+#undef Handle_TCollection_IndexedDataMapNode
+#undef TCollection_IndexedDataMapNode_Type_
+#undef TCollection_IndexedDataMap
+#undef TCollection_IndexedDataMap_hxx
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// File generated by CPPExt (Transient)
+//
+// Copyright (C) 1991 - 2000 by
+// Matra Datavision SA. All rights reserved.
+//
+// Copyright (C) 2001 - 2004 by
+// Open CASCADE SA. All rights reserved.
+//
+// This file is part of the Open CASCADE Technology software.
+//
+// This software may be distributed and/or modified under the terms and
+// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
+// and appearing in the file LICENSE included in the packaging of this file.
+//
+// This software is distributed on an "AS IS" basis, without warranty of any
+// kind, and Open CASCADE SA hereby disclaims all such warranties,
+// including without limitation, any warranties of merchantability, fitness
+// for a particular purpose or non-infringement. Please see the License for
+// the specific terms and conditions governing rights and limitations under the
+// License.
+
+#include <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx>
+
+#ifndef _Standard_TypeMismatch_HeaderFile
+#include <Standard_TypeMismatch.hxx>
+#endif
+
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _GEOMAlgo_ShapeInfo_HeaderFile
+#include <GEOMAlgo_ShapeInfo.hxx>
+#endif
+#ifndef _TopTools_ShapeMapHasher_HeaderFile
+#include <TopTools_ShapeMapHasher.hxx>
+#endif
+#ifndef _GEOMAlgo_IndexedDataMapOfShapeShapeInfo_HeaderFile
+#include <GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx>
+#endif
+//GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo::~GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo() {}
+
+
+
+Standard_EXPORT Handle_Standard_Type& GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_Type_()
+{
+
+ static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
+ static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
+ static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
+
+
+ static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
+ static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo",
+ sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
+
+ return _aType;
+}
+
+
+// DownCast method
+// allow safe downcasting
+//
+const Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo) Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo)::DownCast(const Handle(Standard_Transient)& AnObject)
+{
+ Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo) _anOtherObject;
+
+ if (!AnObject.IsNull()) {
+ if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo))) {
+ _anOtherObject = Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo)((Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo)&)AnObject);
+ }
+ }
+
+ return _anOtherObject ;
+}
+const Handle(Standard_Type)& GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo::DynamicType() const
+{
+ return STANDARD_TYPE(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo) ;
+}
+//Standard_Boolean GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo::IsKind(const Handle(Standard_Type)& AType) const
+//{
+// return (STANDARD_TYPE(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo) == AType || TCollection_MapNode::IsKind(AType));
+//}
+//Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo::~Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo() {}
+#define TheKey TopoDS_Shape
+#define TheKey_hxx <TopoDS_Shape.hxx>
+#define TheItem GEOMAlgo_ShapeInfo
+#define TheItem_hxx <GEOMAlgo_ShapeInfo.hxx>
+#define Hasher TopTools_ShapeMapHasher
+#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
+#define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo
+#define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx>
+#define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo
+#define TCollection_IndexedDataMapNode_Type_() GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_Type_()
+#define TCollection_IndexedDataMap GEOMAlgo_IndexedDataMapOfShapeShapeInfo
+#define TCollection_IndexedDataMap_hxx <GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx>
+#include <TCollection_IndexedDataMapNode.gxx>
+
--- /dev/null
+// File generated by CPPExt (Value)
+//
+// Copyright (C) 1991 - 2000 by
+// Matra Datavision SA. All rights reserved.
+//
+// Copyright (C) 2001 - 2004 by
+// Open CASCADE SA. All rights reserved.
+//
+// This file is part of the Open CASCADE Technology software.
+//
+// This software may be distributed and/or modified under the terms and
+// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
+// and appearing in the file LICENSE included in the packaging of this file.
+//
+// This software is distributed on an "AS IS" basis, without warranty of any
+// kind, and Open CASCADE SA hereby disclaims all such warranties,
+// including without limitation, any warranties of merchantability, fitness
+// for a particular purpose or non-infringement. Please see the License for
+// the specific terms and conditions governing rights and limitations under the
+// License.
+
+#ifndef _GEOMAlgo_IndexedDataMapOfShapeShapeInfo_HeaderFile
+#define _GEOMAlgo_IndexedDataMapOfShapeShapeInfo_HeaderFile
+
+#ifndef _TCollection_BasicMap_HeaderFile
+#include <TCollection_BasicMap.hxx>
+#endif
+#ifndef _Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_HeaderFile
+#include <Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class Standard_DomainError;
+class Standard_OutOfRange;
+class Standard_NoSuchObject;
+class TopoDS_Shape;
+class GEOMAlgo_ShapeInfo;
+class TopTools_ShapeMapHasher;
+class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class GEOMAlgo_IndexedDataMapOfShapeShapeInfo : public TCollection_BasicMap {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT GEOMAlgo_IndexedDataMapOfShapeShapeInfo(const Standard_Integer NbBuckets = 1);
+
+
+Standard_EXPORT GEOMAlgo_IndexedDataMapOfShapeShapeInfo& Assign(const GEOMAlgo_IndexedDataMapOfShapeShapeInfo& Other) ;
+ GEOMAlgo_IndexedDataMapOfShapeShapeInfo& operator =(const GEOMAlgo_IndexedDataMapOfShapeShapeInfo& Other)
+{
+ return Assign(Other);
+}
+
+
+
+Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
+
+
+Standard_EXPORT void Clear() ;
+~GEOMAlgo_IndexedDataMapOfShapeShapeInfo()
+{
+ Clear();
+}
+
+
+
+Standard_EXPORT Standard_Integer Add(const TopoDS_Shape& K,const GEOMAlgo_ShapeInfo& I) ;
+
+
+Standard_EXPORT void Substitute(const Standard_Integer I,const TopoDS_Shape& K,const GEOMAlgo_ShapeInfo& T) ;
+
+
+Standard_EXPORT void RemoveLast() ;
+
+
+Standard_EXPORT Standard_Boolean Contains(const TopoDS_Shape& K) const;
+
+
+Standard_EXPORT const TopoDS_Shape& FindKey(const Standard_Integer I) const;
+
+
+Standard_EXPORT const GEOMAlgo_ShapeInfo& FindFromIndex(const Standard_Integer I) const;
+ const GEOMAlgo_ShapeInfo& operator ()(const Standard_Integer I) const
+{
+ return FindFromIndex(I);
+}
+
+
+
+Standard_EXPORT GEOMAlgo_ShapeInfo& ChangeFromIndex(const Standard_Integer I) ;
+ GEOMAlgo_ShapeInfo& operator ()(const Standard_Integer I)
+{
+ return ChangeFromIndex(I);
+}
+
+
+
+Standard_EXPORT Standard_Integer FindIndex(const TopoDS_Shape& K) const;
+
+
+Standard_EXPORT const GEOMAlgo_ShapeInfo& FindFromKey(const TopoDS_Shape& K) const;
+
+
+Standard_EXPORT GEOMAlgo_ShapeInfo& ChangeFromKey(const TopoDS_Shape& K) ;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+Standard_EXPORT GEOMAlgo_IndexedDataMapOfShapeShapeInfo(const GEOMAlgo_IndexedDataMapOfShapeShapeInfo& Other);
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// File generated by CPPExt (Value)
+//
+// Copyright (C) 1991 - 2000 by
+// Matra Datavision SA. All rights reserved.
+//
+// Copyright (C) 2001 - 2004 by
+// Open CASCADE SA. All rights reserved.
+//
+// This file is part of the Open CASCADE Technology software.
+//
+// This software may be distributed and/or modified under the terms and
+// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
+// and appearing in the file LICENSE included in the packaging of this file.
+//
+// This software is distributed on an "AS IS" basis, without warranty of any
+// kind, and Open CASCADE SA hereby disclaims all such warranties,
+// including without limitation, any warranties of merchantability, fitness
+// for a particular purpose or non-infringement. Please see the License for
+// the specific terms and conditions governing rights and limitations under the
+// License.
+
+#include <GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx>
+
+#ifndef _Standard_DomainError_HeaderFile
+#include <Standard_DomainError.hxx>
+#endif
+#ifndef _Standard_OutOfRange_HeaderFile
+#include <Standard_OutOfRange.hxx>
+#endif
+#ifndef _Standard_NoSuchObject_HeaderFile
+#include <Standard_NoSuchObject.hxx>
+#endif
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _GEOMAlgo_ShapeInfo_HeaderFile
+#include <GEOMAlgo_ShapeInfo.hxx>
+#endif
+#ifndef _TopTools_ShapeMapHasher_HeaderFile
+#include <TopTools_ShapeMapHasher.hxx>
+#endif
+#ifndef _GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_HeaderFile
+#include <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx>
+#endif
+
+
+#define TheKey TopoDS_Shape
+#define TheKey_hxx <TopoDS_Shape.hxx>
+#define TheItem GEOMAlgo_ShapeInfo
+#define TheItem_hxx <GEOMAlgo_ShapeInfo.hxx>
+#define Hasher TopTools_ShapeMapHasher
+#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
+#define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo
+#define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx>
+#define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo
+#define TCollection_IndexedDataMapNode_Type_() GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_Type_()
+#define TCollection_IndexedDataMap GEOMAlgo_IndexedDataMapOfShapeShapeInfo
+#define TCollection_IndexedDataMap_hxx <GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx>
+#include <TCollection_IndexedDataMap.gxx>
+
--- /dev/null
+// File generated by CPPExt (Enum)
+//
+// Copyright (C) 1991 - 2000 by
+// Matra Datavision SA. All rights reserved.
+//
+// Copyright (C) 2001 - 2004 by
+// Open CASCADE SA. All rights reserved.
+//
+// This file is part of the Open CASCADE Technology software.
+//
+// This software may be distributed and/or modified under the terms and
+// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
+// and appearing in the file LICENSE included in the packaging of this file.
+//
+// This software is distributed on an "AS IS" basis, without warranty of any
+// kind, and Open CASCADE SA hereby disclaims all such warranties,
+// including without limitation, any warranties of merchantability, fitness
+// for a particular purpose or non-infringement. Please see the License for
+// the specific terms and conditions governing rights and limitations under the
+// License.
+
+#ifndef _GEOMAlgo_KindOfBounds_HeaderFile
+#define _GEOMAlgo_KindOfBounds_HeaderFile
+
+
+enum GEOMAlgo_KindOfBounds {
+ GEOMAlgo_KB_UNKNOWN,
+GEOMAlgo_KB_TRIMMED,
+GEOMAlgo_KB_INFINITE
+};
+
+
+#ifndef _Standard_PrimitiveTypes_HeaderFile
+#include <Standard_PrimitiveTypes.hxx>
+#endif
+
+#endif
--- /dev/null
+// File generated by CPPExt (Enum)
+//
+// Copyright (C) 1991 - 2000 by
+// Matra Datavision SA. All rights reserved.
+//
+// Copyright (C) 2001 - 2004 by
+// Open CASCADE SA. All rights reserved.
+//
+// This file is part of the Open CASCADE Technology software.
+//
+// This software may be distributed and/or modified under the terms and
+// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
+// and appearing in the file LICENSE included in the packaging of this file.
+//
+// This software is distributed on an "AS IS" basis, without warranty of any
+// kind, and Open CASCADE SA hereby disclaims all such warranties,
+// including without limitation, any warranties of merchantability, fitness
+// for a particular purpose or non-infringement. Please see the License for
+// the specific terms and conditions governing rights and limitations under the
+// License.
+
+#ifndef _GEOMAlgo_KindOfClosed_HeaderFile
+#define _GEOMAlgo_KindOfClosed_HeaderFile
+
+
+enum GEOMAlgo_KindOfClosed {
+ GEOMAlgo_KC_UNKNOWN,
+GEOMAlgo_KC_CLOSED,
+GEOMAlgo_KC_NOTCLOSED
+};
+
+
+#ifndef _Standard_PrimitiveTypes_HeaderFile
+#include <Standard_PrimitiveTypes.hxx>
+#endif
+
+#endif
--- /dev/null
+// File generated by CPPExt (Enum)
+//
+// Copyright (C) 1991 - 2000 by
+// Matra Datavision SA. All rights reserved.
+//
+// Copyright (C) 2001 - 2004 by
+// Open CASCADE SA. All rights reserved.
+//
+// This file is part of the Open CASCADE Technology software.
+//
+// This software may be distributed and/or modified under the terms and
+// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
+// and appearing in the file LICENSE included in the packaging of this file.
+//
+// This software is distributed on an "AS IS" basis, without warranty of any
+// kind, and Open CASCADE SA hereby disclaims all such warranties,
+// including without limitation, any warranties of merchantability, fitness
+// for a particular purpose or non-infringement. Please see the License for
+// the specific terms and conditions governing rights and limitations under the
+// License.
+
+#ifndef _GEOMAlgo_KindOfName_HeaderFile
+#define _GEOMAlgo_KindOfName_HeaderFile
+
+
+enum GEOMAlgo_KindOfName {
+ GEOMAlgo_KN_UNKNOWN,
+GEOMAlgo_KN_SPHERE,
+GEOMAlgo_KN_CYLINDER,
+GEOMAlgo_KN_TORUS,
+GEOMAlgo_KN_CONE,
+GEOMAlgo_KN_ELLIPSE,
+GEOMAlgo_KN_CIRCLE,
+GEOMAlgo_KN_PLANE,
+GEOMAlgo_KN_LINE,
+GEOMAlgo_KN_BOX,
+GEOMAlgo_KN_SEGMENT,
+GEOMAlgo_KN_ARCCIRCLE,
+GEOMAlgo_KN_POLYGON,
+GEOMAlgo_KN_POLYHEDRON,
+GEOMAlgo_KN_DISKCIRCLE,
+GEOMAlgo_KN_DISKELLIPSE,
+GEOMAlgo_KN_RECTANGLE,
+GEOMAlgo_KN_TRIANGLE,
+GEOMAlgo_KN_QUADRANGLE,
+GEOMAlgo_KN_ARCELLIPSE
+};
+
+
+#ifndef _Standard_PrimitiveTypes_HeaderFile
+#include <Standard_PrimitiveTypes.hxx>
+#endif
+
+#endif
--- /dev/null
+// File generated by CPPExt (Enum)
+//
+// Copyright (C) 1991 - 2000 by
+// Matra Datavision SA. All rights reserved.
+//
+// Copyright (C) 2001 - 2004 by
+// Open CASCADE SA. All rights reserved.
+//
+// This file is part of the Open CASCADE Technology software.
+//
+// This software may be distributed and/or modified under the terms and
+// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
+// and appearing in the file LICENSE included in the packaging of this file.
+//
+// This software is distributed on an "AS IS" basis, without warranty of any
+// kind, and Open CASCADE SA hereby disclaims all such warranties,
+// including without limitation, any warranties of merchantability, fitness
+// for a particular purpose or non-infringement. Please see the License for
+// the specific terms and conditions governing rights and limitations under the
+// License.
+
+#ifndef _GEOMAlgo_KindOfShape_HeaderFile
+#define _GEOMAlgo_KindOfShape_HeaderFile
+
+
+enum GEOMAlgo_KindOfShape {
+ GEOMAlgo_KS_UNKNOWN,
+GEOMAlgo_KS_SPHERE,
+GEOMAlgo_KS_CYLINDER,
+GEOMAlgo_KS_BOX,
+GEOMAlgo_KS_TORUS,
+GEOMAlgo_KS_CONE,
+GEOMAlgo_KS_ELLIPSE,
+GEOMAlgo_KS_PLANE,
+GEOMAlgo_KS_CIRCLE,
+GEOMAlgo_KS_LINE,
+GEOMAlgo_KS_DEGENERATED
+};
+
+
+#ifndef _Standard_PrimitiveTypes_HeaderFile
+#include <Standard_PrimitiveTypes.hxx>
+#endif
+
+#endif
--- /dev/null
+-- File: GEOMAlgo_ShapeInfo.cdl
+-- Created: Mon Apr 2 14:04:24 2007
+-- Author: Peter KURNEV
+-- <pkv@irinox>
+---Copyright: Matra Datavision 2007
+
+
+class ShapeInfo from GEOMAlgo
+
+ ---Purpose:
+
+uses
+ Pnt from gp,
+ Dir from gp,
+ Ax2 from gp,
+ Ax3 from gp,
+
+ ShapeEnum from TopAbs,
+ Shape from TopoDS,
+
+ KindOfShape from GEOMAlgo,
+ KindOfBounds from GEOMAlgo,
+ KindOfClosed from GEOMAlgo,
+ KindOfName from GEOMAlgo
+--raises
+
+is
+ Create
+ returns ShapeInfo from GEOMAlgo;
+ ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_ShapeInfo();"
+
+ Reset(me:out);
+
+ SetType(me:out;
+ aType:ShapeEnum from TopAbs);
+
+ Type(me)
+ returns ShapeEnum from TopAbs;
+
+ SetNbSubShapes(me:out;
+ aType:ShapeEnum from TopAbs;
+ aNb :Integer from Standard);
+
+ NbSubShapes(me;
+ aType:ShapeEnum from TopAbs)
+ returns Integer from Standard;
+
+ SetKindOfShape (me:out;
+ aT:KindOfShape from GEOMAlgo);
+
+ KindOfShape (me)
+ returns KindOfShape from GEOMAlgo;
+
+ SetKindOfName (me:out;
+ aT: KindOfName from GEOMAlgo);
+
+ KindOfName(me)
+ returns KindOfName from GEOMAlgo;
+
+ SetKindOfBounds (me:out;
+ aT:KindOfBounds from GEOMAlgo);
+
+ KindOfBounds (me)
+ returns KindOfBounds from GEOMAlgo;
+
+ SetKindOfClosed (me:out;
+ aT:KindOfClosed from GEOMAlgo);
+
+ KindOfClosed(me)
+ returns KindOfClosed from GEOMAlgo;
+
+ SetLocation (me:out;
+ aP: Pnt from gp);
+
+ Location (me)
+ returns Pnt from gp;
+ ---C++: return const&
+
+ SetDirection (me:out;
+ aD:Dir from gp);
+
+ Direction (me)
+ returns Dir from gp;
+ ---C++: return const&
+
+ SetPosition (me:out;
+ aAx2 : Ax2 from gp);
+
+ SetPosition (me:out;
+ aAx3 : Ax3 from gp);
+
+ Position (me)
+ returns Ax3 from gp;
+ ---C++: return const&
+
+ SetPnt1 (me:out;
+ aP: Pnt from gp);
+
+ Pnt1 (me)
+ returns Pnt from gp;
+ ---C++: return const&
+
+ SetPnt2 (me:out;
+ aP: Pnt from gp);
+
+ Pnt2 (me)
+ returns Pnt from gp;
+ ---C++: return const&
+
+ SetRadius1 (me:out;
+ aR: Real from Standard);
+
+ Radius1(me)
+ returns Real from Standard;
+
+ SetRadius2 (me:out;
+ aR: Real from Standard);
+
+ Radius2(me)
+ returns Real from Standard;
+
+ SetLength(me:out;
+ aL: Real from Standard);
+
+ Length(me)
+ returns Real from Standard;
+
+ SetWidth(me:out;
+ aW: Real from Standard);
+
+ Width(me)
+ returns Real from Standard;
+
+ SetHeight(me:out;
+ aH: Real from Standard);
+
+ Height(me)
+ returns Real from Standard;
+ --
+ -- Dump
+ --
+ Dump(me);
+
+ DumpVertex(me)
+ is protected;
+
+ DumpEdge(me)
+ is protected;
+
+ DumpWire(me)
+ is protected;
+
+ DumpFace(me)
+ is protected;
+
+ DumpShell(me)
+ is protected;
+
+ DumpSolid(me)
+ is protected;
+
+ DumpCompSolid(me)
+ is protected;
+
+ DumpCompound(me)
+ is protected;
+
+fields
+ myType : ShapeEnum from TopAbs is protected;
+ myNbSubShapes : Integer from Standard[9] is protected;
+ myKindOfShape : KindOfShape from GEOMAlgo is protected;
+ myKindOfName : KindOfName from GEOMAlgo is protected;
+ myKindOfBounds : KindOfBounds from GEOMAlgo is protected;
+ myKindOfClosed : KindOfClosed from GEOMAlgo is protected;
+ --
+ myLocation : Pnt from gp is protected;
+ myDirection : Dir from gp is protected;
+ myPosition : Ax3 from gp is protected;
+ --
+ myRadius1 : Real from Standard is protected;
+ myRadius2 : Real from Standard is protected;
+ myLength : Real from Standard is protected;
+ myWidth : Real from Standard is protected;
+ myHeight : Real from Standard is protected;
+ --
+ myPnt1 : Pnt from gp is protected;
+ myPnt2 : Pnt from gp is protected;
+ --
+ myNbTypes : Integer from Standard is protected;
+end ShapeInfo;
--- /dev/null
+#include <GEOMAlgo_ShapeInfo.ixx>
+
+
+static
+ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType);
+static
+ void DumpKindOfShape(const GEOMAlgo_KindOfShape aKS);
+static
+ void DumpKindOfClosed(const GEOMAlgo_KindOfClosed aKC);
+static
+ void DumpKindOfBounds(const GEOMAlgo_KindOfBounds aKB);
+static
+ void DumpKindOfName(const GEOMAlgo_KindOfName aKS);
+static
+ void DumpPosition(const gp_Ax3& aAx3);
+static
+ void DumpLocation(const gp_Pnt& aP);
+static
+ void DumpDirection(const gp_Dir& aD);
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+ GEOMAlgo_ShapeInfo::GEOMAlgo_ShapeInfo()
+{
+ Reset();
+}
+//=======================================================================
+//function : ~
+//purpose :
+//=======================================================================
+ GEOMAlgo_ShapeInfo::~GEOMAlgo_ShapeInfo()
+{
+}
+//=======================================================================
+//function : Reset
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::Reset()
+{
+ Standard_Integer i;
+ //
+ myType=TopAbs_SHAPE;
+ //
+ myNbTypes=9;
+ for (i=0; i<myNbTypes; ++i) {
+ myNbSubShapes[i]=0;
+ }
+ //
+ myKindOfShape=GEOMAlgo_KS_UNKNOWN;
+ myKindOfBounds=GEOMAlgo_KB_UNKNOWN;
+ myKindOfClosed=GEOMAlgo_KC_UNKNOWN;
+ myKindOfName=GEOMAlgo_KN_UNKNOWN;
+ //
+ myLocation.SetCoord(99., 99., 99.);
+ myDirection.SetCoord(1.,0.,0.);
+ //
+ myRadius1=-1.;
+ myRadius2=-2.;
+ myLength=-3.;
+ myWidth=-3.;
+ myHeight=-3.;
+}
+//=======================================================================
+//function : SetType
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetType(const TopAbs_ShapeEnum aType)
+{
+ myType=aType;
+}
+//=======================================================================
+//function : Type
+//purpose :
+//=======================================================================
+ TopAbs_ShapeEnum GEOMAlgo_ShapeInfo::Type() const
+{
+ return myType;
+}
+//=======================================================================
+//function : SetNbSubShapes
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetNbSubShapes(const TopAbs_ShapeEnum aType,
+ const Standard_Integer aNb)
+{
+ Standard_Integer iN;
+
+ iN=TypeToInteger(aType);
+ if (iN>=0 && iN<myNbTypes) {
+ myNbSubShapes[iN]=aNb;
+ }
+}
+//=======================================================================
+//function : NbSubShapes
+//purpose :
+//=======================================================================
+ Standard_Integer GEOMAlgo_ShapeInfo::NbSubShapes(const TopAbs_ShapeEnum aType) const
+{
+ Standard_Integer iN;
+
+ iN=TypeToInteger(aType);
+ if (iN>=0 && iN<myNbTypes) {
+ return myNbSubShapes[iN];
+ }
+ return 0;
+}
+//=======================================================================
+//function : SetKindOfShape
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetKindOfShape(const GEOMAlgo_KindOfShape aT)
+{
+ myKindOfShape=aT;
+}
+//=======================================================================
+//function : KindOfShape
+//purpose :
+//=======================================================================
+ GEOMAlgo_KindOfShape GEOMAlgo_ShapeInfo::KindOfShape() const
+{
+ return myKindOfShape;
+}
+//=======================================================================
+//function : SetKindOfName
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetKindOfName(const GEOMAlgo_KindOfName aT)
+{
+ myKindOfName=aT;
+}
+//=======================================================================
+//function : KindOfName
+//purpose :
+//=======================================================================
+ GEOMAlgo_KindOfName GEOMAlgo_ShapeInfo::KindOfName() const
+{
+ return myKindOfName;
+}
+//=======================================================================
+//function : SetKindOfBounds
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetKindOfBounds(const GEOMAlgo_KindOfBounds aT)
+{
+ myKindOfBounds=aT;
+}
+//=======================================================================
+//function : KindOfBounds
+//purpose :
+//=======================================================================
+ GEOMAlgo_KindOfBounds GEOMAlgo_ShapeInfo::KindOfBounds() const
+{
+ return myKindOfBounds;
+}
+//=======================================================================
+//function : SetKindOfClosed
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetKindOfClosed(const GEOMAlgo_KindOfClosed aT)
+{
+ myKindOfClosed=aT;
+}
+//=======================================================================
+//function : KindOfClosed
+//purpose :
+//=======================================================================
+ GEOMAlgo_KindOfClosed GEOMAlgo_ShapeInfo::KindOfClosed() const
+{
+ return myKindOfClosed;
+}
+//=======================================================================
+//function : SetLocation
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetLocation(const gp_Pnt& aP)
+{
+ myLocation=aP;
+}
+//=======================================================================
+//function : Location
+//purpose :
+//=======================================================================
+ const gp_Pnt& GEOMAlgo_ShapeInfo::Location() const
+{
+ return myLocation;
+}
+//=======================================================================
+//function : SetDirection
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetDirection(const gp_Dir& aD)
+{
+ myDirection=aD;
+}
+//=======================================================================
+//function : Direction
+//purpose :
+//=======================================================================
+ const gp_Dir& GEOMAlgo_ShapeInfo::Direction() const
+{
+ return myDirection;
+}
+//=======================================================================
+//function : SetPosition
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax2& aAx2)
+{
+ gp_Ax3 aAx3(aAx2);
+ SetPosition(aAx3);
+}
+//=======================================================================
+//function : SetPosition
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax3& aAx3)
+{
+ myPosition=aAx3;
+}
+//=======================================================================
+//function : Position
+//purpose :
+//=======================================================================
+ const gp_Ax3& GEOMAlgo_ShapeInfo::Position() const
+{
+ return myPosition;
+}
+
+//=======================================================================
+//function : SetPnt1
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetPnt1(const gp_Pnt& aP)
+{
+ myPnt1=aP;
+}
+//=======================================================================
+//function : Pnt1
+//purpose :
+//=======================================================================
+ const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt1() const
+{
+ return myPnt1;
+}
+//=======================================================================
+//function : SetPnt2
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetPnt2(const gp_Pnt& aP)
+{
+ myPnt2=aP;
+}
+//=======================================================================
+//function : Pnt2
+//purpose :
+//=======================================================================
+ const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt2() const
+{
+ return myPnt2;
+}
+//=======================================================================
+//function : SetRadius1
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetRadius1(const Standard_Real aR)
+{
+ myRadius1=aR;
+}
+//=======================================================================
+//function : Radius1
+//purpose :
+//=======================================================================
+ Standard_Real GEOMAlgo_ShapeInfo::Radius1() const
+{
+ return myRadius1;
+}
+//=======================================================================
+//function : SetRadius2
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetRadius2(const Standard_Real aR)
+{
+ myRadius2=aR;
+}
+//=======================================================================
+//function : Radius2
+//purpose :
+//=======================================================================
+ Standard_Real GEOMAlgo_ShapeInfo::Radius2() const
+{
+ return myRadius2;
+}
+//=======================================================================
+//function : SetLength
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetLength(const Standard_Real aL)
+{
+ myLength=aL;
+}
+//=======================================================================
+//function : Length
+//purpose :
+//=======================================================================
+ Standard_Real GEOMAlgo_ShapeInfo::Length() const
+{
+ return myLength;
+}
+//=======================================================================
+//function : SetWidth
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetWidth(const Standard_Real aW)
+{
+ myWidth=aW;
+}
+//=======================================================================
+//function : Width
+//purpose :
+//=======================================================================
+ Standard_Real GEOMAlgo_ShapeInfo::Width() const
+{
+ return myWidth;
+}
+//=======================================================================
+//function : SetHeight
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::SetHeight(const Standard_Real aH)
+{
+ myHeight=aH;
+}
+//=======================================================================
+//function : Height
+//purpose :
+//=======================================================================
+ Standard_Real GEOMAlgo_ShapeInfo::Height() const
+{
+ return myHeight;
+}
+//=======================================================================
+//function : TypeToInteger
+//purpose :
+//=======================================================================
+Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
+{
+ Standard_Integer iN;
+ //
+ iN=(Standard_Integer)aType;
+ return iN;
+}
+//=======================================================================
+//function : Dump
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::Dump()const
+{
+ switch (myType) {
+ //
+ case TopAbs_VERTEX:
+ DumpVertex();
+ break;
+ //
+ case TopAbs_EDGE:
+ DumpEdge();
+ break;
+ //
+ case TopAbs_WIRE:
+ DumpWire();
+ break;
+ //
+ case TopAbs_FACE:
+ DumpFace();
+ break;
+ //
+ case TopAbs_SHELL:
+ DumpShell();
+ break;
+ //
+ case TopAbs_SOLID:
+ DumpSolid();
+ break;
+ //
+ case TopAbs_COMPSOLID:
+ DumpCompSolid();
+ break;
+ //
+ case TopAbs_COMPOUND:
+ DumpCompound();
+ break;
+ //
+ default:
+ printf(" * not implememted yet\n");
+ break;
+ }
+}
+//=======================================================================
+//function : DumpCompound
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::DumpCompound()const
+{
+ Standard_Integer aNbV, aNbE, aNbF, aNbS, aNbC, aNbP;
+ GEOMAlgo_KindOfShape aKS;
+ GEOMAlgo_KindOfName aKN;
+ GEOMAlgo_KindOfBounds aKB;
+ GEOMAlgo_KindOfClosed aKC;
+ //
+ aNbV=NbSubShapes(TopAbs_VERTEX);
+ aNbE=NbSubShapes(TopAbs_EDGE);
+ aNbF=NbSubShapes(TopAbs_FACE);
+ aNbS=NbSubShapes(TopAbs_SOLID);
+ aNbC=NbSubShapes(TopAbs_COMPSOLID);
+ aNbP=NbSubShapes(TopAbs_COMPOUND);
+ aKS=KindOfShape();
+ aKN=KindOfName();
+ aKB=KindOfBounds();
+ aKC=KindOfClosed();
+ //
+ printf(" *COMPOUND\n");
+ printf(" number of vertices : %d\n", aNbV);
+ printf(" number of edges : %d\n", aNbE);
+ printf(" number of faces : %d\n", aNbF);
+ printf(" number of solids : %d\n", aNbS);
+ printf(" number of compsolids : %d\n", aNbC);
+ printf(" number of compounds : %d\n", aNbP);
+ DumpKindOfShape (aKS);
+ DumpKindOfName (aKN);
+ DumpKindOfBounds(aKB);
+ DumpKindOfClosed(aKC);
+}
+//=======================================================================
+//function : DumpCompSolid
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::DumpCompSolid()const
+{
+ Standard_Integer aNbV, aNbE, aNbF, aNbS;
+ GEOMAlgo_KindOfShape aKS;
+ GEOMAlgo_KindOfName aKN;
+ GEOMAlgo_KindOfBounds aKB;
+ GEOMAlgo_KindOfClosed aKC;
+ //
+ aNbV=NbSubShapes(TopAbs_VERTEX);
+ aNbE=NbSubShapes(TopAbs_EDGE);
+ aNbF=NbSubShapes(TopAbs_FACE);
+ aNbS=NbSubShapes(TopAbs_SOLID);
+ aKS=KindOfShape();
+ aKN=KindOfName();
+ aKB=KindOfBounds();
+ aKC=KindOfClosed();
+ //
+ printf(" *COMPSOLID\n");
+ printf(" number of vertices: %d\n", aNbV);
+ printf(" number of edges : %d\n", aNbE);
+ printf(" number of faces : %d\n", aNbF);
+ printf(" number of solids : %d\n", aNbS);
+ DumpKindOfShape (aKS);
+ DumpKindOfName (aKN);
+ DumpKindOfBounds(aKB);
+ DumpKindOfClosed(aKC);
+}
+
+//=======================================================================
+//function : DumpSolid
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::DumpSolid()const
+{
+ Standard_Integer aNbV, aNbE, aNbF;
+ GEOMAlgo_KindOfShape aKS;
+ GEOMAlgo_KindOfName aKN;
+ GEOMAlgo_KindOfBounds aKB;
+ GEOMAlgo_KindOfClosed aKC;
+ //
+ aNbV=NbSubShapes(TopAbs_VERTEX);
+ aNbE=NbSubShapes(TopAbs_EDGE);
+ aNbF=NbSubShapes(TopAbs_FACE);
+ aKS=KindOfShape();
+ aKN=KindOfName();
+ aKB=KindOfBounds();
+ aKC=KindOfClosed();
+ //
+ printf(" *SOLID\n");
+ printf(" number of vertices: %d\n", aNbV);
+ printf(" number of edges : %d\n", aNbE);
+ printf(" number of faces : %d\n", aNbF);
+ DumpKindOfShape (aKS);
+ DumpKindOfName (aKN);
+ DumpKindOfBounds(aKB);
+ DumpKindOfClosed(aKC);
+ //
+ if (aKN==GEOMAlgo_KN_SPHERE) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf\n", myRadius1);
+ }
+ if (aKN==GEOMAlgo_KN_CYLINDER) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf\n", myRadius1);
+ printf(" Height : %.3lf\n", myHeight);
+ }
+ else if (aKN==GEOMAlgo_KN_CONE) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf\n", myRadius1);
+ printf(" Radius2 : %.3lf\n", myRadius2);
+ printf(" Height : %.3lf\n", myHeight);
+ }
+ else if (aKN==GEOMAlgo_KN_TORUS) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf\n", myRadius1);
+ printf(" Radius2 : %.3lf\n", myRadius2);
+ }
+ else if (aKN==GEOMAlgo_KN_POLYHEDRON) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ }
+ else if (aKN==GEOMAlgo_KN_BOX) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Length : %.3lf\n", myLength);
+ printf(" Width : %.3lf\n", myWidth);
+ printf(" Height : %.3lf\n", myHeight);
+ }
+}
+
+//=======================================================================
+//function : DumpFace
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::DumpFace()const
+{
+ Standard_Integer aNbV, aNbE;
+ GEOMAlgo_KindOfShape aKS;
+ GEOMAlgo_KindOfName aKN;
+ GEOMAlgo_KindOfBounds aKB;
+ GEOMAlgo_KindOfClosed aKC;
+ //
+ aNbV=NbSubShapes(TopAbs_VERTEX);
+ aNbE=NbSubShapes(TopAbs_EDGE);
+ aKS=KindOfShape();
+ aKN=KindOfName();
+ aKB=KindOfBounds();
+ aKC=KindOfClosed();
+ //
+ printf(" *FACE\n");
+ printf(" number of vertices: %d\n", aNbV);
+ printf(" number of edges : %d\n", aNbE);
+ DumpKindOfShape (aKS);
+ DumpKindOfName (aKN);
+ DumpKindOfBounds(aKB);
+ DumpKindOfClosed(aKC);
+ //
+ // PLANE
+ if (aKN==GEOMAlgo_KN_PLANE) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ }
+ else if (aKN==GEOMAlgo_KN_DISKCIRCLE) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf\n", myRadius1);
+ }
+ else if (aKN==GEOMAlgo_KN_DISKELLIPSE) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf\n", myRadius1);
+ printf(" Radius2 : %.3lf\n", myRadius2);
+ }
+ else if (aKN==GEOMAlgo_KN_RECTANGLE) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Length : %.3lf\n", myLength);
+ printf(" Width : %.3lf\n", myWidth);
+ }
+ else if (aKN==GEOMAlgo_KN_TRIANGLE ||
+ aKN==GEOMAlgo_KN_QUADRANGLE||
+ aKN==GEOMAlgo_KN_POLYGON) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ }
+ //
+ // SPHERE
+ else if (aKN==GEOMAlgo_KN_SPHERE) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf", myRadius1);
+ }
+ //
+ // CYLINDER
+ else if (aKN==GEOMAlgo_KN_CYLINDER) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf\n", myRadius1);
+ printf(" Height : %.3lf\n", myHeight);
+ }
+ //
+ // CONE
+ else if (aKN==GEOMAlgo_KN_CONE) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf\n", myRadius1);
+ printf(" Radius2 : %.3lf\n", myRadius2);
+ printf(" Height : %.3lf\n", myHeight);
+ }
+ //
+ // TORUS
+ else if (aKN==GEOMAlgo_KN_TORUS) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf\n", myRadius1);
+ printf(" Radius2 : %.3lf\n", myRadius2);
+ }
+
+
+ printf("\n");
+}
+//=======================================================================
+//function : DumpShell
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::DumpShell()const
+{
+ Standard_Integer aNbV, aNbE, aNbF;
+ GEOMAlgo_KindOfClosed aKC;
+ //
+ printf(" *SHELL\n");
+ //
+ aNbV=NbSubShapes(TopAbs_VERTEX);
+ aNbE=NbSubShapes(TopAbs_EDGE);
+ aNbF=NbSubShapes(TopAbs_FACE);
+ printf(" number of vertices: %d\n", aNbV);
+ printf(" number of edges : %d\n", aNbE);
+ printf(" number of faces : %d\n", aNbF);
+ aKC=KindOfClosed();
+ DumpKindOfClosed(aKC);
+ printf("\n");
+}
+//=======================================================================
+//function : DumpWire
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::DumpWire()const
+{
+ Standard_Integer aNbV, aNbE;
+ GEOMAlgo_KindOfClosed aKC;
+ //
+ printf(" *WIRE\n");
+ //
+ aNbV=NbSubShapes(TopAbs_VERTEX);
+ aNbE=NbSubShapes(TopAbs_EDGE);
+ printf(" number of vertices: %d\n", aNbV);
+ printf(" number of edges : %d\n", aNbE);
+
+ aKC=KindOfClosed();
+ DumpKindOfClosed(aKC);
+ printf("\n");
+}
+//=======================================================================
+//function : DumpEdge
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::DumpEdge()const
+{
+ Standard_Integer aNbV;
+ Standard_Real aX, aY, aZ;
+ GEOMAlgo_KindOfShape aKS;
+ GEOMAlgo_KindOfName aKN;
+ GEOMAlgo_KindOfBounds aKB;
+ GEOMAlgo_KindOfClosed aKC;
+ //
+ aNbV=NbSubShapes(TopAbs_VERTEX);
+ aKS=KindOfShape();
+ aKN=KindOfName();
+ aKB=KindOfBounds();
+ aKC=KindOfClosed();
+ //
+ printf(" *EDGE\n");
+ printf(" number of vertices: %d\n", aNbV);
+ DumpKindOfShape (aKS);
+ DumpKindOfName (aKN);
+ DumpKindOfBounds(aKB);
+ DumpKindOfClosed(aKC);
+ //
+ // LINE
+ if (aKN==GEOMAlgo_KN_LINE) {
+ DumpLocation (myLocation);
+ DumpDirection(myDirection);
+ }
+ else if (aKN==GEOMAlgo_KN_SEGMENT) {
+ DumpLocation (myLocation);
+ DumpDirection(myDirection);
+ printf(" Length : %.3lf\n", myLength);
+ myPnt1.Coord(aX, aY, aZ);
+ printf(" Pnt1 : %.3lf %.3lf %.3lf\n", aX, aY, aZ);
+ myPnt2.Coord(aX, aY, aZ);
+ printf(" Pnt2 : %.3lf %.3lf %.3lf\n", aX, aY, aZ);
+
+ }
+ else if (aKN==GEOMAlgo_KN_CIRCLE) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf\n", myRadius1);
+ }
+ else if (aKN==GEOMAlgo_KN_ARCCIRCLE) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf\n", myRadius1);
+ myPnt1.Coord(aX, aY, aZ);
+ printf(" Pnt1 : %.3lf %.3lf %.3lf\n", aX, aY, aZ);
+ myPnt2.Coord(aX, aY, aZ);
+ printf(" Pnt2 : %.3lf %.3lf %.3lf\n", aX, aY, aZ);
+ }
+ else if (aKN==GEOMAlgo_KN_ELLIPSE) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf\n", myRadius1);
+ printf(" Radius2 : %.3lf\n", myRadius2);
+ }
+ else if (aKN==GEOMAlgo_KN_ARCELLIPSE) {
+ DumpLocation (myLocation);
+ DumpPosition (myPosition);
+ printf(" Radius1 : %.3lf\n", myRadius1);
+ printf(" Radius2 : %.3lf\n", myRadius2);
+ myPnt1.Coord(aX, aY, aZ);
+ printf(" Pnt1 : %.3lf %.3lf %.3lf\n", aX, aY, aZ);
+ myPnt2.Coord(aX, aY, aZ);
+ printf(" Pnt2 : %.3lf %.3lf %.3lf\n", aX, aY, aZ);
+ }
+ printf("\n");
+}
+//=======================================================================
+//function : DumpVertex
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfo::DumpVertex()const
+{
+ printf(" *VERTEX\n");
+ DumpLocation(myLocation);
+}
+//=======================================================================
+//function : DumpLocation
+//purpose :
+//=======================================================================
+ void DumpLocation(const gp_Pnt& aP)
+{
+ Standard_Real aX, aY, aZ;
+ //
+ aP.Coord(aX, aY, aZ);
+ printf(" Location : %.3lf %.3lf %.3lf \n", aX, aY, aZ);
+}
+//=======================================================================
+//function : DumpDirection
+//purpose :
+//=======================================================================
+ void DumpDirection(const gp_Dir& aD)
+{
+ Standard_Real aX, aY, aZ;
+ //
+ aD.Coord(aX, aY, aZ);
+ printf(" Direction: %.3lf %.3lf %.3lf \n", aX, aY, aZ);
+}
+//=======================================================================
+//function : DumpPosition
+//purpose :
+//=======================================================================
+void DumpPosition(const gp_Ax3& aAx3)
+{
+ const gp_Dir& aDZ=aAx3.Axis().Direction();
+ const gp_Dir& aDX=aAx3.XDirection();
+ const gp_Dir& aDY=aAx3.YDirection();
+ printf(" Position:\n");
+ printf(" Axis: %.3lf %.3lf %.3lf \n", aDZ.X(), aDZ.Y(), aDZ.Z());
+ printf(" X : %.3lf %.3lf %.3lf \n", aDX.X(), aDX.Y(), aDX.Z());
+ printf(" Y : %.3lf %.3lf %.3lf \n", aDY.X(), aDY.Y(), aDY.Z());
+}
+//=======================================================================
+//function : DumpKindOfBounds
+//purpose :
+//=======================================================================
+void DumpKindOfBounds(const GEOMAlgo_KindOfBounds aKB)
+{
+ char *pStr[]={
+ "KB_UNKNOWN",
+ "KB_TRIMMED",
+ "KB_INFINITE"
+ };
+ int i;
+ //
+ i=(Standard_Integer)aKB;
+ printf(" KindOfBounds: %s\n", pStr[i]);
+
+}
+//=======================================================================
+//function : DumpKindOfClosed
+//purpose :
+//=======================================================================
+void DumpKindOfClosed(const GEOMAlgo_KindOfClosed aKC)
+{
+ char *pStr[]={
+ "KC_UNKNOWN",
+ "KC_CLOSED",
+ "KC_NOTCLOSED"
+ };
+ int i;
+ //
+ i=(Standard_Integer)aKC;
+ printf(" KindOfClosed: %s\n", pStr[i]);
+
+}
+//=======================================================================
+//function : DumpKindOfShape
+//purpose :
+//=======================================================================
+void DumpKindOfShape(const GEOMAlgo_KindOfShape aKS)
+{
+ char *pStr[]={
+ "KS_UNKNOWN",
+ "KS_SPHERE",
+ "KS_CYLINDER",
+ "KS_BOX",
+ "KS_TORUS",
+ "KS_CONE",
+ "KS_ELLIPSE",
+ "KS_PLANE",
+ "KS_CIRCLE",
+ "KS_LINE",
+ "KS_DEGENERATED"
+ };
+ int i;
+ //
+ i=(Standard_Integer)aKS;
+ printf(" KindOfShape : %s\n", pStr[i]);
+}
+//=======================================================================
+//function : DumpKindOfName
+//purpose :
+//=======================================================================
+void DumpKindOfName(const GEOMAlgo_KindOfName aKS)
+{
+ char *pStr[]={
+ "KN_UNKNOWN",
+ "KN_SPHERE",
+ "KN_CYLINDER",
+ "KN_TORUS",
+ "KN_CONE",
+ "KN_ELLIPSE",
+ "KN_CIRCLE",
+ "KN_PLANE",
+ "KN_LINE",
+ "KN_BOX",
+ "KN_SEGMENT",
+ "KN_ARCCIRCLE",
+ "KN_POLYGON",
+ "KN_POLYHEDRON",
+ "KN_DISKCIRCLE",
+ "KN_DISKELLIPSE",
+ "KN_RECTANGLE",
+ "KN_TRIANGLE",
+ "KN_QUADRANGLE",
+ "KN_ARCELLIPSE"
+ };
+ int i;
+ //
+ i=(Standard_Integer)aKS;
+ printf(" KindOfName : %s\n", pStr[i]);
+}
--- /dev/null
+// File generated by CPPExt (Value)
+//
+// Copyright (C) 1991 - 2000 by
+// Matra Datavision SA. All rights reserved.
+//
+// Copyright (C) 2001 - 2004 by
+// Open CASCADE SA. All rights reserved.
+//
+// This file is part of the Open CASCADE Technology software.
+//
+// This software may be distributed and/or modified under the terms and
+// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
+// and appearing in the file LICENSE included in the packaging of this file.
+//
+// This software is distributed on an "AS IS" basis, without warranty of any
+// kind, and Open CASCADE SA hereby disclaims all such warranties,
+// including without limitation, any warranties of merchantability, fitness
+// for a particular purpose or non-infringement. Please see the License for
+// the specific terms and conditions governing rights and limitations under the
+// License.
+
+#ifndef _GEOMAlgo_ShapeInfo_HeaderFile
+#define _GEOMAlgo_ShapeInfo_HeaderFile
+
+#ifndef _TopAbs_ShapeEnum_HeaderFile
+#include <TopAbs_ShapeEnum.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _GEOMAlgo_KindOfShape_HeaderFile
+#include <GEOMAlgo_KindOfShape.hxx>
+#endif
+#ifndef _GEOMAlgo_KindOfName_HeaderFile
+#include <GEOMAlgo_KindOfName.hxx>
+#endif
+#ifndef _GEOMAlgo_KindOfBounds_HeaderFile
+#include <GEOMAlgo_KindOfBounds.hxx>
+#endif
+#ifndef _GEOMAlgo_KindOfClosed_HeaderFile
+#include <GEOMAlgo_KindOfClosed.hxx>
+#endif
+#ifndef _gp_Pnt_HeaderFile
+#include <gp_Pnt.hxx>
+#endif
+#ifndef _gp_Dir_HeaderFile
+#include <gp_Dir.hxx>
+#endif
+#ifndef _gp_Ax3_HeaderFile
+#include <gp_Ax3.hxx>
+#endif
+#ifndef _Standard_Real_HeaderFile
+#include <Standard_Real.hxx>
+#endif
+class gp_Pnt;
+class gp_Dir;
+class gp_Ax2;
+class gp_Ax3;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class GEOMAlgo_ShapeInfo {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT GEOMAlgo_ShapeInfo();
+Standard_EXPORT virtual ~GEOMAlgo_ShapeInfo();
+
+
+Standard_EXPORT void Reset() ;
+
+
+Standard_EXPORT void SetType(const TopAbs_ShapeEnum aType) ;
+
+
+Standard_EXPORT TopAbs_ShapeEnum Type() const;
+
+
+Standard_EXPORT void SetNbSubShapes(const TopAbs_ShapeEnum aType,const Standard_Integer aNb) ;
+
+
+Standard_EXPORT Standard_Integer NbSubShapes(const TopAbs_ShapeEnum aType) const;
+
+
+Standard_EXPORT void SetKindOfShape(const GEOMAlgo_KindOfShape aT) ;
+
+
+Standard_EXPORT GEOMAlgo_KindOfShape KindOfShape() const;
+
+
+Standard_EXPORT void SetKindOfName(const GEOMAlgo_KindOfName aT) ;
+
+
+Standard_EXPORT GEOMAlgo_KindOfName KindOfName() const;
+
+
+Standard_EXPORT void SetKindOfBounds(const GEOMAlgo_KindOfBounds aT) ;
+
+
+Standard_EXPORT GEOMAlgo_KindOfBounds KindOfBounds() const;
+
+
+Standard_EXPORT void SetKindOfClosed(const GEOMAlgo_KindOfClosed aT) ;
+
+
+Standard_EXPORT GEOMAlgo_KindOfClosed KindOfClosed() const;
+
+
+Standard_EXPORT void SetLocation(const gp_Pnt& aP) ;
+
+
+Standard_EXPORT const gp_Pnt& Location() const;
+
+
+Standard_EXPORT void SetDirection(const gp_Dir& aD) ;
+
+
+Standard_EXPORT const gp_Dir& Direction() const;
+
+
+Standard_EXPORT void SetPosition(const gp_Ax2& aAx2) ;
+
+
+Standard_EXPORT void SetPosition(const gp_Ax3& aAx3) ;
+
+
+Standard_EXPORT const gp_Ax3& Position() const;
+
+
+Standard_EXPORT void SetPnt1(const gp_Pnt& aP) ;
+
+
+Standard_EXPORT const gp_Pnt& Pnt1() const;
+
+
+Standard_EXPORT void SetPnt2(const gp_Pnt& aP) ;
+
+
+Standard_EXPORT const gp_Pnt& Pnt2() const;
+
+
+Standard_EXPORT void SetRadius1(const Standard_Real aR) ;
+
+
+Standard_EXPORT Standard_Real Radius1() const;
+
+
+Standard_EXPORT void SetRadius2(const Standard_Real aR) ;
+
+
+Standard_EXPORT Standard_Real Radius2() const;
+
+
+Standard_EXPORT void SetLength(const Standard_Real aL) ;
+
+
+Standard_EXPORT Standard_Real Length() const;
+
+
+Standard_EXPORT void SetWidth(const Standard_Real aW) ;
+
+
+Standard_EXPORT Standard_Real Width() const;
+
+
+Standard_EXPORT void SetHeight(const Standard_Real aH) ;
+
+
+Standard_EXPORT Standard_Real Height() const;
+
+
+Standard_EXPORT void Dump() const;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+Standard_EXPORT void DumpVertex() const;
+
+
+Standard_EXPORT void DumpEdge() const;
+
+
+Standard_EXPORT void DumpWire() const;
+
+
+Standard_EXPORT void DumpFace() const;
+
+
+Standard_EXPORT void DumpShell() const;
+
+
+Standard_EXPORT void DumpSolid() const;
+
+
+Standard_EXPORT void DumpCompSolid() const;
+
+
+Standard_EXPORT void DumpCompound() const;
+
+
+ // Fields PROTECTED
+ //
+TopAbs_ShapeEnum myType;
+Standard_Integer myNbSubShapes[9];
+GEOMAlgo_KindOfShape myKindOfShape;
+GEOMAlgo_KindOfName myKindOfName;
+GEOMAlgo_KindOfBounds myKindOfBounds;
+GEOMAlgo_KindOfClosed myKindOfClosed;
+gp_Pnt myLocation;
+gp_Dir myDirection;
+gp_Ax3 myPosition;
+Standard_Real myRadius1;
+Standard_Real myRadius2;
+Standard_Real myLength;
+Standard_Real myWidth;
+Standard_Real myHeight;
+gp_Pnt myPnt1;
+gp_Pnt myPnt2;
+Standard_Integer myNbTypes;
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// File generated by CPPExt (Value)
+//
+// Copyright (C) 1991 - 2000 by
+// Matra Datavision SA. All rights reserved.
+//
+// Copyright (C) 2001 - 2004 by
+// Open CASCADE SA. All rights reserved.
+//
+// This file is part of the Open CASCADE Technology software.
+//
+// This software may be distributed and/or modified under the terms and
+// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
+// and appearing in the file LICENSE included in the packaging of this file.
+//
+// This software is distributed on an "AS IS" basis, without warranty of any
+// kind, and Open CASCADE SA hereby disclaims all such warranties,
+// including without limitation, any warranties of merchantability, fitness
+// for a particular purpose or non-infringement. Please see the License for
+// the specific terms and conditions governing rights and limitations under the
+// License.
+
+#include <GEOMAlgo_ShapeInfo.jxx>
+
+
+
+
--- /dev/null
+#ifndef _gp_Pnt_HeaderFile
+#include <gp_Pnt.hxx>
+#endif
+#ifndef _gp_Dir_HeaderFile
+#include <gp_Dir.hxx>
+#endif
+#ifndef _gp_Ax2_HeaderFile
+#include <gp_Ax2.hxx>
+#endif
+#ifndef _gp_Ax3_HeaderFile
+#include <gp_Ax3.hxx>
+#endif
+#ifndef _GEOMAlgo_ShapeInfo_HeaderFile
+#include <GEOMAlgo_ShapeInfo.hxx>
+#endif
--- /dev/null
+-- File: GEOMAlgo_ShapeInfoFiller.cdl
+-- Created: Mon Apr 2 15:05:34 2007
+-- Author: Peter KURNEV
+-- <pkv@irinox>
+---Copyright: Matra Datavision 2007
+
+
+class ShapeInfoFiller from GEOMAlgo
+ inherits Algo from GEOMAlgo
+
+ ---Purpose:
+
+uses
+ Pln from gp,
+ Sphere from gp,
+ Cylinder from gp,
+ Cone from gp,
+ Torus from gp,
+
+ Shape from TopoDS,
+ Face from TopoDS,
+ Solid from TopoDS,
+
+ ShapeInfo from GEOMAlgo,
+ KindOfName from GEOMAlgo,
+ IndexedDataMapOfShapeShapeInfo from GEOMAlgo
+
+--raises
+
+is
+
+ Create
+ returns ShapeInfoFiller from GEOMAlgo;
+ ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_ShapeInfoFiller();"
+
+ SetShape(me:out;
+ aS:Shape from TopoDS);
+
+ Shape(me)
+ returns Shape from TopoDS;
+ ---C++:return const &
+
+ SetTolerance(me:out;
+ aT:Real from Standard);
+
+ Tolerance(me)
+ returns Real from Standard;
+
+ Info(me)
+ returns ShapeInfo from GEOMAlgo;
+ ---C++:return const &
+
+ Info(me;
+ aS:Shape from TopoDS)
+ returns ShapeInfo from GEOMAlgo;
+ ---C++:return const &
+
+ Perform(me:out)
+ is redefined;
+
+ CheckData(me:out)
+ is redefined protected;
+
+ FillNbSubShapes(me:out;
+ aS:Shape from TopoDS;
+ aInfo: out ShapeInfo from GEOMAlgo)
+ is protected;
+
+ FillSubShapes(me:out;
+ aS:Shape from TopoDS)
+ is protected;
+
+ FillShape(me:out;
+ aS:Shape from TopoDS)
+ is protected;
+
+ FillVertex(me:out;
+ aS:Shape from TopoDS)
+ is protected;
+
+ FillEdge(me:out;
+ aS:Shape from TopoDS)
+ is protected;
+
+ FillFace(me:out;
+ aS:Shape from TopoDS)
+ is protected;
+
+ FillSolid(me:out;
+ aS:Shape from TopoDS)
+ is protected;
+
+ FillContainer(me:out;
+ aS:Shape from TopoDS)
+ is protected;
+
+
+ FillDetails(me:out;
+ aF:Face from TopoDS;
+ aPln:Pln from gp)
+ is protected;
+
+ FillDetails(me:out;
+ aF:Face from TopoDS;
+ aSph:Sphere from gp)
+ is protected;
+
+ FillDetails(me:out;
+ aF:Face from TopoDS;
+ aCyl:Cylinder from gp)
+ is protected;
+
+ FillDetails(me:out;
+ aF:Face from TopoDS;
+ aCone:Cone from gp)
+ is protected;
+
+ FillDetails(me:out;
+ aF:Face from TopoDS;
+ aTorus:Torus from gp)
+ is protected;
+
+ FillDetails(me:out;
+ aS:Solid from TopoDS)
+ is protected;
+
+fields
+ myShape : Shape from TopoDS is protected;
+ myEmptyInfo : ShapeInfo from GEOMAlgo is protected;
+ myMapInfo : IndexedDataMapOfShapeShapeInfo from GEOMAlgo is protected;
+ myTolerance : Real from Standard is protected;
+end ShapeInfoFiller;
--- /dev/null
+#include <GEOMAlgo_ShapeInfoFiller.ixx>
+
+#include <Precision.hxx>
+
+#include <gp_Lin.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Dir.hxx>
+
+#include <Geom_Curve.hxx>
+#include <GeomAdaptor_Curve.hxx>
+
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+
+#include <BRep_Tool.hxx>
+#include <TopExp.hxx>
+
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <gp_Circ.hxx>
+#include <gp_Ax2.hxx>
+#include <gp_Elips.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <TopoDS_Wire.hxx>
+#include <TopExp.hxx>
+#include <Geom_Surface.hxx>
+#include <TopoDS_Face.hxx>
+#include <GeomAdaptor_Surface.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Sphere.hxx>
+#include <gp_Ax3.hxx>
+#include <BRepTools.hxx>
+#include <gp_Cylinder.hxx>
+#include <gp_Cone.hxx>
+#include <gp_Torus.hxx>
+#include <TopoDS_Solid.hxx>
+
+
+
+
+static
+ Standard_Boolean IsAllowedType(const GeomAbs_CurveType aCT);
+static
+ Standard_Boolean IsAllowedType(const GeomAbs_SurfaceType aST);
+static
+ Standard_Integer NbWires(const TopoDS_Face& aF);
+static
+ Standard_Integer NbShells(const TopoDS_Solid& aS);
+
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+ GEOMAlgo_ShapeInfoFiller::GEOMAlgo_ShapeInfoFiller()
+:
+ GEOMAlgo_Algo()
+{
+ myTolerance=0.0001;
+}
+//=======================================================================
+//function : ~
+//purpose :
+//=======================================================================
+ GEOMAlgo_ShapeInfoFiller::~GEOMAlgo_ShapeInfoFiller()
+{
+}
+//=======================================================================
+//function : SetTolerance
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::SetTolerance(const Standard_Real aT)
+{
+ myTolerance=aT;
+}
+//=======================================================================
+//function : Tolerance
+//purpose :
+//=======================================================================
+ Standard_Real GEOMAlgo_ShapeInfoFiller::Tolerance()const
+{
+ return myTolerance;
+}
+//=======================================================================
+//function : SetShape
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::SetShape(const TopoDS_Shape& aS)
+{
+ myShape=aS;
+}
+//=======================================================================
+//function : Shape
+//purpose :
+//=======================================================================
+ const TopoDS_Shape& GEOMAlgo_ShapeInfoFiller::Shape() const
+{
+ return myShape;
+}
+//=======================================================================
+//function : Info
+//purpose :
+//=======================================================================
+ const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info() const
+{
+ return Info(myShape);
+}
+//=======================================================================
+//function : Info
+//purpose :
+//=======================================================================
+ const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info(const TopoDS_Shape& aS) const
+{
+ if (!aS.IsNull()) {
+ if (myMapInfo.Contains(aS)) {
+ const GEOMAlgo_ShapeInfo& aInfo=myMapInfo.FindFromKey(aS);
+ return aInfo;
+ }
+ }
+ return myEmptyInfo;
+}
+
+//=======================================================================
+//function : CheckData
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::CheckData()
+{
+ myErrorStatus=0;
+ //
+ if (myShape.IsNull()) {
+ myErrorStatus=10;
+ return;
+ }
+}
+//=======================================================================
+//function : Perform
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::Perform()
+{
+ myErrorStatus=0;
+ //
+ myMapInfo.Clear();
+ //
+ CheckData();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ FillShape(myShape);
+}
+//=======================================================================
+//function :FillShape
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillShape(const TopoDS_Shape& aS)
+{
+ TopAbs_ShapeEnum aType;
+ //
+ aType=aS.ShapeType();
+ switch(aType) {
+ //
+ case TopAbs_VERTEX:
+ FillVertex(aS);
+ break;
+ //
+ case TopAbs_EDGE:
+ FillEdge(aS);
+ break;
+ //
+ case TopAbs_FACE:
+ FillFace(aS);
+ break;
+ //
+ case TopAbs_SOLID:
+ FillSolid(aS);
+ break;
+ //
+ case TopAbs_WIRE:
+ case TopAbs_SHELL:
+ case TopAbs_COMPSOLID:
+ case TopAbs_COMPOUND:
+ FillContainer(aS);
+ break;
+ //
+ default:
+ break;
+ }
+}
+//=======================================================================
+//function :FillSubShapes
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillSubShapes(const TopoDS_Shape& aS)
+{
+ TopoDS_Iterator aIt;
+ //
+ aIt.Initialize(aS);
+ for (; aIt.More(); aIt.Next()){
+ const TopoDS_Shape& aSx=aIt.Value();
+ FillShape(aSx);
+ }
+}
+//=======================================================================
+//function : FillContainer
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillContainer(const TopoDS_Shape& aS)
+{
+ myErrorStatus=0;
+ //
+ Standard_Boolean bIsClosed;
+ TopAbs_ShapeEnum aType;
+ GEOMAlgo_KindOfClosed aKC;
+ //
+ aType=aS.ShapeType();
+ //----------------------------------------------------
+ if (myMapInfo.Contains(aS)) {
+ return;
+ }
+ else {
+ GEOMAlgo_ShapeInfo aInfoX;
+ myMapInfo.Add(aS, aInfoX);
+ }
+ GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
+ //----------------------------------------------------
+ aInfo.SetType(aType);
+ FillNbSubShapes(aS, aInfo);
+ //
+ if (aType==TopAbs_SHELL) {
+ bIsClosed=BRep_Tool::IsClosed(aS);
+ aKC=(bIsClosed) ? GEOMAlgo_KC_CLOSED :GEOMAlgo_KC_NOTCLOSED;
+ aInfo.SetKindOfClosed(aKC);
+ }
+ else if (aType==TopAbs_WIRE) {
+ TopoDS_Wire aW;
+ TopoDS_Vertex aV1, aV2;
+ //
+ aW=TopoDS::Wire(aS);
+ TopExp::Vertices(aW, aV1, aV2);
+ //
+ bIsClosed=aV1.IsSame(aV2);
+ aKC=(bIsClosed) ? GEOMAlgo_KC_CLOSED :GEOMAlgo_KC_NOTCLOSED;
+ aInfo.SetKindOfClosed(aKC);
+ }
+ //
+ FillSubShapes(aS);
+}
+//=======================================================================
+//function : FillSolid
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillSolid(const TopoDS_Shape& aS)
+{
+ Standard_Integer aNbShells;
+ TopoDS_Solid aSd;
+ //
+ myErrorStatus=0;
+ //----------------------------------------------------
+ if (myMapInfo.Contains(aS)) {
+ return;
+ }
+ else {
+ GEOMAlgo_ShapeInfo aInfoX;
+ myMapInfo.Add(aS, aInfoX);
+ }
+ GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
+ //----------------------------------------------------
+ aInfo.SetType(TopAbs_SOLID);
+ FillNbSubShapes(aS, aInfo);
+ FillSubShapes(aS);
+ //
+ aSd=TopoDS::Solid(aS);
+ //
+ aNbShells=NbShells(aSd);
+ if (aNbShells>1) {
+ return;
+ }
+ //
+ FillDetails(aSd);
+}
+//=======================================================================
+//function :FillFace
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillFace(const TopoDS_Shape& aS)
+{
+ myErrorStatus=0;
+ //
+ Standard_Boolean bIsAllowedType;
+ Standard_Integer aNbWires;//, iRet
+ Standard_Boolean bInf, bInfU1, bInfU2, bInfV1, bInfV2;
+ Standard_Real aUMin, aUMax, aVMin, aVMax, aR1, aR2;
+ gp_Pnt aP0;
+ gp_Dir aDN;
+ gp_Ax3 aAx3;
+ GeomAbs_SurfaceType aST;
+ Handle(Geom_Surface) aSurf;
+ TopoDS_Face aF;
+ //GEOMAlgo_KindOfName aKindOfName;
+ //----------------------------------------------------
+ if (myMapInfo.Contains(aS)) {
+ return;
+ }
+ else {
+ GEOMAlgo_ShapeInfo aInfoX;
+ myMapInfo.Add(aS, aInfoX);
+ }
+ GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
+ //----------------------------------------------------
+ aInfo.SetType(TopAbs_FACE);
+ //
+ FillNbSubShapes(aS, aInfo);
+ //
+ FillSubShapes(aS);
+ //
+ aF=TopoDS::Face(aS);
+ //
+ aNbWires=NbWires(aF);
+ if (aNbWires>1) {
+ return;
+ }
+ //
+ aSurf=BRep_Tool::Surface(aF);
+ GeomAdaptor_Surface aGAS(aSurf);
+ aST=aGAS.GetType();
+ bIsAllowedType=IsAllowedType(aST);
+ if (!bIsAllowedType) {
+ return;
+ }
+ //
+ // 1. Plane
+ if (aST==GeomAbs_Plane) {
+ gp_Pln aPln;
+ //
+ aPln=aGAS.Plane();
+ aP0=aPln.Location();
+ aAx3=aPln.Position();
+ //
+ aInfo.SetKindOfShape(GEOMAlgo_KS_PLANE);
+ aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED);
+ aInfo.SetLocation(aP0);
+ aInfo.SetPosition(aAx3);
+ //
+ //aSurf->Bounds(aUMin, aUMax, aVMin, aVMax);
+ BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
+ bInfU1=Precision::IsNegativeInfinite(aUMin);
+ bInfU2=Precision::IsPositiveInfinite(aUMax);
+ bInfV1=Precision::IsNegativeInfinite(aVMin);
+ bInfV2=Precision::IsPositiveInfinite(aVMax);
+ //
+ bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
+ if (bInf) {
+ aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
+ }
+ else {
+ aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
+ }
+ //
+ FillDetails(aF, aPln);
+ }// if (aCT==GeomAbs_Line) {
+ //
+ // 2. Sphere
+ else if (aST==GeomAbs_Sphere) {
+ gp_Sphere aSphere;
+ //
+ aSphere=aGAS.Sphere();
+ aP0=aSphere.Location();
+ aAx3=aSphere.Position();
+ aR1=aSphere.Radius();
+ //
+ aInfo.SetKindOfShape(GEOMAlgo_KS_SPHERE);
+ aInfo.SetLocation(aP0);
+ aInfo.SetPosition(aAx3);
+ aInfo.SetRadius1(aR1);
+ //
+ aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
+ aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED);
+ //
+ FillDetails(aF, aSphere);
+ }// else if (aST==GeomAbs_Sphere) {
+ //
+ // 3. Cylinder
+ else if (aST==GeomAbs_Cylinder) {
+ gp_Cylinder aCyl;
+ //
+ aCyl=aGAS.Cylinder();
+ aP0=aCyl.Location();
+ aAx3=aCyl.Position();
+ aR1=aCyl.Radius();
+ //
+ aInfo.SetKindOfShape(GEOMAlgo_KS_CYLINDER);
+ aInfo.SetLocation(aP0);
+ aInfo.SetPosition(aAx3);
+ aInfo.SetRadius1(aR1);
+ //
+ BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
+ bInfU1=Precision::IsNegativeInfinite(aUMin);
+ bInfU2=Precision::IsPositiveInfinite(aUMax);
+ bInfV1=Precision::IsNegativeInfinite(aVMin);
+ bInfV2=Precision::IsPositiveInfinite(aVMax);
+ //
+ bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
+ if (bInf) {
+ aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
+ }
+ else {
+ aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
+ }
+ FillDetails(aF, aCyl);
+ }
+ //
+ // 4. Cone
+ else if (aST==GeomAbs_Cone) {
+ gp_Cone aCone;
+ //
+ aCone=aGAS.Cone();
+ aP0=aCone.Location();
+ aAx3=aCone.Position();
+ //aR1=aCyl.Radius();
+ //
+ aInfo.SetKindOfShape(GEOMAlgo_KS_CONE);
+ aInfo.SetLocation(aP0);
+ aInfo.SetPosition(aAx3);
+ //aInfo.SetRadius1(aR1);
+ //
+ BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
+ bInfU1=Precision::IsNegativeInfinite(aUMin);
+ bInfU2=Precision::IsPositiveInfinite(aUMax);
+ bInfV1=Precision::IsNegativeInfinite(aVMin);
+ bInfV2=Precision::IsPositiveInfinite(aVMax);
+ //
+ bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
+ if (bInf) {
+ aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
+ }
+ else {
+ aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
+ }
+ FillDetails(aF, aCone);
+ }
+ //
+ // 5. Torus
+ else if (aST==GeomAbs_Torus) {
+ gp_Torus aTorus;
+ //
+ aTorus=aGAS.Torus();
+ aP0=aTorus.Location();
+ aAx3=aTorus.Position();
+ aR1=aTorus.MajorRadius();
+ aR2=aTorus.MinorRadius();
+ //
+ aInfo.SetKindOfShape(GEOMAlgo_KS_TORUS);
+ aInfo.SetLocation(aP0);
+ aInfo.SetPosition(aAx3);
+ aInfo.SetRadius1(aR1);
+ aInfo.SetRadius2(aR2);
+ //
+ aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
+
+ FillDetails(aF, aTorus);
+ }
+}
+//=======================================================================
+//function :FillEdge
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
+{
+ myErrorStatus=0;
+ //
+ Standard_Boolean bDegenerated, bIsAllowedType;
+ Standard_Integer aNbV;
+ Standard_Real aR1, aR2;
+ gp_Pnt aP, aP1, aP2, aPc;
+ gp_Dir aD;
+ gp_Ax2 aAx2;
+ Standard_Real aT1, aT2;
+ GeomAbs_CurveType aCT;
+ Handle(Geom_Curve) aC3D;
+ TopoDS_Edge aE;
+ //----------------------------------------------------
+ if (myMapInfo.Contains(aS)) {
+ return;
+ }
+ else {
+ GEOMAlgo_ShapeInfo aInfoX;
+ myMapInfo.Add(aS, aInfoX);
+ }
+ GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
+ //----------------------------------------------------
+ aInfo.SetType(TopAbs_EDGE);
+ //
+ FillNbSubShapes(aS, aInfo);
+ //
+ aE=TopoDS::Edge(aS);
+ //
+ bDegenerated=BRep_Tool::Degenerated(aE);
+ if (bDegenerated) {
+ aInfo.SetKindOfShape(GEOMAlgo_KS_DEGENERATED);
+ FillSubShapes(aS);
+ return;
+ }
+ //
+ aC3D=BRep_Tool::Curve(aE, aT1, aT2);
+ GeomAdaptor_Curve aGAC(aC3D);
+ aCT=aGAC.GetType();
+ bIsAllowedType=IsAllowedType(aCT);
+ if (!bIsAllowedType) {
+ FillSubShapes(aS);
+ return;
+ }
+ // Line
+ if (aCT==GeomAbs_Line) {
+ Standard_Boolean bInf1, bInf2;
+ Standard_Real aLength;
+ gp_Lin aLin;
+ gp_XYZ aXYZ1, aXYZ2, aXYZc;
+ //
+ aLin=aGAC.Line();
+ aP=aLin.Location();
+ aD=aLin.Direction();
+ //
+ aInfo.SetKindOfShape(GEOMAlgo_KS_LINE);
+ aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED);
+ aInfo.SetLocation(aP);
+ aInfo.SetDirection(aD);
+ //
+ bInf1=Precision::IsNegativeInfinite(aT1);
+ bInf2=Precision::IsPositiveInfinite(aT2);
+ if (bInf1||bInf2) {
+ aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
+ aInfo.SetKindOfName(GEOMAlgo_KN_LINE);
+ }
+ else {
+ aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
+ aInfo.SetKindOfName(GEOMAlgo_KN_SEGMENT);
+ aGAC.D0(aT1, aP1);
+ aGAC.D0(aT2, aP2);
+ aInfo.SetPnt1(aP1);
+ aInfo.SetPnt2(aP2);
+ //
+ aLength=aP1.Distance(aP2);
+ aXYZ1=aP1.XYZ();
+ aXYZ2=aP2.XYZ();
+ aXYZc=aXYZ1+aXYZ2;
+ aXYZc.Multiply(0.5);
+ //
+ aPc.SetXYZ(aXYZc);
+ gp_Vec aVec(aPc, aP2);
+ gp_Dir aDir(aVec);
+ //
+ aInfo.SetLocation(aPc);
+ aInfo.SetDirection(aDir);
+ aInfo.SetLength(aLength);
+ }
+ }// if (aCT==GeomAbs_Line) {
+ //
+ // Circle
+ else if (aCT==GeomAbs_Circle) {
+ gp_Circ aCirc;
+ //
+ aCirc=aGAC.Circle();
+ aP=aCirc.Location();
+ aAx2=aCirc.Position();
+ aR1=aCirc.Radius();
+ //
+ aInfo.SetKindOfShape(GEOMAlgo_KS_CIRCLE);
+ aInfo.SetLocation(aP);
+ aInfo.SetPosition(aAx2);
+ aInfo.SetRadius1(aR1);
+ //
+ aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
+ if (!aNbV) {
+ myErrorStatus=11; // circle edge without vertices
+ return;
+ }
+ aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
+ aGAC.D0(aT1, aP1);
+ aGAC.D0(aT2, aP2);
+ aInfo.SetPnt1(aP1);
+ aInfo.SetPnt2(aP2);
+ //
+ if (aNbV==1) {
+ aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED);
+ aInfo.SetKindOfName(GEOMAlgo_KN_CIRCLE);
+ }
+ else {
+ aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED);
+ aInfo.SetKindOfName(GEOMAlgo_KN_ARCCIRCLE);
+ //
+ gp_Vec aVecX(aP, aP1);
+ gp_Dir aDirX(aVecX);
+ gp_Ax2 aAx2new(aP, aAx2.Direction(), aDirX);
+ aInfo.SetPosition(aAx2new);
+ }
+ }// else if (aCT==GeomAbs_Circle) {
+ //
+ // Ellipse
+ else if (aCT==GeomAbs_Ellipse) {
+ gp_Elips aElips;
+ //
+ aElips=aGAC.Ellipse();
+ aP=aElips.Location();
+ aAx2=aElips.Position();
+ aR1=aElips.MajorRadius();
+ aR2=aElips.MinorRadius();
+ //
+ aInfo.SetKindOfShape(GEOMAlgo_KS_ELLIPSE);
+ aInfo.SetLocation(aP);
+ aInfo.SetPosition(aAx2);
+ aInfo.SetRadius1(aR1);
+ aInfo.SetRadius2(aR2);
+ //
+ aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
+ if (!aNbV) {
+ myErrorStatus=11; // ellipse edge without vertices
+ return;
+ }
+ aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
+ aGAC.D0(aT1, aP1);
+ aGAC.D0(aT2, aP2);
+ aInfo.SetPnt1(aP1);
+ aInfo.SetPnt2(aP2);
+ //
+ if (aNbV==1) {
+ aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED);
+ aInfo.SetKindOfName(GEOMAlgo_KN_ELLIPSE);
+ }
+ else {
+ aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED);
+ aInfo.SetKindOfName(GEOMAlgo_KN_ARCELLIPSE);
+ //
+ gp_Vec aVecX(aP, aP1);
+ gp_Dir aDirX(aVecX);
+ gp_Ax2 aAx2new(aP, aAx2.Direction(), aDirX);
+ aInfo.SetPosition(aAx2new);
+ }
+ }// else if (aCT==GeomAbs_Ellipse) {
+ //
+ FillSubShapes(aS);
+}
+//=======================================================================
+//function :FillVertex
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillVertex(const TopoDS_Shape& aS)
+{
+ myErrorStatus=0;
+ //
+ gp_Pnt aP;
+ TopoDS_Vertex aV;
+ //
+ if (myMapInfo.Contains(aS)) {
+ return;
+ }
+ else {
+ GEOMAlgo_ShapeInfo aInfoX;
+ myMapInfo.Add(aS, aInfoX);
+ }
+ GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
+ //
+ aV=TopoDS::Vertex(aS);
+ aP=BRep_Tool::Pnt(aV);
+ //
+ aInfo.SetType(TopAbs_VERTEX);
+ aInfo.SetLocation(aP);
+ myMapInfo.Add(aS, aInfo);
+}
+//=======================================================================
+//function : FillNbSubshapes
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillNbSubShapes(const TopoDS_Shape& aS,
+ GEOMAlgo_ShapeInfo& aInfo)
+{
+ myErrorStatus=0;
+ //
+ Standard_Integer i, aNb, aNbS;
+ TopTools_IndexedMapOfShape aM;
+ TopAbs_ShapeEnum aST;
+ TopAbs_ShapeEnum aTypes[]= {
+ //TopAbs_FACE, TopAbs_EDGE, TopAbs_VERTEX
+ TopAbs_COMPOUND,
+ TopAbs_COMPSOLID,
+ TopAbs_SOLID,
+ TopAbs_SHELL,
+ TopAbs_FACE,
+ TopAbs_WIRE,
+ TopAbs_EDGE,
+ TopAbs_VERTEX
+ };
+
+ //
+ aST=aS.ShapeType();
+ aNb=sizeof(aTypes)/sizeof(aTypes[0]);
+ for (i=0; i<aNb; ++i) {
+ if (aTypes[i]==aST) {
+ continue;
+ }
+ aM.Clear();
+ TopExp::MapShapes(aS, aTypes[i], aM);
+ aNbS=aM.Extent();
+ aInfo.SetNbSubShapes(aTypes[i], aNbS);
+ }
+}
+//=======================================================================
+//function :NbShells
+//purpose :
+//=======================================================================
+Standard_Integer NbShells(const TopoDS_Solid& aSd)
+{
+ Standard_Integer iCnt;
+ TopoDS_Iterator aIt;
+ //
+ iCnt=0;
+ //
+ aIt.Initialize(aSd);
+ for (; aIt.More(); aIt.Next()){
+ //const TopoDS_Shape& aSh=aIt.Value();
+ ++iCnt;
+ }
+ return iCnt;
+}
+//=======================================================================
+//function : NbWires
+//purpose :
+//=======================================================================
+Standard_Integer NbWires(const TopoDS_Face& aF)
+{
+ Standard_Integer iCnt;
+ TopoDS_Iterator aIt;
+ //
+ iCnt=0;
+ //
+ aIt.Initialize(aF);
+ for (; aIt.More(); aIt.Next()){
+ //const TopoDS_Shape& aW=aIt.Value();
+ ++iCnt;
+ }
+ return iCnt;
+}
+//=======================================================================
+//function : IsAllowedType
+//purpose :
+//=======================================================================
+Standard_Boolean IsAllowedType(const GeomAbs_CurveType aCT)
+{
+ Standard_Boolean bRet;
+ Standard_Integer i, aNb;
+ GeomAbs_CurveType aTypes[]={
+ GeomAbs_Line, GeomAbs_Circle, GeomAbs_Ellipse
+ };
+ //
+ bRet=Standard_False;
+ aNb=sizeof(aTypes)/sizeof(aTypes[0]);
+ for (i=0; i<aNb && !bRet; ++i) {
+ bRet=(aCT==aTypes[i]);
+ }
+ //
+ return bRet;
+}
+//=======================================================================
+//function : IsAllowedType
+//purpose :
+//=======================================================================
+Standard_Boolean IsAllowedType(const GeomAbs_SurfaceType aST)
+{
+ Standard_Boolean bRet;
+ Standard_Integer i, aNb;
+ GeomAbs_SurfaceType aTypes[]={
+ GeomAbs_Plane, GeomAbs_Cylinder,
+ GeomAbs_Cone, GeomAbs_Sphere,
+ GeomAbs_Torus
+ };
+ //
+ bRet=Standard_False;
+ aNb=sizeof(aTypes)/sizeof(aTypes[0]);
+ for (i=0; i<aNb && !bRet; ++i) {
+ bRet=(aST==aTypes[i]);
+ }
+ //
+ return bRet;
+}
+//
+// myErrorStatus
+//
+// 0 - Ok
+// 1 - The object is just initialized
+//
+// 10 - Null shape
+// 11 - circle/ellipse edge without vertices
--- /dev/null
+// File generated by CPPExt (Value)
+//
+// Copyright (C) 1991 - 2000 by
+// Matra Datavision SA. All rights reserved.
+//
+// Copyright (C) 2001 - 2004 by
+// Open CASCADE SA. All rights reserved.
+//
+// This file is part of the Open CASCADE Technology software.
+//
+// This software may be distributed and/or modified under the terms and
+// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
+// and appearing in the file LICENSE included in the packaging of this file.
+//
+// This software is distributed on an "AS IS" basis, without warranty of any
+// kind, and Open CASCADE SA hereby disclaims all such warranties,
+// including without limitation, any warranties of merchantability, fitness
+// for a particular purpose or non-infringement. Please see the License for
+// the specific terms and conditions governing rights and limitations under the
+// License.
+
+#ifndef _GEOMAlgo_ShapeInfoFiller_HeaderFile
+#define _GEOMAlgo_ShapeInfoFiller_HeaderFile
+
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _GEOMAlgo_ShapeInfo_HeaderFile
+#include <GEOMAlgo_ShapeInfo.hxx>
+#endif
+#ifndef _GEOMAlgo_IndexedDataMapOfShapeShapeInfo_HeaderFile
+#include <GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx>
+#endif
+#ifndef _Standard_Real_HeaderFile
+#include <Standard_Real.hxx>
+#endif
+#ifndef _GEOMAlgo_Algo_HeaderFile
+#include <GEOMAlgo_Algo.hxx>
+#endif
+class TopoDS_Shape;
+class GEOMAlgo_ShapeInfo;
+class TopoDS_Face;
+class gp_Pln;
+class gp_Sphere;
+class gp_Cylinder;
+class gp_Cone;
+class gp_Torus;
+class TopoDS_Solid;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class GEOMAlgo_ShapeInfoFiller : public GEOMAlgo_Algo {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT GEOMAlgo_ShapeInfoFiller();
+Standard_EXPORT virtual ~GEOMAlgo_ShapeInfoFiller();
+
+
+Standard_EXPORT void SetShape(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT const TopoDS_Shape& Shape() const;
+
+
+Standard_EXPORT void SetTolerance(const Standard_Real aT) ;
+
+
+Standard_EXPORT Standard_Real Tolerance() const;
+
+
+Standard_EXPORT const GEOMAlgo_ShapeInfo& Info() const;
+
+
+Standard_EXPORT const GEOMAlgo_ShapeInfo& Info(const TopoDS_Shape& aS) const;
+
+
+Standard_EXPORT virtual void Perform() ;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+Standard_EXPORT virtual void CheckData() ;
+
+
+Standard_EXPORT void FillNbSubShapes(const TopoDS_Shape& aS,GEOMAlgo_ShapeInfo& aInfo) ;
+
+
+Standard_EXPORT void FillSubShapes(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT void FillShape(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT void FillVertex(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT void FillEdge(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT void FillFace(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT void FillSolid(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT void FillContainer(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT void FillDetails(const TopoDS_Face& aF,const gp_Pln& aPln) ;
+
+
+Standard_EXPORT void FillDetails(const TopoDS_Face& aF,const gp_Sphere& aSph) ;
+
+
+Standard_EXPORT void FillDetails(const TopoDS_Face& aF,const gp_Cylinder& aCyl) ;
+
+
+Standard_EXPORT void FillDetails(const TopoDS_Face& aF,const gp_Cone& aCone) ;
+
+
+Standard_EXPORT void FillDetails(const TopoDS_Face& aF,const gp_Torus& aTorus) ;
+
+
+Standard_EXPORT void FillDetails(const TopoDS_Solid& aS) ;
+
+
+ // Fields PROTECTED
+ //
+TopoDS_Shape myShape;
+GEOMAlgo_ShapeInfo myEmptyInfo;
+GEOMAlgo_IndexedDataMapOfShapeShapeInfo myMapInfo;
+Standard_Real myTolerance;
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// File generated by CPPExt (Value)
+//
+// Copyright (C) 1991 - 2000 by
+// Matra Datavision SA. All rights reserved.
+//
+// Copyright (C) 2001 - 2004 by
+// Open CASCADE SA. All rights reserved.
+//
+// This file is part of the Open CASCADE Technology software.
+//
+// This software may be distributed and/or modified under the terms and
+// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
+// and appearing in the file LICENSE included in the packaging of this file.
+//
+// This software is distributed on an "AS IS" basis, without warranty of any
+// kind, and Open CASCADE SA hereby disclaims all such warranties,
+// including without limitation, any warranties of merchantability, fitness
+// for a particular purpose or non-infringement. Please see the License for
+// the specific terms and conditions governing rights and limitations under the
+// License.
+
+#include <GEOMAlgo_ShapeInfoFiller.jxx>
+
+
+
+
--- /dev/null
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _GEOMAlgo_ShapeInfo_HeaderFile
+#include <GEOMAlgo_ShapeInfo.hxx>
+#endif
+#ifndef _TopoDS_Face_HeaderFile
+#include <TopoDS_Face.hxx>
+#endif
+#ifndef _gp_Pln_HeaderFile
+#include <gp_Pln.hxx>
+#endif
+#ifndef _gp_Sphere_HeaderFile
+#include <gp_Sphere.hxx>
+#endif
+#ifndef _gp_Cylinder_HeaderFile
+#include <gp_Cylinder.hxx>
+#endif
+#ifndef _gp_Cone_HeaderFile
+#include <gp_Cone.hxx>
+#endif
+#ifndef _gp_Torus_HeaderFile
+#include <gp_Torus.hxx>
+#endif
+#ifndef _TopoDS_Solid_HeaderFile
+#include <TopoDS_Solid.hxx>
+#endif
+#ifndef _GEOMAlgo_ShapeInfoFiller_HeaderFile
+#include <GEOMAlgo_ShapeInfoFiller.hxx>
+#endif
--- /dev/null
+#include <GEOMAlgo_ShapeInfoFiller.ixx>
+
+#include <Precision.hxx>
+
+#include <gp_Lin.hxx>
+#include <gp_XYZ.hxx>
+#include <gp_Ax1.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Vec.hxx>
+#include <gp_Ax2.hxx>
+#include <gp_Ax3.hxx>
+
+#include <ElCLib.hxx>
+
+#include <TopoDS.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Wire.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Iterator.hxx>
+
+#include <BRep_Tool.hxx>
+
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+
+#include <TopTools_MapOfShape.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <BRepTools_WireExplorer.hxx>
+
+#include <GEOMAlgo_ShapeInfo.hxx>
+#include <TColStd_MapOfInteger.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
+
+//=======================================================================
+//function : FillDetails
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
+{
+ Standard_Integer i, aNbF, aNbCyl, aNbCon, aNbPgn, aNbRct, aNbCrc, aNbX;
+ TopoDS_Shape aFCyl, aFCon;
+ TopTools_IndexedMapOfShape aMF;
+ GEOMAlgo_KindOfName aKNF;
+ //
+ GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aSd);
+ aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
+ //
+ TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
+ //
+ aNbF=aMF.Extent();
+ if (!aNbF) {
+ return;
+ }
+ //
+ if (aNbF==1) {
+ const TopoDS_Shape& aF=aMF(1);
+ GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aF);
+ aKNF=aInfoF.KindOfName(); // mb: sphere, torus
+ if (aKNF==GEOMAlgo_KN_SPHERE ||
+ aKNF==GEOMAlgo_KN_TORUS) {
+ aInfo.SetKindOfName(aKNF);
+ aInfo.SetLocation(aInfoF.Location());
+ aInfo.SetPosition(aInfoF.Position());
+ aInfo.SetRadius1(aInfoF.Radius1());
+ if(aKNF==GEOMAlgo_KN_TORUS) {
+ aInfo.SetRadius2(aInfoF.Radius2());
+ }
+ return;
+ }
+ }
+ //
+ aNbCyl=0;
+ aNbCon=0;
+ aNbPgn=0;
+ aNbRct=0;
+ aNbCrc=0;
+ for (i=1; i<=aNbF; ++i) {
+ const TopoDS_Shape& aF=aMF(i);
+ GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aF);
+ aKNF=aInfoF.KindOfName();
+ if (aKNF==GEOMAlgo_KN_CYLINDER) {
+ aFCyl=aF;
+ ++aNbCyl;
+ }
+ else if (aKNF==GEOMAlgo_KN_CONE) {
+ aFCon=aF;
+ ++aNbCon;
+ }
+ else if (aKNF==GEOMAlgo_KN_DISKCIRCLE) {
+ ++aNbCrc;
+ }
+ else if (aKNF==GEOMAlgo_KN_POLYGON ||
+ aKNF==GEOMAlgo_KN_TRIANGLE ||
+ aKNF==GEOMAlgo_KN_QUADRANGLE) {
+ ++aNbPgn;
+
+ }
+ else if (aKNF==GEOMAlgo_KN_RECTANGLE) {
+ ++aNbPgn;
+ ++aNbRct;
+ }
+ }
+ //
+ aNbX=aNbCyl+aNbCrc;
+ if (aNbCyl==1 && aNbCrc==2 && aNbX==aNbF) {
+ // cylinder (as they understand it)
+ GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aFCyl);
+ aKNF=aInfoF.KindOfName();
+ aInfo.SetKindOfName(aKNF);
+ aInfo.SetLocation(aInfoF.Location());
+ aInfo.SetPosition(aInfoF.Position());
+ aInfo.SetRadius1(aInfoF.Radius1());
+ aInfo.SetHeight(aInfoF.Height());
+ return;
+ }
+ //
+ aNbX=aNbCon+aNbCrc;
+ if (aNbCon==1 && (aNbCrc==1 || aNbCrc==2) && aNbX==aNbF) {
+ // cone
+ GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aFCon);
+ aKNF=aInfoF.KindOfName();
+ aInfo.SetKindOfName(aKNF);
+ aInfo.SetLocation(aInfoF.Location());
+ aInfo.SetPosition(aInfoF.Position());
+ aInfo.SetRadius1(aInfoF.Radius1());
+ aInfo.SetRadius2(aInfoF.Radius2());
+ aInfo.SetHeight(aInfoF.Height());
+ return;
+ }
+ //
+ if (aNbPgn!=6) {
+ aInfo.SetKindOfName(GEOMAlgo_KN_POLYHEDRON);
+ return;
+ }
+ if (aNbPgn!=aNbRct) {
+ aInfo.SetKindOfName(GEOMAlgo_KN_POLYHEDRON);
+ return;
+ }
+ //===================================================
+ // aNbRct=6;
+ // box
+ Standard_Integer j, aNbFi, aNbV, iMax, iMin, iMid;
+ Standard_Real aDot, aLength, aWidth, aHeight, aDist[3];
+ Standard_Real aDistMin, aDistMax;
+ gp_Pnt aPi, aPc;
+ gp_Dir aDir[3];
+ gp_XYZ aXYZc;
+ TColStd_IndexedMapOfInteger aMp;
+ TopTools_IndexedMapOfShape aMV, aMFi;
+ //
+ // barycenter aPc
+ TopExp::MapShapes(aSd, TopAbs_VERTEX, aMV);
+ aNbV=aMV.Extent();
+ if (aNbV!=8) {
+ return;
+ }
+ //
+ aXYZc.SetCoord(0.,0.,0.);
+ for (i=1; i<=aNbV; ++i) {
+ const TopoDS_Vertex& aVi=TopoDS::Vertex(aMV(i));
+ aPi=BRep_Tool::Pnt(aVi);
+ const gp_XYZ& aXYZ=aPi.XYZ();
+ aXYZc=aXYZc+aXYZ;
+ }
+ //
+ aXYZc.Divide(aNbV);
+ aPc.SetXYZ(aXYZc);
+ //
+ // 3 faces
+ for (i=1; i<=aNbF; ++i) {
+ if (aMp.Contains(i)) {
+ continue;
+ }
+ //
+ const TopoDS_Shape& aFi=aMF(i);
+ const GEOMAlgo_ShapeInfo& aIFi=myMapInfo.FindFromKey(aFi);
+ const gp_Dir& aDNi=aIFi.Position().Direction();
+ //
+ for (j=i+1; j<=aNbF; ++j) {
+ if (aMp.Contains(j)) {
+ continue;
+ }
+ //
+ const TopoDS_Shape& aFj=aMF(j);
+ const GEOMAlgo_ShapeInfo& aIFj=myMapInfo.FindFromKey(aFj);
+ const gp_Dir& aDNj=aIFj.Position().Direction();
+ //
+ aDot=aDNi*aDNj;
+ if (fabs(1.-aDot)<0.0001) {
+ aMp.Add(i);
+ aMp.Add(j);
+ aMFi.Add(aFi);
+ break;
+ }
+ //
+ }
+ }
+ aNbFi=aMFi.Extent();
+ if (aNbFi!=3) {
+ return;
+ }
+ //
+ aDistMin=1.e15;
+ aDistMax=-aDistMin;
+ for (i=0; i<aNbFi; ++i) {
+ const TopoDS_Shape& aFi=aMFi(i+1);
+ const GEOMAlgo_ShapeInfo& aIFi=myMapInfo.FindFromKey(aFi);
+ aPi=aIFi.Location();
+ aDist[i]=aPc.Distance(aPi);
+ if (aDist[i]>aDistMax) {
+ aDistMax=aDist[i];
+ iMax=i;
+ }
+ if (aDist[i]<aDistMin) {
+ aDistMin=aDist[i];
+ iMin=i;
+ }
+ gp_Vec aVi(aPc, aPi);
+ gp_Dir aDi(aVi);
+ aDir[i]=aDi;
+ }
+ //
+ if (iMax==iMin) {
+ iMax=0;
+ iMin=1;
+ }
+ iMid=3-iMax-iMin;
+ //
+ aLength=2.*aDist[iMax];
+ aWidth=2.*aDist[iMid];
+ aHeight=2.*aDist[iMin];
+ //
+ gp_Ax2 aAx2(aPc, aDir[iMin], aDir[iMax]);
+ gp_Ax3 aAx3(aAx2);
+ //
+ aInfo.SetKindOfName(GEOMAlgo_KN_BOX);
+ aInfo.SetLocation(aPc);
+ aInfo.SetLength(aLength);
+ aInfo.SetWidth(aWidth);
+ aInfo.SetHeight(aHeight);
+ aInfo.SetPosition(aAx3);
+}
+//=======================================================================
+//function : FillDetails
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
+ const gp_Pln& aPln)
+{
+ Standard_Integer aNbV, aNbE, i, j;
+ Standard_Real aDot, aD0, aD1, aLength, aWidth;
+ gp_Dir aDx[4], aDX;
+ gp_Pnt aPx[4], aP, aPc;
+ gp_XYZ aXYZc;
+ TopExp_Explorer aExp;
+ TopoDS_Shape aE;
+ TopoDS_Wire aW;
+ TopoDS_Edge aEx;
+ TopoDS_Iterator aIt;
+ TopTools_IndexedMapOfShape aMV;
+ BRepTools_WireExplorer aWExp;
+ GEOMAlgo_KindOfName aKN, aKNE;
+ GEOMAlgo_KindOfShape aKS;
+ //
+ GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
+ aKN=GEOMAlgo_KN_UNKNOWN;
+ aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
+ //
+ aKS=aInfo.KindOfShape();
+ if (aKS!=GEOMAlgo_KS_PLANE) {
+ return;
+ }
+ //
+ if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
+ aInfo.SetKindOfName(GEOMAlgo_KN_PLANE);
+ return;
+ }
+ //
+ aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
+ aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
+ //
+ // 1. may be it is circle/ellipse
+ if (aNbV==1 && aNbE==1) {
+ aExp.Init(aF, TopAbs_EDGE);
+ for (; aExp.More(); aExp.Next()) {
+ aE=aExp.Current();
+ break;
+ }
+ //
+ const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+ aKNE=aInfoE.KindOfName();
+ if (aKNE==GEOMAlgo_KN_CIRCLE) {
+ aKN=GEOMAlgo_KN_DISKCIRCLE;
+ aInfo.SetKindOfName(aKN);
+ aInfo.SetRadius1(aInfoE.Radius1());
+ aInfo.SetLocation(aInfoE.Location());
+ aInfo.SetPosition(aInfoE.Position());
+ }
+ if (aKNE==GEOMAlgo_KN_ELLIPSE) {
+ aKN=GEOMAlgo_KN_DISKELLIPSE;
+ aInfo.SetKindOfName(aKN);
+ aInfo.SetRadius1(aInfoE.Radius1());
+ aInfo.SetRadius2(aInfoE.Radius2());
+ aInfo.SetLocation(aInfoE.Location());
+ aInfo.SetPosition(aInfoE.Position());
+ }
+ }
+ //
+ // 2. may be it is rectangle
+ else {
+ aExp.Init(aF, TopAbs_EDGE);
+ for (; aExp.More(); aExp.Next()) {
+ aE=aExp.Current();
+ const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+ aKNE=aInfoE.KindOfName();
+ if (aKNE!=GEOMAlgo_KN_SEGMENT) {
+ return;
+ }
+ }
+ //
+ aInfo.SetKindOfName(GEOMAlgo_KN_POLYGON);
+ //
+ if (aNbV==3 && aNbE==3) {
+ aInfo.SetKindOfName(GEOMAlgo_KN_TRIANGLE);
+ //
+ aXYZc.SetCoord(0.,0.,0.);
+ TopExp::MapShapes(aF, TopAbs_VERTEX, aMV);
+ for (i=1; i<=aNbV; ++i) {
+ const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i));
+ aP=BRep_Tool::Pnt(aV);
+ const gp_XYZ& aXYZ=aP.XYZ();
+ aXYZc=aXYZc+aXYZ;
+ aPx[i-1]=aP;
+ }
+ aXYZc.Divide(3.);
+ //
+ aPc.SetXYZ(aXYZc);
+ gp_Vec aVX(aPc, aPx[0]);
+ aVX.Normalize();
+ aDX.SetXYZ(aVX.XYZ());
+ const gp_Dir& aDZ=aPln.Axis().Direction();
+ //
+ gp_Ax2 aAx2(aPc, aDZ, aDX);
+ gp_Ax3 aAx3(aAx2);
+ //
+ aInfo.SetLocation(aPc);
+ aInfo.SetPosition(aAx3);
+ //
+ return;
+ }
+ //
+ if (!(aNbV==4 && aNbE==4)) {
+ return;
+ }
+ //
+ // aNbV==4 && aNbE==4 and all edges are segments
+ aIt.Initialize(aF);
+ for (; aIt.More(); aIt.Next()){
+ aW=TopoDS::Wire(aIt.Value());
+ break;
+ }
+ //
+ aWExp.Init(aW, aF);
+ for (i=0; aWExp.More(); aWExp.Next(), ++i) {
+ aEx=aWExp.Current();
+ const GEOMAlgo_ShapeInfo& aInfoEx=myMapInfo.FindFromKey(aEx);
+ aDx[i]=aInfoEx.Direction();
+ aPx[i]=aInfoEx.Location();
+ }
+ //
+ for (i=0; i<4; ++i) {
+ j=(i==3) ? 0 : i+1;
+ aDot=aDx[i]*aDx[j];
+ if (fabs (aDot) > myTolerance) {
+ aInfo.SetKindOfName(GEOMAlgo_KN_QUADRANGLE);
+ return;
+ }
+ }
+ //
+ // rectangle
+ aInfo.SetKindOfName(GEOMAlgo_KN_RECTANGLE);
+ //
+ // shift location to the center and calc. sizes
+ aXYZc.SetCoord(0.,0.,0.);
+ TopExp::MapShapes(aF, TopAbs_VERTEX, aMV);
+ for (i=1; i<=aNbV; ++i) {
+ const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i));
+ aP=BRep_Tool::Pnt(aV);
+ const gp_XYZ& aXYZ=aP.XYZ();
+ aXYZc=aXYZc+aXYZ;
+ }
+ //
+ // Location : aPc in center of rectangle
+ // Position : 0z is plane normal
+ // 0x is along length
+ //
+ aXYZc.Divide(4.);
+ aPc.SetXYZ(aXYZc);
+ //
+ gp_Lin aL0(aPx[0], aDx[0]);
+ gp_Lin aL1(aPx[1], aDx[1]);
+ //
+ aD0=aL0.Distance(aPc);
+ aD1=aL1.Distance(aPc);
+ //
+ aLength=aD0;
+ aWidth =aD1;
+ aDX=aL1.Direction();
+ if (aD0<aD1) {
+ aLength=aD1;
+ aWidth =aD0;
+ aDX=aL0.Direction();
+ }
+ //
+ aLength=2.*aLength;
+ aWidth =2.*aWidth;
+ //
+ aInfo.SetLocation(aPc);
+ aInfo.SetLength(aLength);
+ aInfo.SetWidth(aWidth);
+ //
+ const gp_Dir& aDZ=aPln.Axis().Direction();
+ gp_Ax2 aAx2(aPc, aDZ, aDX);
+ gp_Ax3 aAx3(aAx2);
+ aInfo.SetPosition(aAx3);
+ }
+
+ return;
+}
+//=======================================================================
+//function : FillDetails
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
+ const gp_Sphere& )
+{
+ Standard_Integer aNbV, aNbE, aNbSE, aNbDE;
+ TopoDS_Edge aE;
+ TopExp_Explorer aExp;
+ TopTools_MapOfShape aM;
+ GEOMAlgo_KindOfShape aKS, aKSE;
+ //
+ GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
+ aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
+ //
+ aKS=aInfo.KindOfShape();
+ if (aKS!=GEOMAlgo_KS_SPHERE) {
+ return;
+ }
+ //
+ aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
+ aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
+ if (!(aNbV==2 && aNbE==3)) {
+ return;
+ }
+ //
+ aNbSE=0;
+ aNbDE=0;
+ aExp.Init(aF, TopAbs_EDGE);
+ for (; aExp.More(); aExp.Next()) {
+ aE=TopoDS::Edge(aExp.Current());
+ if(aM.Add(aE)) {
+ const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+ aKSE=aInfoE.KindOfShape();
+ //
+ if (BRep_Tool::IsClosed(aE, aF)) {
+ ++aNbSE;
+ }
+ else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
+ ++aNbDE;
+ }
+ }
+ }
+ //
+ if (!(aNbSE==1 && aNbDE==2)) {
+ return;
+ }
+ aInfo.SetKindOfName(GEOMAlgo_KN_SPHERE);
+}
+//=======================================================================
+//function : FillDetails
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
+ const gp_Cone& )//aCone)
+{
+ Standard_Integer aNbV, aNbE, aNbCE, aNbSE, aNbDE, i;
+ Standard_Real aR[3], aHeight;
+ gp_Pnt aPC[3], aPD, aPc, aPX[3];
+ TopoDS_Vertex aVD;
+ TopoDS_Edge aE;
+ TopoDS_Iterator aIt;
+ TopExp_Explorer aExp;
+ TopTools_MapOfShape aM;
+ GEOMAlgo_KindOfShape aKS, aKSE;
+ GEOMAlgo_KindOfName aKN, aKNE;
+ GEOMAlgo_KindOfClosed aKCE;
+ //
+ GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
+ aKN=GEOMAlgo_KN_UNKNOWN;
+ aInfo.SetKindOfName(aKN);
+ //
+ aKS=aInfo.KindOfShape();
+ if (aKS!=GEOMAlgo_KS_CONE) {
+ return;
+ }
+ //
+ if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
+ return;
+ }
+ //
+ aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
+ aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
+ if (!(aNbV==2 && aNbE==3)) {
+ return;
+ }
+ //
+ i=0;
+ aNbCE=0;
+ aNbSE=0;
+ aNbDE=0;
+ aExp.Init(aF, TopAbs_EDGE);
+ for (; aExp.More(); aExp.Next()) {
+ aE=TopoDS::Edge(aExp.Current());
+ if(aM.Add(aE)) {
+ const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+ aKNE=aInfoE.KindOfName();
+ aKCE=aInfoE.KindOfClosed();
+ aKSE=aInfoE.KindOfShape();
+ if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
+ aPC[i]=aInfoE.Location();
+ aR[i]=aInfoE.Radius1();
+ //
+ aIt.Initialize(aE);
+ for (; aIt.More(); aIt.Next()) {
+ aVD=TopoDS::Vertex(aIt.Value());
+ break;
+ }
+ aPX[i]=BRep_Tool::Pnt(aVD);
+ //
+ ++i;
+ ++aNbCE;
+ }
+ else if (aKNE==GEOMAlgo_KN_SEGMENT) {
+ if (BRep_Tool::IsClosed(aE, aF)) {
+ ++aNbSE;
+ }
+ }
+ else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
+ aIt.Initialize(aE);
+ for (; aIt.More(); aIt.Next()) {
+ aVD=TopoDS::Vertex(aIt.Value());
+ break;
+ }
+ //
+ aPD=BRep_Tool::Pnt(aVD);
+ //
+ ++aNbDE;
+ }
+ }
+ }
+ //
+ if (!((aNbCE==2 || (aNbCE==1 && aNbDE==1)) && aNbSE==1)) {
+ return;
+ }
+ //
+ if (aNbDE==1) {
+ aPC[1]=aPD;
+ aR[1]=0.;
+ }
+ //
+ aHeight=aPC[0].Distance(aPC[1]);
+ //
+ Standard_Real aRmin, aRmax;
+ gp_Ax2 aAx2new;
+ //
+ if (aR[0]>aR[1]) {
+ aRmin=aR[1];
+ aRmax=aR[0];
+ aPc=aPC[0];
+ gp_Vec aVz(aPC[0], aPC[1]);
+ gp_Vec aVx(aPC[0], aPX[0]);
+ gp_Dir aDz(aVz);
+ gp_Dir aDx(aVx);
+ gp_Ax2 aAx2(aPc, aDz, aDx);
+ aAx2new=aAx2;
+ }
+ else {
+ aRmin=aR[0];
+ aRmax=aR[1];
+ aPc=aPC[1];
+ gp_Vec aVz(aPC[1], aPC[0]);
+ gp_Vec aVx(aPC[1], aPX[1]);
+ gp_Dir aDz(aVz);
+ gp_Dir aDx(aVx);
+ gp_Ax2 aAx2(aPc, aDz, aDx);
+ aAx2new=aAx2;
+ }
+ //
+ gp_Ax3 aAx3(aAx2new);
+ aInfo.SetLocation(aPc);
+ aInfo.SetPosition(aAx3);
+ aInfo.SetRadius1(aRmax);
+ aInfo.SetRadius2(aRmin);
+ aInfo.SetHeight(aHeight);
+ //
+ aInfo.SetKindOfName(GEOMAlgo_KN_CONE);
+}
+//=======================================================================
+//function : FillDetails
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
+ const gp_Cylinder& aCyl)
+{
+ Standard_Integer i, aNbV, aNbE, aNbCE, aNbSE;
+ Standard_Real aT0, aT1, aHeight;
+ gp_Pnt aPC[3], aPc;
+ TopoDS_Edge aE;
+ TopExp_Explorer aExp;
+ TopTools_MapOfShape aM;
+ GEOMAlgo_KindOfShape aKS;
+ GEOMAlgo_KindOfName aKN, aKNE;
+ GEOMAlgo_KindOfClosed aKCE;
+ //
+ GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
+ aKN=GEOMAlgo_KN_UNKNOWN;
+ aInfo.SetKindOfName(aKN);
+ //
+ aKS=aInfo.KindOfShape();
+ if (aKS!=GEOMAlgo_KS_CYLINDER) {
+ return;
+ }
+ //
+ if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
+ return;
+ }
+ //
+ aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
+ aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
+ if (!(aNbV==2 && aNbE==3)) {
+ return;
+ }
+ //
+ i=0;
+ aNbCE=0;
+ aNbSE=0;
+ aExp.Init(aF, TopAbs_EDGE);
+ for (; aExp.More(); aExp.Next()) {
+ aE=TopoDS::Edge(aExp.Current());
+ if(aM.Add(aE)) {
+ const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+ aKNE=aInfoE.KindOfName();
+ aKCE=aInfoE.KindOfClosed();
+ if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
+ aPC[aNbCE]=aInfoE.Location();
+ ++aNbCE;
+ }
+ else if (aKNE==GEOMAlgo_KN_SEGMENT) {
+ if (BRep_Tool::IsClosed(aE, aF)) {
+ ++aNbSE;
+ }
+ }
+ }
+ }
+ //
+ if (!(aNbCE==2 && aNbSE==1)) {
+ return;
+ }
+ //
+ const gp_Ax1& aAx1=aCyl.Axis();
+ const gp_Dir& aDir=aAx1.Direction();
+ const gp_Pnt& aPLoc=aAx1.Location();
+ gp_Lin aLin(aPLoc, aDir);
+ //
+ aT0=ElCLib::Parameter(aLin, aPC[0]);
+ aT1=ElCLib::Parameter(aLin, aPC[1]);
+ //
+ aPc=aPC[0];;
+ if (aT0>aT1) {
+ aPc=aPC[1];
+ }
+ aHeight=aPC[0].Distance(aPC[1]);
+ //
+ gp_Ax3 aAx3=aCyl.Position();
+ aAx3.SetLocation(aPc);
+ //
+ aInfo.SetKindOfName(GEOMAlgo_KN_CYLINDER);
+ aInfo.SetPosition(aAx3);
+ aInfo.SetLocation(aPc);
+ aInfo.SetHeight(aHeight);
+}
+
+//=======================================================================
+//function : FillDetails
+//purpose :
+//=======================================================================
+ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
+ const gp_Torus& )
+{
+ Standard_Integer aNbV, aNbE, aNbSE;
+ TopoDS_Edge aE;
+ TopExp_Explorer aExp;
+ TopTools_MapOfShape aM;
+ GEOMAlgo_KindOfShape aKS;
+ //
+ GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
+ aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
+ //
+ aKS=aInfo.KindOfShape();
+ if (aKS!=GEOMAlgo_KS_TORUS) {
+ return;
+ }
+ //
+ aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
+ aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
+ if (!(aNbV==1 && aNbE==2)) {
+ return;
+ }
+ //
+ aNbSE=0;
+ aExp.Init(aF, TopAbs_EDGE);
+ for (; aExp.More(); aExp.Next()) {
+ aE=TopoDS::Edge(aExp.Current());
+ if (aM.Add(aE)) {
+ //const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+ if (BRep_Tool::IsClosed(aE, aF)) {
+ ++aNbSE;
+ }
+ }
+ }
+ //
+ if (aNbSE!=2) {
+ return;
+ }
+ aInfo.SetKindOfName(GEOMAlgo_KN_TORUS);
+}
//=======================================================================
void GEOMAlgo_WESCorrector::DoConnexityBlocks()
{
- Standard_Boolean bRegular;
+ Standard_Boolean bRegular, bClosed;
Standard_Integer i, aNbV, j, aNbC, aNbVP, aNbVS;
TopTools_ListIteratorOfListOfShape aIt;
TopoDS_Iterator aItE;
aER=aMEC(j);
//
if (aMER.Contains(aER)) {
- Standard_Boolean bClosed;
- //
aER.Orientation(TopAbs_FORWARD);
aLEC.Append(aER);
aER.Orientation(TopAbs_REVERSED);
aLEC.Append(aER);
//
- bClosed=BRep_Tool::IsClosed(TopoDS::Edge(aER), myWES->Face());
- if (!bClosed) {
+ //modified by NIZNHY-PKV Tue Nov 28 12:02:29 2006f
+ //bClosed=BRep_Tool::IsClosed(TopoDS::Edge(aER), myWES->Face());
+ //if (!bClosed) {
bRegular=Standard_False;
- }
+ //}
+ //modified by NIZNHY-PKV Tue Nov 28 12:02:33 2006t
}
else {
aLEC.Append(aER);
//
aNbVR=aMVER.Extent();
for (k=1; k<=aNbVR; ++k) {
- const TopTools_ListOfShape& aLER=aMVER(k);//?? it was aMVE(k)
+ const TopTools_ListOfShape& aLER=aMVER(k);
aNbER=aLER.Extent();
if (aNbER==1) {
const TopoDS_Edge& aEx=TopoDS::Edge(aER);
- if (!BRep_Tool::IsClosed(aEx, myWES->Face())) {
+ bClosed=BRep_Tool::IsClosed(aEx, myWES->Face());
+ if (!bClosed) {
bRegular=!bRegular;
break;
}
aTol=2.*Tolerance2D(aVb, aGAS);
aTol2=aTol*aTol;
//
- //modified by NIZNHY-PKV Tue Nov 14 16:56:19 2006f
- /*
- UVTolerance2D(aVb, aGAS, aTolUVb, aTolVVb);
- aTolUVb = 2.*aTolUVb;
- aTolVVb = 2.*aTolVVb;
- */
- //modified by NIZNHY-PKV Tue Nov 14 16:56:26 2006t
- //
aNb=aLS.Length();
if (aNb>0) {
//
//
aD2=aPaPrev.SquareDistance(aPb);
anIsSameV2d =aD2<aTol2;
- //
- //modified by NIZNHY-PKV Tue Nov 14 16:56:49 2006f
- /*
- if(anIsSameV2d) {
- Standard_Real udist, vdist;
- //
- udist=fabs(aPaPrev.X() - aPb.X());
- vdist=fabs(aPaPrev.Y() - aPb.Y());
- if((udist > aTolUVb) || (vdist > aTolVVb)) {
- anIsSameV2d=!anIsSameV2d;
- }
- }
- */
- //modified by NIZNHY-PKV Tue Nov 14 16:56:54 2006t
}//if (anIsSameV) {
//
if (anIsSameV && anIsSameV2d) {
aTol2D=(aVr>anUr) ? aVr : anUr;
//
if (aType==GeomAbs_BSplineSurface||
- aType==GeomAbs_Sphere) {
+ aType==GeomAbs_Sphere||
+ //modified by NIZNHY-PKV Wed Nov 29 10:18:50 2006f
+ GeomAbs_SurfaceOfRevolution) {
+ //modified by NIZNHY-PKV Wed Nov 29 10:18:55 2006t
if (aTol2D < aTolV3D) {
aTol2D=aTolV3D;
}
}
return iCnt;
}
-//modified by NIZNHY-PKV Tue Nov 14 16:55:31 2006f
-/*
-static
- void UVTolerance2D (const TopoDS_Vertex& aV,
- const GeomAdaptor_Surface& aGAS,
- Standard_Real& aTolU,
- Standard_Real& aTolV);
-*/
-/*
-//=======================================================================
-//function : UVTolerance2D
-//purpose :
-//=======================================================================
-void UVTolerance2D (const TopoDS_Vertex& aV,
- const GeomAdaptor_Surface& aGAS,
- Standard_Real& aTolU,
- Standard_Real& aTolV)
-{
- Standard_Real aTolV3D;
- //
- aTolV3D = BRep_Tool::Tolerance(aV);
- aTolU=aGAS.UResolution(aTolV3D);
- aTolV=aGAS.VResolution(aTolV3D);
-}
-*/
-//modified by NIZNHY-PKV Tue Nov 14 16:55:39 2006
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _Handle_GEOMAlgo_ClsfSolid_HeaderFile
+#define _Handle_GEOMAlgo_ClsfSolid_HeaderFile
+
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+
+#ifndef _Handle_GEOMAlgo_Clsf_HeaderFile
+#include <Handle_GEOMAlgo_Clsf.hxx>
+#endif
+
+class Standard_Transient;
+class Handle_Standard_Type;
+class Handle(GEOMAlgo_Clsf);
+class GEOMAlgo_ClsfSolid;
+Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMAlgo_ClsfSolid);
+
+class Handle(GEOMAlgo_ClsfSolid) : public Handle(GEOMAlgo_Clsf) {
+ public:
+ Handle(GEOMAlgo_ClsfSolid)():Handle(GEOMAlgo_Clsf)() {}
+ Handle(GEOMAlgo_ClsfSolid)(const Handle(GEOMAlgo_ClsfSolid)& aHandle) : Handle(GEOMAlgo_Clsf)(aHandle)
+ {
+ }
+
+ Handle(GEOMAlgo_ClsfSolid)(const GEOMAlgo_ClsfSolid* anItem) : Handle(GEOMAlgo_Clsf)((GEOMAlgo_Clsf *)anItem)
+ {
+ }
+
+ Handle(GEOMAlgo_ClsfSolid)& operator=(const Handle(GEOMAlgo_ClsfSolid)& aHandle)
+ {
+ Assign(aHandle.Access());
+ return *this;
+ }
+
+ Handle(GEOMAlgo_ClsfSolid)& operator=(const GEOMAlgo_ClsfSolid* anItem)
+ {
+ Assign((Standard_Transient *)anItem);
+ return *this;
+ }
+
+ GEOMAlgo_ClsfSolid* operator->() const
+ {
+ return (GEOMAlgo_ClsfSolid *)ControlAccess();
+ }
+
+// Standard_EXPORT ~Handle(GEOMAlgo_ClsfSolid)();
+
+ Standard_EXPORT static const Handle(GEOMAlgo_ClsfSolid) DownCast(const Handle(Standard_Transient)& AnObject);
+};
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_HeaderFile
+#define _Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_HeaderFile
+
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+
+#ifndef _Handle_TCollection_MapNode_HeaderFile
+#include <Handle_TCollection_MapNode.hxx>
+#endif
+
+class Standard_Transient;
+class Handle_Standard_Type;
+class Handle(TCollection_MapNode);
+class GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape;
+Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape);
+
+class Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape) : public Handle(TCollection_MapNode) {
+ public:
+ Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape)():Handle(TCollection_MapNode)() {}
+ Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape)(const Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape)& aHandle) : Handle(TCollection_MapNode)(aHandle)
+ {
+ }
+
+ Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape)(const GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem)
+ {
+ }
+
+ Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape)& operator=(const Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape)& aHandle)
+ {
+ Assign(aHandle.Access());
+ return *this;
+ }
+
+ Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape)& operator=(const GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape* anItem)
+ {
+ Assign((Standard_Transient *)anItem);
+ return *this;
+ }
+
+ GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape* operator->() const
+ {
+ return (GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape *)ControlAccess();
+ }
+
+// Standard_EXPORT ~Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape)();
+
+ Standard_EXPORT static const Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape) DownCast(const Handle(Standard_Transient)& AnObject);
+};
+#endif
--- /dev/null
+// File generated by CPPExt (Transient)
+//
+// Copyright (C) 1991 - 2000 by
+// Matra Datavision SA. All rights reserved.
+//
+// Copyright (C) 2001 - 2004 by
+// Open CASCADE SA. All rights reserved.
+//
+// This file is part of the Open CASCADE Technology software.
+//
+// This software may be distributed and/or modified under the terms and
+// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
+// and appearing in the file LICENSE included in the packaging of this file.
+//
+// This software is distributed on an "AS IS" basis, without warranty of any
+// kind, and Open CASCADE SA hereby disclaims all such warranties,
+// including without limitation, any warranties of merchantability, fitness
+// for a particular purpose or non-infringement. Please see the License for
+// the specific terms and conditions governing rights and limitations under the
+// License.
+
+#ifndef _Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_HeaderFile
+#define _Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_HeaderFile
+
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+
+#ifndef _Handle_TCollection_MapNode_HeaderFile
+#include <Handle_TCollection_MapNode.hxx>
+#endif
+
+class Standard_Transient;
+class Handle_Standard_Type;
+class Handle(TCollection_MapNode);
+class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo;
+Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo);
+
+class Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo) : public Handle(TCollection_MapNode) {
+ public:
+ Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo)():Handle(TCollection_MapNode)() {}
+ Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo)(const Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo)& aHandle) : Handle(TCollection_MapNode)(aHandle)
+ {
+ }
+
+ Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo)(const GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem)
+ {
+ }
+
+ Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo)& operator=(const Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo)& aHandle)
+ {
+ Assign(aHandle.Access());
+ return *this;
+ }
+
+ Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo)& operator=(const GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo* anItem)
+ {
+ Assign((Standard_Transient *)anItem);
+ return *this;
+ }
+
+ GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo* operator->() const
+ {
+ return (GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo *)ControlAccess();
+ }
+
+// Standard_EXPORT ~Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo)();
+
+ Standard_EXPORT static const Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo) DownCast(const Handle(Standard_Transient)& AnObject);
+};
+#endif
GEOMAlgo_WESCorrector.cxx \
GEOMAlgo_WireEdgeSet.cxx \
GEOMAlgo_WireSolid.cxx \
- GEOMAlgo_WireSplitter.cxx
-
-LIB_CLIENT_IDL =
-LIB_SERVER_IDL =
+ GEOMAlgo_WireSplitter.cxx \
+ GEOMAlgo_ClsfSolid.cxx \
+ GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_0.cxx \
+ GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape_0.cxx \
+ GEOMAlgo_DataMapOfPassKeyShapeShape_0.cxx \
+ GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_0.cxx \
+ GEOMAlgo_ShapeInfoFiller_1.cxx \
+ GEOMAlgo_IndexedDataMapOfShapeShapeInfo_0.cxx \
+ GEOMAlgo_ShapeInfo.cxx \
+ GEOMAlgo_ShapeInfoFiller.cxx
# header files
salomeinclude_HEADERS = \
Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState.hxx \
Handle_GEOMAlgo_ListNodeOfListOfCoupleOfShapes.hxx \
Handle_GEOMAlgo_ListNodeOfListOfPnt.hxx
+ GEOMAlgo_ClsfSolid.hxx \
+ GEOMAlgo_ClsfSolid.ixx \
+ GEOMAlgo_ClsfSolid.jxx \
+ GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape.hxx \
+ GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx \
+ GEOMAlgo_DataMapOfPassKeyShapeShape.hxx \
+ GEOMAlgo_Gluer1.cxx \
+ GEOMAlgo_Gluer1.hxx \
+ GEOMAlgo_Gluer1.ixx \
+ GEOMAlgo_Gluer1.jxx \
+ GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx \
+ GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx \
+ GEOMAlgo_KindOfBounds.hxx \
+ GEOMAlgo_KindOfClosed.hxx \
+ GEOMAlgo_KindOfName.hxx \
+ GEOMAlgo_KindOfShape.hxx \
+ GEOMAlgo_ShapeInfo.hxx \
+ GEOMAlgo_ShapeInfo.ixx \
+ GEOMAlgo_ShapeInfo.jxx \
+ GEOMAlgo_ShapeInfoFiller.hxx \
+ GEOMAlgo_ShapeInfoFiller.ixx \
+ GEOMAlgo_ShapeInfoFiller.jxx \
+ Handle_GEOMAlgo_ClsfSolid.hxx \
+ Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx \
+ Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx
libGEOMAlgo_la_CPPFLAGS = \
$(CAS_CPPFLAGS) \
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
#include <LightApp_SelectionMgr.h>
+#include <LightApp_DataOwner.h>
#include <SalomeApp_Tools.h>
#include <SalomeApp_DataModel.h>
-#include <SalomeApp_Module.h>
#include <OCCViewer_ViewModel.h>
#include <SVTK_ViewModel.h>
erasePreview();
if ( hasCommand() )
abortCommand();
-
- globalSelection( GEOM_ALLOBJECTS, true );
-
+ SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
+ if(aGeomGUI)
+ globalSelection(aGeomGUI->getLocalSelectionMode() , true );
+ }
+
if (myDisplayer)
delete myDisplayer;
}
void GEOMBase_Helper::displayPreview( const bool activate,
const bool update,
const bool toRemoveFromEngine,
- const double lineWidth )
+ const double lineWidth,
+ const int displayMode,
+ const int color )
{
isPreview = true;
QString msg;
else {
for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it )
{
- displayPreview( *it, true, activate, false, lineWidth );
+ displayPreview( *it, true, activate, false, lineWidth, displayMode, color );
if ( toRemoveFromEngine )
getGeomEngine()->RemoveObject( *it );
}
const bool append,
const bool activate,
const bool update,
- const double lineWidth )
+ const double lineWidth,
+ const int displayMode,
+ const int color )
{
// Set color for preview shape
- getDisplayer()->SetColor( Quantity_NOC_VIOLET );
+ getDisplayer()->SetColor( color == -1 ? Quantity_NOC_VIOLET : color );
// set width of displayed shape
getDisplayer()->SetWidth( lineWidth );
+
+ // set display mode of displayed shape
+ int aPrevDispMode = getDisplayer()->SetDisplayMode( displayMode );
// Disable activation of selection
getDisplayer()->SetToActivate( activate );
displayPreview( aPrs, append, update );
getDisplayer()->UnsetName();
+ getDisplayer()->UnsetColor();
+ getDisplayer()->SetDisplayMode( aPrevDispMode );
// Enable activation of displayed objects
getDisplayer()->SetToActivate( true );
}
else {
const int nbObjs = objects.size();
- bool withChildren = false;
int aNumber = 1;
for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) {
if ( publish ) {
aName = GEOMBase::GetDefaultName( getPrefix( *it ) );
}
addInStudy( *it, aName.latin1() );
- withChildren = false;
+ // updateView=false
display( *it, false );
}
- else { // asv : fix of PAL6454. If publish==false, then the original shape was modified, and need to be re-cached in GEOM_Client
- // before redisplay
+ else {
+ // asv : fix of PAL6454. If publish==false, then the original shape
+ // was modified, and need to be re-cached in GEOM_Client before redisplay
clearShapeBuffer( *it );
- withChildren = true;
- redisplay( *it, withChildren, false );
+ // withChildren=true, updateView=false
+ redisplay( *it, true, false );
}
}
if ( !myPrefix.isEmpty() || theObj->_is_nil() )
return myPrefix;
- TopoDS_Shape aShape;
- if ( !GEOMBase::GetShape( theObj, aShape ) )
- return "";
-
- long aType = aShape.ShapeType();
+ //TopoDS_Shape aShape;
+ //if ( !GEOMBase::GetShape( theObj, aShape ) )
+ // return "";
+ //
+ //long aType = aShape.ShapeType();
+ GEOM::shape_type aType = theObj->GetShapeType();
switch ( aType )
{
- case TopAbs_VERTEX : return QObject::tr( "GEOM_VERTEX" );
- case TopAbs_EDGE : return QObject::tr( "GEOM_EDGE" );
- case TopAbs_WIRE : return QObject::tr( "GEOM_WIRE" );
- case TopAbs_FACE : return QObject::tr( "GEOM_FACE" );
- case TopAbs_SHELL : return QObject::tr( "GEOM_SHELL" );
- case TopAbs_SOLID : return QObject::tr( "GEOM_SOLID" );
- case TopAbs_COMPSOLID: return QObject::tr( "GEOM_COMPOUNDSOLID" );
- case TopAbs_COMPOUND : return QObject::tr( "GEOM_COMPOUND" );
+ case GEOM::VERTEX : return QObject::tr( "GEOM_VERTEX" );
+ case GEOM::EDGE : return QObject::tr( "GEOM_EDGE" );
+ case GEOM::WIRE : return QObject::tr( "GEOM_WIRE" );
+ case GEOM::FACE : return QObject::tr( "GEOM_FACE" );
+ case GEOM::SHELL : return QObject::tr( "GEOM_SHELL" );
+ case GEOM::SOLID : return QObject::tr( "GEOM_SOLID" );
+ case GEOM::COMPSOLID: return QObject::tr( "GEOM_COMPOUNDSOLID" );
+ case GEOM::COMPOUND : return QObject::tr( "GEOM_COMPOUND" );
default : return "";
}
}
return myDesktop;
}
+//================================================================
+// Function : selectObjects
+// Purpose : Selects list of objects
+//================================================================
+bool GEOMBase_Helper::selectObjects( ObjectList& objects )
+{
+ SUIT_DataOwnerPtrList aList;
+ ObjectList::iterator anIter;
+ for ( anIter = objects.begin(); anIter != objects.end(); ++anIter )
+ {
+ string entry = getEntry( *anIter );
+ QString aEntry( entry.c_str() );
+ LightApp_DataOwner* anOwher = new LightApp_DataOwner( aEntry );
+ aList.append( anOwher );
+ }
+
+ SUIT_Session* session = SUIT_Session::session();
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
+ if ( !app )
+ return false;
+
+ LightApp_SelectionMgr* aMgr = app->selectionMgr();
+ if ( !aMgr )
+ return false;
+
+ aMgr->setSelected( aList, false );
+
+ return true;
+}
+
+
+
+
+
+
\ No newline at end of file
virtual void displayPreview ( const bool activate = false,
const bool update = true,
const bool toRemoveFromEngine = true,
- const double lineWidth = -1 );
+ const double lineWidth = -1,
+ const int displayMode = -1,
+ const int color = -1 );
// This is the easiest way to show preview. It is based on execute() method.
// It removes temporary GEOM::GEOM_Objects automatically.
const bool append = false,
const bool activate = false,
const bool update = true,
- const double lineWidth = -1 );
+ const double lineWidth = -1,
+ const int displayMode = -1,
+ const int color = -1 );
void displayPreview ( const SALOME_Prs* prs,
const bool append = false,
const bool = true );
Handle(SALOME_InteractiveObject) lastIObject() ;
// Function returns the last selected object in the list
// of selected objects
+
+ bool selectObjects( ObjectList& objects );
+ // Selects list of objects
////////////////////////////////////////////////////////////////////////////
// Virtual methods, to be redefined in dialog classes
QString myHelpFileName;
protected slots:
- void ClickOnCancel();
+ virtual void ClickOnCancel();
void LineEditReturnPressed();
void DeactivateActiveDialog();
void ActivateThisDialog();
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <SelectMgr_Selection.hxx>
#include <SelectBasics_SensitiveEntity.hxx>
+#include <StdSelect_BRepOwner.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <SelectMgr_IndexedMapOfOwner.hxx>
#include <NCollection_DataMap.hxx>
{
for ( ic->InitSelected(); ic->MoreSelected(); ic->NextSelected() )
{
- Handle(SelectMgr_EntityOwner) anOwner = ic->SelectedOwner();
+ Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(ic->SelectedOwner());
if ( anOwner.IsNull() )
continue;
}
// add externally selected objects
SUIT_DataOwnerPtrList::const_iterator anExtIter;
- for(anExtIter = getSelectedExt().begin(); anExtIter != getSelectedExt().end(); anExtIter++) {
+ for(anExtIter = mySelectedExternals.begin(); anExtIter != mySelectedExternals.end(); anExtIter++) {
aList.append(*anExtIter);
}
for ( int i = 1, n = owners.Extent(); i <= n; i++ )
{
- Handle(SelectMgr_EntityOwner) anOwner = owners( i );
+
+ Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(owners( i ));
+
if ( anOwner.IsNull() || !anOwner->HasShape() )
continue;
vw->update();
// fill extra selected
- clearSelExtOwners();
+ mySelectedExternals.clear();
for ( SUIT_DataOwnerPtrList::const_iterator itr2 = aList.begin(); itr2 != aList.end(); ++itr2 ) {
const LightApp_DataSubOwner* subOwner = dynamic_cast<const LightApp_DataSubOwner*>( (*itr2).operator->() );
if ( !subOwner )
{
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
QString anEntry = appStudy->referencedToEntry( owner->entry() );
- if (globalSelMap[anEntry] == 1)
- appendSelExtOwner(*itr2);
+ if (globalSelMap[anEntry] == 1) mySelectedExternals.append(*itr2);
}
}
}
#include "GEOM_Displayer.h"
#include <LightApp_DataOwner.h>
+#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
#include <OCCViewer_ViewModel.h>
QtxValue GEOMGUI_Selection::globalParam( const QString& p ) const
{
if ( p == "isOCC" ) return QtxValue( activeViewType() == OCCViewer_Viewer::Type() );
-
+ if ( p == "selectionmode" ){
+ return QtxValue(selectionMode());
+ }
return LightApp_Selection::globalParam( p );
}
}
return GEOM::GEOM_Object::_nil();
}
+
+QString GEOMGUI_Selection:: selectionMode() const
+{
+ SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
+ if(aGeomGUI)
+ switch(aGeomGUI->getLocalSelectionMode())
+ {
+ case GEOM_POINT : return "VERTEX";
+ case GEOM_EDGE : return "EDGE";
+ case GEOM_WIRE : return "WIRE";
+ case GEOM_FACE : return "FACE";
+ case GEOM_SHELL : return "SHELL";
+ case GEOM_SOLID : return "SOLID";
+ case GEOM_COMPOUND : return "COMPOUND";
+ case GEOM_ALLOBJECTS : return "ALL";
+ default: return "";
+ }
+ }
+}
bool isVisible( const int ) const;
QString typeName( const int ) const;
QString displayMode( const int ) const;
+ QString selectionMode() const;
bool isComponent( const int ) const;
GEOM::GEOM_Object_ptr getObject( const int ) const;
#include "GEOM_Actor.h"
#include "GEOM_AssemblyBuilder.h"
#include "GEOM_AISShape.hxx"
+#include "GEOM_AISVector.hxx"
#include "GEOM_AISTrihedron.hxx"
#include "GEOM_VTKTrihedron.hxx"
myShadingColor = SalomeApp_Tools::color( col );
myDisplayMode = resMgr->integerValue("Geometry", "display_mode", 0);
+ myTypeOfMarker = (Aspect_TypeOfMarker)resMgr->integerValue("Geometry", "type_of_marker", Aspect_TOM_PLUS);
+ myScaleOfMarker = resMgr->doubleValue("Geometry", "marker_scale", 1.);
+ if(myScaleOfMarker < 1.0)
+ myScaleOfMarker = 1.0;
+ if(myScaleOfMarker > 7.)
+ myScaleOfMarker = 7.;
+
myColor = -1;
// This color is used for shape displaying. If it is equal -1 then
{
if ( !myShape.IsNull() )
{
- Handle(GEOM_AISShape) AISShape = new GEOM_AISShape( myShape, "" );
+ //Handle(GEOM_AISShape) AISShape = new GEOM_AISShape( myShape, "" );
+ Handle(GEOM_AISShape) AISShape;
+ if (myType == GEOM_VECTOR)
+ AISShape = new GEOM_AISVector (myShape, "");
+ else
+ AISShape = new GEOM_AISShape (myShape, "");
// Temporary staff: vertex must be infinite for correct visualization
AISShape->SetInfiniteState( myShape.Infinite() || myShape.ShapeType() == TopAbs_VERTEX );
// Set color and number 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)) );
+ 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 );
int anUIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_u", 1);
int aVIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_v", 1);
-
+
Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect();
anAspect->SetNumber( anUIsoNumber );
anAspect->SetColor( aColor );
AISShape->Attributes()->SetUIsoAspect( anAspect );
-
+
anAspect = AISShape->Attributes()->VIsoAspect();
anAspect->SetNumber( aVIsoNumber );
anAspect->SetColor( aColor );
AISShape->Attributes()->SetVIsoAspect( anAspect );
-
+
if ( HasColor() )
{
AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
{
Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
anAspect->SetColor( (Quantity_NameOfColor)GetColor() );
+ anAspect->SetScale( myScaleOfMarker );
+ anAspect->SetTypeOfMarker( myTypeOfMarker );
AISShape->Attributes()->SetPointAspect( anAspect );
}
}
{
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 );
+ anAspect->SetScale( myScaleOfMarker );
+ anAspect->SetTypeOfMarker( myTypeOfMarker );
+ 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 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 );
vtkActorCollection* theActors = 0;
- if ( myType == GEOM_MARKER && !myShape.IsNull() && myShape.ShapeType() == TopAbs_FACE )
+ if ( myType == GEOM_MARKER && myShape.ShapeType() == TopAbs_FACE )
{
myToActivate = false;
GEOM_VTKTrihedron* aTrh = GEOM_VTKTrihedron::New();
theActors->AddItem( aTrh );
}
else
- theActors = GEOM_AssemblyBuilder::BuildActors( myShape, 0, 0, Standard_True );
+ {
+ bool isVector = (myType == GEOM_VECTOR);
+ theActors = GEOM_AssemblyBuilder::BuildActors( myShape, 0, 0, Standard_True, isVector );
+ }
theActors->InitTraversal();
//=================================================================
void GEOM_Displayer::SetColor( const int color )
{
- myColor = color;
+ if ( color == -1 )
+ UnsetColor();
+ else
+ {
+ myColor = color;
+ myShadingColor = Quantity_Color( (Quantity_NameOfColor)color );
+ }
}
int GEOM_Displayer::GetColor() const
void GEOM_Displayer::UnsetColor()
{
myColor = -1;
+
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ QColor col = resMgr->colorValue( "Geometry", "shading_color", QColor( 255, 0, 0 ) );
+ myShadingColor = SalomeApp_Tools::color( col );
}
//=================================================================
{
return viewer_type==SOCC_Viewer::Type() || viewer_type==SVTK_Viewer::Type();
}
+
+int GEOM_Displayer::SetDisplayMode( const int theMode )
+{
+ int aPrevMode = myDisplayMode;
+ if ( theMode != -1 )
+ myDisplayMode = theMode;
+ else
+ {
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ myDisplayMode = resMgr->integerValue( "Geometry", "display_mode", 0 );
+ }
+ return aPrevMode;
+}
+
+int GEOM_Displayer::GetDisplayMode() const
+{
+ return myDisplayMode;
+}
+
+int GEOM_Displayer::UnsetDisplayMode()
+{
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ myDisplayMode = resMgr->integerValue( "Geometry", "display_mode", 0 );
+}
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
#include <TopoDS_Shape.hxx>
#include <Quantity_Color.hxx>
#include <LightApp_Displayer.h>
+#include <Aspect_TypeOfMarker.hxx>
#include <list>
class GEOMGUI_EXPORT GEOM_Displayer : public LightApp_Displayer
{
-
+
public:
/* Constructor */
GEOM_Displayer( SalomeApp_Study* app );
// This overloaded Display() method can be useful for operations
// not using dialog boxes.
- void Display ( GEOM::GEOM_Object_ptr theObj,
+ void Display ( GEOM::GEOM_Object_ptr theObj,
const bool updateViewer = true );
-
+
void Redisplay ( const Handle(SALOME_InteractiveObject)& theIO,
const bool updateViewer = true );
void Erase ( GEOM::GEOM_Object_ptr theObj,
const bool forced = false,
- const bool updateViewer = true );
+ const bool updateViewer = true );
/* Display/Erase list of objects methods */
-
+
void Display ( const SALOME_ListIO& theIOList,
const bool updateViewer = true );
-
+
void Erase ( const SALOME_ListIO& theIOList,
const bool forced = false,
const bool updateViewer = true );
-
+
void Redisplay ( const SALOME_ListIO& theIOList,
const bool updateViewer = true );
void UnsetWidth();
double GetWidth () const;
bool HasWidth () const;
+
+ /* Set display mode shape displaying. If it is equal -1 then display mode is used. */
+ int SetDisplayMode( const int );
+ int GetDisplayMode() const;
+ int UnsetDisplayMode();
/* Sets name - for temporary objects only */
/* internal methods */
/* Builds presentation accordint to the current viewer type */
virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 );
-
+
/* Sets interactive object */
void setIO( const Handle(SALOME_InteractiveObject)& theIO );
-
+
/* Sets shape */
void setShape( const TopoDS_Shape& theShape );
-
+
/* Resets internal data */
void internalReset();
void clearTemporary( LightApp_SelectionMgr* theSelMgr );
SUIT_SelectionFilter* getFilter( const int theMode );
-
+
protected:
Handle(SALOME_InteractiveObject) myIO;
TopoDS_Shape myShape;
double myWidth;
bool myToActivate;
int myDisplayMode;
+ Aspect_TypeOfMarker myTypeOfMarker;
+ double myScaleOfMarker;
private:
SalomeApp_Application* myApp;
msgid "ICON_DLG_ARC"
msgstr "arc.png"
+#ArcDlg
+msgid "ICON_DLG_ARC_CENTER"
+msgstr "arccenter.png"
+
#ArchimedeDlg
msgid "ICON_DLG_ARCHIMEDE"
msgstr "archimede.png"
msgid "ICON_DLG_GLUE_FACES"
msgstr "glue.png"
+msgid "ICON_DLG_GLUE_FACES2"
+msgstr "glue2.png"
+
msgid "ICON_DLG_FREE_FACES"
msgstr "free_faces.png"
msgid "ICO_POP_CREATE_GROUP"
msgstr "group_new.png"
+
+msgid "ICO_VERTEX_SEL_ONLY"
+msgstr "point2.png"
+
+msgid "ICO_EDGE_SEL_ONLY"
+msgstr "build_edge.png"
+
+msgid "ICO_WIRE_SEL_ONLY"
+msgstr "build_wire.png"
+
+msgid "ICO_FACE_SEL_ONLY"
+msgstr "build_face.png"
+
+msgid "ICO_SHELL_SEL_ONLY"
+msgstr "build_shell.png"
+
+msgid "ICO_SOLID_SEL_ONLY"
+msgstr "build_solid.png"
+
+msgid "ICO_COMPOUND_SEL_ONLY"
+msgstr "build_compound.png"
\ No newline at end of file
msgid "GEOM_WPLANE_OXY"
msgstr "OXY"
+#: GeometryGUI_WorkingPlaneDlg.cxx:107
+msgid "GEOM_REVERSE_PLANE"
+msgstr "Reverse the plane normal"
+
#: GeometryGUI_multiTranslationDlg.cxx:107
msgid "GEOM_MULTITRANSLATION_TITLE"
msgstr "Multi-Translation"
msgid "GEOM_GLUE"
msgstr "Glue"
+msgid "RepairGUI_GlueDlg::SELECT_FACES"
+msgstr "Select Faces"
+
+msgid "RepairGUI_GlueDlg::FACES_FOR_GLUING_ARE_DETECTED"
+msgstr "There are %1 face(s) that can be glued. They are coloured on the screen with red colour\nPlease close this message box and select faces for glueing"
+
+msgid "RepairGUI_GlueDlg::GLUE_FACES"
+msgstr "Glue faces"
+
+msgid "RepairGUI_GlueDlg::THERE_ARE_NO_FACES_FOR_GLUING"
+msgstr "There are no faces for gluing"
+
msgid "GEOM_FREE_FACES_TITLE"
msgstr "Free faces"
msgid "PREF_GROUP_GENERAL"
msgstr "General"
+msgid "PREF_GROUP_VERTEX"
+msgstr "Marker of Points"
+
msgid "PREF_SHADING_COLOR"
msgstr "Default shading color"
msgid "PREF_TAB_SETTINGS"
msgstr "Settings"
+msgid "PREF_TYPE_OF_MARKER"
+msgstr "Type"
+
+msgid "PREF_MARKER_SCALE"
+msgstr "Size"
+
+msgid "TOM_POINT"
+msgstr "."
+
+msgid "TOM_PLUS"
+msgstr "+"
+
+msgid "TOM_STAR"
+msgstr "*"
+
+msgid "TOM_O"
+msgstr "O"
+
+msgid "TOM_X"
+msgstr "X"
+
+msgid "TOM_O_POINT"
+msgstr ". in O"
+
+msgid "TOM_O_PLUS"
+msgstr "+ in O"
+
+msgid "TOM_O_STAR"
+msgstr "* in O"
+
+msgid "TOM_O_X"
+msgstr "X in O"
+
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 "
+
+msgid "MEN_SELECT_ONLY"
+msgstr "Select Only"
+
+msgid "STB_VERTEX_SEL_ONLY"
+msgstr "Select only a Points"
+
+msgid "STB_EDGE_SEL_ONLY"
+msgstr "Select only a Edges"
+
+msgid "STB_WIRE_SEL_ONLY"
+msgstr "Select only a Wires"
+
+msgid "STB_FACE_SEL_ONLY"
+msgstr "Select only a Faces"
+
+msgid "STB_SHELL_SEL_ONLY"
+msgstr "Select only a Shells"
+
+msgid "STB_SOLID_SEL_ONLY"
+msgstr "Select only a Solids"
+
+msgid "STB_COMPOUND_SEL_ONLY"
+msgstr "Select only a Compounds"
+
+msgid "STB_ALL_SEL_ONLY"
+msgstr "Select all Objects"
+
+msgid "MEN_VERTEX_SEL_ONLY"
+msgstr "Vertex"
+
+msgid "MEN_EDGE_SEL_ONLY"
+msgstr "Edge"
+
+msgid "MEN_WIRE_SEL_ONLY"
+msgstr "Wire"
+
+msgid "MEN_FACE_SEL_ONLY"
+msgstr "Face"
+
+msgid "MEN_SHELL_SEL_ONLY"
+msgstr "Shell"
+
+msgid "MEN_SOLID_SEL_ONLY"
+msgstr "Solid"
+
+msgid "MEN_COMPOUND_SEL_ONLY"
+msgstr "Compound"
+
+msgid "MEN_ALL_SEL_ONLY"
+msgstr "Select All"
+
+
+
+
+
+
+
#include <Prs3d_Drawer.hxx>
#include <Prs3d_IsoAspect.hxx>
+#include <Aspect_TypeOfMarker.hxx>
#include <OSD_SharedLibrary.hxx>
#include <utilities.h>
myVTKSelectors.setAutoDelete( true );
myDisplayer = 0;
+ myLocalSelectionMode = GEOM_ALLOBJECTS;
}
//=======================================================================
id == 121 || // MENU FILE - EXPORT BREP
id == 122 || // MENU FILE - EXPORT IGES
id == 123 || // MENU FILE - EXPORT STEP
+ id == 2171 || // POPUP VIEWER - SELECT ONLY - VERTEX
+ id == 2172 || // POPUP VIEWER - SELECT ONLY - EDGE
+ id == 2173 || // POPUP VIEWER - SELECT ONLY - WIRE
+ id == 2174 || // POPUP VIEWER - SELECT ONLY - FACE
+ id == 2175 || // POPUP VIEWER - SELECT ONLY - SHELL
+ id == 2176 || // POPUP VIEWER - SELECT ONLY - SOLID
+ id == 2177 || // POPUP VIEWER - SELECT ONLY - COMPOUND
+ id == 2178 || // POPUP VIEWER - SELECT ONLY - SELECT ALL
id == 31 || // MENU EDIT - COPY
id == 33 || // MENU EDIT - DELETE
id == 411 || // MENU SETTINGS - ADD IN STUDY
createGeomAction( 212, "DISPLAY_ALL" );
createGeomAction( 214, "ERASE_ALL" );
createGeomAction( 216, "DISPLAY" );
+ createGeomAction( 2171, "VERTEX_SEL_ONLY" ,"", 0, true );
+ createGeomAction( 2172, "EDGE_SEL_ONLY", "", 0, true );
+ createGeomAction( 2173, "WIRE_SEL_ONLY", "", 0, true );
+ createGeomAction( 2174, "FACE_SEL_ONLY", "", 0, true );
+ createGeomAction( 2175, "SHELL_SEL_ONLY", "", 0, true );
+ createGeomAction( 2176, "SOLID_SEL_ONLY", "", 0, true );
+ createGeomAction( 2177, "COMPOUND_SEL_ONLY", "", 0, true );
+ createGeomAction( 2178, "ALL_SEL_ONLY", "", 0, true );
createGeomAction( 213, "DISPLAY_ONLY" );
createGeomAction( 215, "ERASE" );
mgr->insert( action( 214 ), -1, -1 ); // erase All
mgr->setRule( action( 214 ), clientOCCorVTK, true );
+ QString selectOnly = "(client='OCCViewer' or client='VTKViewer') and (selcount=0)";
+
+ int selectolnyId = mgr->insert( tr("MEN_SELECT_ONLY"), -1, -1); //select only menu
+ mgr->insert( action(2171), selectolnyId, -1); //Vertex
+ mgr->setRule(action(2171), selectOnly, true);
+ mgr->setRule(action(2171), selectOnly + " and selectionmode='VERTEX'", false);
+ mgr->insert( action(2172), selectolnyId, -1); //Edge
+ mgr->setRule(action(2172), selectOnly, true);
+ mgr->setRule(action(2172), selectOnly + " and selectionmode='EDGE'", false);
+ mgr->insert( action(2173), selectolnyId, -1); //Wire
+ mgr->setRule(action(2173), selectOnly, true);
+ mgr->setRule(action(2173), selectOnly + " and selectionmode='WIRE'", false);
+ mgr->insert( action(2174), selectolnyId, -1); //Face
+ mgr->setRule(action(2174), selectOnly, true);
+ mgr->setRule(action(2174), selectOnly + " and selectionmode='FACE'", false);
+ mgr->insert( action(2175), selectolnyId, -1); //Shell
+ mgr->setRule(action(2175), selectOnly, true);
+ mgr->setRule(action(2175), selectOnly + " and selectionmode='SHELL'", false);
+ mgr->insert( action(2176), selectolnyId, -1); //Solid
+ mgr->setRule(action(2176), selectOnly, true);
+ mgr->setRule(action(2176), selectOnly + " and selectionmode='SOLID'", false);
+ mgr->insert( action(2177), selectolnyId, -1); //Compound
+ mgr->setRule(action(2177), selectOnly, true);
+ mgr->setRule(action(2177), selectOnly + " and selectionmode='COMPOUND'", false);
+ mgr->insert( separator(), selectolnyId, -1);
+ mgr->insert( action(2178), selectolnyId, -1); //Clear selection filter
+ mgr->setRule(action(2178), selectOnly, true);
+ mgr->setRule(action(2178), selectOnly + " and selectionmode='ALL'", false);
+
mgr->insert( action( 213 ), -1, -1 ); // display only
mgr->setRule( action( 213 ), rule.arg( types ).arg( "true" ), true );
mgr->insert( separator(), -1, -1 );
int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
+ int VertexGroup = addPreference( tr( "PREF_GROUP_VERTEX" ), tabId );
+
+ int typeOfMarker = addPreference( tr( "PREF_TYPE_OF_MARKER" ), VertexGroup,
+ LightApp_Preferences::Selector, "Geometry", "type_of_marker" );
+
+ int markerScale = addPreference( tr( "PREF_MARKER_SCALE" ), VertexGroup,
+ LightApp_Preferences::DblSpin, "Geometry", "marker_scale" );
+
// Set property for default display mode
QStringList aModesList;
aModesList.append( tr("MEN_WIREFRAME") );
setPreferenceProperty( step, "max", 10000 );
setPreferenceProperty( step, "precision", 3 );
+ // Set property for type of vertex marker
+ QStringList aTypeOfMarkerList;
+ QValueList<QVariant> anTypeOfMarkerIndexesList;
+
+ aTypeOfMarkerList.append( tr("TOM_PLUS") );
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_PLUS);
+
+ aTypeOfMarkerList.append( tr("TOM_POINT") );
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_POINT);
+
+ aTypeOfMarkerList.append( tr("TOM_STAR") );
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_STAR);
+
+ aTypeOfMarkerList.append( tr("TOM_O") );
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_O);
+
+ aTypeOfMarkerList.append( tr("TOM_X") );
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_X);
+
+ aTypeOfMarkerList.append( tr("TOM_O_POINT") );
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_O_POINT);
+
+ aTypeOfMarkerList.append( tr("TOM_O_PLUS") );
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_O_PLUS);
+
+ aTypeOfMarkerList.append( tr("TOM_O_STAR") );
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_O_STAR);
+
+ aTypeOfMarkerList.append( tr("TOM_O_X") );
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_O_X);
+
+
+ setPreferenceProperty( typeOfMarker, "strings", aTypeOfMarkerList );
+ setPreferenceProperty( typeOfMarker, "indexes", anTypeOfMarkerIndexesList );
+
+ // Set property for Vertex Marker scale
+ setPreferenceProperty( markerScale, "min", 1. );
+ setPreferenceProperty( markerScale, "max", 7. );
+ setPreferenceProperty( markerScale, "precision", 0.01 );
+ setPreferenceProperty( markerScale, "step", 0.5 );
+
}
void GeometryGUI::preferencesChanged( const QString& section, const QString& param )
myDisplayer = new GEOM_Displayer( dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() ) );
return myDisplayer;
}
+
+void GeometryGUI::setLocalSelectionMode(const int mode)
+{
+ myLocalSelectionMode = mode;
+}
+int GeometryGUI::getLocalSelectionMode() const
+{
+ return myLocalSelectionMode;
+}
virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& );
virtual void createPreferences();
virtual void preferencesChanged( const QString&, const QString& );
-
+ int getLocalSelectionMode() const;
+ void setLocalSelectionMode(const int mode);
public slots:
virtual bool deactivateModule( SUIT_Study* );
QPtrList<LightApp_VTKSelector> myVTKSelectors;
LightApp_Displayer* myDisplayer;
+ int myLocalSelectionMode; //Select Only
friend class DisplayGUI;
};
#include <TopExp.hxx>
#include <GC_MakeArcOfCircle.hxx>
-
#include <Standard_ConstructionError.hxx>
#include <Precision.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
+#include <gce_MakeCirc.hxx>
+#include <gce_MakePln.hxx>
+#include <ElCLib.hxx>
+#include <Geom_Circle.hxx>
+#include <Geom_TrimmedCurve.hxx>
+
+#include "utilities.h"
//=======================================================================
//function : GetID
//purpose :
Standard_Integer aType = aFunction->GetType();
TopoDS_Shape aShape;
-
- if (aType == CIRC_ARC_THREE_PNT) {
+ if ((aType == CIRC_ARC_THREE_PNT)||(aType == CIRC_ARC_CENTER)) {
Handle(GEOM_Function) aRefPoint1 = aCI.GetPoint1();
Handle(GEOM_Function) aRefPoint2 = aCI.GetPoint2();
Handle(GEOM_Function) aRefPoint3 = aCI.GetPoint3();
Standard_ConstructionError::Raise("Arc creation aborted: coincident points given");
if (gp_Vec(aP1, aP2).IsParallel(gp_Vec(aP1, aP3), Precision::Angular()))
Standard_ConstructionError::Raise("Arc creation aborted: points lay on one line");
- GC_MakeArcOfCircle arc (aP1, aP2, aP3);
- aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
+ if (aType == CIRC_ARC_THREE_PNT){
+ GC_MakeArcOfCircle arc(aP1, aP2, aP3);
+ aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
+
+ }
+ if (aType == CIRC_ARC_CENTER){
+ Standard_Real Rad = aP1.Distance(aP2);
+ gce_MakeCirc MC(aP1,gce_MakePln(aP1, aP2, aP3).Value(),Rad);
+ Standard_Boolean sense = aCI.GetSense();
+ if (MC.IsDone()) {
+ const gp_Circ& Circ = MC.Value();
+ Standard_Real Alpha1 = ElCLib::Parameter(Circ,aP2);
+ Standard_Real Alpha2 = ElCLib::Parameter(Circ,aP3);
+ Handle(Geom_Circle) C = new Geom_Circle(Circ);
+ Handle(Geom_TrimmedCurve) TheArc;
+ if (!sense)
+ TheArc= new Geom_TrimmedCurve(C,Alpha1,Alpha2,false);
+ if (sense)
+ TheArc= new Geom_TrimmedCurve(C,Alpha2,Alpha1,false);
+ aShape = BRepBuilderAPI_MakeEdge(TheArc).Edge();
+ }
+ }
}
} else {
}
aFunction->SetValue(aShape);
log.SetTouched(Label());
-
+ MESSAGE("Out of building step ...");
return 1;
}
#include <BRepAlgoAPI_Cut.hxx>
#include <BRepAlgoAPI_Fuse.hxx>
#include <BRepAlgoAPI_Section.hxx>
+#include <TopExp_Explorer.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
// perform FUSE operation
else if (aType == BOOLEAN_FUSE) {
+ // Check arguments
+ TopTools_ListOfShape listShape1, listShape2;
+ AddSimpleShapes(aShape1, listShape1);
+ AddSimpleShapes(aShape2, listShape2);
+
+ Standard_Boolean isIntersect = Standard_False;
+
+ if (listShape1.Extent() > 1 && !isIntersect) {
+ // check intersections inside the first compound
+ TopTools_ListIteratorOfListOfShape it1 (listShape1);
+ for (; it1.More() && !isIntersect; it1.Next()) {
+ TopoDS_Shape aValue1 = it1.Value();
+ TopTools_ListIteratorOfListOfShape it2 (listShape1);
+ for (; it2.More() && !isIntersect; it2.Next()) {
+ TopoDS_Shape aValue2 = it2.Value();
+ if (aValue2 != aValue1) {
+ BRepAlgoAPI_Section BO (aValue1, aValue2);
+ if (BO.IsDone()) {
+ TopoDS_Shape aSect = BO.Shape();
+ TopExp_Explorer anExp (aSect, TopAbs_EDGE);
+ if (anExp.More()) {
+ isIntersect = Standard_True;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (listShape2.Extent() > 1 && !isIntersect) {
+ // check intersections inside the second compound
+ TopTools_ListIteratorOfListOfShape it1 (listShape2);
+ for (; it1.More() && !isIntersect; it1.Next()) {
+ TopoDS_Shape aValue1 = it1.Value();
+ TopTools_ListIteratorOfListOfShape it2 (listShape2);
+ for (; it2.More() && !isIntersect; it2.Next()) {
+ TopoDS_Shape aValue2 = it2.Value();
+ if (aValue2 != aValue1) {
+ BRepAlgoAPI_Section BO (aValue1, aValue2);
+ if (BO.IsDone()) {
+ TopoDS_Shape aSect = BO.Shape();
+ TopExp_Explorer anExp (aSect, TopAbs_EDGE);
+ if (anExp.More()) {
+ isIntersect = Standard_True;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (isIntersect) {
+ // have intersections inside compounds
+ // check intersections between compounds
+ TopTools_ListIteratorOfListOfShape it1 (listShape1);
+ for (; it1.More(); it1.Next()) {
+ TopoDS_Shape aValue1 = it1.Value();
+ TopTools_ListIteratorOfListOfShape it2 (listShape2);
+ for (; it2.More(); it2.Next()) {
+ TopoDS_Shape aValue2 = it2.Value();
+ if (aValue2 != aValue1) {
+ BRepAlgoAPI_Section BO (aValue1, aValue2);
+ if (BO.IsDone()) {
+ TopoDS_Shape aSect = BO.Shape();
+ TopExp_Explorer anExp (aSect, TopAbs_EDGE);
+ if (anExp.More()) {
+ StdFail_NotDone::Raise("Bad argument for Fuse: compound with intersecting sub-shapes");
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // Perform
BRepAlgoAPI_Fuse BO (aShape1, aShape2);
if (!BO.IsDone()) {
StdFail_NotDone::Raise("Fuse operation can not be performed on the given shapes");
#include <GEOM_Function.hxx>
#include <GEOMAlgo_Gluer.hxx>
+#include "GEOMAlgo_Gluer1.hxx"
+#include "GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx"
+#include "GEOMAlgo_CoupleOfShapes.hxx"
+#include "GEOMAlgo_ListOfCoupleOfShapes.hxx"
#include "utilities.h"
return aRes;
}
+
//=======================================================================
//function : GlueFaces
//purpose :
return aRes;
}
+
+//=======================================================================
+//function : GlueFacesByList
+//purpose :
+//=======================================================================
+TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesByList (const TopoDS_Shape& theShape,
+ const Standard_Real theTolerance,
+ const TopTools_MapOfShape& aFaces)
+{
+ TopoDS_Shape aRes;
+
+ GEOMAlgo_Gluer1 aGluer;
+ GEOMAlgo_ListIteratorOfListOfCoupleOfShapes aItCS;
+ GEOMAlgo_CoupleOfShapes aCS;
+ GEOMAlgo_ListOfCoupleOfShapes aLCS;
+
+ aGluer.SetShape(theShape);
+ aGluer.SetTolerance(theTolerance);
+ aGluer.Perform();
+ Standard_Integer iErr = aGluer.ErrorStatus();
+ if (iErr) return aRes;
+
+ TopTools_ListOfShape listShape;
+ const GEOMAlgo_ListOfCoupleOfShapes& aLCSG = aGluer.GluedFaces();
+ // Access to faces
+ aItCS.Initialize(aLCSG);
+ for (; aItCS.More(); aItCS.Next()) {
+ const GEOMAlgo_CoupleOfShapes& aCSG = aItCS.Value();
+ const TopoDS_Shape& aF1 = aCSG.Shape1();
+ const TopoDS_Shape& aF2 = aCSG.Shape2();
+ if( aFaces.Contains(aF1) || aFaces.Contains(aF2) )
+ continue;
+ aCS.SetShapes(aF1,aF2);
+ aLCS.Append(aCS);
+ }
+
+ //cout<<"aLCS.Extent() = "<<aLCS.Extent()<<endl;
+ if(aLCS.Extent()>0) {
+ aGluer.SetFacesToUnglue(aLCS);
+ aGluer.UnglueFaces();
+ iErr = aGluer.ErrorStatus();
+ if (iErr) return aRes;
+ }
+
+ aRes = aGluer.Result();
+
+ return aRes;
+}
+
+
//=======================================================================
//function : Execute
//purpose :
TopoDS_Shape aShape;
TCollection_AsciiString aWrn;
- if (aType == GLUE_FACES) {
- Handle(GEOM_Function) aRefBase = aCI.GetBase();
- TopoDS_Shape aShapeBase = aRefBase->GetValue();
- if (aShapeBase.IsNull()) {
- Standard_NullObject::Raise("Shape for gluing is null");
- }
+ Handle(GEOM_Function) aRefBase = aCI.GetBase();
+ TopoDS_Shape aShapeBase = aRefBase->GetValue();
+ if (aShapeBase.IsNull()) {
+ Standard_NullObject::Raise("Shape for gluing is null");
+ }
+
+ Standard_Real tol3d = aCI.GetTolerance();
- Standard_Real tol3d = aCI.GetTolerance();
+ if (aType == GLUE_FACES) {
aShape = GlueFacesWithWarnings(aShapeBase, tol3d, aWrn);
- } else {
+ }
+ else { // aType == GLUE_FACES_BY_LIST
+ Handle(TColStd_HSequenceOfTransient) SF = aCI.GetFaces();
+ TopTools_MapOfShape aFaces;
+ int i=1;
+ for( ; i <= SF->Length(); i++) {
+ Handle(Standard_Transient) anItem = SF->Value(i);
+ if(anItem.IsNull())
+ continue;
+ Handle(GEOM_Function) aRefSh = Handle(GEOM_Function)::DownCast(anItem);
+ if(aRefSh.IsNull())
+ continue;
+ TopoDS_Shape aFace = aRefSh->GetValue();
+ if(aFace.IsNull())
+ continue;
+ if(!aFaces.Contains(aFace))
+ aFaces.Add(aFace);
+ }
+ aShape = GlueFacesByList(aShapeBase, tol3d, aFaces);
}
if (aShape.IsNull()) return 0;
class Handle(TFunction_Driver);
class GEOMImpl_GlueDriver;
+#include <TopTools_MapOfShape.hxx>
+
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMImpl_GlueDriver);
class Handle(GEOMImpl_GlueDriver) : public Handle(TFunction_Driver) {
const Standard_Real theTolerance,
TCollection_AsciiString& theWarning) const;
+Standard_EXPORT static TopoDS_Shape GlueFacesByList (const TopoDS_Shape& theShape,
+ const Standard_Real theTolerance,
+ const TopTools_MapOfShape& aFaces);
+
+
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_GlueDriver_Type_();
#include <GEOMImpl_IFilling.hxx>
#include <GEOMImpl_IThruSections.hxx>
#include <GEOMImpl_IPipeDiffSect.hxx>
+#include <GEOMImpl_IPipeShellSect.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
}
+
//=============================================================================
/*!
* MakePipeWithDifferentSections
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
- const Handle(TColStd_HSequenceOfTransient)& theBases,
- const Handle(TColStd_HSequenceOfTransient)& theLocations,
- const Handle(GEOM_Object)& thePath,
- bool theWithContact,
- bool theWithCorrections)
+ const Handle(TColStd_HSequenceOfTransient)& theBases,
+ const Handle(TColStd_HSequenceOfTransient)& theLocations,
+ const Handle(GEOM_Object)& thePath,
+ bool theWithContact,
+ bool theWithCorrections)
{
Handle(GEOM_Object) anObj;
SetErrorCode(KO);
}
+
+
+//=============================================================================
+/*!
+ * MakePipeWithShellSections
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
+ const Handle(TColStd_HSequenceOfTransient)& theBases,
+ const Handle(TColStd_HSequenceOfTransient)& theSubBases,
+ const Handle(TColStd_HSequenceOfTransient)& theLocations,
+ const Handle(GEOM_Object)& thePath,
+ bool theWithContact,
+ bool theWithCorrections)
+{
+ Handle(GEOM_Object) anObj;
+ SetErrorCode(KO);
+ if(theBases.IsNull())
+ return anObj;
+
+ Standard_Integer nbBases = theBases->Length();
+
+ if (!nbBases)
+ return anObj;
+
+ Standard_Integer nbSubBases = (theSubBases.IsNull() ? 0 :theSubBases->Length());
+
+ Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
+
+ //Add a new Pipe object
+ Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+
+ //Add a new Pipe function
+
+ Handle(GEOM_Function) aFunction =
+ aPipeDS->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_SHELL_SECTIONS);
+ if (aFunction.IsNull()) return anObj;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return anObj;
+
+ //GEOMImpl_IPipeDiffSect aCI (aFunction);
+ GEOMImpl_IPipeShellSect aCI (aFunction);
+
+ Handle(GEOM_Function) aRefPath = thePath->GetLastFunction();
+ if(aRefPath.IsNull())
+ return anObj;
+
+ Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
+ Handle(TColStd_HSequenceOfTransient) aSeqSubBases = new TColStd_HSequenceOfTransient;
+ Handle(TColStd_HSequenceOfTransient) aSeqLocs = new TColStd_HSequenceOfTransient;
+
+ Standard_Integer i =1;
+ for( ; i <= nbBases; i++) {
+
+ Handle(Standard_Transient) anItem = theBases->Value(i);
+ if(anItem.IsNull())
+ continue;
+ Handle(GEOM_Object) aBase = Handle(GEOM_Object)::DownCast(anItem);
+ if(aBase.IsNull())
+ continue;
+ Handle(GEOM_Function) aRefBase = aBase->GetLastFunction();
+ if(aRefBase.IsNull())
+ continue;
+
+ if( nbSubBases >= nbBases ) {
+ Handle(Standard_Transient) aSubItem = theSubBases->Value(i);
+ if(aSubItem.IsNull())
+ continue;
+ Handle(GEOM_Object) aSubBase = Handle(GEOM_Object)::DownCast(aSubItem);
+ if(aSubBase.IsNull())
+ continue;
+ Handle(GEOM_Function) aRefSubBase = aSubBase->GetLastFunction();
+ if(aRefSubBase.IsNull())
+ continue;
+ aSeqSubBases->Append(aRefSubBase);
+ }
+
+ if(nbLocs) {
+ Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
+ if(anItemLoc.IsNull())
+ continue;
+ Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
+ if(aLoc.IsNull())
+ continue;
+ Handle(GEOM_Function) aRefLoc = aLoc->GetLastFunction();
+ if(aRefLoc.IsNull())
+ continue;
+ aSeqLocs->Append(aRefLoc);
+ }
+
+ aSeqBases->Append(aRefBase);
+ }
+
+ if(!aSeqBases->Length())
+ return anObj;
+
+ aCI.SetBases(aSeqBases);
+ aCI.SetSubBases(aSeqSubBases);
+ aCI.SetLocations(aSeqLocs);
+ aCI.SetPath(aRefPath);
+ aCI.SetWithContactMode(theWithContact);
+ aCI.SetWithCorrectionMode(theWithCorrections);
+
+ //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 shell sections driver failed");
+ return anObj;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return anObj;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump pyDump(aFunction);
+ pyDump << aPipeDS << " = geompy.MakePipeWithShellSections([";
+
+ for(i =1 ; i <= nbBases; i++) {
+
+ Handle(Standard_Transient) anItem = theBases->Value(i);
+ if(anItem.IsNull())
+ continue;
+
+ Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
+ if(!anObj.IsNull()) {
+ pyDump<< anObj;
+ if(i < nbBases)
+ pyDump<<", ";
+ }
+
+ }
+
+ pyDump<< "], [";
+
+ for(i =1 ; i <= nbLocs; i++) {
+
+ Handle(Standard_Transient) anItem = theLocations->Value(i);
+ if(anItem.IsNull())
+ continue;
+
+ Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(anItem);
+ if(!anObj.IsNull()) {
+ pyDump<< anObj;
+ if(i < nbLocs)
+ pyDump<<", ";
+ }
+ }
+
+ pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")";
+
+ SetErrorCode(OK);
+ return aPipeDS;
+
+}
+
bool theRuled);
Standard_EXPORT Handle(GEOM_Object) MakePipeWithDifferentSections(
- const Handle(TColStd_HSequenceOfTransient)& theBases,
- const Handle(TColStd_HSequenceOfTransient)& theLocations,
- const Handle(GEOM_Object)& thePath,
- bool theWithContact,
- bool theWithCorrections);
+ const Handle(TColStd_HSequenceOfTransient)& theBases,
+ const Handle(TColStd_HSequenceOfTransient)& theLocations,
+ const Handle(GEOM_Object)& thePath,
+ bool theWithContact,
+ bool theWithCorrections);
+
+ Standard_EXPORT Handle(GEOM_Object) MakePipeWithShellSections(
+ const Handle(TColStd_HSequenceOfTransient)& theBases,
+ const Handle(TColStd_HSequenceOfTransient)& theSubBases,
+ const Handle(TColStd_HSequenceOfTransient)& theLocations,
+ const Handle(GEOM_Object)& thePath,
+ bool theWithContact,
+ bool theWithCorrections);
+
};
#endif
#define ARC_ARG_PI 1
#define ARC_ARG_PC 2
#define ARC_ARG_PE 3
+#define ARC_ARG_SE 4
class GEOMImpl_IArc
{
void SetPoint1(Handle(GEOM_Function) theP) { _func->SetReference(ARC_ARG_PI, theP); }
void SetPoint2(Handle(GEOM_Function) theP) { _func->SetReference(ARC_ARG_PC, theP); }
void SetPoint3(Handle(GEOM_Function) theP) { _func->SetReference(ARC_ARG_PE, theP); }
+ void SetSense(bool theSense) { _func->SetInteger(ARC_ARG_SE, theSense); }
Handle(GEOM_Function) GetPoint1() { return _func->GetReference(ARC_ARG_PI); }
Handle(GEOM_Function) GetPoint2() { return _func->GetReference(ARC_ARG_PC); }
Handle(GEOM_Function) GetPoint3() { return _func->GetReference(ARC_ARG_PE); }
-
+ bool GetSense() { return _func->GetInteger(ARC_ARG_SE); }
+
private:
Handle(GEOM_Function) _func;
//Add a new Circle Arc function
Handle(GEOM_Function) aFunction =
- anArc->AddFunction(GEOMImpl_ArcDriver::GetID(), CIRC_ARC_THREE_PNT);
- if (aFunction.IsNull()) return NULL;
+ anArc->AddFunction(GEOMImpl_ArcDriver::GetID(), CIRC_ARC_THREE_PNT);
+ if (aFunction.IsNull()) return NULL;
+
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_ArcDriver::GetID()) return NULL;
-
GEOMImpl_IArc aCI (aFunction);
Handle(GEOM_Function) aRefPnt1 = thePnt1->GetLastFunction();
Handle(GEOM_Function) aRefPnt2 = thePnt2->GetLastFunction();
Handle(GEOM_Function) aRefPnt3 = thePnt3->GetLastFunction();
+
if (aRefPnt1.IsNull() || aRefPnt2.IsNull() || aRefPnt3.IsNull()) return NULL;
aCI.SetPoint1(aRefPnt1);
aCI.SetPoint2(aRefPnt2);
aCI.SetPoint3(aRefPnt3);
-
+
//Compute the Arc value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
return anArc;
}
+//=============================================================================
+/*!
+ * MakeArcCenter
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeArcCenter (Handle(GEOM_Object) thePnt1,
+ Handle(GEOM_Object) thePnt2,
+ Handle(GEOM_Object) thePnt3,
+ bool theSense)
+{
+ SetErrorCode(KO);
+ if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
+
+ //Add a new Circle Arc object
+ Handle(GEOM_Object) anArc = GetEngine()->AddObject(GetDocID(), GEOM_CIRC_ARC);
+
+ //Add a new Circle Arc function
+ Handle(GEOM_Function) aFunction =
+ anArc->AddFunction(GEOMImpl_ArcDriver::GetID(), CIRC_ARC_CENTER);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_ArcDriver::GetID()) return NULL;
+
+ GEOMImpl_IArc aCI (aFunction);
+
+ Handle(GEOM_Function) aRefPnt1 = thePnt1->GetLastFunction();
+ Handle(GEOM_Function) aRefPnt2 = thePnt2->GetLastFunction();
+ Handle(GEOM_Function) aRefPnt3 = thePnt3->GetLastFunction();
+
+ if (aRefPnt1.IsNull() || aRefPnt2.IsNull() || aRefPnt3.IsNull()) return NULL;
+
+ aCI.SetPoint1(aRefPnt1);
+ aCI.SetPoint2(aRefPnt2);
+ aCI.SetPoint3(aRefPnt3);
+ aCI.SetSense(theSense);
+
+ //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;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << anArc << " = geompy.MakeArcCenter("
+ << thePnt1 << ", " << thePnt2 << ", " << thePnt3 << "," << theSense << ")";
+
+ SetErrorCode(OK);
+ return anArc;
+}
+
//=============================================================================
/*!
* MakeSplineBezier
Standard_EXPORT Handle(GEOM_Object) MakeArc (Handle(GEOM_Object) thePnt1,
Handle(GEOM_Object) thePnt2,
Handle(GEOM_Object) thePnt3);
+
+ Standard_EXPORT Handle(GEOM_Object) MakeArcCenter (Handle(GEOM_Object) thePnt1,
+ Handle(GEOM_Object) thePnt2,
+ Handle(GEOM_Object) thePnt3,
+ bool theSense);
Standard_EXPORT Handle(GEOM_Object) MakeSplineBezier (list<Handle(GEOM_Object)> thePoints);
Standard_EXPORT Handle(GEOM_Object) MakeSplineInterpolation (list<Handle(GEOM_Object)> thePoints);
#include "GEOM_Function.hxx"
+#include <TColStd_HSequenceOfTransient.hxx>
+
#define GLUE_ARG_BASE 1
#define GLUE_ARG_TOLER 2
+#define GLUE_ARG_FACES 3
class GEOMImpl_IGlue
{
Standard_Real GetTolerance() { return _func->GetReal(GLUE_ARG_TOLER); }
+ void SetFaces(const Handle(TColStd_HSequenceOfTransient)& theShapes)
+ { _func->SetReferenceList(GLUE_ARG_FACES, theShapes); }
+
+ Handle(TColStd_HSequenceOfTransient) GetFaces()
+ { return _func->GetReferenceList(GLUE_ARG_FACES); }
+
private:
Handle(GEOM_Function) _func;
if (!InitResMgr()) return Standard_False;
- // Read Import formats list
+ // Read Import formats list from install directory
if (myResMgr->Find("Import")) {
TCollection_AsciiString aFormats (myResMgr->Value("Import"));
TCollection_AsciiString aToken = aFormats.Token("| \t", 1);
}
}
+ // Read Import formats from user directory
+ if (myResMgrUser->Find("Import")) {
+ TCollection_AsciiString aFormats (myResMgrUser->Value("Import"));
+ TCollection_AsciiString aToken = aFormats.Token("| \t", 1);
+ int i = 1;
+ for (; !aToken.IsEmpty(); aToken = aFormats.Token("| \t", ++i)) {
+ int aLenFormats = theFormats->Length();
+ bool isFound = false;
+ for(int aInd=1;aInd<=aLenFormats;aInd++){
+ if( theFormats->Value(aInd) == aToken){
+ isFound = true;
+ break;
+ }
+ }
+ if(!isFound)
+ theFormats->Append(aToken);
+ }
+ }
+
// Read Patterns for each supported format
int j = 1, len = theFormats->Length();
for (; j <= len; j++) {
aKey = theFormats->Value(j) + ".ImportPattern";
if (myResMgr->Find(aKey.ToCString()))
aPattern = myResMgr->Value(aKey.ToCString());
+ else if(myResMgrUser->Find(aKey.ToCString()))
+ aPattern = myResMgrUser->Value(aKey.ToCString());
else {
aKey = theFormats->Value(j) + ".Pattern";
if (myResMgr->Find(aKey.ToCString()))
aPattern = myResMgr->Value(aKey.ToCString());
+ else if(myResMgrUser->Find(aKey.ToCString()))
+ aPattern = myResMgrUser->Value(aKey.ToCString());
else {
aPattern = theFormats->Value(j);
aPattern += " Files ( *.* )";
if (!InitResMgr()) return Standard_False;
- // Read Export formats list
+ // Read Export formats list from install directory
if (myResMgr->Find("Export")) {
TCollection_AsciiString aFormats (myResMgr->Value("Export"));
TCollection_AsciiString aToken = aFormats.Token("| \t", 1);
}
}
+ // Read Export formats list from user directory
+ if (myResMgrUser->Find("Export")) {
+ TCollection_AsciiString aFormats (myResMgrUser->Value("Export"));
+ TCollection_AsciiString aToken = aFormats.Token("| \t", 1);
+ int i = 1;
+ for (; !aToken.IsEmpty(); aToken = aFormats.Token("| \t", ++i)) {
+ int aLenFormats = theFormats->Length();
+ bool isFound = false;
+ for(int aInd=1;aInd<=aLenFormats;aInd++){
+ if( theFormats->Value(aInd) == aToken){
+ isFound = true;
+ break;
+ }
+ }
+ if(!isFound)
+ theFormats->Append(aToken);
+ }
+ }
+
// Read Patterns for each supported format
int j = 1, len = theFormats->Length();
for (; j <= len; j++) {
aKey = theFormats->Value(j) + ".ExportPattern";
if (myResMgr->Find(aKey.ToCString()))
aPattern = myResMgr->Value(aKey.ToCString());
+ else if (myResMgrUser->Find(aKey.ToCString()))
+ aPattern = myResMgrUser->Value(aKey.ToCString());
else {
aKey = theFormats->Value(j) + ".Pattern";
if (myResMgr->Find(aKey.ToCString()))
aPattern = myResMgr->Value(aKey.ToCString());
+ else if (myResMgrUser->Find(aKey.ToCString()))
+ aPattern = myResMgrUser->Value(aKey.ToCString());
else {
aPattern = theFormats->Value(j);
aPattern += " Files ( *.* )";
if (isImport) aMode = "Import";
else aMode = "Export";
- // Read supported formats for the certain mode
+
+ // Read supported formats for the certain mode from install directory
if (myResMgr->Find(aMode.ToCString())) {
TCollection_AsciiString aFormats (myResMgr->Value(aMode.ToCString()));
if (aFormats.Search(theFormat) > -1) {
}
}
}
-
+
+ // Read supported formats for the certain mode from user directory
+ if (myResMgrUser->Find(aMode.ToCString())) {
+ TCollection_AsciiString aFormats (myResMgrUser->Value(aMode.ToCString()));
+ if (aFormats.Search(theFormat) > -1) {
+ // Read library name for the supported format
+ TCollection_AsciiString aKey (theFormat);
+ aKey += ".";
+ aKey += aMode;
+ if (myResMgrUser->Find(aKey.ToCString())) {
+ TCollection_AsciiString aLibName (myResMgrUser->Value(aKey.ToCString()));
+ theLibName = new TCollection_HAsciiString (aLibName);
+ return Standard_True;
+ }
+ }
+ }
+
return Standard_False;
}
//=============================================================================
Standard_Boolean GEOMImpl_IInsertOperations::InitResMgr()
{
+ bool isResourceFound = false;
+ bool isResourceFoundUser = false;
+ TCollection_AsciiString aUserResDir,aResDir;
+
if (myResMgr.IsNull()) {
// Initialize the Resource Manager
- TCollection_AsciiString aResDir (getenv("GEOM_ROOT_DIR"));
+ TCollection_AsciiString aNull;
+ aResDir = TCollection_AsciiString(getenv("GEOM_ROOT_DIR"));
#ifdef WNT
aResDir += "\\share\\salome\\resources\\geom";
#else
aResDir += "/share/salome/resources/geom";
#endif
+
+ myResMgr = new Resource_Manager ("ImportExport", aResDir, aNull, Standard_False);
+
+ isResourceFound = true;
+ if (!myResMgr->Find("Import") && !myResMgr->Find("Export")) {
+ // instead of complains in Resource_Manager
+ isResourceFound = false;
+ INFOS("No valid file \"ImportExport\" found in " << aResDir.ToCString());
+ }
+ } else
+ isResourceFound = true;
+
+ if (myResMgrUser.IsNull()) {
char * dir = getenv("GEOM_ENGINE_RESOURCES_DIR");
- TCollection_AsciiString aUserResDir;
+ TCollection_AsciiString aNull;
if ( dir )
{
aUserResDir = dir;
aUserResDir += "/.salome/resources";
#endif
}
- myResMgr = new Resource_Manager ("ImportExport", aResDir, aUserResDir, Standard_False);
- if (!myResMgr->Find("Import") && !myResMgr->Find("Export")) {
+ myResMgrUser = new Resource_Manager ("ImportExport", aNull, aUserResDir, Standard_False);
+
+ isResourceFoundUser = true;
+
+ if (!myResMgrUser->Find("Import") && !myResMgrUser->Find("Export")) {
// instead of complains in Resource_Manager
- INFOS("No valid file \"ImportExport\" found in " << aResDir.ToCString() <<
- " and in " << aUserResDir.ToCString() );
+ isResourceFoundUser = false;
}
+
+ } else
+ isResourceFoundUser = true;
+
+ if(!isResourceFound && !isResourceFoundUser){
+ INFOS("No valid file \"ImportExport\" found in " << aResDir.ToCString());
+ INFOS("No valid file \"ImportExport\" found in " << aUserResDir.ToCString() );
}
- return ( myResMgr->Find("Import") || myResMgr->Find("Export") );
+ return ( myResMgr->Find("Import") || myResMgr->Find("Export") ||
+ myResMgrUser->Find("Import") || myResMgrUser->Find("Export"));
}
private:
Handle(Resource_Manager) myResMgr;
+ Handle(Resource_Manager) myResMgrUser;
};
#endif
#include <GEOMImpl_MeasureDriver.hxx>
#include <GEOMImpl_IMeasure.hxx>
+#include <GEOMAlgo_ShapeInfo.hxx>
+#include <GEOMAlgo_ShapeInfoFiller.hxx>
+
#include <GEOM_Function.hxx>
#include <GEOM_PythonDump.hxx>
-#include "utilities.h"
+#include <utilities.h>
#include <OpUtil.hxx>
#include <Utils_ExceptHandlers.hxx>
#include <TDF_Tool.hxx>
#include <BRep_Tool.hxx>
+#include <BRepAdaptor_Surface.hxx>
+#include <BRepBndLib.hxx>
#include <BRepCheck.hxx>
#include <BRepCheck_Result.hxx>
#include <BRepCheck_ListIteratorOfListOfStatus.hxx>
-#include <BRepGProp.hxx>
-#include <BRepBndLib.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
+#include <BRepGProp.hxx>
+#include <BRepTools.hxx>
#include <Bnd_Box.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <GeomAbs_SurfaceType.hxx>
#include <Geom_Surface.hxx>
#include <Geom_Plane.hxx>
+#include <Geom_SphericalSurface.hxx>
+#include <Geom_CylindricalSurface.hxx>
+#include <Geom_ToroidalSurface.hxx>
+#include <Geom_ConicalSurface.hxx>
+#include <Geom_SurfaceOfLinearExtrusion.hxx>
+#include <Geom_SurfaceOfRevolution.hxx>
+#include <Geom_BezierSurface.hxx>
+#include <Geom_BSplineSurface.hxx>
+#include <Geom_RectangularTrimmedSurface.hxx>
+#include <Geom_OffsetSurface.hxx>
+
#include <gp_Pln.hxx>
#include <Standard_Failure.hxx>
MESSAGE("GEOMImpl_IMeasureOperations::~GEOMImpl_IMeasureOperations");
}
+//=============================================================================
+/*! Get kind and parameters of the given shape.
+ */
+//=============================================================================
+GEOMImpl_IMeasureOperations::ShapeKind GEOMImpl_IMeasureOperations::KindOfShape
+ (Handle(GEOM_Object) theShape,
+ Handle(TColStd_HSequenceOfInteger)& theIntegers,
+ Handle(TColStd_HSequenceOfReal)& theDoubles)
+{
+ SetErrorCode(KO);
+ ShapeKind aKind = SK_NO_SHAPE;
+
+ if (theIntegers.IsNull()) theIntegers = new TColStd_HSequenceOfInteger;
+ else theIntegers->Clear();
+
+ if (theDoubles.IsNull()) theDoubles = new TColStd_HSequenceOfReal;
+ else theDoubles->Clear();
+
+ if (theShape.IsNull())
+ return aKind;
+
+ Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
+ if (aRefShape.IsNull()) return aKind;
+
+ TopoDS_Shape aShape = aRefShape->GetValue();
+ if (aShape.IsNull()) return aKind;
+
+ // Call algorithm
+ GEOMAlgo_ShapeInfoFiller aSF;
+ aSF.SetShape(aShape);
+ aSF.Perform();
+ Standard_Integer iErr = aSF.ErrorStatus();
+ if (iErr) {
+ SetErrorCode("Error in GEOMAlgo_ShapeInfoFiller");
+ return SK_NO_SHAPE;
+ }
+ const GEOMAlgo_ShapeInfo& anInfo = aSF.Info();
+
+ // Interprete results
+ TopAbs_ShapeEnum aType = anInfo.Type();
+ switch (aType)
+ {
+ case TopAbs_COMPOUND:
+ case TopAbs_COMPSOLID:
+ {
+ // (+) geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
+ // (+) geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
+ // ??? "nb_faces" - all faces or only 'standalone' faces?
+ if (aType == TopAbs_COMPOUND)
+ aKind = SK_COMPOUND;
+ else
+ aKind = SK_COMPSOLID;
+
+ //theIntegers->Append(anInfo.NbSubShapes(TopAbs_COMPOUND));
+ //theIntegers->Append(anInfo.NbSubShapes(TopAbs_COMPSOLID));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_SOLID));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_FACE));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
+ }
+ break;
+
+ case TopAbs_SHELL:
+ {
+ // (+) geompy.kind.SHELL geompy.info.closed nb_faces nb_edges nb_vertices
+ // (+) geompy.kind.SHELL geompy.info.unclosed nb_faces nb_edges nb_vertices
+ aKind = SK_SHELL;
+
+ theIntegers->Append((int)anInfo.KindOfClosed());
+
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_FACE));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
+ }
+ break;
+
+ case TopAbs_WIRE:
+ {
+ // (+) geompy.kind.WIRE geompy.info.closed nb_edges nb_vertices
+ // (+) geompy.kind.WIRE geompy.info.unclosed nb_edges nb_vertices
+ aKind = SK_WIRE;
+
+ theIntegers->Append((int)anInfo.KindOfClosed());
+
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
+ }
+ break;
+
+ case TopAbs_SOLID:
+ {
+ aKind = SK_SOLID;
+
+ GEOMAlgo_KindOfName aKN = anInfo.KindOfName();
+ switch (aKN)
+ {
+ case GEOMAlgo_KN_SPHERE:
+ // (+) geompy.kind.SPHERE xc yc zc R
+ {
+ aKind = SK_SPHERE;
+
+ gp_Pnt aC = anInfo.Location();
+ theDoubles->Append(aC.X());
+ theDoubles->Append(aC.Y());
+ theDoubles->Append(aC.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+ }
+ break;
+ case GEOMAlgo_KN_CYLINDER:
+ // (+) geompy.kind.CYLINDER xb yb zb dx dy dz R H
+ {
+ aKind = SK_CYLINDER;
+
+ gp_Pnt aC = anInfo.Location();
+ theDoubles->Append(aC.X());
+ theDoubles->Append(aC.Y());
+ theDoubles->Append(aC.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+ theDoubles->Append(anInfo.Height());
+ }
+ break;
+ case GEOMAlgo_KN_BOX:
+ // (+) geompy.kind.BOX xc yc zc ax ay az
+ {
+ aKind = SK_BOX;
+
+ gp_Pnt aC = anInfo.Location();
+ theDoubles->Append(aC.X());
+ theDoubles->Append(aC.Y());
+ theDoubles->Append(aC.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ gp_Dir aX = anAx3.XDirection();
+
+ // ax ay az
+ if (aD.IsParallel(gp::DZ(), Precision::Angular()) &&
+ aX.IsParallel(gp::DX(), Precision::Angular())) {
+ theDoubles->Append(anInfo.Length()); // ax'
+ theDoubles->Append(anInfo.Width()); // ay'
+ theDoubles->Append(anInfo.Height()); // az'
+ }
+ else if (aD.IsParallel(gp::DZ(), Precision::Angular()) &&
+ aX.IsParallel(gp::DY(), Precision::Angular())) {
+ theDoubles->Append(anInfo.Width()); // ay'
+ theDoubles->Append(anInfo.Length()); // ax'
+ theDoubles->Append(anInfo.Height()); // az'
+ }
+ else if (aD.IsParallel(gp::DX(), Precision::Angular()) &&
+ aX.IsParallel(gp::DZ(), Precision::Angular())) {
+ theDoubles->Append(anInfo.Height()); // az'
+ theDoubles->Append(anInfo.Width()); // ay'
+ theDoubles->Append(anInfo.Length()); // ax'
+ }
+ else if (aD.IsParallel(gp::DX(), Precision::Angular()) &&
+ aX.IsParallel(gp::DY(), Precision::Angular())) {
+ theDoubles->Append(anInfo.Height()); // az'
+ theDoubles->Append(anInfo.Length()); // ax'
+ theDoubles->Append(anInfo.Width()); // ay'
+ }
+ else if (aD.IsParallel(gp::DY(), Precision::Angular()) &&
+ aX.IsParallel(gp::DZ(), Precision::Angular())) {
+ theDoubles->Append(anInfo.Width()); // ay'
+ theDoubles->Append(anInfo.Height()); // az'
+ theDoubles->Append(anInfo.Length()); // ax'
+ }
+ else if (aD.IsParallel(gp::DY(), Precision::Angular()) &&
+ aX.IsParallel(gp::DX(), Precision::Angular())) {
+ theDoubles->Append(anInfo.Length()); // ax'
+ theDoubles->Append(anInfo.Height()); // az'
+ theDoubles->Append(anInfo.Width()); // ay'
+ }
+ else {
+ // (+) geompy.kind.ROTATED_BOX xo yo zo zx zy zz xx xy xz ax ay az
+ aKind = SK_ROTATED_BOX;
+
+ // Direction and XDirection
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theDoubles->Append(aX.X());
+ theDoubles->Append(aX.Y());
+ theDoubles->Append(aX.Z());
+
+ // ax ay az
+ theDoubles->Append(anInfo.Length());
+ theDoubles->Append(anInfo.Width());
+ theDoubles->Append(anInfo.Height());
+ }
+ }
+ break;
+ case GEOMAlgo_KN_TORUS:
+ // (+) geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
+ {
+ aKind = SK_TORUS;
+
+ gp_Pnt aO = anInfo.Location();
+ theDoubles->Append(aO.X());
+ theDoubles->Append(aO.Y());
+ theDoubles->Append(aO.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+ theDoubles->Append(anInfo.Radius2());
+ }
+ break;
+ case GEOMAlgo_KN_CONE:
+ // (+) geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
+ {
+ aKind = SK_CONE;
+
+ gp_Pnt aO = anInfo.Location();
+ theDoubles->Append(aO.X());
+ theDoubles->Append(aO.Y());
+ theDoubles->Append(aO.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+ theDoubles->Append(anInfo.Radius2());
+ theDoubles->Append(anInfo.Height());
+ }
+ break;
+ case GEOMAlgo_KN_POLYHEDRON:
+ // (+) geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
+ {
+ aKind = SK_POLYHEDRON;
+
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_FACE));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
+ }
+ break;
+ default:
+ // (+) geompy.kind.SOLID nb_faces nb_edges nb_vertices
+ {
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_FACE));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
+ }
+ }
+ }
+ break;
+
+ case TopAbs_FACE:
+ {
+ aKind = SK_FACE;
+
+ GEOMAlgo_KindOfName aKN = anInfo.KindOfName();
+ switch (aKN) {
+ case GEOMAlgo_KN_SPHERE:
+ // (+) geompy.kind.SPHERE2D xc yc zc R
+ {
+ aKind = SK_SPHERE2D;
+
+ gp_Pnt aC = anInfo.Location();
+ theDoubles->Append(aC.X());
+ theDoubles->Append(aC.Y());
+ theDoubles->Append(aC.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+ }
+ break;
+ case GEOMAlgo_KN_CYLINDER:
+ // (+) geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
+ {
+ aKind = SK_CYLINDER2D;
+
+ gp_Pnt aO = anInfo.Location();
+ theDoubles->Append(aO.X());
+ theDoubles->Append(aO.Y());
+ theDoubles->Append(aO.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+ theDoubles->Append(anInfo.Height());
+ }
+ break;
+ case GEOMAlgo_KN_TORUS:
+ // (+) geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
+ {
+ aKind = SK_TORUS2D;
+
+ gp_Pnt aO = anInfo.Location();
+ theDoubles->Append(aO.X());
+ theDoubles->Append(aO.Y());
+ theDoubles->Append(aO.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+ theDoubles->Append(anInfo.Radius2());
+ }
+ break;
+ case GEOMAlgo_KN_CONE:
+ // (+) geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
+ {
+ aKind = SK_CONE2D;
+
+ gp_Pnt aO = anInfo.Location();
+ theDoubles->Append(aO.X());
+ theDoubles->Append(aO.Y());
+ theDoubles->Append(aO.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+ theDoubles->Append(anInfo.Radius2());
+ theDoubles->Append(anInfo.Height());
+ }
+ break;
+ case GEOMAlgo_KN_DISKCIRCLE:
+ // (+) geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
+ {
+ aKind = SK_DISK_CIRCLE;
+
+ gp_Pnt aC = anInfo.Location();
+ theDoubles->Append(aC.X());
+ theDoubles->Append(aC.Y());
+ theDoubles->Append(aC.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+ }
+ break;
+ case GEOMAlgo_KN_DISKELLIPSE:
+ // (+) geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
+ {
+ aKind = SK_DISK_ELLIPSE;
+
+ gp_Pnt aC = anInfo.Location();
+ theDoubles->Append(aC.X());
+ theDoubles->Append(aC.Y());
+ theDoubles->Append(aC.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+ theDoubles->Append(anInfo.Radius2());
+ }
+ break;
+ case GEOMAlgo_KN_RECTANGLE:
+ case GEOMAlgo_KN_TRIANGLE:
+ case GEOMAlgo_KN_QUADRANGLE:
+ case GEOMAlgo_KN_POLYGON:
+ // (+) geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
+ {
+ aKind = SK_POLYGON;
+
+ gp_Pnt aO = anInfo.Location();
+ theDoubles->Append(aO.X());
+ theDoubles->Append(aO.Y());
+ theDoubles->Append(aO.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
+ }
+ break;
+ case GEOMAlgo_KN_PLANE: // infinite
+ // (+) geompy.kind.PLANE xo yo zo dx dy dz
+ {
+ aKind = SK_PLANE;
+
+ gp_Pnt aC = anInfo.Location();
+ theDoubles->Append(aC.X());
+ theDoubles->Append(aC.Y());
+ theDoubles->Append(aC.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+ }
+ break;
+ default:
+ if (anInfo.KindOfShape() == GEOMAlgo_KS_PLANE) {
+ // (+) geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
+
+ aKind = SK_PLANAR;
+
+ gp_Pnt aC = anInfo.Location();
+ theDoubles->Append(aC.X());
+ theDoubles->Append(aC.Y());
+ theDoubles->Append(aC.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
+ }
+ else {
+ // ??? geompy.kind.FACE nb_edges nb_vertices _surface_type_id_
+ // (+) geompy.kind.FACE nb_edges nb_vertices
+
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
+ }
+ }
+ }
+ break;
+
+ case TopAbs_EDGE:
+ {
+ aKind = SK_EDGE;
+
+ GEOMAlgo_KindOfName aKN = anInfo.KindOfName();
+ switch (aKN) {
+ case GEOMAlgo_KN_CIRCLE:
+ {
+ // (+) geompy.kind.CIRCLE xc yc zc dx dy dz R
+ aKind = SK_CIRCLE;
+
+ gp_Pnt aC = anInfo.Location();
+ theDoubles->Append(aC.X());
+ theDoubles->Append(aC.Y());
+ theDoubles->Append(aC.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+ }
+ break;
+ case GEOMAlgo_KN_ARCCIRCLE:
+ {
+ // (+) geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
+ aKind = SK_ARC_CIRCLE;
+
+ gp_Pnt aC = anInfo.Location();
+ theDoubles->Append(aC.X());
+ theDoubles->Append(aC.Y());
+ theDoubles->Append(aC.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+
+ gp_Pnt aP1 = anInfo.Pnt1();
+ theDoubles->Append(aP1.X());
+ theDoubles->Append(aP1.Y());
+ theDoubles->Append(aP1.Z());
+
+ gp_Pnt aP2 = anInfo.Pnt2();
+ theDoubles->Append(aP2.X());
+ theDoubles->Append(aP2.Y());
+ theDoubles->Append(aP2.Z());
+ }
+ break;
+ case GEOMAlgo_KN_ELLIPSE:
+ {
+ // (+) geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
+ aKind = SK_ELLIPSE;
+
+ gp_Pnt aC = anInfo.Location();
+ theDoubles->Append(aC.X());
+ theDoubles->Append(aC.Y());
+ theDoubles->Append(aC.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+ theDoubles->Append(anInfo.Radius2());
+ }
+ break;
+ case GEOMAlgo_KN_ARCELLIPSE:
+ {
+ // (+) geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
+ aKind = SK_ARC_ELLIPSE;
+
+ gp_Pnt aC = anInfo.Location();
+ theDoubles->Append(aC.X());
+ theDoubles->Append(aC.Y());
+ theDoubles->Append(aC.Z());
+
+ gp_Ax3 anAx3 = anInfo.Position();
+ gp_Dir aD = anAx3.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+
+ theDoubles->Append(anInfo.Radius1());
+ theDoubles->Append(anInfo.Radius2());
+
+ gp_Pnt aP1 = anInfo.Pnt1();
+ theDoubles->Append(aP1.X());
+ theDoubles->Append(aP1.Y());
+ theDoubles->Append(aP1.Z());
+
+ gp_Pnt aP2 = anInfo.Pnt2();
+ theDoubles->Append(aP2.X());
+ theDoubles->Append(aP2.Y());
+ theDoubles->Append(aP2.Z());
+ }
+ break;
+ case GEOMAlgo_KN_LINE:
+ {
+ // ??? geompy.kind.LINE x1 y1 z1 x2 y2 z2
+ // (+) geompy.kind.LINE x1 y1 z1 dx dy dz
+ aKind = SK_LINE;
+
+ gp_Pnt aO = anInfo.Location();
+ theDoubles->Append(aO.X());
+ theDoubles->Append(aO.Y());
+ theDoubles->Append(aO.Z());
+
+ gp_Dir aD = anInfo.Direction();
+ theDoubles->Append(aD.X());
+ theDoubles->Append(aD.Y());
+ theDoubles->Append(aD.Z());
+ }
+ break;
+ case GEOMAlgo_KN_SEGMENT:
+ {
+ // (+) geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
+ aKind = SK_SEGMENT;
+
+ gp_Pnt aP1 = anInfo.Pnt1();
+ theDoubles->Append(aP1.X());
+ theDoubles->Append(aP1.Y());
+ theDoubles->Append(aP1.Z());
+
+ gp_Pnt aP2 = anInfo.Pnt2();
+ theDoubles->Append(aP2.X());
+ theDoubles->Append(aP2.Y());
+ theDoubles->Append(aP2.Z());
+ }
+ break;
+ default:
+ // ??? geompy.kind.EDGE nb_vertices _curve_type_id_
+ // (+) geompy.kind.EDGE nb_vertices
+ theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
+ }
+ }
+ break;
+
+ case TopAbs_VERTEX:
+ {
+ // (+) geompy.kind.VERTEX x y z
+ aKind = SK_VERTEX;
+
+ gp_Pnt aP = anInfo.Location();
+ theDoubles->Append(aP.X());
+ theDoubles->Append(aP.Y());
+ theDoubles->Append(aP.Z());
+ }
+ break;
+ }
+
+ SetErrorCode(OK);
+ return aKind;
+}
//=============================================================================
/*! Get LCS, corresponding to the given shape.
#include <TopTools_HSequenceOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TCollection_AsciiString.hxx>
+#include <TColStd_HSequenceOfInteger.hxx>
+#include <TColStd_HSequenceOfReal.hxx>
#include <gp_Ax3.hxx>
class GEOM_Engine;
Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine, int theDocID);
Standard_EXPORT ~GEOMImpl_IMeasureOperations();
+ enum ShapeKind {
+ SK_NO_SHAPE,
+ // COMPOSITEs
+ SK_COMPOUND,
+ SK_COMPSOLID,
+ SK_SHELL,
+ SK_WIRE,
+ // SOLIDs
+ SK_SPHERE, // full sphere
+ SK_CYLINDER, // cylinder
+ SK_BOX, // box with faces, parallel to global coordinate planes
+ SK_ROTATED_BOX, // other box
+ SK_TORUS, // full torus
+ SK_CONE, // cone
+ SK_POLYHEDRON, // solid, bounded by polygons
+ SK_SOLID, // other solid
+ // FACEs
+ SK_SPHERE2D, // spherical face (closed)
+ SK_CYLINDER2D, // cylindrical face with defined height
+ SK_TORUS2D, // toroidal face (closed)
+ SK_CONE2D, // conical face with defined height
+ SK_DISK_CIRCLE, // planar, bounded by circle
+ SK_DISK_ELLIPSE, // planar, bounded by ellipse
+ SK_POLYGON, // planar, bounded by segments
+ SK_PLANE, // infinite planar
+ SK_PLANAR, // other planar
+ SK_FACE, // other face
+ // EDGEs
+ SK_CIRCLE, // full circle
+ SK_ARC_CIRCLE, // arc of circle
+ SK_ELLIPSE, // full ellipse
+ SK_ARC_ELLIPSE, // arc of ellipse
+ SK_LINE, // infinite segment
+ SK_SEGMENT, // segment
+ SK_EDGE, // other edge
+ // VERTEX
+ SK_VERTEX
+ };
+
+ Standard_EXPORT ShapeKind KindOfShape (Handle(GEOM_Object) theShape,
+ Handle(TColStd_HSequenceOfInteger)& theIntegers,
+ Handle(TColStd_HSequenceOfReal)& theDoubles);
+
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,
GEOMImpl_IPipeDiffSect(const Handle(GEOM_Function)& theFunction):GEOMImpl_IPipe(theFunction) {}
void SetBases (const Handle(TColStd_HSequenceOfTransient)& theBases)
- { _func->SetReferenceList(PIPEDS_LIST_BASES,theBases); }
+ {
+ _func->SetReferenceList(PIPEDS_LIST_BASES,theBases);
+ }
Handle(TColStd_HSequenceOfTransient) GetBases ()
{
Handle(TColStd_HSequenceOfTransient) aBases = _func->GetReferenceList(PIPEDS_LIST_BASES);
return aBases;
- }
+ }
void SetLocations (const Handle(TColStd_HSequenceOfTransient)& theLocations)
{ _func->SetReferenceList(PIPEDS_LIST_LOCATIONS,theLocations); }
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//NOTE: This is an intreface to a function for the Pipe creation.
+
+#ifndef _GEOMImpl_IPIPESHELLSECT_HXX_
+#define _GEOMImpl_IPIPESHELLSECT_HXX_
+
+#include "GEOM_Function.hxx"
+
+#ifndef _GEOMImpl_IPIPEDIFFSECT_HXX_
+#include "GEOMImpl_IPipeDiffSect.hxx"
+#endif
+
+#define PIPEDS_LIST_SUBBASES 6
+
+
+class GEOMImpl_IPipeShellSect : public GEOMImpl_IPipeDiffSect
+{
+ public:
+
+ GEOMImpl_IPipeShellSect(const Handle(GEOM_Function)& theFunction):
+ GEOMImpl_IPipeDiffSect(theFunction) {}
+
+ void SetSubBases (const Handle(TColStd_HSequenceOfTransient)& theSubBases)
+ {
+ _func->SetReferenceList(PIPEDS_LIST_SUBBASES,theSubBases);
+ }
+
+ Handle(TColStd_HSequenceOfTransient) GetSubBases ()
+ {
+ Handle(TColStd_HSequenceOfTransient) aSubBases =
+ _func->GetReferenceList(PIPEDS_LIST_SUBBASES);
+ return aSubBases;
+ }
+
+};
+
+#endif
#include "GEOMAlgo_FinderShapeOn2.hxx"
#include "GEOMAlgo_ClsfBox.hxx"
//#include "GEOMAlgo_ClsfSurf.hxx"
+#include "GEOMAlgo_Gluer1.hxx"
+#include "GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx"
+#include "GEOMAlgo_CoupleOfShapes.hxx"
+#include "GEOMAlgo_ListOfCoupleOfShapes.hxx"
#include "utilities.h"
#include "OpUtil.hxx"
return aGlued;
}
+//=============================================================================
+/*!
+ * GetGlueFaces
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetGlueFaces
+ (Handle(GEOM_Object) theShape,
+ const Standard_Real theTolerance)
+{
+ SetErrorCode(KO);
+
+ if (theShape.IsNull()) return NULL;
+ TopoDS_Shape aShape = theShape->GetValue();
+ if (aShape.IsNull()) return NULL;
+
+ Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+
+ Standard_Integer iErr;
+ TopoDS_Shape aS;
+ GEOMAlgo_Gluer1 aGluer;
+ GEOMAlgo_ListIteratorOfListOfCoupleOfShapes aItCS;
+ GEOMAlgo_CoupleOfShapes aCS;
+ GEOMAlgo_ListOfCoupleOfShapes aLCS;
+
+ //aGluer = new GEOMAlgo_Gluer1;
+ aGluer.SetShape(aShape);
+ aGluer.SetTolerance(theTolerance);
+ aGluer.Perform();
+ iErr = aGluer.ErrorStatus();
+ if (iErr) return NULL;
+
+ TopTools_ListOfShape listShape;
+ const GEOMAlgo_ListOfCoupleOfShapes& aLCSG = aGluer.GluedFaces();
+ // Access to faces
+ aItCS.Initialize(aLCSG);
+ for (; aItCS.More(); aItCS.Next()) {
+ const GEOMAlgo_CoupleOfShapes& aCSG = aItCS.Value();
+ listShape.Append(aCSG.Shape1());
+ }
+
+ TopTools_ListIteratorOfListOfShape itSub (listShape);
+ TCollection_AsciiString anAsciiList, anEntry;
+ TopTools_IndexedMapOfShape anIndices;
+ TopExp::MapShapes(aShape, anIndices);
+ Handle(TColStd_HArray1OfInteger) anArray;
+ Handle(GEOM_Object) anObj;
+ for (int index = 1; itSub.More(); itSub.Next(), ++index) {
+ TopoDS_Shape aValue = itSub.Value();
+ anArray = new TColStd_HArray1OfInteger(1,1);
+ anArray->SetValue(1, anIndices.FindIndex(aValue));
+ anObj = GetEngine()->AddSubShape(theShape, anArray);
+ if (!anObj.IsNull()) {
+ aSeq->Append(anObj);
+
+ // for python command
+ TDF_Tool::Entry(anObj->GetEntry(), anEntry);
+ anAsciiList += anEntry;
+ anAsciiList += ",";
+ }
+ }
+
+ //Make a Python command
+ if(anAsciiList.Length()>0)
+ anAsciiList.Trunc(anAsciiList.Length() - 1);
+ Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
+ GEOM::TPythonDump pd (aFunction, /*append=*/true);
+ pd << "[" << anAsciiList.ToCString();
+ pd << "] = geompy.GetGlueFaces" << theShape << ", " << theTolerance << ")";
+
+ SetErrorCode(OK);
+
+ return aSeq;
+}
+
+
+//=============================================================================
+/*!
+ * MakeGlueFacesByList
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFacesByList
+ (Handle(GEOM_Object) theShape,
+ const Standard_Real theTolerance,
+ list<Handle(GEOM_Object)> theFaces)
+{
+ SetErrorCode(KO);
+
+ if (theShape.IsNull()) return NULL;
+
+ //Add a new Glued object
+ Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
+
+ //Add a new Glue function
+ Handle(GEOM_Function) aFunction;
+ aFunction = aGlued->AddFunction(GEOMImpl_GlueDriver::GetID(), GLUE_FACES_BY_LIST);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_GlueDriver::GetID()) return NULL;
+
+ GEOMImpl_IGlue aCI (aFunction);
+
+ Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
+ if (aRefShape.IsNull()) return NULL;
+
+ aCI.SetBase(aRefShape);
+ aCI.SetTolerance(theTolerance);
+ Handle(TColStd_HSequenceOfTransient) aFaces = new TColStd_HSequenceOfTransient;
+ list<Handle(GEOM_Object)>::iterator it = theFaces.begin();
+ for (; it != theFaces.end(); it++) {
+ Handle(GEOM_Function) aRefSh = (*it)->GetLastFunction();
+ if (aRefSh.IsNull()) {
+ SetErrorCode("NULL argument shape for the shape construction");
+ return NULL;
+ }
+ aFaces->Append(aRefSh);
+ }
+ aCI.SetFaces(aFaces);
+
+ //Compute the sub-shape value
+ Standard_Boolean isWarning = Standard_False;
+ try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("Shape driver failed to glue faces");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ // to provide warning
+ if (!aFunction->GetValue().IsNull()) {
+ isWarning = Standard_True;
+ } else {
+ return NULL;
+ }
+ }
+
+ //Make a Python command
+
+ GEOM::TPythonDump pd(aFunction);
+ pd << aGlued << " = geompy.MakeGlueFacesByList("
+ << theShape << ", " << theTolerance << ", [";
+ // Faces
+ it = theFaces.begin();
+ if (it != theFaces.end()) {
+ pd << (*it++);
+ while (it != theFaces.end()) {
+ pd << ", " << (*it++);
+ }
+ }
+ pd << "])";
+
+
+ // to provide warning
+ if (!isWarning) SetErrorCode(OK);
+ return aGlued;
+}
+
+
+
//=============================================================================
/*!
* MakeExplode
Standard_EXPORT Handle(GEOM_Object) MakeCompound (list<Handle(GEOM_Object)> theShapes);
Standard_EXPORT Handle(GEOM_Object) MakeGlueFaces (Handle(GEOM_Object) theShape,
- const Standard_Real theTolerance);
+ const Standard_Real theTolerance);
+
+ Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetGlueFaces (Handle(GEOM_Object) theShape,
+ const Standard_Real theTolerance);
+
+ Standard_EXPORT Handle(GEOM_Object) MakeGlueFacesByList (Handle(GEOM_Object) theShape,
+ const Standard_Real theTolerance,
+ list<Handle(GEOM_Object)> theFaces);
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeExplode (Handle(GEOM_Object) theShape,
const Standard_Integer theShapeType,
const Handle(GEOM_Object)& theAx1,
const GEOMAlgo_State theState);
- Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnPlaneWithLocation (const Handle(GEOM_Object)& theShape,
- const Standard_Integer theShapeType,
- const Handle(GEOM_Object)& theAx1,
- const Handle(GEOM_Object)& thePnt,
- const GEOMAlgo_State theState);
+ Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
+ GetShapesOnPlaneWithLocation (const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ const Handle(GEOM_Object)& theAx1,
+ const Handle(GEOM_Object)& thePnt,
+ const GEOMAlgo_State theState);
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnCylinder (const Handle(GEOM_Object)& theShape,
const Handle(GEOM_Object)& theAx1,
const GEOMAlgo_State theState);
- Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnPlaneWithLocationIDs (const Handle(GEOM_Object)& theShape,
- const Standard_Integer theShapeType,
- const Handle(GEOM_Object)& theAx1,
- const Handle(GEOM_Object)& thePnt,
- const GEOMAlgo_State theState);
+ Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
+ GetShapesOnPlaneWithLocationIDs (const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ const Handle(GEOM_Object)& theAx1,
+ const Handle(GEOM_Object)& thePnt,
+ const GEOMAlgo_State theState);
Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnCylinderIDs (const Handle(GEOM_Object)& theShape,
const Standard_Integer theShapeType,
const Standard_Real theRadius);
Standard_EXPORT Handle(GEOM_Object) GetInPlace (Handle(GEOM_Object) theShapeWhere,
- Handle(GEOM_Object) theShapeWhat);
+ Handle(GEOM_Object) theShapeWhat);
Standard_EXPORT static void SortShapes (TopTools_ListOfShape& SL);
/*!
* \brief Searches a shape equal to theWhat in the context of theWhere
* \param theShapeWhere - a context shap
- * \param theShapeWhat - a sample shape
+ * \param theShapeWhat - a sample shape
* \retval Handle(GEOM_Object) - found shape
*/
- Standard_EXPORT Handle(GEOM_Object) GetSame(const Handle(GEOM_Object)& theShapeWhere,
- const Handle(GEOM_Object)& theShapeWhat);
+ Standard_EXPORT Handle(GEOM_Object) GetSame(const Handle(GEOM_Object)& theShapeWhere,
+ const Handle(GEOM_Object)& theShapeWhat);
/*!
* \brief Find IDs of subshapes complying with given status about surface
* \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
*/
Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
- GEOMImpl_IShapesOperations::GetShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
- const Handle(GEOM_Object)& theShape,
- const Standard_Integer theShapeType,
- GEOMAlgo_State theState);
+ GetShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
+ const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ GEOMAlgo_State theState);
/*!
* \brief Find subshapes complying with given status about surface
* \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
*/
Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
- GEOMImpl_IShapesOperations::GetShapesOnBox(const Handle(GEOM_Object)& theBox,
- const Handle(GEOM_Object)& theShape,
- const Standard_Integer theShapeType,
- GEOMAlgo_State theState);
-
+ GetShapesOnBox(const Handle(GEOM_Object)& theBox,
+ const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ GEOMAlgo_State theState);
private:
Handle(GEOM_Object) MakeShape (list<Handle(GEOM_Object)> theShapes,
const Handle(GEOM_Object)& theShape,
TopAbs_ShapeEnum theShapeType,
GEOMAlgo_State theState,
- TCollection_AsciiString & theShapeEntries
- );
+ TCollection_AsciiString & theShapeEntries);
/*!
* \brief Find IDs of subshapes complying with given status about quadrangle
* \param theState - required state
* \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
*/
- Handle(TColStd_HSequenceOfInteger)
- GEOMImpl_IShapesOperations::getShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
- const Handle(GEOM_Object)& theShape,
- const Standard_Integer theShapeType,
- GEOMAlgo_State theState);
+ Handle(TColStd_HSequenceOfInteger) getShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
+ const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ GEOMAlgo_State theState);
/*!
* \brief Find shape objects and their entries by their ids
#include <TopoDS_Wire.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
+#include <TopoDS_Solid.hxx>
+#include <TopoDS_Shell.hxx>
+#include <TopoDS_Face.hxx>
#include <BRepOffsetAPI_MakePipeShell.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <GEOMImpl_IPipeDiffSect.hxx>
+#include <GEOMImpl_IPipeShellSect.hxx>
#include <Standard_NullObject.hxx>
#include <Standard_TypeMismatch.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <BRep_Builder.hxx>
#include <TopoDS_Compound.hxx>
+#include <ShapeAnalysis_FreeBounds.hxx>
+#include <TColgp_SequenceOfPnt.hxx>
+#include <ShapeAnalysis_Edge.hxx>
+#include <TopTools_IndexedDataMapOfShapeShape.hxx>
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopExp.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <GeomAPI_ProjectPointOnCurve.hxx>
+#include <Precision.hxx>
+#include <Geom_TrimmedCurve.hxx>
+#include <BRepBuilderAPI_Sewing.hxx>
+
+//#include <BRepTools.hxx>
+
//=======================================================================
//function : GetID
{
}
+
+//=======================================================================
+//function : FillForOtherEdges
+//purpose : auxilary for CreatePipeForShellSections()
+//=======================================================================
+static bool FillForOtherEdges(const TopoDS_Shape& F1,
+ const TopoDS_Shape& E1,
+ const TopoDS_Shape& V1,
+ TopTools_IndexedDataMapOfShapeShape& FF)
+{
+ //cout<<"FillForOtherEdges"<<endl;
+ // find other pairs for vertexes and edges
+ // creating map of vertex edges for both faces
+ TopTools_IndexedDataMapOfShapeListOfShape aMapVertEdge1;
+ TopExp::MapShapesAndAncestors(F1, TopAbs_VERTEX, TopAbs_EDGE, aMapVertEdge1);
+ const TopoDS_Shape& F2 = FF.FindFromKey(F1);
+ const TopoDS_Shape& E2 = FF.FindFromKey(E1);
+ const TopoDS_Shape& V2 = FF.FindFromKey(V1);
+ TopTools_IndexedDataMapOfShapeListOfShape aMapVertEdge2;
+ TopExp::MapShapesAndAncestors(F2, TopAbs_VERTEX, TopAbs_EDGE, aMapVertEdge2);
+
+ TopoDS_Edge ES1 = TopoDS::Edge(E1);
+ TopoDS_Edge ES2 = TopoDS::Edge(E2);
+ TopoDS_Shape VS1 = V1;
+ TopoDS_Shape VS2 = V2;
+
+ ShapeAnalysis_Edge sae;
+ while(1) {
+ const TopTools_ListOfShape& aList1 = aMapVertEdge1.FindFromKey(VS1);
+ //TopoDS_Shape E1next;
+ TopTools_ListIteratorOfListOfShape anIter1(aList1);
+ if(anIter1.Value().IsSame(ES1)) {
+ anIter1.Next();
+ }
+ //E1next = anIter1.Value();
+ const TopTools_ListOfShape& aList2 = aMapVertEdge2.FindFromKey(VS2);
+ //TopoDS_Shape E2next;
+ TopTools_ListIteratorOfListOfShape anIter2(aList2);
+ if(anIter2.Value().IsSame(ES2)) {
+ anIter2.Next();
+ }
+ //E2next = anIter2.Value();
+ //ES1 = TopoDS::Edge(E1next);
+ //ES2 = TopoDS::Edge(E2next);
+ ES1 = TopoDS::Edge(anIter1.Value());
+ ES2 = TopoDS::Edge(anIter2.Value());
+ if(!FF.Contains(ES1)) {
+ FF.Add(ES1,ES2);
+ }
+ if(VS1.IsSame(sae.FirstVertex(ES1)))
+ VS1 = sae.LastVertex(ES1);
+ else
+ VS1 = sae.FirstVertex(ES1);
+ if(VS2.IsSame(sae.FirstVertex(ES2)))
+ VS2 = sae.LastVertex(ES2);
+ else
+ VS2 = sae.FirstVertex(ES2);
+ if(VS1.IsSame(V1))
+ break;
+ if(!FF.Contains(VS1)) {
+ FF.Add(VS1,VS2);
+ }
+ }
+
+ return true;
+}
+
+
+//=======================================================================
+//function : FillCorrespondingEdges
+//purpose : auxilary for CreatePipeForShellSections()
+//=======================================================================
+static bool FillCorrespondingEdges(const TopoDS_Shape& FS1,
+ const TopoDS_Shape& FS2,
+ const TopoDS_Vertex& aLoc1,
+ const TopoDS_Vertex& aLoc2,
+ const TopoDS_Wire& aWirePath,
+ TopTools_IndexedDataMapOfShapeShape& FF)
+{
+ //cout<<"FillCorrespondingEdges"<<endl;
+ // find corresponding edges
+ TopExp_Explorer expw1(FS1,TopAbs_WIRE);
+ TopoDS_Wire aWire1 = TopoDS::Wire(expw1.Current());
+ //exp = TopExp_Explorer(FS2,TopAbs_WIRE);
+ TopExp_Explorer expw2(FS2,TopAbs_WIRE);
+ TopoDS_Wire aWire2 = TopoDS::Wire(expw2.Current());
+ BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
+ aBuilder.Add(aWire1, aLoc1);
+ aBuilder.Add(aWire2, aLoc2);
+ if(!aBuilder.IsReady()) {
+ return false;
+ }
+ aBuilder.Build();
+ TopoDS_Shape aShape = aBuilder.Shape();
+ /*
+ TopoDS_Compound C;
+ BRep_Builder B;
+ B.MakeCompound(C);
+ B.Add(C,aShape);
+ B.Add(C,FS1);
+ B.Add(C,FS2);
+ BRepTools::Write(C,"/dn02/users_Linux/skl/work/Bugs/14857/comp.brep");
+ */
+ ShapeAnalysis_Edge sae;
+ double tol = Max( BRep_Tool::Tolerance(TopoDS::Face(FS1)),
+ BRep_Tool::Tolerance(TopoDS::Face(FS2)) );
+ TopTools_MapOfShape Vs1,Vs2;
+ TopExp_Explorer exp;
+ exp.Init( FS1, TopAbs_EDGE );
+ TopoDS_Edge E1 = TopoDS::Edge(exp.Current());
+ TopoDS_Vertex V11 = sae.FirstVertex(E1);
+ TopoDS_Vertex V21 = sae.LastVertex(E1);
+ gp_Pnt P11 = BRep_Tool::Pnt(V11);
+ gp_Pnt P21 = BRep_Tool::Pnt(V21);
+ //cout<<"P11("<<P11.X()<<","<<P11.Y()<<","<<P11.Z()<<")"<<endl;
+ //cout<<"P21("<<P21.X()<<","<<P21.Y()<<","<<P21.Z()<<")"<<endl;
+ // find corresponding vertexes from created shape
+ TopoDS_Vertex VN11,VN21;
+ for( exp.Init( aShape, TopAbs_VERTEX ); exp.More(); exp.Next() ) {
+ TopoDS_Vertex V = TopoDS::Vertex(exp.Current());
+ gp_Pnt P = BRep_Tool::Pnt(V);
+ if(P.Distance(P11)<tol) {
+ VN11 = V;
+ }
+ if(P.Distance(P21)<tol) {
+ VN21 = V;
+ }
+ }
+ // find edge contains VN11 and VN21 and corresponding vertexes
+ TopoDS_Vertex VN12,VN22;
+ for( exp.Init( aShape, TopAbs_FACE ); exp.More(); exp.Next() ) {
+ TopoDS_Shape F = exp.Current();
+ TopExp_Explorer expe;
+ bool IsFind = false;
+ for( expe.Init( F, TopAbs_EDGE ); expe.More(); expe.Next() ) {
+ TopoDS_Edge E = TopoDS::Edge(expe.Current());
+ TopoDS_Vertex VF = sae.FirstVertex(E);
+ TopoDS_Vertex VL = sae.LastVertex(E);
+ if( (VF.IsSame(VN11) && VL.IsSame(VN21)) || (VF.IsSame(VN21) && VL.IsSame(VN11)) ) {
+ IsFind = true;
+ break;
+ }
+ }
+ if(IsFind) {
+ for( expe.Init( F, TopAbs_EDGE ); expe.More(); expe.Next() ) {
+ TopoDS_Edge E = TopoDS::Edge(expe.Current());
+ TopoDS_Vertex VF = sae.FirstVertex(E);
+ TopoDS_Vertex VL = sae.LastVertex(E);
+ if( VF.IsSame(VN11) && !VL.IsSame(VN21) )
+ VN12 = VL;
+ if( VL.IsSame(VN11) && !VF.IsSame(VN21) )
+ VN12 = VF;
+ if( VF.IsSame(VN21) && !VL.IsSame(VN11) )
+ VN22 = VL;
+ if( VL.IsSame(VN21) && !VF.IsSame(VN11) )
+ VN22 = VF;
+ }
+ break;
+ }
+ }
+ // find vertexes from FS2 corresponded to VN12 and VN22
+ // and find edge from FS2 contains V12 and V22,
+ // this edge will be corresponded to edge E1
+ TopoDS_Vertex V12,V22;
+ gp_Pnt PN12 = BRep_Tool::Pnt(VN12);
+ gp_Pnt PN22 = BRep_Tool::Pnt(VN22);
+ //cout<<"PN12("<<PN12.X()<<","<<PN12.Y()<<","<<PN12.Z()<<")"<<endl;
+ //cout<<"PN22("<<PN22.X()<<","<<PN22.Y()<<","<<PN22.Z()<<")"<<endl;
+ TopoDS_Edge E2;
+ TopExp_Explorer expe;
+ for( expe.Init( FS2, TopAbs_EDGE ); expe.More(); expe.Next() ) {
+ TopoDS_Edge E = TopoDS::Edge(expe.Current());
+ TopoDS_Vertex VF = sae.FirstVertex(E);
+ TopoDS_Vertex VL = sae.LastVertex(E);
+ gp_Pnt PF = BRep_Tool::Pnt(VF);
+ gp_Pnt PL = BRep_Tool::Pnt(VL);
+ if( PF.Distance(PN12)<tol && PL.Distance(PN22)<tol ) {
+ V12 = VF;
+ V22 = VL;
+ E2 = E;
+ break;
+ }
+ if( PF.Distance(PN22)<tol && PL.Distance(PN12)<tol ) {
+ V12 = VL;
+ V22 = VF;
+ E2 = E;
+ break;
+ }
+ }
+ FF.Add(V11,V12);
+ FF.Add(V21,V22);
+ FF.Add(E1,E2);
+
+ // find other pairs for vertexes and edges
+ // creating map of vertex edges for both faces
+ return FillForOtherEdges(FS1,E1,V21,FF);
+
+ //return true;
+}
+
+
+//=======================================================================
+//function : FindNextPairOfFaces
+//purpose : auxilary for CreatePipeForShellSections()
+//=======================================================================
+static void FindNextPairOfFaces(const TopoDS_Shape& aCurFace,
+ TopTools_IndexedDataMapOfShapeListOfShape& aMapEdgeFaces1,
+ TopTools_IndexedDataMapOfShapeListOfShape& aMapEdgeFaces2,
+ TopTools_IndexedDataMapOfShapeShape& FF,
+ GEOMImpl_IPipe* aCI)
+{
+ //cout<<"FindNextPairOfFaces"<<endl;
+ TopExp_Explorer anExp;
+ for ( anExp.Init( aCurFace, TopAbs_EDGE ); anExp.More(); anExp.Next() ) {
+ TopoDS_Shape E1 = anExp.Current();
+ if(!FF.Contains(E1)) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("FindNextPairOfFaces: Can not find edge in map");
+ }
+ const TopoDS_Shape& E2 = FF.FindFromKey(E1);
+ TopExp_Explorer anExpV;
+ anExpV.Init( E1, TopAbs_VERTEX );
+ TopoDS_Shape V1 = anExpV.Current();
+ if(!FF.Contains(V1)) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("FindNextPairOfFaces: Can not find vertex in map");
+ }
+
+ const TopTools_ListOfShape& aList1 = aMapEdgeFaces1.FindFromKey(E1);
+ if(aList1.Extent()<2)
+ continue;
+ TopTools_ListIteratorOfListOfShape anIter(aList1);
+ if(anIter.Value().IsEqual(aCurFace)) {
+ anIter.Next();
+ }
+ TopoDS_Shape F1other = anIter.Value();
+ if(FF.Contains(F1other))
+ continue;
+
+ const TopoDS_Shape& F2 = FF.FindFromKey(aCurFace);
+ const TopTools_ListOfShape& aList2 = aMapEdgeFaces2.FindFromKey(E2);
+ if(aList2.Extent()<2) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("FindNextPairOfFaces: Can not find corresponding face");
+ }
+ TopTools_ListIteratorOfListOfShape anIter2(aList2);
+ if(anIter2.Value().IsEqual(F2)) {
+ anIter2.Next();
+ }
+ TopoDS_Shape F2other = anIter2.Value();
+ FF.Add(F1other,F2other);
+
+ // add pairs of edges to FF
+ bool stat = FillForOtherEdges(F1other,E1,V1,FF);
+ if( !stat ) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("FindNextPairOfFaces: Can not mapping other egdes");
+ }
+
+ FindNextPairOfFaces(F1other, aMapEdgeFaces1, aMapEdgeFaces2, FF, aCI);
+
+ }
+}
+
+
+//=======================================================================
+//function : CreatePipeForShellSections
+//purpose : auxilary for Execute()
+//=======================================================================
+static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
+ GEOMImpl_IPipe* aCI)
+{
+ //cout<<"CreatePipeForShellSections"<<endl;
+ //TopoDS_Shape res;
+ int i,j;
+ BRep_Builder B;
+
+ GEOMImpl_IPipeShellSect* aCIDS = (GEOMImpl_IPipeShellSect*)aCI;
+ Handle(TColStd_HSequenceOfTransient) aBasesObjs = aCIDS->GetBases();
+ Handle(TColStd_HSequenceOfTransient) aSubBasesObjs = aCIDS->GetSubBases();
+ Handle(TColStd_HSequenceOfTransient) aLocObjs = aCIDS->GetLocations();
+ Standard_Boolean aWithContact = (aCIDS->GetWithContactMode());
+ Standard_Boolean aWithCorrect = (aCIDS->GetWithCorrectionMode());
+
+ Standard_Integer nbBases = aBasesObjs->Length(),
+ nbSubBases = (aSubBasesObjs.IsNull() ? 0 :aSubBasesObjs->Length()),
+ nbLocs = (aLocObjs.IsNull() ? 0 :aLocObjs->Length());
+
+ if( nbLocs != nbBases) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Number of sections is not equal to number of locations ");
+ }
+ if( nbSubBases && nbSubBases != nbBases) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Number of sections is not equal to number of subsections ");
+ }
+
+ //BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
+
+ TopTools_SequenceOfShape VLocs;
+ for(i=1; i<=nbBases; i++) {
+ Handle(Standard_Transient) anItemLoc = aLocObjs->Value(i);
+ if(anItemLoc.IsNull())
+ continue;
+ Handle(GEOM_Function) aRefLoc = Handle(GEOM_Function)::DownCast(anItemLoc);
+ TopoDS_Shape aShapeLoc = aRefLoc->GetValue();
+ if(aShapeLoc.IsNull() || aShapeLoc.ShapeType() != TopAbs_VERTEX)
+ continue;
+ VLocs.Append(aShapeLoc);
+ }
+ nbLocs = VLocs.Length();
+ if( nbLocs != nbBases) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("One of location shapes is not a vertex");
+ }
+ // split wire path by location points
+ TColgp_SequenceOfPnt PLocs;
+ for(i=1; i<=nbLocs; i++) {
+ TopoDS_Vertex V = TopoDS::Vertex(VLocs.Value(i));
+ PLocs.Append(BRep_Tool::Pnt(V));
+ }
+ TopTools_SequenceOfShape Edges;
+ TopTools_SequenceOfShape Wires;
+ TopExp_Explorer anExp;
+ for ( anExp.Init( aWirePath, TopAbs_EDGE ); anExp.More(); anExp.Next() ) {
+ Edges.Append(anExp.Current());
+ }
+ ShapeAnalysis_Edge sae;
+ TopoDS_Edge edge = TopoDS::Edge(Edges.First());
+ double tol = BRep_Tool::Tolerance(edge);
+ TopoDS_Vertex VF = sae.FirstVertex(edge);
+ gp_Pnt PF = BRep_Tool::Pnt(VF);
+ //cout<<"PF("<<PF.X()<<","<<PF.Y()<<","<<PF.Z()<<")"<<endl;
+ if( PF.Distance(PLocs.First()) > tol ) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise
+ ("First location shapes is not coincided with first vertex of aWirePath");
+ }
+ edge = TopoDS::Edge(Edges.Last());
+ tol = BRep_Tool::Tolerance(edge);
+ TopoDS_Vertex VL = sae.LastVertex(edge);
+ gp_Pnt PL = BRep_Tool::Pnt(VL);
+ if( PL.Distance(PLocs.Last()) > tol ) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise
+ ("Last location shapes is not coincided with last vertex of aWirePath");
+ }
+ int jcurr = 2;
+ TopTools_SequenceOfShape tmpEdges;
+ for(i=1; i<=Edges.Length() && jcurr<nbLocs; i++) {
+ TopoDS_Edge E = TopoDS::Edge(Edges.Value(i));
+ tol = BRep_Tool::Tolerance(edge);
+ TopoDS_Vertex V1 = sae.FirstVertex(E);
+ TopoDS_Vertex V2 = sae.LastVertex(E);
+ gp_Pnt P1 = BRep_Tool::Pnt(V1);
+ gp_Pnt P2 = BRep_Tool::Pnt(V2);
+ if( P2.Distance(PLocs.Value(jcurr)) < tol ) {
+ // make wire from current edge and add created
+ // wire to Wires
+ TopoDS_Wire W;
+ B.MakeWire(W);
+ for(j=1; j<=tmpEdges.Length(); j++)
+ B.Add(W,tmpEdges.Value(j));
+ B.Add(W,E);
+ Wires.Append(W);
+ jcurr++;
+ tmpEdges.Clear();
+ }
+ else {
+ // find distance between E and aLocs(icurr)
+ double fp,lp;
+ Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
+ GeomAPI_ProjectPointOnCurve PPC (PLocs.Value(jcurr),C);
+ if( PPC.NbPoints()>0 &&
+ PLocs.Value(jcurr).Distance(PPC.Point(1)) < tol ) {
+ double param = PPC.Parameter(1);
+ gp_Pnt PC1;
+ C->D0(param,PC1);
+ // split current edge
+ Handle(Geom_TrimmedCurve) tc1 = new Geom_TrimmedCurve(C,fp,param);
+ Handle(Geom_TrimmedCurve) tc2 = new Geom_TrimmedCurve(C,param,lp);
+ TopoDS_Edge E1,E2;
+ if(PC1.Distance(P1)<tol) {
+ B.MakeEdge(E1,tc1,tol);
+ B.Add(E1,V1);
+ TopoDS_Shape tmpV = VLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
+ B.Add(E1,TopoDS::Vertex(tmpV));
+ tmpEdges.Append(E1);
+ B.MakeEdge(E2,tc2,tol);
+ tmpV = VLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
+ B.Add(E2,TopoDS::Vertex(tmpV));
+ B.Add(E2,V2);
+ }
+ else {
+ B.MakeEdge(E1,tc2,tol);
+ TopoDS_Shape tmpV = VLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
+ B.Add(E1,TopoDS::Vertex(tmpV));
+ B.Add(E1,V1);
+ E1.Reverse();
+ tmpEdges.Append(E1);
+ B.MakeEdge(E2,tc1,tol);
+ B.Add(E2,V2);
+ tmpV = VLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
+ B.Add(E2,TopoDS::Vertex(tmpV));
+ E2.Reverse();
+ }
+ // create wire from tmpEdges
+ TopoDS_Wire W;
+ B.MakeWire(W);
+ for(j=1; j<=tmpEdges.Length(); j++)
+ B.Add(W,tmpEdges.Value(j));
+ Wires.Append(W);
+ jcurr++;
+ tmpEdges.Clear();
+ Edges.Remove(i);
+ Edges.InsertAfter(i-1,E1);
+ Edges.InsertAfter(i,E2);
+ }
+ else {
+ tmpEdges.Append(edge);
+ }
+ }
+ }
+ // create wire from other edges
+ TopoDS_Wire W;
+ B.MakeWire(W);
+ for(; i<=Edges.Length(); i++)
+ B.Add(W,Edges.Value(i));
+ Wires.Append(W);
+ //cout<<"Wires.Length()="<<Wires.Length()<<endl;
+
+ if( Wires.Length() != nbLocs-1 ) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise
+ ("One of location shapes is not lied on the path");
+ }
+
+ //TopTools_SequenceOfShape aSeqBases;
+ //TopTools_SequenceOfShape aSeqSubBases;
+ //TopTools_SequenceOfShape aSeqFaces;
+ TopoDS_Compound aComp;
+ B.MakeCompound(aComp);
+ for(i=1 ; i<nbBases; i++) {
+ TopoDS_Wire WPath = TopoDS::Wire(Wires.Value(i));
+ // 1 section
+ Handle(Standard_Transient) anItem1 = aBasesObjs->Value(i);
+ if(anItem1.IsNull())
+ continue;
+ Handle(GEOM_Function) aRefBase1 = Handle(GEOM_Function)::DownCast(anItem1);
+ if(aRefBase1.IsNull())
+ continue;
+ TopoDS_Shape aShBase1 = aRefBase1->GetValue();
+ if(aShBase1.IsNull())
+ continue;
+ TopAbs_ShapeEnum aType1 = aShBase1.ShapeType();
+ // 2 section
+ Handle(Standard_Transient) anItem2 = aBasesObjs->Value(i+1);
+ if(anItem2.IsNull())
+ continue;
+ Handle(GEOM_Function) aRefBase2 = Handle(GEOM_Function)::DownCast(anItem2);
+ if(aRefBase2.IsNull())
+ continue;
+ TopoDS_Shape aShBase2 = aRefBase2->GetValue();
+ if(aShBase2.IsNull())
+ continue;
+ TopAbs_ShapeEnum aType2 = aShBase2.ShapeType();
+
+ //BRepTools::Write(aShBase1,"/dn02/users_Linux/skl/work/Bugs/14857/base1.brep");
+
+ bool OkSec = ( aType1==TopAbs_SHELL || aType1==TopAbs_FACE ) &&
+ ( aType2==TopAbs_SHELL || aType2==TopAbs_FACE );
+ if( !OkSec ) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("One of section shapes has invalid type");
+ }
+
+ bool CreateFewSolids = false;
+ // compare sections
+ TopExp_Explorer anExp;
+ Standard_Integer nbf1 = 0;
+ for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ nbf1++;
+ }
+ Standard_Integer nbf2 = 0;
+ for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ nbf2++;
+ }
+ if(nbf1==nbf2) {
+ CreateFewSolids = true;
+ }
+
+ if(!CreateFewSolids) {
+ // we can create only one solid
+ TopoDS_Shape aWire1, aWire2;
+ // prepare aWire1
+ if(aType1==TopAbs_SHELL) {
+ // create wire as boundary contour if shell is no closed
+ // get free boundary shapes
+ ShapeAnalysis_FreeBounds anAnalizer( aShBase1 );
+ TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
+ //TopExp_Explorer anExp;
+ Standard_Integer NbWires = 0;
+ for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) {
+ NbWires++;
+ aWire1 = anExp.Current();
+ }
+ if(NbWires!=1) {
+ // bad case
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Bad shell is used as section ");
+ }
+ }
+ else { // aType1==TopAbs_FACE
+ TopExp_Explorer aExpW(aShBase1,TopAbs_WIRE);
+ aWire1 = aExpW.Current();
+ }
+ // prepare aWire2
+ if(aType2==TopAbs_SHELL) {
+ // create wire as boundary contour if shell is no closed
+ // get free boundary shapes
+ ShapeAnalysis_FreeBounds anAnalizer( aShBase2 );
+ TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
+ //TopExp_Explorer anExp;
+ Standard_Integer NbWires = 0;
+ for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) {
+ NbWires++;
+ aWire2 = anExp.Current();
+ }
+ if(NbWires!=1) {
+ // bad case
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Bad shell is used as section ");
+ }
+ }
+ else { // aType2==TopAbs_FACE
+ TopExp_Explorer aExpW(aShBase2,TopAbs_WIRE);
+ aWire2 = aExpW.Current();
+ }
+ // make pipe using aWire1 and aWire2
+ if( !aWire1.IsNull() && !aWire2.IsNull() ) {
+ //BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
+ BRepOffsetAPI_MakePipeShell aBuilder(WPath);
+ aBuilder.Add(aWire1, TopoDS::Vertex(VLocs(i)),
+ aWithContact, aWithCorrect);
+ aBuilder.Add(aWire2, TopoDS::Vertex(VLocs(i+1)),
+ aWithContact, aWithCorrect);
+ if(!aBuilder.IsReady()) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
+ }
+ aBuilder.Build();
+ TopoDS_Shape aShape = aBuilder.Shape();
+ TopoDS_Shell aShell;
+ B.MakeShell(aShell);
+ for ( anExp.Init( aShape, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ B.Add(aShell,anExp.Current());
+ }
+ for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ B.Add(aShell,anExp.Current());
+ }
+ for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ B.Add(aShell,anExp.Current());
+ }
+ // make sewing for this shell
+ Handle(BRepBuilderAPI_Sewing) aSewing = new BRepBuilderAPI_Sewing;
+ aSewing->SetTolerance(Precision::Confusion());
+ aSewing->SetFaceMode(Standard_True);
+ aSewing->SetFloatingEdgesMode(Standard_False);
+ aSewing->SetNonManifoldMode(Standard_False);
+ for ( anExp.Init( aShell, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ aSewing->Add(anExp.Current());
+ }
+ aSewing->Perform();
+ const TopoDS_Shape aSewShape = aSewing->SewedShape();
+ if( aSewShape.ShapeType() == TopAbs_SHELL ) {
+ aShell = TopoDS::Shell(aSewShape);
+ if(BRep_Tool::IsClosed(aShell)) {
+ TopoDS_Solid aSolid;
+ B.MakeSolid(aSolid);
+ B.Add(aSolid,aShell);
+ B.Add(aComp,aSolid);
+ }
+ else {
+ B.Add(aComp,aShell);
+ }
+ }
+ else {
+ B.Add(aComp,aShell);
+ }
+ }
+ }
+ else {
+ // main block - creation few solids (for each pair of faces)
+ TopTools_MapOfShape aFaces1,aFaces2;
+ for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() )
+ aFaces1.Add(anExp.Current());
+ for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() )
+ aFaces2.Add(anExp.Current());
+ // creating map of edge faces
+ TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces1;
+ TopExp::MapShapesAndAncestors(aShBase1, TopAbs_EDGE, TopAbs_FACE, aMapEdgeFaces1);
+ TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces2;
+ TopExp::MapShapesAndAncestors(aShBase2, TopAbs_EDGE, TopAbs_FACE, aMapEdgeFaces2);
+
+ // constuct map face->face
+ TopTools_IndexedDataMapOfShapeShape FF;
+ TopoDS_Shape FS1,FS2;
+ if(nbSubBases==0) {
+ // find edge the most distant from location point
+ // (this edge is not shared by two faces)
+ double maxdist = 0.;
+ TopoDS_Shape E1;
+ TopoDS_Vertex V11,V21;
+ for(j=1; j<=aMapEdgeFaces1.Extent(); j++) {
+ TopoDS_Shape tmp = aMapEdgeFaces1.FindKey(j);
+ const TopTools_ListOfShape& aList = aMapEdgeFaces1.FindFromKey(tmp);
+ if(aList.Extent()>1)
+ continue;
+ TopExp_Explorer expv;
+ expv.Init( tmp, TopAbs_VERTEX );
+ TopoDS_Vertex V1 = TopoDS::Vertex(expv.Current());
+ expv.Next();
+ TopoDS_Vertex V2 = TopoDS::Vertex(expv.Current());
+ gp_Pnt P1 = BRep_Tool::Pnt(V1);
+ gp_Pnt P2 = BRep_Tool::Pnt(V2);
+ double dist = PLocs.Value(i).Distance(P1) + PLocs.Value(i).Distance(P2);
+ if(dist>maxdist) {
+ E1 = tmp;
+ V11 = V1;
+ V21 = V2;
+ TopTools_ListIteratorOfListOfShape anIter(aList);
+ FS1 = anIter.Value();
+ maxdist = dist;
+ }
+ }
+ // main direction for comparing
+ gp_Vec VM(PLocs.Value(i),PLocs.Value(i+1));
+ // find corresponding edge from next section
+ double minang = PI;
+ gp_Pnt P11 = BRep_Tool::Pnt(V11);
+ gp_Pnt P21 = BRep_Tool::Pnt(V21);
+ TopoDS_Shape E2;
+ TopoDS_Vertex V12,V22;
+ for(j=1; j<=aMapEdgeFaces2.Extent(); j++) {
+ TopoDS_Shape tmp = aMapEdgeFaces2.FindKey(j);
+ const TopTools_ListOfShape& aList = aMapEdgeFaces2.FindFromKey(tmp);
+ if(aList.Extent()>1)
+ continue;
+ TopExp_Explorer expv;
+ expv.Init( tmp, TopAbs_VERTEX );
+ TopoDS_Vertex V1tmp = TopoDS::Vertex(expv.Current());
+ expv.Next();
+ TopoDS_Vertex V2tmp = TopoDS::Vertex(expv.Current());
+ gp_Pnt P1tmp = BRep_Tool::Pnt(V1tmp);
+ gp_Pnt P2tmp = BRep_Tool::Pnt(V2tmp);
+ double d1 = P1tmp.Distance(P11) + P2tmp.Distance(P21);
+ double d2 = P1tmp.Distance(P21) + P2tmp.Distance(P11);
+ TopoDS_Vertex V1,V2;
+ gp_Pnt P1,P2;
+ if(d1>d2) {
+ V1 = V2tmp; P1 = P2tmp;
+ V2 = V1tmp; P2 = P1tmp;
+ }
+ else {
+ V1 = V1tmp; P1 = P1tmp;
+ V2 = V2tmp; P2 = P2tmp;
+ }
+ gp_Vec Vec1(P11,P1);
+ gp_Vec Vec2(P21,P2);
+ double ang = fabs(Vec1.Angle(VM)) + fabs(Vec2.Angle(VM));
+ if(ang<minang) {
+ E2 = tmp;
+ V12 = V1;
+ V22 = V2;
+ TopTools_ListIteratorOfListOfShape anIter(aList);
+ FS2 = anIter.Value();
+ minang = ang;
+ }
+ }
+ // put all pairs to map FF
+ FF.Add(FS1,FS2);
+ FF.Add(E1,E2);
+ FF.Add(V11,V12);
+ FF.Add(V21,V22);
+
+ // add pairs of edges to FF
+ bool stat = FillForOtherEdges(FS1,E1,V11,FF);
+ if( !stat ) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("FindForOtherEdges: Can not mapping other egdes");
+ }
+
+ }
+ else {
+ { // 1 section
+ Handle(Standard_Transient) anItem = aSubBasesObjs->Value(i);
+ if(anItem.IsNull()) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Invalid subbase shape");
+ }
+ Handle(GEOM_Function) aRefBase = Handle(GEOM_Function)::DownCast(anItem);
+ if(aRefBase.IsNull()) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Invalid subbase shape");
+ }
+ TopoDS_Shape aSh = aRefBase->GetValue();
+ if(aSh.IsNull()) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Invalid subbase shape");
+ }
+ if(aSh.ShapeType()!=TopAbs_FACE) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Invalid subbase shape");
+ }
+ FS1 = aSh;
+ }
+ { // 2 section
+ Handle(Standard_Transient) anItem = aSubBasesObjs->Value(i+1);
+ if(anItem.IsNull()) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Invalid subbase shape");
+ }
+ Handle(GEOM_Function) aRefBase = Handle(GEOM_Function)::DownCast(anItem);
+ if(aRefBase.IsNull()) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Invalid subbase shape");
+ }
+ TopoDS_Shape aSh = aRefBase->GetValue();
+ if(aSh.IsNull()) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Invalid subbase shape");
+ }
+ if(aSh.ShapeType()!=TopAbs_FACE) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Invalid subbase shape");
+ }
+ FS2 = aSh;
+ }
+
+ if( !aFaces1.Contains(FS1) || !aFaces2.Contains(FS2) ) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Invalid subbase shape");
+ }
+
+ FF.Add(FS1,FS2);
+
+ // add pairs of edges to FF
+ bool stat = FillCorrespondingEdges(FS1, FS2, TopoDS::Vertex(VLocs(i)),
+ TopoDS::Vertex(VLocs(i+1)), WPath, FF);
+ if( !stat ) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Can not create correct pipe");
+ }
+ }
+
+ FindNextPairOfFaces(FS1, aMapEdgeFaces1, aMapEdgeFaces2, FF, aCI);
+
+
+ // make pipe for each pair of faces
+ //BRepTools::Write(WPath,"/dn02/users_Linux/skl/work/Bugs/14857/wpath.brep");
+ for(j=1; j<=FF.Extent(); j++) {
+ TopoDS_Shape F1 = FF.FindKey(j);
+ if( F1.ShapeType() != TopAbs_FACE )
+ continue;
+ TopoDS_Shape F2 = FF.FindFromIndex(j);
+ TopExp_Explorer aExpW1(F1,TopAbs_WIRE);
+ TopoDS_Wire aWire1 = TopoDS::Wire(aExpW1.Current());
+ TopExp_Explorer aExpW2(F2,TopAbs_WIRE);
+ TopoDS_Wire aWire2 = TopoDS::Wire(aExpW2.Current());
+ // make pipe using aWire1 and aWire2
+ if( !aWire1.IsNull() && !aWire2.IsNull() ) {
+ BRepOffsetAPI_MakePipeShell aBuilder(WPath);
+ aBuilder.Add(aWire1, TopoDS::Vertex(VLocs(i)),
+ aWithContact, aWithCorrect);
+ aBuilder.Add(aWire2, TopoDS::Vertex(VLocs(i+1)),
+ aWithContact, aWithCorrect);
+ if(!aBuilder.IsReady()) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
+ }
+ aBuilder.Build();
+ TopoDS_Shape aShape = aBuilder.Shape();
+ TopoDS_Shell aShell;
+ B.MakeShell(aShell);
+ //int nbf=0;
+ for ( anExp.Init( aShape, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ //nbf++;
+ //cout<<"nbf="<<nbf<<endl;
+ B.Add(aShell,anExp.Current());
+ }
+ B.Add(aShell,F1);
+ B.Add(aShell,F2);
+ // make sewing for this shell
+ Handle(BRepBuilderAPI_Sewing) aSewing = new BRepBuilderAPI_Sewing;
+ aSewing->SetTolerance(Precision::Confusion());
+ aSewing->SetFaceMode(Standard_True);
+ aSewing->SetFloatingEdgesMode(Standard_False);
+ aSewing->SetNonManifoldMode(Standard_False);
+ for ( anExp.Init( aShell, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ aSewing->Add(anExp.Current());
+ }
+ aSewing->Perform();
+ const TopoDS_Shape aSewShape = aSewing->SewedShape();
+ if( aSewShape.ShapeType() == TopAbs_SHELL ) {
+ aShell = TopoDS::Shell(aSewShape);
+ if(BRep_Tool::IsClosed(aShell)) {
+ TopoDS_Solid aSolid;
+ B.MakeSolid(aSolid);
+ B.Add(aSolid,aShell);
+ B.Add(aComp,aSolid);
+ }
+ else {
+ B.Add(aComp,aShell);
+ }
+ }
+ else {
+ B.Add(aComp,aShell);
+ }
+ }
+ }
+
+ }
+ }
+
+ return aComp;
+}
+
+
//=======================================================================
//function : Execute
//purpose :
aCI = new GEOMImpl_IPipe(aFunction);
else if(aType == PIPE_DIFFERENT_SECTIONS)
aCI = new GEOMImpl_IPipeDiffSect(aFunction);
+ else if(aType == PIPE_SHELL_SECTIONS)
+ aCI = new GEOMImpl_IPipeShellSect(aFunction);
else
return 0;
TopoDS_Shape aShapePath = aRefPath->GetValue();
- if (aShapePath.IsNull())
- {
+ if (aShapePath.IsNull()) {
cout<<"Driver : path is null"<<endl;
if(aCI) delete aCI;
Standard_NullObject::Raise("MakePipe aborted : null path argument");
}
else {
if (aShapePath.ShapeType() == TopAbs_EDGE) {
-
- TopoDS_Edge anEdge = TopoDS::Edge(aShapePath);
- aWirePath = BRepBuilderAPI_MakeWire(anEdge);
+ TopoDS_Edge anEdge = TopoDS::Edge(aShapePath);
+ aWirePath = BRepBuilderAPI_MakeWire(anEdge);
}
else {
if(aCI) delete aCI;
TopoDS_Shape aShape;
- if (aType == PIPE_BASE_PATH)
- {
+ if (aType == PIPE_BASE_PATH) {
Handle(GEOM_Function) aRefBase = aCI->GetBase();
//if for section was specified face with a few wires then a few
// pipes were build and make solid
- if(aTypeBase == TopAbs_FACE)
+ Standard_Boolean NeedCreateSolid = Standard_False;
+ if(aTypeBase == TopAbs_SHELL) {
+ // create wire as boundary contour if shell is no closed
+ // get free boundary shapes
+ ShapeAnalysis_FreeBounds anAnalizer( aShapeBase );
+ TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
+ TopExp_Explorer anExp;
+ TopoDS_Shape aWire;
+ Standard_Integer NbWires = 0;
+ for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) {
+ NbWires++;
+ aWire = anExp.Current();
+ }
+ if(NbWires!=1) {
+ // bad case
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise("Bad shell is used as section ");
+ }
+ NeedCreateSolid = Standard_True;
+ aSeqFaces.Append(aShapeBase);
+ aSeqBases.Append(aWire);
+ }
+ else if(aTypeBase == TopAbs_FACE)
{
+ NeedCreateSolid = Standard_True;
//for case one path should be used other type function
aSeqFaces.Append(aShapeBase);
TopExp_Explorer aExpW(aShapeBase,TopAbs_WIRE);
aSeqBases.Append(aWireProf);
}
}
- else if(aTypeBase == TopAbs_WIRE || aTypeBase == TopAbs_VERTEX)
+ else if(aTypeBase == TopAbs_WIRE || aTypeBase == TopAbs_VERTEX) {
aSeqBases.Append(aShapeBase);
+ }
else if(aTypeBase == TopAbs_EDGE)
{
TopoDS_Edge anEdge = TopoDS::Edge(aShapeBase);
aShape = aComp;
}
}
+
+ //building pipe with shell sections
+ else if (aType == PIPE_SHELL_SECTIONS) {
+ aShape = CreatePipeForShellSections(aWirePath,aCI);
+ }
+
if (aShape.IsNull()) return 0;
BRepCheck_Analyzer ana (aShape, Standard_False);
return _anOtherObject ;
}
+
#include <Handle_TFunction_Driver.hxx>
#endif
+
class Standard_Transient;
class Handle_Standard_Type;
class Handle(TFunction_Driver);
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
- // Methods PUBLIC
- //
-Standard_EXPORT GEOMImpl_PipeDriver();
-Standard_EXPORT virtual Standard_Integer Execute(TFunction_Logbook& log) const;
-Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {}
-Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const { return Standard_True; }
-Standard_EXPORT static const Standard_GUID& GetID();
-Standard_EXPORT ~GEOMImpl_PipeDriver() {};
-
-
- // Type management
- //
-Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_PipeDriver_Type_();
-Standard_EXPORT const Handle(Standard_Type)& DynamicType() const { return STANDARD_TYPE(GEOMImpl_PipeDriver) ; }
-Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const { return (STANDARD_TYPE(GEOMImpl_PipeDriver) == AType || TFunction_Driver::IsKind(AType)); }
-
+ // Methods PUBLIC
+ //
+ Standard_EXPORT GEOMImpl_PipeDriver();
+ Standard_EXPORT virtual Standard_Integer Execute(TFunction_Logbook& log) const;
+ Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {}
+ Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const
+ { return Standard_True; }
+ Standard_EXPORT static const Standard_GUID& GetID();
+ Standard_EXPORT ~GEOMImpl_PipeDriver() {};
+
+
+ // Type management
+ //
+ Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_PipeDriver_Type_();
+ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const
+ { return STANDARD_TYPE(GEOMImpl_PipeDriver) ; }
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const
+ { return (STANDARD_TYPE(GEOMImpl_PipeDriver) == AType ||
+ TFunction_Driver::IsKind(AType)); }
};
#define PIPE_BASE_PATH 1
#define PIPE_DIFFERENT_SECTIONS 2
+#define PIPE_SHELL_SECTIONS 3
#define THRUSECTIONS_RULED 1
#define THRUSECTIONS_SMOOTHED 2
#define ELLIPSE_PNT_VEC_RR 1
#define CIRC_ARC_THREE_PNT 1
+#define CIRC_ARC_CENTER 2
#define FILLET_SHAPE_ALL 1
#define FILLET_SHAPE_EDGES 2
#define BASIC_FILLING 1
#define GLUE_FACES 1
+#define GLUE_FACES_BY_LIST 2
#define SKETCHER_NINE_DOUBLS 1
#define SKETCHER_PLANE 2
GEOMImpl_Gen.hxx \
GEOMImpl_IBasicOperations.hxx \
GEOMImpl_ITransformOperations.hxx \
- GEOMImpl_IHealingOperations.hxx \
+ GEOMImpl_IHealingOperations.hxx \
GEOMImpl_I3DPrimOperations.hxx \
GEOMImpl_IShapesOperations.hxx \
GEOMImpl_IBlocksOperations.hxx \
GEOMImpl_IBooleanOperations.hxx \
GEOMImpl_ICurvesOperations.hxx \
GEOMImpl_ILocalOperations.hxx \
- GEOMImpl_IInsertOperations.hxx \
- GEOMImpl_IMeasureOperations.hxx \
+ GEOMImpl_IInsertOperations.hxx \
+ GEOMImpl_IMeasureOperations.hxx \
GEOMImpl_IGroupOperations.hxx \
GEOMImpl_CopyDriver.hxx \
GEOMImpl_Types.hxx \
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
#include <LightApp_SelectionMgr.h>
+#include <GEOMImpl_Types.hxx>
#include <SALOME_ListIteratorOfListIO.hxx>
#include <SALOME_Prs.h>
Export();
break;
}
+ case 2171: // POPUP VIEWER - SELECT ONLY - VERTEX
+ {
+ OnSelectOnly( GEOM_POINT );
+ break;
+ }
+ case 2172: // POPUP VIEWER - SELECT ONLY - EDGE
+ {
+ OnSelectOnly( GEOM_EDGE );
+ break;
+ }
+ case 2173: // POPUP VIEWER - SELECT ONLY - WIRE
+ {
+ OnSelectOnly( GEOM_WIRE );
+ break;
+ }
+ case 2174: // POPUP VIEWER - SELECT ONLY - FACE
+ {
+ OnSelectOnly( GEOM_FACE );
+ break;
+ }
+ case 2175: // POPUP VIEWER - SELECT ONLY - SHELL
+ {
+ OnSelectOnly( GEOM_SHELL );
+ break;
+ }
+ case 2176: // POPUP VIEWER - SELECT ONLY - SOLID
+ {
+ OnSelectOnly( GEOM_SOLID );
+ break;
+ }
+ case 2177: // POPUP VIEWER - SELECT ONLY - COMPOUND
+ {
+ OnSelectOnly( GEOM_COMPOUND );
+ break;
+ }
+ case 2178: // POPUP VIEWER - SELECT ONLY - SELECT ALL
+ {
+ OnSelectOnly( GEOM_ALLOBJECTS );
+ break;
+ }
case 411: // SETTINGS - ADD IN STUDY
{
// SAN -- TO BE REMOVED !!!
anObj = aInsOp->Import(fileN, fileT);
if ( !anObj->_is_nil() && aInsOp->IsDone() ) {
- anObj->SetName(GEOMBase::GetDefaultName(QObject::tr("GEOM_IMPORT")).latin1());
QString aPublishObjName =
GEOMBase::GetDefaultName(SUIT_Tools::file(fileName, /*withExten=*/true));
return false;
}
+//=================================================================================
+// function : deactivate()
+// purpose : Called when GEOM component is deactivated
+//=================================================================================
+void GEOMToolsGUI::deactivate()
+{
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ if ( app ) {
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+ GEOM_Displayer aDisp (appStudy);
+ aDisp.GlobalSelection();
+ getGeometryGUI()->setLocalSelectionMode(GEOM_ALLOBJECTS);
+ }
+}
+
//=====================================================================================
// EXPORTED METHODS
//=====================================================================================
~GEOMToolsGUI();
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
+ virtual void deactivate();
private:
// Import and export topology methods
void OnTransparency();
void OnNbIsos();
void OnOpen();
-
+ void OnSelectOnly(int mode);
+
// returns name of Module (Component) of given objects (usually selected objects)
// if objects belong to different Components, a NULL string is returned.
QString getParentComponent( _PTR( Study ), const SALOME_ListIO& );
if ( !newName.isEmpty() ) {
aName->SetValue( newName.latin1() ); // rename the SObject
IObject->setName( newName.latin1() );// rename the InteractiveObject
+ // Rename the corresponding GEOM_Object
+ GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(obj));
+ if (!CORBA::is_nil( anObj ))
+ anObj->SetName( newName.latin1() );
(dynamic_cast<SalomeApp_Module*>(app->activeModule()))->updateObjBrowser( false );
}
} // if ( name attribute )
}
*/
}
+
+void GEOMToolsGUI::OnSelectOnly(int mode)
+{
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ if ( app ) {
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+ GEOM_Displayer aDisp (appStudy);
+ aDisp.GlobalSelection(mode);
+ getGeometryGUI()->setLocalSelectionMode(mode);
+ }
+}
-I$(srcdir)/../GEOMBase \
-I$(srcdir)/../GEOMGUI \
-I$(srcdir)/../GEOMClient \
+ -I$(srcdir)/../GEOMImpl \
-I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix
anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeName");
SALOMEDS::AttributeName_var aNameAttrib = SALOMEDS::AttributeName::_narrow(anAttr);
aNameAttrib->SetValue(aShapeName.ToCString());
+
+ //Set a name of the GEOM object
+ aShape->SetName(theName);
return aResultSO._retn();
}
SALOMEDS::TMPFile_var aStreamFile;
// Get a temporary directory to store a file
std::string aTmpDir = (isMultiFile)?theURL:SALOMEDS_Tool::GetTmpDir();
+
+ // OCCT BUG: cannot save a document (in current folder)
+ // if directory name is empty
+ if (aTmpDir.size() == 0) {
+#ifdef WNT
+ aTmpDir = ".\\";
+#else
+ aTmpDir = "./";
+#endif
+ }
+
// Create a list to store names of created files
SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames;
aSeq->length(1);
// Get a temporary directory for a file
std::string aTmpDir = isMultiFile?theURL:SALOMEDS_Tool::GetTmpDir();
+
+ // OCCT BUG: cannot load a document (from current folder)
+ // if directory name is empty
+ if (aTmpDir.size() == 0) {
+#ifdef WNT
+ aTmpDir = ".\\";
+#else
+ aTmpDir = "./";
+#endif
+ }
+
// Conver the byte stream theStream to a file and place it in tmp directory
- SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.c_str(), isMultiFile);
+ SALOMEDS::ListOfFileNames_var aSeq =
+ SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.c_str(), isMultiFile);
// Prepare a file name to open
TCollection_AsciiString aNameWithExt("");
return GetObject(anObject);
}
+
+
+//=============================================================================
+/*!
+ * MakePipeWithShellSections
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithShellSections
+ (const GEOM::ListOfGO& theBases,
+ const GEOM::ListOfGO& theSubBases,
+ const GEOM::ListOfGO& theLocations,
+ GEOM::GEOM_Object_ptr thePath,
+ CORBA::Boolean theWithContact,
+ CORBA::Boolean theWithCorrections)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+ Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
+ Handle(TColStd_HSequenceOfTransient) aSeqSubBases = new TColStd_HSequenceOfTransient;
+ Handle(TColStd_HSequenceOfTransient) aSeqLocations = new TColStd_HSequenceOfTransient;
+ int ind=0, aNbBases=0, aNbSubBases=0, aNbLocs=0;
+
+ //Get the shapes
+ aNbBases = theBases.length();
+ aNbSubBases = theSubBases.length();
+ aNbLocs = theLocations.length();
+
+ if( aNbLocs && aNbBases != aNbLocs)
+ return aGEOMObject._retn();
+
+ Handle(GEOM_Object) aPath = GetOperations()->GetEngine()->GetObject
+ (thePath->GetStudyID(), thePath->GetEntry());
+ if(aPath.IsNull())
+ return aGEOMObject._retn();
+
+ for (ind = 0; ind < aNbBases; ind++) {
+ if (theBases[ind] == NULL) continue;
+ Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->
+ GetObject(theBases[ind]->GetStudyID(), theBases[ind]->GetEntry());
+ if(aBase.IsNull())
+ continue;
+ if(aNbLocs) {
+ Handle(GEOM_Object) aLoc = GetOperations()->GetEngine()->GetObject
+ (theLocations[ind]->GetStudyID(), theLocations[ind]->GetEntry());
+ if(aLoc.IsNull())
+ continue;
+ aSeqLocations->Append(aLoc);
+ }
+ aSeqBases->Append(aBase);
+
+ if(aNbSubBases>=aNbBases) {
+ Handle(GEOM_Object) aSubBase = GetOperations()->GetEngine()->
+ GetObject(theSubBases[ind]->GetStudyID(), theSubBases[ind]->GetEntry());
+ if(aSubBase.IsNull()) {
+ aSeqSubBases->Clear();
+ aNbSubBases = 0;
+ continue;
+ }
+ aSeqSubBases->Append(aSubBase);
+ }
+
+ }
+ if(!aSeqBases->Length())
+ return aGEOMObject._retn();
+
+ // Make pipe
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakePipeWithShellSections(aSeqBases, aSeqSubBases,
+ aSeqLocations, aPath,
+ theWithContact, theWithCorrections);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
CORBA::Boolean theWithContact,
CORBA::Boolean theWithCorrections);
+ GEOM::GEOM_Object_ptr MakePipeWithShellSections(const GEOM::ListOfGO& theBases,
+ const GEOM::ListOfGO& theSubBases,
+ const GEOM::ListOfGO& theLocations,
+ GEOM::GEOM_Object_ptr thePath,
+ CORBA::Boolean theWithContact,
+ CORBA::Boolean theWithCorrections);
+
::GEOMImpl_I3DPrimOperations* GetOperations()
{ return (::GEOMImpl_I3DPrimOperations*)GetImpl(); }
};
return GetObject(anObject);
}
+
+//=============================================================================
+/*!
+ * MakeArcCenter
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeArcCenter
+ (GEOM::GEOM_Object_ptr thePnt1,
+ GEOM::GEOM_Object_ptr thePnt2,
+ GEOM::GEOM_Object_ptr thePnt3,
+ CORBA::Boolean theSense)
+
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ if (thePnt1 == NULL || thePnt2 == NULL || thePnt3 == NULL) return aGEOMObject._retn();
+
+ //Get the reference points
+ Handle(GEOM_Object) aPnt1 = GetOperations()->GetEngine()->GetObject
+ (thePnt1->GetStudyID(), thePnt1->GetEntry());
+ Handle(GEOM_Object) aPnt2 = GetOperations()->GetEngine()->GetObject
+ (thePnt2->GetStudyID(), thePnt2->GetEntry());
+ Handle(GEOM_Object) aPnt3 = GetOperations()->GetEngine()->GetObject
+ (thePnt3->GetStudyID(), thePnt3->GetEntry());
+
+ if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
+
+ // Make ArcCenter
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakeArcCenter(aPnt1, aPnt2, aPnt3,theSense);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
//=============================================================================
/*!
* MakePolyline
GEOM::GEOM_Object_ptr MakeArc (GEOM::GEOM_Object_ptr thePnt1,
GEOM::GEOM_Object_ptr thePnt2,
GEOM::GEOM_Object_ptr thePnt3);
-
+
+ GEOM::GEOM_Object_ptr MakeArcCenter (GEOM::GEOM_Object_ptr thePnt1,
+ GEOM::GEOM_Object_ptr thePnt2,
+ GEOM::GEOM_Object_ptr thePnt3,
+ bool theSense);
+
GEOM::GEOM_Object_ptr MakePolyline (const GEOM::ListOfGO& thePoints);
GEOM::GEOM_Object_ptr MakeSplineBezier (const GEOM::ListOfGO& thePoints);
MESSAGE("GEOM_IMeasureOperations_i::~GEOM_IMeasureOperations_i");
}
+//=============================================================================
+/*!
+ * KindOfShape
+ */
+//=============================================================================
+GEOM::GEOM_IKindOfShape::shape_kind GEOM_IMeasureOperations_i::KindOfShape
+ (GEOM::GEOM_Object_ptr theShape,
+ GEOM::ListOfLong_out theIntegers,
+ GEOM::ListOfDouble_out theDoubles)
+{
+ GEOMImpl_IMeasureOperations::ShapeKind aKind = GEOMImpl_IMeasureOperations::SK_NO_SHAPE;
+
+ // allocate the CORBA arrays
+ GEOM::ListOfLong_var anIntegersArray = new GEOM::ListOfLong();
+ GEOM::ListOfDouble_var aDoublesArray = new GEOM::ListOfDouble();
+
+ //Get the reference shape
+ Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theShape->GetEntry());
+
+ if (!aShape.IsNull()) {
+ Handle(TColStd_HSequenceOfInteger) anIntegers = new TColStd_HSequenceOfInteger;
+ Handle(TColStd_HSequenceOfReal) aDoubles = new TColStd_HSequenceOfReal;
+
+ // Detect kind of shape and parameters
+ aKind = GetOperations()->KindOfShape(aShape, anIntegers, aDoubles);
+
+ int nbInts = anIntegers->Length();
+ int nbDbls = aDoubles->Length();
+
+ anIntegersArray->length(nbInts);
+ aDoublesArray->length(nbDbls);
+
+ for (int ii = 0; ii < nbInts; ii++) {
+ anIntegersArray[ii] = anIntegers->Value(ii + 1);
+ }
+ for (int id = 0; id < nbDbls; id++) {
+ aDoublesArray[id] = aDoubles->Value(id + 1);
+ }
+ }
+
+ // initialize out-parameters with local arrays
+ theIntegers = anIntegersArray._retn();
+ theDoubles = aDoublesArray._retn();
+ return (GEOM::GEOM_IKindOfShape::shape_kind)aKind;
+}
//=============================================================================
/*!
::GEOMImpl_IMeasureOperations* theImpl);
~GEOM_IMeasureOperations_i();
+ GEOM::GEOM_IKindOfShape::shape_kind KindOfShape (GEOM::GEOM_Object_ptr theShape,
+ GEOM::ListOfLong_out theIntegers,
+ GEOM::ListOfDouble_out theDoubles);
+
void GetPosition (GEOM::GEOM_Object_ptr theShape,
CORBA::Double& Ox, CORBA::Double& Oy, CORBA::Double& Oz,
CORBA::Double& Zx, CORBA::Double& Zy, CORBA::Double& Zz,
return GetObject(anObject);
}
+
+//=============================================================================
+/*!
+ * GetGlueFaces
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
+ (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Double theTolerance)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ if (theShape == NULL) return aSeq._retn();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theShape->GetEntry());
+ if (aShape.IsNull()) return aSeq._retn();
+
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->GetGlueFaces(aShape, theTolerance);
+
+ //if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ // to allow warning
+ if(aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+
+//=============================================================================
+/*!
+ * MakeGlueFacesByList
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
+ (GEOM::GEOM_Object_ptr theShape,
+ const CORBA::Double theTolerance,
+ const GEOM::ListOfGO& theFaces)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ if (theShape == NULL) return aGEOMObject._retn();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theShape->GetEntry());
+
+ if (aShape.IsNull()) return aGEOMObject._retn();
+
+ int ind, aLen;
+ list<Handle(GEOM_Object)> aFaces;
+ //Get the shapes
+ aLen = theFaces.length();
+ for (ind = 0; ind < aLen; ind++) {
+ if (theFaces[ind] == NULL) return aGEOMObject._retn();
+ Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
+ (theFaces[ind]->GetStudyID(), theFaces[ind]->GetEntry());
+ if (aSh.IsNull()) return aGEOMObject._retn();
+ aFaces.push_back(aSh);
+ }
+
+ //Perform the gluing
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakeGlueFacesByList(aShape, theTolerance, aFaces);
+ //if (!GetOperations()->IsDone() || anObject.IsNull())
+ // to allow warning
+ if (anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
+
//=============================================================================
/*!
* MakeExplode
GEOM::GEOM_Object_ptr MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
CORBA::Double theTolerance);
+ GEOM::ListOfGO* GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Double theTolerance);
+
+ GEOM::GEOM_Object_ptr MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Double theTolerance,
+ const GEOM::ListOfGO& theFaces);
+
GEOM::ListOfGO* MakeExplode (GEOM::GEOM_Object_ptr theShape,
CORBA::Long theShapeType,
CORBA::Boolean isSorted);
//function : getShape
//purpose : return the TopoDS_Shape when client and servant are colocated, be careful
//=======================================================================
-CORBA::Long GEOM_Object_i::getShape() {
+CORBA::LongLong GEOM_Object_i::getShape() {
_geom = _impl->GetValue();
- return CORBA::Long(size_t(&_geom));
+ return ((CORBA::LongLong)(&_geom));
}
//=============================================================================
virtual SALOMEDS::TMPFile* GetShapeStream();
- virtual CORBA::Long getShape();
+ virtual CORBA::LongLong getShape();
virtual bool IsMainShape() { return _impl->IsMainShape(); }
//=============================================================================
// MakePipe:
//=============================================================================
-GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeWithDifferentSections(const GEOM::ListOfGO& theBases,
- const GEOM::ListOfGO& theLocations,
- GEOM::GEOM_Object_ptr thePath,
- CORBA::Boolean theWithContact,
- CORBA::Boolean theWithCorrections)
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeWithDifferentSections
+ (const GEOM::ListOfGO& theBases,
+ const GEOM::ListOfGO& theLocations,
+ GEOM::GEOM_Object_ptr thePath,
+ CORBA::Boolean theWithContact,
+ CORBA::Boolean theWithCorrections)
{
beginService( " GEOM_Superv_i::MakePipeWithDifferentSections" );
MESSAGE("GEOM_Superv_i::MakePipeWithDifferentSections");
endService( " GEOM_Superv_i::MakePipeWithDifferentSections" );
return anObj;
}
+
+
+//=============================================================================
+// MakePipe:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeWithShellSections
+ (const GEOM::ListOfGO& theBases,
+ const GEOM::ListOfGO& theSubBases,
+ const GEOM::ListOfGO& theLocations,
+ GEOM::GEOM_Object_ptr thePath,
+ CORBA::Boolean theWithContact,
+ CORBA::Boolean theWithCorrections)
+{
+ beginService( " GEOM_Superv_i::MakePipeWithShellSections" );
+ MESSAGE("GEOM_Superv_i::MakePipeWithShellSections");
+ get3DPrimOp();
+ GEOM::GEOM_Object_ptr anObj =
+ my3DPrimOp->MakePipeWithShellSections(theBases, theSubBases,
+ theLocations, thePath,
+ theWithContact, theWithCorrections);
+ endService( " GEOM_Superv_i::MakePipeWithShellSections" );
+ return anObj;
+}
+
+
//=============================================================================
// MakeFuse:
//=============================================================================
// MakeGlueFaces:
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theTolerance)
+ CORBA::Double theTolerance)
{
beginService( " GEOM_Superv_i::MakeGlueFaces" );
MESSAGE("GEOM_Superv_i::MakeGlueFaces");
return anObj;
}
+//=============================================================================
+// GetGlueFaces:
+//=============================================================================
+GEOM::GEOM_List_ptr GEOM_Superv_i::GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Double theTolerance)
+{
+ beginService( " GEOM_Superv_i::GetGlueFaces" );
+ MESSAGE("GEOM_Superv_i::GetGlueFaces");
+ getShapesOp();
+ GEOM::ListOfGO* aList = myShapesOp->GetGlueFaces(theShape, theTolerance);
+ GEOM_List_i<GEOM::ListOfGO>* aListPtr = new GEOM_List_i<GEOM::ListOfGO>(*(aList));
+ MESSAGE(" List of "<<aListPtr->GetList().length()<<" element(s)");
+ endService( " GEOM_Superv_i::GetGlueFaces" );
+ return aListPtr->_this();
+}
+
+//=============================================================================
+// MakeGlueFacesByList:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Double theTolerance,
+ const GEOM::ListOfGO& theFaces)
+{
+ beginService( " GEOM_Superv_i::MakeGlueFacesByList" );
+ MESSAGE("GEOM_Superv_i::MakeGlueFacesByList");
+ getShapesOp();
+ GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeGlueFacesByList(theShape, theTolerance, theFaces);
+ endService( " GEOM_Superv_i::MakeGlueFacesByList" );
+ return anObj;
+}
+
//=============================================================================
// MakeExplode:
//=============================================================================
return anObj;
}
+//=============================================================================
+// MakeArcCenter:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeArcCenter (GEOM::GEOM_Object_ptr theCenter,
+ GEOM::GEOM_Object_ptr thePnt1,
+ GEOM::GEOM_Object_ptr thePnt2,
+ CORBA::Boolean theSense)
+{
+ beginService( " GEOM_Superv_i::MakeArcCenter" );
+ MESSAGE("GEOM_Superv_i::MakeArcCenter");
+ getCurvesOp();
+ GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeArcCenter(theCenter, thePnt1, thePnt2,theSense);
+ endService( " GEOM_Superv_i::MakeArcCenter" );
+ return anObj;
+}
+
//=============================================================================
// MakePolyline:
//=============================================================================
CORBA::Boolean theWithContact,
CORBA::Boolean theWithCorrections);
+ GEOM::GEOM_Object_ptr MakePipeWithShellSections(const GEOM::ListOfGO& theBases,
+ const GEOM::ListOfGO& theSubBases,
+ const GEOM::ListOfGO& theLocations,
+ GEOM::GEOM_Object_ptr thePath,
+ CORBA::Boolean theWithContact,
+ CORBA::Boolean theWithCorrections);
+
//-----------------------------------------------------------//
// BooleanOperations //
//-----------------------------------------------------------//
GEOM::GEOM_Object_ptr MakeSolidShells (GEOM::GEOM_List_ptr theShells);
GEOM::GEOM_Object_ptr MakeCompound (GEOM::GEOM_List_ptr theShapes);
GEOM::GEOM_Object_ptr MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theTolerance);
+ CORBA::Double theTolerance);
+ GEOM::GEOM_List_ptr GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Double theTolerance);
+ GEOM::GEOM_Object_ptr MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Double theTolerance,
+ const GEOM::ListOfGO& theFaces);
GEOM::GEOM_List_ptr MakeExplode (GEOM::GEOM_Object_ptr theShape,
CORBA::Long theShapeType,
CORBA::Boolean isSorted);
GEOM::GEOM_Object_ptr MakeArc (GEOM::GEOM_Object_ptr thePnt1,
GEOM::GEOM_Object_ptr thePnt2,
GEOM::GEOM_Object_ptr thePnt3);
+ GEOM::GEOM_Object_ptr MakeArcCenter (GEOM::GEOM_Object_ptr theCenter,
+ GEOM::GEOM_Object_ptr thePnt1,
+ GEOM::GEOM_Object_ptr thePnt2,
+ CORBA::Boolean theSense);
GEOM::GEOM_Object_ptr MakePolyline (GEOM::GEOM_List_ptr thePoints);
GEOM::GEOM_Object_ptr MakeSplineBezier (GEOM::GEOM_List_ptr thePoints);
GEOM::GEOM_Object_ptr MakeSplineInterpolation (GEOM::GEOM_List_ptr thePoints);
Plane1 = geompy.MakePlaneThreePnt(px, pz, p200, trimsize) #(4 Doubles)->GEOM_Object_ptr
Arc = geompy.MakeArc(py, pz, px) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
+ Arc2 = geompy.MakeArcCenter(py, pz, px,0) #(3 GEOM_Object_ptr,Boolean)->GEOM_Object_ptr
Circle = geompy.MakeCircle(p0, vz, radius1) #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
Circle1 = geompy.MakeCircleThreePnt(p0, pxyz, px) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
Ellipse = geompy.MakeEllipse(p0, vy, radius2, radius1) #(2 GEOM_Object_ptr, 2 Doubles)->GEOM_Object_ptr
print "Z axis: (", Pos[3], ", ", Pos[4], ", ", Pos[5], ")"
print "X axis: (", Pos[6], ", ", Pos[7], ", ", Pos[8], ")"
+ ####### KindOfShape #######
+
+ Kind = geompy.KindOfShape(box)
+ print "\nKindOfShape(box 10x30x70):", Kind
+ #if Kind[0] != geompy.kind.BOX:
+ # print "Error: returned type is", Kind[0], "while must be", geompy.kind.BOX
+
+ Kind = geompy.KindOfShape(p137)
+ print "\nKindOfShape(p137):", Kind
+ if Kind[0] != geompy.kind.VERTEX:
+ print " Error: returned type is", Kind[0], "while must be", geompy.kind.VERTEX
+ else:
+ dx = math.fabs(Kind[1] - 10)
+ dy = math.fabs(Kind[2] - 30)
+ dz = math.fabs(Kind[3] - 70)
+ if (dx + dy + dz) > 1e-5:
+ print " Error: coordinates are (", Kind[1], ",", Kind[2], ",", Kind[3], ") while must be (10, 20, 30)"
+
pass
# see salome_shared_modules.py
# (avoids incomplete import at run time)
-print "============== import GEOM ======================="
+from launchConfigureParser import verbose
+
+if verbose(): print "============== import GEOM ======================="
import GEOM
ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
+# -----------------------------------------------------------------------------
+# enumeration shape_kind
+# -----------------------------------------------------------------------------
+
+kind = GEOM.GEOM_IKindOfShape
+
+class info:
+ UNKNOWN = 0
+ CLOSED = 1
+ UNCLOSED = 2
+
# -----------------------------------------------------------------------------
# Basic primitives
# -----------------------------------------------------------------------------
print "MakeArc : ", CurvesOp.GetErrorCode()
return anObj
+## Create an arc of circle from a center and 2 points.
+# @param thePnt1 Center of the arc
+# @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
+# @param thePnt3 End point of the arc (Gives also a direction)
+# @return New GEOM_Object, containing the created arc.
+#
+# Example: see GEOM_TestAll.py
+def MakeArcCenter(thePnt1, thePnt2, thePnt3,theSense):
+ anObj = CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3,theSense)
+ if CurvesOp.IsDone() == 0:
+ print "MakeArcCenter : ", CurvesOp.GetErrorCode()
+ return anObj
+
## Create a circle with given center, normal vector and radius.
# @param thePnt Circle center.
# @param theVec Vector, normal to the plane of the circle.
print "MakePipeWithDifferentSections : ", PrimOp.GetErrorCode()
return anObj
+## Create a shape by extrusion of the profile shape along
+# the path shape. The path shape can be a shell or a face.
+# the several profiles can be specified in the several locations of path.
+# @param theSeqBases - list of Bases shape to be extruded.
+# @param theSeqSubBases - list of corresponding subshapes of section shapes.
+# @param theLocations - list of locations on the path corresponding
+# specified list of the Bases shapes. Number of locations
+# should be equal to number of bases or list of locations can be empty.
+# @param thePath - Path shape to extrude the base shape along it.
+# @param theWithContact - the mode defining that the section is translated to be in
+# contact with the spine.
+# @param - WithCorrection - defining that the section is rotated to be
+# orthogonal to the spine tangent in the correspondent point
+# @return New GEOM_Object, containing the created solids.
+#
+# Example: see GEOM_TestAll.py
+def MakePipeWithShellSections(theSeqBases, theSeqSubBases,
+ theLocations, thePath,
+ theWithContact, theWithCorrection):
+ anObj = PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
+ theLocations, thePath,
+ theWithContact, theWithCorrection)
+ if PrimOp.IsDone() == 0:
+ print "MakePipeWithShellSections : ", PrimOp.GetErrorCode()
+ return anObj
+
# -----------------------------------------------------------------------------
# Create base shapes
# -----------------------------------------------------------------------------
print "MakeGlueFaces : ", ShapesOp.GetErrorCode()
return anObj
+
+## Find coincident faces in theShape for possible gluing.
+# @param theShape Initial shape.
+# @param theTolerance Maximum distance between faces,
+# which can be considered as coincident.
+# @return ListOfGO.
+#
+# Example: see GEOM_Spanner.py
+def GetGlueFaces(theShape, theTolerance):
+ anObj = ShapesOp.GetGlueFaces(theShape, theTolerance)
+ if ShapesOp.IsDone() == 0:
+ print "GetGlueFaces : ", ShapesOp.GetErrorCode()
+ return anObj
+
+
+## Replace coincident faces in theShape by one face
+# in compliance with given list of faces
+# @param theShape Initial shape.
+# @param theTolerance Maximum distance between faces,
+# which can be considered as coincident.
+# @param theFaces List of faces for gluing.
+# @return New GEOM_Object, containing a copy of theShape
+# without some faces.
+#
+# Example: see GEOM_Spanner.py
+def MakeGlueFacesByList(theShape, theTolerance, theFaces):
+ anObj = ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces)
+ if ShapesOp.IsDone() == 0:
+ print "MakeGlueFacesByList : ", ShapesOp.GetErrorCode()
+ return anObj
+
+
# -----------------------------------------------------------------------------
# Boolean (Common, Cut, Fuse, Section)
# -----------------------------------------------------------------------------
print "GetPosition : ", MeasuOp.GetErrorCode()
return aTuple
+## Get kind of theShape.
+#
+# @param theShape Shape to get a kind of.
+# @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
+# and a list of parameters, describing the shape.
+# @note Concrete meaning of each value, returned via \a theIntegers
+# or \a theDoubles list depends on the kind of the shape.
+# The full list of possible outputs is:
+#
+# geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
+# geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
+#
+# geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
+# geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
+#
+# geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
+# geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
+#
+# geompy.kind.SPHERE xc yc zc R
+# geompy.kind.CYLINDER xb yb zb dx dy dz R H
+# geompy.kind.BOX xc yc zc ax ay az
+# geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
+# geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
+# geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
+# geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
+# geompy.kind.SOLID nb_faces nb_edges nb_vertices
+#
+# geompy.kind.SPHERE2D xc yc zc R
+# geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
+# geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
+# geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
+# geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
+# geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
+# geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
+# geompy.kind.PLANE xo yo zo dx dy dz
+# geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
+# geompy.kind.FACE nb_edges nb_vertices
+#
+# geompy.kind.CIRCLE xc yc zc dx dy dz R
+# geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
+# geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
+# geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
+# geompy.kind.LINE xo yo zo dx dy dz
+# geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
+# geompy.kind.EDGE nb_vertices
+#
+# geompy.kind.VERTEX x y z
+#
+# Example: see GEOM_TestMeasures.py
+def KindOfShape(theShape):
+ aRoughTuple = MeasuOp.KindOfShape(theShape)
+ if MeasuOp.IsDone() == 0:
+ print "KindOfShape : ", MeasuOp.GetErrorCode()
+ return []
+
+ aKind = aRoughTuple[0]
+ anInts = aRoughTuple[1]
+ aDbls = aRoughTuple[2]
+
+ # Now there is no exception from this rule:
+ aKindTuple = [aKind] + aDbls + anInts
+
+ # If they are we will regroup parameters for such kind of shape.
+ # For example:
+ #if aKind == kind.SOME_KIND:
+ # # SOME_KIND int int double int double double
+ # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
+
+ return aKindTuple
+
# -----------------------------------------------------------------------------
# Import/Export objects
# -----------------------------------------------------------------------------
#include <NMTDS_ShapesDataStructure.ixx>
+
+#include <TColStd_MapOfInteger.hxx>
+
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
+
+#include <BooleanOperations_ShapeAndInterferences.hxx>
#include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
+#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+
#include <NMTDS_ListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx>
#include <NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx>
-#include <BooleanOperations_ShapeAndInterferences.hxx>
#include <NMTDS_IndexRange.hxx>
-//
-#include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
-#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
-#include <TColStd_MapOfInteger.hxx>
//===========================================================================
//function : NMTDS_ShapesDataStructure::NMTDS_ShapesDataStructure
NMTDS_ListOfIndexedDataMapOfShapeAncestorsSuccessors aLx;
NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors aLit;
TopoDS_Iterator anIt;
- // Modified Thu Sep 14 14:35:18 2006
- // Contribution of Samtech www.samcef.com BEGIN
BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors aMSA;
- // Contribution of Samtech www.samcef.com END
//
anIt.Initialize(myCompositeShape);
- for (i=0; anIt.More(); anIt.Next(), ++i) {
- // Modified Thu Sep 14 14:35:18 2006
- // Contribution of Samtech www.samcef.com BEGIN
+ for (; anIt.More(); anIt.Next()) {
const TopoDS_Shape& aSx=anIt.Value();
BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors aMS;
- FillMap(aSx, aMSA, aMS);
- aLx.Append(aMS);
- // Contribution of Samtech www.samcef.com END
+ //modified by NIZNHY-PKV Tue Feb 27 17:05:47 2007f
+ //FillMap(aSx, aMSA, aMS);
+ //aLx.Append(aMS);
+ //
+ if (!aMSA.Contains(aSx)) {
+ FillMap(aSx, aMSA, aMS);
+ aLx.Append(aMS);
+ }
+ //modified by NIZNHY-PKV Tue Feb 27 17:06:03 2007t
}
- // Modified Thu Sep 14 14:35:18 2006
- // Contribution of Samtech www.samcef.com BEGIN
+ //
aNbS=aMSA.Extent();
- // Contribution of Samtech www.samcef.com END
//
// Fill myRanges
+ //modified by NIZNHY-PKV Tue Feb 27 17:10:07 2007f
+ i=aLx.Extent();
+ //modified by NIZNHY-PKV Tue Feb 27 17:10:10 2007t
myRanges.Resize(i);
aLit.Initialize(aLx);
for (i=1; aLit.More(); aLit.Next(), ++i) {
// Contribution of Samtech www.samcef.com BEGIN
//
// Fill the table
- //modified by NIZNHY-PKV Tue May 16 11:47:28 2006f
-
//aShift=0;
//for (i=0; i<2; ++i) {
// if (i) {
// InsertShapeAndAncestorsSuccessors(aSx, aASx, aShift);
// }
//}
-
+
aShift=0;
for (j=1; j<=aNbS; ++j) {
const TopoDS_Shape& aSx=aMSA.FindKey(j);
void NMTTools_DEProcessor::DoPaves()
{
- Standard_Integer i, aNbE, nED, nVD, nFD=0;
+ Standard_Integer i, aNbE, nED, nVD, nFD, aNbLPB;
//
+ nFD=0;
aNbE=myDEMap.Extent();
for (i=1; i<=aNbE; i++) {
nED=myDEMap.FindKey(i);
TColStd_ListIteratorOfListOfInteger anIt(nLF);
for (; anIt.More(); anIt.Next()) {
nFD=anIt.Value();
-
+ //
BOPTools_ListOfPaveBlock aLPB;
FindPaveBlocks(nED, nVD, nFD, aLPB);
+ //modified by NIZNHY-PKV Fri Mar 23 10:35:27 2007f
+ //
+ aNbLPB=aLPB.Extent();
+ if (!aNbLPB) {
+ continue;
+ }
+ //modified by NIZNHY-PKV Fri Mar 23 10:35:33 2007t
FillPaveSet (nED, nVD, nFD, aLPB);
}
//
#include <NMTTools_PaveFiller.ixx>
//
-// Modified Thu Sep 14 14:35:18 2006
-// Contribution of Samtech www.samcef.com BEGIN
-#include <TColStd_ListOfInteger.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <BRepBndLib.hxx>
-#include <BOPTools_CArray1OfVSInterference.hxx>
-#include <BOPTools_VSInterference.hxx>
-// Contribution of Samtech www.samcef.com END
-
#include <stdio.h>
#include <Precision.hxx>
-#include <NCollection_UBTreeFiller.hxx>
-
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <TColStd_MapOfInteger.hxx>
-
-#include <gp_XYZ.hxx>
-#include <gp_Pnt.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Compound.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
-#include <TopTools_DataMapOfShapeListOfShape.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_DataMapOfShapeShape.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
#include <IntTools_ShrunkRange.hxx>
#include <IntTools_Range.hxx>
#include <BooleanOperations_KindOfInterference.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
-#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
-#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
-#include <NMTDS_BoxBndTree.hxx>
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
#include <NMTTools_ListOfCommonBlock.hxx>
#include <NMTTools_CommonBlock.hxx>
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
+// Modified Thu Sep 14 14:35:18 2006
+// Contribution of Samtech www.samcef.com BEGIN
+#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <BRepBndLib.hxx>
+#include <BOPTools_CArray1OfVSInterference.hxx>
+#include <BOPTools_VSInterference.hxx>
+// Contribution of Samtech www.samcef.com END
+//
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <Bnd_HArray1OfBox.hxx>
+#include <Bnd_BoundSortBox.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
+#include <TopTools_DataMapOfShapeListOfShape.hxx>
+#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
+#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
+#include <Bnd_Box.hxx>
+#include <BRepBndLib.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_DataMapOfShapeShape.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <gp_XYZ.hxx>
+#include <gp_Pnt.hxx>
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+#include <TColStd_MapOfInteger.hxx>
+//
+#include <NMTDS_BoxBndTree.hxx>
+#include <NCollection_UBTreeFiller.hxx>
+#include <TColStd_MapOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+
static
void TreatNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI,
TopoDS_Vertex& aNewVertex);
-
static
void VertexParameters(const IntTools_CommonPrt& aCPart,
Standard_Real& aT1,
static
void FindChains(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB,
NMTTools_ListOfCommonBlock& aLCB);
+
//=======================================================================
// function: PerformEE
// purpose:
}//for (; aIt.More(); aIt.Next()) {
}// for (; aItIm.More(); aItIm.Next())
}
+//
+// case: use_02
+// completely rewritten
//=======================================================================
//function : TreatNewVertices
//purpose :
TopTools_DataMapOfShapeListOfShape& myImages,
TopTools_DataMapOfShapeShape& myOrigins)
{
- Standard_Integer j, i, aNbV, aIndex, aNbVSD;
+ Standard_Integer j, i, aNbV, aNbVSD;
Standard_Real aTol;
TColStd_ListIteratorOfListOfInteger aIt;
TopoDS_Shape aSTmp, aVF;
NMTDS_IndexedDataMapOfIntegerShape aMIS;
NMTDS_IndexedDataMapOfShapeBox aMSB;
//
- //
NMTDS_BoxBndTreeSelector aSelector;
NMTDS_BoxBndTree aBBTree;
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
//
- //
myImages.Clear();
myOrigins.Clear();
//
//
aTreeFiller.Fill();
//
+ // Chains
for (i=1; i<=aNbV; ++i) {
const TopoDS_Shape& aV=aMV(i);
//
continue;
}
//
- const Bnd_Box& aBoxV=aMSB.FindFromKey(aV);
- aSelector.Clear();
- aSelector.SetBox(aBoxV);
- //
- aNbVSD=aBBTree.Select(aSelector);
- if (!aNbVSD) {
- continue; // it must not be
- }
- //
- // Images
- //
+ Standard_Integer aNbIP, aIP, aNbIP1, aIP1;
TopTools_ListOfShape aLVSD;
+ TColStd_MapOfInteger aMIP, aMIP1, aMIPC;
+ TColStd_MapIteratorOfMapOfInteger aIt1;
//
- const TColStd_ListOfInteger& aLI=aSelector.Indices();
- aIt.Initialize(aLI);
- for (j=0; aIt.More(); aIt.Next(), ++j) {
- aIndex=aIt.Value();
- const TopoDS_Shape& aVx=aMIS.FindFromKey(aIndex);
- if(!j) {
- aVF=aVx;
+ aMIP.Add(i);
+ while(1) {
+ aNbIP=aMIP.Extent();
+ aIt1.Initialize(aMIP);
+ for(; aIt1.More(); aIt1.Next()) {
+ aIP=aIt1.Key();
+ if (aMIPC.Contains(aIP)) {
+ continue;
+ }
+ //
+ const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
+ const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
+ //
+ aSelector.Clear();
+ aSelector.SetBox(aBoxVP);
+ //
+ aNbVSD=aBBTree.Select(aSelector);
+ if (!aNbVSD) {
+ continue; // it must not be
+ }
+ //
+ const TColStd_ListOfInteger& aLI=aSelector.Indices();
+ aIt.Initialize(aLI);
+ for (; aIt.More(); aIt.Next()) {
+ aIP1=aIt.Value();
+ if (aMIP.Contains(aIP1)) {
+ continue;
+ }
+ aMIP1.Add(aIP1);
+ } //for (; aIt.More(); aIt.Next()) {
+ }//for(; aIt1.More(); aIt1.Next()) {
+ //
+ aNbIP1=aMIP1.Extent();
+ if (!aNbIP1) {
+ break; // from while(1)
+ }
+ //
+ aIt1.Initialize(aMIP);
+ for(; aIt1.More(); aIt1.Next()) {
+ aIP=aIt1.Key();
+ aMIPC.Add(aIP);
+ }
+ //
+ aMIP.Clear();
+ aIt1.Initialize(aMIP1);
+ for(; aIt1.More(); aIt1.Next()) {
+ aIP=aIt1.Key();
+ aMIP.Add(aIP);
}
- aLVSD.Append(aVx);
- aMVProcessed.Add(aVx);
+ aMIP1.Clear();
+ }// while(1)
+ //...
+ aNbIP=aMIPC.Extent();
+ if (!aNbIP) {
+ //modified by NIZNHY-PKV Tue Jan 9 14:26:09 2007f
+ aMIPC.Add(i);
+ //continue;
+ //modified by NIZNHY-PKV Tue Jan 9 14:26:12 2007t
}
//
+ aIt1.Initialize(aMIPC);
+ for(j=0; aIt1.More(); aIt1.Next(), ++j) {
+ aIP=aIt1.Key();
+ const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
+ if (!j) {
+ aVF=aVP;
+ }
+ aLVSD.Append(aVP);
+ aMVProcessed.Add(aVP);
+ }
myImages.Bind(aVF, aLVSD);
- }
+ }// for (i=1; i<=aNbV; ++i) {
+ //------------------------------
//
// Make new vertices
aMV.Clear();
}
}
}
+//
//=======================================================================
//function : MakeNewVertex
//purpose :
}
}
// Contribution of Samtech www.samcef.com END
+/*
+//=======================================================================
+// function:EENewVertices
+// purpose:
+//=======================================================================
+ void NMTTools_PaveFiller::EENewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI)
+{
+ Standard_Integer aNb, i, j, aNewShape, aNbEdges, aNbIEE, aNbVV, aNbSimple;
+ Standard_Integer aWhat, aWith, i1, i2, nE1, nE2, nE, nV, aFlag;
+ Standard_Real aT;
+ TopoDS_Compound aCompound;
+ BRep_Builder aBB;
+ NMTTools_IndexedDataMapOfIndexedMapOfInteger aMNVE, aMNVIEE;
+ BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
+ BOPTools_Pave aPave;
+ TopoDS_Vertex aNewVertex;
+ TopTools_IndexedMapOfShape aMNVComplex, aMNVSimple;
+ //
+ BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+ //
+ aNb=aMapVI.Extent();
+ //
+ if (!aNb) { // no new vertices, no new problems
+ return;
+ }
+ //
+ // 0.
+ if (aNb==1) {
+ aNewVertex=TopoDS::Vertex(aMapVI.FindKey(1));
+ EENewVertices(aNewVertex, aMapVI);
+ return;
+ }
+ //
+ // 1. Make compound from new vertices
+ aBB.MakeCompound(aCompound);
+ for (i=1; i<=aNb; ++i) {
+ const TopoDS_Shape& aV=aMapVI.FindKey(i);
+ aBB.Add(aCompound, aV);
+ }
+ //
+ // 2. VV intersection between these vertices
+ // using the auxiliary Filler
+ NMTDS_ShapesDataStructure tDS;
+ //
+ tDS.SetCompositeShape(aCompound);
+ tDS.Init();
+ //
+ BOPTools_InterferencePool tInterfPool(tDS);
+ NMTTools_PaveFiller tPaveFiller(tInterfPool);
+ //
+ tPaveFiller.Init();
+ //
+ tPaveFiller.PerformVV();
+ tPaveFiller.PerformNewVertices();
+ //
+ const BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterfs();
+ //
+ // 3. Separate Comlex and Simple new vertices
+ aNbVV=aVVInterfs.Extent();
+ for (i=1; i<=aNbVV; ++i) {
+ const BOPTools_VVInterference& aVV=aVVInterfs(i);
+ aVV.Indices(aWhat, aWith);
+ const TopoDS_Shape& aV1=tDS.Shape(aWhat);
+ const TopoDS_Shape& aV2=tDS.Shape(aWith);
+ aMNVComplex.Add(aV1);
+ aMNVComplex.Add(aV2);
+ }
+ //
+ for (i=1; i<=aNb; ++i) {
+ const TopoDS_Shape& aV=aMapVI.FindKey(i);
+ if (!aMNVComplex.Contains(aV)) {
+ aMNVSimple.Add(aV);
+ }
+ }
+ //
+ // 4. Treat Simple new Vertices
+ aNbSimple=aMNVSimple.Extent();
+ for (i=1; i<=aNbSimple; ++i) {
+ const TopoDS_Vertex& aV=TopoDS::Vertex(aMNVSimple(i));
+ EENewVertices(aV, aMapVI);
+ }
+ //
+ // 3. Fill Maps : NewVertex-edges (aMNVE)
+ // NewVertex-interferences (aMNVIEE)
+ for (i=1; i<=aNbVV; ++i) {
+ const BOPTools_VVInterference& aVV=aVVInterfs(i);
+ aNewShape=aVV.NewShape();
+ if (!aNewShape) {
+ continue;
+ }
+ //
+ if (!aMNVE.Contains(aNewShape)) {
+ TColStd_IndexedMapOfInteger aMx;
+ aMNVE.Add(aNewShape, aMx);
+ }
+ if (!aMNVIEE.Contains(aNewShape)) {
+ TColStd_IndexedMapOfInteger aMx;
+ aMNVIEE.Add(aNewShape, aMx);
+ }
+ //
+ TColStd_IndexedMapOfInteger& aME=aMNVE.ChangeFromKey(aNewShape);
+ TColStd_IndexedMapOfInteger& aMIEE=aMNVIEE.ChangeFromKey(aNewShape);
+ //
+ aVV.Indices(aWhat, aWith);
+ //aWhat
+ const TopoDS_Shape& aV1=tDS.Shape(aWhat);
+ i1=aMapVI.FindFromKey(aV1);
+ const BOPTools_EEInterference& aEE1=aEEs(i1);
+ aEE1.Indices(nE1, nE2);
+ aME.Add(nE1);
+ aME.Add(nE2);
+ aMIEE.Add(i1);
+ //aWith
+ const TopoDS_Shape& aV2=tDS.Shape(aWith);
+ i2=aMapVI.FindFromKey(aV2);
+ const BOPTools_EEInterference& aEE2=aEEs(i2);
+ aEE2.Indices(nE1, nE2);
+ aME.Add(nE1);
+ aME.Add(nE2);
+ aMIEE.Add(i2);
+ //
+ //printf(" VV: (%d, %d) -> %d\n", aWhat, aWith, aNewShape);
+ }
+ //
+ // 4. Process new vertices
+ aNb=aMNVE.Extent();
+ for (i=1; i<=aNb; ++i) { // xx
+ //
+ // new Vertex
+ nV=aMNVE.FindKey(i);
+ aNewVertex=TopoDS::Vertex(tDS.Shape(nV));
+ //
+ // Insert New Vertex in DS;
+ myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
+ aNewShape=myDS->NumberOfInsertedShapes();
+ myDS->SetState (aNewShape, BooleanOperations_ON);
+ //
+ // Update index of NewShape in EE interferences
+ const TColStd_IndexedMapOfInteger& aMIEE=aMNVIEE.FindFromKey(nV);//(i);
+ aNbIEE=aMIEE.Extent();
+ for (j=1; j<=aNbIEE; ++j) {
+ i1=aMIEE(j);
+ BOPTools_EEInterference& aEE1=aEEs(i1);
+ aEE1.SetNewShape(aNewShape);
+ }
+ //
+ // Update Paves on edges
+ const TColStd_IndexedMapOfInteger& aME=aMNVE(i);
+ aNbEdges=aME.Extent();
+ for (j=1; j<=aNbEdges; ++j) {
+ nE=aME(j);
+ const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));//mpv
+ //
+ aFlag=myContext.ComputeVE (aNewVertex, aE, aT);
+ //
+ if (!aFlag) {
+ aPave.SetInterference(-1);
+ aPave.SetType (BooleanOperations_EdgeEdge);
+ aPave.SetIndex(aNewShape);
+ aPave.SetParam(aT);
+ //
+ BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE));
+ aPaveSet.Append(aPave);
+ }
+ }
+ }// for (i=1; i<=aNb; ++i) {// xx
+}
+//=======================================================================
+// function:EENewVertices
+// purpose:
+//=======================================================================
+ void NMTTools_PaveFiller::EENewVertices (const TopoDS_Vertex& aNewVertex,
+ const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI)
+{
+ Standard_Integer i, aNewShape, nE1, nE2;
+ Standard_Real aT1, aT2;
+ BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
+ BOPTools_Pave aPave;
+ //
+ BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+ //
+ // one new vertex case is treated in usual way
+ //
+ // Insert New Vertex in DS;
+ myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
+ aNewShape=myDS->NumberOfInsertedShapes();
+ myDS->SetState (aNewShape, BooleanOperations_ON);
+ // Insert New Vertex in EE Interference
+ i=aMapVI.FindFromKey(aNewVertex);
+ BOPTools_EEInterference& aEEInterf= aEEs(i);
+ aEEInterf.SetNewShape(aNewShape);
+ // Extact interference info
+ aEEInterf.Indices(nE1, nE2);
+ const IntTools_CommonPrt& aCPart=aEEInterf.CommonPrt();
+ VertexParameters(aCPart, aT1, aT2);
+ //
+ // Add Paves to the myPavePoolNew
+ aPave.SetInterference(i);
+ aPave.SetType (BooleanOperations_EdgeEdge);
+ aPave.SetIndex(aNewShape);
+ // Pave for edge nE1
+ aPave.SetParam(aT1);
+ BOPTools_PaveSet& aPaveSet1=myPavePoolNew(myDS->RefEdge(nE1));
+ aPaveSet1.Append(aPave);
+ // Pave for edge nE2
+ aPave.SetParam(aT2);
+ BOPTools_PaveSet& aPaveSet2=myPavePoolNew(myDS->RefEdge(nE2));
+ aPaveSet2.Append(aPave);
+}
+*/
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <NMTTools_MapOfPaveBlock.hxx>
+//
+#include <IntTools_ShrunkRange.hxx>
static
Standard_Boolean IsPairFound(const Standard_Integer nF1,
TopTools_ListOfShape& aLS);
// Contribution of Samtech www.samcef.com END
+static
+ Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
+ IntTools_Context& aCtx);
+
//=======================================================================
// function: PerformFF
// purpose:
Standard_Boolean bIsExistingPaveBlock, bIsValidIn2D, bIsCoincided;
// Contribution of Samtech www.samcef.com END
//
+ Standard_Boolean bIsMicroEdge;
Standard_Integer i, aNbFFs, nF1, nF2, aBid=0;
Standard_Integer nV1, nV2, j, aNbCurves;
Standard_Real aTolR3D, aTol2D, aT1, aT2, aTolPPC=Precision::PConfusion();
//
BOPTools_Tools::MakeSectEdge (aIC, aV1, aT1, aV2, aT2, aES);
//
- //modified by NIZNHY-PKV Thu Nov 16 11:13:46 2006f SKL/PartC5
- {
- Handle(Geom2d_Curve) aC2D1, aC2D2;
- //
- aC2D1=aIC.FirstCurve2d();
- aC2D2=aIC.SecondCurve2d();
- //
- NMTTools_Tools::MakePCurve(aES, aF1, aC2D1);
- NMTTools_Tools::MakePCurve(aES, aF2, aC2D2);
- NMTTools_Tools::UpdateEdge (aES, aTolR3D);
+ // use_01 f
+ //
+ NMTTools_Tools::UpdateEdge (aES, aTolR3D);
+ bIsMicroEdge=IsMicroEdge(aES, myContext);
+ if (bIsMicroEdge) {
+ continue;
}
-
//
- /*
+ //use_01 t
+ //
+ // SKL/PartC5 f
{
- Standard_Real aTolR2D;
Handle(Geom2d_Curve) aC2D1, aC2D2;
//
- aTolR2D=aFFi.TolR2D();
aC2D1=aIC.FirstCurve2d();
aC2D2=aIC.SecondCurve2d();
//
- NMTTools_Tools::MakePCurve(aES, aF1, aC2D1, aTolR2D);
- NMTTools_Tools::MakePCurve(aES, aF2, aC2D2, aTolR2D);
+ NMTTools_Tools::MakePCurve(aES, aF1, aC2D1);
+ NMTTools_Tools::MakePCurve(aES, aF2, aC2D2);
+ //SKL/PartC5 t
}
- */
- //modified by NIZNHY-PKV Thu Nov 16 11:17:34 2006t
//
aMEPB.Add(aES, aPBNew);
aMapEI.Add(aES, i);
aF2FWD=aF2;
aF2FWD.Orientation(TopAbs_FORWARD);
//
- //modified by NIZNHY-PKV Thu Nov 16 12:49:13 2006f SKL/PartC5
- //NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1, aTolEx);
- //NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2, aTolEx);
+ // SKL/PartC5 f
NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1);
NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2);
NMTTools_Tools::UpdateEdge (aEx, aTolEx);
- //modified by NIZNHY-PKV Thu Nov 16 12:49:24 2006t
+ //SKL/PartC5 t
} //if (aCBAPI.IsCommonBlock(aPB))
//
// new SE
void NMTTools_PaveFiller::MakePCurves()
{
Standard_Integer i, aNb, nF1, nF2, nE;
+ Standard_Integer aNbCB, aNbF, nSp, nF;
TopoDS_Face aF1FWD, aF2FWD;
+ TColStd_ListIteratorOfListOfInteger aItF;
BOPTools_ListIteratorOfListOfPaveBlock anIt;
+ NMTTools_ListIteratorOfListOfCommonBlock aItCB;
+ TopAbs_ShapeEnum aType;
//
BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
//
BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF1FWD);
BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF2FWD);
}
- }
+ }
+ //
+ //modified by NIZNHY-PKV Fri Mar 23 10:35:02 2007f
+ // Check common blocks between edges and faces
+ // Build P-Curves if they were not built in previos block.
+ //
+ // The main case is :arguments for e.g aEdge, aFace -> no FFs,
+ // but p-curves are needed.
+ //
+ aNb=myDS->NumberOfShapesOfTheObject();
+ for (i=1; i<=aNb; ++i) {
+ const TopoDS_Shape& aS=myDS->Shape(i);
+ aType=aS.ShapeType();
+ //
+ if (aType!=TopAbs_EDGE) {
+ continue;
+ }
+ const TopoDS_Edge& aE=TopoDS::Edge(aS);
+ //
+ if (BRep_Tool::Degenerated(aE)) {
+ continue;
+ }
+ //
+ const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(i));
+ aNbCB=aLCB.Extent();
+ if (!aNbCB) {
+ continue;
+ }
+ //
+ aItCB.Initialize(aLCB);
+ for (; aItCB.More(); aItCB.Next()) {
+ const NMTTools_CommonBlock& aCB=aItCB.Value();
+ const BOPTools_PaveBlock &aPB1=aCB.PaveBlock1();
+ //
+ const TColStd_ListOfInteger& aLF=aCB.Faces();
+ aNbF=aLF.Extent();
+ if (!aNbF) {
+ continue;
+ }
+ //
+ nSp=aPB1.Edge();
+ const TopoDS_Edge aSp=TopoDS::Edge(myDS->Shape(nSp));//mpv
+ //
+ aItF.Initialize(aLF);
+ for (; aItF.More(); aItF.Next()) {
+ nF=aItF.Value();
+ aF1FWD=TopoDS::Face(myDS->Shape(nF));
+ aF1FWD.Orientation(TopAbs_FORWARD);
+ //
+ BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aSp, aF1FWD);
+ } // for (; aItCB.More(); aItCB.Next()) {
+ }//if (aS.ShapeType()==TopAbs_EDGE) {
+ }
+ //modified by NIZNHY-PKV Fri Mar 23 10:35:13 2007t
}
//=======================================================================
// function: IsExistingPaveBlock
// V22
const BOPTools_Pave& aPave22=aPBR.Pave2();
nV22=aPave22.Index();
- //modified by NIZNHY-PKV Wed Nov 15 13:08:13 2006f
+ //
if (nV11==nV21 || nV11==nV22 || nV12==nV21 || nV12==nV22) {
continue;
}
- //modified by NIZNHY-PKV Wed Nov 15 13:08:15 2006t
+ //
// E2
nE2=aPBR.Edge();
//
}
//
// Contribution of Samtech www.samcef.com END
+
+// use_01 f
+//=======================================================================
+//function : IsMicroEdge
+//purpose :
+//=======================================================================
+Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
+ IntTools_Context& aCtx)
+{
+ Standard_Boolean bRet;
+ Standard_Integer iErr;
+ Standard_Real aT1, aT2, aTmp;
+ Handle(Geom_Curve) aC3D;
+ TopoDS_Vertex aV1, aV2;
+ IntTools_Range aR;
+ //
+ bRet=(BRep_Tool::Degenerated(aE) ||
+ !BRep_Tool::IsGeometric(aE));
+ if (bRet) {
+ return bRet;
+ }
+ //
+ aC3D=BRep_Tool::Curve(aE, aT1, aT2);
+ TopExp::Vertices(aE, aV1, aV2);
+ aT1=BRep_Tool::Parameter(aV1, aE);
+ aT2=BRep_Tool::Parameter(aV2, aE);
+ if (aT2<aT1) {
+ aTmp=aT1;
+ aT1=aT2;
+ aT2=aTmp;
+ }
+ //
+ aR.SetFirst(aT1);
+ aR.SetLast(aT2);
+ IntTools_ShrunkRange aSR (aE, aV1, aV2, aR, aCtx);
+ iErr=aSR.ErrorStatus();
+ bRet=!aSR.IsDone();
+ //
+ return bRet;
+}
+// use_01 t
aCBIt.Initialize(aLCB);
for (; aCBIt.More(); aCBIt.Next()) {
NMTTools_CommonBlock& aCB=aCBIt.Value();
+ //
+ //modified by NIZNHY-PKV Wed Nov 8 15:59:46 2006f
+ // Among all PBs of aCB the first PB will be one
+ // that have max tolerance value
+ {
+ Standard_Real aTolEx, aTolExMax;
+ BOPTools_ListOfPaveBlock *pLPB, aLPBx;
+ //
+ aTolExMax=-1.;
+ pLPB=(BOPTools_ListOfPaveBlock *)&aCB.PaveBlocks();
+ aPBIt.Initialize(*pLPB);
+ for (; aPBIt.More(); aPBIt.Next()) {
+ const BOPTools_PaveBlock& aPBx=aPBIt.Value();
+ nEx=aPBx.OriginalEdge();
+ const TopoDS_Edge& aEx=TopoDS::Edge(myDS->Shape(nEx));
+ aTolEx=BRep_Tool::Tolerance(aEx);
+ if (aTolEx>aTolExMax) {
+ aTolExMax=aTolEx;
+ aLPBx.Prepend(aPBx);
+ }
+ else{
+ aLPBx.Append(aPBx);
+ }
+ }
+ //
+ pLPB->Clear();
+ *pLPB=aLPBx;
+ }
+ //modified by NIZNHY-PKV Wed Nov 8 15:59:50 2006t
+ //
BOPTools_PaveBlock& aPB=aCB.PaveBlock1(nE);
nSp=SplitIndex(aPB);
aPB.SetEdge(nSp);
#include <Prs3d_ShadingAspect.hxx>
#include <SelectBasics_SensitiveEntity.hxx>
#include <SelectMgr_EntityOwner.hxx>
+#include <StdSelect_BRepOwner.hxx>
#include <SelectMgr_IndexedMapOfOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <StdSelect_DisplayMode.hxx>
TopExp::MapShapes(aMainShape, aMapOfShapes);
for ( Standard_Integer i = 1, n = anAllMap.Extent(); i <= n; i++ ) {
- Handle(SelectMgr_EntityOwner) anOwner = anAllMap( i );
+ Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(anAllMap( i ));
if ( anOwner.IsNull() || !anOwner->HasShape() )
continue;
}
GEOM_AISShape::GEOM_AISShape(const TopoDS_Shape& shape,
- const Standard_CString aName): SALOME_AISShape(shape)
+ const Standard_CString aName)
+ : SALOME_AISShape(shape), myName(aName)
{
- myName = new char [strlen(aName)+1];
- strcpy( myName, aName);
-
myShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD );
}
void GEOM_AISShape::setName(const Standard_CString aName)
{
- myName = new char [strlen(aName)+1];
- strcpy( myName, aName);
+ myName = aName;
Handle(SALOME_InteractiveObject) IO = getIO();
if ( !IO.IsNull() )
}
Standard_CString GEOM_AISShape::getName(){
- return myName;
+ return myName.ToCString();
}
void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
#include <Handle_Prs3d_Presentation.hxx>
#endif
+#include <TCollection_AsciiString.hxx>
+
class PrsMgr_PresentationManager3d;
class Prs3d_Presentation;
class SALOME_InteractiveObject;
//
friend Handle_Standard_Type& GEOM_AISShape_Type_();
const Handle(Standard_Type)& DynamicType() const;
- Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
-
-protected:
-
- // Methods PROTECTED
- //
-
-
- // Fields PROTECTED
- //
+ Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+protected:
+ Quantity_Color myShadingColor;
private:
-
- // Methods PRIVATE
- //
-
-
- // Fields PRIVATE
- //
- Standard_CString myName;
- Quantity_Color myShadingColor;
+ TCollection_AsciiString myName;
};
-
-
-
// other inline functions and methods (like "C++: function call" methods)
//
--- /dev/null
+// GEOM OBJECT : interactive object for Geometry entities visualization
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : GEOM_AISVector.cxx
+// Author : Julia DOROVSKIKH
+// $Header$
+
+
+#include <GEOM_AISVector.hxx>
+
+// OCCT Includes
+#include <Prs3d_Presentation.hxx>
+#include <Prs3d_Arrow.hxx>
+#include <PrsMgr_PresentationManager3d.hxx>
+#include <Graphic3d_Group.hxx>
+#include <BRep_Tool.hxx>
+#include <TopExp.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Vec.hxx>
+
+IMPLEMENT_STANDARD_HANDLE(GEOM_AISVector, GEOM_AISShape)
+IMPLEMENT_STANDARD_RTTIEXT(GEOM_AISVector, GEOM_AISShape)
+
+//=======================================================================
+//function : GEOM_AISVector
+//purpose : Constructor
+//=======================================================================
+GEOM_AISVector::GEOM_AISVector (const TopoDS_Shape& theShape, const Standard_CString theName)
+ : GEOM_AISShape(theShape, theName)
+{
+}
+
+//=======================================================================
+//function : Compute
+//purpose : Compute a presentation
+//=======================================================================
+void GEOM_AISVector::Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+ const Handle(Prs3d_Presentation)& thePrs,
+ const Standard_Integer theMode)
+{
+ GEOM_AISShape::Compute(thePresentationManager, thePrs, theMode);
+
+ if (myshape.ShapeType() == TopAbs_EDGE)
+ {
+ TopoDS_Vertex aV1, aV2;
+ TopoDS_Edge anEdgeE = TopoDS::Edge(myshape);
+ TopExp::Vertices(anEdgeE, aV1, aV2);
+ gp_Pnt aP1 = BRep_Tool::Pnt(aV1);
+ gp_Pnt aP2 = BRep_Tool::Pnt(aV2);
+
+ gp_Vec aVec (aP1, aP2);
+ Standard_Real aDist = aVec.Magnitude();
+ if (aDist > gp::Resolution())
+ {
+ gp_Dir aDir (aVec);
+
+ Handle(Graphic3d_Group) aG = Prs3d_Root::CurrentGroup(thePrs);
+
+ //thePrs->Color(myShadingColor.Name());
+ //aG->BeginPrimitives();
+ Prs3d_Arrow::Draw(thePrs, aP2, aDir, PI/180.*5., aDist/10.);
+ //aG->EndPrimitives();
+ }
+ }
+ //thePrs->ReCompute(); // for hidden line recomputation if necessary...
+}
--- /dev/null
+// GEOM OBJECT : interactive object for Geometry entities visualization
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : GEOM_AISVector.hxx
+// Author : Julia DOROVSKIKH
+// Module : GEOM
+
+#ifndef GEOM_AISVector_HeaderFile
+#define GEOM_AISVector_HeaderFile
+
+#include <GEOM_AISShape.hxx>
+#include <Standard_DefineHandle.hxx>
+
+/*!
+ * \class GEOM_AISVector
+ * \brief Interactive object, representing a vector with arrow on its end
+ */
+
+class GEOM_AISVector : public GEOM_AISShape
+{
+public:
+ /*!
+ * Constructor
+ * \param theShape A linear edge to be represented as a vector
+ * \param theName A name to be passed in constructor of \a GEOM_AISShape
+ */
+ Standard_EXPORT GEOM_AISVector (const TopoDS_Shape& theShape, const Standard_CString theName);
+
+protected:
+ /*!
+ * Redefined from GEOM_AISShape
+ */
+ virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+ const Handle(Prs3d_Presentation)& thePresentation,
+ const Standard_Integer theMode = 0);
+
+public:
+ DEFINE_STANDARD_RTTI (GEOM_AISVector)
+};
+
+DEFINE_STANDARD_HANDLE(GEOM_AISVector, GEOM_AISShape)
+
+#endif
GEOM_Actor *f = GEOM_Actor::SafeDownCast(prop);
if ( f != NULL )
{
- this->setInputShape(f->getTopo(),f->getDeflection(),f->getDisplayMode());
+ this->setInputShape(f->getTopo(),f->getDeflection(),f->getDisplayMode(),f->isVector());
this->setName( f->getName() );
if ( f->hasIO() )
this->setIO( f->getIO() );
deflection = adef;
}
-void GEOM_Actor::setInputShape(const TopoDS_Shape& aShape,double adef,int imode) {
+void GEOM_Actor::setInputShape(const TopoDS_Shape& aShape, double adef,
+ int imode, bool isVector)
+{
myShape = aShape;
deflection = adef;
+ myIsVector = isVector;
setDisplayMode(imode);
}
this->SetPosition(aPnt.X(),aPnt.Y(),aPnt.Z());
}
GEOM_OCCReader* aread = GEOM_OCCReader::New();
- aread->setTopo(myShape);
+ aread->setTopo(myShape, myIsVector);
aread->setDisplayMode(theMode);
aread->GetOutput()->ReleaseDataFlagOn();
-
+
vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New();
if (theMode == 0) {
aMapper->SetInput(aread->GetOutput());
void ReleaseGraphicsResources(vtkWindow *);
const TopoDS_Shape& getTopo();
- void setInputShape(const TopoDS_Shape& ashape,double adef1,int imode);
+ void setInputShape(const TopoDS_Shape& ashape, double adef1,
+ int imode, bool isVector = false);
double getDeflection();
void setDeflection(double adefl);
+ double isVector() { return myIsVector; }
+
// SubShape
void SubShapeOn();
void SubShapeOff();
TopoDS_Shape myShape;
double deflection;
+ bool myIsVector;
vtkMapper* ShadingMapper;
vtkMapper* WireframeMapper;
vtkActorCollection* GEOM_AssemblyBuilder::BuildActors(const TopoDS_Shape& myShape,
- Standard_Real deflection,
- Standard_Integer mode,
- Standard_Boolean forced) {
-
+ Standard_Real deflection,
+ Standard_Integer mode,
+ Standard_Boolean forced,
+ Standard_Boolean isVector)
+{
vtkActorCollection* AISActors = vtkActorCollection::New();
if(myShape.ShapeType() == TopAbs_COMPOUND) {
TopoDS_Iterator anItr(myShape);
for(; anItr.More(); anItr.Next()) {
- vtkActorCollection* theActors = GEOM_AssemblyBuilder::BuildActors(anItr.Value(), deflection, mode, forced);
+ vtkActorCollection* theActors =
+ GEOM_AssemblyBuilder::BuildActors(anItr.Value(), deflection, mode, forced);
theActors->InitTraversal();
vtkActor* anActor = (vtkActor*)theActors->GetNextActor();
while(!(anActor==NULL)) {
- AISActors->AddItem(anActor);
- anActor = (vtkActor*)theActors->GetNextActor();
+ AISActors->AddItem(anActor);
+ anActor = (vtkActor*)theActors->GetNextActor();
}
}
}
}
} else if ( myShape.ShapeType() == TopAbs_EDGE ) { // EDGE Actor
GEOM_Actor* EdgeActor = GEOM_Actor::New();
- EdgeActor->setInputShape(myShape,deflection,mode);
+ EdgeActor->setInputShape(myShape,deflection,mode,isVector);
EdgeActor->SetShadingProperty(EdgeIProp);
EdgeActor->SetWireframeProperty(EdgeIProp);
EdgeActor->SetPreviewProperty(EdgePVProp);
static vtkActorCollection* BuildActors(const TopoDS_Shape& myShape,
Standard_Real deflection,
Standard_Integer amode,
- Standard_Boolean forced);
+ Standard_Boolean forced,
+ Standard_Boolean isVector = Standard_False);
//------------------------------------------------------------------
edgeTransf = aEdgeLoc.Transformation();
}
+ gp_Pnt aP1, aP2;
+
Standard_Integer nbnodes;
if (aEdgePoly.IsNull()) {
nbnodes = P->NbNodes();
const TColgp_Array1OfPnt& theNodesP = P->Nodes();
+ aP1 = theNodesP(1);
+ aP2 = theNodesP(nbnodes);
+
float coord[3];
int pts[2];
-
+
for(int j=1;j<nbnodes;j++) {
gp_Pnt pt1 = theNodesP(j);
gp_Pnt pt2 = theNodesP(j+1);
const TColStd_Array1OfInteger& Nodesidx = aEdgePoly->Nodes();
const TColgp_Array1OfPnt& theNodesPoly = T->Nodes();
+ aP1 = theNodesPoly(1);
+ aP2 = theNodesPoly(nbnodes);
+
float coord[3];
int pts[2];
Cells->InsertNextCell(2,pts);
}
}
+
+ // vector representation has an arrow on its end
+ if (myIsVector)
+ {
+ if (!isidtrsf) {
+ // apply edge transformation
+ aP1.Transform(edgeTransf);
+ aP2.Transform(edgeTransf);
+ }
+
+ // draw an arrow
+ gp_Vec aDirVec (aP1, aP2);
+ Standard_Real aDist = aDirVec.Magnitude();
+ if (aDist < gp::Resolution()) return;
+ gp_Dir aDirection (aDirVec);
+
+ Standard_Real anAngle = PI/180.*5.;
+ Standard_Real aLength = aDist/10.;
+
+ Standard_Real dx,dy,dz;
+ aDirection.Coord(dx,dy,dz);
+
+ // Pointe de la fleche
+ Standard_Real xo,yo,zo;
+ aP2.Coord(xo,yo,zo);
+
+ // Centre du cercle base de la fleche
+ gp_XYZ aPc = aP2.XYZ() - aDirection.XYZ() * aLength;
+
+ // Construction d'un repere i,j pour le cercle
+ gp_Dir aDirN;
+ if (Abs(dx) <= Abs(dy) && Abs(dx) <= Abs(dz)) aDirN = gp::DX();
+ else if (Abs(dy) <= Abs(dz) && Abs(dy) <= Abs(dx)) aDirN = gp::DY();
+ else aDirN = gp::DZ();
+
+ gp_Dir aDirI = aDirection ^ aDirN;
+ gp_Dir aDirJ = aDirection ^ aDirI;
+
+ // Add points and segments, composing the arrow
+ Standard_Real cosinus, sinus, Tg = tan(anAngle);
+
+ float coord[3];
+ coord[0] = xo; coord[1] = yo; coord[2] = zo;
+
+ int ptLoc = Pts->InsertNextPoint(coord);
+ int ptFirst = 0;
+ int ptPrev = 0;
+ int ptCur = 0;
+
+ int pts[2];
+
+ int NbPoints = 15;
+ for (int i = 1; i <= NbPoints; i++, ptPrev = ptCur)
+ {
+ cosinus = cos(2. * PI / NbPoints * (i-1));
+ sinus = sin(2. * PI / NbPoints * (i-1));
+
+ gp_XYZ aP = aPc + (aDirI.XYZ() * cosinus + aDirJ.XYZ() * sinus) * aLength * Tg;
+ coord[0] = aP.X();
+ coord[1] = aP.Y();
+ coord[2] = aP.Z();
+
+ // insert pts
+ ptCur = Pts->InsertNextPoint(coord);
+ pts[0] = ptCur;
+
+ if (i == 1) {
+ ptFirst = ptCur;
+ }
+ else {
+ // insert line (ptCur,ptPrev)
+ pts[1] = ptPrev;
+ Cells->InsertNextCell(2,pts);
+ }
+
+ // insert line (ptCur,ptLoc)
+ pts[1] = ptLoc;
+ Cells->InsertNextCell(2,pts);
+ }
+
+ // insert line (ptCur,ptFirst)
+ pts[0] = ptCur;
+ pts[1] = ptFirst;
+ Cells->InsertNextCell(2,pts);
+ }
}
/* Standard_Integer nbnodes = aEdgePoly->NbNodes();
amode = thenewmode;
}
-void GEOM_OCCReader::setTopo(const TopoDS_Shape& aShape) {
+void GEOM_OCCReader::setTopo(const TopoDS_Shape& aShape, bool isVector) {
myShape = aShape;
+ myIsVector = isVector;
}
void GEOM_OCCReader::setForceUpdate(Standard_Boolean bol) {
const TopoDS_Shape& getTopo();
- void setTopo(const TopoDS_Shape& ashape);
+ void setTopo(const TopoDS_Shape& ashape, bool isVector = false);
int getDisplayMode();
void setDisplayMode(int);
int amode;
int nbisos;
TopoDS_Shape myShape;
+ bool myIsVector;
};
Handle_GEOM_InteractiveObject.hxx \
GEOM_AISTrihedron.hxx \
GEOM_VTKTrihedron.hxx \
+ GEOM_AISVector.hxx \
GEOM_OBJECT_defs.hxx
# Libraries targets
GEOM_AISShape.cxx \
GEOM_InteractiveObject.cxx \
GEOM_AISTrihedron.cxx \
- GEOM_VTKTrihedron.cxx
+ GEOM_VTKTrihedron.cxx \
+ GEOM_AISVector.cxx
libGEOMObject_la_CPPFLAGS = \
// Module : GEOM
// $Header$
+#include "OCCViewer_ViewModel.h"
+
#include "RepairGUI_GlueDlg.h"
#include "DlgRef_1Sel_Ext.h"
#include "GEOMImpl_Types.hxx"
#include <qapplication.h>
#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qhbox.h>
+#include <qgrid.h>
using namespace std;
//=================================================================================
RepairGUI_GlueDlg::RepairGUI_GlueDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
const char* name, bool modal, WFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+: GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
+ WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+ myCurrConstrId( -1 )
{
QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_GLUE_FACES")));
+ QPixmap image2 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_GLUE_FACES2")));
QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
setCaption(tr("GEOM_GLUE_TITLE"));
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_GLUE_TITLE"));
RadioButton1->setPixmap(image0);
- RadioButton2->close(TRUE);
+ RadioButton2->setPixmap(image2);
+ //RadioButton2->close(TRUE);
RadioButton3->close(TRUE);
GroupPoints = new DlgRef_1Sel_Ext(this, "GroupPoints");
GroupPoints->TextLabel1->setText(tr("GEOM_SELECTED_SHAPE"));
GroupPoints->PushButton1->setPixmap(image1);
GroupPoints->LineEdit1->setReadOnly( true );
+
+ int aWidth = GroupPoints->TextLabel1->sizeHint().width() +
+ GroupPoints->PushButton1->sizeHint().width() +
+ GroupPoints->getGroupBoxLayout()->spacing();
Layout1->addWidget(GroupPoints, 2, 0);
- QGridLayout* aLay = new QGridLayout( 0, 2, 2, 0, 6, "aLay" );
- QLabel* aLbl1 = new QLabel( tr( "GEOM_TOLERANCE" ), GroupPoints->GroupBox1 );
- myTolEdt = new QtxDblSpinBox( 0, 100, 1e-7, GroupPoints->GroupBox1 );
+ QHBox* aHBox = new QHBox( GroupPoints->GroupBox1 );
+ aHBox->setSpacing( 5 );
+
+ (new QLabel( tr( "GEOM_TOLERANCE" ), aHBox ))->setFixedWidth( aWidth );
+ myTolEdt = new QtxDblSpinBox( 0, 100, 1e-7, aHBox );
+ myTolEdt->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myTolEdt->setPrecision( 10 );
myTolEdt->setValue( DEFAULT_TOLERANCE_VALUE );
+ GroupPoints->getGroupBoxLayout()->addWidget( aHBox, 3, 0 );
+ /***************************************************************/
- aLay->addWidget( aLbl1, 0, 0 );
- aLay->addWidget( myTolEdt, 0, 1 );
-
- GroupPoints->getGroupBoxLayout()->addLayout( aLay, 3, 0 );
+ GroupPoints2 = new DlgRef_1Sel_Ext(this, "GroupPoints2");
+ GroupPoints2->GroupBox1->setTitle(tr("GEOM_GLUE"));
+ GroupPoints2->TextLabel1->setText(tr("GEOM_SELECTED_SHAPE"));
+ GroupPoints2->PushButton1->setPixmap(image1);
+ GroupPoints2->LineEdit1->setReadOnly( true );
+ Layout1->addWidget(GroupPoints2, 2, 0);
+
+ QGrid* aGrid = new QGrid( 2, Qt::Horizontal, GroupPoints2->GroupBox1 );
+ aGrid->setSpacing( 5 );
+ (new QLabel( tr( "GEOM_TOLERANCE" ), aGrid ))->setFixedWidth( aWidth );;
+ myTolEdt2 = new QtxDblSpinBox( 0, 100, 1e-7, aGrid );
+ myTolEdt2->setPrecision( 10 );
+ myTolEdt2->setValue( DEFAULT_TOLERANCE_VALUE );
+ myTolEdt2->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ (new QLabel( tr( "GLUE_FACES" ), aGrid ))->setFixedWidth( aWidth );;
+ myDetectBtn = new QPushButton( tr( "GEOM_DETECT" ), aGrid );
+ myDetectBtn->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ mySubShapesChk = new QCheckBox( tr( "SELECT_FACES" ), aGrid );
+ GroupPoints2->getGroupBoxLayout()->addWidget( aGrid, 3, 0 );
/***************************************************************/
setHelpFileName("glue_faces.htm");
+
+ // Disable second way of gluing if OCC viewer is not active one
+ if (SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType()
+ != OCCViewer_Viewer::Type())
+ RadioButton2->setEnabled(false);
Init();
}
myObject = GEOM::GEOM_Object::_nil();
//myGeomGUI->SetState( 0 );
- globalSelection( GEOM_COMPOUND );
+ //globalSelection( GEOM_COMPOUND );
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect(GroupPoints2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(GroupPoints2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect( myTolEdt2, SIGNAL( valueChanged( double ) ), this, SLOT( onTolerChanged( double ) ) );
+ connect( mySubShapesChk, SIGNAL( stateChanged( int ) ), this, SLOT( onSubShapesChk() ) );
+
+ connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) );
+
+ connect(myDetectBtn, SIGNAL(clicked()), this, SLOT(onDetect()));
initName( tr( "GLUE_NEW_OBJ_NAME" ) );
+
+ ConstructorsClicked(0);
+
+ activateSelection();
+ updateButtonState();
+}
+
+
+//=================================================================================
+// function : ConstructorsClicked()
+// purpose : Radio button management
+//=================================================================================
+void RepairGUI_GlueDlg::ConstructorsClicked( int constructorId )
+{
+ if ( myCurrConstrId == constructorId )
+ return;
+
+ disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
+
+ switch ( constructorId )
+ {
+ case 0:
+ {
+ GroupPoints2->hide();
+ resize( 0, 0 );
+ GroupPoints->show();
+ GroupPoints->LineEdit1->setText( "" );
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+
+ if ( myCurrConstrId >= 0 ) // i.e. it is not initialisation
+ {
+ // copy tolerance from previous tolerance field
+ myTolEdt->setValue( myTolEdt2->value() );
+ }
+
+ break;
+ }
+ case 1:
+ {
+ GroupPoints->hide();
+ resize(0, 0);
+ GroupPoints2->show();
+ GroupPoints->LineEdit1->setText("");
+ myEditCurrentArgument = GroupPoints2->LineEdit1;
+
+ if ( myCurrConstrId >= 0 ) // i.e. it is not initialisation
+ {
+ // copy tolerance from previous tolerance field
+ myTolEdt2->setValue( myTolEdt->value() );
+ mySubShapesChk->setChecked( false );
+ clearTemporary();
+ }
+
+ break;
+ }
+ }
+
+ myCurrConstrId = constructorId;
+
+ myEditCurrentArgument->setFocus();
+
+ connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+ qApp->processEvents();
+ updateGeometry();
+ QSize aSize = minimumSizeHint();
+ resize( width(), aSize.height() );
+
+ displayPreview();
+ updateButtonState();
+ activateSelection();
+ SelectionIntoArgument();
}
initName();
- GroupPoints->LineEdit1->setText("");
- myObject = GEOM::GEOM_Object::_nil();
+ //GroupPoints->LineEdit1->setText("");
+ //myObject = GEOM::GEOM_Object::_nil();
- globalSelection( GEOM_COMPOUND );
+ //globalSelection( GEOM_COMPOUND );
+
+ ConstructorsClicked( getConstructorId() );
return true;
}
//=================================================================================
void RepairGUI_GlueDlg::SelectionIntoArgument()
{
+ if ( mySubShapesChk->isChecked() && getConstructorId() == 1 )
+ return;
+
erasePreview();
myEditCurrentArgument->setText("");
myObject = GEOM::GEOM_Object::_nil();
if ( aRes )
myEditCurrentArgument->setText( GEOMBase::GetName( myObject ) );
}
+ updateButtonState();
}
//=================================================================================
void RepairGUI_GlueDlg::SetEditCurrentArgument()
{
const QObject* send = sender();
- if ( send == GroupPoints->PushButton1 ) {
+ if ( send == GroupPoints->PushButton1 || send == GroupPoints2->PushButton1 ) {
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
myEditCurrentArgument = GroupPoints->LineEdit1;
GEOMBase_Skeleton::LineEditReturnPressed();
}
+ else if( send == GroupPoints2->LineEdit1 ) {
+ myEditCurrentArgument = GroupPoints2->LineEdit1;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
}
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- GroupPoints->LineEdit1->setText("");
- myObject = GEOM::GEOM_Object::_nil();
+ //GroupPoints->LineEdit1->setText("");
+ //GroupPoints2->LineEdit1->setText("");
+ //myObject = GEOM::GEOM_Object::_nil();
//myGeomGUI->SetState( 0 );
- globalSelection( GEOM_COMPOUND );
+ //globalSelection( GEOM_COMPOUND );
+ activateSelection();
}
ActivateThisDialog();
}
-
//=================================================================================
// function : closeEvent()
// purpose :
GEOMBase_Skeleton::closeEvent( e );
}
+
//=================================================================================
// function : createOperation
// purpose :
bool RepairGUI_GlueDlg::execute( ObjectList& objects )
{
bool aResult = false;
- GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow
- ( getOperation() )->MakeGlueFaces( myObject, myTolEdt->value() );
- aResult = !anObj->_is_nil();
- if ( aResult )
- objects.push_back( anObj._retn() );
+ objects.clear();
+
+ switch ( getConstructorId() )
+ {
+ case 0 :
+ {
+ GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow
+ ( getOperation() )->MakeGlueFaces( myObject, myTolEdt2->value() );
+ aResult = !anObj->_is_nil();
+ if ( aResult )
+ objects.push_back( anObj._retn() );
+ break;
+ }
+ case 1 :
+ if ( IsPreview() )
+ {
+ // if this method is used for displaying preview then we must detect glue faces only
+ ObjectList::iterator anIter;
+ for (anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter)
+ objects.push_back( GEOM::GEOM_Object::_duplicate( *anIter ) );
+ return myTmpObjs.size() ? true : false;
+ } // IsPreview
+
+ // Make glue face by list.
+ // Iterate through myTmpObjs and verifies where each object is currently selected or not.
+ QMap<QString, char> selected;
+
+ // Get names of selected objects
+ SALOME_ListIteratorOfListIO it ( selectedIO() );
+ for (; it.More(); it.Next())
+ selected.insert( it.Value()->getName(), 0 );
+
+ // Iterate through result and select objects with names from selection
+ // ObjectList toRemoveFromEnggine;
+ ObjectList toGlue;
+ ObjectList::iterator anIter;
+ for (anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter)
+ {
+ if ( selected.contains( myGeomGUI->getApp()->orb()->object_to_string(*anIter) ) )
+ toGlue.push_back(*anIter);
+ }
+
+ // make glue faces
+ GEOM::ListOfGO_var aListForGlue = new GEOM::ListOfGO();
+ aListForGlue->length( toGlue.size() );
+ ObjectList::iterator anIter3 = toGlue.begin();
+ for ( int i = 0; anIter3 != toGlue.end(); ++anIter3, ++i )
+ aListForGlue[ i ] = *anIter3;
+ GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow
+ ( getOperation() )->MakeGlueFacesByList( myObject, myTolEdt2->value(), aListForGlue );
+
+ aResult = !anObj->_is_nil();
+
+ if ( aResult )
+ objects.push_back( anObj._retn() );
+
+ // Remove from engine useless objects
+ clearTemporary();
+
+ updateButtonState();
+
+ break;
+ } // case
return aResult;
}
+
//================================================================
// Function : clearShapeBufferLocal
// Purpose :
// It perfroms user input validation, then it
// performs a proper operation and manages transactions, etc.
//================================================================
-bool RepairGUI_GlueDlg::onAcceptLocal( const bool publish, const bool useTransaction )
+bool RepairGUI_GlueDlg::onAcceptLocal()
{
if ( !getStudy() || !( getStudy()->studyDS() ) )
return false;
_PTR(Study) aStudy = getStudy()->studyDS();
bool aLocked = aStudy->GetProperties()->IsLocked();
- if ( aLocked ) {
+ if ( aLocked )
+ {
MESSAGE("GEOMBase_Helper::onAccept - ActiveStudy is locked");
SUIT_MessageBox::warn1 ( (QWidget*)(SUIT_Session::session()->activeApplication()->desktop()),
- QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_STUDY_LOCKED"),
- QObject::tr("BUT_OK") );
+ QObject::tr("WRN_WARNING"), QObject::tr("WRN_STUDY_LOCKED"), QObject::tr("BUT_OK") );
return false;
}
QString msg;
- if ( !isValid( msg ) ) {
+ if ( !isValid( msg ) )
+ {
showError( msg );
return false;
}
erasePreview( false );
- try {
- if ( ( !publish && !useTransaction ) || openCommand() ) {
-
+ try
+ {
+ if ( openCommand() )
+ {
SUIT_OverrideCursor wc;
SUIT_Session::session()->activeApplication()->putInfo( "" );
ObjectList objects;
- // JFA 28.12.2004 if ( !execute( objects ) || !getOperation()->IsDone() ) {
- if ( !execute( objects ) ) { // JFA 28.12.2004 // To enable warnings
- wc.suspend();
+
+ if ( !execute( objects ) )
+ {
+ wc.suspend();
abortCommand();
- showError();
+ showError();
}
- else {
- const int nbObjs = objects.size();
- bool withChildren = false;
- for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) {
- if ( publish ) {
- QString aName("");
- if ( nbObjs > 1 )
- aName = strlen( getNewObjectName() ) ? GEOMBase::GetDefaultName( getNewObjectName() ) : GEOMBase::GetDefaultName( getPrefix( *it ) );
- else {
- aName = getNewObjectName();
- // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName()
- if ( aName.isEmpty() )
- aName = GEOMBase::GetDefaultName( getPrefix( *it ) );
- }
- addInStudy( *it, aName.latin1() );
- withChildren = false;
- display( *it, false );
- }
- else { // asv : fix of PAL6454. If publish==false, then the original shape was modified, and need to be re-cached in GEOM_Client
- // before redisplay
- clearShapeBufferLocal( *it );
- withChildren = true;
- redisplay( *it, withChildren, false );
+ else
+ {
+ const int nbObjs = objects.size();
+ bool withChildren = false;
+ for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it )
+ {
+ QString aName("");
+ if ( nbObjs > 1 )
+ {
+ aName = strlen( getNewObjectName() ) ? GEOMBase::GetDefaultName( getNewObjectName() ) : GEOMBase::GetDefaultName( getPrefix( *it ) );
+ }
+ else
+ {
+ aName = getNewObjectName();
+ // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName()
+ if ( aName.isEmpty() )
+ aName = GEOMBase::GetDefaultName( getPrefix( *it ) );
}
- }
-
- if ( nbObjs ) {
- commitCommand();
- updateObjBrowser();
- SUIT_Session::session()->activeApplication()->putInfo( QObject::tr("GEOM_PRP_DONE") );
- }
- else {
- abortCommand();
+ addInStudy( *it, aName.latin1() );
+ withChildren = false;
+ display( *it, false );
+ }
+
+ if ( nbObjs )
+ {
+ commitCommand();
+ updateObjBrowser();
+ SUIT_Session::session()->activeApplication()->putInfo( QObject::tr("GEOM_PRP_DONE") );
+ }
+ else
+ {
+ abortCommand();
}
// JFA 28.12.2004 BEGIN // To enable warnings
- if ( !getOperation()->_is_nil() ) {
- if ( !getOperation()->IsDone() ) {
+ if ( !getOperation()->_is_nil() )
+ {
+ if ( !getOperation()->IsDone() )
+ {
wc.suspend();
- QString msgw = QObject::tr( getOperation()->GetErrorCode() );
+ QString msgw = QObject::tr( getOperation()->GetErrorCode() );
SUIT_MessageBox::warn1((QWidget*)(SUIT_Session::session()->activeApplication()->desktop()),
QObject::tr( "WRN_WARNING" ),
msgw,
}
}
}
- catch( const SALOME::SALOME_Exception& e ) {
+ catch( const SALOME::SALOME_Exception& e )
+ {
SalomeApp_Tools::QtCatchCorbaException( e );
abortCommand();
}
updateViewer();
+ activateSelection();
+ updateButtonState();
return true;
}
+
+
+//=================================================================================
+// function : onDetect
+// purpose :
+//=================================================================================
+void RepairGUI_GlueDlg::onDetect()
+{
+ clearTemporary();
+ QString msg;
+ if ( !isValid( msg ) ) {
+ showError( msg );
+ return;
+ }
+
+ GEOM::ListOfGO_var aList = GEOM::GEOM_IShapesOperations::_narrow
+ ( getOperation() )->GetGlueFaces( myObject, myTolEdt2->value() );
+
+ for (int i = 0, n = aList->length(); i < n; i++)
+ myTmpObjs.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
+
+ if ( myTmpObjs.size() > 0 )
+ {
+ msg = tr( "FACES_FOR_GLUING_ARE_DETECTED" ).arg( myTmpObjs.size() );
+ mySubShapesChk->setChecked( true );
+ }
+ else
+ {
+ msg = tr( "THERE_ARE_NO_FACES_FOR_GLUING" );
+ }
+
+ SUIT_MessageBox::info1( this, tr( "GEOM_FREE_BOUNDS_TLT" ), msg, "Close" );
+ updateButtonState();
+ activateSelection();
+}
+
+//=================================================================================
+// function : activateSelection
+// purpose : Redisplay preview and Activate selection
+//=================================================================================
+void RepairGUI_GlueDlg::activateSelection()
+{
+ erasePreview(false);
+
+ int anId = getConstructorId();
+ if ( anId == 0 ) // Case of whole gluing
+ {
+ disconnect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ;
+
+ globalSelection( GEOM_ALLSHAPES );
+ if (myObject->_is_nil())
+ SelectionIntoArgument();
+
+ connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ;
+ }
+ else // Second case of gluing
+ {
+ if ( !mySubShapesChk->isChecked() )
+ globalSelection( GEOM_ALLSHAPES );
+ else
+ {
+ displayPreview( true, false, false, 2/*line width*/, 1/*display mode*/, Quantity_NOC_RED );
+ globalSelection( GEOM_PREVIEW );
+ }
+ }
+
+ updateViewer();
+}
+
+//=================================================================================
+// function : updateButtonState
+// purpose : Update button state
+//=================================================================================
+void RepairGUI_GlueDlg::updateButtonState()
+{
+ int anId = getConstructorId();
+ bool hasMainObj = !myObject->_is_nil();
+ if ( anId == 0 )
+ {
+ buttonOk->setEnabled( hasMainObj );
+ buttonApply->setEnabled( hasMainObj );
+ }
+ else
+ {
+ bool wasDetected = myTmpObjs.size() ? true : false;
+ buttonOk->setEnabled( hasMainObj && wasDetected );
+ buttonApply->setEnabled( hasMainObj && wasDetected );
+ mySubShapesChk->setEnabled( hasMainObj && wasDetected );
+ myDetectBtn->setEnabled( hasMainObj );
+ if ( !hasMainObj || !wasDetected )
+ mySubShapesChk->setChecked( false );
+ }
+}
+
+//=================================================================================
+// function : clearTemporary
+// purpose : Remove temporary objects from engine
+//=================================================================================
+void RepairGUI_GlueDlg::clearTemporary()
+{
+ ObjectList::iterator anIter;
+ for (anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter)
+ getGeomEngine()->RemoveObject(*anIter);
+
+ myTmpObjs.clear();
+}
+
+//=================================================================================
+// function : onTolerChanged
+// purpose : Remove temporary objects from engine
+//=================================================================================
+void RepairGUI_GlueDlg::onTolerChanged( double /*theVal*/ )
+{
+ clearTemporary();
+ activateSelection();
+ updateButtonState();
+}
+
+//=================================================================================
+// function : onSubShapesChk
+// purpose : Update selection mode
+//=================================================================================
+void RepairGUI_GlueDlg::onSubShapesChk()
+{
+ if ( !mySubShapesChk->isChecked() )
+ clearTemporary();
+ activateSelection();
+ updateButtonState();
+}
+
+//=================================================================================
+// function : ClickOnCancel
+// purpose : Remove temporary objects from engine and call method of base class
+//=================================================================================
+void RepairGUI_GlueDlg::ClickOnCancel()
+{
+ clearTemporary();
+ GEOMBase_Skeleton::ClickOnCancel();
+}
+
+//================================================================
+// Function : getEntry
+// Purpose :
+//================================================================
+static string getEntry( GEOM::GEOM_Object_ptr object )
+{
+ SUIT_Session* session = SUIT_Session::session();
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
+ if ( app )
+ {
+ string IOR = app->orb()->object_to_string( object );
+ if ( IOR != "" )
+ {
+ SalomeApp_Study* study = ( SalomeApp_Study* )app->activeStudy();
+ _PTR(SObject) SO ( study->studyDS()->FindObjectIOR( IOR ) );
+ if ( SO )
+ return SO->GetID();
+ }
+ }
+ return "";
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
class QtxDblSpinBox;
class DlgRef_1Sel_Ext;
+class QCheckBox;
//=================================================================================
// class : RepairGUI_GlueDlg
Q_OBJECT
public:
- RepairGUI_GlueDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
- const char* name = 0, bool modal = FALSE, WFlags fl = 0);
+ RepairGUI_GlueDlg( GeometryGUI* theGeometryGUI, QWidget* parent = 0,
+ const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~RepairGUI_GlueDlg();
protected:
void enterEvent(QEvent* e);
void closeEvent(QCloseEvent* e);
void initSelection();
+
+ void clearTemporary();
- bool onAcceptLocal( const bool publish = true, const bool useTransaction = true );
+ bool onAcceptLocal();
void clearShapeBufferLocal( GEOM::GEOM_Object_ptr );
// Reimplementation of onAccept for local case of this class.
-
+
+ void activateSelection();
+ void updateButtonState();
+ void selectTmpInViewer();
+
+private:
+
GEOM::GEOM_Object_var myObject;
-
+ ObjectList myTmpObjs;
+
DlgRef_1Sel_Ext* GroupPoints;
+ DlgRef_1Sel_Ext* GroupPoints2;
QtxDblSpinBox* myTolEdt;
+ QtxDblSpinBox* myTolEdt2;
+ QPushButton* myDetectBtn;
+ QCheckBox* mySubShapesChk;
+ int myCurrConstrId;
+
+protected slots:
+ virtual void ClickOnCancel();
+
private slots:
void ClickOnOk();
bool ClickOnApply();
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
+
+ void ConstructorsClicked(int);
+ //void ValueChangedInSpinBox();
+
+ void onDetect();
+ void onTolerChanged( double );
+ void onSubShapesChk();
};
#endif // DIALOGBOX_Glue_H