Salome HOME
Merge from V5_1_main 10/06/2010 V6_1_0a1 V6_1_0a2
authorvsr <vsr@opencascade.com>
Thu, 10 Jun 2010 08:25:12 +0000 (08:25 +0000)
committervsr <vsr@opencascade.com>
Thu, 10 Jun 2010 08:25:12 +0000 (08:25 +0000)
51 files changed:
doc/salome/gui/GEOM/images/neo-scetcher1.png
doc/salome/gui/GEOM/images/neo-scetcher2.png
doc/salome/gui/GEOM/images/partition1.png
doc/salome/gui/GEOM/images/partitionsn3.png [new file with mode: 0644]
doc/salome/gui/GEOM/input/add_point_on_edge_operation.doc
doc/salome/gui/GEOM/input/creating_lcs.doc
doc/salome/gui/GEOM/input/creating_pipetshape.doc
doc/salome/gui/GEOM/input/creating_sketcher.doc
doc/salome/gui/GEOM/input/deflection.doc
doc/salome/gui/GEOM/input/geometrical_object_properties.doc
doc/salome/gui/GEOM/input/index.doc
doc/salome/gui/GEOM/input/partition.doc
doc/salome/gui/GEOM/input/restore_presentation_parameters.doc
doc/salome/gui/GEOM/input/viewing_geom_obj.doc
idl/GEOM_Gen.idl
src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx
src/BasicGUI/BasicGUI_CircleDlg.cxx
src/BasicGUI/BasicGUI_CurveDlg.cxx
src/BasicGUI/BasicGUI_EllipseDlg.cxx
src/BasicGUI/BasicGUI_LineDlg.cxx
src/BasicGUI/BasicGUI_PlaneDlg.cxx
src/BasicGUI/BasicGUI_VectorDlg.cxx
src/BuildGUI/BuildGUI_FaceDlg.cxx
src/BuildGUI/BuildGUI_ShellDlg.cxx
src/BuildGUI/BuildGUI_WireDlg.cxx
src/EntityGUI/EntityGUI_SketcherDlg.cxx
src/EntityGUI/EntityGUI_SketcherDlg.h
src/GEOM/GEOM_Engine.cxx
src/GEOMAlgo/GEOMAlgo_Builder.cxx
src/GEOMAlgo/GEOMAlgo_Tools.cdl
src/GEOMAlgo/GEOMAlgo_Tools.hxx
src/GEOMAlgo/GEOMAlgo_Tools_1.cxx [new file with mode: 0644]
src/GEOMAlgo/Makefile.am
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GeometryGUI.cxx
src/GEOMImpl/GEOMImpl_BooleanDriver.cxx
src/GEOM_SWIG/geompyDC.py
src/OperationGUI/OperationGUI_FilletDlg.cxx
src/OperationGUI/OperationGUI_PartitionDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h
src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h
src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_DiskDlg.h
src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h
src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx
src/TransformationGUI/TransformationGUI_OffsetDlg.cxx

index d0d5d7132e396f7b397cdfc33f02e636d83c9ff1..2205805bd2b40532ed1167ad781e527648cdc084 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/neo-scetcher1.png and b/doc/salome/gui/GEOM/images/neo-scetcher1.png differ
index 9097ffc0776e34eb27bcda0f90ff0fe60fe888af..cec5c57b409baaa632d36fcac07a9d9499645c74 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/neo-scetcher2.png and b/doc/salome/gui/GEOM/images/neo-scetcher2.png differ
index 7e068ca0d00723831fa9dd2f7e5bb24531201b13..cc5b1554480ac7a4f7772e5bc4bdba3d2b8a53c8 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/partition1.png and b/doc/salome/gui/GEOM/images/partition1.png differ
diff --git a/doc/salome/gui/GEOM/images/partitionsn3.png b/doc/salome/gui/GEOM/images/partitionsn3.png
new file mode 100644 (file)
index 0000000..474f8b0
Binary files /dev/null and b/doc/salome/gui/GEOM/images/partitionsn3.png differ
index 465928b808f8ccb591301ff601ce478afa15f3a0..4a58ee64a66a01126f96464bef71a824b85ab7af 100644 (file)
@@ -5,23 +5,35 @@
 \n To <b>Add Point on Edge</b> in the <b>Main Menu</b> select
 <b>Repair - > Add Point on Edge</b>.
 
-\n This operation splits an edge in two in accordance with the
+\n This operation splits an edge in two new edges in accordance with the
 specified mode (by length or by parameter) and a value specifying the
 position of the point on edge (for example val =0.5; mode =
-Length). This operation is available in <b>OCC Viewer</b> only.
+by length). This operation is available in <b>OCC Viewer</b> only.
 
 \n The \b Result will be a \b GEOM_Object.
 
 \n <b>TUI Command:</b> <em>geompy.DivideEdge(Shape, EdgeID, Value,
-IsByParameter), </em> where \em Shape is a shape which contains an edge to
-be divided, \em EdgeID is the ID of the edge to be divided, if it = -1,
-then Shape is an edge, \em Value is a paramter on the edge or a
-length. \em IsByParameter if it is True then Value is the edge parameter
-in the range [0:1] otherwise it is a part of the length of the edge in the range
-[0: full length of the edge]
-\n <b>Arguments:</b> Name + 1 Edge + 1 value setting the position of
+IsByParameter)</em>
+- \em Shape is a shape which contains an edge to be divided
+- \em EdgeID is the ID of the edge to be divided, if it is = -1, 
+then \em Shape should be an edge itself
+- \em Value is a value of parameter on edge or length parameter,
+depending on \em IsByParameter.
+- \em IsByParameter is a boolean flag, specifying operation mode:
+  - \c True: \em Value is treated as a curve parameter [0..1]
+  - \c False: \em Value is treated as a length parameter [0..1] 
+
+<b>Arguments:</b> Name + 1 Edge + 1 Value setting the position of
 the point according to one of the selected modes.
 
+The difference between "by parameter" and "by length" modes becomes
+apparent on the edges with irregular parametrization (for example,
+b-splines which usually have irregular density by the length).
+For example, value 0.5 "by length" on such edge will produce the point
+in the middle of this edge (equidistant from both its ends); the same
+0.5 value "by parameter" will result in the point situated closer to
+one of the ends (depending on the actual parametrization).
+
 \image html repair8.png
 
 \n <b>Example:</b>
index 2516af99d3a93fe4e299da8daa8fc9d01fb65e2b..0188c76ba715b243f06843f2ec1a4499c63b5bc1 100644 (file)
@@ -26,8 +26,8 @@ of the LCS are calculated automatically basing on the selected object.
 coordinates of origin by a point and axes directions by a line or a
 vector.
 \n <b>TUI command:</b> <em>geompy.MakeMarkerPntTwoVec(Center, VectorX, 
-VectorY)</em> where Center is a point specified the coordinate system location,
-VectorX is a derection of OX axis and VectorY direction of OY axis.
+VectorY)</em> where Center is the origin of the coordinate system,
+VectorX is the direction of OX axis and VectorY is the direction of OY axis.
 \n <b>Arguments:</b> Name + 1 point of origin + X axis direction, Y axis direction.
 
 \image html neo-localcs3.png
@@ -40,6 +40,6 @@ and in 3D viewer.
 
 \image html image145.png "Local Coordinate System"
 
-<b>TUI Script</b> provide you with useful example of creation of
-\ref tui_creation_lcs "Local Coordinate System".
-*/
\ No newline at end of file
+<b>TUI Script</b> provides you with a useful example of
+\ref tui_creation_lcs "Local Coordinate System" creation.
+*/
index 823bc3eb99ea77351eb71e52b77a3989d5f7676a..d66250295a60811360632af70985dd4d95e60086 100644 (file)
@@ -5,23 +5,23 @@
 To create a \b PipeTShape in the <b>Main Menu</b> select <b>New Entity - >
 Advanced - > PipeTShape </b>
 
-Specify the parameters of the PipeTShape object creation in the opened dialog
+Specify the parameters of the PipeTShape object in the opened dialog
 box and press "Apply" or "Apply & Close" button.
-Result of each operation will be a GEOM_Object.
+The <b>result</b> of the operation will be a <b>GEOM_Object</b>.
 
 <b>TUI Command:</b> <em>geompy.MakePipeTShape(R1, W1, L1, R2, W2, L2, HexMesh=True, P1=None, P2=None, P3=None)</em>
 
 <b>Arguments:</b>
-- \b R1 - Radius of main T-shape pipe.
-- \b W1 - Thickness of main T-shape pipe.
-- \b L1 - Length of main T-shape pipe.
-- \b R2 - Radius of incident T-shape pipe.
-- \b W2 - Thickness of incident T-shape pipe.
-- \b L2 - Length of incident T-shape pipe.
-- \b HexMesh - If True, the shape is splitted in blocks (suitable for hexaedral mesh).
-- \b P1 - First junction point of main pipe (GEOM Vertex).
-- \b P2 - Second junction point of main pipe (GEOM Vertex).
-- \b P3 - Junction point of incident pipe (GEOM Vertex).
+- \b R1 - Radius of the main T-shape pipe.
+- \b W1 - Thickness of the main T-shape pipe.
+- \b L1 - Length of the main T-shape pipe.
+- \b R2 - Radius of the incident T-shape pipe.
+- \b W2 - Thickness of the incident T-shape pipe.
+- \b L2 - Length of the incident T-shape pipe.
+- \b HexMesh - If True, the shape is splitted into blocks (suitable for hexaedral mesh).
+- \b P1 - First junction point of the main pipe (GEOM Vertex).
+- \b P2 - Second junction point of the main pipe (GEOM Vertex).
+- \b P3 - Junction point of the incident pipe (GEOM Vertex).
 
 \image html pipetshape_dlg.png
 
@@ -33,8 +33,8 @@ A Pipe T-Shape can be created with a chamfer at the junction of the main and the
 
 <b>TUI Command:</b> <em>geompy.MakePipeTShapeChamfer(R1, W1, L1, R2, W2, L2, H, W, HexMesh=True, P1=None, P2=None, P3=None)</em>
 
-<b>Arguments are the same as normal Pipe T-Shape plus:</b>
-- \b H - Height of the chamfer along incident pipe.
+<b>The arguments are the same as of the normal Pipe T-Shape plus:</b>
+- \b H - Height of the chamfer along the incident pipe.
 - \b W - Width of the chamfer along the main pipe.
 
 Example:
@@ -45,7 +45,7 @@ A Pipe T-Shape can be created with a fillet at the junction of the main and the
 
 <b>TUI Command:</b> <em>geompy.MakePipeTShapeFillet(R1, W1, L1, R2, W2, L2, RF, HexMesh=True, P1=None, P2=None, P3=None)</em>
 
-<b>Arguments are the same as normal Pipe T-Shape plus:</b>
+<b>The arguments are the same as of the normal Pipe T-Shape plus:</b>
 - \b RF - Radius of the fillet.
 
 Example:
index 2da54f5fa786965312f7e35d3a41c87b0748ff12..c93f5f3ff98eee98becd776196f133ac96bef203 100644 (file)
@@ -54,13 +54,14 @@ is predefined and is equal to 90 degrees);</li>
 
 \b Buttons:
 
-<b>"Sketch Validation"</b> button applies the wire, only red part will be built by "Sketch Validation".
+<b>"Restore"</b> button orientates the viewer correspondingly to the chosen working plane and fits the scene to show all its objects. 
+\n <b>"Sketch Validation"</b> button applies the wire, only red part will be built by "Sketch Validation".
 \n <b>"Sketch Closure"</b> will close the Sketch by straight line from last red part and apply it.
 
 \n <b>Dialog Box:</b>
 
 \image html neo-scetcher1.png
-
+<br>
 \image html neo-scetcher2.png
 
 \n <b>Example:</b>
index b2f419a94c01962998fa5a7059aa1f5789c8501d..1d523f3b4d5ff32564087e212675e1b23f575ce4 100644 (file)
@@ -2,8 +2,8 @@
 
 \page deflection_page Deflection
 
-\n In this menu you can change the deviation coefficient of the
-shape. Smaller coefficient provides better quality of the shape in the
+\n In this menu you can change the deflection coefficient of the
+shape. The less is the coefficient the better is the quality of the shape in the
 viewer.
 
 \n <b>Arguments: </b>1 floating point value (deviation coefficient).
index 78de472cd9bffe33086bbf6e082a0c22ea5ee026..e323c6932db4d4b8e3839aa394520fd73b43baf0 100644 (file)
@@ -8,7 +8,7 @@
 
 The <b>Type</b> property of the geometrical object specifies the 
 way the object has been created. It is an integer identifier that 
-has predefined value depending on the function type used for the 
+has predefined value depending on the function type used for the 
 object creation. The type of the object can be retrieved using the 
 \b %GetType() function of the \b GEOM_Object interface.
 
@@ -70,10 +70,9 @@ The possible values of the geometrical objects are listed in the table below:
 </table>
 
 Also geompy.py module provides a helper function ShapeIdToType() 
-that allows converting of the geometrical object type id value 
-to its string representation.
+that allows converting the geometrical object id value to its string representation.
 
-For example:
+For example, the output of the following code:
 \code
 import geompy
 box = geompy.MakeBoxDXDYDZ(10,10,10)
@@ -81,12 +80,12 @@ type = geompy.ShapeIdToType(box.GetType())
 print type
 \endcode
 
-The above code prints "BOX" value.
+will be the "BOX" value.
 
 <b>GetShapeType function:</b>
 
 The ShapeType property specifies the geometrical object in terms of
-its topology nature.
+its topologic nature.
 
 The possible values are defined in the GEOM namespace: { COMPOUND, COMPSOLID,
 SOLID, SHELL, FACE, WIRE, EDGE, VERTEX, SHAPE }<br>
@@ -94,7 +93,7 @@ SOLID, SHELL, FACE, WIRE, EDGE, VERTEX, SHAPE }<br>
 This type can be retrieved using the \b %GetShapeType() function
 of the \b GEOM_Object interface.
 
-Example code:
+For example:
 \code
 import geompy
 import GEOM
@@ -103,6 +102,6 @@ type = box.GetShapeType()
 print type == GEOM.SOLID
 \endcode
 
-This code prints "True".
+The result is "True".
 
 */
index d1485ef1417849b7efccc9d2c4250220871404dc..d28e8c343b3fe16997bcc8b1ca5acbb5713137b9 100644 (file)
@@ -13,9 +13,11 @@ using a wide range of functions;</li>
 <li>\subpage transform_geom_obj_page "transformation of geometrical objects" using
 various algorithms;</li>
 <li>\subpage repairing_operations_page "optimization of geometrical objects";</li>
-<li>\subpage geometrical_obj_prop_page "Geometrical object properties".</li>
-<li>\subpage using_measurement_tools_page "provision of information about geometrical objects".</li>
-<li>\subpage using_notebook_geom_page.</li>
+<li>viewing \subpage geometrical_obj_prop_page "geometrical object properties".</li>
+<li>and other information about geometrical objects using
+ \subpage using_measurement_tools_page "measurement tools".</li>
+<li>easily setting parameters via the variables predefined in
+ \subpage using_notebook_geom_page "Salome notebook".</li>
 </ul>
 
 Almost all geometry module functionalities are accessible via
index 532f4c375ac6a433ac707b01ae1212e0aee187c2..6661d12f234f6f29348fcdedd2c7487570939854 100644 (file)
@@ -4,45 +4,66 @@
 
 \n To produce a \b Partition in the <b>Main Menu</b> select <b>Operations - > Partition</b>
 
-\n This operation builds a compound by intersection of several shapes with a tool object or a plane.
+\n This operation builds a compound by intersection of several shapes
+with a set of tool objects or with a plane.
 \n The \b Result will be any \b GEOM_Object.
 
 <br><h2>Intersection of two shapes.</h2>
 
+\image html partition1.png
+
+\n <b>Arguments:</b> Name + 2 lists of shapes (the shapes from the
+first list will be intersected with the shapes from the second list) +
+Resulting Type of shape.
+
 \n As far as the intersection of two objects can produce any type of
 geometrical objects, <b>Resulting type</b> box allows choosing the
 preferrable result, i.e. a solid, a shell, a list of faces, etc.
+\n<b>Resulting type</b> has to be equal or lower than the type of the
+\em Objects. In other words, if the \em Objects don't contain any
+shape of this type, Partition fails.
+
+<b>Keep shapes of lower type</b> checkbox manages standalone shapes of
+type other than the \em Limit. If it is checked, lower dimension
+objects will be preserved, else they will be lost.
+\n For example, you do a partition of a box (Solid) and a face (Face)
+without any tool. If you choose Resulting Type "Solid", you will
+obtain a compound of two solids (let's the box will be splitted by the
+face on two parts), but if you will also check <b>Keep shapes of lower
+type</b> checkbox, you will obtain a compound of two solids and one
+face (the face will have a hole where the original face lays inside
+the box, see corresponding \ref partition_picture_3 "picture" below).
+
+\n <b>Advanced option:</b>
+   \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
+
 \n <b>TUI Command:</b> <em>geompy.MakePartition(ListOfShapes,
 ListOfTools, ListOfKeepInside, ListOfRemoveInside, Limit, RemoveWebs,
-ListOfMaterials),</em> where where \em ListOfShapes is a list of shapes to
-be intersected and \em ListOfTools is a list of shapes to intersect the
-shapes from ListOfShapes.
+ListOfMaterials, KeepNonlimitShapes),</em> where where \em
+ListOfShapes is a list of shapes to be intersected, \em ListOfTools is
+a list of shapes to intersect the shapes from ListOfShapes, \em Limit
+is a Type of resulting shapes and \em KeepNonlimitShapes is a flag
+that allows to preserve standalone shapes of low dimension (than
+Limit) in the result.
+
 \n Since the implementation of a new version of PartitionAlgo other
 parameters are ignored by the current functionality and remain there
 only to support the old scripts.
-\n <b>Arguments:</b> Name + 2 lists of shapes (the shapes from the
-first list will be intersected with the shapes from the second list) +
-reconstruction limit.
-\n <b>Advanced option:</b>
-   \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
-
-\image html partition1.png
-
-<b>Keep shapes of lower type</b> checkbox allows building geometrical objects. 
-Only lower type objects will be preserved without the upper ones.
 
 
 <br><h2>Intersection of a Shape and a Plane.</h2>
 
-\n <b>TUI Command:</b> <em> geompy.MakeHalfPartition(Shapes,
-Plane),</em> where \em Shapes are a list of Shapes to be intersected
-and \em Plane is a Tool shape, to intersect the \em Shapes.
+\image html partition2.png
+
 \n <b>Arguments:</b> Name + a list of shapes which will be intersected
 + 1 cutting plane.
+
 \n <b>Advanced option:</b>
    \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
 
-\image html partition2.png
+\n <b>TUI Command:</b> <em> geompy.MakeHalfPartition(Shapes,
+Plane),</em> where \em Shapes are a list of Shapes to be intersected
+and \em Plane is a Tool shape, to intersect the \em Shapes.
 
 \n <b>Example:</b>
 
@@ -50,6 +71,9 @@ and \em Plane is a Tool shape, to intersect the \em Shapes.
 
 \image html partitionsn2.png "Result of intersection"
 
+\anchor partition_picture_3
+\image html partitionsn3.png "Result of intersection of a box and a plane (both as \em Objects, no tools) with Resulting type \em Solid and checked \em Keep \em shapes \em of \em lower \em type"
+
 Our <b>TUI Scripts</b> provide you with useful examples of the use of
 \ref tui_partition "Basic Operations".
 
index 4cb9aa916f9a237f641058ad661d5810bcd45b5a..4fdffcd79a58370c6c969496ed2190dada741649 100644 (file)
@@ -1,8 +1,10 @@
 /*!
 
-\page restore_presentation_parameters_page Restore presentation parameters and a tree of subshapes
+\page restore_presentation_parameters_page Advanced Transformation Options
 
-\n This functionality allows the operation result to inherit colour
+<br><center><b>Set presentation parameters and subshapes from arguments</b></center>
+
+\n This option allows the operation result to inherit colour
 and subshapes from its arguments.
 
 \n To activate this functionality, check in "Set
@@ -38,7 +40,7 @@ operation arguments and their published subshapes. The resulting shape
 has a default colour, but its subshapes inherit colors corresponding
 to arguments and their subshapes.
 
-\image html restore-ss-viewer-after.png "Thev resulting shape"
+\image html restore-ss-viewer-after.png "The resulting shape"
 
 
 Please, note that when the resulting shape corresponds to one
@@ -51,12 +53,13 @@ inherited subshapes depend on the arguments.
 
 \image html restore-ss-OB.png
 
+\n You can also call this functionality from your python scripts.
+See our <b>TUI Scripts</b> for \ref tui_restore_prs_params "example".
+
 <br><center><b>Add prefix to names of restored subshapes</b></center>
-Add prefix "from_" to names of restored sub-shapes, and prefix "from_subshapes_of_" to names of partially restored subshapes. 
+This option allows adding the prefix "from_" to the names of
+restored sub-shapes, and the prefix "from_subshapes_of_" to the names of partially restored subshapes. 
 By default this option is On.
 
 
-\n You can also call this functionality from your python scripts.
-See our <b>TUI Scripts</b> for \ref tui_restore_prs_params "example".
-
 */
index b6e5b97baed472222eaa8d777d4380dbc3b62979..39a4f9035892e3308ebb1c994a2e7487c4d4fae5 100644 (file)
@@ -28,7 +28,7 @@ transparency of geometrical objects.</li>
 <li>\subpage isolines_page "Isos" - allows to change the number of
 isolines displayed within a shape.</li>
 <li>\subpage deflection_page "Deflection" - allows to change the
-deviation coefficient of a shape.</li>
+deflection coefficient of a shape.</li>
 <li>\subpage point_marker_page "Point Marker" - allows to change the
 representation of geometrical vertices.</li>
 <li><b>Auto color</b> / <b>Disable auto color</b> - activates the auto color
index baf88a7805c3ac1099c63a427695b6411304ab3d..61aa8caeb716d5fd625373a43487a9d8195728fb 100644 (file)
@@ -2180,10 +2180,10 @@ module GEOM
      *  \note  Each compound from ListShapes and ListTools will be exploded in order
      *         to avoid possible intersection between shapes from this compound.
      *  \param theLimit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
-     #  \param KeepNonlimitShapes: if this parameter == 0 - only shapes with
-     #                             type <= Limit are kept in the result,
-     #                             else - shapes with type > Limit are kept
-     #                             also (if they exist)
+     *  \param KeepNonlimitShapes: if this parameter == 0, then only shapes of
+     *                             target type (equal to Limit) are kept in the result,
+     *                             else standalone shapes of lower dimension
+     *                             are kept also (if they exist).
      *
      *  After implementation new version of PartitionAlgo (October 2006)
      *  other parameters are ignored by current functionality. They are kept
index 2c476cc74697cc3ab1c3d8fcd28d344c58d70271..b43126f0826c431447c7790f76e9f1ce59fd2160 100644 (file)
@@ -207,7 +207,7 @@ void AdvancedGUI_PipeTShapeDlg::Init() {
        ChamferGroupParams->SpinBox_DX->setValue(20);
        ChamferGroupParams->SpinBox_DY->setValue(10);
        FilletGroupParams->SpinBox_DX->setValue(20);
-    
+
     CssNormal = QString("QDoubleSpinBox {");
     CssNormal.append(MainTubeGroupParams->SpinBox_DZ->styleSheet());
     CssNormal.append("}");
@@ -216,7 +216,7 @@ void AdvancedGUI_PipeTShapeDlg::Init() {
     CssNormal.append("}");
     CssAcceptable = "QDoubleSpinBox, QPushButton {background-color: rgb(85, 170, 127)}";
     CssRefused = "QDoubleSpinBox, QPushButton {background-color: rgb(255, 0, 0)}";
-    
+
        // Signal/slot connections
        connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
        connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
@@ -258,7 +258,7 @@ void AdvancedGUI_PipeTShapeDlg::Init() {
 //=================================================================================
 void AdvancedGUI_PipeTShapeDlg::ApplyNewDimensions() {
     QPushButton* send = (QPushButton*) sender();
-    
+
     bool ok = false;
     double newVal;
     if (send == JunctionPointsSel->PushButton4) {
@@ -379,7 +379,7 @@ void AdvancedGUI_PipeTShapeDlg::SetPosition(bool isChecked) {
 //=================================================================================
 void AdvancedGUI_PipeTShapeDlg::ValueChangedInSpinBox(double newValue)
 {
-    if (myOkPoint1 && myOkPoint2 && myOkPoint3)
+    if (JunctionPointsSel->GroupBox1->isChecked() && myOkPoint1 && myOkPoint2 && myOkPoint3)
         CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
     DisplayPreview();
 }
@@ -530,7 +530,7 @@ void AdvancedGUI_PipeTShapeDlg::SetEditCurrentArgument() {
                JunctionPointsSel->LineEdit1->setEnabled(false);
                JunctionPointsSel->PushButton2->setDown(false);
                JunctionPointsSel->LineEdit2->setEnabled(false);
-       } 
+       }
 
        // enable line edit
        myEditCurrentArgument->setEnabled(true);
@@ -541,7 +541,7 @@ void AdvancedGUI_PipeTShapeDlg::SetEditCurrentArgument() {
 
     JunctionPointsSel->LineEdit4->setText("");
     JunctionPointsSel->LineEdit5->setText("");
-    
+
        disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
 //     globalSelection(GEOM_POINT);
     globalSelection(); // close local contexts, if any
@@ -764,10 +764,10 @@ bool AdvancedGUI_PipeTShapeDlg::CheckCompatiblePosition(GEOM::GEOM_Object_var th
 
     CORBA::Double theL1 = MainTubeGroupParams->SpinBox_DZ->value();
     CORBA::Double theL2 = IncidentTubeGroupParams->SpinBox_DZ->value();
-    
+
     JunctionPointsSel->LineEdit4->setText("");
     JunctionPointsSel->LineEdit5->setText("");
-    
+
     MainTubeGroupParams->SpinBox_DZ->setToolTip("");
     IncidentTubeGroupParams->SpinBox_DZ->setToolTip("");
 
@@ -791,7 +791,7 @@ bool AdvancedGUI_PipeTShapeDlg::CheckCompatiblePosition(GEOM::GEOM_Object_var th
     double d12 = P1.Distance(P2);
     double d13 = P1.Distance(P3);
     double d23 = P2.Distance(P3);
-    
+
     if (Abs(d12) <= Precision::Confusion()) {
 //         SetErrorCode("Junctions points P1 and P2 are identical");
         return false;
@@ -857,7 +857,7 @@ bool AdvancedGUI_PipeTShapeDlg::CheckCompatiblePosition(GEOM::GEOM_Object_var th
 }
 
 bool AdvancedGUI_PipeTShapeDlg::execute(ObjectList& objects) {
-    
+
     if (JunctionPointsSel->GroupBox1->isChecked() && myOkPoint1 && myOkPoint2 && myOkPoint3)
         CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
 
index 256d235b1cdc179802141d01cdb2b1e64e069b58..119176c59b3c980e79a7e4d1a9ba15ccccc79f40 100644 (file)
@@ -271,6 +271,7 @@ void BasicGUI_CircleDlg::ConstructorsClicked( int constructorId )
   qApp->processEvents();
   updateGeometry();
   resize( minimumSizeHint() );
+  SelectionIntoArgument();
 
   myEditCurrentArgument->setFocus();
   globalSelection(); // close local contexts, if any
index 6804419db8494c862abc2ef58936bd99f579dcd4..b1c6f000f0fa6f5a736fa880321867117525df96 100644 (file)
@@ -158,6 +158,10 @@ void BasicGUI_CurveDlg::ConstructorsClicked( int id )
   myPoints->length( 0 );
 
   myEditCurrentArgument->setText( "" );
+  qApp->processEvents();
+  updateGeometry();
+  resize( minimumSizeHint() );
+  SelectionIntoArgument();
 }
 
 
index 2bccca6e271e5b1d272a08d486c0ef31d0ec0674..4354cf072987877bc1ec82e5a2d507dd0a9b6263 100644 (file)
@@ -158,7 +158,8 @@ void BasicGUI_EllipseDlg::Init()
 
   initName( tr( "GEOM_ELLIPSE" ) );
 
-  resize(100,100);
+  resize( minimumSizeHint() );
+  SelectionIntoArgument();
   displayPreview();
 }
 
index 7389718496ee76c9b775aa8d6ba5beca86bc54e8..9a45c86d434ee01c631b66864a6a6490f2922942 100644 (file)
@@ -228,7 +228,6 @@ void BasicGUI_LineDlg::ConstructorsClicked( int constructorId )
   qApp->processEvents();
   updateGeometry();
   resize( minimumSizeHint() );
-
   SelectionIntoArgument();
 }
 
index 7cf7ecb45e17301d1024325e371fb4d0c17a6c9c..e6b6f6610a5e4ca9551a40ef2132b2f67ddbb8ef 100644 (file)
@@ -364,6 +364,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked( int constructorId )
   qApp->processEvents();
   updateGeometry();
   resize( minimumSizeHint() );
+  SelectionIntoArgument();
 
   myEditCurrentArgument->setFocus();
   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
index 3ec36f1a23fd1065787cf774aedbcbfa915765e4..97e19c98d38185d3605669fb57a2c50d4293c205 100644 (file)
@@ -231,6 +231,7 @@ void BasicGUI_VectorDlg::ConstructorsClicked( int constructorId )
   qApp->processEvents();
   updateGeometry();
   resize( minimumSizeHint() );
+  SelectionIntoArgument();
 
   displayPreview();
 }
index 6f633d66f0e119b062c23dfcf285a41bf2186bf5..8f204e41126ca38c3bb2d905efde026b6fd5acb9 100644 (file)
@@ -116,6 +116,7 @@ void BuildGUI_FaceDlg::Init()
            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
 
   initName( tr( "GEOM_FACE" ) );
+  SelectionIntoArgument();
 }
 
 
index 6c1b33bf90237e93968ea62c2bd492991f4f3cbb..3cf46a4717578266d25dadbdeeed595f933d240d 100644 (file)
@@ -111,7 +111,6 @@ void BuildGUI_ShellDlg::Init()
   QList<int> aSubShapes;
   aSubShapes.append( GEOM_FACE );
   globalSelection( aMap, aSubShapes );
-  
 
   /* signals and slots connections */
   connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
@@ -123,6 +122,7 @@ void BuildGUI_ShellDlg::Init()
            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
 
   initName( tr( "GEOM_SHELL" ) );
+  SelectionIntoArgument();
 }
 
 
index 1b930742e8073f3fdf9f0aeed4d63f3985e192c3..5ecf3efb234f4d9ba66071e1920a5f9ee04e1567 100644 (file)
@@ -123,6 +123,7 @@ void BuildGUI_WireDlg::Init()
            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
   
   initName( tr( "GEOM_WIRE" ) );
+  SelectionIntoArgument();
 }
 
 
index d1a4ff9e8ef76aa952068266c5347d210737500f..8538d514faee0f37e1acf84c371cf0a3b1d85b4d 100644 (file)
@@ -57,6 +57,8 @@
 
 #include <gp_Pln.hxx>
 
+#include <Basics_Utils.hxx>
+
 //=================================================================================
 // class    : EntityGUI_SketcherDlg()
 // purpose  : Constructs a EntityGUI_SketcherDlg which is a child of 'parent', with the
@@ -105,12 +107,17 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg( GeometryGUI* GUI, QWidget* parent,
   /***************************************************************/
 
   GroupBox1 = new QGroupBox(tr("GEOM_CS"), this);
-  QGridLayout* OwnLayout = new QGridLayout(GroupBox1);
-  OwnLayout->setSpacing(6);
-  OwnLayout->setMargin(11);
+  QHBoxLayout* planeLayout = new QHBoxLayout(GroupBox1);
+  planeLayout->setSpacing(6);
+  planeLayout->setMargin(11);
 
   ComboBox1 = new QComboBox(GroupBox1);
-  OwnLayout->addWidget(ComboBox1);
+  ComboBox1->setSizePolicy( QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed) );
+  planeLayout->addWidget(ComboBox1);
+
+  planeButton = new QPushButton (GroupBox1);
+  planeButton->setText( tr( "GEOM_SKETCHER_RESTORE" ) );
+  planeLayout->addWidget(planeButton);
 
   topLayout->addWidget(GroupBox1);
   topLayout->addWidget( MainWidget );
@@ -233,6 +240,7 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg( GeometryGUI* GUI, QWidget* parent,
   connect( Group4Spin->SpinBox_DS, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
 
   connect( ComboBox1, SIGNAL( activated( int ) ), this, SLOT( SelectionIntoArgument() ) );
+  connect( planeButton, SIGNAL( clicked() ), this, SLOT( ActivateLocalCS() ) );
 
   connect( myGeometryGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this, SLOT( SetDoubleSpinBoxStep( double ) ) );
 
@@ -352,7 +360,7 @@ void EntityGUI_SketcherDlg::Init()
   FindLocalCS();
   resize(100,100);
 
-
+  ActivateLocalCS();
   GEOMBase_Helper::displayPreview( false, true, true, myLineWidth );
 }
 
@@ -896,6 +904,12 @@ void EntityGUI_SketcherDlg::SelectionIntoArgument()
   double tmpY = myY;
   myX = myLastX1;
   myY = myLastY1;
+  //  printf ("\nmyX = %f         myY = %f", myX, myY);
+  //  printf ("\nmyLastX1 = %f    myLastY1 = %f", myLastX1, myLastY1);
+  //  printf ("\nmyLastX2 = %f    myLastY2 = %f", myLastX2, myLastY2);
+
+  if ( sender() == ComboBox1 )
+      ActivateLocalCS();
 
   LightApp_SelectionMgr* aSelMgr = myGeometryGUI->getApp()->selectionMgr();
   SALOME_ListIO aSelList;
@@ -1406,6 +1420,9 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects )
     //Test if the current point is the same as the last one
     TopoDS_Shape myShape1, myShape2;
 
+    // Set "C" numeric locale
+    Kernel_Utils::Localizer loc;
+
     //Last Shape
     QString Command1 = myCommand.join( "" );
     Sketcher_Profile aProfile1( Command1.toAscii() );
@@ -1648,15 +1665,15 @@ void EntityGUI_SketcherDlg::initSpinBox( SalomeApp_DoubleSpinBox* spinBox,
   int aPrecision = resMgr->integerValue( "Geometry", quantity, 6 );
   
   spinBox->setPrecision( aPrecision );
-  spinBox->setDecimals( aPrecision ); // it's necessary to set decimals before the range setting,
-                                    // by default Qt rounds boundaries to 2 decimals at setRange
+  spinBox->setDecimals( qAbs( aPrecision ) ); // it's necessary to set decimals before the range setting,
+                                              // by default Qt rounds boundaries to 2 decimals at setRange
   spinBox->setRange( min, max );
   spinBox->setSingleStep( step );
   
   // Add a hint for the user saying how to tune precision
-  QString userPropName = QObject::tr( QString( "PREF_%1" ).arg( quantity ).toLatin1().constData() );
+  QString userPropName = QObject::tr( QString( "GEOM_PREF_%1" ).arg( quantity ).toLatin1().constData() );
   spinBox->setProperty( "validity_tune_hint", 
-                        QVariant( QObject::tr( "PRECISION_HINT" ).arg( userPropName ) ) );  
+                        QVariant( QObject::tr( "GEOM_PRECISION_HINT" ).arg( userPropName ) ) );
 }
 
 //=================================================================================
@@ -1747,7 +1764,7 @@ void EntityGUI_SketcherDlg::FindLocalCS()
 
 //=================================================================================
 // function : GetActiveLocalCS()
-// purpose  : Find All Coordinates systems in study
+// purpose  : Get Working plane
 //=================================================================================
 gp_Ax3 EntityGUI_SketcherDlg::GetActiveLocalCS()
 {
@@ -1757,7 +1774,15 @@ gp_Ax3 EntityGUI_SketcherDlg::GetActiveLocalCS()
 
   gp_Ax3 aLCS = myLCSList.at(ind);
 
-  myGeometryGUI->SetWorkingPlane( aLCS );
-  myGeometryGUI->ActiveWorkingPlane();
   return aLCS;
 }
+
+//=================================================================================
+// function : ActivateLocalCS()
+// purpose  : Activate & Fit Working plane
+//=================================================================================
+void EntityGUI_SketcherDlg::ActivateLocalCS()
+{
+    myGeometryGUI->SetWorkingPlane( GetActiveLocalCS() );
+    myGeometryGUI->ActiveWorkingPlane();
+}
index 8e3eaceb02287439606f513f00618ad0fb8cb672..0c0f631ac1f0ea9879310c9e06fa1d55ce845211 100644 (file)
@@ -145,6 +145,7 @@ private:
 
   QGroupBox*                         GroupBox1;
   QComboBox*                         ComboBox1;
+  QPushButton*                       planeButton;
 
   GeometryGUI*                       myGeometryGUI;
 
@@ -184,6 +185,7 @@ private slots:
   void                               SetDoubleSpinBoxStep( double );
   void                               FindLocalCS();
   gp_Ax3                             GetActiveLocalCS();
+  void                               ActivateLocalCS();
 };
 
 #endif // ENTITYGUI_SKETCHERDLG_H
index 11679422afd43455166e613444990d8da862139a..60a5e7da762479f8a900ad8b330867ae1f73b059 100644 (file)
@@ -35,6 +35,8 @@
 
 #include "utilities.h"
 
+#include <Basics_Utils.hxx>
+
 #include <TDF_Tool.hxx>
 #include <TDF_Data.hxx>
 #include <TDF_Reference.hxx>
@@ -528,6 +530,9 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
                                                 bool isPublished,
                                                 bool& aValidScript)
 {
+  // Set "C" numeric locale to save numbers correctly
+  Kernel_Utils::Localizer loc;
+
   TCollection_AsciiString aScript;
   Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
 
index 4c98d3600733f2e68d4917c7a5654543d7669b18..feee863dbf9fbc93b13c7d92c54efb292532acf7 100755 (executable)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -19,7 +19,6 @@
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 // File:        GEOMAlgo_Builder.cxx
 // Created:     
 // Author:      Peter KURNEV 
@@ -42,6 +41,7 @@
 
 #include <BRepLib.hxx>
 #include <NMTTools_PaveFiller.hxx>
+#include <GEOMAlgo_Tools.hxx>
 
 //=======================================================================
 //function : 
     AddShape1(aS);
   }
 }
-//=======================================================================
-//function : PostTreat
-//purpose  : 
-//=======================================================================
-  void GEOMAlgo_Builder::PostTreat()
-{
-  Standard_Integer aNbS;
-  TopoDS_Iterator aIt;
-  TopTools_ListOfShape aLS;
-  //
-  aIt.Initialize(myShape);
-  for (; aIt.More(); aIt.Next()) {
-    const TopoDS_Shape& aS=aIt.Value();
-    aLS.Append(aS);
-  }
-  aNbS=aLS.Extent();
-  if (aNbS==1) {
-    myShape=aLS.First();
-  }
-  
-  BRepLib::SameParameter(myShape, 1.e-7, Standard_True);
-}
+
 //=======================================================================
 //function : AddShape1
 //purpose  : 
   PostTreat();
 }
 //
+static 
+  void CorrectWires(const TopoDS_Shape& aS);
+//
+//=======================================================================
+//function : PostTreat
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_Builder::PostTreat()
+{
+  Standard_Integer aNbS;
+  TopoDS_Iterator aIt;
+  TopTools_ListOfShape aLS;
+  //
+  aIt.Initialize(myShape);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aS=aIt.Value();
+    aLS.Append(aS);
+  }
+  aNbS=aLS.Extent();
+  if (aNbS==1) {
+    myShape=aLS.First();
+  }
+  
+  BRepLib::SameParameter(myShape, 1.e-7, Standard_True);
+  //
+  GEOMAlgo_Tools::CorrectWires(myShape);
+}
+//
 // myErrorStatus
 // 
 // 0  - Ok
 // 2  - PaveFiller is failed
 // 10 - No shapes to process
 // 30 - SolidBuilder failed
+
index c1bf40a58a97d7fa7bb045449d6eec6d2308e47d..92beb2e4869df886c10effa94a76a83076b86794 100644 (file)
@@ -1,4 +1,4 @@
---  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+--  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 --
 --  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 --  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -19,7 +19,6 @@
 --
 --  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 --
-
 -- File:       GEOMAlgo_Tools.cdl
 -- Created:    Mon Dec  6 11:26:02 2004
 -- Author:     Peter KURNEV
@@ -108,6 +107,9 @@ is
            aS:Surface from Geom) 
        returns Boolean from Standard;   
 
+    CorrectWires(myclass; 
+           aS  :Shape from TopoDS) 
+       returns Boolean from Standard; 
 --fields
 
 end Tools;
index f4682ea8290916d35c3151de38568ab785d6dd41..50de1a5de9741a475b7b2d340eb123434cb353ab 100644 (file)
@@ -1,24 +1,23 @@
-//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+// File generated by CPPExt (Value)
 //
-//  Copyright (C) 2003-2007  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
+//                     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_Tools_HeaderFile
 #define _GEOMAlgo_Tools_HeaderFile
@@ -110,6 +109,9 @@ Standard_EXPORT static  void RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE,con
 Standard_EXPORT static  Standard_Boolean IsUPeriodic(const Handle(Geom_Surface)& aS) ;
 
 
+Standard_EXPORT static  Standard_Boolean CorrectWires(const TopoDS_Shape& aS) ;
+
+
 
 
 
diff --git a/src/GEOMAlgo/GEOMAlgo_Tools_1.cxx b/src/GEOMAlgo/GEOMAlgo_Tools_1.cxx
new file mode 100644 (file)
index 0000000..992c8af
--- /dev/null
@@ -0,0 +1,323 @@
+// File:       GEOMAlgo_Tools_1.cxx
+// Created:    Thu May  6 10:46:21 2010
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <GEOMAlgo_Tools.ixx>
+//
+#include <NCollection_DataMap.hxx>
+
+#include <gp_Pnt2d.hxx>
+#include <gp_Pnt.hxx>
+
+#include <Geom2dAdaptor_Curve.hxx>
+#include <Geom2dInt_GInter.hxx>
+#include <Geom2d_Curve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Surface.hxx>
+#include <GeomAdaptor_Surface.hxx>
+
+#include <IntRes2d_Domain.hxx>
+#include <IntRes2d_IntersectionPoint.hxx>
+#include <IntRes2d_Transition.hxx>
+
+#include <TopoDS_Iterator.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Wire.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopExp_Explorer.hxx>
+
+#include <BRep_Tool.hxx>
+#include <BRep_Builder.hxx>
+
+#include <TopTools_MapOfShape.hxx>
+#include <TopTools_ShapeMapHasher.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_DataMapOfShapeListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
+
+static 
+  inline Standard_Boolean IsEqual(const TopoDS_Shape& aS1, 
+                                 const TopoDS_Shape& aS2) {
+  return TopTools_ShapeMapHasher::IsEqual(aS1, aS2);
+}
+//
+static
+  Standard_Boolean CorrectWire(const TopoDS_Wire& aW,
+                              const TopoDS_Face& aF);
+
+//=======================================================================
+//function : CorrectWires
+//purpose  : 
+//=======================================================================
+  Standard_Boolean GEOMAlgo_Tools::CorrectWires(const TopoDS_Shape& aShape)
+{
+  Standard_Boolean bRet;
+  TopoDS_Iterator aItF;
+  TopExp_Explorer aExp;
+  TopTools_MapOfShape aMF;
+  GeomAdaptor_Surface aGAS;
+  GeomAbs_SurfaceType aTS;
+  TopLoc_Location aLoc; 
+  //
+  bRet=Standard_False;
+  //
+  aExp.Init(aShape, TopAbs_FACE);
+  for (; aExp.More(); aExp.Next()) {
+    const TopoDS_Face& aF=*((TopoDS_Face*)&aExp.Current());
+    if (aMF.Add(aF)) {
+      const Handle(Geom_Surface)& aS=BRep_Tool::Surface(aF, aLoc);
+      aGAS.Load(aS);
+      aTS=aGAS.GetType();
+      if (aTS==GeomAbs_Cylinder) {
+       aItF.Initialize(aF);
+       for (; aItF.More(); aItF.Next()) {
+         const TopoDS_Wire& aW=*((TopoDS_Wire*)&aItF.Value());
+         if (CorrectWire(aW, aF)) {
+          bRet=Standard_True;
+         }
+       }
+      }
+    }
+  }
+  return bRet;
+}
+//=======================================================================
+//class: GEOMAlgo_InfoEdge
+//purpose  : 
+//=======================================================================
+class GEOMAlgo_InfoEdge {
+ public:
+  //
+  GEOMAlgo_InfoEdge() {
+    myErrorStatus=0;
+    myTolInt=1.0e-10;
+  };
+  //
+  ~GEOMAlgo_InfoEdge(){
+  };
+  //
+  void Init(const TopoDS_Edge& aE, 
+           const TopoDS_Face& aF);
+  //
+  void SetTolInt(const Standard_Real aTolInt) {
+    myTolInt=aTolInt;
+  };
+  //
+  const Standard_Real TolInt() const {
+    return myTolInt;
+  }
+  //
+  const Geom2dAdaptor_Curve& Adaptor() const {
+    return myGAC2D;
+  }
+  //
+  const IntRes2d_Domain& Domain()const {
+    return myDomain;
+  }
+  //
+  const Handle(Geom2d_Curve)& CurveOnSurface()const {
+    return myC2D;
+  }
+  //
+  const Handle(Geom_Curve)& Curve()const {
+    return myC3D;
+  }
+  //
+  Standard_Integer ErrorStatus()const {
+    return myErrorStatus;
+  }
+  //
+ protected:
+  Standard_Integer myErrorStatus;
+  Standard_Real myTolInt;
+  Geom2dAdaptor_Curve myGAC2D;
+  IntRes2d_Domain myDomain;
+  Handle(Geom2d_Curve) myC2D;
+  Handle(Geom_Curve) myC3D;
+};
+//
+typedef NCollection_DataMap<TopoDS_Shape, GEOMAlgo_InfoEdge> GEOMAlgo_DataMapOfShapeInfoEdge; 
+typedef GEOMAlgo_DataMapOfShapeInfoEdge::Iterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeInfoEdge; 
+
+//=======================================================================
+//function : Init
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_InfoEdge::Init(const TopoDS_Edge& aE, 
+                              const TopoDS_Face& aF)
+{
+  Standard_Real aT1, aT2, aT1x, aT2x;
+  gp_Pnt2d aP2D1, aP2D2;
+  //
+  myErrorStatus=0;
+  //
+  myC3D=BRep_Tool::Curve(aE, aT1, aT2);
+  myC2D=BRep_Tool::CurveOnSurface(aE ,aF, aT1, aT2);
+  if (!myC2D.IsNull() && aT2>aT1) {
+    myGAC2D.Load(myC2D);
+    if(!myGAC2D.IsPeriodic()) {
+      aT1x=myGAC2D.FirstParameter();
+      aT2x=myGAC2D.LastParameter();
+      if(aT1x > aT1) {
+       aT1=aT1x;
+      }
+      if(aT2x < aT2) {
+       aT2=aT2x;
+      }
+    }
+    //
+    BRep_Tool::UVPoints(aE, aF, aP2D1, aP2D2);
+    myDomain.SetValues(aP2D1, aT1, myTolInt, aP2D2, aT2, myTolInt);
+  }
+  else {
+    myErrorStatus=10;
+    return;
+  }
+}
+//=======================================================================
+//function : CorrectWire
+//purpose  : 
+//=======================================================================
+Standard_Boolean CorrectWire(const TopoDS_Wire& aW,
+                            const TopoDS_Face& aF)
+{
+  Standard_Boolean bRet;
+  Standard_Real aTolInt;
+  Standard_Integer iErr, aNbV, aNbE;
+  TopoDS_Iterator aItW, aItE;
+  Geom2dInt_GInter aInter;
+  GEOMAlgo_DataMapOfShapeInfoEdge aDMEIE;
+  TopTools_DataMapOfShapeListOfShape aDMVLE;
+  TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMVLE;
+  //
+  bRet=Standard_False;
+  aTolInt=1.0e-10;
+  //
+  aItW.Initialize(aW);
+  for (; aItW.More(); aItW.Next()) {
+    const TopoDS_Edge& aE=*((TopoDS_Edge*)&aItW.Value());
+    
+    aItE.Initialize(aE);
+    for (aNbV=0; aItE.More(); aItE.Next(), ++aNbV) {
+    }
+    if (aNbV<2) {
+      return bRet; //
+    }
+    //
+    if (!aDMEIE.IsBound(aE)) {
+      GEOMAlgo_InfoEdge aInfoEdge;
+      //
+      aInfoEdge.Init (aE, aF);
+      iErr=aInfoEdge.ErrorStatus();
+      if (iErr) {
+       return bRet; //
+      }
+      //
+      aDMEIE.Bind(aE, aInfoEdge);
+    }
+    //
+    aItE.Initialize(aE);
+    for (; aItE.More(); aItE.Next()) {
+      const TopoDS_Shape& aV=aItE.Value();
+      if (aDMVLE.IsBound(aV)) {
+       TopTools_ListOfShape& aLE=aDMVLE.ChangeFind(aV);
+       aLE.Append(aE);
+      }
+      else {
+       TopTools_ListOfShape aLE;
+       aLE.Append(aE);
+       aDMVLE.Bind(aV, aLE);
+      }
+    }
+  }
+  //
+  // 2
+  Standard_Real aTolV, aD1, aD2, aDmax, aCoeff;
+  gp_Pnt aPV;
+  Handle(Geom_Surface) aS;
+  BRep_Builder aBB;
+  //
+  aCoeff=1.1;
+  aS=BRep_Tool::Surface(aF);
+  //
+  aItDMVLE.Initialize(aDMVLE);
+  for(; aItDMVLE.More(); aItDMVLE.Next()) {
+    const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&aItDMVLE.Key());
+    const TopTools_ListOfShape& aLE=aItDMVLE.Value();
+    aNbE=aLE.Extent();
+    if (aNbE!=2) {
+      continue;
+    }
+    //
+    aPV=BRep_Tool::Pnt(aV);
+    aTolV=BRep_Tool::Tolerance(aV);
+    //
+    const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aLE.First());
+    const GEOMAlgo_InfoEdge& aIE1=aDMEIE.Find(aE1); 
+    const Geom2dAdaptor_Curve& aGAC1=aIE1.Adaptor();
+    const IntRes2d_Domain& aDomain1=aIE1.Domain();
+    //
+    const TopoDS_Edge& aE2=*((TopoDS_Edge*)&aLE.Last()); 
+    const GEOMAlgo_InfoEdge& aIE2=aDMEIE.Find(aE2);
+    const Geom2dAdaptor_Curve& aGAC2=aIE2.Adaptor();
+    const IntRes2d_Domain& aDomain2=aIE2.Domain();
+    //
+    aInter.Perform(aGAC1, aDomain1,aGAC2, aDomain2, aTolInt, aTolInt);
+    if(!aInter.IsDone()) { 
+      continue;
+    }
+    //
+    Standard_Integer i, aNbP;
+    Standard_Real aIP_ParamOnFirst, aIP_ParamOnSecond;
+    gp_Pnt aP3D1, aP3D2;
+    gp_Pnt2d aP2D1, aP2D2;
+    IntRes2d_Transition aTr1, aTr2;
+    //
+    aNbP=aInter.NbPoints();
+    for (i=1; i<=aNbP; ++i) {
+      const IntRes2d_IntersectionPoint& aIP = aInter.Point(i);
+      aIP_ParamOnFirst  = aIP.ParamOnFirst();
+      aIP_ParamOnSecond = aIP.ParamOnSecond();
+      aTr1 =aIP.TransitionOfFirst();
+      aTr2 =aIP.TransitionOfSecond();
+      if(aTr1.PositionOnCurve()==IntRes2d_Middle ||
+        aTr2.PositionOnCurve()==IntRes2d_Middle) {
+       //
+       const Handle(Geom_Curve)& aC3D1=aIE1.Curve();
+       if (!aC3D1.IsNull()) {
+         aP3D1=aC3D1->Value(aIP_ParamOnFirst);
+       }
+       else {
+         aP2D1=aGAC1.Value(aIP_ParamOnFirst);
+         aS->D0(aP2D1.X(), aP2D1.Y(), aP3D1);
+       }
+       //
+       const Handle(Geom_Curve)& aC3D2=aIE2.Curve();   
+       if (!aC3D2.IsNull()) {
+         aP3D2=aC3D2->Value(aIP_ParamOnSecond);
+       }
+       else {
+         aP2D2=aGAC2.Value(aIP_ParamOnSecond);
+         aS->D0(aP2D2.X(), aP2D2.Y(), aP3D2);
+       }
+       //
+       aD1=aPV.Distance(aP3D1);
+       aD2=aPV.Distance(aP3D2);
+       aDmax=(aD1>aD2)? aD1 : aD2;
+       if (aDmax>aCoeff*aTolV) {
+         if (aDmax<10.*aTolV){
+           aBB.UpdateVertex(aV, aDmax);
+           bRet=Standard_True;
+         }
+       }
+      }//
+    }//for (i=1; i<=aNbP; ++i) {
+  }//for(; aItDMVLE.More(); aItDMVLE.Next()) {
+  return bRet;
+}
+
+
index 891a0dec55896e7eaaaf30c518f7b94c8625aa77..597d6d5c69a8eed340ec5f034a2a388bf4fdaadf 100644 (file)
@@ -103,6 +103,7 @@ dist_libGEOMAlgo_la_SOURCES =                       \
        GEOMAlgo_SurfaceTools.cxx               \
        GEOMAlgo_Tools3D.cxx                    \
        GEOMAlgo_Tools.cxx                      \
+       GEOMAlgo_Tools_1.cxx                    \
        GEOMAlgo_VertexSolid.cxx                \
        GEOMAlgo_WESCorrector.cxx               \
        GEOMAlgo_WireEdgeSet.cxx                \
index b54be9129f35bc42939e961d8f9bea1f1b88a318..ade11bc38b3a708b039c11a8417ed0576bff9718 100644 (file)
@@ -1555,6 +1555,10 @@ Please, select face, shell or solid and try again</translation>
             <source>GEOM_SKETCHER_EL</source>
             <translation>Element Type</translation>
         </message>
+       <message>
+            <source>GEOM_SKETCHER_RESTORE</source>
+            <translation>Restore</translation>
+        </message>
         <message>
             <source>GEOM_SKETCHER_LENGTH</source>
             <translation>Length</translation>
index 855e3b6d829de7346fd4deb3e7abd71fa19ba68c..6f9d09bde62700925c27aa0f3578a3ae535aa377 100644 (file)
@@ -1278,7 +1278,7 @@ void GeometryGUI::viewManagers( QStringList& lst ) const
 
 void GeometryGUI::onViewManagerAdded( SUIT_ViewManager* vm )
 {
-  if ( vm->getType() == OCCViewer_Viewer::Type() )
+  if ( vm && vm->getType() == OCCViewer_Viewer::Type() )
   {
     qDebug( "connect" );
     connect( vm, SIGNAL( keyPress  ( SUIT_ViewWindow*, QKeyEvent* ) ),
@@ -1475,8 +1475,8 @@ void GeometryGUI::createPreferences()
   
   // Set property for precision value for spinboxes
   for ( ii = 0; ii < nbQuantities; ii++ ){
-    setPreferenceProperty( prec[ii], "min", -10 );
-    setPreferenceProperty( prec[ii], "max", 10 );
+    setPreferenceProperty( prec[ii], "min", -14 );
+    setPreferenceProperty( prec[ii], "max", 14 );
     setPreferenceProperty( prec[ii], "precision", 2 );
   }  
 
index 63dbbb42ce21a88d77a8b93e66f0542bf08b5b6b..d311b0dcec72ca420b10ac2454487947cc151cc4 100644 (file)
@@ -438,13 +438,14 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
   //}
 
   //Alternative case to check shape result Mantis 0020604: EDF 1172
-  TopoDS_Iterator It (aShape, Standard_True, Standard_True);
+/*  TopoDS_Iterator It (aShape, Standard_True, Standard_True);
   int nbSubshapes=0;
   for (; It.More(); It.Next())
     nbSubshapes++;
   if (!nbSubshapes)
-    Standard_ConstructionError::Raise("Boolean operation aborted : result object is empty compound");
+    Standard_ConstructionError::Raise("Boolean operation aborted : result object is empty compound");*/
   //end of 0020604: EDF 1172
+  //! the changes temporary commented because of customer needs (see the same mantis bug)
 
   aFunction->SetValue(aShape);
 
index 24e2406f0104708475815a469faa3f5db076ed79..a873fc9c8c31486b8f5ac644373b7a78a30935f0 100644 (file)
 #
 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-
 #  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
 #  File   : geompy.py
 #  Author : Paul RASCLE, EDF
 #  Module : GEOM
-#
+
 """
     \namespace geompy
     \brief Module geompy
@@ -535,13 +534,13 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @param theFace The face for which tangent plane should be built.
         #  @param theParameterV vertical value of the center point (0.0 - 1.0).
         #  @param theParameterU horisontal value of the center point (0.0 - 1.0).
-       #  @param theTrimSize the size of plane.
+        #  @param theTrimSize the size of plane.
         #  @return New GEOM_Object, containing the created tangent.
         #
         #  @ref swig_MakeTangentPlaneOnFace "Example"
-       def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
-           anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
-           RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
+        def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
+            anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
+            RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
             return anObj
 
         ## Create a vector with the given components.
@@ -699,7 +698,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             RaiseIfFailed("MakeMarker", self.BasicOp)
             anObj.SetParameters(Parameters)
             return anObj
-           
+
         ## Create a local coordinate system from shape.
         #  @param theShape The initial shape to detect the coordinate system.
         #  @return New GEOM_Object, containing the created coordinate system.
@@ -716,7 +715,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @param theYVec Vector of Y direction
         #  @return New GEOM_Object, containing the created coordinate system.
         #
-       #  @ref tui_creation_lcs "Example"
+        #  @ref tui_creation_lcs "Example"
         def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
             anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
             RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
@@ -754,7 +753,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
             RaiseIfFailed("MakeArcCenter", self.CurvesOp)
             return anObj
-       
+
         ##  Create an arc of ellipse, of center and two points.
         #  @param theCenter Center of the arc.
         #  @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
@@ -945,9 +944,9 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
             return anObj
 
-       ## Create a sketcher wire, following the numerical description,
+        ## Create a sketcher wire, following the numerical description,
         #  passed through <VAR>theCoordinates</VAR> argument. \n
-       #  @param theCoordinates double values, defining points to create a wire,
+        #  @param theCoordinates double values, defining points to create a wire,
         #                                                      passing from it.
         #  @return New GEOM_Object, containing the created wire.
         #
@@ -1008,7 +1007,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  with edges, parallel to this coordinate axes.
         #  @param theH height of Face.
         #  @param theW width of Face.
-       #  @param theOrientation orientation belong axis OXY OYZ OZX
+        #  @param theOrientation orientation belong axis OXY OYZ OZX
         #  @return New GEOM_Object, containing the created face.
         #
         #  @ref tui_creation_face "Example"
@@ -1023,7 +1022,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         ## Create a face from another plane and two sizes,
         #  vertical size and horisontal size.
         #  @param theObj   Normale vector to the creating face or
-       #  the face object.
+        #  the face object.
         #  @param theH     Height (vertical size).
         #  @param theW     Width (horisontal size).
         #  @return New GEOM_Object, containing the created face.
@@ -1065,7 +1064,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
 
         ## Create a disk with specified dimensions along OX-OY coordinate axes.
         #  @param theR Radius of Face.
-       #  @param theOrientation set the orientation belong axis OXY or OYZ or OZX
+        #  @param theOrientation set the orientation belong axis OXY or OYZ or OZX
         #  @return New GEOM_Object, containing the created disk.
         #
         #  @ref tui_creation_face "Example"
@@ -1387,7 +1386,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
 
         ## Create a shape by extrusion of the profile shape along
         #  the path shape. The path shape can be a wire or an edge.
-        #  the several profiles can be specified in the several locations of path.     
+        #  the several profiles can be specified in the several locations of path.
         #  @param theSeqBases - list of  Bases shape to be extruded.
         #  @param theLocations - list of locations on the path corresponding
         #                        specified list of the Bases shapes. Number of locations
@@ -1411,7 +1410,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
 
         ## Create a shape by extrusion of the profile shape along
         #  the path shape. The path shape can be a wire or a edge.
-        #  the several profiles can be specified in the several locations of path.     
+        #  the several profiles can be specified in the several locations of path.
         #  @param theSeqBases - list of  Bases shape to be extruded. Base shape must be
         #                       shell or face. If number of faces in neighbour sections
         #                       aren't coincided result solid between such sections will
@@ -2118,10 +2117,13 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @return New GEOM_Object, containing processed shape.
         #
         #  @ref tui_shape_processing "Example"
-        def ProcessShape(self,theShape, theOperators, theParameters, theValues):
+        def ProcessShape(self, theShape, theOperators, theParameters, theValues):
             # Example: see GEOM_TestHealing.py
             theValues,Parameters = ParseList(theValues)
             anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
+            # To avoid script failure in case of good argument shape
+            if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
+                return theShape
             RaiseIfFailed("ProcessShape", self.HealOp)
             for string in (theOperators + theParameters):
                 Parameters = ":" + Parameters
@@ -2375,10 +2377,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #           in order to avoid possible intersection between shapes from
         #           this compound.
         #  @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
-        #  @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
-        #                             type <= Limit are kept in the result,
-        #                             else - shapes with type > Limit are kept
-        #                             also (if they exist)
+        #  @param KeepNonlimitShapes: if this parameter == 0, then only shapes of
+        #                             target type (equal to Limit) are kept in the result,
+        #                             else standalone shapes of lower dimension
+        #                             are kept also (if they exist).
         #
         #  After implementation new version of PartitionAlgo (October 2006)
         #  other parameters are ignored by current functionality. They are kept
@@ -2701,9 +2703,9 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         ## Modify the Location of the given object by Path,
         #  @param  theObject The object to be displaced.
         #  @param  thePath Wire or Edge along that the object will be translated.
-       #  @param  theDistance progress of Path (0 = start location, 1 = end of path location).
-       #  @param  theCopy is to create a copy objects if true.
-       #  @param  theReverse - 0 for usual direction, 1 to reverse path direction.
+        #  @param  theDistance progress of Path (0 = start location, 1 = end of path location).
+        #  @param  theCopy is to create a copy objects if true.
+        #  @param  theReverse - 0 for usual direction, 1 to reverse path direction.
         #  @return New GEOM_Object, containing the displaced shape.
         #
         #  @ref tui_modify_location "Example"
@@ -4129,7 +4131,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         # end of l3_groups
         ## @}
 
-        ## @addtogroup l4_advanced 
+        ## @addtogroup l4_advanced
         ## @{
 
         ## Create a T-shape object with specified caracteristics for the main
@@ -4153,11 +4155,11 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_creation_pipetshape "Example"
         def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
             theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
-           if (theP1 and theP2 and theP3):
-             anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
-           else:
-             anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
-           RaiseIfFailed("MakePipeTShape", self.AdvOp)
+            if (theP1 and theP2 and theP3):
+                anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
+            else:
+                anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
+            RaiseIfFailed("MakePipeTShape", self.AdvOp)
             if Parameters: anObj[0].SetParameters(Parameters)
             return anObj
 
@@ -4185,17 +4187,17 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_creation_pipetshape "Example"
         def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
             theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
-           if (theP1 and theP2 and theP3):
-             anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
-           else:
-             anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
+            if (theP1 and theP2 and theP3):
+              anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
+            else:
+              anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
             RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
             if Parameters: anObj[0].SetParameters(Parameters)
             return anObj
 
         ## Create a T-shape object with fillet and with specified caracteristics for the main
         #  and the incident pipes (radius, width, half-length). The fillet is
-       #  created on the junction of the pipes.
+        #  created on the junction of the pipes.
         #  The extremities of the main pipe are located on junctions points P1 and P2.
         #  The extremity of the incident pipe is located on junction point P3.
         #  If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
@@ -4207,7 +4209,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @param theW2 Width of incident pipe (R2+W2 < R1+W1)
         #  @param theL2 Half-length of incident pipe
         #  @param theRF Radius of curvature of fillet.
-       #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
+        #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
         #  @param theP1 1st junction point of main pipe
         #  @param theP2 2nd junction point of main pipe
         #  @param theP3 Junction point of incident pipe
@@ -4216,10 +4218,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_creation_pipetshape "Example"
         def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
             theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
-           if (theP1 and theP2 and theP3):
-             anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
-           else:
-             anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
+            if (theP1 and theP2 and theP3):
+              anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
+            else:
+              anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
             RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
             if Parameters: anObj[0].SetParameters(Parameters)
             return anObj
index 7eb174826055648118dd16881615b9ef24ebadcf..6cd07c94a6d6d9bd7b0be08938e19ff035f483aa 100644 (file)
@@ -298,6 +298,7 @@ void OperationGUI_FilletDlg::ConstructorsClicked (int constructorId)
   qApp->processEvents();
   updateGeometry();
   resize(minimumSizeHint());
+  SelectionIntoArgument();
 }
 
 //=================================================================================
index 0b08ae59fcdf065eff571fb32c7d137609c8192a..b6fac51c725384b350fa1f979eef7c7648377367 100644 (file)
@@ -202,6 +202,7 @@ void OperationGUI_PartitionDlg::ConstructorsClicked( int constructorId )
   myEditCurrentArgument->setFocus();
   connect( myGeomGUI->getApp()->selectionMgr(), 
            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+  SelectionIntoArgument();
 }
 
 
index f5115bd0eb4572ea05db79dded02ef83d2ebc97e..b797fc1bf9c5ae700dcac0bde428e8f5364b00b6 100644 (file)
@@ -54,8 +54,7 @@
 //=================================================================================
 PrimitiveGUI_BoxDlg::PrimitiveGUI_BoxDlg (GeometryGUI* theGeometryGUI, QWidget* parent,
                                           bool modal, Qt::WindowFlags fl)
-  : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
-    myInitial(true)
+  : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl)
 {
   QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BOX_2P")));
   QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BOX_DXYZ")));
@@ -196,15 +195,9 @@ void PrimitiveGUI_BoxDlg::ConstructorsClicked (int constructorId)
   qApp->processEvents();
   updateGeometry();
   resize(minimumSizeHint());
+  SelectionIntoArgument();
 
-  if (myInitial) {
-    // on dialog initialization we init the first field with a selected object (if any)
-    SelectionIntoArgument();
-    myInitial = false;
-  }
-  else {
-    displayPreview();
-  }
+  displayPreview();
 }
 
 //=================================================================================
@@ -331,10 +324,6 @@ void PrimitiveGUI_BoxDlg::SetEditCurrentArgument()
 
   // clear selection
   //disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
-  //if (myInitial)
-  //  myInitial = false;
-  //else
-  //  myGeomGUI->getApp()->selectionMgr()->clearSelected();
 
   if (send == GroupPoints->PushButton1) {
     myEditCurrentArgument = GroupPoints->LineEdit1;
index fab0dc3909fb957ce2ea8813641024516fe8019f..bdc8e6af87b5763565d95437368538ffbbcaa0c6 100644 (file)
@@ -58,9 +58,6 @@ private:
 private:
   GEOM::GEOM_Object_var              myPoint1, myPoint2; /* Points containing the vector */
 
-  // to initialize the first selection field with a selected object on the dialog creation
-  bool                               myInitial;
-
   DlgRef_2Sel*                       GroupPoints;
   DlgRef_3Spin*                      GroupDimensions;
 
index c5ebf0be93f9a467dd6c4114f6b1e0d196efb377..bef1293eb9da31949363e0c97733e0d430128f33 100644 (file)
@@ -54,8 +54,7 @@
 //=================================================================================
 PrimitiveGUI_ConeDlg::PrimitiveGUI_ConeDlg (GeometryGUI* theGeometryGUI, QWidget* parent,
                                             bool modal, Qt::WindowFlags fl)
-  : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
-    myInitial(true)
+  : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl)
 {
   QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_CONE_PV")));
   QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_CONE_DXYZ")));
@@ -211,15 +210,9 @@ void PrimitiveGUI_ConeDlg::ConstructorsClicked (int constructorId)
   qApp->processEvents();
   updateGeometry();
   resize(minimumSizeHint());
+  SelectionIntoArgument();
 
-  if (myInitial) {
-    // on dialog initialization we init the first field with a selected object (if any)
-    SelectionIntoArgument();
-    myInitial = false;
-  }
-  else {
-    displayPreview();
-  }
+  displayPreview();
 }
 
 //=================================================================================
index 0e4d6ad14d4212bdfaa29651889d94f5949f6b6b..abea2e72b37b89279cbcac32babc2079055852cf 100644 (file)
@@ -61,9 +61,6 @@ private:
 private:
   GEOM::GEOM_Object_var              myPoint, myDir;
 
-  // to initialize the first selection field with a selected object on the dialog creation
-  bool                               myInitial;
-  
   DlgRef_2Sel3Spin*                  GroupPoints;
   DlgRef_3Spin*                      GroupDimensions;
 
index be7685d9fe768075be37190996c8cdcd4cf858f6..cea029cf658d02de07fba0a60fcab06d796fce17 100644 (file)
@@ -202,20 +202,9 @@ void PrimitiveGUI_CylinderDlg::ConstructorsClicked (int constructorId)
   qApp->processEvents();
   updateGeometry();
   resize(minimumSizeHint());
+  SelectionIntoArgument();
 
-  if (myInitial) {
-    myInitial = false;
-    if (constructorId == 0) {
-      // on dialog initialization we init the first field with a selected object (if any)
-      SelectionIntoArgument();
-    }
-    else {
-      displayPreview();
-    }
-  }
-  else {
-    displayPreview();
-  }
+  displayPreview();
 }
 
 //=================================================================================
index fb23cb4ef0799ff557e5a32c0c18de6494a20723..8aa1a6aee465f74383ac4d31db558c54c2ae7407 100755 (executable)
@@ -49,8 +49,7 @@
 //=================================================================================
 PrimitiveGUI_DiskDlg::PrimitiveGUI_DiskDlg (GeometryGUI* theGeometryGUI, QWidget* parent,
                                             bool modal, Qt::WindowFlags fl)
-  : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
-    myInitial(true)
+  : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl)
 {
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
   QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_DISK_PNT_VEC_R")));
@@ -253,20 +252,9 @@ void PrimitiveGUI_DiskDlg::ConstructorsClicked (int constructorId)
   qApp->processEvents();
   updateGeometry();
   resize(minimumSizeHint());
+  SelectionIntoArgument();
 
-  if (myInitial) {
-    myInitial = false;
-    if (constructorId == 1 || constructorId == 2) {
-      // on dialog initialization we init the first field with a selected object (if any)
-      SelectionIntoArgument();
-    }
-    else {
-      displayPreview();
-    }
-  }
-  else {
-    displayPreview();
-  }
+  displayPreview();
 }
 
 //=================================================================================
index 6e3d3c36dcb9ca280c2317daf11ec233fd092ef5..e7f4e9cc279a6dbe84c731e42001c08ff63260f2 100755 (executable)
@@ -60,9 +60,6 @@ private:
 private:
   GEOM::GEOM_Object_var              myPoint, myDir, myPoint1, myPoint2, myPoint3;
 
-  // to initialize the first selection field with a selected object on the dialog creation
-  bool                               myInitial;
-
   DlgRef_2Sel1Spin*                  GroupPntVecR;
   DlgRef_3Sel*                       Group3Pnts;
   DlgRef_1Spin*                      GroupDimensions;
index 23fb51375614f5d03c89658615c9592ab35e4312..44dd44ca0a36ff5bdec82f71df5cf99affd0a74d 100644 (file)
@@ -193,6 +193,7 @@ void PrimitiveGUI_SphereDlg::ConstructorsClicked( int constructorId )
   qApp->processEvents();
   updateGeometry();
   resize( minimumSizeHint() );
+  SelectionIntoArgument();
 
   displayPreview();
 }
index f0253fcc6796300251b9db273a20a206c52d3851..f6a47130a2c194d813672e816970acc3ac12d8bb 100644 (file)
@@ -54,8 +54,7 @@
 //=================================================================================
 PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg (GeometryGUI* theGeometryGUI, QWidget* parent,
                                               bool modal, Qt::WindowFlags fl)
-  : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
-    myInitial(true)
+  : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl)
 {
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
   QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TORUS_PV")));
@@ -201,20 +200,9 @@ void PrimitiveGUI_TorusDlg::ConstructorsClicked (int constructorId)
   qApp->processEvents();
   updateGeometry();
   resize(minimumSizeHint());
+  SelectionIntoArgument();
 
-  if (myInitial) {
-    myInitial = false;
-    if (constructorId == 0) {
-      // on dialog initialization we init the first field with a selected object (if any)
-      SelectionIntoArgument();
-    }
-    else {
-      displayPreview();
-    }
-  }
-  else {
-    displayPreview();
-  }
+  displayPreview();
 }
 
 //=================================================================================
index 9a190dc9516499c3de9401cdd5674fd875511b13..8cc2a57e2de76cf14278236a20fbc9d2878ec0a9 100644 (file)
@@ -60,9 +60,6 @@ private:
 private:
   GEOM::GEOM_Object_var              myPoint, myDir;
 
-  // to initialize the first selection field with a selected object on the dialog creation
-  bool                               myInitial;
-  
   DlgRef_2Sel2Spin*                  GroupPoints;
   DlgRef_2Spin*                      GroupDimensions;
   
index b0d60a95ba984c62e41e375d60d6a6d3d7b4bf16..15796bc2f95ed019a3d4c723d831e4acbee89f57 100644 (file)
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
 //  GEOM GEOMGUI : GUI for Geometry component
 //  File   : RepairGUI_SuppressFacesDlg.cxx
 //  Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
-//
+
 #include "RepairGUI_SuppressFacesDlg.h"
 
 #include <DlgRef.h>
@@ -111,7 +110,7 @@ void RepairGUI_SuppressFacesDlg::Init()
   myObject = GEOM::GEOM_Object::_nil();
   myFacesInd = new GEOM::short_array();
   myFacesInd->length(0);
-  
+
   mainFrame()->GroupBoxPublish->show();
 
   // signals and slots connections
@@ -207,6 +206,8 @@ void RepairGUI_SuppressFacesDlg::SelectionIntoArgument()
     }
 
     if (aMap.IsEmpty() && aSelList.Extent() > 0) { // try to detect selected published sub-shape
+      TColStd_MapOfInteger anIds;
+
       SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(myGeomGUI->getApp()->activeStudy());
       if (!appStudy) return;
       _PTR(Study) aStudy = appStudy->studyDS();
@@ -232,11 +233,30 @@ void RepairGUI_SuppressFacesDlg::SelectionIntoArgument()
               int anIndex = aMainMap.FindIndex(aSubShape);
               if (anIndex >= 0) {
                 aMap.Add(anIndex);
+                anIds.Add(anIndex);
               }
             }
           }
         }
       }
+      if (!aMap.IsEmpty()) {
+        // highlight local faces, correspondent to OB selection
+        disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+
+        aSelMgr->clearSelected();
+
+        Standard_Boolean isOk;
+        char* objIOR = GEOMBase::GetIORFromObject(myObject);
+        Handle(GEOM_AISShape) aSh = GEOMBase::ConvertIORinGEOMAISShape(objIOR, isOk, true);
+        free(objIOR);
+        if (!isOk || aSh.IsNull())
+          return;
+
+        aSelMgr->AddOrRemoveIndex(aSh->getIO(), anIds, false);
+
+        connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+                this, SLOT(SelectionIntoArgument()));
+      }
     }
 
     const int n = aMap.Extent();
index 442c8615df0e5e83abd087028b5a02256e90cc9e..d81792e8fc7f106b3e529c38e64abad9d9ddf0d4 100644 (file)
@@ -130,6 +130,7 @@ void TransformationGUI_OffsetDlg::Init()
 
   globalSelection( GEOM_ALLSHAPES );
   resize(100,100);
+  SelectionIntoArgument();
 }