From: vsr Date: Fri, 12 Nov 2010 11:47:21 +0000 (+0000) Subject: Merge from V5_1_5_BR branch 12/11/2010 X-Git-Tag: RELIQUAT_5x_15112010~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ae89775f1b73533d82578538f9c45a89e0e1040b;p=modules%2Fgeom.git Merge from V5_1_5_BR branch 12/11/2010 --- diff --git a/adm_local/cmake_files/FindGEOM.cmake b/adm_local/cmake_files/FindGEOM.cmake index 5f138fd7e..fc6f3eb94 100644 --- a/adm_local/cmake_files/FindGEOM.cmake +++ b/adm_local/cmake_files/FindGEOM.cmake @@ -19,6 +19,7 @@ SET(GEOM_CXXFLAGS -I${GEOM_ROOT_DIR}/include/salome) +FIND_LIBRARY(AdvancedGUI AdvancedGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(BasicGUI BasicGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(BlocksGUI BlocksGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(BooleanGUI BooleanGUI ${GEOM_ROOT_DIR}/lib/salome) @@ -48,6 +49,7 @@ FIND_LIBRARY(IGESImport IGESImport ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(MeasureGUI MeasureGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(NMTDS NMTDS ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(NMTTools NMTTools ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(OCC2VTK OCC2VTK ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(OperationGUI OperationGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(PrimitiveGUI PrimitiveGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(RepairGUI RepairGUI ${GEOM_ROOT_DIR}/lib/salome) @@ -57,3 +59,4 @@ FIND_LIBRARY(STEPExport STEPExport ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(STEPImport STEPImport ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(STLExport STLExport ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(TransformationGUI TransformationGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(VTKExport VTKExport ${GEOM_ROOT_DIR}/lib/salome) diff --git a/configure.ac b/configure.ac index e5cd6f127..550a35335 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ # Modified by : Alexander BORODIN (OCN) - autotools usage # Created from configure.in.base # -AC_INIT([Salome2 Project GEOM module], [5.1.4], [webmaster.salome@opencascade.com], [SalomeGEOM]) +AC_INIT([Salome2 Project GEOM module], [5.1.5], [webmaster.salome@opencascade.com], [SalomeGEOM]) AC_CONFIG_AUX_DIR(adm_local/unix/config_files) AC_CANONICAL_HOST AC_CANONICAL_TARGET @@ -375,6 +375,19 @@ echo # chmod +x ./bin/*; \ #]) +AC_CONFIG_COMMANDS([hack_libtool],[ +sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\ + if test \"\$(echo \$[@] | grep -E '\\\-L/usr/lib(/../lib)?(64)? ')\" == \"\" \n\ + then\n\ + cmd=\"\1 \$[@]\"\n\ + else\n\ + cmd=\"\1 \"\`echo \$[@] | sed -r -e 's|(.*)-L/usr/lib(/../lib)?(64)? (.*)|\\\1\\\4 -L/usr/lib\\\3|g'\`\n\ + fi\n\ + \$cmd\n\ +}\n\ +CC=\"hack_libtool\"%g" libtool +],[]) + # This list is initiated using autoscan and must be updated manually # when adding a new file .in to manage. When you execute # autoscan, the Makefile list is generated in the output file configure.scan. @@ -449,5 +462,3 @@ AC_OUTPUT([ \ idl/Makefile \ Makefile \ ]) - -AC_HACK_LIBTOOL diff --git a/doc/docutils/Makefile.am b/doc/docutils/Makefile.am index ca2932a4c..16ec48f2d 100644 --- a/doc/docutils/Makefile.am +++ b/doc/docutils/Makefile.am @@ -41,7 +41,7 @@ SPHINXBUILD = sphinx-build PAPEROPT_a4 = -D latex_paper_size=a4 ALLSPHINXOPTS = -d doctrees $(PAPEROPT_a4) $(SPHINXOPTS) $(SOURCEDIR) -SPHINX_PYTHONPATH = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/bin/salome:$(KERNEL_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages +SPHINX_PYTHONPATH = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(prefix)/lib64/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/bin/salome:$(KERNEL_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/lib64/python$(PYTHON_VERSION)/site-packages/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages SPHINX_LD_LIBRARY_PATH = $(KERNEL_ROOT_DIR)/lib/salome:$(OMNIORB_ROOT)/lib diff --git a/doc/salome/gui/GEOM/images/geomscreen.png b/doc/salome/gui/GEOM/images/geomscreen.png index 58908a742..ebcd56f2e 100755 Binary files a/doc/salome/gui/GEOM/images/geomscreen.png and b/doc/salome/gui/GEOM/images/geomscreen.png differ diff --git a/doc/salome/gui/GEOM/images/mtrans1.png b/doc/salome/gui/GEOM/images/mtrans1.png index 41b44d79b..5abf96abb 100755 Binary files a/doc/salome/gui/GEOM/images/mtrans1.png and b/doc/salome/gui/GEOM/images/mtrans1.png differ diff --git a/doc/salome/gui/GEOM/images/mtrans2.png b/doc/salome/gui/GEOM/images/mtrans2.png index 9c9781b82..ee32abe1e 100755 Binary files a/doc/salome/gui/GEOM/images/mtrans2.png and b/doc/salome/gui/GEOM/images/mtrans2.png differ diff --git a/doc/salome/gui/GEOM/images/neo-mrot1.png b/doc/salome/gui/GEOM/images/neo-mrot1.png index d1e7c78e9..f00e5c0b1 100755 Binary files a/doc/salome/gui/GEOM/images/neo-mrot1.png and b/doc/salome/gui/GEOM/images/neo-mrot1.png differ diff --git a/doc/salome/gui/GEOM/images/neo-mrot2.png b/doc/salome/gui/GEOM/images/neo-mrot2.png index 42ddcee14..fb4a819ac 100755 Binary files a/doc/salome/gui/GEOM/images/neo-mrot2.png and b/doc/salome/gui/GEOM/images/neo-mrot2.png differ diff --git a/doc/salome/gui/GEOM/images/partition1.png b/doc/salome/gui/GEOM/images/partition1.png index cc5b15544..65d318ea3 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/partition2.png b/doc/salome/gui/GEOM/images/partition2.png index 18f01e212..8125cdbb9 100755 Binary files a/doc/salome/gui/GEOM/images/partition2.png and b/doc/salome/gui/GEOM/images/partition2.png differ diff --git a/doc/salome/gui/GEOM/images/transformation13.png b/doc/salome/gui/GEOM/images/transformation13.png index c9ffa8325..6436379f4 100644 Binary files a/doc/salome/gui/GEOM/images/transformation13.png and b/doc/salome/gui/GEOM/images/transformation13.png differ diff --git a/doc/salome/gui/GEOM/images/transformation5.png b/doc/salome/gui/GEOM/images/transformation5.png index c9b54e819..e2d877124 100755 Binary files a/doc/salome/gui/GEOM/images/transformation5.png and b/doc/salome/gui/GEOM/images/transformation5.png differ diff --git a/doc/salome/gui/GEOM/images/transformation6.png b/doc/salome/gui/GEOM/images/transformation6.png index 2fa724cf9..a9e4cf286 100755 Binary files a/doc/salome/gui/GEOM/images/transformation6.png and b/doc/salome/gui/GEOM/images/transformation6.png differ diff --git a/doc/salome/gui/GEOM/input/creating_edge.doc b/doc/salome/gui/GEOM/input/creating_edge.doc index 6d45a5418..ffbfa69de 100644 --- a/doc/salome/gui/GEOM/input/creating_edge.doc +++ b/doc/salome/gui/GEOM/input/creating_edge.doc @@ -2,25 +2,50 @@ \page create_edge_page Edge -\n To create an \b Edge in the Main Menu select New Entity- > Build - > Edge +To create an \b Edge, in the Main Menu select New Entity > +Build > Edge -\n You can create an \b Edge from two points (\b Point1 and \b Point2), being the first and the last vertices of the edge. +There are two ways to create an edge. In both cases the \b Result +will be a \b GEOM_Object (EDGE). -The \b Result will be a \b GEOM_Object (EDGE). +Firstly, you can create an \b Edge by specifying two points (\b Point1 and +\b Point2), which are the first and the last vertices of the edge. -TUI Command: geompy.MakeEdge(Vertex1, Vertex2), where -Vertex1 and Vertex2 are correspondingly the first and the last vertex -of the edge. +TUI Command: geompy.MakeEdge(Vertex1, Vertex2)
+Arguments: Name + 2 vertices (Vertex1 and Vertex2 are +correspondingly the first and the last vertex of the edge). -Arguments: Name + 2 vertices. +\image html edge1.png "Create edge by two points" -\image html neo-obj2.png +Secondly, you can create an \b Edge by specifying a single wire. -\n Example: +In this mode the following use cases are possible: +- All edges that form the wire lie on the same geometrical curve +(i.e. curve(edge1) == curve(edge2)). +- The edges that form the wire lie on analytical curves of the same +type, for example, segments of line, arcs, etc. In this case, the +algorithm checks geometrical coincidence of these curves using +a certain tolerance. If the curves are coinciding in terms of the given +tolerance, the resulting edge is built as if on a single curve. +- The edges that form the wire have the same tangency in the connection +points. In this case the curves are interpolated by the single +b-spline curve with sufficient precision. The resulting edge will +be built on this curve. + +The case when the edges that form the wire have different tangency in +the connection points (sharp bend) is not processed. + +TUI Command: geompy.MakeEdgeWire(Wire, LinearTolerance, AngularTolerance)
+Arguments: Name + 1 wire + Linear Tolerance + Angular Tolerance +(tolerance values are used to check coincidence of the underlying curves). + +\image html edge2.png "Create edge from wire" + +Example: \image html edgesn.png "Edge" Our TUI Scripts provide you with useful examples of creation of \ref tui_creation_edge "Advanced Geometric Objects". -*/ \ No newline at end of file +*/ diff --git a/doc/salome/gui/GEOM/input/creating_extrusion.doc b/doc/salome/gui/GEOM/input/creating_extrusion.doc index c86ed5ac5..afd78e1f6 100644 --- a/doc/salome/gui/GEOM/input/creating_extrusion.doc +++ b/doc/salome/gui/GEOM/input/creating_extrusion.doc @@ -18,8 +18,8 @@ shell, solid or compsolid). \n Both Directions checkbox allows extruiding the source object both forward and backward. \n TUI Command: geompy.MakePrismVecH(Base, Vector, Height) -\n Arguments: Name + 1 shape (vertex, edge, planar wire, face or -shell) serving as base object + 1 vector (for direction of the +\n Arguments: Name + one or several shapes (vertex, edge, planar wire, face or +shell) serving as base objects + 1 vector (for direction of the extrusion) + 1 value (dimension). \image html extrusion1.png @@ -30,8 +30,8 @@ you don't need to create it in advance). \n Both Directions checkbox allows extruiding the source object both forward and backward. \n TUI Command: geompy.MakePrism(Base, Point1, Point2) -\n Arguments: Name + 1 shape (vertex, edge, planar wire, face or -shell) serving as base object + 2 vertices. +\n Arguments: Name + one or several shapes (vertex, edge, planar wire, face or +shell) serving as base objects + 2 vertices. \image html extrusion2.png @@ -40,8 +40,8 @@ and the DX, DY, DZ Vector\n Both Directions checkbox allows extruding the source objects both forward and backward. \n TUI Command: geompy.MakePrismDXDYDZ(Base, dx, dy, dz) -\n Arguments: Name + 1 shape (vertex, edge, planar wire, face or -shell) serving as base object + 3 axis directions. +\n Arguments: Name + one or several shapes (vertex, edge, planar wire, face or +shell) serving as base objects + 3 axis directions. \image html extrusion3.png diff --git a/doc/salome/gui/GEOM/input/creating_filling.doc b/doc/salome/gui/GEOM/input/creating_filling.doc index a66bb45f0..5074f4eed 100644 --- a/doc/salome/gui/GEOM/input/creating_filling.doc +++ b/doc/salome/gui/GEOM/input/creating_filling.doc @@ -4,39 +4,38 @@ To generate a \b Filling in the Main Menu select New Entity - > Generation - > Filling -To create a curving face using several edges you need to define the +To create a curvilinear face from several edges you need to define the following parameters: \n Input Compound - the list of edges/wires used for creation -of the surface. Before perform filling algorithm each wire from -compound is converted to one edge created on BSpline curve built using -curves from all edges from wire. +of the surface. To prepare for the filling each wire of the compound +is converted to an edge created on a BSpline curve built using curves +from all edges of the wire. \n \b Minimum and Maximum Degree of equation of the resulting BSpline or Besier curves describing the surface; \n \b Tolerance for \b 2D and for \b 3D - minimum distance between the created surface and the reference edge; -\n Number of -Iterations - defines the maximum number of iterations. The +\n Number of Iterations - defines the maximum number of iterations. The iterations are repeated until the required tolerance is reached. So, a greater number of iterations allows producing a better surface. \n Method - Kind of method to perform filling operation -1. Default - standard behaviour -2. Use edges orientation - orientation of edges are used: if edge is -reversed curve from this edge is reversed before using in filling +1. Default - the standard behaviour. +2. Use edges orientation - the edges orientation is used: if an edge is +reversed, the curve from this edge is reversed before being used by the filling algorithm. -3. Auto-correct edges orientation - change orientation of curves using -minimization of sum of distances between ends points of edges. +3. Auto-correct edges orientation - curves orientation is changed to +minimize the sum of distances between ends points of edges. \n Approximation - if checked, BSpline curves are generated in the process of surface construction (using GeomAPI_PointsToBSplineSurface functionality). By default the surface is created using Besier curves. The usage of Approximation -makes the algorithm work slower, but allows building the surface for -rather complex cases. +slows the algorithm, but allows building the surface for complex cases. \n The \b Result of the operation will be a GEOM_Object (face). \n TUI Command: geompy.MakeFilling(Edges, MinDegree, MaxDegree, Tol2D, Tol3D, NbIter) \n Arguments: Name + 1 List of edges + 7 Parameters -(Min. degree, Max. degree, 2D tolerance, 3D tolerance, Number of iterations, Method, Approximation). +(Min. degree, Max. degree, Number of iterations, 2D tolerance, 3D +tolerance, Number of iterations, Method, Approximation). \image html filling.png diff --git a/doc/salome/gui/GEOM/input/index.doc b/doc/salome/gui/GEOM/input/index.doc index f612e7108..856e03a54 100644 --- a/doc/salome/gui/GEOM/input/index.doc +++ b/doc/salome/gui/GEOM/input/index.doc @@ -23,8 +23,7 @@ various algorithms; Almost all geometry module functionalities are accessible via \subpage geompy_page "Geometry module Python Interface" -\n Have a look also at the - documentation of the GEOM python packages +Also it can be useful to have a look at the \subpage geompypkg_page "documentation on GEOM python packages". \image html image3.png "Example of Geometry module usage for engineering tasks" diff --git a/doc/salome/gui/GEOM/input/limit_tolerance_operation.doc b/doc/salome/gui/GEOM/input/limit_tolerance_operation.doc index 3767c0c99..f7c0b2e84 100644 --- a/doc/salome/gui/GEOM/input/limit_tolerance_operation.doc +++ b/doc/salome/gui/GEOM/input/limit_tolerance_operation.doc @@ -13,25 +13,25 @@ \n The \b Result will be a \b GEOM_Object. -\n This functionality tries to set new value of tolerance for the - given shape. But the final tolerance value depends also on the - initial shape topology (regards existing gaps) in order to obtain - valid resulting shape. +\n This functionality tries to set a new value of tolerance for the + given shape. However, the final tolerance value also depends on the + initial shape topology (takes into consideration the existing gaps) to obtain + a valid resulting shape. \n Example of usage:
    -
  1. Try a partition on objects obj1 and obj2.
  2. +
  3. Partition objects obj1 and obj2.
  4. Partition fails.
  5. Perform Limit Tolerance on objects obj1 and obj2.
  6. -
  7. Try again the partition.
  8. +
  9. Try to partition them again.
See also \ref tui_limit_tolerance "TUI example". \n TUI Command: geompy.LimitTolerance(Shape, Tolerance), where \em Shape is a shape with presumably incorrect tolerance, \em - Tolerance is a desired value of tolerance. + Tolerance is the required tolerance value. -Our TUI Scripts provide you with useful examples of the use of +Our TUI Scripts provide you with useful examples of \ref tui_limit_tolerance "Repairing Operations". */ diff --git a/doc/salome/gui/GEOM/input/multi_translation_operation.doc b/doc/salome/gui/GEOM/input/multi_translation_operation.doc index 2bd2ef3fc..7e6d64f46 100644 --- a/doc/salome/gui/GEOM/input/multi_translation_operation.doc +++ b/doc/salome/gui/GEOM/input/multi_translation_operation.doc @@ -12,7 +12,9 @@ two directions. \n To produce a Simple Multi Translation (in one direction) you need to indicate an \b Object to be translated, a \b Vector of translation, a \b Step of translation and a Number of Times the -Object should be duplicated. +Object should be duplicated. If a curve has been selected instead of +the Vector, only its first and last vertices will be used to get the vector direction +and the dialog preview will display the vector along which the object will be translated. \n TUI Command: geompy.MakeMultiTranslation1D(Shape, Dir, Step, NbTimes) \n Arguments: Name + 1 shape + 1 vector (for direction) + 1 @@ -27,6 +29,8 @@ step value + 1 value (repetition). \n To produce a Double Multi Translation (in two directions) you need to indicate an \b Object to be translated, and, for both axes, a \b Vector of translation, a \b Step of translation and a Number of Times the shape must be duplicated. +If a curve has been selected instead of the Vector, only its first and last vertices will be used to get the vector direction +and the dialog preview will display the vector along which the object will be translated. \n TUI Command: geompy.MakeMultiTranslation2D(Shape, Dir1, Step1, NbTimes1, Dir2, Step2, NbTimes2), where \em Shape is a shape diff --git a/doc/salome/gui/GEOM/input/partition.doc b/doc/salome/gui/GEOM/input/partition.doc index 2b3b31eae..c58d6ed63 100644 --- a/doc/salome/gui/GEOM/input/partition.doc +++ b/doc/salome/gui/GEOM/input/partition.doc @@ -2,85 +2,104 @@ \page partition_page Partition -\n To produce a \b Partition in the Main Menu select Operations - > Partition +To produce a \b Partition in the Main Menu select Operations - > Partition -\n This operation builds a compound by intersection of several shapes +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. +The \b Result will be a \b GEOM_Object.

Intersection of two shapes.

\image html partition1.png -\n Arguments: Name + 2 lists of shapes (the shapes from the +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 +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 + +The Resulting 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: +For example, you partition a box (Solid) and a face (Face) +without any tool (the box is split in two parts by the shape). If you +choose the Resulting Type "Solid", you will +obtain a compound of two solids, but if you also check Keep shapes of lower +type checkbox, you will obtain a compound of two solids and one +face (there will be a hole in the resulting face, where the original +face intersects with the box, see the corresponding \ref partition_picture_3 "picture" below). + +No sub-shapes intersection (Compounds only) check box affects +only input shapes of the Compound type. If this option is switched off (default +behavior) each input compound will be automatically exploded into +sub-shapes and the intersection between these shapes will be also +computed. If this option is switched on, the intersection between +sub-shapes will not be performed. In this case the Partition algorithm +will work faster, but the result might differ from the default behavior. + + Advanced option: \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments". -\note Partition is a kind of complex operation, result of it depends - on the initial shapes quality. Sometimes, if partition fails, - some healing operations could help. Try Shape Processing - and Limit Tolerance in such cases. See also \ref - tui_limit_tolerance "TUI example" of shape healing. +\note Partition is a complex operation, so its result of it depends + on the quality of the initial shapes. Sometimes, if partition fails, + such healing operations as Shape Processing + and Limit Tolerance can help to attune source shapes to obtain correct result of the Partition. + See also \ref tui_limit_tolerance "TUI example" of shape healing. -\n TUI Command: geompy.MakePartition(ListOfShapes, -ListOfTools, ListOfKeepInside, ListOfRemoveInside, Limit, RemoveWebs, -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. +TUI Command (with sub-shapes intersection): -\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. +geompy.MakePartition(ListOfShapes, ListOfTools, ListOfKeepInside, +ListOfRemoveInside, Limit, RemoveWebs, ListOfMaterials, +KeepNonlimitShapes) +TUI Command (without sub-shapes intersection): + +geompy.MakePartitionNonSelfIntersectedShape(ListOfShapes, +ListOfTools, ListOfKeepInside, ListOfRemoveInside, Limit, RemoveWebs, +ListOfMaterials, KeepNonlimitShapes) + +Here, +- \em ListOfShapes is a list of shapes to be intersected +- \em ListOfTools is a list of shapes to intersect the shapes from +\em ListOfShapes +- \em Limit is a Type of resulting shapes +- \em KeepNonlimitShapes is a flag that allows to preserve standalone +shapes of low dimension (than \em Limit) in the result. +- Other parameters are obsolete and kept only for compatibility with +previous versions of SALOME.

Intersection of a Shape and a Plane.

\image html partition2.png -\n Arguments: Name + a list of shapes which will be intersected -+ 1 cutting plane. +Arguments: Name + 1 shape to be intersected + 1 cutting plane. -\n Advanced option: - \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments". +Advanced option: +\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments". + +TUI Command: -\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. +geompy.MakeHalfPartition(Shape, Plane), where: +- \em Shape is a source shape to be intersected by the \em Plane +- \em Plane is a tool shape, to intersect the \em Shape. -\n Example: +Examples: \image html partitionsn1.png "Box intersected by a plane" \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" +\image html partitionsn3.png "Result of intersection of a box and a +plane (both as \em Objects, no tools) with the Resulting type \em Solid and checked "Keep shapes of lower type" -Our TUI Scripts provide you with useful examples of the use of -\ref tui_partition "Basic Operations". +Our TUI Scripts provide you with useful examples of \ref tui_partition "Basic Operations". */ diff --git a/doc/salome/gui/GEOM/input/shape_processing_operation.doc b/doc/salome/gui/GEOM/input/shape_processing_operation.doc index 7d7c9a406..5aac5fd14 100644 --- a/doc/salome/gui/GEOM/input/shape_processing_operation.doc +++ b/doc/salome/gui/GEOM/input/shape_processing_operation.doc @@ -15,16 +15,16 @@ is a list of operators ("FixShape", "SplitClosedFaces", etc.), etc), \em Values is a list of values of parameters placed in the same order as in the list of Parameters. -\note Shape Processing is usefull not only on invalid shapes, - but sometimes also on shapes, that are classified as valid by - the Check functionality. Use it, if some operation (for +\note Shape Processing is useful not only on invalid shapes, + but also on the shapes, that are classified as valid by + the Check functionality. Use it, if an operation (for example, Partition) fails. Example of usage:
    -
  1. Try a partition on objects obj1 and obj2.
  2. +
  3. Try to partition objects obj1 and obj2.
  4. Partition fails.
  5. Perform Shape Processing on objects obj1 and obj2.
  6. -
  7. Try again the partition.
  8. +
  9. Try to partition them again.
See also \ref tui_limit_tolerance "TUI example". diff --git a/doc/salome/gui/GEOM/input/translation_operation.doc b/doc/salome/gui/GEOM/input/translation_operation.doc index 32958367d..98fe6808a 100644 --- a/doc/salome/gui/GEOM/input/translation_operation.doc +++ b/doc/salome/gui/GEOM/input/translation_operation.doc @@ -31,7 +31,9 @@ of the vector. \image html transformation2.png -\n Finally you can define an \b Object and the vector. The object will be translated by the length of the vector. +\n Finally you can define an \b Object and a vector. The object will be translated by the length of the vector. +If a curve has been selected instead of the vector, only its first and last vertices will be used to get the vector direction +and the dialog preview will display the vector along which the object will be translated. \n TUI Command: geompy.MakeTranslationVector(Object, Vector) \n Activate Distance checkbox and Distance field allow defining the custom distance of translation. \n TUI Command for translation by vector and custom distance: geompy.MakeTranslationVectorDistance(Object, Vector, Distance) diff --git a/doc/salome/gui/GEOM/input/tui_advanced_geom_objs.doc b/doc/salome/gui/GEOM/input/tui_advanced_geom_objs.doc index f9f402a7e..506e1039a 100644 --- a/doc/salome/gui/GEOM/input/tui_advanced_geom_objs.doc +++ b/doc/salome/gui/GEOM/input/tui_advanced_geom_objs.doc @@ -10,6 +10,10 @@ import geompy import salome gg = salome.ImportComponentGUI("GEOM") +# +# create edge by two points +# + # create vertices p0 = geompy.MakeVertex(0. , 0. , 0. ) pxyz = geompy.MakeVertex(100., 100., 100.) @@ -18,10 +22,30 @@ pxyz = geompy.MakeVertex(100., 100., 100.) edge = geompy.MakeEdge(p0, pxyz) # add object in the study -id_edge = geompy.addToStudy(edge,"Edge") +id_edge = geompy.addToStudy(edge,"Edge_1") + +# display an edge +gg.createAndDisplayGO(id_edge) + +# +# create edge from wire +# + +# create a circle +c = geompy.MakeCircle(None, None, 100) + +# create a wire +w = geompy.MakeWire([c], 1e-07) + +# create an edge from wire +edge = geompy.MakeEdgeWire(w) + +# add object in the study +id_edge = geompy.addToStudy(edge,"Edge_2") # display an edge gg.createAndDisplayGO(id_edge) + \endcode \anchor tui_creation_wire diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index 4cef6701a..7f37c359b 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -1313,6 +1313,17 @@ module GEOM */ GEOM_Object MakeEdge (in GEOM_Object thePnt1, in GEOM_Object thePnt2); + /*! + * Create an edge from specified wire. + * \param theWire source Wire. + * \param theLinearTolerance linear tolerance value + * \param theAngularTolerance angular tolerance value + * \return New GEOM_Object, containing the created edge. + */ + GEOM_Object MakeEdgeWire (in GEOM_Object theWire, + in double theLinearTolerance, + in double theAngularTolerance); + /*! * Create a wire from the set of edges and wires. * \param theEdgesAndWires List of edge and/or wires. diff --git a/resources/Makefile.am b/resources/Makefile.am index f8bc0a9dc..76368f05b 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -47,6 +47,7 @@ box2points.png \ boxdxyz.png \ build_compound.png \ build_edge.png \ +build_edge_wire.png \ build_face.png \ build_shell.png \ build_solid.png \ diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index 6dfae46c6..5c9ab11c0 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -70,8 +70,8 @@ BasicGUI_CircleDlg::BasicGUI_CircleDlg( GeometryGUI* theGeometryGUI, QWidget* pa GroupPntVecR = new DlgRef_2Sel1Spin( centralWidget() ); GroupPntVecR->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupPntVecR->TextLabel1->setText( tr( "GEOM_CENTER_POINT" ) + " (Origin by default)" ); - GroupPntVecR->TextLabel2->setText( tr( "GEOM_VECTOR" ) + " (Z axis by default)" ); + GroupPntVecR->TextLabel1->setText( tr( "GEOM_CENTER_POINT" ) + " " + tr( "GEOM_CENTER_DEFAULT" ) ); + GroupPntVecR->TextLabel2->setText( tr( "GEOM_VECTOR" ) + " " + tr( "GEOM_AXIS_DEFAULT" ) ); GroupPntVecR->TextLabel3->setText( tr( "GEOM_RADIUS" ) ); GroupPntVecR->PushButton1->setIcon( image1 ); GroupPntVecR->PushButton2->setIcon( image1 ); diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index 1f6993050..90af070cd 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -76,7 +76,8 @@ //================================================================================= BasicGUI_PointDlg::BasicGUI_PointDlg( GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl ) - : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl ) + : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl ), + myBusy ( false ) { QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT") ) ); QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT_EDGE" ) ) ); @@ -531,6 +532,8 @@ void BasicGUI_PointDlg::SelectionIntoArgument() if ( aShape.IsNull() || aShape.ShapeType() != myNeedType) return; + myBusy = true; + if ( id == GEOM_POINT_XYZ ) { gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) ); GroupXYZ->SpinBox_DX->setValue( aPnt.X() ); @@ -571,6 +574,7 @@ void BasicGUI_PointDlg::SelectionIntoArgument() myFace = aSelectedObject; GroupOnSurface->LineEdit1->setText( aName ); } + myBusy = false; } } @@ -637,6 +641,10 @@ void BasicGUI_PointDlg::SetEditCurrentArgument() GroupLineIntersection->LineEdit2->setEnabled(true); } send->setDown(true); + + if ( ( send == GroupLineIntersection->PushButton1 || + send == GroupLineIntersection->PushButton2 ) && !myBusy ) + SelectionIntoArgument(); } diff --git a/src/BasicGUI/BasicGUI_PointDlg.h b/src/BasicGUI/BasicGUI_PointDlg.h index 367391047..5f78bcf78 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.h +++ b/src/BasicGUI/BasicGUI_PointDlg.h @@ -82,6 +82,8 @@ private: GEOM::GEOM_Object_var myLine1; GEOM::GEOM_Object_var myLine2; + bool myBusy; + DlgRef_3Spin* GroupXYZ; DlgRef_1Sel3Spin* GroupRefPoint; DlgRef_1Sel1Spin* GroupOnCurve; diff --git a/src/BuildGUI/BuildGUI_CompoundDlg.cxx b/src/BuildGUI/BuildGUI_CompoundDlg.cxx index e71337972..24f18c622 100644 --- a/src/BuildGUI/BuildGUI_CompoundDlg.cxx +++ b/src/BuildGUI/BuildGUI_CompoundDlg.cxx @@ -113,6 +113,7 @@ void BuildGUI_CompoundDlg::Init() globalSelection( GEOM_ALLSHAPES ); initName( tr( "GEOM_COMPOUND" ) ); + SelectionIntoArgument(); } diff --git a/src/BuildGUI/BuildGUI_EdgeDlg.cxx b/src/BuildGUI/BuildGUI_EdgeDlg.cxx index 5096b2a7a..33e9f1e50 100644 --- a/src/BuildGUI/BuildGUI_EdgeDlg.cxx +++ b/src/BuildGUI/BuildGUI_EdgeDlg.cxx @@ -36,6 +36,7 @@ #include #include +#include //================================================================================= // class : BuildGUI_EdgeDlg() @@ -47,38 +48,58 @@ BuildGUI_EdgeDlg::BuildGUI_EdgeDlg (GeometryGUI* theGeometryGUI, QWidget* parent) : GEOMBase_Skeleton(theGeometryGUI, parent) { - QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_EDGE"))); - QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); + QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); + QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_EDGE"))); + QPixmap image2 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_EDGE_WIRE"))); setWindowTitle(tr("GEOM_EDGE_TITLE")); /***************************************************************/ mainFrame()->GroupConstructors->setTitle(tr("GEOM_EDGE")); - mainFrame()->RadioButton1->setIcon(image0); - mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose); - mainFrame()->RadioButton2->close(); - mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose); + mainFrame()->RadioButton1->setIcon(image1); + mainFrame()->RadioButton2->setIcon(image2); + mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); mainFrame()->RadioButton3->close(); - GroupPoints = new DlgRef_2Sel(centralWidget()); + // two points + GroupPoints = new DlgRef_2Sel(centralWidget()); GroupPoints->GroupBox1->setTitle(tr("GEOM_POINTS")); GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg(1)); GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg(2)); - GroupPoints->PushButton1->setIcon(image1); - GroupPoints->PushButton2->setIcon(image1); - + GroupPoints->PushButton1->setIcon(image0); + GroupPoints->PushButton2->setIcon(image0); GroupPoints->LineEdit1->setReadOnly(true); GroupPoints->LineEdit2->setReadOnly(true); + // wire + + GroupWire = new DlgRef_1Sel2Spin(centralWidget()); + GroupWire->GroupBox1->setTitle(tr("GEOM_WIRE")); + GroupWire->TextLabel1->setText(tr("GEOM_WIRE")); + GroupWire->PushButton1->setIcon(image0); + GroupWire->LineEdit1->setReadOnly(true); + GroupWire->TextLabel2->setText( tr( "GEOM_LINEAR_TOLERANCE" ) ); + GroupWire->TextLabel3->setText( tr( "GEOM_ANGULAR_TOLERANCE" ) ); + double SpecificStep = 0.0001; + double prec1 = Precision::Confusion(); + double prec2 = Precision::Angular(); + initSpinBox(GroupWire->SpinBox_DX, prec1, MAX_NUMBER, SpecificStep, "len_tol_precision" ); + initSpinBox(GroupWire->SpinBox_DY, prec2, MAX_NUMBER, SpecificStep, "ang_tol_precision" ); + GroupWire->SpinBox_DX->setValue(prec1); + GroupWire->SpinBox_DY->setValue(prec2); + + // layout + QVBoxLayout* layout = new QVBoxLayout(centralWidget()); layout->setMargin(0); layout->setSpacing(6); layout->addWidget(GroupPoints); + layout->addWidget(GroupWire); /***************************************************************/ setHelpFileName("create_edge_page.html"); - // Initialisation + // initialisation Init(); } @@ -98,28 +119,35 @@ BuildGUI_EdgeDlg::~BuildGUI_EdgeDlg() void BuildGUI_EdgeDlg::Init() { // init variables - GroupPoints->LineEdit1->setReadOnly(true); - GroupPoints->LineEdit2->setReadOnly(true); - - GroupPoints->LineEdit1->setText(""); - GroupPoints->LineEdit2->setText(""); - myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil(); - myOkPoint1 = myOkPoint2 = false; + myPoint1 = myPoint2 = myWire = GEOM::GEOM_Object::_nil(); + myEditCurrentArgument = GroupPoints->LineEdit1; + GroupPoints->PushButton1->setDown(true); + globalSelection(); // close local contexts, if any + localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); // signals and slots connections + connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ); + connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ); + + connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) ); + connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + connect(GroupWire->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupWire->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); initName(tr("GEOM_EDGE")); - GroupPoints->PushButton1->click(); - SelectionIntoArgument(); + ConstructorsClicked( 0 ); } //================================================================================= @@ -142,11 +170,60 @@ bool BuildGUI_EdgeDlg::ClickOnApply() return false; initName(); - // activate selection and connect selection manager - GroupPoints->PushButton1->click(); + + myEditCurrentArgument->setText( "" ); + ConstructorsClicked( getConstructorId() ); + return true; } +//================================================================================= +// function : ConstructorsClicked() +// purpose : Radio button management +//================================================================================= +void BuildGUI_EdgeDlg::ConstructorsClicked( int constructorId ) +{ + switch ( constructorId ) { + case 0: + { + globalSelection(); // close local contexts, if any + localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); + + myEditCurrentArgument = GroupPoints->LineEdit1; + GroupPoints->LineEdit1->setText( "" ); + GroupPoints->LineEdit2->setText( "" ); + myPoint1 = GEOM::GEOM_Object::_nil(); + myPoint2 = GEOM::GEOM_Object::_nil(); + GroupPoints->PushButton1->setDown(true); + GroupPoints->PushButton2->setDown(false); + GroupPoints->LineEdit1->setEnabled(true); + GroupPoints->LineEdit2->setEnabled(false); + GroupPoints->show(); + GroupWire->hide(); + break; + } + case 1: + { + globalSelection(); // close local contexts, if any + localSelection( GEOM::GEOM_Object::_nil(), TopAbs_WIRE ); + + myEditCurrentArgument = GroupWire->LineEdit1; + GroupWire->LineEdit1->setText(""); + myWire = GEOM::GEOM_Object::_nil(); + GroupWire->PushButton1->setDown(true); + GroupWire->LineEdit1->setEnabled(true); + GroupPoints->hide(); + GroupWire->show(); + break; + } + } + + qApp->processEvents(); + updateGeometry(); + resize( minimumSizeHint() ); + SelectionIntoArgument(); +} + //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection is changed or on dialog initialization or activation @@ -161,38 +238,67 @@ void BuildGUI_EdgeDlg::SelectionIntoArgument() aSelMgr->selectedObjects(aSelList); if (aSelList.Extent() != 1) { - if (myEditCurrentArgument == GroupPoints->LineEdit1) - myOkPoint1 = false; - else if (myEditCurrentArgument == GroupPoints->LineEdit2) - myOkPoint2 = false; + if (myEditCurrentArgument == GroupPoints->LineEdit1) myPoint1 = GEOM::GEOM_Object::_nil(); + else if (myEditCurrentArgument == GroupPoints->LineEdit2) myPoint2 = GEOM::GEOM_Object::_nil(); + else if (myEditCurrentArgument == GroupWire->LineEdit1) myWire = GEOM::GEOM_Object::_nil(); + displayPreview(); return; } // nbSel == 1 Standard_Boolean testResult = Standard_False; GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); - if (!testResult || aSelectedObject->_is_nil()) - return; - - myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject)); - // clear selection - disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); - myGeomGUI->getApp()->selectionMgr()->clearSelected(); - connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), - this, SLOT(SelectionIntoArgument())); - - if (myEditCurrentArgument == GroupPoints->LineEdit1) { - myPoint1 = aSelectedObject; - myOkPoint1 = true; - if (!myOkPoint2) - GroupPoints->PushButton2->click(); - } - else if (myEditCurrentArgument == GroupPoints->LineEdit2) { - myPoint2 = aSelectedObject; - myOkPoint2 = true; - if (!myOkPoint1) - GroupPoints->PushButton1->click(); + if ( testResult && !aSelectedObject->_is_nil() ) { + QString aName = GEOMBase::GetName( aSelectedObject ); + TopAbs_ShapeEnum aNeedType = myEditCurrentArgument == GroupWire->LineEdit1 ? TopAbs_WIRE : TopAbs_VERTEX; + + TopoDS_Shape aShape; + if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) { + TColStd_IndexedMapOfInteger aMap; + aSelMgr->GetIndexes( aSelList.First(), aMap ); + if ( aMap.Extent() == 1 ) { // Local Selection + int anIndex = aMap( 1 ); + aName += ( aNeedType == TopAbs_WIRE ? QString( ":wire_%1" ).arg( anIndex ) : QString( ":vertex_%1" ).arg( anIndex ) ); + + //Find SubShape Object in Father + GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName ); + if ( CORBA::is_nil( aFindedObject ) ) { // Object not found in study + GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); + aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex ); + } + else { + aSelectedObject = aFindedObject; // get Object from study + } + } + else { // Global Selection + if ( aShape.ShapeType() != aNeedType ) { + aSelectedObject = GEOM::GEOM_Object::_nil(); + aName = ""; + } + } + } + + myEditCurrentArgument->setText( aName ); + + if (!aSelectedObject->_is_nil()) { // clear selection if something selected + globalSelection(); + localSelection( GEOM::GEOM_Object::_nil(), aNeedType ); + } + + if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { + myPoint1 = aSelectedObject; + if ( !myPoint1->_is_nil() && myPoint2->_is_nil() ) + GroupPoints->PushButton2->click(); + } + else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) { + myPoint2 = aSelectedObject; + if ( !myPoint2->_is_nil() && myPoint1->_is_nil() ) + GroupPoints->PushButton1->click(); + } + else if ( myEditCurrentArgument == GroupWire->LineEdit1 ) { + myWire = aSelectedObject; + } } displayPreview(); @@ -205,7 +311,6 @@ void BuildGUI_EdgeDlg::SelectionIntoArgument() void BuildGUI_EdgeDlg::SetEditCurrentArgument() { QPushButton* send = (QPushButton*)sender(); - //globalSelection();//?? if (send == GroupPoints->PushButton1) { myEditCurrentArgument = GroupPoints->LineEdit1; @@ -217,19 +322,14 @@ void BuildGUI_EdgeDlg::SetEditCurrentArgument() GroupPoints->PushButton1->setDown(false); GroupPoints->LineEdit1->setEnabled(false); } + else if (send == GroupWire->PushButton1) { + myEditCurrentArgument = GroupWire->LineEdit1; + } // enable line edit myEditCurrentArgument->setEnabled(true); myEditCurrentArgument->setFocus(); - // after setFocus(), because it will be setDown(false) when loses focus send->setDown(true); - - disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); - globalSelection(GEOM_POINT); - connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), - this, SLOT(SelectionIntoArgument())); - - // seems we need it only to avoid preview disappearing, caused by selection mode change displayPreview(); } @@ -240,7 +340,7 @@ void BuildGUI_EdgeDlg::SetEditCurrentArgument() void BuildGUI_EdgeDlg::LineEditReturnPressed() { QLineEdit* send = (QLineEdit*)sender(); - if (send == GroupPoints->LineEdit1 || send == GroupPoints->LineEdit2) { + if (send == GroupPoints->LineEdit1 || send == GroupPoints->LineEdit2 || send == GroupWire->LineEdit1 ) { myEditCurrentArgument = send; GEOMBase_Skeleton::LineEditReturnPressed(); } @@ -257,7 +357,7 @@ void BuildGUI_EdgeDlg::ActivateThisDialog() connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - displayPreview(); + ConstructorsClicked( getConstructorId() ); } //================================================================================= @@ -283,9 +383,18 @@ GEOM::GEOM_IOperations_ptr BuildGUI_EdgeDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool BuildGUI_EdgeDlg::isValid (QString&) +bool BuildGUI_EdgeDlg::isValid (QString& msg) { - return myOkPoint1 && myOkPoint2; + bool ok = false; + if ( getConstructorId() == 0 ) { + ok = !myPoint1->_is_nil() && !myPoint2->_is_nil(); + } + else { + ok = !myWire->_is_nil(); + ok = ok && GroupWire->SpinBox_DX->isValid( msg, !IsPreview() ); + ok = ok && GroupWire->SpinBox_DY->isValid( msg, !IsPreview() ); + } + return ok; } //================================================================================= @@ -294,11 +403,57 @@ bool BuildGUI_EdgeDlg::isValid (QString&) //================================================================================= bool BuildGUI_EdgeDlg::execute (ObjectList& objects) { + bool res = false; + GEOM::GEOM_Object_var anObj; + GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() ); - GEOM::GEOM_Object_var anObj = anOper->MakeEdge(myPoint1, myPoint2); - if (!anObj->_is_nil()) - objects.push_back(anObj._retn()); + switch ( getConstructorId() ) { + case 0 : + { + anObj = anOper->MakeEdge( myPoint1, myPoint2 ); + res = true; + break; + } + case 1: + { + double aLinearTolerance = GroupWire->SpinBox_DX->value(); + double anAngularTolerance = GroupWire->SpinBox_DY->value(); + + QStringList aParameters; + aParameters << GroupWire->SpinBox_DX->text(); + aParameters << GroupWire->SpinBox_DY->text(); + + anObj = anOper->MakeEdgeWire( myWire, aLinearTolerance, anAngularTolerance ); + + if ( !anObj->_is_nil() && !IsPreview() ) + anObj->SetParameters( aParameters.join(":").toLatin1().constData() ); + + res = true; + break; + } + } - return true; + if ( !anObj->_is_nil() ) objects.push_back( anObj._retn() ); + + return res; +} + +//================================================================================= +// function : addSubshapeToStudy +// purpose : virtual method to add new SubObjects if local selection +//================================================================================= +void BuildGUI_EdgeDlg::addSubshapesToStudy() +{ + QMap objMap; + switch ( getConstructorId() ) { + case 0 : + objMap[GroupPoints->LineEdit1->text()] = myPoint1; + objMap[GroupPoints->LineEdit2->text()] = myPoint2; + break; + case 1 : + objMap[GroupWire->LineEdit1->text()] = myWire; + break; + } + addSubshapesToFather( objMap ); } diff --git a/src/BuildGUI/BuildGUI_EdgeDlg.h b/src/BuildGUI/BuildGUI_EdgeDlg.h index 1f95ea865..f6e09236f 100644 --- a/src/BuildGUI/BuildGUI_EdgeDlg.h +++ b/src/BuildGUI/BuildGUI_EdgeDlg.h @@ -29,6 +29,7 @@ #include +class DlgRef_1Sel2Spin; class DlgRef_2Sel; //================================================================================= @@ -48,19 +49,21 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); + virtual void addSubshapesToStudy(); private: void Init(); void enterEvent( QEvent* ); private: - GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points containing the edge */ - bool myOkPoint1; /* true when myPoint is defined */ - bool myOkPoint2; + GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points containing the edge */ + GEOM::GEOM_Object_var myWire; /* Wire */ DlgRef_2Sel* GroupPoints; + DlgRef_1Sel2Spin* GroupWire; private slots: + void ConstructorsClicked( int ); void ClickOnOk(); bool ClickOnApply(); void ActivateThisDialog(); diff --git a/src/BuildGUI/BuildGUI_SolidDlg.cxx b/src/BuildGUI/BuildGUI_SolidDlg.cxx index 05814b272..4f29cfcff 100644 --- a/src/BuildGUI/BuildGUI_SolidDlg.cxx +++ b/src/BuildGUI/BuildGUI_SolidDlg.cxx @@ -117,6 +117,7 @@ void BuildGUI_SolidDlg::Init() SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); initName( tr( "GEOM_SOLID" ) ); + SelectionIntoArgument(); } diff --git a/src/DlgRef/DlgRef.cxx b/src/DlgRef/DlgRef.cxx index 9bd1c3fb3..1ff6c6b87 100644 --- a/src/DlgRef/DlgRef.cxx +++ b/src/DlgRef/DlgRef.cxx @@ -288,6 +288,20 @@ DlgRef_2Sel1List1Check::~DlgRef_2Sel1List1Check() { } +////////////////////////////////////////// +// DlgRef_2Sel1List2Check +////////////////////////////////////////// + +DlgRef_2Sel1List2Check::DlgRef_2Sel1List2Check( QWidget* parent, Qt::WindowFlags f ) +: QWidget( parent, f ) +{ + setupUi( this ); +} + +DlgRef_2Sel1List2Check::~DlgRef_2Sel1List2Check() +{ +} + ////////////////////////////////////////// // DlgRef_2Sel1List ////////////////////////////////////////// diff --git a/src/DlgRef/DlgRef.h b/src/DlgRef/DlgRef.h index 642aba629..a7b31a945 100644 --- a/src/DlgRef/DlgRef.h +++ b/src/DlgRef/DlgRef.h @@ -339,6 +339,22 @@ public: ~DlgRef_2Sel1List1Check(); }; +////////////////////////////////////////// +// DlgRef_2Sel1List2Check +////////////////////////////////////////// + +#include "ui_DlgRef_2Sel1List2Check_QTD.h" + +class DLGREF_EXPORT DlgRef_2Sel1List2Check : public QWidget, + public Ui::DlgRef_2Sel1List2Check_QTD +{ + Q_OBJECT + +public: + DlgRef_2Sel1List2Check( QWidget* = 0, Qt::WindowFlags = 0 ); + ~DlgRef_2Sel1List2Check(); +}; + ////////////////////////////////////////// // DlgRef_2Sel1List ////////////////////////////////////////// diff --git a/src/DlgRef/DlgRef_2Sel1List2Check_QTD.ui b/src/DlgRef/DlgRef_2Sel1List2Check_QTD.ui new file mode 100644 index 000000000..8cc018c02 --- /dev/null +++ b/src/DlgRef/DlgRef_2Sel1List2Check_QTD.ui @@ -0,0 +1,151 @@ + + + DlgRef_2Sel1List2Check_QTD + + + + 0 + 0 + 127 + 140 + + + + + + + + 0 + + + 0 + + + + + + + + + + + + 0 + 0 + + + + TL1 + + + false + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + 0 + 0 + + + + TL2 + + + false + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + 0 + 0 + + + + TL3 + + + false + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + qPixmapFromMimeSource + + PushButton1 + LineEdit1 + PushButton2 + LineEdit2 + ComboBox1 + CheckButton1 + CheckButton2 + + + + diff --git a/src/DlgRef/Makefile.am b/src/DlgRef/Makefile.am index 0aadfc72d..f7af410b2 100644 --- a/src/DlgRef/Makefile.am +++ b/src/DlgRef/Makefile.am @@ -55,6 +55,7 @@ UIC_FILES = \ ui_DlgRef_1SelExt_QTD.h \ ui_DlgRef_1Spin_QTD.h \ ui_DlgRef_2Sel1List1Check_QTD.h \ + ui_DlgRef_2Sel1List2Check_QTD.h \ ui_DlgRef_2Sel1List_QTD.h \ ui_DlgRef_2Sel1Spin2Check_QTD.h \ ui_DlgRef_2Sel1Spin_QTD.h \ diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index b0ea5a0c2..f3607e52f 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -189,10 +189,12 @@ GEOM_Engine::GEOM_Engine() GEOM_Engine::~GEOM_Engine() { GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It(_objects); + std::list< Handle(GEOM_Object) > objs; for(; It.More(); It.Next()) - { - RemoveObject(Handle(GEOM_Object)::DownCast(It.Value())); - } + objs.push_back( Handle(GEOM_Object)::DownCast(It.Value()) ); + std::list< Handle(GEOM_Object) >::iterator objit; + for(objit = objs.begin(); objit != objs.end(); ++objit) + RemoveObject(*objit); //Close all documents not closed for(Interface_DataMapIteratorOfDataMapOfIntegerTransient anItr(_mapIDDocument); anItr.More(); anItr.Next()) @@ -403,7 +405,9 @@ bool GEOM_Engine::RemoveObject(Handle(GEOM_Object) theObject) Handle(GEOM_Function) aFunction = theObject->GetFunction(1); GEOM_ISubShape aSSI (aFunction); Handle(GEOM_Function) aMainShape = aSSI.GetMainShape(); - aMainShape->RemoveSubShapeReference(aFunction); + //If main shape is not null, then remove + if(!aMainShape.IsNull()) + aMainShape->RemoveSubShapeReference(aFunction); } int nb = theObject->GetNbFunctions(); diff --git a/src/GEOMAlgo/GEOMAlgo_WESCorrector.cxx b/src/GEOMAlgo/GEOMAlgo_WESCorrector.cxx index 77ecf1947..4ee7d7a69 100755 --- a/src/GEOMAlgo/GEOMAlgo_WESCorrector.cxx +++ b/src/GEOMAlgo/GEOMAlgo_WESCorrector.cxx @@ -26,7 +26,11 @@ // #include +#include + +#include #include + #include #include #include @@ -34,6 +38,7 @@ #include #include +#include #include #include @@ -54,16 +59,15 @@ #include #include - static void MakeWire(const TopTools_ListOfShape& aLE, TopoDS_Wire& newWire); -//modified by NIZNHY-PKV Thu Jun 10 11:26:55 2010f + static Standard_Boolean IsToScale(const TopoDS_Face& aF, Standard_Real& aScale); -//modified by NIZNHY-PKV Thu Jun 10 11:27:02 2010t + //======================================================================= // function: // purpose: @@ -227,7 +231,14 @@ static } // if (bRegular) { - TopExp::MapShapesAndAncestors(aER, TopAbs_VERTEX, TopAbs_EDGE, aMVER); + //modified by NIZNHY-PKV Wed Oct 20 14:45:52 2010f + const TopoDS_Edge& aEx=*((TopoDS_Edge*)&aER); + if (!BRep_Tool::Degenerated(aEx)) { + TopExp::MapShapesAndAncestors(aER, TopAbs_VERTEX, TopAbs_EDGE, aMVER); + } + // + //TopExp::MapShapesAndAncestors(aER, TopAbs_VERTEX, TopAbs_EDGE, aMVER); + //modified by NIZNHY-PKV Wed Oct 20 14:46:48 2010t } }//for (j=1; j<=aNbC; ++j) { // @@ -274,9 +285,8 @@ static GEOMAlgo_WESScaler aWSC; // const TopoDS_Face& aF=myWES->Face(); - //modified by NIZNHY-PKV Thu Jun 10 11:27:45 2010f + // bToScale=IsToScale(aF, aScale); - //modified by NIZNHY-PKV Thu Jun 10 11:27:49 2010t // myNewWES.SetFace(aF); aCBIt.Initialize(myConnexityBlocks); @@ -293,7 +303,6 @@ static // GEOMAlgo_WireSplitter aWS; // - //modified by NIZNHY-PKV Thu Jun 10 10:40:43 2010f if(bToScale) { TopoDS_Shape aE; TopTools_ListIteratorOfListOfShape aIt; @@ -345,7 +354,6 @@ static myNewWES.AddShape (aW); } }//if(bToScale) - //modified by NIZNHY-PKV Thu Jun 10 10:40:48 2010t // else { aWS.SetFace(aF); @@ -392,11 +400,7 @@ static } } // -//modified by NIZNHY-PKV Thu Jun 10 11:14:09 2010f -#include -#include -#include //======================================================================= //function : IsToScale @@ -427,5 +431,4 @@ Standard_Boolean IsToScale(const TopoDS_Face& aF, } return bRet; } -//modified by NIZNHY-PKV Thu Jun 10 11:14:12 2010t diff --git a/src/GEOMBase/GEOMBase.cxx b/src/GEOMBase/GEOMBase.cxx index 6cbf4f374..efd69ff3c 100644 --- a/src/GEOMBase/GEOMBase.cxx +++ b/src/GEOMBase/GEOMBase.cxx @@ -893,7 +893,7 @@ GEOM::GEOM_Object_ptr GEOMBase::GetObjectFromIOR( const char* theIOR ) // function : GetIORFromObject() // purpose : returns IOR of a given GEOM_Object //======================================================================= -char* GEOMBase::GetIORFromObject( const GEOM::GEOM_Object_ptr& theObject ) +QString GEOMBase::GetIORFromObject( const GEOM::GEOM_Object_ptr& theObject ) { if ( CORBA::is_nil( theObject ) ) return NULL; diff --git a/src/GEOMBase/GEOMBase.h b/src/GEOMBase/GEOMBase.h index e1bd56882..fb846fe3c 100644 --- a/src/GEOMBase/GEOMBase.h +++ b/src/GEOMBase/GEOMBase.h @@ -90,7 +90,7 @@ public : static GEOM::GEOM_Object_ptr GetObjectFromIOR(const char* theIOR); - static char* GetIORFromObject(const GEOM::GEOM_Object_ptr& theObject); + static QString GetIORFromObject(const GEOM::GEOM_Object_ptr& theObject); /* Geometry */ static bool VertexToPoint(const TopoDS_Shape& S, gp_Pnt& P); diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index 64bdc325f..de5f92978 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -170,9 +170,10 @@ void GEOMBase_Helper::erase( const ObjectList& objList, const bool updateView ) void GEOMBase_Helper::erase( GEOM::GEOM_Object_ptr object, const bool updateView ) { if ( !object->_is_nil() ) { - std::string entry = getEntry( object ); + QString entry = getEntry( object ); getDisplayer()->Erase( new SALOME_InteractiveObject( - entry.c_str(), "GEOM", strdup( GEOMBase::GetName( object ).toLatin1().constData() ) ), true, updateView ); + entry.toLatin1().constData(), + "GEOM", strdup( GEOMBase::GetName( object ).toLatin1().constData() ) ), true, updateView ); } } @@ -209,9 +210,9 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object, // Enable activisation of selection getDisplayer()->SetToActivate( true ); - std::string entry = getEntry( object ); + QString entry = getEntry( object ); getDisplayer()->Redisplay(new SALOME_InteractiveObject - (entry.c_str(), "GEOM", strdup(GEOMBase::GetName(object).toLatin1().constData())), false); + (entry.toLatin1().constData(), "GEOM", strdup(GEOMBase::GetName(object).toLatin1().constData())), false); } if ( withChildren ) { @@ -227,9 +228,9 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object, (GeometryGUI::ClientSObjectToObject(anIt->Value())); if ( !CORBA::is_nil( aChild ) ) { if ( !aChild->_is_nil() ) { - std::string entry = getEntry( aChild ); + QString entry = getEntry( aChild ); getDisplayer()->Redisplay( new SALOME_InteractiveObject( - entry.c_str(), "GEOM", strdup( GEOMBase::GetName( aChild ).toLatin1().constData() ) ), false ); + entry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( aChild ).toLatin1().constData() ) ), false ); } } } @@ -449,10 +450,10 @@ void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMo GEOM::GEOM_Object_ptr anObj = *anIter; if ( anObj->_is_nil() ) continue; - std::string aEntry = getEntry( anObj ); - if ( aEntry != "" ) + QString anEntry = getEntry( anObj ); + if ( anEntry != "" ) aListOfIO.Append( new SALOME_InteractiveObject( - aEntry.c_str(), "GEOM", strdup( GEOMBase::GetName( anObj ).toLatin1().constData() ) ) ); + anEntry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( anObj ).toLatin1().constData() ) ) ); } getDisplayer()->LocalSelection( aListOfIO, theMode ); @@ -619,21 +620,18 @@ SalomeApp_Study* GEOMBase_Helper::getStudy() const // Function : getEntry // Purpose : //================================================================ -char* GEOMBase_Helper::getEntry( GEOM::GEOM_Object_ptr object ) const +QString GEOMBase_Helper::getEntry( GEOM::GEOM_Object_ptr object ) const { SalomeApp_Study* study = getStudy(); if ( study ) { - char * objIOR = GEOMBase::GetIORFromObject( object ); - std::string IOR( objIOR ); - free( objIOR ); - if ( IOR != "" ) { - _PTR(SObject) SO ( study->studyDS()->FindObjectIOR( IOR ) ); - if ( SO ) { - return (char*) TCollection_AsciiString((char*)SO->GetID().c_str()).ToCString(); - } + QString objIOR = GEOMBase::GetIORFromObject( object ); + if ( objIOR != "" ) { + _PTR(SObject) SO ( study->studyDS()->FindObjectIOR( objIOR.toLatin1().constData() ) ); + if ( SO ) + return QString::fromStdString(SO->GetID()); } } - return (char*)""; + return ""; } //================================================================ @@ -1025,9 +1023,8 @@ bool GEOMBase_Helper::selectObjects( ObjectList& objects ) ObjectList::iterator anIter; for ( anIter = objects.begin(); anIter != objects.end(); ++anIter ) { - std::string entry = getEntry( *anIter ); - QString aEntry( entry.c_str() ); - LightApp_DataOwner* anOwher = new LightApp_DataOwner( aEntry ); + QString anEntry = getEntry( *anIter ); + LightApp_DataOwner* anOwher = new LightApp_DataOwner( anEntry ); aList.append( anOwher ); } @@ -1057,8 +1054,8 @@ GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather (GEOM::GEOM_Object_ptr dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); _PTR(Study) aDStudy = appStudy->studyDS(); - std::string IOR = GEOMBase::GetIORFromObject( theFather ); - _PTR(SObject) SObj ( aDStudy->FindObjectIOR( IOR ) ); + QString IOR = GEOMBase::GetIORFromObject( theFather ); + _PTR(SObject) SObj ( aDStudy->FindObjectIOR( IOR.toLatin1().constData() ) ); bool inStudy = false; GEOM::GEOM_Object_var aReturnObject; @@ -1104,11 +1101,11 @@ void GEOMBase_Helper::addSubshapesToFather( QMap if ( !anOp->_is_nil() ) { GEOM::GEOM_Object_var aFatherObj = anOp->GetMainShape( it.value() ); if ( !aFatherObj->_is_nil() ) { - std::string aFatherEntry = getEntry( aFatherObj ); + QString aFatherEntry = getEntry( aFatherObj ); if ( aFatherEntry != "") { // additional checking that object is valid 0020598 EDF 1191 GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aFatherObj, it.key().toLatin1().data() ); //Add Object to study if its not exist - if ( aFindedObject->_is_nil() ) + if ( aFindedObject->_is_nil() ) GeometryGUI::GetGeomGen()->AddInStudy(GeometryGUI::ClientStudyToStudy(aDStudy), it.value(), it.key().toLatin1().data(), aFatherObj ); } diff --git a/src/GEOMBase/GEOMBase_Helper.h b/src/GEOMBase/GEOMBase_Helper.h index b8e12adba..0a3fc2914 100755 --- a/src/GEOMBase/GEOMBase_Helper.h +++ b/src/GEOMBase/GEOMBase_Helper.h @@ -177,7 +177,7 @@ protected: SUIT_Desktop* getDesktop() const; private: - char* getEntry ( GEOM::GEOM_Object_ptr ) const; + QString getEntry( GEOM::GEOM_Object_ptr ) const; void clearShapeBuffer( GEOM::GEOM_Object_ptr ); private: diff --git a/src/GEOMGUI/GEOM_images.ts b/src/GEOMGUI/GEOM_images.ts index e41de1d95..e0dd7d86c 100644 --- a/src/GEOMGUI/GEOM_images.ts +++ b/src/GEOMGUI/GEOM_images.ts @@ -109,6 +109,10 @@ ICON_DLG_BUILD_EDGE build_edge.png + + ICON_DLG_BUILD_EDGE_WIRE + build_edge_wire.png + ICON_DLG_BUILD_FACE build_face.png diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 01b728a30..3ddd7f470 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -277,10 +277,15 @@ Please, select face, shell or solid and try again GEOM_CENTER Center + + GEOM_CENTER_DEFAULT + (Origin by default) + GEOM_CENTER_POINT Center Point + GEOM_CENTRAL_POINT Central Point @@ -555,15 +560,15 @@ Please, select face, shell or solid and try again GEOM_EXTRUSION_BSV - Base Shape + Vector + Base Shapes + Vector GEOM_EXTRUSION_BSV_2P - Base Shape + 2 Points + Base Shapes + 2 Points GEOM_EXTRUSION_DXDYDZ - Base Shape + DX DY DZ Vector + Base Shapes + DX DY DZ Vector GEOM_EXTRUSION_TITLE @@ -1821,6 +1826,14 @@ Please, select face, shell or solid and try again GEOM_TOLERANCE Tolerance + + GEOM_LINEAR_TOLERANCE + Linear Tolerance + + + GEOM_ANGULAR_TOLERANCE + Angular Tolerance + GEOM_TOLERANCE_CONSTR Object And Its Tolerances @@ -1897,6 +1910,11 @@ Please, select face, shell or solid and try again GEOM_VECTOR Vector + + GEOM_AXIS_DEFAULT + (Z axis by default) + + GEOM_VECTOR_LENGTH Vector Length : @@ -3777,6 +3795,10 @@ Please, select face, shell or solid and try again GEOM_KEEP_NONLIMIT_SHAPES Keep shapes of lower type + + GEOM_NO_SELF_INTERSECTION + No sub-shapes intersection (Compounds only) + GEOM_CENTER_2POINTS Center and two points @@ -4132,6 +4154,10 @@ Input value precision can be adjusted using JUNCTION_FACE_3 Junction 3 + + GEOM_PLUGINS_OTHER + Other + BasicGUI_CurveDlg @@ -4374,6 +4400,18 @@ Number of sketch points too small REMOVE Remove + + SHOW_ONLY_SELECTED + Show only selected + + + HIDE_SELECTED + Hide selected + + + SHOW_ALL_SUB_SHAPES + Show all sub-shapes + SELECT_ALL Select All diff --git a/src/GEOMGUI/GEOM_msg_fr.ts b/src/GEOMGUI/GEOM_msg_fr.ts index 55c113af8..33bff63ba 100644 --- a/src/GEOMGUI/GEOM_msg_fr.ts +++ b/src/GEOMGUI/GEOM_msg_fr.ts @@ -13,7 +13,7 @@ CLOSE_CONTOUR_NEW_OBJ_NAME - FermerContour + ContourFerme DEP_OBJECT @@ -27,7 +27,7 @@ Il n'est pas possible de le supprimer ERROR_SHAPE_TYPE Le type de l'objet choisi n'est pas correct! -Choisissez face, coque ou solide et essayez de nouveau +Choisissez une face, une coque ou un solide et essayez de nouveau iErr : 10 @@ -39,15 +39,15 @@ Choisissez face, coque ou solide et essayez de nouveau iErr : 12 - Un type de sous-forme pas authorisé + Type d'objet non autoriqé iErr : 13 - Cet état n'est pas authorisé + Cet état n'est pas autorisé iErr : 15 - Ce type de surface n'est pas authorisé + Ce type de surface n'est pas autorisé iErr : 20 @@ -123,7 +123,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_ARC_TITLE - Construction Arc + Construction d'un arc GEOM_ARGUMENTS @@ -131,7 +131,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_AXE_MIRROR - Axe Miroir + Axe de symétrie GEOM_AXIS @@ -159,7 +159,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_BLOCK - Solide Hexahédral + Solide Hexaédrique GEOM_BLOCKS_COMPOUND @@ -191,11 +191,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_BLOCK_TITLE - Construction d'un Solide Hexahédral + Construction d'un solide hexaédrique GEOM_BNDBOX - Boîte Englonante + Boîte Englobante GEOM_BNDBOX_OBJDIM @@ -215,7 +215,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_BOX_TITLE - Construction d'une Boite + Construction d'une Boîte GEOM_BSplineRestriction @@ -235,15 +235,15 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_BUT_CLOSE_SKETCH - Renfermer le Contour + Fermer le contour et valider GEOM_BUT_END_SKETCH - Valider le Contour + Valider l'esquisse GEOM_BUT_EXPLODE - &Eclatement + &Eclater GEOM_BUT_HELP @@ -277,6 +277,10 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_CENTER Centre + + GEOM_CENTER_DEFAULT + (Origine par défaut) + GEOM_CENTER_POINT Point Central @@ -307,11 +311,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_CHAMFER_TITLE - Construction d'un Chanfrain + Construction d'un Chanfrein GEOM_CHANGE_ORIENTATION - Les objets à changer l'orientation + Objets à modifier GEOM_CHANGE_ORIENTATION_TITLE @@ -319,11 +323,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_CHECK_BLOCKS_COMPOUND - Check and Improve Blocks Compound + Controler un Assemblage de Blocs GEOM_CHECK_BLOCKS_COMPOUND_FAILED - Vérification n'a pas abouti + La vérification n'a pas abouti GEOM_CHECK_BLOCKS_COMPOUND_ERRORS @@ -331,15 +335,15 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_CHECK_BLOCKS_COMPOUND_HAS_ERRORS - Il y a d'erreurs dans l'Assemblage des Bloques + L'Assemblage de Blocs contient des erreurs GEOM_CHECK_BLOCKS_COMPOUND_HAS_NO_ERRORS - Il n'y a pas d'erreurs dans l'Assemblage des Bloques + L'Assemblage de Blocs n'a pas d'erreur GEOM_CHECK_BLOCKS_COMPOUND_SUBSHAPES - Sous-Formes augmentées + Sous-objets incriminés GEOM_CHECK_INFOS @@ -347,11 +351,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_CHECK_SHAPE - Vérifier la forme + Contrôler un objet GEOM_CHECK_TITLE - Vérifier l'Information de la Forme + Contrôler la validité de l'objet GEOM_CIRCLE @@ -359,7 +363,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_CIRCLE_TITLE - Construction d'un Circle + Construction d'un Cercle GEOM_CLOSECONTOUR_TITLE @@ -367,19 +371,19 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_CMASS - Centre de la Masse + Centre de Gravité GEOM_CMASS_TITLE - Construction du Centre de la Masse + Construction du Centre de Gravité GEOM_COMMON - Commun + Intersection GEOM_COMMON_TITLE - Commun de deux Objets + Intersection de deux Objets GEOM_COMPOUND @@ -407,7 +411,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_CONFIRM_INFO - La forme contient %1 sous-formes ! + L'objet contient %1 sous-objets ! GEOM_COOR @@ -427,7 +431,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_CREATE_SINGLE_SOLID - Créer un solide + Créer un solide unique GEOM_CURVE @@ -467,7 +471,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_DETECT - Detecter + Détecter GEOM_DIAGONAL_POINTS @@ -507,7 +511,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_DropSmallEdges - OmettreArêtesMineures + ArêtesMineuresOmises GEOM_EDGE @@ -523,11 +527,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_ELLIPSE_ERROR_1 - Impossible de créer un ellipse: le rayon mineur est plus que le rayon majeur. + Impossible de créer un ellipse: le demi petit axe est plus grand que le demi grand axe. GEOM_ELLIPSE_TITLE - Construction d'un Ellipse + Construction d'une Ellipse GEOM_END_LCS @@ -555,15 +559,15 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_EXTRUSION_BSV - Forme de Base + Vecteur + Formes de Base + Vecteur GEOM_EXTRUSION_BSV_2P - Forme de Base + 2 Points + Formes de Base + 2 Points GEOM_EXTRUSION_DXDYDZ - Forme de Base + Vecteur DX DY DZ + Formes de Base + Vecteur DX DY DZ GEOM_EXTRUSION_TITLE @@ -579,11 +583,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_GCS - Système de Coordonnées Globale + Système de Coordonnées Global GEOM_LCS - Système de Coordonnées Locale + Système de Coordonnées Local GEOM_FACES @@ -595,7 +599,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_FACE_OPT - Privilégier la création d'une face planaire + Privilégier la création d'une face plane GEOM_FACE_OR_LCS @@ -707,7 +711,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_FREE_BOUNDS_ERROR - L'objet n'est pas choisi + L'objet n'est pas sélectionné GEOM_FREE_BOUNDS_MSG @@ -727,31 +731,31 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_FUSE - Fusion + Union GEOM_FUSE_TITLE - Fusionner deux Objets + Réunir deux Objets GEOM_FixFaceSize - FixerFaceTaille + TailleFaceRepare GEOM_FixShape - FixerForme + ObjetRepare GEOM_GLUE - Coller + Recoller GEOM_GLUE_TITLE - Coller des faces + Recollement de faces GEOM_LIMIT_TOLERANCE_TITLE - Tolérance limite + Limiter la tolérance GEOM_HEIGHT @@ -763,7 +767,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_IDENTICAL_NAMES_SELECT_BY_MOUSE - Noms Identiques : choisir par souris ! + Noms Identiques : sélectionner à la souris ! GEOM_IMPORT @@ -771,7 +775,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_INCORRECT_INPUT - Les données d'entrée ne sont pas correctes! + Les données d'entrée ne sont pas valides! GEOM_INERTIA_CONSTR @@ -787,11 +791,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_INERTIA_TITLE - Calcul d'Inertie + Calcul de l'Inertie GEOM_INF_LOADED - Fichier %1 est ouvert. + Le fichier %1 est ouvert. GEOM_INTERNAL_WIRES @@ -803,7 +807,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_KEEP_OBJECT - Préserver l'Objet + Garder l'Objet GEOM_LENGTH @@ -891,7 +895,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_MEN_ISOS - Choisir le numéro d'Isolignes + Choisir le nombre d'Isolignes GEOM_MEN_ISOU @@ -931,7 +935,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_MEN_WIREFRAME - Contours + Filaire GEOM_MEN_X @@ -999,15 +1003,15 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_NAME_INCORRECT - Le nom de l'Objet n'est pas trouvé + Le nom de l'Objet n'a pas été trouvé GEOM_NB_BLOCKS_NO_OTHERS - Il y a %1 bloques spécifiées et PAS d'autres solides + Il y a %1 bloques spécifiés et PAS d'autres solides GEOM_NB_BLOCKS_SOME_OTHERS - Il y a %1 bloques spécifiées et un nombre d'autres solides + Il y a %1 bloques spécifiés et d'autres solides GEOM_NB_TIMES @@ -1027,7 +1031,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_NUM_SPLIT_POINTS - Numéro de points de coupage + Nombre de points de découpe GEOM_OBJECT @@ -1055,7 +1059,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_OFFSET_TITLE - Surface de Décalage + Décaler une surface GEOM_OPERATIONS @@ -1067,7 +1071,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_ORIENTATION_OPT - Invertir l'Orientation et simuler les vecturs normaux + Inverser l'Orientation et simuler les vecteurs normaux GEOM_ORIENTATION_TITLE @@ -1083,11 +1087,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_POINT_ON_EDGE - Point sur l'Arête + Créer un point sur une arête GEOM_POINT_ON_FACE - Point sur la Face + Créer un point sur une face GEOM_PARAM_VALUE @@ -1103,7 +1107,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_WRN_PARTITION_RESULT_EMPTY - The partition result is empty, please verify the reconstruction limit parameter. + Le résultat de la partition est vide, verifiez le paramètre limite de reconstruction GEOM_PARTITION_HALFSPACE @@ -1115,11 +1119,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_PARTITION_TITLE - Partition d'un Objet avec Outil + Partition d'un Objet avec un Outil GEOM_PATH_OBJECT - Chemin à l'Objet + Chemin GEOM_PIPE @@ -1131,7 +1135,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SEGMENT - Segment d'une ligne droite + Segment de droite GEOM_SELECT_UNPUBLISHED_EDGES @@ -1195,11 +1199,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_POLYLINE - Polyline + Ligne brisée GEOM_POSITION - Location + Position GEOM_POSITION_TITLE @@ -1211,11 +1215,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_PROPAGATE - Propaguer + Propager GEOM_PROPAGATE_TITLE - Propaguer + Propager GEOM_PROPERTIES @@ -1223,23 +1227,23 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_PROPERTIES_CONSTR - L'Objet et ses Propriétés + Objet et ses Propriétés GEOM_PROPERTIES_SURFACE - Surface est : + Surface : GEOM_PROPERTIES_TITLE - Information sur les Propriétés de Base + Propriétés de Base GEOM_PROPERTIES_VOLUME - Volume est : + Volume : GEOM_PRP_ABORT - Opération est annulée + L'Opération a été annulée GEOM_PRP_COMMAND @@ -1247,7 +1251,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_PRP_DONE - Opération aboutie + L'Opération a abouti GEOM_PRP_EXPORT @@ -1255,7 +1259,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_PRP_LOADING - Ouvrir %1 ... + Charger %1 ... GEOM_PRP_MIN_DIST @@ -1263,7 +1267,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_PRP_NOT_FOR_VTK_VIEWER - Interdit au visualisateur VTK + Interdit dans le visualiseur VTK GEOM_PRP_NULLSHAPE @@ -1275,11 +1279,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_PRP_SELECT_EDGE - Choisissez les arêtes et cliquez Appliquer + Choisissez les arêtes et cliquez sur Appliquer GEOM_PRP_SELECT_FACE - Choisissez les faces à supprimer et cliquez Oui/Appliquer + Choisissez les faces à supprimer et cliquez sur Oui/Appliquer GEOM_PRP_SELECT_FIRST @@ -1287,7 +1291,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_PRP_SELECT_SUBSHAPES - Choisissez les Sous-Formes + Choisissez les Sous-Objets GEOM_PRP_SHAPE_IN_STUDY @@ -1311,11 +1315,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_RADIUS_MAJOR - Rayon Majeur : + Demi grand axe : GEOM_RADIUS_MINOR - Rayon Mineur : + Demi petit axe : GEOM_RECONSTRUCTION_LIMIT @@ -1379,31 +1383,31 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_REQUIRED_NUM_SEGMENTS - Le nombre de segments approprié + Nombre de segments requis GEOM_REVERSE - Invertir + Inverser GEOM_REVERSE_DIRECTION - Direction Invertie + Inverser la direction GEOM_REVERSE_PLANE - Invertir le normal du plan + Inverser la normale du plan GEOM_REVERSE_U - Invertir U + Inverser U GEOM_REVERSE_V - Invertir V + inverser V GEOM_REVERSE_VECTOR - Invertir un Vecteur + Inverser un vecteur GEOM_REVOLUTION @@ -1411,7 +1415,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_REVOLUTION_TITLE - Construction par Révolution + Construction par révolution GEOM_ROTATION @@ -1419,7 +1423,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_ROTATION_TITLE - Rotation d'un Objet + Rotation d'un objet GEOM_SCALE @@ -1431,7 +1435,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SCALE_TITLE - Redimensionner un Objet + Redimensionner un objet GEOM_SECTION @@ -1439,19 +1443,19 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SECTION_TITLE - Section de deux Objets + Section de deux objets GEOM_SELECTED_FACE - Face Sélectionnée + Face sélectionnée GEOM_SELECTED_OBJECTS - Objets Sélectionnées + Objets sélectionnés GEOM_SELECTED_SHAPE - Forme Sélectionné + Forme sélectionnée GEOM_SELECTION @@ -1467,7 +1471,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SEWING_TITLE - Couture Topologique + Couture topologique GEOM_SHAPE @@ -1475,7 +1479,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SHAPEPROCESS_TITLE - Traitement de Formes + Traitement de formes GEOM_SHAPES @@ -1491,11 +1495,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SHELL_TITLE - Construction d'une Coque + Construction d'une coque GEOM_SKETCHER_ABS - Absolues + Absolu GEOM_SKETCHER_ANGLE @@ -1507,7 +1511,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SKETCHER_APPLY - Applquer + Appliquer GEOM_SKETCHER_ARC @@ -1535,7 +1539,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SKETCHER_EL - Type d'Elément + Type d'élément GEOM_SKETCHER_RESTORE @@ -1567,7 +1571,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SKETCHER_REL - Relatives + Relatif GEOM_SKETCHER_SEGMENT @@ -1583,11 +1587,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SKETCHER_TITLE - Construction d'un Contour 2D + Construction d'une esquisse 2D GEOM_3DSKETCHER_TITLE - Construction d'un Contour 3D + Construction d'une esquisse 3D GEOM_SKETCHER_TYPE @@ -1595,7 +1599,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SKETCHER_UNDO - Défaire + Revenir GEOM_SKETCHER_VALUES @@ -1643,11 +1647,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_3DSKETCHER - Contour 3D + Esquisse 3D GEOM_COORDINATES_TYPE - Type de Coordonnées + Type de coordonnées GEOM_SOLID @@ -1655,7 +1659,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SOLID_TITLE - Construction d'un Solide + Construction d'un solide GEOM_SPHERE @@ -1667,11 +1671,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SPHERE_RO - Rayon d'Origine + Rayon (centre à l'origine) GEOM_SPHERE_TITLE - Construction d'une Sphère + Construction d'une sphère GEOM_SPLINE @@ -1679,7 +1683,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SPLINE_TITLE - Construction d'un Spline + Construction d'un spline GEOM_START_LCS @@ -1711,19 +1715,19 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SUBSHAPE_SELECT - Choisir les Sous-Formes + Choisir les sous-objets GEOM_SUBSHAPE_TITLE - Sélection des Sous-formes + Sélection des sous-objets GEOM_SUBSHAPE_TYPE - Type des Sous-formes: + Type des sous-objets: GEOM_SUB_SHAPE - Sous-Formes + Sous-objets GEOM_SUPPRESSHOLE_FACE_SHELL @@ -1755,7 +1759,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SUPPRESS_RESULT - Supprimer le Résultat + Supprimer le résultat GEOM_SUPPRESS_RESULT_INSIDE @@ -1775,11 +1779,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SUPRESSFACE_TITLE - Supprimer les Faces d'un Objet + Supprimer les faces d'un objet GEOM_SURFACE_CONTINUTY - Continuité des Surfaces + Continuité des surfaces GEOM_SURFACE_MODE @@ -1787,19 +1791,19 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SURFCONE - Face Conique + Face conique GEOM_SURFCYLINDER - Face Cylindrique + Face cylindrique GEOM_SURFSPHERE - Face Sphèrique + Face sphérique GEOM_SURFTORUS - Face Toroïdal + Face toroïdale GEOM_SameParameter @@ -1821,9 +1825,17 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_TOLERANCE Tolérance + + GEOM_LINEAR_TOLERANCE + Tolérance linéaire + + + GEOM_ANGULAR_TOLERANCE + Tolérance angulaire + GEOM_TOLERANCE_CONSTR - Objet et ses Tolérances + Objet et ses tolérances GEOM_TOLERANCE_EDGE @@ -1835,7 +1847,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_TOLERANCE_TITLE - Tolérance Maximale + Tolérance maximale GEOM_TOLERANCE_VERTEX @@ -1843,11 +1855,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_TOOL_OBJECT - Objet Outil + Objet outil GEOM_TOOL_OBJECTS - Objets Outils + Objets outils GEOM_TORUS @@ -1855,7 +1867,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_TORUS_TITLE - Construction d'un Tore + Construction d'un tore GEOM_TRANSLATION @@ -1863,11 +1875,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_TRANSLATION_COOR - Translation avec Coordonnées + Translation avec coordonnées GEOM_TRANSLATION_TITLE - Translation d'un Objet + Translation d'un objet GEOM_TRANSPARENCY_OPAQUE @@ -1883,7 +1895,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_TRIHEDRON - Trihèdre + Trièdre GEOM_ToBezier @@ -1897,13 +1909,17 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_VECTOR Vecteur + + GEOM_AXIS_DEFAULT + (Axe Z par défaut) + GEOM_VECTOR_LENGTH - Longueur du Vecteur : + Longueur d'un vecteur : GEOM_VECTOR_TITLE - Construction d'un Vecteur + Construction d'un vecteur GEOM_VECTOR_U @@ -1915,15 +1931,15 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_VERTEX - Point + Sommet GEOM_VERTEXES - Points + Sommets GEOM_WATER_DENSITY - Densité de l'Eau : + Densité de l'eau : GEOM_WEIGHT @@ -1935,15 +1951,15 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_WHATIS - Qu'est-ce que c'est + Qu'est-ce que c'est ? GEOM_WHATIS_OBJECT - Objet et son Information Topologique + Objet et ses caractéristiques topologiques GEOM_WHATIS_TITLE - Qu'est-ce que c'est + Qu'est-ce que c'est ? GEOM_WIRE @@ -1963,19 +1979,19 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_WIRE_CONNECT - Création d'un contour à partir des contours/arêtes connectés + Création d'un contour à partir de contours/arêtes connecté(e)s GEOM_WIRE_TITLE - Création d'un Contour + Création d'un contour GEOM_WPLANE - Plan de Travail + Plan de travail GEOM_WPLANE_FACE - Plan, Face Planaire ou SCL + Plan, Face plane ou SCL GEOM_WPLANE_ORIGIN @@ -1995,7 +2011,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_WPLANE_TITLE - Sélection du Plan de Travail + Sélection du plan de travail GEOM_WPLANE_VECTOR @@ -2011,15 +2027,15 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_WRN_RADIUS_NULL - Le Rayon est nul + Le rayon est nul GEOM_WRN_WARNING - Avertissement + Attention WRN_SHAPE_UNCLOSED - Impossible de créer un solide à partir de la forme non-fermée %1 + Impossible de créer un solide à partir d'une forme non-fermée %1 GEOM_X @@ -2035,7 +2051,7 @@ Choisissez face, coque ou solide et essayez de nouveau GLUE_NEW_OBJ_NAME - Coller + Recollement LIMIT_TOLERANCE_NEW_OBJ_NAME @@ -2043,7 +2059,7 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_ALL_SEL_ONLY - Choisir Tous + Sélectionner tout MEN_ARC @@ -2055,23 +2071,23 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_BASIC - de Base + Objets de base MEN_BASIC_PROPS - Propriétés de Base + Propriétés de base MEN_BLOCKS - Bloques + Blocs MEN_BND_BOX - Boîte Englobante + Boîte englobante MEN_BOOLEAN - Booléen + Opérations booléennes MEN_BOX @@ -2087,43 +2103,43 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_CHANGE_ORIENTATION - Changer l'Orientation + Changer l'orientation MEN_CHECK - Vérifier une Forme + Contrôler un objet MEN_CHECK_COMPOUND - Vérifier un Assemblage de Bloques + Contrôler un assemblage de blocs MEN_CHECK_FREE_BNDS - Vérifier les Contours Libres + Contrôler les contours libres MEN_CHECK_FREE_FACES - Vérifier les Faces Libres + Contrôler les faces libres MEN_CHECK_GEOMETRY - Vérifier la Géométrie + Contrôler la géométrie MEN_CIRCLE - Circle + Cercle MEN_CLIPPING - Diapason de Clippage + Plage de découpe MEN_CLOSE_CONTOUR - Fermer le Contour + Fermer le contour MEN_COMMON - Commun + Intersection MEN_COMPOUND @@ -2163,7 +2179,7 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_DISPLAY - Visualiser + Afficher MEN_DISK @@ -2171,15 +2187,15 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_DISPLAY_ALL - Visualiser Tous + Afficher tout MEN_DISPLAY_MODE - Mode de Visualisation + Mode de visualisation MEN_DISPLAY_ONLY - Visualiser Seul + Afficher uniquement MEN_EDGE @@ -2203,15 +2219,15 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_ERASE_ALL - Cacher Tous + Cacher tout MEN_EXPLODE - Eclatement + Eclater MEN_EXPLODE_BLOCKS - Eclater en Bloques + Eclater en blocs MEN_EXPORT @@ -2247,11 +2263,11 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_FILLING - Remplissage + Nappe MEN_FUSE - Fusion + Union MEN_GENERATION @@ -2259,7 +2275,7 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_GLUE_FACES - Coller les Faces + Recoller les faces MEN_GROUP @@ -2267,7 +2283,7 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_GROUP_CREATE - Créer une Groupe + Créer une groupe MEN_GROUP_EDIT @@ -2275,11 +2291,11 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_RELOAD_IMPORTED - Rouvrir de la Disque + Recharger à partir du disque MEN_HEX_SOLID - Solid Hexahédral + Solid hexaédrique MEN_IMPORT @@ -2303,47 +2319,47 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_LOCAL_CS - Système de Coordonnées Locale + Système de coordonnées local MEN_MASS_CENTER - Centre de la Masse + Centre de gravité MEN_MEASURES - Informations + Mesures MEN_MIN_DIST - Distance Minimale + Distance minimale MEN_MIRROR - Image Miroir + Symétrie MEN_MODIFY_LOCATION - Modifer la Location + Modifer la position MEN_MUL_ROTATION - Multi-Rotation + Multi-rotation MEN_MUL_TRANSFORM - Multi-Transformation + Multi-transformation MEN_MUL_TRANSLATION - Multi-Translation + Multi-translation MEN_NEW_ENTITY - Entité Nouvelle + Nouvel objet MEN_OFFSET - Surface de Décalage + Décaler une surface MEN_OPERATIONS @@ -2351,7 +2367,7 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_ORIGIN_AND_VECTORS - Vecteurs de Base et d'Origine + Vecteurs de base et origine MEN_PARTITION @@ -2359,7 +2375,7 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_PIPE - Extrusion au long d'un Chemin + Extrusion suivant un chemin MEN_PLANE @@ -2371,11 +2387,11 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_POINT_COORDS - Coordonnées d'un Point + Coordonnées d'un point MEN_POINT_ON_EDGE - Ajouter un Point sur l'Arête + Ajouter un point sur l'arête MEN_POP_COLOR @@ -2383,7 +2399,7 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_POP_CREATE_GROUP - Créer un Groupe + Créer un groupe MEN_POP_SHOW_CHILDREN @@ -2399,7 +2415,7 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_POP_DEFLECTION - Coefficient de Déflection + Coefficient de déformation MEN_POP_RENAME @@ -2415,11 +2431,11 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_POP_WIREFRAME - Contour + Filaire MEN_POP_VECTORS - Montrer la Direction de l'Arête + Montrer l'orientation de l'arête MEN_PREFERENCES @@ -2439,15 +2455,15 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_PROPAGATE - Propaguer + Propager MEN_Q_FACE - Face Quadrangulaire + Face quadrangulaire MEN_REPAIR - Reparer + Réparer MEN_REVOLUTION @@ -2459,7 +2475,7 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_SCALE - Transformation par + Redimensionner MEN_SECTION @@ -2467,7 +2483,7 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_SELECT_ONLY - Choisir seul + Sélectionner uniquement MEN_SEWING @@ -2479,11 +2495,11 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_SHADING_COLOR - Couleur d'Ombrage + Couleur d'ombrage MEN_SHAPE_PROCESS - Traitement de Forme + Traitement de forme MEN_SHELL @@ -2495,11 +2511,11 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_SKETCH - Contour 2D + Esquisse 2D MEN_3DSKETCH - Contour 3D + Esquisse 3D MEN_SOLID @@ -2515,19 +2531,19 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_STEP_VALUE - Valeur de Pas + Valeur du pas MEN_SUPPERSS_HOLES - Supprimer les Trous + Supprimer les trous MEN_SUPPRESS_FACES - Supprimer les Faces + Supprimer des faces MEN_SUPPRESS_INT_WIRES - Supprimer les Contours Internes + Supprimer des contours Internes MEN_TOLERANCE @@ -2563,7 +2579,7 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_WHAT_IS - Qu'est-ce que c'est + Qu'est-ce que c'est ? MEN_WIRE @@ -2571,15 +2587,15 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_VECTOR_MODE_ON - Montrer la Direction de l'Arête + Montrer l'orientation de l'arête MEN_VECTOR_MODE_OFF - Cacher la Direction de l'Arête + Cacher l'orientation de l'arête MEN_WIREFRAME - Contour + Filaire MEN_WIRE_SEL_ONLY @@ -2587,11 +2603,11 @@ Choisissez face, coque ou solide et essayez de nouveau MEN_WORK_PLANE - Plan de Travail + Plan de travail MEN_POP_POINT_MARKER - Repère Point + Marqueur de point NAME_LBL @@ -2599,15 +2615,15 @@ Choisissez face, coque ou solide et essayez de nouveau NON_GEOM_OBJECTS_SELECTED - Dans la sélection il y a d'objets n'appartenant pas au composant %1. + Il y a des objets n'appartenant pas au composant %1 dans la sélection PREF_DEFLECTION - Coefficient de Déflection + Coefficient de déformation GEOM_PREF_def_precision - Précision de défaut + Précision par défaut GEOM_PREF_length_precision @@ -2623,23 +2639,23 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_PREF_ang_tol_precision - Tolérance de Précision Angulaire + Précision de la tolérance angulaire GEOM_PREF_weight_precision - Précision de Poids + Précision de poids GEOM_PREF_density_precision - Précision de Densité + Précision de densité GEOM_PREF_parametric_precision - Précision Paramétrique + Précision paramétrique GEOM_PREF_param_tol_precision - Tolérance de Précision Paramétrique + Tolérance de précision paramétrique PREF_AUTO_CREATE @@ -2647,15 +2663,15 @@ Choisissez face, coque ou solide et essayez de nouveau PREF_DISPLAY_MODE - Mode de visualisation de défault + Mode de visualisation par défaut PREF_FREE_BOUND_COLOR - Couleur des Contours Libres + Couleur des contours libres PREF_GROUP_ORIGIN_AND_BASE_VECTORS - Vecteurs d'origine et de base + Vecteurs de base et origine PREF_GROUP_GENERAL @@ -2663,7 +2679,7 @@ Choisissez face, coque ou solide et essayez de nouveau PREF_GROUP_OCCVIEWER - Visualisateur OCC 3d + Visualiseur OCC 3d GEOM_PREF_GROUP_PRECISION @@ -2671,7 +2687,7 @@ Choisissez face, coque ou solide et essayez de nouveau PREF_GROUP_VERTEX - Repère des points + Marqueurs de points PREF_ISOS_COLOR @@ -2691,11 +2707,11 @@ Choisissez face, coque ou solide et essayez de nouveau PREF_SHADING_COLOR - Couleur d'Ombrage de Défault + Couleur d'ombrage par défaut PREF_STEP_VALUE - Valeur de pas pour les boîtes d'incrément + Valeur du pas pour les boîtes d'incrément PREF_TAB_SETTINGS @@ -2711,11 +2727,11 @@ Choisissez face, coque ou solide et essayez de nouveau PREF_WIREFRAME_COLOR - Couleur des contours de défaut + Couleur des contours par défaut PROCESS_SHAPE_NEW_OBJ_NAME - FormeTraitement + FormeRetraitée REMOVE_HOLES_NEW_OBJ_NAME @@ -2731,7 +2747,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_ALL_SEL_ONLY - Choisir tous les Objets + Choisir tous les objets STB_ARC @@ -2739,11 +2755,11 @@ Choisissez face, coque ou solide et essayez de nouveau STB_ARCHIMEDE - Opération Archimède + Opération archimède STB_BASIC_PROPS - Montrer les propriétés de base de l'Objet + Montrer les propriétés de base de l'objet STB_BND_BOX @@ -2755,7 +2771,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_CHAMFER - Créer un Chanfrein + Créer un chanfrein STB_CHANGE_ORIENTATION @@ -2763,31 +2779,31 @@ Choisissez face, coque ou solide et essayez de nouveau STB_CHECK - Valider une forme + Contrôler une forme STB_CHECK_COMPOUND - Valider un assemlage de bloques + Contrôler un assemlage de blocs STB_CHECK_FREE_BNDS - Vérifier les Contours Libres + Vérifier les contours libres STB_CHECK_FREE_FACES - Vérifier les Faces Libres + Contrôler les faces libres STB_CHECK_GEOMETRY - Vérifier la Géométrie + Contrôler la géométrie STB_CIRCLE - Créer un circle + Créer un cercle STB_CLIPPING - Diapason de Clippage + Intervalle de découpe STB_CLOSE_CONTOUR @@ -2795,7 +2811,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_COMMON - Commun + Intersection STB_COMPOUND @@ -2803,7 +2819,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_COMPOUND_SEL_ONLY - Ne choisir que des Assemblages + Ne choisir que des assemblages STB_CONE @@ -2835,15 +2851,15 @@ Choisissez face, coque ou solide et essayez de nouveau STB_DISPLAY - Visualiser les objets + Afficher les objets STB_DISPLAY_ALL - Visualiser tous + Afficher tout STB_DISPLAY_ONLY - Visualiser seul + Afficher uniquement STB_EDGE @@ -2851,7 +2867,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_EDGE_SEL_ONLY - Ne choisir que des Arêtes + Ne choisir que des arêtes STB_ELLIPSE @@ -2863,15 +2879,15 @@ Choisissez face, coque ou solide et essayez de nouveau STB_ERASE_ALL - Cacher tous + Cacher tout STB_EXPLODE - Eclatement + Eclater STB_EXPLODE_BLOCKS - Eclater en Bloques + Eclater en Blocs STB_EXPORT @@ -2887,7 +2903,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_FACE_SEL_ONLY - Ne choisir que des Faces + Ne choisir que des faces STB_FILLET @@ -2903,15 +2919,15 @@ Choisissez face, coque ou solide et essayez de nouveau STB_FILLING - Créer un remplissage + Créer une nappe STB_FUSE - Fusion + Union STB_GLUE_FACES - Coller les faces + Recoller les faces STB_GROUP_CREATE @@ -2923,11 +2939,11 @@ Choisissez face, coque ou solide et essayez de nouveau STB_RELOAD_IMPORTED - Recharger la forme importée de sa place d'origine sur la disque + Recharger l'objet importé depuis le disque STB_HEX_SOLID - Solide Hexahédral + Solide hexaédrique STB_IMPORT @@ -2939,7 +2955,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_ISOS - Définir le numéro d'isolignes + Définir le nombre d'isolignes STB_LINE @@ -2955,7 +2971,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_MASS_CENTER - Calculer le centre de la masse de l'objet + Calculer le centre de gravité de l'objet STB_MIN_DIST @@ -2967,7 +2983,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_MODIFY_LOCATION - Modifier la location d'un objet + Modifier la position d'un objet STB_MUL_ROTATION @@ -2983,11 +2999,11 @@ Choisissez face, coque ou solide et essayez de nouveau STB_OFFSET - Surface de Décalage + Décaler une surface STB_ORIGIN_AND_VECTORS - Créer les Vecteurs de l'origine et de base + Créer les vecterurs de base et l'origine STB_PARTITION @@ -2995,7 +3011,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_PIPE - Créer un objet par l'extrusion au long d'un chemin + Créer un objet par extrusion suivant un chemin STB_PLANE @@ -3035,7 +3051,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_POP_DEFLECTION - Coefficient de Déflection + Coefficient de déformation STB_POP_RENAME @@ -3055,11 +3071,11 @@ Choisissez face, coque ou solide et essayez de nouveau STB_PROPAGATE - Propaguer + Propager STB_Q_FACE - Face Quadrangulaire + Face quadrangulaire STB_REVOLUTION @@ -3087,11 +3103,11 @@ Choisissez face, coque ou solide et essayez de nouveau STB_VECTOR_MODE - Changer le Mode de Présentation des arêtes + Changer le mode de représentation des arêtes STB_SHADING_COLOR - Définir le Couleur d'Ombrage + Définir la couleur d'ombrage STB_SHAPE_PROCESS @@ -3103,15 +3119,15 @@ Choisissez face, coque ou solide et essayez de nouveau STB_SHELL_SEL_ONLY - Ne choisir que des Coques + Ne choisir que des coques STB_SKETCH - Créer un contour 2D + Créer une esquisse 2D STB_3DSKETCH - Créer un contour 3D + Créer une esquisse 3D STB_SOLID @@ -3119,7 +3135,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_SOLID_SEL_ONLY - Ne choisir que des Solides + Ne choisir que des solides STB_SPHERE @@ -3127,7 +3143,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_STEP_VALUE - Définir le valeur de pas + Définir le valeur du pas STB_SUPPERSS_HOLES @@ -3159,11 +3175,11 @@ Choisissez face, coque ou solide et essayez de nouveau STB_VERTEX_SEL_ONLY - Ne choisir que des Points + Ne choisir que des points STB_WHAT_IS - Qu'est-ce que c'est + Qu'est-ce que c'est ? STB_WIRE @@ -3171,7 +3187,7 @@ Choisissez face, coque ou solide et essayez de nouveau STB_WIRE_SEL_ONLY - Ne choisir que des Contours + Ne choisir que des contours STB_WORK_PLANE @@ -3179,15 +3195,15 @@ Choisissez face, coque ou solide et essayez de nouveau STB_POP_POINT_MARKER - Définir un Point Repère + Définir un marqueur de point SUPPRESS_RESULT - Supprimer le Résultat + Supprimer le résultat SUPRESS_FACE_NEW_OBJ_NAME - SupprimerFaces + FacesSupprimees ShHealOper_ErrorExecution_msg @@ -3243,11 +3259,11 @@ Choisissez face, coque ou solide et essayez de nouveau TOOL_BASIC - de Base + Objets de base TOOL_BOOLEAN - Opérations Booléennes + Opérations booléennes TOOL_GENERATION @@ -3291,15 +3307,15 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_BND_BOX - Boîte Englobante + Boîte englobante TOP_BOX - Créer une Boîte + Créer une boîte TOP_CHAMFER - Chanfrain + Chanfrein TOP_CHANGE_ORIENTATION @@ -3307,31 +3323,31 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_CHECK - Valider l'Objet + Valider l'objet TOP_CHECK_COMPOUND - Valider l'assemblage de bloques + Valider l'assemblage de blocs TOP_CHECK_FREE_BNDS - Valider les Contours Libres + Valider les contours libres TOP_CHECK_FREE_FACES - Valider les Faces Libres + Contrôler les faces libres TOP_CHECK_GEOMETRY - Valider la Géométrie + Contrôler la géométrie TOP_CIRCLE - Créer un circle + Créer un cercle TOP_CLIPPING - Diapason de Clipage + Intervalle de découpe TOP_CLOSE_CONTOUR @@ -3339,7 +3355,7 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_COMMON - Commun + Intersection TOP_COMPOUND @@ -3375,15 +3391,15 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_DISPLAY - Montrer + Afficher TOP_DISPLAY_ALL - Montrer Tous + Afficher tout TOP_DISPLAY_ONLY - Montrer Seul + Afficher uniquement TOP_EDGE @@ -3399,19 +3415,19 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_ERASE_ALL - Cacher tous + Cacher tout TOP_EXPLODE - Eclatement + Eclater TOP_EXPLODE_BLOCKS - Eclater en Bloques + Eclater en blocs TOP_EXPORT - Exporter une géométrie au fichier BREP + Exporter une géométrie au format BREP TOP_EXTRUSION @@ -3435,15 +3451,15 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_FILLING - Créer un remplissage + Créer une nappe TOP_FUSE - Fusion + Union TOP_GLUE_FACES - Coller les faces + Recoller les faces TOP_GROUP_CREATE @@ -3455,11 +3471,11 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_HEX_SOLID - Solide Hexahédral + Solide hexaédrique TOP_IMPORT - Importer une géométry du fichier BREP + Importer une géométry d'un fichier BREP TOP_INERTIA @@ -3467,7 +3483,7 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_ISOS - Définir le numéro des isolignes + Définir le nombre d'isolignes TOP_LINE @@ -3483,23 +3499,23 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_MASS_CENTER - Centre de la masse + Centre de gravité TOP_MIN_DIST - Distance Minimale + Distance minimale TOP_MIRROR - Image Miroir + Symétrie TOP_MODIFY_LOCATION - Modifer la location + Modifer la position TOP_MUL_ROTATION - Multi-Rotation + Multi-rotation TOP_MUL_TRANSFORM @@ -3507,15 +3523,15 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_MUL_TRANSLATION - Multi-Translation + Multi-translation TOP_OFFSET - Surface de Décalage + Décaler une surface TOP_ORIGIN_AND_VECTORS - Créer l'origine et les Vecteurs de base + Créer l'origine et les vecteurs de base TOP_PARTITION @@ -3523,7 +3539,7 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_PIPE - Extrusion au long d'un chemin + Extrusion suivant un chemin TOP_PLANE @@ -3547,11 +3563,11 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_POP_CREATE_GROUP - Créer un Groupe + Créer un groupe TOP_POP_SHOW_CHILDREN - Montrer les Enfants + Montrer les enfants TOP_POP_HIDE_CHILDREN @@ -3563,7 +3579,7 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_POP_DEFLECTION - Coefficient de Déflection + Coefficient de déformation TOP_POP_RENAME @@ -3583,11 +3599,11 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_PROPAGATE - Propaguer + Propager TOP_Q_FACE - Face Quadrangulaire + Face quadrangulaire TOP_REVOLUTION @@ -3599,7 +3615,7 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_SCALE - Redimentionnement + Redimensionner TOP_SECTION @@ -3627,11 +3643,11 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_SKETCH - Contour 2D + Esquisse 2D TOP_3DSKETCH - Contour 3D + Esquisse 3D TOP_SOLID @@ -3643,7 +3659,7 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_STEP_VALUE - Définir la valeur de pas + Définir la valeur du pas TOP_SUPPERSS_HOLES @@ -3675,7 +3691,7 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_WHAT_IS - Qu'est-ce que c'est + Qu'est-ce que c'est ? TOP_WIRE @@ -3687,7 +3703,7 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_POP_POINT_MARKER - Repère d'un Point + Marqueur de point WRN_NOT_IMPLEMENTED @@ -3699,7 +3715,7 @@ Choisissez face, coque ou solide et essayez de nouveau NOT_FOUND_ANY - Pas une seule entité a été trouvée + Aucune entité n'a été trouvée GEOM_FACE_I @@ -3719,11 +3735,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_BOTHWAY - Toutes les deux directions + Dans les deux directions GEOM_NORMALE - Normale à une Face + Normale à une face GEOM_VECTOR_NORMALE @@ -3743,7 +3759,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_CHAMFER_EDGE - Chanfrein sur les Arêtes choisies + Chanfrein sur les arêtes choisies SELECTED_EDGE @@ -3751,11 +3767,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_NORMALE_TITLE - Créer un Vecteur Normal à une Face + Créer un vecteur normal à une face GEOM_MEASURE_ANGLE_TITLE - Angle entre deux Arêtes/Lignes/Vecteurs Droits + Angle entre deux arêtes/lignes/vecteurs droits GEOM_MEASURE_ANGLE_ANGLE @@ -3763,31 +3779,35 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_MEASURE_ANGLE_OBJ - Objets et Résultats + Objets et résultats GEOM_MEASURE_ANGLE_IS - Angle en degrées : + Angle en degrés : GEOM_LINE_INTERSECTION - Point sur l'Intersection des Lignes + Point à l'Intersection de deux lignes GEOM_KEEP_NONLIMIT_SHAPES Préserver les formes inférieures + + GEOM_NO_SELF_INTERSECTION + Pas d'intersection des sous-formes (assemblages seuls) + GEOM_CENTER_2POINTS Centre et deux points GEOM_REMOVE_EXTRA_EDGES_TITLE - Supprimer les arêtes supplémentaires + Supprimer les arêtes inutiles GEOM_REMOVE_EXTRA_EDGES - L'Objet pour suppimer les arêtes supplémentaires + Objet dont on suppime les arêtes inutiles GEOM_RMEE_UNION_FACES @@ -3799,27 +3819,27 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_REMOVE_EXTRA_EDGES - Suppimer les Arêtes Supplémentaires + Suppimer les arêtes inutiles MEN_REMOVE_EXTRA_EDGES - Suppimer les Arêtes Supplémentaires + Suppimer les arêtes inutiles STB_REMOVE_EXTRA_EDGES - Suppimer les Arêtes Supplémentaires + Suppimer les arêtes inutiles TOP_NORMALE - Vecteur Normal à une Face + Vecteur normal à une face MEN_NORMALE - Vecteur Normal à une Face + Vecteur normal à une face STB_NORMALE - Calculer le Vecteur Normal à une Face + Vecteur normal à une face TOP_MEASURE_ANGLE @@ -3847,19 +3867,19 @@ Choisissez face, coque ou solide et essayez de nouveau TOP_POP_DISABLE_AUTO_COLOR - Désactiver le Couleur Automatique + Désactiver le couleur automatique MEN_POP_DISABLE_AUTO_COLOR - Désactiver le Couleur Automatique + Désactiver le couleur automatique STB_POP_DISABLE_AUTO_COLOR - Désactiver le Couleur Automatique + Désactiver le couleur automatique GEOM_RESULT_NAME_GRP - Nom du Résultat + Nom du résultat GEOM_RESULT_NAME_LBL @@ -3883,7 +3903,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_FILLING_AUTO - Auto-corrger l'orientation des arêtes + Auto-corriger l'orientation des arêtes GEOM_WRN_NO_APPROPRIATE_SELECTION @@ -3899,7 +3919,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SHAPES_ON_SHAPE_CSHAPE - Le Solide à vérifier + Le solide de contrôle GEOM_SHAPES_ON_SHAPE_STATE @@ -3907,7 +3927,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_KIND_OF_SHAPE - Type d'Objet : + Type d'objet : GEOM_CLOSED @@ -3919,7 +3939,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_CLOSEDUNCLOSED - Il n'est pas défini, si l'objet est fermé ou ouvert. Possiblement, il y a un erreur. + Il n'est pas défini, si l'objet est fermé ou ouvert. , il y a potentiellement une erreur. GEOM_DISK_CIRCLE @@ -3927,15 +3947,15 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_DISK_ELLIPSE - Face Elliptique + Face elliptique GEOM_PLANAR_FACE - Face Planaire + Face plane GEOM_PLANAR_EDGE_WIRE - Contour avec des Arêtes Planaires + Contour avec des arêtes planes GEOM_POLYGON @@ -3947,7 +3967,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_NORMAL - Direction Normale + Direction normale GEOM_DIRECTION @@ -3979,15 +3999,15 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SCALE_FACTOR_X - Facteur de Redimentionnnement à l'axe X : + Facteur de redimensionnnement suivant X : GEOM_SCALE_FACTOR_Y - Facteur de Redimentionnnement à l'axe Y : + Facteur de redimensionnnement suivant Y : GEOM_SCALE_FACTOR_Z - Facteur de Redimentionnnement à l'axe Z : + Facteur de redimensionnnement suivant Z : GEOM_STATE_IN @@ -4031,11 +4051,11 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_RESTORE_SUB_SHAPES - Importer à partir des arguments les paramètres de la présentation et les sous-formes + Importer les paramètres de la présentation et les sous-objets GEOM_RSS_ADD_FREFIX - Ajouter un préfixe aux noms des sous-formes restaurées + Ajouter un préfixe aux noms des sous-objets restaurés GEOM_ALL_IMPORT_FILES @@ -4051,7 +4071,7 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_IMPORT_ERRORS - L'importation s'est finie avec des erreurs: + L'import s'est fini avec des erreurs: GEOM_PUBLISH_NAMED_SHAPES @@ -4059,12 +4079,12 @@ Choisissez face, coque ou solide et essayez de nouveau GEOM_SCALE_DIMENSIONS - Voulez-vous prendre les unités en consiération? + Voulez-vous prendre les unités en considération? Sinon les dimensions seront préservées sans modifications. GEOM_ADVANCED - Forme Avancée : type %1 + Objet géométrique avancé : type %1 GEOM_PRECISION_HINT @@ -4073,27 +4093,27 @@ le paramètre '%1' aux préférences du module Géométrie. TOP_PIPETSHAPE - Créer un Tuyau TForme + Créer un tuyau en T MEN_PIPETSHAPE - Tuyau TForme + Tuyau en T STB_PIPETSHAPE - Créer un Nouveau Tuyau TForme + Créer un nouveau tuyau en T GEOM_ADVANCED_201 - Tuyau TForme + Tuyau en T HALF_LENGTH_MAIN_PIPE - Demi-longueur du Tuyau Principal + Demi-longueur du tuyau principal HALF_LENGTH_INCIDENT_PIPE - Demi-longueur du Tuyau Incident + Demi-longueur du tuyau incident CIRCULAR_QUARTER_PIPE @@ -4105,11 +4125,11 @@ le paramètre '%1' aux préférences du module Géométrie. FLANGE - Flange + Collerette CHAMFER_OR_FILLET - Chanfrein ou Congé + Chanfrein ou congé CHAMFER @@ -4131,6 +4151,10 @@ le paramètre '%1' aux préférences du module Géométrie.JUNCTION_FACE_3 Jonction 3 + + GEOM_PLUGINS_OTHER + Autre + BasicGUI_CurveDlg @@ -4143,26 +4167,26 @@ le paramètre '%1' aux préférences du module Géométrie.BasicGUI_EllipseDlg GEOM_VECTOR_MAJOR - Axe Majeur + Grand Axe ORIGIN_DEFAULT - Origine de défaut + Origine par défaut X_AXIS_DEFAULT - Axe X de défaut + Axe X par défaut Z_AXIS_DEFAULT - Axe Z de défaut + Axe Z par défaut BasicGUI_MarkerDlg CAPTION - Construction d'un SC Local + Construction d'un S.C. local DX @@ -4232,11 +4256,11 @@ le paramètre '%1' aux préférences du module Géométrie.BlocksGUI_ExplodeDlg NB_FACES_MAX - Numéro maximal des faces + Nombre de faces maximal NB_FACES_MIN - Numéro minimal des faces + Nombre de faces maximal @@ -4259,19 +4283,19 @@ le paramètre '%1' aux préférences du module Géométrie. VERTEX_1 - Point 1 + Sommet 1 VERTEX_2 - Point 2 + Sommet 2 VERTEX_3 - Point 3 + Sommet 3 VERTEX_4 - Point 4 + Sommet 4 @@ -4306,14 +4330,14 @@ le paramètre '%1' aux préférences du module Géométrie. CANNOT_CLOSE Il est impossible de fermer le contour -Le numéro de points du contour n'est pas suffisant +Le nombre de points n'est pas suffisant EntityGUI_SubShapeDlg NO_SUBSHAPES_SELECTED - Choisissez une ou plusieurs sous-formes + Choisissez un ou plusieurs sous-objets @@ -4339,15 +4363,15 @@ Le numéro de points du contour n'est pas suffisant EMPTY_LIST - Choisissez une ou plus de sous-formes à placer dans le groupe + Choisissez un ou plusieurs sous-objets à placer dans le groupe EMPTY_NAME - Le nom de groupe est vide. Indiquez un nom correcte + Le nom de groupe est vide. Indiquez un nom valide GROUP_NAME - Npm du Groupe + Nom du Groupe GROUP_PREFIX @@ -4355,11 +4379,11 @@ Le numéro de points du contour n'est pas suffisant MAIN_SHAPE - La Forme Principale + Objet Principal MAIN_SUB_SHAPES - La Forme Principale et ces Sous-Formes + Objet principal et objets secondaires NO_GROUP @@ -4367,23 +4391,35 @@ Le numéro de points du contour n'est pas suffisant NO_MAIN_OBJ - Choisissez l'objet principal + Choisissez un objet principal REMOVE Supprimer + + SHOW_ONLY_SELECTED + Afficher uniquement la sélection + + + HIDE_SELECTED + Cacher la sélection + + + SHOW_ALL_SUB_SHAPES + Afficher tous les sous-objets + SELECT_ALL - Choisir Tous + Tout sélectionner SHAPE_SEL_RESTR - Sélection Limité de la Forme Principale + Restriction de la sélection SHAPE_TYPE - Type de la Forme + Type d'objet NO_RESTR @@ -4391,15 +4427,15 @@ Le numéro de points du contour n'est pas suffisant GEOM_PARTS_OF_SHAPE2 - Parties Géométriques de la Seconde Forme + Parties Géométriques de l'Objet Secondaire SUBSHAPES_OF_SHAPE2 - Seules les Sous-Formes de la Seconde Forme + Sous-Objets de l'Objet Secondaire Uniquement SECOND_SHAPE - Seconde Forme + Objet secondaire @@ -4417,7 +4453,7 @@ Le numéro de points du contour n'est pas suffisant COORDINATES - Le Point et ces coordonnées + Le Point et ses coordonnées POINT @@ -4452,18 +4488,18 @@ Le numéro de points du contour n'est pas suffisant SELECTED_FACES - Les Faces Choisies + Faces sélectionnées OperationGUI_FilletDlg SELECTED_EDGES - Les arêtes choisies + Arêtes sélectionnées SELECTED_FACES - Les Faces Choisies + Faces sélectionnées @@ -4478,23 +4514,23 @@ Le numéro de points du contour n'est pas suffisant NUMBER_CLOSED - Numéro de contours libres fermés + Nombre de contours libres fermés NUMBER_OPEN - Numéro de contours libres ouverts + Nombre de contours libres ouverts RepairGUI_GlueDlg FACES_FOR_GLUING_ARE_DETECTED - Il y a %1 face(s) à coller surlignées en couleur rouge. -Fermez cette boîte d'alerte et choisissez les faces à coller + Il y a %1 face(s) à recoller surlignées en couleur rouge. +Fermez cette boîte d'alerte et choisissez les faces à recoller GLUE_FACES - Coller les faces + Recollement de faces SELECT_FACES @@ -4502,7 +4538,7 @@ Fermez cette boîte d'alerte et choisissez les faces à coller THERE_ARE_NO_FACES_FOR_GLUING - Il n'y a pas de Faces à Coller + Il n'y a pas de faces à coller @@ -4517,19 +4553,19 @@ Fermez cette boîte d'alerte et choisissez les faces à coller TIME_CONSUMING - L'activarion de cette option peut résulter en une perte de temps à l'entrée de certaines formes. -Voudriez-vous continuer? + L'activation de cette option peut résulter en une perte de temps sur certains objets. +Voulez-vous continuer? GEOMToolsGUI_DeleteDlg GEOM_REALLY_DELETE - Est-ce que vous voulez supprimer %1 objet(s)? + Voulez-vous vraiment supprimer %1 objet(s)? GEOM_REALLY_DELETE_ALL - Est-ce que vous voulez de supprimer tous les objets? + Voulez-vous vraiment supprimer tous les objets? GEOM_DELETE_OBJECTS @@ -4540,18 +4576,18 @@ Voudriez-vous continuer? GEOMToolsGUI_DeflectionDlg GEOM_DEFLECTION_TLT - Choisir la déflection d'un Objet + Choisir le degré de déformation d'un objet GEOM_DEFLECTION - Déflection : + Déformation : GEOMToolsGUI_MarkerDlg SET_MARKER_TLT - Définir le Repère de Point + Définir le Marqueur de Point STANDARD_MARKER @@ -4598,15 +4634,15 @@ Voudriez-vous continuer? AdvancedGUI_PipeTShapeDlg GEOM_PIPE_TSHAPE_TITLE - Construction d'un Tuyau TForme + Construction d'un Tuyau en T GEOM_PIPE_TSHAPE - TuyauTForme + TuyauT GEOM_PIPE_TSHAPE_MPIPE - Tuyau Principal + Tuyau principal GEOM_PIPE_TSHAPE_R @@ -4622,7 +4658,7 @@ Voudriez-vous continuer? GEOM_PIPE_TSHAPE_IPIPE - Tuyau Incident + Tuyau incident GEOM_PIPE_TSHAPE_CHAMFER @@ -4642,7 +4678,7 @@ Voudriez-vous continuer? GEOM_PIPE_TSHAPE_HEX - Préparer pour un maillage hexagonal + Préparer pour un maillage hexaédrique GEOM_PIPE_TSHAPE_POSITION diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 3ee06d2df..57b89ad57 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -1202,7 +1202,7 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) PyErr_Print(); else { - PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"geom","New Entity","Other"); + PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"geom",tr("MEN_NEW_ENTITY").toStdString().c_str(),tr("GEOM_PLUGINS_OTHER").toStdString().c_str()); if(result==NULL) PyErr_Print(); Py_XDECREF(result); diff --git a/src/GEOMImpl/GEOMImpl_Block6Explorer.cxx b/src/GEOMImpl/GEOMImpl_Block6Explorer.cxx index 67cfbdbc1..27056c52c 100644 --- a/src/GEOMImpl/GEOMImpl_Block6Explorer.cxx +++ b/src/GEOMImpl/GEOMImpl_Block6Explorer.cxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #include @@ -62,8 +61,11 @@ #include #include +#include + #include #include +#include #include #include @@ -1198,11 +1200,70 @@ void GEOMImpl_Block6Explorer::MakeFace (const TopoDS_Wire& theWire, const Standard_Boolean isPlanarWanted, TopoDS_Shape& theResult) { - // try to build face on plane or on any surface under the edges of the wire - BRepBuilderAPI_MakeFace MK (theWire, isPlanarWanted); - if (MK.IsDone()) { - theResult = MK.Shape(); - return; + // Workaround for Mantis issue 0020956 + if (isPlanarWanted) { + // Count the number of points in the wire. + // Collect the first three points. + gp_Pnt p1, p2, p3; + bool is3Pnts(false); + bool p1set(false), p2set(false), p3set(false); + BRepTools_WireExplorer wexpl(theWire); + for (; wexpl.More(); wexpl.Next()) { + if (!p1set) { + p1set = true; + p1 = BRep_Tool::Pnt(wexpl.CurrentVertex()); + } + else if (!p2set) { + p2set = true; + p2 = BRep_Tool::Pnt(wexpl.CurrentVertex()); + } + else if (!p3set) { + p3set = true; + is3Pnts = true; + p3 = BRep_Tool::Pnt(wexpl.CurrentVertex()); + } + else { + is3Pnts = false; + break; + } + } + + // Construct a plane for the case of three points in the wire. + gp_Pln plane; + if (is3Pnts) { + gce_MakePln mkPln(p1, p2, p3); + if (mkPln.IsDone()) { + plane = mkPln.Value(); + } + else { + is3Pnts = false; + } + } + + // Construct a face based on the plane (in case of three points in the wire) or + // allow MakeFace to build the plane itself (in case of the number of points is greater than 3). + if (is3Pnts) { + BRepBuilderAPI_MakeFace MK (plane, theWire, isPlanarWanted); + if (MK.IsDone()) { + theResult = MK.Shape(); + return; + } + } + else { + BRepBuilderAPI_MakeFace MK (theWire, isPlanarWanted); + if (MK.IsDone()) { + theResult = MK.Shape(); + return; + } + } + } + else { + // try to build face on plane or on any surface under the edges of the wire + BRepBuilderAPI_MakeFace MK (theWire, isPlanarWanted); + if (MK.IsDone()) { + theResult = MK.Shape(); + return; + } } if (!isPlanarWanted) { diff --git a/src/GEOMImpl/GEOMImpl_Fillet1d.cxx b/src/GEOMImpl/GEOMImpl_Fillet1d.cxx index 6c0a67f7f..24123d0b7 100644 --- a/src/GEOMImpl/GEOMImpl_Fillet1d.cxx +++ b/src/GEOMImpl/GEOMImpl_Fillet1d.cxx @@ -1,763 +1,775 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// File : GEOMImpl_Fillet1d.cxx -// Module : GEOMImpl -// -#include "GEOMImpl_Fillet1d.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/** - * class GEOMImpl_Fillet1d - */ - - -//======================================================================= -//function : Constructor -//purpose : -//======================================================================= -GEOMImpl_Fillet1d::GEOMImpl_Fillet1d(const TopoDS_Edge& theEdge1, - const TopoDS_Edge& theEdge2, - const gp_Pln& thePlane) -: myEdgesExchnged( Standard_False ) -{ - myPlane = new Geom_Plane(thePlane); - - BRepAdaptor_Curve aBAC1(theEdge1); - BRepAdaptor_Curve aBAC2(theEdge2); - if (aBAC1.GetType() < aBAC2.GetType()) - { // first curve must be more complicated - myEdge1 = theEdge2; - myEdge2 = theEdge1; - myEdgesExchnged = Standard_True; - } - else - { - myEdge1 = theEdge1; - myEdge2 = theEdge2; - } - - Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(myEdge1, myStart1, myEnd1); - Handle(Geom_Curve) aCurve2 = BRep_Tool::Curve(myEdge2, myStart2, myEnd2); - - myCurve1 = GeomProjLib::Curve2d(aCurve1, myStart1, myEnd1, myPlane); - myCurve2 = GeomProjLib::Curve2d(aCurve2, myStart2, myEnd2, myPlane); - - while (myCurve1->IsPeriodic() && myStart1 >= myEnd1) - myEnd1 += myCurve1->Period(); - while (myCurve2->IsPeriodic() && myStart2 >= myEnd2) - myEnd2 += myCurve2->Period(); - - if (aBAC1.GetType() == aBAC2.GetType()) - { - if (myEnd2 - myStart2 < myEnd1 - myStart1) - { // first curve must be parametrically shorter - TopoDS_Edge anEdge = myEdge1; - myEdge1 = myEdge2; - myEdge2 = anEdge; - Handle(Geom2d_Curve) aCurve = myCurve1; - myCurve1 = myCurve2; - myCurve2 = aCurve; - Standard_Real a = myStart1; - myStart1 = myStart2; - myStart2 = a; - a = myEnd1; - myEnd1 = myEnd2; - myEnd2 = a; - myEdgesExchnged = Standard_True; - } - } -} - -//======================================================================= -//function : isRadiusIntersected -//purpose : local function -//======================================================================= -static Standard_Boolean isRadiusIntersected(const Handle(Geom2d_Curve)& theCurve, - const gp_Pnt2d theStart, - const gp_Pnt2d theEnd, - const Standard_Boolean theStartConnected) -{ - const Standard_Real aTol = Precision::Confusion(); - const Standard_Real anAngTol = Precision::Angular(); - Geom2dAPI_InterCurveCurve anInter(theCurve, new Geom2d_Line(theStart, - gp_Dir2d(gp_Vec2d(theStart, theEnd))), aTol); - Standard_Integer a; - gp_Pnt2d aPoint; - for(a = anInter.NbPoints(); a > 0; a--) - { - aPoint = anInter.Point(a); - if ( aPoint.Distance(theStart) < aTol && !theStartConnected ) - return Standard_True; - if (aPoint.Distance(theEnd) < aTol * 200) - return Standard_True; - if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol)) - return Standard_True; - } - Handle(Geom2d_Curve) aCurve; - for(a = anInter.NbSegments(); a > 0; a--) - { - anInter.Segment(a, aCurve); - aPoint = aCurve->Value(aCurve->FirstParameter()); - if (aPoint.Distance(theStart) < aTol) - if (!theStartConnected) - return Standard_True; - if (aPoint.Distance(theEnd) < aTol) - return Standard_True; - if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol)) - return Standard_True; - aPoint = aCurve->Value(aCurve->LastParameter()); - if (aPoint.Distance(theStart) < aTol) - if (!theStartConnected) - return Standard_True; - if (aPoint.Distance(theEnd) < aTol) - return Standard_True; - if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol)) - return Standard_True; - } - return Standard_False; -} - - -//======================================================================= -//function : fillPoint -//purpose : -//======================================================================= -void GEOMImpl_Fillet1d::fillPoint(GEOMImpl_Fillet1dPoint* thePoint) -{ - gp_Pnt2d aPoint; - gp_Vec2d aVec; - const Standard_Real aTol = Precision::Confusion(); - myCurve1->D1(thePoint->GetParam(), aPoint, aVec); - if (aVec.SquareMagnitude() < aTol) - return; - - gp_Vec2d aPerp(((myStartSide)?-1:1) * aVec.Y(), ((myStartSide)?1:-1) * aVec.X()); - aPerp.Normalize(); - aPerp.Multiply(myRadius); - gp_Pnt2d aCenter = aPoint.Translated(aPerp); - thePoint->SetCenter(aCenter); - - // on the intersection point - Standard_Boolean aValid = Standard_True; - Geom2dAPI_ProjectPointOnCurve aProjInt(aPoint, myCurve2); - if (aProjInt.NbPoints() && aPoint.Distance(aProjInt.NearestPoint()) < aTol) - aValid = Standard_False; - else - aValid = !isRadiusIntersected(myCurve2, aPoint, aCenter, Standard_True); - - Geom2dAPI_ProjectPointOnCurve aProj(aCenter, myCurve2); - Standard_Integer a, aNB = aProj.NbPoints(); - for(a = aNB; a > 0; a--) - { - if (aPoint.Distance(aProj.Point(a)) < aTol) - continue; - - Standard_Boolean aValid2 = aValid; - if (aValid2) - aValid2 = !isRadiusIntersected(myCurve1, aCenter, aProj.Point(a), Standard_False); - - // checking the right parameter - Standard_Real aParam = aProj.Parameter(a); - while(myCurve2->IsPeriodic() && aParam < myStart2) - aParam += myCurve2->Period(); - - thePoint->AddValue(aProj.Distance(a) * aProj.Distance(a) - myRadius * myRadius, - (aParam >= myStart2 && aParam <= myEnd2 && aValid2)); - if (fabs(fabs(aProj.Distance(a)) - myRadius) < aTol) - thePoint->SetParam2(aParam); - } -} - -//======================================================================= -//function : fillDiff -//purpose : -//======================================================================= -void GEOMImpl_Fillet1d::fillDiff(GEOMImpl_Fillet1dPoint* thePoint, Standard_Real theDiffStep, Standard_Boolean theFront) -{ - GEOMImpl_Fillet1dPoint* aDiff = - new GEOMImpl_Fillet1dPoint(thePoint->GetParam() + (theFront?(theDiffStep):(-theDiffStep))); - fillPoint(aDiff); - if (!thePoint->ComputeDifference(aDiff)) - { - aDiff->SetParam(thePoint->GetParam() + (theFront?(-theDiffStep):(theDiffStep))); - fillPoint(aDiff); - thePoint->ComputeDifference(aDiff); - } - delete aDiff; -} - -//======================================================================= -//function : Perform -//purpose : -//======================================================================= -Standard_Boolean GEOMImpl_Fillet1d::Perform(const Standard_Real theRadius) -{ - myResultParams.Clear(); - myResultOrientation.Clear(); - - Standard_Real aNBSteps = 100; - Geom2dAdaptor_Curve aGAC(myCurve1); - switch (aGAC.GetType()) - { - case GeomAbs_Line: - aNBSteps = 2; - break; - case GeomAbs_Circle: - aNBSteps = 4; - break; - case GeomAbs_Ellipse: - aNBSteps = 5; - break; - case GeomAbs_BezierCurve: - case GeomAbs_BSplineCurve: - aNBSteps = 2 + aGAC.Degree() * aGAC.NbPoles(); - break; - default: // unknown: maximum - aNBSteps = 100; - } - - myRadius = theRadius; - Standard_Real aParam, aStep, aDStep; - aStep = (myEnd1 - myStart1) / aNBSteps; - aDStep = aStep/1000.; - - Standard_Integer aCycle; - for(aCycle = 2, myStartSide = Standard_False; aCycle; myStartSide = !myStartSide, aCycle--) - { - GEOMImpl_Fillet1dPoint *aLeft = NULL, *aRight = NULL; - - for(aParam = myStart1 + aStep; aParam < myEnd1 || fabs(myEnd1 - aParam) < Precision::Confusion(); aParam += aStep) - { - if (!aLeft) - { - aLeft = new GEOMImpl_Fillet1dPoint(aParam - aStep); - fillPoint(aLeft); - fillDiff(aLeft, aDStep, Standard_True); - } - - aRight = new GEOMImpl_Fillet1dPoint(aParam); - fillPoint(aRight); - fillDiff(aRight, aDStep, Standard_False); - - aLeft->FilterPoints(aRight); - performNewton(aLeft, aRight); - - delete aLeft; - aLeft = aRight; - } - delete aLeft; - } - - if (myResultParams.Extent()) - return Standard_True; - - return Standard_False; -} - -//======================================================================= -//function : processPoint -//purpose : -//======================================================================= -Standard_Boolean GEOMImpl_Fillet1d::processPoint(GEOMImpl_Fillet1dPoint* theLeft, - GEOMImpl_Fillet1dPoint* theRight, - Standard_Real theParameter) -{ - if (theParameter >= theLeft->GetParam() && theParameter < theRight->GetParam()) - { - Standard_Real aDX = theRight->GetParam() - theLeft->GetParam(); - if (theParameter - theLeft->GetParam() < aDX / 100.) - { - theParameter = theLeft->GetParam() + aDX / 100.; - } - if (theRight->GetParam() - theParameter < aDX / 100.) - { - theParameter = theRight->GetParam() - aDX / 100.; - } - - GEOMImpl_Fillet1dPoint* aPoint1 = theLeft->Copy(); - GEOMImpl_Fillet1dPoint* aPoint2 = new GEOMImpl_Fillet1dPoint(theParameter); - fillPoint(aPoint2); - fillDiff(aPoint2, aDX / 1000., Standard_True); - - aPoint1->FilterPoints(aPoint2); - performNewton(aPoint1, aPoint2); - aPoint2->FilterPoints(theRight); - performNewton(aPoint2, theRight); - - delete aPoint1; - delete aPoint2; - return Standard_True; - } - - return Standard_False; -} - -//======================================================================= -//function : performNewton -//purpose : -//======================================================================= -void GEOMImpl_Fillet1d::performNewton(GEOMImpl_Fillet1dPoint* theLeft, - GEOMImpl_Fillet1dPoint* theRight) -{ - Standard_Integer a; - // check the left: if this is solution store it and remove it from the list of researching points of theLeft - a = theLeft->HasSolution(myRadius); - if (a) - { - if (theLeft->IsValid(a)) - { - myResultParams.Append(theLeft->GetParam()); - myResultOrientation.Append(myStartSide); - } - return; - } - - Standard_Real aDX = theRight->GetParam() - theLeft->GetParam(); - if ( aDX < Precision::Confusion() / 1000000.) - { - a = theRight->HasSolution(myRadius); - if (a) - if (theRight->IsValid(a)) - { - myResultParams.Append(theRight->GetParam()); - myResultOrientation.Append(myStartSide); - } - return; - } - - for(a = 1; a <= theLeft->GetNBValues(); a++) - { - Standard_Integer aNear = theLeft->GetNear(a); - - Standard_Real aA = (theRight->GetDiff(aNear) - theLeft->GetDiff(a)) / aDX; - Standard_Real aB = theLeft->GetDiff(a) - aA * theLeft->GetParam(); - Standard_Real aC = theLeft->GetValue(a) - theLeft->GetDiff(a) * theLeft->GetParam() + - aA * theLeft->GetParam() * theLeft->GetParam() / 2.0; - Standard_Real aDet = aB * aB - 2.0 * aA * aC; - - if ( fabs(aDet) < gp::Resolution() ) - continue; - - if (fabs(aA) < Precision::Confusion()) - { // linear case - if (fabs(aB) > 10e-20) - { - Standard_Real aX0 = - aC / aB; // use extremum - if (aX0 > theLeft->GetParam() && aX0 < theRight->GetParam()) - processPoint(theLeft, theRight, aX0); - } - else - { - processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise - } - } - else - { - if (fabs(aB) > fabs(aDet * 1000000.)) - { // possible floating point operations accurancy errors - processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise - } - else - { - if (aDet > 0) - { // two solutions - aDet = sqrt(aDet); - Standard_Boolean aRes = processPoint(theLeft, theRight, (- aB + aDet) / aA); - if (!aRes) - aRes = processPoint(theLeft, theRight, (- aB - aDet) / aA); - if (!aRes) - processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise - } - else - { - Standard_Real aX0 = - aB / aA; // use extremum - if (aX0 > theLeft->GetParam() && aX0 < theRight->GetParam()) - processPoint(theLeft, theRight, aX0); - else - processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise - } - } - } - } -} - -//======================================================================= -//function : Result -//purpose : -//======================================================================= -TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint, - TopoDS_Edge& theEdge1, - TopoDS_Edge& theEdge2) -{ - TopoDS_Edge aResult; - gp_Pnt2d aTargetPoint2d; - Standard_Real aX, aY; - ElSLib::PlaneParameters(myPlane->Pln().Position(), thePoint, aX, aY); - aTargetPoint2d.SetCoord(aX, aY); - - // choose the nearest circle - Standard_Real aDistance, aP; - GEOMImpl_Fillet1dPoint *aNearest; - Standard_Integer a; - TColStd_ListIteratorOfListOfReal anIter(myResultParams); - for(aNearest = NULL, a = 1; anIter.More(); anIter.Next(), a++) - { - myStartSide = (myResultOrientation.Value(a)) ? Standard_True : Standard_False; - GEOMImpl_Fillet1dPoint *aPoint = new GEOMImpl_Fillet1dPoint(anIter.Value()); - fillPoint(aPoint); - if (!aPoint->HasSolution(myRadius)) - continue; - aP = fabs(aPoint->GetCenter().Distance(aTargetPoint2d) - myRadius); - if (!aNearest || aP < aDistance) - { - aNearest = aPoint; - aDistance = aP; - } - else - { - delete aPoint; - } - } - - if (!aNearest) - return aResult; - - // create circle edge - gp_Pnt aCenter = ElSLib::PlaneValue(aNearest->GetCenter().X(), - aNearest->GetCenter().Y(), - myPlane->Pln().Position()); - Handle(Geom_Circle) aCircle = - new Geom_Circle(gp_Ax2(aCenter, myPlane->Pln().Axis().Direction()), myRadius); - gp_Pnt2d aPoint2d1, aPoint2d2; - myCurve1->D0(aNearest->GetParam(), aPoint2d1); - myCurve2->D0(aNearest->GetParam2(), aPoint2d2); - gp_Pnt aPoint1 = ElSLib::PlaneValue(aPoint2d1.X(), aPoint2d1.Y(), myPlane->Pln().Position()); - gp_Pnt aPoint2 = ElSLib::PlaneValue(aPoint2d2.X(), aPoint2d2.Y(), myPlane->Pln().Position()); - - GeomAPI_ProjectPointOnCurve aProj(thePoint, aCircle); - Standard_Real aTarGetParam = aProj.LowerDistanceParameter(); - gp_Pnt aPointOnCircle = aProj.NearestPoint(); - - // Check extrema point manually, because there is a bug in Open CASCADE - // in calculation of nearest point to a circle near the parameter 0.0 - gp_Pnt p0 = ElCLib::Value(0.0, aCircle->Circ()); - if (p0.Distance(thePoint) < aPointOnCircle.Distance(thePoint)) - { - aTarGetParam = 0.0; - aPointOnCircle = p0; - } - - aProj.Perform(aPoint1); - Standard_Real aParam1 = aProj.LowerDistanceParameter(); - aProj.Perform(aPoint2); - Standard_Real aParam2 = aProj.LowerDistanceParameter(); - Standard_Boolean aIsOut = ((aParam1 < aTarGetParam && aParam2 < aTarGetParam) || - (aParam1 > aTarGetParam && aParam2 > aTarGetParam)); - if (aParam1 > aParam2) - aIsOut = !aIsOut; - BRepBuilderAPI_MakeEdge aBuilder(aCircle->Circ(), - aIsOut ? aParam2 : aParam1, - aIsOut? aParam1 : aParam2); - aResult = aBuilder.Edge(); - - // divide edges - Standard_Real aStart, anEnd; - Handle(Geom_Curve) aCurve = BRep_Tool::Curve(myEdge1, aStart, anEnd); - gp_Vec aDir; - aCurve->D1(aNearest->GetParam(), aPoint1, aDir); - - gp_Vec aCircleDir; - aCircle->D1(aParam1, aPoint1, aCircleDir); - if ((aCircleDir.Angle(aDir) > PI / 2.0) ^ aIsOut) - aStart = aNearest->GetParam(); - else - anEnd = aNearest->GetParam(); - - //Check the case when start and end are identical. This happens - //when the edge decreases to size 0. Old ww5 allows such - //cases. So we are again bug compatible - if (fabs(aStart - anEnd) < Precision::PConfusion()/*gp::Resolution()*/) - anEnd = 0.01; - //Divide edge - BRepBuilderAPI_MakeEdge aDivider1(aCurve, aStart, anEnd); - if (myEdgesExchnged) - theEdge2 = aDivider1.Edge(); - else - theEdge1 = aDivider1.Edge(); - - - aCurve = BRep_Tool::Curve(myEdge2, aStart, anEnd); - aCurve->D1(aNearest->GetParam2(), aPoint2, aDir); - - aCircle->D1(aParam2, aPoint2, aCircleDir); - if ((aCircleDir.Angle(aDir) > PI / 2.0) ^ (!aIsOut)) - aStart = aNearest->GetParam2(); - else - anEnd = aNearest->GetParam2(); - - //Check the case when start and end are identical. This happens - //when the edge decreases to size 0. Old ww5 allows such - //cases. So we are again bug compatible - if (fabs(aStart - anEnd) < Precision::PConfusion()/*gp::Resolution()*/) - anEnd = 0.01; - BRepBuilderAPI_MakeEdge aDivider2(aCurve, aStart, anEnd); - if (myEdgesExchnged) - theEdge1 = aDivider2.Edge(); - else - theEdge2 = aDivider2.Edge(); - - delete aNearest; - return aResult; -} - -//======================================================================= -//function : AddValue -//purpose : -//======================================================================= -void GEOMImpl_Fillet1dPoint::AddValue(Standard_Real theValue, Standard_Boolean theValid) -{ - Standard_Integer a; - for(a = 1; a <= myV.Length(); a++) - { - if (theValue < myV.Value(a)) - { - myV.InsertBefore(a, theValue); - myValid.InsertBefore(a, (Standard_Integer)theValid); - return; - } - } - myV.Append(theValue); - myValid.Append((Standard_Integer)theValid); -} - -//======================================================================= -//function : ComputeDifference -//purpose : -//======================================================================= -Standard_Boolean GEOMImpl_Fillet1dPoint::ComputeDifference(GEOMImpl_Fillet1dPoint* thePoint) -{ - Standard_Integer a; - Standard_Boolean aDiffsSet = (myD.Length() != 0); - Standard_Real aDX = thePoint->GetParam() - myParam, aDY; - if (thePoint->myV.Length() == myV.Length()) - { // absolutely the same points - for(a = 1; a <= myV.Length(); a++) - { - aDY = thePoint->myV.Value(a) - myV.Value(a); - if ( aDiffsSet ) - myD.SetValue(a, fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0); - else - myD.Append( fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0); - } - return Standard_True; - } - // between the diffeerent points searching for nearest analogs - Standard_Integer b; - for(a = 1; a <= myV.Length(); a++) - { - for(b = 1; b <= thePoint->myV.Length(); b++) - { - if (b == 1 || fabs(thePoint->myV.Value(b) - myV.Value(a)) < fabs(aDY)) - aDY = thePoint->myV.Value(b) - myV.Value(a); - } - if (aDiffsSet) - { - if ( fabs(aDX) > gp::Resolution() && fabs(aDY / aDX) < fabs(myD.Value(a))) - myD.SetValue(a, aDY / aDX); - else - myD.SetValue(a, 0); - } - else - { - myD.Append( fabs(aDX) > gp::Resolution() ? aDY/aDX : 0); - } - } - - return Standard_False; -} - -//======================================================================= -//function : FilterPoints -//purpose : -//======================================================================= -void GEOMImpl_Fillet1dPoint::FilterPoints(GEOMImpl_Fillet1dPoint* thePoint) -{ - Standard_Integer a, b; - TColStd_SequenceOfReal aDiffs; - Standard_Real aY, aY2, aDX = thePoint->GetParam() - myParam; - for(a = 1; a <= myV.Length(); a++) - { - // searching for near point from thePoint - Standard_Integer aNear = 0; - Standard_Real aDiff = aDX * 10000.; - aY = myV.Value(a) + myD.Value(a) * aDX; - for(b = 1; b <= thePoint->myV.Length(); b++) - { - // calculate hypothesis value of the Y2 with the constant first and second derivative - aY2 = aY + aDX * (thePoint->myD.Value(b) - myD.Value(a)) / 2.0; - if (aNear == 0 || fabs(aY2 - thePoint->myV.Value(b)) < fabs(aDiff)) - { - aNear = b; - aDiff = aY2 - thePoint->myV.Value(b); - } - }//for b... - - if (aNear) - { - if (myV.Value(a) * thePoint->myV.Value(aNear) > 0) - {// the same sign at the same sides of the interval - if (myV.Value(a) * myD.Value(a) > 0) - { - if (fabs(myD.Value(a)) > Precision::Confusion()) - aNear = 0; - } - else - { - if (fabs(myV.Value(a)) > fabs(thePoint->myV.Value(aNear))) - if (thePoint->myV.Value(aNear) * thePoint->myD.Value(aNear) < 0 && - fabs(thePoint->myD.Value(aNear)) > Precision::Confusion()) - { - aNear = 0; - } - } - } - } - - if (aNear) - { - if (myV.Value(a) * thePoint->myV.Value(aNear) > 0) - { - if ((myV.Value(a) + myD.Value(a) * aDX) * myV.Value(a) > Precision::Confusion() && - (thePoint->myV.Value(aNear) + thePoint->myD.Value(aNear) * aDX) * thePoint->myV.Value(aNear) > Precision::Confusion()) - { - aNear = 0; - } - } - } - - if (aNear) - { - if ( fabs(aDX) < gp::Resolution() || fabs(aDiff / aDX) > 1.e+7) - { - aNear = 0; - } - } - - if (aNear == 0) - { // there is no near: remove it from the list - myV.Remove(a); - myD.Remove(a); - myValid.Remove(a); - a--; - } - else - { - Standard_Boolean aFound = Standard_False; - for(b = 1; b <= myNear.Length(); b++) - { - if (myNear.Value(b) == aNear) - { - if (fabs(aDiffs.Value(b)) < fabs(aDiff)) - { // return this 'near' - aFound = Standard_True; - myV.Remove(a); - myD.Remove(a); - myValid.Remove(a); - a--; - break; - } - else - { // remove the old 'near' - myV.Remove(b); - myD.Remove(b); - myValid.Remove(b); - myNear.Remove(b); - aDiffs.Remove(b); - a--; - break; - } - } - }//for b... - if (!aFound) - { - myNear.Append(aNear); - aDiffs.Append(aDiff); - } - } - }//for a... -} - -//======================================================================= -//function : Copy -//purpose : -//======================================================================= -GEOMImpl_Fillet1dPoint* GEOMImpl_Fillet1dPoint::Copy() -{ - GEOMImpl_Fillet1dPoint* aCopy = new GEOMImpl_Fillet1dPoint(myParam); - Standard_Integer a; - for(a = 1; a <= myV.Length(); a++) - { - aCopy->myV.Append(myV.Value(a)); - aCopy->myD.Append(myD.Value(a)); - aCopy->myValid.Append(myValid.Value(a)); - } - return aCopy; -} - -//======================================================================= -//function : HasSolution -//purpose : -//======================================================================= -Standard_Integer GEOMImpl_Fillet1dPoint::HasSolution(const Standard_Real theRadius) -{ - Standard_Integer a; - for(a = 1; a <= myV.Length(); a++) - { - if (fabs(sqrt(fabs(fabs(myV.Value(a)) + theRadius * theRadius)) - theRadius) < Precision::Confusion() / 10.) - return a; - } - return 0; -} - -//======================================================================= -//function : RemoveSolution -//purpose : -//======================================================================= -void GEOMImpl_Fillet1dPoint::RemoveSolution(Standard_Integer theIndex) -{ - myV.Remove(theIndex); - myD.Remove(theIndex); - myValid.Remove(theIndex); - myNear.Remove(theIndex); -} +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// File : GEOMImpl_Fillet1d.cxx +// Module : GEOMImpl +// +#include "GEOMImpl_Fillet1d.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * class GEOMImpl_Fillet1d + */ + + +//======================================================================= +//function : Constructor +//purpose : +//======================================================================= +GEOMImpl_Fillet1d::GEOMImpl_Fillet1d(const TopoDS_Edge& theEdge1, + const TopoDS_Edge& theEdge2, + const gp_Pln& thePlane) +: myEdgesExchnged( Standard_False ) +{ + myPlane = new Geom_Plane(thePlane); + + BRepAdaptor_Curve aBAC1(theEdge1); + BRepAdaptor_Curve aBAC2(theEdge2); + if (aBAC1.GetType() < aBAC2.GetType()) + { // first curve must be more complicated + myEdge1 = theEdge2; + myEdge2 = theEdge1; + myEdgesExchnged = Standard_True; + } + else + { + myEdge1 = theEdge1; + myEdge2 = theEdge2; + } + + Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(myEdge1, myStart1, myEnd1); + Handle(Geom_Curve) aCurve2 = BRep_Tool::Curve(myEdge2, myStart2, myEnd2); + + myCurve1 = GeomProjLib::Curve2d(aCurve1, myStart1, myEnd1, myPlane); + myCurve2 = GeomProjLib::Curve2d(aCurve2, myStart2, myEnd2, myPlane); + + while (myCurve1->IsPeriodic() && myStart1 >= myEnd1) + myEnd1 += myCurve1->Period(); + while (myCurve2->IsPeriodic() && myStart2 >= myEnd2) + myEnd2 += myCurve2->Period(); + + if (aBAC1.GetType() == aBAC2.GetType()) + { + if (myEnd2 - myStart2 < myEnd1 - myStart1) + { // first curve must be parametrically shorter + TopoDS_Edge anEdge = myEdge1; + myEdge1 = myEdge2; + myEdge2 = anEdge; + Handle(Geom2d_Curve) aCurve = myCurve1; + myCurve1 = myCurve2; + myCurve2 = aCurve; + Standard_Real a = myStart1; + myStart1 = myStart2; + myStart2 = a; + a = myEnd1; + myEnd1 = myEnd2; + myEnd2 = a; + myEdgesExchnged = Standard_True; + } + } +} + +//======================================================================= +//function : isRadiusIntersected +//purpose : local function +//======================================================================= +static Standard_Boolean isRadiusIntersected(const Handle(Geom2d_Curve)& theCurve, + const gp_Pnt2d theStart, + const gp_Pnt2d theEnd, + const Standard_Boolean theStartConnected) +{ + const Standard_Real aTol = Precision::Confusion(); + const Standard_Real anAngTol = Precision::Angular(); + Geom2dAPI_InterCurveCurve anInter(theCurve, new Geom2d_Line(theStart, + gp_Dir2d(gp_Vec2d(theStart, theEnd))), aTol); + Standard_Integer a; + gp_Pnt2d aPoint; + for(a = anInter.NbPoints(); a > 0; a--) + { + aPoint = anInter.Point(a); + if ( aPoint.Distance(theStart) < aTol && !theStartConnected ) + return Standard_True; + if (aPoint.Distance(theEnd) < aTol * 200) + return Standard_True; + if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol)) + return Standard_True; + } + Handle(Geom2d_Curve) aCurve; + for(a = anInter.NbSegments(); a > 0; a--) + { + anInter.Segment(a, aCurve); + aPoint = aCurve->Value(aCurve->FirstParameter()); + if (aPoint.Distance(theStart) < aTol) + if (!theStartConnected) + return Standard_True; + if (aPoint.Distance(theEnd) < aTol) + return Standard_True; + if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol)) + return Standard_True; + aPoint = aCurve->Value(aCurve->LastParameter()); + if (aPoint.Distance(theStart) < aTol) + if (!theStartConnected) + return Standard_True; + if (aPoint.Distance(theEnd) < aTol) + return Standard_True; + if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol)) + return Standard_True; + } + return Standard_False; +} + + +//======================================================================= +//function : fillPoint +//purpose : +//======================================================================= +void GEOMImpl_Fillet1d::fillPoint(GEOMImpl_Fillet1dPoint* thePoint) +{ + gp_Pnt2d aPoint; + gp_Vec2d aVec; + const Standard_Real aTol = Precision::Confusion(); + myCurve1->D1(thePoint->GetParam(), aPoint, aVec); + if (aVec.SquareMagnitude() < aTol) + return; + + gp_Vec2d aPerp(((myStartSide)?-1:1) * aVec.Y(), ((myStartSide)?1:-1) * aVec.X()); + aPerp.Normalize(); + aPerp.Multiply(myRadius); + gp_Pnt2d aCenter = aPoint.Translated(aPerp); + thePoint->SetCenter(aCenter); + + // on the intersection point + Standard_Boolean aValid = Standard_True; + Geom2dAPI_ProjectPointOnCurve aProjInt(aPoint, myCurve2); + if (aProjInt.NbPoints() && aPoint.Distance(aProjInt.NearestPoint()) < aTol) + aValid = Standard_False; + else + aValid = !isRadiusIntersected(myCurve2, aPoint, aCenter, Standard_True); + + Geom2dAPI_ProjectPointOnCurve aProj(aCenter, myCurve2); + Standard_Integer a, aNB = aProj.NbPoints(); + for(a = aNB; a > 0; a--) + { + if (aPoint.Distance(aProj.Point(a)) < aTol) + continue; + + Standard_Boolean aValid2 = aValid; + if (aValid2) + aValid2 = !isRadiusIntersected(myCurve1, aCenter, aProj.Point(a), Standard_False); + + // checking the right parameter + Standard_Real aParam = aProj.Parameter(a); + while(myCurve2->IsPeriodic() && aParam < myStart2) + aParam += myCurve2->Period(); + + thePoint->AddValue(aProj.Distance(a) * aProj.Distance(a) - myRadius * myRadius, + (aParam >= myStart2 && aParam <= myEnd2 && aValid2)); + if (fabs(fabs(aProj.Distance(a)) - myRadius) < aTol) + thePoint->SetParam2(aParam); + } +} + +//======================================================================= +//function : fillDiff +//purpose : +//======================================================================= +void GEOMImpl_Fillet1d::fillDiff(GEOMImpl_Fillet1dPoint* thePoint, Standard_Real theDiffStep, Standard_Boolean theFront) +{ + GEOMImpl_Fillet1dPoint* aDiff = + new GEOMImpl_Fillet1dPoint(thePoint->GetParam() + (theFront?(theDiffStep):(-theDiffStep))); + fillPoint(aDiff); + if (!thePoint->ComputeDifference(aDiff)) + { + aDiff->SetParam(thePoint->GetParam() + (theFront?(-theDiffStep):(theDiffStep))); + fillPoint(aDiff); + thePoint->ComputeDifference(aDiff); + } + delete aDiff; +} + +//======================================================================= +//function : Perform +//purpose : +//======================================================================= +Standard_Boolean GEOMImpl_Fillet1d::Perform(const Standard_Real theRadius) +{ + myDegreeOfRecursion = 0; + myResultParams.Clear(); + myResultOrientation.Clear(); + + Standard_Real aNBSteps = 100; + Geom2dAdaptor_Curve aGAC(myCurve1); + switch (aGAC.GetType()) + { + case GeomAbs_Line: + aNBSteps = 2; + break; + case GeomAbs_Circle: + aNBSteps = 4; + break; + case GeomAbs_Ellipse: + aNBSteps = 5; + break; + case GeomAbs_BezierCurve: + case GeomAbs_BSplineCurve: + aNBSteps = 2 + aGAC.Degree() * aGAC.NbPoles(); + break; + default: // unknown: maximum + aNBSteps = 100; + } + + myRadius = theRadius; + Standard_Real aParam, aStep, aDStep; + aStep = (myEnd1 - myStart1) / aNBSteps; + aDStep = aStep/1000.; + + Standard_Integer aCycle; + for(aCycle = 2, myStartSide = Standard_False; aCycle; myStartSide = !myStartSide, aCycle--) + { + GEOMImpl_Fillet1dPoint *aLeft = NULL, *aRight = NULL; + + for(aParam = myStart1 + aStep; aParam < myEnd1 || fabs(myEnd1 - aParam) < Precision::Confusion(); aParam += aStep) + { + if (!aLeft) + { + aLeft = new GEOMImpl_Fillet1dPoint(aParam - aStep); + fillPoint(aLeft); + fillDiff(aLeft, aDStep, Standard_True); + } + + aRight = new GEOMImpl_Fillet1dPoint(aParam); + fillPoint(aRight); + fillDiff(aRight, aDStep, Standard_False); + + aLeft->FilterPoints(aRight); + performNewton(aLeft, aRight); + + delete aLeft; + aLeft = aRight; + } + delete aLeft; + } + + if (myResultParams.Extent()) + return Standard_True; + + return Standard_False; +} + +//======================================================================= +//function : processPoint +//purpose : +//======================================================================= +Standard_Boolean GEOMImpl_Fillet1d::processPoint(GEOMImpl_Fillet1dPoint* theLeft, + GEOMImpl_Fillet1dPoint* theRight, + Standard_Real theParameter) +{ + if (theParameter >= theLeft->GetParam() && theParameter < theRight->GetParam()) + { + Standard_Real aDX = theRight->GetParam() - theLeft->GetParam(); + if (theParameter - theLeft->GetParam() < aDX / 100.) + { + theParameter = theLeft->GetParam() + aDX / 100.; + } + if (theRight->GetParam() - theParameter < aDX / 100.) + { + theParameter = theRight->GetParam() - aDX / 100.; + } + + // Protection on infinite loop. + myDegreeOfRecursion++; + Standard_Real diffx = 0.001 * aDX; + if (myDegreeOfRecursion > 1000) + { + diffx *= 10.0; + if (myDegreeOfRecursion > 10000) + { + diffx *= 10.0; + if (myDegreeOfRecursion > 100000) + { + return Standard_True; + } + } + } + + GEOMImpl_Fillet1dPoint* aPoint1 = theLeft->Copy(); + GEOMImpl_Fillet1dPoint* aPoint2 = new GEOMImpl_Fillet1dPoint(theParameter); + fillPoint(aPoint2); + fillDiff(aPoint2, diffx, Standard_True); + + aPoint1->FilterPoints(aPoint2); + performNewton(aPoint1, aPoint2); + aPoint2->FilterPoints(theRight); + performNewton(aPoint2, theRight); + + delete aPoint1; + delete aPoint2; + return Standard_True; + } + + return Standard_False; +} + +//======================================================================= +//function : performNewton +//purpose : +//======================================================================= +void GEOMImpl_Fillet1d::performNewton(GEOMImpl_Fillet1dPoint* theLeft, + GEOMImpl_Fillet1dPoint* theRight) +{ + Standard_Integer a; + // check the left: if this is solution store it and remove it from the list of researching points of theLeft + a = theLeft->HasSolution(myRadius); + if (a) + { + if (theLeft->IsValid(a)) + { + myResultParams.Append(theLeft->GetParam()); + myResultOrientation.Append(myStartSide); + } + return; + } + + Standard_Real aDX = theRight->GetParam() - theLeft->GetParam(); + if ( aDX < Precision::Confusion() / 1000000.) + { + a = theRight->HasSolution(myRadius); + if (a) + if (theRight->IsValid(a)) + { + myResultParams.Append(theRight->GetParam()); + myResultOrientation.Append(myStartSide); + } + return; + } + + for(a = 1; a <= theLeft->GetNBValues(); a++) + { + Standard_Integer aNear = theLeft->GetNear(a); + + Standard_Real aA = (theRight->GetDiff(aNear) - theLeft->GetDiff(a)) / aDX; + Standard_Real aB = theLeft->GetDiff(a) - aA * theLeft->GetParam(); + Standard_Real aC = theLeft->GetValue(a) - theLeft->GetDiff(a) * theLeft->GetParam() + + aA * theLeft->GetParam() * theLeft->GetParam() / 2.0; + Standard_Real aDet = aB * aB - 2.0 * aA * aC; + + if ( fabs(aDet) < gp::Resolution() ) + continue; + + if (fabs(aA) < Precision::Confusion()) + { // linear case + if (fabs(aB) > 10e-20) + { + Standard_Real aX0 = - aC / aB; // use extremum + if (aX0 > theLeft->GetParam() && aX0 < theRight->GetParam()) + processPoint(theLeft, theRight, aX0); + } + else + { + processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise + } + } + else + { + if (fabs(aB) > fabs(aDet * 1000000.)) + { // possible floating point operations accurancy errors + processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise + } + else + { + if (aDet > 0) + { // two solutions + aDet = sqrt(aDet); + Standard_Boolean aRes = processPoint(theLeft, theRight, (- aB + aDet) / aA); + if (!aRes) + aRes = processPoint(theLeft, theRight, (- aB - aDet) / aA); + if (!aRes) + processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise + } + else + { + Standard_Real aX0 = - aB / aA; // use extremum + if (aX0 > theLeft->GetParam() && aX0 < theRight->GetParam()) + processPoint(theLeft, theRight, aX0); + else + processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise + } + } + } + } +} + +//======================================================================= +//function : Result +//purpose : +//======================================================================= +TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint, + TopoDS_Edge& theEdge1, + TopoDS_Edge& theEdge2) +{ + TopoDS_Edge aResult; + gp_Pnt2d aTargetPoint2d; + Standard_Real aX, aY; + ElSLib::PlaneParameters(myPlane->Pln().Position(), thePoint, aX, aY); + aTargetPoint2d.SetCoord(aX, aY); + + // choose the nearest circle + Standard_Real aDistance, aP; + GEOMImpl_Fillet1dPoint *aNearest; + Standard_Integer a; + TColStd_ListIteratorOfListOfReal anIter(myResultParams); + for(aNearest = NULL, a = 1; anIter.More(); anIter.Next(), a++) + { + myStartSide = (myResultOrientation.Value(a)) ? Standard_True : Standard_False; + GEOMImpl_Fillet1dPoint *aPoint = new GEOMImpl_Fillet1dPoint(anIter.Value()); + fillPoint(aPoint); + if (!aPoint->HasSolution(myRadius)) + continue; + aP = fabs(aPoint->GetCenter().Distance(aTargetPoint2d) - myRadius); + if (!aNearest || aP < aDistance) + { + aNearest = aPoint; + aDistance = aP; + } + else + { + delete aPoint; + } + } + + if (!aNearest) + return aResult; + + // create circle edge + gp_Pnt aCenter = ElSLib::PlaneValue(aNearest->GetCenter().X(), + aNearest->GetCenter().Y(), + myPlane->Pln().Position()); + Handle(Geom_Circle) aCircle = + new Geom_Circle(gp_Ax2(aCenter, myPlane->Pln().Axis().Direction()), myRadius); + gp_Pnt2d aPoint2d1, aPoint2d2; + myCurve1->D0(aNearest->GetParam(), aPoint2d1); + myCurve2->D0(aNearest->GetParam2(), aPoint2d2); + gp_Pnt aPoint1 = ElSLib::PlaneValue(aPoint2d1.X(), aPoint2d1.Y(), myPlane->Pln().Position()); + gp_Pnt aPoint2 = ElSLib::PlaneValue(aPoint2d2.X(), aPoint2d2.Y(), myPlane->Pln().Position()); + + GeomAPI_ProjectPointOnCurve aProj(thePoint, aCircle); + Standard_Real aTarGetParam = aProj.LowerDistanceParameter(); + gp_Pnt aPointOnCircle = aProj.NearestPoint(); + + // Check extrema point manually, because there is a bug in Open CASCADE + // in calculation of nearest point to a circle near the parameter 0.0 + gp_Pnt p0 = ElCLib::Value(0.0, aCircle->Circ()); + if (p0.Distance(thePoint) < aPointOnCircle.Distance(thePoint)) + { + aTarGetParam = 0.0; + aPointOnCircle = p0; + } + + aProj.Perform(aPoint1); + Standard_Real aParam1 = aProj.LowerDistanceParameter(); + aProj.Perform(aPoint2); + Standard_Real aParam2 = aProj.LowerDistanceParameter(); + Standard_Boolean aIsOut = ((aParam1 < aTarGetParam && aParam2 < aTarGetParam) || + (aParam1 > aTarGetParam && aParam2 > aTarGetParam)); + if (aParam1 > aParam2) + aIsOut = !aIsOut; + BRepBuilderAPI_MakeEdge aBuilder(aCircle->Circ(), + aIsOut ? aParam2 : aParam1, + aIsOut? aParam1 : aParam2); + aResult = aBuilder.Edge(); + + // divide edges + Standard_Real aStart, anEnd; + Handle(Geom_Curve) aCurve = BRep_Tool::Curve(myEdge1, aStart, anEnd); + gp_Vec aDir; + aCurve->D1(aNearest->GetParam(), aPoint1, aDir); + + gp_Vec aCircleDir; + aCircle->D1(aParam1, aPoint1, aCircleDir); + if ((aCircleDir.Angle(aDir) > PI / 2.0) ^ aIsOut) + aStart = aNearest->GetParam(); + else + anEnd = aNearest->GetParam(); + + if (fabs(aStart - anEnd) > Precision::Confusion()) + { + //Divide edge + BRepBuilderAPI_MakeEdge aDivider1(aCurve, aStart, anEnd); + if (myEdgesExchnged) + theEdge2 = aDivider1.Edge(); + else + theEdge1 = aDivider1.Edge(); + } + + aCurve = BRep_Tool::Curve(myEdge2, aStart, anEnd); + aCurve->D1(aNearest->GetParam2(), aPoint2, aDir); + + aCircle->D1(aParam2, aPoint2, aCircleDir); + if ((aCircleDir.Angle(aDir) > PI / 2.0) ^ (!aIsOut)) + aStart = aNearest->GetParam2(); + else + anEnd = aNearest->GetParam2(); + + if (fabs(aStart - anEnd) > Precision::Confusion()) + { + BRepBuilderAPI_MakeEdge aDivider2(aCurve, aStart, anEnd); + if (myEdgesExchnged) + theEdge1 = aDivider2.Edge(); + else + theEdge2 = aDivider2.Edge(); + } + + delete aNearest; + return aResult; +} + +//======================================================================= +//function : AddValue +//purpose : +//======================================================================= +void GEOMImpl_Fillet1dPoint::AddValue(Standard_Real theValue, Standard_Boolean theValid) +{ + Standard_Integer a; + for(a = 1; a <= myV.Length(); a++) + { + if (theValue < myV.Value(a)) + { + myV.InsertBefore(a, theValue); + myValid.InsertBefore(a, (Standard_Integer)theValid); + return; + } + } + myV.Append(theValue); + myValid.Append((Standard_Integer)theValid); +} + +//======================================================================= +//function : ComputeDifference +//purpose : +//======================================================================= +Standard_Boolean GEOMImpl_Fillet1dPoint::ComputeDifference(GEOMImpl_Fillet1dPoint* thePoint) +{ + Standard_Integer a; + Standard_Boolean aDiffsSet = (myD.Length() != 0); + Standard_Real aDX = thePoint->GetParam() - myParam, aDY; + if (thePoint->myV.Length() == myV.Length()) + { // absolutely the same points + for(a = 1; a <= myV.Length(); a++) + { + aDY = thePoint->myV.Value(a) - myV.Value(a); + if ( aDiffsSet ) + myD.SetValue(a, fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0); + else + myD.Append( fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0); + } + return Standard_True; + } + // between the diffeerent points searching for nearest analogs + Standard_Integer b; + for(a = 1; a <= myV.Length(); a++) + { + for(b = 1; b <= thePoint->myV.Length(); b++) + { + if (b == 1 || fabs(thePoint->myV.Value(b) - myV.Value(a)) < fabs(aDY)) + aDY = thePoint->myV.Value(b) - myV.Value(a); + } + if (aDiffsSet) + { + if ( fabs(aDX) > gp::Resolution() && fabs(aDY / aDX) < fabs(myD.Value(a))) + myD.SetValue(a, aDY / aDX); + else + myD.SetValue(a, 0); + } + else + { + myD.Append( fabs(aDX) > gp::Resolution() ? aDY/aDX : 0); + } + } + + return Standard_False; +} + +//======================================================================= +//function : FilterPoints +//purpose : +//======================================================================= +void GEOMImpl_Fillet1dPoint::FilterPoints(GEOMImpl_Fillet1dPoint* thePoint) +{ + Standard_Integer a, b; + TColStd_SequenceOfReal aDiffs; + Standard_Real aY, aY2, aDX = thePoint->GetParam() - myParam; + for(a = 1; a <= myV.Length(); a++) + { + // searching for near point from thePoint + Standard_Integer aNear = 0; + Standard_Real aDiff = aDX * 10000.; + aY = myV.Value(a) + myD.Value(a) * aDX; + for(b = 1; b <= thePoint->myV.Length(); b++) + { + // calculate hypothesis value of the Y2 with the constant first and second derivative + aY2 = aY + aDX * (thePoint->myD.Value(b) - myD.Value(a)) / 2.0; + if (aNear == 0 || fabs(aY2 - thePoint->myV.Value(b)) < fabs(aDiff)) + { + aNear = b; + aDiff = aY2 - thePoint->myV.Value(b); + } + }//for b... + + if (aNear) + { + if (myV.Value(a) * thePoint->myV.Value(aNear) > 0) + {// the same sign at the same sides of the interval + if (myV.Value(a) * myD.Value(a) > 0) + { + if (fabs(myD.Value(a)) > Precision::Confusion()) + aNear = 0; + } + else + { + if (fabs(myV.Value(a)) > fabs(thePoint->myV.Value(aNear))) + if (thePoint->myV.Value(aNear) * thePoint->myD.Value(aNear) < 0 && + fabs(thePoint->myD.Value(aNear)) > Precision::Confusion()) + { + aNear = 0; + } + } + } + } + + if (aNear) + { + if (myV.Value(a) * thePoint->myV.Value(aNear) > 0) + { + if ((myV.Value(a) + myD.Value(a) * aDX) * myV.Value(a) > Precision::Confusion() && + (thePoint->myV.Value(aNear) + thePoint->myD.Value(aNear) * aDX) * thePoint->myV.Value(aNear) > Precision::Confusion()) + { + aNear = 0; + } + } + } + + if (aNear) + { + if ( fabs(aDX) < gp::Resolution() || fabs(aDiff / aDX) > 1.e+7) + { + aNear = 0; + } + } + + if (aNear == 0) + { // there is no near: remove it from the list + myV.Remove(a); + myD.Remove(a); + myValid.Remove(a); + a--; + } + else + { + Standard_Boolean aFound = Standard_False; + for(b = 1; b <= myNear.Length(); b++) + { + if (myNear.Value(b) == aNear) + { + if (fabs(aDiffs.Value(b)) < fabs(aDiff)) + { // return this 'near' + aFound = Standard_True; + myV.Remove(a); + myD.Remove(a); + myValid.Remove(a); + a--; + break; + } + else + { // remove the old 'near' + myV.Remove(b); + myD.Remove(b); + myValid.Remove(b); + myNear.Remove(b); + aDiffs.Remove(b); + a--; + break; + } + } + }//for b... + if (!aFound) + { + myNear.Append(aNear); + aDiffs.Append(aDiff); + } + } + }//for a... +} + +//======================================================================= +//function : Copy +//purpose : +//======================================================================= +GEOMImpl_Fillet1dPoint* GEOMImpl_Fillet1dPoint::Copy() +{ + GEOMImpl_Fillet1dPoint* aCopy = new GEOMImpl_Fillet1dPoint(myParam); + Standard_Integer a; + for(a = 1; a <= myV.Length(); a++) + { + aCopy->myV.Append(myV.Value(a)); + aCopy->myD.Append(myD.Value(a)); + aCopy->myValid.Append(myValid.Value(a)); + } + return aCopy; +} + +//======================================================================= +//function : HasSolution +//purpose : +//======================================================================= +Standard_Integer GEOMImpl_Fillet1dPoint::HasSolution(const Standard_Real theRadius) +{ + Standard_Integer a; + for(a = 1; a <= myV.Length(); a++) + { + if (fabs(sqrt(fabs(fabs(myV.Value(a)) + theRadius * theRadius)) - theRadius) < Precision::Confusion() / 10.) + return a; + } + return 0; +} + +//======================================================================= +//function : RemoveSolution +//purpose : +//======================================================================= +void GEOMImpl_Fillet1dPoint::RemoveSolution(Standard_Integer theIndex) +{ + myV.Remove(theIndex); + myD.Remove(theIndex); + myValid.Remove(theIndex); + myNear.Remove(theIndex); +} diff --git a/src/GEOMImpl/GEOMImpl_Fillet1d.hxx b/src/GEOMImpl/GEOMImpl_Fillet1d.hxx index 80df11a1e..c12ee1567 100644 --- a/src/GEOMImpl/GEOMImpl_Fillet1d.hxx +++ b/src/GEOMImpl/GEOMImpl_Fillet1d.hxx @@ -1,141 +1,142 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// File : GEOMImpl_Fillet1d.hxx -// Module : GEOMImpl -// -#ifndef _GEOMImpl_Fillet1d_HeaderFile -#define _GEOMImpl_Fillet1d_HeaderFile - -#include -#include -#include - -#include -#include -#include -#include - -class GEOMImpl_Fillet1dPoint; - -/** -* GEOMImpl_Fillet1d is 1D fillet algorithm on two planar edges with given radius -*/ - -class GEOMImpl_Fillet1d -{ -public: - //! Constructor - //! The fillet 1D algorithm initialise by two edges and plane - Standard_EXPORT GEOMImpl_Fillet1d(const TopoDS_Edge& theEdge1, - const TopoDS_Edge& theEdge2, - const gp_Pln& thePlane); - //! Makes fillet with given radius - //! @returns Standard_True, if at least one result computed - Standard_EXPORT Standard_Boolean Perform(const Standard_Real theRadius); - //! Returns result fillet edge and modified edges as out parameters - Standard_EXPORT TopoDS_Edge Result(const gp_Pnt& thePoint, TopoDS_Edge& theEdge1, TopoDS_Edge& theEdge2); - -private: - //! private methods - void fillPoint(GEOMImpl_Fillet1dPoint*); - void fillDiff(GEOMImpl_Fillet1dPoint*, Standard_Real, Standard_Boolean); - void performNewton(GEOMImpl_Fillet1dPoint*, GEOMImpl_Fillet1dPoint*); - Standard_Boolean processPoint(GEOMImpl_Fillet1dPoint*, GEOMImpl_Fillet1dPoint*, Standard_Real); - - -private: - //! private fields - TopoDS_Edge myEdge1, myEdge2; - Handle(Geom_Plane) myPlane; - Handle(Geom2d_Curve) myCurve1, myCurve2; - Standard_Real myStart1, myEnd1, myStart2, myEnd2, myRadius; - TColStd_ListOfReal myResultParams; - TColStd_SequenceOfInteger myResultOrientation; - Standard_Boolean myStartSide, myEdgesExchnged; -}; - - -/** -* GEOMImpl_Fillet1dPoint is an internal class for 1D fillet algorithm -* to store and compare computed solutions on edges -*/ - -class GEOMImpl_Fillet1dPoint -{ -public: - //! Puiblic methods - - //! Constructor - Standard_EXPORT GEOMImpl_Fillet1dPoint(Standard_Real theParam) - {myParam = theParam;} - - //! Make copy of point - //!WARNING: Copies only field values: myParam, myV, myD, myValid - Standard_EXPORT GEOMImpl_Fillet1dPoint* Copy(); // warning: this is not the full copy! - - //! Set/Get parameter - Standard_EXPORT inline void SetParam(Standard_Real theParam) - {myParam = theParam;} - Standard_EXPORT inline Standard_Real GetParam() const - {return myParam;} - Standard_EXPORT inline void SetParam2(const Standard_Real theParam2) - {myParam2 = theParam2;} - Standard_EXPORT inline Standard_Real GetParam2() - { return myParam2 ; } - - //! Returns validity - Standard_EXPORT inline Standard_Boolean IsValid(int theIndex) - {return (Standard_Boolean)myValid.Value(theIndex);} - - //! Get values - Standard_EXPORT inline Standard_Integer GetNBValues() {return myV.Length();} - Standard_EXPORT inline Standard_Real GetValue(Standard_Integer theIndex) - {return myV.Value(theIndex);} - Standard_EXPORT inline Standard_Real GetDiff(Standard_Integer theIndex) - {return myD.Value(theIndex);} - Standard_EXPORT inline Standard_Integer GetNear(Standard_Integer theIndex) - {return myNear.Value(theIndex);} - - //! Set/Get center point - Standard_EXPORT inline void SetCenter(const gp_Pnt2d thePoint) - {myCenter = thePoint;} - Standard_EXPORT inline const gp_Pnt2d GetCenter() - {return myCenter;} - - Standard_EXPORT void AddValue(Standard_Real theValue, Standard_Boolean theIsValid); - - //! compute difference between this and given point - Standard_EXPORT Standard_Boolean ComputeDifference(GEOMImpl_Fillet1dPoint*); - Standard_EXPORT void FilterPoints(GEOMImpl_Fillet1dPoint*); - - //! Check is point contains solution and returns the index of them if any - Standard_EXPORT Standard_Integer HasSolution(Standard_Real theRadius); - //! Remove solution by index - void RemoveSolution(Standard_Integer theIndex); - -private: - //! Private fields - gp_Pnt2d myCenter; - Standard_Real myParam, myParam2; - TColStd_SequenceOfReal myV, myD; - TColStd_SequenceOfInteger myValid, myNear; -}; - -#endif +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// File : GEOMImpl_Fillet1d.hxx +// Module : GEOMImpl +// +#ifndef _GEOMImpl_Fillet1d_HeaderFile +#define _GEOMImpl_Fillet1d_HeaderFile + +#include +#include +#include + +#include +#include +#include +#include + +class GEOMImpl_Fillet1dPoint; + +/** +* GEOMImpl_Fillet1d is 1D fillet algorithm on two planar edges with given radius +*/ + +class GEOMImpl_Fillet1d +{ +public: + //! Constructor + //! The fillet 1D algorithm initialise by two edges and plane + Standard_EXPORT GEOMImpl_Fillet1d(const TopoDS_Edge& theEdge1, + const TopoDS_Edge& theEdge2, + const gp_Pln& thePlane); + //! Makes fillet with given radius + //! @returns Standard_True, if at least one result computed + Standard_EXPORT Standard_Boolean Perform(const Standard_Real theRadius); + //! Returns result fillet edge and modified edges as out parameters + Standard_EXPORT TopoDS_Edge Result(const gp_Pnt& thePoint, TopoDS_Edge& theEdge1, TopoDS_Edge& theEdge2); + +private: + //! private methods + void fillPoint(GEOMImpl_Fillet1dPoint*); + void fillDiff(GEOMImpl_Fillet1dPoint*, Standard_Real, Standard_Boolean); + void performNewton(GEOMImpl_Fillet1dPoint*, GEOMImpl_Fillet1dPoint*); + Standard_Boolean processPoint(GEOMImpl_Fillet1dPoint*, GEOMImpl_Fillet1dPoint*, Standard_Real); + + +private: + //! private fields + TopoDS_Edge myEdge1, myEdge2; + Handle(Geom_Plane) myPlane; + Handle(Geom2d_Curve) myCurve1, myCurve2; + Standard_Real myStart1, myEnd1, myStart2, myEnd2, myRadius; + TColStd_ListOfReal myResultParams; + TColStd_SequenceOfInteger myResultOrientation; + Standard_Boolean myStartSide, myEdgesExchnged; + Standard_Integer myDegreeOfRecursion; +}; + + +/** +* GEOMImpl_Fillet1dPoint is an internal class for 1D fillet algorithm +* to store and compare computed solutions on edges +*/ + +class GEOMImpl_Fillet1dPoint +{ +public: + //! Puiblic methods + + //! Constructor + Standard_EXPORT GEOMImpl_Fillet1dPoint(Standard_Real theParam) + {myParam = theParam;} + + //! Make copy of point + //!WARNING: Copies only field values: myParam, myV, myD, myValid + Standard_EXPORT GEOMImpl_Fillet1dPoint* Copy(); // warning: this is not the full copy! + + //! Set/Get parameter + Standard_EXPORT inline void SetParam(Standard_Real theParam) + {myParam = theParam;} + Standard_EXPORT inline Standard_Real GetParam() const + {return myParam;} + Standard_EXPORT inline void SetParam2(const Standard_Real theParam2) + {myParam2 = theParam2;} + Standard_EXPORT inline Standard_Real GetParam2() + { return myParam2 ; } + + //! Returns validity + Standard_EXPORT inline Standard_Boolean IsValid(int theIndex) + {return (Standard_Boolean)myValid.Value(theIndex);} + + //! Get values + Standard_EXPORT inline Standard_Integer GetNBValues() {return myV.Length();} + Standard_EXPORT inline Standard_Real GetValue(Standard_Integer theIndex) + {return myV.Value(theIndex);} + Standard_EXPORT inline Standard_Real GetDiff(Standard_Integer theIndex) + {return myD.Value(theIndex);} + Standard_EXPORT inline Standard_Integer GetNear(Standard_Integer theIndex) + {return myNear.Value(theIndex);} + + //! Set/Get center point + Standard_EXPORT inline void SetCenter(const gp_Pnt2d thePoint) + {myCenter = thePoint;} + Standard_EXPORT inline const gp_Pnt2d GetCenter() + {return myCenter;} + + Standard_EXPORT void AddValue(Standard_Real theValue, Standard_Boolean theIsValid); + + //! compute difference between this and given point + Standard_EXPORT Standard_Boolean ComputeDifference(GEOMImpl_Fillet1dPoint*); + Standard_EXPORT void FilterPoints(GEOMImpl_Fillet1dPoint*); + + //! Check is point contains solution and returns the index of them if any + Standard_EXPORT Standard_Integer HasSolution(Standard_Real theRadius); + //! Remove solution by index + void RemoveSolution(Standard_Integer theIndex); + +private: + //! Private fields + gp_Pnt2d myCenter; + Standard_Real myParam, myParam2; + TColStd_SequenceOfReal myV, myD; + TColStd_SequenceOfInteger myValid, myNear; +}; + +#endif diff --git a/src/GEOMImpl/GEOMImpl_Fillet1dDriver.cxx b/src/GEOMImpl/GEOMImpl_Fillet1dDriver.cxx index 1056f0108..d173fba61 100644 --- a/src/GEOMImpl/GEOMImpl_Fillet1dDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_Fillet1dDriver.cxx @@ -235,9 +235,9 @@ Standard_Integer GEOMImpl_Fillet1dDriver::Execute(TFunction_Logbook& log) const // check if face edges modified, // if yes, than map to original edges (from vertex-edges list), because edges can be modified before - if (!aModifE1.IsNull() && !aModifE1.IsSame( anEdge1 )) + if (aModifE1.IsNull() || !anEdge1.IsSame( aModifE1 )) addEdgeRelation( anEdgeToEdgeMap, TopoDS::Edge(aVertexEdges.First()), aModifE1 ); - if (!aModifE2.IsNull() && !aModifE2.IsSame( anEdge2 )) + if (aModifE2.IsNull() || !anEdge2.IsSame( aModifE2 )) addEdgeRelation( anEdgeToEdgeMap, TopoDS::Edge(aVertexEdges.Last()), aModifE2 ); } @@ -251,7 +251,7 @@ Standard_Integer GEOMImpl_Fillet1dDriver::Execute(TFunction_Logbook& log) const TopoDS_Shape anEdge = anExp.Current(); if ( !anEdgeToEdgeMap.IsBound( anEdge ) ) aListOfNewEdge.Append( anEdge ); - else + else if (!anEdgeToEdgeMap.Find( anEdge ).IsNull()) aListOfNewEdge.Append( anEdgeToEdgeMap.Find( anEdge ) ); } diff --git a/src/GEOMImpl/GEOMImpl_FillingDriver.cxx b/src/GEOMImpl/GEOMImpl_FillingDriver.cxx index 521589d5b..c70a3b04f 100644 --- a/src/GEOMImpl/GEOMImpl_FillingDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_FillingDriver.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -102,7 +103,12 @@ Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const GEOMImpl_IFilling IF (aFunction); Handle(GEOM_Function) aShapeFunction = IF.GetShape(); if (aShapeFunction.IsNull()) return 0; - TopoDS_Shape aShape = aShapeFunction->GetValue(); + TopoDS_Shape aShape; + + BRepBuilderAPI_Copy Copy(aShapeFunction->GetValue()); + if( Copy.IsDone() ) + aShape = Copy.Shape(); + if (aShape.IsNull() || aShape.ShapeType() != TopAbs_COMPOUND) return 0; Standard_Integer mindeg = IF.GetMinDeg(); diff --git a/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx index 9899fc5da..9a86c59fe 100644 --- a/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx @@ -16,10 +16,8 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - // File : GEOMImpl_IAdvancedOperations.cxx // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) -// #include #include "GEOMImpl_Types.hxx" @@ -31,6 +29,7 @@ #include "GEOMImpl_IBlocksOperations.hxx" #include "GEOMImpl_I3DPrimOperations.hxx" #include "GEOMImpl_ILocalOperations.hxx" +#include "GEOMImpl_IHealingOperations.hxx" #include "GEOMImpl_Gen.hxx" @@ -81,7 +80,7 @@ */ //============================================================================= GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngine, int theDocID) : - GEOM_IOperations(theEngine, theDocID) + GEOM_IOperations(theEngine, theDocID) { MESSAGE("GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations"); myBasicOperations = new GEOMImpl_IBasicOperations(GetEngine(), GetDocID()); @@ -91,6 +90,7 @@ GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngin myBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine(), GetDocID()); my3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine(), GetDocID()); myLocalOperations = new GEOMImpl_ILocalOperations(GetEngine(), GetDocID()); + myHealingOperations = new GEOMImpl_IHealingOperations(GetEngine(), GetDocID()); } //============================================================================= @@ -108,6 +108,7 @@ GEOMImpl_IAdvancedOperations::~GEOMImpl_IAdvancedOperations() delete myBlocksOperations; delete my3DPrimOperations; delete myLocalOperations; + delete myHealingOperations; } //============================================================================= @@ -116,9 +117,9 @@ GEOMImpl_IAdvancedOperations::~GEOMImpl_IAdvancedOperations() */ //============================================================================= gp_Trsf GEOMImpl_IAdvancedOperations::GetPositionTrsf(double theL1, double theL2, - Handle(GEOM_Object) theP1, - Handle(GEOM_Object) theP2, - Handle(GEOM_Object) theP3) + Handle(GEOM_Object) theP1, + Handle(GEOM_Object) theP2, + Handle(GEOM_Object) theP3) { // Old Local Coordinates System oldLCS gp_Pnt P0(0, 0, 0); @@ -157,10 +158,10 @@ gp_Trsf GEOMImpl_IAdvancedOperations::GetPositionTrsf(double theL1, double theL2 */ //============================================================================= bool GEOMImpl_IAdvancedOperations::CheckCompatiblePosition(double& theL1, double& theL2, - Handle(GEOM_Object) theP1, - Handle(GEOM_Object) theP2, - Handle(GEOM_Object) theP3, - double theTolerance) + Handle(GEOM_Object) theP1, + Handle(GEOM_Object) theP2, + Handle(GEOM_Object) theP3, + double theTolerance) { SetErrorCode(KO); gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(theP1->GetValue())); @@ -193,7 +194,7 @@ bool GEOMImpl_IAdvancedOperations::CheckCompatiblePosition(double& theL1, double // if (fabs(newL1 - theL1) > Precision::Approximation()) { if ( (newL1 * (1 - theTolerance) -theL1 <= Precision::Approximation()) && - (newL1 * (1 + theTolerance) -theL1 >= Precision::Approximation()) ) { + (newL1 * (1 + theTolerance) -theL1 >= Precision::Approximation()) ) { // std::cerr << "theL1 = newL1" << std::endl; theL1 = newL1; } else { @@ -208,7 +209,7 @@ bool GEOMImpl_IAdvancedOperations::CheckCompatiblePosition(double& theL1, double // if (fabs(newL2 - theL2) > Precision::Approximation()) { if ( (newL2 * (1 - theTolerance) -theL2 <= Precision::Approximation()) && - (newL2 * (1 + theTolerance) -theL2 >= Precision::Approximation()) ) { + (newL2 * (1 + theTolerance) -theL2 >= Precision::Approximation()) ) { theL2 = newL2; } else { theL2 = -1; @@ -228,10 +229,10 @@ bool GEOMImpl_IAdvancedOperations::CheckCompatiblePosition(double& theL1, double */ //============================================================================= bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int shapeType, - double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - Handle(TColStd_HSequenceOfTransient) theSeq, - gp_Trsf aTrsf) + double theR1, double theW1, double theL1, + double theR2, double theW2, double theL2, + Handle(TColStd_HSequenceOfTransient) theSeq, + gp_Trsf aTrsf) { SetErrorCode(KO); @@ -244,7 +245,7 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int } gp_Trsf aTrsfInv = aTrsf.Inverted(); - + int expectedGroups = 0; if (shapeType == TSHAPE_BASIC) if (Abs(theR2+theW2-theR1-theW1) <= Precision::Approximation()) @@ -253,10 +254,10 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int expectedGroups = 11; else if (shapeType == TSHAPE_CHAMFER || shapeType == TSHAPE_FILLET) expectedGroups = 12; - + double aR1Ext = theR1 + theW1; double aR2Ext = theR2 + theW2; - + ///////////////////////// //// Groups of Faces //// ///////////////////////// @@ -274,9 +275,10 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int BRepBuilderAPI_Transform aTransformationBox(aBox->GetValue(), aTrsf, Standard_False); TopoDS_Shape aBoxShapeTrsf = aTransformationBox.Shape(); aBox->GetLastFunction()->SetValue(aBoxShapeTrsf); - + // Get the shell of the box - Handle(GEOM_Object) aShell = Handle(GEOM_Object)::DownCast(myShapesOperations->MakeExplode(aBox, TopAbs_SHELL, true)->Value(1)); + Handle(GEOM_Object) aShell = Handle(GEOM_Object)::DownCast + (myShapesOperations->MakeExplode(aBox, TopAbs_SHELL, true)->Value(1)); aBox->GetLastFunction()->SetDescription(""); aShell->GetLastFunction()->SetDescription(""); // Get the common shapes between shell and shape @@ -287,17 +289,18 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int } aCommonCompound->GetLastFunction()->SetDescription(""); // Explode the faces of common shapes => 3 faces - Handle(TColStd_HSequenceOfTransient) aCommonFaces = myShapesOperations->MakeExplode(aCommonCompound, TopAbs_FACE, true); + Handle(TColStd_HSequenceOfTransient) aCommonFaces = + myShapesOperations->MakeExplode(aCommonCompound, TopAbs_FACE, true); aCommonCompound->GetLastFunction()->SetDescription(""); std::list aCompoundOfFacesList; - + for (int i=0 ; i<= aCommonFaces->Length()-4 ; i+=4) { std::list aFacesList; for (int j = 1 ; j <= 4 ; j++) { Handle(GEOM_Object) aFace = Handle(GEOM_Object)::DownCast(aCommonFaces->Value(i+j)); // Junction faces if (!aFace.IsNull()) { - aFace->GetLastFunction()->SetDescription(""); - aFacesList.push_back(aFace); + aFace->GetLastFunction()->SetDescription(""); + aFacesList.push_back(aFace); } } Handle(GEOM_Object) aCompoundOfFaces = myShapesOperations->MakeCompound(aFacesList); @@ -316,8 +319,8 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int aCompoundOfFacesList.pop_front(); // == END // - - + + // Uncomment the following lines when GetInPlace bug is solved // == BEGIN // Handle(GEOM_Object) aP1 = myBasicOperations->MakePointXYZ(-theL1, 0, 0); @@ -338,7 +341,7 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int // aPln1->GetLastFunction()->SetDescription(""); // aPln2->GetLastFunction()->SetDescription(""); // aPln3->GetLastFunction()->SetDescription(""); -// +// // BRepBuilderAPI_Transform aTransformation1(aPln1->GetValue(), aTrsf, Standard_False); // TopoDS_Shape aTrsf_Shape1 = aTransformation1.Shape(); // aPln1->GetLastFunction()->SetValue(aTrsf_Shape1); @@ -350,10 +353,11 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int // aPln3->GetLastFunction()->SetValue(aTrsf_Shape3); // == END // - + Handle(GEOM_Object) junctionFaces1 = myShapesOperations->GetInPlace(theShape, aPln1); if (junctionFaces1.IsNull()) - junctionFaces1 = myShapesOperations->GetShapesOnShapeAsCompound(aPln1, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); + junctionFaces1 = myShapesOperations->GetShapesOnShapeAsCompound + (aPln1, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); if (!junctionFaces1.IsNull()) { junctionFaces1->GetLastFunction()->SetDescription(""); junctionFaces1->SetName("JUNCTION_FACE_1"); @@ -366,7 +370,8 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int } Handle(GEOM_Object) junctionFaces2 = myShapesOperations->GetInPlace(theShape, aPln2); if (junctionFaces2.IsNull()) - junctionFaces2 = myShapesOperations->GetShapesOnShapeAsCompound(aPln2, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); + junctionFaces2 = myShapesOperations->GetShapesOnShapeAsCompound + (aPln2, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); if (!junctionFaces2.IsNull()) { junctionFaces2->GetLastFunction()->SetDescription(""); junctionFaces2->SetName("JUNCTION_FACE_2"); @@ -379,7 +384,8 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int } Handle(GEOM_Object) junctionFaces3 = myShapesOperations->GetInPlace(theShape, aPln3); if (junctionFaces3.IsNull()) - junctionFaces3 = myShapesOperations->GetShapesOnShapeAsCompound(aPln3, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); + junctionFaces3 = myShapesOperations->GetShapesOnShapeAsCompound + (aPln3, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); if (!junctionFaces3.IsNull()) { junctionFaces3->GetLastFunction()->SetDescription(""); junctionFaces3->SetName("JUNCTION_FACE_3"); @@ -391,7 +397,7 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int // return false; } // Comment the following lines when GetInPlace bug is solved - // == BEGIN + // == BEGIN } // == END ///////////////////////// @@ -400,7 +406,7 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int // Result of propagate Handle(GEOM_Function) aFunction = theShape->GetLastFunction(); - + TCollection_AsciiString theDesc = aFunction->GetDescription(); Handle(TColStd_HSequenceOfTransient) aSeqPropagate = myBlocksOperations->Propagate(theShape); if (aSeqPropagate.IsNull() || aSeqPropagate->Length() == 0) { @@ -410,7 +416,7 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int Standard_Integer nbEdges, aNbGroups = aSeqPropagate->Length(); // Recover previous description to get rid of Propagate dump aFunction->SetDescription(theDesc); - + bool addGroup; bool circularFoundAndAdded = false; bool incidentPipeFound = false; @@ -420,162 +426,161 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int bool flangeFound = false; bool flangeFoundAndAdded = false; bool chamferOrFilletFound = false; - + for (int i=1 ; i<= aNbGroups; i++) { addGroup = false; - + Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(aSeqPropagate->Value(i)); if(aGroup.IsNull()) continue; - + TopoDS_Shape aGroupShape = aGroup->GetValue(); BRepBuilderAPI_Transform aTransformationShapeInv(aGroupShape, aTrsfInv, Standard_False); TopoDS_Shape aGroupShapeTrsfInv = aTransformationShapeInv.Shape(); - + TopTools_IndexedMapOfShape anEdgesMap; TopExp::MapShapes(aGroupShapeTrsfInv,TopAbs_EDGE, anEdgesMap); nbEdges = anEdgesMap.Extent(); if (shapeType == TSHAPE_BASIC) { if ((nbEdges == 21) || /*R1Ext = R2Ext*/(nbEdges == 17)){ - addGroup = true; - aGroup->SetName("THICKNESS"); + addGroup = true; + aGroup->SetName("THICKNESS"); } else if (nbEdges == 6) { - if (!circularFoundAndAdded) { - circularFoundAndAdded = true; - addGroup = true; - aGroup->SetName("CIRCULAR_QUARTER_PIPE"); - } + if (!circularFoundAndAdded) { + circularFoundAndAdded = true; + addGroup = true; + aGroup->SetName("CIRCULAR_QUARTER_PIPE"); + } } else if (nbEdges == 8) { - incidentPipeFound = true; - mainPipeFound = false; - radialFound =false; - flangeFound = false; - - TopExp_Explorer Ex(aGroupShapeTrsfInv,TopAbs_VERTEX); - while (Ex.More()) { - gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); - double x=aP.X(), y=aP.Y(), z=aP.Z(); - - - if ((Abs(x) > aR2Ext + Precision::Confusion()) || - (Abs(y) > aR2Ext + Precision::Confusion())) { - incidentPipeFound = false; - } - - if ( z < -Precision::Confusion()) { - // length of main pipe - mainPipeFound = true; - if (!mainPipeFoundAndAdded) { - mainPipeFoundAndAdded = true; - addGroup = true; - aGroup->SetName("HALF_LENGTH_MAIN_PIPE"); - } - } - - else if (Abs(x) > (theL1-Precision::Confusion())) { - // discretisation circulaire - radialFound = true; - if (!circularFoundAndAdded) { - circularFoundAndAdded = true; - addGroup = true; - aGroup->SetName("CIRCULAR_QUARTER_PIPE"); - } - } + incidentPipeFound = true; + mainPipeFound = false; + radialFound =false; + flangeFound = false; + + TopExp_Explorer Ex(aGroupShapeTrsfInv,TopAbs_VERTEX); + while (Ex.More()) { + gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); + double x=aP.X(), y=aP.Y(), z=aP.Z(); + + + if ((Abs(x) > aR2Ext + Precision::Confusion()) || + (Abs(y) > aR2Ext + Precision::Confusion())) { + incidentPipeFound = false; + } + + if ( z < -Precision::Confusion()) { + // length of main pipe + mainPipeFound = true; + if (!mainPipeFoundAndAdded) { + mainPipeFoundAndAdded = true; + addGroup = true; + aGroup->SetName("HALF_LENGTH_MAIN_PIPE"); + } + } + + else if (Abs(x) > (theL1-Precision::Confusion())) { + // discretisation circulaire + radialFound = true; + if (!circularFoundAndAdded) { + circularFoundAndAdded = true; + addGroup = true; + aGroup->SetName("CIRCULAR_QUARTER_PIPE"); + } + } Ex.Next(); - } - if (incidentPipeFound) { - addGroup = true; - aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE"); - } - if (!addGroup && (!incidentPipeFound && - !radialFound && - !mainPipeFound && - !flangeFound)) { - // Flange (collerette) - flangeFound = true; - addGroup = true; - aGroup->SetName("FLANGE"); - } + } + if (incidentPipeFound) { + addGroup = true; + aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE"); + } + if (!addGroup && (!incidentPipeFound && + !radialFound && + !mainPipeFound && + !flangeFound)) { + // Flange (collerette) + flangeFound = true; + addGroup = true; + aGroup->SetName("FLANGE"); + } } else - continue; + continue; } else if (shapeType == TSHAPE_CHAMFER || shapeType == TSHAPE_FILLET) { if (nbEdges == 25) { - addGroup = true; - aGroup->SetName("THICKNESS"); + addGroup = true; + aGroup->SetName("THICKNESS"); } else if ((nbEdges == 10) || (nbEdges == 6)) { - if (!circularFoundAndAdded) { - addGroup = true; - circularFoundAndAdded = true; - aGroup->SetName("CIRCULAR_QUARTER_PIPE"); - } + if (!circularFoundAndAdded) { + addGroup = true; + circularFoundAndAdded = true; + aGroup->SetName("CIRCULAR_QUARTER_PIPE"); + } } else if (nbEdges == 8) { - incidentPipeFound = true; - mainPipeFound = true; - flangeFound = false; - - TopExp_Explorer Ex(aGroupShapeTrsfInv,TopAbs_VERTEX); - while (Ex.More()) { - gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); - double x=aP.X(), y=aP.Y(), z=aP.Z(); - - // tuy_princ_long_avant & tuy_princ_long_apres - bool isMain = (((z < Precision::Confusion()) || (x < Precision::Confusion())) && - ((y <= aR1Ext + Precision::Confusion()) || - (y <= -(aR1Ext + Precision::Confusion())) || - (y <= theR1 + Precision::Confusion()) || - (y == -(theR1 + Precision::Confusion())))); - - - if (!isMain) { - mainPipeFound = false; - } - - // collerette - if (z < Precision::Confusion()) { - flangeFound = true; - if (!flangeFoundAndAdded) { - flangeFoundAndAdded = true; - addGroup = true; - aGroup->SetName("FLANGE"); - } - } - - // tuyau incident - if ((Abs(x) > aR2Ext + Precision::Confusion()) || - (Abs(y) > aR2Ext + Precision::Confusion())) { - incidentPipeFound = false; - } - Ex.Next(); - } - if (mainPipeFound) { - addGroup = true; - aGroup->SetName("HALF_LENGTH_MAIN_PIPE"); - } - if (incidentPipeFound) { - addGroup = true; - aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE"); - } - if (!addGroup && (!incidentPipeFound && - !mainPipeFound && - !flangeFound && - !chamferOrFilletFound)) { - addGroup = true; - chamferOrFilletFound = true; - if (shapeType == TSHAPE_CHAMFER) - aGroup->SetName("CHAMFER"); - else - aGroup->SetName("FILLET"); - } + incidentPipeFound = true; + mainPipeFound = true; + flangeFound = false; + + TopExp_Explorer Ex(aGroupShapeTrsfInv,TopAbs_VERTEX); + while (Ex.More()) { + gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); + double x=aP.X(), y=aP.Y(), z=aP.Z(); + + // tuy_princ_long_avant & tuy_princ_long_apres + bool isMain = (((z < Precision::Confusion()) || (x < Precision::Confusion())) && + ((y <= aR1Ext + Precision::Confusion()) || + (y <= -(aR1Ext + Precision::Confusion())) || + (y <= theR1 + Precision::Confusion()) || + (y == -(theR1 + Precision::Confusion())))); + + if (!isMain) { + mainPipeFound = false; + } + + // collerette + if (z < Precision::Confusion()) { + flangeFound = true; + if (!flangeFoundAndAdded) { + flangeFoundAndAdded = true; + addGroup = true; + aGroup->SetName("FLANGE"); + } + } + + // tuyau incident + if ((Abs(x) > aR2Ext + Precision::Confusion()) || + (Abs(y) > aR2Ext + Precision::Confusion())) { + incidentPipeFound = false; + } + Ex.Next(); + } + if (mainPipeFound) { + addGroup = true; + aGroup->SetName("HALF_LENGTH_MAIN_PIPE"); + } + if (incidentPipeFound) { + addGroup = true; + aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE"); + } + if (!addGroup && (!incidentPipeFound && + !mainPipeFound && + !flangeFound && + !chamferOrFilletFound)) { + addGroup = true; + chamferOrFilletFound = true; + if (shapeType == TSHAPE_CHAMFER) + aGroup->SetName("CHAMFER"); + else + aGroup->SetName("FILLET"); + } } else - continue; + continue; } // Add group to the list if (addGroup) @@ -586,11 +591,11 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int return true; } -bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) theShape, - double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theH, double theW, - double theRF, bool isNormal) +bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) theShape, + double theR1, double theW1, double theL1, + double theR2, double theW2, double theL2, + double theH, double theW, + double theRF, bool isNormal) { SetErrorCode(KO); @@ -617,10 +622,11 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t box_i->GetLastFunction()->SetDescription(""); box_i = myTransformOperations->TranslateDXDYDZ(box_i, -theR2, -theR2, 0); box_i->GetLastFunction()->SetDescription(""); - + Handle(GEOM_Function) aFunction = theShape->GetLastFunction(); TCollection_AsciiString theDesc = aFunction->GetDescription(); - Handle(TColStd_HSequenceOfTransient) edges_i = myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN); + Handle(TColStd_HSequenceOfTransient) edges_i = + myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN); // Recover previous description to get rid of Propagate dump aFunction->SetDescription(theDesc); if (edges_i.IsNull() || edges_i->Length() == 0) { @@ -636,7 +642,8 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t // search for vertices located on both internal pipes aFunction = theShape->GetLastFunction(); theDesc = aFunction->GetDescription(); - Handle(TColStd_HSequenceOfTransient) vertices_i = myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); + Handle(TColStd_HSequenceOfTransient) vertices_i = + myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); // Recover previous description to get rid of Propagate dump aFunction->SetDescription(theDesc); if (vertices_i.IsNull() || vertices_i->Length() == 0) { @@ -651,15 +658,15 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t gp_Pnt aP = BRep_Tool::Pnt(aVertex); if (Abs(aP.X()) <= Precision::Confusion()) { if (Abs(aP.Y()) - theR2 <= Precision::Confusion()) - vi1 = v; + vi1 = v; } else if (Abs(aP.Y()) <= Precision::Confusion()) { if (Abs(aP.X()) - theR1 <= Precision::Confusion()) - vi2 = v; + vi2 = v; } } std::list theShapes; - + if (isNormal) { Handle(GEOM_Object) ve1, ve2; @@ -670,7 +677,8 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t // Common edges on external cylinder aFunction = theShape->GetLastFunction(); theDesc = aFunction->GetDescription(); - Handle(TColStd_HSequenceOfTransient) edges_e = myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN); + Handle(TColStd_HSequenceOfTransient) edges_e = + myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN); // Recover previous description to get rid of Propagate dump aFunction->SetDescription(theDesc); if (edges_e.IsNull() || edges_e->Length() == 0) { @@ -685,7 +693,8 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t // search for vertices located on both external pipes aFunction = theShape->GetLastFunction(); theDesc = aFunction->GetDescription(); - Handle(TColStd_HSequenceOfTransient) vertices_e = myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); + Handle(TColStd_HSequenceOfTransient) vertices_e = + myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); // Recover previous description to get rid of Propagate dump aFunction->SetDescription(theDesc); if (vertices_e.IsNull() || vertices_e->Length() == 0) { @@ -699,11 +708,11 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t TopoDS_Vertex aVertex = TopoDS::Vertex(v->GetValue()); gp_Pnt aP = BRep_Tool::Pnt(aVertex); if (Abs(aP.X()) <= Precision::Confusion()) { - if (Abs(aP.Y()) - theR2 > Precision::Confusion()) - ve1 = v; + if (Abs(aP.Y()) - theR2 > Precision::Confusion()) + ve1 = v; } else if (Abs(aP.Y()) <= Precision::Confusion()) { - if (Abs(aP.X()) - theR2 > Precision::Confusion()) - ve2 = v; + if (Abs(aP.X()) - theR2 > Precision::Confusion()) + ve2 = v; } } Handle(GEOM_Object) edge_e1, edge_e2; @@ -713,8 +722,8 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t #endif edge_e1 = myBasicOperations->MakeLineTwoPnt(ve1, vi1); if (edge_e1.IsNull()) { - SetErrorCode("Edge 1 could not be built"); - return false; + SetErrorCode("Edge 1 could not be built"); + return false; } } catch (Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); @@ -728,15 +737,15 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t #endif edge_e2 = myBasicOperations->MakeLineTwoPnt(ve2, vi2); if (edge_e2.IsNull()) { - SetErrorCode("Edge 2 could not be built"); - return false; + SetErrorCode("Edge 2 could not be built"); + return false; } } catch (Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); SetErrorCode(aFail->GetMessageString()); return false; } - + edge_e1->GetLastFunction()->SetDescription(""); edge_e2->GetLastFunction()->SetDescription(""); @@ -765,25 +774,28 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t double ZX=0, ZY=0; std::vector LX; std::vector LY; - Handle(GEOM_Object) box_e = my3DPrimOperations->MakeBoxDXDYDZ(theVertCylinderRadius, theVertCylinderRadius, theHoriCylinderRadius); + Handle(GEOM_Object) box_e = my3DPrimOperations->MakeBoxDXDYDZ + (theVertCylinderRadius, theVertCylinderRadius, theHoriCylinderRadius); box_e->GetLastFunction()->SetDescription(""); - box_e = myTransformOperations->TranslateDXDYDZ(box_e, -theVertCylinderRadius, -theVertCylinderRadius, 0); + box_e = myTransformOperations->TranslateDXDYDZ + (box_e, -theVertCylinderRadius, -theVertCylinderRadius, 0); box_e->GetLastFunction()->SetDescription(""); aFunction = theShape->GetLastFunction(); theDesc = aFunction->GetDescription(); - Handle(TColStd_HSequenceOfTransient) extremVertices = myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); + Handle(TColStd_HSequenceOfTransient) extremVertices = + myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); // Recover previous description to get rid of Propagate dump aFunction->SetDescription(theDesc); - + if (extremVertices.IsNull() || extremVertices->Length() == 0) { if (theRF == 0) - SetErrorCode("Vertices on chamfer not found"); + SetErrorCode("Vertices on chamfer not found"); else - SetErrorCode("Vertices on fillet not found"); + SetErrorCode("Vertices on fillet not found"); return false; } - + theShapes.push_back(theShape); theShapes.push_back(box_e); if (extremVertices->Length() != 6) { @@ -796,29 +808,29 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t SetErrorCode("Bad number of vertices on chamfer found"); return false; } - + for (int i=1; i<=extremVertices->Length(); i++){ Handle(GEOM_Object) aV = Handle(GEOM_Object)::DownCast(extremVertices->Value(i)); aV->GetLastFunction()->SetDescription(""); gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(aV->GetValue())); if (Abs(aP.X()) <= Precision::Confusion()) { - if (Abs(aP.Y()) - theR2 > Precision::Confusion()) { - LX.push_back(i); - if (aP.Z()-ZX > Precision::Confusion()) { - ZX = aP.Z(); - PZX = i; - } - } + if (Abs(aP.Y()) - theR2 > Precision::Confusion()) { + LX.push_back(i); + if (aP.Z()-ZX > Precision::Confusion()) { + ZX = aP.Z(); + PZX = i; + } + } } else { - if (Abs(aP.X()) - theR2 > Precision::Confusion()) { - LY.push_back(i); - if (aP.Z() - ZY > Precision::Confusion()) { - ZY = aP.Z(); - PZY = i; - } - } + if (Abs(aP.X()) - theR2 > Precision::Confusion()) { + LY.push_back(i); + if (aP.Z() - ZY > Precision::Confusion()) { + ZY = aP.Z(); + PZY = i; + } + } } } @@ -842,7 +854,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t return false; } Cote_1->GetLastFunction()->SetDescription(""); - + Handle(GEOM_Object) Cote_2 = myBasicOperations->MakeLineTwoPnt(vi2, P3); if (Cote_2.IsNull()) { SetErrorCode("Impossible to build edge in thickness"); @@ -859,7 +871,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t return false; } edge_chan_princ->GetLastFunction()->SetDescription(""); - + Handle(GEOM_Object) edge_chan_inc = myBlocksOperations->GetEdge(theShape, P2, P4); if (edge_chan_inc.IsNull()) { SetErrorCode("Impossible to find edge on incident pipe"); @@ -872,7 +884,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t edgeList1.push_back(Cote_1); edgeList1.push_back(arete_intersect_int); edgeList1.push_back(Cote_2); - + // std::cerr << "Creating wire 1" << std::endl; wire_t = myShapesOperations->MakeWire(edgeList1, 1e-7); if (wire_t.IsNull()) { @@ -880,7 +892,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t return false; } wire_t->GetLastFunction()->SetDescription(""); - + // std::cerr << "Creating face 1" << std::endl; face_t = myShapesOperations->MakeFace(wire_t, false); if (face_t.IsNull()) { @@ -889,7 +901,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t } face_t->GetLastFunction()->SetDescription(""); theShapes.push_back(face_t); - + gp_Pnt aP2 = BRep_Tool::Pnt(TopoDS::Vertex(P2->GetValue())); gp_Pnt aP5 = BRep_Tool::Pnt(TopoDS::Vertex(vi1->GetValue())); double deltaZ = aP2.Z() - aP5.Z(); @@ -919,7 +931,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t return false; } Cote_3->GetLastFunction()->SetDescription(""); - + // std::cerr << "Creating new line 2 from 2 previous points" << std::endl; Handle(GEOM_Object) Cote_4 = myBasicOperations->MakeLineTwoPnt(P6bis, P4); if (Cote_4.IsNull()) { @@ -927,7 +939,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t return false; } Cote_4->GetLastFunction()->SetDescription(""); - + // std::cerr << "Creating new line 3 from 2 previous points" << std::endl; Handle(GEOM_Object) Cote_5 = myBasicOperations->MakeLineTwoPnt(P5bis, P6bis); if (Cote_4.IsNull()) { @@ -936,20 +948,21 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t } Cote_5->GetLastFunction()->SetDescription(""); - std::list edgeList2; - edgeList2.push_back(edge_chan_inc); - edgeList2.push_back(Cote_3); - edgeList2.push_back(Cote_5); - edgeList2.push_back(Cote_4); + //std::list edgeList2; + //edgeList2.push_back(edge_chan_inc); + //edgeList2.push_back(Cote_3); + //edgeList2.push_back(Cote_5); + //edgeList2.push_back(Cote_4); // std::cerr << "Creating wire 2" << std::endl; - wire_t2 = myShapesOperations->MakeWire(edgeList2, 1e-7); - if (wire_t2.IsNull()) { - SetErrorCode("Impossible to build wire"); - return false; - } - wire_t2->GetLastFunction()->SetDescription(""); + //wire_t2 = myShapesOperations->MakeWire(edgeList2, 1e-7); + //if (wire_t2.IsNull()) { + // SetErrorCode("Impossible to build wire"); + // return false; + //} + //wire_t2->GetLastFunction()->SetDescription(""); // std::cerr << "Creating face 2" << std::endl; - face_t2 = myShapesOperations->MakeFace(wire_t2, false); + //face_t2 = myShapesOperations->MakeFace(wire_t2, false); + face_t2 = my3DPrimOperations->MakePrismVecH(edge_chan_inc, Cote_4, - 2.0*theR2); if (face_t2.IsNull()) { SetErrorCode("Impossible to build face"); return false; @@ -972,7 +985,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t theShapes.push_back(aPlnOZ); theShapes.push_back(aPlnOXZ); - + // Partition Handle(TColStd_HSequenceOfTransient) partitionShapes = new TColStd_HSequenceOfTransient; Handle(TColStd_HSequenceOfTransient) theTools = new TColStd_HSequenceOfTransient; Handle(TColStd_HSequenceOfTransient) theKeepInside = new TColStd_HSequenceOfTransient; @@ -986,7 +999,9 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t if (!isNormal) theTools->Append(face_t2); - Handle(GEOM_Object) Te3 = myBooleanOperations->MakePartition(partitionShapes, theTools, theKeepInside, theRemoveInside, TopAbs_SOLID, false, theMaterials, 0, false); + Handle(GEOM_Object) Te3 = myBooleanOperations->MakePartition + (partitionShapes, theTools, theKeepInside, theRemoveInside, + TopAbs_SOLID, false, theMaterials, 0, false); if (Te3.IsNull()) { SetErrorCode("Impossible to build partition of TShape"); // Handle(GEOM_Object) aCompound = myShapesOperations->MakeCompound(theShapes); @@ -1004,18 +1019,18 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t } TopoDS_Shape aShape = Te3->GetValue(); theShape->GetLastFunction()->SetValue(aShape); - + SetErrorCode(OK); return true; } // Mirror and glue faces -bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape, - double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2) +bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape, + double theR1, double theW1, double theL1, + double theR2, double theW2, double theL2) { SetErrorCode(KO); - + // Useful values double aSize = 2*(theL1 + theL2); double aR1Ext = theR1 + theW1; @@ -1099,8 +1114,8 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Objec //============================================================================= Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - bool theHexMesh) + double theR2, double theW2, double theL2, + bool theHexMesh) { MESSAGE("GEOMImpl_IAdvancedOperations::MakePipeTShape"); SetErrorCode(KO); @@ -1138,7 +1153,7 @@ GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1, double SetErrorCode(aFail->GetMessageString()); return NULL; } - + if (theHexMesh) { if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2)) return NULL; @@ -1180,17 +1195,19 @@ GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1, double aListRes.Trunc(aListRes.Length() - 2); //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString() << "] = geompy.MakePipeTShape(" - << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " - << theHexMesh << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << ", " << aListRes.ToCString() << "] = geompy.MakePipeTShape(" + << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " + << theHexMesh << ")"; } /* * Get the groups: END */ else { //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShape(" << theR1 << ", " << theW1 << ", " - << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theHexMesh << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << "] = geompy.MakePipeTShape(" << theR1 << ", " << theW1 << ", " + << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theHexMesh << ")"; } SetErrorCode(OK); @@ -1220,11 +1237,11 @@ GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1, double //============================================================================= Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - bool theHexMesh, - Handle(GEOM_Object) theP1, - Handle(GEOM_Object) theP2, - Handle(GEOM_Object) theP3) + double theR2, double theW2, double theL2, + bool theHexMesh, + Handle(GEOM_Object) theP1, + Handle(GEOM_Object) theP2, + Handle(GEOM_Object) theP3) { SetErrorCode(KO); //Add a new object @@ -1268,7 +1285,7 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition(double theR1, double th SetErrorCode(aFail->GetMessageString()); return NULL; } - + if (theHexMesh) { if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2)) return NULL; @@ -1318,9 +1335,10 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition(double theR1, double th aListRes.Trunc(aListRes.Length() - 2); //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString() << "] = geompy.MakePipeTShape(" - << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " - << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3 << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << ", " << aListRes.ToCString() << "] = geompy.MakePipeTShape(" + << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " + << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3 << ")"; } // // Get the groups: END @@ -1328,9 +1346,10 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition(double theR1, double th else { //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShape(" << theR1 << ", " << theW1 << ", " - << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theHexMesh << ", " << theP1 - << ", " << theP2 << ", " << theP3 << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << "] = geompy.MakePipeTShape(" << theR1 << ", " << theW1 << ", " + << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theHexMesh << ", " << theP1 + << ", " << theP2 << ", " << theP3 << ")"; } SetErrorCode(OK); @@ -1359,9 +1378,9 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition(double theR1, double th //============================================================================= Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theH, double theW, - bool theHexMesh) + double theR2, double theW2, double theL2, + double theH, double theW, + bool theHexMesh) { SetErrorCode(KO); //Add a new object @@ -1415,8 +1434,9 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, box_e->GetLastFunction()->SetDescription(""); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0); box_e->GetLastFunction()->SetDescription(""); - - Handle(TColStd_HSequenceOfInteger) edges_e = myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); + + Handle(TColStd_HSequenceOfInteger) edges_e = + myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); box_e->GetLastFunction()->SetDescription(""); if (edges_e.IsNull() || edges_e->Length() == 0) { @@ -1434,8 +1454,8 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, iv ++; gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) { - nbEdgesInChamfer ++; - theEdges.push_back(edgeID); + nbEdgesInChamfer ++; + theEdges.push_back(edgeID); } Ex.Next(); } @@ -1456,7 +1476,7 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, return NULL; } aChamfer->GetLastFunction()->SetDescription(""); - + TopoDS_Shape aChamferShape = aChamfer->GetValue(); aFunction->SetValue(aChamferShape); // END of chamfer @@ -1484,13 +1504,14 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, // // Get the groups: BEGIN // - // if (!MakeGroups(aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) { - // //Make a Python command - // GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 - // << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW - // << ", " << theHexMesh << ")"; - // } - // else { + //if (!MakeGroups(aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) { + // //Make a Python command + // GEOM::TPythonDump(aFunction) + // << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 + // << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW + // << ", " << theHexMesh << ")"; + //} + //else { try { if (!MakeGroups(aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) return NULL; @@ -1518,19 +1539,21 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, aListRes.Trunc(aListRes.Length() - 2); //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString() - << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 - << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW << ", " << theHexMesh << ")"; - // } + GEOM::TPythonDump(aFunction) + << "[" << aShape << ", " << aListRes.ToCString() + << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 + << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW << ", " << theHexMesh << ")"; + //} } // // Get the groups: END // else { //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 - << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW - << ", " << theHexMesh << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 + << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW + << ", " << theHexMesh << ")"; } SetErrorCode(OK); @@ -1563,12 +1586,12 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, //============================================================================= Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theH, double theW, - bool theHexMesh, - Handle(GEOM_Object) theP1, - Handle(GEOM_Object) theP2, - Handle(GEOM_Object) theP3) + double theR2, double theW2, double theL2, + double theH, double theW, + bool theHexMesh, + Handle(GEOM_Object) theP1, + Handle(GEOM_Object) theP2, + Handle(GEOM_Object) theP3) { SetErrorCode(KO); //Add a new object @@ -1627,8 +1650,9 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, do box_e->GetLastFunction()->SetDescription(""); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0); box_e->GetLastFunction()->SetDescription(""); - - Handle(TColStd_HSequenceOfInteger) edges_e = myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); + + Handle(TColStd_HSequenceOfInteger) edges_e = + myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); box_e->GetLastFunction()->SetDescription(""); if (edges_e.IsNull() || edges_e->Length() == 0) { @@ -1644,8 +1668,8 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, do while (Ex.More()) { gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) { - nbEdgesInChamfer ++; - theEdges.push_back(edgeID); + nbEdgesInChamfer ++; + theEdges.push_back(edgeID); } Ex.Next(); } @@ -1666,11 +1690,11 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, do return NULL; } aChamfer->GetLastFunction()->SetDescription(""); - + TopoDS_Shape aChamferShape = aChamfer->GetValue(); aFunction->SetValue(aChamferShape); // END of chamfer - + if (theHexMesh) { if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, 0, false)) return NULL; @@ -1718,19 +1742,21 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, do aListRes.Trunc(aListRes.Length() - 2); //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString() - << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 - << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW << ", " << theHexMesh << ", " - << theP1 << ", " << theP2 << ", " << theP3 << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << ", " << aListRes.ToCString() + << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 + << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW << ", " << theHexMesh << ", " + << theP1 << ", " << theP2 << ", " << theP3 << ")"; } /* * Get the groups: END */ else { //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 - << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW - << ", " << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3 << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 + << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW + << ", " << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3 << ")"; } SetErrorCode(OK); @@ -1758,8 +1784,8 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, do //============================================================================= Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theRF, bool theHexMesh) + double theR2, double theW2, double theL2, + double theRF, bool theHexMesh) { SetErrorCode(KO); //Add a new object @@ -1812,8 +1838,9 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, d box_e->GetLastFunction()->SetDescription(""); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0); box_e->GetLastFunction()->SetDescription(""); - - Handle(TColStd_HSequenceOfInteger) edges_e = myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); + + Handle(TColStd_HSequenceOfInteger) edges_e = + myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); box_e->GetLastFunction()->SetDescription(""); if (edges_e.IsNull() || edges_e->Length() == 0) { @@ -1829,8 +1856,8 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, d while (Ex.More()) { gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) { - nbEdgesInFillet ++; - theEdges.push_back(edgeID); + nbEdgesInFillet ++; + theEdges.push_back(edgeID); } Ex.Next(); } @@ -1848,16 +1875,23 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, d return NULL; } if (aFillet.IsNull()) { -// SetErrorCode("Fillet can not be computed on the given shape with the given parameters"); + //SetErrorCode("Fillet can not be computed on the given shape with the given parameters"); SetErrorCode(myLocalOperations->GetErrorCode()); return NULL; } aFillet->GetLastFunction()->SetDescription(""); - + TopoDS_Shape aFilletShape = aFillet->GetValue(); aFunction->SetValue(aFilletShape); // END of fillet + // BEGIN: Limit tolerances (debug) + Handle(GEOM_Object) aCorr1 = myHealingOperations->LimitTolerance(aShape, 1e-07); + TopoDS_Shape aCorr1Shape = aCorr1->GetValue(); + aShape->GetLastFunction()->SetValue(aCorr1Shape); + aCorr1->GetLastFunction()->SetDescription(""); + // END: Limit tolerances (debug) + if (theHexMesh) { if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false)) return NULL; @@ -1898,25 +1932,25 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, d aListRes.Trunc(aListRes.Length() - 2); //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString() - << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 - << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " << theHexMesh << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << ", " << aListRes.ToCString() + << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 + << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " << theHexMesh << ")"; } /* * Get the groups: END */ else { //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 - << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " - << theHexMesh << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 + << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " + << theHexMesh << ")"; } - SetErrorCode(OK); return aSeq; - } //============================================================================= @@ -1943,11 +1977,11 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, d //============================================================================= Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theRF, bool theHexMesh, - Handle(GEOM_Object) theP1, - Handle(GEOM_Object) theP2, - Handle(GEOM_Object) theP3) + double theR2, double theW2, double theL2, + double theRF, bool theHexMesh, + Handle(GEOM_Object) theP1, + Handle(GEOM_Object) theP2, + Handle(GEOM_Object) theP3) { SetErrorCode(KO); //Add a new object @@ -2005,8 +2039,9 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition(double theR1, dou box_e->GetLastFunction()->SetDescription(""); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0); box_e->GetLastFunction()->SetDescription(""); - - Handle(TColStd_HSequenceOfInteger) edges_e = myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); + + Handle(TColStd_HSequenceOfInteger) edges_e = + myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); box_e->GetLastFunction()->SetDescription(""); if (edges_e.IsNull() || edges_e->Length() == 0) { @@ -2022,8 +2057,8 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition(double theR1, dou while (Ex.More()) { gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) { - nbEdgesInFillet ++; - theEdges.push_back(edgeID); + nbEdgesInFillet ++; + theEdges.push_back(edgeID); } Ex.Next(); } @@ -2045,11 +2080,18 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition(double theR1, dou return NULL; } aFillet->GetLastFunction()->SetDescription(""); - + TopoDS_Shape aFilletShape = aFillet->GetValue(); aFunction->SetValue(aFilletShape); // END of fillet + // BEGIN: Limit tolerances (debug) + Handle(GEOM_Object) aCorr1 = myHealingOperations->LimitTolerance(aShape, 1e-07); + TopoDS_Shape aCorr1Shape = aCorr1->GetValue(); + aShape->GetLastFunction()->SetValue(aCorr1Shape); + aCorr1->GetLastFunction()->SetDescription(""); + // END: Limit tolerances (debug) + if (theHexMesh) { if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false)) return NULL; @@ -2097,19 +2139,21 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition(double theR1, dou aListRes.Trunc(aListRes.Length() - 2); //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString() - << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 - << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " << theHexMesh << ", " << theP1 << ", " - << theP2 << ", " << theP3 << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << ", " << aListRes.ToCString() + << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 + << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " << theHexMesh << ", " << theP1 << ", " + << theP2 << ", " << theP3 << ")"; } /* * Get the groups: END */ else { //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 - << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " - << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3 << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 + << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " + << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3 << ")"; } SetErrorCode(OK); diff --git a/src/GEOMImpl/GEOMImpl_IAdvancedOperations.hxx b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.hxx index 2b7b91892..ee5e5347d 100644 --- a/src/GEOMImpl/GEOMImpl_IAdvancedOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.hxx @@ -16,10 +16,9 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - // File : GEOMImpl_IAdvancedOperations.hxx // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) -// + #ifndef _GEOMImpl_IAdvancedOperations_HXX_ #define _GEOMImpl_IAdvancedOperations_HXX_ @@ -35,31 +34,32 @@ class GEOMImpl_ITransformOperations; class GEOMImpl_IBlocksOperations; class GEOMImpl_I3DPrimOperations; class GEOMImpl_ILocalOperations; +class GEOMImpl_IHealingOperations; class GEOMImpl_IAdvancedOperations: public GEOM_IOperations { private: bool MakePipeTShapePartition(Handle(GEOM_Object) theShape, - double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theH = 0, double theW = 0, - double theRF = 0, bool isNormal = true); + double theR1, double theW1, double theL1, + double theR2, double theW2, double theL2, + double theH = 0, double theW = 0, + double theRF = 0, bool isNormal = true); bool MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape, - double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2); + double theR1, double theW1, double theL1, + double theR2, double theW2, double theL2); bool MakeGroups(Handle(GEOM_Object) theShape, int shapType, - double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - Handle(TColStd_HSequenceOfTransient) theSeq, - gp_Trsf aTrsf); + double theR1, double theW1, double theL1, + double theR2, double theW2, double theL2, + Handle(TColStd_HSequenceOfTransient) theSeq, + gp_Trsf aTrsf); gp_Trsf GetPositionTrsf(double theL1, double theL2, - Handle(GEOM_Object) P1 = 0, - Handle(GEOM_Object) P2 = 0, - Handle(GEOM_Object) P3 = 0); + Handle(GEOM_Object) P1 = 0, + Handle(GEOM_Object) P2 = 0, + Handle(GEOM_Object) P3 = 0); bool CheckCompatiblePosition(double& theL1, double& theL2, - Handle(GEOM_Object) theP1, - Handle(GEOM_Object) theP2, - Handle(GEOM_Object) theP3, - double theTolerance); + Handle(GEOM_Object) theP1, + Handle(GEOM_Object) theP2, + Handle(GEOM_Object) theP3, + double theTolerance); private: GEOMImpl_IBasicOperations* myBasicOperations; GEOMImpl_IBooleanOperations* myBooleanOperations; @@ -68,6 +68,7 @@ private: GEOMImpl_IBlocksOperations* myBlocksOperations; GEOMImpl_I3DPrimOperations* my3DPrimOperations; GEOMImpl_ILocalOperations* myLocalOperations; + GEOMImpl_IHealingOperations* myHealingOperations; public: Standard_EXPORT GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngine, int theDocID); @@ -75,39 +76,39 @@ public: Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeTShape(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - bool theHexMesh = true); + double theR2, double theW2, double theL2, + bool theHexMesh = true); Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeTShapeWithPosition(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - bool theHexMesh = true, - Handle(GEOM_Object) P1 = 0, - Handle(GEOM_Object) P2 = 0, - Handle(GEOM_Object) P3 = 0); + double theR2, double theW2, double theL2, + bool theHexMesh = true, + Handle(GEOM_Object) P1 = 0, + Handle(GEOM_Object) P2 = 0, + Handle(GEOM_Object) P3 = 0); Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeTShapeChamfer(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theH, double theW, - bool theHexMesh = true); + double theR2, double theW2, double theL2, + double theH, double theW, + bool theHexMesh = true); Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeTShapeChamferWithPosition(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theH, double theW, - bool theHexMesh = true, - Handle(GEOM_Object) P1 = 0, - Handle(GEOM_Object) P2 = 0, - Handle(GEOM_Object) P3 = 0); + double theR2, double theW2, double theL2, + double theH, double theW, + bool theHexMesh = true, + Handle(GEOM_Object) P1 = 0, + Handle(GEOM_Object) P2 = 0, + Handle(GEOM_Object) P3 = 0); Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeTShapeFillet(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theRF, bool theHexMesh = true); + double theR2, double theW2, double theL2, + double theRF, bool theHexMesh = true); Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeTShapeFilletWithPosition(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theRF, bool theHexMesh = true, - Handle(GEOM_Object) P1 = 0, - Handle(GEOM_Object) P2 = 0, - Handle(GEOM_Object) P3 = 0); + double theR2, double theW2, double theL2, + double theRF, bool theHexMesh = true, + Handle(GEOM_Object) P1 = 0, + Handle(GEOM_Object) P2 = 0, + Handle(GEOM_Object) P3 = 0); /*@@ insert new functions before this line @@ do not remove this line @@*/ }; #endif diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx index c62f4ac26..d0ac43e7c 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx @@ -1479,7 +1479,8 @@ static double CheckSingularCase(const TopoDS_Shape& aSh1, if( sh.ShapeType()==TopAbs_SHELL || sh.ShapeType()==TopAbs_FACE ) { // non solid case double U1,U2,V1,V2; - S->Bounds(U1,U2,V1,V2); + //S->Bounds(U1,U2,V1,V2); + ShapeAnalysis::GetFaceUVBounds(TopoDS::Face(tmpSh2),U1,U2,V1,V2); Handle(Geom_RectangularTrimmedSurface) TrS1 = new Geom_RectangularTrimmedSurface(S,U1,(U1+U2)/2.,V1,V2); Handle(Geom_RectangularTrimmedSurface) TrS2 = diff --git a/src/GEOMImpl/GEOMImpl_IShapes.hxx b/src/GEOMImpl/GEOMImpl_IShapes.hxx index cd8dbe705..dcdb59265 100644 --- a/src/GEOMImpl/GEOMImpl_IShapes.hxx +++ b/src/GEOMImpl/GEOMImpl_IShapes.hxx @@ -38,7 +38,8 @@ class GEOMImpl_IShapes SHAPE_ARG_PLANAR = 3, // for Face SHAPE_ARG_SUBTYPE = 4, // for Sub-shape SHAPE_ARG_INDICES = 5, // for Sub-shape - SHAPE_ARG_TOLERANCE = 6 // for Wire + SHAPE_ARG_TOLERANCE = 6, // linear tolerance (for Wire, Edge) + SHAPE_ARG_ANGLE_TOL = 7, // angular tolerance (for Edge) }; GEOMImpl_IShapes(Handle(GEOM_Function) theFunction): _func(theFunction) {} @@ -75,6 +76,11 @@ class GEOMImpl_IShapes Standard_Real GetTolerance() { return _func->GetReal(SHAPE_ARG_TOLERANCE); } + void SetAngularTolerance(const Standard_Real theValue) + { _func->SetReal(SHAPE_ARG_ANGLE_TOL, theValue); } + + Standard_Real GetAngularTolerance() { return _func->GetReal(SHAPE_ARG_ANGLE_TOL); } + private: Handle(GEOM_Function) _func; diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index 202a02f44..a0e0be546 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -210,6 +210,77 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdge return anEdge; } +//============================================================================= +/*! + * MakeEdgeWire + */ +//============================================================================= +Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdgeWire + (Handle(GEOM_Object) theWire, + const Standard_Real theLinearTolerance, + const Standard_Real theAngularTolerance) +{ + SetErrorCode(KO); + + if (theWire.IsNull()) return NULL; + + //Add a new Edge object + Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE); + + //Add a new Vector function + Handle(GEOM_Function) aFunction = + anEdge->AddFunction(GEOMImpl_ShapeDriver::GetID(), EDGE_WIRE); + + //Check if the function is set correctly + if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL; + + GEOMImpl_IShapes aCI (aFunction); + + Handle(GEOM_Function) aWire = theWire->GetLastFunction(); + + if (aWire.IsNull()) return NULL; + + aCI.SetBase(aWire); + aCI.SetTolerance(theLinearTolerance); + aCI.SetAngularTolerance(theAngularTolerance); + + //Compute the Edge value + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + if (!GetSolver()->ComputeFunction(aFunction)) { + SetErrorCode("Shape driver failed"); + return NULL; + } + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); + return NULL; + } + + const double DEF_LIN_TOL = Precision::Confusion(); + const double DEF_ANG_TOL = Precision::Angular(); + //Make a Python command + if ( theAngularTolerance == DEF_ANG_TOL ) { + if ( theLinearTolerance == DEF_LIN_TOL ) + GEOM::TPythonDump(aFunction) << anEdge << " = geompy.MakeEdgeWire(" + << theWire << ")"; + else + GEOM::TPythonDump(aFunction) << anEdge << " = geompy.MakeEdgeWire(" + << theWire << ", " << theLinearTolerance << ")"; + } + else { + GEOM::TPythonDump(aFunction) << anEdge << " = geompy.MakeEdgeWire(" + << theWire << ", " << theLinearTolerance << ", " + << theAngularTolerance << ")"; + } + + SetErrorCode(OK); + return anEdge; +} + //============================================================================= /*! * MakeWire @@ -435,60 +506,6 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidShells return MakeShape(theShapes, GEOM_SOLID, SOLID_SHELLS, "MakeSolid"); } -//============================================================================= -/*! - * MakeSolidShell - */ -//============================================================================= -Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidShell (Handle(GEOM_Object) theShell) -{ - SetErrorCode(KO); - - if (theShell.IsNull()) return NULL; - - //Add a new Solid object - Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GetDocID(), GEOM_SOLID); - - //Add a new Solid function for creation of a solid from a shell - Handle(GEOM_Function) aFunction = - aSolid->AddFunction(GEOMImpl_ShapeDriver::GetID(), SOLID_SHELL); - if (aFunction.IsNull()) return NULL; - - //Check if the function is set correctly - if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL; - - GEOMImpl_IShapes aCI (aFunction); - - Handle(GEOM_Function) aRefShell = theShell->GetLastFunction(); - - if (aRefShell.IsNull()) return NULL; - - aCI.SetBase(aRefShell); - - //Compute the Solid value - try { -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 - OCC_CATCH_SIGNALS; -#endif - if (!GetSolver()->ComputeFunction(aFunction)) { - SetErrorCode("Solid driver failed"); - return NULL; - } - } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); - return NULL; - } - - //Make a Python command - GEOM::TPythonDump(aFunction) << aSolid - << " = geompy.MakeSolid(" << theShell << ")"; - - SetErrorCode(OK); - return aSolid; -} - //============================================================================= /*! * MakeCompound @@ -3212,7 +3229,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) bool isFound = false; Standard_Integer iType = TopAbs_SOLID; Standard_Integer compType = TopAbs_SOLID; - Standard_Real aWhat_Mass = 0., aWhere_Mass = 0.; + //Standard_Real aWhat_Mass = 0., aWhere_Mass = 0.; Standard_Real tab_aWhat[4], tab_aWhere[4]; Standard_Real dl_l = 1e-3; Standard_Real min_l, Tol_0D, Tol_1D, Tol_2D, Tol_3D, Tol_Mass; @@ -3293,6 +3310,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) else if ( iType == TopAbs_FACE ) Tol_Mass = Tol_2D; // Compute the ShapeWhat Mass + /* for ( ; Exp_aWhat.More(); Exp_aWhat.Next() ) { if ( iType == TopAbs_VERTEX ) { aWhat_Mass += 1; @@ -3303,6 +3321,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) else BRepGProp::VolumeProperties(Exp_aWhat.Current(), aProps); aWhat_Mass += aProps.Mass(); } + */ // Searching for the sub-shapes inside the ShapeWhere shape TopTools_MapOfShape map_aWhere; @@ -3344,12 +3363,13 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) if ( isFound ) { aWhereIndex = aWhereIndices.FindIndex(Exp_aWhere.Current()); aModifiedList.Append(aWhereIndex); - aWhere_Mass += tab_aWhere[3]; + //aWhere_Mass += tab_aWhere[3]; isFound = false; break; } } - if ( fabs( aWhat_Mass - aWhere_Mass ) <= Tol_Mass ) break; + //if ( fabs( aWhat_Mass - aWhere_Mass ) <= Tol_Mass ) + //break; } if (aModifiedList.Extent() == 0) { // Not found any Results diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx index c776217c9..b097ef81e 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx @@ -55,7 +55,10 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations Standard_EXPORT ~GEOMImpl_IShapesOperations(); Standard_EXPORT Handle(GEOM_Object) MakeEdge (Handle(GEOM_Object) thePoint1, - Handle(GEOM_Object) thePoint2); + Handle(GEOM_Object) thePoint2); + Standard_EXPORT Handle(GEOM_Object) MakeEdgeWire (Handle(GEOM_Object) theWire, + const Standard_Real theLinearTolerance, + const Standard_Real theAngularTolerance); Standard_EXPORT Handle(GEOM_Object) MakeWire (std::list theEdgesAndWires, const Standard_Real theTolerance); @@ -67,8 +70,6 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations Standard_EXPORT Handle(GEOM_Object) MakeShell (std::list theShapes); - Standard_EXPORT Handle(GEOM_Object) MakeSolidShell (Handle(GEOM_Object) theShell); - Standard_EXPORT Handle(GEOM_Object) MakeSolidShells (std::list theShells); Standard_EXPORT Handle(GEOM_Object) MakeCompound (std::list theShapes); diff --git a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx index 744bdc200..42ab3f44f 100644 --- a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx @@ -1252,7 +1252,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionShape aTI.SetShape(anOriginal); aTI.SetEndLCS(theEndLCS->GetLastFunction()); if (!theStartLCS.IsNull()) - aTI.SetStartLCS(theStartLCS->GetLastFunction()); + aTI.SetStartLCS(theObject == theStartLCS ? anOriginal : theStartLCS->GetLastFunction()); //Compute the Position try { diff --git a/src/GEOMImpl/GEOMImpl_MeasureDriver.cxx b/src/GEOMImpl/GEOMImpl_MeasureDriver.cxx index 70a0fb545..c3b9cd0ca 100644 --- a/src/GEOMImpl/GEOMImpl_MeasureDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_MeasureDriver.cxx @@ -216,6 +216,17 @@ Standard_Integer GEOMImpl_MeasureDriver::Execute(TFunction_Logbook& log) const gp_Vec Vec1,Vec2; BRepAdaptor_Surface SF (aFace); SF.D1(pUV.X(), pUV.Y(), p1, Vec1, Vec2); + if (Vec1.Magnitude() < Precision::Confusion()) { + gp_Vec tmpV; + gp_Pnt tmpP; + SF.D1(pUV.X(), pUV.Y()-0.1, tmpP, Vec1, tmpV); + } + else if (Vec2.Magnitude() < Precision::Confusion()) { + gp_Vec tmpV; + gp_Pnt tmpP; + SF.D1(pUV.X()-0.1, pUV.Y(), tmpP, tmpV, Vec2); + } + gp_Vec V = Vec1.Crossed(Vec2); Standard_Real mod = V.Magnitude(); if (mod < Precision::Confusion()) diff --git a/src/GEOMImpl/GEOMImpl_PointDriver.cxx b/src/GEOMImpl/GEOMImpl_PointDriver.cxx index 38065f47f..8af5452e6 100644 --- a/src/GEOMImpl/GEOMImpl_PointDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_PointDriver.cxx @@ -190,6 +190,10 @@ Standard_Integer GEOMImpl_PointDriver::Execute(TFunction_Logbook& log) const Standard_TypeMismatch::Raise ("Creation Point On Lines Intersection Aborted : Line shape is not an edge or wire"); } + + if (aRefShape1.IsSame(aRefShape2)) + Standard_ConstructionError::Raise("The lines to make intersection must be different"); + //Calculate Lines Intersection Point BRepExtrema_DistShapeShape dst (aRefShape1, aRefShape2); if (dst.IsDone()) { diff --git a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx index 6990682cf..54d149b3a 100644 --- a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx @@ -31,6 +31,7 @@ // OCCT Includes #include #include +#include #include #include @@ -43,8 +44,13 @@ #include #include #include +#include +#include +#include +#include #include +#include #include #include @@ -61,7 +67,18 @@ #include #include +#include #include +#include +#include +#include +#include + +#include +#include +#include +#include +#include #include #include @@ -441,6 +458,342 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const aShape = tds; } } + else if (aType == EDGE_WIRE) { + Handle(GEOM_Function) aRefBase = aCI.GetBase(); + TopoDS_Shape aWire = aRefBase->GetValue(); + Standard_Real LinTol = aCI.GetTolerance(); + Standard_Real AngTol = aCI.GetAngularTolerance(); + if (aWire.IsNull()) Standard_NullObject::Raise("Argument Wire is null"); + + TopoDS_Edge ResEdge; + + BRepLib::BuildCurves3d(aWire); + Handle(ShapeFix_Shape) Fixer = new ShapeFix_Shape(aWire); + Fixer->SetPrecision(LinTol); + Fixer->SetMaxTolerance(LinTol); + Fixer->Perform(); + TopoDS_Wire theWire = TopoDS::Wire(Fixer->Shape()); + + TColGeom_SequenceOfCurve CurveSeq; + TopTools_SequenceOfShape LocSeq; + TColStd_SequenceOfReal FparSeq; + TColStd_SequenceOfReal LparSeq; + TColStd_SequenceOfReal TolSeq; + GeomAbs_CurveType CurType; + TopoDS_Vertex FirstVertex, LastVertex; + + BRepTools_WireExplorer wexp(theWire) ; + for (; wexp.More(); wexp.Next()) + { + TopoDS_Edge anEdge = wexp.Current(); + Standard_Real fpar, lpar; + TopLoc_Location aLoc; + Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aLoc, fpar, lpar); + if (aCurve.IsNull()) + continue; + + BRepAdaptor_Curve BAcurve(anEdge); + GeomAbs_CurveType aType = BAcurve.GetType(); + + Handle(Geom_Curve) aBasisCurve = BAcurve.Curve().Curve(); + + if (aBasisCurve->IsPeriodic()) + ElCLib::AdjustPeriodic(aBasisCurve->FirstParameter(), aBasisCurve->LastParameter(), + Precision::PConfusion(), fpar, lpar); + + if (CurveSeq.IsEmpty()) + { + CurveSeq.Append(aCurve); + TopoDS_Shape aLocShape; + aLocShape.Location(aLoc); + aLocShape.Orientation(wexp.Orientation()); + LocSeq.Append(aLocShape); + FparSeq.Append(fpar); + LparSeq.Append(lpar); + CurType = aType; + FirstVertex = wexp.CurrentVertex(); + } + else + { + Standard_Boolean Done = Standard_False; + Standard_Real NewFpar, NewLpar; + GeomAdaptor_Curve GAprevcurve(CurveSeq.Last()); + TopoDS_Vertex CurVertex = wexp.CurrentVertex(); + TopoDS_Vertex CurFirstVer = TopExp::FirstVertex(anEdge); + TopAbs_Orientation ConnectByOrigin = (CurVertex.IsSame(CurFirstVer))? TopAbs_FORWARD : TopAbs_REVERSED; + if (aCurve == CurveSeq.Last()) + { + NewFpar = fpar; + NewLpar = lpar; + if (aBasisCurve->IsPeriodic()) + { + if (NewLpar < NewFpar) + NewLpar += aBasisCurve->Period(); + if (ConnectByOrigin == TopAbs_FORWARD) + ElCLib::AdjustPeriodic(FparSeq.Last(), + FparSeq.Last() + aBasisCurve->Period(), + Precision::PConfusion(), NewFpar, NewLpar); + else + ElCLib::AdjustPeriodic(FparSeq.Last() - aBasisCurve->Period(), + FparSeq.Last(), + Precision::PConfusion(), NewFpar, NewLpar); + } + Done = Standard_True; + } + else if (aType == CurType && + aType != GeomAbs_BezierCurve && + aType != GeomAbs_BSplineCurve && + aType != GeomAbs_OtherCurve) + { + switch (aType) + { + case GeomAbs_Line: + { + gp_Lin aLine = BAcurve.Line(); + gp_Lin PrevLine = GAprevcurve.Line(); + if (aLine.Contains(PrevLine.Location(), LinTol) && + aLine.Direction().IsParallel(PrevLine.Direction(), AngTol)) + { + gp_Pnt P1 = ElCLib::Value(fpar, aLine); + gp_Pnt P2 = ElCLib::Value(lpar, aLine); + NewFpar = ElCLib::Parameter(PrevLine, P1); + NewLpar = ElCLib::Parameter(PrevLine, P2); + if (NewLpar < NewFpar) + { + Standard_Real MemNewFpar = NewFpar; + NewFpar = NewLpar; + NewLpar = MemNewFpar; + ConnectByOrigin = TopAbs::Reverse(ConnectByOrigin); + } + Done = Standard_True; + } + break; + } + case GeomAbs_Circle: + { + gp_Circ aCircle = BAcurve.Circle(); + gp_Circ PrevCircle = GAprevcurve.Circle(); + if (aCircle.Location().Distance(PrevCircle.Location()) <= LinTol && + Abs(aCircle.Radius() - PrevCircle.Radius()) <= LinTol && + aCircle.Axis().IsParallel(PrevCircle.Axis(), AngTol)) + { + if (aCircle.Axis().Direction() * PrevCircle.Axis().Direction() < 0.) + { + Standard_Real memfpar = fpar; + fpar = lpar; + lpar = memfpar; + ConnectByOrigin = TopAbs::Reverse(ConnectByOrigin); + } + gp_Pnt P1 = ElCLib::Value(fpar, aCircle); + gp_Pnt P2 = ElCLib::Value(lpar, aCircle); + NewFpar = ElCLib::Parameter(PrevCircle, P1); + NewLpar = ElCLib::Parameter(PrevCircle, P2); + if (NewLpar < NewFpar) + NewLpar += 2.*PI; + //Standard_Real MemNewFpar = NewFpar, MemNewLpar = NewLpar; + if (ConnectByOrigin == TopAbs_FORWARD) + ElCLib::AdjustPeriodic(FparSeq.Last(), + FparSeq.Last() + 2.*PI, + Precision::PConfusion(), NewFpar, NewLpar); + else + ElCLib::AdjustPeriodic(FparSeq.Last() - 2.*PI, + FparSeq.Last(), + Precision::PConfusion(), NewFpar, NewLpar); + Done = Standard_True; + } + break; + } + case GeomAbs_Ellipse: + { + gp_Elips anEllipse = BAcurve.Ellipse(); + gp_Elips PrevEllipse = GAprevcurve.Ellipse(); + if (anEllipse.Focus1().Distance(PrevEllipse.Focus1()) <= LinTol && + anEllipse.Focus2().Distance(PrevEllipse.Focus2()) <= LinTol && + Abs(anEllipse.MajorRadius() - PrevEllipse.MajorRadius()) <= LinTol && + Abs(anEllipse.MinorRadius() - PrevEllipse.MinorRadius()) <= LinTol && + anEllipse.Axis().IsParallel(PrevEllipse.Axis(), AngTol)) + { + if (anEllipse.Axis().Direction() * PrevEllipse.Axis().Direction() < 0.) + { + Standard_Real memfpar = fpar; + fpar = lpar; + lpar = memfpar; + ConnectByOrigin = TopAbs::Reverse(ConnectByOrigin); + } + gp_Pnt P1 = ElCLib::Value(fpar, anEllipse); + gp_Pnt P2 = ElCLib::Value(lpar, anEllipse); + NewFpar = ElCLib::Parameter(PrevEllipse, P1); + NewLpar = ElCLib::Parameter(PrevEllipse, P2); + if (NewLpar < NewFpar) + NewLpar += 2.*PI; + if (ConnectByOrigin == TopAbs_FORWARD) + ElCLib::AdjustPeriodic(FparSeq.Last(), + FparSeq.Last() + 2.*PI, + Precision::PConfusion(), NewFpar, NewLpar); + else + ElCLib::AdjustPeriodic(FparSeq.Last() - 2.*PI, + FparSeq.Last(), + Precision::PConfusion(), NewFpar, NewLpar); + Done = Standard_True; + } + break; + } + case GeomAbs_Hyperbola: + { + gp_Hypr aHypr = BAcurve.Hyperbola(); + gp_Hypr PrevHypr = GAprevcurve.Hyperbola(); + if (aHypr.Focus1().Distance(PrevHypr.Focus1()) <= LinTol && + aHypr.Focus2().Distance(PrevHypr.Focus2()) <= LinTol && + Abs(aHypr.MajorRadius() - PrevHypr.MajorRadius()) <= LinTol && + Abs(aHypr.MinorRadius() - PrevHypr.MinorRadius()) <= LinTol && + aHypr.Axis().IsParallel(PrevHypr.Axis(), AngTol)) + { + gp_Pnt P1 = ElCLib::Value(fpar, aHypr); + gp_Pnt P2 = ElCLib::Value(lpar, aHypr); + NewFpar = ElCLib::Parameter(PrevHypr, P1); + NewLpar = ElCLib::Parameter(PrevHypr, P2); + if (NewLpar < NewFpar) + { + Standard_Real MemNewFpar = NewFpar; + NewFpar = NewLpar; + NewLpar = MemNewFpar; + ConnectByOrigin = TopAbs::Reverse(ConnectByOrigin); + } + Done = Standard_True; + } + break; + } + case GeomAbs_Parabola: + { + gp_Parab aParab = BAcurve.Parabola(); + gp_Parab PrevParab = GAprevcurve.Parabola(); + if (aParab.Location().Distance(PrevParab.Location()) <= LinTol && + aParab.Focus().Distance(PrevParab.Focus()) <= LinTol && + Abs(aParab.Focal() - PrevParab.Focal()) <= LinTol && + aParab.Axis().IsParallel(PrevParab.Axis(), AngTol)) + { + gp_Pnt P1 = ElCLib::Value(fpar, aParab); + gp_Pnt P2 = ElCLib::Value(lpar, aParab); + NewFpar = ElCLib::Parameter(PrevParab, P1); + NewLpar = ElCLib::Parameter(PrevParab, P2); + if (NewLpar < NewFpar) + { + Standard_Real MemNewFpar = NewFpar; + NewFpar = NewLpar; + NewLpar = MemNewFpar; + ConnectByOrigin = TopAbs::Reverse(ConnectByOrigin); + } + Done = Standard_True; + } + break; + } + } //end of switch (aType) + } // end of else if (aType == CurType && ... + if (Done) + { + if (NewFpar < FparSeq.Last()) + FparSeq(FparSeq.Length()) = NewFpar; + else + LparSeq(LparSeq.Length()) = NewLpar; + } + else + { + CurveSeq.Append(aCurve); + TopoDS_Shape aLocShape; + aLocShape.Location(aLoc); + aLocShape.Orientation(wexp.Orientation()); + LocSeq.Append(aLocShape); + FparSeq.Append(fpar); + LparSeq.Append(lpar); + TolSeq.Append(BRep_Tool::Tolerance(CurVertex)); + CurType = aType; + } + } // end of else (CurveSeq.IsEmpty()) -> not first time + } // end for (; wexp.More(); wexp.Next()) + + LastVertex = wexp.CurrentVertex(); + TolSeq.Append(BRep_Tool::Tolerance(LastVertex)); + + if (!CurveSeq.IsEmpty()) + { + Standard_Integer nb_curve = CurveSeq.Length(); //number of curves + TColGeom_Array1OfBSplineCurve tab(0,nb_curve-1); //array of the curves + TColStd_Array1OfReal tabtolvertex(0,nb_curve-1); //(0,nb_curve-2); //array of the tolerances + + Standard_Integer i; + + if (nb_curve > 1) + { + for (i = 1; i <= nb_curve; i++) + { + if (CurveSeq(i)->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) + CurveSeq(i) = (*((Handle(Geom_TrimmedCurve)*)&(CurveSeq(i))))->BasisCurve(); + + Handle(Geom_TrimmedCurve) aTrCurve = new Geom_TrimmedCurve(CurveSeq(i), FparSeq(i), LparSeq(i)); + tab(i-1) = GeomConvert::CurveToBSplineCurve(aTrCurve); + tab(i-1)->Transform(LocSeq(i).Location().Transformation()); + GeomConvert::C0BSplineToC1BSplineCurve(tab(i-1), Precision::Confusion()); + if (LocSeq(i).Orientation() == TopAbs_REVERSED) + tab(i-1)->Reverse(); + + //Temporary + //char* name = new char[100]; + //sprintf(name, "c%d", i); + //DrawTrSurf::Set(name, tab(i-1)); + + if (i > 1) + tabtolvertex(i-2) = TolSeq(i-1); + } // end for (i = 1; i <= nb_curve; i++) + tabtolvertex(nb_curve-1) = TolSeq(TolSeq.Length()); + + Standard_Boolean closed_flag = Standard_False; + Standard_Real closed_tolerance = 0.; + if (FirstVertex.IsSame(LastVertex) && + GeomLProp::Continuity(tab(0), tab(nb_curve-1), + tab(0)->FirstParameter(), + tab(nb_curve-1)->LastParameter(), + Standard_False, Standard_False, LinTol, AngTol) >= GeomAbs_G1) + { + closed_flag = Standard_True ; + closed_tolerance = BRep_Tool::Tolerance(FirstVertex); + } + + Handle(TColGeom_HArray1OfBSplineCurve) concatcurve; //array of the concatenated curves + Handle(TColStd_HArray1OfInteger) ArrayOfIndices; //array of the remining Vertex + GeomConvert::ConcatC1(tab, + tabtolvertex, + ArrayOfIndices, + concatcurve, + closed_flag, + closed_tolerance); //C1 concatenation + + if (concatcurve->Length() > 1) + { + GeomConvert_CompCurveToBSplineCurve Concat(concatcurve->Value(concatcurve->Lower())); + + for (i = concatcurve->Lower()+1; i <= concatcurve->Upper(); i++) + Concat.Add( concatcurve->Value(i), LinTol, Standard_True ); + + concatcurve->SetValue(concatcurve->Lower(), Concat.BSplineCurve()); + } + + ResEdge = BRepLib_MakeEdge(concatcurve->Value(concatcurve->Lower()), + FirstVertex, LastVertex); + } + else + { + if (CurveSeq(1)->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) + CurveSeq(1) = (*((Handle(Geom_TrimmedCurve)*)&(CurveSeq(i))))->BasisCurve(); + + CurveSeq(1)->Transform(LocSeq(1).Location().Transformation()); + ResEdge = BRepLib_MakeEdge(CurveSeq(1), + FirstVertex, LastVertex, + FparSeq(1), LparSeq(1)); + } + } + + aShape = ResEdge; + } if (aShape.IsNull()) return 0; diff --git a/src/GEOMImpl/GEOMImpl_Types.hxx b/src/GEOMImpl/GEOMImpl_Types.hxx index d1dcbe274..b954ec438 100755 --- a/src/GEOMImpl/GEOMImpl_Types.hxx +++ b/src/GEOMImpl/GEOMImpl_Types.hxx @@ -257,6 +257,7 @@ #define SUBSHAPE_NOT_SORTED 8 #define FACE_WIRES 9 #define REVERSE_ORIENTATION 10 +#define EDGE_WIRE 11 #define ARCHIMEDE_TYPE 1 diff --git a/src/GEOM_I/GEOM_IShapesOperations_i.cc b/src/GEOM_I/GEOM_IShapesOperations_i.cc index f6ff7d0e2..310111aaa 100644 --- a/src/GEOM_I/GEOM_IShapesOperations_i.cc +++ b/src/GEOM_I/GEOM_IShapesOperations_i.cc @@ -85,6 +85,34 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdge return GetObject(anObject); } +//============================================================================= +/*! + * MakeEdgeWire + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdgeWire + (GEOM::GEOM_Object_ptr theWire, + const CORBA::Double theLinearTolerance, + const CORBA::Double theAngularTolerance) +{ + GEOM::GEOM_Object_var aGEOMObject; + + //Set a not done flag + GetOperations()->SetNotDone(); + + //Get the source wire + Handle(GEOM_Object) aWire = GetObjectImpl(theWire); + + if (aWire.IsNull()) return aGEOMObject._retn(); + + //Create the Edge + Handle(GEOM_Object) anObject = GetOperations()->MakeEdgeWire(aWire, theLinearTolerance, theAngularTolerance); + if (!GetOperations()->IsDone() || anObject.IsNull()) + return aGEOMObject._retn(); + + return GetObject(anObject); +} + //============================================================================= /*! * MakeWire @@ -229,8 +257,11 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShell Handle(GEOM_Object) aShell = GetObjectImpl(theShell); if (aShell.IsNull()) return aGEOMObject._retn(); + std::list aShapes; + aShapes.push_back(aShell); + //Create the Solid - Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShell(aShell); + Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShells(aShapes); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); diff --git a/src/GEOM_I/GEOM_IShapesOperations_i.hh b/src/GEOM_I/GEOM_IShapesOperations_i.hh index fdc3e4ba0..54752caf2 100644 --- a/src/GEOM_I/GEOM_IShapesOperations_i.hh +++ b/src/GEOM_I/GEOM_IShapesOperations_i.hh @@ -44,6 +44,9 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i : GEOM::GEOM_Object_ptr MakeEdge (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2); + GEOM::GEOM_Object_ptr MakeEdgeWire (GEOM::GEOM_Object_ptr theWire, + const CORBA::Double theLinearTolerance, + const CORBA::Double theAngularTolerance); GEOM::GEOM_Object_ptr MakeWire (const GEOM::ListOfGO& theEdgesAndWires, const CORBA::Double theTolerance); diff --git a/src/GEOM_PY/Makefile.am b/src/GEOM_PY/Makefile.am index a3b6695e7..70d732d47 100644 --- a/src/GEOM_PY/Makefile.am +++ b/src/GEOM_PY/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am SUBDIRS= structelem -salomepypkgdir = $(salomepythondir)/salome/geom -salomepypkg_PYTHON = \ +mypkgpythondir = $(salomepythondir)/salome/geom +mypkgpython_PYTHON = \ __init__.py \ geomtools.py diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index 954896f5e..86ebc2a67 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -1551,6 +1551,19 @@ class geompyDC(GEOM._objref_GEOM_Gen): RaiseIfFailed("MakeEdge", self.ShapesOp) return anObj + ## Create an edge from specified wire. + # @param theWire source Wire. + # @param theLinearTolerance linear tolerance value. + # @param theAngularTolerance angular tolerance value. + # @return New GEOM_Object, containing the created edge. + # + # @ref tui_creation_edge "Example" + def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12): + # Example: see GEOM_TestAll.py + anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance) + RaiseIfFailed("MakeEdgeWire", self.ShapesOp) + return anObj + ## Create a wire from the set of edges and wires. # @param theEdgesAndWires List of edges and/or wires. # @param theTolerance Maximum distance between vertices, that will be merged. @@ -3975,7 +3988,9 @@ class geompyDC(GEOM._objref_GEOM_Gen): def AddObject(self,theGroup, theSubShapeID): # Example: see GEOM_TestOthers.py self.GroupOp.AddObject(theGroup, theSubShapeID) - RaiseIfFailed("AddObject", self.GroupOp) + if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT": + RaiseIfFailed("AddObject", self.GroupOp) + pass pass ## Removes a sub object with ID \a theSubShapeId from the group diff --git a/src/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index dcee8dbad..327b0d4bb 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -141,9 +141,9 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW myRestrictGroupBox->setEnabled(!CORBA::is_nil(myMainObj)); allSubs->setChecked(true); - myShowOnlyBtn = new QPushButton(tr("Show only selected"), GroupMedium); - myHideSelBtn = new QPushButton(tr("Hide selected"), GroupMedium); - myShowAllBtn = new QPushButton(tr("Show all sub-shapes"), GroupMedium); + myShowOnlyBtn = new QPushButton(tr("SHOW_ONLY_SELECTED"), GroupMedium); + myHideSelBtn = new QPushButton(tr("HIDE_SELECTED"), GroupMedium); + myShowAllBtn = new QPushButton(tr("SHOW_ALL_SUB_SHAPES"), GroupMedium); mySelAllBtn = new QPushButton(tr("SELECT_ALL"), GroupMedium); myAddBtn = new QPushButton(tr("ADD"), GroupMedium); @@ -1059,11 +1059,9 @@ bool GroupGUI_GroupDlg::execute(ObjectList& objects) SalomeApp_Study* study = getStudy(); if (study) { - char* objIOR = GEOMBase::GetIORFromObject(aGroup); - std::string IOR(objIOR); - free(objIOR); - if (IOR != "") { - _PTR(SObject) SO (study->studyDS()->FindObjectIOR(IOR)); + QString objIOR = GEOMBase::GetIORFromObject(aGroup); + if (objIOR != "") { + _PTR(SObject) SO (study->studyDS()->FindObjectIOR(objIOR.toLatin1().constData())); if (SO) { _PTR(StudyBuilder) aBuilder (study->studyDS()->NewBuilder()); aBuilder->SetName(SO, getNewObjectName().toLatin1().constData()); diff --git a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx index 501517307..20d7d7674 100644 --- a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx @@ -177,8 +177,8 @@ bool MeasureGUI_BndBoxDlg::getParameters( double& theXmin, double& theXmax, if ( CORBA::is_nil(aGeomGen) ) return false; - char* IOR = GEOMBase::GetIORFromObject( myObj ); - GEOM::GEOM_Object_var anObject = aGeomGen->GetIORFromString(IOR); + QString IOR = GEOMBase::GetIORFromObject( myObj ); + GEOM::GEOM_Object_var anObject = aGeomGen->GetIORFromString( IOR.toLatin1().constData() ); if ( CORBA::is_nil(anObject) ) return false; diff --git a/src/NMTDS/NMTDS_Iterator.cxx b/src/NMTDS/NMTDS_Iterator.cxx index b205c9fc4..ce2eeff79 100755 --- a/src/NMTDS/NMTDS_Iterator.cxx +++ b/src/NMTDS/NMTDS_Iterator.cxx @@ -195,14 +195,11 @@ { Standard_Boolean bFlag; Standard_Integer aNb, i, aNbB, aNbR, iFlag; - Standard_Integer i1, i2, aNbSD, iX, j, iDS, jB, iR, k, aNbLV; + Standard_Integer i1, i2, aNbSD, iX, j, iDS, jB, iR, k, aNbLV, aNbLV1; TColStd_ListIteratorOfListOfInteger aIt; TColStd_DataMapOfIntegerInteger aMII; - //modified by NIZNHY-PKV Mon Jan 22 15:08:00 2007f - //TColStd_MapOfInteger aMFence; TColStd_DataMapOfIntegerListOfInteger aMVSD; TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD; - //modified by NIZNHY-PKV Mon Jan 22 10:21:50 2007t TopTools_DataMapOfShapeInteger aMSI; TopAbs_ShapeEnum aTi, aTj; NMTDS_PassKeyBoolean aPKXB; @@ -319,7 +316,14 @@ aMPKXB.Remove(aPKXB); } } - aMVSD.Bind(i, aLV1); + // + //modified by NIZNHY-PKV Mon Sep 27 08:31:04 2010f + aNbLV1=aLV1.Extent(); + if (aNbLV1) { + aMVSD.Bind(i, aLV1); + } + //aMVSD.Bind(i, aLV1); + //modified by NIZNHY-PKV Mon Sep 27 08:31:21 2010t } }//for (i=i1; i<=i2; ++i) { }//for (iR=1; iRSplitShapesPool(); const BOPTools_ListOfPaveBlock& aSplitEdges=aSplitShapesPool(myDS->RefEdge(nED)); - Standard_Integer nV1, nV2, aNewShapeIndex; - Standard_Real t1, t2; + Standard_Integer nV1, nV2, aNbPB, aNewShapeIndex; + Standard_Real t1, t2; TopoDS_Edge aE, aESplit; TopoDS_Vertex aV1, aV2; - + BOPTools_ListIteratorOfListOfPaveBlock aPBIt; + // const TopoDS_Edge aDE=TopoDS::Edge(myDS->Shape(nED)); const TopoDS_Face aDF=TopoDS::Face(myDS->Shape(nFD)); - - BOPTools_ListIteratorOfListOfPaveBlock aPBIt(aSplitEdges); - + // + //modified by NIZNHY-PKV Wed Oct 20 13:20:37 2010f + aNbPB=aSplitEdges.Extent(); + if (aNbPB==1) { + Standard_Real aT1, aT2, dT1, dT2, aDT; + Handle(Geom2d_Curve) aC2D; + // + BOPTools_PaveBlock& aPB=aSplitEdges.First(); + // + const BOPTools_Pave& aPave1=aPB.Pave1(); + t1=aPave1.Param(); + const BOPTools_Pave& aPave2=aPB.Pave2(); + t2=aPave2.Param(); + //// + nV1=aPave1.Index(); + aV1=*((TopoDS_Vertex*)&myDS->GetShape(nV1)); + // + aV2=TopExp::FirstVertex(aDE); + if (aV2.IsSame(aV1)) { + aC2D=BRep_Tool::CurveOnSurface(aDE, aDF, aT1, aT2); + dT1=aT1-t1; + if (dT1<0.) { + dT1=-dT1; + } + // + dT2=aT2-t2; + if (dT2<0.) { + dT2=-dT2; + } + aDT=Precision::PConfusion(); + if(dT1Clear(); + return; + } + } + } + //modified by NIZNHY-PKV Wed Oct 20 13:20:39 2010t + // + aPBIt.Initialize(aSplitEdges); for (; aPBIt.More(); aPBIt.Next()) { BOPTools_PaveBlock& aPB=aPBIt.Value(); diff --git a/src/NMTTools/NMTTools_MapIteratorOfMapOfPaveBlock_0.cxx b/src/NMTTools/NMTTools_MapIteratorOfMapOfPaveBlock_0.cxx index 0a32c9c5b..40c739829 100644 --- a/src/NMTTools/NMTTools_MapIteratorOfMapOfPaveBlock_0.cxx +++ b/src/NMTTools/NMTTools_MapIteratorOfMapOfPaveBlock_0.cxx @@ -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. #include diff --git a/src/NMTTools/NMTTools_MapOfPaveBlock.hxx b/src/NMTTools/NMTTools_MapOfPaveBlock.hxx index 7963a1f98..50007afee 100644 --- a/src/NMTTools/NMTTools_MapOfPaveBlock.hxx +++ b/src/NMTTools/NMTTools_MapOfPaveBlock.hxx @@ -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 _NMTTools_MapOfPaveBlock_HeaderFile #define _NMTTools_MapOfPaveBlock_HeaderFile diff --git a/src/NMTTools/NMTTools_MapOfPaveBlock_0.cxx b/src/NMTTools/NMTTools_MapOfPaveBlock_0.cxx index 6f9d7d8a3..e1e5db0c8 100644 --- a/src/NMTTools/NMTTools_MapOfPaveBlock_0.cxx +++ b/src/NMTTools/NMTTools_MapOfPaveBlock_0.cxx @@ -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. #include diff --git a/src/NMTTools/NMTTools_PaveFiller.cdl b/src/NMTTools/NMTTools_PaveFiller.cdl index 1bc4c8e72..d21a19edf 100644 --- a/src/NMTTools/NMTTools_PaveFiller.cdl +++ b/src/NMTTools/NMTTools_PaveFiller.cdl @@ -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: NMTTools_PaveFiller.cdl -- Created: Fri Dec 5 14:35:00 2003 -- Author: Peter KURNEV @@ -36,13 +35,10 @@ uses Vertex from TopoDS, Face from TopoDS, Shape from TopoDS, - -- Modified to add new definitions Thu Sep 14 14:35:18 2006 - -- Contribution of Samtech www.samcef.com BEGIN Edge from TopoDS, ListOfShape from TopTools, DataMapOfShapeShape from TopTools, ListOfInteger from TColStd, - -- Contribution of Samtech www.samcef.com END Context from IntTools, ShrunkRange from IntTools, @@ -68,12 +64,9 @@ uses ShapesDataStructure from NMTDS, - -- Modified to add new definitions Thu Sep 14 14:35:18 2006 - -- Contribution of Samtech www.samcef.com BEGIN PShapesDataStructure from NMTDS, Iterator from NMTDS, IndexedDataMapOfIndexedMapOfInteger from NMTTools, - -- Contribution of Samtech www.samcef.com END PIterator from NMTDS, PInterfPool from NMTDS @@ -104,12 +97,8 @@ is IP(me:out) returns PInterfPool from NMTDS; -- - -- Perform the algo - -- Modified to add new method Thu Sep 14 14:35:18 2006 - -- Contribution of Samtech www.samcef.com BEGIN Init (me:out) is virtual protected; - -- Contribution of Samtech www.samcef.com END Clear (me:out) is virtual protected; @@ -369,14 +358,12 @@ is returns PaveBlock from BOPTools; ---C++: return const & - --modified by NIZNHY-PKV Fri Nov 30 10:30:54 2007 f RealPaveBlock(me:out; aPB:PaveBlock from BOPTools; aLB:out ListOfInteger from TColStd; aIsCommonBlock:out Integer from Standard) returns PaveBlock from BOPTools; ---C++: return const & - --modified by NIZNHY-PKV Fri Nov 30 10:30:58 2007 t RealSplitsFace (me:out; nF2 :Integer from Standard; @@ -457,8 +444,6 @@ is MakePCurves (me:out); - -- Modified to add new methods Thu Sep 14 14:35:18 2006 - -- Contribution of Samtech www.samcef.com BEGIN PerformVF1(me:out) is protected; @@ -468,7 +453,6 @@ is AloneVertices(me) returns IndexedDataMapOfIndexedMapOfInteger from NMTTools; ---C++: return const & - -- Contribution of Samtech www.samcef.com END IsExistingPaveBlock (me:out; aPB : PaveBlock from BOPTools; @@ -489,19 +473,30 @@ is aTol: Real from Standard) returns Integer from Standard; - -- Modified to add new method Thu Sep 14 14:35:18 2006 - -- Contribution of Samtech www.samcef.com BEGIN SharedEdges(me:out; nF1 :Integer from Standard; nF2 :Integer from Standard; aLNE :out ListOfInteger from TColStd; aLSE :out ListOfShape from TopTools); - -- Contribution of Samtech www.samcef.com END FuseVertices(me; aC:Shape from TopoDS; aDMVV: out DataMapOfShapeShape from TopTools); - + -- + TreatPaveBlocks(me:out; + theLCB:out ListOfCommonBlock from NMTTools); + + ChangePavePoolNew(me:out) + returns PavePool from BOPTools; + ---C++:return & + + --modified by NIZNHY-PKV Thu Nov 11 08:12:50 2010f + CheckCoincidence (me:out; + aPB1 : PaveBlock from BOPTools; + aPB2 : PaveBlock from BOPTools) + returns Boolean from Standard; + --modified by NIZNHY-PKV Thu Nov 11 08:12:54 2010t + fields myDS : PShapesDataStructure from NMTDS is protected; myIsDone : Boolean from Standard is protected; diff --git a/src/NMTTools/NMTTools_PaveFiller.hxx b/src/NMTTools/NMTTools_PaveFiller.hxx index 13e147c87..ba8dbd419 100644 --- a/src/NMTTools/NMTTools_PaveFiller.hxx +++ b/src/NMTTools/NMTTools_PaveFiller.hxx @@ -1,35 +1,27 @@ -// 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 _NMTTools_PaveFiller_HeaderFile #define _NMTTools_PaveFiller_HeaderFile -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Standard_Macro_HeaderFile -#include -#endif - #ifndef _NMTDS_PShapesDataStructure_HeaderFile #include #endif @@ -102,134 +94,204 @@ class TopoDS_Edge; class TopTools_DataMapOfShapeShape; +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + class NMTTools_PaveFiller { + public: - void* operator new(size_t,void* anAddress) - { - return anAddress; - } - void* operator new(size_t size) - { - return Standard::Allocate(size); - } - void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } - - - Standard_EXPORT NMTTools_PaveFiller(); + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT NMTTools_PaveFiller(); Standard_EXPORT virtual ~NMTTools_PaveFiller(); - - Standard_EXPORT void SetCompositeShape(const TopoDS_Shape& aS) ; - - Standard_EXPORT const TopoDS_Shape& CompositeShape() const; - - Standard_EXPORT NMTDS_PShapesDataStructure DS() ; - - Standard_EXPORT NMTDS_PIterator DSIt() ; - - Standard_EXPORT NMTDS_PInterfPool IP() ; - - Standard_EXPORT virtual void Perform() ; - - Standard_EXPORT Standard_Boolean IsDone() const; - - Standard_EXPORT const IntTools_Context& Context() const; - - Standard_EXPORT IntTools_Context& ChangeContext() ; - - Standard_EXPORT const BOPTools_PavePool& PavePool() const; - - Standard_EXPORT BOPTools_PavePool& ChangePavePool() ; - - Standard_EXPORT BOPTools_PavePool& ChangePavePoolNew() ; - - Standard_EXPORT const NMTTools_CommonBlockPool& CommonBlockPool() const; - - Standard_EXPORT NMTTools_CommonBlockPool& ChangeCommonBlockPool() ; - - Standard_EXPORT const BOPTools_SplitShapesPool& SplitShapesPool() const; - - Standard_EXPORT BOPTools_SplitShapesPool& ChangeSplitShapesPool() ; - - Standard_EXPORT Standard_Integer FindSDVertex(const Standard_Integer nV) const; - - Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,TColStd_ListOfInteger& aLs) ; - - Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - Standard_EXPORT Standard_Integer CommonBlocksFace(const Standard_Integer nF,NMTTools_ListOfCommonBlock& aLCB) ; - - Standard_EXPORT void PrepareFace(const Standard_Integer nF,TopoDS_Face& aF) ; - - Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB) ; - - Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB,TColStd_ListOfInteger& aLB,Standard_Integer& aIsCommonBlock) ; - - Standard_EXPORT void RealSplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Boolean HasRealSplitsInOnFace(const Standard_Integer nF1,const Standard_Integer nF2) ; - - Standard_EXPORT void RealSplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT void RealSplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT void RealSplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT void RealSplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT void RealSplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT void PrepareSetForFace(const Standard_Integer nF1,const Standard_Integer nF2,const BOPTools_ListOfPaveBlock& aLPB,BOPTools_PaveSet& aPSF) ; - - Standard_EXPORT void PutPaveOnCurve(const BOPTools_PaveSet& aPSF,const Standard_Real aTol,BOPTools_Curve& aBC) ; - - Standard_EXPORT void PutBoundPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; - - Standard_EXPORT void PutBoundPaveOnCurve(const gp_Pnt& aP,const Standard_Real aT,BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; - - Standard_EXPORT Standard_Boolean FindPave(const gp_Pnt& aP,const Standard_Real aTpV,const BOPTools_PaveSet& aPS,BOPTools_Pave& aPV) ; - - Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const BOPTools_PaveBlock& aPBR,const Standard_Real aTol) ; - - Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB,const Standard_Real aTol) ; - - Standard_EXPORT void MakePCurves() ; - - Standard_EXPORT const NMTTools_IndexedDataMapOfIndexedMapOfInteger& AloneVertices() const; - - Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const TopTools_ListOfShape& aLPB,const Standard_Real aTol) ; - - Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB) ; - - Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const TopoDS_Edge& aE,const Standard_Real aTol) ; - - Standard_EXPORT void SharedEdges(const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLNE,TopTools_ListOfShape& aLSE) ; - - Standard_EXPORT void FuseVertices(const TopoDS_Shape& aC,TopTools_DataMapOfShapeShape& aDMVV) const; + + +Standard_EXPORT void SetCompositeShape(const TopoDS_Shape& aS) ; + + +Standard_EXPORT const TopoDS_Shape& CompositeShape() const; + + +Standard_EXPORT NMTDS_PShapesDataStructure DS() ; + + +Standard_EXPORT NMTDS_PIterator DSIt() ; + + +Standard_EXPORT NMTDS_PInterfPool IP() ; + + +Standard_EXPORT virtual void Perform() ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT const IntTools_Context& Context() const; + + +Standard_EXPORT IntTools_Context& ChangeContext() ; + + +Standard_EXPORT const BOPTools_PavePool& PavePool() const; + + +Standard_EXPORT BOPTools_PavePool& ChangePavePool() ; + + +Standard_EXPORT const NMTTools_CommonBlockPool& CommonBlockPool() const; + + +Standard_EXPORT NMTTools_CommonBlockPool& ChangeCommonBlockPool() ; + + +Standard_EXPORT const BOPTools_SplitShapesPool& SplitShapesPool() const; + + +Standard_EXPORT BOPTools_SplitShapesPool& ChangeSplitShapesPool() ; + + +Standard_EXPORT Standard_Integer FindSDVertex(const Standard_Integer nV) const; + + +Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,TColStd_ListOfInteger& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + +Standard_EXPORT Standard_Integer CommonBlocksFace(const Standard_Integer nF,NMTTools_ListOfCommonBlock& aLCB) ; + + +Standard_EXPORT void PrepareFace(const Standard_Integer nF,TopoDS_Face& aF) ; + + +Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB) ; + + +Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB,TColStd_ListOfInteger& aLB,Standard_Integer& aIsCommonBlock) ; + + +Standard_EXPORT void RealSplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Boolean HasRealSplitsInOnFace(const Standard_Integer nF1,const Standard_Integer nF2) ; + + +Standard_EXPORT void RealSplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT void RealSplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT void RealSplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT void RealSplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT void RealSplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT void PrepareSetForFace(const Standard_Integer nF1,const Standard_Integer nF2,const BOPTools_ListOfPaveBlock& aLPB,BOPTools_PaveSet& aPSF) ; + + +Standard_EXPORT void PutPaveOnCurve(const BOPTools_PaveSet& aPSF,const Standard_Real aTol,BOPTools_Curve& aBC) ; + + +Standard_EXPORT void PutBoundPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; + + +Standard_EXPORT void PutBoundPaveOnCurve(const gp_Pnt& aP,const Standard_Real aT,BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; + + +Standard_EXPORT Standard_Boolean FindPave(const gp_Pnt& aP,const Standard_Real aTpV,const BOPTools_PaveSet& aPS,BOPTools_Pave& aPV) ; + + +Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const BOPTools_PaveBlock& aPBR,const Standard_Real aTol) ; + + +Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB,const Standard_Real aTol) ; + + +Standard_EXPORT void MakePCurves() ; + + +Standard_EXPORT const NMTTools_IndexedDataMapOfIndexedMapOfInteger& AloneVertices() const; + + +Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const TopTools_ListOfShape& aLPB,const Standard_Real aTol) ; + + +Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB) ; + + +Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const TopoDS_Edge& aE,const Standard_Real aTol) ; + + +Standard_EXPORT void SharedEdges(const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLNE,TopTools_ListOfShape& aLSE) ; + + +Standard_EXPORT void FuseVertices(const TopoDS_Shape& aC,TopTools_DataMapOfShapeShape& aDMVV) const; + + +Standard_EXPORT void TreatPaveBlocks(NMTTools_ListOfCommonBlock& theLCB) ; + + +Standard_EXPORT BOPTools_PavePool& ChangePavePoolNew() ; + + +Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) ; @@ -237,76 +299,111 @@ Standard_EXPORT virtual ~NMTTools_PaveFiller(); protected: - - Standard_EXPORT virtual void Init() ; - - Standard_EXPORT virtual void Clear() ; - - Standard_EXPORT virtual void PerformVV() ; - - Standard_EXPORT virtual void PerformVE() ; - - Standard_EXPORT virtual void PerformVF() ; - - Standard_EXPORT virtual void PerformEE() ; - - Standard_EXPORT virtual void PerformEF() ; - - Standard_EXPORT virtual void PerformFF() ; - - Standard_EXPORT void MakeSplitEdges() ; - - Standard_EXPORT virtual void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ; - - Standard_EXPORT void CorrectShrunkRanges(const Standard_Integer aSide,const BOPTools_Pave& aPave,IntTools_ShrunkRange& aSR) ; - - Standard_EXPORT virtual void PreparePaveBlocks(const Standard_Integer anE) ; - - Standard_EXPORT virtual void PrepareEdges() ; - - Standard_EXPORT Standard_Boolean IsSuccessorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const; - - Standard_EXPORT Standard_Boolean IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) const; - - Standard_EXPORT void RefinePavePool() ; - - Standard_EXPORT Standard_Integer CheckFacePaves(const TopoDS_Vertex& aV,const Standard_Integer nF) ; - - Standard_EXPORT void ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; - - Standard_EXPORT void RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; - - Standard_EXPORT void SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; - - Standard_EXPORT void SplitCommonBlock(const NMTTools_CommonBlock& aCB,NMTTools_ListOfCommonBlock& aLCB) ; - - Standard_EXPORT void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aM) ; - - Standard_EXPORT void EFCommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfInteger& aMapCB) ; - - Standard_EXPORT void EENewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - - Standard_EXPORT void EENewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - - Standard_EXPORT void EFNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - - Standard_EXPORT void EFNewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - - Standard_EXPORT void UpdateCommonBlocks() ; - - Standard_EXPORT void UpdatePaveBlocks() ; - - Standard_EXPORT Standard_Integer SplitIndex(const BOPTools_PaveBlock& aPB) const; - - Standard_EXPORT void MakeBlocks() ; - - Standard_EXPORT void PerformVF1() ; - - Standard_EXPORT void MakeAloneVertices() ; - - Standard_EXPORT void TreatPaveBlocks(NMTTools_ListOfCommonBlock& theLCB) ; + // Methods PROTECTED + // + + +Standard_EXPORT virtual void Init() ; + + +Standard_EXPORT virtual void Clear() ; + + +Standard_EXPORT virtual void PerformVV() ; + + +Standard_EXPORT virtual void PerformVE() ; + + +Standard_EXPORT virtual void PerformVF() ; + + +Standard_EXPORT virtual void PerformEE() ; + + +Standard_EXPORT virtual void PerformEF() ; + + +Standard_EXPORT virtual void PerformFF() ; + +Standard_EXPORT void MakeSplitEdges() ; + +Standard_EXPORT virtual void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ; + + +Standard_EXPORT void CorrectShrunkRanges(const Standard_Integer aSide,const BOPTools_Pave& aPave,IntTools_ShrunkRange& aSR) ; + + +Standard_EXPORT virtual void PreparePaveBlocks(const Standard_Integer anE) ; + + +Standard_EXPORT virtual void PrepareEdges() ; + + +Standard_EXPORT Standard_Boolean IsSuccessorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const; + + +Standard_EXPORT Standard_Boolean IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) const; + + +Standard_EXPORT void RefinePavePool() ; + + +Standard_EXPORT Standard_Integer CheckFacePaves(const TopoDS_Vertex& aV,const Standard_Integer nF) ; + + +Standard_EXPORT void ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; + + +Standard_EXPORT void RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; + + +Standard_EXPORT void SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; + + +Standard_EXPORT void SplitCommonBlock(const NMTTools_CommonBlock& aCB,NMTTools_ListOfCommonBlock& aLCB) ; + + +Standard_EXPORT void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aM) ; + + +Standard_EXPORT void EFCommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfInteger& aMapCB) ; + + +Standard_EXPORT void EENewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; + + +Standard_EXPORT void EENewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; + + +Standard_EXPORT void EFNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; + + +Standard_EXPORT void EFNewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; + + +Standard_EXPORT void UpdateCommonBlocks() ; + + +Standard_EXPORT void UpdatePaveBlocks() ; + + +Standard_EXPORT Standard_Integer SplitIndex(const BOPTools_PaveBlock& aPB) const; + + +Standard_EXPORT void MakeBlocks() ; + + +Standard_EXPORT void PerformVF1() ; + + +Standard_EXPORT void MakeAloneVertices() ; + + + // Fields PROTECTED + // NMTDS_PShapesDataStructure myDS; Standard_Boolean myIsDone; Standard_Integer myNbSources; @@ -324,10 +421,14 @@ TopoDS_Shape myCompositeShape; NMTDS_PInterfPool myIP; -private: +private: + // Methods PRIVATE + // + // Fields PRIVATE + // }; @@ -337,6 +438,7 @@ private: // other Inline functions and methods (like "C++: function call" methods) +// #endif diff --git a/src/NMTTools/NMTTools_PaveFiller_4.cxx b/src/NMTTools/NMTTools_PaveFiller_4.cxx index b6dc1b485..22288863a 100644 --- a/src/NMTTools/NMTTools_PaveFiller_4.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_4.cxx @@ -32,6 +32,8 @@ #include #include +#include + #include #include #include @@ -62,6 +64,7 @@ #include #include #include +#include #include #include @@ -170,16 +173,10 @@ void NMTTools_PaveFiller::PerformEE() for (; myDSIt->More(); myDSIt->Next()) { myDSIt->Current(n1, n2, bJustAdd); anIndexIn = 0; - // - //if (myIntrPool->IsComputed(n1, n2)) { - // continue; - //} - // nE1=n1; nE2=n2; // if(bJustAdd) { - //myIntrPool->AddInterference (nE1, nE2, BooleanOperations_EdgeEdge, anIndexIn); continue; } // @@ -281,9 +278,7 @@ void NMTTools_PaveFiller::PerformEE() aR1 = (aEE.Order()) ? anewSR2 : anewSR1; aR2 = (aEE.Order()) ? anewSR1 : anewSR2; // - //modified by NIZNHY-PKV Mon Jun 07 11:01:40 2010f aTol=0.8*aTol; - //modified by NIZNHY-PKV Mon Jun 07 11:01:43 2010t bIsOnPave1=IsOnPave(aT1, aR1, aTol); bIsOnPave2=IsOnPave(aT2, aR2, aTol); // @@ -362,7 +357,6 @@ void NMTTools_PaveFiller::PerformEE() aCoinsideFlag=IsBlocksCoinside(aPB1, aPB2); // if (aNbComPrt2>1 || !aCoinsideFlag) { - //myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn); break; } // @@ -1276,6 +1270,7 @@ void NMTTools_PaveFiller::RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& a void NMTTools_PaveFiller::SplitCommonBlock(const NMTTools_CommonBlock& aCB, NMTTools_ListOfCommonBlock& aLCBx) { + Standard_Boolean bIsCoincided; Standard_Integer i, j,nE, aNbE, aNbSPBx, aNbPB, k; BOPTools_SequenceOfPaveBlock aSPBx; BOPTools_ListIteratorOfListOfPaveBlock anItLPB; @@ -1355,8 +1350,6 @@ void NMTTools_PaveFiller::SplitCommonBlock(const NMTTools_CommonBlock& aCB, aNbSPBx=aSPBx.Length(); aNbPB=aNbSPBx/aNbE; // - //modified by NIZNHY-PKV Fri Jun 04 14:07:37 2010f - // Standard_Integer k1, k2, n11, n12, n21, n22; // for (i=1; i<=aNbPB; ++i) { @@ -1378,28 +1371,20 @@ void NMTTools_PaveFiller::SplitCommonBlock(const NMTTools_CommonBlock& aCB, n21=aPB2.Pave1().Index(); n22=aPB2.Pave2().Index(); if ((n21==n11 && n22==n12) || (n21==n12 && n22==n11)) { - aCBx.AddPaveBlock(aPB2); - break; + //modified by NIZNHY-PKV Thu Nov 11 08:13:24 2010f + bIsCoincided=CheckCoincidence(aPB2, aPB1); + if (bIsCoincided) { + aCBx.AddPaveBlock(aPB2); + break; + } + //aCBx.AddPaveBlock(aPB2); + //break; + //modified by NIZNHY-PKV Thu Nov 11 08:13:31 2010t } } } aLCBx.Append(aCBx); } - /* - for (i=1; i<=aNbPB; ++i) { - NMTTools_CommonBlock aCBx; - // - aCBx.AddFaces(aLF); - // - for (j=1; j<=aNbE; ++j) { - k=i+(j-1)*aNbPB; - const BOPTools_PaveBlock& aPB=aSPBx(k); - aCBx.AddPaveBlock(aPB); - } - aLCBx.Append(aCBx); - } - */ - //modified by NIZNHY-PKV Fri Jun 04 14:07:42 2010t } //======================================================================= @@ -1507,7 +1492,6 @@ void ProcessBlock(const BOPTools_PaveBlock& aPB, ProcessBlock(aPBx, aMapCB, aProcessedBlocks, aChain); } } - // Modified to provide VS interference between // vertex as result of EE and a Face of argument // Thu Sep 14 14:35:18 2006 @@ -1581,3 +1565,48 @@ void ProcessBlock(const BOPTools_PaveBlock& aPB, } } // Contribution of Samtech www.samcef.com END +//modified by NIZNHY-PKV Thu Nov 11 08:13:48 2010f +//======================================================================= +// function: CheckCoincidence +// purpose: +//======================================================================= +Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock& aPB1, + const BOPTools_PaveBlock& aPB2) +{ + Standard_Boolean bRet; + Standard_Integer nE1, nE2, aNbPoints; + Standard_Real aT11, aT12, aT21, aT22, aT1m, aD, aTol, aT2x; + gp_Pnt aP1m; + // + bRet=Standard_False; + // + aT11=aPB1.Pave1().Param(); + aT12=aPB1.Pave2().Param(); + aT1m=IntTools_Tools::IntermediatePoint (aT11, aT12); + nE1=aPB1.OriginalEdge(); + const TopoDS_Edge& aE1=(*(TopoDS_Edge*)(&myDS->Shape(nE1))); + BOPTools_Tools::PointOnEdge(aE1, aT1m, aP1m); + // + aT21=aPB2.Pave1().Param(); + aT22=aPB2.Pave2().Param(); + nE2=aPB2.OriginalEdge(); + const TopoDS_Edge& aE2=(*(TopoDS_Edge*)(&myDS->Shape(nE2))); + // + GeomAPI_ProjectPointOnCurve& aPPC=myContext.ProjPC(aE2); + aPPC.Perform(aP1m); + aNbPoints=aPPC.NbPoints(); + if (aNbPoints) { + aD=aPPC.LowerDistance(); + // + aTol=BRep_Tool::Tolerance(aE1); + aTol=aTol+BRep_Tool::Tolerance(aE2); + if (aDaT21 && aT2x @@ -52,10 +51,10 @@ Standard_EXPORT Handle_Standard_Type& NMTTools_StdMapNodeOfMapOfPaveBlock_Type_( static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; static Handle_Standard_Type _aType = new Standard_Type("NMTTools_StdMapNodeOfMapOfPaveBlock", - sizeof(NMTTools_StdMapNodeOfMapOfPaveBlock), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); + sizeof(NMTTools_StdMapNodeOfMapOfPaveBlock), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); return _aType; } diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.cxx b/src/OperationGUI/OperationGUI_ChamferDlg.cxx index a10babc44..71a6e290c 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.cxx +++ b/src/OperationGUI/OperationGUI_ChamferDlg.cxx @@ -526,6 +526,19 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument() default: break; } + + //rnv: To fix the bug IPAL22041 TC5.1.5: "Fillet Construcion" dialog loses current selection. + // Restore selection of the main shape, if need, + // because it was canceled. + aSelMgr->selectedObjects(aSelList); + if (aSelList.Extent() == 0 && !myShape->_is_nil()) { + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); + ObjectList list; + list.push_back(myShape); + selectObjects(list); + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + } } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx b/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx index 25a6969b8..f7aea996c 100644 --- a/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx +++ b/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx @@ -370,9 +370,12 @@ GEOM::GEOM_IOperations_ptr OperationGUI_Fillet1d2dDlg::createOperation() // function : isValid() // purpose : Verify validity of input data //================================================================================= -bool OperationGUI_Fillet1d2dDlg::isValid (QString&) +bool OperationGUI_Fillet1d2dDlg::isValid (QString& msg) { - return !myShape->_is_nil() && (myIs1D || myVertexes.Extent() > 0); + bool ok = !myShape->_is_nil(); + ok = GroupVertexes->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; + ok = (myIs1D || myVertexes.Extent() > 0) && ok; + return ok; } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_FilletDlg.cxx b/src/OperationGUI/OperationGUI_FilletDlg.cxx index 6cd07c94a..e18e1cb4c 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.cxx +++ b/src/OperationGUI/OperationGUI_FilletDlg.cxx @@ -298,7 +298,6 @@ void OperationGUI_FilletDlg::ConstructorsClicked (int constructorId) qApp->processEvents(); updateGeometry(); resize(minimumSizeHint()); - SelectionIntoArgument(); } //================================================================================= @@ -398,7 +397,7 @@ void OperationGUI_FilletDlg::SelectionIntoArgument() } } - // clear selection + // clear selection of the faces or edges if (!(myEditCurrentArgument == Group2->LineEdit2 || myEditCurrentArgument == Group3->LineEdit2)) { disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); @@ -423,6 +422,19 @@ void OperationGUI_FilletDlg::SelectionIntoArgument() default: break; } + + //rnv: To fix the bug IPAL22041 TC5.1.5: "Fillet Construcion" dialog loses current selection. + // Restore selection of the main shape, if need, + // because it was canceled. + aSelMgr->selectedObjects(aSelList); + if (aSelList.Extent() == 0 && !myShape->_is_nil()) { + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); + ObjectList list; + list.push_back(myShape); + selectObjects(list); + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + } } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_PartitionDlg.cxx b/src/OperationGUI/OperationGUI_PartitionDlg.cxx index b6fac51c7..a18661158 100644 --- a/src/OperationGUI/OperationGUI_PartitionDlg.cxx +++ b/src/OperationGUI/OperationGUI_PartitionDlg.cxx @@ -67,7 +67,7 @@ OperationGUI_PartitionDlg::OperationGUI_PartitionDlg( GeometryGUI* theGeometryGU mainFrame()->RadioButton3->close(); // Full partition (contains half-space partition) - GroupPoints = new DlgRef_2Sel1List1Check( centralWidget() ); + GroupPoints = new DlgRef_2Sel1List2Check( centralWidget() ); GroupPoints->GroupBox1->setTitle( tr( "GEOM_PARTITION" ) ); GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECTS" ) ); GroupPoints->TextLabel2->setText( tr( "GEOM_TOOL_OBJECTS" ) ); @@ -76,9 +76,10 @@ OperationGUI_PartitionDlg::OperationGUI_PartitionDlg( GeometryGUI* theGeometryGU GroupPoints->PushButton2->setIcon( image2 ); GroupPoints->LineEdit1->setReadOnly( true ); GroupPoints->LineEdit2->setReadOnly( true ); - GroupPoints->LineEdit1->setEnabled(true); - GroupPoints->LineEdit2->setEnabled(false); + GroupPoints->LineEdit1->setEnabled( true ); + GroupPoints->LineEdit2->setEnabled( false ); GroupPoints->CheckButton1->setText( tr( "GEOM_KEEP_NONLIMIT_SHAPES" ) ); + GroupPoints->CheckButton2->setText( tr( "GEOM_NO_SELF_INTERSECTION" ) ); QVBoxLayout* layout = new QVBoxLayout( centralWidget() ); layout->setMargin( 0 ); layout->setSpacing( 6 ); @@ -161,20 +162,22 @@ void OperationGUI_PartitionDlg::ConstructorsClicked( int constructorId ) disconnect( myGeomGUI->getApp()->selectionMgr(), 0, this, 0 ); globalSelection(); - myListShapes.length( 0 ); - myListTools.length( 0 ); - myListKeepInside.length( 0 ); - myListRemoveInside.length( 0 ); - myListMaterials.length( 0 ); + //myListShapes.length( 0 ); + //myListTools.length( 0 ); + //myListKeepInside.length( 0 ); // obsolete + //myListRemoveInside.length( 0 ); // obsolete + //myListMaterials.length( 0 ); // obsolete switch ( constructorId ) { case 0: /*Full partition */ GroupPoints->GroupBox1->setTitle( tr( "GEOM_PARTITION" ) ); + GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECTS" ) ); GroupPoints->TextLabel2->setText( tr( "GEOM_TOOL_OBJECTS" ) ); GroupPoints->TextLabel3->show(); GroupPoints->ComboBox1->show(); GroupPoints->ComboBox1->setCurrentIndex( 0 ); GroupPoints->CheckButton1->show(); + GroupPoints->CheckButton2->show(); GroupPoints->PushButton1->setDown( true ); GroupPoints->PushButton2->setDown( false ); GroupPoints->LineEdit1->setEnabled(true); @@ -184,8 +187,10 @@ void OperationGUI_PartitionDlg::ConstructorsClicked( int constructorId ) GroupPoints->GroupBox1->setTitle( tr( "GEOM_PARTITION_HALFSPACE" ) ); GroupPoints->TextLabel3->hide(); GroupPoints->ComboBox1->hide(); + GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECT" ) ); GroupPoints->TextLabel2->setText( tr( "GEOM_PLANE" ) ); GroupPoints->CheckButton1->hide(); + GroupPoints->CheckButton2->hide(); GroupPoints->PushButton1->setDown( true ); GroupPoints->LineEdit1->setEnabled(true); break; @@ -249,27 +254,38 @@ void OperationGUI_PartitionDlg::SelectionIntoArgument() int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true); - if ( nbSel < 1 ) { - if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { - myListShapes.length( 0 ); - myListMaterials.length( 0 ); + if ( getConstructorId() == 1 ) { + // for half-selection, only one shape can be selected as an object + // and only one plane as a tool + if ( nbSel != 1 ) { + if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { + myListShapes.length( 0 ); + // myListMaterials.length( 0 ); // obsolete + return; + } + else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) { + myListTools.length( 0 ); + return; + } } - else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) - myListTools.length( 0 ); } - - // One and only one plane can be selected - - if ( getConstructorId() == 1 && - myEditCurrentArgument == GroupPoints->LineEdit2 && - nbSel != 1 ) { - myListTools.length( 0 ); - return; + else { + if ( nbSel < 1 ) { + if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { + myListShapes.length( 0 ); + //myListMaterials.length( 0 ); // obsolete + return; + } + else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) { + myListTools.length( 0 ); + return; + } + } } if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListShapes, true); - myListMaterials.length( 0 ); + //myListMaterials.length( 0 ); // obsolete if ( !myListShapes.length() ) return; } @@ -277,6 +293,17 @@ void OperationGUI_PartitionDlg::SelectionIntoArgument() GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListTools, true); if ( !myListTools.length() ) return; + else if ( myListTools.length() == 1 && getConstructorId() == 1 ) { + GEOM::GEOM_IMeasureOperations_var mOp = getGeomEngine()->GetIMeasureOperations( getStudyId() ); + GEOM::ListOfLong_var intList; + GEOM::ListOfDouble_var dblList; + GEOM::GEOM_IKindOfShape::shape_kind kind = mOp->KindOfShape( myListTools[0].in(), intList.out(), dblList.out() ); + mOp->Destroy(); + if ( kind < GEOM::GEOM_IKindOfShape::DISK_CIRCLE || kind > GEOM::GEOM_IKindOfShape::PLANAR ) { + myListTools.length( 0 ); + return; + } + } } myEditCurrentArgument->setText( aString ); @@ -372,8 +399,9 @@ GEOM::GEOM_IOperations_ptr OperationGUI_PartitionDlg::createOperation() //================================================================================= bool OperationGUI_PartitionDlg::isValid( QString& ) { - return ( myListShapes.length() || myListTools.length() || - myListKeepInside.length() || myListRemoveInside.length() ); + printf("OperationGUI_PartitionDlg::isValid:myListShapes.length()=%d\n",myListShapes.length()); + printf("OperationGUI_PartitionDlg::isValid:myListTools.length()=%d\n",myListTools.length()); + return ( myListShapes.length() || myListTools.length() ); // || myListKeepInside.length() || myListRemoveInside.length() // obsolete } @@ -384,50 +412,47 @@ bool OperationGUI_PartitionDlg::isValid( QString& ) bool OperationGUI_PartitionDlg::execute( ObjectList& objects ) { bool res = false; - GEOM::GEOM_Object_var anObj; - QString msg; - - int aLimit = GetLimit(); - int aConstructorId = getConstructorId(); - int aKeepNonlimitShapes = 0; - - if ( aConstructorId == 1 ) { - aLimit = GEOM::SHAPE; - } - else { - if ( GroupPoints->CheckButton1->isChecked() ) { - aKeepNonlimitShapes = 1; - } - else { - aKeepNonlimitShapes = 0; - } - } - if ( isValid( msg ) ) { - GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow(getOperation()); - anObj = anOper->MakePartition( myListShapes, myListTools, - myListKeepInside, myListRemoveInside, - aLimit, false, myListMaterials, aKeepNonlimitShapes ); + int aLimit = GetLimit(); + int aKeepNonlimitShapes = GroupPoints->CheckButton1->isChecked(); + bool aNoSelfIntersection = GroupPoints->CheckButton2->isChecked(); + + GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow( getOperation() ); + + switch ( getConstructorId() ) { + case 0: + anObj = aNoSelfIntersection ? + anOper->MakePartitionNonSelfIntersectedShape( myListShapes, myListTools, + myListKeepInside, myListRemoveInside, + aLimit, false, myListMaterials, aKeepNonlimitShapes ) : + anOper->MakePartition( myListShapes, myListTools, + myListKeepInside, myListRemoveInside, + aLimit, false, myListMaterials, aKeepNonlimitShapes ); res = true; + break; + case 1: + anObj = anOper->MakeHalfPartition( myListShapes[0].in(), myListTools[0].in() ); + res = true; + break; } if ( !anObj->_is_nil() ) { TopoDS_Shape aShape; - GEOMBase::GetShape(anObj, aShape, TopAbs_SHAPE); - TopoDS_Iterator It (aShape, Standard_True, Standard_True); - int nbSubshapes=0; - for (; It.More(); It.Next()) + GEOMBase::GetShape( anObj, aShape, TopAbs_SHAPE ); + TopoDS_Iterator It( aShape, Standard_True, Standard_True ); + int nbSubshapes = 0; + for ( ; It.More(); It.Next() ) nbSubshapes++; - if (nbSubshapes) + if ( nbSubshapes ) objects.push_back( anObj._retn() ); else - SUIT_MessageBox::warning(this, - QObject::tr("GEOM_ERROR"), - QObject::tr("GEOM_WRN_PARTITION_RESULT_EMPTY")); + SUIT_MessageBox::warning( this, + QObject::tr( "GEOM_ERROR" ), + QObject::tr( "GEOM_WRN_PARTITION_RESULT_EMPTY" ) ); } - + return res; } diff --git a/src/OperationGUI/OperationGUI_PartitionDlg.h b/src/OperationGUI/OperationGUI_PartitionDlg.h index f179659a5..306a2eb14 100644 --- a/src/OperationGUI/OperationGUI_PartitionDlg.h +++ b/src/OperationGUI/OperationGUI_PartitionDlg.h @@ -29,7 +29,7 @@ #include -class DlgRef_2Sel1List1Check; +class DlgRef_2Sel1List2Check; //================================================================================= // class : OperationGUI_PartitionDlg @@ -65,7 +65,7 @@ private: GEOM::ListOfGO myListRemoveInside; GEOM::ListOfGO myListKeepInside; - DlgRef_2Sel1List1Check* GroupPoints; + DlgRef_2Sel1List2Check* GroupPoints; private slots: void ClickOnOk(); diff --git a/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx b/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx index 60e8bef02..87b6d503d 100644 --- a/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx +++ b/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx @@ -118,6 +118,7 @@ void RepairGUI_ChangeOrientationDlg::Init() initName( tr( "CHANGE_ORIENTATION_NEW_OBJ_NAME" ) ); resize(100,100); + SelectionIntoArgument(); } diff --git a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx index 0d315e37d..7423d3b94 100644 --- a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx +++ b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx @@ -147,6 +147,7 @@ void RepairGUI_DivideEdgeDlg::Init() initName( tr( "DEVIDE_EDGE_NEW_OBJECT_NAME" ) ); resize(100,100); + SelectionIntoArgument(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx index 90c9a3d9c..1a654d7c0 100644 --- a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx @@ -120,6 +120,7 @@ void RepairGUI_RemoveExtraEdgesDlg::Init() initName( tr( "REMOVE_EXTRA_EDGES_NEW_OBJ_NAME" ) ); resize(100,100); + SelectionIntoArgument(); } diff --git a/src/RepairGUI/RepairGUI_SewingDlg.cxx b/src/RepairGUI/RepairGUI_SewingDlg.cxx index 8e5335068..006a929b8 100644 --- a/src/RepairGUI/RepairGUI_SewingDlg.cxx +++ b/src/RepairGUI/RepairGUI_SewingDlg.cxx @@ -137,6 +137,7 @@ void RepairGUI_SewingDlg::Init() initName( tr( "SEWING_NEW_OBJ_NAME" ) ); resize(100,100); + SelectionIntoArgument(); } diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx index cabf3749a..37c3e0e16 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx @@ -322,6 +322,7 @@ void RepairGUI_ShapeProcessDlg::init() reset(); initName( tr( "PROCESS_SHAPE_NEW_OBJ_NAME" ) ); + selectionChanged(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx index 15796bc2f..2469cefe6 100644 --- a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx @@ -246,9 +246,8 @@ void RepairGUI_SuppressFacesDlg::SelectionIntoArgument() aSelMgr->clearSelected(); Standard_Boolean isOk; - char* objIOR = GEOMBase::GetIORFromObject(myObject); - Handle(GEOM_AISShape) aSh = GEOMBase::ConvertIORinGEOMAISShape(objIOR, isOk, true); - free(objIOR); + QString objIOR = GEOMBase::GetIORFromObject(myObject); + Handle(GEOM_AISShape) aSh = GEOMBase::ConvertIORinGEOMAISShape(objIOR.toLatin1().constData(), isOk, true); if (!isOk || aSh.IsNull()) return; diff --git a/src/STEPImport/STEPImport.cxx b/src/STEPImport/STEPImport.cxx index 0ba785429..1983470bc 100644 --- a/src/STEPImport/STEPImport.cxx +++ b/src/STEPImport/STEPImport.cxx @@ -172,6 +172,13 @@ extern "C" Handle(TCollection_HAsciiString) aName = Prod->Name(); TCollection_ExtendedString aNameExt (aName->ToCString()); + // special check to pass names like "Open CASCADE STEP translator 6.3 1" + TCollection_AsciiString aSkipName ("Open CASCADE STEP translator"); + if (aName->Length() >= aSkipName.Length()) { + if (aName->String().SubString(1, aSkipName.Length()).IsEqual(aSkipName)) + continue; + } + // find target shape Handle(Transfer_Binder) binder = TP->Find(enti); if (binder.IsNull()) continue; diff --git a/src/TransformationGUI/Makefile.am b/src/TransformationGUI/Makefile.am index 92153168d..1038e4955 100644 --- a/src/TransformationGUI/Makefile.am +++ b/src/TransformationGUI/Makefile.am @@ -97,4 +97,6 @@ libTransformationGUI_la_CPPFLAGS = \ libTransformationGUI_la_LDFLAGS = \ ../GEOMFiltersSelection/libGEOMFiltersSelection.la \ - ../GEOMBase/libGEOMBase.la + ../GEOMBase/libGEOMBase.la \ + $(CAS_LDPATH) -lTKShHealing + diff --git a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx index e8dcf3148..18c96f017 100644 --- a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx @@ -197,6 +197,12 @@ bool TransformationGUI_MirrorDlg::ClickOnApply() return false; initName(); + + myObjects.length(0); + myEditCurrentArgument = GroupPoints->LineEdit1; + myEditCurrentArgument->setText(""); + myGeomGUI->getApp()->selectionMgr()->clearSelected(); + // activate selection and connect selection manager ConstructorsClicked(getConstructorId()); return true; @@ -524,5 +530,5 @@ void TransformationGUI_MirrorDlg::addSubshapesToStudy() return; } addSubshapesToFather(objMap); - } + } } diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx index 00410ea64..aebe44d82 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx @@ -153,6 +153,8 @@ void TransformationGUI_MultiRotationDlg::Init() myBase = myVector = GEOM::GEOM_Object::_nil(); + mainFrame()->GroupBoxPublish->show(); + // signals and slots connections connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -620,3 +622,24 @@ void TransformationGUI_MultiRotationDlg::addSubshapesToStudy() } addSubshapesToFather(objMap); } + +//================================================================================= +// function : restoreSubShapes +// purpose : +//================================================================================= +void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, + SALOMEDS::SObject_ptr theSObject) +{ + if (mainFrame()->CheckBoxRestoreSS->isChecked()) { + // we pass here the first operation argument (object) through the list of arguments + // because the rotation operation place its arguments in the data structure in another order, + // and we need to point the first argument directly + GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO; + anArgs->length(1); + anArgs[0] = myBase; + getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, + /*theFindMethod=*/GEOM::FSM_Transformed, + /*theInheritFirstArg=*/true, + mainFrame()->CheckBoxAddPrefix->isChecked()); + } +} diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h index c8f05b819..b0874fa41 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h @@ -51,6 +51,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); + virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); private: void Init(); diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx index 996030db8..36f2a54dc 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx @@ -32,8 +32,14 @@ #include #include +#include +#include +#include #include #include +#include +#include +#include // OCCT Includes #include @@ -42,6 +48,10 @@ #include #include #include +#include +#include +#include +#include #include @@ -160,6 +170,8 @@ void TransformationGUI_MultiTranslationDlg::Init() myBase = myVectorU = myVectorV = GEOM::GEOM_Object::_nil(); + mainFrame()->GroupBoxPublish->show(); + // signals and slots connections connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -678,6 +690,7 @@ bool TransformationGUI_MultiTranslationDlg::execute (ObjectList& objects) switch (getConstructorId()) { case 0: if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVectorU)) { + createPathPreview ( myVectorU ); anObj = anOper->MultiTranslate1D(myBase, myVectorU, myStepU, myNbTimesU); if(!IsPreview()) { aParameters<SpinBox_DX->text(); @@ -689,6 +702,8 @@ bool TransformationGUI_MultiTranslationDlg::execute (ObjectList& objects) case 1: if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVectorU) && !CORBA::is_nil(myVectorV)) { + createPathPreview ( myVectorU ); + createPathPreview ( myVectorV ); anObj = anOper->MultiTranslate2D(myBase, myVectorU, myStepU, myNbTimesU, myVectorV, myStepV, myNbTimesV); @@ -731,3 +746,50 @@ void TransformationGUI_MultiTranslationDlg::addSubshapesToStudy() } addSubshapesToFather(objMap); } + +//================================================================================= +// function : restoreSubShapes +// purpose : +//================================================================================= +void TransformationGUI_MultiTranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, + SALOMEDS::SObject_ptr theSObject) +{ + if (mainFrame()->CheckBoxRestoreSS->isChecked()) { + // we pass here the first operation argument (object) through the list of arguments + // because the rotation operation place its arguments in the data structure in another order, + // and we need to point the first argument directly + GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO; + anArgs->length(1); + anArgs[0] = myBase; + getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, + /*theFindMethod=*/GEOM::FSM_Transformed, + /*theInheritFirstArg=*/true, + mainFrame()->CheckBoxAddPrefix->isChecked()); + } +} + +//================================================================================= +// function : createPathPreview +// purpose : +//================================================================================= +void TransformationGUI_MultiTranslationDlg::createPathPreview ( GEOM::GEOM_Object_var thePath ) +{ + if ( IsPreview() ) { + TopoDS_Shape aShape; + GEOMBase::GetShape( thePath, aShape, TopAbs_SHAPE ); + TopoDS_Edge anEdge = TopoDS::Edge( aShape ); + ShapeAnalysis_Edge aShapeAnal; + TopoDS_Vertex aFirst = aShapeAnal.FirstVertex( anEdge ); + TopoDS_Vertex aLast = aShapeAnal.LastVertex( anEdge ); + TopoDS_Shape aVector = BRepBuilderAPI_MakeEdge(BRep_Tool::Pnt(aFirst), BRep_Tool::Pnt(aLast)).Shape(); + const char* aName = "tmpVector"; + Handle(GEOM_AISVector) anIO = new GEOM_AISVector( aVector, aName ); + + // add Prs to preview + SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); + SOCC_Prs* aPrs = dynamic_cast(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0)); + if (aPrs) + aPrs->AddObject(anIO); + GEOMBase_Helper::displayPreview( aPrs, false, true ); + } +} diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h index 3e1f146d8..ec4904819 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h @@ -51,10 +51,12 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); + virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); private: void Init(); void enterEvent( QEvent* ); + void createPathPreview( GEOM::GEOM_Object_var ); private: GEOM::GEOM_Object_var myBase, myVectorU, myVectorV; diff --git a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx index feac8ab91..da9067e0f 100644 --- a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx @@ -91,7 +91,6 @@ TransformationGUI_PositionDlg::TransformationGUI_PositionDlg // Activate Create a Copy mode Group1->CheckButton1->setChecked(true); - Group1->CheckButton1->setChecked(false); CreateCopyModeChanged(true); Init(); @@ -300,6 +299,12 @@ bool TransformationGUI_PositionDlg::ClickOnApply() return false; initName(); + + myObjects.length(0); + myEditCurrentArgument = Group1->LineEdit1; + myEditCurrentArgument->setText(""); + myGeomGUI->getApp()->selectionMgr()->clearSelected(); + // activate selection and connect selection manager ConstructorsClicked(getConstructorId()); return true; @@ -340,8 +345,8 @@ void TransformationGUI_PositionDlg::SelectionIntoArgument() else myEditCurrentArgument->setText(aName); - if (getConstructorId() == 2) - Group1->PushButton5->click(); + /* if (getConstructorId() == 2) + Group1->PushButton5->click();*/ } else if (myEditCurrentArgument == Group1->LineEdit2) { if (aSelList.Extent() != 1) @@ -628,7 +633,6 @@ bool TransformationGUI_PositionDlg::execute (ObjectList& objects) case 1: { for (int i = 0; i < myObjects.length(); i++) { - if (toCreateCopy) anObj = toCreateCopy ? anOper->PositionShapeCopy(myObjects[i], myStartLCS, myEndLCS) : anOper->PositionShape(myObjects[i], myStartLCS, myEndLCS); diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index 1b9183a83..c999df5a2 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -236,6 +236,12 @@ bool TransformationGUI_RotationDlg::ClickOnApply() return false; initName(); + + myObjects.length(0); + myEditCurrentArgument = GroupPoints->LineEdit1; + myEditCurrentArgument->setText(""); + myGeomGUI->getApp()->selectionMgr()->clearSelected(); + // activate selection and connect selection manager ConstructorsClicked(getConstructorId()); return true; diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx index dab7b7ca4..17023381f 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx @@ -202,6 +202,9 @@ void TransformationGUI_ScaleDlg::ConstructorsClicked (int constructorId) { disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); + myPoint = GEOM::GEOM_Object::_nil(); + LineEdit2->clear(); + switch (constructorId) { case 0: // translation an object by dx, dy, dz TextLabel3->setText(tr("GEOM_SCALE_FACTOR")); @@ -258,6 +261,12 @@ bool TransformationGUI_ScaleDlg::ClickOnApply() return false; initName(tr("GEOM_SCALE")); + + myObjects.length(0); + myEditCurrentArgument = LineEdit1; + myEditCurrentArgument->setText(""); + myGeomGUI->getApp()->selectionMgr()->clearSelected(); + // activate selection and connect selection manager ConstructorsClicked(getConstructorId()); return true; diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx index df10e06e1..292af61f6 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx @@ -32,16 +32,27 @@ #include #include +#include +#include +#include #include #include +#include +#include +#include // OCCT Includes #include #include +#include #include #include #include #include +#include +#include +#include +#include #include @@ -272,6 +283,12 @@ bool TransformationGUI_TranslationDlg::ClickOnApply() return false; initName(); + + myObjects.length(0); + myEditCurrentArgument = GroupPoints->LineEdit1; + myEditCurrentArgument->setText(""); + myGeomGUI->getApp()->selectionMgr()->clearSelected(); + // activate selection and connect selection manager ConstructorsClicked(getConstructorId()); return true; @@ -623,6 +640,8 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects) QStringList aParameters; aParameters<SpinBox3->text(); bool byDistance = GroupPoints->CheckBox1->isChecked(); + createPathPreview( myVector ); + if (byDistance) { double aDistance = GroupPoints->SpinBox3->value(); for (int i = 0; i < myObjects.length(); i++) { @@ -727,3 +746,29 @@ void TransformationGUI_TranslationDlg::addSubshapesToStudy() addSubshapesToFather(objMap); } } + +//================================================================================= +// function : createPathPreview +// purpose : +//================================================================================= +void TransformationGUI_TranslationDlg::createPathPreview ( GEOM::GEOM_Object_var thePath ) +{ + if ( IsPreview() ) { + TopoDS_Shape aShape; + GEOMBase::GetShape( thePath, aShape, TopAbs_SHAPE ); + TopoDS_Edge anEdge = TopoDS::Edge( aShape ); + ShapeAnalysis_Edge aShapeAnal; + TopoDS_Vertex aFirst = aShapeAnal.FirstVertex( anEdge ); + TopoDS_Vertex aLast = aShapeAnal.LastVertex( anEdge ); + TopoDS_Shape aVector = BRepBuilderAPI_MakeEdge(BRep_Tool::Pnt(aFirst), BRep_Tool::Pnt(aLast)).Shape(); + const char* aName = "tmpVector"; + Handle(GEOM_AISVector) anIO = new GEOM_AISVector( aVector, aName ); + + // add Prs to preview + SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); + SOCC_Prs* aPrs = dynamic_cast(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0)); + if (aPrs) + aPrs->AddObject(anIO); + GEOMBase_Helper::displayPreview( aPrs, false, true ); + } +} diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.h b/src/TransformationGUI/TransformationGUI_TranslationDlg.h index 2d064dabb..02c437fd5 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.h +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.h @@ -55,6 +55,7 @@ protected: private: void Init(); void enterEvent( QEvent* ); + void createPathPreview( GEOM::GEOM_Object_var ); private: GEOM::ListOfGO myObjects;