Salome HOME
Merge branch occ/shape_reparation_2
authorvsr <vsr@opencascade.com>
Wed, 28 Jan 2015 15:16:24 +0000 (18:16 +0300)
committervsr <vsr@opencascade.com>
Wed, 28 Jan 2015 15:23:03 +0000 (18:23 +0300)
96 files changed:
CMakeLists.txt
bin/geom_setenv.py
doc/salome/examples/CMakeLists.txt
doc/salome/gui/GEOM/images/measures10.png [changed mode: 0755->0644]
doc/salome/gui/GEOM/images/measures2.png
doc/salome/gui/GEOM/images/measures2a.png
doc/salome/gui/GEOM/images/tree_example.png
doc/salome/gui/GEOM/input/arranging_study_objects_page.doc
doc/salome/gui/GEOM/input/check_compound_of_blocks.doc
doc/salome/gui/GEOM/input/creating_cylinder.doc
doc/salome/gui/GEOM/input/creating_explode.doc
doc/salome/gui/GEOM/input/creating_polyline.doc
doc/salome/gui/GEOM/input/creating_smoothingsurface.doc
doc/salome/gui/GEOM/input/dependency_tree.doc
doc/salome/gui/GEOM/input/geometry_preferences.doc
doc/salome/gui/GEOM/input/geompy.doc
doc/salome/gui/GEOM/input/get_non_blocks.doc
doc/salome/gui/GEOM/input/reduce_study.doc
doc/salome/gui/GEOM/input/tui_basic_geom_objs.doc
doc/salome/gui/GEOM/input/tui_polyline.doc [deleted file]
doc/salome/gui/GEOM/input/tui_test_all.doc
doc/salome/gui/GEOM/input/viewing_geom_obj.doc
idl/GEOM_Gen.idl
resources/GEOMCatalog.xml.in
src/AdvancedEngine/AdvancedEngine_IOperations.cxx
src/AdvancedEngine/AdvancedEngine_PipeTShapeDriver.cxx
src/AdvancedGUI/AdvancedGEOM_msg_ja.ts
src/BREPPlugin/BREPPlugin_msg_ja.ts
src/BasicGUI/BasicGUI_CircleDlg.cxx
src/BlockFix/BlockFix_CheckTool.cxx
src/BlockFix/BlockFix_CheckTool.hxx
src/DependencyTree/resources/DependencyTree_msg_fr.ts
src/DependencyTree/resources/DependencyTree_msg_ja.ts
src/EntityGUI/EntityGUI.cxx
src/EntityGUI/EntityGUI_PictureImportDlg.cxx
src/EntityGUI/EntityGUI_PolylineDlg.cxx
src/EntityGUI/EntityGUI_SketcherDlg.cxx
src/GEOMBase/GEOMBase_Helper.cxx
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GEOM_Displayer.h
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GEOM_msg_fr.ts
src/GEOMGUI/GEOM_msg_ja.ts
src/GEOMImpl/GEOMImpl_Block6Explorer.cxx
src/GEOMImpl/GEOMImpl_BooleanDriver.cxx
src/GEOMImpl/GEOMImpl_ChamferDriver.cxx
src/GEOMImpl/GEOMImpl_Fillet2dDriver.cxx
src/GEOMImpl/GEOMImpl_FilletDriver.cxx
src/GEOMImpl/GEOMImpl_HealingDriver.cxx
src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx
src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx
src/GEOMImpl/GEOMImpl_IHealing.hxx
src/GEOMImpl/GEOMImpl_IHealingOperations.cxx
src/GEOMImpl/GEOMImpl_IHealingOperations.hxx
src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx
src/GEOMImpl/GEOMImpl_IShapesOperations.cxx
src/GEOMImpl/GEOMImpl_IShapesOperations.hxx
src/GEOMImpl/GEOMImpl_OffsetDriver.cxx
src/GEOMImpl/GEOMImpl_PartitionDriver.cxx
src/GEOMImpl/GEOMImpl_PipeDriver.cxx
src/GEOMImpl/GEOMImpl_PipePathDriver.cxx
src/GEOMImpl/GEOMImpl_ScaleDriver.cxx
src/GEOMImpl/GEOMImpl_ThruSectionsDriver.cxx
src/GEOMImpl/GEOMImpl_TranslateDriver.cxx
src/GEOMImpl/GEOMImpl_VectorDriver.cxx
src/GEOMUtils/CMakeLists.txt
src/GEOMUtils/GEOMUtils.cxx
src/GEOMUtils/GEOMUtils.hxx
src/GEOM_I/GEOM_IBlocksOperations_i.cc [changed mode: 0755->0644]
src/GEOM_I/GEOM_IBlocksOperations_i.hh
src/GEOM_I/GEOM_IShapesOperations_i.cc
src/GEOM_I/GEOM_IShapesOperations_i.hh
src/GEOM_I/GEOM_Object_i.cc
src/GEOM_I/GEOM_Object_i.hh
src/GEOM_I_Superv/GEOM_Superv_i.cc
src/GEOM_SWIG/GEOM_TestAll.py
src/GEOM_SWIG/geomBuilder.py
src/GEOM_SWIG/gsketcher.py
src/GroupGUI/GroupGUI_GroupDlg.cxx
src/IGESPlugin/IGESPlugin_msg_ja.ts
src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx
src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.h
src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.cxx
src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.h
src/OCC2VTK/OCC2VTK_Tools.cxx
src/OCC2VTK/OCC2VTK_Tools.h
src/RepairGUI/RepairGUI_FreeFacesDlg.cxx
src/RepairGUI/RepairGUI_GlueDlg.cxx
src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx
src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx
src/STEPPlugin/STEPPlugin_msg_ja.ts
src/STLPlugin/STLPlugin_msg_fr.ts
src/STLPlugin/STLPlugin_msg_ja.ts
src/VTKPlugin/VTKPlugin_ExportDriver.cxx
src/VTKPlugin/VTKPlugin_msg_ja.ts
src/XAOPlugin/XAOPlugin_msg_ja.ts

index c03791e8cd8609ce1d377ad3537c98fe24c0f634..3bfa02db817494679ee276476050e5dc2dff6160 100755 (executable)
@@ -30,7 +30,7 @@ CMAKE_POLICY(SET CMP0003 NEW)
 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
 
 SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 5)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
index b4e8b747ac00edcb2b359775d1d33c49353fd8a9..8b34068dcc79be619d84e8c4014ad9830ef960b0 100644 (file)
@@ -20,7 +20,7 @@
 #
 
 import os, sys, string
-from salome_utils import getTmpDir, generateFileName, uniteFiles
+from salome_utils import getLogDir, generateFileName, uniteFiles
 from setenv import add_path, get_lib_dir, salome_subdir
 
 # -----------------------------------------------------------------------------
@@ -29,8 +29,8 @@ def set_env( args ):
     """Add to the PATH-variables modules specific paths"""
     psep = os.pathsep
     python_version="python%d.%d" % sys.version_info[0:2]
-    
-    tmp_dir = getTmpDir()
+
+    tmp_dir = getLogDir()
     env_dir = generateFileName( tmp_dir, prefix="env", with_port=True )
     res_dir = os.path.join( os.getenv( "GEOM_ROOT_DIR" ), "share", salome_subdir, "resources", "geom" )
 
index 74a84d124ddf57004bb67f7eb4f7e99f2758ff79..d42f84ef5a779475265a2cf3fa9c4b67a6b2fd53 100644 (file)
@@ -77,6 +77,7 @@ SET(GOOD_TESTS
   min_distance.py  
   normal_face.py  
   notebook_geom.py  
+  polyline.py
   point_coordinates.py  
   primitives_ex01.py  
   primitives_ex02.py  
old mode 100755 (executable)
new mode 100644 (file)
index 091b2c0..7a05b55
Binary files a/doc/salome/gui/GEOM/images/measures10.png and b/doc/salome/gui/GEOM/images/measures10.png differ
index 21e5218a40ea5f27255b8b25ccf88bde62af74ef..a9e064b5e852679d46b4477b1f71e6770a487c9e 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/measures2.png and b/doc/salome/gui/GEOM/images/measures2.png differ
index 3068f49b196e2092a190ac13b284bb72b49b41bd..718c60f9044d47e8b0ccb09697c44ee201867b63 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/measures2a.png and b/doc/salome/gui/GEOM/images/measures2a.png differ
index e41c1b1f857dc47a80fc62eeb3a7792a52a19d22..bb75713c8aa5a6b6c5d11610e567b0829ad2f6b2 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/tree_example.png and b/doc/salome/gui/GEOM/images/tree_example.png differ
index 88aea81d4c7fc3099f16e188460cf7ee0bb9fe59..e496e02f223911f45473bc5be44a233c0f048476 100644 (file)
@@ -36,11 +36,10 @@ and then displays only the children of the selected object(s).
   to change the order (ascending / descending) by clicking the corresponding title bar of the objects list.
 </li>
 
-<li>\ref dependency_tree_page "Show dependency tree" - shows dependency tree of selected objects
-in new 2D View Window.</li>
+<li>\ref dependency_tree_page "Show dependency tree" - shows the dependency tree with parents and children of the selected object
+in new 2D View Window.</li>
 
-<li>\ref reduce_study_page "Reduce study" - allows to reduce study
-by automatic removing objects according to user's options.</li>
+<li>\ref reduce_study_page "Reduce study" - allows reducing the study by removing objects from it.</li>
 </ul>
 
 <h2> Folders </h2>
index e9893b8e53f577be45e3d4e1b98516535a619a7a..7151dcff7b27f3e73980b9f277ac296e76c63d9f 100644 (file)
@@ -8,7 +8,10 @@ This operation checks whether a shape is a compound of glued blocks.
 
 To be considered as a compound of blocks, the given shape must satisfy the
 following conditions:
-- Each element of the compound should be a Block (6 faces and 12 edges);
+- Each element of the compound should be a Block (6 quadrangle faces);
+- Each quadrangle face is a face that has 1 wire with 4 edges. If there are
+more than 4 edges in a single wire and C1 continuity mode is switched on,
+a face is quadrangular if it has 4 bounds of C1 continuity.
 - Blocks can be connected only via an entire quadrangle face or an entire edge;
 - The compound should be connected;
 - Each couple of connecting quadrangle faces should be glued.
@@ -16,8 +19,10 @@ following conditions:
 
 In this dialog:
 
-- \b Object - the checked object. \b Selection button allows picking it in the viewer or in the object browser. 
-- \b Errors list informs of possible errors, for example:. 
+- \b Object - the checked object. \b Selection button allows picking it in the viewer or in the object browser.
+- <b>Use C1 criterion</b> - option that shitches on/off the C1 continuity mode.
+- <b>Angular Tolerance</b> - angular tolerance to check C1 continuity between neighbor edges in a wire.
+- \b Errors list informs of possible errors, for example:
        - Not a block;
        - Not glued;
        - Not connected;
@@ -26,7 +31,7 @@ In this dialog:
 
 
 \n <b>TUI Command:</b>
-<em>geompy.CheckCompoundOfBlocks(Compound).</em> Checks if the shape
+<em>geompy.CheckCompoundOfBlocks(Compound, theIsUseC1 = False, theAngTolerance = 1.e-12).</em> Checks if the shape
 is a valid compound of blocks. If it is true, then the validity flag
 is returned, and encountered errors are printed in the python console.
 
index d2c9f78e3829ffa84ac96077af346606cfe1776b..8b81f79820a668899917dff9f87463d122a8e199 100644 (file)
@@ -10,8 +10,8 @@ Entity - > Primitives - > Cylinder</b>
 
 \n Firstly, you can define a \b Cylinder by the <b>Base Point</b> (the central
 point of the cylinder base), the \b Vector (the axis of the cylinder),
-and its dimensions: the \b Radius and the \b Height. Also, you can optionally specify
-the \b Angle in order to create a portion of cylinder.
+and its dimensions: the \b Radius and the \b Height. You can optionally specify
+the \b Angle to create a portion of cylinder.
 
 \n <b>TUI Command:</b> <em>geompy.MakeCylinder(Point, Axis, Radius, Height)</em>
 \n <b>Arguments:</b>  Name + 1 vertex + 1 vector + 2 values
@@ -26,8 +26,8 @@ the \b Angle in order to create a portion of cylinder.
 \n Secondly, you can define a \b Cylinder by the given \b Radius and
 \b Height at the origin of coordinate system. The axis of the cylinder
 will be collinear to the OZ axis of the coordinate system. 
-Similarly to first constructor, you can optionally specify the \b Angle
-in order to create a portion of cylinder.
+Similarly to the first constructor, you can optionally specify the \b Angle
+to create a portion of cylinder.
 
 \n <b>TUI Command:</b> <em>geompy.MakeCylinderRH(Radius, Height)</em>
 \n <b>Arguments:</b> Name + 2 values (Dimensions at origin: radius and
index 6caf20df12b9275f058ac9f177a2e9ccef3409de..c25b719ae4545df649247c7e4442441d8a3d4a05 100644 (file)
@@ -76,11 +76,11 @@ variety of ways:
   sub-shapes.
 - <em>geompy.SubShapeAllSortedCentres(Shape, Type)</em> explodes a
   shape on sub-shapes of a given type and sorts them taking into account
-  their gravity centers, to provide stable order of sub-shapes.
+  their gravity centers, to provide stable order of sub-shapes.
   It returns a list of sub-shapes.
 - <em>geompy.SubShapeAllSortedCentresIDs(Shape, Type)</em> explodes
   a shape on sub-shapes of a given type and sorts them taking into
-  account their gravity centers, to provide stable order of sub-shapes.
+  account their gravity centers, to provide stable order of sub-shapes.
   It returns a List of IDs of sub-shapes.
 - <em>geompy.SubShape(Shape, Type, ListOfInd)</em> allows to obtain
   a compound of sub-shapes of  the Shape,  selected by they indices in a
index 7ec36434dfee03817d6e96adaaa7e73f06858204..2ca7f4ba9fd79e04fb2c0b5a85234884159a2a21 100644 (file)
@@ -9,93 +9,68 @@ To create a <b>2D Polyline</b> select in the main menu  <b>New Entity -> Basic -
 \image html polyline_dlg.png
 
 A polyline represents a section or a set of sections. Each section is constructed from a sequence of 2D points
-connected either by linear setgments or an interpolation curve. Every section has its own attributes:
+connected  by either linear segments or an interpolation curve. Every section has its own attributes:
 - \b Name, 
 - \b Type (Polyline or Spline),
 - \b Closed flag.
 
-A Polyline created represents a shape that lies on the XOY plane. It can have the following types:
+A created Polyline represents a shape that lies on the XOY plane. Its type can be one of the following:
 - \b Vertex for a single section with only 1 point.
-- \b Wire for a single section with 2 or more points. A Wire can have multiple edges for more then 2 points if the section type is Polyline.
-A single edge in the result wire is obtained for a Spline or Polyline with 2 points.
+- \b Wire for a single section with 2 or more points. A Wire can have multiple edges for more then 2 points if the section type is Polyline. A single edge in the resulting wire is obtained for a Spline or Polyline with 2 points.
 - \b Compound of Wires and/or Vertices if there are several sections.
 
-For the moment only one reference coordinate system for polyline creation is supported. The XOY plane of the <b>Global coordinate system</b>
-is suggested. Implementation of another reference coordinate system is a subject of further development of this functionality.
-Restore button orientates the viewer correspondingly to the chosen working plane and fits the scene to show all objects.
+For the moment only one reference coordinate system for polyline creation is supported, which is the XOY plane of the <b>Global coordinate system</b>. 
+\b Restore button orientates the viewer correspondingly to the chosen working plane and fits the scene to show all objects.
 For the moment this button works with only one plane.
 
-It is possible to import a shape in this dialog using <b>Import polyline</b> selection button. To do it an imported object should satisfy conditions
-for polyline shapes mentioned above. If a valid shape is selected, when dialog is opened, it is initialized by this shape.
-Though the shape can be on any plane, an imported polyline will be defined on XOY plane only due to the limitation.
+It is possible to import a shape in this dialog using <b>Import polyline</b> selection button. An imported object should meet the conditions for polyline shapes mentioned above. If a valid shape is selected, when the dialog is opened, it is initialized by this shape.
+Though the shape can be on any plane, the imported polyline will be defined on XOY plane only due to the limitation.
 
-The group \b Sections in this dialog represents the Polyline construction framework. Its toolbar has the following operations:
-- \b Undo
-- \b Redo
-- <b>Insert new section</b>
-- <b>Addition mode</b>
-- <b>Modification mode</b> - not implemented
-- <b>Detection mode</b> - not implemented
-- \b Remove
-- <b>Join selected sections</b>
+The group \b Sections in this dialog represents the Polyline construction framework. 
 
-<b>Undo/Redo</b> buttons allows to undo/redo changes of the polyline.
+The buttons <b>Undo</b> and <b>Redo</b> allow to undo or redo the changes of the polyline.
 
-<b>Insert new section</b> button opens a dialog that allows to add a new section:
+<b>Insert new section</b> button opens the corresponding dialog:
 
 \image html polyline_dlg_add_section.png
 
 In this dialog it is possible to choose:
-- \b Name of section
-- \b Type of section
-- \b Closed flag
+- \b Name of section;
+- \b Type of section;
+- Set \b Closed flag.
 
-To create a new section \b Add button should be clicked. \b Cancel button is used to cancel this operation.
-After clicking \b Add button a new section is appeared on the list. Its name supplemented by its type and closedness
-information (see icon) and the number of points (equal to 0 after creation).
+To create a new section, click \b Add button. \b Cancel button is used to cancel this operation.
+After clicking \b Add button a new section appears in the list. Its name is generated automatically depending on its type, closed or opened state and the number of points (equal to 0 after creation).
 
-To modify section parameters it is possible to double-click on a section in the list. In this case the following dialog appears:
+To modify section parameters, double-click on a section in the list. In this case the following dialog appears:
 
 \image html polyline_dlg_edit_section.png
 
-To apply modifications the button \b Ok should be clicked.
+To apply the modifications, click \b Ok button.
 
-<b>Addition mode</b> allows to add points to a section. It is necessary to select a particular section in a list of sections
-and make some mouse clicks in the viewer. A section preview is recomputed after each click.
+<b>Addition mode</b> allows adding points to a section. Select a particular section in the list of sections
+and left-click in the viewer to add new nodes to the section. A section preview is recomputed after each click.
 
 <b>Modification mode</b> and <b>Detection mode</b> are not implemented for the moment.
 
-\b Remove button allows to remove a section. It is available if all modes are deactivated and one section is selected.
+\b Remove button allows removing a section. It is available if all modes are deactivated and one section is selected.
 
 <b>Join selected sections</b> button is available in modification mode if two or more sections are selected. It is used to
-merge several sections into the first one from selection list. Joined section has parameters of the first selected one. Points of
-the other sections are appended at the end of the list of the first section points.
+merge several sections into the first one from the selection list. The points of the merged sections are appended at the end of the list of points of the first section.
 
-Some actions are available via popup menu by right mouse button click.
+Some actions are available via the context menu activated by right mouse button click.
+- <b>Join all sections</b> - joins all defined sections into the first one.
+- \b Join - joins two or more selected sections.
+- <b>Clear all</b> - removes all selected sections. 
+- <b>Set closed</b> - sets \b Closed flag for all selected section.
+- <b>Set open</b>  - unset \b Closed flag for all selected sections.
+- <b>Set polyline</b> - sets the type of all selected sections to Polyline.
+- <b>Set spline</b>  - set the type of all selected sections to Spline. 
 
-If all modes are deactivated:
-- <b>Join all sections</b> - join all defined sections into the first one.
-- \b Join - join sections. Available if two or more sections are selected.
-
-In <b>Addition mode</b>:
-- <b>Join all sections</b> - join all defined sections into the first one.
-
-In <b>Modification mode</b>:
-- <b>Join all sections</b> - join all defined sections into the first one.
-- \b Join - join sections. Available if two or more sections are selected.
-- <b>Clear all</b> - remove all sections. Available if at least one section is selected.
-- <b>Set closed</b> - set all selected section's Closed flag. Available if at least one section is selected.
-- <b>Set open</b>  - reset all selected section's Closed flag. Available if at least one section is selected.
-- <b>Set polyline</b> - set all selected section's type to Polyline. Available if at least one section is selected.
-- <b>Set spline</b>  - set all selected section's type to Spline. Available if at least one section is selected.
-
-In <b>Detection mode</b>:
-- <b>Join all sections</b> - join all defined sections into the first one.
-- \b Join - join sections. Available if two or more sections are selected.
+Different actions are available depending on the mode and selection.  
 
 <h2>TUI Commands</h2>
 
-
 To create the 2D polyline in TUI Polyline2D interface is used.
 
 <em>pl = geompy.Polyline2D()</em> - returns an instance of Polyline2D interface <i>pl</i>.
@@ -103,5 +78,5 @@ To create the 2D polyline in TUI Polyline2D interface is used.
 See the \ref gsketcher.Polyline2D "Polyline2D" interface documentation for more information.
 
 Our <b>TUI Scripts</b> provide you with useful examples of the use of
-\ref tui_polyline_page "2D Polyline".
+\ref tui_creation_polyline "2D Polyline".
 */
index a4d3fb6471d6940d3971141779ba866a439cca94..e59f403b163c3976e47df43dce8b103f6c1badb9 100644 (file)
@@ -14,11 +14,11 @@ In this dialog you can specify the following parameters:
 - <b>Max BSpline surface degree</b> of the resulting BSpline surface;
 - <b>3D tolerance of initial approximation</b>
 
-\note <b>3D tolerance of initial approximation</b> represents a tolerance of
+\note <b>3D tolerance of the initial approximation</b> represents the tolerance of
 initial plate surface approximation. If this parameter is equal to 0 (default),
 its value is automatically computed as <em> max(0.0001, 10*error)</em>,
-where <em>error</em> is a 3D tolerance of the surface representing a maximal
-distance between computed plate surface and given points.
+where <em>error</em> is the 3D tolerance of the surface representing the maximal
+distance between the computed plate surface and given points.
 
 <b>Advanced options:</b> \ref preview_anchor "Preview"
 
@@ -28,7 +28,7 @@ Press "Apply" or "Apply & Close" button to get the resulting <em>GEOM_Object(Sur
 - \em thelPoints is a list of points or compounds of points;
 - \em theNbMax maximum number of Bezier pieces in the resulting surface;
 - \em theDegMax maximum degree;  
-- \em theDMax specifies 3D tolerance of initial approximation
+- \em theDMax specifies 3D tolerance of the initial approximation.
 
 Example:
 
index 15a3a76397326014f49f8f3e9382a4a18bba65a5..2f07c9bd33867c731636559d2d5908f1341e3dc9 100644 (file)
 
 \anchor dependency_tree_general_description_anchor <h2>General description</h2>
 
-In order to better understand the relations between the %GEOM 
-objects in a study the user has a possibility to display the 
-ascendants and descendant of the object(s) in a family tree.
-
-User can build the dependency tree by selecting desirable object 
-in Object Browser or OCC Viewer and calling "Show dependency tree" 
-popup item. It will open a new or clear the existing "Dependency 
-Tree" view window (only one view is supported) and display a 
-dependency tree for the selected object or objects (multiple 
-selection is supported). Also user can rebuild the tree if to select 
-some object(s) right in the "Dependency Tree" view and call 
-"Rebuild the tree" popup menu item.
+You can display the ascendants and descendants of object(s) in a tree structure to better understand the relations between the %GEOM 
+objects in a study .
+
+To build the dependency tree, select the necessary object or objects (multiple 
+selection is supported) in the Object Browser or OCC Viewer and call "Show dependency tree" context menu item. 
 
 \image html tree_example.png
 
-User can change all necessary parameters of Dependency Tree Viewer 
-in \ref pref_dependency_tree "Preferences".
+
+"Dependency Tree" view window will display the dependency tree for the selected object. 
+It is also possible to select an object(s) directly in the "Dependency Tree" view and to rebuild the tree by selecting 
+"Rebuild the tree" context menu item.
+
+All necessary parameters of Dependency Tree Viewer can be edited in the \ref pref_dependency_tree "Preferences".
 
 <hr>
 \anchor dependency_tree_nodes_anchor <h2>Nodes</h2>
@@ -37,62 +34,48 @@ in \ref pref_dependency_tree "Preferences".
 Tree nodes in the Dependency Viewer are named according to the study 
 names of the corresponding objects. 
 
-Non-published objects are shown in the tree as "unpublished" and 
-colored in special color.
-
-All nodes have the fixed size, so the long names are cut and shown 
-with ellipsis; full name of the object can be seen in the tooltip 
-if to keep the cursor over the node.
+All nodes have fixed size, so long names are cut; the full object name can be seen in the tooltip 
+when the cursor is hovered over the node.
 
 "Dependency Tree" view supports the following states of nodes:
 
-<ul><li><b>Main node</b> - node of main object(s), which were selected in Object 
-Browser, OCC Viewer or Dependency Tree Viewer in order to build the 
-dependency tree;</li></ul>
+<ul><li><b>Main node</b> - corresponds to the main object(s) selected in Object 
+Browser, OCC Viewer or Dependency Tree Viewer;</li></ul>
 \image html tree_main_node.png
 
-<ul><li><b>Default node</b> - node of published in study object, which participate in building of 
-dependency tree as ascendant or descendant;</li></ul>
+<ul><li><b>Default node</b> - ascendant or descendant node of the dependency tree corresponding to an object published in the study;</li></ul>
 \image html tree_default_node.png
 
-<ul><li><b>Unpublished node</b> - the same as "Default node", but 
-corresponding object was not published in study;</li></ul>
+<ul><li><b>Unpublished node</b> - corresponds to an object that was not published in the study;</li></ul>
 \image html tree_unpublished_node.png
 
-<ul><li><b>Highlighted node</b> - the state of node when mouse 
-cursor is over it;</li></ul>
+<ul><li><b>Highlighted node</b> - the state of a node when the mouse cursor is hovered over it;</li></ul>
 \image html tree_highlighted_node.png
 
-<ul><li><b>Selected node</b> - the state of node when user 
-clicks the left mouse button on node.</li></ul>
+<ul><li><b>Selected node</b> - the state of node when the user clicks the left mouse button it.</li></ul>
 \image html tree_selected_node.png
 
 <hr>
 \anchor dependency_tree_links_anchor <h2>Links</h2>
 
 Dependency Tree Viewer shows oriented links between nodes to 
-represent dependency direction. Viewer supports the following states 
-of links:
+represent the dependency direction. The viewer supports the following states of links:
 
-<ul><li><b>Unidirectional link</b> - shows that A object depends on 
-B object;</li></ul>
+<ul><li><b>Unidirectional link</b> - shows that object B depends on object A;</li></ul>
 \image html tree_unidir_link.png
 
-<ul><li><b>Bidirectional link</b> - shows that A object depends on 
-B object and, at the same time, B object depends on 
-A object;</li></ul>
+<ul><li><b>Bidirectional link</b> - shows that object B depends on 
+object A and, at the same time, object A depends on object B;</li></ul>
 \image html tree_bidir_link.png
 
-<ul><li><b>Self-dependency link</b> - shows that object depends on 
-itself;</li></ul>
+<ul><li><b>Self-dependency link</b> - shows that an object depends on itself;</li></ul>
 \image html tree_selfdep_link.png
 
-<ul><li><b>Cyclic dependency links</b> - shows cyclic dependency of 
-some nodes.</li></ul>
+<ul><li><b>Cyclic dependency links</b> - shows cyclic dependency of some nodes.</li></ul>
 \image html tree_cycldep_link.png
 
 <hr>
-\anchor dependency_tree_operations_anchor <h2>Operations</h2>
+\anchor dependency_tree_operations_anchor <h2>Viewer Operations</h2>
 
 The dependency tree of a chosen %GEOM object is displayed in 
 the dedicated 2D view window.
@@ -105,8 +88,7 @@ mouse button.
 
 \image html tree_tool_bar.png
 
-<b>Dump View</b> - exports an object from the viewer in bmp, png or
-jpeg image format.
+<b>Dump View</b> - exports the current scene in bmp, png or jpeg image format.
 \image html tree_view_dump.png
 
 <b>Fit all</b> - scales the presentation so that it could fit within
@@ -140,38 +122,32 @@ levels to be shown in the dependency tree.
 <ul>
 <li>Level 1 corresponds to the parents and children of the selected 
 object(s);</li>
-<li>Level 2 is Level 1 plus the grand-parents and grand-children 
+<li>Level 2 adds the grand-parents and grand-children 
 of the selected object(s);</li>
 <li>etc...</li>
 </ul>
 
-<b>Display ascendants</b> - allows user to control the displaying 
-of ascendants.
+<b>Display ascendants</b> - allows showing/hiding the ascendants.
 \image html tree_disp_ascendants.png
 
-<b>Display descendants</b> - allows user to control the displaying 
-of descendants.
+<b>Display descendants</b> - allows showing/hiding the descendants.
 \image html tree_disp_descendants.png
 
-<b>Move nodes</b> - enables/disables of moving the nodes.
+<b>Move nodes</b> -if checked, it is possible to move nodes in the viewer.
 \image html tree_move_nodes.png
 
-<b>Update</b> - allows user to update a dependency tree model and the view.
+<b>Update</b> - updates the dependency tree view, reflecting changes introduced in the hierarchy.
 \image html tree_button_update.png
 
 <hr>
-\anchor dependency_tree_navigation_anchor <h2>Navigation</h2>
-
-Dependency Tree 2D Viewer supports the following navigation mode:
+\anchor dependency_tree_navigation_anchor <h2>Selection and Shortcuts</h2>
 
 <ul>
-<li>rectangle selection in this mode is performed by the left mouse 
-button</li>;
-<li>multiple selection is available when \b Shift button 
+<li>It is possible to select multiple nodes in the view by rectangle selection or by clicking nodes when \b Shift button 
 is pressed.</li>
 </ul>
 
-Also, holding \b Ctrl key with pressed mouse buttons performs 
+Holding \b Ctrl key with pressed mouse buttons performs 
 the following view transformations:
 <ul>
 <li>Ctrl + left mouse button - zooming;</li>
@@ -179,33 +155,23 @@ the following view transformations:
 </ul>
 
 <hr>
-\anchor dependency_tree_popup_menu_anchor <h2>Popup Menu</h2>
+\anchor dependency_tree_popup_menu_anchor <h2>Context Menu</h2>
 
-After the object has appeared in the Dependency Tree 2D Viewer, 
-user can select it with left mouse click to change its presentation 
-parameters and get access to other useful options by right-clicking on 
-the selected object.
+The following operations are available from the context menu of the selected object.
 
 \image html tree_popup_menu1.png
 
 <ul>
-<li>\b Show - allows to show selected object(s) in OCC 3D Viewer;</li>
-<li><b> Show Only</b> - allows to show only selected object(s) 
-in OCC 3D Viewer;</li>
-<li><b> Rebuild the tree</b> - allows to rebuild the dependency tree 
+<li>\b Show - shows the selected object(s) in OCC 3D Viewer;</li>
+<li><b> Show Only</b> - shows only the selected object(s) in OCC 3D Viewer;</li>
+<li><b> Rebuild the tree</b> - rebuilds the dependency tree 
 for selected object(s);</li>
-<li>\ref reduce_study_page "Reduce study" - allows to reduce study.</li>
-</ul>
-
-Some functionalities are available through right-clicking on 
-the viewer background:
+<li>\ref reduce_study_page "Reduce study" - allows reducing the study.</li>
 
 \image html tree_popup_menu2.png
 
-Dependency Tree 2D Viewer background can be customized using the 
-"Change background" popup menu command that opens standard 
-"Select Color" dialog box:
-
-\image html selectcolor.png
+<li>It is also possible to customize the background of Dependency Tree 2D Viewer using the 
+corresponding context menu command.</li>  
+</ul>
 
 */
index 5e9e94e7d69859a5e6d7ebfe81ae93187af5e3ba..ea011b8bfefd350b78a4a157b59865741fd0b7bb 100644 (file)
@@ -4,10 +4,9 @@
 
 \anchor pref_settings <h2>Settings</h2>
 
-In the \b Geometry module you can set preferences for visualisation of
+In the \b Geometry module you can set preferences for visualization of
 geometrical figures, which can be used in later sessions with this module.
-There is also a special group of preferences controlling input
-precision for floating-point data.
+
 
 \image html pref15.png
 
@@ -67,7 +66,7 @@ of values set in spin boxes.</li>
 </ul>
 
 <ul>
-<li><b>Dimensions (Measurements)</b></li>
+<li><b>Dimensions (Measurements)</b> - a group of preferences controlling the presentation of dimensions.</li>
 <ul>
 <li><b>Color</b> - allows to define color for persistent dimension presentations.</li>
 <li><b>Line width</b> - allows to define pixel width of dimension lines.</li>
@@ -91,7 +90,8 @@ By default <b>Along U</b> and <b>Along V</b> are null and isolines are not drawn
 </ul>
 
 <ul>
-<li><b>Input fields precision</b></li>
+<li><b>Input fields precision</b> - a group of preferences controlling input
+precision for floating-point data.</li>
 <ul>
 <li><b>Length precision</b> - allows to adjust input precision of coordinates and dimensions.</li>
 <li><b>Angular precision</b> - allows to adjust input precision of angles.</li>
@@ -147,32 +147,29 @@ system immediately after the module activation.</li>
 
 \anchor pref_dependency_tree <h2>Dependency Tree</h2>
 
-Also user can set preferences for visualisation of <b>Dependency Tree</b> in 2D Viewer.
+This tab groups preferences for visualization of <b>Dependency Tree</b> in the 2D Viewer.
 
 \image html pref_dep_tree.png
 
 <ul>
 <li><b>General</b></li>
 <ul>
-<li><b>Hierarchy type</b> - allows to choose default displaying mode of dependency tree.</li>
-<li><b>Possibility to move nodes</b> - enable/disable the possibility of moving nodes by default.</li>
+<li><b>Hierarchy type</b> - allows to choose the default display mode of the dependency tree.</li>
+<li><b>Possibility to move nodes</b> - enables/disables the possibility of moving nodes by default.</li>
 </ul>
 </ul>
 
 <ul>
 <li><b>Color</b></li>
 <ul>
-<li><b>Background color</b> - allows to select default background color.</li>
-<li><b>Default node color</b> - allows to select default node color.</li>
-<li><b>Main node color</b> - allows to select default main node color.</li>
-<li><b>Unpublished node color</b> - allows to select default node color
-for unpublished objects.</li>
-<li><b>Selected node color</b> - allows to select default selected node color.</li>
-<li><b>Default arrow color</b> - allows to select default arrow color.</li>
-<li><b>Highlighted arrow color</b> - allows to select default highlighted 
-arrow color.</li>
-<li><b>Selected arrow color</b> - allows to select default selected 
-arrow color.</li>
+<li><b>Background color</b> - allows to select the default background color.</li>
+<li><b>Default node color</b> - allows to select the default node color.</li>
+<li><b>Main node color</b> - allows to select the default main node color.</li>
+<li><b>Unpublished node color</b> - allows to select the default node color for unpublished objects.</li>
+<li><b>Selected node color</b> - allows to select the default selected node color.</li>
+<li><b>Default arrow color</b> - allows to select the default arrow color.</li>
+<li><b>Highlighted arrow color</b> - allows to select the default highlighted arrow color.</li>
+<li><b>Selected arrow color</b> - allows to select the default selected arrow color.</li>
 </ul>
 </ul>
 
index c483ca71ccd6c90c64b4df02bcaeed659b3e3d6f..a39809963aee53de68a9f52c947374d30301cb38 100644 (file)
@@ -31,6 +31,7 @@ provided by Geometry module.
     <li>\ref tui_working_with_groups_page</li>
     <li>\ref tui_building_by_blocks_page</li>
     <li>\ref tui_sketcher_page</li>
+    <li>\ref tui_3dsketcher_page</li>
     <li>\ref tui_advanced_geom_objs_page</li>
   </ul>
   <li>\subpage tui_viewing_geom_objs_page</li>
index 79f6ba0219ef9b3b633145648cad4ad9e74f8cb6..e2b566dd30431580ae53f5be5f6aac1fa4573e47 100644 (file)
@@ -5,24 +5,45 @@
 
 This operation retrieves all non-block solids and non-quadrangular faces from the selected shape.
 
-A non-block solid is a solid that does not have 6 faces, or has 6 faces, but some of them are not quadrangular.
+A block solid is a solid that has 6 quadrangular faces.
+
+A quadrangular face is a face that has 1 wire with 4 edges. If there are
+more than 4 edges in a single wire and C1 continuity mode is switched on,
+a face is quadrangular if it has 4 bounds of C1 continuity.
+
+All solids and faces from a shape that do not satisfy these conditions are
+returned by this operation.
 
 \image html measures2.png
 
-\b Preview option shows non block solids and faces in the viewer. 
+It is possible to select an \b Object to be explored, to check or uncheck
+<b>Use C1 criterion</b> option and to set the <b>Angular Tolerance</b>
+to check C1 continuity between neighbor edges in a wire.
 
-Press \b Apply or <b>Apply and Close</b> button to publish non block solids and faces in the Object
-Browser under the processed object. Solids and faces are published separately in two groups. 
+\b Preview option shows non-block solids and non-quadrangular faces in the viewer. 
+
+Press \b Apply or <b>Apply and Close</b> button to publish non-block solids
+and non-quadrangular faces in the Object Browser under the processed object.
+Solids and faces are published separately in two groups. 
 
 If no bad sub-shapes have been found, the corresponding warning is shown. 
 
 \image html measures2a.png
 
 \n <b>TUI Command:</b>
-<em>geompy.GetNonBlocks(Compound).</em> Returns a tuple of two GEOM_Objects. 
-
-The first object is a group of all non block solids; the second object is a group of all non
-quadrangular faces.
+<em>geompy.GetNonBlocks(theShape, theIsUseC1 = False, theAngTolerance = 1.e-12).</em> \n
+where \n
+\em theShape is the shape to explore, \n
+\em theIsUseC1 is the flag to check if there are 4 bounds on a face
+    taking into account C1 continuity, \n
+\em theAngTolerance the angular tolerance to check if two neighbor edges are
+    codirectional in the common vertex with this tolerance. This parameter is
+    used only if \em theIsUseC1 is set to True.
+
+This command returns a tuple of two GEOM_Objects. 
+
+The first object is a group of all non-block solids; the second object is a group
+of all non-quadrangular faces.
 
 See also a \ref tui_get_non_blocks_page "TUI example".
 
index 8a3c7e7662ee31a2e7ef0d92a1ab061637edfc8c..6757c5a1ad1e14997a746ce3e50a7e61546c53db 100644 (file)
@@ -2,55 +2,52 @@
 
 \page reduce_study_page Reduce Study
 
-The user sometimes needs to keep in the study only some objects that 
+It can be sometimes necessary to keep in the study only the objects that 
 present the final result(s) of the design operations and to delete all 
-other objects which do not contribute to these results.
+other objects, which do not contribute to these results.
 
-The feature is especially useful when the user designs the whole model 
-through the GUI and wants to generate simplified "clean" Python dump only 
-at the end of the model construction with no "useless" objects in the 
-%GEOM module.
+This is especially useful when the model is designed using the GUI 
+and it is necessary to generate a simplified "clean" Python dump without "useless" objects 
+at the end of the model construction.
 
-User can open dialog box by selecting desirable object(s) in Object 
-Browser or OCC Viewer and calling "Reduce study" popup item.
+This feature can be activated by selecting the desirable object(s) in Object 
+Browser or OCC Viewer and calling "Reduce study" context item.
 
 \image html reduce_study_dialog.png
 
 <ul>
 
 <li><b> Objects to be kept</b> - objects that will be kept in the study after 
-applying operation of reduce study. The list of objects being selected by 
+applying reduce study operation. The objects selected by 
 the user are highlighted in bold font.</li>
 
 <li><b> Objects to be removed</b> - objects that will be deleted.</li>
 
-\note Mentioned views provide possibility to show/hide object(s) in 
-current Viewer using "eye" icon near each item of tree. Also user can 
-show/hide ALL objects in tree by clicking "eye" icon in the head of tree view.
+\note It is possible to show/hide object(s) in the 
+current Viewer using "eye" icon next to each tree item. 
+ALL objects in the tree can be shown/hidden by clicking the "eye" icon in the head of the tree view.
+
+<li><b> Intermediate objects</b> group box allows choosing what should be done with the objects that are used to produce the selected object(s):
+<li><b> Sub-objects</b> group box allows choosing the same operations for 
+sub-objects of the selected object(s).</li>
 
-<li><b> Intermediate objects</b> group box allows to choose an action 
-that will be performed with the objects that took part in the operations 
-chain to produce the selected object(s):
 <ul>
 <li>Keep - object(s) will be kept in the study;</li>
 <li>Unpublish - object(s) will be unpublished (hidden) from the study;</li>
 <li>Remove - object(s) will be removed from the study. \note Since use of 
-this option can lead to the broken Dump Python script, the warning message 
-will be shown at the operation commiting to confirm/reject removing 
-intermediate objects.</li>
+this option can cause a broken Dump Python script, the warning message 
+is shown confirm/reject removing intermediate objects.</li>
 </ul>
 </li>
 
-<li><b> Sub-objects</b> group box allows to choose the same operations for 
-sub-objects of selected item(s): keep, unpublish or remove.</li>
 
-<li><b> Remove empty folders</b> - if this option is checked, then all folders, 
+<li><b> Remove empty folders</b> - if this option is checked, all folders, 
 which will become empty after removing unused objects from the study, 
 will be also removed; otherwise, empty folders will be kept.</li>
 
-<li><b> Soft removal</b> - if this option is checked, operation will just 
-unpublish the redundant objects from the study instead of their hard delete.
-\n Soft removal would keep all the data in the study to give the user a 
+<li><b> Soft removal</b> - if this option is checked, the operation will 
+unpublish the redundant objects from the study instead of deleting them.
+\n So, soft removal keeps all data in the study to give the user a 
 chance to revert this operation using \ref publish_hidden_objects 
 "Publish Objects" dialog box.</li>
 
index 2083bcc461cf3cb4493b01b2c2ca2fc8750c105d..4d141752b629aebf3ec4754fea8bc30feb58b436 100644 (file)
@@ -42,4 +42,8 @@
 <br><h2>Creation of a Surface From Face</h2>
 \tui_script{basic_geom_objs_ex10.py}
 
+\anchor tui_creation_polyline
+<br><h2>Creation of 2D Polyline</h2>
+\tui_script{polyline.py}
+
 */
diff --git a/doc/salome/gui/GEOM/input/tui_polyline.doc b/doc/salome/gui/GEOM/input/tui_polyline.doc
deleted file mode 100644 (file)
index ff83b90..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-/*!
-
-\page tui_polyline_page 2D Polyline
-\tui_script{polyline.py}
-
-*/
index 56beffc5de137abc085ccd13e4cef45f6f23419e..1718afb0043bb3d64929ae19ab9482eb3250ce7a 100644 (file)
 \until Scale4
 
 \anchor swig_all_trsf_more
-\until MakeOffset
+\until MakeProjectionOnWire
 
 \anchor swig_ChangeOrientation
 \until ChangeOrientation
 
+\anchor swig_ExtendFaceEdge
+\until ExtendFace
+
+\anchor swig_SurfaceFromFace
+\until MakeSurfaceFromFace
+
 \anchor swig_ExtractShapes
 \until prism_edges
 
+\until IDlist_f
+
 \anchor swig_FilletChamfer
 \until End of Local operations
 
 \anchor swig_all_patterns
-\until MultiRot2D
+\until MultiRot2Ds
 
 \anchor swig_all_measure
 \until "CheckShape(Prism) = "
@@ -91,6 +99,9 @@
 \until nameS
 
 \anchor swig_all_decompose
+\until geompy.RestoreSubShapes(Partition1)
+
+\anchor swig_GetSubShapeEdgeSorted
 \until print "DONE"
 
 */
index 29a43cfbf1ca54b70a8d297d8b55ca2b065b4af1..430624deb96dece433c1b50a645358df9cb90ba4 100644 (file)
@@ -64,10 +64,9 @@ geometrical object. TUI Command: <em>sg.DisplayOnly(ID)</em></li>
 
 <li><b>Show all dimensions</b> - shows all of the persistent dimensions created for the selected geometrical object.</li>
 <li><b>Hide all dimensions</b> - hides all of the persistent dimensions created for the selected geometrical object.</li>
-<li>\subpage dependency_tree_page "Show dependency tree" - shows dependency tree of selected objects
-in new 2D View Window.</li>
-<li>\subpage reduce_study_page "Reduce study" - allows to reduce study
-by automatic removing objects according to user's options.</li>
+<li>\subpage dependency_tree_page "Show dependency tree" - shows the dependency tree with parents and children of the selected object
+in a new 2D View Window.</li>
+<li>\subpage reduce_study_page "Reduce study" - allows reducing the study by removing objects from it.</li>
 <li><b>Dump view</b> - exports an object from the viewer in bmp, png,
 jpg or jpeg image format.</li>
 <li><b>Change background</b> - allows to redefine the background
index 26412f7e5f13a276593c72c2a29fb39ba8fe3256..5ea2b1b2dc07263e04adb8b10b3336a1143b92a3 100644 (file)
@@ -2657,6 +2657,15 @@ module GEOM
      */
     GEOM_Object MakeSurfaceFromFace(in GEOM_Object theFace);
 
+    /*!
+     * \brief Explode a shape into edges sorted in a row from a starting point.
+     * \param theShape - the shape to be exploded on edges.
+     * \param theStartPoint - the starting point.
+     * \return Ordered list of edges sorted in a row from a starting point.
+     */
+    ListOfGO GetSubShapeEdgeSorted (in GEOM_Object theShape,
+                                    in GEOM_Object theStartPoint);
+
   };
 
  // # GEOM_IBlocksOperations: 
@@ -2902,10 +2911,14 @@ module GEOM
      *  - The glue between two quadrangle faces should be applied.
      *    \note Single block is also accepted as a valid compound of blocks.
      *  \param theCompound The compound to check.
+     *  \param theToleranceC1 the tolerance to check if two neighbor edges are
+     *         collinear in the common vertex with this tolerance. Negative
+     *         value means that C1 criterion is not used (old implementation).
      *  \param theErrors Structure, containing discovered errors and incriminated sub-shapes.
      *  \return TRUE, if the given shape is a compound of blocks.
      */
     boolean CheckCompoundOfBlocks (in GEOM_Object theCompound,
+                                   in double      theToleranceC1,
                                    out BCErrors   theErrors);
 
     /*!
@@ -2922,12 +2935,17 @@ module GEOM
      *  \brief Retrieve all non blocks solids and faces from a shape.
      *
      *  \param theShape The shape to explore.
+     *  \param theToleranceC1 the tolerance to check if two neighbor edges are
+     *         collinear in the common vertex with this tolerance. Negative
+     *         value means that C1 criterion is not used (old implementation).
      *  \param theNonQuads Output parameter. Group of all non quadrangular faces.
      *
      *  \return Group of all non block solids (= not 6 faces, or with 6
      *          faces, but with the presence of non-quadrangular faces).
      */
-    GEOM_Object GetNonBlocks (in GEOM_Object theShape, out GEOM_Object theNonQuads);
+    GEOM_Object GetNonBlocks (in GEOM_Object  theShape,
+                              in double       theToleranceC1,
+                              out GEOM_Object theNonQuads);
 
     /*!
      *  \brief Remove all seam and degenerated edges from \a theShape.
index 427b9c16a960ba85015c402de857f0aa1e37f6fa..3ba3cf2a0f24de466a9101c8763bbb96e2640f62 100644 (file)
@@ -33,6 +33,7 @@
   <!-- Geom data types  -->
   <type-list>
     <!-- From GEOM_Gen.idl -->
+    <objref name="CORBA/Object" id="" />
     <objref name="GEOM/GEOM_Gen" id="IDL:GEOM/GEOM_Gen:1.0" />
     <objref name="GEOM/GEOM_BaseObject" id="IDL:GEOM/GEOM_BaseObject:1.0" />
     <objref name="GEOM/GEOM_Object" id="IDL:GEOM/GEOM_Object:1.0">
               </inParameter>
               <inParameter>
                 <inParameter-name>theObject</inParameter-name>
-                <inParameter-type>Object</inParameter-type>
+                <inParameter-type>CORBA/Object</inParameter-type>
                 <inParameter-comment>unknown</inParameter-comment>
               </inParameter>
             </inParameter-list>
index 234407a9e1e827e084426e0e59688f68941802a4..430c8a33cbe6933f5d94d6ef07aef52b58ce4c1d 100644 (file)
 
 #define FIND_GROUPS_BY_POINTS 1
 
+// Undefine below macro to enable workaround about fillet problem in MakePipeTShapeFillet
+// VSR 30/12/2014: macro enabled
+#define FILLET_FIX_TOLERANCE
+
 //=============================================================================
 /*!
  *  Constructor
@@ -1579,7 +1583,7 @@ bool AdvancedEngine_IOperations::MakePipeTShapePartition(Handle(GEOM_Object) the
 
     // Last verification: result should be a block
     std::list<GEOMImpl_IBlocksOperations::BCError> errList;
-    if (!myBlocksOperations->CheckCompoundOfBlocks(Te3,errList)) {
+    if (!myBlocksOperations->CheckCompoundOfBlocks(Te3, -1, errList)) {
       SetErrorCode("TShape is not a compound of block");
       return false;
     }
@@ -2843,6 +2847,17 @@ AdvancedEngine_IOperations::MakePipeTShapeFillet
   aFillet->GetLastFunction()->SetDescription("");
 
   TopoDS_Shape aFilletShape = aFillet->GetValue();
+
+#ifdef FILLET_FIX_TOLERANCE
+  // VSR: 30/12/2014: temporary workaround about Fillet problem
+  if (theHexMesh) {
+    GEOMUtils::FixShapeTolerance(aFilletShape, TopAbs_FACE);
+  }
+  else {
+    GEOMUtils::FixShapeCurves(aFilletShape);
+  }
+#endif
+
   aFunction->SetValue(aFilletShape);
   // END of fillet
 
@@ -3088,6 +3103,17 @@ AdvancedEngine_IOperations::MakePipeTShapeFilletWithPosition
   aFillet->GetLastFunction()->SetDescription("");
 
   TopoDS_Shape aFilletShape = aFillet->GetValue();
+
+#ifdef FILLET_FIX_TOLERANCE
+  // VSR: 30/12/2014: temporary workaround about Fillet problem
+  if (theHexMesh) {
+    GEOMUtils::FixShapeTolerance(aFilletShape, TopAbs_FACE);
+  }
+  else {
+    GEOMUtils::FixShapeCurves(aFilletShape);
+  }
+#endif
+
   aFunction->SetValue(aFilletShape);
   // END of fillet
 
index 7551b43f7f5f199be5edfcc1cc6b67756ddb61d9..25d0edadece5aa78db53fabb1affc7e49a97b9f2 100644 (file)
 
 #include <vector>
 
+// Undefine below macro to enable workaround about problem with wrong 
+// tolerances of intersection curves in MakePipeTShape and MakeQuarterPipeTShape
+// VSR 30/12/2014: macro enabled
+#define FIX_CURVES_TOLERANCES
+
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -299,7 +304,7 @@ void AdvancedEngine_PipeTShapeDriver::GetCommonShapesOnCylinders(const TopoDS_Sh
 //purpose  :
 //=======================================================================
 TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakePipeTShape (const double r1, const double w1, const double l1,
-                                                        const double r2, const double w2, const double l2) const
+                                                              const double r2, const double w2, const double l2) const
 {
   double r1Ext = r1 + w1;
   double r2Ext = r2 + w2;
@@ -341,7 +346,14 @@ TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakePipeTShape (const double r1, c
     StdFail_NotDone::Raise("Coudn't cut cylinders");
   }
 
-  return Te.Shape();
+  TopoDS_Shape aShape = Te.Shape();
+
+  // VSR: 30/12/2014: temporary workaround about intersection curves problem
+#ifdef FIX_CURVES_TOLERANCES
+  GEOMUtils::FixShapeCurves(aShape);
+#endif
+
+  return aShape;
 }
 
 //=======================================================================
@@ -349,7 +361,7 @@ TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakePipeTShape (const double r1, c
 //purpose  :
 //=======================================================================
 TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakeQuarterPipeTShape (const double r1, const double w1, const double l1,
-                                                               const double r2, const double w2, const double l2) const
+                                                                     const double r2, const double w2, const double l2) const
 {
   TopoDS_Shape Te = MakePipeTShape(r1, w1, l1, r2, w2, l2);
   if (Te.IsNull())
@@ -373,6 +385,13 @@ TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakeQuarterPipeTShape (const doubl
     StdFail_NotDone::Raise("Couldn't cut Pipe Tshape with box");
   }
 
+  TopoDS_Shape aShape = Te4.Shape();
+
+  // VSR: 30/12/2014: temporary workaround about intersection curves problem
+#ifdef FIX_CURVES_TOLERANCES
+  GEOMUtils::FixShapeCurves(aShape);
+#endif
+
   return Te4.Shape();
 }
 
index a5e5e0851b26f75d57c893747d836bcf172c326c..fb449602ef7be362a4cc47ccb6d9fb3dc3d42089 100644 (file)
@@ -21,7 +21,7 @@
     </message>
     <message>
       <source>GEOM_DIVIDEDDISK</source>
-      <translation>Divided_Disk</translation>
+      <translation>分割ディスク</translation>
     </message>
     <message>
       <source>GEOM_DIVIDEDDISK_TITLE</source>
@@ -29,7 +29,7 @@
     </message>
     <message>
       <source>GEOM_DIVIDEDCYLINDER</source>
-      <translation>Divided_Cylinder</translation>
+      <translation>分割シリンダー</translation>
     </message>
     <message>
       <source>GEOM_DIVIDEDCYLINDER_TITLE</source>
     </message>
     <message>
       <source>JUNCTION_FACE_1</source>
-      <translation>Junction 1</translation>
+      <translation>継手面1</translation>
     </message>
     <message>
       <source>JUNCTION_FACE_2</source>
-      <translation>Junction 2</translation>
+      <translation>継手面2</translation>
     </message>
     <message>
       <source>JUNCTION_FACE_3</source>
-      <translation>Junction 3</translation>
+      <translation>継手面3</translation>
     </message>
     <message>
       <source>INTERNAL_FACES</source>
     </message>
     <message>
       <source>GEOM_PIPE_TSHAPE</source>
-      <translation>PipeTShape</translation>
+      <translation>T型パイプ</translation>
     </message>
     <message>
       <source>GEOM_PIPE_TSHAPE_MPIPE</source>
     </message>
     <message>
       <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L1</source>
-      <translation>New L1</translation>
+      <translation>T型パイプの位置 L1</translation>
     </message>
     <message>
       <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L2</source>
-      <translation>New L2</translation>
+      <translation>T型パイプの位置 L2</translation>
     </message>
     <message>
       <source>GEOM_PIPE_TSHAPE_LEFT_TR</source>
     </message>
     <message>
       <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_L</source>
-      <translation type="unfinished">メインパイプの半径は、左側薄型化(rL)と等しくすることはできません!</translation>
+      <translation>メインパイプの半径は、左側薄型化(rL)と等しくすることはできません!</translation>
     </message>
     <message>
       <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_L</source>
-      <translation type="unfinished">メインパイプの外半径(半径+幅)は、左側薄型化外半径(rL+wL)と等しくすることはできません!</translation>
+      <translation>メインパイプの外半径(半径+幅)は、左側薄型化外半径(rL+wL)と等しくすることはできません!</translation>
     </message>
     <message>
       <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_R</source>
-      <translation type="unfinished">メインパイプの半径は、右側薄型化半径(rR)と同じにすることはできません!</translation>
+      <translation>メインパイプの半径は、右側薄型化半径(rR)と同じにすることはできません!</translation>
     </message>
     <message>
       <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_R</source>
-      <translation type="unfinished">メインパイプの外半径(半径+幅)は、右側薄型化外半径(rR+wR)と等しくすることはできません!</translation>
+      <translation>メインパイプの外半径(半径+幅)は、右側薄型化外半径(rR+wR)と等しくすることはできません!</translation>
     </message>
     <message>
       <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_I</source>
-      <translation type="unfinished">インシデントパイプの半径は、インシデントパイプ薄肉化半径(rl)と等しくすることはできません!</translation>
+      <translation>インシデントパイプの半径は、インシデントパイプ薄肉化半径(rl)と等しくすることはできません!</translation>
     </message>
     <message>
       <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_I</source>
-      <translation type="unfinished">インシデントパイプの外半径(半径+厚さ)は、インシデントパイプの薄肉化外半径(rI+wI)と等しくすることはできません!</translation>
+      <translation>インシデントパイプの外半径(半径+厚さ)は、インシデントパイプの薄肉化外半径(rI+wI)と等しくすることはできません!</translation>
     </message>
   </context>
   <context>
     </message>
     <message>
       <source>GEOM_SMOOTHINGSURFACE_ARG_NB_MAX</source>
-      <translation>ベジェパッチの最大数</translation>
+      <translation>ベジェパッチの最大数&lt;</translation>
     </message>
     <message>
       <source>GEOM_SMOOTHINGSURFACE_ARG_DEG_MAX</source>
index 4a23773a343889e68645b00a2ce627a04356a660..cca0947a331d4b523dfdfad97365e783398d7b29 100644 (file)
@@ -1,46 +1,46 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS version="2.0" language="ja" sourcelanguage="en">
-<context>
+  <context>
     <name>@default</name>
     <message>
-        <source>MEN_EXPORTBREP</source>
-        <translation type="unfinished">BREP</translation>
+      <source>MEN_EXPORTBREP</source>
+      <translation>BREPエキスポート</translation>
     </message>
     <message>
-        <source>TOP_EXPORTBREP</source>
-        <translation type="unfinished">Export BREP</translation>
+      <source>TOP_EXPORTBREP</source>
+      <translation>BREPエキスポート</translation>
     </message>
     <message>
-        <source>STB_EXPORTBREP</source>
-        <translation type="unfinished">Export BREP</translation>
+      <source>STB_EXPORTBREP</source>
+      <translation>BREPエキスポート</translation>
     </message>
     <message>
-        <source>MEN_IMPORTBREP</source>
-        <translation type="unfinished">BREP</translation>
+      <source>MEN_IMPORTBREP</source>
+      <translation>BREPインポート</translation>
     </message>
     <message>
-        <source>TOP_IMPORTBREP</source>
-        <translation type="unfinished">Import BREP</translation>
+      <source>TOP_IMPORTBREP</source>
+      <translation>BREPインポート</translation>
     </message>
     <message>
-        <source>STB_IMPORTBREP</source>
-        <translation type="unfinished">Import BREP</translation>
+      <source>STB_IMPORTBREP</source>
+      <translation>BREPインポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>BREPPlugin_GUI</name>
     <message>
-        <source>BREP_FILES</source>
-        <translation type="unfinished">BREP files( *.brep )</translation>
+      <source>BREP_FILES</source>
+      <translation>BREPファイル</translation>
     </message>
     <message>
-        <source>EXPORT_TITLE</source>
-        <translation type="unfinished">Export BREP</translation>
+      <source>EXPORT_TITLE</source>
+      <translation>BREPエキスポート</translation>
     </message>
     <message>
-        <source>IMPORT_TITLE</source>
-        <translation type="unfinished">Import BREP</translation>
+      <source>IMPORT_TITLE</source>
+      <translation>BREPインポート</translation>
     </message>
-</context>
+  </context>
 </TS>
index 54cbb52befa64d148272a3aa1b549956dd59d07e..96b6eeba2e1ba84c2a9697a5597b896165dbf8bd 100644 (file)
@@ -35,6 +35,7 @@
 #include <SUIT_Session.h>
 #include <SalomeApp_Application.h>
 #include <LightApp_SelectionMgr.h>
+#include "utilities.h"
 
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <TopoDS_Shape.hxx>
index 32c0714be12bc8ddfe723351794ca404b496ab0a..36e527550605b9afac35c33dc370a3fa6b2eef37 100644 (file)
 
 #include <BRep_Tool.hxx>
 
+#include <Geom_Curve.hxx>
+
+#include <gp_Pnt.hxx>
+#include <gp_Vec.hxx>
+
 #include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
 
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Solid.hxx>
 #include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
 
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
@@ -49,6 +56,7 @@
 BlockFix_CheckTool::BlockFix_CheckTool( )
 {
   myHasCheck = Standard_False;
+  myAngTolerance = -1.;
   myPossibleBlocks.Clear();
 }
 
@@ -63,6 +71,17 @@ void BlockFix_CheckTool::SetShape(const TopoDS_Shape& aShape)
   myPossibleBlocks.Clear();
 }
 
+//=======================================================================
+//function : SetAngTolerance
+//purpose  :
+//=======================================================================
+void BlockFix_CheckTool::SetAngTolerance(const Standard_Real theTolerance)
+{
+  myHasCheck     = Standard_False;
+  myAngTolerance = theTolerance;
+  myPossibleBlocks.Clear();
+}
+
 //=======================================================================
 //function : Perform
 //purpose  :
@@ -159,7 +178,6 @@ void BlockFix_CheckTool::Perform()
     if (nbe < 12)
       IsBlock = Standard_False;
     if (nbe > 12) {
-      IsBlock = Standard_False;
       // check edges unification
       // creating map of edge faces
       TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces;
@@ -194,9 +212,19 @@ void BlockFix_CheckTool::Perform()
         Standard_Integer i = 1;
         for (; i <= aMapFacesEdges.Extent(); i++) {
           const TopTools_ListOfShape& ListEdges = aMapFacesEdges.FindFromIndex(i);
-          if (ListEdges.Extent() > 1) break;
+          if (ListEdges.Extent() > 1) {
+            if (myAngTolerance < 0.) {
+              break;
+            }
+
+            // Check if edges have C1 continuity.
+            if (!isC1(ListEdges)) {
+              break;
+            }
+          }
         }
         if (i <= aMapFacesEdges.Extent()) {
+          IsBlock = Standard_False;
           MayBeUE = Standard_True;
           break;
         }
@@ -265,3 +293,84 @@ void BlockFix_CheckTool::DumpCheckResult(Standard_OStream& S) const
     S<<"             number of impossible blocks = "<<nbtmp<<endl;
   }
 }
+
+//=======================================================================
+//function : isC1
+//purpose  :
+//=======================================================================
+Standard_Boolean BlockFix_CheckTool::isC1
+          (const TopTools_ListOfShape &theEdges) const
+{
+  // Fill the map vertex - list of ancestor edges
+  TopTools_IndexedDataMapOfShapeListOfShape aMapVE;
+  TopTools_ListIteratorOfListOfShape        anIter(theEdges);
+  TopTools_MapOfShape                       aMapFence;
+  Standard_Integer                          i;
+  Standard_Integer                          aNbVtx;
+
+  for (; anIter.More(); anIter.Next()) {
+    TopTools_IndexedMapOfShape  aMapVtx;
+    const TopoDS_Shape         &anEdge = anIter.Value();
+
+    if (aMapFence.Add(anEdge)) {
+      TopExp::MapShapes(anEdge, TopAbs_VERTEX, aMapVtx);
+      aNbVtx = aMapVtx.Extent();
+
+      for (i = 1; i <= aNbVtx; ++i) {
+        const TopoDS_Shape &aVtx = aMapVtx.FindKey(i);
+
+        if (!aMapVE.Contains(aVtx)) {
+          aMapVE.Add(aVtx, TopTools_ListOfShape());
+        }
+
+        aMapVE.ChangeFromKey(aVtx).Append(anEdge);
+      }
+    }
+  }
+
+  // Check C1 continuity.
+  Standard_Integer aNbEnds = 0;
+
+  for (i = 1, aNbVtx = aMapVE.Extent(); i <= aNbVtx; ++i) {
+    const TopTools_ListOfShape &anEdges  = aMapVE.FindFromIndex(i);
+    Standard_Integer            aNbEdges = anEdges.Extent();
+
+    if (aNbEdges == 1) {
+      ++aNbEnds;
+    } else if (aNbEdges == 2) {
+      TopoDS_Vertex      aCommonVtx = TopoDS::Vertex(aMapVE.FindKey(i));
+      TopoDS_Edge        anEdge1    = TopoDS::Edge(anEdges.First());
+      TopoDS_Edge        anEdge2    = TopoDS::Edge(anEdges.Last());
+      Standard_Real      aParam1    = BRep_Tool::Parameter(aCommonVtx, anEdge1);
+      Standard_Real      aParam2    = BRep_Tool::Parameter(aCommonVtx, anEdge2);
+      Standard_Real      aPar[2];
+      Handle(Geom_Curve) aCurve1    =
+        BRep_Tool::Curve(anEdge1, aPar[0], aPar[1]);
+      Handle(Geom_Curve) aCurve2    =
+        BRep_Tool::Curve(anEdge2, aPar[0], aPar[1]);
+      gp_Pnt             aPnt;
+      gp_Vec             aVec1;
+      gp_Vec             aVec2;
+
+      aCurve1->D1(aParam1, aPnt, aVec1);
+      aCurve2->D1(aParam2, aPnt, aVec2);
+
+      if (anEdge1.Orientation() != anEdge2.Orientation()) {
+        // Orientations are different. One vector should be reversed.
+        aVec1.Reverse();
+      }
+
+      const Standard_Real anAngle = aVec1.Angle(aVec2);
+
+      if (anAngle > myAngTolerance) {
+        // There is no C1 continuity.
+        break;
+      }
+    } else {
+      // Non-manifold case.
+      break;
+    }
+  }
+
+  return (i > aNbVtx && aNbEnds == 2);
+}
index 83bd5b3c158942595f2a0b051b29506ee126ca1b..66711433c9b2d94c7cf422121265f1ca292ddd6b 100644 (file)
@@ -30,6 +30,7 @@
 #include <Standard_OStream.hxx>
 
 class TopoDS_Shape;
+class TopTools_ListOfShape;
 
 #include <Standard.hxx>
 #include <Standard_Macro.hxx>
@@ -38,14 +39,20 @@ class BlockFix_CheckTool {
 
 public:
   Standard_EXPORT BlockFix_CheckTool();
-  Standard_EXPORT void SetShape(const TopoDS_Shape& aShape) ;
+  Standard_EXPORT void SetShape(const TopoDS_Shape& aShape);
+  Standard_EXPORT void SetAngTolerance(const Standard_Real theTolerance);
   Standard_EXPORT void Perform() ;
   Standard_EXPORT Standard_Integer NbPossibleBlocks() const;
   Standard_EXPORT TopoDS_Shape PossibleBlock(const Standard_Integer num) const;
   Standard_EXPORT void DumpCheckResult(Standard_OStream& S) const;
 
 private:
-  TopoDS_Shape myShape;
+
+  Standard_Boolean isC1(const TopTools_ListOfShape &theEdges) const;
+
+private:
+  TopoDS_Shape     myShape;
+  Standard_Real    myAngTolerance;
   Standard_Boolean myHasCheck;
   Standard_Integer myNbSolids;
   Standard_Integer myNbBlocks;
index ffeb404bc57e121e1ce2d5369d0f0fce89d24869..33c54ff5aeb24ea7b1436a2fc6d114a486d9685e 100644 (file)
@@ -2,43 +2,45 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="fr_FR">
 <context>
-  <name>DependencyTree_View</name>
+    <name>DependencyTree_View</name>
     <message>
-      <source>DEPENDENCY_TREE</source>
-      <translation type="unfinished">Dependency Tree</translation>
+        <source>DEPENDENCY_TREE</source>
+        <translation>Arbre des dépendances</translation>
     </message>
     <message>
-      <source>MOVE_NODES</source>
-      <translation type="unfinished">Move nodes</translation>
+        <source>MOVE_NODES</source>
+        <translation>Déplacer les noeuds</translation>
     </message>
     <message>
-      <source>HIERARCHY_DEPTH</source>
-      <translation type="unfinished">Hierarchy depth  </translation>
+        <source>HIERARCHY_DEPTH</source>
+        <translation>Niveau hiérarchique</translation>
     </message>
     <message>
-      <source>DISPLAY_ASCENDANTS</source>
-      <translation type="unfinished">Display ascendants</translation>
+        <source>DISPLAY_ASCENDANTS</source>
+        <translation>Montrer les liens ascendants</translation>
     </message>
     <message>
-      <source>DISPLAY_DESCENDANTS</source>
-      <translation type="unfinished">Display descendants</translation>
+        <source>DISPLAY_DESCENDANTS</source>
+        <translation>Montrer les liens descendants</translation>
     </message>
     <message>
-      <source>SHOW_ALL</source>
-      <translation type="unfinished">Show all</translation>
+        <source>SHOW_ALL</source>
+        <translation>Montrer tout</translation>
     </message>
     <message>
-      <source>UPDATE</source>
-      <translation type="unfinished">Update</translation>
+        <source>UPDATE</source>
+        <translation>Mise à jour</translation>
     </message>
-  <name>DependencyTree_ViewModel</name>
+</context>
+<context>
+    <name>DependencyTree_ViewModel</name>
     <message>
-      <source>MEN_REBUILD_THE_TREE</source>
-      <translation type="unfinished">Rebuild the tree</translation>
+        <source>MEN_REBUILD_THE_TREE</source>
+        <translation type="unfinished">Rebuild the tree</translation>
     </message>
     <message>
-      <source>MEN_REDUCE_STUDY</source>
-      <translation type="unfinished">Reduce study</translation>
+        <source>MEN_REDUCE_STUDY</source>
+        <translation type="unfinished">Reduce study</translation>
     </message>
 </context>
 </TS>
index 642f04c6a7f36116eae786442980c670ab75e4c7..a463109e8565e80acd734a6f8898810a3789c96e 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS>
-<context>
-  <name>DependencyTree_View</name>
+<TS version="2.0" language="ja" sourcelanguage="en">
+  <context>
+    <name>DependencyTree_View</name>
     <message>
       <source>DEPENDENCY_TREE</source>
       <translation type="unfinished">Dependency Tree</translation>
@@ -31,7 +31,7 @@
       <source>UPDATE</source>
       <translation type="unfinished">Update</translation>
     </message>
-  <name>DependencyTree_ViewModel</name>
+    <name>DependencyTree_ViewModel</name>
     <message>
       <source>MEN_REBUILD_THE_TREE</source>
       <translation type="unfinished">Rebuild the tree</translation>
@@ -40,5 +40,5 @@
       <source>MEN_REDUCE_STUDY</source>
       <translation type="unfinished">Reduce study</translation>
     </message>
-</context>
-</TS>
\ No newline at end of file
+  </context>
+</TS>
index 55d92893026e5cdc5bb0dd81741e2639f9eab2b4..398ebfc45c592bed90ed26e44017445902dc1f87 100644 (file)
@@ -42,6 +42,7 @@
 #include <SUIT_ViewWindow.h>
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
+#include "utilities.h"
 
 #include <TopoDS_Shape.hxx>
 #include <TopoDS.hxx>
index 5a7fe60ae39196ee0b8575b3f8aafe738b7133e9..2d6d80193091a0f40386be4c426b816719212159 100644 (file)
@@ -34,6 +34,7 @@
 #include <SUIT_Session.h>
 #include <SalomeApp_Application.h>
 #include <LightApp_SelectionMgr.h>
+#include "utilities.h"
 
 #include <TopoDS_Shape.hxx>
 #include <TopoDS.hxx>
index 50c12462aadc4ca76951653c1ae0c791e2bbd1f7..351bfc614837dd508277e4e9886f175d84ab14bf 100644 (file)
@@ -28,6 +28,8 @@
 #include <GeometryGUI.h>
 #include <GEOMBase.h>
 
+#include "utilities.h"
+
 #include <OCCViewer_ViewManager.h>
 #include <LightApp_SelectionMgr.h>
 #include <SalomeApp_Application.h>
index fde880b435ff86b93d04d8b036b20a894c0f582e..5da33a8d5134820f1c46b54fcb6055818f5562e7 100644 (file)
@@ -64,6 +64,7 @@
 
 #include <SalomeApp_Study.h>
 #include <SalomeApp_Tools.h>
+#include "utilities.h"
 
 #include <gp_Pln.hxx>
 
@@ -2258,7 +2259,7 @@ QString EntityGUI_SketcherDlg::GetNewCommand( QString& theParameters )
                                   + ":TT " + QString::number( myX2, Format, DigNum) + " " + QString::number( myY1, Format, DigNum)
                                   + ":WW";
                           
-      theParameters = myX1Str + ":" + myY1Str + ":" + myX2Str + ":" + myY2Str ;
+      theParameters = myX1Str + ":" + myY1Str + ":" + myX1Str + ":" + myY2Str + ":" + myX2Str + ":" + myY2Str + ":" + myX2Str + ":" + myY1Str;
     }
   return myNewCommand;
 }
index 439bfe7ee600945b137f04eb86f00b68b9128146..326b9fb28be2e91a17df61b8786e072154b08138 100755 (executable)
@@ -48,6 +48,7 @@
 #include <SALOME_ListIO.hxx>
 
 #include <SALOME_Prs.h>
+#include "utilities.h"
 
 #include <OCCViewer_ViewModel.h>
 #include <SVTK_ViewModel.h>
index 1e4f76a6b222442842e27bfe628541bb6615af45..91e935cef02e88a5c16909dc50d9b11b07a68348 100644 (file)
@@ -67,6 +67,7 @@
 
 #include <SALOME_ListIO.hxx>
 #include <SALOME_Prs.h>
+#include "utilities.h"
 
 #include <SOCC_Prs.h>
 #include <SOCC_ViewModel.h>
 
 // Hard-coded value of shape deflection coefficient for VTK viewer
 const double VTK_MIN_DEFLECTION = 0.001;
+// If the next macro is defined, the deflection coefficient for VTK presentation
+// is limited by VTK_MIN_DEFLECTION
+//#define LIMIT_DEFLECTION_FOR_VTK
 
 // Pixmap caching support
 namespace
@@ -473,25 +477,24 @@ GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* st )
   myHasDisplayMode = false;
 
   int aType = resMgr->integerValue("Geometry", "type_of_marker", (int)Aspect_TOM_PLUS);
-  myWidth = resMgr->integerValue("Geometry", "edge_width", -1);
-  myIsosWidth = resMgr->integerValue("Geometry", "isolines_width", -1);
   
-  myTransparency = resMgr->integerValue("Geometry", "transparency", 0) / 100.;
-  myHasTransparency = false;
-
   myTypeOfMarker = (Aspect_TypeOfMarker)(std::min((int)Aspect_TOM_RING3, std::max((int)Aspect_TOM_POINT, aType)));
   myScaleOfMarker = (resMgr->integerValue("Geometry", "marker_scale", 1)-(int)GEOM::MS_10)*0.5 + 1.0;
   myScaleOfMarker = std::min(7.0, std::max(1., myScaleOfMarker));
 
+  // Next properties provide a way to customize displaying of presentations;
+  // for instance, this is useful for preview
   myColor = -1;
-  // This color is used for shape displaying. If it is equal -1 then
-  // default color is used.
   myTexture = "";
-
+  myNbIsos = -1;
   myWidth = -1;
+  myTransparency = -1;
   myType = -1;
+  myIsosColor = -1;
+  myIsosWidth = -1;
+
+  // This parameter is used for activisation/deactivisation (selection) of objects to be displayed
   myToActivate = true;
-  // This parameter is used for activisation/deactivisation of objects to be displayed
 
   // Activate parallel vizualisation only for testing purpose
   // and if the corresponding env variable is set to 1
@@ -864,12 +867,34 @@ void GEOM_Displayer::updateShapeProperties( const Handle(GEOM_AISShape)& AISShap
   int isosWidth = propMap.value( GEOM::propertyName( GEOM::IsosWidth ) ).toInt();
   Handle(Prs3d_IsoAspect) uIsoAspect = AISShape->Attributes()->UIsoAspect();
   Handle(Prs3d_IsoAspect) vIsoAspect = AISShape->Attributes()->VIsoAspect();
-  uIsoAspect->SetColor( isosColor );
-  uIsoAspect->SetWidth( isosWidth );
-  uIsoAspect->SetNumber( uIsos );
-  vIsoAspect->SetColor( isosColor );
-  vIsoAspect->SetWidth( isosWidth );
-  vIsoAspect->SetNumber( vIsos );
+
+  if ( HasIsosColor() ) {
+    uIsoAspect->SetColor( (Quantity_NameOfColor)GetIsosColor() );
+    vIsoAspect->SetColor( (Quantity_NameOfColor)GetIsosColor() );
+  }
+  else {
+    uIsoAspect->SetColor( isosColor );
+    vIsoAspect->SetColor( isosColor );
+  }
+
+  if ( HasIsosWidth() ) {
+    uIsoAspect->SetWidth( GetIsosWidth() );
+    vIsoAspect->SetWidth( GetIsosWidth() );
+  }
+  else {
+    uIsoAspect->SetWidth( isosWidth );
+    vIsoAspect->SetWidth( isosWidth );
+  }
+  
+  if ( HasNbIsos() ) {
+    uIsoAspect->SetNumber( GetNbIsos() );
+    vIsoAspect->SetNumber( GetNbIsos() );
+  }
+  else {
+    uIsoAspect->SetNumber( uIsos );
+    vIsoAspect->SetNumber( vIsos );
+  }
+
   AISShape->Attributes()->SetUIsoAspect( uIsoAspect );
   AISShape->Attributes()->SetVIsoAspect( vIsoAspect );
 
@@ -1021,7 +1046,11 @@ void GEOM_Displayer::updateActorProperties( GEOM_Actor* actor, bool create )
   // actor->SetShape(myShape,aDefPropMap.value(GEOM::propertyName( GEOM::Deflection )).toDouble(),myType == GEOM_VECTOR);
   /////////////////////////////////////////////////////////////////////////
   if ( !actor->getTopo().IsSame( myShape ) )
+#ifdef LIMIT_DEFLECTION_FOR_VTK
     actor->SetShape( myShape, VTK_MIN_DEFLECTION, myType == GEOM_VECTOR );
+#else
+    actor->SetShape( myShape, qMax( propMap.value( GEOM::propertyName( GEOM::Deflection ) ).toDouble(), GEOM::minDeflection() ), myType == GEOM_VECTOR );
+#endif
 
   // set material
   Material_Model material;
@@ -1035,16 +1064,25 @@ void GEOM_Displayer::updateActorProperties( GEOM_Actor* actor, bool create )
 
   // - set number of iso-lines
   int nbIsos[2]= { 1, 1 };
-  QStringList isos = propMap.value( GEOM::propertyName( GEOM::NbIsos ) ).toString().split( GEOM::subSectionSeparator() );
-  nbIsos[0] = isos[0].toInt();
-  nbIsos[1] = isos[1].toInt();
+  if ( HasNbIsos() ) {
+    nbIsos[0] = GetNbIsos();
+    nbIsos[1] = GetNbIsos();
+  }
+  else {
+    QStringList isos = propMap.value( GEOM::propertyName( GEOM::NbIsos ) ).toString().split( GEOM::subSectionSeparator() );
+    nbIsos[0] = isos[0].toInt();
+    nbIsos[1] = isos[1].toInt();
+  }
   actor->SetNbIsos( nbIsos );
 
   // - set iso-lines width
-  actor->SetIsosWidth( propMap.value( GEOM::propertyName( GEOM::IsosWidth ) ).toInt() );
+  actor->SetIsosWidth( HasIsosWidth() ? GetIsosWidth() : propMap.value( GEOM::propertyName( GEOM::IsosWidth ) ).toInt() );
 
   // - set iso-lines color
-  c = propMap.value( GEOM::propertyName( GEOM::IsosColor ) ).value<QColor>();
+  if ( HasIsosColor() )
+    c = SalomeApp_Tools::color( Quantity_Color((Quantity_NameOfColor)GetIsosColor()) );
+  else
+    c = propMap.value( GEOM::propertyName( GEOM::IsosColor ) ).value<QColor>();
   actor->SetIsosColor( c.redF(), c.greenF(), c.blueF() );
 
   // set colors
@@ -2050,15 +2088,9 @@ void GEOM_Displayer::UnsetColor()
 //=================================================================
 double GEOM_Displayer::SetTransparency( const double transparency )
 {
-  double aPrevTransparency = myTransparency;
-  if ( transparency < 0 ) {
-    UnsetTransparency();
-  }
-  else {
-    myTransparency = transparency;
-    myHasTransparency = true;
-  }
-  return aPrevTransparency;
+  double prevTransparency = myTransparency;
+  myTransparency = transparency;
+  return prevTransparency;
 }
 
 //=================================================================
@@ -2080,7 +2112,7 @@ double GEOM_Displayer::GetTransparency() const
 //=================================================================
 bool GEOM_Displayer::HasTransparency() const
 {
-  return myHasTransparency;
+  return myTransparency >= 0;
 }
 
 //=================================================================
@@ -2091,27 +2123,17 @@ bool GEOM_Displayer::HasTransparency() const
 //=================================================================
 double GEOM_Displayer::UnsetTransparency()
 {
-  double aPrevTransparency = myTransparency;
-  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-  myTransparency = resMgr->integerValue("Geometry", "transparency", 0) / 100.;
-  myHasTransparency = false;
-  return aPrevTransparency;
+  return SetTransparency( -1 );
 }
 
-
 //=================================================================
 /*!
  *  GEOM_Displayer::SetTexture
- *  Set color for shape displaying. If it is equal -1 then default color is used.
- *  Available values are from Quantity_NameOfColor enumeration
  */
 //=================================================================
 void GEOM_Displayer::SetTexture( const std::string& texureFileName )
 {
-  if(texureFileName!="")
-  {
-    myTexture = texureFileName;
-  }
+  myTexture = texureFileName;
 }
 
 bool GEOM_Displayer::HasTexture() const
@@ -2150,7 +2172,6 @@ void GEOM_Displayer::UnsetWidth()
   myWidth = -1;
 }
 
-
 int GEOM_Displayer::GetIsosWidth() const
 {
   return myIsosWidth;
@@ -2166,6 +2187,49 @@ bool GEOM_Displayer::HasIsosWidth() const
   return myIsosWidth != -1;
 }
 
+int GEOM_Displayer::SetNbIsos( const int nbIsos )
+{
+  int prevNbIsos = myNbIsos;
+  myNbIsos = nbIsos;
+  return prevNbIsos;
+}
+
+int GEOM_Displayer::UnsetNbIsos()
+{
+  return SetNbIsos( -1 );
+}
+
+int GEOM_Displayer::GetNbIsos() const
+{
+  return myNbIsos;
+}
+
+bool GEOM_Displayer::HasNbIsos() const
+{
+  return myNbIsos >= 0;
+}
+
+int GEOM_Displayer::SetIsosColor( const int color )
+{
+  int prevColor = myIsosColor;
+  myIsosColor = color;
+  return prevColor;
+}
+
+int GEOM_Displayer::GetIsosColor() const
+{
+  return myIsosColor;
+}
+
+bool GEOM_Displayer::HasIsosColor() const
+{
+  return myIsosColor != -1;
+}
+
+int GEOM_Displayer::UnsetIsosColor()
+{
+  return SetIsosColor( -1 );
+}
 
 //=================================================================
 /*!
index 03b00c0c6d0de66b31e893416583a65a8106e9de..110785ee26a0b3d8fae40898204566b707b92814 100644 (file)
@@ -162,7 +162,20 @@ public:
   void          SetIsosWidth  ( const int );
   int           GetIsosWidth  () const;
   bool          HasIsosWidth  () const;
+  /* Set nb iso-libes for displaying. Use -1 to set default values. */
+  int           SetNbIsos( const int );
+  int           UnsetNbIsos();
+  int           GetNbIsos() const;
+  bool          HasNbIsos() const;
   
+  /* Set color for iso-lines displaying. If it is equal -1 then default color is used.
+     Available values are from Quantity_NameOfColor enumeration */
+  int           SetIsosColor  ( const int );
+  int           UnsetIsosColor();
+  int           GetIsosColor  () const;
+  bool          HasIsosColor  () const;
   /* Set display mode shape displaying. If it is equal -1 then display mode is used. */
   int           SetDisplayMode( const int );
   int           GetDisplayMode() const;
@@ -291,13 +304,14 @@ protected:
   int                              myColor;
   double                           myWidth;
   int                              myIsosWidth;
+  int                              myNbIsos;
+  int                              myIsosColor;
   bool                             myToActivate;
   int                              myDisplayMode;
   bool                             myHasDisplayMode;
   Aspect_TypeOfMarker              myTypeOfMarker;
   double                           myScaleOfMarker;
   double                           myTransparency;
-  bool                             myHasTransparency;
 
 private:
   SalomeApp_Application* myApp;
index 94cdfeff432f063e1c4913a38a3bf92353daf979..c44395e9bfce664855385ce5400104f0089e2a80 100644 (file)
@@ -415,6 +415,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_NONBLOCKS</source>
         <translation>NonBlocksGroup</translation>
     </message>
+    <message>
+        <source>GEOM_USE_C1_CRITERION</source>
+        <translation>Use C1 criterion</translation>
+    </message>
     <message>
         <source>GEOM_CHECK_INFOS</source>
         <translation>Object And Its Topological Information</translation>
@@ -2122,7 +2126,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>GEOM_SUPRESSFACE</source>
-        <translation>Supress Face</translation>
+        <translation>Suppress Face</translation>
     </message>
     <message>
         <source>GEOM_SUPRESSFACE_SELECT</source>
@@ -3446,7 +3450,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>REMOVE_HOLES_NEW_OBJ_NAME</source>
-        <translation>SupressHoles</translation>
+        <translation>SuppressHoles</translation>
     </message>
     <message>
         <source>REMOVE_INT_WIRES_NEW_OBJ_NAME</source>
@@ -4030,7 +4034,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>SUPRESS_FACE_NEW_OBJ_NAME</source>
-        <translation>SupressFaces</translation>
+        <translation>SuppressFaces</translation>
     </message>
     <message>
         <source>ShHealOper_ErrorExecution_msg</source>
index c2bb2c69048fcda74ceb6ff90adda1a14d2cd19a..e3e610c0b8db2b0c86383e160b7f648c59c09111 100644 (file)
@@ -38,7 +38,7 @@
     <message>
         <source>DEP_OBJECT</source>
         <translation>L&apos;objet choisi a été utilisé pour créer un autre objet ou est référencé par un autre module.
-La suppression de cet objet peut entrainer un export python invalide. 
+La suppression de cet objet peut entrainer un export python invalide.
 
 Voulez-vous tout de même supprimer ces objets ?</translation>
     </message>
@@ -185,7 +185,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_BEZIER</source>
-        <translation>Bezier</translation>
+        <translation>Bézier</translation>
     </message>
     <message>
         <source>GEOM_BINORMAL</source>
@@ -237,11 +237,11 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_BNDBOX_TITLE</source>
-        <translation>Boîte englobante</translation>
+        <translation>Informations sur la Boîte englobante</translation>
     </message>
     <message>
         <source>GEOM_BOX</source>
-        <translation>Boite</translation>
+        <translation>Boîte</translation>
     </message>
     <message>
         <source>GEOM_BOX_OBJ</source>
@@ -253,7 +253,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_BSplineRestriction</source>
-        <translation>Limitation BSpline</translation>
+        <translation>LimitationB-Spline</translation>
     </message>
     <message>
         <source>GEOM_BUT_APPLY</source>
@@ -341,7 +341,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_CHAMFER_FACES</source>
-        <translation>Chanfrein sur des faces</translation>
+        <translation>Chanfrein sur les faces sélectionnées</translation>
     </message>
     <message>
         <source>GEOM_CHAMFER_TITLE</source>
@@ -405,11 +405,11 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_GETNONBLOCKS_TITLE</source>
-        <translation>Récupérer les solides non-hexahédres et les faces non-quadrangles</translation>
+        <translation>Récupérer les solides qui ne sontpas des hexahédres et les faces qui ne sont pas des quadrangles</translation>
     </message>
     <message>
         <source>GEOM_GETNONBLOCKS</source>
-        <translation>Récupérer les solides non blocs</translation>
+        <translation>Récupérer les solides qui ne sont pas des blocs</translation>
     </message>
     <message>
         <source>GEOM_NONBLOCKS</source>
@@ -417,7 +417,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_CHECK_INFOS</source>
-        <translation>Objet et son information topologique</translation>
+        <translation>Objet et ses informations topologiques</translation>
     </message>
     <message>
         <source>GEOM_CHECK_SHAPE</source>
@@ -553,7 +553,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_CYLINDER_ANGLE_ERR</source>
-        <translation>Les valeurs de l'angle 0 et 360 sont à éviter pour construire des volumes sains. Veuillez décocher la case "Angle" pour utiliser le constructeur de cylindre complet.</translation>
+        <translation>Les valeurs de l&apos;angle 0 et 360 sont à éviter pour construire des volumes sains. Veuillez décocher la case &quot;Angle&quot; pour utiliser le constructeur de cylindre complet.</translation>
     </message>
     <message>
         <source>GEOM_D1</source>
@@ -2926,7 +2926,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>MEN_POP_VERTICES</source>
-        <translation type="unfinished">Show Vertices</translation>
+        <translation>Montrer les sommets</translation>
     </message>
     <message>
         <source>MEN_PREFERENCES</source>
@@ -3102,11 +3102,11 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>MEN_VERTICES_MODE_ON</source>
-        <translation type="unfinished">Show Vertices</translation>
+        <translation>Montrer les sommets</translation>
     </message>
     <message>
         <source>MEN_VERTICES_MODE_OFF</source>
-        <translation type="unfinished">Hide Vertices</translation>
+        <translation>Cacher les sommets</translation>
     </message>
     <message>
         <source>MEN_WIREFRAME</source>
@@ -3802,7 +3802,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>STB_POP_VERTICES</source>
-        <translation type="unfinished">Show Vertices</translation>
+        <translation>Montrer les sommets</translation>
     </message>
     <message>
         <source>STB_POP_SETTEXTURE</source>
@@ -4762,11 +4762,11 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
-        <translation type="unfinished">Show dependency tree</translation>
+        <translation>Montrer l&apos;arbre des dépendances</translation>
     </message>
     <message>
         <source>MEN_POP_SHOW_REDUCE_STUDY</source>
-        <translation type="unfinished">Reduce study</translation>
+        <translation>Etude réduite</translation>
     </message>
     <message>
         <source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
@@ -5034,63 +5034,63 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>PREF_TAB_DEPENDENCY_VIEW</source>
-        <translation type="unfinished">Dependency Tree</translation>
+        <translation>Arbre des dépendances</translation>
     </message>
     <message>
         <source>PREF_HIERARCHY_TYPE</source>
-        <translation type="unfinished">Hierarchy type</translation>
+        <translation>Type de hiérarchie</translation>
     </message>
     <message>
         <source>MEN_ONLY_ASCENDANTS</source>
-        <translation type="unfinished">Display only ascendants tree</translation>
+        <translation>Montrer seulement les liens ascendants</translation>
     </message>
     <message>
         <source>MEN_ONLY_DESCENDANTS</source>
-        <translation type="unfinished">Display only descendants tree</translation>
+        <translation>Montrer seulement les liens descendants</translation>
     </message>
     <message>
         <source>MEN_BOTH_ASCENDANTS_DESCENDANTS</source>
-        <translation type="unfinished">Display both ascendants and descendants trees</translation>
+        <translation>Montrer les liens ascendants et descendants</translation>
     </message>
     <message>
         <source>GEOM_MOVE_POSSIBILITY</source>
-        <translation type="unfinished">Possibility to move nodes</translation>
+        <translation>Possibilité de déplacer des noeuds</translation>
     </message>
     <message>
         <source>PREF_GROUP_DEPENDENCY_VIEW_COLOR</source>
-        <translation type="unfinished">Color</translation>
+        <translation>Couleur</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_BACKGROUND_COLOR</source>
-        <translation type="unfinished">Background color</translation>
+        <translation>Couleur du fond</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_NODE_COLOR</source>
-        <translation type="unfinished">Default node color</translation>
+        <translation>Couleur des noeuds par défaut</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR</source>
-        <translation type="unfinished">Main node color</translation>
+        <translation>Couleur des noeuds principaux</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR</source>
-        <translation type="unfinished">Unpublished node color</translation>
+        <translation>Couleur des noeuds non publiés</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR</source>
-        <translation type="unfinished">Selected node color</translation>
+        <translation>Couleurs des noeuds sélectionnés</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_ARROW_COLOR</source>
-        <translation type="unfinished">Arrow color</translation>
+        <translation>Couleur des flèches par défaut</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_HIGHLIGHT_ARROW_COLOR</source>
-        <translation type="unfinished">Highlighted arrow color</translation>
+        <translation>Couleur des flèches en surbrillance</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_SELECT_ARROW_COLOR</source>
-        <translation type="unfinished">Selected arrow color</translation>
+        <translation>Couleur des flèches sélectionnées</translation>
     </message>
     <message>
         <source>GEOM_ALL_IMPORT_FILES</source>
@@ -6939,55 +6939,55 @@ Voulez-vous en créer un nouveau ?</translation>
     <name>GEOMToolsGUI_ReduceStudyDlg</name>
     <message>
         <source>GEOM_REDUCE_STUDY_TITLE</source>
-        <translation type="unfinished">Reduce study</translation>
+        <translation>Etude réduite</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_KEPT_OBJECTS</source>
-        <translation type="unfinished">Objects to be kept</translation>
+        <translation>Objets à conserver</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_REMOVE_OBJECTS</source>
-        <translation type="unfinished">Objects to be removed</translation>
+        <translation>Objets à enlever</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_NAME</source>
-        <translation type="unfinished">Name</translation>
+        <translation>Nom</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_OPTIONS</source>
-        <translation type="unfinished">Options</translation>
+        <translation>Options</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_INTERMEDIATES</source>
-        <translation type="unfinished">Intermediate objects</translation>
+        <translation>Objets intermédiaires</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_SUB_OBJECTS</source>
-        <translation type="unfinished">Sub-objects</translation>
+        <translation>Sous-objets</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_KEEP</source>
-        <translation type="unfinished">Keep</translation>
+        <translation>Conserver</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_UNPUBLISH</source>
-        <translation type="unfinished">Unpublish</translation>
+        <translation>Dépublier</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_REMOVE</source>
-        <translation type="unfinished">Remove</translation>
+        <translation>Enlever</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_REMOVE_EMPTY_FOLDER</source>
-        <translation type="unfinished">Remove empty folders</translation>
+        <translation>Enlever les dossiers vide</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_SOFT_REMOVAL</source>
-        <translation type="unfinished">Soft removal</translation>
+        <translation>Dépublication seulement</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_WARNING_DELETE</source>
-        <translation type="unfinished">Do you really want to delete intermediate objects? After applying this operation study will be broken.</translation>
+        <translation>Voulez-vous vraiment supprimer les objets intermédiaires ? Après la confirmation de cette opération, l&apos;étude sera cassée.</translation>
     </message>
 </context>
 <context>
index ae9d818df91d34e1476120f1b65df9fdd2dac10b..a8e0ee46ac87cf0deecfe7085fae41643cc8d2b9 100644 (file)
       <source>GEOM_CYLINDER_TITLE</source>
       <translation>円柱の作成</translation>
     </message>
+    <message>
+      <source>GEOM_CYLINDER_ANGLE_ERR</source>
+      <translation type="unfinished">Angle values 0 and 360 are unsafe to build proper volumes. Please uncheck the "Angle" box to use the regular cylinder constructor.</translation>
+    </message>
     <message>
       <source>GEOM_D1</source>
       <translation>D1 を:</translation>
     </message>
     <message>
       <source>GEOM_PRP_EXPORT</source>
-      <translation>ジオメトリを %1 にエクスポート</translation>
+      <translation>ジオメトリを %1 にエクスポート...</translation>
     </message>
     <message>
       <source>GEOM_PRP_LOADING</source>
       <source>MEN_CURVE_CREATOR</source>
       <translation>カーブの作成</translation>
     </message>
+    <message>
+      <source>TOP_CURVE_CREATOR</source>
+      <translation type="unfinished">Create 2D polyline</translation>
+    </message>
+    <message>
+      <source>STB_CURVE_CREATOR</source>
+      <translation type="unfinished">Create 2D polyline</translation>
+    </message>
     <message>
       <source>MEN_ALL_SEL_ONLY</source>
       <translation>全選択</translation>
     </message>
     <message>
       <source>MEN_IMPORT</source>
-      <translation>インポート</translation>
+      <translation>インポート...</translation>
     </message>
     <message>
       <source>MEN_INERTIA</source>
       <translation>表示モード</translation>
     </message>
     <message>
-        <source>PREF_TRANSPARENCY</source>
-        <translation>透明度</translation>
+      <source>PREF_TRANSPARENCY</source>
+      <translation>透明度</translation>
     </message>
     <message>
       <source>PREF_FREE_BOUND_COLOR</source>
     </message>
     <message>
       <source>REMOVE_HOLES_NEW_OBJ_NAME</source>
-      <translation>SupressHoles</translation>
+      <translation>SuppressHoles</translation>
     </message>
     <message>
       <source>REMOVE_INT_WIRES_NEW_OBJ_NAME</source>
     </message>
     <message>
       <source>SUPRESS_FACE_NEW_OBJ_NAME</source>
-      <translation>SupressFaces</translation>
+      <translation>SuppressFaces</translation>
     </message>
     <message>
       <source>ShHealOper_ErrorExecution_msg</source>
       <translation>オブジェクトの基準寸法を管理</translation>
     </message>
     <message>
-        <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
-        <translation type="unfinished">Show dependency tree</translation>
+      <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
+      <translation type="unfinished">Show dependency tree</translation>
     </message>
     <message>
-        <source>MEN_POP_SHOW_REDUCE_STUDY</source>
-        <translation type="unfinished">Reduce study</translation>
+      <source>MEN_POP_REDUCE_STUDY</source>
+      <translation type="unfinished">Reduce study</translation>
     </message>
     <message>
       <source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
       <translation>プレビュー</translation>
     </message>
     <message>
-        <source>PREF_TAB_DEPENDENCY_VIEW</source>
-        <translation type="unfinished">Dependency Tree</translation>
+      <source>PREF_TAB_DEPENDENCY_VIEW</source>
+      <translation type="unfinished">Dependency Tree</translation>
     </message>
     <message>
-        <source>PREF_HIERARCHY_TYPE</source>
-        <translation type="unfinished">Hierarchy type</translation>
+      <source>PREF_HIERARCHY_TYPE</source>
+      <translation type="unfinished">Hierarchy type</translation>
     </message>
     <message>
-        <source>MEN_ONLY_ASCENDANTS</source>
-        <translation type="unfinished">Display only ascendants tree</translation>
+      <source>MEN_ONLY_ASCENDANTS</source>
+      <translation type="unfinished">Display only ascendants tree</translation>
     </message>
     <message>
-        <source>MEN_ONLY_DESCENDANTS</source>
-        <translation type="unfinished">Display only descendants tree</translation>
+      <source>MEN_ONLY_DESCENDANTS</source>
+      <translation type="unfinished">Display only descendants tree</translation>
     </message>
     <message>
-        <source>MEN_BOTH_ASCENDANTS_DESCENDANTS</source>
-        <translation type="unfinished">Display both ascendants and descendants trees</translation>
+      <source>MEN_BOTH_ASCENDANTS_DESCENDANTS</source>
+      <translation type="unfinished">Display both ascendants and descendants trees</translation>
     </message>
     <message>
-        <source>GEOM_MOVE_POSSIBILITY</source>
-        <translation type="unfinished">Possibility to move nodes</translation>
+      <source>GEOM_MOVE_POSSIBILITY</source>
+      <translation type="unfinished">Possibility to move nodes</translation>
     </message>
     <message>
-        <source>PREF_GROUP_DEPENDENCY_VIEW_COLOR</source>
-        <translation type="unfinished">Color</translation>
+      <source>PREF_GROUP_DEPENDENCY_VIEW_COLOR</source>
+      <translation type="unfinished">Color</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_BACKGROUND_COLOR</source>
-        <translation type="unfinished">Background color</translation>
+      <source>PREF_DEPENDENCY_VIEW_BACKGROUND_COLOR</source>
+      <translation type="unfinished">Background color</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_NODE_COLOR</source>
-        <translation type="unfinished">Default node color</translation>
+      <source>PREF_DEPENDENCY_VIEW_NODE_COLOR</source>
+      <translation type="unfinished">Default node color</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR</source>
-        <translation type="unfinished">Main node color</translation>
+      <source>PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR</source>
+      <translation type="unfinished">Main node color</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR</source>
-        <translation type="unfinished">Unpublished node color</translation>
+      <source>PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR</source>
+      <translation type="unfinished">Unpublished node color</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR</source>
-        <translation type="unfinished">Selected node color</translation>
+      <source>PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR</source>
+      <translation type="unfinished">Selected node color</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_ARROW_COLOR</source>
-        <translation type="unfinished">Arrow color</translation>
+      <source>PREF_DEPENDENCY_VIEW_ARROW_COLOR</source>
+      <translation type="unfinished">Default arrow color</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_HIGHLIGHT_ARROW_COLOR</source>
-        <translation type="unfinished">Highlighted arrow color</translation>
+      <source>PREF_DEPENDENCY_VIEW_HIGHLIGHT_ARROW_COLOR</source>
+      <translation type="unfinished">Highlighted arrow color</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_SELECT_ARROW_COLOR</source>
-        <translation type="unfinished">Selected arrow color</translation>
+      <source>PREF_DEPENDENCY_VIEW_SELECT_ARROW_COLOR</source>
+      <translation type="unfinished">Selected arrow color</translation>
     </message>
     <message>
       <source>GEOM_ALL_IMPORT_FILES</source>
     <name>GeometryGUI</name>
     <message>
       <source>TOOL_BASIC</source>
-      <translation>基礎オブジェクト</translation>
+      <translation type="unfinished">Basic</translation>
     </message>
     <message>
       <source>TOOL_BLOCKS</source>
-      <translation>ブロック分割</translation>
+      <translation type="unfinished">Blocks</translation>
     </message>
     <message>
       <source>TOOL_BOOLEAN</source>
-      <translation>ブーリアン操作</translation>
+      <translation type="unfinished">Boolean operations</translation>
     </message>
     <message>
       <source>TOOL_FEATURES</source>
-      <translation>フィーチャー</translation>
+      <translation type="unfinished">Modification</translation>
     </message>
     <message>
       <source>TOOL_GENERATION</source>
-      <translation>押し出し/回転</translation>
+      <translation type="unfinished">Generation</translation>
     </message>
     <message>
       <source>TOOL_PRIMITIVES</source>
-      <translation>基本図形</translation>
+      <translation type="unfinished">Primitives</translation>
     </message>
     <message>
       <source>TOOL_TRANSFORMATION</source>
-      <translation>変形/移動/回転</translation>
+      <translation type="unfinished">Transformation</translation>
     </message>
     <message>
       <source>TOOL_BUILD</source>
-      <translation>構築</translation>
+      <translation type="unfinished">Build</translation>
     </message>
     <message>
       <source>TOOL_OPERATIONS</source>
-      <translation>操作</translation>
+      <translation type="unfinished">Operations</translation>
     </message>
     <message>
       <source>TOOL_PICTURES</source>
-      <translation>画像</translation>
+      <translation type="unfinished">Pictures</translation>
     </message>
     <message>
       <source>TOOL_ADVANCED</source>
-      <translation>高度なツール</translation>
+      <translation type="unfinished">Advanced</translation>
     </message>
     <message>
       <source>TOOL_MEASURES</source>
-      <translation>情報/測定</translation>
+      <translation type="unfinished">Measures</translation>
     </message>
     <message>
       <source>TOOL_IMPORTEXPORT</source>
-      <translation>インポート/エクスポート</translation>
+      <translation type="unfinished">Import / Export XAO</translation>
+    </message>
+    <message>
+      <source>TABLE_SECTION</source>
+      <translation type="unfinished">Section</translation>
+    </message>
+    <message>
+      <source>TABLE_INDEX</source>
+      <translation type="unfinished">Index</translation>
+    </message>
+    <message>
+      <source>TABLE_X</source>
+      <translation type="unfinished">X</translation>
+    </message>
+    <message>
+      <source>TABLE_Y</source>
+      <translation type="unfinished">Y</translation>
     </message>
   </context>
   <context>
       <translation>フェース 2 V</translation>
     </message>
   </context>
-  <context>
-    <name>CurveCreator_NewPointDlg</name>
-    <message>
-      <source>ADD_NEW_POINT</source>
-      <translation>新しい点の追加</translation>
-    </message>
-    <message>
-      <source>X_COORD</source>
-      <translation>X</translation>
-    </message>
-    <message>
-      <source>Y_COORD</source>
-      <translation>Y</translation>
-    </message>
-    <message>
-      <source>Z_COORD</source>
-      <translation>Z</translation>
-    </message>
-    <message>
-      <source>ADD_BTN</source>
-      <translation>追加</translation>
-    </message>
-    <message>
-      <source>ADD_CONTINUE_BTN</source>
-      <translation>追加して継続</translation>
-    </message>
-    <message>
-      <source>ADD_NEW_POINT_TO_%1</source>
-      <translation>新しい点を%1に追加</translation>
-    </message>
-    <message>
-      <source>SET_POINT_COORDINATES</source>
-      <translation>点座標の設定</translation>
-    </message>
-  </context>
   <context>
     <name>CurveCreator_NewSectionDlg</name>
     <message>
-      <source>NAME</source>
-      <translation>名前</translation>
+      <source>SECTION_NAME</source>
+      <translation type="unfinished">Name</translation>
     </message>
     <message>
-      <source>LINE_TYPE</source>
-      <translation>ライン</translation>
+      <source>SECTION_LINE_TYPE</source>
+      <translation type="unfinished">Type</translation>
     </message>
     <message>
-      <source>POLYLINE_TYPE</source>
-      <translation>ポリライン</translation>
+      <source>SECTION_POLYLINE_TYPE</source>
+      <translation type="unfinished">Polyline</translation>
     </message>
     <message>
-      <source>SPLINE_TYPE</source>
-      <translation>スプライン</translation>
+      <source>SECTION_SPLINE_TYPE</source>
+      <translation type="unfinished">Spline</translation>
     </message>
     <message>
-      <source>LINE_CLOSED</source>
-      <translation>閉じたライン</translation>
+      <source>SECTION_LINE_CLOSED</source>
+      <translation type="unfinished">Closed</translation>
     </message>
     <message>
-      <source>OK</source>
-      <translation>Ok</translation>
+      <source>SECTION_ADD_BTN</source>
+      <translation type="unfinished">Add</translation>
     </message>
     <message>
-      <source>ADD_BTN</source>
-      <translation>追加</translation>
+      <source>SECTION_OK_BTN</source>
+      <translation type="unfinished">Ok</translation>
     </message>
     <message>
-      <source>ADD_CONTINUE_BTN</source>
-      <translation>追加して継続</translation>
+      <source>SECTION_CANCEL_BTN</source>
+      <translation type="unfinished">Cancel</translation>
     </message>
     <message>
       <source>ADD_NEW_SECTION</source>
     <name>CurveCreator_TreeViewModel</name>
     <message>
       <source>X=%1, Y=%2</source>
-      <translation>X=%1, Y=%2</translation>
+      <translation type="unfinished">X=%1, Y=%2</translation>
     </message>
     <message>
       <source>X=%1, Y=%2, Z=%3</source>
-      <translation>X=%1, Y=%2, Z=%3</translation>
+      <translation type="unfinished">X=%1, Y=%2, Z=%3</translation>
     </message>
   </context>
   <context>
     <name>CurveCreator_Widget</name>
     <message>
-      <source>CURVE_NAME_TLT</source>
-      <translation>カーブの名前</translation>
-    </message>
-    <message>
-      <source>SECTION_GROUP_TLT</source>
-      <translation>断面グループ</translation>
+      <source>SECTION_GROUP_TITLE</source>
+      <translation type="unfinished">Sections</translation>
     </message>
     <message>
       <source>UNDO</source>
       <source>NEW_SECTION_TLT</source>
       <translation>新しい断面の挿入</translation>
     </message>
-    <message>
-      <source>INSERT_SECTION_BEFORE</source>
-      <translation>前に断面を挿入</translation>
-    </message>
-    <message>
-      <source>INSERT_SECTION_BEFORE_TLT</source>
-      <translation>前に断面を挿入</translation>
-    </message>
-    <message>
-      <source>INSERT_SECTION_AFTER</source>
-      <translation>後に断面の挿入</translation>
-    </message>
-    <message>
-      <source>INSERT_SECTION_AFTER_TLT</source>
-      <translation>後に断面の挿入</translation>
-    </message>
     <message>
       <source>ADDITION_MODE</source>
       <translation>追加モード</translation>
       <source>DETECTION_MODE_TLT</source>
       <translation>検出モード</translation>
     </message>
-    <message>
-      <source>INSERT_POINT_BEFORE</source>
-      <translation>前に点の挿入</translation>
-    </message>
-    <message>
-      <source>INSERT_POINT_BEFORE_TLT</source>
-      <translation>前に点の挿入</translation>
-    </message>
-    <message>
-      <source>INSERT_POINT_AFTER</source>
-      <translation>後に点の挿入</translation>
-    </message>
     <message>
       <source>CLOSE_SECTIONS</source>
       <translation>断面を閉じる</translation>
       <source>JOIN_TLT</source>
       <translation>選択した断面を結合</translation>
     </message>
-    <message>
-      <source>STEP_UP</source>
-      <translation>上昇</translation>
-    </message>
-    <message>
-      <source>STEP_UP_TLT</source>
-      <translation>選択したオブジェクトを上昇</translation>
-    </message>
-    <message>
-      <source>STEP_DOWN</source>
-      <translation>下降</translation>
-    </message>
-    <message>
-      <source>STEP_DOWN_TLT</source>
-      <translation>選択したオブジェクトを下降</translation>
-    </message>
     <message>
       <source>CLEAR_ALL</source>
       <translation>すべて消去</translation>
       <translation>すべての断面を結合</translation>
     </message>
   </context>
+  <context>
+    <name>EntityGUI_PolylineDlg</name>
+    <message>
+      <source>POLYLINE_DLG_TITLE</source>
+      <translation type="unfinished">Polyline Construction</translation>
+    </message>
+    <message>
+      <source>POLYLINE_TITLE</source>
+      <translation type="unfinished">Polyline</translation>
+    </message>
+    <message>
+      <source>POLYLINE_NAME</source>
+      <translation type="unfinished">Polyline</translation>
+    </message>
+    <message>
+      <source>POLYLINE_IMPORT</source>
+      <translation type="unfinished">Import polyline</translation>
+    </message>
+    <message>
+      <source>POLYLINE_ADD_SECTION</source>
+      <translation type="unfinished">Add section</translation>
+    </message>
+    <message>
+      <source>POLYLINE_EDIT_SECTION</source>
+      <translation type="unfinished">Edit section</translation>
+    </message>
+  </context>
   <context>
     <name>EntityGUI_SketcherDlg</name>
     <message>
     </message>
     <message>
       <source>X</source>
-      <translation>X</translation>
+      <translation type="unfinished">X</translation>
     </message>
     <message>
       <source>Y</source>
-      <translation>Y</translation>
+      <translation type="unfinished">Y</translation>
     </message>
     <message>
       <source>Z</source>
-      <translation>Z</translation>
+      <translation type="unfinished">Z</translation>
     </message>
   </context>
   <context>
     <name>OperationGUI_ChamferDlg</name>
     <message>
       <source>D</source>
-      <translation>D</translation>
+      <translation type="unfinished">D</translation>
     </message>
     <message>
       <source>FACE_1</source>
   <context>
     <name>GEOMToolsGUI_ReduceStudyDlg</name>
     <message>
-        <source>GEOM_REDUCE_STUDY_TITLE</source>
-        <translation type="unfinished">Reduce study</translation>
+      <source>GEOM_REDUCE_STUDY_TITLE</source>
+      <translation type="unfinished">Reduce study</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_KEPT_OBJECTS</source>
-        <translation type="unfinished">Objects to be kept</translation>
+      <source>GEOM_REDUCE_STUDY_KEPT_OBJECTS</source>
+      <translation type="unfinished">Objects to be kept</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_REMOVE_OBJECTS</source>
-        <translation type="unfinished">Objects to be removed</translation>
+      <source>GEOM_REDUCE_STUDY_REMOVE_OBJECTS</source>
+      <translation type="unfinished">Objects to be removed</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_NAME</source>
-        <translation type="unfinished">Name</translation>
+      <source>GEOM_REDUCE_STUDY_NAME</source>
+      <translation type="unfinished">Name</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_OPTIONS</source>
-        <translation type="unfinished">Options</translation>
+      <source>GEOM_REDUCE_STUDY_OPTIONS</source>
+      <translation type="unfinished">Options</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_INTERMEDIATES</source>
-        <translation type="unfinished">Intermediate objects</translation>
+      <source>GEOM_REDUCE_STUDY_INTERMEDIATES</source>
+      <translation type="unfinished">Intermediate objects</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_SUB_OBJECTS</source>
-        <translation type="unfinished">Sub-objects</translation>
+      <source>GEOM_REDUCE_STUDY_SUB_OBJECTS</source>
+      <translation type="unfinished">Sub-objects</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_KEEP</source>
-        <translation type="unfinished">Keep</translation>
+      <source>GEOM_REDUCE_STUDY_KEEP</source>
+      <translation type="unfinished">Keep</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_UNPUBLISH</source>
-        <translation type="unfinished">Unpublish</translation>
+      <source>GEOM_REDUCE_STUDY_UNPUBLISH</source>
+      <translation type="unfinished">Unpublish</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_REMOVE</source>
-        <translation type="unfinished">Remove</translation>
+      <source>GEOM_REDUCE_STUDY_REMOVE</source>
+      <translation type="unfinished">Remove</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_REMOVE_EMPTY_FOLDER</source>
-        <translation type="unfinished">Remove empty folders</translation>
+      <source>GEOM_REDUCE_STUDY_REMOVE_EMPTY_FOLDER</source>
+      <translation type="unfinished">Remove empty folders</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_SOFT_REMOVAL</source>
-        <translation type="unfinished">Soft removal</translation>
+      <source>GEOM_REDUCE_STUDY_SOFT_REMOVAL</source>
+      <translation type="unfinished">Soft removal</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_WARNING_DELETE</source>
-        <translation type="unfinished">Do you really want to delete intermediate objects? After applying this operation study will be broken.</translation>
+      <source>GEOM_REDUCE_STUDY_WARNING_DELETE</source>
+      <translation type="unfinished">Do you really want to delete intermediate objects? After applying this operation study will be broken.</translation>
     </message>
   </context>
   <context>
index ac7176133c50fa4ade48295abc96c984e723e27e..0df1b0047487eb927ae120249bf0d436e22fe56e 100644 (file)
 
 #define PLANAR_FACE_MAX_TOLERANCE 1e-06
 
+// The following macro, when enabled, causes pcurves upgrade after MakeFilling algorithm
+// in MakeAnyFace function;
+// WARNING: it may lead to extra vertices generation by partition algorithm
+// in some cases, for example when fillet is made on a PipeTShape - 
+// see issues 0021568 and 0021550
+// VSR (15/05/2012): macro commented out (disabled) to avoid extra vertices!
+//#define MAKE_FACE_UPGRADE_PCURVES
+
+// The following macro, when enabled, causes fixing tolerance for pcurves
+// after BRepBuilderAPI_MakeFace + ShHealOper_ShapeProcess in MakeAnyFace function;
+// This sometimes allows to fix problems of extra vertices generation
+// see issue 0022706
+// VSR (17/11/2014): macro enabled
+#define MAKE_FACE_PCURVES_FIX_TOLERANCE
+
+#ifdef MAKE_FACE_PCURVES_FIX_TOLERANCE
+#include <BOPTools_AlgoTools.hxx>
+#include <NCollection_DataMap.hxx>
+#include <ShapeFix_ShapeTolerance.hxx>
+#endif
+
 static Standard_Integer mod4 (Standard_Integer nb)
 {
   if (nb <= 0) return nb + 4;
@@ -1362,11 +1383,7 @@ TCollection_AsciiString GEOMImpl_Block6Explorer::MakeAnyFace (const TopoDS_Wire&
   // 12.04.2006 for PAL12149 begin
   Handle(Geom_Surface) aGS = BRep_Tool::Surface(TopoDS::Face(aFace));
 
-// VSR: debug issues 0021568 and 0021550 (15/05/2012) - BEGIN
-// the following block, when enabled, leads to extra vertices generation by partition algorithm
-// in some cases, for example when fillet is made on a PipeTShape
-#if 0
-// VSR: debug issues 0021568 and 0021550 (15/05/2012) - END
+#ifdef MAKE_FACE_UPGRADE_PCURVES
   BRep_Builder BB;
   TopoDS_Iterator itw(theWire);
   for (; itw.More(); itw.Next())
@@ -1396,7 +1413,46 @@ TCollection_AsciiString GEOMImpl_Block6Explorer::MakeAnyFace (const TopoDS_Wire&
   }
   // 12.04.2006 for PAL12149 end
 
-  if (theResult.IsNull()) { // try to deal with pure result of filling
+  if (!theResult.IsNull()) {
+    // try to deal with result of BRepBuilderAPI_MakeFace + ShHealOper_ShapeProcess
+#if OCC_VERSION_LARGE >= 0x06080000
+#ifdef MAKE_FACE_PCURVES_FIX_TOLERANCE
+    // check and fix pcurves, if necessary
+    Standard_Real aT, aTolE, aD, aDMax;
+    TopExp_Explorer aExpF, aExpE;
+    NCollection_DataMap<TopoDS_Shape, Standard_Real, TopTools_ShapeMapHasher> aDMETol;
+    aExpF.Init(theResult, TopAbs_FACE);
+    for (; aExpF.More(); aExpF.Next()) {
+      const TopoDS_Face& aF = *(TopoDS_Face*)&aExpF.Current();
+      aExpE.Init(aF, TopAbs_EDGE);
+      for (; aExpE.More(); aExpE.Next()) {
+        const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExpE.Current();
+        if (!BOPTools_AlgoTools::ComputeTolerance(aF, aE, aDMax, aT)) continue;
+        aTolE = BRep_Tool::Tolerance(aE);
+        if (aDMax < aTolE) continue;
+        if (aDMETol.IsBound(aE)) {
+          aD = aDMETol.Find(aE);
+          if (aDMax > aD) {
+            aDMETol.UnBind(aE);
+            aDMETol.Bind(aE, aDMax);
+          }
+        }
+        else {
+          aDMETol.Bind(aE, aDMax);
+        }
+      }
+    }
+    NCollection_DataMap<TopoDS_Shape, Standard_Real, TopTools_ShapeMapHasher>::Iterator aDMETolIt(aDMETol);
+    ShapeFix_ShapeTolerance sat;
+    for (; aDMETolIt.More(); aDMETolIt.Next()) {
+      sat.LimitTolerance(aDMETolIt.Key(), aDMETolIt.Value());
+    }
+#endif
+#endif
+  }
+  else {
+    // try to deal with pure result of BRepOffsetAPI_MakeFilling
+
     // Update tolerance
     Standard_Real aTol = MF.G0Error();
 
index 32b0b04fa21b02af7d5861013d0b7f0e8a5dadd5..111a509cdd7d22413ca06be424b69b1952176e88 100644 (file)
 
 #include <TNaming_CopyShape.hxx>
 
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <ShapeFix_Shape.hxx>
-
 #include <BRep_Builder.hxx>
-#include <BRepAlgo.hxx>
 #include <BRepAlgoAPI_Common.hxx>
 #include <BRepAlgoAPI_Cut.hxx>
 #include <BRepAlgoAPI_Fuse.hxx>
 #include <BRepAlgoAPI_Section.hxx>
-#include <BRepCheck_Analyzer.hxx>
 #include <BOPAlgo_CheckerSI.hxx>
 #include <BOPDS_DS.hxx>
 
@@ -73,33 +68,23 @@ static TopoDS_Shape RemoveExtraEdges(const TopoDS_Shape &theShape)
 {
   TopoDS_Shape aResult;
 
-  if (theShape.IsNull() == Standard_False) {
+  if (!theShape.IsNull()) {
     BlockFix_BlockFixAPI aTool;
 
     aTool.OptimumNbFaces() = 0;
     aTool.SetShape(theShape);
     aTool.Perform();
-    aResult = aTool.Shape();
-
-    // Repair result
-    BRepCheck_Analyzer anAna (aResult, false);
-    Standard_Boolean isValid = anAna.IsValid();
+    TopoDS_Shape aShape = aTool.Shape();
 
-    if (!isValid) {
+    if (GEOMUtils::CheckShape(aShape)) {
+      aResult = aShape;
+    }
+    else {
       TopoDS_Shape aFixed;
       ShHealOper_ShapeProcess aHealer;
-
       aHealer.Perform(aResult, aFixed);
-
-      if (aHealer.isDone()) {
+      if (aHealer.isDone() && GEOMUtils::CheckShape(aFixed))
         aResult = aFixed;
-        anAna.Init(aResult, false);
-        isValid = anAna.IsValid();
-      }
-    }
-
-    if (!isValid) {
-      aResult.Nullify();
     }
   }
 
@@ -153,11 +138,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
 
       if (!aShape1.IsNull() && !aShape2.IsNull()) {
         // check arguments for Mantis issue 0021019
-        BRepCheck_Analyzer ana (aShape1, Standard_True);
-        if (!ana.IsValid())
-          StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
-        ana.Init(aShape2);
-        if (!ana.IsValid())
+        if (!GEOMUtils::CheckShape(aShape1, true) || !GEOMUtils::CheckShape(aShape2, true))
           StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
 
         if (isCheckSelfInte) {
@@ -211,10 +192,9 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
         aShape = aRefShape->GetValue();
        
         if (!aShape.IsNull()) {
-          BRepCheck_Analyzer anAna (aShape, Standard_True);
-          if (!anAna.IsValid()) {
+          // check arguments for Mantis issue 0021019
+          if (!GEOMUtils::CheckShape(aShape, true))
             StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
-          }
 
           BOPAlgo_CheckerSI aCSI;  // checker of self-interferences
 
@@ -239,11 +219,9 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
           for (i = 2; i <= nbShapes; i++) {
            aRefShape = Handle(GEOM_Function)::DownCast(aShapes->Value(i));
            aShape2 = aRefShape->GetValue();
-           anAna.Init(aShape2);
-           
-           if (!anAna.IsValid()) {
+            
+            if (!GEOMUtils::CheckShape(aShape2, true))
              StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
-           }
            
             if (isCheckSelfInte) {
               BOPCol_ListOfShape aList2;
@@ -280,11 +258,8 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
 
       if (!aShape.IsNull()) {
         // check arguments for Mantis issue 0021019
-        BRepCheck_Analyzer anAna (aShape, Standard_True);
-
-        if (!anAna.IsValid()) {
+        if (!GEOMUtils::CheckShape(aShape, true))
           StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
-        }
 
        BOPAlgo_CheckerSI aCSI;  // checker of self-interferences
 
@@ -315,11 +290,9 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
         for (i = 1; i <= nbShapes; i++) {
           aRefTool = Handle(GEOM_Function)::DownCast(aTools->Value(i));
           aTool = aRefTool->GetValue();
-          anAna.Init(aTool);
 
-          if (!anAna.IsValid()) {
+          if (!GEOMUtils::CheckShape(aTool, true))
             StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
-          }
 
           if (isCheckSelfInte) {
             BOPCol_ListOfShape aList2;
@@ -572,19 +545,8 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
   }
 
   // 08.07.2008 skl for bug 19761 from Mantis
-  BRepCheck_Analyzer ana (aShape, Standard_True);
-  ana.Init(aShape);
-  if (!ana.IsValid()) {
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape, Precision::Confusion(),
-                        Precision::Confusion(), TopAbs_SHAPE);
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-    ana.Init(aShape);
-    if (!ana.IsValid())
-      Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result");
-  }
+  if ( !GEOMUtils::CheckShape(aShape, true) && !GEOMUtils::FixShapeTolerance(aShape) )
+    Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result");
 
   // BEGIN: Mantis issue 0021060: always limit tolerance of BOP result
   // 1. Get shape parameters for comparison
@@ -616,15 +578,8 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
   TopoDS_Shape aShapeCopy;
   TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
   TNaming_CopyShape::CopyTool(aShape, aMapTShapes, aShapeCopy);
-  ShapeFix_ShapeTolerance aSFT;
-  aSFT.LimitTolerance(aShapeCopy, Precision::Confusion(), Precision::Confusion(), TopAbs_SHAPE);
-  Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape (aShapeCopy);
-  aSfs->Perform();
-  aShapeCopy = aSfs->Shape();
-
-  // 3. Check parameters
-  ana.Init(aShapeCopy);
-  if (ana.IsValid()) {
+
+  if ( GEOMUtils::FixShapeTolerance(aShapeCopy, true) ) {
     int iType, nbTypesCopy [TopAbs_SHAPE];
 
     for (iType = 0; iType < TopAbs_SHAPE; ++iType)
index e845c72a71a9f396ff63766943f0ec978015fdb7..f7582ecfd7a2ab649aa9199666ac9edc8de25772 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_ChamferDriver.hxx>
 #include <GEOMImpl_IChamfer.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOMImpl_ILocalOperations.hxx>
 #include <GEOMImpl_Block6Explorer.hxx>
-
+#include <GEOMUtils.hxx>
 #include <GEOM_Function.hxx>
 
 #include <BRepLib.hxx>
 #include <BRepTools.hxx>
 #include <BRepFilletAPI_MakeChamfer.hxx>
 
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-
 #include <TopAbs.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Iterator.hxx>
-#include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 
-#include <Precision.hxx>
-#include <gp_Pnt.hxx>
 #include <StdFail_NotDone.hxx>
 
 //=======================================================================
@@ -63,7 +55,6 @@ const Standard_GUID& GEOMImpl_ChamferDriver::GetID()
   return aChamferDriver;
 }
 
-
 //=======================================================================
 //function : GEOMImpl_ChamferDriver
 //purpose  :
@@ -269,12 +260,7 @@ Standard_Integer GEOMImpl_ChamferDriver::Execute(TFunction_Logbook& log) const
   if (aShape.IsNull()) return 0;
 
   // reduce tolerances
-  ShapeFix_ShapeTolerance aSFT;
-  aSFT.LimitTolerance(aShape, Precision::Confusion(),
-                      Precision::Confusion(), TopAbs_SHAPE);
-  Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-  aSfs->Perform();
-  aShape = aSfs->Shape();
+  GEOMUtils::FixShapeTolerance( aShape );
 
   // fix SameParameter flag
   BRepLib::SameParameter(aShape, 1.E-5, Standard_True);
index ad3fb2d12522483c5e3bad87c76f833bea3c4567..808d79253c4908f5c79321c5c02465342208b3a8 100755 (executable)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_Fillet2dDriver.hxx>
 #include <GEOMImpl_IFillet2d.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOMImpl_ILocalOperations.hxx>
 #include <GEOMImpl_Block6Explorer.hxx>
 #include <GEOM_Function.hxx>
+#include <GEOMUtils.hxx>
 
 #include <BRepFilletAPI_MakeFillet2d.hxx>
-#include <BRepCheck_Analyzer.hxx>
-#include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
 
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
-#include <TopoDS_Edge.hxx>
 #include <TopoDS_Iterator.hxx>
 #include <TopAbs.hxx>
-#include <TopExp_Explorer.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
 
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <ShapeFix_Shape.hxx>
-
-#include <Precision.hxx>
-#include <gp_Pnt.hxx>
 #include <StdFail_NotDone.hxx>
 
 //=======================================================================
index 33e942e793d79bdd18626c942dc78fb9fa12b920..bdffdb03a9bdf44b265c44944c8c1b5d7b763e3a 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_FilletDriver.hxx>
 #include <GEOMImpl_IFillet.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOMImpl_ILocalOperations.hxx>
+#include <GEOMUtils.hxx>
 #include <GEOM_Function.hxx>
 
 #include <BRepFilletAPI_MakeFillet.hxx>
-#include <BRepCheck_Analyzer.hxx>
-#include <BRep_Tool.hxx>
-
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopAbs.hxx>
 #include <TopExp_Explorer.hxx>
-
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <ShapeFix_Shape.hxx>
-
-#include <Precision.hxx>
-#include <gp_Pnt.hxx>
 #include <StdFail_NotDone.hxx>
 
+// Debug PipeTShape function: uncomment the macro below to correct tolerance
+// of resulting face after fillet creation
+// VSR 30/12/2014: macro disabled
+//#define FIX_FACE_TOLERANCE
+// Debug PipeTShape function: uncomment the macro below to correct tolerance
+// of resulting curves after fillet creation
+// VSR 30/12/2014: macro disabled
+//#define FIX_CURVES_TOLERANCES
+
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -135,20 +134,16 @@ Standard_Integer GEOMImpl_FilletDriver::Execute(TFunction_Logbook& log) const
 
   if (aShape.IsNull()) return 0;
 
-  // Check shape validity
-  BRepCheck_Analyzer ana (aShape, false);
-  if (!ana.IsValid()) {
-    // 08.07.2008 added by skl during fixing bug 19761 from Mantis
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape, Precision::Confusion(),
-                        Precision::Confusion(), TopAbs_SHAPE);
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-    ana.Init(aShape);
-    if (!ana.IsValid())
-      StdFail_NotDone::Raise("Fillet algorithm have produced an invalid shape result");
-  }
+#if defined(FIX_CURVES_TOLERANCES)
+  bool isOk = GEOMUtils::FixShapeCurves(aShape);
+#elif defined(FIX_FACE_TOLERANCE)
+  bool isOk = GEOMUtils::FixShapeTolerance(aShape, TopAbs_FACE);
+#else
+  // 08.07.2008 added by skl during fixing bug 19761 from Mantis
+  bool isOk = GEOMUtils::CheckShape(aShape) || GEOMUtils::FixShapeTolerance(aShape);
+#endif
+  if ( !isOk )
+    StdFail_NotDone::Raise("Fillet algorithm have produced an invalid shape result");
 
   aFunction->SetValue(aShape);
 
index 51154eb638b116c43c4ae70a04c6a7b3169ade0f..edce49658cdb93a9dcece06a8ca2831fc0fcda1f 100644 (file)
@@ -20,8 +20,6 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_HealingDriver.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOMImpl_IHealing.hxx>
 
 #include <TNaming_CopyShape.hxx>
 
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <ShapeFix_Shape.hxx>
-
 #include <BRep_Builder.hxx>
 #include <BRepAdaptor_Curve.hxx>
-#include <BRepCheck_Analyzer.hxx>
 #include <BRepTools_WireExplorer.hxx>
 
 #include <TopExp.hxx>
@@ -650,6 +644,8 @@ void GEOMImpl_HealingDriver::LimitTolerance (GEOMImpl_IHealing* theHI,
                                              TopoDS_Shape& theOutShape) const
 {
   Standard_Real aTol = theHI->GetTolerance();
+  TopAbs_ShapeEnum aType = theHI->GetType();
+
   if (aTol < Precision::Confusion())
     aTol = Precision::Confusion();
 
@@ -659,19 +655,14 @@ void GEOMImpl_HealingDriver::LimitTolerance (GEOMImpl_IHealing* theHI,
     TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
     TNaming_CopyShape::CopyTool(theOriginalShape, aMapTShapes, aShapeCopy);
   }
-  // 2. Limit tolerance.
-  ShapeFix_ShapeTolerance aSFT;
-  aSFT.LimitTolerance(aShapeCopy, aTol, aTol, TopAbs_SHAPE);
 
-  // 3. Fix obtained shape.
-  Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape (aShapeCopy);
-  aSfs->Perform();
-  theOutShape = aSfs->Shape();
-
-  BRepCheck_Analyzer ana (theOutShape, Standard_True);
-  if (!ana.IsValid())
+  // 2. Limit tolerance.
+  if (!GEOMUtils::FixShapeTolerance(aShapeCopy, aType, aTol))
     StdFail_NotDone::Raise("Non valid shape result");
 
+  // 3. Set the result
+  theOutShape = aShapeCopy;
+
   // 4. Collect statistics
   {
     ShHealOper_Tool tool;
@@ -907,8 +898,7 @@ void GEOMImpl_HealingDriver::FuseCollinearEdges (const TopoDS_Shape& theOriginal
   }
   theOutShape = aFinalWire;
 
-  BRepCheck_Analyzer ana (theOutShape, Standard_True);
-  if (!ana.IsValid())
+  if (!GEOMUtils::CheckShape(theOutShape, true))
     StdFail_NotDone::Raise("Non valid shape result");
 }
 
@@ -1082,6 +1072,7 @@ GetCreationInformation(std::string&             theOperationName,
     theOperationName = "LIMIT_TOLERANCE";
     AddParam( theParams, "Selected shape", aCI.GetOriginal() );
     AddParam( theParams, "Tolerance", aCI.GetTolerance() );
+    AddParam( theParams, "Type", aCI.GetType() );
     break;
   case FUSE_COLLINEAR_EDGES:
     theOperationName = "FUSE_EDGES";
index cca9f381f3b9586673588f7f03f042312cf646e4..2a733c51e22ea048d7f36b67027af3e6a8dc3dde 100644 (file)
@@ -88,6 +88,7 @@
 #include <Bnd_Box.hxx>
 #include <GProp_GProps.hxx>
 
+#include <Geom_Curve.hxx>
 #include <Geom_Surface.hxx>
 #include <ShapeAnalysis_Surface.hxx>
 
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
 
+
+/**
+ * This function returns Standard_True if the face is quadrangular. It means
+ * that it has only 1 wire with 4 edges. If there are more then 4 edges in
+ * the wire and theToleranceC1 is not negative the new implementation is used.
+ * According to it the face is quadrangular if it is quadrangular according to
+ * an old implementation or if it has a single wire with more then 4 edges
+ * that form exactly 4 bounds of C1 continuity with the given tolerance.
+ *
+ * \param theFace the face to be checked
+ * \param theToleranceC1 if negative, it is not used; otherwise it is used
+ *        to check if two neighbor edges of face have C1 continuity.
+ * \return Standard_True if the face is quadrangular; Standard_False otherwise.
+ */
+static Standard_Boolean IsQuadrangle(const TopoDS_Face   &theFace,
+                                     const Standard_Real  theToleranceC1)
+{
+  TopExp_Explorer aFExp (theFace, TopAbs_WIRE);
+
+  if (!aFExp.More()) {
+    // no wire in the face
+    return Standard_False;
+  }
+
+  TopoDS_Shape aWire = aFExp.Current();
+
+  aFExp.Next();
+
+  if (aFExp.More()) {
+    // multiple wires in the face
+    return Standard_False;
+  }
+
+  // Check number of edges in the face
+  Standard_Integer    aNbEdges = 0;
+  TopTools_MapOfShape aMapEdges;
+  TopExp_Explorer     aWExp(aWire, TopAbs_EDGE);
+
+  for (; aWExp.More(); aWExp.Next()) {
+    if (aMapEdges.Add(aWExp.Current())) {
+      aNbEdges++;
+
+      if (aNbEdges > 4) {
+        break;
+      }
+    }
+  }
+
+  if (aNbEdges < 4) {
+    return Standard_False;
+  }
+
+  if (aNbEdges > 4) {
+    if (theToleranceC1 < 0.) {
+      return Standard_False;
+    }
+
+    // Check if a wire has 4 bounds of C1 continuity.
+    BRepTools_WireExplorer aWireExp(TopoDS::Wire(aWire), theFace);
+    TopTools_ListOfShape   anEdges;
+
+    for (aNbEdges = 0; aWireExp.More(); aWireExp.Next()) {
+      const TopoDS_Edge &anEdge = aWireExp.Current();
+
+      // Skip degenerated edges.
+      if (!BRep_Tool::Degenerated(anEdge)) {
+        anEdges.Append(anEdge);
+        ++aNbEdges;
+      }
+    }
+
+    if (aNbEdges < 4) {
+      return Standard_False;
+    }
+
+    // Compute number of sharp corners.
+    anEdges.Append(anEdges.First()); // To make a loop.
+
+    TopTools_ListIteratorOfListOfShape anIter(anEdges);
+    Standard_Real      aPar[2];
+    Standard_Integer   aNbCorners = 0;
+    TopoDS_Edge        anEdge1    = TopoDS::Edge(anEdges.First());
+    Handle(Geom_Curve) aCurve1    = BRep_Tool::Curve(anEdge1, aPar[0], aPar[1]);
+    Handle(Geom_Curve) aCurve2;
+    TopoDS_Edge        anEdge2;
+    TopoDS_Vertex      aCommonVtx;
+    gp_Pnt             aPnt;
+    gp_Vec             aVec1;
+    gp_Vec             aVec2;
+    Standard_Boolean   isReversed1 = (anEdge1.Orientation() == TopAbs_REVERSED);
+    Standard_Boolean   isReversed2;
+
+    for (anIter.Next(); anIter.More(); anIter.Next()) {
+      TopoDS_Edge anEdge2 = TopoDS::Edge(anIter.Value());
+
+      if (!TopExp::CommonVertex(anEdge1, anEdge2, aCommonVtx)) {
+        // NEVERREACHED
+        return Standard_False;
+      }
+
+      // Check the angle between tangent vectors of 2 curves at this point.
+      Standard_Real aParam1 = BRep_Tool::Parameter(aCommonVtx, anEdge1);
+      Standard_Real aParam2 = BRep_Tool::Parameter(aCommonVtx, anEdge2);
+
+      aCurve2     = BRep_Tool::Curve(anEdge2, aPar[0], aPar[1]);
+      isReversed2 = (anEdge2.Orientation() == TopAbs_REVERSED);
+      aCurve1->D1(aParam1, aPnt, aVec1);
+      aCurve2->D1(aParam2, aPnt, aVec2);
+
+      if (isReversed1) {
+        aVec1.Reverse();
+      }
+
+      if (isReversed2) {
+        aVec2.Reverse();
+      }
+      const Standard_Real anAngle = aVec1.Angle(aVec2);
+
+      if (anAngle > theToleranceC1) {
+        ++aNbCorners;
+
+        if (aNbCorners > 4) {
+          break;
+        }
+      }
+
+      // Go to the next couple of edges.
+      anEdge1     = anEdge2;
+      aCurve1     = aCurve2;
+      isReversed1 = isReversed2;
+    }
+
+    // Check the total number of corners.
+    if (aNbCorners != 4) {
+      return Standard_False;
+    }
+  }
+
+  return Standard_True;
+}
+
 //=============================================================================
 /*!
  *   constructor:
@@ -1647,7 +1789,8 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape&   theShape,
                                                 TopTools_ListOfShape& BLO,
                                                 TopTools_ListOfShape& NOT,
                                                 TopTools_ListOfShape& EXT,
-                                                TopTools_ListOfShape& NOQ)
+                                                TopTools_ListOfShape& NOQ,
+                                                const Standard_Real   theToleranceC1)
 {
   TopAbs_ShapeEnum aType = theShape.ShapeType();
   switch (aType) {
@@ -1656,7 +1799,7 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape&   theShape,
     {
       TopoDS_Iterator It (theShape);
       for (; It.More(); It.Next()) {
-        AddBlocksFrom(It.Value(), BLO, NOT, EXT, NOQ);
+        AddBlocksFrom(It.Value(), BLO, NOT, EXT, NOQ, theToleranceC1);
       }
     }
     break;
@@ -1665,6 +1808,7 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape&   theShape,
       // Check, if there are seam or degenerated edges
       BlockFix_CheckTool aTool;
       aTool.SetShape(theShape);
+      aTool.SetAngTolerance(theToleranceC1);
       aTool.Perform();
       if (aTool.NbPossibleBlocks() > 0) {
         EXT.Append(theShape);
@@ -1676,41 +1820,12 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape&   theShape,
         TopExp_Explorer expF (theShape, TopAbs_FACE);
 
         for (; expF.More(); expF.Next()) {
-          if (mapFaces.Add(expF.Current())) {
-            nbFaces++;
-            //0021483//if (nbFaces > 6) break;
+          TopoDS_Face aF = TopoDS::Face(expF.Current());
 
-            // get wire
-            TopoDS_Shape aF = expF.Current();
-            TopExp_Explorer wires (aF, TopAbs_WIRE);
-            if (!wires.More()) {
-              // no wire in the face
-              hasNonQuadr = Standard_True;
-              NOQ.Append(aF);//0021483
-              //0021483//break;
-              continue;
-            }
-            TopoDS_Shape aWire = wires.Current();
-            wires.Next();
-            if (wires.More()) {
-              // multiple wires in the face
-              hasNonQuadr = Standard_True;
-              NOQ.Append(aF);//0021483
-              //0021483//break;
-              continue;
-            }
+          if (mapFaces.Add(aF)) {
+            nbFaces++;
 
-            // Check number of edges in the face
-            Standard_Integer nbEdges = 0;
-            TopTools_MapOfShape mapEdges;
-            TopExp_Explorer expW (aWire, TopAbs_EDGE);
-            for (; expW.More(); expW.Next()) {
-              if (mapEdges.Add(expW.Current())) {
-                nbEdges++;
-                if (nbEdges > 4) break;
-              }
-            }
-            if (nbEdges != 4) {
+            if (!IsQuadrangle(aF, theToleranceC1)) {
               hasNonQuadr = Standard_True;
               NOQ.Append(aF);//0021483
             }
@@ -1732,34 +1847,10 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape&   theShape,
       TopTools_MapOfShape mapFaces;
       TopExp_Explorer expF (theShape, TopAbs_FACE);
       for (; expF.More(); expF.Next()) {
-        if (mapFaces.Add(expF.Current())) {
-          // get wire
-          TopoDS_Shape aF = expF.Current();
-          TopExp_Explorer wires (aF, TopAbs_WIRE);
-          if (!wires.More()) {
-            // no wire in the face
-            NOQ.Append(aF);//0021483
-            continue;
-          }
-          TopoDS_Shape aWire = wires.Current();
-          wires.Next();
-          if (wires.More()) {
-            // multiple wires in the face
-            NOQ.Append(aF);//0021483
-            continue;
-          }
+        TopoDS_Face aF = TopoDS::Face(expF.Current());
 
-          // Check number of edges in the face
-          Standard_Integer nbEdges = 0;
-          TopTools_MapOfShape mapEdges;
-          TopExp_Explorer expW (aWire, TopAbs_EDGE);
-          for (; expW.More(); expW.Next()) {
-            if (mapEdges.Add(expW.Current())) {
-              nbEdges++;
-              if (nbEdges > 4) break;
-            }
-          }
-          if (nbEdges != 4) {
+        if (mapFaces.Add(aF)) {
+          if (!IsQuadrangle(aF, theToleranceC1)) {
             NOQ.Append(aF);//0021483
           }
         }
@@ -1771,99 +1862,6 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape&   theShape,
   }
 }
 
-void AddBlocksFromOld (const TopoDS_Shape&   theShape,
-                       TopTools_ListOfShape& BLO,
-                       TopTools_ListOfShape& NOT,
-                       TopTools_ListOfShape& DEG,
-                       TopTools_ListOfShape& SEA)
-{
-  TopAbs_ShapeEnum aType = theShape.ShapeType();
-  switch (aType) {
-  case TopAbs_COMPOUND:
-  case TopAbs_COMPSOLID:
-    {
-      TopoDS_Iterator It (theShape);
-      for (; It.More(); It.Next()) {
-        AddBlocksFromOld(It.Value(), BLO, NOT, DEG, SEA);
-      }
-    }
-    break;
-  case TopAbs_SOLID:
-    {
-      TopTools_MapOfShape mapFaces;
-      TopExp_Explorer expF (theShape, TopAbs_FACE);
-      Standard_Integer nbFaces = 0;
-      Standard_Boolean hasNonQuadr = Standard_False;
-      Standard_Boolean hasDegenerated = Standard_False;
-      Standard_Boolean hasSeam = Standard_False;
-      for (; expF.More(); expF.Next()) {
-        if (mapFaces.Add(expF.Current())) {
-          nbFaces++;
-          if (nbFaces > 6) break;
-
-          // Check number of edges in the face
-          Standard_Integer nbEdges = 0;
-          TopTools_MapOfShape mapEdges;
-
-          // get wire
-          TopoDS_Shape aF = expF.Current();
-          TopExp_Explorer wires (aF, TopAbs_WIRE);
-          if (!wires.More()) {
-            // no wire in the face
-            hasNonQuadr = Standard_True;
-            break;
-          }
-          TopoDS_Shape aWire = wires.Current();
-          wires.Next();
-          if (wires.More()) {
-            // multiple wires in the face
-            hasNonQuadr = Standard_True;
-            break;
-          }
-
-          // iterate on wire
-          BRepTools_WireExplorer aWE (TopoDS::Wire(aWire), TopoDS::Face(aF));
-          for (; aWE.More(); aWE.Next(), nbEdges++) {
-            if (BRep_Tool::Degenerated(aWE.Current())) {
-              // degenerated edge found
-              hasDegenerated = Standard_True;
-//              break;
-            }
-            if (mapEdges.Contains(aWE.Current())) {
-              // seam edge found
-              hasSeam = Standard_True;
-//              break;
-            }
-            mapEdges.Add(aWE.Current());
-          }
-          if (nbEdges != 4) {
-            hasNonQuadr = Standard_True;
-          }
-        }
-      }
-      if (nbFaces == 6) {
-        if (hasDegenerated || hasSeam) {
-          if (hasDegenerated) {
-            DEG.Append(theShape);
-          }
-          if (hasSeam) {
-            SEA.Append(theShape);
-          }
-        } else if (hasNonQuadr) {
-          NOT.Append(theShape);
-        } else {
-          BLO.Append(theShape);
-        }
-      } else {
-        NOT.Append(theShape);
-      }
-    }
-    break;
-  default:
-    NOT.Append(theShape);
-  }
-}
-
 #define REL_NOT_CONNECTED 0
 #define REL_OK            1
 #define REL_NOT_GLUED     2
@@ -2086,158 +2084,6 @@ Standard_Boolean HasAnyConnection (const Standard_Integer         theBlockIndex,
   return Standard_False;
 }
 
-//=============================================================================
-/*!
- *  CheckCompoundOfBlocksOld
- */
-//=============================================================================
-Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocksOld
-                                                (Handle(GEOM_Object) theCompound,
-                                                 std::list<BCError>&      theErrors)
-{
-  SetErrorCode(KO);
-
-  if (theCompound.IsNull()) return Standard_False;
-  TopoDS_Shape aBlockOrComp = theCompound->GetValue();
-
-  Standard_Boolean isCompOfBlocks = Standard_True;
-
-  // Map sub-shapes and their indices
-  TopTools_IndexedMapOfShape anIndices;
-  TopExp::MapShapes(aBlockOrComp, anIndices);
-
-  // 1. Report non-blocks
-  TopTools_ListOfShape NOT; // Not blocks
-  TopTools_ListOfShape DEG; // Hexahedral solids, having degenerated edges
-  TopTools_ListOfShape SEA; // Hexahedral solids, having seam edges
-  TopTools_ListOfShape BLO; // All blocks from the given compound
-  AddBlocksFromOld(aBlockOrComp, BLO, NOT, DEG, SEA);
-
-  if (NOT.Extent() > 0) {
-    isCompOfBlocks = Standard_False;
-    BCError anErr;
-    anErr.error = NOT_BLOCK;
-    TopTools_ListIteratorOfListOfShape it (NOT);
-    for (; it.More(); it.Next()) {
-      anErr.incriminated.push_back(anIndices.FindIndex(it.Value()));
-    }
-    theErrors.push_back(anErr);
-  }
-
-  if (DEG.Extent() > 0 || SEA.Extent() > 0) {
-    isCompOfBlocks = Standard_False;
-    BCError anErr;
-    anErr.error = EXTRA_EDGE;
-
-    TopTools_ListIteratorOfListOfShape itDEG (DEG);
-    for (; itDEG.More(); itDEG.Next()) {
-      anErr.incriminated.push_back(anIndices.FindIndex(itDEG.Value()));
-    }
-
-    TopTools_ListIteratorOfListOfShape itSEA (SEA);
-    for (; itSEA.More(); itSEA.Next()) {
-      anErr.incriminated.push_back(anIndices.FindIndex(itSEA.Value()));
-    }
-
-    theErrors.push_back(anErr);
-  }
-
-  Standard_Integer nbBlocks = BLO.Extent();
-  if (nbBlocks == 0) {
-    isCompOfBlocks = Standard_False;
-    SetErrorCode(OK);
-    return isCompOfBlocks;
-  }
-  if (nbBlocks == 1) {
-    SetErrorCode(OK);
-    return isCompOfBlocks;
-  }
-
-  // Convert list of blocks into array for easy and fast access
-  Standard_Integer ibl = 1;
-  TopTools_Array1OfShape aBlocks (1, nbBlocks);
-  TopTools_ListIteratorOfListOfShape BLOit (BLO);
-  for (; BLOit.More(); BLOit.Next(), ibl++) {
-    aBlocks.SetValue(ibl, BLOit.Value());
-  }
-
-  // 2. Find relations between all blocks,
-  //    report connection errors (NOT_GLUED and INVALID_CONNECTION)
-  TColStd_Array2OfInteger aRelations (1, nbBlocks, 1, nbBlocks);
-  aRelations.Init(REL_NOT_CONNECTED);
-
-  Standard_Integer row = 1;
-  for (row = 1; row <= nbBlocks; row++) {
-    TopoDS_Shape aBlock = aBlocks.Value(row);
-
-    Standard_Integer col = row + 1;
-    for (; col <= nbBlocks; col++) {
-      Standard_Integer aRel = BlocksRelation(aBlock, aBlocks.Value(col));
-      if (aRel != REL_NOT_CONNECTED) {
-        aRelations.SetValue(row, col, aRel);
-        aRelations.SetValue(col, row, aRel);
-        if (aRel == REL_NOT_GLUED) {
-          // report connection error
-          isCompOfBlocks = Standard_False;
-          BCError anErr;
-          anErr.error = NOT_GLUED;
-          anErr.incriminated.push_back(anIndices.FindIndex(aBlocks.Value(row)));
-          anErr.incriminated.push_back(anIndices.FindIndex(aBlocks.Value(col)));
-          theErrors.push_back(anErr);
-        } else if (aRel == REL_COLLISION_VV ||
-                   aRel == REL_COLLISION_FF ||
-                   aRel == REL_COLLISION_EE ||
-                   aRel == REL_UNKNOWN) {
-          // report connection error
-          isCompOfBlocks = Standard_False;
-          BCError anErr;
-          anErr.error = INVALID_CONNECTION;
-          anErr.incriminated.push_back(anIndices.FindIndex(aBlocks.Value(row)));
-          anErr.incriminated.push_back(anIndices.FindIndex(aBlocks.Value(col)));
-          theErrors.push_back(anErr);
-        } else {
-        }
-      }
-    }
-  }
-
-  // 3. Find largest set of connected (good connection or not glued) blocks
-  TColStd_MapOfInteger aProcessedMap;
-  TColStd_MapOfInteger aLargestSet;
-  TColStd_MapOfInteger aCurrentSet;
-  for (ibl = 1; ibl <= nbBlocks; ibl++) {
-    if (!aProcessedMap.Contains(ibl)) {
-      aCurrentSet.Clear();
-      FindConnected(ibl, aRelations, aProcessedMap, aCurrentSet);
-      if (aCurrentSet.Extent() > aLargestSet.Extent()) {
-        aLargestSet = aCurrentSet;
-      }
-    }
-  }
-
-  // 4. Report all blocks, isolated from <aLargestSet>
-  BCError anErr;
-  anErr.error = NOT_CONNECTED;
-  Standard_Boolean hasIsolated = Standard_False;
-  for (ibl = 1; ibl <= nbBlocks; ibl++) {
-    if (!aLargestSet.Contains(ibl)) {
-      aProcessedMap.Clear();
-      if (!HasAnyConnection(ibl, aLargestSet, aRelations, aProcessedMap)) {
-        // report connection absence
-        hasIsolated = Standard_True;
-        anErr.incriminated.push_back(anIndices.FindIndex(aBlocks.Value(ibl)));
-      }
-    }
-  }
-  if (hasIsolated) {
-    isCompOfBlocks = Standard_False;
-    theErrors.push_back(anErr);
-  }
-
-  SetErrorCode(OK);
-  return isCompOfBlocks;
-}
-
 //=============================================================================
 /*!
  *  PrintBCErrors
@@ -2294,6 +2140,7 @@ TCollection_AsciiString GEOMImpl_IBlocksOperations::PrintBCErrors
 //=============================================================================
 Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocks
                                               (Handle(GEOM_Object) theCompound,
+                                               const Standard_Real theToleranceC1,
                                                std::list<BCError>& theErrors)
 {
   SetErrorCode(KO);
@@ -2312,7 +2159,7 @@ Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocks
   TopTools_ListOfShape EXT; // Hexahedral solids, having degenerated and/or seam edges
   TopTools_ListOfShape BLO; // All blocks from the given compound
   TopTools_ListOfShape NOQ; // All non-quadrangular faces
-  AddBlocksFrom(aBlockOrComp, BLO, NOT, EXT, NOQ);
+  AddBlocksFrom(aBlockOrComp, BLO, NOT, EXT, NOQ, theToleranceC1);
 
   // Report non-blocks
   if (NOT.Extent() > 0) {
@@ -2478,7 +2325,8 @@ Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocks
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetNonBlocks
-                                     (Handle(GEOM_Object) theShape,
+                                     (Handle(GEOM_Object)  theShape,
+                                      const Standard_Real  theToleranceC1,
                                       Handle(GEOM_Object)& theNonQuads)
 {
   SetErrorCode(KO);
@@ -2491,7 +2339,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetNonBlocks
   TopTools_ListOfShape NOT; // Not blocks
   TopTools_ListOfShape EXT; // Hexahedral solids, having degenerated and/or seam edges
   TopTools_ListOfShape NOQ; // All non-quadrangular faces
-  AddBlocksFrom(aShape, BLO, NOT, EXT, NOQ);
+  AddBlocksFrom(aShape, BLO, NOT, EXT, NOQ, theToleranceC1);
 
   if (NOT.IsEmpty() && EXT.IsEmpty() && NOQ.IsEmpty()) {
     SetErrorCode("NOT_FOUND_ANY");
index 8a03b6e23f5bc6d5c62958a1922e9e37d7e47f26..568872a083e0e260570349c79c1a5262b78979f7 100644 (file)
@@ -125,16 +125,15 @@ class GEOMImpl_IBlocksOperations : public GEOM_IOperations {
     std::list<int>   incriminated;
   };
 
-  Standard_EXPORT Standard_Boolean CheckCompoundOfBlocksOld (Handle(GEOM_Object) theCompound,
-                                                             std::list<BCError>& theErrors);
-
   Standard_EXPORT Standard_Boolean CheckCompoundOfBlocks (Handle(GEOM_Object) theCompound,
+                                                          const Standard_Real theToleranceC1,
                                                           std::list<BCError>& theErrors);
 
   Standard_EXPORT TCollection_AsciiString PrintBCErrors (Handle(GEOM_Object)       theCompound,
                                                          const std::list<BCError>& theErrors);
 
-  Standard_EXPORT Handle(GEOM_Object) GetNonBlocks (Handle(GEOM_Object) theShape,
+  Standard_EXPORT Handle(GEOM_Object) GetNonBlocks (Handle(GEOM_Object)  theShape,
+                                                    const Standard_Real  theToleranceC1,
                                                     Handle(GEOM_Object)& theNonQuads);
 
   Standard_EXPORT Handle(GEOM_Object) RemoveExtraEdges (Handle(GEOM_Object) theShape,
@@ -148,7 +147,8 @@ class GEOMImpl_IBlocksOperations : public GEOM_IOperations {
                                              TopTools_ListOfShape& BLO,
                                              TopTools_ListOfShape& NOT,
                                              TopTools_ListOfShape& EXT,
-                                             TopTools_ListOfShape& NOQ);
+                                             TopTools_ListOfShape& NOQ,
+                                             const Standard_Real  theToleranceC1 = -1.);
 
   // Extract blocks from blocks compounds
   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) ExplodeCompoundOfBlocks
index 06e354db2b5e74f5b3c65dd76d6ac0be95fe9c7f..c0284e7e26d74e548c12911153e82ce32545165a 100755 (executable)
@@ -24,7 +24,8 @@
 
 #include <TColStd_HArray1OfInteger.hxx>
 #include <TColStd_HArray1OfExtendedString.hxx>
-#include "TColStd_HSequenceOfTransient.hxx"
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <TopAbs.hxx>
 #include <ShHealOper_ModifStats.hxx>
 
 class GEOMImpl_IHealing
@@ -43,7 +44,7 @@ public:
     ARG_IS_BY_PARAMETER         =  9,
     ARG_SUBSHAPE_INDEX          = 10,
     ARG_LIST_SHAPES             = 11,
-    ARG_STATISTICS              =  4
+    ARG_TYPE                    = 12
   };
 
   GEOMImpl_IHealing(Handle(GEOM_Function) theFunction): _func(theFunction) {}
@@ -75,6 +76,9 @@ public:
   void SetTolerance( Standard_Real val ) { _func->SetReal(ARG_TOLERANCE, val); }
   Standard_Real GetTolerance() { return _func->GetReal(ARG_TOLERANCE); }
 
+  void SetType( TopAbs_ShapeEnum val ) { _func->SetInteger(ARG_TYPE, (Standard_Integer)val); }
+  TopAbs_ShapeEnum GetType() { TopAbs_ShapeEnum type = (TopAbs_ShapeEnum)(_func->GetInteger(ARG_TYPE)); return _func->IsDone() ? type : TopAbs_SHAPE; }
+
   void SetDevideEdgeValue( Standard_Real val ) { _func->SetReal(ARG_DEV_EDGE_VALUE, val); }
   Standard_Real GetDevideEdgeValue() { return _func->GetReal(ARG_DEV_EDGE_VALUE); }
 
@@ -94,12 +98,12 @@ public:
     return funs;
   }
 
-  void SetStatistics( ShHealOper_ModifStats * ms )
+  void SetStatistics( ShHealOper_ModifStats* ms )
   {
     if ( ms ) ms->Clear();
     _func->SetCallBackData( (void*) ms );
   }
-  ShHealOper_ModifStats * GetStatistics()
+  ShHealOper_ModifStats* GetStatistics()
   {
     return (ShHealOper_ModifStats*) _func->GetCallBackData();
   }
index 865867dac5a564a54f7fee39148eebbc7d9712ad..43aee783e670c9ca943f588d67d694e54730997f 100644 (file)
@@ -1175,7 +1175,8 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_IHealingOperations::LimitTolerance (Handle(GEOM_Object) theObject,
-                                                                 double theTolerance)
+                                                                 double theTolerance,
+                                                                 TopAbs_ShapeEnum theType)
 {
   // Set error code, check parameters
   SetErrorCode(KO);
@@ -1203,6 +1204,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::LimitTolerance (Handle(GEOM_Obj
   GEOMImpl_IHealing HI (aFunction);
   HI.SetOriginal(aLastFunction);
   HI.SetTolerance(theTolerance);
+  HI.SetType(theType);
   HI.SetStatistics( myModifStats );
 
   // Compute
index df2952a9a679709d473a993d2b08c0223235b4bc..af111fff0859a62c10e5b7f8ffe4bf741f44d63e 100644 (file)
@@ -27,6 +27,7 @@
 #include "GEOM_Engine.hxx"
 #include "GEOM_Object.hxx"
 
+#include <TopAbs.hxx>
 #include <TColStd_HArray1OfExtendedString.hxx>
 #include <TColStd_HArray1OfInteger.hxx>
 
@@ -102,7 +103,8 @@ class GEOMImpl_IHealingOperations : public GEOM_IOperations {
   Standard_EXPORT Handle(GEOM_Object) ChangeOrientationCopy( Handle(GEOM_Object) theObject);
 
   Standard_EXPORT Handle(GEOM_Object) LimitTolerance( Handle(GEOM_Object) theObject,
-                                                      double theTolerance );
+                                                      double theTolerance,
+                                                      TopAbs_ShapeEnum theType = TopAbs_SHAPE );
 
   const ShHealOper_ModifStats* GetStatistics() { return myModifStats; }
 
index 3d7601a7677560a757c5e473b92184bf4008e499..ae0103de6b828c5c38e69ce9285aa76962688d33 100644 (file)
@@ -20,6 +20,8 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <GEOMImpl_IMeasureOperations.hxx>
 #include <GEOMImpl_IMeasure.hxx>
 #include <GEOMImpl_MeasureDriver.hxx>
@@ -49,7 +51,9 @@
 #include <BRepClass3d_SolidClassifier.hxx>
 #include <BRepClass_FaceClassifier.hxx>
 #include <BRepExtrema_DistShapeShape.hxx>
+#if OCC_VERSION_LARGE > 0x06080000
 #include <BRepExtrema_ShapeProximity.hxx>
+#endif
 #include <BRepGProp.hxx>
 #include <BRepTools.hxx>
 #include <BRep_Tool.hxx>
@@ -1590,6 +1594,8 @@ bool GEOMImpl_IMeasureOperations::FastIntersect (Handle(GEOM_Object) theShape1,
   SetErrorCode(KO);
   bool isGood = false;
 
+#if OCC_VERSION_LARGE > 0x06080000
+
   if (theIntersections1.IsNull())
     theIntersections1 = new TColStd_HSequenceOfInteger;
   else
@@ -1657,8 +1663,11 @@ bool GEOMImpl_IMeasureOperations::FastIntersect (Handle(GEOM_Object) theShape1,
   if (aBSP.IsDone())
     SetErrorCode(OK);
 
+#endif // OCC_VERSION_LARGE > 0x06080000
+
   return isGood;
 }
+
 //=============================================================================
 /*!
  *  IsGoodForSolid
index 9f1ee5e88f8385ee1dfa53f0bb666246d041ab7f..da74684cba267292447d91ad69b57c501a0928cd 100644 (file)
@@ -121,6 +121,46 @@ namespace {
   }
 }
 
+namespace
+{
+  const double MAX_TOLERANCE = 1.e-7;
+
+  /**
+   * \brief Returns the vertex from theWhere shape that is coincident with
+   * theVertex.
+   *
+   * \param theWhere the shape where the coinsident vertex is searched.
+   * \param theVertex the vertex to be searched.
+   * \return the coincident vertex if it is found. Otherwise null object.
+   */
+  static TopoDS_Vertex getSameVertex(const TopoDS_Shape  &theWhere,
+                                     const TopoDS_Vertex &theVertex)
+  {
+    TopoDS_Vertex       aResult;
+    gp_Pnt              aPoint = BRep_Tool::Pnt(theVertex);
+    TopExp_Explorer     anExp(theWhere, TopAbs_VERTEX);
+    TopTools_MapOfShape aMap;
+    
+    for(; anExp.More(); anExp.Next()) {
+      const TopoDS_Shape &aLocalShape = anExp.Current();
+
+      if(!aMap.Add(aLocalShape)) {
+        continue;
+      }
+
+      TopoDS_Vertex aVertex = TopoDS::Vertex(aLocalShape);
+      gp_Pnt        aPoint2 = BRep_Tool::Pnt(aVertex);
+
+      if(aPoint.Distance(aPoint2) <= MAX_TOLERANCE) {
+        aResult = aVertex;
+        break;
+      }
+    }
+
+    return aResult;
+  }
+} // end of namespace
+
 //=============================================================================
 /*!
  *   constructor:
@@ -2951,6 +2991,44 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetShapesOnShapeAsCompound
   return aRes;
 }
 
+//=============================================================================
+/*!
+ *  GetSubShapeEdgeSorted
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+    GEOMImpl_IShapesOperations::GetSubShapeEdgeSorted
+                          (const Handle(GEOM_Object) &theShape,
+                           const Handle(GEOM_Object) &theStartPoint)
+{
+  // Get the sorted edges indices.
+  Handle(TColStd_HSequenceOfInteger) aSortedIDs =
+    getSubShapeEdgeSortedIDs(theShape, theStartPoint);
+
+  // Get object by indices.
+  TCollection_AsciiString              anAsciiList;
+  Handle(TColStd_HSequenceOfTransient) aSeq =
+    getObjectsShapesOn(theShape, aSortedIDs, anAsciiList);
+
+  if (aSeq.IsNull() || aSeq->IsEmpty()) {
+    SetErrorCode("Empty sequence of edges");
+    return NULL;
+  }
+
+  // Make a Python command
+  Handle(GEOM_Object)   anObj     =
+    Handle(GEOM_Object)::DownCast(aSeq->Value(1));
+  Handle(GEOM_Function) aFunction = anObj->GetLastFunction();
+
+  GEOM::TPythonDump(aFunction)
+    << "[" << anAsciiList.ToCString() << "] = geompy.GetSubShapeEdgeSorted("
+    << theShape << ", " << theStartPoint << ")";
+
+  SetErrorCode(OK);
+
+  return aSeq;
+}
+
 //=======================================================================
 //function : getShapesOnSurfaceIDs
   /*!
@@ -3092,6 +3170,152 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::
   return aSeq;
 }
 
+//=============================================================================
+/*!
+ *  getSubShapeEdgeSortedIDs
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfInteger)
+    GEOMImpl_IShapesOperations::getSubShapeEdgeSortedIDs
+                               (const Handle(GEOM_Object) &theShape,
+                                const Handle(GEOM_Object) &theStartPoint)
+{
+  Handle(TColStd_HSequenceOfInteger) aResult;
+
+  if (theShape.IsNull() || theStartPoint.IsNull()) {
+    SetErrorCode("NULL GEOM object");
+    return aResult;
+  }
+
+  const TopoDS_Shape aShape      = theShape->GetValue();
+  const TopoDS_Shape aStartPoint = theStartPoint->GetValue();
+
+  if (aShape.IsNull() || aStartPoint.IsNull()) {
+    SetErrorCode("NULL Shape");
+    return aResult;
+  }
+
+  if (aStartPoint.ShapeType() != TopAbs_VERTEX) {
+    SetErrorCode("Starting point is not a vertex");
+    return aResult;
+  }
+
+  TopExp_Explorer      anExp(aShape, TopAbs_EDGE);
+  TopTools_MapOfShape  aMapFence;
+  TopTools_ListOfShape anEdges;
+
+  for (; anExp.More(); anExp.Next()) {
+    const TopoDS_Shape &anEdge = anExp.Current();
+
+    if (aMapFence.Add(anEdge)) {
+      anEdges.Append(anEdge);
+    }
+  }
+
+  if (anEdges.IsEmpty()) {
+    SetErrorCode("Shape doesn't contain edges");
+    return aResult;
+  }
+
+  // Step 1: Sort edges
+  GEOMUtils::SortShapes(anEdges, Standard_False);
+
+  TopTools_ListIteratorOfListOfShape anIter(anEdges);
+  TopoDS_Vertex                      aV[2];
+  TopTools_DataMapOfShapeListOfShape aMapVE;
+
+  // Step 2: Fill the map vertex - list of edges.
+  for (; anIter.More(); anIter.Next()) {
+    TopoDS_Edge anEdge = TopoDS::Edge(anIter.Value());
+
+    TopExp::Vertices(anEdge, aV[0], aV[1]);
+
+    const Standard_Integer aNbV = aV[0].IsSame(aV[1]) ? 1 : 2;
+    Standard_Integer       i;
+
+    for (i = 0; i < aNbV; ++i) {
+      if (aV[i].IsNull() == Standard_False) {
+        if (!aMapVE.IsBound(aV[i])) {
+          // There is no this vertex in the map.
+          aMapVE.Bind(aV[i], TopTools_ListOfShape());
+        }
+
+        // Add the edge to the list bound with the vertex aV[i].
+        TopTools_ListOfShape &aLEdges = aMapVE.ChangeFind(aV[i]);
+
+        aLEdges.Append(anEdge);
+      }
+    }
+  }
+
+  // Step 3: Find starting point in aMapVE.
+  TopoDS_Vertex aStartVtx = TopoDS::Vertex(aStartPoint);
+
+  if (!aMapVE.IsBound(aStartVtx)) {
+    aStartVtx = getSameVertex(aShape, aStartVtx);
+
+    if (aStartVtx.IsNull()) {
+      SetErrorCode("Invalid Starting point");
+      return aResult;
+    }
+  }
+
+  TopTools_IndexedMapOfShape anIndices;
+  TopTools_MapOfShape        aMapVFence;
+  TopoDS_Shape               aCurVtx  = aStartVtx;
+  TopoDS_Edge                aCurEdge =
+    TopoDS::Edge(aMapVE.Find(aCurVtx).First());
+
+  aResult = new TColStd_HSequenceOfInteger;
+  TopExp::MapShapes(aShape, anIndices);
+
+  // Step 4: Fill the list of sorted edges.
+  while (aMapVFence.Add(aCurVtx)) {
+    // Append the ID of the current edge to the list of sorted.
+    aResult->Append(anIndices.FindIndex(aCurEdge));
+    TopExp::Vertices(aCurEdge, aV[0], aV[1]);
+
+    // Get the next vertex.
+    if (aCurVtx.IsSame(aV[0])) {
+      if (aCurVtx.IsSame(aV[1])) {
+        // There is no next vertex.
+        break;
+      } else {
+        aCurVtx = aV[1];
+      }
+    } else {
+      aCurVtx = aV[0];
+    }
+
+    if (aCurVtx.IsNull()) {
+      // There is no next vertex.
+      break;
+    }
+
+    // Get the next edge.
+    const TopTools_ListOfShape         &aLEdges = aMapVE.Find(aCurVtx);
+    TopTools_ListIteratorOfListOfShape  anEIter(aLEdges);
+
+    for (; anEIter.More(); anEIter.Next()) {
+      const TopoDS_Shape &aLocalEdge = anEIter.Value();
+
+      if (aLocalEdge.IsNull() == Standard_False) {
+        if (!aCurEdge.IsSame(aLocalEdge)) {
+          aCurEdge = TopoDS::Edge(aLocalEdge);
+          break;
+        }
+      }
+    }
+
+    if (!anEIter.More()) {
+      // There is no next edge.
+      break;
+    }
+  }
+
+  return aResult;
+}
+
 //=======================================================================
 //function : getShapesOnSurface
 /*!
@@ -4220,8 +4444,6 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceByHistory
   return aResult;
 }
 
-#define MAX_TOLERANCE 1.e-7
-
 //=======================================================================
 //function : isSameEdge
 //purpose  : Returns True if two edges coincide
@@ -4473,17 +4695,8 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetSame(const Handle(GEOM_Object
 
   switch (aWhat.ShapeType()) {
     case TopAbs_VERTEX: {
-      gp_Pnt P = BRep_Tool::Pnt(TopoDS::Vertex(aWhat));
-      TopExp_Explorer E(aWhere, TopAbs_VERTEX);
-      for(; E.More(); E.Next()) {
-        if(!aMap.Add(E.Current())) continue;
-        gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(E.Current()));
-        if(P.Distance(P2) <= MAX_TOLERANCE) {
-          isFound = true;
-          aSubShape = E.Current();
-          break;
-        }
-      }
+      aSubShape = getSameVertex(aWhere, TopoDS::Vertex(aWhat));
+      isFound   = !aSubShape.IsNull();
       break;
                         }
     case TopAbs_EDGE: {
index 002f338e611bd1b2d54a1d88b7fff0279f97088e..0b767615fbbdc26fd513cb426fe760cf90fe91a3 100644 (file)
@@ -388,21 +388,66 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
                                        const Standard_Integer theShapeType,
                                        GEOMAlgo_State theState);
 
+  /*!
+   * \brief Resize the input edge with the new Min and Max parameters.
+   * The input edge parameters range is [0, 1]. If theMin parameter is
+   * negative, the input edge is extended, otherwise it is shrinked by
+   * theMin parameter. If theMax is greater than 1, the edge is extended,
+   * otherwise it is shrinked by theMax parameter
+   * \param theEdge the input edge to be resized
+   * \param theMin the minimal parameter value
+   * \param theMax the maximal parameter value
+   * \retval Handle(GEOM_Object) - newly created edge
+   */
   Standard_EXPORT Handle(GEOM_Object)
-                            ExtendEdge(const Handle(GEOM_Object) &theEdge,
+                            ExtendEdge(const Handle(GEOM_Object)theEdge,
                                        const Standard_Real        theMin,
                                        const Standard_Real        theMax);
 
+  /*!
+   * \brief Resize the input face with the new UMin, UMax, VMin and VMax
+   * parameters. The input face U and V parameters range is [0, 1]. If
+   * theUMin parameter is negative, the input face is extended, otherwise
+   * it is shrinked along U direction by theUMin parameter. If theUMax is
+   * greater than 1, the face is extended, otherwise it is shrinked along
+   * U direction by theUMax parameter. So as for theVMin, theVMax and
+   * V direction of the input face.
+   * \param theFace the input face to be resized
+   * \param theUMin the minimal U parameter value
+   * \param theUMax the maximal U parameter value
+   * \param theVMin the minimal V parameter value
+   * \param theVMax the maximal V parameter value
+   * \retval Handle(GEOM_Object) - newly created face
+   */
   Standard_EXPORT Handle(GEOM_Object)
-                            ExtendFace(const Handle(GEOM_Object) &theFace,
+                            ExtendFace(const Handle(GEOM_Object)theFace,
                                        const Standard_Real        theUMin,
                                        const Standard_Real        theUMax,
                                        const Standard_Real        theVMin,
                                        const Standard_Real        theVMax);
-
+  
+  /*!
+   * \brief Make a surface from a face. This function takes some face as
+   * input parameter and creates new GEOM_Object, i.e. topological shape
+   * by extracting underlying surface of the source face and limiting it
+   * by the Umin, Umax, Vmin, Vmax parameters of the source face (in the
+   * parametrical space).
+   * \param theFace the input face
+   * \retval Handle(GEOM_Object) - newly created face
+   */
   Standard_EXPORT Handle(GEOM_Object)
                    MakeSurfaceFromFace(const Handle(GEOM_Object) &theFace);
 
+  /*!
+   * \brief Explode a shape into edges sorted in a row from a starting point.
+   * \param theShape - the shape to be exploded on edges.
+   * \param theStartPoint - the starting point.
+   * \return Ordered list of edges sorted in a row from a starting point.
+   */
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
+    GetSubShapeEdgeSorted (const Handle(GEOM_Object) &theShape,
+                           const Handle(GEOM_Object) &theStartPoint);
+
  private:
   Handle(GEOM_Object) MakeShape (std::list<Handle(GEOM_Object)>      theShapes,
                                  const Standard_Integer         theObjectType,
@@ -525,6 +570,16 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
                        const Handle(TColStd_HSequenceOfInteger)& theShapeIDs,
                        TCollection_AsciiString &                 theShapeEntries);
 
+  /*!
+   * \brief Explode a shape into edges sorted in a row from a starting point.
+   * \param theShape - the shape to be exploded on edges.
+   * \param theStartPoint - the starting point.
+   * \return Ordered list of edges sorted in a row from a starting point.
+   */
+  Handle(TColStd_HSequenceOfInteger) getSubShapeEdgeSortedIDs
+                                (const Handle(GEOM_Object) &theShape,
+                                 const Handle(GEOM_Object) &theStartPoint);
+
   /*!
    * \brief Select the object created last
    * \param theObj1 - Object 1
index fe5bb0580489bc72fdd2d47750271e77cc389b10..7475b4a3405a69e7f02ad9a9243d2fe851157d48 100644 (file)
 #include <GEOMImpl_IOffset.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
+#include <GEOMUtils.hxx>
 
 #include <BRepOffsetAPI_MakeOffsetShape.hxx>
-#include <BRep_Tool.hxx>
-#include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
-#include <TopoDS_Vertex.hxx>
 #include <TopAbs.hxx>
-#include <TopExp.hxx>
-
 #include <BRepClass3d_SolidClassifier.hxx>
-
 #include <Precision.hxx>
-#include <gp_Pnt.hxx>
-
-#include <BRepCheck_Analyzer.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <ShapeFix_Shape.hxx>
-
 #include <Standard_ConstructionError.hxx>
 #include <StdFail_NotDone.hxx>
 
-#include "utilities.h"
-
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -59,7 +46,6 @@ const Standard_GUID& GEOMImpl_OffsetDriver::GetID()
   return aOffsetDriver;
 }
 
-
 //=======================================================================
 //function : GEOMImpl_OffsetDriver
 //purpose  :
@@ -100,20 +86,8 @@ Standard_Integer GEOMImpl_OffsetDriver::Execute(TFunction_Logbook& log) const
                                       aTol);
     if (MO.IsDone()) {
       aShape = MO.Shape();
-      // 23.04.2010 skl for bug 21699 from Mantis
-      BRepCheck_Analyzer ana (aShape, Standard_True);
-      ana.Init(aShape);
-      if (!ana.IsValid()) {
-        ShapeFix_ShapeTolerance aSFT;
-        aSFT.LimitTolerance(aShape, Precision::Confusion(),
-                            Precision::Confusion(), TopAbs_SHAPE);
-        Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-        aSfs->Perform();
-        aShape = aSfs->Shape();
-        ana.Init(aShape);
-        if (!ana.IsValid())
-          Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result");
-      }
+      if ( !GEOMUtils::CheckShape(aShape, true) && !GEOMUtils::FixShapeTolerance(aShape) )
+        Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result");
     }
     else {
       StdFail_NotDone::Raise("Offset construction failed");
index c50b0a86addd27bcd9770953af2552b8dcb9e9b0..9b49bfeaf9ae42adb61a1d61b3a08e97b9c70280 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_PartitionDriver.hxx>
 #include <GEOMImpl_IPartition.hxx>
 #include <GEOMImpl_Types.hxx>
-
+#include <GEOMUtils.hxx>
 #include <GEOM_Object.hxx>
 #include <GEOM_Function.hxx>
-
 #include <GEOMAlgo_Splitter.hxx>
 
 #include <TDataStd_IntegerArray.hxx>
 #include <TNaming_CopyShape.hxx>
 
-//#include <BRepBuilderAPI_Copy.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepAlgo.hxx>
-#include <BRepTools.hxx>
-
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
-#include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <TopoDS_Wire.hxx>
 #include <TopoDS_Iterator.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <TopTools_DataMapOfShapeShape.hxx>
 
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <ShapeFix_Shape.hxx>
-
 #include <TColStd_IndexedDataMapOfTransientTransient.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <TColStd_ListOfInteger.hxx>
 #include <Standard_NullObject.hxx>
 #include <StdFail_NotDone.hxx>
-#include <Precision.hxx>
-#include <gp_Pnt.hxx>
 #include <BOPAlgo_CheckerSI.hxx>
 #include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
 #include <BOPCol_ListOfShape.hxx>
@@ -444,17 +426,8 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const
     Standard_ConstructionError::Raise("Partition aborted : non valid shape result");
   //end of IPAL21418
 
-  if (!BRepAlgo::IsValid(aShape)) {
-    // 08.07.2008 added by skl during fixing bug 19761 from Mantis
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape, Precision::Confusion(),
-                        Precision::Confusion(), TopAbs_SHAPE);
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-    if (!BRepAlgo::IsValid(aShape))
-      Standard_ConstructionError::Raise("Partition aborted : non valid shape result");
-  }
+  if ( !GEOMUtils::CheckShape(aShape, true) && !GEOMUtils::FixShapeTolerance(aShape) )
+    Standard_ConstructionError::Raise("Partition aborted : non valid shape result");
 
   aFunction->SetValue(aShape);
 
index 5f580ddb95ef9f38a6fdeb56811dbe0045affe50..a3f4c388a1fd1fdceeb0543aef05a5cbe38c229c 100644 (file)
@@ -38,8 +38,6 @@
 #include <ShapeAnalysis_Edge.hxx>
 #include <ShapeFix_Face.hxx>
 #include <ShapeFix_Shell.hxx>
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
 
 #include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
@@ -47,7 +45,6 @@
 #include <BRepBuilderAPI_MakeFace.hxx>
 #include <BRepBuilderAPI_MakeWire.hxx>
 #include <BRepBuilderAPI_Sewing.hxx>
-#include <BRepCheck_Analyzer.hxx>
 #include <BRepGProp.hxx>
 #include <GeomFill_Trihedron.hxx>
 #include <GeomFill_CorrectedFrenet.hxx>
@@ -2573,19 +2570,8 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
 
   if (aShape.IsNull()) return 0;
 
-  BRepCheck_Analyzer ana (aShape, Standard_False);
-  if (!ana.IsValid()) {
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape,Precision::Confusion(),Precision::Confusion());
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->SetPrecision(Precision::Confusion());
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-
-    ana.Init(aShape, Standard_False);
-    if (!ana.IsValid())
-      Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
-  }
+  if ( !GEOMUtils::CheckShape(aShape) && !GEOMUtils::FixShapeTolerance(aShape) ) 
+    Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
 
   if (aType != PIPE_BASE_PATH &&
       aType != PIPE_SHELLS_WITHOUT_PATH) {
index 25bf5cdffc87750b8b91688960aaeccfaf42ed30..f52d340f22d740bcabc379cae30f8d1904229d66 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
-#include <Basics_OCCTVersion.hxx>
-
 #include <GEOMImpl_PipePathDriver.hxx>
-
-#include <GEOMImpl_IShapesOperations.hxx>
 #include <GEOMImpl_ShapeDriver.hxx>
 #include <GEOMImpl_IPipePath.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
 
-#include <ShapeAnalysis_FreeBounds.hxx>
-#include <ShapeAnalysis_Edge.hxx>
-#include <ShapeFix_Face.hxx>
-#include <ShapeFix_Shell.hxx>
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-
-#include <BRep_Tool.hxx>
-#include <BRep_Builder.hxx>
-#include <BRepBuilderAPI_Copy.hxx>
-#include <BRepBuilderAPI_MakeFace.hxx>
-#include <BRepBuilderAPI_MakeWire.hxx>
-#include <BRepBuilderAPI_Sewing.hxx>
-#include <BRepCheck_Analyzer.hxx>
-#include <BRepGProp.hxx>
-#include <BRepOffsetAPI_MakePipe.hxx>
-#include <BRepOffsetAPI_MakePipeShell.hxx>
-
 #include <BRepOffsetAPI_MiddlePath.hxx>
-
-#include <TopAbs.hxx>
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Wire.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Solid.hxx>
-#include <TopoDS_Shell.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Compound.hxx>
-#include <TopTools_SequenceOfShape.hxx>
-#include <TopTools_HSequenceOfShape.hxx>
-#include <TopTools_IndexedDataMapOfShapeShape.hxx>
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-
-#include <GProp_GProps.hxx>
-
-#include <GeomAPI_ProjectPointOnCurve.hxx>
-#include <GeomAPI_Interpolate.hxx>
-#include <Geom_TrimmedCurve.hxx>
-#include <Geom_Plane.hxx>
-#include <Geom_RectangularTrimmedSurface.hxx>
-#include <Geom_BezierSurface.hxx>
-#include <Geom_Line.hxx>
-#include <Geom_Conic.hxx>
-#include <Geom_BSplineCurve.hxx>
-#include <Geom_BSplineSurface.hxx>
-#include <GeomFill_BSplineCurves.hxx>
-#include <GeomConvert_ApproxCurve.hxx>
-#include <GeomConvert.hxx>
-
-#include <TColgp_SequenceOfPnt.hxx>
-#include <TColgp_HArray1OfPnt.hxx>
-#include <TColgp_Array2OfPnt.hxx>
 #include <TColStd_HSequenceOfTransient.hxx>
-
 #include <Precision.hxx>
-
 #include <Standard_NullObject.hxx>
-#include <Standard_TypeMismatch.hxx>
-#include <Standard_ConstructionError.hxx>
-
-#include "utilities.h"
 
 //=======================================================================
 //function : GetID
index 3525ed57b489258e6e4bdb61a57893f28f36368c..9cc1d62653280f78c04156ed6ed08669b180990f 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_ScaleDriver.hxx>
 #include <GEOMImpl_IScale.hxx>
 #include <GEOMImpl_Types.hxx>
+#include <GEOMUtils.hxx>
 #include <GEOM_Function.hxx>
 
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-
 #include <BRepBuilderAPI_Transform.hxx>
 #include <BRepBuilderAPI_GTransform.hxx>
 #include <BRep_Tool.hxx>
-#include <BRepAlgo.hxx>
-#include <BRepCheck_Analyzer.hxx>
 
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
-#include <TopoDS_Vertex.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 
 #include <Precision.hxx>
@@ -175,19 +168,8 @@ Standard_Integer GEOMImpl_ScaleDriver::Execute(TFunction_Logbook& log) const
 
   if (aShape.IsNull()) return 0;
 
-  BRepCheck_Analyzer ana (aShape, Standard_False);
-  if (!ana.IsValid()) {
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape,Precision::Confusion(),Precision::Confusion());
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->SetPrecision(Precision::Confusion());
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-
-    ana.Init(aShape, Standard_False);
-    if (!ana.IsValid())
-      Standard_ConstructionError::Raise("Scaling aborted : algorithm has produced an invalid shape result");
-  }
+  if ( !GEOMUtils::CheckShape(aShape) && !GEOMUtils::FixShapeTolerance(aShape) )
+    Standard_ConstructionError::Raise("Scaling aborted : algorithm has produced an invalid shape result");
 
   aFunction->SetValue(aShape);
 
index d4df6a4b6ca5c99e1298422a3948023084b00dbe..367587691cdaccc45af333fabaa3fba932f2fa73 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_ThruSectionsDriver.hxx>
 #include <GEOMImpl_IThruSections.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
+#include <GEOMUtils.hxx>
 
 #include <TColStd_HSequenceOfTransient.hxx>
 #include <Precision.hxx>
-#include <BRepCheck_Analyzer.hxx>
 #include <BRepOffsetAPI_ThruSections.hxx>
 #include <BRepBuilderAPI_MakeWire.hxx>
-#include <TopExp_Explorer.hxx>
 #include <TopoDS.hxx>
 
 #include <TopAbs.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Shape.hxx>
 
-#include <Standard_NullObject.hxx>
 #include <Standard_TypeMismatch.hxx>
 #include <Standard_ConstructionError.hxx>
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <Precision.hxx>
+
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -132,21 +126,11 @@ Standard_Integer GEOMImpl_ThruSectionsDriver::Execute(TFunction_Logbook& log) co
     return 0;
   }
 
-  BRepCheck_Analyzer ana (aShape, Standard_False);
-  if (!ana.IsValid()) {
+  if ( !GEOMUtils::CheckShape(aShape) && !GEOMUtils::FixShapeTolerance(aShape) ) {
     //algoritm thru section creats on the arcs invalid shapes gka
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape,Precision::Confusion(),Precision::Confusion());
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->SetPrecision(Precision::Confusion());
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-    //ana.Init(aShape, Standard_False);
-    //if (!ana.IsValid()) 
     //  Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
   }
 
-
   aFunction->SetValue(aShape);
 
   log.SetTouched(Label());
index 0fab3342e8b7ca3a9701bef35dec34349588f5b2..cb67a9ec09b3943309f4f968cd7da4059d66ff04 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_TranslateDriver.hxx>
 #include <GEOMImpl_ITranslate.hxx>
-#include <GEOMImpl_ITransformOperations.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
 #include <GEOMUtils.hxx>
 
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-
 #include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
-#include <BRepCheck_Analyzer.hxx>
-#include <BRepBuilderAPI_Transform.hxx>
 
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
@@ -43,8 +35,6 @@
 #include <TopoDS_Compound.hxx>
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <TopoDS_Edge.hxx>
 
 #include <gp_Trsf.hxx>
 #include <gp_Pnt.hxx>
@@ -197,7 +187,6 @@ Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const
       B.Add(aCompound, anOriginal.Located(aLocRes));
     }
     aShape = aCompound;
-    //aShape = GEOMImpl_ITransformOperations::TranslateShape1D(anOriginal, &TI);
   }
   else if (aType == TRANSLATE_2D) {
     Standard_Integer nbtimes1 = TI.GetNbIter1(), nbtimes2 = TI.GetNbIter2();
@@ -242,25 +231,13 @@ Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const
       }
     }
     aShape = aCompound;
-    //aShape = GEOMImpl_ITransformOperations::TranslateShape2D(anOriginal, &TI);
   }
   else return 0;
 
   if (aShape.IsNull()) return 0;
 
-  BRepCheck_Analyzer ana (aShape, Standard_True);
-  if (!ana.IsValid()) {
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape,Precision::Confusion(),Precision::Confusion());
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->SetPrecision(Precision::Confusion());
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-
-    ana.Init(aShape, Standard_False);
-    if (!ana.IsValid())
-      Standard_ConstructionError::Raise("Scaling aborted : algorithm has produced an invalid shape result");
-  }
+  if ( !GEOMUtils::CheckShape(aShape, true) && !GEOMUtils::FixShapeTolerance(aShape) )
+    Standard_ConstructionError::Raise("Scaling aborted : algorithm has produced an invalid shape result");
 
   aFunction->SetValue(aShape);
 
index f123e4fefc208c772bd2bc01c3325aa208146ba0..4c7d2a55c3b1f7db6be5b889f96ad65c8889a4f7 100644 (file)
 
 #include <Standard_ConstructionError.hxx>
 
+namespace
+{
+  Handle(GEOM_Object) GetOwner( const TDF_Label& l )
+  {
+    TDF_Label label = l;
+    // object is stored on a grandfather label of a driver label
+    if ( !label.IsNull() )
+      label = label.Father();
+    if ( !label.IsNull() )
+      label = label.Father();
+    
+    return GEOM_Object::GetObject( label );
+  }
+}
+
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -179,8 +194,7 @@ GetCreationInformation(std::string&             theOperationName,
     AddParam( theParams, "Dz", aCI.GetDZ() );
     break;
   case VECTOR_TWO_PNT: {
-    TDF_Label label = Label();
-    Handle(GEOM_Object) obj = GEOM_Object::GetObject( label );
+    Handle(GEOM_Object) obj = GetOwner( Label() );
     if ( !obj.IsNull() && obj->GetType() == GEOM_EDGE )
       theOperationName = "EDGE";
     else
index fdd98a68658728819c5b6b482b088f0603749a53..db3037eac13ce6be780078c5c7e0fa56f54e80ca 100755 (executable)
@@ -42,6 +42,7 @@ SET(_link_LIBRARIES
   ${CAS_TKG3d}
   ${CAS_TKV3d}
   ${CAS_TKGeomBase}
+  ${CAS_TKBO}
   ${LIBXML2_LIBRARIES}
   ${KERNEL_SALOMELocalTrace}
   )
index 5b5cc2574a167a061354e90e033e212f285b127f..75fa4b94b3784e8d888f739f2a41bfdb7872fe06 100644 (file)
@@ -26,7 +26,6 @@
 
 #include <Basics_OCCTVersion.hxx>
 
-#include <utilities.h>
 #include <OpUtil.hxx>
 #include <Utils_ExceptHandlers.hxx>
 
 #include <BRepClass3d_SolidClassifier.hxx>
 
 #include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRepBuilderAPI_Sewing.hxx>
+
+#include <BRepCheck_Analyzer.hxx>
 
 #include <Bnd_Box.hxx>
 
+#include <BOPTools_AlgoTools.hxx>
+
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
 #include <TopoDS.hxx>
 
 #include <ShapeAnalysis.hxx>
 #include <ShapeFix_Shape.hxx>
+#include <ShapeFix_ShapeTolerance.hxx>
 
 #include <ProjLib.hxx>
 #include <ElSLib.hxx>
 
 #include <vector>
 #include <sstream>
+#include <algorithm>
 
 #include <Standard_Failure.hxx>
 #include <Standard_NullObject.hxx>
 
 #define STD_SORT_ALGO 1
 
+// When the following macro is defined, ShapeFix_ShapeTolerance function is used to set max tolerance of curve
+// in GEOMUtils::FixShapeCurves function; otherwise less restrictive BRep_Builder::UpdateEdge/UpdateVertex
+// approach is used
+// VSR (29/12/2014): macro disabled
+//#define USE_LIMIT_TOLERANCE
+
 namespace
 {
   /**
@@ -112,7 +124,6 @@ namespace
                                TopoDS_Shape  &theModifiedShape,
                                Standard_Real &theAddDist)
   {
-    Standard_Boolean isModified = Standard_False;
     TopExp_Explorer anExp;
     int nbf = 0;
 
@@ -136,80 +147,74 @@ namespace
         const Standard_Boolean isShell =
           (sh.ShapeType()==TopAbs_SHELL || sh.ShapeType()==TopAbs_FACE);
 
-        if( isShell || S->IsUPeriodic() ) {
-          // non solid case or any periodic surface (Mantis 22454).
-          double U1,U2,V1,V2;
-          // changes for 0020677: EDF 1219 GEOM: MinDistance gives 0 instead of 20.88
-          //S->Bounds(U1,U2,V1,V2); changed by
-          ShapeAnalysis::GetFaceUVBounds(TopoDS::Face(theModifiedShape),U1,U2,V1,V2);
-          // end of changes for 020677 (dmv)
-          Handle(Geom_RectangularTrimmedSurface) TrS1 =
-            new Geom_RectangularTrimmedSurface(S,U1,(U1+U2)/2.,V1,V2);
-          Handle(Geom_RectangularTrimmedSurface) TrS2 =
-            new Geom_RectangularTrimmedSurface(S,(U1+U2)/2.,U2,V1,V2);
+        if ( !isShell && S->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ) {
+          Handle(Geom_SphericalSurface) SS = Handle(Geom_SphericalSurface)::DownCast(S);
+          gp_Pnt PC = SS->Location();
           BRep_Builder B;
-          TopoDS_Face F1,F2;
-          TopoDS_Shape aMShape;
-
-          if (isShell) {
-            B.MakeCompound(TopoDS::Compound(aMShape));
-          } else {
-            B.MakeShell(TopoDS::Shell(aMShape));
-          }
-
-          B.MakeFace(F1,TrS1,1.e-7);
-          B.Add(aMShape,F1);
-          B.MakeFace(F2,TrS2,1.e-7);
-          B.Add(aMShape,F2);
-          Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape;
-
-          if (!isShell) {
-            // The original shape is a solid.
-            TopoDS_Solid aSolid;
-
-            B.MakeSolid(aSolid);
-            B.Add(aSolid, aMShape);
-            aMShape = aSolid;
-          }
-
-          sfs->Init(aMShape);
-          sfs->SetPrecision(1.e-6);
-          sfs->SetMaxTolerance(1.0);
-          sfs->Perform();
-          theModifiedShape = sfs->Shape();
-          isModified = Standard_True;
+          TopoDS_Vertex V;
+          B.MakeVertex(V,PC,1.e-7);
+          theModifiedShape = V;
+          theAddDist = SS->Radius();
+          return Standard_True;
         }
-        else {
-          if( S->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ) {
-            Handle(Geom_SphericalSurface) SS = Handle(Geom_SphericalSurface)::DownCast(S);
-            gp_Pnt PC = SS->Location();
-            BRep_Builder B;
-            TopoDS_Vertex V;
-            B.MakeVertex(V,PC,1.e-7);
-            theModifiedShape = V;
-            theAddDist = SS->Radius();
-            isModified = Standard_True;
-          }
-          else {
-            Handle(Geom_ToroidalSurface) TS = Handle(Geom_ToroidalSurface)::DownCast(S);
-            gp_Ax3 ax3 = TS->Position();
-            Handle(Geom_Circle) C = new Geom_Circle(ax3.Ax2(),TS->MajorRadius());
-            BRep_Builder B;
-            TopoDS_Edge E;
-            B.MakeEdge(E,C,1.e-7);
-            theModifiedShape = E;
-            theAddDist = TS->MinorRadius();
-            isModified = Standard_True;
-          }
+        if ( !isShell && S->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)) ) {
+          Handle(Geom_ToroidalSurface) TS = Handle(Geom_ToroidalSurface)::DownCast(S);
+          gp_Ax3 ax3 = TS->Position();
+          Handle(Geom_Circle) C = new Geom_Circle(ax3.Ax2(),TS->MajorRadius());
+          BRep_Builder B;
+          TopoDS_Edge E;
+          B.MakeEdge(E,C,1.e-7);
+          theModifiedShape = E;
+          theAddDist = TS->MinorRadius();
+          return Standard_True;
         }
-      } else {
-        theModifiedShape = theShape;
+
+        // non solid case or any periodic surface (Mantis 22454).
+        double U1,U2,V1,V2;
+        // changes for 0020677: EDF 1219 GEOM: MinDistance gives 0 instead of 20.88
+        //S->Bounds(U1,U2,V1,V2); changed by
+        ShapeAnalysis::GetFaceUVBounds(TopoDS::Face(theModifiedShape),U1,U2,V1,V2);
+        // end of changes for 020677 (dmv)
+        Handle(Geom_RectangularTrimmedSurface) TrS1 =
+          new Geom_RectangularTrimmedSurface(S,U1,(U1+U2)/2.,V1,V2);
+        Handle(Geom_RectangularTrimmedSurface) TrS2 =
+          new Geom_RectangularTrimmedSurface(S,(U1+U2)/2.,U2,V1,V2);
+        TopoDS_Shape aMShape;
+        
+        TopoDS_Face F1 = BRepBuilderAPI_MakeFace(TrS1, Precision::Confusion());
+        TopoDS_Face F2 = BRepBuilderAPI_MakeFace(TrS2, Precision::Confusion());
+        
+        if (isShell) {
+          BRep_Builder B;
+          B.MakeCompound(TopoDS::Compound(aMShape));
+          B.Add(aMShape, F1);
+          B.Add(aMShape, F2);
+        } else {
+          // The original shape is a solid.
+          BRepBuilderAPI_Sewing aSewing (Precision::Confusion()*10.0);
+          aSewing.Add(F1);
+          aSewing.Add(F2);
+          aSewing.Perform();
+          aMShape = aSewing.SewedShape();
+          BRep_Builder B;
+          TopoDS_Solid aSolid;
+          B.MakeSolid(aSolid);
+          B.Add(aSolid, aMShape);
+          aMShape = aSolid;
+        }
+        
+        Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape;
+        sfs->Init(aMShape);
+        sfs->SetPrecision(1.e-6);
+        sfs->SetMaxTolerance(1.0);
+        sfs->Perform();
+        theModifiedShape = sfs->Shape();
+        return Standard_True;
       }
     }
-    else
-      theModifiedShape = theShape;
-
-    return isModified;
+    
+    theModifiedShape = theShape;
+    return Standard_False;
   }
 
   void parseWard( const GEOMUtils::LevelsList &theLevelList, std::string &treeStr )
@@ -1039,19 +1044,19 @@ gp_Pnt GEOMUtils::ConvertClickToPoint( int x, int y, Handle(V3d_View) aView )
 // function : ConvertTreeToString()
 // purpose  : Returns the string representation of dependency tree
 //=======================================================================
-void GEOMUtils::ConvertTreeToString( const TreeModel &tree,
-                                     std::string &treeStr )
+void GEOMUtils::ConvertTreeToString( const TreeModeltree,
+                                     std::string& dependencyStr )
 {
   TreeModel::const_iterator i;
   for ( i = tree.begin(); i != tree.end(); ++i ) {
-    treeStr.append( i->first );
-    treeStr.append( "-" );
+    dependencyStr.append( i->first );
+    dependencyStr.append( "-" );
     std::vector<LevelInfo> upLevelList = i->second.first;
-    treeStr.append( "upward" );
-    parseWard( upLevelList, treeStr );
+    dependencyStr.append( "upward" );
+    parseWard( upLevelList, dependencyStr );
     std::vector<LevelInfo> downLevelList = i->second.second;
-    treeStr.append( "downward" );
-    parseWard( downLevelList, treeStr );
+    dependencyStr.append( "downward" );
+    parseWard( downLevelList, dependencyStr );
   }
 }
 
@@ -1059,23 +1064,113 @@ void GEOMUtils::ConvertTreeToString( const TreeModel &tree,
 // function : ConvertStringToTree()
 // purpose  : Returns the dependency tree
 //=======================================================================
-void GEOMUtils::ConvertStringToTree( const std::string &theData,
-                                     TreeModel &tree )
+void GEOMUtils::ConvertStringToTree( const std::string& dependencyStr,
+                                     TreeModeltree )
 {
   std::size_t cursor = 0;
 
-  while( theData.find('-',cursor) != std::string::npos ) //find next selected object
+  while( dependencyStr.find('-',cursor) != std::string::npos ) //find next selected object
   {
-    std::size_t objectIndex = theData.find( '-', cursor );
-    std::string objectEntry = theData.substr( cursor, objectIndex - cursor );
+    std::size_t objectIndex = dependencyStr.find( '-', cursor );
+    std::string objectEntry = dependencyStr.substr( cursor, objectIndex - cursor );
     cursor = objectIndex;
 
-    std::size_t upwardIndexBegin = theData.find("{",cursor) + 1;
-    std::size_t upwardIndexFinish = theData.find("}",upwardIndexBegin);
-    LevelsList upwardList = parseWard( theData, cursor );
+    std::size_t upwardIndexBegin = dependencyStr.find("{",cursor) + 1;
+    std::size_t upwardIndexFinish = dependencyStr.find("}",upwardIndexBegin);
+    LevelsList upwardList = parseWard( dependencyStr, cursor );
 
-    LevelsList downwardList = parseWard( theData, cursor );
+    LevelsList downwardList = parseWard( dependencyStr, cursor );
 
     tree[objectEntry] = std::pair<LevelsList,LevelsList>( upwardList, downwardList );
   }
 }
+
+bool GEOMUtils::CheckShape( TopoDS_Shape& shape,
+                            bool checkGeometry )
+{
+  BRepCheck_Analyzer analyzer( shape, checkGeometry );
+  return analyzer.IsValid();
+}
+
+bool GEOMUtils::FixShapeTolerance( TopoDS_Shape& shape,
+                                   TopAbs_ShapeEnum type,
+                                   Standard_Real tolerance,
+                                   bool checkGeometry )
+{
+  ShapeFix_ShapeTolerance aSft;
+  aSft.LimitTolerance( shape, tolerance, tolerance, type );
+  Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape( shape );
+  aSfs->Perform();
+  shape = aSfs->Shape();
+  return CheckShape( shape, checkGeometry );
+}
+
+bool GEOMUtils::FixShapeTolerance( TopoDS_Shape& shape,
+                                   Standard_Real tolerance,
+                                   bool checkGeometry )
+{
+  return FixShapeTolerance( shape, TopAbs_SHAPE, tolerance, checkGeometry );
+}
+
+bool GEOMUtils::FixShapeTolerance( TopoDS_Shape& shape,
+                                   bool checkGeometry )
+{
+  return FixShapeTolerance( shape, Precision::Confusion(), checkGeometry );
+}
+
+bool GEOMUtils::FixShapeCurves( TopoDS_Shape& shape )
+{
+  Standard_Real aT, aTolE, aD, aDMax;
+  TopExp_Explorer aExpF, aExpE;
+  NCollection_DataMap<TopoDS_Edge, Standard_Real, TopTools_ShapeMapHasher> aDMETol;
+  aExpF.Init(shape, TopAbs_FACE);
+  for (; aExpF.More(); aExpF.Next()) {
+    const TopoDS_Face& aF = *(TopoDS_Face*)&aExpF.Current();
+    aExpE.Init(aF, TopAbs_EDGE);
+    for (; aExpE.More(); aExpE.Next()) {
+      const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExpE.Current();
+      try {
+        if (!BOPTools_AlgoTools::ComputeTolerance(aF, aE, aDMax, aT)) {
+          continue;
+        }
+      }
+      catch(...) {
+        continue;
+      }
+      aTolE = BRep_Tool::Tolerance(aE);
+      if (aDMax < aTolE) continue;
+      if (aDMETol.IsBound(aE)) {
+        aD = aDMETol.Find(aE);
+        if (aDMax > aD) {
+          aDMETol.UnBind(aE);
+          aDMETol.Bind(aE, aDMax);
+        }
+      }
+      else {
+        aDMETol.Bind(aE, aDMax);
+      }
+    }
+  }
+  NCollection_DataMap<TopoDS_Edge, Standard_Real, TopTools_ShapeMapHasher>::Iterator aDMETolIt(aDMETol);
+#ifdef USE_LIMIT_TOLERANCE
+  ShapeFix_ShapeTolerance sat;
+#else
+  BRep_Builder b;
+#endif
+  for (; aDMETolIt.More(); aDMETolIt.Next()) {
+#ifdef USE_LIMIT_TOLERANCE
+    sat.LimitTolerance(aDMETolIt.Key(), aDMETolIt.Value()*1.001);
+#else
+    TopoDS_Iterator itv(aDMETolIt.Key());
+    for (; itv.More(); itv.Next())
+      b.UpdateVertex(TopoDS::Vertex(itv.Value()), aDMETolIt.Value()*1.001);
+    b.UpdateEdge(aDMETolIt.Key(), aDMETolIt.Value()*1.001);
+#endif
+  }
+  return CheckShape( shape );
+}
+
+bool GEOMUtils::Write( const TopoDS_Shape& shape, const char* fileName )
+{
+  return BRepTools::Write( shape, fileName );
+}
index 0fd9d22a06f7369d8f69c67f97885a32c04b8c80..dfd8e653fdb21b10e20a5c5366b34370191aebf7 100644 (file)
@@ -215,12 +215,91 @@ namespace GEOMUtils
    */
   Standard_EXPORT gp_Pnt ConvertClickToPoint( int x, int y, Handle(V3d_View) theView );
 
-  Standard_EXPORT void ConvertTreeToString( const TreeModel &theTree,
-                                           std::string &DependencyStr );
+  /*!
+   * \brief Convert dependency tree data to the string representation
+   *
+   * \param tree dependency tree data
+   * \param dependencyStr output string
+   */
+  Standard_EXPORT void ConvertTreeToString( const TreeModel& tree,
+                                           std::string& dependencyStr );
+
+  /*!
+   * \brief Restore dependency tree data from the string representation
+   *
+   * \param dependencyStr string representation of tree data
+   * \param tree output dependency tree data
+   */
+  Standard_EXPORT void ConvertStringToTree( const std::string& dependencyStr,
+                                           TreeModel& tree );
 
-  Standard_EXPORT void ConvertStringToTree( const std::string &theDependencyStr,
-                                           TreeModel &tree );
+  /*!
+   * \brief Check shape
+   *
+   * \param shape input shape object
+   * \param checkGeometry when set to \c true, causes check of underlying geometry
+   *        in addition to the topology
+   * \return \c true if shape is valid or \c false otherwise
+   */
+  Standard_EXPORT bool CheckShape( TopoDS_Shape& shape, bool checkGeometry = false );
+  
+  /*!
+   * \brief Limit shape tolerance to the given value
+   *
+   * \param shape shape being fixed
+   * \param type topology type which tolerance is to be limited; TopAbs_SHAPE means
+   *             all types of topology
+   * \param tolerance expected tolerance value (1e-7 by default)
+   * \param checkGeometry check geometry validity of result
+   * \return \c true if resulting shape is valid
+   *
+   * \note Resulting tolerance of the shape is not mandatory equal to requested value
+   *       as it might be changed by fixshape operation in order to get valid shape where possible
+   * \note By default, result only checked for topology validity; check of geometry can be done by
+   *       passing \c true to \a checkGeometry parameter
+   */
+  Standard_EXPORT bool FixShapeTolerance( TopoDS_Shape& shape,
+                                          TopAbs_ShapeEnum type,
+                                          Standard_Real tolerance = Precision::Confusion(),
+                                          bool checkGeometry = false );
 
+  /*!
+   * \brief Limit shape tolerance to the given value
+   * This is overloaded function, it behaves exactly as previous one
+   */
+  Standard_EXPORT bool FixShapeTolerance( TopoDS_Shape& shape,
+                                          Standard_Real tolerance = Precision::Confusion(),
+                                          bool checkGeometry = false );
+
+  /*!
+   * \brief Limit shape tolerance to the given value
+   * This is overloaded function, it behaves exactly as previous one
+   */
+  Standard_EXPORT bool FixShapeTolerance( TopoDS_Shape& shape,
+                                          bool checkGeometry );
+
+  /*!
+   * \brief Fix curves of the given shape
+   * 
+   * The function checks each curve of the input shape in the following way:
+   * - compute deviation of the curve from the underlying surface in a set of points
+   *   computed with the certain discretization step value
+   * - find maximum tolerance between computed deviation values
+   * - limit tolerance of the curve with the computed maximum value
+   * 
+   * \param shape shape being fixed
+   * \return \c true if resulting shape is valid
+   */
+  Standard_EXPORT bool FixShapeCurves( TopoDS_Shape& shape );
+
+  /*!
+   * \brief Write shape to the BREP file
+   *
+   * \param source shape
+   * \return \c true if file was written or \c false otherwise
+   */
+  Standard_EXPORT bool Write( const TopoDS_Shape& shape,
+                              const char* fileName );
 };
 
 #endif
old mode 100755 (executable)
new mode 100644 (file)
index 55a9c3c..513ffa7
@@ -614,6 +614,7 @@ CORBA::Boolean GEOM_IBlocksOperations_i::IsCompoundOfBlocks
 //=============================================================================
 CORBA::Boolean GEOM_IBlocksOperations_i::CheckCompoundOfBlocks
                                           (GEOM::GEOM_Object_ptr theCompound,
+                                           const CORBA::Double   theToleranceC1,
                                            GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors)
 {
   CORBA::Boolean isComp = false;
@@ -627,7 +628,8 @@ CORBA::Boolean GEOM_IBlocksOperations_i::CheckCompoundOfBlocks
 
   //Check
   std::list<GEOMImpl_IBlocksOperations::BCError> errList;
-  isComp = GetOperations()->CheckCompoundOfBlocks(aCompound, errList);
+  isComp = GetOperations()->CheckCompoundOfBlocks
+    (aCompound, theToleranceC1, errList);
   if (!GetOperations()->IsDone())
     return isComp;
 
@@ -749,6 +751,7 @@ char* GEOM_IBlocksOperations_i::PrintBCErrors
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetNonBlocks
                                       (GEOM::GEOM_Object_ptr theShape,
+                                       const CORBA::Double   theToleranceC1,
                                        GEOM::GEOM_Object_out theNonQuads)
 {
   GEOM::GEOM_Object_var aGEOMObject;
@@ -765,7 +768,8 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetNonBlocks
 
   //Get the result
   Handle(GEOM_Object) aFaces;
-  Handle(GEOM_Object) anObject = GetOperations()->GetNonBlocks(aShape, aFaces);
+  Handle(GEOM_Object) anObject =
+    GetOperations()->GetNonBlocks(aShape, theToleranceC1, aFaces);
   if (!GetOperations()->IsDone())
     return aGEOMObject._retn();
 
index fa457b56692605c2ded47949bf4fbd490ce4e453..7755eeb640b7b5828af10fb044f79e70a7952d66 100644 (file)
@@ -116,12 +116,14 @@ class GEOM_I_EXPORT GEOM_IBlocksOperations_i :
                                     CORBA::Long&          theNbBlocks);
 
   CORBA::Boolean CheckCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
+                                        const CORBA::Double   theToleranceC1,
                                        GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors);
 
   char* PrintBCErrors (GEOM::GEOM_Object_ptr theCompound,
                       const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors);
 
   GEOM::GEOM_Object_ptr GetNonBlocks (GEOM::GEOM_Object_ptr theShape,
+                                      const CORBA::Double   theToleranceC1,
                                       GEOM::GEOM_Object_out theNonQuads);
 
   GEOM::GEOM_Object_ptr RemoveExtraEdges (GEOM::GEOM_Object_ptr theShape,
index 1fa7f1fb903398eab45624cc8c926d9ca00fa0c9..2ff91518be37c0f932f76af72b6696f9faf99001 100644 (file)
@@ -2115,3 +2115,44 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSurfaceFromFace
 
   return GetObject(aNewFace);
 }
+
+//=============================================================================
+/*!
+ *  GetSubShapeEdgeSorted
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSubShapeEdgeSorted
+                                        (GEOM::GEOM_Object_ptr theShape,
+                                         GEOM::GEOM_Object_ptr theStartPoint)
+{
+  GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the reference objects
+  Handle(GEOM_Object) aShape      = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aStartPoint = GetObjectImpl(theStartPoint);
+
+  if (aShape.IsNull() || aStartPoint.IsNull()) {
+    return aSeq._retn();
+  }
+
+  //Get Shapes On Shape
+  Handle(TColStd_HSequenceOfTransient) aHSeq =
+      GetOperations()->GetSubShapeEdgeSorted(aShape, aStartPoint);
+
+  if (!GetOperations()->IsDone() || aHSeq.IsNull())
+    return aSeq._retn();
+
+  const Standard_Integer aLength = aHSeq->Length();
+  Standard_Integer       i;
+
+  aSeq->length(aLength);
+
+  for (i = 1; i <= aLength; i++) {
+    aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+  }
+
+  return aSeq._retn();
+}
index 9d0dbb464f79378bf46778a09fc3e1d580565635..5c74ca2c1bdfad1c5d353653c88fbcf717170a64 100644 (file)
@@ -297,6 +297,9 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
 
   GEOM::GEOM_Object_ptr MakeSurfaceFromFace(GEOM::GEOM_Object_ptr theFace);
 
+  GEOM::ListOfGO* GetSubShapeEdgeSorted (GEOM::GEOM_Object_ptr theShape,
+                                         GEOM::GEOM_Object_ptr theStartPoint);
+
   ::GEOMImpl_IShapesOperations* GetOperations()
   { return (::GEOMImpl_IShapesOperations*)GetImpl(); }
 };
index 920aa557ad979f7078849e407354923fb4c01913..2e2e4b45c0c697a0159a8ab7d1879367ea25c266 100644 (file)
@@ -406,15 +406,19 @@ bool GEOM_Object_i::IsShape()
   return !_impl->GetValue().IsNull() && _impl->GetType() != GEOM_MARKER;
 }
 
-bool GEOM_Object_i::IsSame(GEOM::GEOM_Object_ptr other)
+bool GEOM_Object_i::IsSame(GEOM::GEOM_BaseObject_ptr other)
 {
-  TopoDS_Shape thisShape  = _impl->GetValue();
-  TopoDS_Shape otherShape;
-  if ( !CORBA::is_nil( other ) ) {
+  bool result = false;
+
+  GEOM::GEOM_Object_var shapePtr = GEOM::GEOM_Object::_narrow( other );
+  if ( !CORBA::is_nil( shapePtr ) ) {
     Handle(GEOM_Object) otherObject = Handle(GEOM_Object)::DownCast
-      ( GEOM_Engine::GetEngine()->GetObject( other->GetStudyID(), other->GetEntry(), false ));
-    if ( !otherObject.IsNull() )
-      otherShape = otherObject->GetValue();
+      ( GEOM_Engine::GetEngine()->GetObject( shapePtr->GetStudyID(), shapePtr->GetEntry(), false ));
+    if ( !otherObject.IsNull() ) {
+      TopoDS_Shape thisShape  = _impl->GetValue();
+      TopoDS_Shape otherShape = otherObject->GetValue();
+      result = !thisShape.IsNull() && !otherShape.IsNull() && thisShape.IsSame( otherShape );
+    }
   }
-  return thisShape.IsSame( otherShape );
+  return result;
 }
index dffc72663598cde6d20ab28eedfd0de965d8f46b..176164936bcc8b603f6b2ff8e93cc3d69d022ca6 100644 (file)
@@ -77,7 +77,7 @@ class GEOM_I_EXPORT GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public
 
   virtual GEOM::GEOM_Object_ptr GetMainShape();
 
-  virtual bool IsSame(GEOM::GEOM_Object_ptr other);
+  virtual bool IsSame(GEOM::GEOM_BaseObject_ptr other);
 
   virtual bool IsShape();
 
index 7c4409f7eaf4667e2e355f8b0032d43fed84a44d..58217549227f4226831e8c3456b6429a1c1e9bfc 100644 (file)
@@ -2762,7 +2762,7 @@ CORBA::Boolean GEOM_Superv_i::CheckCompoundOfBlocks
   beginService( " GEOM_Superv_i::CheckCompoundOfBlocks" );
   MESSAGE("GEOM_Superv_i::CheckCompoundOfBlocks");
   getBlocksOp();
-  CORBA::Boolean aRes = myBlocksOp->CheckCompoundOfBlocks(theCompound, theErrors);
+  CORBA::Boolean aRes = myBlocksOp->CheckCompoundOfBlocks(theCompound, -1., theErrors);
   endService( " GEOM_Superv_i::CheckCompoundOfBlocks" );
   return aRes;
 }
index 2fef6a4c569b1c6e9a5e16df5116792e68157fcd..85c7b8aff298b9df6b7e4cf5da3692a3e1adc40f 100644 (file)
@@ -229,7 +229,6 @@ def TestAll (geompy, math):
   Line3 = geompy.MakeLineTwoFaces(prism1_faces[0], prism1_faces[1]) #(2 GEOM_Object)->GEOM_Object
 
   #Create advanced objects
-  Copy             = geompy.MakeCopy(Box)                      #(GEOM_Object)->GEOM_Object
   Prism            = geompy.MakePrismVecH(Face, vz, 100.0)     #(2 GEOM_Object, Double)->GEOM_Object
   Prism2Ways       = geompy.MakePrismVecH2Ways(Face, vz, 10.0) #(2 GEOM_Object, Double)->GEOM_Object
   PrismTwoPnt      = geompy.MakePrism(Face2, p0, pxyz)         #(3 GEOM_Object)->GEOM_Object
@@ -242,6 +241,7 @@ def TestAll (geompy, math):
                                         tol2d, tol3d, nbiter)  #(GEOM_Object, 4 Doubles, Short)->GEOM_Object
   Pipe             = geompy.MakePipe(Wire, Edge)               #(2 GEOM_Object)->GEOM_Object
   Sewing           = geompy.MakeSewing([Face, S], precision)   #(List Of GEOM_Object, Double)->GEOM_Object
+  Copy             = geompy.MakeCopy(Box)                      #(GEOM_Object)->GEOM_Object
 
   #Transform objects
   Translation = geompy.MakeTranslationTwoPoints(Box, px, pz)    #(3 GEOM_Object)->GEOM_Object
@@ -265,8 +265,8 @@ def TestAll (geompy, math):
   Position    = geompy.MakePosition(Box, cs1, cs2)   #(3 GEOM_Object)->GEOM_Object
   Position2   = geompy.PositionAlongPath(Box, Arc, 0.5, 1, 0)  #(2 GEOM_Object, 1 Double, 2 Bool)->GEOM_Object
   Offset      = geompy.MakeOffset(Box, 10.)          #(GEOM_Object, Double)->GEOM_Object
-  Orientation = geompy.ChangeOrientation(Box)
   ProjOnWire  = geompy.MakeProjectionOnWire(p0, Wire)
+  Orientation = geompy.ChangeOrientation(Box)
   ExtEdge     = geompy.ExtendEdge(Edge1, -0.3, 1.3)
   ExtFace     = geompy.ExtendFace(Face5, -0.3, 1.3, -0.1, 1.1)
   Surface     = geompy.MakeSurfaceFromFace(Face5)
@@ -565,4 +565,13 @@ def TestAll (geompy, math):
   geompy.RestoreSubShapes(Partition, [Box])
   geompy.RestoreSubShapes(Partition1)
 
+  # GetSubShapeEdgeSorted
+  p1 = geompy.GetFirstVertex(Sketcher)
+  p2 = geompy.GetFirstVertex(Sketcher3d_1)
+  p3 = geompy.GetFirstVertex(Sketcher3d_2)
+  geompy.GetSubShapeEdgeSorted(Sketcher, p1, "OrderedEdges")
+  geompy.GetSubShapeEdgeSorted(Sketcher3d_1, p2, "OrderedEdges")
+  geompy.GetSubShapeEdgeSorted(Sketcher3d_2, p3, "OrderedEdges")
+
+
   print "DONE"
index b5d4c2406cf4689c2a1c02e9c54af657ad2ebc93..fad3398cba4f5a6a59da4a1db3478d9bd3d03024 100755 (executable)
@@ -80,7 +80,7 @@
 ## # create and publish cylinder
 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
 ## # get non blocks from cylinder
-## g1, g2 = geompy.GetNonBlocks(cyl, "nonblock")
+## g1, g2 = geompy.GetNonBlocks(cyl, theName="nonblock")
 ## @endcode
 ##
 ## Above example will publish both result compounds (first with non-hexa solids and
@@ -88,7 +88,7 @@
 ## However, if second command is invoked as
 ##
 ## @code
-## g1, g2 = geompy.GetNonBlocks(cyl, ("nonhexa", "nonquad"))
+## g1, g2 = geompy.GetNonBlocks(cyl, theName=("nonhexa", "nonquad"))
 ## @endcode
 ##
 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
@@ -6296,6 +6296,38 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(ListObj, theName, "subshape")
             return ListObj
 
+        ## Explode a shape into edges sorted in a row from a starting point.
+        #  @param theShape the shape to be exploded on edges.
+        #  @param theStartPoint the starting point.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #  @return List of GEOM.GEOM_Object that is actually an ordered list
+        #          of edges sorted in a row from a starting point.
+        #
+        #  @ref swig_GetSubShapeEdgeSorted "Example"
+        @ManageTransactions("ShapesOp")
+        def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
+            """
+            Explode a shape into edges sorted in a row from a starting point.
+
+            Parameters:
+                theShape the shape to be exploded on edges.
+                theStartPoint the starting point.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                List of GEOM.GEOM_Object that is actually an ordered list
+                of edges sorted in a row from a starting point.
+            """
+            # Example: see GEOM_TestAll.py
+            ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
+            RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
+            self._autoPublish(ListObj, theName, "SortedEdges")
+            return ListObj
+
         ## Check if the object is a sub-object of another GEOM object.
         #  @param aSubObject Checked sub-object (or its parent object, in case if
         #         \a theSubObjectIndex is non-zero).
@@ -11755,36 +11787,62 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         ## Check, if the compound of blocks is given.
         #  To be considered as a compound of blocks, the
         #  given shape must satisfy the following conditions:
-        #  - Each element of the compound should be a Block (6 faces and 12 edges).
+        #  - Each element of the compound should be a Block (6 faces).
+        #  - Each face should be a quadrangle, i.e. it should have only 1 wire
+        #       with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
+        #       there are more than 4 edges in the only wire of a face,
+        #       this face is considered to be quadrangle if it has 4 bounds
+        #       (1 or more edge) of C1 continuity.
         #  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
         #  - The compound should be connexe.
         #  - The glue between two quadrangle faces should be applied.
         #  @param theCompound The compound to check.
+        #  @param theIsUseC1 Flag to check if there are 4 bounds on a face
+        #         taking into account C1 continuity.
+        #  @param theAngTolerance the angular tolerance to check if two neighbor
+        #         edges are codirectional in the common vertex with this
+        #         tolerance. This parameter is used only if
+        #         <VAR>theIsUseC1</VAR> is set to True.
         #  @return TRUE, if the given shape is a compound of blocks.
         #  If theCompound is not valid, prints all discovered errors.
         #
         #  @ref tui_check_compound_of_blocks_page "Example 1"
         #  \n @ref swig_CheckCompoundOfBlocks "Example 2"
         @ManageTransactions("BlocksOp")
-        def CheckCompoundOfBlocks(self,theCompound):
+        def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
+                                  theAngTolerance = 1.e-12):
             """
             Check, if the compound of blocks is given.
             To be considered as a compound of blocks, the
             given shape must satisfy the following conditions:
-            - Each element of the compound should be a Block (6 faces and 12 edges).
+            - Each element of the compound should be a Block (6 faces).
+            - Each face should be a quadrangle, i.e. it should have only 1 wire
+                 with 4 edges. If theIsUseC1 is set to True and
+                 there are more than 4 edges in the only wire of a face,
+                 this face is considered to be quadrangle if it has 4 bounds
+                 (1 or more edge) of C1 continuity.
             - A connection between two Blocks should be an entire quadrangle face or an entire edge.
             - The compound should be connexe.
             - The glue between two quadrangle faces should be applied.
 
             Parameters:
                 theCompound The compound to check.
+                theIsUseC1 Flag to check if there are 4 bounds on a face
+                           taking into account C1 continuity.
+                theAngTolerance the angular tolerance to check if two neighbor
+                           edges are codirectional in the common vertex with this
+                           tolerance. This parameter is used only if
+                           theIsUseC1 is set to True.
 
             Returns:
                 TRUE, if the given shape is a compound of blocks.
                 If theCompound is not valid, prints all discovered errors.
             """
             # Example: see GEOM_Spanner.py
-            (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
+            aTolerance = -1.0
+            if theIsUseC1:
+                aTolerance = theAngTolerance
+            (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
             RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
             if IsValid == 0:
                 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
@@ -11793,6 +11851,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
         ## Retrieve all non blocks solids and faces from \a theShape.
         #  @param theShape The shape to explore.
+        #  @param theIsUseC1 Flag to check if there are 4 bounds on a face
+        #         taking into account C1 continuity.
+        #  @param theAngTolerance the angular tolerance to check if two neighbor
+        #         edges are codirectional in the common vertex with this
+        #         tolerance. This parameter is used only if
+        #         <VAR>theIsUseC1</VAR> is set to True.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -11800,17 +11864,27 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @return A tuple of two GEOM_Objects. The first object is a group of all
         #          non block solids (= not 6 faces, or with 6 faces, but with the
         #          presence of non-quadrangular faces). The second object is a
-        #          group of all non quadrangular faces.
+        #          group of all non quadrangular faces (= faces with more then
+        #          1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
+        #          with 1 wire with not 4 edges that do not form 4 bounds of
+        #          C1 continuity).
         #
         #  @ref tui_get_non_blocks_page "Example 1"
         #  \n @ref swig_GetNonBlocks "Example 2"
         @ManageTransactions("BlocksOp")
-        def GetNonBlocks (self, theShape, theName=None):
+        def GetNonBlocks (self, theShape, theIsUseC1 = False,
+                          theAngTolerance = 1.e-12, theName=None):
             """
             Retrieve all non blocks solids and faces from theShape.
 
             Parameters:
                 theShape The shape to explore.
+                theIsUseC1 Flag to check if there are 4 bounds on a face
+                           taking into account C1 continuity.
+                theAngTolerance the angular tolerance to check if two neighbor
+                           edges are codirectional in the common vertex with this
+                           tolerance. This parameter is used only if
+                           theIsUseC1 is set to True.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -11819,13 +11893,19 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 A tuple of two GEOM_Objects. The first object is a group of all
                 non block solids (= not 6 faces, or with 6 faces, but with the
                 presence of non-quadrangular faces). The second object is a
-                group of all non quadrangular faces.
+                group of all non quadrangular faces (= faces with more then
+                1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
+                with 1 wire with not 4 edges that do not form 4 bounds of
+                C1 continuity).
 
             Usage:
                 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
             """
             # Example: see GEOM_Spanner.py
-            aTuple = self.BlocksOp.GetNonBlocks(theShape)
+            aTolerance = -1.0
+            if theIsUseC1:
+                aTolerance = theAngTolerance
+            aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
             RaiseIfFailed("GetNonBlocks", self.BlocksOp)
             self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
             return aTuple
index 004e8e63e9a171e558b218f351f3988ee00da3bb..67fbaca57f87b10c20e2a721fc5be55eac8aaeb4 100644 (file)
@@ -1160,11 +1160,16 @@ class Sketcher2D:
         if self.closed:
             self.myCommand = self.myCommand + ":WW"
 
+        from salome.geom.geomBuilder import ParseSketcherCommand, RaiseIfFailed
+        Command,Parameters = ParseSketcherCommand(self.myCommand)
+
         import GEOM
-        if isinstance(WorkingPlane, list): wire = self.geompyD.CurvesOp.MakeSketcher(self.myCommand, WorkingPlane)
-        if isinstance(WorkingPlane, GEOM._objref_GEOM_Object): wire = self.geompyD.CurvesOp.MakeSketcherOnPlane(self.myCommand, WorkingPlane)
+        if isinstance(WorkingPlane, list): wire = self.geompyD.CurvesOp.MakeSketcher(Command, WorkingPlane)
+        if isinstance(WorkingPlane, GEOM._objref_GEOM_Object): wire = self.geompyD.CurvesOp.MakeSketcherOnPlane(Command, WorkingPlane)
 
         self.myCommand = "Sketcher"
+        RaiseIfFailed("Sketcher", self.geompyD.CurvesOp)
+        wire.SetParameters(Parameters)
         self.geompyD._autoPublish(wire, theName, "wire")
         return wire
         
@@ -1204,11 +1209,16 @@ class Sketcher2D:
         else:
             raise RuntimeError, "Sketcher2D.close() : can't build face on unclosed wire"
 
+        from salome.geom.geomBuilder import ParseSketcherCommand, RaiseIfFailed
+        Command,Parameters = ParseSketcherCommand(self.myCommand)
+
         import GEOM
-        if isinstance(WorkingPlane, list): face = self.geompyD.CurvesOp.MakeSketcher(self.myCommand, WorkingPlane)
-        if isinstance(WorkingPlane, GEOM._objref_GEOM_Object): face = self.geompyD.CurvesOp.MakeSketcherOnPlane(self.myCommand, WorkingPlane)
+        if isinstance(WorkingPlane, list): face = self.geompyD.CurvesOp.MakeSketcher(Command, WorkingPlane)
+        if isinstance(WorkingPlane, GEOM._objref_GEOM_Object): face = self.geompyD.CurvesOp.MakeSketcherOnPlane(Command, WorkingPlane)
 
         self.myCommand = "Sketcher"
+        RaiseIfFailed("Sketcher", self.geompyD.CurvesOp)
+        face.SetParameters(Parameters)
         self.geompyD._autoPublish(face, theName, "face")
         return face
 
index 63127af248c5b37cbf204c352ad25a947b8a2a03..d314f09d245840c7206d6b1fcca59b264af77c7f 100644 (file)
@@ -43,6 +43,7 @@
 #include <SVTK_ViewModel.h>
 #include <SALOME_Prs.h>
 #include <SALOME_ListIO.hxx>
+#include "utilities.h"
 
 #include <SUIT_Desktop.h>
 #include <SUIT_MessageBox.h>
index 5064dead25ff0bc4881ed72d27c9f524840bfaa1..e7f66919eaaea9337dbefb3e3c8ee424e92ef277 100644 (file)
@@ -1,57 +1,57 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS version="2.0" language="ja" sourcelanguage="en">
-<context>
+  <context>
     <name>@default</name>
     <message>
-        <source>MEN_EXPORTIGES</source>
-        <translation type="unfinished">IGES</translation>
+      <source>MEN_EXPORTIGES</source>
+      <translation>IGESエクスポート</translation>
     </message>
     <message>
-        <source>TOP_EXPORTIGES</source>
-        <translation type="unfinished">Export IGES</translation>
+      <source>TOP_EXPORTIGES</source>
+      <translation>IGESエクスポート</translation>
     </message>
     <message>
-        <source>STB_EXPORTIGES</source>
-        <translation type="unfinished">Export IGES</translation>
+      <source>STB_EXPORTIGES</source>
+      <translation>IGESエクスポート</translation>
     </message>
     <message>
-        <source>MEN_IMPORTIGES</source>
-        <translation type="unfinished">IGES</translation>
+      <source>MEN_IMPORTIGES</source>
+      <translation>IGESインポート</translation>
     </message>
     <message>
-        <source>TOP_IMPORTIGES</source>
-        <translation type="unfinished">Import IGES</translation>
+      <source>TOP_IMPORTIGES</source>
+      <translation>IGESインポート</translation>
     </message>
     <message>
-        <source>STB_IMPORTIGES</source>
-        <translation type="unfinished">Import IGES</translation>
+      <source>STB_IMPORTIGES</source>
+      <translation>IGESインポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>IGESPlugin_GUI</name>
     <message>
-        <source>IGES_FILES</source>
-        <translation type="unfinished">IGES Files ( *.iges *.igs )</translation>
+      <source>IGES_FILES</source>
+      <translation>IGESファイル</translation>
     </message>
     <message>
-        <source>EXPORT_TITLE</source>
-        <translation type="unfinished">Export IGES</translation>
+      <source>EXPORT_TITLE</source>
+      <translation>IGESエクスポート</translation>
     </message>
     <message>
-        <source>IMPORT_TITLE</source>
-        <translation type="unfinished">Import IGES</translation>
+      <source>IMPORT_TITLE</source>
+      <translation>IGESインポート</translation>
     </message>
     <message>
-        <source>SCALE_DIMENSIONS</source>
-        <translation>インポートしたファイルの単位をミリメートルからメートルに変換しますか?いいえを選んだ場合、メートル単位として解釈します。</translation>
+      <source>SCALE_DIMENSIONS</source>
+      <translation>インポートしたファイルの単位をミリメートルからメートルに変換しますか?いいえを選んだ場合、メートル単位として解釈します。</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>IGESPlugin_ExportDlg</name>
     <message>
-        <source>IGES_VERSION</source>
-        <translation type="unfinished">Version</translation>
+      <source>IGES_VERSION</source>
+      <translation>IGESバージョン</translation>
     </message>
-</context>
+  </context>
 </TS>
index 8d7961412765ad02225d303a9b7aff54f7afb835..eee95b56b0fe355eff832d3fde1757bfae8fe127 100644 (file)
@@ -26,7 +26,6 @@
 //
 #include "MeasureGUI.h"
 #include "MeasureGUI_CheckCompoundOfBlocksDlg.h"
-#include "MeasureGUI_Widgets.h"
 
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
@@ -43,6 +42,8 @@
 #include <GEOMBase.h>
 #include <GEOMImpl_Types.hxx>
 
+#include <QListWidget>
+
 #define TEXTEDIT_FONT_FAMILY "Courier"
 #define TEXTEDIT_FONT_SIZE 11
 
 //            true to construct a modal dialog.
 //=================================================================================
 MeasureGUI_CheckCompoundOfBlocksDlg::MeasureGUI_CheckCompoundOfBlocksDlg( GeometryGUI* GUI, QWidget* parent )
-  : GEOMBase_Skeleton( GUI, parent, false )
+  : GEOMBase_Skeleton(GUI, parent, false),
+    myObjectName     (0),
+    mySelButton      (0),
+    myUseC1Check     (0),
+    myTolLbl         (0),
+    mySpinTol        (0),
+    myTextView       (0),
+    myListBox1       (0),
+    myListBox2       (0)
 {
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
   QPixmap image0( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_CHECK_COMPOUND_OF_BLOCKS" ) ) );
@@ -70,29 +79,55 @@ MeasureGUI_CheckCompoundOfBlocksDlg::MeasureGUI_CheckCompoundOfBlocksDlg( Geomet
   mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
   mainFrame()->RadioButton3->close();
 
-  myGrp = new MeasureGUI_1Sel1TextView2ListBox( centralWidget() );
-  myGrp->GroupBox1->setTitle( tr( "GEOM_CHECK_INFOS" ) );
-  myGrp->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
-
-  myGrp->TextView1->setReadOnly( true );
-  QFont aFont( TEXTEDIT_FONT_FAMILY, TEXTEDIT_FONT_SIZE );
-  aFont.setStyleHint( QFont::TypeWriter, QFont::PreferAntialias );
-  myGrp->TextView1->setFont( aFont );
-
-  myGrp->PushButton1->setIcon( image1 );
-  myGrp->LineEdit1->setReadOnly( true );
-
-  myGrp->TextLabel2->setText( tr( "GEOM_CHECK_BLOCKS_COMPOUND_ERRORS" ) );
-  myGrp->TextLabel3->setText( tr( "GEOM_CHECK_BLOCKS_COMPOUND_SUBSHAPES" ) );
-
-  myGrp->ListBox2->setSelectionMode( QAbstractItemView::ExtendedSelection );
+  QGroupBox   *aGrpParams    =
+    new QGroupBox(tr("GEOM_CHECK_INFOS"), centralWidget());
+  QGridLayout *aParamsLayout = new QGridLayout(aGrpParams);
+  QLabel      *anObjLbl      = new QLabel(tr("GEOM_OBJECT"), aGrpParams);
+  QLabel      *anErrorsLbl   =
+    new QLabel(tr("GEOM_CHECK_BLOCKS_COMPOUND_ERRORS"), aGrpParams);
+  QLabel      *aNonBlocksLbl =
+    new QLabel(tr("GEOM_CHECK_BLOCKS_COMPOUND_SUBSHAPES"), aGrpParams);
+
+  myObjectName = new QLineEdit(aGrpParams);
+  mySelButton  = new QPushButton(aGrpParams);
+  myUseC1Check = new QCheckBox(tr("GEOM_USE_C1_CRITERION"), aGrpParams);
+  myTolLbl     = new QLabel(tr("GEOM_ANGULAR_TOLERANCE"), aGrpParams);
+  mySpinTol    = new SalomeApp_DoubleSpinBox(aGrpParams);
+  myTextView   = new QTextBrowser(aGrpParams);
+  myListBox1   = new QListWidget(aGrpParams);
+  myListBox2   = new QListWidget(aGrpParams);
+
+  myObjectName->setReadOnly(true);
+  mySelButton->setIcon(image1);
+  mySelButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+  myUseC1Check->setText(tr("GEOM_USE_C1_CRITERION"));
+  myUseC1Check->setChecked(true);
+  myTextView->setReadOnly(true);
+  myListBox2->setSelectionMode(QAbstractItemView::ExtendedSelection);
+
+  // Set text view font.
+  QFont aFont(TEXTEDIT_FONT_FAMILY, TEXTEDIT_FONT_SIZE);
+
+  aFont.setStyleHint(QFont::TypeWriter, QFont::PreferAntialias);
+  myTextView->setFont(aFont);
+
+  aParamsLayout->setMargin(9);
+  aParamsLayout->setSpacing(6);
+  aParamsLayout->addWidget(anObjLbl,      0, 0);
+  aParamsLayout->addWidget(mySelButton,   0, 1);
+  aParamsLayout->addWidget(myObjectName,  0, 2);
+  aParamsLayout->addWidget(myUseC1Check,  1, 0, 1, 3);
+  aParamsLayout->addWidget(myTolLbl,      2, 0);
+  aParamsLayout->addWidget(mySpinTol,     2, 1, 1, 2);
+  aParamsLayout->addWidget(myTextView,    3, 0, 1, 3);
+  aParamsLayout->addWidget(anErrorsLbl,   4, 0);
+  aParamsLayout->addWidget(myListBox1,    5, 0, 1, 2);
+  aParamsLayout->addWidget(aNonBlocksLbl, 4, 2);
+  aParamsLayout->addWidget(myListBox2,    5, 2);
 
   QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
   layout->setMargin( 0 ); layout->setSpacing( 6 );
-  layout->addWidget( myGrp );
-
-  connect( myGrp->ListBox1, SIGNAL( itemSelectionChanged() ), SLOT( onErrorsListSelectionChanged() ) );
-  connect( myGrp->ListBox2, SIGNAL( itemSelectionChanged() ), SLOT( onSubShapesListSelectionChanged() ) );
+  layout->addWidget( aGrpParams );
 
   /***************************************************************/
 
@@ -116,14 +151,24 @@ MeasureGUI_CheckCompoundOfBlocksDlg::~MeasureGUI_CheckCompoundOfBlocksDlg()
 //=================================================================================
 void MeasureGUI_CheckCompoundOfBlocksDlg::Init()
 {
-  myEditCurrentArgument = myGrp->LineEdit1;
+  /* init variables */
+  double SpecificStep = 0.0001;
+  double aDefaultTol  = Precision::Angular();
+
+  initSpinBox(mySpinTol, aDefaultTol, MAX_NUMBER, SpecificStep, "ang_tol_precision");
+  mySpinTol->setValue(aDefaultTol);
+  myEditCurrentArgument = myObjectName;
 
   // signals and slots connections
   connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
   connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
 
-  connect( myGrp->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
-  connect( myGrp->PushButton1, SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
+  connect(myObjectName, SIGNAL(returnPressed()),        this, SLOT(LineEditReturnPressed()));
+  connect(mySelButton,  SIGNAL(clicked()),              this, SLOT(SetEditCurrentArgument()));
+  connect(myListBox1,   SIGNAL(itemSelectionChanged()), this, SLOT(onErrorsListSelectionChanged()));
+  connect(myListBox2,   SIGNAL(itemSelectionChanged()), this, SLOT(onSubShapesListSelectionChanged()));
+  connect(myUseC1Check, SIGNAL(clicked()),              this, SLOT(SetUseC1Tolerance()));
+  connect(mySpinTol,    SIGNAL(valueChanged(double)),   this, SLOT(processObject()));
 
   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
            this, SLOT( SelectionIntoArgument() ) );
@@ -172,7 +217,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::SelectionIntoArgument()
   aSelMgr->selectedObjects(aSelList);
 
   if (aSelList.Extent() != 1) {
-    myGrp->LineEdit1->setText( "" );
+    myObjectName->setText( "" );
     processObject();
     return;
   }
@@ -181,13 +226,13 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::SelectionIntoArgument()
     GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
 
   if ( aSelectedObject->_is_nil() ) {
-    myGrp->LineEdit1->setText( "" );
+    myObjectName->setText( "" );
     processObject();
     return;
   }
 
   myObj = aSelectedObject;
-  myGrp->LineEdit1->setText( GEOMBase::GetName( myObj ) );
+  myObjectName->setText( GEOMBase::GetName( myObj ) );
   processObject();
   DISPLAY_PREVIEW_MACRO;
 }
@@ -198,11 +243,22 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::SelectionIntoArgument()
 //=================================================================================
 void MeasureGUI_CheckCompoundOfBlocksDlg::SetEditCurrentArgument()
 {
-  myGrp->LineEdit1->setFocus();
-  myEditCurrentArgument = myGrp->LineEdit1;
+  myObjectName->setFocus();
+  myEditCurrentArgument = myObjectName;
   SelectionIntoArgument();
 }
 
+//=================================================================================
+// function : SetUseC1Tolerance()
+// purpose  :
+//=================================================================================
+void MeasureGUI_CheckCompoundOfBlocksDlg::SetUseC1Tolerance()
+{
+  myTolLbl->setEnabled(myUseC1Check->isChecked());
+  mySpinTol->setEnabled(myUseC1Check->isChecked());
+  processObject();
+}
+
 //=================================================================================
 // function : LineEditReturnPressed()
 // purpose  :
@@ -210,8 +266,8 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::SetEditCurrentArgument()
 void MeasureGUI_CheckCompoundOfBlocksDlg::LineEditReturnPressed()
 {
   QLineEdit* send = (QLineEdit*)sender();
-  if ( send == myGrp->LineEdit1 ) {
-    myEditCurrentArgument = myGrp->LineEdit1;
+  if ( send == myObjectName ) {
+    myEditCurrentArgument = myObjectName;
     GEOMBase_Skeleton::LineEditReturnPressed();
   }
 }
@@ -245,7 +301,13 @@ bool MeasureGUI_CheckCompoundOfBlocksDlg::getBCErrors( bool& theIsCompoundOfBloc
     GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() );
     try {
       GEOM::GEOM_IBlocksOperations::BCErrors_var aErrs;
-      theIsCompoundOfBlocks = anOper->CheckCompoundOfBlocks( myObj, aErrs );
+      double aC1Tol = -1.;
+
+      if (myUseC1Check->isChecked()) {
+        aC1Tol = mySpinTol->value();
+      }
+
+      theIsCompoundOfBlocks = anOper->CheckCompoundOfBlocks( myObj, aC1Tol, aErrs );
       if (anOper->IsDone() && aErrs->length() > 0)
       //if (anOper->IsDone() && !aErrs._is_nil())
         theErrors = aErrs;
@@ -270,9 +332,9 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::processObject()
   GEOM::GEOM_IBlocksOperations::BCErrors aErrs;
   if ( !getBCErrors( isCompoundOfBlocks, aErrs ) ) {
     aMsg += tr( "GEOM_CHECK_BLOCKS_COMPOUND_FAILED" );
-    myGrp->TextView1->setText( aMsg );
-    myGrp->ListBox1->clear();
-    myGrp->ListBox2->clear();
+    myTextView->setText( aMsg );
+    myListBox1->clear();
+    myListBox2->clear();
     erasePreview();
     return;
   }
@@ -287,7 +349,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::processObject()
     buttonOk()->setEnabled( true );
     buttonApply()->setEnabled( true );
   }
-  myGrp->TextView1->setText( aMsg );
+  myTextView->setText( aMsg );
 
   QStringList aErrList;
   QString aErrStr( "" );
@@ -321,9 +383,9 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::processObject()
       aErrList.append( aErrStr );
   }
 
-  myGrp->ListBox1->clear();
-  myGrp->ListBox2->clear();
-  myGrp->ListBox1->addItems( aErrList );
+  myListBox1->clear();
+  myListBox2->clear();
+  myListBox1->addItems( aErrList );
 }
 
 //=================================================================================
@@ -342,19 +404,19 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_CheckCompoundOfBlocksDlg::createOperation(
 void MeasureGUI_CheckCompoundOfBlocksDlg::onErrorsListSelectionChanged()
 {
   erasePreview();
-  int aCurItem = myGrp->ListBox1->currentRow();
+  int aCurItem = myListBox1->currentRow();
   if ( aCurItem < 0 )
     return;
   bool isCompoundOfBlocks;
   GEOM::GEOM_IBlocksOperations::BCErrors aErrs;
   if ( !getBCErrors( isCompoundOfBlocks, aErrs ) ) {
-    myGrp->TextView1->setText( "" );
-    myGrp->ListBox1->clear();
-    myGrp->ListBox2->clear();
+    myTextView->setText( "" );
+    myListBox1->clear();
+    myListBox2->clear();
     return;
   }
 
-  myGrp->ListBox2->clear();
+  myListBox2->clear();
 
   if (aCurItem < aErrs.length()) {
     GEOM::GEOM_IBlocksOperations::BCError aErr = aErrs[aCurItem];
@@ -371,7 +433,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onErrorsListSelectionChanged()
           aSubShapeList.append( QString( "%1_%2" ).arg( aType ).arg( aObjLst[i] ) );
       }
     }
-    myGrp->ListBox2->addItems( aSubShapeList );
+    myListBox2->addItems( aSubShapeList );
   }
 }
 
@@ -382,12 +444,12 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onErrorsListSelectionChanged()
 void MeasureGUI_CheckCompoundOfBlocksDlg::onSubShapesListSelectionChanged()
 {
   erasePreview();
-  int aErrCurItem = myGrp->ListBox1->currentRow();
+  int aErrCurItem = myListBox1->currentRow();
   if ( aErrCurItem < 0 )
     return;
   QList<int> aIds;
-  for ( int i = 0, n = myGrp->ListBox2->count(); i < n; i++ ) {
-    if ( myGrp->ListBox2->item( i )->isSelected() )
+  for ( int i = 0, n = myListBox2->count(); i < n; i++ ) {
+    if ( myListBox2->item( i )->isSelected() )
       aIds.append( i );
   }
   if ( aIds.count() < 1 )
@@ -395,9 +457,9 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onSubShapesListSelectionChanged()
   bool isCompoundOfBlocks;
   GEOM::GEOM_IBlocksOperations::BCErrors aErrs;
   if ( !getBCErrors( isCompoundOfBlocks, aErrs ) ) {
-    myGrp->TextView1->setText( "" );
-    myGrp->ListBox1->clear();
-    myGrp->ListBox2->clear();
+    myTextView->setText( "" );
+    myListBox1->clear();
+    myListBox2->clear();
     return;
   }
 
@@ -433,6 +495,15 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onSubShapesListSelectionChanged()
   }
 }
 
+//=================================================================================
+// function : onDisplayPreview
+// purpose  : 
+//=================================================================================
+void MeasureGUI_CheckCompoundOfBlocksDlg::onDisplayPreview()
+{
+  DISPLAY_PREVIEW_MACRO;
+}
+
 //=================================================================================
 // function : activateSelection
 // purpose  : activate selection of faces, shells, and solids
@@ -459,9 +530,9 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::enterEvent( QEvent* )
 // function : isValid
 // purpose  :
 //=================================================================================
-bool MeasureGUI_CheckCompoundOfBlocksDlg::isValid( QString)
+bool MeasureGUI_CheckCompoundOfBlocksDlg::isValid( QString &msg)
 {
-  return !myObj->_is_nil();
+  return !myObj->_is_nil() && mySpinTol->isValid(msg, !IsPreview());
 }
 
 //=================================================================================
index e6a93c4f07e124f6144c766b43e4f5ff705687e9..b2d43ca1fc9009a2da0860b76667094ed4112eb1 100644 (file)
 
 #include <GEOMBase_Skeleton.h>
 
-class MeasureGUI_1Sel1TextView2ListBox;
+class QCheckBox;
+class QLabel;
+class QLineEdit;
+class QListWidget;
+class QPushButton;
+class QTextBrowser;
+class SalomeApp_DoubleSpinBox;
 
 //=================================================================================
 // class    : MeasureGUI_CheckCompoundOfBlocksDlg
@@ -47,7 +53,7 @@ public:
 protected:
   // redefined from GEOMBase_Helper and GEOMBase_Skeleton
   virtual GEOM::GEOM_IOperations_ptr  createOperation();
-  virtual bool                        isValid( QString& );
+  virtual bool                        isValid( QString &msg );
   virtual bool                        execute( ObjectList& );
   virtual void                        processObject();
 
@@ -61,6 +67,8 @@ private slots:
   
   void                                onErrorsListSelectionChanged();
   void                                onSubShapesListSelectionChanged();
+  void                                SetUseC1Tolerance();
+  void                                onDisplayPreview();
   
 private:
   void                                Init();
@@ -71,7 +79,14 @@ private:
 
 private:
   GEOM::GEOM_Object_var               myObj;
-  MeasureGUI_1Sel1TextView2ListBox*   myGrp;
+  QLineEdit                          *myObjectName;
+  QPushButton                        *mySelButton;
+  QCheckBox                          *myUseC1Check;
+  QLabel                             *myTolLbl;
+  SalomeApp_DoubleSpinBox            *mySpinTol;
+  QTextBrowser                       *myTextView;
+  QListWidget                        *myListBox1;
+  QListWidget                        *myListBox2;
 };
 
 #endif // MEASUREGUI_CHECKCOMPOUNDOFBLOCKSDLG_H
index 5c04f273aa8b766af40fbe653709ce9ac72474d7..6ef248017cebcfd7a1ec98834e2514120b379f9e 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "MeasureGUI_GetNonBlocksDlg.h"
 
-#include <DlgRef.h>
 #include <GEOMBase.h>
 
 #include <GeometryGUI.h>
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 #include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
 #include <LightApp_SelectionMgr.h>
 #include <SalomeApp_Tools.h>
 
+#include <QCheckBox>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QVBoxLayout>
+
 //=================================================================================
 // class    : MeasureGUI_GetNonBlocksDlg()
 // purpose  : Constructs a MeasureGUI_GetNonBlocksDlg which is a child of 'parent',
 //            true to construct a modal dialog.
 //=================================================================================
 MeasureGUI_GetNonBlocksDlg::MeasureGUI_GetNonBlocksDlg (GeometryGUI* theGeometryGUI, QWidget* parent)
-  : GEOMBase_Skeleton(theGeometryGUI, parent, false)
+  : GEOMBase_Skeleton(theGeometryGUI, parent, false),
+    myObjectName     (0),
+    mySelButton      (0),
+    myUseC1Check     (0),
+    myTolLbl         (0),
+    mySpinTol        (0)
 {
   QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_GETNONBLOCKS")));
   QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
@@ -58,16 +71,36 @@ MeasureGUI_GetNonBlocksDlg::MeasureGUI_GetNonBlocksDlg (GeometryGUI* theGeometry
   mainFrame()->RadioButton2->close();
   mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
   mainFrame()->RadioButton3->close();
-
-  myGrp = new DlgRef_1Sel (centralWidget());
-  myGrp->GroupBox1->setTitle(tr("GEOM_GETNONBLOCKS"));
-  myGrp->TextLabel1->setText(tr("GEOM_OBJECT"));
-  myGrp->PushButton1->setIcon(image1);
-  myGrp->LineEdit1->setReadOnly(true);
+  
+  QGroupBox   *aGrpParams    =
+    new QGroupBox(tr("GEOM_GETNONBLOCKS"), centralWidget());
+  QGridLayout *aParamsLayout = new QGridLayout(aGrpParams);
+  QLabel      *anObjLbl      = new QLabel(tr("GEOM_OBJECT"), aGrpParams);
+
+  myObjectName = new QLineEdit(aGrpParams);
+  mySelButton  = new QPushButton(aGrpParams);
+  myUseC1Check = new QCheckBox(tr("GEOM_USE_C1_CRITERION"), aGrpParams);
+  myTolLbl     = new QLabel(tr("GEOM_ANGULAR_TOLERANCE"), aGrpParams);
+  mySpinTol    = new SalomeApp_DoubleSpinBox(aGrpParams);
+
+  myObjectName->setReadOnly(true);
+  mySelButton->setIcon(image1);
+  mySelButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+  myUseC1Check->setText(tr("GEOM_USE_C1_CRITERION"));
+  myUseC1Check->setChecked(true);
+
+  aParamsLayout->setMargin(9);
+  aParamsLayout->setSpacing(6);
+  aParamsLayout->addWidget(anObjLbl,     0, 0);
+  aParamsLayout->addWidget(mySelButton,  0, 1);
+  aParamsLayout->addWidget(myObjectName, 0, 2);
+  aParamsLayout->addWidget(myUseC1Check, 1, 0, 1, 3);
+  aParamsLayout->addWidget(myTolLbl,     2, 0);
+  aParamsLayout->addWidget(mySpinTol,    2, 1, 1, 2);
 
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
-  layout->addWidget(myGrp);
+  layout->addWidget(aGrpParams);
 
   /***************************************************************/
 
@@ -94,14 +127,20 @@ void MeasureGUI_GetNonBlocksDlg::Init()
   showOnlyPreviewControl();
 
   /* init variables */
-  myEditCurrentArgument = myGrp->LineEdit1;
+  double SpecificStep = 0.0001;
+  double aDefaultTol  = Precision::Angular();
 
-   /* signals and slots connections */
-  connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+  initSpinBox(mySpinTol, aDefaultTol, MAX_NUMBER, SpecificStep, "ang_tol_precision");
+  mySpinTol->setValue(aDefaultTol);
+  myEditCurrentArgument = myObjectName;
 
-  connect(myGrp->LineEdit1,   SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-  connect(myGrp->PushButton1, SIGNAL(clicked()),       this, SLOT(SetEditCurrentArgument()));
+   /* signals and slots connections */
+  connect(buttonOk(),    SIGNAL(clicked()),            this, SLOT(ClickOnOk()));
+  connect(buttonApply(), SIGNAL(clicked()),            this, SLOT(ClickOnApply()));
+  connect(myUseC1Check,  SIGNAL(clicked()),            this, SLOT(SetUseC1Tolerance()));
+  connect(mySpinTol,     SIGNAL(valueChanged(double)), this, SLOT(processPreview()));
+  connect(myObjectName,  SIGNAL(returnPressed()),      this, SLOT(LineEditReturnPressed()));
+  connect(mySelButton,   SIGNAL(clicked()),            this, SLOT(SetEditCurrentArgument()));
 
   connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
            SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
@@ -171,11 +210,22 @@ void MeasureGUI_GetNonBlocksDlg::SelectionIntoArgument()
 //=================================================================================
 void MeasureGUI_GetNonBlocksDlg::SetEditCurrentArgument()
 {
-  myGrp->LineEdit1->setFocus();
-  myEditCurrentArgument = myGrp->LineEdit1;
+  myObjectName->setFocus();
+  myEditCurrentArgument = myObjectName;
   SelectionIntoArgument();
 }
 
+//=================================================================================
+// function : SetUseC1Tolerance()
+// purpose  :
+//=================================================================================
+void MeasureGUI_GetNonBlocksDlg::SetUseC1Tolerance()
+{
+  myTolLbl->setEnabled(myUseC1Check->isChecked());
+  mySpinTol->setEnabled(myUseC1Check->isChecked());
+  processPreview();
+}
+
 //=================================================================================
 // function : LineEditReturnPressed()
 // purpose  :
@@ -183,8 +233,8 @@ void MeasureGUI_GetNonBlocksDlg::SetEditCurrentArgument()
 void MeasureGUI_GetNonBlocksDlg::LineEditReturnPressed()
 {
   QLineEdit* send = (QLineEdit*)sender();
-  if (send == myGrp->LineEdit1) {
-    myEditCurrentArgument = myGrp->LineEdit1;
+  if (send == myObjectName) {
+    myEditCurrentArgument = myObjectName;
     GEOMBase_Skeleton::LineEditReturnPressed();
   }
 }
@@ -211,10 +261,11 @@ void MeasureGUI_GetNonBlocksDlg::ActivateThisDialog()
 void MeasureGUI_GetNonBlocksDlg::processObject()
 {
   if (myObj->_is_nil()) {
+    myObjectName->setText("");
     erasePreview();
   }
   else {
-    myGrp->LineEdit1->setText(GEOMBase::GetName(myObj));
+    myObjectName->setText(GEOMBase::GetName(myObj));
 
     processPreview();
   }
@@ -243,9 +294,9 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_GetNonBlocksDlg::createOperation()
 // function : isValid
 // purpose  :
 //=================================================================================
-bool MeasureGUI_GetNonBlocksDlg::isValid (QString&)
+bool MeasureGUI_GetNonBlocksDlg::isValid (QString &msg)
 {
-  return !myObj->_is_nil();
+  return !myObj->_is_nil() && mySpinTol->isValid(msg, !IsPreview());
 }
 
 //=================================================================================
@@ -256,7 +307,13 @@ bool MeasureGUI_GetNonBlocksDlg::execute (ObjectList& objects)
 {
   GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation());
   GEOM::GEOM_Object_var aNonQuads;
-  GEOM::GEOM_Object_var anObj = anOper->GetNonBlocks(myObj, aNonQuads);
+  double aC1Tol = -1.;
+
+  if (myUseC1Check->isChecked()) {
+    aC1Tol = mySpinTol->value();
+  }
+
+  GEOM::GEOM_Object_var anObj = anOper->GetNonBlocks(myObj, aC1Tol, aNonQuads);
   //mainFrame()->ResultName->setText(tr("GEOM_NONBLOCKS"));
 
   if (!anObj->_is_nil())
index 5282c8cd6e888180839292c79f47c75c4d619a96..f6f59b6805ba6ebd4a8d787abb399a2d0a09540e 100644 (file)
 
 #include <GEOMBase_Skeleton.h>
 
-class DlgRef_1Sel;
+class QCheckBox;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class SalomeApp_DoubleSpinBox;
 
 //=================================================================================
 // class    : MeasureGUI_GetNonBlocksDlg
@@ -45,7 +49,7 @@ public:
 protected:
   // redefined from GEOMBase_Helper
   virtual GEOM::GEOM_IOperations_ptr  createOperation();
-  virtual bool                        isValid (QString&);
+  virtual bool                        isValid (QString &msg);
   virtual bool                        execute (ObjectList&);
   virtual GEOM::GEOM_Object_ptr       getFather (GEOM::GEOM_Object_ptr);
 
@@ -56,6 +60,7 @@ private slots:
   void                                LineEditReturnPressed();
   void                                SelectionIntoArgument();
   void                                SetEditCurrentArgument();
+  void                                SetUseC1Tolerance();
   
 private:
   void                                Init();
@@ -64,7 +69,11 @@ private:
 
 private:
   GEOM::GEOM_Object_var               myObj;
-  DlgRef_1Sel*                        myGrp;
+  QLineEdit                          *myObjectName;
+  QPushButton                        *mySelButton;
+  QCheckBox                          *myUseC1Check;
+  QLabel                             *myTolLbl;
+  SalomeApp_DoubleSpinBox            *mySpinTol;
 };
 
 #endif // MEASUREGUI_GETNONBLOCKSDLG_H
index e9b592035f70bb0d5e05d95d022dc54e8687c536..6326c2904a39a155bb28b15b61bcf6ed1fc3477b 100755 (executable)
 #include <TopoDS.hxx>
 #include <TopTools_ListOfShape.hxx>
 
+
+#include <TopExp.hxx>
+#include <vtkAppendPolyData.h>
+#include <vtkPolyData.h>
+#include <BRepBuilderAPI_Copy.hxx>
+
 #define MAX2(X, Y)    (Abs(X) > Abs(Y) ? Abs(X) : Abs(Y))
 #define MAX3(X, Y, Z) (MAX2(MAX2(X,Y), Z))
 
@@ -159,4 +165,68 @@ namespace GEOM
       }
     }
   }
+
+  vtkPolyData* GetData(const TopoDS_Shape& theShape, float theDeflection) {
+    BRepBuilderAPI_Copy aCopy(theShape);
+    if(!aCopy.IsDone()) {
+      return 0;
+    }
+
+    TopoDS_Shape aShape = aCopy.Shape();
+    
+    try {
+      GEOM_VertexSource* myVertexSource = GEOM_VertexSource::New();
+      GEOM_EdgeSource* myIsolatedEdgeSource = GEOM_EdgeSource::New();
+      GEOM_EdgeSource* myOneFaceEdgeSource = GEOM_EdgeSource::New();
+      GEOM_EdgeSource* mySharedEdgeSource = GEOM_EdgeSource::New();
+      GEOM_WireframeFace* myWireframeFaceSource = GEOM_WireframeFace::New();
+      GEOM_ShadingFace* myShadingFaceSource = GEOM_ShadingFace::New();
+      
+      vtkAppendPolyData* myAppendFilter = vtkAppendPolyData::New();
+      myAppendFilter->AddInputConnection( myVertexSource->GetOutputPort() );
+      myAppendFilter->AddInputConnection( myIsolatedEdgeSource->GetOutputPort() );
+      myAppendFilter->AddInputConnection( myOneFaceEdgeSource->GetOutputPort() );
+      myAppendFilter->AddInputConnection( mySharedEdgeSource->GetOutputPort() );      
+      myAppendFilter->AddInputConnection( myShadingFaceSource->GetOutputPort() );
+      
+      bool anIsVector = false;
+      
+      GEOM::MeshShape( aShape, theDeflection );
+      TopExp_Explorer aVertexExp( aShape, TopAbs_VERTEX );
+      for( ; aVertexExp.More(); aVertexExp.Next() ) {
+       const TopoDS_Vertex& aVertex = TopoDS::Vertex( aVertexExp.Current() );
+       myVertexSource->AddVertex( aVertex );
+      }
+      
+      TopTools_IndexedDataMapOfShapeListOfShape anEdgeMap;
+      TopExp::MapShapesAndAncestors( aShape, TopAbs_EDGE, TopAbs_FACE, anEdgeMap );
+      
+      GEOM::SetShape( aShape,
+                     anEdgeMap,
+                     anIsVector,
+                     0,
+                     myIsolatedEdgeSource,
+                     myOneFaceEdgeSource,
+                     mySharedEdgeSource,
+                     myWireframeFaceSource,
+                     myShadingFaceSource );
+      
+      myAppendFilter->Update();
+
+      myVertexSource->Delete();
+      myIsolatedEdgeSource->Delete();
+      myOneFaceEdgeSource->Delete();
+      mySharedEdgeSource->Delete();
+      myWireframeFaceSource->Delete();
+      myShadingFaceSource->Delete();
+
+      vtkPolyData* ret = vtkPolyData::New();
+      ret->ShallowCopy(myAppendFilter->GetOutput());
+      myAppendFilter->Delete();
+      return ret;
+    }
+    catch(Standard_Failure) {
+      return 0;
+    }
+  }  
 }
index 523ca14b945ffa3724dc6ad271cc3e7243f4730f..9ca5465509ef13b28dd7eaacb9ece7543f02715d 100755 (executable)
@@ -29,7 +29,7 @@ class GEOM_VertexSource;
 class GEOM_EdgeSource;
 class GEOM_WireframeFace;
 class GEOM_ShadingFace;
-
+class vtkPolyData;
 namespace GEOM
 {
   // moved from GEOM_AssemblyBuilder
@@ -47,6 +47,8 @@ namespace GEOM
                                GEOM_EdgeSource* theSharedEdgeSource,
                                GEOM_WireframeFace* theWireframeFaceSource,
                                GEOM_ShadingFace* theShadingFaceSource);
+
+  OCC2VTK_EXPORT vtkPolyData* GetData(const TopoDS_Shape& theShape, float theDeflection);
 }
 
 #endif // OCC2VTK_TOOLS_H
index 051ca495a1e6c7084a1d08f5755bb2e703d56355..83104ee5e76556f66c9754d88b820f02c76759a7 100644 (file)
@@ -319,8 +319,13 @@ bool RepairGUI_FreeFacesDlg::execute( ObjectList& objects )
       aFace = anIndices.FindKey( aFaceLst[i] );
       try {
         getDisplayer()->SetColor( Quantity_NOC_RED );
-        getDisplayer()->SetToActivate( false );
        getDisplayer()->SetTransparency( transparency );
+       getDisplayer()->SetWidth( 2 );
+       getDisplayer()->SetNbIsos( 1 );
+       getDisplayer()->SetIsosWidth( 1 );
+       getDisplayer()->SetIsosColor( Quantity_NOC_RED );
+       getDisplayer()->SetDisplayMode( 0 );
+        getDisplayer()->SetToActivate( false );
         aPrs = !aFace.IsNull() ? getDisplayer()->BuildPrs( aFace ) : 0;
         if ( aPrs )
           displayPreview( aPrs, true );
index debad4f6a84885a182c14377d6ad9c730cf7f5e8..3dcadf2a55ca9737876da37037ce0229658f44ee 100644 (file)
@@ -30,6 +30,7 @@
 #include <GeometryGUI.h>
 #include <GEOMBase.h>
 #include <SalomeApp_DoubleSpinBox.h>
+#include "utilities.h"
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
index 0b447d106757ac6566f67591dcd5ba74c366aafd..dc5e3fa097408ae1aee1bd79be3fc6e3270c6af6 100644 (file)
@@ -327,7 +327,6 @@ bool RepairGUI_LimitToleranceDlg::onAcceptLocal()
 
   bool aLocked = aStudy->GetProperties()->IsLocked();
   if (aLocked) {
-    MESSAGE("GEOMBase_Helper::onAccept - ActiveStudy is locked");
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"), tr("WRN_STUDY_LOCKED"), tr("BUT_OK"));
     return false;
   }
index dc32f058e203615d502b65b65fd98d5a447a1fad..6d9f4dcc0489ed722acbef7562e5a79370860f03 100755 (executable)
@@ -42,6 +42,7 @@
 #include <SALOME_ListIO.hxx>
 
 #include <Basics_Utils.hxx>
+#include "utilities.h"
 
 #include <TCollection_AsciiString.hxx>
 #include <TColStd_MapOfInteger.hxx>
index 459ee3442af0308eaf86778a8520e7a16448b3e2..1d8b70447987657b0c7e6908e3838c89c8f0de01 100644 (file)
@@ -1,50 +1,50 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS version="2.0" language="ja" sourcelanguage="en">
-<context>
+  <context>
     <name>@default</name>
     <message>
-        <source>MEN_EXPORTSTEP</source>
-        <translation type="unfinished">STEP</translation>
+      <source>MEN_EXPORTSTEP</source>
+      <translation>STEPエクスポート</translation>
     </message>
     <message>
-        <source>TOP_EXPORTSTEP</source>
-        <translation type="unfinished">Export STEP</translation>
+      <source>TOP_EXPORTSTEP</source>
+      <translation>STEPエクスポート</translation>
     </message>
     <message>
-        <source>STB_EXPORTSTEP</source>
-        <translation type="unfinished">Export STEP</translation>
+      <source>STB_EXPORTSTEP</source>
+      <translation>STEPエクスポート</translation>
     </message>
     <message>
-        <source>MEN_IMPORTSTEP</source>
-        <translation type="unfinished">STEP</translation>
+      <source>MEN_IMPORTSTEP</source>
+      <translation>STEPインポート</translation>
     </message>
     <message>
-        <source>TOP_IMPORTSTEP</source>
-        <translation type="unfinished">Import STEP</translation>
+      <source>TOP_IMPORTSTEP</source>
+      <translation>STEPインポート</translation>
     </message>
     <message>
-        <source>STB_IMPORTSTEP</source>
-        <translation type="unfinished">Import STEP</translation>
+      <source>STB_IMPORTSTEP</source>
+      <translation>STEPインポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>STEPPlugin_GUI</name>
     <message>
-        <source>STEP_FILES</source>
-        <translation type="unfinished">STEP Files ( *.step *.stp )</translation>
+      <source>STEP_FILES</source>
+      <translation>STEPファイル</translation>
     </message>
     <message>
-        <source>EXPORT_TITLE</source>
-        <translation type="unfinished">Export STEP</translation>
+      <source>EXPORT_TITLE</source>
+      <translation>STEPエクスポート</translation>
     </message>
     <message>
-        <source>IMPORT_TITLE</source>
-        <translation type="unfinished">Import STEP</translation>
+      <source>IMPORT_TITLE</source>
+      <translation>STEPインポート</translation>
     </message>
     <message>
-        <source>SCALE_DIMENSIONS</source>
-        <translation>インポートしたファイルの単位をミリメートルからメートルに変換しますか?いいえを選んだ場合、メートル単位として解釈します。</translation>
+      <source>SCALE_DIMENSIONS</source>
+      <translation>インポートしたファイルの単位をミリメートルからメートルに変換しますか?いいえを選んだ場合、メートル単位として解釈します。</translation>
     </message>
-</context>
+  </context>
 </TS>
index e4347f8290724c1c4258d9b2a7a42bdd147976aa..2c7ac4a07b941e65fc34a8a04eba630c4a02bf02 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS version="2.0" language="fr_US">
+<TS version="2.0" language="fr_FR">
 <context>
     <name>@default</name>
     <message>
@@ -47,7 +47,7 @@
     <name>STLPlugin_ExportDlg</name>
     <message>
         <source>ASCII</source>
-        <translation type="unfinished">Save as ASCII</translation>
+        <translation>Sauver au format ASCII</translation>
     </message>
     <message>
         <source>RELATIVE</source>
index 1c10df04fce0994e2f32bf10d2b0da49db785c0a..da367eaf3eabad470dc847e11a5303898ad86df1 100644 (file)
@@ -1,61 +1,61 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS version="2.0" language="ja" sourcelanguage="en">
-<context>
+  <context>
     <name>@default</name>
     <message>
-        <source>MEN_EXPORTSTL</source>
-        <translation type="unfinished">STL</translation>
+      <source>MEN_EXPORTSTL</source>
+      <translation>STLエクスポート</translation>
     </message>
     <message>
-        <source>TOP_EXPORTSTL</source>
-        <translation type="unfinished">Export STL</translation>
+      <source>TOP_EXPORTSTL</source>
+      <translation>STLエクスポート</translation>
     </message>
     <message>
-        <source>STB_EXPORTSTL</source>
-        <translation type="unfinished">Export STL</translation>
+      <source>STB_EXPORTSTL</source>
+      <translation>STLエクスポート</translation>
     </message>
     <message>
-        <source>MEN_IMPORTSTL</source>
-        <translation type="unfinished">STL</translation>
+      <source>MEN_IMPORTSTL</source>
+      <translation>STLインポート</translation>
     </message>
     <message>
-        <source>TOP_IMPORTSTL</source>
-        <translation type="unfinished">Import STL</translation>
+      <source>TOP_IMPORTSTL</source>
+      <translation>STLインポート</translation>
     </message>
     <message>
-        <source>STB_IMPORTSTL</source>
-        <translation type="unfinished">Import STL</translation>
+      <source>STB_IMPORTSTL</source>
+      <translation>STLインポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>STLPlugin_GUI</name>
     <message>
-        <source>STL_FILES</source>
-        <translation type="unfinished">STL files( *.stl )</translation>
+      <source>STL_FILES</source>
+      <translation>STLファイル</translation>
     </message>
     <message>
-        <source>EXPORT_TITLE</source>
-        <translation type="unfinished">Export STL</translation>
+      <source>EXPORT_TITLE</source>
+      <translation>STLエクスポート</translation>
     </message>
     <message>
-        <source>IMPORT_TITLE</source>
-        <translation type="unfinished">Import STL</translation>
+      <source>IMPORT_TITLE</source>
+      <translation>STLインポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>STLPlugin_ExportDlg</name>
     <message>
-        <source>ASCII</source>
-        <translation type="unfinished">Save as ASCII</translation>
+      <source>ASCII</source>
+      <translation>アスキーテキスト</translation>
     </message>
     <message>
-        <source>RELATIVE</source>
-        <translation type="unfinished">Relative</translation>
+      <source>RELATIVE</source>
+      <translation type="unfinished">Relative</translation>
     </message>
     <message>
-        <source>DEFLECTION</source>
-        <translation type="unfinished">Deflection</translation>
+      <source>DEFLECTION</source>
+      <translation type="unfinished">Deflection</translation>
     </message>
-</context>
+  </context>
 </TS>
index a77897278cd28b6bd729e184fd0f5ac473b8d308..1242f4468c471dd9c5bbba97eb0eb47121c35d10 100644 (file)
@@ -91,80 +91,16 @@ Standard_Integer VTKPlugin_ExportDriver::Execute( TFunction_Logbook& log ) const
   MESSAGE( "Export VTK into file " << aFileName );
   try
   {
-    GEOM_VertexSource* myVertexSource = GEOM_VertexSource::New();
-    GEOM_EdgeSource* myIsolatedEdgeSource = GEOM_EdgeSource::New();
-    GEOM_EdgeSource* myOneFaceEdgeSource = GEOM_EdgeSource::New();
-    GEOM_EdgeSource* mySharedEdgeSource = GEOM_EdgeSource::New();
-    GEOM_WireframeFace* myWireframeFaceSource = GEOM_WireframeFace::New();
-    GEOM_ShadingFace* myShadingFaceSource = GEOM_ShadingFace::New();
-
-    vtkAppendPolyData* myAppendFilter = vtkAppendPolyData::New();
-    myAppendFilter->AddInputConnection( myVertexSource->GetOutputPort() );
-    myAppendFilter->AddInputConnection( myIsolatedEdgeSource->GetOutputPort() );
-    myAppendFilter->AddInputConnection( myOneFaceEdgeSource->GetOutputPort() );
-    myAppendFilter->AddInputConnection( mySharedEdgeSource->GetOutputPort() );
-    //myAppendFilter->AddInputConnection( myWireframeFaceSource->GetOutputPort() ); // iso-lines are unnecessary
-    myAppendFilter->AddInputConnection( myShadingFaceSource->GetOutputPort() );
-
-    bool anIsVector = false;
-
-    // Is shape triangulated?
-    bool wasMeshed = true;
-    TopExp_Explorer ex;
-    TopLoc_Location aLoc;
-    for (ex.Init(aShape, TopAbs_FACE); ex.More(); ex.Next()) {
-      const TopoDS_Face& aFace = TopoDS::Face(ex.Current());
-      Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc);
-      if(aPoly.IsNull()) {
-        wasMeshed = false;
-        break;
-      }
-    }
-
-    GEOM::MeshShape( aShape, aDeflection );
-
-    TopExp_Explorer aVertexExp( aShape, TopAbs_VERTEX );
-    for( ; aVertexExp.More(); aVertexExp.Next() )
-    {
-      const TopoDS_Vertex& aVertex = TopoDS::Vertex( aVertexExp.Current() );
-      myVertexSource->AddVertex( aVertex );
-    }
-
-    TopTools_IndexedDataMapOfShapeListOfShape anEdgeMap;
-    TopExp::MapShapesAndAncestors( aShape, TopAbs_EDGE, TopAbs_FACE, anEdgeMap );
-
-    GEOM::SetShape( aShape,
-                   anEdgeMap,
-                   anIsVector,
-                   0,
-                   myIsolatedEdgeSource,
-                   myOneFaceEdgeSource,
-                   mySharedEdgeSource,
-                   myWireframeFaceSource,
-                   myShadingFaceSource );
-
-    myAppendFilter->Update();
-
     // Set "C" numeric locale to save numbers correctly
     Kernel_Utils::Localizer loc;
 
-    vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();
-    aWriter->SetInputConnection( myAppendFilter->GetOutputPort() );
+    vtkPolyData* pd = GEOM::GetData( aShape, aDeflection );
+    vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();    
+    aWriter->SetInputData( pd );
     aWriter->SetFileName( aFileName.ToCString() );
     aWriter->Write();
     aWriter->Delete();
-
-    myVertexSource->Delete();
-    myIsolatedEdgeSource->Delete();
-    myOneFaceEdgeSource->Delete();
-    mySharedEdgeSource->Delete();
-    myWireframeFaceSource->Delete();
-    myShadingFaceSource->Delete();
-
-    myAppendFilter->Delete();
-
-    if(!wasMeshed)
-      BRepTools::Clean(aShape);
+    pd->Delete(); //instanciated by the GEOM::GetData(...) method
 
     return 1;
   }
index 8b0df3ae870fa1fd8b625a971cc8b6ee3a84edf6..87944b0bb550ef1e8c1b549bb3b2bde422d57cd8 100644 (file)
@@ -1,49 +1,49 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS version="2.0" language="ja" sourcelanguage="en">
-<context>
+  <context>
     <name>@default</name>
     <message>
-        <source>MEN_EXPORTVTK</source>
-        <translation type="unfinished">VTK</translation>
+      <source>MEN_EXPORTVTK</source>
+      <translation>VTKエクスポート</translation>
     </message>
     <message>
-        <source>TOP_EXPORTVTK</source>
-        <translation type="unfinished">Export VTK</translation>
+      <source>TOP_EXPORTVTK</source>
+      <translation>VTKエクスポート</translation>
     </message>
     <message>
-        <source>STB_EXPORTVTK</source>
-        <translation type="unfinished">Export VTK</translation>
+      <source>STB_EXPORTVTK</source>
+      <translation>VTKエクスポート</translation>
     </message>
     <message>
-        <source>MEN_IMPORTVTK</source>
-        <translation type="unfinished">VTK</translation>
+      <source>MEN_IMPORTVTK</source>
+      <translation>VTKインポート</translation>
     </message>
     <message>
-        <source>TOP_IMPORTVTK</source>
-        <translation type="unfinished">Import VTK</translation>
+      <source>TOP_IMPORTVTK</source>
+      <translation>VTKインポート</translation>
     </message>
     <message>
-        <source>STB_IMPORTVTK</source>
-        <translation type="unfinished">Import VTK</translation>
+      <source>STB_IMPORTVTK</source>
+      <translation>VTKインポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>VTKPlugin_GUI</name>
     <message>
-        <source>VTK_FILES</source>
-        <translation type="unfinished">VTK files( *.vtk )</translation>
+      <source>VTK_FILES</source>
+      <translation>VTKファイル</translation>
     </message>
     <message>
-        <source>EXPORT_TITLE</source>
-        <translation type="unfinished">Export VTK</translation>
+      <source>EXPORT_TITLE</source>
+      <translation>VTKエクスポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>VTKPlugin_ExportDlg</name>
     <message>
-        <source>DEFLECTION</source>
-        <translation type="unfinished">Deflection</translation>
+      <source>DEFLECTION</source>
+      <translation type="unfinished">Deflection</translation>
     </message>
-</context>
+  </context>
 </TS>
index 307f0146b676ad863ce5f2d2944213d1518ffba5..7d26ad27a09c447109f3b143a8f14c37ba39f2aa 100644 (file)
@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS version="2.0" language="ja" sourcelanguage="en">
-<context>
+  <context>
     <name>@default</name>
     <message>
       <source>MEN_EXPORTXAO</source>
       <translation>エクスポートしました。</translation>
     </message>
     <message>
-        <source>TOP_EXPORTXAO</source>
-        <translation>エクスポートしました。</translation>
+      <source>TOP_EXPORTXAO</source>
+      <translation>エクスポートしました。</translation>
     </message>
     <message>
       <source>STB_EXPORTXAO</source>
@@ -39,8 +39,8 @@
       <source>XAOPLUGIN_FILES</source>
       <translation>ファイルした (*.xao)</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>XAOPlugin_ExportDlg</name>
     <message>
       <source>XAOPLUGIN_EXPORT_TITLE</source>
@@ -70,8 +70,8 @@
       <source>XAOPLUGIN_EXPORT_LFIELDS</source>
       <translation>フィールド</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>XAOPlugin_ImportDlg</name>
     <message>
       <source>XAOPLUGIN_IMPORT_TITLE</source>
       <source>XAOPLUGIN_STEP</source>
       <translation>Step</translation>
     </message>
-</context>
-</TS>
\ No newline at end of file
+  </context>
+</TS>