From: vsr Date: Thu, 10 Jun 2010 06:34:05 +0000 (+0000) Subject: Merge from V5_1_4_BR (5_1_4rc2) 09/06/2010 X-Git-Tag: translate_resources_09Jul10~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=01f5a34efc9d0c9b489f88368930a011f981cd1c;p=modules%2Fgeom.git Merge from V5_1_4_BR (5_1_4rc2) 09/06/2010 --- diff --git a/doc/salome/gui/GEOM/images/partition1.png b/doc/salome/gui/GEOM/images/partition1.png index 7e068ca0d..cc5b15544 100755 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 index 000000000..474f8b0b0 Binary files /dev/null and b/doc/salome/gui/GEOM/images/partitionsn3.png differ diff --git a/doc/salome/gui/GEOM/input/add_point_on_edge_operation.doc b/doc/salome/gui/GEOM/input/add_point_on_edge_operation.doc index 465928b80..4a58ee64a 100644 --- a/doc/salome/gui/GEOM/input/add_point_on_edge_operation.doc +++ b/doc/salome/gui/GEOM/input/add_point_on_edge_operation.doc @@ -5,23 +5,35 @@ \n To Add Point on Edge in the Main Menu select Repair - > Add Point on Edge. -\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 OCC Viewer only. +by length). This operation is available in OCC Viewer only. \n The \b Result will be a \b GEOM_Object. \n TUI Command: geompy.DivideEdge(Shape, EdgeID, Value, -IsByParameter), 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 Arguments: Name + 1 Edge + 1 value setting the position of +IsByParameter) +- \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] + +Arguments: 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 Example: diff --git a/doc/salome/gui/GEOM/input/creating_lcs.doc b/doc/salome/gui/GEOM/input/creating_lcs.doc index 2516af99d..0188c76ba 100644 --- a/doc/salome/gui/GEOM/input/creating_lcs.doc +++ b/doc/salome/gui/GEOM/input/creating_lcs.doc @@ -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 TUI command: geompy.MakeMarkerPntTwoVec(Center, VectorX, -VectorY) where Center is a point specified the coordinate system location, -VectorX is a derection of OX axis and VectorY direction of OY axis. +VectorY) 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 Arguments: 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" -TUI Script provide you with useful example of creation of -\ref tui_creation_lcs "Local Coordinate System". -*/ \ No newline at end of file +TUI Script provides you with a useful example of +\ref tui_creation_lcs "Local Coordinate System" creation. +*/ diff --git a/doc/salome/gui/GEOM/input/creating_pipetshape.doc b/doc/salome/gui/GEOM/input/creating_pipetshape.doc index 823bc3eb9..d66250295 100644 --- a/doc/salome/gui/GEOM/input/creating_pipetshape.doc +++ b/doc/salome/gui/GEOM/input/creating_pipetshape.doc @@ -5,23 +5,23 @@ To create a \b PipeTShape in the Main Menu select New Entity - > Advanced - > PipeTShape -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 result of the operation will be a GEOM_Object. TUI Command: geompy.MakePipeTShape(R1, W1, L1, R2, W2, L2, HexMesh=True, P1=None, P2=None, P3=None) Arguments: -- \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 TUI Command: geompy.MakePipeTShapeChamfer(R1, W1, L1, R2, W2, L2, H, W, HexMesh=True, P1=None, P2=None, P3=None) -Arguments are the same as normal Pipe T-Shape plus: -- \b H - Height of the chamfer along incident pipe. +The arguments are the same as of the normal Pipe T-Shape plus: +- \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 TUI Command: geompy.MakePipeTShapeFillet(R1, W1, L1, R2, W2, L2, RF, HexMesh=True, P1=None, P2=None, P3=None) -Arguments are the same as normal Pipe T-Shape plus: +The arguments are the same as of the normal Pipe T-Shape plus: - \b RF - Radius of the fillet. Example: diff --git a/doc/salome/gui/GEOM/input/deflection.doc b/doc/salome/gui/GEOM/input/deflection.doc index b2f419a94..1d523f3b4 100644 --- a/doc/salome/gui/GEOM/input/deflection.doc +++ b/doc/salome/gui/GEOM/input/deflection.doc @@ -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 Arguments: 1 floating point value (deviation coefficient). diff --git a/doc/salome/gui/GEOM/input/geometrical_object_properties.doc b/doc/salome/gui/GEOM/input/geometrical_object_properties.doc index 78de472cd..e323c6932 100644 --- a/doc/salome/gui/GEOM/input/geometrical_object_properties.doc +++ b/doc/salome/gui/GEOM/input/geometrical_object_properties.doc @@ -8,7 +8,7 @@ The Type 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 a 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: 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. GetShapeType function: 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 }
@@ -94,7 +93,7 @@ SOLID, SHELL, FACE, WIRE, EDGE, VERTEX, SHAPE }
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". */ diff --git a/doc/salome/gui/GEOM/input/index.doc b/doc/salome/gui/GEOM/input/index.doc index d1485ef14..d28e8c343 100644 --- a/doc/salome/gui/GEOM/input/index.doc +++ b/doc/salome/gui/GEOM/input/index.doc @@ -13,9 +13,11 @@ using a wide range of functions;
  • \subpage transform_geom_obj_page "transformation of geometrical objects" using various algorithms;
  • \subpage repairing_operations_page "optimization of geometrical objects";
  • -
  • \subpage geometrical_obj_prop_page "Geometrical object properties".
  • -
  • \subpage using_measurement_tools_page "provision of information about geometrical objects".
  • -
  • \subpage using_notebook_geom_page.
  • +
  • viewing \subpage geometrical_obj_prop_page "geometrical object properties".
  • +
  • and other information about geometrical objects using + \subpage using_measurement_tools_page "measurement tools".
  • +
  • easily setting parameters via the variables predefined in + \subpage using_notebook_geom_page "Salome notebook".
  • Almost all geometry module functionalities are accessible via diff --git a/doc/salome/gui/GEOM/input/partition.doc b/doc/salome/gui/GEOM/input/partition.doc index 532f4c375..6661d12f2 100644 --- a/doc/salome/gui/GEOM/input/partition.doc +++ b/doc/salome/gui/GEOM/input/partition.doc @@ -4,45 +4,66 @@ \n To produce a \b Partition in the Main Menu select Operations - > Partition -\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.

    Intersection of two shapes.

    +\image html partition1.png + +\n Arguments: 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, Resulting type box allows choosing the preferrable result, i.e. a solid, a shell, a list of faces, etc. +\nResulting type 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. + +Keep shapes of lower type 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 Keep shapes of lower +type 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 Advanced option: + \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments". + \n TUI Command: geompy.MakePartition(ListOfShapes, ListOfTools, ListOfKeepInside, ListOfRemoveInside, Limit, RemoveWebs, -ListOfMaterials), 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), 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 Arguments: Name + 2 lists of shapes (the shapes from the -first list will be intersected with the shapes from the second list) + -reconstruction limit. -\n Advanced option: - \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments". - -\image html partition1.png - -Keep shapes of lower type checkbox allows building geometrical objects. -Only lower type objects will be preserved without the upper ones.

    Intersection of a Shape and a Plane.

    -\n TUI Command: geompy.MakeHalfPartition(Shapes, -Plane), 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 Arguments: Name + a list of shapes which will be intersected + 1 cutting plane. + \n Advanced option: \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments". -\image html partition2.png +\n TUI Command: geompy.MakeHalfPartition(Shapes, +Plane), where \em Shapes are a list of Shapes to be intersected +and \em Plane is a Tool shape, to intersect the \em Shapes. \n Example: @@ -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 TUI Scripts provide you with useful examples of the use of \ref tui_partition "Basic Operations". diff --git a/doc/salome/gui/GEOM/input/restore_presentation_parameters.doc b/doc/salome/gui/GEOM/input/restore_presentation_parameters.doc index 4cb9aa916..4fdffcd79 100644 --- a/doc/salome/gui/GEOM/input/restore_presentation_parameters.doc +++ b/doc/salome/gui/GEOM/input/restore_presentation_parameters.doc @@ -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 +
    Set presentation parameters and subshapes from arguments
    + +\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 TUI Scripts for \ref tui_restore_prs_params "example". +
    Add prefix to names of restored subshapes
    -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 TUI Scripts for \ref tui_restore_prs_params "example". - */ diff --git a/doc/salome/gui/GEOM/input/viewing_geom_obj.doc b/doc/salome/gui/GEOM/input/viewing_geom_obj.doc index b6e5b97ba..39a4f9035 100644 --- a/doc/salome/gui/GEOM/input/viewing_geom_obj.doc +++ b/doc/salome/gui/GEOM/input/viewing_geom_obj.doc @@ -28,7 +28,7 @@ transparency of geometrical objects.
  • \subpage isolines_page "Isos" - allows to change the number of isolines displayed within a shape.
  • \subpage deflection_page "Deflection" - allows to change the -deviation coefficient of a shape.
  • +deflection coefficient of a shape.
  • \subpage point_marker_page "Point Marker" - allows to change the representation of geometrical vertices.
  • Auto color / Disable auto color - activates the auto color diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index baf88a780..61aa8caeb 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -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 diff --git a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx index 2c476cc74..b43126f08 100644 --- a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx +++ b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx @@ -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); diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx index d9cded4fd..8538d514f 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx @@ -57,6 +57,8 @@ #include +#include + //================================================================================= // class : EntityGUI_SketcherDlg() // purpose : Constructs a EntityGUI_SketcherDlg which is a child of 'parent', with the @@ -1418,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() ); @@ -1660,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 ) ) ); } //================================================================================= diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index 11679422a..60a5e7da7 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -35,6 +35,8 @@ #include "utilities.h" +#include + #include #include #include @@ -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); diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 19e6515c4..6f9d09bde 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -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 ); } diff --git a/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx b/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx index 63dbbb42c..d311b0dce 100644 --- a/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx @@ -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); diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index 24e2406f0..a873fc9c8 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -17,12 +17,11 @@ # # 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 theCoordinates 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 diff --git a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx index b0d60a95b..15796bc2f 100644 --- a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx @@ -19,11 +19,10 @@ // // 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 @@ -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(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();