]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Merge branch 'hydro/imps_2015'
authorPaul RASCLE <paul.rascle@edf.fr>
Tue, 26 Jan 2016 07:42:42 +0000 (08:42 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Tue, 26 Jan 2016 07:42:42 +0000 (08:42 +0100)
303 files changed:
CMakeLists.txt
SalomeGEOMConfig.cmake.in
doc/salome/examples/CMakeLists.txt
doc/salome/examples/check_self_intersections.py
doc/salome/examples/check_self_intersections_fast.py [new file with mode: 0644]
doc/salome/examples/complex_objs_ex05.py
doc/salome/examples/testme.py
doc/salome/gui/GEOM/collect_geom_methods.py
doc/salome/gui/GEOM/images/editgroup.png
doc/salome/gui/GEOM/images/geomcreategroup.png
doc/salome/gui/GEOM/images/inspect_object.png
doc/salome/gui/GEOM/images/inspect_object2.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/measures11.png
doc/salome/gui/GEOM/images/measures13.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/pipe3.png
doc/salome/gui/GEOM/images/point3.png [changed mode: 0755->0644]
doc/salome/gui/GEOM/images/proj_on_cyl_angles.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/proj_on_cyl_dlg.png
doc/salome/gui/GEOM/images/shape_statistics.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/shape_statistics_simple.png [new file with mode: 0644]
doc/salome/gui/GEOM/input/add_point_on_edge_operation.doc
doc/salome/gui/GEOM/input/check_compound_of_blocks.doc
doc/salome/gui/GEOM/input/check_self_intersections.doc
doc/salome/gui/GEOM/input/creating_complex_obj.doc
doc/salome/gui/GEOM/input/creating_explode.doc
doc/salome/gui/GEOM/input/creating_extrusion_alongpath.doc
doc/salome/gui/GEOM/input/creating_face.doc
doc/salome/gui/GEOM/input/creating_isoline.doc
doc/salome/gui/GEOM/input/creating_point.doc
doc/salome/gui/GEOM/input/creating_shell.doc
doc/salome/gui/GEOM/input/creating_surface_from_face.doc
doc/salome/gui/GEOM/input/creating_thickness_page.doc
doc/salome/gui/GEOM/input/dependency_tree.doc
doc/salome/gui/GEOM/input/display_mode.doc
doc/salome/gui/GEOM/input/extension_operation.doc
doc/salome/gui/GEOM/input/fast_intersection.doc
doc/salome/gui/GEOM/input/glue_edges_operation.doc
doc/salome/gui/GEOM/input/glue_faces_operation.doc
doc/salome/gui/GEOM/input/inspect_object_operation.doc [changed mode: 0755->0644]
doc/salome/gui/GEOM/input/projection_on_cylinder_operation.doc
doc/salome/gui/GEOM/input/sewing_operation.doc
doc/salome/gui/GEOM/input/shape_processing_operation.doc
doc/salome/gui/GEOM/input/shape_statistics_operation.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/shared_shapes.doc
doc/salome/gui/GEOM/input/size_models_range.doc
doc/salome/gui/GEOM/input/transfer_data.doc
doc/salome/gui/GEOM/input/tui_check_self_intersections_fast.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/tui_measurement_tools.doc
doc/salome/gui/GEOM/input/tui_test_all.doc
doc/salome/gui/GEOM/input/tui_test_measures.doc
doc/salome/gui/GEOM/input/using_measurement_tools.doc
doc/salome/gui/GEOM/input/whatis.doc
doc/salome/gui/GEOM/input/working_with_groups.doc
idl/GEOM_Gen.idl
idl/STEPPlugin.idl
resources/CMakeLists.txt
resources/SalomeApp.xml.in
resources/Y14.5M-2009.ttf [new file with mode: 0644]
resources/import.png [new file with mode: 0644]
src/AdvancedGUI/AdvancedGUI_DividedDiskDlg.cxx
src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx
src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx
src/AdvancedGUI/CMakeLists.txt
src/BREPPlugin/BREPPlugin_GUI.cxx
src/BREPPlugin/CMakeLists.txt
src/BasicGUI/BasicGUI_ArcDlg.cxx
src/BasicGUI/BasicGUI_CircleDlg.cxx
src/BasicGUI/BasicGUI_CurveDlg.cxx
src/BasicGUI/BasicGUI_EllipseDlg.cxx
src/BasicGUI/BasicGUI_LineDlg.cxx
src/BasicGUI/BasicGUI_MarkerDlg.cxx
src/BasicGUI/BasicGUI_PlaneDlg.cxx
src/BasicGUI/BasicGUI_PointDlg.cxx
src/BasicGUI/BasicGUI_PointDlg.h
src/BasicGUI/BasicGUI_VectorDlg.cxx
src/BasicGUI/CMakeLists.txt
src/BlockFix/BlockFix_UnionEdges.cxx
src/BlockFix/BlockFix_UnionFaces.cxx
src/BlocksGUI/BlocksGUI_BlockDlg.cxx
src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx
src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx
src/BlocksGUI/BlocksGUI_TrsfDlg.cxx
src/BlocksGUI/CMakeLists.txt
src/BooleanGUI/BooleanGUI_Dialog.cxx
src/BooleanGUI/CMakeLists.txt
src/BuildGUI/BuildGUI_EdgeDlg.cxx
src/BuildGUI/BuildGUI_FaceDlg.cxx
src/BuildGUI/BuildGUI_ShellDlg.cxx
src/BuildGUI/BuildGUI_WireDlg.cxx
src/BuildGUI/CMakeLists.txt
src/CMakeLists.txt
src/CurveCreator/CMakeLists.txt
src/CurveCreator/CurveCreator_TreeView.cxx
src/DependencyTree/CMakeLists.txt
src/DependencyTree/DependencyTree_Arrow.cxx
src/DisplayGUI/CMakeLists.txt
src/DlgRef/CMakeLists.txt
src/EntityGUI/CMakeLists.txt
src/EntityGUI/EntityGUI_3DSketcherDlg.cxx
src/EntityGUI/EntityGUI_FieldDlg.cxx
src/EntityGUI/EntityGUI_SketcherDlg.cxx
src/EntityGUI/EntityGUI_SubShapeDlg.cxx
src/EntityGUI/EntityGUI_SubShapeDlg.h
src/GEOM/GEOM_Engine.cxx
src/GEOM/GEOM_PythonDump.cxx
src/GEOMAlgo/CMakeLists.txt
src/GEOMAlgo/FILES
src/GEOMAlgo/GEOMAlgo.cdl [changed mode: 0755->0644]
src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx
src/GEOMAlgo/GEOMAlgo_GetInPlaceAPI.cxx
src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx
src/GEOMAlgo/GEOMAlgo_GlueDetector.cxx
src/GEOMAlgo/GEOMAlgo_Gluer.cxx [changed mode: 0755->0644]
src/GEOMAlgo/GEOMAlgo_Gluer2.cxx
src/GEOMAlgo/GEOMAlgo_KindOfDef.hxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_KindOfName.hxx
src/GEOMAlgo/GEOMAlgo_KindOfShape.hxx
src/GEOMAlgo/GEOMAlgo_ShapeInfo.cxx
src/GEOMAlgo/GEOMAlgo_ShapeInfo.hxx
src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller.cxx
src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller_1.cxx [changed mode: 0644->0755]
src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx
src/GEOMAlgo/GEOMAlgo_Splitter.cxx [changed mode: 0755->0644]
src/GEOMAlgo/GEOMAlgo_SurfaceTools.cxx
src/GEOMBase/CMakeLists.txt
src/GEOMBase/GEOMBase.cxx
src/GEOMBase/GEOMBase.h
src/GEOMBase/GEOMBase_Helper.cxx
src/GEOMBase/GEOMBase_Helper.h
src/GEOMFiltersSelection/CMakeLists.txt
src/GEOMGUI/CMakeLists.txt
src/GEOMGUI/GEOMGUI.cxx
src/GEOMGUI/GEOMGUI_CreationInfoWdg.cxx
src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx [new file with mode: 0644]
src/GEOMGUI/GEOMGUI_TextTreeWdg.h [new file with mode: 0644]
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GEOM_images.ts
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GEOM_msg_fr.ts
src/GEOMGUI/GEOM_msg_ja.ts
src/GEOMGUI/GeometryGUI.cxx
src/GEOMGUI/GeometryGUI.h
src/GEOMGUI/GeometryGUI_Operations.h
src/GEOMImpl/GEOMImpl_BooleanDriver.cxx
src/GEOMImpl/GEOMImpl_HealingDriver.cxx
src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx
src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx
src/GEOMImpl/GEOMImpl_IBasicOperations.cxx
src/GEOMImpl/GEOMImpl_IBasicOperations.hxx
src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx
src/GEOMImpl/GEOMImpl_IHealingOperations.cxx
src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx
src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx
src/GEOMImpl/GEOMImpl_IPipe.hxx
src/GEOMImpl/GEOMImpl_IPipeDiffSect.hxx
src/GEOMImpl/GEOMImpl_IPoint.hxx [changed mode: 0755->0644]
src/GEOMImpl/GEOMImpl_IProjOnCyl.hxx
src/GEOMImpl/GEOMImpl_IShapesOperations.cxx
src/GEOMImpl/GEOMImpl_IShapesOperations.hxx
src/GEOMImpl/GEOMImpl_ITransformOperations.cxx
src/GEOMImpl/GEOMImpl_ITransformOperations.hxx
src/GEOMImpl/GEOMImpl_PipeDriver.cxx
src/GEOMImpl/GEOMImpl_PipeDriver.hxx
src/GEOMImpl/GEOMImpl_PointDriver.cxx
src/GEOMImpl/GEOMImpl_PrismDriver.cxx
src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx
src/GEOMImpl/GEOMImpl_ProjectionDriver.hxx
src/GEOMImpl/GEOMImpl_ShapeDriver.cxx
src/GEOMToolsGUI/CMakeLists.txt
src/GEOMToolsGUI/GEOMToolsGUI.cxx
src/GEOMToolsGUI/GEOMToolsGUI.h
src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx
src/GEOMUtils/CMakeLists.txt
src/GEOMUtils/GEOMUtils.cxx
src/GEOMUtils/GEOMUtils.hxx
src/GEOMUtils/GEOMUtils_ShapeStatistics.cxx [new file with mode: 0644]
src/GEOMUtils/GEOMUtils_ShapeStatistics.hxx [new file with mode: 0644]
src/GEOM_I/GEOM_Gen_i.cc
src/GEOM_I/GEOM_Gen_i.hh
src/GEOM_I/GEOM_I3DPrimOperations_i.cc
src/GEOM_I/GEOM_I3DPrimOperations_i.hh
src/GEOM_I/GEOM_IBasicOperations_i.cc
src/GEOM_I/GEOM_IBasicOperations_i.hh
src/GEOM_I/GEOM_IMeasureOperations_i.cc
src/GEOM_I/GEOM_IMeasureOperations_i.hh
src/GEOM_I/GEOM_IShapesOperations_i.cc
src/GEOM_I/GEOM_IShapesOperations_i.hh
src/GEOM_I/GEOM_ITransformOperations_i.cc
src/GEOM_I/GEOM_ITransformOperations_i.hh
src/GEOM_I_Superv/GEOM_Superv_i.cc
src/GEOM_PY/structelem/__init__.py
src/GEOM_PY/structelem/parts.py
src/GEOM_SWIG/GEOM_TestAll.py
src/GEOM_SWIG/GEOM_TestMeasures.py
src/GEOM_SWIG/STEPPluginBuilder.py
src/GEOM_SWIG/geomBuilder.py
src/GEOM_SWIG_WITHIHM/CMakeLists.txt
src/GenerationGUI/CMakeLists.txt
src/GenerationGUI/GenerationGUI_FillingDlg.cxx
src/GenerationGUI/GenerationGUI_PipeDlg.cxx
src/GenerationGUI/GenerationGUI_PipeDlg.h
src/GenerationGUI/GenerationGUI_PipePathDlg.cxx
src/GenerationGUI/GenerationGUI_PrismDlg.cxx
src/GenerationGUI/GenerationGUI_RevolDlg.cxx
src/GroupGUI/CMakeLists.txt
src/GroupGUI/GroupGUI_GroupDlg.cxx
src/GroupGUI/GroupGUI_GroupDlg.h
src/IGESPlugin/CMakeLists.txt
src/IGESPlugin/IGESPlugin_ExportDlg.cxx
src/IGESPlugin/IGESPlugin_GUI.cxx
src/Material/CMakeLists.txt
src/MeasureGUI/CMakeLists.txt
src/MeasureGUI/MeasureGUI.cxx
src/MeasureGUI/MeasureGUI_AngleDlg.cxx
src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx
src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx
src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx
src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.h
src/MeasureGUI/MeasureGUI_CreateDimensionDlg.cxx
src/MeasureGUI/MeasureGUI_DistanceDlg.cxx
src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.cxx
src/MeasureGUI/MeasureGUI_InertiaDlg.cxx
src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx
src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx
src/MeasureGUI/MeasureGUI_NormaleDlg.cxx
src/MeasureGUI/MeasureGUI_PointDlg.cxx
src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx
src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.cxx [new file with mode: 0644]
src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.h [new file with mode: 0644]
src/MeasureGUI/MeasureGUI_WhatisDlg.cxx
src/MeasureGUI/MeasureGUI_definitions.h [new file with mode: 0644]
src/OBJECT/CMakeLists.txt
src/OCC2VTK/GEOM_EdgeSource.cxx
src/OperationGUI/CMakeLists.txt
src/PrimitiveGUI/CMakeLists.txt
src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx
src/RepairGUI/CMakeLists.txt
src/RepairGUI/RepairGUI.cxx
src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx
src/RepairGUI/RepairGUI_FuseEdgesDlg.cxx
src/RepairGUI/RepairGUI_GlueDlg.cxx
src/RepairGUI/RepairGUI_InspectObjectDlg.cxx
src/RepairGUI/RepairGUI_InspectObjectDlg.h
src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx
src/STEPPlugin/CMakeLists.txt
src/STEPPlugin/STEPPlugin_ExportDlg.cxx [new file with mode: 0644]
src/STEPPlugin/STEPPlugin_ExportDlg.h [new file with mode: 0644]
src/STEPPlugin/STEPPlugin_ExportDriver.cxx
src/STEPPlugin/STEPPlugin_GUI.cxx
src/STEPPlugin/STEPPlugin_IECallBack.cxx [changed mode: 0755->0644]
src/STEPPlugin/STEPPlugin_IExport.hxx
src/STEPPlugin/STEPPlugin_IOperations.cxx
src/STEPPlugin/STEPPlugin_IOperations.hxx
src/STEPPlugin/STEPPlugin_IOperations_i.cc
src/STEPPlugin/STEPPlugin_IOperations_i.hh
src/STEPPlugin/STEPPlugin_ImportDriver.cxx
src/STEPPlugin/STEPPlugin_msg_en.ts
src/STLPlugin/CMakeLists.txt
src/STLPlugin/STLPlugin_ExportDlg.cxx
src/STLPlugin/STLPlugin_GUI.cxx
src/ShapeRecognition/CMakeLists.txt
src/Tools/CMakeLists.txt [new file with mode: 0644]
src/Tools/geom_plugins.py [new file with mode: 0644]
src/Tools/t_shape/CMakeLists.txt [new file with mode: 0644]
src/Tools/t_shape/__init__.py [new file with mode: 0644]
src/Tools/t_shape/t_shape_builder.py [new file with mode: 0644]
src/Tools/t_shape/t_shape_dialog.py [new file with mode: 0644]
src/Tools/t_shape/t_shape_dialog.ui [new file with mode: 0644]
src/Tools/t_shape/t_shape_progress.py [new file with mode: 0644]
src/TransformationGUI/CMakeLists.txt
src/TransformationGUI/TransformationGUI_MirrorDlg.cxx
src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx
src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx
src/TransformationGUI/TransformationGUI_PositionDlg.cxx
src/TransformationGUI/TransformationGUI_ProjectionDlg.cxx
src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.cxx
src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.h
src/TransformationGUI/TransformationGUI_RotationDlg.cxx
src/TransformationGUI/TransformationGUI_ScaleDlg.cxx
src/TransformationGUI/TransformationGUI_TranslationDlg.cxx
src/VTKPlugin/CMakeLists.txt
src/VTKPlugin/VTKPlugin_ExportDlg.cxx
src/VTKPlugin/VTKPlugin_GUI.cxx
src/XAO/tests/TestUtils.hxx
src/XAOPlugin/CMakeLists.txt
src/XAOPlugin/XAOPlugin_Driver.cxx
src/XAOPlugin/XAOPlugin_Driver.hxx
src/XAOPlugin/XAOPlugin_IOperations.cxx
src/XAOPlugin/XAOPlugin_ImportDlg.cxx

index 6431c21614ac85def8da0e33de890b146667c58a..cd26147d5542ed6bed68ce8fb1e2e8528046075a 100755 (executable)
@@ -30,11 +30,11 @@ 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 6)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 7)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
+SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
 
 # Find KERNEL
 # ===========
@@ -108,7 +108,9 @@ IF(SALOME_BUILD_GUI)
   IF(EXISTS ${GUI_ROOT_DIR})
     LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
     FIND_PACKAGE(SalomeGUI)
-    FULL_GUI(TRUE) #check whether GUI builded in full mode and with CORBA
+    SALOME_GUI_WITH_CORBA() #check whether GUI builded with CORBA
+    SALOME_GUI_MODE(SALOME_USE_OCCVIEWER SALOME_USE_VTKVIEWER SALOME_USE_SALOMEOBJECT 
+                    OPTIONAL SALOME_USE_PLOT2DVIEWER SALOME_USE_GRAPHICSVIEW SALOME_USE_PYCONSOLE)
     ADD_DEFINITIONS(${GUI_DEFINITIONS})
     INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
   ELSE(EXISTS ${GUI_ROOT_DIR})
@@ -122,15 +124,17 @@ ENDIF(SALOME_BUILD_GUI)
 ##
 
 IF(SALOME_BUILD_GUI)
-
-  # Qt4
-  FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml)
-
-  # Optional prerequisites for GUI
-  IF(SALOME_USE_GLVIEWER)
-    FIND_PACKAGE(SalomeOpenGL)
-    SALOME_LOG_OPTIONAL_PACKAGE(OpenGL SALOME_USE_GLVIEWER) 
-  ENDIF() 
+  IF(NOT SALOME_GUI_BUILD_WITH_QT5)
+    # Qt
+    FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL QtNetwork)
+    # PyQt
+    FIND_PACKAGE(SalomePyQt4 REQUIRED)
+  ELSE()
+    # Qt
+    FIND_PACKAGE(SalomeQt5 REQUIRED)
+    # PyQt
+    FIND_PACKAGE(SalomePyQt5 REQUIRED)
+  ENDIF()
 ENDIF(SALOME_BUILD_GUI)
 
 ##
@@ -231,9 +235,12 @@ IF(SALOME_BUILD_GUI)
   LIST(APPEND _${PROJECT_NAME}_exposed_targets 
     AdvancedGUI BasicGUI BlocksGUI BooleanGUI BuildGUI DisplayGUI DlgRef CurveCreator EntityGUI GEOMBase
     GEOMFiltersSelection GEOM GEOMToolsGUI GenerationGUI GroupGUI Material MeasureGUI GEOMObject
-    OperationGUI PrimitiveGUI RepairGUI TransformationGUI DependencyTree
+    OperationGUI PrimitiveGUI RepairGUI TransformationGUI
     STLPluginGUI BREPPluginGUI STEPPluginGUI IGESPluginGUI XAOPluginGUI VTKPluginGUI
     )
+  IF(SALOME_USE_GRAPHICSVIEW)
+    LIST(APPEND _${PROJECT_NAME}_exposed_targets DependencyTree)
+  ENDIF(SALOME_USE_GRAPHICSVIEW)
 ENDIF(SALOME_BUILD_GUI)
 
 IF(SALOME_GEOM_USE_OPENCV)
index fe0e4b8f55687129720f7d41e6003aa4647c4d9a..42db6d36b81272b12252c6ee3f95aff42ddd8624 100644 (file)
@@ -69,32 +69,34 @@ IF(SALOME_GEOM_USE_OPENCV)
   LIST(APPEND GEOM_DEFINITIONS "-DWITH_OPENCV")
 ENDIF()
 
-# For all prerequisites, load the corresponding targets if the package was used 
+# For all prerequisites, load the corresponding targets if the package was used
 # in CONFIG mode. This ensures dependent projects link correctly
 # without having to set LD_LIBRARY_PATH:
-SET(_PREREQ @_PREREQ_LIST@)
-SET(_PREREQ_CONFIG_DIR @_PREREQ_DIR_LIST@)
-SET(_PREREQ_COMPONENTS "@_PREREQ_COMPO_LIST@")
-LIST(LENGTH _PREREQ_CONFIG_DIR _list_len)
-IF(NOT _list_len EQUAL 0)
+SET(_PREREQ_@PROJECT_NAME@ @_PREREQ_LIST@)
+SET(_PREREQ_@PROJECT_NAME@_CONFIG_DIR @_PREREQ_DIR_LIST@)
+SET(_PREREQ_@PROJECT_NAME@_COMPONENTS "@_PREREQ_COMPO_LIST@")
+LIST(LENGTH _PREREQ_@PROJECT_NAME@_CONFIG_DIR _list_len_@PROJECT_NAME@)
+IF(NOT _list_len_@PROJECT_NAME@ EQUAL 0)
   # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
-  MATH(EXPR _range "${_list_len}-1")
-  FOREACH(_p RANGE ${_range})  
-    LIST(GET _PREREQ            ${_p} _pkg    )
-    LIST(GET _PREREQ_CONFIG_DIR ${_p} _pkg_dir)
-    LIST(GET _PREREQ_COMPONENTS ${_p} _pkg_compo)
-    MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...")
-    IF(NOT _pkg_compo)
-      FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE 
-          PATHS "${_pkg_dir}" 
-          NO_DEFAULT_PATH)
-    ELSE()
-      STRING(REPLACE "," ";" _compo_lst "${_pkg_compo}")
-      MESSAGE(STATUS "===> (components: ${_pkg_compo})")
-      FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE
-          COMPONENTS ${_compo_lst} 
-          PATHS "${_pkg_dir}"
-          NO_DEFAULT_PATH)
+  MATH(EXPR _range_@PROJECT_NAME@ "${_list_len_@PROJECT_NAME@}-1")
+  FOREACH(_p_@PROJECT_NAME@ RANGE ${_range_@PROJECT_NAME@})
+    LIST(GET _PREREQ_@PROJECT_NAME@            ${_p_@PROJECT_NAME@} _pkg_@PROJECT_NAME@    )
+    LIST(GET _PREREQ_@PROJECT_NAME@_CONFIG_DIR ${_p_@PROJECT_NAME@} _pkg_dir_@PROJECT_NAME@)
+    LIST(GET _PREREQ_@PROJECT_NAME@_COMPONENTS ${_p_@PROJECT_NAME@} _pkg_compo_@PROJECT_NAME@)
+    IF(NOT OMIT_DETECT_PACKAGE_${_pkg_@PROJECT_NAME@})
+      MESSAGE(STATUS "===> Reloading targets from ${_pkg_@PROJECT_NAME@} ...")
+      IF(NOT _pkg_compo_@PROJECT_NAME@)
+        FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
+            PATHS "${_pkg_dir_@PROJECT_NAME@}"
+            NO_DEFAULT_PATH)
+      ELSE()
+        STRING(REPLACE "," ";" _compo_lst_@PROJECT_NAME@ "${_pkg_compo_@PROJECT_NAME@}")
+        MESSAGE(STATUS "===> (components: ${_pkg_compo_@PROJECT_NAME@})")
+        FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
+            COMPONENTS ${_compo_lst_@PROJECT_NAME@}
+            PATHS "${_pkg_dir_@PROJECT_NAME@}"
+            NO_DEFAULT_PATH)
+      ENDIF()
     ENDIF()
   ENDFOREACH()
 ENDIF()
index a437b407821414d21b884a2522095e0029cf3e54..afd0a3a6aa065702db4892b1bb9ef7b7d6374cc1 100644 (file)
@@ -68,6 +68,7 @@ SET(GOOD_TESTS
   complex_objs_ex09.py
   complex_objs_ex10.py
   complex_objs_ex11.py
+  fast_intersection.py
   free_boundaries.py
   free_faces.py
   GEOM_box.py
@@ -131,9 +132,9 @@ SET(GOOD_TESTS
   working_with_groups_ex05.py
   working_with_groups_ex06.py
 )
-IF(CAS_VERSION_STR VERSION_GREATER "6.8.0")
+IF(CAS_VERSION_STR VERSION_GREATER "6.9.0")
   LIST(APPEND GOOD_TESTS
-    fast_intersection.py
+    check_self_intersections_fast.py
   )
 ENDIF()
 
index 8df91b9fe480015bbb1a8c30063db2dd3a2904f3..f70a545408742406726db20a2cda0181fba96cc9 100644 (file)
@@ -7,9 +7,15 @@ from salome.geom import geomBuilder
 geompy = geomBuilder.New(salome.myStudy)
 
 # create a box
-box = geompy.MakeBoxDXDYDZ(100,30,100)
-IsValid = geompy.CheckSelfIntersections(box)
-if IsValid == 0:
-    raise RuntimeError, "Box with self-intersections created"
+box = geompy.MakeBoxDXDYDZ(100,100,100)
+# create a cylinder
+cylinder = geompy.MakeCylinderRH(100, 300)
+# make a compound
+compound = geompy.MakeCompound([box, cylinder])
+
+# check self-intersection
+IsValid = geompy.CheckSelfIntersections(compound)
+if not IsValid:
+    print "Shape is self-intersected!"
 else:
-    print "\nBox is valid"
+    print "No self-intersection detected in a shape"
diff --git a/doc/salome/examples/check_self_intersections_fast.py b/doc/salome/examples/check_self_intersections_fast.py
new file mode 100644 (file)
index 0000000..83c8a74
--- /dev/null
@@ -0,0 +1,21 @@
+# Detect Self-intersections fast
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+# create a box
+box = geompy.MakeBoxDXDYDZ(100,100,100)
+# create a cylinder
+cylinder = geompy.MakeCylinderRH(100, 300)
+# make a compound
+compound = geompy.MakeCompound([box, cylinder])
+
+# check self-intersection
+IsValid = geompy.CheckSelfIntersectionsFast(compound)
+if not IsValid:
+    print "Shape is self-intersected!"
+else:
+    print "No self-intersection detected in a shape"
index f38f0816b6feeb868b48d8a04ebf56203813a155..f6681b587c798827bfd27ca6722e22db4fba2c3c 100644 (file)
@@ -18,18 +18,22 @@ circles.append(geompy.MakeCircle(vertices[1], edges[0], 40))
 circles.append(geompy.MakeCircle(vertices[2], edges[2], 30))
 circles.append(geompy.MakeCircle(vertices[3], edges[2], 20))
 
-# create pipe
-Pipe = geompy.MakePipeWithDifferentSections(circles, vertices, Wire_1, 0, 0)
+# create pipes
+Pipe1 = geompy.MakePipeWithDifferentSections(circles, vertices, Wire_1, 0, 0)
+Pipe2 = geompy.MakePipeWithDifferentSectionsBySteps(circles, vertices, Wire_1)
 
 # add objects in the study
 geompy.addToStudy(circles[0], "circles1")
 geompy.addToStudy(circles[1], "circles2")
 geompy.addToStudy(circles[2], "circles3")
 geompy.addToStudy(circles[3], "circles4")
-id_wire = geompy.addToStudy(Wire_1, "Path")
-id_pipe = geompy.addToStudy(Pipe, "Pipe")
+id_wire  = geompy.addToStudy(Wire_1, "Path")
+id_pipe1 = geompy.addToStudy(Pipe1, "Pipe1")
+id_pipe2 = geompy.addToStudy(Pipe2, "Pipe2")
 
 # display the wire(path) and the pipe
 gg.createAndDisplayGO(id_wire)
-gg.createAndDisplayGO(id_pipe)
-gg.setDisplayMode(id_pipe,1) 
+gg.createAndDisplayGO(id_pipe1)
+gg.createAndDisplayGO(id_pipe2)
+gg.setDisplayMode(id_pipe1,1)
+gg.setDisplayMode(id_pipe2,1)
index 0f16a4288907a43b2b2b331f383f62f86e20cd0d..3e0e49698afcd901bb360a5fdb35523aea1f55dc 100755 (executable)
@@ -24,11 +24,21 @@ import unittest, sys, os
 class SalomeSession(object):
     def __init__(self, script):
         import runSalome
-        sys.argv  = ["runSalome.py"]
+        run_script = "runSalome.py"
+        if sys.platform == 'win32':
+            module_dir = os.getenv("KERNEL_ROOT_DIR")
+            if module_dir: run_script = os.path.join(module_dir, "bin", "salome", run_script)
+            pass
+        sys.argv  = [run_script]
         sys.argv += ["--terminal"]
         sys.argv += ["--modules=GEOM"]
         sys.argv += ["%s" % script]
+        if sys.platform == 'win32':
+            main_module_path = sys.modules['__main__'].__file__
+            sys.modules['__main__'].__file__ = ''
         clt, d = runSalome.main()
+        if sys.platform == 'win32':
+            sys.modules['__main__'].__file__ = main_module_path
         return
 
     def __del__(self):
index 3639181c4d03cd8920303464a680da6bb3b6288a..2f489aefb3be3851e0ea20f20b148ea680525640 100644 (file)
@@ -117,16 +117,22 @@ if __name__ == "__main__":
     if len( args ) < 1: sys.exit("Plugin name is not specified")
 
     f = open(options.output, "w")
-    
+
+    if len(args) > 1:
+        plugins_names = " ".join(args) + " plugins"
+    elif len(args) == 1:
+        plugins_names = args[0] + " plugin"
+    else:
+        plugins_names = ""
     output = []
     if options.dummygeomhelp:
         output.append( "## @package geomBuilder" )
-        output.append( "#  Documentation of the methods dynamically added by the " + plugin_name + " Geometry plug-in to the geomBuilder class." )
+        output.append( "#  Documentation of the methods dynamically added by the " + plugins_names + " to the @b %geomBuilder class." )
         # Add dummy Geometry help
         # This is supposed to be done when generating documentation for Geometry module plug-ins
         output.append( "#  @note The documentation below does not provide complete description of class @b %geomBuilder" )
         output.append( "#  from @b geomBuilder package. This documentation provides only information about" )
-        output.append( "#  the methods dynamically added to the %geomBuilder class by the " + plugin_name + " plugin" )
+        output.append( "#  the methods dynamically added to the %geomBuilder class by the " + plugins_names + "." )
         output.append( "#  For more details on the %geomBuilder class, please refer to the SALOME %Geometry module" )
         output.append( "#  documentation." )
         pass
index c7f55074e27ea482a3fe678945ae82c6b0ea61e4..4501fa61ff4701073ab349387730f3f9ec365f1d 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/editgroup.png and b/doc/salome/gui/GEOM/images/editgroup.png differ
index 0f67a625c1f772ed7a469793c067a109ff01e0e1..c982f0bc93886bc8de8acdf5d47824c77bc3c99b 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/geomcreategroup.png and b/doc/salome/gui/GEOM/images/geomcreategroup.png differ
index 09d90d0699337e4314fb5409490731e33a5af3f9..23065bd2edba206a5ae4212b65474085ed186a46 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/inspect_object.png and b/doc/salome/gui/GEOM/images/inspect_object.png differ
diff --git a/doc/salome/gui/GEOM/images/inspect_object2.png b/doc/salome/gui/GEOM/images/inspect_object2.png
new file mode 100644 (file)
index 0000000..121e152
Binary files /dev/null and b/doc/salome/gui/GEOM/images/inspect_object2.png differ
index 6ee44987416555bf22ca65b9ea84c5a5835cb1b6..562714d31227c690518d3a8011b2e264e248096d 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/measures11.png and b/doc/salome/gui/GEOM/images/measures11.png differ
diff --git a/doc/salome/gui/GEOM/images/measures13.png b/doc/salome/gui/GEOM/images/measures13.png
new file mode 100644 (file)
index 0000000..6e9deb5
Binary files /dev/null and b/doc/salome/gui/GEOM/images/measures13.png differ
index d1b7f403112e899f565dd7a357a33e951efaa125..c5c3149152a256cb0e62efc775af7a4aaebc1902 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/pipe3.png and b/doc/salome/gui/GEOM/images/pipe3.png differ
old mode 100755 (executable)
new mode 100644 (file)
index 8b4daec..57cccab
Binary files a/doc/salome/gui/GEOM/images/point3.png and b/doc/salome/gui/GEOM/images/point3.png differ
diff --git a/doc/salome/gui/GEOM/images/proj_on_cyl_angles.png b/doc/salome/gui/GEOM/images/proj_on_cyl_angles.png
new file mode 100644 (file)
index 0000000..0d36e4e
Binary files /dev/null and b/doc/salome/gui/GEOM/images/proj_on_cyl_angles.png differ
index 38d81b51e0461caac799cb46997592cb84b20fa2..7ce80c1e897a60b40a0bbb02acbd830a3d34a59a 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/proj_on_cyl_dlg.png and b/doc/salome/gui/GEOM/images/proj_on_cyl_dlg.png differ
diff --git a/doc/salome/gui/GEOM/images/shape_statistics.png b/doc/salome/gui/GEOM/images/shape_statistics.png
new file mode 100644 (file)
index 0000000..2aaaa9a
Binary files /dev/null and b/doc/salome/gui/GEOM/images/shape_statistics.png differ
diff --git a/doc/salome/gui/GEOM/images/shape_statistics_simple.png b/doc/salome/gui/GEOM/images/shape_statistics_simple.png
new file mode 100644 (file)
index 0000000..bc2c076
Binary files /dev/null and b/doc/salome/gui/GEOM/images/shape_statistics_simple.png differ
index 187cefbcd32284196cfbca0bc504a0e84648a652..92d6c31a11e968a6fbc79966bac824b4e18c4ca2 100644 (file)
@@ -10,25 +10,24 @@ This operation is available in <b>OCC Viewer</b> only.
 
 The \b Result will be a \b GEOM_Object.
 
-\n Location of a new vertex on a selected edge can be defined two ways:
+\n The location of a new vertex on the selected edge can be defined in two ways:
 <ol>
-  <li> We can specify a position (ranging from 0.0 to 1.0) of the
-    vertex on the selected edge either by length or by parameter.
+  <li> By specifying the position (ranging from 0.0 to 1.0) by length or by parameter.
     <p>
     <b>TUI Command:</b> <em>geompy.DivideEdge(Shape, EdgeID, Value,
       IsByParameter)</em>
     <ul>
-      <li> \em Shape is a shape which contains an edge to be divided</li>
+      <li> \em Shape is a shape, which contains an edge to be divided;</li>
       <li>\em EdgeID is the ID of the edge to be divided, if it is = -1,
-        then \em Shape should be an edge itself.</li>
+        then \em Shape should be an edge itself;</li>
       <li> \em Value is a value of parameter on edge or length parameter,
-        depending on \em IsByParameter</li>
-      <li> \em IsByParameter is a boolean flag, specifying operation mode:
-        - \c True: \em Value is treated as a curve parameter [0..1]
-        - \c False: \em Value is treated as a length parameter [0..1] </li>
+        depending on \em IsByParameter;</li>
+      <li> \em IsByParameter is a boolean flag, specifying the operation mode:
+        - \c True: \em Value is treated as a curve parameter; [0..1]
+        - \c False: \em Value is treated as a length parameter. [0..1] </li>
     </ul>
     \b Arguments: Name + 1 Edge + 1 Value setting the position of
-    the point according to one of the selected modes.
+    the point according to the selected mode.
 
     The difference between "by parameter" and "by length" modes becomes
     apparent on the edges with irregular parametrization (for example,
@@ -41,15 +40,15 @@ The \b Result will be a \b GEOM_Object.
     \image html repair8.png
     \n\n
   </li>
-  <li>We can select several points that will be projected to the selected
+  <li> By selecting several points that will be projected to the selected
     edge to find the location of new vertices.
     <p>
-    <b>TUI Command:</b> <em>geompy.DivideEdgeByPoint(Shape, Edge, Points)</em>
+    <b>TUI Command:</b> <em>geompy.DivideEdgeByPoint(Shape, Edge, Points):</em>
     <ul>
-      <li> \em Shape is a shape which contains an edge to be divided</li>
-      <li>\em Edge is an edge to be divided (or it's ID, if it is = -1,
-        then \em Shape should be an edge itself).</li>
-      <li> \em Points is a list of points to project to \a Edge. </li>
+      <li> \em Shape is a shape, which contains an edge to be divided;</li>
+      <li>\em Edge is an edge to be divided (or its ID, if it is = -1,
+        then \em Shape should be an edge itself);</li>
+      <li> \em Points is a list of points to be projected to the \a Edge.</li>
     </ul>
     \b Arguments: Name + 1 Edge + 1 or more Points.
 
index 7151dcff7b27f3e73980b9f277ac296e76c63d9f..5b95a87231604430dedfeb3b15704ab8e4d48421 100644 (file)
@@ -2,16 +2,17 @@
 
 \page check_compound_of_blocks_page Check Compound of Blocks
 
-This operation checks whether a shape is a compound of glued blocks. 
+This operation checks whether a shape is a compound of glued blocks
+and improves the shape to include only valid blocks.
 
 \image html measures10.png
 
 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 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.
+- Each element of the compound should be a Block, i.e. have 6 quadrangle faces;
+- Each quadrangle face should have one wire with four edges. If there are
+more than four edges in a single wire and C1 continuity mode is switched on,
+a face is quadrangular if it has four bounds with 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.
@@ -20,14 +21,21 @@ a face is quadrangular if it has 4 bounds of C1 continuity.
 In this dialog:
 
 - \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>Use C1 criterion</b> - option switches 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;
        - Extra or degenerated edge.
-- <b>Incriminated Sub-shapes</b> field outputs the list of sub-shapes that cause problem. It is possible to select them in the list and publish in the study for further analysis by clicking \b Apply or <b>Apply and Close</b> button. 
+- <b>Incriminated Sub-shapes</b> field outputs the list of sub-shapes that cause problem.
+- \b Apply and <b>Apply and Close</b> buttons launch the improvement process
+and publish the result shape, which includes valid blocks only. The
+algorithm tries to:
+   - remove seam and degenerated edges from surfaces of revolution;
+   - re-approximate surfaces to exclude singularities on boundaries;
+   - unite edges and faces;
+   - glue faces.
 
 
 \n <b>TUI Command:</b>
@@ -38,4 +46,4 @@ is returned, and encountered errors are printed in the python console.
 See also a \ref tui_check_compound_of_blocks_page "TUI example".
 
 
-*/
\ No newline at end of file
+*/
index 8cf4d57bfa47bb07278e1719d814ac6759154088..8533274e27a496a38e11ff2fb100e2c269ee3d55 100644 (file)
@@ -2,6 +2,14 @@
 
 \page check_self_intersections_page Detect Self-intersections
 
+\n To <b>Detect Self-intersections,</b> select in the <b>Main Menu</b> 
+<b>Inspection - > Detect Self-intersections</b>.
+
+There are two ways to check self-intersections.
+
+\anchor check_self_intersections_topological
+<br><h3>Check topological intersections</h3>
+
 This operation checks the topology of the selected shape to detect self-intersections.
 
 \image html measures11.png
@@ -9,17 +17,14 @@ This operation checks the topology of the selected shape to detect self-intersec
 In this dialog:
 
 - \b Object - the checked object. \b Selection button allows picking it in the viewer or in the object browser.
-- <b>Level of check</b> - The combo box that allows to set the level of checking shape on self-interference.
-  It defines which interferferences will be checked. Default value is "All interferences".
-- <b>Compute self-intersections</b> button computes self-interferences.
-- \b Summary section contains the general report if the object has self-intersections and/or if errors are occured during computation.
-- \b Self-intersections list contains the list of self-intersections detected.
-Select the intersection(s) to show <b>Sub-shapes</b> in the field to the right. 
-- \b Apply and <b>Apply and Close</b> buttons are used to store interferences selected in the "Self-intersections" list box in the study for further analysis.
-If no any interference is selected, all interferences are published in the study. Each interference is published as a child
-compound of the source shape and contains a couple of intersecting sub-shapes.
-
-\note This tool is useful for detection of shapes, not suitable for
+- <b>Level of check</b> - combo box allows setting the level of self-interference checking. It defines, which interferences will be checked. The default value is "All interferences".
+- <b>Compute self-intersections</b> button performs the computation.
+- \b Summary section contains the general report about self-intersections of the object and/or errors that occurred during the computation.
+- \b Self-intersections list contains the list of detected self-intersections. Select the intersection to show <b>Sub-shapes</b> in the field to the right. 
+- \b Apply and <b>Apply and Close</b> buttons store the interferences selected in the <b>Self-intersections</b> list box in the study for further analysis. 
+If no interferences are selected, all of them are published in the study. Each interference is published as a child compound of the source shape and contains a couple of intersecting sub-shapes.
+
+\note This tool is useful for detection of shapes that are not suitable as
 arguments of Boolean operations and Partition algorithm.
 For more information about Partition and Boolean Operations Algorithms
 and their limitations refer to <a href="SALOME_BOA_PA.pdf">this document</a>.
@@ -32,5 +37,39 @@ where: \n
 
 See also a \ref tui_check_self_intersections_page "TUI example".
 
+\anchor check_self_intersections_fast
+<br><h3>Fast intersection</h3>
+
+This operation allows quickly detecting self-interferences of the given shape using the algorithm based on mesh intersections.
+
+The algorithm works on the face level, i.e. it computes only face-to-face intersections. No additional intersection types are computed.
+
+This can be useful to detect all intersections between subshapes of type "surface" in an assembly.
+The result quality will depend on the tesselation quality. However, small deflection values can significantly decrease the performance of the algorithm.
+Nevertheless, the performance of Fast Intersect algorithm is much higher than that of the topological intersection.
+
+\image html measures13.png
+
+In this dialog:
+
+- \b Object - the checked object. \b Selection button allows picking it in the viewer or in the object browser.
+- <b>Deflection coefficient</b> -  a linear deflection coefficient that defines the tesselation quality. If theDeflection <= 0, default deflection 0.001 is used.
+- <b>Detect gaps with tolerance</b> specifies the distance between shapes used for detecting gaps:
+     - if theTolerance <= 0, the algorithm detects intersections;
+     - if theTolerance > 0, the algorithm detects gapss. 
+- <b>Compute self-intersections</b> button performs the computation.
+- \b Summary section contains the general report about self-intersections of the object and/or errors that occurred during the computation.
+- \b Self-intersections list contains the list of detected self-intersections. Select the intersection to show <b>Sub-shapes</b> in the field to the right. 
+- \b Apply and <b>Apply and Close</b> buttons store the interferences selected in the <b>Self-intersections</b> list box in the study for further analysis. 
+If no interferences are selected, all of them are published in the study. Each interference is published as a child compound of the source shape and contains a couple of intersecting sub-shapes.
+
+\n <b>Result:</b> Boolean.
+\n <b>TUI Command:</b> <em>geompy.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance),</em> \n
+where: \n
+\em theShape is the shape checked for validity. \n
+\em theDeflection that specifies the quality of tesselation. 
+\em theTolerance Specifies the distance between shapes used for detecting gaps.
+
+See also a \ref tui_check_self_intersections_fast_page "TUI example".
 
-*/
\ No newline at end of file
+*/
index 1fbb1d6a266be6b6242b76cb2258f8b3228a09c6..01b6eb85f16210a389c2e7ff33dc9ce4c3f773b4 100644 (file)
@@ -15,10 +15,8 @@ axis, creating a body of revolution.</li>
 <li>\subpage create_extrusion_alongpath_page "Extrude an object along a path",
 creating a more complex trajectory object.</li>
 <li>\subpage create_pipe_path_page "Restore Path" of a pipe-like shape.</li>
-<li>\subpage create_thickness_page "Thickness" operation that allows to add a thickness to objects.</li>
-
-<li>\subpage create_groups_page "Generate Groups".
-This cross-operation functionality allows creation of groups for certain generation operations.</li>
+<li>\subpage create_thickness_page "Add thickness" to objects.</li>
+<li>\subpage create_groups_page "Generate Groups" for certain generation operations.</li>
 </ul>
 
 <b> New entity -> Advanced </b> sub-menu allows creating new geometric
index c25b719ae4545df649247c7e4442441d8a3d4a05..69377397357422652da8702a20691801ffe383fe 100644 (file)
@@ -16,7 +16,7 @@ obtain from it.
 The \b Result of the operation will be a List of \b GEOM_Objects
 (vertexes, edges, wires, faces, shells or solids).
 
-Available choices in the <b>Sub Shapes Type</b> combo box depend on the type
+The choices available in the <b>Sub Shapes Type</b> combo box depend on the type
 of selected <b>Main Object</b>:
 - \b Compound: to extract compounds;
 - \b Compsolid: to extract compsolids;
@@ -29,72 +29,70 @@ of selected <b>Main Object</b>:
 - \b Shape: to extract top-level contents of the compound shape;
 - \b Flat: to extract "flat" contents of the compound shape.
 
-Note: "flat" contents means top-level simple-type sub-shapes extracted from
-the compound object recursively (i.e. there is no compounds in the result).
-For example, if a compound C1 contains a solid S1 and another compound C2 that
-contains solids S2 and S3 (see picture below):
+Note: "flat" contents means that top-level simple-type sub-shapes are extracted from
+the compound object recursively (i.e. there are no compounds in the result).
+
+Let us take, for example, compound C1 that contains solid S1 and another compound C2 that
+contains solids S2 and S3 (see the picture below):
 - Explode operation with \b Shape type given as parameter will return S1 and C2;
 - Explode operation with \b Flat type given as parameter will return S1, S2 and S3.
 
 \image html flat_contents.png
 
 Switching on <b>Select Sub-shapes</b> check box allows manual selection of sub-shapes
-to be extracted from the main object. In this mode the user can select sub-shapes
+to be extracted from the main object. In this mode it is possible to select sub-shapes
 directly in 3D viewer.
 
 When <b>Select Sub-shapes</b> check box is switched on, additional \b Filter controls
-allow to automatically pick up entites which satisfy specified threshold value(s).
-The numerical functor for each sub-shape that is compared with threshold value(s)
-is computed according to the shape's topological properties:
-- length for edges and wires
-- area for faces and shells
-- volume for solids, compounds, compsolids
+allow to automatically pick up entities, which satisfy the specified threshold value(s).
+The numerical functor for each sub-shape that is compared with the threshold value(s)
+is computed according to the topological properties of the shape:
+- length for edges and wires;
+- area for faces and shells;
+- volume for solids, compounds and compsolids. 
 
 Filtering capabilities are not available for vertices.
 
-In order to filter out some entities:
-- Activate one or two filtering controls by switching on corresponding check boxes;
-- Select required threshold comparator type; the following choices are available:
+To filter out some entities it is necessary to do the following:
+- Activate one or two filtering controls by switching on the corresponding check boxes;
+- Select the required threshold comparator type; the following choices are available:
   - <b>Less Than</b> or <b>Equal or Less Than</b> for the first comparator;
   - <b>Greater Than</b> or <b>Equal or Greater Than</b> for the second comparator;
-- Enter required threshold value (values);
+- Enter the required threshold value (values);
 - Press \b Apply button in the \b Filter group.
 
-The entities which satisfy entered filtering parameters will be automatically highlighted
+The entities, which correspond to the entered filtering parameters, will be automatically highlighted
 in the 3D viewer.
 
 Using <b>TUI Commands</b> you can perform this operation in a
 variety of ways:
 - <em>geompy.ExtractShapes(Shape, Type, isSorted)</em> explodes a
   Shape into sub-shapes of a given Type and returns a List of sub-shapes.
-  This method does not return the Shape itself if it matches the
-  Type.
-- <em>geompy.SubShapeAll(Shape, Type)</em> explodes a Shape on
+  This method does not return the Shape itself if it matches the Type.
+- <em>geompy.SubShapeAll(Shape, Type)</em> explodes a Shape into
   sub-shapes of a given Type and returns a List of sub-shapes.
-- <em>geompy.SubShapeAllIDs(Shape, Type)</em> explodes a Shape on
-  sub-shapes of a given Type and returns a List of IDs of
-  sub-shapes.
+- <em>geompy.SubShapeAllIDs(Shape, Type)</em> explodes a Shape into sub-shapes of a given Type and returns a List of IDs of sub-shapes.
 - <em>geompy.SubShapeAllSortedCentres(Shape, Type)</em> explodes a
-  shape on sub-shapes of a given type and sorts them taking into account
+  shape into sub-shapes of a given type and sorts them taking into account
   their gravity centers, to provide a 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
+  a shape into sub-shapes of a given type and sorts them taking into
   account their gravity centers, to provide a 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
+  a compound of sub-shapes of the Shape, selected by their indexes in a
   list of all sub-shapes of the given Type. Each index is in the range
   [1, Nb_Sub-Shapes_Of_Given_Type].
 - <em>geompy.SubShapeSortedCentres(Shape, Type, ListOfInd)</em>
   allows to obtain a compound of sub-shapes of the Shape, selected by
-  they indices in sorted list of all sub-shapes of the given Type. Each
+  their indexes in a sorted list of all sub-shapes of the given Type. Each
   index is in the range [1, Nb_Sub-Shapes_Of_Given_Type]
 
 <b>Arguments: </b>1 SHAPE + 1 type of SubShape.
 
 <b>Example:</b>
 
-\image html explode.png "A box, exploded into faces"
+\image html explode.png "A box exploded into faces"
 
 */
index 07808936287ba6ee8e1b666213f0cec263aa5fd1..84260fe68dac34089737d6dcf4d9cf330bc57d92 100644 (file)
@@ -72,18 +72,33 @@ Additional controls:
 - If <b>With contact</b> is checked, the section is translated in contact with the spine.
 - If <b>With correction</b> is checked, the section is rotated to be orthogonal to the spine
 tangent in the corresponding point.
+- If <b>Step-by-step generation</b> is checked, the result is created
+step-by-step, i.e. it creates pipes between each pair of neighbor sections and
+fuses them into a single shape.
+
+\note If <b>Step-by-step generation</b> is checked, <b>With contact</b> and
+<b>With correction</b> controls are disabled as corrections of bases are
+not allowed in step-by-step mode.
 
 <b>Generate groups</b> checkbox - if checked allows to create groups of
 sub-shapes. For more details on groups creation please refer to
 \ref create_groups_page "this description".
 \n The \b Result of the operation will be a shell or a solid.
 
-\n <b>TUI Command:</b> <em>geompy.MakePipeWithDifferentSections(baseShape, locations, pathShape, withContact, withCorrection,
+\n <b>TUI Commands:</b>
+- <em>geompy.MakePipeWithDifferentSections(baseShape, locations, pathShape, withContact, withCorrection,
  IsGenerateGroups=False)</em>
 \n <b>Arguments:</b> Name + list of shapes (edges, planar wires, faces or shells) serving as base object + 
 list of locations (vertices) on the path corresponding specified list of the shapes + 
 1 shape (edge or wire) for definition of the path + 
 3 Boolean parameters (withContact, withCorrection, IsGenerateGroups).
+- <em>geompy.MakePipeWithDifferentSectionsBySteps(baseShape, locations, pathShape,
+ IsGenerateGroups=False)</em>
+\n <b>Arguments:</b> Name + list of shapes (edges, planar wires, faces or shells) serving as base object +
+list of locations (vertices) on the path corresponding specified list of the shapes +
+1 shape (edge or wire) for definition of the path +
+Boolean parameter.
+
 \n <b>Advanced options</b> \ref preview_anchor "Preview"
 
 \image html pipe3.png
index cb626f83d0e1665576a83171547ee0cd467a0823..e75288de730c49f3617e952d802733a75e57ff14 100644 (file)
@@ -11,7 +11,7 @@ of the operation will be a GEOM_Object (FACE).
 \n Firstly, to create a \b Face you need to select input shape(s). The list of
 input shapes can include shapes of any type except vertices; if the shapes are
 neither wires nor edges, the algorithm extracts all edges from
-the input shapes and works on the obtaineed edges.
+the input shapes and works on the obtained edges.
 \n The edges and wires do not necessarily have to be closed, the
 algorithm automatically builds a wire of maximum length from all
 given edges and wires. If several closed wires are detected the algorithm tries
@@ -26,7 +26,7 @@ exceeds 1e-06, a warning will be shown, but the face will be created
 and published in the study in a normal way. Using such faces can lead to failures
 or unpredictable results in most operations.
 
-\n The \b Result will be a \b GEOM_Object (FACE).
+\n The \b Result will be a \b GEOM_Object. It can be either a single face or, in specific cases, a compound of faces.
 
 \n <b>TUI Command:</b> <em>geompy.MakeFaceWires([list of Shapes], isPlanarWanted)</em>
 \n <b>Arguments:</b> Name + 1 wire.
@@ -35,7 +35,7 @@ or unpredictable results in most operations.
 
 \n Secondly, it is possible to create a face based on another face's surface and bounded by a wire.
 
-\n The \b Result will be a \b GEOM_Object (FACE).
+\n The \b Result will be a \b GEOM_Object (face).
 
 \n <b>TUI Command:</b> <em>geompy.MakeFaceFromSurface(theFace, theWire)</em>
 \n <b>Arguments:</b> Name + 1 face + 1 wire.
@@ -50,7 +50,7 @@ and constraints:
 
 \note Please note, that the constraint face must be connected to a reference edge.
 
-\n The \b Result will be a \b GEOM_Object (FACE).
+\n The \b Result will be a \b GEOM_Object (face).
 
 \n <b>TUI Command:</b> <em>geompy.MakeFaceWithConstraints([List of constraints])</em>
 \n <b>Arguments:</b> Name + List of input edges and constraint faces. If a constraint
index c69418547ebbf10e564707fb3b4e96be27799a64..9736a29822525523b734f43acd523d697e4b2d00 100644 (file)
@@ -3,7 +3,9 @@
 \page create_isoline_page Isoline
 
 \b Isoline is a 3D curve built on a bounded face limited by <em> [Umin, Umax] </em> and <em> [Vmin, Vmax] </em>
-values of U and V parameters. For all points of the isoline U or V parameter value is constant. 
+values of U and V parameters. For all points of the isoline U or V parameter value is constant.
+
+Result of this operation is either a single edge or a compound of edges.
 
 To create an \b Isoline of a face in the <b>Main Menu</b> select <b>New Entity - > Basic - > Isoline</b>.
 
index cc879062498c9530ddc4681c043aba4612a177f2..5929a8fd1a21888417a43f9c4342130c92123a51 100644 (file)
@@ -28,9 +28,10 @@ the position of this point regarding the reference one.
 \n Thirdly, we can define a point by an \b Edge and a \b Parameter
 indicating its position on the Edge, ranging from 0.0 to 1.0. For example, 0.5 means that the
 point is located in the middle of the edge.
-\n <b>TUI Command:</b> <em>geompy.MakeVertexOnCurve(Edge,Parameter).</em>
+\n <b>TUI Command:</b> <em>geompy.MakeVertexOnCurve(Edge,Parameter,takeOrientationIntoAccount).</em>
 \n <b>Arguments:</b> Name + 1 edge  + 1 Parameter defining the
-position of the point on the given edge.
+position of the point on the given edge + flag that tells if it is necessary
+to take the edge orientation into account.
 \image html point3.png
 
 Alternatively, it is possible to define a point by an \b Edge and a \b Length.
index 32cc8783ce2d37850828216dc1fb78235dbdf533..822b8d95313ce27fab974cddd600bff8a0e3b731 100644 (file)
@@ -6,7 +6,7 @@ To create a \b Shell in the <b>Main Menu</b> select <b>New Entity - >
 Build - > Shell</b>
 
 \n You can create a \b Shell from a compound of faces or a list of faces or shells.
-\n The \b Result will be a \b GEOM_Object (shell).
+\n The \b Result will be a \b GEOM_Object. It can be either a single shell or, in specific cases, a compound of shells.
 
 \n <b>TUI Command:</b> <em>geompy.MakeShell(ListOfShape)</em>
 \n <b>Arguments:</b> Name + Compound of faces or List of faces having connected edges.
index 6034ed5e313a2718cbb9bdd337f31ad24cb5323f..a707dc64e6c840356bb002923258079ca9d56cb8 100644 (file)
@@ -4,10 +4,10 @@
 
 To create a <b>Surface From Face</B> in the <b>Main Menu</b> select <b>New Entity - > Basic - > Surface From Face</b>
 
-\n 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).
+\n This function takes a face at input and creates a new
+<b>GEOM_Object</b>, i.e. topological shape by extracting the underlying surface
+of the source face and limiting it by the <b>Umin, Umax, Vmin</b> and <b>Vmax</b>
+parameters of the source face (in the parametric space).
 \n
 \ref restore_presentation_parameters_page "Advanced options".
 
index 140c02fc1b6df970e71c8f8ae670a6bf69399af2..88dfc221e067d911981439bbe270a2cd6d1c2b5e 100644 (file)
@@ -2,26 +2,28 @@
 
 \page create_thickness_page Thickness Construction
 
-To add a \b Thickness to a shape in the <b>Main Menu</b> select <b>New Entity - > Generation  - > Thickness</b>
-\n
-It is possible to create a Solid from a Face or a Shell by applying a
-\b Thickness. To do it you should define an \b Object that is a Face or a
-Shell, \b Thickness and to define the thickness direction by means of
-<b>Thicken towards the inside</b> check box.
+To add \b Thickness to a shape in the <b>Main Menu</b> select <b>New Entity - > Generation  - > Thickness</b>.
+
+Switch between adding thickness to a Face (Shell) or a Solid using radio buttons.
+
+Firstly, \b Thickness can be applied to a Face or a Shell to create a Solid.
 
 \image html thickness.png
 
+It is necessary to define an \b Object (Face or Shell) and the value of \b Thickness.
+<b>Thicken towards the inside</b> check box allows changing the thickness direction.
+
 <b>Example:</b>
 
 \image html thickness_result.png "Thickness of Shell"
 
-It is possible to apply \b Thickness to a Solid. The result of this operation
-is the hollowed Solid. To do it you should define an \b Object that is a Solid,
-\b Faces to be removed from result, \b Thickness and the thickness direction by
-means of <b>Thicken towards the inside</b> check box.
+Secondly, the \b Thickness can be applied to a Solid to create a hollowed Solid. 
 
 \image html thicksolid.png
 
+It is necessary to define a Solid \b Object \b Faces to be removed from the result and \b Thickness.
+<b>Thicken towards the inside</b> check box allows changing the thickness direction.
+
 <b>Example:</b>
 
 \image html thicksolid_result.png "Thickness of Solid"
@@ -36,8 +38,8 @@ Modifies a shape to make it a thick solid.
 
 <b>Arguments:</b> Name + 1 shape (face, shell or solid) + thickness +
 the list of face IDs.
-\n If the shape is face or shell the list of face IDs is not used.
-The thickness can be positive or negative for thicken towards the inside.
+\n If the shape is a face or a shell the list of face IDs is not used.
+The thickness can be positive or negative for thickening towards the inside.
 \n\n <b>Advanced options</b> \ref preview_anchor "Preview"
 
 Our <b>TUI Scripts</b> provide you with useful examples of creation of
index 2f07c9bd33867c731636559d2d5908f1341e3dc9..b9bbe9566423190ef2ab915a37f7ff73489b9dcd 100644 (file)
@@ -28,13 +28,15 @@ It is also possible to select an object(s) directly in the "Dependency Tree" vie
 
 All necessary parameters of Dependency Tree Viewer can be edited in the \ref pref_dependency_tree "Preferences".
 
+\note This functionality is available only if the GUI module is built with Graphics view (option SALOME_USE_GRAPHICSVIEW is ON when building GUI module).
+
 <hr>
 \anchor dependency_tree_nodes_anchor <h2>Nodes</h2>
 
 Tree nodes in the Dependency Viewer are named according to the study 
 names of the corresponding objects. 
 
-All nodes have fixed size, so long names are cut; the full object name can be seen in the tooltip 
+All nodes have fixed size, so long names are cut; the full object name can be seen in the tool-tip 
 when the cursor is hovered over the node.
 
 "Dependency Tree" view supports the following states of nodes:
@@ -61,11 +63,11 @@ Browser, OCC Viewer or Dependency Tree Viewer;</li></ul>
 Dependency Tree Viewer shows oriented links between nodes to 
 represent the dependency direction. The viewer supports the following states of links:
 
-<ul><li><b>Unidirectional link</b> - shows that object B depends on object A;</li></ul>
+<ul><li><b>Unidirectional link</b> - shows that object \b B depends on object \b A;</li></ul>
 \image html tree_unidir_link.png
 
-<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>
+<ul><li><b>Bidirectional link</b> - shows that object \b B depends on 
+object \b A and, at the same time, object \b A depends on object \b B;</li></ul>
 \image html tree_bidir_link.png
 
 <ul><li><b>Self-dependency link</b> - shows that an object depends on itself;</li></ul>
index 7ba53518420ce7087377a555182002ce49d70226..af842ccf1dff480a731e446fb79062bdb830887e 100644 (file)
@@ -29,7 +29,7 @@ functionality for all objects in the current view via the main menu
 
 \n <b>TUI Command:</b> <em>gg.setVectorsMode(ID, Bool)</em>
 
-\n Also it is possible to show the vertices of the selected
+\n It is possible to show the vertices of the selected
 shape. For this, choose in the context menu of the shape
 <b>Display mode -> Show Vertices</b>, or apply this
 functionality for all objects in the current view via the main menu
@@ -40,10 +40,9 @@ functionality for all objects in the current view via the main menu
 
 \n <b>TUI Command:</b> <em>gg.setVerticesMode(ID, Bool)</em>
 
-\n Moreover user can show the name of the selected
-shape. For this, choose in the context menu of the shape
+\n To show the name of the selected shape, choose in its context menu
 <b>Display mode -> Show Name</b>, or apply this
-functionality for all objects in the current view via the main menu
+functionality for all objects in the current view via the main menu option
 <b> View -> Display Mode -> Show/Hide Name.</b>
 
 \image html name_mode.png
index 605ff176f3d52d8c5fa901276202905f7645c55d..dd2ad27fa671d630031e410d7464d89e179bf970 100644 (file)
@@ -1,25 +1,20 @@
 /*!
 
-\page extension_operation_page Extension of an Edge or a Face
+\page extension_operation_page Extension 
 
-\n To produce an \b Extension in the <b>Main Menu</b> select
-<b>Operations - > Transformation - > Extension</b>
+\n To produce an \b Extension of an Edge or a Face select in the <b>Main Menu</b> 
+<b>Operations - > Transformation - > Extension</b>. The type of extension is defined using the radio buttons.
 
-\n This operation resizes an \b Edge by means of first
- and last parameters modification or a \b Face by means of modification
- of minimal and maximal U- and V-Parameters. \n
-\ref restore_presentation_parameters_page "Advanced options".
+Firstly it is possible to resize an \b Edge by modifying its first
+and last parameters
 
-The type of extension is defined using the radio buttons.
+\image html extension1.png "Edge Extension" 
 
-Firstly it is possible to resize an \b Edge.
 \n <b>TUI Command:</b> <em>geompy.ExtendEdge(theEdge, theMin, theMax)</em>,
 where \em theEdge the input edge to be resized, \em theMin the minimal
 parameter value, \em theMax the maximal parameter value.
 \n <b>Arguments:</b> Name + Object (Edge) + 2 values (Min and Max Parameters).
 
-\image html extension1.png "Extension of an Edge"
-
 \n <b>Example:</b>
 
 \image html extend_edge_example.png "Original edge (white) and extended edge"
@@ -28,8 +23,12 @@ parameter value, \em theMax the maximal parameter value.
       negative, the input Edge is extended, otherwise it is shrinked by
       \b theMin parameter. If \b theMax is greater than 1, the Edge is
       extended, otherwise it is shrinked by \b theMax parameter.
+       
+Secondly it is possible to resize a \b Face by modifying its 
+minimal and maximal U- and V-Parameters. 
 
-Secondly it is possible to resize a \b Face.
+ \image html extension2.png "Face Extension" 
 \n <b>TUI Command:</b> <em>geompy.ExtendFace(theFace, theUMin, theUMax,
 theVMin, theVMax)</em>, where \em theFace the input face to be resized,
 \em theUMin the minimal U-Parameter value, \em theUMax the maximal U-Parameter
@@ -38,18 +37,16 @@ V-Parameter value.
 \n <b>Arguments:</b> Name + Object (Face) + 4 values (Min and Max U- and
 V-Parameters).
 
-\image html extension2.png "Extension of a Face"
 
 \n <b>Example:</b>
 
-\image html extend_face_example.png "The original face (gray) and a result
-       face shrinked along U-Direction and extended along V-Direction"
+\image html extend_face_example.png "The original face (gray) and a result face shrinked along U-Direction and extended along V-Direction"
 
 \note The input Face U- and V-Parameters range is [0, 1]. If \b theUMin
       parameter is negative, the input Face is extended, otherwise it is
-      shrinked along U-Direction by \b theUMin parameter. If theUMax is
+      shrinked along U-Direction by \b theUMin parameter. If \b theUMax is
       greater than 1, the Face is extended, otherwise it is shrinked along
-      U-Direction by \b theUMax parameter. So as for \b theVMin, \b theVMax
+      U-Direction by \b theUMax parameter. The same applies to \b theVMin, \b theVMax
       and V-Direction of the input Face.
 
 Our <b>TUI Scripts</b> provide you with useful examples of the use of
index 4de27fc29fea3f5668d770fcd5cb89146added68..f27a6d94461026be3e3bbb78379e3058393e2577 100644 (file)
@@ -1,11 +1,11 @@
 /*!
 \page fast_intersection_page Fast intersection
 
-This operation checks whether or not two selected shapes are overlapped.
+This operation checks if two selected shapes are overlapped.
 
 This tool is useful for fast detection of intersections and gaps.
 In contrast to Boolean Operations, Partition and Detect Self-intersection 
-algorithms that compute topological intersections, this algoritm computes 
+algorithms that compute topological intersections, this algorithm computes 
 intersections by generating tessellation (triangulation) of the source 
 shapes and detecting overlapping of resulting meshes. High performance is 
 achieved through the use of existing triangulation of faces.
@@ -28,22 +28,21 @@ of the GUI module's documentation.
 
 In this dialog:
 
-- \b Object 1 - first checked object. \b Selection button allows picking it in the viewer or in the object browser.
-- \b Object 2 - second checked object. \b Selection button allows picking it in the viewer or in the object browser.
+- <b> Object 1 </b> and <b> Object 2 </b> the checked objects. \b Selection button allows picking them in the viewer or in the object browser.
 - <b>Deflection coefficient</b> specifies the quality of shapes tessellation.
 - <b>Detect gaps</b> - when switched on, allows detecting gaps between shapes. 
-- <b>Tolerance</b> - specifies a distance between shapes used for detecting gaps.
+- <b>Tolerance</b> - specifies the distance between shapes used for detecting gaps.
 - <b>Compute intersections</b> - press this button to compute interferences.
 - <b>Sub-shapes of Object 1</b> - list of sub-shapes from the first source shape that localize the intersection.
 - <b>Sub-shapes of Object 2</b> - list of sub-shapes from the second source shape that localize the intersection.
 - \b Apply and <b>Apply and Close</b> buttons are used to store selected intersected shapes in the study for
 further analysis (see below).
 
-\note Quality of the result depends on the quality of triangulation. Changing a value of the deflection coefficient
-parameter can strongly affect the result. On the other hand, small values of deflection coefficient might lead to
+\note The result quality depends on the quality of triangulation. Changing the value of the deflection coefficient
+parameter can strongly affect the result. However, small values of the deflection coefficient might lead to
 some performance loss of the algorithm, as number of triangles of the tesselation mesh depends on this parameter.
 
-It is possible to store sub-shapes selected by the user in the study, for the further analysis.
+Press <b>Apply and Close</b> or \b Apply button to store the selected sub-shapes in the study for further analysis.
 The selection will be published as a compound containing intersected sub-shapes from both source objects.
 
 <b>TUI Command:</b> <em>geompy.FastIntersect(theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001),</em> \n
index eb7d2377c07673b66c52387079c3c86f095b7e39..2b5c8a98111eb73c77d0f2b70ad8b3df63b7cf7a 100644 (file)
@@ -17,7 +17,7 @@ given tolerance value.
 
 \n <b>TUI Command:</b>
 <p><em>geompy.MakeGlueEdges( theShapes, theTolerance )</em>,
-\n where \em theShapes is either a list or compound of shapes to be
+\n where \em theShapes is a list or compound of shapes to be
 glued, and \em theTolerance is a maximum distance between two
 edges, which can be considered as coincident.
 
@@ -41,12 +41,12 @@ The selected edges will be marked in white.
  theTolerance is a maximum distance between two edges, which can
  be considered as coincident. The \b Result will be a list of \b
  GEOM_Objects (edges), containing one sub-shape per each detected set of
- coincident sub-shapes. For example if there are two coincident edges
-in selected shapes, the result list contains one of the two coincident edges.
+ coincident sub-shapes. For example, if there are two coincident edges
+in the selected shapes, the result list contains one of the two coincident edges.
 
 <em>geompy.MakeGlueEdgesByList( theShapes, theTolerance, theEdges )</em>,
-\n where \em theShape is either a list or compound of shapes to be glued, \em
- theTolerance is a maximum distance between two edges, which can
+\n where \em theShape is a list or compound of shapes to be glued, 
+\em theTolerance is a maximum distance between two edges, which can
  be considered as coincident, \em theEdges is a list of
  edges to be glued. 
 
index 8f020115bcdbfae1bbc4ced1bfc42bb017d775da..c6a6fa021583320f6b423d3568f7a032e8ae18d3 100644 (file)
@@ -41,12 +41,12 @@ The selected faces will be marked in white.
 
 When the faces are glued their edges are glued as well. By default, other
 edges are not glued. To force gluing of all edges, check <b>Glue all coincident edges</b>
-checkbox.
+check-box.
 
 \n <b>TUI Commands:</b>
 
 <em>geompy.GetGlueFaces( theShapes, theTolerance )</em>,
-\n where \em theShapes is either a list or compound of shapes to be glued, \em
+\n where \em theShapes is a list or compound of shapes to be glued, \em
 theTolerance is a maximum distance between two faces, which can
 be considered as coincident. The \b Result will be a list of \b
 GEOM_Objects (faces), containing one sub-shape per each detected set of
old mode 100755 (executable)
new mode 100644 (file)
index 40cc4c0..bff2fbd
@@ -6,17 +6,60 @@ This operation allows browsing the contents of the selected shape.
 
 To <b>Inspect Object</b>, in the <b>Main Menu</b> select <b>Measures - > Inspect Object</b>.
 
-\image html inspect_object.png
+The dialog can be used in two modes. The first one is a tree view mode:
+\image html inspect_object.png "Dialog in the tree view mode"
 
-In this dialog:
+This is a default mode that allows to inspect an object in the form of tree
+starting from the shape itself. Its children are its direct sub-shapes that
+have they own children as sub-shapes etc. till most very base sub-shapes,
+i.e. vertices.
+
+The second mode is a filtering one. It is activated when the user selects
+<b>Tolerance filter</b> check box:
+\image html inspect_object2.png "Dialog in the filtering mode"
+
+In this mode the user can check the type of sub-shapes to work with using
+the radio-buttons. The type can be either \b Vertex, \b Edge or \b Face.
+Then the user choses a tolerance criterion to be applied to filter out
+sub-shapes. It is possible to chose one of the following values:
+- \b > - greater than (default value)
+- \b >= - greater than or equal to
+- \b < - lower than
+- \b <= - lower than or equal to
+
+The last parameter to be chosen is the tolerance value. The result is the shapes
+of a certain type that satisfy the defined tolerance criterion. E.g. if the user
+chooses \b Face, criterion \b > and tolerance value equal to \b 1.e-6 the faces
+with the tolerance greater than \b 1.e-6 are displayed.
+
+It is possible to set maximal and minimal value of the tolerance using the
+buttons <b>Max value</b> and <b>Min value</b>. These values are displayed in
+the labels <b>Max :</b> and <b>Min :</b>
+
+In this dialog never mind of its mode it is possible to:
 - Click on the "selection" button and select an object to inspect in the Object Browser or in the viewer.
-- Show/hide sub-shape(s) in the 3D viewer, by pressing “eye” icon in the first column of the tree view.
-- Show/hide all sub-shapes in the 3D viewer, by pressing “eye” icon in the first column of the tree view header.
-- Rename selected sub-shape by double-clicking on the item or pressing <F2> key.
-- Show selected sub-shape(s) in the 3D viewer by pressing <b>Show Selected</b> button.
-- Show selected sub-shape(s) in the 3D viewer and erase all currently shown objects by pressing <b>Show Only Selected</b> button.
-- Hide selected sub-shape(s) from the 3D viewer by pressing <b>Hide Selected</b> button.
-- Publish selected sub-shapes in the study, by pressing <b>Publish Selected</b> button.
+- Show/hide sub-shape(s) in the 3D viewer, by pressing "eye" icon in the first column of the tree view.
+- Show/hide all sub-shapes in the tree, by pressing "eye" icon in the first column of the tree view header or
+  by pressing <b>Show all</b>/<b>Hide all</b> buttons.
+- Rename the selected sub-shape by double-clicking on the item or pressing <F2> key.
+- Show the selected sub-shape(s) in the 3D viewer by pressing <b>Show Selected</b> button.
+- Show the selected sub-shape(s) in the 3D viewer and erase all currently shown objects by pressing <b>Show Only Selected</b> button.
+- Hide the selected sub-shape(s) from the 3D viewer by pressing <b>Hide Selected</b> button.
+- Publish the selected sub-shapes in the study, by pressing <b>Publish Selected</b> button.
 - Close dialog box, by pressing <b>Close</b> button.
 
+\n <b>TUI Command:</b>
+
+A command to filter sub-shapes is defined:
+
+<em>geompy.GetSubShapesWithTolerance(theShape, theShapeType, theCondition, theTolerance),</em> \n
+where \n
+\em theShape is the shape to be exploded. \n
+\em theShapeType is the type of sub-shapes to be returned. Can have
+    the values \b GEOM.FACE, \b GEOM.EDGE and \b GEOM.VERTEX only.\n
+\em theCondition is the condition type (the value of GEOM.comparison_condition emuneration).\n
+\em theTolerance is the tolerance filter.
+
+See also a \ref swig_GetSubShapesWithTolerance "TUI example".
+
 */
index be0c5aa279bde7f24c43a9bbb0b4a0b1520108e1..3d8978d8de989b4552566c9669e734f56627fe78 100644 (file)
@@ -14,24 +14,31 @@ To make a projection it is necessary to define:
 - \b Object to be projected. It can be either a planar wire or a face;
 - \b Radius of the cylinder;
 - <b>Starting angle</b> from the cylinder's X axis around Z axis. This is
-the angle of the projection starting.
-- <b>Length angle</b> in which to project the total length of
-the wire. If it is unchecked the projection is not scaled and natural
+the angle of the projection start.
+- <b>Length angle</b> where the total length of
+the wire should be projected. If it is unchecked the projection is not scaled and the natural
 wire length is kept for the projection.
-
-\ref restore_presentation_parameters_page "Advanced options".
+- <b>Rotation angle</b> the angle between the tangent vector to
+the first curve at the first point of the object projection in 2D space
+and U-direction of the cylinder in 2D space.
+- \ref restore_presentation_parameters_page "Advanced options".
 
 \image html proj_on_cyl_dlg.png
 
+\n The following figure explains the meaning of each input angle:
+
+\image html proj_on_cyl_angles.png "Input angles of projection on the cylinder"
+
 \n <b>Example:</b>
 
 \image html proj_on_cyl_preview.png "The curve (in red) and its projection on the cylinder"
 
 \n <b>TUI Command:</b> <em>geompy.MakeProjectionOnCylinder(theObject, theRadius,
-theStartAngle=0.0, theAngleLength=-1.0),</em>
-where \em theObject is a shape which has to be projected, \em theRadius
-is a cylinder radius, \em theStartAngle the starting angle of projection in
-radians, \em theAngleLength the projection length angle in radians.
+theStartAngle=0.0, theAngleLength=-1.0, theAngleRotation=0.0),</em>
+where \em theObject is a shape to be projected, \em theRadius
+is a cylinder radius, \em theStartAngle is the starting angle of projection in
+radians, \em theAngleLength the projection length angle in radians,
+\em theAngleRotation projection rotation angle in radians.
 The \em Result will be a \em GEOM_Object.
 
 Our <b>TUI Scripts</b> provide you with useful examples of the use of
index 0008dc80a6c5f86124373028ad15622e51f5f10f..9d293dec40d247ee4d24c0b1889b82836e70fb9a 100644 (file)
@@ -3,18 +3,18 @@
 \page sewing_operation_page Sewing
 
 \b Sewing operation allows uniting several faces (possibly contained
-in a shell, solid or compound) into one shell while geometrically
+in a shell, solid or compound) into one shell. Geometrically
 coincident (within a specified tolerance) edges (or parts of edges) of
 different faces are replaced by one edge thus producing a shell of
 faces with shared boundaries.<p> 
 This operation is similar to <b>New Entity - > Build - > Shell</b>
 operation, the difference is that with \b Sewing you can specify the
-tolerance and can get a non-manifold result. <p>
-Possibility to create a non-manifold shell can be used e.g. to create a
+tolerance and get a non-manifold result. <p>
+The possibility to create a non-manifold shell can be used e.g. to create a
 shell forming several closed domains and then to create several solids
 with shared boundaries from this shell.
 
-\note Geometrically coincident faces (or part of faces) won't be
+\note Geometrically coincident faces (or parts of faces) will not be
 replaced by one face during \b Sewing.
 
 To produce a \b Sewing operation in the <b>Main Menu</b> select <b>Repair - > Sewing</b>.
index c92d48b8cedbcc05d6f9a6aac3ad27ae847cd597..643c706386bcd9af63d3e7ba3393a47091c7cf72 100644 (file)
@@ -56,22 +56,22 @@ merge with neighboring edges.</li>
 <li><b>3D Tolerance</b> (DropSmallEdges.Tolerance3d) - defines minimum
 possible distance between two parallel edges.</li>
 </ul>
-<li><b>Drop Small Solids</b> (DropSmallSolids) - either removes small
+<li><b>Drop Small Solids</b> (DropSmallSolids) - removes small
   solids or merges them with neighboring ones.</li>
 <ul>
 <li><b>Width factor tol.</b> (DropSmallSolids.WidthFactorThreshold) -
-  defines maximum value of <em>2V/S</em> of a solid which is
-  considered small, where \a V is volume and \a S is surface area of
+  defines the maximum value of <em>2V/S</em> of a solid, which is
+  considered small, where \a V is the volume and \a S is the surface area of
   the solid.</li>
 <li><b>Volume tol.</b> (DropSmallSolids.VolumeThreshold) - defines
-  maximum volume of a solid which is considered small.</li>
+  the maximum volume of a solid, which is considered small.</li>
 <li><b>To merge solids</b> (DropSmallSolids.MergeSolids) - if
   activated, small solids are removed, else small solids are merged to
-  adjacent non-small solids or left untouched if cannot be merged.
+  adjacent non-small solids or left untouched if they cannot be merged.
 </li>
 </ul>
 If the both tolerances are activated a solid is considered small if
-it meets the both criteria.
+it meets both criteria.
 <li><b>Split Angle</b> (SplitAngle) - splits faces based on conical
 surfaces, surfaces of revolution and cylindrical surfaces in segments
 using a certain angle.</li>
diff --git a/doc/salome/gui/GEOM/input/shape_statistics_operation.doc b/doc/salome/gui/GEOM/input/shape_statistics_operation.doc
new file mode 100644 (file)
index 0000000..d1fb6fe
--- /dev/null
@@ -0,0 +1,30 @@
+/*!
+
+\page shape_statistics_operation_page Shape Statistics
+
+This operation allows plotting a distribution histogram for the numerical parameters and creating the corresponding geometrical groups of the given shape.
+
+To call <b>Shape Statistics</b> dialog box, in the <b>Main Menu</b> select <b>Inspection - > Shape Statistics</b>.
+
+\image html shape_statistics.png
+
+In this dialog:
+- "Selected objects" standard selection box allows selecting one or more geometrical objects.
+
+- "Type" combo-box with the following items: "Edges length", "Faces area", "Solids volume".
+\note "Type" combo-box includes only parameters applied to the currently selected shape (e.g. "Solids volume" will not be available for a selected face or shell); multiple selection is processed correspondingly (i.e. only types applicable for all selected shapes will be available).
+
+- "Number of intervals" spin box is used to specify number of distribution histogram ranges.
+
+- "Scalar range" checkable group box, when switched ON, allows specifying custom values range used for plotting and creating groups.
+\note By default, "Scalar range" controls are empty; pressing "Compute" button allows automatically computing the initial range of the chosen parameter. This is necessary as the computation of the parameters range can be time-consuming for large or complex models. In case of multiple selection, the scalar range is computed for all selected shapes.
+
+- "Plot" button opens or uses an opened Plot2d viewer and plots the distribution histogram for the selected shape(s).
+
+- "Create groups" button allows creating groups according to the currently specified parameters. The group names will include numerical values of the range, e.g. "Edges_length_0-20", "Edges_length_20-40", etc. Empty groups are not created.
+
+- Close dialog box, by pressing <b>Close</b> button.
+
+\note This functionality is available only if GUI module is built with Plot 2D Viewer (option SALOME_USE_PLOT2DVIEWER is ON when building GUI module).
+
+*/
index 802fc45a1782dba7fc9911725025e738547da3d5..23d94d2f0c7083e878fa18812eda7230405157d3 100755 (executable)
@@ -15,22 +15,22 @@ Shared Shapes.</b> The following dialog box will appear.
 
 In this dialog:
 - <b>Name</b> is the base name of the resulting shapes.
-- <b>Shapes</b> are the shapes to fing shared sub-shapes of.
+- <b>Shapes</b> are the shapes whose shared sub-shapes should be found.
 - <b>Sub-shapes Type</b> is the type of required sub-shapes.
 - <b>Shared by all</b> option specifies what type of shared sub-shapes should be checked:
-  - \b On: causes to search sub-shapes from the first input shape shared with all other input shapes;
-  - \b Off: causes to search sub-shapes shared between couples of input shapes.
+  - \b On: searches for sub-shapes from the first input shape shared with all other input shapes;
+  - \b Off: searches for sub-shapes shared between couples of input shapes.
 
 \note For the case when "Shared by all" option is switched off - if an input list of shapes
-contains single compound, the sub-shapes shared between all possible couples of its top-level shapes
-are searched; otherwise, only sub-shapes that are shared between first input shape and all rest input
-shapes are searched.
+contains single compound, the sub-shapes shared between all possible couples of its top-level shapes
+are searched for; otherwise, only sub-shapes that are shared between the first input shape and 
+all other input shapes are searched.
 
 <b>Advanced options:</b> \ref preview_anchor "Preview"
 
 <b>TUI Command:</b> <em> geompy.GetSharedShapesMulti( Shapes, Type ),</em> 
-<br> where \em Shapes is a list or compound of shapes to fing shared sub-
-shapes of and \em Type is the type of required sub-shapes.
+<br> where \em Shapes is a list or compound of shapes, whose shared sub-
+shapes should be found and \em Type is the type of required sub-shapes.
 
 Our <b>TUI Scripts</b> provide you with useful examples of the use of
 Get Shared Shapes functionality:
index 5f77a22e3ceae928ab1ade29bf9a58d274ca232e..c8594abffe1e4e238c308044ae1c2bbda1960479 100644 (file)
@@ -4,37 +4,33 @@
 
 \tableofcontents
 
-This document determines the range of numbers (tolerances, locations
-and sizes) that are to be taken into account for any 3D model design
-in Salome. Although it is not obligatory to create models within this range,
-algorithms can fail or return unexpected result in this case.
+In Salome and Open CASCADE Technology (OCCT), which is a modeling core
+of Salome %GEOM module, any model has its location in the 3D-space and size.
+This document defines the range of values (tolerances, locations
+and sizes) that should be taken into account for any 3D model design.
 
-This document refers mainly to Open CASCADE Technology (OCCT). However it
-concerns Salome as well as OCCT is a modeling core of Salome %GEOM module.
-
-Any model in 3D-space has its location and sizes. The last two things in Salome
-and OCCT are represented by the double precision floating point numbers.
-
-The goal of the document is to define the range of numbers that can be used in
-modeling algorithms provided by Salome and Open CASCADE Technology.
+It is not obligatory to create models within this range,
+however, algorithms can fail or return unexpected results if the 
+recommendations are not followed.
 
 \section sec1 Maximal Size of the Model
 
-The Maximal Size of the model is a number defined as the maximal diameter of
+The Maximal Size of the model corresponds to the maximal diameter of
 enclosed sphere built for the model. In OCCT any model has a location defined
-relative the absolute origin. Thus the maximal diameter above should be built
+relatively to the absolute origin. Thus the maximal diameter should be built
 taking into account the model itself and its location.
 
-In Open CASCADE there are two tolerances: Tolerance Confusion (TolC)
+In OCCT there are two tolerances: Tolerance Confusion (TolC)
 and Tolerance Angular (TolA) (see OCCT Precision package for more details).
-These values are used for geometric comparisons. They are not used inside
-low-level algorithms (intersection for e.g.), where more precise values are
+These values are used for geometric comparisons. However, they are not used inside
+low-level algorithms (e.g. intersection), where more precise values are
 used instead. The value TolC guarantees that the error associated with
-the computations for given geometric entity is not greater than TolC.
+the computations for given geometric entity is not greater than TolC.
 
-- TolC - precision value when checking coincidence of two points
+- TolC - precision value used to check the coincidence of two points
   [by default 1.e-7];
-- TolA - precision value when checking the equality of two angles
+- TolA - precision value used to check the equality of two angles
   [by default 1.e-12].
 
 For more information on tolerance definition please see
@@ -43,8 +39,8 @@ that are due to modeling errors or inaccuracies of tolerance usage please
 refer to <a href="SALOME_BOA_PA.pdf">Chapter 9.2.2 of the same document</a>.
 
 To provide robust geometric modeling the computations should be consistent,
-i.e. the one tolerance value should be used for all computations. To provide
-consistent computations the values TolC and TolA should be consistent:
+i.e. the one tolerance value should be used for all computations. Thus, the
+TolC and TolA values should be consistent:
 
 <CENTER><B><PRE>Smax = TolC / TolA             (1)</PRE></B></CENTER>
 
@@ -56,16 +52,16 @@ In accordance with <B>(1)</B> the Maximal Size for the Model is [by default]:
 
 \section sec2 Minimal Size of the Model
 
-The Minimal Size of the Model is defined as maximal diameter of enclosed
+The Minimal Size of the Model is defined as the maximal diameter of enclosed
 sphere built for the smallest BRep entity of the Model.
 
-All models in Open CASCADE Technology are represented using double precision
+All models in OCCT are represented using double precision
 floating point numbers. This representation contains approximately 14-16
 significant digits.
 
-From the experience of using it is considered that the least four significant
+From the experience, it is considered that the last four significant
 digits contain rounding-off errors occurring during the computation. So
-(taking in account the worst cases), there are ten reliable significant digits
+(taking into account the worst cases), there are ten reliable significant digits
 for double precision floating point numbers. Having the estimation it is
 possible to compute the value of the Minimal size of the model:
 
@@ -78,7 +74,7 @@ In accordance with <B>(2)</B> for the default value it will be [by default]:
 \section sec3 Full Range of Sizes
 
 The values <B>Smax (2)</B>, <B>Smin (4)</B> are theoretical. Taking into
-account the practical purposes of improving the reliability the lower limit
+account the practical purposes of improving the reliability, the lower limit
 should be restricted by one order. Thus, the full Range of Sizes of the Models
 is:
 
index b34b34f31bba3337f5aea324492ff87661d831b0..87a64860fef18c1461e04387a8e6fb288c1f8d3a 100644 (file)
@@ -21,24 +21,23 @@ In this dialog:
 <ul>
 <li> <b>Source Shape</b> is an object that is a source of non-topological data.</li>
 <li> <b>Destination Shape</b> is a data destination object. </li>
-<li> <b>Type of detection operation</b> is the method to search sub-shapes of
-     <b>Source Shape</b> in <b>Destination Shape</b>. Data are transferred
-     from these corresponding sub-shapes. This is a combo-box with the following
-     possible values:
+<li> <b>Type of detection operation</b> allows choosing how to search sub-shapes of the 
+     <b>Source Shape</b> in the <b>Destination Shape</b>. The data are transferred
+     from these corresponding sub-shapes. The following methods are possible:
     <ul>
-    <li><b>Get In Place</b> - current implementation of Get In Place algorithm
+    <li><b>Get In Place</b> - the current implementation of Get In Place algorithm
         (default value).</li>
-    <li><b>Get In Place (old)</b> - old implementation of Get In Place
+    <li><b>Get In Place (old)</b> - the old implementation of Get In Place
         algorithm.</li>
     <li><b>Get In Place By History</b> - Get In Place By History algorithm.</li>
     </ul>
 </li>
 </ul>
 
-To copy data click on \b Apply or <b>Apply and Close</b> button. As the result
-it is possible to see how many names and materials are copied as well as
-maximum number of names and materials available for copying. This information is
-provided on the following message box:
+To copy the data click on \b Apply or <b>Apply and Close</b> button. 
+It is possible to see how many names and materials are copied as well as
+the maximum number of names and materials available for copying. This information is
+provided in the following message box:
 
 \image html transfer_data2.png "Transfer Data Information"
 
diff --git a/doc/salome/gui/GEOM/input/tui_check_self_intersections_fast.doc b/doc/salome/gui/GEOM/input/tui_check_self_intersections_fast.doc
new file mode 100644 (file)
index 0000000..c8266e3
--- /dev/null
@@ -0,0 +1,6 @@
+/*!
+
+\page tui_check_self_intersections_fast_page Detect Self-intersections fast
+\tui_script{check_self_intersections_fast.py}
+
+*/
index 6e83325c3dc8b10a24a6f9ff04128d60a592ba39..be111dbb16e2372e877388ae8a4dfcca6feaa3a1 100644 (file)
@@ -19,6 +19,7 @@
 <li>\subpage tui_check_compound_of_blocks_page</li>
 <li>\subpage tui_get_non_blocks_page</li>
 <li>\subpage tui_check_self_intersections_page</li>
+<li>\subpage tui_check_self_intersections_fast_page</li>
 <li>\subpage tui_fast_intersection_page</li>
 </ul>
 
index f2407ca29685460eb968d5e6583910dc9dfc3f14..5ed1334a00c422e25c2482809dafd8e1f663e5ea 100644 (file)
 \until geompy.RestoreSubShapes(Partition1)
 
 \anchor swig_GetSubShapeEdgeSorted
+\until geompy.GetSubShapeEdgeSorted(Sketcher3d_2, p3, "OrderedEdges")
+
+\anchor swig_GetSubShapesWithTolerance
 \until print "DONE"
 
 */
index b954b7f605bec8b10f4efb6cd54d1f98bc4eb760..3e147f3882f8d34099fd87809547948a9b0ad20d 100644 (file)
 \until Detect Self-intersections
 
 \anchor swig_CheckSelfIntersections
-\until Detect Fast intersection
+\until Detect Self-intersections fast
+
+\anchor swig_CheckSelfIntersectionsFast
+\until Fast intersection
 
 \anchor swig_FastIntersection
 \until WhatIs
index 77a5ee4b3aecbb40dde9c228ddda5b5e167e485d..515a94ce4a7808c7942730e944c6d6ec2b716803 100644 (file)
@@ -19,6 +19,7 @@
 <li>\subpage managing_dimensions_page "Dimensions"</li>
 <li>\subpage whatis_page "WhatIs"</li>
 <li>\subpage inspect_object_operation_page "Inspect Object"</li>
+<li>\subpage shape_statistics_operation_page "Shape Statistics"</li>
 </ul>
 
 \n To check their integrity:
index fad70f01c9028401590d7d7a02892ad832afc0ed..43dc0f6f70fe4d97ab17c0f26cb6e4e624551801 100644 (file)
@@ -5,13 +5,13 @@
 This operation provides the list of types and quantities of all topological
 entities, composing the selected geometrical object.
 
-For the \em COMPOUND or \em COMPSOLID shape, additionally the information about
-"flat" content is shown - a number of "simple" top-level shapes enclosed into the compound.
+The information about \em COMPOUND or \em COMPSOLID shapes additionally shows
+"flat" content - the number of "simple" top-level shapes enclosed into the compound.
 
 \image html measures8.png
 
 \note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
-- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when the input focus is
 in the viewer to navigate between selectable objects.
 - Press left mouse button to select an appropriate object to the dialog box.
 .
index 36a0d49a30b84f48fb5abc434f6493376a53eba7..aa9951260b0835d6bdb746acece32379687c4b1c 100644 (file)
@@ -24,7 +24,7 @@ This functionality is available in OCC viewer only.
 
 To create a group of sub-shapes of a geometrical object in the main
 menu select <b>New entity > Group > Create</b>
-\n The following menu will appear:
+\n The following dialog box will appear:
 
 \image html geomcreategroup.png
 
@@ -81,26 +81,31 @@ creation of other groups), or skip it by clicking \b Close button.
 
 \n The Result of the operation will be a \b GEOM_Object.
 
-The \b Filter controls allow to automatically pick up entites which satisfy specified 
+The \b Filter controls allow to automatically pick up entities, which satisfy specified 
 threshold value(s). The numerical functor for each sub-shape that is compared with
 threshold value(s) is computed according to the shape's topological properties:
-- length for edges and wires
-- area for faces and shells
-- volume for solids, compounds, compsolids
+- length for edges and wires;
+- area for faces and shells;
+- volume for solids, compounds, compsolids.
 
 Filtering capabilities are not available for vertices.
 
 In order to filter out some entities:
-- Activate one or two filtering controls by switching on corresponding check boxes;
-- Select required threshold comparator type; the following choices are available:
+- Activate one or two filtering controls by switching on the corresponding check boxes;
+- Select the required threshold comparator type; the following choices are available:
   - <b>Less Than</b> or <b>Equal or Less Than</b> for the first comparator;
   - <b>Greater Than</b> or <b>Equal or Greater Than</b> for the second comparator;
-- Enter required threshold value (values);
+- Enter the required threshold value (values);
 - Press \b Apply button in the \b Filter group.
 
-The entities which satisfy entered filtering parameters will be automatically highlighted
+The entities, which satisfy the entered filtering parameters, will be automatically highlighted
 in the 3D viewer.
 
+\b Plot button gives access 
+to the \ref shape_statistics_operation_page "Shape Statistics" functionality with a simplified look-and-feel:
+
+\image html shape_statistics_simple.png
+
 \n <b>TUI Command:</b> <em>geompy.CreateGroup(MainShape,
 ShapeType),</em> where MainShape is a shape for which the group is
 created, ShapeType is a type of shapes in the created group.
index 87a912edc3829cb0cbb0237637947422e9819efe..830fcc3984dfdef42f54e5e4567a932a644e3a86 100644 (file)
@@ -209,6 +209,17 @@ module GEOM
     SI_ALL      // all interferences
   };
 
+  /**
+   * This enumeration represents comparison conditions.
+   */
+  enum comparison_condition
+  {
+    CC_GT, ///< Greater then
+    CC_GE, ///< Greater then or equal to
+    CC_LT, ///< Less then
+    CC_LE  ///< Less then or equal to
+  };
+
  /*!
    * \brief Object creation parameters
    *
@@ -732,10 +743,13 @@ module GEOM
      *  Create a point, corresponding to the given parameter on the given curve.
      *  \param theRefCurve The referenced curve.
      *  \param theParameter Value of parameter on the referenced curve.
+     *  \param takeOrientationIntoAccount flag that tells if it is necessary
+     *         to take the curve's orientation into account.
      *  \return New GEOM_Object, containing the created point.
      */
     GEOM_Object MakePointOnCurve (in GEOM_Object theRefCurve,
-                                  in double theParameter);
+                                  in double      theParameter,
+                                  in boolean     takeOrientationIntoAccount);
 
     /*!
      *  \brief Create a point, corresponding to the given length on the given curve.
@@ -1439,13 +1453,17 @@ module GEOM
      *         to project the total length of the wire. If it is negative the
      *         projection is not scaled and natural wire length is kept for
      *         the projection.
+     *  \param theAngleRotation the desired angle between the tangent vector
+     *         to the first curve at the first point of the theObject's
+     *         projection in 2D space and U-direction of cylinder's 2D space.
      *  \return A wire or a face or a compound of faces that represents a
      *         projection of the source shape onto a cylinder.
      */
     GEOM_Object MakeProjectionOnCylinder (in GEOM_Object theObject,
                                           in double      theRadius,
                                           in double      theStartAngle,
-                                          in double      theAngleLength);
+                                          in double      theAngleLength,
+                                          in double      theAngleRotation);
   };
   
   /*!
@@ -1801,9 +1819,13 @@ module GEOM
      *                        should be equal to number of bases or list of locations can be empty.
      *  \param thePath - Path shape to extrude the base shape along it.
      *  \param theWithContact - the mode defining that the section is translated to be in
-     *                          contact with the spine.
+     *                          contact with the spine. Ignored if IsBySteps is set.
      *  \param theWithCorrection - defining that the section is rotated to be
-     *                                 orthogonal to the spine tangent in the correspondent point
+     *                                 orthogonal to the spine tangent in
+     *                          the correspondent point. Ignored if IsBySteps is set.
+     *  \param IsBySteps - flag that tells if the result should be created
+     *         step by step or as a whole. If IsBySteps is set no correction
+     *         of bases is allowed.
      *  \param IsGenerateGroups flag that tells if it is necessary to
      *         return groups (true) or not (false).
      *  \return The list of objects. The first one is a result pipe,
@@ -1816,6 +1838,7 @@ module GEOM
                                             in GEOM_Object thePath,
                                             in boolean theWithContact ,
                                             in boolean theWithCorrection,
+                                            in boolean IsBySteps,
                                             in boolean IsGenerateGroups);
 
     /*!
@@ -2735,6 +2758,26 @@ module GEOM
     ListOfGO GetSubShapeEdgeSorted (in GEOM_Object theShape,
                                     in GEOM_Object theStartPoint);
 
+    /*!
+     * \brief Return the list of subshapes that satisfies a certain tolerance
+     * criterion. The user defines the type of shapes to be returned, the
+     * condition and the tolerance value. The operation is defined for
+     * faces, edges and vertices only. E.g. for theShapeType FACE, theCondition
+     * CC_GT and theTolerance 1.e-7 this method returns all faces of theShape
+     * that have tolerances greater then 1.e7.
+     *
+     * \param theShape the shape to be exploded
+     * \param theShapeType the type of shapes to be returned. Can have the
+     *        values FACE, EDGE and VERTEX only.
+     * \param theCondition the condition type.
+     * \param theTolerance the tolerance filter.
+     * \return the list of shapes that satisfy the conditions.
+     */
+    ListOfGO GetSubShapesWithTolerance(in GEOM_Object          theShape,
+                                       in short                theShapeType,
+                                       in comparison_condition theCondition,
+                                       in double               theTolerance);
+
   };
 
  // # GEOM_IBlocksOperations: 
@@ -4204,6 +4247,7 @@ module GEOM
       // VERTEX
       VERTEX,
       // ADVANCED shapes
+      LCS,
       /*! all advanced shapes (temporary implementation) */
       ADVANCED    
     };
@@ -4448,6 +4492,21 @@ module GEOM
                                     in long        theCheckLevel,
                                     out ListOfLong theIntersections);
 
+    /*!
+     *  \brief Detect self-intersections of the given shape with algorithm based on mesh intersections.
+     *  \param theShape Shape to check validity of.
+     *  \param theDeflection Linear deflection coefficient that specifies quality of tesselation.
+     *  \param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
+     *                       - if \a theTolerance <= 0, algorithm detects intersections
+     *                       - if \a theTolerance > 0, algorithm detects gaps
+     *  \param theIntersections Output. List of intersected sub-shapes IDs, it contains pairs of IDs.
+     *  \return TRUE, if the shape does not have any self-intersections.
+     */
+    boolean CheckSelfIntersectionsFast (in GEOM_Object theShape,
+                                       in float       theDeflection,
+                                       in double      theTolerance,
+                                       out ListOfLong theIntersections);
+
     /*!
      *  \brief Detect intersections of the given shapes with algorithm based on mesh intersections.
      *  \param theShape1 First source object
index 083016fab291b271a8764e92154d407214a5d1e3..ba1a74ec8b919b16a24be4c6d81adf3e95868766 100644 (file)
 
 module GEOM
 {
+  /*!
+   *  \brief Units of length
+   */
+  enum length_unit
+  {
+    LU_INCH,
+    LU_MILLIMETER,
+    LU_FOOT,
+    LU_MILE,
+    LU_METER,
+    LU_KILOMETER,
+    LU_MILLIINCH,
+    LU_MICROMETER,
+    LU_CENTIMETER,
+    LU_MICROINCH
+  };
+
   /*!
    *  \brief Interface for STEPPlugin modeling functions.
    */
@@ -34,9 +51,11 @@ module GEOM
      *
      *  \param theObject Shape to be stored in the file.
      *  \param theFileName Name of the file to store the given shape in.
+     *  \param theUnit the length unit.
      */
     void ExportSTEP( in GEOM::GEOM_Object theObject, 
-                     in string            theFileName );
+                     in string            theFileName,
+                     in GEOM::length_unit theUnit);
       
     /*!
      *  \brief Import a shape from the STEP file.
index cef2c42f2976d4ba54acafd65e34099d2858125e..3d47d93edc22f23ef4df2f7c95802f4b251a5e97 100755 (executable)
@@ -35,6 +35,7 @@ SET( _res_files
   GEOM.config
   GEOMDS_Resources
   ShHealing
+  Y14.5M-2009.ttf
   3dsketch.png
   isoline.png
   isoline_v.png
@@ -113,6 +114,7 @@ SET( _res_files
   fuse_collinear_edges.png
   geometry.png
   import_picture.png
+  import.png
   limit_tolerance.png
   line.png
   line2points.png
index 84f53783c7e224fbc70819938ccc5890a03848b2..8e83fdbc2fe8e69c3afd42f3091eb9b90b70b317 100644 (file)
     <!-- Dimension presentation properties -->
     <parameter name="dimensions_color"          value="#ffffff" />
     <parameter name="dimensions_line_width"     value="1" />
-    <parameter name="dimensions_font_height"    value="10" />
+    <parameter name="dimensions_font"           value="Y14.5M-2009,14" />
     <parameter name="dimensions_arrow_length"   value="5" />
     <parameter name="dimensions_show_units"     value="0" />
     <parameter name="dimensions_length_units"   value="m" />
     <parameter name="dimensions_angle_units"    value="deg" />
-       <parameter name="dimensions_default_flyout" value="20" />
+    <parameter name="dimensions_default_flyout" value="20" />
+    <parameter name="dimensions_use_text3d"     value="0" />
 
     <!-- Scalar bar for field step presentation -->
     <parameter name="scalar_bar_x_position"   value="0.05" />
diff --git a/resources/Y14.5M-2009.ttf b/resources/Y14.5M-2009.ttf
new file mode 100644 (file)
index 0000000..1f1ca19
Binary files /dev/null and b/resources/Y14.5M-2009.ttf differ
diff --git a/resources/import.png b/resources/import.png
new file mode 100644 (file)
index 0000000..71690c9
Binary files /dev/null and b/resources/import.png differ
index 4da6ad710a1573cbf97aa4b26af98257440fd113..39197f059053afe8eb67c9d5f9a59f2c5465ba82 100644 (file)
@@ -335,11 +335,11 @@ void AdvancedGUI_DividedDiskDlg::SetEditCurrentArgument()
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   if (myEditCurrentArgument == GroupPntVecR->LineEdit2) {
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   else {
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
index 5999c6471b2770e1ce8f35dea89af5c5787d848e..f00d74043c56c98dd80b92257f54752c76041465 100644 (file)
@@ -642,7 +642,7 @@ void AdvancedGUI_PipeTShapeDlg::SetEditCurrentArgument()
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   //globalSelection(GEOM_POINT);
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
 }
index e51ad791bd0a77503ce3c41163ff420c0587d0a4..412fa23c66f85cdd75b400d5f72cbaf2a56f3cda 100644 (file)
@@ -120,7 +120,7 @@ void AdvancedGUI_SmoothingSurfaceDlg::Init()
   showOnlyPreviewControl();
 
   globalSelection();
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
   //@@ initialize dialog box widgets here @@//
 
   // Signal/slot connections
@@ -163,7 +163,7 @@ bool AdvancedGUI_SmoothingSurfaceDlg::ClickOnApply()
 
   initName();
   globalSelection();
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
   return true;
 }
 
@@ -175,7 +175,7 @@ void AdvancedGUI_SmoothingSurfaceDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
   globalSelection();
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
   //displayPreview();
 }
 
@@ -363,6 +363,6 @@ void AdvancedGUI_SmoothingSurfaceDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupPoints->LineEdit1;
   myEditCurrentArgument->setFocus();
   globalSelection();
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
   SelectionIntoArgument();
 }
index b2df1cc476a946d7a1094a297e7744a5a996354f..6a023ac702f2f7a6a0f00eee3ffe69a93e724271 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -96,12 +94,12 @@ SET(_moc_HEADERS
   )
 
 # header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
+QT_WRAP_UIC(_uic_HEADERS ${_uic_files})
 
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(AdvancedGUI_SOURCES
   AdvancedGUI.cxx
@@ -120,4 +118,4 @@ ADD_LIBRARY(AdvancedGUI ${AdvancedGUI_SOURCES})
 TARGET_LINK_LIBRARIES(AdvancedGUI ${_link_LIBRARIES})
 INSTALL(TARGETS AdvancedGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
-QT4_INSTALL_TS_RESOURCES("${AdvancedGUI_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${AdvancedGUI_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
index 9da10a0d17b4fe814bafdc670e4b4e42dfee19f3..312919727318c0be62709c8c70ec57855d6acd83 100644 (file)
 #include "GEOM_Operation.h"
 #include "GEOMBase.h"
 #include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(BREPPlugin)
 
+typedef GEOM::GenericObjPtr<GEOM::IBREPOperations> BREPOpPtr;
+
 //=======================================================================
 // function : BREPPlugin_GUI()
 // purpose  : Constructor
@@ -111,8 +114,8 @@ bool BREPPlugin_GUI::importBREP( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "BREPPluginEngine" );
-  GEOM::IBREPOperations_var brepOp = GEOM::IBREPOperations::_narrow( op );
-  if ( CORBA::is_nil( brepOp ) ) return false;
+  BREPOpPtr brepOp = GEOM::IBREPOperations::_narrow( op );
+  if ( brepOp.isNull() ) return false;
   
   QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
                                                 tr( "BREP_FILES" ),
@@ -126,7 +129,7 @@ bool BREPPlugin_GUI::importBREP( SUIT_Desktop* parent )
     foreach( QString fileName, fileNames )
     {
       SUIT_OverrideCursor wc;
-      GEOM_Operation transaction( app, brepOp.in() );
+      GEOM_Operation transaction( app, brepOp.get() );
       
       try
       {
@@ -145,6 +148,7 @@ bool BREPPlugin_GUI::importBREP( SUIT_Desktop* parent )
          entryList.append( so->GetID() );
          transaction.commit();
          GEOM_Displayer( study ).Display( main.in() );
+          main->UnRegister();
        }
        else
        {
@@ -183,8 +187,8 @@ bool BREPPlugin_GUI::exportBREP( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "BREPPluginEngine" );
-  GEOM::IBREPOperations_var brepOp = GEOM::IBREPOperations::_narrow( op );
-  if ( CORBA::is_nil( brepOp ) ) return false;
+  BREPOpPtr brepOp = GEOM::IBREPOperations::_narrow( op );
+  if ( brepOp.isNull() ) return false;
 
   LightApp_SelectionMgr* sm = app->selectionMgr();
   if ( !sm ) return false;
@@ -212,7 +216,7 @@ bool BREPPlugin_GUI::exportBREP( SUIT_Desktop* parent )
     
     SUIT_OverrideCursor wc;
     
-    GEOM_Operation transaction( app, brepOp.in() );
+    GEOM_Operation transaction( app, brepOp.get() );
     
     try
     {
index 0372c1e6402b5a998f5515f5aa5f5c8ea0fcb740..7db89bde38f06f1d0814eef8a2bdae8922eb5bfb 100644 (file)
@@ -18,8 +18,7 @@
 #
 
 IF(SALOME_BUILD_GUI)
-  INCLUDE(UseQt4Ext)
-  INCLUDE(${QT_USE_FILE})
+  INCLUDE(UseQtExt)
 ENDIF()
 
 # --- options ---
@@ -39,7 +38,6 @@ INCLUDE_DIRECTORIES(
   
 IF(SALOME_BUILD_GUI)
   INCLUDE_DIRECTORIES(
-    ${QT_INCLUDE_DIRS}
     ${GUI_INCLUDE_DIRS}
     ${PROJECT_SOURCE_DIR}/src/OBJECT
     ${PROJECT_SOURCE_DIR}/src/GEOMGUI
@@ -109,7 +107,7 @@ ENDIF()
 
 IF(SALOME_BUILD_GUI)
   # sources / moc wrappings
-  QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+  QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
   SET(BREPPluginGUI_SOURCES
     BREPPlugin_GUI.cxx
@@ -145,7 +143,7 @@ IF(SALOME_BUILD_GUI)
   TARGET_LINK_LIBRARIES(BREPPluginGUI ${_link_gui_LIBRARIES})
   INSTALL(TARGETS BREPPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
   
-  QT4_INSTALL_TS_RESOURCES("${BREPPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+  QT_INSTALL_TS_RESOURCES("${BREPPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
 ENDIF()
 
 
index 37e50ea4bec38193152608038589df498ce7a21b..43cb1f4936fda5b873310a906730723b5deb62b9 100644 (file)
@@ -330,7 +330,7 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
 void BasicGUI_ArcDlg::SetEditCurrentArgument()
 {
   globalSelection(); // close local selection to clear it
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
 
   QPushButton* send = (QPushButton*)sender();
   switch ( getConstructorId() ) {
@@ -580,7 +580,7 @@ void BasicGUI_ArcDlg::ConstructorsClicked( int constructorId )
   }
 
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); //Select Vertex on All Shapes
+  localSelection( TopAbs_VERTEX ); //Select Vertex on All Shapes
   
   qApp->processEvents();
   updateGeometry();
index 21515ed32823ceadbd2d109b921b5f7766c37814..55dabb28522e1c842e35f6e89868d6ba21a5a305 100644 (file)
@@ -283,7 +283,7 @@ void BasicGUI_CircleDlg::ConstructorsClicked( int constructorId )
 
   myEditCurrentArgument->setFocus();
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
 
   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged() ),
            this, SLOT( SelectionIntoArgument() ) );
@@ -471,7 +471,7 @@ void BasicGUI_CircleDlg::SetEditCurrentArgument()
   TopAbs_ShapeEnum aNeedType = ( myEditCurrentArgument == GroupPntVecR->LineEdit2 ) ?
     TopAbs_EDGE : TopAbs_VERTEX;
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+  localSelection( aNeedType );
 
   myEditCurrentArgument->setFocus();
   //  SelectionIntoArgument();
index 110c80c7f60fd2506590c55c629628d6ea8f94fa..0b4d9030eb250d46327761b5f1908dd919457716 100644 (file)
@@ -280,15 +280,15 @@ void BasicGUI_CurveDlg::SetEditCurrentArgument()
 
   if (sender() == myGroupPoints->PushButton1) {
     myEditCurrentArgument = myGroupPoints->LineEdit1;
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (sender() == myPushBtnV1) {
     myEditCurrentArgument = myLineEditV1;
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   else if (sender() == myPushBtnV2) {
     myEditCurrentArgument = myLineEditV2;
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
 
   myEditCurrentArgument->setFocus();
index f1e74179ffd656b12d24dbbb2f4c6229aa464532..53ac9b4910cb6216e341ebff203dd3b1e39f37bc 100644 (file)
@@ -155,7 +155,7 @@ void BasicGUI_EllipseDlg::Init()
   initName( tr( "GEOM_ELLIPSE" ) );
 
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
 
   resize( minimumSizeHint() );
   SelectionIntoArgument();
@@ -212,7 +212,7 @@ bool BasicGUI_EllipseDlg::ClickOnApply()
   myEditCurrentArgument = GroupPoints->LineEdit1;
 
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
   displayPreview(true);
   
   return true;
@@ -303,7 +303,7 @@ void BasicGUI_EllipseDlg::SetEditCurrentArgument()
                                  myEditCurrentArgument == GroupPoints->LineEdit3 ) ? 
     TopAbs_EDGE : TopAbs_VERTEX;
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+  localSelection( aNeedType );
   
   myEditCurrentArgument->setFocus();
   //SelectionIntoArgument();
@@ -333,7 +333,7 @@ void BasicGUI_EllipseDlg::ActivateThisDialog()
   myDir.nullify();
   //globalSelection( GEOM_POINT );
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
 }
 
 //=================================================================================
index 56a4fe041454c94fc274a226c6068142c1c57be2..6ac2df336d845287dfe36b54aa9c3eb266cd4273 100644 (file)
@@ -220,7 +220,7 @@ void BasicGUI_LineDlg::ConstructorsClicked( int constructorId )
                                  myEditCurrentArgument == GroupFaces->LineEdit2 ) ?
     TopAbs_FACE : TopAbs_VERTEX;
   globalSelection(); // close local selection to clear it
-  localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+  localSelection( aNeedType );
 
   qApp->processEvents();
   updateGeometry();
@@ -318,7 +318,7 @@ void BasicGUI_LineDlg::SetEditCurrentArgument()
                                  myEditCurrentArgument == GroupFaces->LineEdit2 ) ?
     TopAbs_FACE : TopAbs_VERTEX;
   globalSelection(); // close local selection to clear it
-  localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+  localSelection( aNeedType );
 
   myEditCurrentArgument->setFocus();
   //  SelectionIntoArgument();
index 8cb1dd447466a920a2dbc33bd141462eecb07fce..7b2a7106cbaccf5e2669f8d71fbbfb73316046dd 100644 (file)
@@ -228,7 +228,7 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
 {
   if ( myConstructorId == constructorId && myConstructorId == 0 ) {
     globalSelection(); // close local contexts, if any
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+    localSelection( TopAbs_VERTEX );
     activate( GEOM_MARKER );
     return;
   }
@@ -244,7 +244,7 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
       Group2->hide();
       aMainGrp->show();
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+      localSelection( TopAbs_VERTEX );
       activate( GEOM_MARKER );
       break;
     }
@@ -269,7 +269,7 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
       Group2->PushButton2->setDown( false );
       Group2->PushButton3->setDown( false );
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+      localSelection( TopAbs_VERTEX );
       myEditCurrentArgument = Group2->LineEdit1;
       Group2->LineEdit1->setText( "" );
       Group2->LineEdit2->setText( "" );
@@ -442,7 +442,7 @@ void BasicGUI_MarkerDlg::SetEditCurrentArgument()
   }
   else if ( send == Group2->PushButton1 ) {
     myEditCurrentArgument = Group2->LineEdit1;
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+    localSelection( TopAbs_VERTEX );
     Group2->PushButton2->setDown( false );
     Group2->PushButton3->setDown( false );
     Group2->LineEdit1->setEnabled( true );
@@ -451,7 +451,7 @@ void BasicGUI_MarkerDlg::SetEditCurrentArgument()
   }
   else if ( send == Group2->PushButton2 ) {
     myEditCurrentArgument = Group2->LineEdit2;
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
     Group2->PushButton1->setDown( false );
     Group2->PushButton3->setDown( false );
     Group2->LineEdit1->setEnabled( false );
@@ -460,7 +460,7 @@ void BasicGUI_MarkerDlg::SetEditCurrentArgument()
   }
   else if ( send == Group2->PushButton3 ) {
     myEditCurrentArgument = Group2->LineEdit3;
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
     Group2->PushButton1->setDown( false );
     Group2->PushButton2->setDown( false );
     Group2->LineEdit1->setEnabled( false );
index 707a456048365d2928eb6c3920865b691551c933..053fa5089942ded2e6cd9d1ccd623c5284367987 100644 (file)
@@ -291,7 +291,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked( int constructorId )
       
       /* for the first argument */
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+      localSelection( TopAbs_VERTEX );
       break;
     }
   case 1: /* plane from 3 points */
@@ -315,7 +315,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked( int constructorId )
       
       /* for the first argument */
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+      localSelection( TopAbs_VERTEX );
       break;
     }
   case 2: /* plane from a planar face */
@@ -331,7 +331,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked( int constructorId )
       GroupFace->PushButton1->setDown( true );
       
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+      localSelection( TopAbs_FACE );
       break;
     }
   case 3: /* plane from a 2 Vectors */
@@ -347,7 +347,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked( int constructorId )
       Group2Vec->PushButton1->setDown( true );
       
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+      localSelection( TopAbs_EDGE );
       break;
     }
   case 4: /* plane from a LCS */
@@ -575,7 +575,7 @@ void BasicGUI_PlaneDlg::SetEditCurrentArgument()
   if ( myEditCurrentArgument == GroupPntDir->LineEdit2 || 
        myEditCurrentArgument == Group2Vec->LineEdit1   ||
        myEditCurrentArgument == Group2Vec->LineEdit2 ) {
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
   } else if ( myEditCurrentArgument == GroupFace->LineEdit1 ) {
     TColStd_MapOfInteger aMap;
     aMap.Add( GEOM_PLANE );
@@ -585,7 +585,7 @@ void BasicGUI_PlaneDlg::SetEditCurrentArgument()
     globalSelection( GEOM_MARKER );
   }
   else { // 3 Pnts
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+    localSelection( TopAbs_VERTEX );
   }
 
   //  SelectionIntoArgument();
index 983666d280b9af71eed29afc0963034ebb9635b5..021592e5130d48bf467dff70a07139acf8d0fc09 100644 (file)
@@ -125,13 +125,17 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren
   GroupXYZ->TextLabel2->setText(tr("GEOM_Y"));
   GroupXYZ->TextLabel3->setText(tr("GEOM_Z"));
 
-  GroupOnCurve = new DlgRef_2Sel1Spin(centralWidget());
+  GroupOnCurve = new DlgRef_2Sel1Spin2Check(centralWidget());
   GroupOnCurve->GroupBox1->setTitle(tr("GEOM_POINT_ON_EDGE"));
   GroupOnCurve->TextLabel1->setText(tr("GEOM_EDGE"));
   GroupOnCurve->TextLabel2->setText(tr("GEOM_START_POINT"));
   GroupOnCurve->TextLabel3->setText(tr("GEOM_PARAMETER"));
   GroupOnCurve->PushButton1->setIcon(image2);
   GroupOnCurve->PushButton2->setIcon(image2);
+  GroupOnCurve->TextLabel3->setText(tr("GEOM_PARAMETER"));
+  GroupOnCurve->CheckButton1->setText(tr("GEOM_TAKE_ORIENTATION_INTO_ACCOUNT"));
+  GroupOnCurve->CheckButton2->setAttribute( Qt::WA_DeleteOnClose );
+  GroupOnCurve->CheckButton2->close();
 
   GroupOnSurface = new DlgRef_1Sel2Spin(centralWidget());
   GroupOnSurface->GroupBox1->setTitle(tr("GEOM_POINT_ON_FACE"));
@@ -258,6 +262,7 @@ void BasicGUI_PointDlg::Init()
 
   initSpinBox(GroupOnCurve->SpinBox_DX, 0., 1., step, "parametric_precision");
   GroupOnCurve->SpinBox_DX->setValue(0.5);
+  GroupOnCurve->CheckButton1->setChecked(true);
 
   initSpinBox(GroupOnSurface->SpinBox_DX, 0., 1., step, "parametric_precision");
   GroupOnSurface->SpinBox_DX->setValue(0.5);
@@ -275,6 +280,8 @@ void BasicGUI_PointDlg::Init()
 
   connect(myParamCoord,   SIGNAL(buttonClicked(int)), this, SLOT(ClickParamCoord(int)));
 
+  connect(GroupOnCurve->CheckButton1,         SIGNAL(toggled(bool)), this, SLOT(CheckBoxClicked()));
+
   connect(GroupOnCurve->PushButton1,          SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(GroupOnCurve->PushButton2,          SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(GroupOnSurface->PushButton1,        SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
@@ -328,7 +335,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
     {
       globalSelection(); // close local contexts, if any
       myNeedType = TopAbs_VERTEX;
-      localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+      localSelection(myNeedType);
 
       GroupRefPoint->hide();
       GroupOnCurve->hide();
@@ -343,7 +350,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
     {
       globalSelection(); // close local contexts, if any
       myNeedType = TopAbs_VERTEX;
-      localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+      localSelection(myNeedType);
 
       myEditCurrentArgument = GroupRefPoint->LineEdit1;
       myEditCurrentArgument->setText("");
@@ -362,7 +369,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
     {
       globalSelection(); // close local contexts, if any
       myNeedType = TopAbs_EDGE;
-      localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+      localSelection(myNeedType);
 
       myEditCurrentArgument = GroupOnCurve->LineEdit1;
       myEditCurrentArgument->setText("");
@@ -385,7 +392,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
       globalSelection(); // close local contexts, if any
       std::list<int> needTypes;
       needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE );
-      localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+      localSelection(needTypes );
 
       myEditCurrentArgument = GroupLineIntersection->LineEdit1;
       GroupLineIntersection->LineEdit1->setText("");
@@ -409,7 +416,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
     {
       globalSelection(); // close local contexts, if any
       myNeedType = TopAbs_FACE;
-      localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+      localSelection(myNeedType);
 
       myEditCurrentArgument = GroupOnSurface->LineEdit1;
       myEditCurrentArgument->setText("");
@@ -568,14 +575,14 @@ void BasicGUI_PointDlg::SetEditCurrentArgument()
     GroupRefPoint->LineEdit1->setFocus();
     myEditCurrentArgument = GroupRefPoint->LineEdit1;
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupOnCurve->PushButton1) {
     GroupOnCurve->LineEdit1->setFocus();
     myEditCurrentArgument = GroupOnCurve->LineEdit1;
     globalSelection(); // close local contexts, if any
     myNeedType = TopAbs_EDGE;
-    localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+    localSelection(myNeedType);
     GroupOnCurve->PushButton2->setDown(false);
     GroupOnCurve->LineEdit1->setEnabled(true);
     GroupOnCurve->LineEdit2->setEnabled(false);
@@ -585,7 +592,7 @@ void BasicGUI_PointDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupOnCurve->LineEdit2;
     globalSelection(); // close local contexts, if any
     myNeedType = TopAbs_VERTEX;
-    localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+    localSelection(myNeedType);
     GroupOnCurve->PushButton1->setDown(false);
     GroupOnCurve->LineEdit2->setEnabled(true);
     GroupOnCurve->LineEdit1->setEnabled(false);
@@ -595,7 +602,7 @@ void BasicGUI_PointDlg::SetEditCurrentArgument()
     GroupOnSurface->LineEdit1->setFocus();
     myEditCurrentArgument = GroupOnSurface->LineEdit1;
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE);
+    localSelection(TopAbs_FACE);
   }
   else if (send == GroupLineIntersection->PushButton1) {
     GroupLineIntersection->LineEdit1->setFocus();
@@ -669,7 +676,7 @@ void BasicGUI_PointDlg::ValueChangedInSpinBox(double newValue)
 // function : CheckBoxClicked()
 // purpose  : Check Boxes Management
 //=================================================================================
-void BasicGUI_PointDlg::CheckBoxClicked(int  State)
+void BasicGUI_PointDlg::CheckBoxClicked()
 {
   displayPreview(true);
 }
@@ -821,7 +828,9 @@ bool BasicGUI_PointDlg::execute(ObjectList& objects)
   case GEOM_POINT_EDGE :
     {
       if (myParamCoord->checkedId() == PARAM_VALUE) {
-        anObj = anOper->MakePointOnCurve(myEdge.get(), getParameter());
+        bool isUseOrientation = GroupOnCurve->CheckButton1->isChecked();
+
+        anObj = anOper->MakePointOnCurve(myEdge.get(), getParameter(), isUseOrientation);
         aParameters<<GroupOnCurve->SpinBox_DX->text();
       }
       else if (myParamCoord->checkedId() == LENGTH_VALUE) {
@@ -973,6 +982,7 @@ void BasicGUI_PointDlg::updateParamCoord(bool theIsUpdate)
     GroupOnCurve->LineEdit2->setVisible(isLength);
     GroupOnCurve->TextLabel3->setVisible(isParam || isLength);
     GroupOnCurve->SpinBox_DX->setVisible(isParam || isLength);
+    GroupOnCurve->CheckButton1->setVisible(isParam);
     if (isParam){
       initSpinBox(GroupOnCurve->SpinBox_DX, 0., 1., 0.1, "parametric_precision");
       GroupOnCurve->SpinBox_DX->setValue(0.5);
@@ -985,13 +995,13 @@ void BasicGUI_PointDlg::updateParamCoord(bool theIsUpdate)
     }
   }
   else if (id == GEOM_POINT_SURF) {
-    GroupOnSurface->TextLabel2->setShown(isParam);
-    GroupOnSurface->TextLabel3->setShown(isParam);
-    GroupOnSurface->SpinBox_DX->setShown(isParam);
-    GroupOnSurface->SpinBox_DY->setShown(isParam);
+    GroupOnSurface->TextLabel2->setVisible(isParam);
+    GroupOnSurface->TextLabel3->setVisible(isParam);
+    GroupOnSurface->SpinBox_DX->setVisible(isParam);
+    GroupOnSurface->SpinBox_DY->setVisible(isParam);
   }
 
-  GroupXYZ->setShown(!isParam && !isLength);
+  GroupXYZ->setVisible(!isParam && !isLength);
 
   if (theIsUpdate)
     QTimer::singleShot(50, this, SLOT(updateSize()));
index 7002333dba7f439a4e507dd1a3d084b8419fc192..ffc01a165876512eca8d7c6dcebae73afd951e84 100644 (file)
@@ -31,7 +31,7 @@
 #include "GEOM_GenericObjPtr.h"
 #include <QMap>
 
-class DlgRef_2Sel1Spin;
+class DlgRef_2Sel1Spin2Check;
 class DlgRef_3Spin;
 class DlgRef_2Sel;
 class DlgRef_1Sel3Spin;
@@ -88,7 +88,7 @@ private:
 
   DlgRef_3Spin*                      GroupXYZ;
   DlgRef_1Sel3Spin*                  GroupRefPoint;
-  DlgRef_2Sel1Spin*                  GroupOnCurve;
+  DlgRef_2Sel1Spin2Check*            GroupOnCurve;
   DlgRef_2Sel*                       GroupLineIntersection;
   DlgRef_1Sel2Spin*                  GroupOnSurface;
   
@@ -115,7 +115,7 @@ private slots:
   void                               ValueChangedInSpinBox( double );
   void                               SetDoubleSpinBoxStep( double );
   void                               ClickParamCoord( int );
-  void                               CheckBoxClicked( int );
+  void                               CheckBoxClicked();
   void                               updateSize();
 };
 
index 8b915423bb37e7e3be161d34bbbed9862cd98ba3..d2648f9cf32d52a73c263cd1f86d118c167ab483 100644 (file)
@@ -204,7 +204,7 @@ void BasicGUI_VectorDlg::ConstructorsClicked( int constructorId )
       GroupPoints->LineEdit2->setEnabled( false );
 
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+      localSelection( TopAbs_VERTEX );
       connect( myGeomGUI->getApp()->selectionMgr(),
                SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
       break;
@@ -325,7 +325,7 @@ void BasicGUI_VectorDlg::SetEditCurrentArgument()
   myEditCurrentArgument->setFocus();
   //  SelectionIntoArgument();
   globalSelection(); // close local selection to clear it
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
   send->setDown(true);
   displayPreview(true);
 }
index 3a4821820ca4414fcc4e20b596869f47408c8e90..769c8092c7d6087b5fae60d532d8668dfb9c84f6 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -94,7 +93,7 @@ SET(_moc_HEADERS
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(BasicGUI_SOURCES
   BasicGUI.cxx
index 4647d9e558dc1f693a29ba4c78842ea0049fc6c6..4908e5455091f8c815133c7a8999a85ad243d714 100644 (file)
 
 #include "utilities.h"
 
+//=======================================================================
+//function : IsToMerge
+//purpose  : This method return Standard_True if two edges have common
+//           vertex. This vertex is returned by output parameter. The
+//           difference with the method TopExp::CommonVertex is only in
+//           the case if there are two common vertices. In this case
+//           this method returns the last vertex of theEdge1, not the first
+//           one that TopExp::CommonVertex does.
+//=======================================================================
+static Standard_Boolean GetCommonVertex(const TopoDS_Edge   &theEdge1,
+                                        const TopoDS_Edge   &theEdge2,
+                                              TopoDS_Vertex &theCommon)
+{
+  Standard_Boolean   isFound = Standard_True;
+  ShapeAnalysis_Edge aSae;
+  TopoDS_Vertex      aVF1 = aSae.FirstVertex(theEdge1);
+  TopoDS_Vertex      aVL1 = aSae.LastVertex(theEdge1);
+  TopoDS_Vertex      aVF2 = aSae.FirstVertex(theEdge2);
+  TopoDS_Vertex      aVL2 = aSae.LastVertex(theEdge2);
+
+  if (aVL1.IsSame(aVF2) || aVL1.IsSame(aVL2)) {
+    theCommon = aVL1;
+  } else if (aVF1.IsSame(aVL2) || aVF1.IsSame(aVF2)) {
+    theCommon = aVF1;
+  } else {
+    theCommon.Nullify();
+    isFound = Standard_False;
+  }
+
+  return isFound;
+}
 
 //=======================================================================
 //function : IsToMerge
@@ -130,7 +161,7 @@ static Standard_Boolean IsToMerge
 
         isSame = Standard_True;
 
-        for (; anIter1.More(); anIter1.Next()) {
+        for (; anIter1.More() && isSame; anIter1.Next()) {
           TopoDS_Face aFace1 = TopoDS::Face(anIter1.Value());
           TopTools_ListIteratorOfListOfShape  anIter2(aLst2);
 
@@ -148,7 +179,7 @@ static Standard_Boolean IsToMerge
                 // that are connected to the common vertex.
                 TopoDS_Vertex aVCommon;
 
-                if (TopExp::CommonVertex(theEdge1, theEdge2, aVCommon)) {
+                if (GetCommonVertex(theEdge1, theEdge2, aVCommon)) {
                   TopTools_IndexedDataMapOfShapeListOfShape aMapVE;
 
                   TopExp::MapShapesAndAncestors
@@ -328,7 +359,7 @@ static TopoDS_Edge GlueEdgesWithPCurves(const TopTools_SequenceOfShape& aChain,
     
     if (i > 1)
     {
-      TopExp::CommonVertex(PrevEdge, anEdge, CV);
+      GetCommonVertex(PrevEdge, anEdge, CV);
       Standard_Real Tol = BRep_Tool::Tolerance(CV);
       tabtolvertex(i-2) = Tol;
     }
@@ -550,16 +581,24 @@ static Standard_Boolean MergeEdges(const TopTools_SequenceOfShape& SeqEdges,
       if (C.IsNull()) {
         // jfa for Mantis issue 0020228
         if (PV1.Distance(PV2) > Precision::Confusion()) continue;
-        // closed chain
-        if (edge1.Orientation() == TopAbs_FORWARD) {
-          C = C1;
-        } else {
-          C = Handle(Geom_Circle)::DownCast(C1->Reversed());
+        // closed chain. Make a closed circular edge starting from V1.
+        gp_Ax1 anAxis = C1->Axis();
+
+        if (edge1.Orientation() == TopAbs_REVERSED) {
+          anAxis.Reverse();
         }
 
+        const gp_Pnt &aP0 = anAxis.Location();
+        gp_Dir        aDX(PV1.XYZ().Subtracted(aP0.XYZ()));
+        gp_Ax2        aNewAxis(aP0, anAxis.Direction(), aDX);
+
+        C = new Geom_Circle(aNewAxis, C1->Radius());
+
         B.MakeEdge (E,C,Precision::Confusion());
         B.Add(E,V1);
         B.Add(E,V2);
+        B.UpdateVertex(V1, 0., E, 0.);
+        B.UpdateVertex(V2, 2.*M_PI, E, 0.);
       }
       else {
         gp_Pnt P0 = C->Location();
index c1b56f260ad7af7510e5970918ce7e6947885867..c1788bbb157405226f08706b4e6188fd4da50760 100644 (file)
@@ -138,8 +138,9 @@ static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges,
 {
   //map of edges
   TopTools_MapOfShape aNewEdges;
+  TopExp_Explorer exp(aShape,TopAbs_EDGE);
   //add edges without seams
-  for(TopExp_Explorer exp(aShape,TopAbs_EDGE); exp.More(); exp.Next()) {
+  for(; exp.More(); exp.Next()) {
     TopoDS_Shape edge = exp.Current();
     if(aNewEdges.Contains(edge))
       aNewEdges.Remove(edge);
@@ -164,9 +165,14 @@ static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges,
     }
   }
 
-  //add edges to the sequemce
-  for(TopTools_MapIteratorOfMapOfShape anIter(aNewEdges); anIter.More(); anIter.Next())
-    edges.Append(anIter.Key());
+  //add edges to the sequence
+  for(exp.ReInit(); exp.More(); exp.Next()) {
+    const TopoDS_Shape &anEdge = exp.Current();
+
+    if (aNewEdges.Contains(anEdge)) {
+      edges.Append(anEdge);
+    }
+  }
 
   return isDropped;
 }
index c4b98627186a7a0dde21e685e26557e912a83126..657d1ac39f7cc2c9ba2f2721bb22ea2b2ebc40e8 100644 (file)
@@ -387,7 +387,7 @@ void BlocksGUI_BlockDlg::SetEditCurrentArgument()
   aSender->setDown(true);
 
   globalSelection(); // close local contexts, if any
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE); //Select Faces on All Shapes
+  localSelection(TopAbs_FACE); //Select Faces on All Shapes
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
 }
@@ -400,7 +400,7 @@ void BlocksGUI_BlockDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
   globalSelection(); // close local contexts, if any
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE); //Select Faces on All Shapes
+  localSelection(TopAbs_FACE); //Select Faces on All Shapes
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
   displayPreview(true);
index 1f1fcda890ef7cd66e916c48ff505b0f4c11ffea..63352c47b11239d6a3916afced4ec8f46ac254e8 100644 (file)
@@ -46,7 +46,7 @@
 // purpose  : Constructs a BlocksGUI_ExplodeDlg which is a child of 'parent'.
 //=================================================================================
 BlocksGUI_ExplodeDlg::BlocksGUI_ExplodeDlg( GeometryGUI* theGeometryGUI, QWidget* parent )
-  : GEOMBase_Skeleton( theGeometryGUI, parent )
+  : GEOMBase_Skeleton( theGeometryGUI, parent ), myNbBlocks( 0 )
 {
   QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BLOCK_EXPLODE" ) ) );
   QPixmap imageS( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
@@ -189,7 +189,7 @@ bool BlocksGUI_ExplodeDlg::ClickOnApply()
     }
   }
 
-  if ( !onAccept() )
+  if ( !onAccept( true, true, false ) )
     return false;
 
   activateSelection();
@@ -351,7 +351,7 @@ void BlocksGUI_ExplodeDlg::updateButtonState()
 //=================================================================================
 bool BlocksGUI_ExplodeDlg::isAllSubShapes() const
 {
-  return !myGrp1->CheckBox1->isChecked() || !myGrp1->CheckBox1->isEnabled();
+  return !(myGrp1->CheckBox1->isEnabled() && myGrp1->CheckBox1->isChecked());
 }
 
 //=================================================================================
index b004d5c870b3a5c1762414724d13eb3c0200b6dc..39c42e5bab8a1867f983fed992b52a4058143806 100644 (file)
@@ -466,11 +466,11 @@ void BlocksGUI_QuadFaceDlg::activateSelection()
       myEditCurrentArgument == mySelName[Vertex3] ||
       myEditCurrentArgument == mySelName[Vertex4])
   {
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX); //Select Vertices on All Shapes
+    localSelection(TopAbs_VERTEX); //Select Vertices on All Shapes
   }
   else
   {
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE); //Select Edges on All Shapes
+    localSelection(TopAbs_EDGE); //Select Edges on All Shapes
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
index b441b58a866d7bb3bf0f0d08e14796f3b3c38cb8..985bfc97e63ebf22711f1dbbeb90095385efb9ff 100644 (file)
@@ -219,7 +219,6 @@ bool BlocksGUI_TrsfDlg::ClickOnApply()
 //=================================================================================
 void BlocksGUI_TrsfDlg::SelectionIntoArgument()
 {
-  erasePreview();
   myEditCurrentArgument->setText("");
 
   // Get index of current selection focus
@@ -273,7 +272,6 @@ void BlocksGUI_TrsfDlg::SelectionIntoArgument()
     }
     myEditCurrentArgument->setText(aName);
     myFaces[aCurrFocus] = anIndex;
-    processPreview();
   }
 
   switch (aCurrFocus) {
@@ -316,6 +314,8 @@ void BlocksGUI_TrsfDlg::SelectionIntoArgument()
   default:
     break;
   }
+
+  processPreview();
 }
 
 //=================================================================================
@@ -379,6 +379,8 @@ void BlocksGUI_TrsfDlg::SetEditCurrentArgument()
   aSender->setDown(true);
 
   activateSelection();
+
+  processPreview();
 }
 
 //=================================================================================
index ebc68572c05c7eab8ecceba39030c5504c98584b..a365598d36c6f2b297b231c8bd62d1591006f9c7 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-#INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -83,12 +81,12 @@ SET(_moc_HEADERS
   )
 
 # header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
+QT_WRAP_UIC(_uic_HEADERS ${_uic_files})
 
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(BlocksGUI_SOURCES
   BlocksGUI.cxx
index 11539451451bc8e228fcd068c131f53b6f013fcc..02ebd41d5c4b0f748dec4a9fe26b3f50fc3a30a9 100644 (file)
@@ -198,10 +198,7 @@ void BooleanGUI_Dialog::Init()
   mainFrame()->RadioButton1->setFocus();
 
   globalSelection(GEOM_ALLSHAPES);
-
-  std::list<int> needTypes;
-  needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
-  localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+  //localSelection(TopAbs_SHAPE); // VSR 24/09/2015: dectivate local selection in BOP (CoTech decision)
   
   myGroup->PushButton1->click();
   resize(100,100);
@@ -341,10 +338,7 @@ void BooleanGUI_Dialog::SetEditCurrentArgument()
   }
 
   globalSelection(GEOM_ALLSHAPES);
-
-  std::list<int> needTypes;
-  needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
-  localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+  //localSelection(TopAbs_SHAPE); // VSR 24/09/2015: dectivate local selection in BOP (CoTech decision)
 
   // enable line edit
   myEditCurrentArgument->setEnabled(true);
index e7c9b7850cf6d7744ac87e50485de6871c1662aa..f9f27055b16bb140cd54dff57eeddf0670615b82 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-#INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -75,12 +73,12 @@ SET(_moc_HEADERS
   )
 
 # header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
+QT_WRAP_UIC(_uic_HEADERS ${_uic_files})
 
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(BooleanGUI_SOURCES
   BooleanGUI.cxx
index b96feeeae7a604f2626c2e94fcbe848fe2d3a9b7..c34e448e5f66b1eedcceba72a6b88fbf106bc9ff 100644 (file)
@@ -145,7 +145,7 @@ void BuildGUI_EdgeDlg::Init()
   myEditCurrentArgument = GroupPoints->LineEdit1;
   GroupPoints->PushButton1->setDown(true);
   globalSelection(); // close local contexts, if any
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+  localSelection(TopAbs_VERTEX);
 
   // signals and slots connections
   connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
@@ -210,7 +210,7 @@ void BuildGUI_EdgeDlg::ConstructorsClicked(int constructorId)
   case 0:
     {
       globalSelection(); // close local contexts, if any
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+      localSelection(TopAbs_VERTEX);
 
       myEditCurrentArgument = GroupPoints->LineEdit1;
       GroupPoints->LineEdit1->setText("");
@@ -229,7 +229,7 @@ void BuildGUI_EdgeDlg::ConstructorsClicked(int constructorId)
   case 1:
     {
       globalSelection(); // close local contexts, if any
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_WIRE);
+      localSelection(TopAbs_WIRE);
 
       myEditCurrentArgument = GroupWire->LineEdit1;
       GroupWire->LineEdit1->setText("");
@@ -244,7 +244,7 @@ void BuildGUI_EdgeDlg::ConstructorsClicked(int constructorId)
   case 2:
     {
       globalSelection(); // close local contexts, if any
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+      localSelection(TopAbs_EDGE);
 
       myEditCurrentArgument = GroupOnCurve->LineEdit1;
       GroupOnCurve->LineEdit1->setText("");
@@ -302,7 +302,7 @@ void BuildGUI_EdgeDlg::SelectionIntoArgument()
     myEditCurrentArgument->setText(aName);
 
     globalSelection();
-    localSelection(GEOM::GEOM_Object::_nil(), aNeedType);
+    localSelection(aNeedType);
 
     if (myEditCurrentArgument == GroupPoints->LineEdit1) {
       myPoint1 = aSelectedObject;
@@ -359,7 +359,7 @@ void BuildGUI_EdgeDlg::SetEditCurrentArgument()
     GroupOnCurve->LineEdit2->setEnabled(false);
 
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   else if (send == GroupOnCurve->PushButton2) {
     myEditCurrentArgument = GroupOnCurve->LineEdit2;
@@ -367,7 +367,7 @@ void BuildGUI_EdgeDlg::SetEditCurrentArgument()
     GroupOnCurve->LineEdit1->setEnabled(false);
 
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
 
   // enable line edit
index 1f42c752a8448b095e2e1cf7d6c07070e4e13d93..afb657109e05fa2f28c0cd31ddfbf53d43778b4e 100644 (file)
@@ -156,8 +156,13 @@ BuildGUI_FaceDlg::BuildGUI_FaceDlg( GeometryGUI* theGeometryGUI, QWidget* parent
   columnNames.append( tr( "GEOM_EDGE" ));
   columnNames.append( tr( "GEOM_FACE_CONSTRAINT" ) );
   myTreeConstraints->setHeaderLabels( columnNames );
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
   myTreeConstraints->header()->setMovable( false );
   myTreeConstraints->header()->setResizeMode( QHeaderView::ResizeToContents );
+#else
+  myTreeConstraints->header()->setSectionsMovable( false );
+  myTreeConstraints->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
+#endif
   myTreeConstraints->setMinimumHeight( 140 );
 
   QHBoxLayout* l = new QHBoxLayout( myGroupWireConstraints->Box );
@@ -263,7 +268,7 @@ void BuildGUI_FaceDlg::ConstructorsClicked(int constructorId)
   case 1:
     {
       globalSelection(GEOM_FACE); // For the first element.
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+      localSelection( TopAbs_FACE );
 
       myEditCurrentArgument = myGroupSurf->LineEdit1;
       myGroupSurf->LineEdit1->setText("");
@@ -277,7 +282,7 @@ void BuildGUI_FaceDlg::ConstructorsClicked(int constructorId)
   case 2:
     {
       globalSelection();
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_WIRE );
+      localSelection( TopAbs_WIRE );
     
       myTreeConstraints->clear();
       myCurrentItem = 0;
@@ -323,7 +328,7 @@ void BuildGUI_FaceDlg::updateConstraintsTree()
 
   myEditCurrentArgument->setEnabled(false);
   globalSelection();
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+  localSelection( TopAbs_FACE );
   
   myTreeConstraints->resizeColumnToContents(0);
   QTreeWidgetItem* firstItem = myTreeConstraints->topLevelItem(0);
@@ -509,21 +514,21 @@ void BuildGUI_FaceDlg::SetEditCurrentArgument()
   }
   else if (send == myGroupSurf->PushButton1) {
     globalSelection(GEOM_FACE);
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+    localSelection( TopAbs_FACE );
     myEditCurrentArgument = myGroupSurf->LineEdit1;
     myGroupSurf->PushButton2->setDown(false);
     myGroupSurf->LineEdit2->setEnabled(false);
   }
   else if (send == myGroupSurf->PushButton2) {
     globalSelection(GEOM_WIRE);
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_WIRE );
+    localSelection( TopAbs_WIRE );
     myEditCurrentArgument = myGroupSurf->LineEdit2;
     myGroupSurf->PushButton1->setDown(false);
     myGroupSurf->LineEdit1->setEnabled(false);
   }
   else if (send == myGroupWireConstraints->PushButton1) {
     globalSelection();
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_WIRE );
+    localSelection( TopAbs_WIRE );
     myEditCurrentArgument = myGroupWireConstraints->LineEdit1;
     myCurrentItem = 0;
   }
@@ -659,8 +664,6 @@ bool BuildGUI_FaceDlg::execute( ObjectList& objects )
   }
 
   if (!anObj->_is_nil()) {
-    objects.push_back(anObj._retn());
-
     if ( !anOper->IsDone() && QString(anOper->GetErrorCode()) == "MAKE_FACE_TOLERANCE_TOO_BIG") {
       if ( !IsPreview() ) {
         SUIT_OverrideCursor wc;
@@ -670,6 +673,14 @@ bool BuildGUI_FaceDlg::execute( ObjectList& objects )
       }
       anOper->SetErrorCode("PAL_NO_ERROR");
     }
+    else if ( anObj->GetShapeType() == GEOM::COMPOUND ) {
+      if ( !IsPreview() ) {
+        SUIT_MessageBox::warning(this,
+                                 QObject::tr("GEOM_WRN_WARNING"),
+                                 QObject::tr("GEOM_WRN_FACES_NOT_FACE"));
+      }
+    }
+    objects.push_back(anObj._retn());
   }
 
   return res;
index 36ed6ad7ea04a24e2c04fadc63d35047c3046be9..6674e9eace88c02a269576aa12d6a894ec13e1bb 100644 (file)
@@ -262,10 +262,7 @@ bool BuildGUI_ShellDlg::execute( ObjectList& objects )
   GEOM::GEOM_Object_var anObj = anOper->MakeShell( objlist.in() );
 
   if ( !anObj->_is_nil() ) {
-    TopoDS_Shape aShell;
-    GEOMBase::GetShape(anObj, aShell, TopAbs_SHELL);
-
-    if (aShell.IsNull()) {
+    if (anObj->GetShapeType() == GEOM::COMPOUND) {
       SUIT_MessageBox::warning(this,
                                QObject::tr("GEOM_WRN_WARNING"),
                                QObject::tr("GEOM_WRN_FACES_NOT_SHELL"));
index 83c7213cf9277720d167dde27732c7fe5370e98c..0970282089c219bd79e23c64ce8e7761569f5398 100644 (file)
@@ -121,7 +121,7 @@ void BuildGUI_WireDlg::Init()
   
   myEdgesAndWires.clear();
 
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+  localSelection( TopAbs_EDGE );
 
   /* signals and slots connections */
   connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
@@ -177,12 +177,12 @@ void BuildGUI_WireDlg::TypeButtonClicked()
 {
   if ( GroupType->RadioButton1->isChecked() ) {
     globalSelection(); // close local contexts, if any
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
     GroupArgs->TextLabel1->setText( tr( "GEOM_EDGE" ) );
   }
   else if ( GroupType->RadioButton2->isChecked() ) {
     globalSelection(); // close local contexts, if any
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_WIRE );
+    localSelection( TopAbs_WIRE );
     GroupArgs->TextLabel1->setText( tr( "GEOM_WIRE" ) );
   }
   SelectionIntoArgument();
index 37bcff647a4f08fbe34608cc1543a81d70f72736..d3b92ad5247a42a936ff3e7ab33c416e979cbd95 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-#INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -90,12 +88,12 @@ SET(_moc_HEADERS
   )
 
 # header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
+QT_WRAP_UIC(_uic_HEADERS ${_uic_files})
 
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(BuildGUI_SOURCES
   BuildGUI.cxx
index d271e268eaef9f2b1eaabd65f07b1f6834b51a1a..13d33e44460c7c33dd6e25c655cdcc58f0951d85 100755 (executable)
@@ -24,7 +24,7 @@ SET(SUBDIRS_COMMON
   ARCHIMEDE BlockFix GEOMAlgo SKETCHER GEOM ShHealOper GEOMUtils XAO XAO_Swig 
   GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG GEOM_PY
   AdvancedEngine OCC2VTK
-  STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin VTKPlugin
+  STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin VTKPlugin Tools
   )
 
 ##
@@ -42,11 +42,14 @@ ENDIF()
 IF(SALOME_BUILD_GUI)
   SET(SUBDIRS_GUI
     OBJECT DlgRef GEOMFiltersSelection Material GEOMGUI
-    GEOMBase DependencyTree GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI
-    CurveCreator EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI
-    RepairGUI MeasureGUI GroupGUI BlocksGUI AdvancedGUI
+    GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI
+    CurveCreator MeasureGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI
+    RepairGUI GroupGUI BlocksGUI AdvancedGUI
     GEOM_SWIG_WITHIHM
     )
+  IF(SALOME_USE_GRAPHICSVIEW)
+    LIST(APPEND SUBDIRS_GUI DependencyTree)
+  ENDIF()
 ENDIF()
 
 SET(SUBDIRS
index c085fc69f014213067c4a1ded8b8bf7becee394d..89b7bcd270a8c9da5cc0fdb74c102fc79b37f077 100644 (file)
 #
 
 IF(SALOME_BUILD_GUI)
-  INCLUDE(${QT_USE_FILE})
+  INCLUDE(UseQtExt)
 ENDIF(SALOME_BUILD_GUI)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${CAS_INCLUDE_DIRS}
   ${KERNEL_INCLUDE_DIRS}
@@ -85,7 +84,7 @@ SET(CurveCreator_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
 
 IF(SALOME_BUILD_GUI)
   # sources / moc wrappings
-  QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+  QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 ENDIF(SALOME_BUILD_GUI)
 
 # sources / static
@@ -117,4 +116,3 @@ TARGET_LINK_LIBRARIES(CurveCreator ${_link_LIBRARIES})
 INSTALL(TARGETS CurveCreator EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 INSTALL(FILES ${CurveCreator_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-
index bb0f8545b0423a571976e083879b427cfe1105a4..148fabaab4d32a1fb220a881cbeb7511b90ac79d 100644 (file)
@@ -213,7 +213,9 @@ int CurveCreator_TreeViewModel::getPoint( const QModelIndex& theIndx ) const
 void CurveCreator_TreeViewModel::setCurve( CurveCreator_ICurve* theCurve )
 {
   myCurve = theCurve;
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
   reset();
+#endif
 }
 
 /*****************************************************************************************/
@@ -221,7 +223,11 @@ CurveCreator_TreeView::CurveCreator_TreeView( CurveCreator_ICurve* theCurve, QWi
   QTreeView(parent)
 {
   header()->hide();
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
   header()->setResizeMode(QHeaderView::ResizeToContents);
+#else
+  header()->setSectionResizeMode(QHeaderView::ResizeToContents);
+#endif
   setUniformRowHeights(true);
   setContextMenuPolicy( Qt::CustomContextMenu );
   CurveCreator_TreeViewModel* aModel = new CurveCreator_TreeViewModel(theCurve, this);
index 0aa01462a13db0b3c5d493e89b5dbb469717b75d..31ec9a39a7b034e0f096044110ed7db765a3e5e5 100644 (file)
@@ -17,7 +17,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
 
 # --- options ---
 
@@ -73,7 +73,7 @@ SET(_moc_HEADERS
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(DependencyTree_SOURCES
   DependencyTree_Arrow.cxx
@@ -101,4 +101,4 @@ INSTALL(TARGETS DependencyTree EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${S
 
 INSTALL(FILES ${DependencyTree_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 
-QT4_INSTALL_TS_RESOURCES("${_res_files}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_res_files}" "${SALOME_GEOM_INSTALL_RES_DATA}")
index d7e38c5f65ef983ffeb9c86b551c505ea16715b1..b558f334744ffd42200f17ab43a78953896b0b93 100644 (file)
@@ -39,7 +39,11 @@ const qreal arrowSize = 20;
 DependencyTree_Arrow::DependencyTree_Arrow( DependencyTree_Object* theStartItem,
                                             DependencyTree_Object* theEndItem,
                                             QGraphicsItem* parent, QGraphicsScene* scene )
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
 :QGraphicsLineItem( parent, scene ),
+#else
+:QGraphicsLineItem( parent ),
+#endif
 myIsBiLink( false ),
 myStartItem( theStartItem ),
 myEndItem( theEndItem )
index 7a9d92208017d765c1f2d3ccccfb0717100b5779..980c5097a528ab8db1518fb5bc48eee348b31ee7 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-#INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
-
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
index ac45eab233871365dab0e5d82e8f2bc58e13f3d9..6fa1dac2424ed4b21e7e37894f88843b36961ef6 100755 (executable)
@@ -17,7 +17,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
 
 # --- options ---
 
@@ -109,12 +109,12 @@ SET(_uic_files
 SET(_moc_HEADERS DlgRef.h)
 
 # header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
+QT_WRAP_UIC(_uic_HEADERS ${_uic_files})
 
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 # sources / to compile
 SET(DlgRef_SOURCES DlgRef.cxx ${_moc_SOURCES} ${_uic_HEADERS})
index ecfc09a2d4f7fbd29dba91dae9789e5c93ab9d50..15778cb7c4bf8fa6c168f56dbe4533f56c497429 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-#INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -39,6 +37,7 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/GEOMImpl
   ${PROJECT_SOURCE_DIR}/src/GEOMGUI
   ${PROJECT_SOURCE_DIR}/src/GEOMBase
+  ${PROJECT_SOURCE_DIR}/src/MeasureGUI
   ${PROJECT_SOURCE_DIR}/src/SKETCHER
   ${PROJECT_SOURCE_DIR}/src/CurveCreator
   ${PROJECT_SOURCE_DIR}/src/ShapeRecognition
@@ -67,6 +66,7 @@ SET(_link_LIBRARIES
   DlgRef
   GEOMSketcher
   CurveCreator
+  MeasureGUI
   )
 
 # optional sources
@@ -129,12 +129,12 @@ SET(_moc_HEADERS
   )
 
 # header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
+QT_WRAP_UIC(_uic_HEADERS ${_uic_files})
 
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(EntityGUI_SOURCES
   EntityGUI.cxx
index 41a10d23229ae437d1612a181b5f6c3311d5a45e..861d7c5b3fd4edcfdb38d47a9a9a4d99be9587c7 100755 (executable)
@@ -327,7 +327,7 @@ void EntityGUI_3DSketcherDlg::Init()
   myLengthPrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
   myTextPrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
 
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+  localSelection(TopAbs_VERTEX);
 
   /* Get setting of step value from file configuration */
   double step = SUIT_Session::session()->resourceMgr()->doubleValue("Geometry", "SettingsGeomStep", 100.0);
@@ -823,7 +823,7 @@ void EntityGUI_3DSketcherDlg::ActivateThisDialog()
   connect(myGeomGUI->getApp()->selectionMgr(),
           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+  localSelection(TopAbs_VERTEX);
   GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth);
 }
 
index 6e887f941eca2fbbf3a3d11d8de88ea8fb4ca584..aab2def9b6568c4112ec9d740d3317d6320e3027 100644 (file)
@@ -1695,7 +1695,7 @@ void EntityGUI_FieldDlg::activateSelection()
         TopoDS_Shape aSubShape = myShapeMap( index );
         QString anEntry = QString( "TEMP_" ) + aMainEntry.in() + QString("_%1").arg(index);
         Handle(SALOME_InteractiveObject) io =
-          new SALOME_InteractiveObject(anEntry.toAscii(), "GEOM", "TEMP_IO");
+          new SALOME_InteractiveObject(anEntry.toLatin1(), "GEOM", "TEMP_IO");
         aDisplayer->SetColor( aCol );
         SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, aView);
         if (aPrs) {
index f489c89c2e029bc718fbfe6847c2e44a7f2c6227..6749738fdec2ec85ebfbfd9ab742db57ca5a3be2 100644 (file)
@@ -541,7 +541,7 @@ void EntityGUI_SketcherDlg::InitClick()
   Group4Spin->hide();
   GroupRect->hide();
   globalSelection(); // close local selection to clear it
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
 }
 
 
@@ -1143,7 +1143,7 @@ void EntityGUI_SketcherDlg::ClickOnEnd()
     }
 
     QString Command = myCommand.join( "" );
-    Sketcher_Profile aProfile = Sketcher_Profile( Command.toAscii() );
+    Sketcher_Profile aProfile = Sketcher_Profile( Command.toLatin1() );
     bool isDone = false;
     TopoDS_Shape myShape = aProfile.GetShape( &isDone );
     if ( isDone ) {
@@ -1571,7 +1571,7 @@ void EntityGUI_SketcherDlg::SetEditCurrentArgument()
     selButton->setDown(true);
   }
   globalSelection(); // close local selection to clear it
-  localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+  localSelection( myNeedType );
 }
 
 
@@ -2341,12 +2341,12 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects )
 
     //Last Shape
     QString Command1 = myCommand.join( "" );
-    Sketcher_Profile aProfile1( Command1.toAscii() );
+    Sketcher_Profile aProfile1( Command1.toLatin1() );
     myShape1 = aProfile1.GetShape();
 
     //Current Shape
     QString Command2 = Command1 + GetNewCommand( aParameters );
-    Sketcher_Profile aProfile2( Command2.toAscii() );
+    Sketcher_Profile aProfile2( Command2.toLatin1() );
     myShape2 = aProfile2.GetShape( &isDone, &error );
 
     //Error Message
index 9db5fbab0723d932e37a3e99b5a037fddaf78724..085028ce12a02984a2b90971e09b9902d2360cbb 100644 (file)
@@ -30,6 +30,9 @@
 #include <GeometryGUI.h>
 #include <GEOMBase.h>
 #include <GEOMUtils.hxx>
+#ifndef DISABLE_PLOT2DVIEWER
+  #include <MeasureGUI_ShapeStatisticsDlg.h>
+#endif
 
 #include <OCCViewer_ViewModel.h>
 #include <SVTK_ViewModel.h>
@@ -165,6 +168,9 @@ EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidge
   myLessFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
   myGreaterFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
   myApplyFilterButton = new QPushButton(tr("GEOM_BUT_APPLY"), myFilterGrp);
+#ifndef DISABLE_PLOT2DVIEWER
+  myPlotDistributionButton = new QPushButton(tr("GEOM_PLOT_DISTRIBUTION"), myFilterGrp);
+#endif
 
   QGridLayout* filterLayout = new QGridLayout(myFilterGrp);
   filterLayout->addWidget(myLessFilterCheck,    0, 0);
@@ -174,6 +180,9 @@ EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidge
   filterLayout->addWidget(myGreaterFilterCombo, 1, 1);
   filterLayout->addWidget(myGreaterFilterSpin,  1, 2);
   filterLayout->addWidget(myApplyFilterButton,  0, 3);
+#ifndef DISABLE_PLOT2DVIEWER
+  filterLayout->addWidget(myPlotDistributionButton,  1, 3);
+#endif
 
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
@@ -250,6 +259,9 @@ void EntityGUI_SubShapeDlg::Init()
   connect(GroupPoints->PushButton4, SIGNAL(clicked()), this, SLOT(showOnlySelected()));
 
   connect(myApplyFilterButton, SIGNAL(clicked()),         this, SLOT(ClickOnOkFilter()));
+#ifndef DISABLE_PLOT2DVIEWER
+  connect(myPlotDistributionButton, SIGNAL(clicked()),    this, SLOT(ClickOnPlot()));
+#endif
   connect(myLessFilterCheck,   SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
   connect(myGreaterFilterCheck,   SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
 
@@ -322,7 +334,7 @@ void EntityGUI_SubShapeDlg::ClickOnOk()
   }
 
   if (isOk)
-    isOk = onAccept();
+    isOk = onAccept( true, true, false );
 
   if (isOk)
     ClickOnCancel();
@@ -491,6 +503,13 @@ void EntityGUI_SubShapeDlg::SubShapeToggled()
                           GroupPoints->CheckButton1->isChecked() &&
                           shapeType() < GEOM::VERTEX);
 
+#ifndef DISABLE_PLOT2DVIEWER
+  myPlotDistributionButton->setEnabled( myFilterGrp->isEnabled() &&
+                                       ( shapeType() == TopAbs_EDGE || 
+                                         shapeType() == TopAbs_FACE ||
+                                         shapeType() == TopAbs_SOLID ) );
+#endif
+
   activateSelection();
 }
 
@@ -936,6 +955,20 @@ void EntityGUI_SubShapeDlg::ClickOnOkFilter()
   updateButtonState();
 }
 
+#ifndef DISABLE_PLOT2DVIEWER
+//=================================================================================
+// function : ClickOnPlot()
+// purpose  : opens "Shape Statistics" dialog box in order to plot sub-shapes distribution.
+//=================================================================================
+void EntityGUI_SubShapeDlg::ClickOnPlot()
+{
+  QDialog* dlg = new MeasureGUI_ShapeStatisticsDlg( this, myShape, (TopAbs_ShapeEnum)shapeType() );
+  if ( dlg ) {
+    dlg->show();
+  }
+}
+#endif
+
 //=================================================================================
 // function : MeasureToggled()
 // purpose  :
index e3618ac41e97b5d5d6b210384930b1cea21c9c06..18c0c9ec87b1804f54a8b46c8fa46eb5a8435258 100644 (file)
@@ -73,6 +73,9 @@ private slots:
 
   void                                showOnlySelected();
   void                                ClickOnOkFilter();
+#ifndef DISABLE_PLOT2DVIEWER
+  void                                ClickOnPlot();
+#endif
   void                                MeasureToggled();
 
 private:
@@ -102,6 +105,7 @@ private:
   SalomeApp_DoubleSpinBox*            myLessFilterSpin;
   SalomeApp_DoubleSpinBox*            myGreaterFilterSpin;
   QPushButton*                        myApplyFilterButton;
+  QPushButton*                        myPlotDistributionButton;
   QGroupBox*                          myFilterGrp;
 };
 
index 0859c2850d5ca9c563a5f4b8f1d09ce1df681857..e7921bed45520072b77f5adaec1feb7d13c833ca 100644 (file)
@@ -88,6 +88,7 @@ static int MYDEBUG = 0;
 typedef std::map< TCollection_AsciiString, TCollection_AsciiString > TSting2StringMap;
 typedef std::map< TCollection_AsciiString, TObjectData >             TSting2ObjDataMap;
 typedef std::map< TCollection_AsciiString, TObjectData* >            TSting2ObjDataPtrMap;
+typedef std::map< int, std::list < int > >                           TIntToListIntMap;
 
 static GEOM_Engine* TheEngine = NULL;
 
@@ -123,6 +124,11 @@ bool ProcessFunction(Handle(GEOM_Function)&             theFunction,
                      std::set<TCollection_AsciiString>& theIgnoreObjs,
                      bool&                              theIsDumpCollected);
 
+static int GetTag(const TCollection_AsciiString &theEntry);
+
+static void FillMapOfRef(const Handle(GEOM_Function) &theFunction,
+                               TIntToListIntMap      &theRefMap);
+
 void ReplaceVariables(TCollection_AsciiString& theCommand,
                       const TVariablesList&    theVariables);
 
@@ -148,6 +154,12 @@ void PublishObject (TObjectData&                              theObjectData,
                     std::map< int, TCollection_AsciiString >& theEntryToCmdMap,
                     std::set<TCollection_AsciiString>&        theMapOfPublished);
 
+static TCollection_AsciiString GetPublishCommands
+                   (const int                                       theTag,
+                    const std::map< int, TCollection_AsciiString > &theEntryToCmdMap,
+                    const TIntToListIntMap                         &theMapRefs,
+                          std::set< int >                          &thePublished);
+
 //================================================================================
 /*!
  * \brief Fix up the name of python variable
@@ -674,6 +686,7 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
   // Mantis issue 0020768
   Standard_Integer objectCounter = 0;
   Resource_DataMapOfAsciiStringAsciiString aNameToEntry;
+  TIntToListIntMap                         aRefMap;
 
   if (aDoc->Main().FindAttribute(GEOM_Function::GetFunctionTreeID(), aRoot)) {
     TDataStd_ChildNodeIterator Itr(aRoot);
@@ -702,6 +715,10 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
             continue; // aCurScript is already at the end of aFuncScript
         aFuncScript += aCurScript;
       }
+
+      // Fill the map of references.
+      FillMapOfRef(aFunction, aRefMap);
+
       if (isDumpCollected ) {
         // Replace entries by the names
         ReplaceEntriesByNames( aFuncScript, aEntry2ObjData, isPublished,
@@ -717,9 +734,16 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
                          aNameToEntry, anEntryToCmdMap, anIgnoreObjMap );
         }
         // add publishing commands to the script
+        std::set< int >                                    aPublished;
         std::map< int, TCollection_AsciiString >::iterator anEntryToCmd = anEntryToCmdMap.begin();
-        for ( ; anEntryToCmd != anEntryToCmdMap.end(); ++anEntryToCmd )
-          aFuncScript += anEntryToCmd->second;
+
+        for ( ; anEntryToCmd != anEntryToCmdMap.end(); ++anEntryToCmd ) {
+          const TCollection_AsciiString aPublishCmds =
+              GetPublishCommands(anEntryToCmd->first, anEntryToCmdMap,
+                                 aRefMap, aPublished);
+
+          aFuncScript += aPublishCmds;
+        }
 
         // PTv, 0020001 add result objects from RestoreGivenSubShapes into ignore list,
         //  because they will be published during command execution
@@ -772,9 +796,16 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
                      aNameToEntry, anEntryToCmdMap, anIgnoreObjMap );
     }
     // add publishing commands to the script
+    std::set< int >                                    aPublished;
     std::map< int, TCollection_AsciiString >::iterator anEntryToCmd = anEntryToCmdMap.begin();
-    for ( ; anEntryToCmd != anEntryToCmdMap.end(); ++anEntryToCmd )
-      aScript += anEntryToCmd->second;
+
+    for ( ; anEntryToCmd != anEntryToCmdMap.end(); ++anEntryToCmd ) {
+      const TCollection_AsciiString aPublishCmds =
+          GetPublishCommands(anEntryToCmd->first, anEntryToCmdMap,
+                             aRefMap, aPublished);
+
+      aScript += aPublishCmds;
+    }
   }
 
   //RNV: issue 16219: EDF PAL 469: "RemoveFromStudy" Function
@@ -1197,6 +1228,64 @@ bool ProcessFunction(Handle(GEOM_Function)&             theFunction,
   return true;
 }
 
+//=============================================================================
+/*!
+ *  GetTag: Returns the tag from entry
+ */
+//=============================================================================
+int GetTag(const TCollection_AsciiString &theEntry)
+{
+  const int aGeomObjDepth = 3;
+  const int aTag          = theEntry.Token(":", aGeomObjDepth).IntegerValue();
+
+  return aTag;
+}
+
+//=============================================================================
+/*!
+ *  FillMapOfRef: Fill the map of references
+ */
+//=============================================================================
+void FillMapOfRef(const Handle(GEOM_Function) &theFunction,
+                        TIntToListIntMap      &theRefMap)
+{
+  TDF_LabelSequence       aSeq;
+  TCollection_AsciiString anObjEntry;
+  int                     anObjTag;
+
+  TDF_Tool::Entry(theFunction->GetOwnerEntry(), anObjEntry);
+  anObjTag = GetTag(anObjEntry);
+  theFunction->GetDependency(aSeq);
+
+  const Standard_Integer aLen = aSeq.Length();
+  Standard_Integer       i;
+
+  for (i = 1; i <= aLen; i++) {
+    TDF_Label             aRefLabel = aSeq.Value(i);
+    Handle(TDF_Reference) aRef;
+
+    if (aRefLabel.FindAttribute(TDF_Reference::GetID(), aRef)) {
+      if (!aRef.IsNull() && !aRef->Get().IsNull()) {
+        Handle(TDataStd_TreeNode) aT;
+
+        if (TDataStd_TreeNode::Find(aRef->Get(), aT)) {
+          TDF_Label             aDepLabel = aT->Label();
+          Handle(GEOM_Function) aRefFunct = GEOM_Function::GetFunction(aDepLabel);
+
+          if (!aRefFunct.IsNull()) {
+            // Get entry of the referenced object.
+            TDF_Tool::Entry(aRefFunct->GetOwnerEntry(), anObjEntry);
+
+            const int aRefTag = GetTag(anObjEntry);
+
+            theRefMap[anObjTag].push_back(aRefTag);
+          }
+        }
+      }
+    }
+  }
+}
+
 //=============================================================================
 /*!
  *  FindEntries: Returns a sequence of start/end positions of entries in the string
@@ -1726,8 +1815,6 @@ void PublishObject (TObjectData&                              theObjectData,
   if ( stEntry2DataPtr != theStEntry2ObjDataPtr.end() )
     aFatherData = stEntry2DataPtr->second;
 
-  const int geomObjDepth = 3;
-
   // treat multiply published object
   if ( theObjectData._pyName.IsEmpty() )
   {
@@ -1741,7 +1828,7 @@ void PublishObject (TObjectData&                              theObjectData,
     aCreationCommand += theObjectData._pyName + " = " + data0._pyName;
 
     // store aCreationCommand before publishing commands
-    int tag = theObjectData._entry.Token( ":", geomObjDepth ).IntegerValue();
+    int tag = GetTag(theObjectData._entry);
     theEntryToCmdMap.insert( std::make_pair( tag + 2*theEntry2ObjData.size(), aCreationCommand ));
   }
 
@@ -1756,12 +1843,57 @@ void PublishObject (TObjectData&                              theObjectData,
   aCommand += theObjectData._pyName + ", '" + theObjectData._name + "' )";
 
   // bind a command to the study entry
-  int tag = theObjectData._entry.Token( ":", geomObjDepth ).IntegerValue();
+  int tag = GetTag(theObjectData._entry);
   theEntryToCmdMap.insert( std::make_pair( tag, aCommand ));
 
   theObjectData._studyEntry.Clear(); // not to publish any more
 }
 
+//================================================================================
+/*!
+ * \brief Returns the string of publishing commands. Take into account that
+ *  references should be published prior to the objects refer to them.
+ */
+//================================================================================
+TCollection_AsciiString GetPublishCommands
+                   (const int                                       theTag,
+                    const std::map< int, TCollection_AsciiString > &theEntryToCmdMap,
+                    const TIntToListIntMap                         &theMapRefs,
+                          std::set< int >                          &thePublished)
+{
+  TCollection_AsciiString aResult;
+
+  if (!thePublished.count(theTag)) {
+    // This object is not published yet.
+    std::map< int, TCollection_AsciiString >::const_iterator anIt =
+      theEntryToCmdMap.find(theTag);
+
+    if (anIt != theEntryToCmdMap.end()) {
+      // There is a pubish cmd.
+      TIntToListIntMap::const_iterator aRefIt = theMapRefs.find(theTag);
+
+      if (aRefIt != theMapRefs.end()) {
+        // Recursively publish all references.
+        std::list< int >::const_iterator aRefTagIt = aRefIt->second.begin();
+  
+        for(; aRefTagIt != aRefIt->second.end(); ++aRefTagIt) {
+          const TCollection_AsciiString aRefCmd = GetPublishCommands
+            (*aRefTagIt, theEntryToCmdMap, theMapRefs, thePublished);
+
+          aResult += aRefCmd;
+        }
+      }
+
+      // Add the object command.
+      aResult += anIt->second;
+    }
+
+    thePublished.insert(theTag);
+  }
+
+  return aResult;
+}
+
 //================================================================================
 /*!
  * \brief Constructor
index 6d697dd991895d231bebf09c3bfcb8a834e1df8d..bcee3dc0451d34d56c8d965f6f372df7482226b8 100644 (file)
@@ -144,7 +144,7 @@ namespace GEOM
   TPythonDump::operator<< (const std::list<Handle(GEOM_Object)>& theObjects)
   {
     Standard_Integer aLength = theObjects.size();
-    if ( aLength > 1 ) {
+    if ( aLength != 1 ) {
       myStream << "[";
     }
     std::list<Handle(GEOM_Object)>::const_iterator obj = theObjects.begin();
@@ -152,7 +152,7 @@ namespace GEOM
       *this << *obj;
       if ( i < aLength ) myStream << ", ";
     }
-    if ( aLength > 1 ) {
+    if ( aLength != 1 ) {
       myStream << "]";
     }
     return *this;
index f44663a1026972c59249dc8a7089f5039d395b8b..d2b6024abadb4910378579dc3f69c441598a1cf8 100755 (executable)
@@ -59,7 +59,10 @@ SET(GEOMAlgo_HEADERS
   GEOMAlgo_DataMapOfPassKeyInteger.hxx
   GEOMAlgo_DataMapOfShapeMapOfShape.hxx
   GEOMAlgo_DataMapOfShapePnt.hxx
+  GEOMAlgo_FinderShapeOn.hxx
+  GEOMAlgo_FinderShapeOn1.hxx
   GEOMAlgo_FinderShapeOn2.hxx
+  GEOMAlgo_FinderShapeOnQuad.hxx
   GEOMAlgo_GetInPlace.hxx
   GEOMAlgo_GetInPlaceAPI.hxx
   GEOMAlgo_GlueAnalyser.hxx
@@ -77,6 +80,7 @@ SET(GEOMAlgo_HEADERS
   GEOMAlgo_IndexedDataMapOfShapeState.hxx
   GEOMAlgo_KindOfBounds.hxx
   GEOMAlgo_KindOfClosed.hxx
+  GEOMAlgo_KindOfDef.hxx
   GEOMAlgo_KindOfName.hxx
   GEOMAlgo_KindOfShape.hxx
   GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx
index 85d55bcfcd6f53a8c0d52c49b100f59b07964c90..91e59813fbd294e77a480fa7597e540b8f0a61f6 100644 (file)
@@ -11,25 +11,28 @@ GEOMAlgo_ShellSolid.cxx
 GEOMAlgo_AlgoTools.hxx
 GEOMAlgo_AlgoTools.cxx
 GEOMAlgo_AlgoTools_1.cxx
-GEOMAlgo_AlgoTools_2.cxx
 GEOMAlgo_SolidSolid.hxx
 GEOMAlgo_SolidSolid.cxx
 GEOMAlgo_ShapeAlgo.hxx
 GEOMAlgo_ShapeAlgo.cxx
+GEOMAlgo_FinderShapeOn.hxx
+GEOMAlgo_FinderShapeOn.cxx
+GEOMAlgo_FinderShapeOn1.hxx
+GEOMAlgo_FinderShapeOn1.cxx
 GEOMAlgo_HAlgo.hxx
 GEOMAlgo_HAlgo.cxx
 GEOMAlgo_Clsf.hxx
 GEOMAlgo_Clsf.cxx
 GEOMAlgo_ClsfBox.hxx
 GEOMAlgo_ClsfBox.cxx
-GEOMAlgo_ClsfQuad.hxx
-GEOMAlgo_ClsfQuad.cxx
 GEOMAlgo_ClsfSolid.hxx
 GEOMAlgo_ClsfSolid.cxx
 GEOMAlgo_ClsfSurf.hxx
 GEOMAlgo_ClsfSurf.cxx
 GEOMAlgo_FinderShapeOn2.hxx
 GEOMAlgo_FinderShapeOn2.cxx
+GEOMAlgo_FinderShapeOnQuad.hxx
+GEOMAlgo_FinderShapeOnQuad.cxx
 GEOMAlgo_Gluer.hxx
 GEOMAlgo_Gluer.cxx
 GEOMAlgo_GlueAnalyser.hxx
@@ -50,8 +53,6 @@ GEOMAlgo_GetInPlace.cxx
 GEOMAlgo_GetInPlace_1.cxx
 GEOMAlgo_GetInPlace_2.cxx
 GEOMAlgo_GetInPlace_3.cxx
-GEOMAlgo_GetInPlaceAPI.hxx
-GEOMAlgo_GetInPlaceAPI.cxx
 GEOMAlgo_Splitter.hxx
 GEOMAlgo_Splitter.cxx
 GEOMAlgo_ShapeInfoFiller.hxx
@@ -106,3 +107,5 @@ GEOMAlgo_ShapeInfo.cxx
 GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx
 
 Basics_OCCTVersion.hxx
+
+GEOMAlgo_KindOfDef.hxx
old mode 100755 (executable)
new mode 100644 (file)
index ae08f548096f10753bdd680a15640f4584faa20e..57184bff18b7f0a5ff51ec4bac0ee955f939409a 100644 (file)
@@ -93,15 +93,15 @@ static
                 Standard_Integer& iCnt);
 static
   void CopySource(const TopoDS_Shape& aS,
-                 TopTools_IndexedDataMapOfShapeShape& aMapSS,
-                 TopoDS_Shape& aSC);
+    TopTools_IndexedDataMapOfShapeShape& aMapSS,
+    TopoDS_Shape& aSC);
 
 //=======================================================================
 //function : CopyShape
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS,
-                                  TopoDS_Shape& aSC)
+       TopoDS_Shape& aSC)
 {
   TopTools_IndexedDataMapOfShapeShape aMapSS;
   //
@@ -112,8 +112,8 @@ void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS,
-                                  TopoDS_Shape& aSC,
-                                  TopTools_IndexedDataMapOfShapeShape& aMapSS)
+       TopoDS_Shape& aSC,
+       TopTools_IndexedDataMapOfShapeShape& aMapSS)
 {
   CopySource(aS, aMapSS, aSC);
 }
@@ -172,9 +172,9 @@ void CopySource(const TopoDS_Shape& aS,
 //purpose  : 
 //=======================================================================
 void GEOMAlgo_AlgoTools::FaceNormal (const TopoDS_Face& aF,
-                                    const Standard_Real U,
-                                    const Standard_Real V,
-                                    gp_Vec& aN)
+         const Standard_Real U,
+         const Standard_Real V,
+         gp_Vec& aN)
 {
   gp_Pnt aPnt ;
   gp_Vec aD1U, aD1V;
@@ -343,7 +343,7 @@ Standard_Integer GEOMAlgo_AlgoTools::BuildPCurveForEdgeOnFace
 // purpose:
 //=======================================================================
 void GEOMAlgo_AlgoTools::MakeContainer(const TopAbs_ShapeEnum theType,
-                                      TopoDS_Shape& theC)
+           TopoDS_Shape& theC)
 {
   BRep_Builder aBB;
   //
@@ -412,9 +412,9 @@ Standard_Boolean GEOMAlgo_AlgoTools::IsUPeriodic(const  Handle(Geom_Surface) &aS
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE,
-                                                  const TopoDS_Face& aF,
-                                                  const Standard_Real aUMin,
-                                                  const Standard_Real aUMax)
+         const TopoDS_Face& aF,
+         const Standard_Real aUMin,
+         const Standard_Real aUMax)
 {
   Standard_Real aT1, aT2, aTx, aUx, aTol;
   gp_Pnt2d aP2D;
@@ -559,7 +559,7 @@ Standard_Boolean GEOMAlgo_AlgoTools::ProjectPointOnShape
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
-                                    gp_Pnt& aP3D)
+         gp_Pnt& aP3D)
 {
   Standard_Real aTx, aT1, aT2;
   //
@@ -572,8 +572,8 @@ void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
-                                    const Standard_Real aT,
-                                    gp_Pnt& aP3D)
+         const Standard_Real aT,
+         gp_Pnt& aP3D)
 {
   Standard_Real aT1, aT2;
   Handle(Geom_Curve) aC3D;
@@ -586,9 +586,9 @@ void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
-                                    const Standard_Real aU,
-                                    const Standard_Real aV,
-                                    gp_Pnt& aP3D)
+         const Standard_Real aU,
+         const Standard_Real aV,
+         gp_Pnt& aP3D)
 {
   Handle(Geom_Surface) aS;
   //
@@ -600,7 +600,7 @@ void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
-                                    gp_Pnt& aP3D)
+         gp_Pnt& aP3D)
 {
   Standard_Real aU, aV, aUMin, aUMax, aVMin, aVMax;
   //
@@ -616,7 +616,7 @@ void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::PointOnShape(const TopoDS_Shape& aS,
-                                     gp_Pnt& aP3D)
+          gp_Pnt& aP3D)
 {
   TopAbs_ShapeEnum aType;
   //
@@ -713,7 +713,7 @@ Standard_Integer GEOMAlgo_AlgoTools::FindSDShapes
     return 0; // Nothing to do
   }
   //
-  while(1) {
+  for(;;) {
     aNbEProcessed=aMProcessed.Extent();
     if (aNbEProcessed==aNbE) {
       break;
@@ -922,8 +922,8 @@ void GetCount(const TopoDS_Shape& aS,
 //purpose  :
 //=======================================================================
 Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face& aF,
-                                              gp_Pnt& theP,
-                                              gp_Pnt2d& theP2D)
+                                               gp_Pnt& theP,
+                                               gp_Pnt2d& theP2D)
 {
   Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
   Standard_Integer iErr, aIx, aNbDomains, i;
@@ -948,8 +948,8 @@ Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face& aF,
   //
   Geom2dHatch_Intersector aIntr(aTotArcIntr, aTolTangfIntr);
   Geom2dHatch_Hatcher aHatcher(aIntr,
-                              aTolHatch2D, aTolHatch3D,
-                              Standard_True, Standard_False);
+          aTolHatch2D, aTolHatch3D,
+          Standard_True, Standard_False);
   //
   iErr=0;
   aEpsT=1.e-12;
@@ -1004,30 +1004,33 @@ Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face& aF,
   }
   //
   // 4.
+  aVx=aVMin;
   aNbDomains=aHatcher.NbDomains(aIx);
-  for (i=1; i<=aNbDomains; ++i) {
-    const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
-    bHasFirstPoint=aDomain.HasFirstPoint();
-    if (!bHasFirstPoint) {
-      iErr=5;
-      return iErr;
-    }
-    //
-    aV1=aDomain.FirstPoint().Parameter();
-    //
-    bHasSecondPoint=aDomain.HasSecondPoint();
-    if (!bHasSecondPoint) {
-      iErr=6;
-      return iErr;
-    }
-    //
-    aV2=aDomain.SecondPoint().Parameter();
-    //
-    aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
-    //
-    break;
+  if (!aNbDomains) {
+    iErr=5;
+    return iErr;
   }
   //
+  i=1;
+  const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
+  bHasFirstPoint=aDomain.HasFirstPoint();
+  if (!bHasFirstPoint) {
+    iErr=5;
+    return iErr;
+  }
+  //
+  aV1=aDomain.FirstPoint().Parameter();
+  //
+  bHasSecondPoint=aDomain.HasSecondPoint();
+  if (!bHasSecondPoint) {
+    iErr=6;
+    return iErr;
+  }
+  //
+  aV2=aDomain.SecondPoint().Parameter();
+  //
+  aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
+  //
   aS->D0(aUx, aVx, aPx);
   //
   theP2D.SetCoord(aUx, aVx);
index e721aca85e0ed905bb832c0944fc6aa50a783cc8..4db6801de96fc7045d33e6a82a11d8ecd443a273 100644 (file)
@@ -62,7 +62,6 @@
 #include <BRepLib_MakeFace.hxx>
 #include <BRepLib_FaceError.hxx>
 
-//#include <BOPTools_DSFiller.hxx>
 
 #include <GEOMAlgo_WireSolid.hxx>
 #include <GEOMAlgo_ShellSolid.hxx>
@@ -300,7 +299,6 @@ void GEOMAlgo_FinderShapeOn::Find(const TopoDS_Shape& aS)
 {
   myErrorStatus=0;
   //
-  Standard_Boolean bIsDone;
   Standard_Integer i, iErr;
   TopAbs_State aSts[]={TopAbs_IN, TopAbs_OUT, TopAbs_ON};
   TopTools_ListIteratorOfListOfShape aIt;
index 6487a04ac8e77ec418f47669c530a503f9766dff..f2f7fe0d51c6c03685a71cd369d116e51f554db3 100644 (file)
@@ -309,6 +309,9 @@ void GEOMAlgo_FinderShapeOn1::ProcessEdges()
   aType1=myGAS.GetType();
   //
   TopExp::MapShapes(myShape, TopAbs_EDGE, aM);
+  //
+  bIsConformState=Standard_False;
+  //
   aNb=aM.Extent();
   for (i=1; i<=aNb; ++i) {
     GEOMAlgo_ListOfPnt aLP;
@@ -427,6 +430,8 @@ void GEOMAlgo_FinderShapeOn1::ProcessFaces()
       }
     }
     //
+    bIsConformState=Standard_False;
+    //
     aExp.Init(aF, TopAbs_EDGE);
     for (; aExp.More(); aExp.Next()) {
       const TopoDS_Shape& aE=aExp.Current();
@@ -500,6 +505,9 @@ void GEOMAlgo_FinderShapeOn1::ProcessSolids()
     const TopoDS_Shape& aSd=aM(i);
     aMF.Clear();
     TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
+    //
+    bIsConformState=Standard_False;
+    //
     aNbF=aMF.Extent();
     for (j=1; j<=aNbF; ++j) {
       const TopoDS_Shape& aF=aMF(j);
@@ -660,7 +668,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Face& aF,
     }// if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder)
   }// if (!aNb && myNbPntsMin) {
 }
-//modified by NIZNHY-PKV Thu Jan 26 09:56:20 2012f
 //=======================================================================
 //function : InnerPoints
 //purpose  :
@@ -676,7 +683,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
   aLP.Clear();
   InnerPoints(aE, aNbPntsMin, aLP);
 }
-//modified by NIZNHY-PKV Thu Jan 26 09:56:32 2012t
 //=======================================================================
 //function : InnerPoints
 //purpose  :
@@ -702,16 +708,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
     return;
   }
   //
-  //modified by NIZNHY-PKV Thu Jan 26 09:51:20 2012f
-  /*
-  aNbT=myNbPntsMin+1;
-  dT=(aT2-aT1)/aNbT;
-  for (j=1; j<=aNbPntsMin; ++j) {
-    aT=aT1+j*dT;
-    aC3D->D0(aT, aP);
-    aLP.Append(aP);
-  }
-  */
   aNbT=aNbPntsMin+1;
   dT=(aT2-aT1)/aNbT;
   for (j=1; j<aNbT; ++j) {
@@ -719,7 +715,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
     aC3D->D0(aT, aP);
     aLP.Append(aP);
   }
-  //modified by NIZNHY-PKV Thu Jan 26 09:51:24 2012t
 }
 
 //=======================================================================
index 439caec37553401368f4e839bc3a845ebc70603b..e2e34de0fefe009075e38d742c2ee8e4c4bd879e 100644 (file)
@@ -362,6 +362,8 @@ void GEOMAlgo_FinderShapeOn2::ProcessEdges()
     //
     const TopoDS_Edge& aE=TopoDS::Edge(aM(i));
     //
+    bIsConformState=Standard_False;
+    //
     aExp.Init(aE, TopAbs_VERTEX);
     for (; aExp.More(); aExp.Next()) {
       const TopoDS_Shape& aV=aExp.Current();
@@ -475,6 +477,9 @@ void GEOMAlgo_FinderShapeOn2::ProcessFaces()
       }
     }
     //
+    //
+    bIsConformState=Standard_False;
+    //
     aExp.Init(aF, TopAbs_EDGE);
     for (; aExp.More(); aExp.Next()) {
       const TopoDS_Shape& aE=aExp.Current();
@@ -558,6 +563,9 @@ void GEOMAlgo_FinderShapeOn2::ProcessSolids()
     const TopoDS_Shape& aSd=aM(i);
     aMF.Clear();
     TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
+    //
+    bIsConformState=Standard_False;
+    //
     aNbF=aMF.Extent();
     for (j=1; j<=aNbF; ++j) {
       const TopoDS_Shape& aF=aMF(j);
index 6c1afa4e9832329f4cc1e4fcc9247aab9aaf6cf6..878faf172d5e9cdb34dac68b476f257f5f3c1b7f 100644 (file)
@@ -126,93 +126,75 @@ Standard_Integer GEOMAlgo_GetInPlaceAPI::GetInPlaceOld
     return 1;
   }
 
-  TopoDS_Shape     aPntShape;
-  TopoDS_Vertex    aVertex;
-  bool             isFound = false;
-  TopAbs_ShapeEnum iType   = TopAbs_SOLID;
-  //Standard_Real    aWhat_Mass = 0., aWhere_Mass = 0.;
-  Standard_Real    tab_aWhat[4],    tab_aWhere[4];
-  Standard_Real    dl_l = 1e-3;
-  Standard_Real    min_l, Tol_0D, Tol_1D, Tol_2D, Tol_3D, Tol_Mass;
-  Standard_Real    aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
-  Bnd_Box          BoundingBox;
-  gp_Pnt           aPnt, aPnt_aWhat, tab_Pnt[2];
-  GProp_GProps     aProps;
-
-  iType = GEOMUtils::GetTypeOfSimplePart(theWhat);
+  // Check shape type.
+  TopAbs_ShapeEnum iType = GEOMUtils::GetTypeOfSimplePart(theWhat);
+
   if (iType == TopAbs_SHAPE) {
     // Error: An attempt to extract a shape of not supported type.
     return 2;
   }
 
-  TopExp_Explorer Exp_aWhat  ( theWhat,  iType );
-  TopExp_Explorer Exp_aWhere ( theWhere, iType );
-  TopExp_Explorer Exp_Edge   ( theWhere, TopAbs_EDGE );
-
-  // Find the shortest edge in theShapeWhere shape
-  BRepBndLib::Add(theWhere, BoundingBox);
-  BoundingBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
-  min_l = fabs(aXmax - aXmin);
-  if( min_l < fabs(aYmax - aYmin) ) min_l = fabs(aYmax - aYmin);
-  if( min_l < fabs(aZmax - aZmin) ) min_l = fabs(aZmax - aZmin);
-  min_l /= dl_l;
-  // Mantis issue 0020908 BEGIN
-  if (!Exp_Edge.More()) {
-    min_l = Precision::Confusion();
-  }
-  // Mantis issue 0020908 END
-  for ( Standard_Integer nbEdge = 0; Exp_Edge.More(); Exp_Edge.Next(), nbEdge++ ) {
-    TopExp_Explorer Exp_Vertex( Exp_Edge.Current(), TopAbs_VERTEX);
-    for ( Standard_Integer nbVertex = 0; Exp_Vertex.More(); Exp_Vertex.Next(), nbVertex++ ) {
-      aPnt = BRep_Tool::Pnt( TopoDS::Vertex( Exp_Vertex.Current() ) );
-      tab_Pnt[nbVertex] = aPnt;
-    }
-    if ( ! tab_Pnt[0].IsEqual(tab_Pnt[1], dl_l) ) {
-      BRepGProp::LinearProperties(Exp_Edge.Current(), aProps);
-      if ( aProps.Mass() < min_l ) min_l = aProps.Mass();
+  // Compute confusion tolerance.
+  Standard_Real    aTolConf = Precision::Confusion();
+  Standard_Integer i;
+
+  for (i = 0; i < 2; ++i) {
+    TopExp_Explorer anExp(i == 0 ? theWhere : theWhat, TopAbs_VERTEX);
+
+    for (; anExp.More(); anExp.Next()) {
+      const TopoDS_Vertex aVtx = TopoDS::Vertex(anExp.Current());
+      const Standard_Real aTolVtx = BRep_Tool::Tolerance(aVtx);
+
+      if (aTolVtx > aTolConf) {
+        aTolConf = aTolVtx;
+      }
     }
   }
 
-  // Compute tolerances
-  Tol_0D = dl_l;
-  Tol_1D = dl_l * min_l;
-  Tol_2D = dl_l * ( min_l * min_l) * ( 2. + dl_l);
-  Tol_3D = dl_l * ( min_l * min_l * min_l ) * ( 3. + (3 * dl_l) + (dl_l * dl_l) );
-
-  if (Tol_0D < Precision::Confusion()) Tol_0D = Precision::Confusion();
-  if (Tol_1D < Precision::Confusion()) Tol_1D = Precision::Confusion();
-  if (Tol_2D < Precision::Confusion()) Tol_2D = Precision::Confusion();
-  if (Tol_3D < Precision::Confusion()) Tol_3D = Precision::Confusion();
+  // Compute mass tolerance.
+  Bnd_Box       aBoundingBox;
+  Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+  Standard_Real aMassTol;
 
-  Tol_Mass = Tol_3D;
-  if ( iType == TopAbs_VERTEX )    Tol_Mass = Tol_0D;
-  else if ( iType == TopAbs_EDGE ) Tol_Mass = Tol_1D;
-  else if ( iType == TopAbs_FACE ) Tol_Mass = Tol_2D;
+  BRepBndLib::Add(theWhere, aBoundingBox);
+  BRepBndLib::Add(theWhat,  aBoundingBox);
+  aBoundingBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
+  aMassTol = Max(aXmax - aXmin, aYmax - aYmin);
+  aMassTol = Max(aMassTol, aZmax - aZmin);
+  aMassTol *= aTolConf;
 
-  // Searching for the sub-shapes inside the ShapeWhere shape
+  // Compute the result.
+  TopExp_Explorer     Exp_aWhat  (theWhat,  iType);
+  TopExp_Explorer     Exp_aWhere (theWhere, iType);
+  Standard_Real       tab_aWhat[4], tab_aWhere[4];
+  gp_Pnt              aPnt, aPnt_aWhat;
+  TopoDS_Shape        aPntShape;
+  TopoDS_Vertex       aVertex;
+  bool                isFound = false;
   TopTools_MapOfShape map_aWhere;
-  for ( Exp_aWhere.ReInit(); Exp_aWhere.More(); Exp_aWhere.Next() ) {
+
+  for (; Exp_aWhere.More(); Exp_aWhere.Next()) {
     if (!map_aWhere.Add(Exp_aWhere.Current()))
       continue; // skip repeated shape to avoid mass addition
     GetShapeProperties( Exp_aWhere.Current(), tab_aWhere, aPnt );
     for ( Exp_aWhat.ReInit(); Exp_aWhat.More(); Exp_aWhat.Next() ) {
       GetShapeProperties( Exp_aWhat.Current(), tab_aWhat, aPnt_aWhat );
-      if ( fabs(tab_aWhat[3] - tab_aWhere[3]) <= Tol_Mass && aPnt_aWhat.Distance(aPnt) <= Tol_1D )
+      if (fabs(tab_aWhat[3] - tab_aWhere[3]) <= aMassTol && aPnt_aWhat.Distance(aPnt) <= aTolConf)
         isFound = true;
       else {
-        if ( (tab_aWhat[3] - tab_aWhere[3]) > Tol_Mass ) {
+        if (tab_aWhat[3] > tab_aWhere[3]) {
           aPntShape = BRepBuilderAPI_MakeVertex( aPnt ).Shape();
           aVertex   = TopoDS::Vertex( aPntShape );
           BRepExtrema_DistShapeShape aWhereDistance ( aVertex, Exp_aWhere.Current() );
           BRepExtrema_DistShapeShape aWhatDistance  ( aVertex, Exp_aWhat.Current() );
-          if ( aWhereDistance.IsDone() && aWhatDistance.IsDone() &&
-               fabs(aWhereDistance.Value() - aWhatDistance.Value()) <= Tol_1D )
+          if (aWhereDistance.IsDone() && aWhatDistance.IsDone() &&
+              fabs(aWhereDistance.Value() - aWhatDistance.Value()) <= aTolConf)
           {
             // 0020162: "EDF 961 GEOM : Getinplace is getting additionnal orthogonal faces"
             // aVertex must be projected to the same point on Where and on What
             gp_Pnt pOnWhat  = aWhatDistance.PointOnShape2(1);
             gp_Pnt pOnWhere = aWhereDistance.PointOnShape2(1);
-            isFound = ( pOnWhat.Distance(pOnWhere) <= Tol_1D );
+            isFound = (pOnWhat.Distance(pOnWhere) <= aTolConf);
             if ( isFound && iType == TopAbs_FACE )
             {
               // check normals at pOnWhat and pOnWhere
index c717997e3826289a4353a548154853ffccbcd9a1..03416d293fa26c0b8cfc1ca0f229a4e6a1196d0c 100644 (file)
@@ -239,7 +239,6 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
   gp_Pnt aPx;
   gp_Pnt2d aP2Dx;
   gp_Vec aDNx;
-
   TopoDS_Face aF;
   TopExp_Explorer aExp;
   //
@@ -247,9 +246,8 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
   aCoef=10.;
   //
   aExp.Init (aZ, TopAbs_FACE);
-  for (; aExp.More() ; aExp.Next()) {
+  if (aExp.More()) {
     aF=*((TopoDS_Face*)&aExp.Current());
-    break;
   }
   //
   iErr=PntInFace(aF, aPx, aP2Dx);
@@ -368,29 +366,31 @@ Standard_Integer PntInFace(const TopoDS_Face& aF,
   //
   // 4.
   aNbDomains=aHatcher.NbDomains(aIx);
-  for (i=1; i<=aNbDomains; ++i) {
-    const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
-    bHasFirstPoint=aDomain.HasFirstPoint();
-    if (!bHasFirstPoint) {
-      iErr=5;
-      return iErr;
-    }
-    //
-    aV1=aDomain.FirstPoint().Parameter();
-    //
-    bHasSecondPoint=aDomain.HasSecondPoint();
-    if (!bHasSecondPoint) {
-      iErr=6;
-      return iErr;
-    }
-    //
-    aV2=aDomain.SecondPoint().Parameter();
-    //
-    aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
-    //
-    break;
+  if (!aNbDomains) {
+    iErr=5;
+    return iErr;
+  }
+  //
+  i=1;
+  const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
+  bHasFirstPoint=aDomain.HasFirstPoint();
+  if (!bHasFirstPoint) {
+    iErr=5;
+    return iErr;
+  }
+  //
+  aV1=aDomain.FirstPoint().Parameter();
+  //
+  bHasSecondPoint=aDomain.HasSecondPoint();
+  if (!bHasSecondPoint) {
+    iErr=6;
+    return iErr;
   }
   //
+  aV2=aDomain.SecondPoint().Parameter();
+  //
+  aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
+  //
   aS->D0(aUx, aVx, aPx);
   //
   theP2D.SetCoord(aUx, aVx);
index e5ca7dfbdad98cf0db273041c476a2c5d0b0aaa1..bad1fe01f67b65b720463b5deea102cc61b7220c 100644 (file)
@@ -90,7 +90,6 @@ GEOMAlgo_GlueDetector::GEOMAlgo_GlueDetector()
 //=======================================================================
 GEOMAlgo_GlueDetector::~GEOMAlgo_GlueDetector()
 {}
-//modified by NIZNHY-PKV Tue Mar 13 12:26:50 2012f
 //=======================================================================
 //function : StickedShapes
 //purpose  :
@@ -100,7 +99,6 @@ const TopTools_IndexedDataMapOfShapeListOfShape&
 {
   return myStickedShapes;
 }
-//modified by NIZNHY-PKV Tue Mar 13 12:26:54 2012t
 //=======================================================================
 //function : Perform
 //purpose  :
@@ -124,12 +122,10 @@ void GEOMAlgo_GlueDetector::Perform()
     return;
   }
   //
-  //modified by NIZNHY-PKV Wed Mar 14 08:00:09 2012f
   CheckDetected();
   if (myErrorStatus) {
     return;
   }
-  //modified by NIZNHY-PKV Wed Mar 14 08:00:12 2012t
   //
   DetectEdges();
   if (myErrorStatus) {
@@ -206,7 +202,7 @@ void GEOMAlgo_GlueDetector::DetectVertices()
     TColStd_MapIteratorOfMapOfInteger aIt1;
     //
     aMIP.Add(i);
-    while(1) {
+    for(;;) {
       aNbIP=aMIP.Extent();
       aIt1.Initialize(aMIP);
       for(; aIt1.More(); aIt1.Next()) {
@@ -460,7 +456,6 @@ void GEOMAlgo_GlueDetector::EdgePassKey(const TopoDS_Edge& aE,
   //
   aPK.SetShapes(aLV);
 }
-//modified by NIZNHY-PKV Tue Mar 13 09:54:18 2012f
 //=======================================================================
 //function : CheckDetected
 //purpose  :
@@ -607,4 +602,3 @@ Standard_Integer CheckAncesstors
   //
   return iRet;
 }
-//modified by NIZNHY-PKV Tue Mar 13 09:54:59 2012t
old mode 100755 (executable)
new mode 100644 (file)
index 3c1d629..d9f8079
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-// File:       GEOMAlgo_Gluer.cxx
-// Created:    Sat Dec 04 12:45:53 2004
-// Author:     Peter KURNEV
-//             <peter@PREFEX>
+// File: GEOMAlgo_Gluer.cxx
+// Created: Sat Dec 04 12:45:53 2004
+// Author: Peter KURNEV
+//  <peter@PREFEX>
 //
 #include <GEOMAlgo_Gluer.hxx>
 
 //
 static
   void GetSubShapes(const TopoDS_Shape& aS,
-                   TopTools_IndexedMapOfShape& aMSS);
+      TopTools_IndexedMapOfShape& aMSS);
 
 //=======================================================================
 //function : GEOMAlgo_Gluer
@@ -228,10 +228,7 @@ void GEOMAlgo_Gluer::MakeVertices()
   TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
   TopTools_DataMapOfShapeListOfShape aMVV;
   GEOMAlgo_IndexedDataMapOfIntegerShape aMIS;
-  //modified by NIZNHY-PKV Thu Jan 21 10:03:07 2010f
-  //GEOMAlgo_IndexedDataMapOfShapeBox aMSB;
   GEOMAlgo_IndexedDataMapOfShapeBndSphere aMSB;
-  //modified by NIZNHY-PKV Thu Jan 21 10:03:10 2010t
   //
   GEOMAlgo_BndSphereTreeSelector aSelector;
   GEOMAlgo_BndSphereTree aBBTree;
@@ -278,57 +275,54 @@ void GEOMAlgo_Gluer::MakeVertices()
     TColStd_MapIteratorOfMapOfInteger aIt1;
     //
     aMIP.Add(i);
-    while(1) {
+    for(;;) {
       aNbIP=aMIP.Extent();
       aIt1.Initialize(aMIP);
       for(; aIt1.More(); aIt1.Next()) {
-       aIP=aIt1.Key();
-       if (aMIPC.Contains(aIP)) {
-         continue;
-       }
-       //
-       const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
-       //modified by NIZNHY-PKV Thu Jan 21 10:04:09 2010f
-       const GEOMAlgo_BndSphere& aBoxVP=aMSB.FindFromKey(aVP);
-       //const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
-       //modified by NIZNHY-PKV Thu Jan 21 10:04:11 2010t
-       //
-       aSelector.Clear();
-       aSelector.SetBox(aBoxVP);
-       //
-       aNbVSD=aBBTree.Select(aSelector);
-       if (!aNbVSD) {
-         continue;  // it must not be
-       }
-       //
-       const TColStd_ListOfInteger& aLI=aSelector.Indices();
-       //
-       aIt.Initialize(aLI);
-       for (; aIt.More(); aIt.Next()) {
-         aIP1=aIt.Value();
-         if (aMIP.Contains(aIP1)) {
-           continue;
-         }
-         aMIP1.Add(aIP1);
-       } //for (; aIt.More(); aIt.Next()) {
+        aIP=aIt1.Key();
+        if (aMIPC.Contains(aIP)) {
+          continue;
+        }
+        //
+        const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
+        const GEOMAlgo_BndSphere& aBoxVP=aMSB.FindFromKey(aVP);
+        //
+        aSelector.Clear();
+        aSelector.SetBox(aBoxVP);
+        //
+        aNbVSD=aBBTree.Select(aSelector);
+        if (!aNbVSD) {
+          continue;  // it must not be
+ }
+        //
+        const TColStd_ListOfInteger& aLI=aSelector.Indices();
+        //
+        aIt.Initialize(aLI);
+        for (; aIt.More(); aIt.Next()) {
+          aIP1=aIt.Value();
+          if (aMIP.Contains(aIP1)) {
+            continue;
+          }
+          aMIP1.Add(aIP1);
+        } //for (; aIt.More(); aIt.Next()) {
       }//for(; aIt1.More(); aIt1.Next()) {
       //
       aNbIP1=aMIP1.Extent();
       if (!aNbIP1) {
-       break;
+        break;
       }
       //
       aIt1.Initialize(aMIP);
       for(; aIt1.More(); aIt1.Next()) {
-       aIP=aIt1.Key();
-       aMIPC.Add(aIP);
+        aIP=aIt1.Key();
+        aMIPC.Add(aIP);
       }
       //
       aMIP.Clear();
       aIt1.Initialize(aMIP1);
       for(; aIt1.More(); aIt1.Next()) {
-       aIP=aIt1.Key();
-       aMIP.Add(aIP);
+        aIP=aIt1.Key();
+        aMIP.Add(aIP);
       }
       aMIP1.Clear();
     }// while(1)
@@ -344,13 +338,13 @@ void GEOMAlgo_Gluer::MakeVertices()
     else { // SD vertices founded [ aMIPC ]
       aIt1.Initialize(aMIPC);
       for(j=0; aIt1.More(); aIt1.Next(), ++j) {
-       aIP=aIt1.Key();
-       const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
-       if (!j) {
-         aVF=aVP;
-       }
-       aLVSD.Append(aVP);
-       aMVProcessed.Add(aVP);
+        aIP=aIt1.Key();
+        const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
+        if (!j) {
+          aVF=aVP;
+        }
+        aLVSD.Append(aVP);
+        aMVProcessed.Add(aVP);
       }
     }
     myImages.Bind(aVF, aLVSD);
@@ -395,7 +389,7 @@ void GEOMAlgo_Gluer::MakeVertices()
     for (; aItS.More(); aItS.Next()) {
       const TopoDS_Shape& aVSD=aItS.Value();
       if (!myOrigins.IsBound(aVSD)) {
-       myOrigins.Bind(aVSD, aV);
+        myOrigins.Bind(aVSD, aV);
       }
     }
   }
@@ -468,7 +462,8 @@ void GEOMAlgo_Gluer::MakeSubShapes (const TopoDS_Shape&  theShape,
           aER.Orientation(TopAbs_FORWARD);
           if (!BRep_Tool::Degenerated(aER)) {
             // orient image
-            Standard_Boolean bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
+            Standard_Boolean bIsToReverse=
+              GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
             if (bIsToReverse) {
               aER.Reverse();
             }
@@ -490,8 +485,7 @@ void GEOMAlgo_Gluer::MakeSubShapes (const TopoDS_Shape&  theShape,
       aBB.Add(theResult, aShapeR);
     }
   }
-  else
-  {
+  else  {
     if (myKeepNonSolids)    {
       // just add image
       const TopoDS_Shape& aShapeR = myOrigins.Find(theShape);
@@ -554,12 +548,12 @@ void GEOMAlgo_Gluer::MakeShells()
       const TopoDS_Face& aF=TopoDS::Face(aExp.Current());
       aFR=TopoDS::Face(myOrigins.Find(aF));
       if (aFR.IsSame(aF)) {
-       aBB.Add(aNewShell, aF);
-       continue;
+        aBB.Add(aNewShell, aF);
+        continue;
       }
       bIsToReverse=IsToReverse(aFR, aF);
       if (bIsToReverse) {
-       aFR.Reverse();
+        aFR.Reverse();
       }
       aBB.Add(aNewShell, aFR);
     }
@@ -660,25 +654,25 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
     if (aNbSDF==1) {
       bHasNewSubShape=HasNewSubShape(aS1);
       if (!bHasNewSubShape) {
-       aNewShape=aS1;
-       aNewShape.Orientation(TopAbs_FORWARD);
+        aNewShape=aS1;
+        aNewShape.Orientation(TopAbs_FORWARD);
       }
     }
     //
     if (bHasNewSubShape) {
       if (aType==TopAbs_FACE) {
-       TopoDS_Face aNewFace;
-       //
-       const TopoDS_Face& aF1=TopoDS::Face(aS1);
-       MakeFace(aF1, aNewFace);
-       aNewShape=aNewFace;
+        TopoDS_Face aNewFace;
+        //
+        const TopoDS_Face& aF1=TopoDS::Face(aS1);
+        MakeFace(aF1, aNewFace);
+        aNewShape=aNewFace;
       }
       else if (aType==TopAbs_EDGE) {
-       TopoDS_Edge aNewEdge;
-       //
-       const TopoDS_Edge& aE1=TopoDS::Edge(aS1);
-       MakeEdge(aE1, aNewEdge);
-       aNewShape=aNewEdge;
+        TopoDS_Edge aNewEdge;
+        //
+        const TopoDS_Edge& aE1=TopoDS::Edge(aS1);
+        MakeEdge(aE1, aNewEdge);
+        aNewShape=aNewEdge;
       }
     }
     //
@@ -688,7 +682,7 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
     for (; aItS.More(); aItS.Next()) {
       const TopoDS_Shape& aFSD=aItS.Value();
       if (!myOrigins.IsBound(aFSD)) {
-       myOrigins.Bind(aFSD, aNewShape);
+        myOrigins.Bind(aFSD, aNewShape);
       }
     }
   }
@@ -728,12 +722,12 @@ void GEOMAlgo_Gluer::CheckResult()
     for (j=1; j<=aNbFS; ++j) {
       const TopoDS_Shape& aFS=aMFS(j);
       if (aMFR.Contains(aFS)) {
-       const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS);
-       aNbSx=aLSx.Extent();
-       if (aNbSx==2) {
-         bFound=!bFound;
-         break;
-       }
+        const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS);
+        aNbSx=aLSx.Extent();
+        if (aNbSx==2) {
+          bFound=!bFound;
+          break;
+        }
       }
     }
     //
@@ -795,7 +789,7 @@ void GEOMAlgo_Gluer::InnerTolerance()
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
-                                GEOMAlgo_PassKeyShape& aPK)
+     GEOMAlgo_PassKeyShape& aPK)
 {
   Standard_Integer i, aNbE;
   TopTools_ListOfShape aLE;
@@ -820,7 +814,7 @@ void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
-                                GEOMAlgo_PassKeyShape& aPK)
+     GEOMAlgo_PassKeyShape& aPK)
 {
   TopoDS_Vertex aV1, aV2;
   //
@@ -839,7 +833,7 @@ void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
-                               TopoDS_Vertex& aNewVertex)
+    TopoDS_Vertex& aNewVertex)
 {
   Standard_Integer aNbV;
   Standard_Real aTolV, aD, aDmax;
@@ -885,7 +879,7 @@ void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
-                             TopoDS_Edge& aNewEdge)
+         TopoDS_Edge& aNewEdge)
 {
   myErrorStatus=0;
   //
@@ -939,7 +933,7 @@ void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
-                             TopoDS_Face& aNewFace)
+         TopoDS_Face& aNewFace)
 {
   myErrorStatus=0;
   //
@@ -975,20 +969,20 @@ void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
       //
       aER.Orientation(TopAbs_FORWARD);
       if (!BRep_Tool::Degenerated(aER)) {
-       // build p-curve
-       if (bIsUPeriodic) {
-         GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
-       }
-       BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
-
-       // orient image
-       bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
-       if (bIsToReverse) {
-         aER.Reverse();
-       }
+        // build p-curve
+        if (bIsUPeriodic) {
+          GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
+          }
+        BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
+        
+        // orient image
+        bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
+        if (bIsToReverse) {
+          aER.Reverse();
+        }
       }
       else {
-       aER.Orientation(aE.Orientation());
+        aER.Orientation(aE.Orientation());
       }
       //
       aBB.Add(newWire, aER);
@@ -1009,7 +1003,7 @@ void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
 //purpose  :
 //=======================================================================
 Standard_Boolean GEOMAlgo_Gluer::IsToReverse(const TopoDS_Face& aFR,
-                                            const TopoDS_Face& aF)
+                                             const TopoDS_Face& aF)
 {
   Standard_Boolean bRet;
   Standard_Real aT, aT1, aT2, aTR, aScPr;
@@ -1088,7 +1082,7 @@ Standard_Boolean GEOMAlgo_Gluer::HasNewSubShape(const TopoDS_Shape& aS)const
 //purpose  :
 //=======================================================================
 void GetSubShapes(const TopoDS_Shape& aS,
-                 TopTools_IndexedMapOfShape& aMSS)
+    TopTools_IndexedMapOfShape& aMSS)
 {
   Standard_Integer aR;
   TopAbs_ShapeEnum aType;
@@ -1111,7 +1105,8 @@ void GetSubShapes(const TopoDS_Shape& aS,
 //function : Modified
 //purpose  :
 //=======================================================================
-const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified (const TopoDS_Shape& aS)
+const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified
+  (const TopoDS_Shape& aS)
 {
   TopAbs_ShapeEnum aType;
   //
@@ -1127,7 +1122,7 @@ const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified (const TopoDS_Shape& aS)
     if(myOrigins.IsBound(aS)) {
       const TopoDS_Shape& aSnew=myOrigins.Find(aS);
       if (!aSnew.IsSame(aS)) {
-       myGenerated.Append(aSnew);
+        myGenerated.Append(aSnew);
       }
     }
   }
index 80e71f4fae4c52c0e5b9c30c7f2ec5e3a1d57d3b..7ecbd807bb3ee10d9a8efdcc46e997987df52b76 100644 (file)
@@ -84,11 +84,8 @@ void GEOMAlgo_Gluer2::Clear()
   myImagesToWork.Clear();
   myOriginsToWork.Clear();
   myKeepNonSolids=Standard_False;
-  //modified by NIZNHY-PKV Tue Mar 13 13:38:28 2012f
   myDetector.Clear();
-  //modified by NIZNHY-PKV Tue Mar 13 13:38:30 2012t
 }
-//modified by NIZNHY-PKV Tue Mar 13 12:26:50 2012f
 //=======================================================================
 //function : StickedShapes
 //purpose  :
@@ -98,12 +95,12 @@ const TopTools_IndexedDataMapOfShapeListOfShape&
 {
   return myDetector.StickedShapes();
 }
-//modified by NIZNHY-PKV Tue Mar 13 12:26:54 2012t
 //=======================================================================
 //function : SetShapesToGlue
 //purpose  :
 //=======================================================================
-void GEOMAlgo_Gluer2::SetShapesToGlue(const TopTools_DataMapOfShapeListOfShape& aM)
+void GEOMAlgo_Gluer2::SetShapesToGlue
+  (const TopTools_DataMapOfShapeListOfShape& aM)
 {
   myShapesToGlue=aM;
 }
@@ -241,6 +238,7 @@ void GEOMAlgo_Gluer2::CheckData()
   myWarningStatus=0;
   //
   aNbSG=myShapesToGlue.Extent();
+  aType=TopAbs_SHAPE;
   if (aNbSG) {
     // Check myShapesToGlue
     aItDMSLS.Initialize(myShapesToGlue);
@@ -587,6 +585,7 @@ void GEOMAlgo_Gluer2::BuildResult()
   myErrorStatus=0;
   myWarningStatus=0;
   //
+  bHasImage=Standard_False;
   aItC.Initialize(myArgument);
   for (; aItC.More(); aItC.Next()) {
     const TopoDS_Shape& aCx=aItC.Value();
diff --git a/src/GEOMAlgo/GEOMAlgo_KindOfDef.hxx b/src/GEOMAlgo/GEOMAlgo_KindOfDef.hxx
new file mode 100644 (file)
index 0000000..fab5929
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//GEOMAlgo_KindOfDef
+#ifndef _GEOMAlgo_KindOfDef_HeaderFile
+#define _GEOMAlgo_KindOfDef_HeaderFile
+
+
+enum GEOMAlgo_KindOfDef {
+GEOMAlgo_KD_UNKNOWN,
+GEOMAlgo_KD_SPECIFIED,
+GEOMAlgo_KD_ARBITRARY
+};
+
+#ifndef _Standard_PrimitiveTypes_HeaderFile
+#include <Standard_PrimitiveTypes.hxx>
+#endif
+
+#endif
index eda5fba088fe71d9b5b9d8f875768e06a56a7cd6..cf012663ecda63232ad00c343cbf6dee2c2545ad 100644 (file)
@@ -44,7 +44,8 @@ GEOMAlgo_KN_DISKELLIPSE,
 GEOMAlgo_KN_RECTANGLE,
 GEOMAlgo_KN_TRIANGLE,
 GEOMAlgo_KN_QUADRANGLE,
-GEOMAlgo_KN_ARCELLIPSE
+GEOMAlgo_KN_ARCELLIPSE,
+GEOMAlgo_KN_SOLID
 };
 
 #ifndef _Standard_PrimitiveTypes_HeaderFile
index 32efa59c96b97c16834364d9d3c53b51a8968179..382fdef6a0f0068c28f1c30b1d0ebbaca2d3897e 100644 (file)
@@ -35,9 +35,7 @@ GEOMAlgo_KS_PLANE,
 GEOMAlgo_KS_CIRCLE,
 GEOMAlgo_KS_LINE,
 GEOMAlgo_KS_DEGENERATED,
-//modified by NIZNHY-PKV Tue Jul 03 10:28:09 2012f
 GEOMAlgo_KS_BSPLINE
-//modified by NIZNHY-PKV Tue Jul 03 10:28:11 2012t
 };
 
 #ifndef _Standard_PrimitiveTypes_HeaderFile
index b91eb9728cb91128e374c31adc848ca108838d8e..fe4b7f69b0fb5d4726d5a1a02be4287c01526c10 100644 (file)
@@ -29,6 +29,8 @@ static
   void DumpKindOfBounds(const GEOMAlgo_KindOfBounds aKB);
 static
   void DumpKindOfName(const GEOMAlgo_KindOfName aKS);
+static
+  void DumpKindOfDef(const GEOMAlgo_KindOfDef aKD);
 static
   void DumpPosition(const gp_Ax3& aAx3);
 static
@@ -39,7 +41,7 @@ static
 //function :
 //purpose  :
 //=======================================================================
-  GEOMAlgo_ShapeInfo::GEOMAlgo_ShapeInfo()
+GEOMAlgo_ShapeInfo::GEOMAlgo_ShapeInfo()
 {
   Reset();
 }
@@ -47,14 +49,14 @@ static
 //function : ~
 //purpose  :
 //=======================================================================
-  GEOMAlgo_ShapeInfo::~GEOMAlgo_ShapeInfo()
+GEOMAlgo_ShapeInfo::~GEOMAlgo_ShapeInfo()
 {
 }
 //=======================================================================
 //function : Reset
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::Reset()
+void GEOMAlgo_ShapeInfo::Reset()
 {
   Standard_Integer i;
   //
@@ -69,6 +71,7 @@ static
   myKindOfBounds=GEOMAlgo_KB_UNKNOWN;
   myKindOfClosed=GEOMAlgo_KC_UNKNOWN;
   myKindOfName=GEOMAlgo_KN_UNKNOWN;
+  myKindOfDef=GEOMAlgo_KD_UNKNOWN;
   //
   myLocation.SetCoord(99., 99., 99.);
   myDirection.SetCoord(1.,0.,0.);
@@ -83,7 +86,7 @@ static
 //function : SetType
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetType(const TopAbs_ShapeEnum aType)
+void GEOMAlgo_ShapeInfo::SetType(const TopAbs_ShapeEnum aType)
 {
   myType=aType;
 }
@@ -91,7 +94,7 @@ static
 //function : Type
 //purpose  :
 //=======================================================================
-  TopAbs_ShapeEnum GEOMAlgo_ShapeInfo::Type() const
+TopAbs_ShapeEnum GEOMAlgo_ShapeInfo::Type() const
 {
   return myType;
 }
@@ -99,8 +102,8 @@ static
 //function : SetNbSubShapes
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetNbSubShapes(const TopAbs_ShapeEnum aType,
-                                          const Standard_Integer aNb)
+void GEOMAlgo_ShapeInfo::SetNbSubShapes(const TopAbs_ShapeEnum aType,
+                                        const Standard_Integer aNb)
 {
   Standard_Integer iN;
 
@@ -113,7 +116,8 @@ static
 //function : NbSubShapes
 //purpose  :
 //=======================================================================
-  Standard_Integer GEOMAlgo_ShapeInfo::NbSubShapes(const TopAbs_ShapeEnum aType) const
+Standard_Integer GEOMAlgo_ShapeInfo::NbSubShapes
+  (const TopAbs_ShapeEnum aType) const
 {
   Standard_Integer iN;
 
@@ -127,7 +131,7 @@ static
 //function : SetKindOfShape
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetKindOfShape(const GEOMAlgo_KindOfShape aT)
+void GEOMAlgo_ShapeInfo::SetKindOfShape(const GEOMAlgo_KindOfShape aT)
 {
   myKindOfShape=aT;
 }
@@ -135,7 +139,7 @@ static
 //function : KindOfShape
 //purpose  :
 //=======================================================================
-  GEOMAlgo_KindOfShape GEOMAlgo_ShapeInfo::KindOfShape() const
+GEOMAlgo_KindOfShape GEOMAlgo_ShapeInfo::KindOfShape() const
 {
   return myKindOfShape;
 }
@@ -143,7 +147,7 @@ static
 //function : SetKindOfName
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetKindOfName(const GEOMAlgo_KindOfName aT)
+void GEOMAlgo_ShapeInfo::SetKindOfName(const GEOMAlgo_KindOfName aT)
 {
   myKindOfName=aT;
 }
@@ -151,7 +155,7 @@ static
 //function : KindOfName
 //purpose  :
 //=======================================================================
-  GEOMAlgo_KindOfName GEOMAlgo_ShapeInfo::KindOfName() const
+GEOMAlgo_KindOfName GEOMAlgo_ShapeInfo::KindOfName() const
 {
   return myKindOfName;
 }
@@ -159,7 +163,7 @@ static
 //function : SetKindOfBounds
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetKindOfBounds(const GEOMAlgo_KindOfBounds aT)
+void GEOMAlgo_ShapeInfo::SetKindOfBounds(const GEOMAlgo_KindOfBounds aT)
 {
   myKindOfBounds=aT;
 }
@@ -167,7 +171,7 @@ static
 //function : KindOfBounds
 //purpose  :
 //=======================================================================
-  GEOMAlgo_KindOfBounds GEOMAlgo_ShapeInfo::KindOfBounds() const
+GEOMAlgo_KindOfBounds GEOMAlgo_ShapeInfo::KindOfBounds() const
 {
   return myKindOfBounds;
 }
@@ -175,7 +179,7 @@ static
 //function : SetKindOfClosed
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetKindOfClosed(const GEOMAlgo_KindOfClosed aT)
+void GEOMAlgo_ShapeInfo::SetKindOfClosed(const GEOMAlgo_KindOfClosed aT)
 {
   myKindOfClosed=aT;
 }
@@ -183,15 +187,31 @@ static
 //function : KindOfClosed
 //purpose  :
 //=======================================================================
-  GEOMAlgo_KindOfClosed GEOMAlgo_ShapeInfo::KindOfClosed() const
+GEOMAlgo_KindOfClosed GEOMAlgo_ShapeInfo::KindOfClosed() const
 {
   return myKindOfClosed;
 }
 //=======================================================================
+//function : SetKindOfDef
+//purpose  :
+//=======================================================================
+void GEOMAlgo_ShapeInfo::SetKindOfDef(const GEOMAlgo_KindOfDef aT)
+{
+  myKindOfDef=aT;
+}
+//=======================================================================
+//function : KindOfDef
+//purpose  :
+//=======================================================================
+GEOMAlgo_KindOfDef GEOMAlgo_ShapeInfo::KindOfDef() const
+{
+  return myKindOfDef;
+}
+//=======================================================================
 //function : SetLocation
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetLocation(const gp_Pnt& aP)
+void GEOMAlgo_ShapeInfo::SetLocation(const gp_Pnt& aP)
 {
   myLocation=aP;
 }
@@ -199,7 +219,7 @@ static
 //function : Location
 //purpose  :
 //=======================================================================
-  const gp_Pnt& GEOMAlgo_ShapeInfo::Location() const
+const gp_Pnt& GEOMAlgo_ShapeInfo::Location() const
 {
   return myLocation;
 }
@@ -207,7 +227,7 @@ static
 //function : SetDirection
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetDirection(const gp_Dir& aD)
+void GEOMAlgo_ShapeInfo::SetDirection(const gp_Dir& aD)
 {
   myDirection=aD;
 }
@@ -215,7 +235,7 @@ static
 //function : Direction
 //purpose  :
 //=======================================================================
-  const gp_Dir& GEOMAlgo_ShapeInfo::Direction() const
+const gp_Dir& GEOMAlgo_ShapeInfo::Direction() const
 {
   return myDirection;
 }
@@ -223,7 +243,7 @@ static
 //function : SetPosition
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax2& aAx2)
+void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax2& aAx2)
 {
   gp_Ax3 aAx3(aAx2);
   SetPosition(aAx3);
@@ -232,7 +252,7 @@ static
 //function : SetPosition
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax3& aAx3)
+void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax3& aAx3)
 {
   myPosition=aAx3;
 }
@@ -240,7 +260,7 @@ static
 //function : Position
 //purpose  :
 //=======================================================================
-  const gp_Ax3& GEOMAlgo_ShapeInfo::Position() const
+const gp_Ax3& GEOMAlgo_ShapeInfo::Position() const
 {
   return myPosition;
 }
@@ -249,7 +269,7 @@ static
 //function : SetPnt1
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetPnt1(const gp_Pnt& aP)
+void GEOMAlgo_ShapeInfo::SetPnt1(const gp_Pnt& aP)
 {
   myPnt1=aP;
 }
@@ -257,7 +277,7 @@ static
 //function : Pnt1
 //purpose  :
 //=======================================================================
-  const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt1() const
+const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt1() const
 {
   return myPnt1;
 }
@@ -265,7 +285,7 @@ static
 //function : SetPnt2
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetPnt2(const gp_Pnt& aP)
+void GEOMAlgo_ShapeInfo::SetPnt2(const gp_Pnt& aP)
 {
   myPnt2=aP;
 }
@@ -273,7 +293,7 @@ static
 //function : Pnt2
 //purpose  :
 //=======================================================================
-  const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt2() const
+const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt2() const
 {
   return myPnt2;
 }
@@ -281,7 +301,7 @@ static
 //function : SetRadius1
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetRadius1(const Standard_Real aR)
+void GEOMAlgo_ShapeInfo::SetRadius1(const Standard_Real aR)
 {
   myRadius1=aR;
 }
@@ -289,7 +309,7 @@ static
 //function : Radius1
 //purpose  :
 //=======================================================================
-  Standard_Real GEOMAlgo_ShapeInfo::Radius1() const
+Standard_Real GEOMAlgo_ShapeInfo::Radius1() const
 {
   return myRadius1;
 }
@@ -297,7 +317,7 @@ static
 //function : SetRadius2
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetRadius2(const Standard_Real aR)
+void GEOMAlgo_ShapeInfo::SetRadius2(const Standard_Real aR)
 {
   myRadius2=aR;
 }
@@ -305,7 +325,7 @@ static
 //function : Radius2
 //purpose  :
 //=======================================================================
-  Standard_Real GEOMAlgo_ShapeInfo::Radius2() const
+Standard_Real GEOMAlgo_ShapeInfo::Radius2() const
 {
   return myRadius2;
 }
@@ -313,7 +333,7 @@ static
 //function : SetLength
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetLength(const Standard_Real aL)
+void GEOMAlgo_ShapeInfo::SetLength(const Standard_Real aL)
 {
   myLength=aL;
 }
@@ -321,7 +341,7 @@ static
 //function : Length
 //purpose  :
 //=======================================================================
-  Standard_Real GEOMAlgo_ShapeInfo::Length() const
+Standard_Real GEOMAlgo_ShapeInfo::Length() const
 {
   return myLength;
 }
@@ -329,7 +349,7 @@ static
 //function : SetWidth
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetWidth(const Standard_Real aW)
+void GEOMAlgo_ShapeInfo::SetWidth(const Standard_Real aW)
 {
   myWidth=aW;
 }
@@ -337,7 +357,7 @@ static
 //function : Width
 //purpose  :
 //=======================================================================
-  Standard_Real GEOMAlgo_ShapeInfo::Width() const
+Standard_Real GEOMAlgo_ShapeInfo::Width() const
 {
   return myWidth;
 }
@@ -345,7 +365,7 @@ static
 //function : SetHeight
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetHeight(const Standard_Real aH)
+void GEOMAlgo_ShapeInfo::SetHeight(const Standard_Real aH)
 {
   myHeight=aH;
 }
@@ -353,7 +373,7 @@ static
 //function : Height
 //purpose  :
 //=======================================================================
-  Standard_Real GEOMAlgo_ShapeInfo::Height() const
+Standard_Real GEOMAlgo_ShapeInfo::Height() const
 {
   return myHeight;
 }
@@ -372,7 +392,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : Dump
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::Dump()const
+void GEOMAlgo_ShapeInfo::Dump()const
 {
   switch (myType) {
     //
@@ -417,7 +437,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpCompound
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpCompound()const
+void GEOMAlgo_ShapeInfo::DumpCompound()const
 {
   Standard_Integer aNbV, aNbE, aNbF, aNbS, aNbC, aNbP;
   GEOMAlgo_KindOfShape aKS;
@@ -452,7 +472,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpCompSolid
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpCompSolid()const
+void GEOMAlgo_ShapeInfo::DumpCompSolid()const
 {
   Standard_Integer aNbV, aNbE, aNbF, aNbS;
   GEOMAlgo_KindOfShape aKS;
@@ -479,12 +499,11 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
   DumpKindOfBounds(aKB);
   DumpKindOfClosed(aKC);
 }
-
 //=======================================================================
 //function : DumpSolid
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpSolid()const
+void GEOMAlgo_ShapeInfo::DumpSolid()const
 {
   Standard_Integer aNbV, aNbE, aNbF;
   GEOMAlgo_KindOfShape aKS;
@@ -545,18 +564,18 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
     printf("  Height    : %.3lf\n", myHeight);
   }
 }
-
 //=======================================================================
 //function : DumpFace
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpFace()const
+void GEOMAlgo_ShapeInfo::DumpFace()const
 {
   Standard_Integer aNbV, aNbE;
   GEOMAlgo_KindOfShape aKS;
   GEOMAlgo_KindOfName aKN;
   GEOMAlgo_KindOfBounds aKB;
   GEOMAlgo_KindOfClosed aKC;
+  GEOMAlgo_KindOfDef aKD;
   //
   aNbV=NbSubShapes(TopAbs_VERTEX);
   aNbE=NbSubShapes(TopAbs_EDGE);
@@ -564,6 +583,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
   aKN=KindOfName();
   aKB=KindOfBounds();
   aKC=KindOfClosed();
+  aKD=KindOfDef();
   //
   printf(" *FACE\n");
   printf("  number of vertices: %d\n", aNbV);
@@ -572,6 +592,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
   DumpKindOfName (aKN);
   DumpKindOfBounds(aKB);
   DumpKindOfClosed(aKC);
+  DumpKindOfDef(aKD);
   //
   // PLANE
   if (aKN==GEOMAlgo_KN_PLANE) {
@@ -641,7 +662,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpShell
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpShell()const
+void GEOMAlgo_ShapeInfo::DumpShell()const
 {
   Standard_Integer aNbV, aNbE, aNbF;
   GEOMAlgo_KindOfClosed aKC;
@@ -662,7 +683,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpWire
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpWire()const
+void GEOMAlgo_ShapeInfo::DumpWire()const
 {
   Standard_Integer aNbV, aNbE;
   GEOMAlgo_KindOfClosed aKC;
@@ -682,7 +703,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpEdge
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpEdge()const
+void GEOMAlgo_ShapeInfo::DumpEdge()const
 {
   Standard_Integer aNbV;
   Standard_Real aX, aY, aZ;
@@ -755,7 +776,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpVertex
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpVertex()const
+void GEOMAlgo_ShapeInfo::DumpVertex()const
 {
   printf(" *VERTEX\n");
   DumpLocation(myLocation);
@@ -764,7 +785,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpLocation
 //purpose  :
 //=======================================================================
-  void DumpLocation(const gp_Pnt& aP)
+void DumpLocation(const gp_Pnt& aP)
 {
   Standard_Real aX, aY, aZ;
   //
@@ -775,7 +796,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpDirection
 //purpose  :
 //=======================================================================
-  void DumpDirection(const gp_Dir& aD)
+void DumpDirection(const gp_Dir& aD)
 {
   Standard_Real aX, aY, aZ;
   //
@@ -881,10 +902,27 @@ void DumpKindOfName(const GEOMAlgo_KindOfName aKS)
     "KN_RECTANGLE",
     "KN_TRIANGLE",
     "KN_QUADRANGLE",
-    "KN_ARCELLIPSE"
+    "KN_ARCELLIPSE",
+    "KN_SOLID"
     };
   int i;
   //
   i=(Standard_Integer)aKS;
   printf(" KindOfName  : %s\n", pStr[i]);
 }
+//=======================================================================
+//function : DumpKindOfDef
+//purpose  :
+//=======================================================================
+void DumpKindOfDef(const GEOMAlgo_KindOfDef aKD)
+{
+  const char *pStr[]={
+    "KD_UNKNOWN",
+    "KD_SPECIFIED",
+    "KB_ARBITRARY"
+  };
+  int i;
+  //
+  i=(Standard_Integer)aKD;
+  printf(" KindOfDef: %s\n", pStr[i]);
+}
index 827370343f5ac21918334ee025f2f097fe2d5795..0556e68d47ffa559d644516d19adbb0bf235a486 100644 (file)
@@ -37,6 +37,7 @@
 #include <GEOMAlgo_KindOfName.hxx>
 #include <GEOMAlgo_KindOfBounds.hxx>
 #include <GEOMAlgo_KindOfClosed.hxx>
+#include <GEOMAlgo_KindOfDef.hxx>
 
 
 //=======================================================================
@@ -62,7 +63,8 @@ class GEOMAlgo_ShapeInfo
     TopAbs_ShapeEnum Type() const;
 
   Standard_EXPORT
-    void SetNbSubShapes(const TopAbs_ShapeEnum aType,const Standard_Integer aNb) ;
+    void SetNbSubShapes(const TopAbs_ShapeEnum aType,
+                        const Standard_Integer aNb) ;
 
   Standard_EXPORT
     Standard_Integer NbSubShapes(const TopAbs_ShapeEnum aType) const;
@@ -91,6 +93,12 @@ class GEOMAlgo_ShapeInfo
   Standard_EXPORT
     GEOMAlgo_KindOfClosed KindOfClosed() const;
 
+  Standard_EXPORT
+    void SetKindOfDef(const GEOMAlgo_KindOfDef aT) ;
+
+  Standard_EXPORT
+    GEOMAlgo_KindOfDef KindOfDef() const;
+
   Standard_EXPORT
     void SetLocation(const gp_Pnt& aP) ;
 
@@ -189,6 +197,7 @@ class GEOMAlgo_ShapeInfo
   GEOMAlgo_KindOfName myKindOfName;
   GEOMAlgo_KindOfBounds myKindOfBounds;
   GEOMAlgo_KindOfClosed myKindOfClosed;
+  GEOMAlgo_KindOfDef myKindOfDef;
   gp_Pnt myLocation;
   gp_Dir myDirection;
   gp_Ax3 myPosition;
index 84a4f4322a1944ce9f9605348ca92a4b7fec14e3..e440912b61d6156929762a308c3458e4ca7e8c26 100644 (file)
@@ -59,7 +59,7 @@
 //function :
 //purpose  :
 //=======================================================================
-  GEOMAlgo_ShapeInfoFiller::GEOMAlgo_ShapeInfoFiller()
+GEOMAlgo_ShapeInfoFiller::GEOMAlgo_ShapeInfoFiller()
 :
   GEOMAlgo_Algo()
 {
 //function : ~
 //purpose  :
 //=======================================================================
-  GEOMAlgo_ShapeInfoFiller::~GEOMAlgo_ShapeInfoFiller()
+GEOMAlgo_ShapeInfoFiller::~GEOMAlgo_ShapeInfoFiller()
 {
 }
 //=======================================================================
 //function : SetTolerance
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::SetTolerance(const Standard_Real aT)
+void GEOMAlgo_ShapeInfoFiller::SetTolerance(const Standard_Real aT)
 {
   myTolerance=aT;
 }
@@ -84,7 +84,7 @@
 //function : Tolerance
 //purpose  :
 //=======================================================================
-  Standard_Real GEOMAlgo_ShapeInfoFiller::Tolerance()const
+Standard_Real GEOMAlgo_ShapeInfoFiller::Tolerance()const
 {
   return myTolerance;
 }
@@ -92,7 +92,7 @@
 //function : SetShape
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::SetShape(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::SetShape(const TopoDS_Shape& aS)
 {
   myShape=aS;
 }
 //function : Shape
 //purpose  :
 //=======================================================================
-  const TopoDS_Shape& GEOMAlgo_ShapeInfoFiller::Shape() const
+const TopoDS_Shape& GEOMAlgo_ShapeInfoFiller::Shape() const
 {
   return myShape;
 }
 //function : Info
 //purpose  :
 //=======================================================================
-  const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info() const
+const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info() const
 {
   return Info(myShape);
 }
 //function : Info
 //purpose  :
 //=======================================================================
-  const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info(const TopoDS_Shape& aS) const
+const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info
+  (const TopoDS_Shape& aS) const
 {
   if (!aS.IsNull()) {
     if (myMapInfo.Contains(aS)) {
 //function : CheckData
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::CheckData()
+void GEOMAlgo_ShapeInfoFiller::CheckData()
 {
   myErrorStatus=0;
   //
 //function : Perform
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::Perform()
+void GEOMAlgo_ShapeInfoFiller::Perform()
 {
   myErrorStatus=0;
   //
 //function :FillShape
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillShape(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::FillShape(const TopoDS_Shape& aS)
 {
   TopAbs_ShapeEnum aType;
   //
 //function :FillSubShapes
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillSubShapes(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::FillSubShapes(const TopoDS_Shape& aS)
 {
   TopoDS_Iterator aIt;
   //
 //function : FillContainer
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillContainer(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::FillContainer(const TopoDS_Shape& aS)
 {
   myErrorStatus=0;
   //
 //function : FillSolid
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillSolid(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::FillSolid(const TopoDS_Shape& aS)
 {
-  Standard_Integer aNbShells;
   TopoDS_Solid aSd;
   //
   myErrorStatus=0;
   //
   aSd=TopoDS::Solid(aS);
   //
-  aNbShells=GEOMAlgo_ShapeInfoFiller::NbShells(aSd);
-  if (aNbShells>1) {
-    return;
-  }
-  //
   FillDetails(aSd);
 }
 //=======================================================================
 //function :FillFace
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillFace(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::FillFace(const TopoDS_Shape& aS)
 {
   myErrorStatus=0;
+  if (myMapInfo.Contains(aS)) {
+    return;
+  }
   //
   Standard_Boolean bIsAllowedType;
-  Standard_Integer aNbWires;//, iRet
   Standard_Boolean bInf, bInfU1, bInfU2, bInfV1, bInfV2;
-  Standard_Real aUMin, aUMax, aVMin, aVMax, aR1, aR2;
+  Standard_Real aUMin, aUMax, aVMin, aVMax, aR1, aR2, dV;
   gp_Pnt aP0;
   gp_Dir aDN;
   gp_Ax3 aAx3;
   GeomAbs_SurfaceType aST;
   Handle(Geom_Surface) aSurf;
   TopoDS_Face aF;
-  //GEOMAlgo_KindOfName aKindOfName;
   //----------------------------------------------------
-  if (myMapInfo.Contains(aS)) {
-    return;
-  }
-  else {
-    GEOMAlgo_ShapeInfo aInfoX;
-    myMapInfo.Add(aS, aInfoX);
-  }
+  GEOMAlgo_ShapeInfo aInfoX;
+  myMapInfo.Add(aS, aInfoX);
+  //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
   //----------------------------------------------------
   aInfo.SetType(TopAbs_FACE);
   //
   aF=TopoDS::Face(aS);
   //
-  aNbWires=GEOMAlgo_ShapeInfoFiller::NbWires(aF);
-  //
   aSurf=BRep_Tool::Surface(aF);
   GeomAdaptor_Surface aGAS(aSurf);
   aST=aGAS.GetType();
     return;
   }
   //
+  //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
   // 1. Plane
   if (aST==GeomAbs_Plane) {
     gp_Pln aPln;
     aP0=aPln.Location();
     aAx3=aPln.Position();
     //
-    aInfo.SetKindOfShape(GEOMAlgo_KS_PLANE);
+    aInfo.SetKindOfShape(GEOMAlgo_KS_PLANE); 
+    aInfo.SetKindOfName(GEOMAlgo_KN_PLANE);
     aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED);
     aInfo.SetLocation(aP0);
     aInfo.SetPosition(aAx3);
     //
-    if (aNbWires>1) {
-      return;
-    }
-    //
-    //aSurf->Bounds(aUMin, aUMax, aVMin, aVMax);
     BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
     bInfU1=Precision::IsNegativeInfinite(aUMin);
     bInfU2=Precision::IsPositiveInfinite(aUMax);
     bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
     if (bInf) {
       aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
+      return;
     }
-    else {
-      aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
-    }
+    //
+    aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
     //
     FillDetails(aF, aPln);
   }// if (aCT==GeomAbs_Line) {
   //
+  //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
   // 2. Sphere
   else if (aST==GeomAbs_Sphere) {
     gp_Sphere aSphere;
     aR1=aSphere.Radius();
     //
     aInfo.SetKindOfShape(GEOMAlgo_KS_SPHERE);
+    aInfo.SetKindOfName(GEOMAlgo_KN_SPHERE);
     aInfo.SetLocation(aP0);
     aInfo.SetPosition(aAx3);
     aInfo.SetRadius1(aR1);
     //
-    if (aNbWires>1) {
-      return;
-    }
-    //
     aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
     aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED);
     //
     FillDetails(aF, aSphere);
   }// else if (aST==GeomAbs_Sphere) {
   //
+  //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
   // 3. Cylinder
   else if (aST==GeomAbs_Cylinder) {
     gp_Cylinder aCyl;
     aR1=aCyl.Radius();
     //
     aInfo.SetKindOfShape(GEOMAlgo_KS_CYLINDER);
+    aInfo.SetKindOfName(GEOMAlgo_KN_CYLINDER);
     aInfo.SetLocation(aP0);
     aInfo.SetPosition(aAx3);
     aInfo.SetRadius1(aR1);
     //
-    if (aNbWires>1) {
-      return;
-    }
-    //
     BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
     bInfU1=Precision::IsNegativeInfinite(aUMin);
     bInfU2=Precision::IsPositiveInfinite(aUMax);
     bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
     if (bInf) {
       aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
+      return;
     }
-    else {
-      aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
-    }
+    //
+    aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
+    //
+    dV=aVMax-aVMin;
+    aInfo.SetHeight(dV);
+    //
     FillDetails(aF, aCyl);
   }
   //
+  //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
   // 4. Cone
   else if (aST==GeomAbs_Cone) {
+    Standard_Real aSemiAngle;
     gp_Cone aCone;
     //
     aCone=aGAS.Cone();
     aP0=aCone.Location();
     aAx3=aCone.Position();
-    //aR1=aCyl.Radius();
     //
     aInfo.SetKindOfShape(GEOMAlgo_KS_CONE);
+    aInfo.SetKindOfName(GEOMAlgo_KN_CONE);
     aInfo.SetLocation(aP0);
     aInfo.SetPosition(aAx3);
-    //aInfo.SetRadius1(aR1);
-    //
-    if (aNbWires>1) {
-      return;
-    }
     //
     BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
     bInfU1=Precision::IsNegativeInfinite(aUMin);
     bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
     if (bInf) {
       aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
+      return;
     }
-    else {
-      aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
-    }
+    //
+    aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
+    //
+    aSemiAngle=fabs(aCone.SemiAngle());
+    dV=(aVMax-aVMin)*cos(aSemiAngle);
+    
+    aInfo.SetHeight(dV);
+    //
     FillDetails(aF, aCone);
   }
   //
+  //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
   // 5. Torus
   else if (aST==GeomAbs_Torus) {
     gp_Torus aTorus;
     aR2=aTorus.MinorRadius();
     //
     aInfo.SetKindOfShape(GEOMAlgo_KS_TORUS);
+    aInfo.SetKindOfName(GEOMAlgo_KN_TORUS);
     aInfo.SetLocation(aP0);
     aInfo.SetPosition(aAx3);
     aInfo.SetRadius1(aR1);
     aInfo.SetRadius2(aR2);
     //
-    if (aNbWires>1) {
-      return;
-    }
-    //
     aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
     //
     FillDetails(aF, aTorus);
@@ -535,7 +523,6 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
     FillSubShapes(aS);
     return;
   }
-  //modified by NIZNHY-PKV Tue Jul 03 10:19:03 2012f
   // BSplineCurve
   if (aCT==GeomAbs_BSplineCurve) {
     Standard_Integer aNbKnots, aNbPoles, aDegree;
@@ -577,7 +564,6 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
       aInfo.SetDirection(aDir);
     }
   }
-  //modified by NIZNHY-PKV Tue Jul 03 10:19:06 2012t
   // Line
   else if (aCT==GeomAbs_Line) {
     Standard_Boolean bInf1, bInf2;
@@ -712,7 +698,7 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
 //function :FillVertex
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillVertex(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::FillVertex(const TopoDS_Shape& aS)
 {
   myErrorStatus=0;
   //
@@ -739,8 +725,8 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
 //function : FillNbSubshapes
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillNbSubShapes(const TopoDS_Shape& aS,
-                                                 GEOMAlgo_ShapeInfo& aInfo)
+void GEOMAlgo_ShapeInfoFiller::FillNbSubShapes(const TopoDS_Shape& aS,
+                                               GEOMAlgo_ShapeInfo& aInfo)
 {
   myErrorStatus=0;
   //
@@ -776,7 +762,8 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
 //function :NbShells
 //purpose  :
 //=======================================================================
-Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells(const TopoDS_Solid& aSd)
+Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells
+  (const TopoDS_Solid& aSd)
 {
   Standard_Integer iCnt;
   TopoDS_Iterator aIt;
@@ -785,7 +772,6 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells(const TopoDS_Solid& aSd)
   //
   aIt.Initialize(aSd);
   for (; aIt.More(); aIt.Next()) {
-    //const TopoDS_Shape& aSh=aIt.Value();
     ++iCnt;
   }
   return iCnt;
@@ -794,7 +780,8 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells(const TopoDS_Solid& aSd)
 //function : NbWires
 //purpose  :
 //=======================================================================
-Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires(const TopoDS_Face& aF)
+Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires
+  (const TopoDS_Face& aF)
 {
   Standard_Integer iCnt;
   TopoDS_Iterator aIt;
@@ -803,7 +790,6 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires(const TopoDS_Face& aF)
   //
   aIt.Initialize(aF);
   for (; aIt.More(); aIt.Next()) {
-    //const TopoDS_Shape& aW=aIt.Value();
     ++iCnt;
   }
   return iCnt;
@@ -812,7 +798,8 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires(const TopoDS_Face& aF)
 //function : IsAllowedType
 //purpose  :
 //=======================================================================
-Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_CurveType aCT)
+Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType
+  (const GeomAbs_CurveType aCT)
 {
   Standard_Boolean bRet;
   Standard_Integer i, aNb;
@@ -820,7 +807,7 @@ Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_CurveType
     GeomAbs_Line,
     GeomAbs_Circle,
     GeomAbs_Ellipse,
-    GeomAbs_BSplineCurve //modified by NIZNHY-PKV Tue Jul 03 10:18:01 2012ft
+    GeomAbs_BSplineCurve 
   };
   //
   bRet=Standard_False;
@@ -834,7 +821,8 @@ Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_CurveType
 //function : IsAllowedType
 //purpose  :
 //=======================================================================
-Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_SurfaceType aST)
+Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType
+  (const GeomAbs_SurfaceType aST)
 {
   Standard_Boolean bRet;
   Standard_Integer i, aNb;
old mode 100644 (file)
new mode 100755 (executable)
index 77fb5e0..7c4a9b2
@@ -68,10 +68,12 @@ static
 void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
 {
   Standard_Boolean bIsStepSphere;
-  Standard_Integer i, aNbF, aNbCyl, aNbCon, aNbPgn, aNbRct, aNbCrc, aNbX;
+  Standard_Integer i, aNbF, aNbCyl, aNbCon, aNbPgn, aNbRct;
+  Standard_Integer aNbShells, aNbCrc, aNbX;
   TopoDS_Shape aFCyl, aFCon;
   TopTools_IndexedMapOfShape aMF;
   GEOMAlgo_KindOfName aKNF;
+  GEOMAlgo_KindOfDef aKD;
   //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aSd);
   aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
@@ -83,7 +85,37 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
     return;
   }
   //
+  //modified by NIZNHY-PKV Tue Jun 09 08:35:23 2015f
+  if (aNbF==2) {
+    // case requested by the customer
+    // specific solid that should be treated as a sphere
+    bIsStepSphere=TreatStepSphere(aSd);
+    if (bIsStepSphere) {
+      return;
+    }
+  }
+  //modified by NIZNHY-PKV Tue Jun 09 08:35:28 2015t
+  //
+  aKD=GEOMAlgo_KD_SPECIFIED;
+  for (i=1; i<=aNbF && aKD==GEOMAlgo_KD_SPECIFIED; ++i) {
+    const TopoDS_Shape& aF=aMF(i);
+    GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aF);
+    aKD=aInfoF.KindOfDef();
+  }
+  if (aKD!=GEOMAlgo_KD_SPECIFIED) {
+    aInfo.SetKindOfName(GEOMAlgo_KN_SOLID); 
+    return;
+  }
+  //
+  aNbShells=GEOMAlgo_ShapeInfoFiller::NbShells(aSd);
+  if (aNbShells>1) {
+    aInfo.SetKindOfName(GEOMAlgo_KN_SOLID); 
+    return;
+  }
+  //
+  //
   if (aNbF==1) {
+    // mb: sphere, torus
     const TopoDS_Shape& aF=aMF(1);
     GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aF);
     aKNF=aInfoF.KindOfName(); // mb: sphere, torus
@@ -99,7 +131,8 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
       return;
     }
   }
-  //modified by NIZNHY-PKV Tue Jul 03 13:23:55 2012f
+  //modified by NIZNHY-PKV Tue Jun 09 08:36:08 2015f
+  /*
   else if (aNbF==2) {
     // specific solid that should be treated as a sphere
     bIsStepSphere=TreatStepSphere(aSd);
@@ -107,7 +140,8 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
       return;
     }
   }
-  //modified by NIZNHY-PKV Tue Jul 03 13:23:57 2012t
+  */
+  //modified by NIZNHY-PKV Tue Jun 09 08:36:12 2015t
   //
   aNbCyl=0;
   aNbCon=0;
@@ -229,11 +263,9 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
       const gp_Dir& aDNj=aIFj.Position().Direction();
       //
       aDot=aDNi*aDNj;
-      //modified by NIZNHY-PKV Tue Jul 03 10:01:56 2012f
       if (aDot<0.) {
         aDot=-aDot;
       }
-      //modified by NIZNHY-PKV Tue Jul 03 10:01:52 2012t
       if (fabs(1.-aDot)<0.0001) {
         aMp.Add(i);
         aMp.Add(j);
@@ -248,6 +280,8 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
     return;
   }
   //
+  iMin=-1;
+  iMax=-1;
   aDistMin=1.e15;
   aDistMax=-aDistMin;
   for (i=0; i<aNbFi; ++i) {
@@ -308,21 +342,10 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
   TopTools_IndexedMapOfShape aMV;
   BRepTools_WireExplorer aWExp;
   GEOMAlgo_KindOfName aKN, aKNE;
-  GEOMAlgo_KindOfShape aKS;
   //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
-  aKN=GEOMAlgo_KN_UNKNOWN;
-  aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
   //
-  aKS=aInfo.KindOfShape();
-  if (aKS!=GEOMAlgo_KS_PLANE) {
-    return;
-  }
-  //
-  if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
-    aInfo.SetKindOfName(GEOMAlgo_KN_PLANE);
-    return;
-  }
+  aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
   //
   aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
   aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
@@ -330,9 +353,8 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
   // 1. may be it is circle/ellipse
   if (aNbV==1 && aNbE==1) {
     aExp.Init(aF, TopAbs_EDGE);
-    for (; aExp.More(); aExp.Next()) {
+    if (aExp.More()) {
       aE=aExp.Current();
-      break;
     }
     //
     const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
@@ -343,6 +365,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
       aInfo.SetRadius1(aInfoE.Radius1());
       aInfo.SetLocation(aInfoE.Location());
       aInfo.SetPosition(aInfoE.Position());
+      aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
     }
     if (aKNE==GEOMAlgo_KN_ELLIPSE) {
       aKN=GEOMAlgo_KN_DISKELLIPSE;
@@ -351,22 +374,29 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
       aInfo.SetRadius2(aInfoE.Radius2());
       aInfo.SetLocation(aInfoE.Location());
       aInfo.SetPosition(aInfoE.Position());
+      aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
     }
-  }
+    return;
+  }// if (aNbV==1 && aNbE==1) {
   //
-  // 2. may be it is rectangle
-  else  {
-    aExp.Init(aF, TopAbs_EDGE);
-    for (; aExp.More(); aExp.Next()) {
-      aE=aExp.Current();
-      const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
-      aKNE=aInfoE.KindOfName();
-      if (aKNE!=GEOMAlgo_KN_SEGMENT) {
-        return;
-      }
+  //
+  Standard_Boolean bSegment;
+  //
+  bSegment=Standard_True;
+  aExp.Init(aF, TopAbs_EDGE);
+  for (; aExp.More() && bSegment; aExp.Next()) {
+    aE=aExp.Current();
+    const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+    aKNE=aInfoE.KindOfName();
+    if (aKNE!=GEOMAlgo_KN_SEGMENT) {
+      bSegment=!bSegment;
     }
-    //
-    aInfo.SetKindOfName(GEOMAlgo_KN_POLYGON);
+  }
+  //
+  if (bSegment) {
+  // 2. may be it is TRIANGLE, POLYGON, QUADRANGLE, RECTANGLE
+    aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
+    aInfo.SetKindOfName(GEOMAlgo_KN_POLYGON); 
     //
     if (aNbV==3 && aNbE==3) {
       aInfo.SetKindOfName(GEOMAlgo_KN_TRIANGLE);
@@ -393,359 +423,327 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
       //
       aInfo.SetLocation(aPc);
       aInfo.SetPosition(aAx3);
-      //
-      return;
-    }
-    //
-    if (!(aNbV==4 && aNbE==4)) {
-      return;
-    }
+    } // if (aNbV==3 && aNbE==3) {
     //
-    // aNbV==4 && aNbE==4 and all edges are segments
-    aIt.Initialize(aF);
-    for (; aIt.More(); aIt.Next()){
-      aW=TopoDS::Wire(aIt.Value());
-      break;
-    }
-    //
-    aWExp.Init(aW, aF);
-    for (i=0; aWExp.More(); aWExp.Next(), ++i) {
-      aEx=aWExp.Current();
-      const GEOMAlgo_ShapeInfo& aInfoEx=myMapInfo.FindFromKey(aEx);
-      aDx[i]=aInfoEx.Direction();
-      aPx[i]=aInfoEx.Location();
-    }
-    //
-    Standard_Boolean isRectangle = Standard_True;
-    for (i=0; i<4; ++i) {
-      j=(i==3) ? 0 : i+1;
-      aDot=aDx[i]*aDx[j];
-      if (fabs (aDot) > myTolerance) {
-        isRectangle = Standard_False;
-        break;
+    if (aNbV==4 && aNbE==4) {
+      aIt.Initialize(aF);
+      if (aIt.More()) {
+        aW=*((TopoDS_Wire*)&aIt.Value());
       }
-    }
-    //
-    // rectangle
-    // shift location to the center
-    aXYZc.SetCoord(0.,0.,0.);
-    TopExp::MapShapes(aF, TopAbs_VERTEX, aMV);
-    for (i=1; i<=aNbV; ++i) {
-      const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i));
-      aP=BRep_Tool::Pnt(aV);
-      const gp_XYZ& aXYZ=aP.XYZ();
-      aXYZc=aXYZc+aXYZ;
-    }
-    //
-    // Location : aPc in center of rectangle
-    // Position : 0z is plane normal
-    //            0x is along the first edge (quadrangle) or
-    //            along length (rectangle)
-    //
-    aXYZc.Divide(4.);
-    aPc.SetXYZ(aXYZc);
-    aDX=aDx[0];
-    aInfo.SetLocation(aPc);
-
-    if (isRectangle) {
-      // Calculate sizes
-      gp_Lin aL0(aPx[0], aDx[0]);
-      gp_Lin aL1(aPx[1], aDx[1]);
       //
-      aD0=aL0.Distance(aPc);
-      aD1=aL1.Distance(aPc);
+      aWExp.Init(aW, aF);
+      for (i=0; aWExp.More(); aWExp.Next(), ++i) {
+        aEx=aWExp.Current();
+        const GEOMAlgo_ShapeInfo& aInfoEx=myMapInfo.FindFromKey(aEx);
+        aDx[i]=aInfoEx.Direction();
+        aPx[i]=aInfoEx.Location();
+      }
       //
-      aLength=aD1;
-      aWidth =aD0;
-
-      if (aD0>aD1) {
-        aLength=aD0;
-        aWidth =aD1;
-        aDX=aDx[1];
+      Standard_Boolean isRectangle = Standard_True;
+      for (i=0; i<4; ++i) {
+        j=(i==3) ? 0 : i+1;
+        aDot=aDx[i]*aDx[j];
+        if (fabs (aDot) > myTolerance) {
+          isRectangle = Standard_False;
+          break;
+        }
+      }
+      //
+      // rectangle
+      // shift location to the center
+      aXYZc.SetCoord(0.,0.,0.);
+      TopExp::MapShapes(aF, TopAbs_VERTEX, aMV);
+      for (i=1; i<=aNbV; ++i) {
+        const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i));
+        aP=BRep_Tool::Pnt(aV);
+        const gp_XYZ& aXYZ=aP.XYZ();
+        aXYZc=aXYZc+aXYZ;
       }
       //
-      aLength=2.*aLength;
-      aWidth =2.*aWidth;
+      // Location : aPc in center of rectangle
+      // Position : 0z is plane normal
+      //            0x is along the first edge (quadrangle) or
+      //            along length (rectangle)
       //
-      aInfo.SetLength(aLength);
-      aInfo.SetWidth(aWidth);
-      aInfo.SetKindOfName(GEOMAlgo_KN_RECTANGLE);
-    } else {
-      aInfo.SetKindOfName(GEOMAlgo_KN_QUADRANGLE);
-    }
-    //
-    const gp_Dir& aDZ=aPln.Axis().Direction();
-    gp_Ax2 aAx2(aPc, aDZ, aDX);
-    gp_Ax3 aAx3(aAx2);
-    aInfo.SetPosition(aAx3);
-  }
+      aXYZc.Divide(4.);
+      aPc.SetXYZ(aXYZc);
+      aDX=aDx[0];
+      aInfo.SetLocation(aPc);
 
-  return;
+      if (isRectangle) {
+      // Calculate sizes
+        gp_Lin aL0(aPx[0], aDx[0]);
+        gp_Lin aL1(aPx[1], aDx[1]);
+        //
+        aD0=aL0.Distance(aPc);
+        aD1=aL1.Distance(aPc);
+        //
+        aLength=aD1;
+        aWidth =aD0;
+        
+        if (aD0>aD1) {
+          aLength=aD0;
+          aWidth =aD1;
+          aDX=aDx[1];
+        }
+        //
+        aLength=2.*aLength;
+        aWidth =2.*aWidth;
+        //
+        aInfo.SetLength(aLength);
+        aInfo.SetWidth(aWidth);
+        aInfo.SetKindOfName(GEOMAlgo_KN_RECTANGLE);
+      } else {
+        aInfo.SetKindOfName(GEOMAlgo_KN_QUADRANGLE);
+      }
+      //
+      const gp_Dir& aDZ=aPln.Axis().Direction();
+      gp_Ax2 aAx2(aPc, aDZ, aDX);
+      gp_Ax3 aAx3(aAx2);
+      aInfo.SetPosition(aAx3);
+      //
+    }// if (aNbV==4 && aNbE==4) {
+    return;
+  }// if (bSegment) {
+  //
+  //aInfo.SetKindOfName(GEOMAlgo_KN_PLANE);
 }
 //=======================================================================
 //function : FillDetails
 //purpose  :
 //=======================================================================
 void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
-                                           const gp_Sphere& )
+                                           const gp_Sphere& )//aSph)
 {
+  
   Standard_Integer aNbV, aNbE, aNbSE, aNbDE;
   TopoDS_Edge aE;
   TopExp_Explorer aExp;
   TopTools_MapOfShape aM;
-  GEOMAlgo_KindOfShape aKS, aKSE;
+  GEOMAlgo_KindOfShape aKSE;//, aKSE;
   //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
-  aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
-  //
-  aKS=aInfo.KindOfShape();
-  if (aKS!=GEOMAlgo_KS_SPHERE) {
-    return;
-  }
-  //
+  // 
+  aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
   aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
   aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
-  if (!(aNbV==2 && aNbE==3)) {
-    return;
-  }
-  //
-  aNbSE=0;
-  aNbDE=0;
-  aExp.Init(aF, TopAbs_EDGE);
-  for (; aExp.More(); aExp.Next()) {
-    aE=TopoDS::Edge(aExp.Current());
-    if(aM.Add(aE)) {
-      const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
-      aKSE=aInfoE.KindOfShape();
-      //
-      if (BRep_Tool::IsClosed(aE, aF)) {
-        ++aNbSE;
-      }
-      else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
-        ++aNbDE;
+  if (aNbV==2 && aNbE==3) {
+    aNbSE=0;
+    aNbDE=0;
+    aExp.Init(aF, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      aE=TopoDS::Edge(aExp.Current());
+      if(aM.Add(aE)) {
+        const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+        aKSE=aInfoE.KindOfShape();
+        //
+        if (BRep_Tool::IsClosed(aE, aF)) {
+          ++aNbSE;
+        }
+        else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
+          ++aNbDE;
+        }
       }
     }
+    //
+    if (aNbSE==1 && aNbDE==2) {
+      aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
+    }
   }
-  //
-  if (!(aNbSE==1 && aNbDE==2)) {
-    return;
-  }
-  aInfo.SetKindOfName(GEOMAlgo_KN_SPHERE);
 }
 //=======================================================================
 //function : FillDetails
 //purpose  :
 //=======================================================================
 void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
-                                           const gp_Cone& )//aCone)
+                                           const gp_Cylinder& aCyl)
+     
 {
-  Standard_Integer aNbV, aNbE, aNbCE, aNbSE, aNbDE, i;
-  Standard_Real aR[3], aHeight;
-  gp_Pnt aPC[3], aPD, aPc, aPX[3];
-  TopoDS_Vertex aVD;
+  Standard_Integer i, aNbV, aNbE, aNbCE, aNbSE;
+  Standard_Real aT0, aT1, aHeight;
+  gp_Pnt aPC[3], aPc;
   TopoDS_Edge aE;
-  TopoDS_Iterator aIt;
   TopExp_Explorer aExp;
   TopTools_MapOfShape aM;
-  GEOMAlgo_KindOfShape aKS, aKSE;
-  GEOMAlgo_KindOfName aKN, aKNE;
+  GEOMAlgo_KindOfName aKNE;
   GEOMAlgo_KindOfClosed aKCE;
   //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
-  aKN=GEOMAlgo_KN_UNKNOWN;
-  aInfo.SetKindOfName(aKN);
-  //
-  aKS=aInfo.KindOfShape();
-  if (aKS!=GEOMAlgo_KS_CONE) {
-    return;
-  }
-  //
-  if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
-    return;
-  }
   //
+  aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
   aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
   aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
-  if (!(aNbV==2 && aNbE==3)) {
-    return;
-  }
-  //
-  i=0;
-  aNbCE=0;
-  aNbSE=0;
-  aNbDE=0;
-  aExp.Init(aF, TopAbs_EDGE);
-  for (; aExp.More(); aExp.Next()) {
-    aE=TopoDS::Edge(aExp.Current());
-    if(aM.Add(aE)) {
-      const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
-      aKNE=aInfoE.KindOfName();
-      aKCE=aInfoE.KindOfClosed();
-      aKSE=aInfoE.KindOfShape();
-      if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
-        aPC[i]=aInfoE.Location();
-        aR[i]=aInfoE.Radius1();
-        //
-        aIt.Initialize(aE);
-        for (; aIt.More(); aIt.Next()) {
-          aVD=TopoDS::Vertex(aIt.Value());
-          break;
+  if (aNbV==2 && aNbE==3) {
+    const gp_Ax1& aAx1=aCyl.Axis();
+    const gp_Dir& aDir=aAx1.Direction();
+    const gp_Pnt& aPLoc=aAx1.Location();
+    //
+    i=0;
+    aNbCE=0;
+    aNbSE=0;
+    aExp.Init(aF, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      aE=TopoDS::Edge(aExp.Current());
+      if(aM.Add(aE)) {
+        const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+        aKNE=aInfoE.KindOfName();
+        aKCE=aInfoE.KindOfClosed();
+        if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
+          aPC[aNbCE]=aInfoE.Location();
+          ++aNbCE;
         }
-        aPX[i]=BRep_Tool::Pnt(aVD);
-        //
-        ++i;
-        ++aNbCE;
-      }
-      else if (aKNE==GEOMAlgo_KN_SEGMENT) {
-        if (BRep_Tool::IsClosed(aE, aF)) {
-          ++aNbSE;
+        else if (aKNE==GEOMAlgo_KN_SEGMENT) {
+          if (BRep_Tool::IsClosed(aE, aF)) {
+            ++aNbSE;
+          }
         }
       }
-      else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
-        aIt.Initialize(aE);
-        for (; aIt.More(); aIt.Next()) {
-          aVD=TopoDS::Vertex(aIt.Value());
-          break;
-        }
-        //
-        aPD=BRep_Tool::Pnt(aVD);
-        //
-        ++aNbDE;
-      }
     }
-  }
-  //
-  if (!((aNbCE==2 || (aNbCE==1 && aNbDE==1)) && aNbSE==1)) {
-    return;
-  }
-  //
-  if (aNbDE==1) {
-    aPC[1]=aPD;
-    aR[1]=0.;
-  }
-  //
-  aHeight=aPC[0].Distance(aPC[1]);
-  //
-  Standard_Real aRmin, aRmax;
-  gp_Ax2 aAx2new;
-  //
-  if (aR[0]>aR[1]) {
-    aRmin=aR[1];
-    aRmax=aR[0];
-    aPc=aPC[0];
-    gp_Vec aVz(aPC[0], aPC[1]);
-    gp_Vec aVx(aPC[0], aPX[0]);
-    gp_Dir aDz(aVz);
-    gp_Dir aDx(aVx);
-    gp_Ax2 aAx2(aPc, aDz, aDx);
-    aAx2new=aAx2;
-  }
-  else {
-    aRmin=aR[0];
-    aRmax=aR[1];
-    aPc=aPC[1];
-    gp_Vec aVz(aPC[1], aPC[0]);
-    gp_Vec aVx(aPC[1], aPX[1]);
-    gp_Dir aDz(aVz);
-    gp_Dir aDx(aVx);
-    gp_Ax2 aAx2(aPc, aDz, aDx);
-    aAx2new=aAx2;
-  }
-  //
-  gp_Ax3 aAx3(aAx2new);
-  aInfo.SetLocation(aPc);
-  aInfo.SetPosition(aAx3);
-  aInfo.SetRadius1(aRmax);
-  aInfo.SetRadius2(aRmin);
-  aInfo.SetHeight(aHeight);
-  //
-  aInfo.SetKindOfName(GEOMAlgo_KN_CONE);
+    //
+    if (aNbCE==2 && aNbSE==1) {
+      gp_Lin aLin(aPLoc, aDir);
+      //
+      aT0=ElCLib::Parameter(aLin, aPC[0]);
+      aT1=ElCLib::Parameter(aLin, aPC[1]);
+      //
+      aPc=aPC[0];
+      if (aT0>aT1) {
+        aPc=aPC[1];
+      }
+      aHeight=aPC[0].Distance(aPC[1]);
+      //
+      gp_Ax3 aAx3=aCyl.Position();
+      aAx3.SetLocation(aPc);
+      //
+      aInfo.SetPosition(aAx3);
+      aInfo.SetLocation(aPc);
+      aInfo.SetHeight(aHeight);
+      //
+      aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
+      return; // conventional cylinder
+    }//if (aNbCE==2 && aNbSE==1) {
+  }//if (aNbV==2 && aNbE==3) {
 }
 //=======================================================================
 //function : FillDetails
 //purpose  :
 //=======================================================================
 void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
-                                           const gp_Cylinder& aCyl)
+                                           const gp_Cone& aCone)
 {
-  Standard_Integer i, aNbV, aNbE, aNbCE, aNbSE;
-  Standard_Real aT0, aT1, aHeight;
-  gp_Pnt aPC[3], aPc;
+  Standard_Integer aNbV, aNbE, aNbCE, aNbSE, aNbDE, i;
+  Standard_Real aR[3], aHeight, aRmin, aRmax;
+  gp_Pnt aPC[3], aPD, aPc, aPX[3];
+  TopoDS_Vertex aVD;
   TopoDS_Edge aE;
+  TopoDS_Iterator aIt;
   TopExp_Explorer aExp;
   TopTools_MapOfShape aM;
-  GEOMAlgo_KindOfShape aKS;
-  GEOMAlgo_KindOfName aKN, aKNE;
+  GEOMAlgo_KindOfShape aKSE;
+  GEOMAlgo_KindOfName aKNE;
   GEOMAlgo_KindOfClosed aKCE;
   //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
-  aKN=GEOMAlgo_KN_UNKNOWN;
-  aInfo.SetKindOfName(aKN);
-  //
-  aKS=aInfo.KindOfShape();
-  if (aKS!=GEOMAlgo_KS_CYLINDER) {
-    return;
-  }
   //
-  if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
-    return;
-  }
+  aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
   //
   aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
   aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
-  if (!(aNbV==2 && aNbE==3)) {
-    return;
-  }
-  //
-  i=0;
-  aNbCE=0;
-  aNbSE=0;
-  aExp.Init(aF, TopAbs_EDGE);
-  for (; aExp.More(); aExp.Next()) {
-    aE=TopoDS::Edge(aExp.Current());
-    if(aM.Add(aE)) {
-      const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
-      aKNE=aInfoE.KindOfName();
-      aKCE=aInfoE.KindOfClosed();
-      if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
-        aPC[aNbCE]=aInfoE.Location();
-        ++aNbCE;
-      }
-      else if (aKNE==GEOMAlgo_KN_SEGMENT) {
-        if (BRep_Tool::IsClosed(aE, aF)) {
-          ++aNbSE;
+  if (aNbV==2 && aNbE==3) {
+    i=0;
+    aNbCE=0;
+    aNbSE=0;
+    aNbDE=0;
+    aExp.Init(aF, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      aE=TopoDS::Edge(aExp.Current());
+      if(aM.Add(aE)) {
+        const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+        aKNE=aInfoE.KindOfName();
+        aKCE=aInfoE.KindOfClosed();
+        aKSE=aInfoE.KindOfShape();
+        if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
+          aPC[i]=aInfoE.Location();
+          aR[i]=aInfoE.Radius1();
+          //
+          aIt.Initialize(aE);
+          if (aIt.More()) {
+            aVD=*((TopoDS_Vertex*)&aIt.Value());
+          }
+          aPX[i]=BRep_Tool::Pnt(aVD);
+          //
+          ++i;
+          ++aNbCE;
+        }
+        else if (aKNE==GEOMAlgo_KN_SEGMENT) {
+          if (BRep_Tool::IsClosed(aE, aF)) {
+            ++aNbSE;
+          }
+        }
+        else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
+          aIt.Initialize(aE);
+          if (aIt.More()) {
+            aVD=*((TopoDS_Vertex*)&aIt.Value());
+          }
+          //
+          aPD=BRep_Tool::Pnt(aVD);
+          //
+          ++aNbDE;
         }
       }
     }
-  }
-  //
-  if (!(aNbCE==2 && aNbSE==1)) {
-    return;
-  }
-  //
-  const gp_Ax1& aAx1=aCyl.Axis();
-  const gp_Dir& aDir=aAx1.Direction();
-  const gp_Pnt& aPLoc=aAx1.Location();
-  gp_Lin aLin(aPLoc, aDir);
-  //
-  aT0=ElCLib::Parameter(aLin, aPC[0]);
-  aT1=ElCLib::Parameter(aLin, aPC[1]);
-  //
-  aPc=aPC[0];;
-  if (aT0>aT1) {
-    aPc=aPC[1];
-  }
-  aHeight=aPC[0].Distance(aPC[1]);
+    //
+    if ((aNbCE==2 || (aNbCE==1 && aNbDE==1)) && aNbSE==1) {
+      if (aNbDE==1) {
+        aPC[1]=aPD;
+        aR[1]=0.;
+      }
+      //
+      aHeight=aPC[0].Distance(aPC[1]);
+      //
+      
+      gp_Ax2 aAx2new;
+      //
+      if (aR[0]>aR[1]) {
+        aRmin=aR[1];
+        aRmax=aR[0];
+        aPc=aPC[0];
+        gp_Vec aVz(aPC[0], aPC[1]);
+        gp_Vec aVx(aPC[0], aPX[0]);
+        gp_Dir aDz(aVz);
+        gp_Dir aDx(aVx);
+        gp_Ax2 aAx2(aPc, aDz, aDx);
+        aAx2new=aAx2;
+      }
+      else {
+        aRmin=aR[0];
+        aRmax=aR[1];
+        aPc=aPC[1];
+        gp_Vec aVz(aPC[1], aPC[0]);
+        gp_Vec aVx(aPC[1], aPX[1]);
+        gp_Dir aDz(aVz);
+        gp_Dir aDx(aVx);
+        gp_Ax2 aAx2(aPc, aDz, aDx);
+        aAx2new=aAx2;
+      }
+      //
+      gp_Ax3 aAx3(aAx2new);
+      aInfo.SetLocation(aPc);
+      aInfo.SetPosition(aAx3);
+      aInfo.SetRadius1(aRmax);
+      aInfo.SetRadius2(aRmin);
+      aInfo.SetHeight(aHeight);
+      //
+      aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
+      return;
+    }//if ((aNbCE==2 || (aNbCE==1 && aNbDE==1)) && aNbSE==1) {
+  }//if (aNbV==2 && aNbE==3) {
   //
-  gp_Ax3 aAx3=aCyl.Position();
-  aAx3.SetLocation(aPc);
+  aInfo.SetRadius1 (aCone.RefRadius());
   //
-  aInfo.SetKindOfName(GEOMAlgo_KN_CYLINDER);
-  aInfo.SetPosition(aAx3);
-  aInfo.SetLocation(aPc);
-  aInfo.SetHeight(aHeight);
+  aRmin=0.;   // ZZ
+  aInfo.SetRadius2(aRmin);
 }
-
 //=======================================================================
 //function : FillDetails
 //purpose  :
@@ -753,6 +751,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
 void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
                                            const gp_Torus& )
 {
+  
   Standard_Integer aNbV, aNbE, aNbSE;
   TopoDS_Edge aE;
   TopExp_Explorer aExp;
@@ -760,46 +759,43 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
   GEOMAlgo_KindOfShape aKS;
   //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
-  aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
+  aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
   //
   aKS=aInfo.KindOfShape();
   if (aKS!=GEOMAlgo_KS_TORUS) {
     return;
   }
-  //
+  
   aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
-  aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
-  if (!(aNbV==1 && aNbE==2)) {
-    return;
-  }
-  //
-  aNbSE=0;
-  aExp.Init(aF, TopAbs_EDGE);
-  for (; aExp.More(); aExp.Next()) {
-    aE=TopoDS::Edge(aExp.Current());
-    if (aM.Add(aE)) {
-      if (BRep_Tool::IsClosed(aE, aF)) {
-        ++aNbSE;
+  aNbE=aInfo.NbSubShapes(TopAbs_EDGE); 
+  
+  if (aNbV==1 && aNbE==2) {
+    aNbSE=0;
+    aExp.Init(aF, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      aE=TopoDS::Edge(aExp.Current());
+      if (aM.Add(aE)) {
+        if (BRep_Tool::IsClosed(aE, aF)) {
+          ++aNbSE;
+        }
       }
     }
+    //
+    if (aNbSE==2) {
+      aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
+    }
   }
-  //
-  if (aNbSE!=2) {
-    return;
-  }
-  aInfo.SetKindOfName(GEOMAlgo_KN_TORUS);
 }
-//modified by NIZNHY-PKV Tue Jul 03 13:29:41 2012f
 //=======================================================================
 //function : TreatStepSphere
 //purpose  :
 //=======================================================================
-Standard_Boolean
-  GEOMAlgo_ShapeInfoFiller::TreatStepSphere(const TopoDS_Solid& aSd)
+Standard_Boolean  GEOMAlgo_ShapeInfoFiller::TreatStepSphere
+  (const TopoDS_Solid& aSd)
 {
   Standard_Boolean bRet, bIsAllowedType, bOnlyClosed, bIsEqual;
   Standard_Integer j;
-  Standard_Real aTolAng, aTolLin;
+  Standard_Real aTolAng, aTol;
   Standard_Real aVolume, aVolumeS, dV, aArea, aAreaS, dA;
   gp_Sphere aSphere[2];
   GeomAbs_SurfaceType aST;
@@ -808,7 +804,7 @@ Standard_Boolean
   TopExp_Explorer aExp;
   //
   bRet=Standard_False;
-  aTolLin=Precision::Confusion();
+  aTol=Precision::Confusion();
   aTolAng=Precision::Angular();
   //
   aExp.Init(aSd, TopAbs_FACE);
@@ -829,7 +825,7 @@ Standard_Boolean
     aSphere[j]=aGAS.Sphere();
   }
   //
-  bIsEqual=IsEqual(aSphere[0], aSphere[1], aTolLin);
+  bIsEqual=IsEqual(aSphere[0], aSphere[1], aTol);
   if (!bIsEqual) {
     return bRet;
   }
@@ -841,24 +837,30 @@ Standard_Boolean
   //
   aVolume=aSphere[0].Volume();
   //
-  BRepGProp::VolumeProperties(aSd, aGProps,  bOnlyClosed);
+  //modified by NIZNHY-PKV Tue Jun 09 08:39:47 2015f
+  BRepGProp::VolumeProperties(aSd, aGProps, aTol,  bOnlyClosed);
+  //BRepGProp::VolumeProperties(aSd, aGProps,  bOnlyClosed);
+  //modified by NIZNHY-PKV Tue Jun 09 08:39:50 2015t
   aVolumeS=aGProps.Mass();
   if (aVolumeS<0.) {
     aVolumeS=-aVolumeS;
   }
   //
   dV=fabs(aVolumeS-aVolume);
-  if (dV>aTolLin) {
+  if (dV>aTol) {
     return bRet;
   }
   //--------------------------------
   aArea=aSphere[0].Area();
   //
-  BRepGProp::SurfaceProperties(aSd, aGProps);
+  //modified by NIZNHY-PKV Tue Jun 09 08:23:54 2015f
+  BRepGProp::SurfaceProperties(aSd, aGProps, aTol);
+  //BRepGProp::SurfaceProperties(aSd, aGProps);
+  //modified by NIZNHY-PKV Tue Jun 09 08:23:56 2015t
   aAreaS=aGProps.Mass();
   //
   dA=fabs(aAreaS-aArea);
-  if (dA>aTolLin) {
+  if (dA>aTol) {
     return bRet;
   }
   //
@@ -906,4 +908,3 @@ Standard_Boolean IsEqual(const gp_Sphere& aSp1,
   //
   return bRet;
 }
-//modified by NIZNHY-PKV Tue Jul 03 13:29:43 2012t
index 3749b7cd718613f872926fa55a5358516eba28c4..964ea96cd98646b71abb1059fac11d921f51d63e 100644 (file)
@@ -245,7 +245,7 @@ void GEOMAlgo_ShellSolid::Perform()
     const BOPDS_IndexRange& aRange=pDS->Range(iRank);
     aRange.Indices(iBeg, iEnd);
     const TopoDS_Solid& aSolid=(!iRank) ? *((TopoDS_Solid*)&aTool) : *((TopoDS_Solid*)&aObj);
-    BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid);
+    //BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid);
     //
     //------------------------------ShellSolidBuilder
     GEOMAlgo_ShellSolidBuilder aSSB;
@@ -264,50 +264,50 @@ void GEOMAlgo_ShellSolid::Perform()
       const TopoDS_Shape& aS=pDS->Shape(i);
       aType=aS.ShapeType();
       if (aType!=TopAbs_FACE) {
-       continue;
+        continue;
       }
       //
       aState=TopAbs_UNKNOWN;
       aF=*((TopoDS_Face*)&aS);
       //
       if (!aImages.IsBound(aS)) {
-       iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
-       if (iErr) {
-         myErrorStatus=16;
-         return;
-       }
-       //
-       aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
+        iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
+        if (iErr) {
+          myErrorStatus=16;
+          return;
+        }
+        //
+        aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
       }
       else {
-       const BOPCol_ListOfShape& aLSp=aImages.Find(aS);
-       aNbSp=aLSp.Extent();
-       if (aNbSp>0) {
-         continue;
-       }
-       //
-       if (aNbSp==1) {
-         aF=*((TopoDS_Face*)&aLSp.First());
-       }
-       //
-       iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
-       if (iErr) {
-         myErrorStatus=16;
-         return;
-       }
-       //
-       aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
+        const BOPCol_ListOfShape& aLSp=aImages.Find(aS);
+        aNbSp=aLSp.Extent();
+        if (aNbSp>0) {
+          continue;
+        }
+        //
+        if (aNbSp==1) {
+          aF=*((TopoDS_Face*)&aLSp.First());
+        }
+        //
+        iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
+        if (iErr) {
+          myErrorStatus=16;
+          return;
+        }
+        //
+        aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
       }
       //----------
       if (aState==TopAbs_ON) {
-       myLSON.Append(aF);
+        myLSON.Append(aF);
       }
       else if (aState==TopAbs_OUT) {
-       myLSOUT.Append(aF);
+        myLSOUT.Append(aF);
       }
       else if (aState==TopAbs_IN) {
-       myLSIN.Append(aF);
-      }        
+        myLSIN.Append(aF);
+      } 
       //----------
     }//for (i=iBeg; i<=iEnd; ++i) {
     
old mode 100755 (executable)
new mode 100644 (file)
index 4bbcf5c..f48c5e1
@@ -301,7 +301,7 @@ void TreatCompound(const TopoDS_Shape& aC1,
   TopoDS_Iterator aItC;
   //
   aLC.Append (aC1);
-  while(1) {
+  for(;;) {
     aLC1.Clear();
     aIt.Initialize(aLC);
     for (; aIt.More(); aIt.Next()) {
index 59cfe94ad137f63e7b508a65c8176d00f1d00757..4a02ac4bef4ba6627213b463e7eadc322923edcf 100644 (file)
 //function : GetState
 //purpose  :
 //=======================================================================
- Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP,
-                                                  const GeomAdaptor_Surface& aGAS,
-                                                  const Standard_Real aTol,
-                                                  TopAbs_State& aState)
+ Standard_Integer GEOMAlgo_SurfaceTools::GetState
+  (const gp_Pnt& aP,
+   const GeomAdaptor_Surface& aGAS,
+   const Standard_Real aTol,
+   TopAbs_State& aState)
 {
   Standard_Integer    iErr  = 0;
   GeomAbs_SurfaceType aType = aGAS.GetType();
 //function : GetState
 //purpose  :
 //=======================================================================
- Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP,
-                                                  const Handle(Geom_Surface)& aSurf,
-                                                  const Standard_Real aTol,
-                                                  TopAbs_State& aState)
+ Standard_Integer GEOMAlgo_SurfaceTools::GetState
+  (const gp_Pnt& aP,
+   const Handle(Geom_Surface)& aSurf,
+   const Standard_Real aTol,
+   TopAbs_State& aState)
 {
   Standard_Integer iErr;
   GeomAdaptor_Surface aGAS;
 //function : ReverseState
 //purpose  :
 //=======================================================================
- TopAbs_State GEOMAlgo_SurfaceTools::ReverseState(const TopAbs_State aState)
+ TopAbs_State GEOMAlgo_SurfaceTools::ReverseState
+  (const TopAbs_State aState)
 {
   TopAbs_State aRSt=aState;
   //
 //function : IsCoaxial
 //purpose  :
 //=======================================================================
-Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
-                                                  const gp_Pnt& aP2,
-                                                  const gp_Cylinder& aCyl,
-                                                  const Standard_Real aTol)
+Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial
+  (const gp_Pnt& aP1,
+   const gp_Pnt& aP2,
+   const gp_Cylinder& aCyl,
+   const Standard_Real aTol)
 {
   const gp_XYZ &aLoc   = aCyl.Location().XYZ();
   const gp_Ax1 &aAxis  = aCyl.Axis();
@@ -147,7 +151,7 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
   gp_XYZ        aDP2   = aP2.XYZ().Subtracted(aLoc);
   Standard_Real aDot1  = aDP1.Dot(aDAxis);
   Standard_Real aDot2  = aDP1.Dot(aDAxis);
-  Standard_Real aTol2  = aTol*aTol;
+  //Standard_Real aTol2  = aTol*aTol;
 
   // Project P1 and P2 onto a plane with location aLoc and Norm aDAxis.
   aDP1.Subtract(aDAxis.Multiplied(aDot1));
@@ -160,7 +164,7 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
   if (fabs(aRadius1 - aRadius2) <= aTol) {
     // Check the deflection of the middle point.
     gp_XYZ        aMidP       = 0.5*(aDP1 + aDP2);
-    Standard_Real aMidRadius1 = aMidP.Modulus();
+    //Standard_Real aMidRadius1 = aMidP.Modulus();
 
     if (fabs(aRadius1 - aRadius2) <= aTol) {
       isOn = Standard_True;
@@ -173,7 +177,8 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
 //function : IsAnalytic
 //purpose  :
 //=======================================================================
-Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic(const Handle(Geom_Surface)& aSurf)
+Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic
+  (const Handle(Geom_Surface)& aSurf)
 {
   Standard_Boolean bRet;
   GeomAbs_SurfaceType aType;
@@ -190,8 +195,9 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic(const Handle(Geom_Surface)& a
 //function : IsConformState
 //purpose  :
 //=======================================================================
-Standard_Boolean GEOMAlgo_SurfaceTools::IsConformState(const TopAbs_State aST1,
-                                                       const GEOMAlgo_State aST2)
+Standard_Boolean GEOMAlgo_SurfaceTools::IsConformState
+  (const TopAbs_State aST1,
+   const GEOMAlgo_State aST2)
 {
   Standard_Boolean bRet=Standard_False;
   //
index f3cc03f2680687e6f43bce97e4d87b7998674515..a6b58e6a51931c3ab74915ce635a0b4b92186961 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(${QT_USE_FILE})
-
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -80,7 +77,7 @@ SET(_moc_HEADERS
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(GEOMBase_SOURCES
   GEOMBase.cxx
index e10909ddca19a73d142a7305a86791d3eeadbd55..0cfe8f6aed6d58ba05089445c9f6225452d4e0a2 100644 (file)
@@ -859,7 +859,7 @@ QString GEOMBase::GetEntry( GEOM::GEOM_Object_ptr object )
 // Function : PublishSubObject
 // Purpose  : Publish sub-shape under the main object
 //================================================================
-void GEOMBase::PublishSubObject( GEOM::GEOM_Object_ptr object )
+void GEOMBase::PublishSubObject( GEOM::GEOM_Object_ptr object, const QString& name )
 {
   SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
   if ( study && !CORBA::is_nil( object ) ) {
@@ -868,9 +868,9 @@ void GEOMBase::PublishSubObject( GEOM::GEOM_Object_ptr object )
     GEOM::GEOM_Object_var father = object->GetMainShape();
     QString fatherEntry = GetEntry( father );
     if ( entry.isEmpty() && !CORBA::is_nil( father ) && !fatherEntry.isEmpty() ) {
-      QString name = GetName( object );
+      QString aName = !name.isEmpty() ? name : GetName( object );
       GeometryGUI::GetGeomGen()->AddInStudy( GeometryGUI::ClientStudyToStudy( studyDS ),
-                                             object, name.toLatin1().data(), father.in() );
+                                             object, aName.toLatin1().data(), father.in() );
     }
   }
 }
index 242e5fdcdfb664331744e3bd6c867436173d16f5..69e21e778a533a3639928a0cd24c86cfcc7255d3 100644 (file)
@@ -133,7 +133,7 @@ public :
   static QString      GetEntry( GEOM::GEOM_Object_ptr object );
 
   /* Publish sub-shape under the main object */
-  static void         PublishSubObject( GEOM::GEOM_Object_ptr object );
+  static void         PublishSubObject( GEOM::GEOM_Object_ptr object, const QString& name = QString() );
 
   static void         Synchronize( QList<GEOM::GeomObjPtr>& left, QList<GEOM::GeomObjPtr>& right );
 };
index 1e795376c1d81c110281701254f967b8be914357..4693656172db363162607113f95ff084a37392a2 100755 (executable)
@@ -528,6 +528,28 @@ void GEOMBase_Helper::localSelection( GEOM::GEOM_Object_ptr obj, const int mode
   localSelection( obj, modes );
 }
 
+//================================================================
+// Function : localSelection
+// Purpose  : Activate selection of sub-shapes in accordance with mode
+//            modes are from TopAbs_ShapeEnum
+//================================================================
+void GEOMBase_Helper::localSelection( const std::list<int> modes )
+{
+  localSelection( GEOM::GEOM_Object::_nil(), modes );
+}
+
+//================================================================
+// Function : localSelection
+// Purpose  : Activate selection of sub-shapes in accordance with mode
+//            mode is from TopAbs_ShapeEnum
+//================================================================
+void GEOMBase_Helper::localSelection( const int mode )
+{
+  std::list<int> modes;
+  modes.push_back( mode );
+  localSelection( modes );
+}
+
 //================================================================
 // Function : globalSelection
 // Purpose  : Activate selection of sub-shapes. Set selection filters
index fac2d89ba11d989da44bdd644dc9f2f51f5f0e4c..44f424def63df72ff4fb0dd39a3b20dfbaaf20be 100755 (executable)
@@ -100,6 +100,8 @@ protected:
   void localSelection( const ObjectList&, const int );
   void localSelection( GEOM::GEOM_Object_ptr, const std::list<int> );
   void localSelection( GEOM::GEOM_Object_ptr, const int );
+  void localSelection( const std::list<int> );
+  void localSelection( const int );
   void activate( const int );
   void globalSelection( const int = GEOM_ALLOBJECTS, const bool = false  );
   void globalSelection( const TColStd_MapOfInteger&, const bool = false );
index d999542d4eba5eed00358da24ec3ebdd106b2e52..89669a29b97185dcc6602d89b605cc4af792b168 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(${QT_USE_FILE})
-
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
   ${PTHREAD_INCLUDE_DIR}
   ${CAS_INCLUDE_DIRS}
index 211156716d5258f3f50994f9c608b09834c22584..d6e2f5d6f5770404642655ecd1eb11479b85be19 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -76,12 +74,14 @@ SET(GEOMGUI_HEADERS
   GEOMGUI_Selection.h
   GEOM_GEOMGUI.hxx
   GEOMGUI_CreationInfoWdg.h
+  GEOMGUI_TextTreeWdg.h
   GEOMGUI_DimensionProperty.h
   )
 
 # header files / to be processed by moc
 SET(_moc_HEADERS 
   GEOMGUI_CreationInfoWdg.h
+  GEOMGUI_TextTreeWdg.h
   GeometryGUI.h
   )
 
@@ -101,10 +101,10 @@ SET(_ts_RESOURCES
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 # sources / rcc wrappings
-QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+QT_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
 
 SET(GEOMGUI_SOURCES
   GeometryGUI.cxx
@@ -114,6 +114,7 @@ SET(GEOMGUI_SOURCES
   GEOMGUI_OCCSelector.cxx
   GEOMGUI_Selection.cxx
   GEOMGUI_CreationInfoWdg.cxx
+  GEOMGUI_TextTreeWdg.cxx
   GEOMGUI_DimensionProperty.cxx
   ${_moc_SOURCES}
   ${_rcc_SOURCES}
@@ -126,4 +127,4 @@ TARGET_LINK_LIBRARIES(GEOM ${_link_LIBRARIES})
 INSTALL(TARGETS GEOM EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 INSTALL(FILES ${GEOMGUI_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
index f743932508e5a96c1d9735520764b7d7e4041771..05dabb9fe66b30786516fa9c18a908dd33d993e4 100644 (file)
@@ -54,7 +54,7 @@ GEOMGUI::~GEOMGUI()
 //=================================================================================
 bool GEOMGUI::OnGUIEvent( int /*theCommandID*/, SUIT_Desktop* /*parent*/, const QVariant& /*theParam*/  )
 {
-  return TRUE;
+  return true;
 }
 
 //=================================================================================
@@ -63,7 +63,7 @@ bool GEOMGUI::OnGUIEvent( int /*theCommandID*/, SUIT_Desktop* /*parent*/, const
 //=================================================================================
 bool GEOMGUI::OnGUIEvent( int /*theCommandID*/, SUIT_Desktop* /*parent*/ )
 {
-  return TRUE;
+  return true;
 }
 
 //=================================================================================
@@ -73,7 +73,7 @@ bool GEOMGUI::OnGUIEvent( int /*theCommandID*/, SUIT_Desktop* /*parent*/ )
 //=================================================================================
 bool GEOMGUI::OnMousePress( QMouseEvent* /*pe*/, SUIT_Desktop* /*parent*/, SUIT_ViewWindow* /*studyFrame*/ )
 {
-  return FALSE;
+  return false;
 }
 
 //=================================================================================
@@ -82,7 +82,7 @@ bool GEOMGUI::OnMousePress( QMouseEvent* /*pe*/, SUIT_Desktop* /*parent*/, SUIT_
 //=================================================================================
 bool GEOMGUI::OnMouseMove( QMouseEvent* /*pe*/, SUIT_Desktop* /*parent*/, SUIT_ViewWindow* /*studyFrame*/ )
 {
-  return TRUE;
+  return true;
 }
 
 //=================================================================================
@@ -91,7 +91,7 @@ bool GEOMGUI::OnMouseMove( QMouseEvent* /*pe*/, SUIT_Desktop* /*parent*/, SUIT_V
 //=================================================================================
 bool GEOMGUI::OnMouseRelease( QMouseEvent* /*pe*/, SUIT_Desktop* /*parent*/, SUIT_ViewWindow* /*studyFrame*/ )
 {
-  return TRUE;
+  return true;
 }
 
 //=================================================================================
@@ -100,7 +100,7 @@ bool GEOMGUI::OnMouseRelease( QMouseEvent* /*pe*/, SUIT_Desktop* /*parent*/, SUI
 //=================================================================================
 bool GEOMGUI::OnKeyPress( QKeyEvent* /*pe*/, SUIT_Desktop* /*parent*/, SUIT_ViewWindow* /*studyFrame*/ )
 {
-  return TRUE;
+  return true;
 }
 
 //=================================================================================
index 5c3681e28df6f1fa778bac57d987225ebce38c1c..5ab93cee006841115a3ecba847ef9649d8d10c75 100644 (file)
@@ -47,7 +47,11 @@ GEOMGUI_CreationInfoWdg::GEOMGUI_CreationInfoWdg( SalomeApp_Application* app )
   myParamsTreeWd->setColumnCount( 2 );
   myParamsTreeWd->setHeaderLabels( QStringList() << tr( "PARAMETER" ) << tr( "VALUE" ) );
   myParamsTreeWd->header()->setStretchLastSection( true );
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
   myParamsTreeWd->header()->setResizeMode( 0, QHeaderView::ResizeToContents );
+#else
+  myParamsTreeWd->header()->setSectionResizeMode( 0, QHeaderView::ResizeToContents );
+#endif
 
   QVBoxLayout* aLayout = new QVBoxLayout( this );
   aLayout->addWidget( myParamsTreeWd );
@@ -124,7 +128,10 @@ void GEOMGUI_CreationInfoWdg::setInfo( GEOM::CreationInformationSeq& info )
           }
           // get icon
           QString prefix = plugin_name.isEmpty() ? "GEOM" : plugin_name;
-          icon = resMgr->loadPixmap( prefix, tr( ("ICO_"+name).toLatin1().constData() ), false );
+          if ( name.startsWith( "Import"))
+            icon = resMgr->loadPixmap( "GEOM", tr("ICO_IMPORT_SHAPE"), true );
+          else
+            icon = resMgr->loadPixmap( prefix, tr( ("ICO_"+name).toLatin1().constData() ), false );
 
           // translate operation name
           operationName = tr( ("MEN_"+name).toLatin1().constData() );
diff --git a/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx b/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx
new file mode 100644 (file)
index 0000000..47ab21c
--- /dev/null
@@ -0,0 +1,424 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File      : GEOMGUI_TextTreeWdg.cxx
+// Author    : Alexander KOVALEV (akl)
+
+#include "GEOMGUI_TextTreeWdg.h"
+
+#include "GEOMGUI_DimensionProperty.h"
+#include "GeometryGUI.h"
+#include "GeometryGUI_Operations.h"
+#include <GEOM_Constants.h>
+#include <GEOMUtils.hxx>
+
+// GUI includes
+#include <LightApp_Module.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_DataBrowser.h>
+
+// Qt includes
+#include <QAction>
+#include <QMenu>
+#include <QString>
+#include <QLabel>
+#include <QLineEdit>
+#include <QTreeWidget>
+#include <QHeaderView>
+#include <QGroupBox>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QHash>
+
+GEOMGUI_TextTreeWdg::GEOMGUI_TextTreeWdg( SalomeApp_Application* app )
+  : myDisplayer(NULL)
+{
+  myStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+  myDisplayer = GEOM_Displayer( myStudy );
+
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  myVisibleIcon = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) );
+  myInvisibleIcon = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_INVISIBLE" ) ) );
+
+  setWindowTitle( tr( "TEXT_TREE_VIEW_TITLE" ) );
+  setObjectName( "geomTextTreeWdg" );
+
+  setRootIsDecorated( true );
+  setSelectionMode( QAbstractItemView::ExtendedSelection );
+  setAllColumnsShowFocus( true );
+  setUniformRowHeights( true );
+
+  QStringList columnNames;
+  columnNames << tr("TEXT_TREE_VIEW_NAME") << "";
+  QTreeWidgetItem * headerItem = new QTreeWidgetItem( columnNames );
+  headerItem->setIcon( 1, myVisibleIcon );
+  setHeaderItem ( headerItem ); 
+  header()->moveSection( 1, 0 );
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+  header()->setResizeMode( 1, QHeaderView::ResizeToContents );
+#else
+  header()->setSectionResizeMode( 1, QHeaderView::ResizeToContents );
+#endif
+  QStringList rootNames;
+  rootNames << tr("GEOM_DIMENSIONS") << "";
+  myDimensionsItem = new QTreeWidgetItem( this, rootNames );
+  myDimensionsItem->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled );
+  addTopLevelItem( myDimensionsItem );
+
+  // get a free dockable window id
+  myWindowID = 11;
+  while( app->dockWindow( myWindowID ))
+    ++myWindowID;
+  ++myWindowID;
+
+  createActions();
+  setContextMenuPolicy( Qt::CustomContextMenu );
+  connect( this, SIGNAL( customContextMenuRequested(const QPoint&) ),
+          this, SLOT( showContextMenu(const QPoint&) ) );
+
+  connect( myStudy, SIGNAL( objVisibilityChanged( QString, Qtx::VisibilityState ) ), 
+          this, SLOT( updateVisibilityColumn( QString, Qtx::VisibilityState ) ) );
+  connect( app->objectBrowser(), SIGNAL( updated() ), this, SLOT( updateTree() ) );
+  GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
+  connect( aGeomGUI, SIGNAL( DimensionsUpdated( const QString& ) ), this, SLOT( updateBranch( const QString& ) ) );
+  connect( this, SIGNAL( itemClicked( QTreeWidgetItem*, int) ), 
+          this, SLOT( onItemClicked( QTreeWidgetItem*, int ) ) );
+
+}
+
+GEOMGUI_TextTreeWdg::~GEOMGUI_TextTreeWdg()
+{
+  //std::cout<<"~GEOMGUI_TextTreeWdg"<<std::endl;
+}
+
+//=================================================================================
+// function : createActions
+// purpose  : Create context popup menu actions.
+//=================================================================================
+void GEOMGUI_TextTreeWdg::createActions()
+{
+  QAction* a = new QAction( tr( "MEN_DISPLAY" ), this );
+  a->setIcon( myVisibleIcon );
+  myActions.insert( GEOMOp::OpShow, a );
+  
+  QAction* b = new QAction( tr( "MEN_ERASE" ), this );
+  b->setIcon( myInvisibleIcon );
+  myActions.insert( GEOMOp::OpHide, b );
+}
+
+//=================================================================================
+// function : updateTree
+// purpose  :
+//=================================================================================
+void GEOMGUI_TextTreeWdg::updateTree()
+{
+  myStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+  _PTR(Study) aDSStudy = myStudy->studyDS();
+  if ( aDSStudy ) {
+    _PTR(SComponent) SC ( aDSStudy->FindComponent( "GEOM" ) );
+    if ( SC ) {
+      _PTR(ChildIterator) anIter ( aDSStudy->NewChildIterator( SC ) );
+      anIter->InitEx( true );
+      QList<QString> objEntries = myObjects.keys();
+      while( anIter->More() ) {
+       _PTR(SObject) valSO ( anIter->Value() );
+       _PTR(SObject) refSO;
+       if ( !valSO->ReferencedObject( refSO ) ) {
+         // update tree of object's dimensions
+         QString anEntry = valSO->GetID().c_str();
+         updateBranch( anEntry );
+         objEntries.removeAll( anEntry );
+       }
+       anIter->Next();
+      }
+      foreach (QString entry, objEntries) {
+       removeBranch( entry, true );
+      }
+    }
+  }
+}
+  
+//=================================================================================
+// function : updateBranch
+// purpose  :
+//=================================================================================
+void GEOMGUI_TextTreeWdg::updateBranch( const QString& theEntry )
+{
+  myStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+  if ( myStudy ) {
+    _PTR(Study) aStudyDS = myStudy->studyDS();
+    if ( aStudyDS ) {
+      _PTR(SObject) obj( aStudyDS->FindObjectID( theEntry.toStdString() ) );
+      QString aName = obj->GetName().c_str();
+  
+      GEOMGUI_DimensionProperty aProp;
+      aProp.LoadFromAttribute( myStudy, theEntry.toStdString() );
+      int nbProps = aProp.GetNumber();
+
+      QTreeWidgetItem* objectItem = itemFromEntry( theEntry );
+      if ( objectItem ) {
+       removeBranch( theEntry, nbProps > 0 ? false : true );
+      }
+      QStringList itemName;
+      if ( nbProps > 0 ) {
+       itemName << aName << "";
+       if ( !objectItem ) {
+         objectItem = new QTreeWidgetItem( myDimensionsItem, itemName );
+         objectItem->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled );
+         objectItem->setData( 1, Qt::UserRole, theEntry );
+         myDimensionsItem->addChild( objectItem );
+         myObjects.insert( theEntry, objectItem );
+         if ( myDimensionsItem->childCount() == 1 )
+           myDimensionsItem->setExpanded( true );
+       }
+       bool isDisplayed = myDisplayer.IsDisplayed( theEntry );
+       // read dimension records from property
+       for ( int anIt = 0; anIt < aProp.GetNumber(); ++anIt )
+         {
+           QString aName  = aProp.GetName( anIt );
+           bool isVisible = aProp.IsVisible( anIt );
+
+           QTreeWidgetItem* anItem = new QTreeWidgetItem;
+           anItem->setText( 0, aName );
+           //  if ( isDisplayed )
+           anItem->setIcon( 1, isVisible ? myVisibleIcon : myInvisibleIcon );
+           anItem->setData( 0, Qt::UserRole, anIt );
+           anItem->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled );
+           objectItem->addChild( anItem ); 
+         }
+      }
+    }
+  }
+}
+
+//=================================================================================
+// function : removeBranch
+// purpose  :
+//=================================================================================
+void GEOMGUI_TextTreeWdg::removeBranch( const QString& theEntry, bool force )
+{
+  QTreeWidgetItem* objectItem = itemFromEntry( theEntry );
+  if ( !objectItem )
+    return;
+  qDeleteAll( objectItem->takeChildren() );
+  if ( force ) {
+    myDimensionsItem->removeChild( objectItem );
+    myObjects.remove( theEntry );
+  }
+}
+
+//=================================================================================
+// function : onItemClicked()
+// purpose  : called when tree item was clicked
+//=================================================================================
+void GEOMGUI_TextTreeWdg::onItemClicked( QTreeWidgetItem* theItem, int theColumn )
+{
+  if( theColumn != 1 || theItem->icon( 1 ).isNull() || theItem->isDisabled() )
+    return;
+  
+  std::string anEntry = entryFromItem( theItem->parent() ).toStdString();
+  int aDimIndex = idFromItem( theItem );
+  GEOMGUI_DimensionProperty aProp;
+  aProp.LoadFromAttribute( myStudy, anEntry );
+  if ( aProp.IsVisible( aDimIndex ) ) {
+    aProp.SetVisible( aDimIndex, false );
+    theItem->setIcon( 1, myInvisibleIcon );
+  } else {
+    aProp.SetVisible( aDimIndex, true );
+    theItem->setIcon( 1, myVisibleIcon );
+  }
+  aProp.SaveToAttribute( myStudy, anEntry );
+  redisplay( anEntry.c_str() );
+}
+
+//=================================================================================
+// function : idFromItem
+// purpose  :
+//=================================================================================
+int GEOMGUI_TextTreeWdg::idFromItem( QTreeWidgetItem* theItem )
+{
+  if ( !theItem )
+    return -1;
+
+  bool isIdOK = false;
+  const int anId = theItem->data( 0, Qt::UserRole ).toInt( &isIdOK );
+
+  return isIdOK ? anId : -1;
+}
+
+//=================================================================================
+// function : entryFromItem
+// purpose  :
+//=================================================================================
+QString GEOMGUI_TextTreeWdg::entryFromItem( QTreeWidgetItem* theShapeItem )
+{
+  if ( !theShapeItem )
+    return "";
+
+  return theShapeItem->data( 1, Qt::UserRole ).toString();
+}
+
+//=================================================================================
+// function : itemFromEntry
+// purpose  :
+//=================================================================================
+QTreeWidgetItem* GEOMGUI_TextTreeWdg::itemFromEntry( QString theEntry )
+{
+  if ( theEntry.isEmpty() )
+    return 0;
+
+  return myObjects.value( theEntry, 0 );
+}
+
+//=================================================================================
+// function : updateVisibilityColumn
+// purpose  : Update icons of dimension items.
+//=================================================================================
+void GEOMGUI_TextTreeWdg::updateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState )
+{
+  QTreeWidgetItem* anItem = itemFromEntry( theEntry );
+  if ( !anItem )
+    return;
+  anItem->setDisabled( theState != Qtx::ShownState );
+  QTreeWidgetItem* aChildItem;
+  GEOMGUI_DimensionProperty aProp;
+  for ( int i=0; i < anItem->childCount(); i++ ) {
+    aChildItem = anItem->child( i );
+    if ( theState == Qtx::ShownState ) {
+      aProp.LoadFromAttribute( myStudy, theEntry.toStdString() );
+      if ( aProp.GetNumber() == 0 )
+       continue;
+      aChildItem->setIcon( 1, aProp.IsVisible( idFromItem( aChildItem ) ) ? myVisibleIcon : myInvisibleIcon );
+      aChildItem->setDisabled( false );
+    } else {
+      aChildItem->setIcon( 1, QIcon() );
+      aChildItem->setDisabled( true );
+    }
+  }
+}
+
+//=================================================================================
+// function : showContextMenu
+// purpose  : 
+//=================================================================================
+void GEOMGUI_TextTreeWdg::showContextMenu( const QPoint& pos )
+{
+  if ( selectedItems().isEmpty() )
+    return;
+  QMenu aMenu;
+  aMenu.addAction( myActions[GEOMOp::OpShow] );
+  aMenu.addAction( myActions[GEOMOp::OpHide] );
+  if ( selectedItems().count() == 1 ) {
+    QTreeWidgetItem* anItem = selectedItems().first();
+    QString anEntry = entryFromItem( anItem->parent() );
+    if ( !anEntry.isEmpty() ) {
+      GEOMGUI_DimensionProperty aProp;
+      aProp.LoadFromAttribute( myStudy, anEntry.toStdString() );
+      if ( aProp.GetNumber() == 0 )
+       return;
+      aMenu.clear();
+      if ( aProp.IsVisible( idFromItem( anItem ) ) )
+       aMenu.addAction( myActions[GEOMOp::OpHide] );
+      else
+       aMenu.addAction( myActions[GEOMOp::OpShow] );
+    }
+  }
+  QAction* selPopupItem = aMenu.exec( viewport()->mapToGlobal(pos) );
+  if ( selPopupItem == myActions[GEOMOp::OpShow] )
+    setVisibility( true );
+  else if ( selPopupItem == myActions[GEOMOp::OpHide] )
+    setVisibility( false );
+}
+
+//=================================================================================
+// function : setVisibility
+// purpose  : 
+//=================================================================================
+void GEOMGUI_TextTreeWdg::setVisibility( bool theVisibility )
+{
+  if ( myDimensionsItem->isSelected() ) {
+    // set visibility for all dimensions
+    QTreeWidgetItem* anItem;
+    foreach ( QString entry, myObjects.keys() ) {
+      anItem = itemFromEntry( entry );
+      if ( !anItem->isDisabled() )
+       setShapeDimensionsVisibility( entry, theVisibility );
+    }
+    return;
+  }
+  foreach ( QTreeWidgetItem* item, selectedItems() ) {
+    if ( item->isDisabled() || item->parent()->isSelected() )
+      continue;
+    QString anEntry = entryFromItem( item );
+    if ( !anEntry.isEmpty() ) {
+      // it is a shape item
+      setShapeDimensionsVisibility( anEntry, theVisibility );
+    } else {
+      // it is a dimension item
+      anEntry = entryFromItem( item->parent() );
+      setDimensionVisibility( anEntry, item, theVisibility );
+    }
+  }
+}
+
+//=================================================================================
+// function : setShapeDimensionsVisibility
+// purpose  : 
+//=================================================================================
+void GEOMGUI_TextTreeWdg::setShapeDimensionsVisibility( QString theEntry, bool theVisibility )
+{
+  QTreeWidgetItem* anItem = itemFromEntry( theEntry );
+  QTreeWidgetItem* aChildItem;
+  for ( int i=0; i < anItem->childCount(); i++ ) {
+    aChildItem = anItem->child( i );
+    setDimensionVisibility( theEntry, aChildItem, theVisibility );
+  }
+  redisplay( theEntry );
+}
+
+//=================================================================================
+// function : setDimensionVisibility
+// purpose  : 
+//=================================================================================
+void GEOMGUI_TextTreeWdg::setDimensionVisibility( QString theEntry, QTreeWidgetItem* theDimItem, bool theVisibility )
+{
+  GEOMGUI_DimensionProperty aProp;
+  aProp.LoadFromAttribute( myStudy, theEntry.toStdString() );
+  int aDimIndex = idFromItem( theDimItem );
+  if ( aProp.GetNumber() == 0  || aProp.IsVisible( aDimIndex ) == theVisibility )
+    return;;
+  aProp.SetVisible( aDimIndex, theVisibility );
+  aProp.SaveToAttribute( myStudy, theEntry.toStdString() );
+
+  theDimItem->setIcon( 1, theVisibility ? myVisibleIcon : myInvisibleIcon );
+  redisplay( theEntry );
+}
+
+//=================================================================================
+// function : redisplay
+// purpose  : 
+//=================================================================================
+void GEOMGUI_TextTreeWdg::redisplay( QString theEntry )
+{
+  Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( theEntry.toLatin1().constData(), "GEOM", "TEMP_IO" );
+  myDisplayer.Redisplay( io );
+}
diff --git a/src/GEOMGUI/GEOMGUI_TextTreeWdg.h b/src/GEOMGUI/GEOMGUI_TextTreeWdg.h
new file mode 100644 (file)
index 0000000..689a21a
--- /dev/null
@@ -0,0 +1,89 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef GEOMGUI_TEXTTREEWDG_H
+#define GEOMGUI_TEXTTREEWDG_H
+
+#include "GEOM_GEOMGUI.hxx"
+#include "GEOM_Displayer.h"
+
+#include <QTreeWidget>
+#include <QHash>
+
+#include <SALOMEDSClient.hxx>
+
+class QLabel;
+class QLineEdit;
+class QString;
+class QTreeWidgetItem;
+class SalomeApp_Application;
+class SalomeApp_Study;
+
+/*!
+ * \brief Tree view contains Dimension and Annotation text items:
+ *  - text visibility in OCC viewer
+ *  - text object name
+ */
+class GEOMGUI_EXPORT GEOMGUI_TextTreeWdg : public QTreeWidget
+{
+  Q_OBJECT
+
+ public:
+  GEOMGUI_TextTreeWdg( SalomeApp_Application* app );
+  ~GEOMGUI_TextTreeWdg();
+
+  int getWinID() { return myWindowID; }
+
+  void                          removeBranch( const QString& theEntry, 
+                                             bool force = true );
+  int                           idFromItem( QTreeWidgetItem* theItem );
+  QString                       entryFromItem( QTreeWidgetItem* theShapeItem );
+  QTreeWidgetItem*              itemFromEntry( QString theEntry );
+  void                          setShapeDimensionsVisibility( QString theEntry, bool theVisibility );
+  void                          setDimensionVisibility( QString theEntry, QTreeWidgetItem* theDimItem, bool theVisibility );
+
+protected:
+  void                          createActions();
+  void                          redisplay( QString theEntry );
+
+ public slots:
+  void                          updateTree();
+  void                          updateBranch( const QString& theEntry );
+
+private slots:
+  void                          onItemClicked(QTreeWidgetItem*, int );
+  void                          updateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState );
+  void                          setVisibility( bool visibility );
+  void                          showContextMenu( const QPoint& pos );
+
+ private:
+
+  int                           myWindowID;
+
+  QIcon                         myVisibleIcon;
+  QIcon                         myInvisibleIcon;
+  QHash<QString, QTreeWidgetItem*> myObjects;
+  SalomeApp_Study*              myStudy;
+  QTreeWidgetItem*              myDimensionsItem;
+  GEOM_Displayer                myDisplayer;
+
+  QMap<int, QAction*>           myActions;   //!< menu actions list
+
+};
+#endif
index 205e9db757d3655cfc148e5a2548d17fdeea4068..3166ac20a98e47b4ab47eb70e11be71fb4de214c 100644 (file)
@@ -1234,11 +1234,12 @@ void GEOM_Displayer::updateDimensions( const Handle(SALOME_InteractiveObject)& t
 
   QColor  aQColor       = aResMgr->colorValue  ( "Geometry", "dimensions_color", QColor( 0, 255, 0 ) );
   int     aLineWidth    = aResMgr->integerValue( "Geometry", "dimensions_line_width", 1 );
-  double  aFontHeight   = aResMgr->doubleValue ( "Geometry", "dimensions_font_height", 10 );
+  QFont   aFont         = aResMgr->fontValue   ( "Geometry", "dimensions_font", QFont("Y14.5M-2009", 14) );
   double  anArrowLength = aResMgr->doubleValue ( "Geometry", "dimensions_arrow_length", 5 );
   bool    isUnitsShown  = aResMgr->booleanValue( "Geometry", "dimensions_show_units", false );
   QString aUnitsLength  = aResMgr->stringValue ( "Geometry", "dimensions_length_units", "m" );
   QString aUnitsAngle   = aResMgr->stringValue ( "Geometry", "dimensions_angle_units", "deg" );
+  bool    aUseText3d    = aResMgr->booleanValue( "Geometry", "dimensions_use_text3d", false );
 
   // restore dimension presentation from saved attribute or property data
   AIS_ListOfInteractive aRestoredDimensions;
@@ -1304,10 +1305,12 @@ void GEOM_Displayer::updateDimensions( const Handle(SALOME_InteractiveObject)& t
 
     aStyle->SetCommonColor( aColor );
     aStyle->MakeUnitsDisplayed( (Standard_Boolean) isUnitsShown );
-    aStyle->MakeText3d( Standard_True );
+    aStyle->MakeText3d( aUseText3d );
     aStyle->MakeTextShaded( Standard_True );
-    aStyle->SetExtensionSize( aFontHeight * 0.5 );
-    aStyle->TextAspect()->SetHeight( aFontHeight );
+    int fsize = aFont.pixelSize() != -1 ? aFont.pixelSize() : aFont.pointSize();
+    aStyle->SetExtensionSize( fsize * 0.5 );
+    aStyle->TextAspect()->SetFont( aFont.family().toLatin1().data() );
+    aStyle->TextAspect()->SetHeight( fsize );
     aStyle->ArrowAspect()->SetLength( anArrowLength );
     aStyle->LineAspect()->SetWidth( aLineWidth );
     aStyle->SetTextHorizontalPosition( aPrs->DimensionAspect()->TextHorizontalPosition() );
index 1e906fe81d893ff92ef2f265522c3b6f91d4c324..cfcccd313b526d0aa9f64ae1c859f2be4c1d67d4 100644 (file)
             <source>ICO_TRANSFER_DATA</source>
             <translation>transfer_data.png</translation>
         </message>
+        <message>
+            <source>ICO_IMPORT_SHAPE</source>
+            <translation>import.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_POINT_FACE</source>
             <translation>pointonface.png</translation>
index 72fb131e156fdd511135e59ee76e34c1522f6911..5a094f30350e99d841b479aa8bd979c7027a9e99 100644 (file)
@@ -431,6 +431,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_FAST_CHECK_INTERSECTIONS</source>
         <translation>Fast intersection</translation>
     </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS</source>
+        <translation>Shape Statistics</translation>
+    </message>
     <message>
         <source>GEOM_CIRCLE</source>
         <translation>Circle</translation>
@@ -1348,6 +1352,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_LENGTH_VALUE</source>
         <translation>By length</translation>
     </message>
+    <message>
+        <source>GEOM_TAKE_ORIENTATION_INTO_ACCOUNT</source>
+        <translation>Take edge orientation into account</translation>
+    </message>
     <message>
         <source>GEOM_PARTITION</source>
         <translation>Partition</translation>
@@ -1420,6 +1428,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_GROUP_NAME_PREFIX</source>
         <translation>Group Names Prefix</translation>
     </message>
+    <message>
+        <source>GEOM_STEP_BY_STEP</source>
+        <translation>Step-by-step generation</translation>
+    </message>
     <message>
         <source>GEOM_PLANE</source>
         <translation>Plane</translation>
@@ -2414,7 +2426,11 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>GEOM_WRN_FACES_NOT_SHELL</source>
-        <translation>Unable to create a shell. Result is a compound of faces.</translation>
+        <translation>Unable to create single shell. Result is a compound of shells.</translation>
+    </message>
+    <message>
+        <source>GEOM_WRN_FACES_NOT_FACE</source>
+        <translation>Unable to create single face. Result is a compound of faces.</translation>
     </message>
     <message>
         <source>WRN_SHAPE_UNCLOSED</source>
@@ -2556,6 +2572,10 @@ Please, select face, shell or solid and try again</translation>
         <source>MEN_FAST_CHECK_INTERSECTIONS</source>
         <translation>Fast intersection</translation>
     </message>
+    <message>
+        <source>MEN_SHAPE_STATISTICS</source>
+        <translation>Shape Statistics</translation>
+    </message>
     <message>
         <source>MEN_CHECK_FREE_BNDS</source>
         <translation>Check Free Boundaries</translation>
@@ -2838,7 +2858,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>MEN_MEASURES</source>
-        <translation>Measures</translation>
+        <translation>Inspection</translation>
     </message>
     <message>
         <source>MEN_MIN_DIST</source>
@@ -3445,8 +3465,8 @@ Please, select face, shell or solid and try again</translation>
         <translation>Line width</translation>
     </message>
     <message>
-        <source>PREF_DIMENSIONS_FONT_HEIGHT</source>
-        <translation>Font height</translation>
+        <source>PREF_DIMENSIONS_FONT</source>
+        <translation>Font</translation>
     </message>
     <message>
         <source>PREF_DIMENSIONS_ARROW_LENGTH</source>
@@ -3468,6 +3488,10 @@ Please, select face, shell or solid and try again</translation>
         <source>PREF_DIMENSIONS_SHOW_UNITS</source>
         <translation>Show units of measurement</translation>
     </message>
+    <message>
+        <source>PREF_DIMENSIONS_USE_TEXT3D</source>
+        <translation>Use 3D text</translation>
+    </message>
     <message>
         <source>PREF_HIDE_INPUT_OBJECT</source>
         <translation>Hide input objects from the viewer</translation>
@@ -3591,8 +3615,12 @@ Please, select face, shell or solid and try again</translation>
     <message>
         <source>STB_FAST_CHECK_INTERSECTIONS</source>
         <translation>Fast intersection</translation>
-    </message>
+   </message>
     <message>
+        <source>STB_SHAPE_STATISTICS</source>
+        <translation>Shape Statistics</translation>
+   </message>
+   <message>
         <source>STB_CHECK_FREE_BNDS</source>
         <translation>Check free boundaries</translation>
     </message>
@@ -4224,6 +4252,10 @@ Please, select face, shell or solid and try again</translation>
         <source>TOP_FAST_CHECK_INTERSECTIONS</source>
         <translation>Fast intersection</translation>
     </message>
+    <message>
+        <source>TOP_SHAPE_STATISTICS</source>
+        <translation>Shape Statistics</translation>
+    </message>
     <message>
         <source>TOP_CHECK_FREE_BNDS</source>
         <translation>Check free boundaries</translation>
@@ -5116,6 +5148,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_Z_I</source>
         <translation>Z%1 :</translation>
     </message>
+    <message>
+        <source>GEOM_A_I</source>
+        <translation>A%1 :</translation>
+    </message>
     <message>
         <source>GEOM_SHAPES_ON_SHAPE_TITLE</source>
         <translation>Get shapes on shape</translation>
@@ -5314,7 +5350,7 @@ shells and solids on the other hand.</translation>
     </message>
     <message>
         <source>GEOM_PLUGINS_OTHER</source>
-        <translation>Other</translation>
+        <translation>Python Plugins</translation>
     </message>
     <message>
         <source>SHOW_ONLY_SELECTED</source>
@@ -5384,6 +5420,34 @@ shells and solids on the other hand.</translation>
         <source>GEOM_HEALING_STATS_COL_2</source>
         <translation>Modification</translation>
     </message>
+    <message>
+        <source>GEOM_PLOT_DISTRIBUTION</source>
+        <translation>Plot</translation>
+    </message>
+    <message>
+        <source>GEOM_X_AXIS</source>
+        <translation>X Axis</translation>
+    </message>
+    <message>
+        <source>GEOM_Y_AXIS</source>
+        <translation>Y Axis</translation>
+    </message>
+    <message>
+        <source>GEOM_Z_AXIS</source>
+        <translation>Z Axis</translation>
+    </message>
+    <message>
+        <source>GEOM_DIM_AXES</source>
+        <translation>Dimensions along local axes</translation>
+    </message>
+    <message>
+        <source>SHOW_ALL_BTN</source>
+        <translation>Show all</translation>
+    </message>
+    <message>
+        <source>HIDE_ALL_BTN</source>
+        <translation>Hide all</translation>
+    </message>
 </context>
 <context>
     <name>GeometryGUI</name>
@@ -5433,7 +5497,7 @@ shells and solids on the other hand.</translation>
     </message>
     <message>
         <source>TOOL_MEASURES</source>
-        <translation>Measures</translation>
+        <translation>Inspection</translation>
     </message>
     <message>
         <source>TOOL_IMPORTEXPORT</source>
@@ -6451,14 +6515,6 @@ Number of sketch points too small</translation>
         <source>REMOVE_BTN</source>
         <translation>Remove</translation>
     </message>
-    <message>
-        <source>SHOW_ALL_BTN</source>
-        <translation>Show all</translation>
-    </message>
-    <message>
-        <source>HIDE_ALL_BTN</source>
-        <translation>Hide all</translation>
-    </message>
     <message>
         <source>DISTANCE_ITEM</source>
         <translation>Distance</translation>
@@ -7175,7 +7231,19 @@ Do you want to create new material?</translation>
         <translation>Main shape</translation>
     </message>
     <message>
-        <source>GEOM_INSPECT_OBJECT_SHOW</source>
+      <source>GEOM_INSPECT_TOLERANCE_FILTER</source>
+      <translation>Tolerance filter</translation>
+    </message>
+    <message>
+      <source>GEOM_INSPECT_RESET_MIN</source>
+      <translation>Min value</translation>
+    </message>
+    <message>
+      <source>GEOM_INSPECT_RESET_MAX</source>
+      <translation>Max value</translation>
+    </message>
+    <message>
+      <source>GEOM_INSPECT_OBJECT_SHOW</source>
         <translation>Show Selected</translation>
     </message>
     <message>
@@ -7218,6 +7286,17 @@ Do you want to create new material?</translation>
         <translation>(No info available)</translation>
     </message>
 </context>
+<context>
+    <name>GEOMGUI_TextTreeWdg</name>
+    <message>
+        <source>TEXT_TREE_VIEW_TITLE</source>
+        <translation>Text</translation>
+    </message>
+    <message>
+        <source>TEXT_TREE_VIEW_NAME</source>
+        <translation>Name</translation>
+    </message>
+</context>
 <context>
     <name>EntityGUI_IsolineDlg</name>
     <message>
@@ -7239,6 +7318,10 @@ Do you want to create new material?</translation>
 </context>
 <context>
     <name>MeasureGUI_CheckSelfIntersectionsDlg</name>
+    <message>
+        <source>GEOM_CHECK_INTERSECT_TYPE</source>
+        <translation>Self-intersection Detection Type</translation>
+    </message>
     <message>
         <source>GEOM_CHECK_INTE_INTERSECTIONS</source>
         <translation>Self-intersections</translation>
@@ -7303,6 +7386,14 @@ Do you want to create new material?</translation>
         <source>GEOM_CHECK_INTE_ALL</source>
         <translation>Face to Face + all above</translation>
     </message>
+    <message>
+        <source>GEOM_CHECK_INT_DEFLECT</source>
+        <translation>Deflection coefficient</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INT_DETECT_GAPS</source>
+        <translation>Detect gaps with tolerance</translation>
+    </message>
 </context>
 <context>
     <name>MeasureGUI_FastCheckIntersectionsDlg</name>
@@ -7335,6 +7426,69 @@ Do you want to create new material?</translation>
         <translation>Objects And Results</translation>
     </message>
 </context>
+<context>
+    <name>MeasureGUI_ShapeStatisticsDlg</name>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_TYPE</source>
+        <translation>Type</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_LENGTH</source>
+        <translation>Edges length</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_AREA</source>
+        <translation>Faces area</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_VOLUME</source>
+        <translation>Solids volume</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_NB_INTERVALS</source>
+        <translation>Number of intervals</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_SCALAR_RANGE</source>
+        <translation>Scalar range</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_COMPUTE</source>
+        <translation>Compute</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MIN</source>
+        <translation>Min</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MAX</source>
+        <translation>Max</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_CREATE_GROUPS</source>
+        <translation>Create Groups</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_DISTRIBUTION_NB_ENT</source>
+        <translation>Number of entities</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MIN_ERROR</source>
+        <translation>Set minimal range value or switch-off Scalar range</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MAX_ERROR</source>
+        <translation>Set maximal range value or switch-off Scalar range</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MIN_MAX_ERROR</source>
+        <translation>Minimal range value can not be more than maximal</translation>
+    </message>
+    <message>
+        <source>GEOM_MSG_GROUPS_CREATED</source>
+        <translation>%1 groups created</translation>
+    </message>
+</context>
 <context>
     <name>TransformationGUI_ExtensionDlg</name>
     <message>
@@ -7462,5 +7616,9 @@ Do you want to create new material?</translation>
         <source>GEOM_PROJ_ON_CYL_LENGTH_ANGLE</source>
         <translation>Length angle</translation>
     </message>
+    <message>
+        <source>GEOM_PROJ_ON_CYL_ROTATION_ANGLE</source>
+        <translation>Rotation angle</translation>
+    </message>
 </context>
 </TS>
index 203e4d6aae3dd10b29293fbbc64dbe7be2e9ef4e..01acd20ca6eab1a8ae9b5a00f7a97c0e5efe2a39 100644 (file)
@@ -431,6 +431,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_FAST_CHECK_INTERSECTIONS</source>
         <translation>Intersection rapide</translation>
     </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS</source>
+        <translation>Statistiques sur l&apos;objet</translation>
+    </message>
     <message>
         <source>GEOM_CIRCLE</source>
         <translation>Cercle</translation>
@@ -685,7 +689,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_TOWARDS_INSIDE</source>
-        <translation>Epaissit vers l'intérieur</translation>
+        <translation>Epaissit vers l&apos;intérieur</translation>
     </message>
     <message>
         <source>GEOM_SCALE_PRISM</source>
@@ -2414,7 +2418,11 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_WRN_FACES_NOT_SHELL</source>
-        <translation>Impossible de créer une coque. Le résultat est un assemblage de faces.</translation>
+        <translation>Impossible de créer une coque. Le résultat est un assemblage de coques.</translation>
+    </message>
+    <message>
+        <source>GEOM_WRN_FACES_NOT_FACE</source>
+        <translation>Impossible de créer une face. Le résultat est un assemblage de faces.</translation>
     </message>
     <message>
         <source>WRN_SHAPE_UNCLOSED</source>
@@ -2556,6 +2564,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>MEN_FAST_CHECK_INTERSECTIONS</source>
         <translation>Intersection rapide</translation>
     </message>
+    <message>
+        <source>MEN_SHAPE_STATISTICS</source>
+        <translation>Statistiques sur l&apos;objet</translation>
+    </message>
     <message>
         <source>MEN_CHECK_FREE_BNDS</source>
         <translation>Contrôler les contours libres</translation>
@@ -2838,7 +2850,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>MEN_MEASURES</source>
-        <translation>Mesures</translation>
+        <translation>Inspection</translation>
     </message>
     <message>
         <source>MEN_MIN_DIST</source>
@@ -3445,8 +3457,8 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <translation>Epaisseur de la ligne</translation>
     </message>
     <message>
-        <source>PREF_DIMENSIONS_FONT_HEIGHT</source>
-        <translation>Taille de police</translation>
+        <source>PREF_DIMENSIONS_FONT</source>
+        <translation>Police</translation>
     </message>
     <message>
         <source>PREF_DIMENSIONS_ARROW_LENGTH</source>
@@ -3468,6 +3480,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>PREF_DIMENSIONS_SHOW_UNITS</source>
         <translation>Afficher les unités</translation>
     </message>
+    <message>
+        <source>PREF_DIMENSIONS_USE_TEXT3D</source>
+        <translation>Utiliser du texte 3D</translation>
+    </message>
     <message>
         <source>PREF_HIDE_INPUT_OBJECT</source>
         <translation>Cacher dans la vue les objets en entrée</translation>
@@ -3592,6 +3608,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>STB_FAST_CHECK_INTERSECTIONS</source>
         <translation>Intersection rapide</translation>
     </message>
+    <message>
+        <source>STB_SHAPE_STATISTICS</source>
+        <translation>Statistique de l&apos;objet</translation>
+    </message>
     <message>
         <source>STB_CHECK_FREE_BNDS</source>
         <translation>Vérifier les contours libres</translation>
@@ -3862,7 +3882,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>STB_THICKNESS</source>
-        <translation>Crée un solide par ajout d'épaisseur</translation>
+        <translation>Crée un solide par ajout d&apos;épaisseur</translation>
     </message>
     <message>
         <source>STB_PLANE</source>
@@ -4224,6 +4244,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>TOP_FAST_CHECK_INTERSECTIONS</source>
         <translation>Intersection rapide</translation>
     </message>
+    <message>
+        <source>TOP_SHAPE_STATISTICS</source>
+        <translation>Statistique de l&apos;objet</translation>
+    </message>
     <message>
         <source>TOP_CHECK_FREE_BNDS</source>
         <translation>Valider les contours libres</translation>
@@ -5116,6 +5140,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_Z_I</source>
         <translation>Z%1 :</translation>
     </message>
+    <message>
+        <source>GEOM_A_I</source>
+        <translation>A%1 :</translation>
+    </message>
     <message>
         <source>GEOM_SHAPES_ON_SHAPE_TITLE</source>
         <translation>Trouver les éléments d&apos;un objet</translation>
@@ -5314,7 +5342,7 @@ le paramètre &apos;%1&apos; aux préférences du module Géométrie.</translati
     </message>
     <message>
         <source>GEOM_PLUGINS_OTHER</source>
-        <translation>Autre</translation>
+        <translation>Plugins Python</translation>
     </message>
     <message>
         <source>SHOW_ONLY_SELECTED</source>
@@ -5384,6 +5412,26 @@ le paramètre &apos;%1&apos; aux préférences du module Géométrie.</translati
         <source>GEOM_HEALING_STATS_COL_2</source>
         <translation>Modification</translation>
     </message>
+    <message>
+        <source>GEOM_PLOT_DISTRIBUTION</source>
+        <translation>Graphe</translation>
+    </message>
+    <message>
+        <source>GEOM_X_AXIS</source>
+        <translation>Axe X</translation>
+    </message>
+    <message>
+        <source>GEOM_Y_AXIS</source>
+        <translation>Axe Y</translation>
+    </message>
+    <message>
+        <source>GEOM_Z_AXIS</source>
+        <translation>Axe Z</translation>
+    </message>
+    <message>
+        <source>GEOM_DIM_AXES</source>
+        <translation>Dimensions sur les axes locaux</translation>
+    </message>
 </context>
 <context>
     <name>GeometryGUI</name>
@@ -5433,7 +5481,7 @@ le paramètre &apos;%1&apos; aux préférences du module Géométrie.</translati
     </message>
     <message>
         <source>TOOL_MEASURES</source>
-        <translation>Informations</translation>
+        <translation>Inspection</translation>
     </message>
     <message>
         <source>TOOL_IMPORTEXPORT</source>
@@ -7218,6 +7266,17 @@ Voulez-vous en créer un nouveau ?</translation>
         <translation>(aucune information disponible)</translation>
     </message>
 </context>
+<context>
+    <name>GEOMGUI_TextTreeWdg</name>
+    <message>
+        <source>TEXT_TREE_VIEW_TITLE</source>
+        <translation>Texte</translation>
+    </message>
+    <message>
+        <source>TEXT_TREE_VIEW_NAME</source>
+        <translation>Nom</translation>
+    </message>
+</context>
 <context>
     <name>EntityGUI_IsolineDlg</name>
     <message>
@@ -7239,6 +7298,10 @@ Voulez-vous en créer un nouveau ?</translation>
 </context>
 <context>
     <name>MeasureGUI_CheckSelfIntersectionsDlg</name>
+    <message>
+        <source>GEOM_CHECK_INTERSECT_TYPE</source>
+        <translation>Détection du type d&apos;auto-intersection</translation>
+    </message>
     <message>
         <source>GEOM_CHECK_INTE_INTERSECTIONS</source>
         <translation>Auto-intersections</translation>
@@ -7303,6 +7366,14 @@ Voulez-vous en créer un nouveau ?</translation>
         <source>GEOM_CHECK_INTE_ALL</source>
         <translation>Face à Face + tout au-delà</translation>
     </message>
+    <message>
+        <source>GEOM_CHECK_INT_DEFLECT</source>
+        <translation>Coefficient de déflexion</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INT_DETECT_GAPS</source>
+        <translation>Détection des écarts avec tolérance</translation>
+    </message>
 </context>
 <context>
     <name>MeasureGUI_FastCheckIntersectionsDlg</name>
@@ -7335,6 +7406,69 @@ Voulez-vous en créer un nouveau ?</translation>
         <translation>Objets et résultats</translation>
     </message>
 </context>
+<context>
+    <name>MeasureGUI_ShapeStatisticsDlg</name>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_TYPE</source>
+        <translation>Type</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_LENGTH</source>
+        <translation>Longueur des arêtes</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_AREA</source>
+        <translation>Aire des faces</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_VOLUME</source>
+        <translation>Volume des solides</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_NB_INTERVALS</source>
+        <translation>Nombre d&apos;intervalles</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_SCALAR_RANGE</source>
+        <translation>Echelle de dimension</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_COMPUTE</source>
+        <translation>Calculer</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MIN</source>
+        <translation>Min</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MAX</source>
+        <translation>Max</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_CREATE_GROUPS</source>
+        <translation>Créer des groupes</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_DISTRIBUTION_NB_ENT</source>
+        <translation>Nombre d&apos;entités</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MIN_ERROR</source>
+        <translation>Spécifier une valeur minimale ou ignorer l&apos;échelle de dimension</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MAX_ERROR</source>
+        <translation>Spécifier une valeur maximale ou ignorer l&apos;échelle de dimension</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MIN_MAX_ERROR</source>
+        <translation>La valeur minimal ne peut pas être plus grande que la maximale</translation>
+    </message>
+    <message>
+        <source>GEOM_MSG_GROUPS_CREATED</source>
+        <translation>%1 groupes créés</translation>
+    </message>
+</context>
 <context>
     <name>TransformationGUI_ExtensionDlg</name>
     <message>
@@ -7460,7 +7594,7 @@ Voulez-vous en créer un nouveau ?</translation>
     </message>
     <message>
         <source>GEOM_PROJ_ON_CYL_LENGTH_ANGLE</source>
-        <translation>Longueur de l'angle</translation>
+        <translation>Longueur de l&apos;angle</translation>
     </message>
 </context>
 </TS>
index fc01a2b0a21fe2901087aec1cf5f965f8a0f0da8..0a55e444fd7b2cd6d66f5f56061e08721a6aeca1 100644 (file)
       <source>GEOM_FAST_CHECK_INTERSECTIONS</source>
       <translation>クイック交点</translation>
     </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS</source>
+      <translation>形状の統計</translation>
+    </message>
     <message>
       <source>GEOM_CIRCLE</source>
       <translation>Circle</translation>
       <source>GEOM_LENGTH_VALUE</source>
       <translation>長さで</translation>
     </message>
+    <message>
+      <source>GEOM_TAKE_ORIENTATION_INTO_ACCOUNT</source>
+      <translation>エッジの方向に注意</translation>
+    </message>
     <message>
       <source>GEOM_PARTITION</source>
       <translation>Partition</translation>
       <source>GEOM_GROUP_NAME_PREFIX</source>
       <translation>グループ名Prefix</translation>
     </message>
+    <message>
+      <source>GEOM_STEP_BY_STEP</source>
+      <translation>ステップ生成</translation>
+    </message>
     <message>
       <source>GEOM_PLANE</source>
       <translation>Plane</translation>
       <source>GEOM_WRN_FACES_NOT_SHELL</source>
       <translation>シェルを作成できません。面の結合です。</translation>
     </message>
+    <message>
+      <source>GEOM_WRN_FACES_NOT_FACE</source>
+      <translation>たった1つの面を作成することはできません。結果は複合面になります。</translation>
+    </message>
     <message>
       <source>WRN_SHAPE_UNCLOSED</source>
       <translation>閉じていないオブジェクト %1 からソリッドを作成できません</translation>
       <source>MEN_FAST_CHECK_INTERSECTIONS</source>
       <translation>クイック交点</translation>
     </message>
+    <message>
+      <source>MEN_SHAPE_STATISTICS</source>
+      <translation>形状の統計</translation>
+    </message>
     <message>
       <source>MEN_CHECK_FREE_BNDS</source>
       <translation>自由境界の確認</translation>
       <translation>線幅</translation>
     </message>
     <message>
-      <source>PREF_DIMENSIONS_FONT_HEIGHT</source>
-      <translation>フォント高さ</translation>
+      <source>PREF_DIMENSIONS_FONT</source>
+      <translation>フォント</translation>
     </message>
     <message>
       <source>PREF_DIMENSIONS_ARROW_LENGTH</source>
       <source>PREF_DIMENSIONS_SHOW_UNITS</source>
       <translation>測定単位の表示</translation>
     </message>
+    <message>
+      <source>PREF_DIMENSIONS_USE_TEXT3D</source>
+      <translation>3Dテキストの使用</translation>
+    </message>
     <message>
       <source>PREF_HIDE_INPUT_OBJECT</source>
       <translation>ビューワから入力したオブジェクトの非表示</translation>
       <source>STB_FAST_CHECK_INTERSECTIONS</source>
       <translation>クイック交点</translation>
     </message>
+    <message>
+      <source>STB_SHAPE_STATISTICS</source>
+      <translation>形状の統計</translation>
+    </message>
     <message>
       <source>STB_CHECK_FREE_BNDS</source>
       <translation>自由境界をチェック</translation>
       <source>TOP_FAST_CHECK_INTERSECTIONS</source>
       <translation>クイック交点</translation>
     </message>
+    <message>
+      <source>TOP_SHAPE_STATISTICS</source>
+      <translation>形状の統計</translation>
+    </message>
     <message>
       <source>TOP_CHECK_FREE_BNDS</source>
       <translation>自由境界を確認</translation>
       <source>GEOM_Z_I</source>
       <translation>Z%1 :</translation>
     </message>
+    <message>
+      <source>GEOM_A_I</source>
+      <translation>A%1 :</translation>
+    </message>
     <message>
       <source>GEOM_SHAPES_ON_SHAPE_TITLE</source>
       <translation>オブジェクトの要素を見つける</translation>
     </message>
     <message>
       <source>CC_PNT_ITEM_X_Y</source>
-      <translation type="unfinished">X=%1, Y=%2</translation>
+      <translation>X=%1, Y=%2</translation>
     </message>
     <message>
       <source>CC_PNT_ITEM_X_Y_Z</source>
-      <translation type="unfinished">X=%1, Y=%2, Z=%3</translation>
+      <translation>X=%1, Y=%2, Z=%3</translation>
     </message>
     <message>
       <source>GEOM_FILTER</source>
       <source>GEOM_HEALING_STATS_COL_2</source>
       <translation>修正</translation>
     </message>
+    <message>
+      <source>GEOM_PLOT_DISTRIBUTION</source>
+      <translation>Plot</translation>
+    </message>
+    <message>
+      <source>GEOM_X_AXIS</source>
+      <translation>X軸</translation>
+    </message>
+    <message>
+      <source>GEOM_Y_AXIS</source>
+      <translation>Y軸</translation>
+    </message>
+    <message>
+      <source>GEOM_Z_AXIS</source>
+      <translation>Z軸</translation>
+    </message>
+    <message>
+      <source>GEOM_DIM_AXES</source>
+      <translation>局所座標軸に沿った次元</translation>
+    </message>
   </context>
   <context>
     <name>GeometryGUI</name>
     </message>
     <message>
       <source>TABLE_X</source>
-      <translation type="unfinished">X</translation>
+      <translation>X</translation>
     </message>
     <message>
       <source>TABLE_Y</source>
-      <translation type="unfinished">Y</translation>
+      <translation>Y</translation>
     </message>
   </context>
   <context>
     </message>
     <message>
       <source>Z</source>
-      <translation type="unfinished">Z</translation>
+      <translation>Z</translation>
     </message>
   </context>
   <context>
     <name>OperationGUI_ChamferDlg</name>
     <message>
       <source>D</source>
-      <translation type="unfinished">D</translation>
+      <translation>D</translation>
     </message>
     <message>
       <source>FACE_1</source>
       <translation>(有効情報なし)</translation>
     </message>
   </context>
+  <context>
+    <name>GEOMGUI_TextTreeWdg</name>
+    <message>
+      <source>TEXT_TREE_VIEW_TITLE</source>
+      <translation>テキスト</translation>
+    </message>
+    <message>
+      <source>TEXT_TREE_VIEW_NAME</source>
+      <translation>名前</translation>
+    </message>
+  </context>
   <context>
     <name>EntityGUI_IsolineDlg</name>
     <message>
   </context>
   <context>
     <name>MeasureGUI_CheckSelfIntersectionsDlg</name>
+    <message>
+      <source>GEOM_CHECK_INTERSECT_TYPE</source>
+      <translation>自己交差検出型</translation>
+    </message>
     <message>
       <source>GEOM_CHECK_INTE_INTERSECTIONS</source>
       <translation>自己交差</translation>
       <source>GEOM_CHECK_INTE_ALL</source>
       <translation>面から面と上記すべて</translation>
     </message>
+    <message>
+      <source>GEOM_CHECK_INT_DEFLECT</source>
+      <translation>偏向係数</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INT_DETECT_GAPS</source>
+      <translation>トレランスとのギャップ検出</translation>
+    </message>
   </context>
   <context>
     <name>MeasureGUI_FastCheckIntersectionsDlg</name>
       <translation>オブジェクトと結果</translation>
     </message>
   </context>
+  <context>
+    <name>MeasureGUI_ShapeStatisticsDlg</name>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_TYPE</source>
+      <translation>タイプ</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_LENGTH</source>
+      <translation>エッジ長さ</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_AREA</source>
+      <translation>面の面積</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_VOLUME</source>
+      <translation>ソリッドの体積</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_NB_INTERVALS</source>
+      <translation>間隔数</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_SCALAR_RANGE</source>
+      <translation>スカラ範囲</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_COMPUTE</source>
+      <translation>計算</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_MIN</source>
+      <translation>Min</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_MAX</source>
+      <translation>Max</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_CREATE_GROUPS</source>
+      <translation>グループの作成</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_DISTRIBUTION_NB_ENT</source>
+      <translation>エンティティ数</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_MIN_ERROR</source>
+      <translation>範囲内最小の値をセットするかスカラ範囲のスイッチをOFFにしてください。</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_MAX_ERROR</source>
+      <translation>範囲内最大の値をセットするかスカラ範囲のスイッチをOFFにしてください。</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_MIN_MAX_ERROR</source>
+      <translation>範囲内最小値が最大値より大きくすることはできません</translation>
+    </message>
+    <message>
+      <source>GEOM_MSG_GROUPS_CREATED</source>
+      <translation>%1 グループを作成しました。</translation>
+    </message>
+  </context>
   <context>
     <name>TransformationGUI_ExtensionDlg</name>
     <message>
       <source>GEOM_PROJ_ON_CYL_LENGTH_ANGLE</source>
       <translation>Length angle</translation>
     </message>
+    <message>
+      <source>GEOM_PROJ_ON_CYL_ROTATION_ANGLE</source>
+      <translation>回転角度</translation>
+    </message>
   </context>
 </TS>
index 3e61afba714451fa2154482e385347e79ba0712d..0d3f733a6bdea793139f3782842eb58bf3cb7b6f 100644 (file)
@@ -33,6 +33,7 @@
 #include "GEOMGUI_OCCSelector.h"
 #include "GEOMGUI_Selection.h"
 #include "GEOMGUI_CreationInfoWdg.h"
+#include "GEOMGUI_TextTreeWdg.h"
 #include "GEOMGUI_DimensionProperty.h"
 #include "GEOM_Constants.h"
 #include "GEOM_Displayer.h"
@@ -50,8 +51,6 @@
 #include <SUIT_Session.h>
 #include <SUIT_ViewManager.h>
 
-#include <PyInterp_Interp.h>
-
 #include <OCCViewer_ViewWindow.h>
 #include <OCCViewer_ViewPort3d.h>
 #include <OCCViewer_ViewModel.h>
@@ -65,7 +64,9 @@
 #include <SVTK_InteractorStyle.h>
 #include <SVTK_ViewModel.h>
 
+#ifndef DISABLE_GRAPHICSVIEW
 #include <GraphicsView_Viewer.h>
+#endif
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_DataObject.h>
@@ -86,6 +87,7 @@
 #include <SALOMEDS_SObject.hxx>
 
 #include <Basics_OCCTVersion.hxx>
+#include <QtxFontEdit.h>
 
 // External includes
 #include <QDir>
@@ -97,6 +99,7 @@
 #include <QString>
 #include <QPainter>
 #include <QSignalMapper>
+#include <QFontDatabase>
 
 #include <AIS_ListOfInteractive.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 #include <NCollection_DataMap.hxx>
 
 #include <TColStd_HArray1OfByte.hxx>
+#include <TColStd_SequenceOfHAsciiString.hxx>
 
 #include <utilities.h>
 
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx>
 
+#include <Font_SystemFont.hxx>
+#include <Font_FontMgr.hxx>
+#include <TCollection_HAsciiString.hxx>
+
 #include "GEOM_version.h"
 #include "GEOMImpl_Types.hxx" // dangerous hxx (defines short-name macros) - include after all
 
@@ -218,6 +226,7 @@ GeometryGUI::GeometryGUI() :
   myLocalSelectionMode = GEOM_ALLOBJECTS;
 
   myCreationInfoWdg = 0;
+  myTextTreeWdg = 0;
 
   connect( Material_ResourceMgr::resourceMgr(), SIGNAL( changed() ), this, SLOT( updateMaterials() ) );
 
@@ -429,7 +438,11 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   SUIT_ViewWindow* window = desk->activeWindow();
   bool ViewOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
   bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
+#ifndef DISABLE_GRAPHICSVIEW
   bool ViewDep = ( window && window->getViewManager()->getType() == GraphicsView_Viewer::Type() );
+#else
+  bool ViewDep = 0;
+#endif
   // if current viewframe is not of OCC and not of VTK type - return immediately
   // fix for IPAL8958 - allow some commands to execute even when NO viewer is active (rename for example)
   QList<int> NotViewerDependentCommands;
@@ -470,7 +483,9 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpSelectCompound:     // POPUP MENU - SELECT ONLY - COMPOUND
   case GEOMOp::OpSelectAll:          // POPUP MENU - SELECT ONLY - SELECT ALL
   case GEOMOp::OpDelete:             // MENU EDIT - DELETE
+#ifndef DISABLE_PYCONSOLE
   case GEOMOp::OpCheckGeom:          // MENU TOOLS - CHECK GEOMETRY
+#endif
   case GEOMOp::OpMaterialsLibrary:   // MENU TOOLS - MATERIALS LIBRARY
   case GEOMOp::OpDeflection:         // POPUP MENU - DEFLECTION COEFFICIENT
   case GEOMOp::OpColor:              // POPUP MENU - COLOR
@@ -497,7 +512,9 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpClsBringToFront:    //
   case GEOMOp::OpCreateFolder:       // POPUP MENU - CREATE FOLDER
   case GEOMOp::OpSortChildren:       // POPUP MENU - SORT CHILD ITEMS
+#ifndef DISABLE_GRAPHICSVIEW
   case GEOMOp::OpShowDependencyTree: // POPUP MENU - SHOW DEPENDENCY TREE
+#endif
   case GEOMOp::OpReduceStudy:        // POPUP MENU - REDUCE STUDY
     libName = "GEOMToolsGUI";
     break;
@@ -644,6 +661,9 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpCheckSelfInters:    // MENU MEASURE - CHECK SELF INTERSECTIONS
   case GEOMOp::OpFastCheckInters:    // MENU MEASURE - FAST CHECK INTERSECTIONS
   case GEOMOp::OpManageDimensions:   // MENU MEASURE - MANAGE DIMENSIONS
+#ifndef DISABLE_PLOT2DVIEWER
+  case GEOMOp::OpShapeStatistics:    // MENU MEASURE - SHAPE STATISTICS
+#endif
   case GEOMOp::OpShowAllDimensions:  // POPUP MENU - SHOW ALL DIMENSIONS
   case GEOMOp::OpHideAllDimensions:  // POPUP MENU - HIDE ALL DIMENSIONS
     libName = "MeasureGUI";
@@ -878,6 +898,11 @@ void GeometryGUI::createOriginAndBaseVectors()
         GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOX, "OX" );
         GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOY, "OY" );
         GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOZ, "OZ" );
+        anOrigin->UnRegister();
+        anOX->UnRegister();
+        anOY->UnRegister();
+        anOZ->UnRegister();
+        aBasicOperations->UnRegister();
 
         getApp()->updateObjectBrowser( true );
       }
@@ -1025,9 +1050,14 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpGetNonBlocks,     "GET_NON_BLOCKS" );
   createGeomAction( GEOMOp::OpCheckSelfInters,  "CHECK_SELF_INTERSECTIONS" );
   createGeomAction( GEOMOp::OpFastCheckInters,  "FAST_CHECK_INTERSECTIONS" );
+#ifndef DISABLE_PLOT2DVIEWER
+  createGeomAction( GEOMOp::OpShapeStatistics,  "SHAPE_STATISTICS" );
+#endif
 
+#ifndef DISABLE_PYCONSOLE
 #ifdef _DEBUG_ // PAL16821
   createGeomAction( GEOMOp::OpCheckGeom,        "CHECK_GEOMETRY" );
+#endif
 #endif
 
   createGeomAction( GEOMOp::OpMaterialsLibrary,   "MATERIALS_LIBRARY" );
@@ -1082,7 +1112,9 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpPredefMaterCustom,    "POP_PREDEF_MATER_CUSTOM" );
   createGeomAction( GEOMOp::OpCreateFolder, "POP_CREATE_FOLDER" );
   createGeomAction( GEOMOp::OpSortChildren, "POP_SORT_CHILD_ITEMS" );
+#ifndef DISABLE_GRAPHICSVIEW
   createGeomAction( GEOMOp::OpShowDependencyTree, "POP_SHOW_DEPENDENCY_TREE" );
+#endif
   createGeomAction( GEOMOp::OpReduceStudy,       "POP_REDUCE_STUDY" );
   createGeomAction( GEOMOp::OpShowAllDimensions, "POP_SHOW_ALL_DIMENSIONS" );
   createGeomAction( GEOMOp::OpHideAllDimensions, "POP_HIDE_ALL_DIMENSIONS" );
@@ -1288,11 +1320,16 @@ void GeometryGUI::initialize( CAM_Application* app )
   createMenu( GEOMOp::OpCheckSelfInters, measurId, -1 );
   createMenu( GEOMOp::OpFastCheckInters, measurId, -1 );
   createMenu( GEOMOp::OpInspectObj,      measurId, -1 );
+#ifndef DISABLE_PLOT2DVIEWER
+  createMenu( GEOMOp::OpShapeStatistics, measurId, -1 );
+#endif
 
   int toolsId = createMenu( tr( "MEN_TOOLS" ), -1, -1, 50 );
+#ifndef DISABLE_PYCONSOLE
 #if defined(_DEBUG_) || defined(_DEBUG) // PAL16821
   createMenu( separator(),         toolsId, -1 );
   createMenu( GEOMOp::OpCheckGeom, toolsId, -1 );
+#endif
 #endif
 
   createMenu( separator(),         toolsId, -1 );
@@ -1621,9 +1658,11 @@ void GeometryGUI::initialize( CAM_Application* app )
   mgr->insert( action(  GEOMOp::OpSortChildren ), -1, -1 ); // Sort child items
   mgr->setRule( action( GEOMOp::OpSortChildren ), QString("client='ObjectBrowser' and $component={'GEOM'} and nbChildren>1"), QtxPopupMgr::VisibleRule );
 
+#ifndef DISABLE_GRAPHICSVIEW
   mgr->insert( separator(), -1, -1 );     // -----------
   mgr->insert( action(  GEOMOp::OpShowDependencyTree ), -1, -1 ); // Show dependency tree
   mgr->setRule( action( GEOMOp::OpShowDependencyTree ), clientOCCorVTKorOB + " and selcount>0 and ($component={'GEOM'}) and type='Shape'", QtxPopupMgr::VisibleRule );
+#endif
 
   mgr->insert( separator(), -1, -1 );     // -----------
   mgr->insert( action(  GEOMOp::OpReduceStudy ), -1, -1 ); // Reduce Study
@@ -1744,17 +1783,18 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
 
   // import Python module that manages GEOM plugins (need to be here because SalomePyQt API uses active module)
   PyGILState_STATE gstate = PyGILState_Ensure();
-  PyObjWrapper pluginsmanager = PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager");
+  PyObject* pluginsmanager = PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager");
   if ( !pluginsmanager ) {
     PyErr_Print();
   }
   else {
-    PyObjWrapper result =
+    PyObject* result =
       PyObject_CallMethod(pluginsmanager, (char*)"initialize", (char*)"isss", 1, "geom",
                           tr("MEN_NEW_ENTITY").toUtf8().data(),
                           tr("GEOM_PLUGINS_OTHER").toUtf8().data());
     if ( !result )
       PyErr_Print();
+    Py_XDECREF(result);
   }
   PyGILState_Release(gstate);
   // end of GEOM plugins loading
@@ -1780,6 +1820,11 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
   getApp()->insertDockWindow( myCreationInfoWdg->getWinID(), myCreationInfoWdg );
   getApp()->placeDockWindow( myCreationInfoWdg->getWinID(), Qt::LeftDockWidgetArea );
 
+  if ( !myTextTreeWdg )
+    myTextTreeWdg = new GEOMGUI_TextTreeWdg( getApp() );
+  getApp()->insertDockWindow( myTextTreeWdg->getWinID(), myTextTreeWdg );
+  getApp()->placeDockWindow( myTextTreeWdg->getWinID(), Qt::LeftDockWidgetArea );
+
   //NPAL 19674
   SALOME_ListIO selected;
   sm->selectedObjects( selected );
@@ -1818,6 +1863,7 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
     }
   }
 
+  Py_XDECREF(pluginsmanager);
   return true;
 }
 
@@ -1841,8 +1887,15 @@ bool GeometryGUI::deactivateModule( SUIT_Study* study )
 
   disconnect( selMrg, SIGNAL( currentSelectionChanged() ), this, SLOT( updateCreationInfo() ));
   disconnect( selMrg, SIGNAL( currentSelectionChanged() ), this, SLOT( updateFieldColorScale() ));
-  getApp()->removeDockWindow( myCreationInfoWdg->getWinID() );
-  myCreationInfoWdg = 0;
+  if ( myCreationInfoWdg ) {
+    getApp()->removeDockWindow( myCreationInfoWdg->getWinID() );
+    myCreationInfoWdg = 0;
+  }
+  if ( myTextTreeWdg ) {
+    getApp()->removeDockWindow( myTextTreeWdg->getWinID() );
+    disconnect( application(), 0, myTextTreeWdg, 0 );
+    myTextTreeWdg = 0;
+  }
 
   EmitSignalCloseAllDialogs();
 
@@ -1897,9 +1950,13 @@ void GeometryGUI::windows( QMap<int, int>& mappa ) const
 {
   mappa.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
   mappa.insert( SalomeApp_Application::WT_NoteBook, Qt::LeftDockWidgetArea );
+#ifndef DISABLE_PYCONSOLE
   mappa.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
+#endif
   if ( myCreationInfoWdg )
     mappa.insert( myCreationInfoWdg->getWinID(), Qt::LeftDockWidgetArea );
+  if ( myTextTreeWdg )
+    mappa.insert( myTextTreeWdg->getWinID(), Qt::LeftDockWidgetArea );
 }
 
 void GeometryGUI::viewManagers( QStringList& lst ) const
@@ -2211,6 +2268,8 @@ void GeometryGUI::OnSetMaterial(const QString& theName)
 
 void GeometryGUI::createPreferences()
 {
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
   int tabId = addPreference( tr( "PREF_TAB_SETTINGS" ) );
 
   int genGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), tabId );
@@ -2307,12 +2366,36 @@ void GeometryGUI::createPreferences()
   setPreferenceProperty( aDimLineWidthId, "min", 1 );
   setPreferenceProperty( aDimLineWidthId, "max", 5 );
 
-  int aDimFontHeightId = addPreference( tr( "PREF_DIMENSIONS_FONT_HEIGHT" ), aDimGroupId,
-                                        LightApp_Preferences::DblSpin, "Geometry", "dimensions_font_height" );
-
-  setPreferenceProperty( aDimFontHeightId, "min", 1e-9 );
-  setPreferenceProperty( aDimFontHeightId, "max", 1e+9 );
-  setPreferenceProperty( aDimFontHeightId, "precision", 9 );
+  int aDimFontId = addPreference( tr( "PREF_DIMENSIONS_FONT" ), aDimGroupId, LightApp_Preferences::Font, "Geometry", "dimensions_font" );
+
+  int f = QtxFontEdit::Family | QtxFontEdit::Size;
+  setPreferenceProperty( aDimFontId, "features", f );
+  setPreferenceProperty( aDimFontId, "mode", QtxFontEdit::Custom );
+
+  Handle(Font_FontMgr) fmgr = Font_FontMgr::GetInstance();
+  QString aFontFile = "";
+  resMgr->value("resources", "GEOM", aFontFile);
+  aFontFile = aFontFile + QDir::separator() + "Y14.5M-2009.ttf";
+  // add enginier font into combobox
+  int fontID = QFontDatabase::addApplicationFont( aFontFile );
+  Handle(Font_SystemFont) sf = new Font_SystemFont( 
+    new TCollection_HAsciiString("Y14.5M-2009"), 
+    Font_FA_Regular, 
+    new TCollection_HAsciiString(aFontFile.toLatin1().data()) );
+  // register font in OCC font manager
+  fmgr->RegisterFont( sf, Standard_False );
+
+  // get list of supported fonts by OCC
+  QStringList anOCCFonts;
+  TColStd_SequenceOfHAsciiString theFontsNames;
+  fmgr->GetAvailableFontsNames( theFontsNames );
+  for(Standard_Integer i=1; i<=theFontsNames.Length(); i++) {
+    Handle(TCollection_HAsciiString) str = theFontsNames(i);
+    anOCCFonts << str->ToCString();
+  }
+  anOCCFonts.removeDuplicates();
+  // set the supported fonts into combobox to use its only
+  setPreferenceProperty( aDimFontId, "fonts", anOCCFonts );
 
   int aDimArrLengthId = addPreference( tr( "PREF_DIMENSIONS_ARROW_LENGTH" ), aDimGroupId,
                                        LightApp_Preferences::DblSpin, "Geometry", "dimensions_arrow_length" );
@@ -2327,9 +2410,6 @@ void GeometryGUI::createPreferences()
   int anAngUnitsId = addPreference( tr( "PREF_DIMENSIONS_ANGLE_UNITS" ), aDimGroupId,
                                    LightApp_Preferences::Selector, "Geometry", "dimensions_angle_units" );
 
-  addPreference( tr( "PREF_DIMENSIONS_SHOW_UNITS" ), aDimGroupId,
-                 LightApp_Preferences::Bool, "Geometry", "dimensions_show_units" );
-
   QStringList aListOfLengthUnits;
   aListOfLengthUnits << "m";
   aListOfLengthUnits << "cm";
@@ -2344,6 +2424,9 @@ void GeometryGUI::createPreferences()
   setPreferenceProperty( aLengthUnitsId, "strings", aListOfLengthUnits );
   setPreferenceProperty( anAngUnitsId,   "strings", aListOfAngUnits );
 
+  addPreference( tr( "PREF_DIMENSIONS_SHOW_UNITS" ), aDimGroupId,
+                 LightApp_Preferences::Bool, "Geometry", "dimensions_show_units" );
+
   int aDimDefFlyout = addPreference( tr( "PREF_DIMENSIONS_DEFAULT_FLYOUT" ), aDimGroupId,
                                      LightApp_Preferences::DblSpin, "Geometry", "dimensions_default_flyout" );
 
@@ -2351,6 +2434,9 @@ void GeometryGUI::createPreferences()
   setPreferenceProperty( aDimDefFlyout, "max", 1e+9 );
   setPreferenceProperty( aDimDefFlyout, "precision", 9 );
 
+  addPreference( tr( "PREF_DIMENSIONS_USE_TEXT3D" ), aDimGroupId,
+                 LightApp_Preferences::Bool, "Geometry", "dimensions_use_text3d" );
+
   int isoGroup = addPreference( tr( "PREF_ISOS" ), tabId );
   setPreferenceProperty( isoGroup, "columns", 2 );
   int isoU = addPreference( tr( "PREF_ISOS_U" ), isoGroup,
@@ -2457,7 +2543,6 @@ void GeometryGUI::createPreferences()
   QList<QVariant> aMarkerTypeIndicesList;
   QList<QVariant> aMarkerTypeIconsList;
 
-  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
   for ( int i = GEOM::MT_POINT; i < GEOM::MT_USER; i++ ) {
     QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
     QPixmap pixmap = resMgr->loadPixmap( "GEOM", tr( qPrintable( icoFile ) ) );
@@ -2619,11 +2704,12 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par
     }
     else if ( param == QString("dimensions_color")        ||
               param == QString("dimensions_line_width")   ||
-              param == QString("dimensions_font_height")  ||
+              param == QString("dimensions_font")         ||
               param == QString("dimensions_arrow_length") ||
               param == QString("dimensions_show_units")   ||
               param == QString("dimensions_length_units") ||
               param == QString("dimensions_angle_units")  ||
+              param == QString("dimensions_use_text3d")  ||
               param == QString("label_color") )
     {
       SalomeApp_Application* anApp = getApp();
@@ -3442,3 +3528,8 @@ void GeometryGUI::dropObjects( const DataObjectList& what, SUIT_DataObject* wher
   // update Object browser
   getApp()->updateObjectBrowser( false );
 }
+
+void GeometryGUI::emitDimensionsUpdated( QString entry )
+{
+  emit DimensionsUpdated( entry );
+}
index 53d314ed127faf41f8ec5e36d1bfedf9fb8b0ef1..f0abf2da2244d5ba81cfdd3985a19d45769d5dbb 100644 (file)
@@ -64,6 +64,7 @@ class LightApp_Selection;
 class SUIT_ViewManager;
 class SalomeApp_Study;
 class GEOMGUI_CreationInfoWdg;
+class GEOMGUI_TextTreeWdg;
 
 //=================================================================================
 // class    : GeometryGUI
@@ -148,6 +149,8 @@ public:
                                            SUIT_DataObject* where,
                                            const int row, Qt::DropAction action );
 
+  void                        emitDimensionsUpdated( QString entry );
+
 public slots:
   virtual bool                deactivateModule( SUIT_Study* );
   virtual bool                activateModule( SUIT_Study* );
@@ -176,6 +179,7 @@ signals :
   void                        SignalDefaultStepValueChanged( double newVal );
   void                        SignalDependencyTreeParamChanged( const QString&, const QString& );
   void                        SignalDependencyTreeRenameObject( const QString& );
+  void                        DimensionsUpdated( const QString& );
 
 protected:
   virtual LightApp_Selection* createSelection() const;
@@ -224,6 +228,8 @@ private:
 
   GEOMGUI_CreationInfoWdg*    myCreationInfoWdg;
   
+  GEOMGUI_TextTreeWdg*       myTextTreeWdg;
+  
   SALOME_ListIO               myTopLevelIOList;               
 
   friend class DisplayGUI;
index 915f5d1f18bc026eb1e0d0bf7bda802b641ed792..480b7d2fd366ebfbc47dad62cb8f21043d09529d 100644 (file)
@@ -26,7 +26,9 @@ namespace GEOMOp {
   enum {
     // ToolsGUI --------------------//--------------------------------
     OpDelete              = 1020,   // MENU EDIT  - DELETE
+#ifndef DISABLE_PYCONSOLE
     OpCheckGeom           = 1030,   // MENU TOOLS - CHECK GEOMETRY
+#endif
     OpMaterialsLibrary    = 1040,   // MENU TOOLS - MATERIALS LIBRARY
     OpSelectVertex        = 1100,   // POPUP MENU - SELECT ONLY - VERTEX
     OpSelectEdge          = 1101,   // POPUP MENU - SELECT ONLY - EDGE
@@ -59,7 +61,9 @@ namespace GEOMOp {
     OpIsosWidth           = 1261,   // POPUP MENU - LINE WIDTH - ISOS WIDTH
     OpCreateFolder        = 1262,   // POPUP MENU - CREATE FOLDER
     OpSortChildren        = 1263,   // POPUP MENU - SORT CHILD ITEMS
+#ifndef DISABLE_GRAPHICSVIEW
     OpShowDependencyTree  = 1264,   // POPUP MENU - SHOW DEPENDENCY TREE
+#endif
     OpReduceStudy         = 1265,   // POPUP MENU - REDUCE STUDY
     // DisplayGUI ------------------//--------------------------------
     OpSwitchVectors       = 2001,   // MENU VIEW  - DISPLAY MODE - SHOW/HIDE EDGE DIRECTION
@@ -199,7 +203,10 @@ namespace GEOMOp {
     OpShowAllDimensions   = 5015,   // POPUP MENU - SHOW ALL DIMENSIONS
     OpHideAllDimensions   = 5016,   // POPUP MENU - HIDE ALL DIMENSIONS
     OpFastCheckInters     = 5017,   // MENU MEASURES - FAST CHECK INTERSECTIONS
-    OpInspectObj         = 5018,   // MENU MEASURES - INSPECT OBJECT
+    OpInspectObj         = 5018,       // MENU MEASURES - INSPECT OBJECT
+#ifndef DISABLE_PLOT2DVIEWER
+    OpShapeStatistics    = 5019,   // MENU MEASURES - SHAPE STATISTICS
+#endif
     // GroupGUI --------------------//--------------------------------
     OpGroupCreate         = 6000,   // MENU GROUP - CREATE
     OpGroupEdit           = 6001,   // MENU GROUP - EDIT
index 4d6a72f2abb8358fbea33ded131924e70bf312ed..54ab687215c0f6cc3dde0e0bcc0bf57dfad2699a 100644 (file)
@@ -82,7 +82,7 @@ static TopoDS_Shape RemoveExtraEdges(const TopoDS_Shape &theShape)
     else {
       TopoDS_Shape aFixed;
       ShHealOper_ShapeProcess aHealer;
-      aHealer.Perform(aResult, aFixed);
+      aHealer.Perform(aShape, aFixed);
       if (aHealer.isDone() && GEOMUtils::CheckShape(aFixed))
         aResult = aFixed;
     }
index 3c519465c76fad30fb043e9b86e5deaf8b9fe45c..fab57241a61731153ec96b7e589dea27593da6ec 100644 (file)
@@ -804,25 +804,73 @@ void GEOMImpl_HealingDriver::FuseCollinearEdges (const TopoDS_Shape& theOriginal
   theWire = TopoDS::Wire(Fixer->Shape());
   */
 
-  TopoDS_Edge prevEdge;
-  TopTools_ListOfShape finalList, currChain;
-
-  BRepTools_WireExplorer wexp (theWire);
-  if (wexp.More()) {
-    prevEdge = wexp.Current();
-    currChain.Append(prevEdge);
-    wexp.Next();
+  // Get the ordered list of edges.
+  TopTools_ListOfShape   anEdges;
+  TopTools_ListOfShape   aCurVertices;
+  BRepTools_WireExplorer aWExp (theWire);
+
+  for (; aWExp.More(); aWExp.Next()) {
+    anEdges.Append(aWExp.Current());
+    aCurVertices.Append(aWExp.CurrentVertex());
   }
-  else {
+
+  if (anEdges.IsEmpty()) {
     Standard_NullObject::Raise("Empty wire given");
   }
 
-  for (; wexp.More(); wexp.Next()) {
-    TopoDS_Edge anEdge = wexp.Current();
-    TopoDS_Vertex CurVertex = wexp.CurrentVertex();
+  // Treat the case if the wire is closed and first and last edges are C1.
+  Standard_Boolean isShift = Standard_False;
+
+  if (BRep_Tool::IsClosed(theWire)) {
+    // Wire is closed. Check if there are more than 2 edges in the wire.
+    if (!anEdges.First().IsSame(anEdges.Last())) {
+      isShift = Standard_True;
+    }
+  }
+
+  if (isShift) {
+    // Put first edge to the end of the list while the chain break is reached.
+    TopoDS_Shape aFirstEdge = anEdges.First();
+
+    while (isShift) {
+      isShift = Standard_False;
+
+      // Check if the first vertex should be kept
+      if (aMapToRemove.Contains(aCurVertices.First()) || removeAll) {
+        // Check if first and last edges are C1.
+        TopoDS_Edge anEdge1 = TopoDS::Edge(anEdges.Last());
+        TopoDS_Edge anEdge2 = TopoDS::Edge(anEdges.First());
+
+        if (AreEdgesC1(anEdge1, anEdge2)) {
+          // Make the first edge last.
+          anEdges.Append(anEdge2);
+          anEdges.RemoveFirst();
+          aCurVertices.Append(aCurVertices.First());
+          aCurVertices.RemoveFirst();
+
+          // Check if we reached the first edge again.
+          // Break the loop in this case.
+          isShift = !aFirstEdge.IsSame(anEdges.First());
+        }
+      }
+    }
+  }
+
+  TopTools_ListOfShape finalList, currChain;
+  TopTools_ListIteratorOfListOfShape anEIter(anEdges);
+  TopTools_ListIteratorOfListOfShape aVIter(aCurVertices);
+  TopoDS_Edge                        prevEdge = TopoDS::Edge(anEIter.Value());
+
+  currChain.Append(prevEdge);
+  anEIter.Next();
+  aVIter.Next();
+
+  for (; anEIter.More(); anEIter.Next(), aVIter.Next()) {
+    TopoDS_Edge         anEdge     = TopoDS::Edge(anEIter.Value());
+    const TopoDS_Shape &aCurVertex = aVIter.Value();
 
     bool continueChain = false;
-    if (aMapToRemove.Contains(CurVertex) || removeAll) {
+    if (aMapToRemove.Contains(aCurVertex) || removeAll) {
       // if C1 -> continue chain
       if (AreEdgesC1(prevEdge, anEdge)) {
         continueChain = true;
index 0174470713c4a57ffbb447e6702b9c16b4d836df..4f46c1bbdb41622b4a906d3672019e81f7a83240 100644 (file)
@@ -1828,6 +1828,7 @@ Handle(TColStd_HSequenceOfTransient)
                const Handle(GEOM_Object)                  &thePath,
                const bool                                  theWithContact,
                const bool                                  theWithCorrections,
+               const bool                                  IsBySteps,
                const bool                                  IsGenerateGroups)
 {
   SetErrorCode(KO);
@@ -1897,8 +1898,13 @@ Handle(TColStd_HSequenceOfTransient)
   aCI.SetBases(aSeqBases);
   aCI.SetLocations(aSeqLocs);
   aCI.SetPath(aRefPath);
-  aCI.SetWithContactMode(theWithContact);
-  aCI.SetWithCorrectionMode(theWithCorrections);
+
+  if (!IsBySteps) {
+    aCI.SetWithContactMode(theWithContact);
+    aCI.SetWithCorrectionMode(theWithCorrections);
+  }
+
+  aCI.SetIsBySteps(IsBySteps);
   aCI.SetGenerateGroups(IsGenerateGroups);
 
   //Compute the Pipe value
@@ -1930,7 +1936,11 @@ Handle(TColStd_HSequenceOfTransient)
     pyDump << aPipeDS;
   }
 
-  pyDump << " = geompy.MakePipeWithDifferentSections([";
+  if (IsBySteps) {
+    pyDump << " = geompy.MakePipeWithDifferentSectionsBySteps([";
+  } else {
+    pyDump << " = geompy.MakePipeWithDifferentSections([";
+  }
 
   for(i =1 ; i <= nbBases; i++) {
 
@@ -1962,7 +1972,11 @@ Handle(TColStd_HSequenceOfTransient)
     }
   }
 
-  pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections;
+  pyDump<< "], "<<thePath;
+
+  if (!IsBySteps) {
+    pyDump<<","<<theWithContact << "," << theWithCorrections;
+  }
 
   if (IsGenerateGroups) {
     pyDump << ", True";
index a0ae56e3790b0d0e3475ba0e69e55555850fadad..91f4f46bb3c7e296522305f8cf901acff9020300 100644 (file)
@@ -135,6 +135,7 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
                const Handle(GEOM_Object)                  &thePath,
                const bool                                  theWithContact,
                const bool                                  theWithCorrections,
+               const bool                                  IsBySteps,
                const bool                                  IsGenerateGroups);
 
   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeWithShellSections
index 576ba74af0ceaad6a56e0430c53f0bf02d1e3e3b..8f282f2ae477fa3c06457de0f06a7af2483bcf0a 100644 (file)
@@ -186,10 +186,11 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointWithReference
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom
                     (Handle(GEOM_Object) theGeomObj,
-                     double theParam1,
-                     double theParam2,
-                     double theParam3,
+                     double              theParam1,
+                     double              theParam2,
+                     double              theParam3,
                      const PointLocation theLocation,
+                     const bool          takeOrientationIntoAccount,
                      Handle(GEOM_Object) theRefPoint)
 {
   SetErrorCode(KO);
@@ -226,6 +227,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom
     case PointOn_CurveByParam:
       aPI.SetCurve(aRefFunction);
       aPI.SetParameter(theParam1);
+      aPI.SetTakeOrientationIntoAccount(takeOrientationIntoAccount);
       break;
     case PointOn_CurveByLength:
       aPI.SetCurve(aRefFunction);
@@ -277,7 +279,8 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom
     {
     case PointOn_CurveByParam:
       GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurve("
-                                   << theGeomObj << ", " << theParam1 << ")";
+                                   << theGeomObj << ", " << theParam1 << ", "
+                                   << takeOrientationIntoAccount <<  ")";
       break;
     case PointOn_CurveByLength:
       GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurveByLength("
@@ -315,9 +318,12 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurve
-                            (Handle(GEOM_Object) theCurve, double theParameter)
+                            (Handle(GEOM_Object) theCurve,
+                             double              theParameter,
+                             bool                takeOrientationIntoAccount)
 {
-  return makePointOnGeom(theCurve, theParameter, 0.0, 0.0, PointOn_CurveByParam);
+  return makePointOnGeom(theCurve, theParameter, 0.0, 0.0, PointOn_CurveByParam,
+                         takeOrientationIntoAccount);
 }
 
 //=============================================================================
@@ -344,7 +350,8 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurveByLength
                      double              theLength, 
                      Handle(GEOM_Object) theStartPoint)
 {
-  return makePointOnGeom(theCurve, theLength, 0.0, 0.0, PointOn_CurveByLength, theStartPoint);
+  return makePointOnGeom(theCurve, theLength, 0.0, 0.0, PointOn_CurveByLength,
+                         false, theStartPoint);
 }
 
 //=============================================================================
index e3960f2f548ff0c9095be3c7ee4e75f561bb55d2..df8051ab683d187316d590fde79d6ac394e11497 100644 (file)
@@ -40,8 +40,10 @@ class GEOMImpl_IBasicOperations : public GEOM_IOperations {
   Standard_EXPORT Handle(GEOM_Object) MakePointWithReference (Handle(GEOM_Object) theReference,
                                               double theX, double theY, double theZ);
 
-  Standard_EXPORT Handle(GEOM_Object) MakePointOnCurve (Handle(GEOM_Object) theCurve,
-                                                        double theParameter);
+  Standard_EXPORT Handle(GEOM_Object) MakePointOnCurve
+                              (Handle(GEOM_Object) theCurve,
+                               double              theParameter,
+                               bool                takeOrientationIntoAccount);
 
   Standard_EXPORT Handle(GEOM_Object) MakePointOnCurveByLength (Handle(GEOM_Object) theCurve,
                                                                 double              theLength,
@@ -134,12 +136,14 @@ class GEOMImpl_IBasicOperations : public GEOM_IOperations {
     PointOn_Face
   };
 
-  Handle(GEOM_Object) makePointOnGeom (Handle(GEOM_Object) theGeomObj,
-                                       double theParam1,
-                                       double theParam2,
-                                       double theParam3,
-                                       const PointLocation theLocation,
-                                       Handle(GEOM_Object) theRefPoint = 0);
+  Handle(GEOM_Object) makePointOnGeom
+                     (Handle(GEOM_Object) theGeomObj,
+                      double              theParam1,
+                      double              theParam2,
+                      double              theParam3,
+                      const PointLocation theLocation,
+                      const bool          takeOrientationIntoAccount = false,
+                      Handle(GEOM_Object) theRefPoint = 0);
 };
 
 #endif
index 2ee635e31bc8fbe5cf3c465f7fffccb27da9f739..229024df4028641243ba7f0ce07506c67a920db4 100644 (file)
  * ===========  PYTHON ==============
  * ==================================*/
 
-typedef struct {
-  PyObject_HEAD
-  int softspace;
-  std::string *out;
-  } PyStdOut;
-
-static void
-PyStdOut_dealloc(PyStdOut *self)
-{
-  PyObject_Del(self);
-}
-
-static PyObject *
-PyStdOut_write(PyStdOut *self, PyObject *args)
+namespace
 {
-  char *c;
-  int l;
-  if (!PyArg_ParseTuple(args, "t#:write",&c, &l))
-    return NULL;
-
-  //std::cerr << c ;
-  *(self->out)=*(self->out)+c;
-
-  Py_INCREF(Py_None);
-  return Py_None;
-}
+  typedef struct {
+    PyObject_HEAD
+    int softspace;
+    std::string *out;
+  } PyStdOut;
+  
+  static void
+  PyStdOut_dealloc(PyStdOut *self)
+  {
+    PyObject_Del(self);
+  }
 
-static PyMethodDef PyStdOut_methods[] = {
-  {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS,
-    PyDoc_STR("write(string) -> None")},
-  {NULL,    NULL}   /* sentinel */
-};
-
-static PyMemberDef PyStdOut_memberlist[] = {
-  {(char*)"softspace", T_INT,  offsetof(PyStdOut, softspace), 0,
-   (char*)"flag indicating that a space needs to be printed; used by print"},
-  {NULL} /* Sentinel */
-};
-
-static PyTypeObject PyStdOut_Type = {
-  /* The ob_type field must be initialized in the module init function
-   * to be portable to Windows without using C++. */
-  PyObject_HEAD_INIT(NULL)
-  0,                            /*ob_size*/
-  "PyOut",                      /*tp_name*/
-  sizeof(PyStdOut),             /*tp_basicsize*/
-  0,                            /*tp_itemsize*/
-  /* methods */
-  (destructor)PyStdOut_dealloc, /*tp_dealloc*/
-  0,                            /*tp_print*/
-  0,                            /*tp_getattr*/
-  0,                            /*tp_setattr*/
-  0,                            /*tp_compare*/
-  0,                            /*tp_repr*/
-  0,                            /*tp_as_number*/
-  0,                            /*tp_as_sequence*/
-  0,                            /*tp_as_mapping*/
-  0,                            /*tp_hash*/
-  0,                            /*tp_call*/
-  0,                            /*tp_str*/
-  PyObject_GenericGetAttr,      /*tp_getattro*/
-  /* softspace is writable:  we must supply tp_setattro */
-  PyObject_GenericSetAttr,      /* tp_setattro */
-  0,                            /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT,           /*tp_flags*/
-  0,                            /*tp_doc*/
-  0,                            /*tp_traverse*/
-  0,                            /*tp_clear*/
-  0,                            /*tp_richcompare*/
-  0,                            /*tp_weaklistoffset*/
-  0,                            /*tp_iter*/
-  0,                            /*tp_iternext*/
-  PyStdOut_methods,             /*tp_methods*/
-  PyStdOut_memberlist,          /*tp_members*/
-  0,                            /*tp_getset*/
-  0,                            /*tp_base*/
-  0,                            /*tp_dict*/
-  0,                            /*tp_descr_get*/
-  0,                            /*tp_descr_set*/
-  0,                            /*tp_dictoffset*/
-  0,                            /*tp_init*/
-  0,                            /*tp_alloc*/
-  0,                            /*tp_new*/
-  0,                            /*tp_free*/
-  0,                            /*tp_is_gc*/
-};
-
-PyObject * newPyStdOut( std::string& out )
-{
-  PyStdOut *self;
-  self = PyObject_New(PyStdOut, &PyStdOut_Type);
-  if (self == NULL)
-    return NULL;
-  self->softspace = 0;
-  self->out=&out;
-  return (PyObject*)self;
+  static PyObject*
+  PyStdOut_write(PyStdOut* self, PyObject* args)
+  {
+    char *c;
+    int l;
+    if (!PyArg_ParseTuple(args, "t#:write", &c, &l))
+      return NULL;
+    
+    *(self->out) = *(self->out) + c;
+    
+    Py_INCREF(Py_None);
+    return Py_None;
+  }
+  
+  static PyMethodDef PyStdOut_methods[] = {
+    {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS,
+     PyDoc_STR("write(string) -> None")},
+    {NULL,    NULL}   /* sentinel */
+  };
+
+  static PyMemberDef PyStdOut_memberlist[] = {
+    {(char*)"softspace", T_INT,  offsetof(PyStdOut, softspace), 0,
+     (char*)"flag indicating that a space needs to be printed; used by print"},
+    {NULL} /* Sentinel */
+  };
+  
+  static PyTypeObject PyStdOut_Type = {
+    /* The ob_type field must be initialized in the module init function
+     * to be portable to Windows without using C++. */
+    PyObject_HEAD_INIT(NULL)
+    0,                            /*ob_size*/
+    "PyOut",                      /*tp_name*/
+    sizeof(PyStdOut),             /*tp_basicsize*/
+    0,                            /*tp_itemsize*/
+    /* methods */
+    (destructor)PyStdOut_dealloc, /*tp_dealloc*/
+    0,                            /*tp_print*/
+    0,                            /*tp_getattr*/
+    0,                            /*tp_setattr*/
+    0,                            /*tp_compare*/
+    0,                            /*tp_repr*/
+    0,                            /*tp_as_number*/
+    0,                            /*tp_as_sequence*/
+    0,                            /*tp_as_mapping*/
+    0,                            /*tp_hash*/
+    0,                            /*tp_call*/
+    0,                            /*tp_str*/
+    PyObject_GenericGetAttr,      /*tp_getattro*/
+    /* softspace is writable:  we must supply tp_setattro */
+    PyObject_GenericSetAttr,      /* tp_setattro */
+    0,                            /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT,           /*tp_flags*/
+    0,                            /*tp_doc*/
+    0,                            /*tp_traverse*/
+    0,                            /*tp_clear*/
+    0,                            /*tp_richcompare*/
+    0,                            /*tp_weaklistoffset*/
+    0,                            /*tp_iter*/
+    0,                            /*tp_iternext*/
+    PyStdOut_methods,             /*tp_methods*/
+    PyStdOut_memberlist,          /*tp_members*/
+    0,                            /*tp_getset*/
+    0,                            /*tp_base*/
+    0,                            /*tp_dict*/
+    0,                            /*tp_descr_get*/
+    0,                            /*tp_descr_set*/
+    0,                            /*tp_dictoffset*/
+    0,                            /*tp_init*/
+    0,                            /*tp_alloc*/
+    0,                            /*tp_new*/
+    0,                            /*tp_free*/
+    0,                            /*tp_is_gc*/
+  };
+  
+  PyObject* newPyStdOut( std::string& out )
+  {
+    PyStdOut* self = PyObject_New(PyStdOut, &PyStdOut_Type);
+    if (self) {
+      self->softspace = 0;
+      self->out=&out;
+    }
+    return (PyObject*)self;
+  }
 }
 
-
 ////////////////////////END PYTHON///////////////////////////
 //=============================================================================
 /*!
@@ -1008,7 +1008,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric
 
   PyObject * func = NULL;
   func = PyObject_GetAttrString(main_mod, "coordCalculator");
-
   if (func == NULL){
     SetErrorCode("Can't get function from python module !!!");
     PyGILState_Release(gstate);
@@ -1021,15 +1021,15 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric
   else
     coords = PyObject_CallFunction(func,(char*)"(d, d, d)", theParamMin, theParamMax, theParamStep );
 
-  PyObject* new_stderr = NULL;
-
   if (coords == NULL){
     fflush(stderr);
     std::string err_description="";
-    new_stderr = newPyStdOut(err_description);
+    PyObject* new_stderr = newPyStdOut(err_description);
+    PyObject* old_stderr = PySys_GetObject((char*)"stderr");
+    Py_INCREF(old_stderr);
     PySys_SetObject((char*)"stderr", new_stderr);
     PyErr_Print();
-    PySys_SetObject((char*)"stderr", PySys_GetObject((char*)"__stderr__"));
+    PySys_SetObject((char*)"stderr", old_stderr);
     Py_DECREF(new_stderr);
     MESSAGE("Can't evaluate coordCalculator()" << " error is " << err_description);
     SetErrorCode("Can't evaluate the expressions, please check them !!!");
index 4bc9a6700fc6e6c6d5cb84cae55e809b9e14acef..82654f21ffac3deb4c03f9f51498cf7a23eb7a67 100644 (file)
@@ -1116,7 +1116,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G
     return NULL; //There is no function which creates an object to be processed
 
   // Add a new object
-  Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   if (theObject->GetType() == GEOM_VECTOR) { // Mantis issue 21066
     //Add the function
index d1d23d51c1e14cc86afaae6033dd09e04db557a1..e1b9e08cd63d38493c730d01c0ca03fce03ed834 100644 (file)
 #include <BRepClass3d_SolidClassifier.hxx>
 #include <BRepClass_FaceClassifier.hxx>
 #include <BRepExtrema_DistShapeShape.hxx>
-#if OCC_VERSION_LARGE > 0x06080000
 #include <BRepExtrema_ShapeProximity.hxx>
+#if OCC_VERSION_LARGE > 0x06090000
+#include <BRepExtrema_SelfIntersection.hxx>
+#include <BRepExtrema_MapOfIntegerPackedMapOfInteger.hxx>
 #endif
 #include <BRepGProp.hxx>
 #include <BRepTools.hxx>
@@ -61,6 +63,7 @@
 #include <GeomAPI_ProjectPointOnSurf.hxx>
 #include <GeomLProp_CLProps.hxx>
 #include <GeomLProp_SLProps.hxx>
+#include <Geom_Plane.hxx>
 #include <GProp_GProps.hxx>
 #include <GProp_PrincipalProps.hxx>
 #include <ShapeAnalysis.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape.hxx>
+#include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
 
+#include <set>
+
 //=============================================================================
 /*!
  *  Constructor
@@ -142,6 +148,38 @@ GEOMImpl_IMeasureOperations::ShapeKind GEOMImpl_IMeasureOperations::KindOfShape
   }
   const GEOMAlgo_ShapeInfo& anInfo = aSF.Info();
 
+  // specific processing for some "advandced" objects
+  switch ( geom_type ) {
+  case GEOM_MARKER:
+    // local coordinate systen
+    // (+) geompy.kind.LCS  xc yc zc xx xy xz yx yy yz zx zy zz
+
+    TopoDS_Face aFace = TopoDS::Face( aShape );
+    Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast( BRep_Tool::Surface( aFace ) );
+    gp_Pnt aC = aPlane->Pln().Location();
+    gp_Ax3 anAx3 = aPlane->Pln().Position();
+
+    theDoubles->Append(aC.X());
+    theDoubles->Append(aC.Y());
+    theDoubles->Append(aC.Z());
+    
+    gp_Dir aD = anAx3.XDirection();
+    theDoubles->Append(aD.X());
+    theDoubles->Append(aD.Y());
+    theDoubles->Append(aD.Z());
+    aD = anAx3.YDirection();
+    theDoubles->Append(aD.X());
+    theDoubles->Append(aD.Y());
+    theDoubles->Append(aD.Z());
+    aD = anAx3.Direction();
+    theDoubles->Append(aD.X());
+    theDoubles->Append(aD.Y());
+    theDoubles->Append(aD.Z());
+
+    SetErrorCode(OK);
+    return SK_LCS;
+  }
+
   // Interprete results
   TopAbs_ShapeEnum aType = anInfo.Type();
   switch (aType)
@@ -523,35 +561,22 @@ GEOMImpl_IMeasureOperations::ShapeKind GEOMImpl_IMeasureOperations::KindOfShape
           theDoubles->Append(aD.X());
           theDoubles->Append(aD.Y());
           theDoubles->Append(aD.Z());
+
+          if (anInfo.KindOfBounds() != GEOMAlgo_KB_INFINITE)
+          {
+            // (+) geompy.kind.PLANAR  xo yo zo  dx dy dz  nb_edges nb_vertices
+            aKind = SK_PLANAR;
+            
+            theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
+            theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
+          }
         }
         break;
       default:
-        if (anInfo.KindOfShape() == GEOMAlgo_KS_PLANE) {
-          // (+) geompy.kind.PLANAR  xo yo zo  dx dy dz  nb_edges nb_vertices
-
-          aKind = SK_PLANAR;
-
-          gp_Pnt aC = anInfo.Location();
-          theDoubles->Append(aC.X());
-          theDoubles->Append(aC.Y());
-          theDoubles->Append(aC.Z());
-
-          gp_Ax3 anAx3 = anInfo.Position();
-          gp_Dir aD = anAx3.Direction();
-          theDoubles->Append(aD.X());
-          theDoubles->Append(aD.Y());
-          theDoubles->Append(aD.Z());
-
-          theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
-          theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
-        }
-        else {
-          // ??? geompy.kind.FACE  nb_edges nb_vertices _surface_type_id_
-          // (+) geompy.kind.FACE  nb_edges nb_vertices
-
-          theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
-          theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
-        }
+        // ??? geompy.kind.FACE  nb_edges nb_vertices _surface_type_id_
+        // (+) geompy.kind.FACE  nb_edges nb_vertices
+        theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
+        theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
       }
     }
     break;
@@ -1510,7 +1535,6 @@ bool GEOMImpl_IMeasureOperations::CheckSelfIntersections
                           Handle(TColStd_HSequenceOfInteger)& theIntersections)
 {
   SetErrorCode(KO);
-  bool isGood = false;
 
   if (theIntersections.IsNull())
     theIntersections = new TColStd_HSequenceOfInteger;
@@ -1518,13 +1542,13 @@ bool GEOMImpl_IMeasureOperations::CheckSelfIntersections
     theIntersections->Clear();
 
   if (theShape.IsNull())
-    return isGood;
+    return false;
 
   Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
-  if (aRefShape.IsNull()) return isGood;
+  if (aRefShape.IsNull()) return false;
 
   TopoDS_Shape aShape = aRefShape->GetValue();
-  if (aShape.IsNull()) return isGood;
+  if (aShape.IsNull()) return false;
 
   // 0. Prepare data
   TopoDS_Shape aScopy;
@@ -1546,7 +1570,6 @@ bool GEOMImpl_IMeasureOperations::CheckSelfIntersections
   aCSI.Perform();
   Standard_Integer iErr = aCSI.ErrorStatus();
 
-  isGood = true;
   //
   Standard_Integer aNbS, n1, n2;
   BOPDS_MapIteratorMapOfPassKey aItMPK;
@@ -1570,14 +1593,82 @@ bool GEOMImpl_IMeasureOperations::CheckSelfIntersections
 
     theIntersections->Append(anIndices.FindIndex(aS1));
     theIntersections->Append(anIndices.FindIndex(aS2));
-    isGood = false;
   }
 
   if (!iErr) {
     SetErrorCode(OK);
   }
 
-  return isGood;
+  return theIntersections->IsEmpty();
+}
+
+//=============================================================================
+/*!
+ *  CheckSelfIntersectionsFast
+ */
+//=============================================================================
+bool GEOMImpl_IMeasureOperations::CheckSelfIntersectionsFast
+                         (Handle(GEOM_Object) theShape,
+                         float theDeflection, double theTolerance,
+                          Handle(TColStd_HSequenceOfInteger)& theIntersections)
+{
+  SetErrorCode(KO);
+
+  if (theIntersections.IsNull())
+    theIntersections = new TColStd_HSequenceOfInteger;
+  else
+    theIntersections->Clear();
+
+  if (theShape.IsNull())
+    return false;
+
+  Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
+  if (aRefShape.IsNull()) return false;
+
+  TopoDS_Shape aShape = aRefShape->GetValue();
+  if (aShape.IsNull()) return false;
+
+  // Prepare data
+  TopoDS_Shape aScopy;
+
+  GEOMAlgo_AlgoTools::CopyShape(aShape, aScopy);
+  GEOMUtils::MeshShape(aScopy, theDeflection);
+
+  // Map sub-shapes and their indices
+  TopTools_IndexedMapOfShape anIndices;
+  TopExp::MapShapes(aScopy, anIndices);
+
+#if OCC_VERSION_LARGE > 0x06090000
+  // Checker of fast interferences
+  BRepExtrema_SelfIntersection aTool(aScopy, (theTolerance <= 0.) ? 0.0 : theTolerance);
+
+  // Launch the checker
+  aTool.Perform();
+  
+  const BRepExtrema_MapOfIntegerPackedMapOfInteger& intersections = aTool.OverlapElements();
+  
+  std::set<Standard_Integer> processed;
+  
+  for (BRepExtrema_MapOfIntegerPackedMapOfInteger::Iterator it(intersections); it.More(); it.Next()) {
+    Standard_Integer idxLeft = it.Key();
+    if (processed.count(idxLeft) > 0) continue; // already added
+    processed.insert(idxLeft);
+    const TColStd_PackedMapOfInteger& overlaps = it.Value();
+    for (TColStd_MapIteratorOfPackedMapOfInteger subit(overlaps); subit.More(); subit.Next()) {
+      Standard_Integer idxRight = subit.Key();
+      if (processed.count(idxRight) > 0) continue; // already added
+      const TopoDS_Shape& aS1 = aTool.GetSubShape(idxLeft);
+      const TopoDS_Shape& aS2 = aTool.GetSubShape(idxRight);
+      theIntersections->Append(anIndices.FindIndex(aS1));
+      theIntersections->Append(anIndices.FindIndex(aS2));
+    }
+  }
+
+  if (aTool.IsDone())
+    SetErrorCode(OK);
+#endif
+
+  return theIntersections->IsEmpty();
 }
 
 //=============================================================================
@@ -1593,8 +1684,6 @@ 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
@@ -1646,12 +1735,22 @@ bool GEOMImpl_IMeasureOperations::FastIntersect (Handle(GEOM_Object) theShape1,
   aBSP.Perform();
  
   // 2. Get sets of IDs of overlapped faces
-  for (BRepExtrema_OverlappedSubShapes::Iterator anIt1 (aBSP.OverlapSubShapes1()); anIt1.More(); anIt1.Next()) {
+#if OCC_VERSION_LARGE > 0x06090000
+  for (BRepExtrema_MapOfIntegerPackedMapOfInteger::Iterator anIt1 (aBSP.OverlapSubShapes1()); anIt1.More(); anIt1.Next())
+#else
+  for (BRepExtrema_OverlappedSubShapes::Iterator anIt1 (aBSP.OverlapSubShapes1()); anIt1.More(); anIt1.Next())
+#endif
+  {
     const TopoDS_Shape& aS1 = aBSP.GetSubShape1(anIt1.Key());
     theIntersections1->Append(anIndices1.FindIndex(aS1));
   }
   
-  for (BRepExtrema_OverlappedSubShapes::Iterator anIt2 (aBSP.OverlapSubShapes2()); anIt2.More(); anIt2.Next()) {
+#if OCC_VERSION_LARGE > 0x06090000
+  for (BRepExtrema_MapOfIntegerPackedMapOfInteger::Iterator anIt2 (aBSP.OverlapSubShapes2()); anIt2.More(); anIt2.Next())
+#else
+  for (BRepExtrema_OverlappedSubShapes::Iterator anIt2 (aBSP.OverlapSubShapes2()); anIt2.More(); anIt2.Next())
+#endif
+  {
     const TopoDS_Shape& aS2 = aBSP.GetSubShape2(anIt2.Key());
     theIntersections2->Append(anIndices2.FindIndex(aS2));
   }
@@ -1661,8 +1760,6 @@ bool GEOMImpl_IMeasureOperations::FastIntersect (Handle(GEOM_Object) theShape1,
   if (aBSP.IsDone())
     SetErrorCode(OK);
 
-#endif // OCC_VERSION_LARGE > 0x06080000
-
   return isGood;
 }
 
index 3798af25eb4e9c779c95436c23c3259e26ac2e3e..72329c18d868bcfc8e41267517e30cabaaa6c06f 100644 (file)
@@ -80,8 +80,10 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
     SK_SEGMENT,      // segment
     SK_EDGE,         // other edge
     // VERTEX
-    SK_VERTEX,
+    SK_VERTEX,       // vertex
     // ADVANCED shapes
+    SK_LCS,          // local coordinate system
+    // (other advanced shapes)
     SK_ADVANCED,     // all advanced shapes (temporary implementation)
   };
 
@@ -158,6 +160,11 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
                                                const SICheckLevel  theCheckLevel,
                                                Handle(TColStd_HSequenceOfInteger)& theIntersections);
   
+  Standard_EXPORT bool CheckSelfIntersectionsFast (Handle(GEOM_Object) theShape,
+                                                  float  deflection, 
+                                                  double tolerance,
+                                                  Handle(TColStd_HSequenceOfInteger)& theIntersections);
+  
   Standard_EXPORT bool FastIntersect (Handle(GEOM_Object) theShape1, Handle(GEOM_Object) theShape2,
                                       double tolerance, float deflection,
                                       Handle(TColStd_HSequenceOfInteger)& theIntersections1,
index fc346c5f13d8359c1ccd921fec2634d133937f4d..3e0892f819baa00b4c7e991c26399213f7ee880a 100644 (file)
@@ -42,6 +42,7 @@
 #define PIPEDS_LIST_LOCATIONS  3
 #define PIPEDS_ARG_WITHCONTACT 4
 #define PIPEDS_ARG_WITHCORRECT 5
+#define PIPEDS_ARG_BY_STEPS    6
 
 // ---- GEOMImpl_IPipeShellSect
 #define PIPEDS_LIST_SUBBASES   6
index 902f0cf4d436aeb0ba1eafb50d23e5baac61e017..ad9b10db32b981c3dd760d50ec20bd514f13bce7 100644 (file)
@@ -73,6 +73,12 @@ class GEOMImpl_IPipeDiffSect : public GEOMImpl_IPipe
   int GetWithCorrectionMode()
   { return _func->GetInteger(PIPEDS_ARG_WITHCORRECT); }
 
+  void SetIsBySteps (int IsBySteps)
+  { _func->SetInteger(PIPEDS_ARG_BY_STEPS, IsBySteps); }
+
+  int GetIsBySteps()
+  { return _func->GetInteger(PIPEDS_ARG_BY_STEPS); }
+
 };
 
 #endif
old mode 100755 (executable)
new mode 100644 (file)
index 6503302..07f81f0
@@ -40,7 +40,7 @@
 
 #define ARG_LENGTH 11
 
-//#define ARG_FLAG 12
+#define ARG_USE_ORIENTATION 12
 
 class GEOMImpl_IPoint
 {
@@ -73,12 +73,13 @@ class GEOMImpl_IPoint
   void SetParameter(double theParam) { _func->SetReal(ARG_PARAM, theParam); }
   void SetParameter2(double theParam) { _func->SetReal(ARG_PARAM2, theParam); }
   void SetLength(double theLength) { _func->SetReal(ARG_LENGTH, theLength); }
-  //void SetReversed(bool theReversed)  { _func->SetInteger(ARG_FLAG, theReversed); }
+  void SetTakeOrientationIntoAccount(bool takeOrientationIntoAccount)
+        { _func->SetInteger(ARG_USE_ORIENTATION, takeOrientationIntoAccount); }
 
   double GetParameter() { return _func->GetReal(ARG_PARAM); }
   double GetParameter2() { return _func->GetReal(ARG_PARAM2); }
   double GetLength() { return _func->GetReal(ARG_LENGTH); }
-  //bool   GetReversed() { return _func->GetInteger(ARG_FLAG); }
+  bool   GetTakeOrientationIntoAccount() { return _func->GetInteger(ARG_USE_ORIENTATION); }
 
  private:
 
index a5162534e261c3bcde646cdb9e60681f40cefbdb..8e0dd2bb5a16d78ba4966e6260803128cc084a97 100644 (file)
@@ -28,6 +28,7 @@
 #define PROJCYL_ARG_RADIUS           2
 #define PROJCYL_ARG_START_ANGLE      3
 #define PROJCYL_ARG_ANGLE_LENGTH     4
+#define PROJCYL_ARG_ANGLE_ROTATION   5
 
 class GEOMImpl_IProjOnCyl
 {
@@ -36,14 +37,16 @@ public:
 
   GEOMImpl_IProjOnCyl(Handle(GEOM_Function) theFunction): _func(theFunction) {}
 
-  void SetShape       (const Handle(GEOM_Function) &theShape)
-          { _func->SetReference(PROJCYL_ARG_SHAPE,   theShape); }
-  void SetRadius      (const Standard_Real          theRadius)
-          { _func->SetReal(PROJCYL_ARG_RADIUS,       theRadius); }
-  void SetStartAngle  (const Standard_Real          theStartAngle)
-          { _func->SetReal(PROJCYL_ARG_START_ANGLE,  theStartAngle); }
-  void SetAngleLength (const Standard_Real          theAngleLength)
-          { _func->SetReal(PROJCYL_ARG_ANGLE_LENGTH, theAngleLength); }
+  void SetShape         (const Handle(GEOM_Function) &theShape)
+          { _func->SetReference(PROJCYL_ARG_SHAPE,     theShape); }
+  void SetRadius        (const Standard_Real          theRadius)
+          { _func->SetReal(PROJCYL_ARG_RADIUS,         theRadius); }
+  void SetStartAngle    (const Standard_Real          theStartAngle)
+          { _func->SetReal(PROJCYL_ARG_START_ANGLE,    theStartAngle); }
+  void SetAngleLength   (const Standard_Real          theAngleLength)
+          { _func->SetReal(PROJCYL_ARG_ANGLE_LENGTH,   theAngleLength); }
+  void SetAngleRotation (const Standard_Real          theAngleLength)
+          { _func->SetReal(PROJCYL_ARG_ANGLE_ROTATION, theAngleLength); }
 
   Handle(GEOM_Function) GetShape()
           { return _func->GetReference(PROJCYL_ARG_SHAPE); }
@@ -53,6 +56,8 @@ public:
           { return _func->GetReal(PROJCYL_ARG_START_ANGLE ); }
   Standard_Real         GetAngleLength()
           { return _func->GetReal(PROJCYL_ARG_ANGLE_LENGTH ); }
+  Standard_Real         GetAngleRotation()
+          { return _func->GetReal(PROJCYL_ARG_ANGLE_ROTATION ); }
 
  private:
 
index affb64b9c81492c67a5eafd1de99b9f626d8dd3c..65716670c9e393839fade61a8d9ac9b74a4c3655 100644 (file)
@@ -74,6 +74,7 @@
 #include <Geom_Plane.hxx>
 #include <Geom_SphericalSurface.hxx>
 #include <Geom_Surface.hxx>
+#include <Geom_TrimmedCurve.hxx>
 #include <Precision.hxx>
 #include <TColStd_HArray1OfInteger.hxx>
 #include <TDF_Tool.hxx>
@@ -690,8 +691,12 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceWithConstraints
       if ( aFace->GetValue().ShapeType() != TopAbs_FACE )
         // constraint face can be omitted - it is a valid case
         continue;
+      // Keep the old error code as IsSubShapeBelongsTo changes it.
+      TCollection_AsciiString anOldCode = GetErrorCode();
+
       if ( IsSubShapeBelongsTo( anObject, 0, aFace, 0 ) ) {
         // valid constraint
+        SetErrorCode(anOldCode);
         aRefSh = aFace->GetLastFunction();
         aConstraints->Append(aRefSh);
         it++;
@@ -2019,6 +2024,8 @@ Standard_Boolean GEOMImpl_IShapesOperations::IsSubShapeBelongsTo( Handle(GEOM_Ob
                                                                   Handle(GEOM_Object) theObject,
                                                                   const Standard_Integer theObjectIndex)
 {
+  SetErrorCode(KO);
+
   if ( theObject.IsNull() || theSubObject.IsNull() )
     return false;
 
@@ -2039,7 +2046,12 @@ Standard_Boolean GEOMImpl_IShapesOperations::IsSubShapeBelongsTo( Handle(GEOM_Ob
   }
 
   TopExp::MapShapes( shape, anIndices );
-  return anIndices.Contains( subShape );
+
+  const Standard_Boolean isBelongTo = anIndices.Contains(subShape);
+
+  SetErrorCode(OK);
+
+  return isBelongTo;
 }
 
 //=============================================================================
@@ -2615,7 +2627,7 @@ Handle(TColStd_HSequenceOfInteger)
   TopoDS_Shape aShape = theShape->GetValue();
 
   // Check presence of triangulation, build if need
-  if (!GEOMUtils::CheckTriangulation(aShape)) {
+  if (theShapeType != TopAbs_VERTEX && !GEOMUtils::CheckTriangulation(aShape)) {
     SetErrorCode("Cannot build triangulation on the shape");
     return aSeqOfIDs;
   }
@@ -2782,7 +2794,7 @@ Handle(TColStd_HSequenceOfInteger)
   TopTools_ListOfShape res;
 
   // Check presence of triangulation, build if need
-  if (!GEOMUtils::CheckTriangulation(aShape)) {
+  if (theShapeType != TopAbs_VERTEX && !GEOMUtils::CheckTriangulation(aShape)) {
     SetErrorCode("Cannot build triangulation on the shape");
     return aSeqOfIDs;
   }
@@ -3051,6 +3063,106 @@ Handle(TColStd_HSequenceOfTransient)
   return aSeq;
 }
 
+//=============================================================================
+/*!
+ *  GetSubShapesWithTolerance
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+    GEOMImpl_IShapesOperations::GetSubShapesWithTolerance
+                     (const Handle(GEOM_Object)            &theShape,
+                      const Standard_Integer                theShapeType,
+                      const GEOMUtils::ComparisonCondition  theCondition,
+                      const Standard_Real                   theTolerance)
+{
+  if (theShape.IsNull()) {
+    SetErrorCode("NULL GEOM object");
+    return NULL;
+  }
+
+  TopoDS_Shape aShape = theShape->GetValue();
+
+  if (aShape.IsNull()) {
+    SetErrorCode("NULL Shape");
+    return NULL;
+  }
+
+  if (theShapeType != TopAbs_FACE && theShapeType != TopAbs_EDGE &&
+      theShapeType != TopAbs_VERTEX && aShape.ShapeType() >= theShapeType) {
+    SetErrorCode("Invalid shape type");
+    return NULL;
+  }
+
+  TopTools_IndexedMapOfShape         anIndices;
+  TopTools_MapOfShape                aMapFence;
+  TopExp_Explorer                    anExp(aShape,
+                                           (TopAbs_ShapeEnum) theShapeType);
+  Handle(TColStd_HSequenceOfInteger) anIDs = new TColStd_HSequenceOfInteger;
+
+  TopExp::MapShapes(aShape, anIndices);
+
+  for (; anExp.More(); anExp.Next()) {
+    const TopoDS_Shape &aSubShape = anExp.Current();
+
+    if (aMapFence.Add(aSubShape)) {
+      // Compute tolerance
+      Standard_Real aTolerance = -1.;
+
+      switch (aSubShape.ShapeType()) {
+        case TopAbs_FACE:
+          aTolerance = BRep_Tool::Tolerance(TopoDS::Face(aSubShape));
+          break;
+        case TopAbs_EDGE:
+          aTolerance = BRep_Tool::Tolerance(TopoDS::Edge(aSubShape));
+          break;
+        case TopAbs_VERTEX:
+          aTolerance = BRep_Tool::Tolerance(TopoDS::Vertex(aSubShape));
+          break;
+        default:
+          break;
+      }
+
+      if (aTolerance < 0.) {
+        continue;
+      }
+
+      // Compare the tolerance with reference value.
+      if (GEOMUtils::IsFitCondition (theCondition, aTolerance, theTolerance)) {
+        anIDs->Append(anIndices.FindIndex(aSubShape));
+      }
+    }
+  }
+
+  if (anIDs->IsEmpty()) {
+    SetErrorCode("Empty sequence of sub-shapes");
+    return NULL;
+  }
+
+  // Get objects by indices.
+  TCollection_AsciiString              anAsciiList;
+  Handle(TColStd_HSequenceOfTransient) aSeq =
+    getObjectsShapesOn(theShape, anIDs, 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.GetSubShapesWithTolerance("
+    << theShape << ", " << theShapeType << ", " << theCondition << ", "
+    << theTolerance << ")";
+
+  SetErrorCode(OK);
+
+  return aSeq;
+}
+
 //=======================================================================
 //function : getShapesOnSurfaceIDs
   /*!
@@ -3071,7 +3183,8 @@ Handle(TColStd_HSequenceOfInteger)
   Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
 
   // Check presence of triangulation, build if need
-  if (!GEOMUtils::CheckTriangulation(theShape)) {
+  if (theShapeType != TopAbs_VERTEX &&
+      !GEOMUtils::CheckTriangulation(theShape)) {
     SetErrorCode("Cannot build triangulation on the shape");
     return aSeqOfIDs;
   }
@@ -3997,7 +4110,7 @@ Handle(TColStd_HSequenceOfInteger)
   Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
 
   // Check presence of triangulation, build if need
-  if (!GEOMUtils::CheckTriangulation(aShape)) {
+  if (theShapeType != TopAbs_VERTEX && !GEOMUtils::CheckTriangulation(aShape)) {
     SetErrorCode("Cannot build triangulation on the shape");
     return aSeqOfIDs;
   }
@@ -4223,16 +4336,28 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
   const TopoDS_Shape         &aShapeResult = aGIP.Result();
   TopTools_MapOfShape         aMFence;
   TopTools_IndexedMapOfShape  aWhereIndices;
+  Standard_Integer            aShapeType = -1;
 
   TopExp::MapShapes(aWhere, aWhereIndices);
 
   if (aShapeResult.IsNull() == Standard_False) {
-    TopoDS_Iterator anIt(aShapeResult);
+    TopoDS_Iterator  anIt(aShapeResult);
+    Standard_Boolean isFirst = Standard_True;
 
     for (; anIt.More(); anIt.Next()) {
       const TopoDS_Shape &aPart = anIt.Value();
 
       if(aWhereIndices.Contains(aPart) && aMFence.Add(aPart)) {
+        const TopAbs_ShapeEnum aType = aPart.ShapeType();
+
+        if (aShapeType == -1) {
+          // Initialization.
+          aShapeType = aType;
+        } else if (aShapeType != TopAbs_SHAPE && aShapeType != aType) {
+          // Different types.
+          aShapeType = TopAbs_SHAPE;
+        }
+
         aLSA.Append(aPart);
       }
     }
@@ -4246,13 +4371,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
   Handle(TColStd_HArray1OfInteger) aModifiedArray = new TColStd_HArray1OfInteger (1, aLSA.Extent());
   TopTools_ListIteratorOfListOfShape anIterModif (aLSA);
   for (Standard_Integer imod = 1; anIterModif.More(); anIterModif.Next(), imod++) {
-    if (aWhereIndices.Contains(anIterModif.Value())) {
-      aModifiedArray->SetValue(imod, aWhereIndices.FindIndex(anIterModif.Value()));
-    }
-    else {
-      SetErrorCode("Error: wrong sub-shape returned");
-      return NULL;
-    }
+    aModifiedArray->SetValue(imod, aWhereIndices.FindIndex(anIterModif.Value()));
   }
 
   //Add a new object
@@ -4262,7 +4381,10 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
     return NULL;
   }
 
-  if (aModifiedArray->Length() > 1 || theShapeWhat->GetType() == GEOM_GROUP) {
+  const Standard_Boolean isSameType = (aShapeType != TopAbs_SHAPE);
+
+  if ((aModifiedArray->Length() > 1 && isSameType) ||
+      theShapeWhat->GetType() == GEOM_GROUP) {
     //Set a GROUP type
     aResult->SetType(GEOM_GROUP);
 
@@ -4331,10 +4453,20 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceOld
     new TColStd_HArray1OfInteger (1, aModifiedList.Extent());
   TopTools_ListIteratorOfListOfShape anIterModif (aModifiedList);
   Standard_Integer                   imod;
+  Standard_Integer                   aShapeType = -1;
 
   for (imod = 1; anIterModif.More(); anIterModif.Next(), imod++) {
     const Standard_Integer anIndex =
       aWhereIndices.FindIndex(anIterModif.Value());
+    const TopAbs_ShapeEnum aType   = anIterModif.Value().ShapeType();
+
+    if (aShapeType == -1) {
+      // Initialization.
+      aShapeType = aType;
+    } else if (aShapeType != TopAbs_SHAPE && aShapeType != aType) {
+      // Different types.
+      aShapeType = TopAbs_SHAPE;
+    }
 
     aModifiedArray->SetValue(imod, anIndex);
   }
@@ -4348,7 +4480,10 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceOld
     return NULL;
   }
 
-  if (aModifiedArray->Length() > 1 || theShapeWhat->GetType() == GEOM_GROUP) {
+  const Standard_Boolean isSameType = (aShapeType != TopAbs_SHAPE);
+
+  if ((aModifiedArray->Length() > 1 && isSameType) ||
+      theShapeWhat->GetType() == GEOM_GROUP) {
     //Set a GROUP type
     aResult->SetType(GEOM_GROUP);
 
@@ -4406,40 +4541,27 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceByHistory
     return NULL;
   }
 
-  Standard_Integer nbFound = aModifiedList.Extent();
+  Handle(TColStd_HArray1OfInteger)   aModifiedArray =
+    new TColStd_HArray1OfInteger (1, aModifiedList.Extent());
   TopTools_ListIteratorOfListOfShape anIterModif (aModifiedList);
-  if ( nbFound > 1 )
-  {
-    // remove sub-shapes inappropriate for group creation
-    TopAbs_ShapeEnum subType = TopAbs_SHAPE;
-    while ( anIterModif.More() ) {
-      TopAbs_ShapeEnum type = anIterModif.Value().ShapeType();
-      bool okForGroup = ( type == TopAbs_VERTEX || type == TopAbs_EDGE ||
-                          type == TopAbs_FACE   || type == TopAbs_SOLID );
-      if ( okForGroup ) {
-        if ( subType == TopAbs_SHAPE )
-          subType = type;
-        else
-          okForGroup = ( subType == type );
-      }
-      if ( okForGroup )
-        anIterModif.Next();
-      else
-        aModifiedList.Remove( anIterModif );
-      nbFound -= ( !okForGroup );
-    }
-    if ( nbFound == 0 ) {
-      SetErrorCode("Error: result found but it's type is inappropriate for group creation.");
-      return NULL;
+  Standard_Integer                   imod;
+  Standard_Integer                   aShapeType = -1;
+
+  for (imod = 1; anIterModif.More(); anIterModif.Next(), imod++) {
+    const Standard_Integer anIndex =
+      aWhereIndices.FindIndex(anIterModif.Value());
+    const TopAbs_ShapeEnum aType   = anIterModif.Value().ShapeType();
+
+    if (aShapeType == -1) {
+      // Initialization.
+      aShapeType = aType;
+    } else if (aShapeType != TopAbs_SHAPE && aShapeType != aType) {
+      // Different types.
+      aShapeType = TopAbs_SHAPE;
     }
-  }
 
-  Handle(TColStd_HArray1OfInteger) aModifiedArray =
-    new TColStd_HArray1OfInteger( 1, nbFound );
-  anIterModif.Initialize(aModifiedList);
-  for (Standard_Integer imod = 1; anIterModif.More(); anIterModif.Next(), imod++)
-    aModifiedArray->SetValue
-        (imod, aWhereIndices.FindIndex(anIterModif.Value()));
+    aModifiedArray->SetValue(imod, anIndex);
+  }
 
   //Add a new object
   Handle(GEOM_Object) aResult = GetEngine()->AddSubShape(theShapeWhere, aModifiedArray);
@@ -4448,7 +4570,10 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceByHistory
     return NULL;
   }
 
-  if (aModifiedArray->Length() > 1) {
+  const Standard_Boolean isSameType = (aShapeType != TopAbs_SHAPE);
+
+  if ((aModifiedArray->Length() > 1 && isSameType) ||
+      theShapeWhat->GetType() == GEOM_GROUP) {
     //Set a GROUP type
     aResult->SetType(GEOM_GROUP);
 
@@ -4512,6 +4637,8 @@ static bool isSameEdge(const TopoDS_Edge& theEdge1, const TopoDS_Edge& theEdge2)
   U = U11+range*2.0/3.0;
   gp_Pnt P2 = C1->Value(U);     //Compute a point on two thirds of the edge's length
 
+  C2 = new Geom_TrimmedCurve(C2, U21, U22);
+
   if(!GeomLib_Tool::Parameter(C2, P1, MAX_TOLERANCE, U) ||  U < U21 || U > U22)
     return false;
 
index 795a55d1b0af24729adb3aca433db0cca6aef022..d8e4f9fb21606071fd9146a6282c088ddf210850 100644 (file)
@@ -33,6 +33,7 @@
 #include "GEOM_IOperations.hxx"
 
 #include "GEOMAlgo_State.hxx"
+#include "GEOMUtils.hxx"
 
 #include <TColStd_HSequenceOfTransient.hxx>
 #include <TColStd_HSequenceOfInteger.hxx>
@@ -448,6 +449,27 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
     GetSubShapeEdgeSorted (const Handle(GEOM_Object) &theShape,
                            const Handle(GEOM_Object) &theStartPoint);
 
+  /*!
+   * \brief Return the list of subshapes that satisfies a certain tolerance
+   * criterion. The user defines the type of shapes to be returned, the
+   * condition and the tolerance value. The operation is defined for
+   * faces, edges and vertices only. E.g. for theShapeType FACE, theCondition
+   * CC_GT and theTolerance 1.e-7 this method returns all faces of theShape
+   * that have tolerances greater then 1.e7.
+   *
+   * \param theShape the shape to be exploded
+   * \param theShapeType the type of shapes to be returned. Can have the
+   *        values FACE, EDGE and VERTEX only.
+   * \param theCondition the condition type.
+   * \param theTolerance the tolerance filter.
+   * \return the list of shapes that satisfy the conditions.
+   */
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetSubShapesWithTolerance
+                     (const Handle(GEOM_Object)            &theShape,
+                      const Standard_Integer                theShapeType,
+                      const GEOMUtils::ComparisonCondition  theCondition,
+                      const Standard_Real                   theTolerance);
+
  private:
   Handle(GEOM_Object) MakeShape (std::list<Handle(GEOM_Object)>      theShapes,
                                  const Standard_Integer         theObjectType,
index 5d89b0c0ac6630c535678e5ad0a9ea6f2902de25..6cc2010005f1dba1f424b5ea6a8d6a7b440c2c52 100644 (file)
@@ -218,7 +218,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateTwoPointsCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a translate function
   Handle(GEOM_Function) aFunction =
@@ -271,7 +271,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateDXDYDZCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a translate function
   Handle(GEOM_Function) aFunction =
@@ -376,7 +376,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateVectorCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a translate function
   Handle(GEOM_Function) aFunction =
@@ -807,7 +807,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPlaneCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a mirror function
   Handle(GEOM_Function) aFunction =
@@ -910,7 +910,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPointCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a mirror function
   Handle(GEOM_Function) aFunction =
@@ -1013,7 +1013,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorAxisCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a mirror function
   Handle(GEOM_Function) aFunction =
@@ -1114,7 +1114,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShapeCopy
   if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be offset
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a new Offset function
   Handle(GEOM_Function) aFunction =
@@ -1364,7 +1364,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShapeCopy
   if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be scaled
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a scale function
   Handle(GEOM_Function) aFunction =
@@ -1555,7 +1555,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionShapeCopy
   if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be set in position
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a position function
   Standard_Integer aType = POSITION_SHAPE_COPY;
@@ -1734,7 +1734,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateCopy (Handle(GEOM_Objec
   if (aLastFunction.IsNull()) return NULL;  //There is no function which creates an object to be rotated
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a rotate function
   aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_COPY);
@@ -2088,7 +2088,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateThreePointsCopy (Handle
   if (aLastFunction.IsNull()) return NULL;  //There is no function which creates an object to be rotated
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a rotate function
   aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_THREE_POINTS_COPY);
@@ -2145,7 +2145,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TransformLikeOtherCopy
   if (aSampleFunc.IsNull()) return NULL; // There is no function which creates a sample object
 
   // Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   // Add a transform function (depends on theSample function)
   Handle(GEOM_Function) aFunction =
@@ -2278,7 +2278,8 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MakeProjectionOnCylinder
                              (const Handle(GEOM_Object) &theObject,
                               const Standard_Real        theRadius,
                               const Standard_Real        theStartAngle,
-                              const Standard_Real        theAngleLength)
+                              const Standard_Real        theAngleLength,
+                              const Standard_Real        theAngleRotation)
 {
   SetErrorCode(KO);
 
@@ -2312,6 +2313,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MakeProjectionOnCylinder
   aProj.SetRadius(theRadius);
   aProj.SetStartAngle(theStartAngle);
   aProj.SetAngleLength(theAngleLength);
+  aProj.SetAngleRotation(theAngleRotation);
 
   //Compute the Projection
   try {
@@ -2328,16 +2330,10 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MakeProjectionOnCylinder
   }
 
   //Make a Python command
-  GEOM::TPythonDump pd(aFunction);
-
-  pd << aResult << " = geompy.MakeProjectionOnCylinder("
-     << theObject << ", " << theRadius << ", " << theStartAngle;
-
-  if (theAngleLength >= 0.) {
-    pd << ", " << theAngleLength;
-  }
-
-   pd << ")";
+  GEOM::TPythonDump(aFunction)
+    << aResult << " = geompy.MakeProjectionOnCylinder("
+    << theObject << ", " << theRadius << ", " << theStartAngle
+    << ", " << theAngleLength << ", " << theAngleRotation << ")";
 
   SetErrorCode(OK);
 
index 155dbfdd9f1379f229bc572aaef4038cd6b9d4e5..3742157bf7e387567700a9ab61e8286945ebd64a 100644 (file)
@@ -195,7 +195,8 @@ class GEOMImpl_ITransformOperations : public GEOM_IOperations
                              (const Handle(GEOM_Object) &theObject,
                               const Standard_Real        theRadius,
                               const Standard_Real        theStartAngle,
-                              const Standard_Real        theAngleLength);
+                              const Standard_Real        theAngleLength,
+                              const Standard_Real        theAngleRotation);
 
 };
 
index 31f53f8733646d575ccde04cd27e3d70967bc88f..ef5b07e7943a51d232e5e7aa9ed7e7a13bcdebf7 100644 (file)
 #include <BRep_Builder.hxx>
 #include <BRepBuilderAPI_Copy.hxx>
 #include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRepBuilderAPI_MakeSolid.hxx>
 #include <BRepBuilderAPI_MakeWire.hxx>
 #include <BRepBuilderAPI_Sewing.hxx>
+#include <BRepClass3d_SolidClassifier.hxx>
 #include <BRepGProp.hxx>
 #include <GeomFill_Trihedron.hxx>
 #include <GeomFill_CorrectedFrenet.hxx>
 #define GROUP_SIDE2 3
 #define GROUP_OTHER 4
 
+static const Standard_Real TolPipeSurf = 5.e-4;
+
 static bool FillGroups(const TopTools_SequenceOfShape         *theGroups,
                        const TopTools_IndexedMapOfShape       &theIndices,
                              Handle(TColStd_HArray1OfInteger) *theGroupIds);
@@ -180,7 +184,8 @@ static Standard_Boolean BuildPipeShell(BRepOffsetAPI_MakePipeShell &theBuilder)
 
   Standard_Boolean isDone = theBuilder.IsDone();
 
-  if (!isDone) {
+  if (!isDone ||
+      theBuilder.ErrorOnSurface() > TolPipeSurf) {
     // Try to use Descrete Trihedron mode.
     theBuilder.SetDiscreteMode();
     theBuilder.Build();
@@ -686,6 +691,42 @@ static void FindFirstPairFaces(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
   FS2 = Fs(numface);
 }
 
+//=======================================================================
+//function : RemoveFaces
+//purpose  : This function returns theShapeFrom without faces of the shape
+//           theFacesToRm. It returns a shell if theShapeFrom is a solid or
+//           a compound otherwise. Auxilary for CreatePipeWithDifferentSections
+//           method.
+//=======================================================================
+static TopoDS_Shape RemoveFaces(const TopoDS_Shape &theShapeFrom,
+                                const TopoDS_Shape &theFacesToRm)
+{
+  TopTools_IndexedMapOfShape aMapFaces;
+  TopExp_Explorer            anExp(theShapeFrom, TopAbs_FACE);
+  BRep_Builder               aBuilder;
+  TopoDS_Shape               aResult;
+
+  if (theShapeFrom.ShapeType() == TopAbs_SOLID) {
+    // Create shell
+    aBuilder.MakeShell(TopoDS::Shell(aResult));
+  } else {
+    // Create compound
+    aBuilder.MakeCompound(TopoDS::Compound(aResult));
+  }
+
+  TopExp::MapShapes(theFacesToRm, TopAbs_FACE, aMapFaces);
+
+  for (; anExp.More(); anExp.Next()) {
+    const TopoDS_Shape &aFace = anExp.Current();
+
+    if (!aMapFaces.Contains(aFace)) {
+      aBuilder.Add(aResult, aFace);
+    }
+  }
+
+  return aResult;
+}
+
 //=======================================================================
 //function : CreatePipeWithDifferentSections
 //purpose  :
@@ -696,6 +737,7 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
                    const Handle(TopTools_HSequenceOfShape)  theHSeqLocs,
                    const Standard_Boolean                   theWithContact,
                    const Standard_Boolean                   theWithCorrect,
+                   const Standard_Boolean                   IsBySteps,
                          Handle(TColStd_HArray1OfInteger)  *theGroups)
 {
   TopoDS_Shape aShape;
@@ -883,49 +925,82 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
     }
   }
 
-  // check curvature of wire for condition that
-  // max summary angle between directions along
-  // wire path must be < 4*PI. If not - split wire
-  // and seguences of shapes, perform pipe for each
-  // and make sewing after that
-  double fp,lp;
-  gp_Pnt P1,P2;
-  gp_Vec Vec1,Vec2;
-  double SumAng = 0;
-  if ( Edges.Length() > 0 ) {
-    Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(Edges.Value(1)),fp,lp);
-    C->D1(fp,P1,Vec1);
-    C->D1(lp,P2,Vec2);
-    SumAng = fabs(Vec1.Angle(Vec2));
-    Vec1 = Vec2;
-    P1 = P2;
-  }
   TColStd_SequenceOfInteger SplitEdgeNums,SplitLocNums;
-  int LastLoc = 1;
-  //cout<<"Edges.Length()="<<Edges.Length()<<endl;
-  for (i=2; i<=Edges.Length(); i++) {
-      TopoDS_Edge edge = TopoDS::Edge(Edges.Value(i));
-      double tol = BRep_Tool::Tolerance(edge);
-      Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
-      C->D1(lp,P2,Vec2);
-      double ang = fabs(Vec1.Angle(Vec2));
-      SumAng += ang;
-      if (SumAng>4*M_PI) {
-        SumAng = ang;
-        SplitEdgeNums.Append(i-1);
-        int j;
-        for (j=LastLoc+1; j<=aSeqLocs.Length(); j++) {
-          TopoDS_Vertex aVert = TopoDS::Vertex(aSeqLocs.Value(j));
-          gp_Pnt P = BRep_Tool::Pnt(aVert);
-          if (P1.Distance(P) < tol) {
-            SplitLocNums.Append(j);
-            LastLoc = j;
-            break;
-          }
+
+  if (IsBySteps) {
+    // Fill SplitEdgeNums and SplitLocNums with intermediate location indices
+    // and corresponding edge indices.
+    Standard_Integer i = 1;
+    Standard_Integer j;
+    TopoDS_Vertex    aVert;
+    gp_Pnt           aP;
+
+    for (j = 2; j < aSeqLocs.Length(); j++) {
+      SplitLocNums.Append(j);
+      aVert = TopoDS::Vertex(aSeqLocs.Value(j));
+      aP    = BRep_Tool::Pnt(aVert);
+
+      while (i < Edges.Length()) {
+        Standard_Real      aFp;
+        Standard_Real      aLp;
+        TopoDS_Edge        anEdge = TopoDS::Edge(Edges.Value(i));
+        Standard_Real      aTol   = BRep_Tool::Tolerance(anEdge);
+        Handle(Geom_Curve) aC     = BRep_Tool::Curve(anEdge, aFp, aLp);
+        gp_Pnt             aPLast;
+
+        aC->D0(aLp, aPLast);
+        i++;
+
+        if (aP.Distance(aPLast) < aTol) {
+          SplitEdgeNums.Append(i - 1);
+          break;
         }
       }
+    }
+  } else {
+    // check curvature of wire for condition that
+    // max summary angle between directions along
+    // wire path must be < 4*PI. If not - split wire
+    // and seguences of shapes, perform pipe for each
+    // and make sewing after that
+    double fp,lp;
+    gp_Pnt P1,P2;
+    gp_Vec Vec1,Vec2;
+    double SumAng = 0;
+    if ( Edges.Length() > 0 ) {
+      Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(Edges.Value(1)),fp,lp);
+      C->D1(fp,P1,Vec1);
+      C->D1(lp,P2,Vec2);
+      SumAng = fabs(Vec1.Angle(Vec2));
       Vec1 = Vec2;
       P1 = P2;
+    }
+    int LastLoc = 1;
+    //cout<<"Edges.Length()="<<Edges.Length()<<endl;
+    for (i=2; i<=Edges.Length(); i++) {
+        TopoDS_Edge edge = TopoDS::Edge(Edges.Value(i));
+        double tol = BRep_Tool::Tolerance(edge);
+        Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+        C->D1(lp,P2,Vec2);
+        double ang = fabs(Vec1.Angle(Vec2));
+        SumAng += ang;
+        if (SumAng>4*M_PI) {
+          SumAng = ang;
+          SplitEdgeNums.Append(i-1);
+          int j;
+          for (j=LastLoc+1; j<=aSeqLocs.Length(); j++) {
+            TopoDS_Vertex aVert = TopoDS::Vertex(aSeqLocs.Value(j));
+            gp_Pnt P = BRep_Tool::Pnt(aVert);
+            if (P1.Distance(P) < tol) {
+              SplitLocNums.Append(j);
+              LastLoc = j;
+              break;
+            }
+          }
+        }
+        Vec1 = Vec2;
+        P1 = P2;
+    }
   }
 
   bool isCreateGroups = (theGroups != NULL);
@@ -966,9 +1041,24 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
           Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
         }
 
-        BuildPipeShell(aBuilder);
+        Standard_Boolean isDone = BuildPipeShell(aBuilder);
+
+        if (isDone && NeedCreateSolid && nn == 1) {
+          // Make solid for the first step.
+          isDone = aBuilder.MakeSolid();
+        }
+
+        if (!isDone) {
+          Standard_ConstructionError::Raise("Pipe construction failure");
+        }
 
         TopoDS_Shape resShape = aBuilder.Shape();
+
+        if (NeedCreateSolid && nn == 1) {
+          // Remove top lid from the result.
+          resShape = RemoveFaces(resShape, aBuilder.LastShape());
+        }
+
         aSeqRes.Append(resShape);
 
         // Create groups.
@@ -1014,9 +1104,23 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
         Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
       }
 
-      BuildPipeShell(aBuilder);
+      Standard_Boolean isDone = BuildPipeShell(aBuilder);
+
+      if (isDone && NeedCreateSolid) {
+        isDone = aBuilder.MakeSolid();
+      }
+
+      if (!isDone) {
+        Standard_ConstructionError::Raise("Pipe construction failure");
+      }
 
       TopoDS_Shape resShape = aBuilder.Shape();
+
+      if (NeedCreateSolid) {
+        // Remove bottom lid from the result.
+        resShape = RemoveFaces(resShape, aBuilder.FirstShape());
+      }
+
       aSeqRes.Append(resShape);
 
       // Create groups.
@@ -1046,6 +1150,28 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
       aSewing->Perform();
       aShape = aSewing->SewedShape();
 
+      if (NeedCreateSolid && aShape.ShapeType() == TopAbs_SHELL) {
+        // Build a solid.
+        BRepBuilderAPI_MakeSolid aMkSolid;
+
+        aMkSolid.Add(TopoDS::Shell(aShape));
+
+        if (!aMkSolid.IsDone()) {
+          Standard_ConstructionError::Raise("Can't create solid pipe");
+        }
+
+        TopoDS_Solid                aSolid = aMkSolid.Solid();
+        BRepClass3d_SolidClassifier aSC(aSolid);
+
+        aSC.PerformInfinitePoint(Precision::Confusion());
+
+        if (aSC.State() == TopAbs_IN) {
+          aShape = aSolid.Reversed();
+        } else {
+          aShape = aSolid;
+        }
+      }
+
       if (isCreateGroups) {
         // Replase Group shapes by modified ones.
         TopTools_SequenceOfShape aSeqGroups[5];
@@ -3001,7 +3127,7 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
       GeomFill_Trihedron theBestMode = EvaluateBestSweepMode(aWirePath);
       BRepOffsetAPI_MakePipe aMkPipe(aWirePath, aShapeBase, theBestMode);
 
-      if (aMkPipe.IsDone()) {
+      if (aMkPipe.IsDone() && aMkPipe.ErrorOnSurface() <= TolPipeSurf) {
         aShape = aMkPipe.Shape();
 
         if (!CreateGroups(aShapeBase, aWirePath, aMkPipe, aCI)) {
@@ -3032,6 +3158,7 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
     Handle(TColStd_HSequenceOfTransient) aLocObjs = aCIDS->GetLocations ();
     Standard_Boolean aWithContact = (aCIDS->GetWithContactMode());
     Standard_Boolean aWithCorrect = (aCIDS->GetWithCorrectionMode());
+    Standard_Boolean isBySteps = aCIDS->GetIsBySteps();
 
     if (aCI) {
       delete aCI;
@@ -3079,7 +3206,7 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
 
     aShape = CreatePipeWithDifferentSections
               (aWirePath, aHSeqBases, aHSeqLocs,
-               aWithContact, aWithCorrect, pGroups);
+               aWithContact, aWithCorrect, isBySteps, pGroups);
 
     if (isGenerateGroups) {
       // Store created groups.
@@ -3265,8 +3392,13 @@ GetCreationInformation(std::string&             theOperationName,
     AddParam( theParams, "Bases", aCI.GetBases() );
     AddParam( theParams, "Locations", aCI.GetLocations() );
     AddParam( theParams, "Path", aCI.GetPath() );
-    AddParam( theParams, "With contact", aCI.GetWithContactMode() );
-    AddParam( theParams, "With correction", aCI.GetWithCorrectionMode() );
+
+    if (!aCI.GetIsBySteps()) {
+      AddParam( theParams, "With contact", aCI.GetWithContactMode() );
+      AddParam( theParams, "With correction", aCI.GetWithCorrectionMode() );
+    }
+
+    AddParam( theParams, "Step by step", aCI.GetIsBySteps() );
     break;
   }
   case PIPE_SHELL_SECTIONS:
index 3a4deca6feed0c44274f19ca92fc2dc5a34a5a3f..7675369469e974b071a688c8235522e8e365141a 100644 (file)
@@ -88,6 +88,7 @@ public:
                    const Handle(TopTools_HSequenceOfShape)  theLocs,
                    const Standard_Boolean                   theWithContact,
                    const Standard_Boolean                   theWithCorrect,
+                   const Standard_Boolean                   IsBySteps,
                          Handle(TColStd_HArray1OfInteger)  *theGroups = NULL);
 
   Standard_EXPORT virtual
index 03edfc4c1bef3c6f2a85dc1724d017b8cbc41a0e..f80ba42b986d9cf384d24c537f849386a3c4b76c 100644 (file)
@@ -145,7 +145,14 @@ Standard_Integer GEOMImpl_PointDriver::Execute(TFunction_Logbook& log) const
     Standard_Real aFP, aLP, aP;
     Handle(Geom_Curve) aCurve = BRep_Tool::Curve(TopoDS::Edge(aRefShape), aFP, aLP);
     if ( !aCurve.IsNull() ) {
-      aP = aFP + (aLP - aFP) * aPI.GetParameter();
+      if (aPI.GetTakeOrientationIntoAccount() &&
+          aRefShape.Orientation() == TopAbs_REVERSED) {
+        aP = 1. - aPI.GetParameter();
+      } else {
+        aP = aPI.GetParameter();
+      }
+
+      aP = aFP + (aLP - aFP) * aP;
       aPnt = aCurve->Value(aP);
     }
     else {
@@ -393,6 +400,7 @@ GetCreationInformation(std::string&             theOperationName,
   case POINT_CURVE_PAR:
     AddParam( theParams, "Edge", aCI.GetCurve() );
     AddParam( theParams, "Parameter", aCI.GetParameter() );
+    AddParam( theParams, "Use Orientation", aCI.GetTakeOrientationIntoAccount() );
     break;
   case POINT_CURVE_COORD:
     AddParam( theParams, "X", aCI.GetX() );
index 52f6d21092126981c0e0a40ea4701018eff7af49..48e5353ea0989379389548146902734337606ac3 100644 (file)
@@ -351,7 +351,8 @@ TopoDS_Shape GEOMImpl_PrismDriver::MakeScaledPrism (const TopoDS_Shape& theShape
   aLocs->Append(aShapeCDG_1);
   aLocs->Append(aShapeCDG_2);
 
-  aShape = GEOMImpl_PipeDriver::CreatePipeWithDifferentSections(aWirePath, aBases, aLocs, false, false);
+  aShape = GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
+              (aWirePath, aBases, aLocs, false, false, false);
 
   // 7. Make a solid, if possible
   if (theShapeBase.ShapeType() == TopAbs_FACE) {
index 0c34bc8c26570c689a3dc37fbcb9bb5dc3b0b483..db0fae3496395fbd10559987dc381c6985eeeb17 100644 (file)
@@ -33,6 +33,8 @@
 #include <GEOMUtils_HTrsfCurve2d.hxx>
 
 #include <Approx_Curve2d.hxx>
+#include <Bnd_Box2d.hxx>
+#include <BndLib_Add2dCurve.hxx>
 #include <BRep_Tool.hxx>
 #include <BRepAdaptor_Curve2d.hxx>
 #include <BRepBuilderAPI_Transform.hxx>
@@ -428,10 +430,11 @@ Standard_Integer GEOMImpl_ProjectionDriver::Execute(TFunction_Logbook& log) cons
     }
 
     // Get the face.
-    const TopAbs_ShapeEnum aType        = aShape.ShapeType();
-    const Standard_Real    aRadius      = aProj.GetRadius();
-    const Standard_Real    aStartAngle  = aProj.GetStartAngle();
-    const Standard_Real    aLengthAngle = aProj.GetAngleLength();
+    const TopAbs_ShapeEnum aType          = aShape.ShapeType();
+    const Standard_Real    aRadius        = aProj.GetRadius();
+    const Standard_Real    aStartAngle    = aProj.GetStartAngle();
+    const Standard_Real    aLengthAngle   = aProj.GetAngleLength();
+    const Standard_Real    aRotationAngle = aProj.GetAngleRotation();
 
     if (aType != TopAbs_WIRE && aType != TopAbs_FACE) {
       return 0;
@@ -441,8 +444,8 @@ Standard_Integer GEOMImpl_ProjectionDriver::Execute(TFunction_Logbook& log) cons
       return 0;
     }
 
-    TopoDS_Shape aProjShape =
-      projectOnCylinder(aShape, aRadius, aStartAngle, aLengthAngle);
+    TopoDS_Shape aProjShape = projectOnCylinder
+      (aShape, aRadius, aStartAngle, aLengthAngle, aRotationAngle);
 
     if (aProjShape.IsNull()) {
       return 0;
@@ -504,6 +507,8 @@ GetCreationInformation(std::string&             theOperationName,
       AddParam(theParams, "Length angle", aLengthAngle);
     }
 
+    AddParam(theParams, "Rotation angle", aProj.GetAngleRotation());
+
     break;
   }
   default:
@@ -523,7 +528,8 @@ TopoDS_Shape GEOMImpl_ProjectionDriver::projectOnCylinder
                                 (const TopoDS_Shape  &theShape,
                                  const Standard_Real  theRadius,
                                  const Standard_Real  theStartAngle,
-                                 const Standard_Real  theAngleLength) const
+                                 const Standard_Real  theAngleLength,
+                                 const Standard_Real  theAngleRotation) const
 {
   TopoDS_Shape aResult;
 
@@ -596,8 +602,6 @@ TopoDS_Shape GEOMImpl_ProjectionDriver::projectOnCylinder
 
   // Compute 2d translation transformation.
   TopoDS_Wire            anOuterWire = BRepTools::OuterWire(aFace);
-  Standard_Real          aU[2];
-  Standard_Real          aV[2];
   BRepTools_WireExplorer aOWExp(anOuterWire, aFace);
 
   if (!aOWExp.More()) {
@@ -605,21 +609,63 @@ TopoDS_Shape GEOMImpl_ProjectionDriver::projectOnCylinder
     return aResult;
   }
 
-  // Compute anisotropic transformation from a face's 2d space
-  // to cylinder's 2d space.
-  BRepTools::UVBounds(aFace, anOuterWire, aU[0], aU[1], aV[0], aV[1]);
-
+  // Rotate 2D presentation of face.
   TopoDS_Vertex       aFirstVertex = aOWExp.CurrentVertex();
   TopoDS_Edge         aFirstEdge   = aOWExp.Current();
   gp_Pnt              aPnt         = BRep_Tool::Pnt(aFirstVertex);
   BRepAdaptor_Curve2d anAdaptorCurve(aFirstEdge, aFace);
   Standard_Real       aParam       =
     BRep_Tool::Parameter(aFirstVertex, aFirstEdge, aFace);
-  gp_Pnt2d            aPntUV       = anAdaptorCurve.Value(aParam);
+  gp_Pnt2d            aPntUV;
+  gp_Vec2d            aVecUV;
+  gp_Vec2d            aVecU0(1., 0);
+
+  anAdaptorCurve.D1(aParam, aPntUV, aVecUV);
+
+  if (aVecUV.Magnitude() <= gp::Resolution()) {
+    return aResult;
+  }
+
+  if (aFirstEdge.Orientation() == TopAbs_REVERSED) {
+    aVecUV.Reverse();
+  }
+
+  const Standard_Real    anAngle    = aVecUV.Angle(aVecU0) + theAngleRotation;
+  const Standard_Boolean isToRotate = Abs(anAngle) > Precision::Angular();
+  gp_Trsf2d              aRotTrsf;
+  Bnd_Box2d              aUVBox;
+  Standard_Real          aPar[2];
 
+  if (isToRotate) {
+    aRotTrsf.SetRotation(aPntUV, anAngle);
+  }
+
+  for (; aOWExp.More(); aOWExp.Next()) {
+    TopoDS_Edge                 anEdge   = aOWExp.Current();
+    Handle(Geom2d_Curve)        aCurve   =
+        BRep_Tool::CurveOnSurface(anEdge, aFace, aPar[0], aPar[1]);
+
+    if (aCurve.IsNull()) {
+      continue;
+    }
+
+    if (isToRotate) {
+      aCurve = Handle(Geom2d_Curve)::DownCast(aCurve->Transformed(aRotTrsf));
+    }
+
+    BndLib_Add2dCurve::Add(aCurve, aPar[0], aPar[1], 0., aUVBox);
+  }
+
+  Standard_Real aU[2];
+  Standard_Real aV[2];
+
+  aUVBox.Get(aU[0], aV[0], aU[1], aV[1]);
+
+  // Compute anisotropic transformation from a face's 2d space
+  // to cylinder's 2d space.
   GEOMUtils::Trsf2d aTrsf2d
             (1./theRadius, 0., theStartAngle - aU[0]/theRadius,
-             0.,           1., aPnt.Z() - 0.5*(aV[1] - aV[0]) - aPntUV.Y());
+             0.,           1., aPnt.Z() - aPntUV.Y());
 
   // Compute scaling trsf.
   const Standard_Boolean isToScale = theAngleLength >= Precision::Angular();
@@ -640,7 +686,6 @@ TopoDS_Shape GEOMImpl_ProjectionDriver::projectOnCylinder
     new Geom_CylindricalSurface(gp_Ax3(), theRadius);
   GeomAdaptor_Surface  aGACyl(aCylinder);
   TopExp_Explorer      anExp(aFace, TopAbs_WIRE);
-  Standard_Real        aPar[2];
   TopTools_ListOfShape aWires;
   Standard_Real        aUResol = aGACyl.UResolution(Precision::Confusion());
   Standard_Real        aVResol = aGACyl.VResolution(Precision::Confusion());
@@ -659,6 +704,10 @@ TopoDS_Shape GEOMImpl_ProjectionDriver::projectOnCylinder
         continue;
       }
 
+      if (isToRotate) {
+        aCurve = Handle(Geom2d_Curve)::DownCast(aCurve->Transformed(aRotTrsf));
+      }
+
       // Transform the curve to cylinder's parametric space.
       GEOMUtils::Handle(HTrsfCurve2d) aTrsfCurve =
         new GEOMUtils::HTrsfCurve2d(aCurve, aPar[0], aPar[1], aTrsf2d);
index ee703af55b1fafe518cc73785f381fee73baa462..47dfc44139c34e2e80295629722394668ae7d90e 100644 (file)
@@ -87,7 +87,8 @@ private:
   TopoDS_Shape projectOnCylinder(const TopoDS_Shape  &theShape,
                                  const Standard_Real  theRadius,
                                  const Standard_Real  theStartAngle,
-                                 const Standard_Real  theAngleLength) const;
+                                 const Standard_Real  theAngleLength,
+                                 const Standard_Real  theAngleRotation) const;
 
 public:
 
index 933ad9eea273c2c693c4ee3250f12c6d401d06be..8b585f83eb84600974d473540fda0a53d1070955 100644 (file)
 
 #include <list>
 
+namespace
+{
+  // check that compound includes only shapes of expected type
+  bool checkCompound( TopoDS_Shape& c, TopAbs_ShapeEnum t )
+  {
+    TopoDS_Iterator it( c, Standard_True, Standard_True );
+
+    // empty compound is OK only if we explicitly create a compound of shapes
+    bool result = true;
+
+    // => if expected type is TopAbs_SHAPE, we allow compound consisting of any shapes, this above check is enough
+    // => otherwise we have to check compound's content
+    // => compound sometimes can contain enclosed compound(s), we process them recursively and rebuild initial compound
+
+    if ( t != TopAbs_SHAPE ) {
+      result = it.More();
+      std::list<TopoDS_Shape> compounds, shapes;
+      compounds.push_back( c );
+      while ( !compounds.empty() && result ) {
+        // check that compound contains only shapes of expected type
+        TopoDS_Shape cc = compounds.front();
+        compounds.pop_front();
+        it.Initialize( cc, Standard_True, Standard_True );
+        for ( ; it.More() && result; it.Next() ) {
+          TopAbs_ShapeEnum tt = it.Value().ShapeType();
+          if ( tt == TopAbs_COMPOUND || tt == TopAbs_COMPSOLID ) {
+            compounds.push_back( it.Value() );
+            continue;
+          }
+          shapes.push_back( it.Value() );
+          result = tt == t;
+        }
+      }
+      if ( result ) {
+        if ( shapes.empty() ) {
+          result = false;
+        }
+        else if ( shapes.size() == 1 ) {
+          c = shapes.front();
+        }
+        else {
+          BRep_Builder b;
+          TopoDS_Compound newc;
+          b.MakeCompound( newc );
+          std::list<TopoDS_Shape> ::const_iterator sit;
+          for ( sit = shapes.begin(); sit != shapes.end(); ++sit )
+          b.Add( newc, *sit );
+          c = newc;
+        }
+      }
+    }
+
+    return result;
+  }
+}
+
 //modified by NIZNHY-PKV Wed Dec 28 13:48:20 2011f
 //static
 //  void KeepEdgesOrder(const Handle(TopTools_HSequenceOfShape)& aEdges,
@@ -146,12 +202,17 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
 
   TopoDS_Shape aShape;
   TCollection_AsciiString aWarning;
-  std::list<TopAbs_ShapeEnum> anExpectedType;
+
+  // this is an exact type of expected shape, or shape in a compound if compound is allowed as a result (see below)
+  TopAbs_ShapeEnum anExpectedType = TopAbs_SHAPE;
+  // this should be true if result can be a compound of shapes of strict type (see above)
+  bool allowCompound = false;
 
   BRep_Builder B;
 
   if (aType == WIRE_EDGES) {
-    anExpectedType.push_back(TopAbs_WIRE);
+    // result may be only a single wire
+    anExpectedType = TopAbs_WIRE;
 
     Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
 
@@ -162,7 +223,9 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     aShape = MakeWireFromEdges(aShapes, aTolerance);
   }
   else if (aType == FACE_WIRE) {
-    anExpectedType.push_back(TopAbs_FACE);
+    // result may be a face or a compound of faces
+    anExpectedType = TopAbs_FACE;
+    allowCompound = true;
 
     Handle(GEOM_Function) aRefBase = aCI.GetBase();
     TopoDS_Shape aShapeBase = aRefBase->GetValue();
@@ -197,7 +260,9 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     }
   }
   else if (aType == FACE_WIRES) {
-    anExpectedType.push_back(TopAbs_FACE);
+    // result may be a face or a compound of faces
+    anExpectedType = TopAbs_FACE;
+    allowCompound = true;
 
     // Try to build a face from a set of wires and edges
     int ind;
@@ -325,7 +390,8 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     }
   }
   else if (aType == FACE_FROM_SURFACE) {
-    anExpectedType.push_back(TopAbs_FACE);
+    // result may be only a face
+    anExpectedType = TopAbs_FACE;
 
     Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
 
@@ -361,7 +427,9 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     }
   }
   else if (aType == SHELL_FACES) {
-    anExpectedType.push_back(TopAbs_SHELL);
+    // result may be only a shell or a compound of shells
+    anExpectedType = TopAbs_SHELL;
+    allowCompound = true;
 
     Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
     unsigned int ind, nbshapes = aShapes->Length();
@@ -420,7 +488,9 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
 
   }
   else if (aType == SOLID_SHELLS) {
-    anExpectedType.push_back(TopAbs_SOLID);
+    // result may be only a solid or a compound of solids
+    anExpectedType = TopAbs_SOLID;
+    allowCompound = true;
 
     Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
     unsigned int ind, nbshapes = aShapes->Length();
@@ -463,7 +533,8 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
       aShape = Sol;
   }
   else if (aType == COMPOUND_SHAPES) {
-    anExpectedType.push_back(TopAbs_COMPOUND);
+    // result may be only a compound of any shapes
+    allowCompound = true;
 
     Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
     unsigned int ind, nbshapes = aShapes->Length();
@@ -484,7 +555,8 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
 
   }
   else if (aType == EDGE_WIRE) {
-    anExpectedType.push_back(TopAbs_EDGE);
+    // result may be only an edge
+    anExpectedType = TopAbs_EDGE;
 
     Handle(GEOM_Function) aRefBase = aCI.GetBase();
     TopoDS_Shape aWire = aRefBase->GetValue();
@@ -495,9 +567,9 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     aShape = MakeEdgeFromWire(aWire, LinTol, AngTol);
   }
   else if (aType == SOLID_FACES) {
-    anExpectedType.push_back(TopAbs_SOLID);
-    anExpectedType.push_back(TopAbs_COMPOUND);
-    anExpectedType.push_back(TopAbs_COMPSOLID);
+    // result may be only a solid or a compound of solids
+    anExpectedType = TopAbs_SOLID;
+    allowCompound = true;
     
     Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
     unsigned int ind, nbshapes = aShapes->Length();
@@ -534,7 +606,8 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     aShape = aMV.Shape();
   }
   else if (aType == EDGE_CURVE_LENGTH) {
-    anExpectedType.push_back(TopAbs_EDGE);
+    // result may be only an edge
+    anExpectedType = TopAbs_EDGE;
 
     GEOMImpl_IVector aVI (aFunction);
 
@@ -609,7 +682,12 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     BRepBuilderAPI_MakeEdge aME (ReOrientedCurve, UFirst, aParam);
     if (aME.IsDone())
       aShape = aME.Shape();
-  } else if (aType == SHAPE_ISOLINE) {
+  }
+  else if (aType == SHAPE_ISOLINE) {
+    // result may be only an edge or compound of edges
+    anExpectedType = TopAbs_EDGE;
+    allowCompound = true;
+
     GEOMImpl_IIsoline     aII (aFunction);
     Handle(GEOM_Function) aRefFace = aII.GetFace();
     TopoDS_Shape          aShapeFace = aRefFace->GetValue();
@@ -635,8 +713,11 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
       Standard_NullObject::Raise
         ("Shape for isoline construction is not a face");
     }
-  } else if (aType == EDGE_UV) {
-    anExpectedType.push_back(TopAbs_EDGE);
+  }
+  else if (aType == EDGE_UV) {
+    // result may be only an edge
+    anExpectedType = TopAbs_EDGE;
+
     GEOMImpl_IShapeExtend aSE (aFunction);
     Handle(GEOM_Function) aRefEdge   = aSE.GetShape();
     TopoDS_Shape          aShapeEdge = aRefEdge->GetValue();
@@ -646,8 +727,10 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
 
       aShape = ExtendEdge(anEdge, aSE.GetUMin(), aSE.GetUMax());
     }
-  } else if (aType == FACE_UV) {
-    anExpectedType.push_back(TopAbs_FACE);
+  }
+  else if (aType == FACE_UV) {
+    // result may be only a face
+    anExpectedType = TopAbs_FACE;
 
     GEOMImpl_IShapeExtend aSE (aFunction);
     Handle(GEOM_Function) aRefFace   = aSE.GetShape();
@@ -660,8 +743,10 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
       aShape = ExtendFace(aFace, aSE.GetUMin(), aSE.GetUMax(),
                           aSE.GetVMin(), aSE.GetVMax()); 
     }
-  } else if (aType == SURFACE_FROM_FACE) {
-    anExpectedType.push_back(TopAbs_FACE);
+  }
+  else if (aType == SURFACE_FROM_FACE) {
+    // result may be only a face
+    anExpectedType = TopAbs_FACE;
 
     GEOMImpl_IShapeExtend aSE (aFunction);
     Handle(GEOM_Function) aRefFace   = aSE.GetShape();
@@ -706,7 +791,7 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
   if (aShape.IsNull()) return 0;
 
   // Check shape validity
-  BRepCheck_Analyzer ana (aShape, false);
+  BRepCheck_Analyzer ana (aShape, true);
   if (!ana.IsValid()) {
     //Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
     // For Mantis issue 0021772: EDF 2336 GEOM: Non valid face created from two circles
@@ -715,17 +800,18 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     aShape = aSfs->Shape();
   }
 
-  // Check if the result shape type is compatible with the expected.
+  // Check if the result shape is of expected type.
   const TopAbs_ShapeEnum aShType = aShape.ShapeType();
 
-  if (!anExpectedType.empty()) {
-    bool ok = false;
-    std::list<TopAbs_ShapeEnum>::const_iterator it;
-    for (it = anExpectedType.begin(); it != anExpectedType.end() && !ok; ++it)
-      ok = (*it == TopAbs_SHAPE || *it == aShType);
-    if (!ok)
-      Standard_ConstructionError::Raise("Result type check failed");
+  bool ok = false;
+  if ( aShType == TopAbs_COMPOUND || aShType == TopAbs_COMPSOLID ) {
+    ok = allowCompound && checkCompound( aShape, anExpectedType );
+  }
+  else {
+    ok = ( anExpectedType == TopAbs_SHAPE ) || ( aShType == anExpectedType );
   }
+  if (!ok)
+    Standard_ConstructionError::Raise("Result type check failed");
 
   aFunction->SetValue(aShape);
 
@@ -861,11 +947,13 @@ TopoDS_Edge GEOMImpl_ShapeDriver::MakeEdgeFromWire(const TopoDS_Shape& aWire,
       {
         Standard_Boolean Done = Standard_False;
         Standard_Real NewFpar, NewLpar;
-        GeomAdaptor_Curve GAprevcurve(CurveSeq.Last());
+        Handle(Geom_Geometry) aTrsfGeom = CurveSeq.Last()->Transformed
+                      (LocSeq.Last().Location().Transformation());
+        GeomAdaptor_Curve GAprevcurve(Handle(Geom_Curve)::DownCast(aTrsfGeom));
         TopoDS_Vertex CurVertex = wexp.CurrentVertex();
         TopoDS_Vertex CurFirstVer = TopExp::FirstVertex(anEdge);
         TopAbs_Orientation ConnectByOrigin = (CurVertex.IsSame(CurFirstVer))? TopAbs_FORWARD : TopAbs_REVERSED;
-        if (aCurve == CurveSeq.Last())
+        if (aCurve == CurveSeq.Last() && aLoc.IsEqual(LocSeq.Last().Location()))
         {
           NewFpar = fpar;
           NewLpar = lpar;
index ea18e8b904575523fb4e4468ef0b1ebf39371f72..96380bee200dd35a559061624d99094405f7a2f5 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(${QT_USE_FILE})
-
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -58,8 +55,13 @@ SET(_link_LIBRARIES
   GEOM
   GEOMBase
   Material
-  DependencyTree
   )
+  
+IF(SALOME_USE_GRAPHICSVIEW)
+  LIST(APPEND _link_LIBRARIES
+    DependencyTree
+    )
+ENDIF()
 
 # --- headers ---
 
@@ -93,7 +95,7 @@ SET(_moc_HEADERS
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(GEOMToolsGUI_SOURCES
   GEOMToolsGUI.cxx
index 5fe45f595bd1ea0b289b927d4eea2b09bdbe1e93..7a437d272feb4ac70e75578ae7ca2add8c70c7d1 100644 (file)
@@ -206,9 +206,11 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
   case GEOMOp::OpDelete:         // EDIT - DELETE
     OnEditDelete();
     break;
+#ifndef DISABLE_PYCONSOLE
   case GEOMOp::OpCheckGeom:      // TOOLS - CHECK GEOMETRY
     OnCheckGeometry();
     break;
+#endif
   case GEOMOp::OpSelectVertex:   // POPUP - SELECT ONLY - VERTEX
     OnSelectOnly( GEOM_POINT );
     break;
@@ -306,9 +308,11 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
   case GEOMOp::OpSortChildren:
     OnSortChildren();
     break;
+#ifndef DISABLE_GRAPHICSVIEW
   case GEOMOp::OpShowDependencyTree:
     OnShowDependencyTree();
      break;
+#endif
   case GEOMOp::OpReduceStudy:
     OnReduceStudy();
     break;
index 581d10f7bc612b64d00eb655663ee6b1cec4851b..6916bdfa83ef76f8450d46daf2513b1e5152d07e 100644 (file)
@@ -87,7 +87,9 @@ private:
   void         OnClsBringToFront();
   void         OnCreateFolder();
   void         OnSortChildren();
+#ifndef DISABLE_GRAPHICSVIEW
   void         OnShowDependencyTree();
+#endif
   void         OnReduceStudy();
 
   // Shortcut commands
index d00c98d24103826add3fc3a30139ac1243ef09df..b83b3e77e30da171467a31beb1753d5d0fb24763 100644 (file)
@@ -24,7 +24,9 @@
 //  File   : GEOMToolsGUI_1.cxx
 //  Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
 
+#ifndef DISABLE_PYCONSOLE
 #include <PyConsole_Console.h>
+#endif
 
 #include "GEOMToolsGUI.h"
 #include "GEOMToolsGUI_TransparencyDlg.h"
 #include <GEOMBase.h>
 #include <GEOM_Actor.h>
 
+#ifndef DISABLE_GRAPHICSVIEW
 #include <DependencyTree_ViewModel.h>
 #include <DependencyTree_View.h>
 #include <DependencyTree_Selector.h>
+#endif
 
 #include <Basics_OCCTVersion.hxx>
 
 // on Show Dependencies operation
 #define LAYOUT_DEPVIEW
 
+#ifndef DISABLE_PYCONSOLE
 void GEOMToolsGUI::OnCheckGeometry()
 {
   SalomeApp_Application* app =
@@ -135,6 +140,7 @@ void GEOMToolsGUI::OnCheckGeometry()
   if (pyConsole)
     pyConsole->exec("from GEOM_usinggeom import *");
 }
+#endif
 
 void GEOMToolsGUI::OnAutoColor()
 {
@@ -882,6 +888,7 @@ void GEOMToolsGUI::OnSortChildren()
   app->updateObjectBrowser( true );
 }
 
+#ifndef DISABLE_GRAPHICSVIEW
 void GEOMToolsGUI::OnShowDependencyTree()
 {
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
@@ -932,6 +939,7 @@ void GEOMToolsGUI::OnShowDependencyTree()
 #endif
   depVw->setFocus();
 }
+#endif
 
 void GEOMToolsGUI::OnReduceStudy()
 {
index f977e08d92da60bef029ab573c05fabab0da8213..1d8bc588b7addaeee135cc631c2ff8e3a2c58282 100644 (file)
@@ -52,7 +52,7 @@ GEOMToolsGUI_DeflectionDlg::GEOMToolsGUI_DeflectionDlg (QWidget* parent)
   setModal(true);
 
   setWindowTitle(tr("GEOM_DEFLECTION_TLT"));
-  setSizeGripEnabled(TRUE);
+  setSizeGripEnabled(true);
   QGridLayout* MyDialogLayout = new QGridLayout(this);
   MyDialogLayout->setSpacing(6);
   MyDialogLayout->setMargin(11);
@@ -101,8 +101,8 @@ GEOMToolsGUI_DeflectionDlg::GEOMToolsGUI_DeflectionDlg (QWidget* parent)
   QPushButton* buttonOk = new QPushButton (GroupButtons);
   buttonOk->setObjectName("buttonOk");
   buttonOk->setText(tr("GEOM_BUT_OK"));
-  buttonOk->setAutoDefault(TRUE);
-  buttonOk->setDefault(TRUE);
+  buttonOk->setAutoDefault(true);
+  buttonOk->setDefault(true);
   GroupButtonsLayout->addWidget(buttonOk, 0, 0);
 
   GroupButtonsLayout->addItem(new QSpacerItem (20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
@@ -110,13 +110,13 @@ GEOMToolsGUI_DeflectionDlg::GEOMToolsGUI_DeflectionDlg (QWidget* parent)
   QPushButton* buttonCancel = new QPushButton (GroupButtons);
   buttonCancel->setObjectName("buttonCancel");
   buttonCancel->setText(tr("GEOM_BUT_CANCEL"));
-  buttonCancel->setAutoDefault(TRUE);
+  buttonCancel->setAutoDefault(true);
   GroupButtonsLayout->addWidget(buttonCancel, 0, 1);
 
   QPushButton* buttonHelp = new QPushButton (GroupButtons);
   buttonHelp->setObjectName("buttonHelp");
   buttonHelp->setText(tr("GEOM_BUT_HELP"));
-  buttonHelp->setAutoDefault(TRUE);
+  buttonHelp->setAutoDefault(true);
   GroupButtonsLayout->addWidget(buttonHelp, 0, 2);
   /***************************************************************/
 
index 95713739cdd944e1c35502b35323aa480ebc9d32..bfadece29630050034f0a1936ef73c347ca081aa 100644 (file)
@@ -54,7 +54,7 @@ GEOMToolsGUI_LineWidthDlg::GEOMToolsGUI_LineWidthDlg (QWidget* parent, const QSt
   setModal(true);
 
   setWindowTitle(tr(title.toLatin1().constData()));
-  setSizeGripEnabled(TRUE);
+  setSizeGripEnabled(true);
   QGridLayout* MyDialogLayout = new QGridLayout(this);
   MyDialogLayout->setSpacing(6);
   MyDialogLayout->setMargin(11);
@@ -95,8 +95,8 @@ GEOMToolsGUI_LineWidthDlg::GEOMToolsGUI_LineWidthDlg (QWidget* parent, const QSt
   QPushButton* buttonOk = new QPushButton (GroupButtons);
   buttonOk->setObjectName("buttonOk");
   buttonOk->setText(tr("GEOM_BUT_OK"));
-  buttonOk->setAutoDefault(TRUE);
-  buttonOk->setDefault(TRUE);
+  buttonOk->setAutoDefault(true);
+  buttonOk->setDefault(true);
   GroupButtonsLayout->addWidget(buttonOk, 0, 0);
 
   GroupButtonsLayout->addItem(new QSpacerItem (20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
@@ -104,13 +104,13 @@ GEOMToolsGUI_LineWidthDlg::GEOMToolsGUI_LineWidthDlg (QWidget* parent, const QSt
   QPushButton* buttonCancel = new QPushButton (GroupButtons);
   buttonCancel->setObjectName("buttonCancel");
   buttonCancel->setText(tr("GEOM_BUT_CANCEL"));
-  buttonCancel->setAutoDefault(TRUE);
+  buttonCancel->setAutoDefault(true);
   GroupButtonsLayout->addWidget(buttonCancel, 0, 1);
 
   QPushButton* buttonHelp = new QPushButton (GroupButtons);
   buttonHelp->setObjectName("buttonHelp");
   buttonHelp->setText(tr("GEOM_BUT_HELP"));
-  buttonHelp->setAutoDefault(TRUE);
+  buttonHelp->setAutoDefault(true);
   GroupButtonsLayout->addWidget(buttonHelp, 0, 2);
   /***************************************************************/
 
index ab1ea6692e4399a7afcc2405b0d9468f077e15fe..724346eb831819f12cb3fc242490bd3df132c329 100644 (file)
@@ -53,7 +53,7 @@ GEOMToolsGUI_NbIsosDlg::GEOMToolsGUI_NbIsosDlg(QWidget* parent )
   setModal( true );
 
   setWindowTitle( tr( "GEOM_MEN_ISOS" ) );
-  setSizeGripEnabled(TRUE);
+  setSizeGripEnabled(true);
   QGridLayout* MyDialogLayout = new QGridLayout(this); 
   MyDialogLayout->setSpacing(6);
   MyDialogLayout->setMargin(11);
@@ -101,8 +101,8 @@ GEOMToolsGUI_NbIsosDlg::GEOMToolsGUI_NbIsosDlg(QWidget* parent )
   QPushButton* buttonOk = new QPushButton( GroupButtons );
   buttonOk->setObjectName( "buttonOk" );
   buttonOk->setText( tr( "GEOM_BUT_OK" ) ) ;
-  buttonOk->setAutoDefault( TRUE );
-  buttonOk->setDefault( TRUE );
+  buttonOk->setAutoDefault( true );
+  buttonOk->setDefault( true );
   GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
   
   GroupButtonsLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
@@ -110,13 +110,13 @@ GEOMToolsGUI_NbIsosDlg::GEOMToolsGUI_NbIsosDlg(QWidget* parent )
   QPushButton* buttonCancel = new QPushButton( GroupButtons );
   buttonCancel->setObjectName( "buttonCancel" );
   buttonCancel->setText( tr( "GEOM_BUT_CANCEL" ) ) ;
-  buttonCancel->setAutoDefault( TRUE );
+  buttonCancel->setAutoDefault( true );
   GroupButtonsLayout->addWidget( buttonCancel, 0, 1 );
 
   QPushButton* buttonHelp = new QPushButton( GroupButtons );
   buttonHelp->setObjectName( "buttonHelp" );
   buttonHelp->setText( tr( "GEOM_BUT_HELP" ) ) ;
-  buttonHelp->setAutoDefault( TRUE );
+  buttonHelp->setAutoDefault( true );
   GroupButtonsLayout->addWidget( buttonHelp, 0, 2 );
   /***************************************************************/
   
index 0ac5eb330aabdd9c3bcba9e91fc295ceda15d1a6..3a8640ba914abb636ffee72648a0de2ac5980a41 100644 (file)
@@ -78,7 +78,11 @@ GEOMToolsGUI_PublishDlg::GEOMToolsGUI_PublishDlg(QWidget* parent):
    SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
    headerItem->setIcon( 2, QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) ) );
    myTreeWidget->setHeaderItem ( headerItem );
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
    myTreeWidget->header()->setClickable( true );
+#else
+   myTreeWidget->header()->setSectionsClickable( true );
+#endif
    myTreeWidget->header()->setSortIndicatorShown( true );
    myTreeWidget->header()->moveSection( 2, 0 );
    myTreeWidget->setSortingEnabled( true );
index d5e69e2ec838fdc6dd03e3cb1fc33bbeec6bd96f..6784a91d6aaa2b471287d870374b46689ce4705f 100644 (file)
@@ -222,9 +222,15 @@ void GEOMToolsGUI_ReduceStudyDlg::createTreeWidget( QTreeWidget* theTreeWidget )
   QTreeWidgetItem * headerItem = new QTreeWidgetItem( columnNames );
   theTreeWidget->setHeaderItem ( headerItem );
   theTreeWidget->header()->moveSection( 1, 0 );
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
   theTreeWidget->header()->setClickable( true );
   theTreeWidget->header()->setMovable( false );
   theTreeWidget->header()->setResizeMode( 1, QHeaderView::ResizeToContents );
+#else
+  theTreeWidget->header()->setSectionsClickable( true );
+  theTreeWidget->header()->setSectionsMovable( false );
+  theTreeWidget->header()->setSectionResizeMode( 1, QHeaderView::ResizeToContents );
+#endif
   theTreeWidget->setSelectionMode( QAbstractItemView::ExtendedSelection );
 }
 
index 039990ab77c4edf7b699ebf53f3a1ee0c148acee..a2bbfd9d00d295b8c7514cf029876560656a52f5 100755 (executable)
@@ -53,6 +53,7 @@ SET(GEOMUtils_HEADERS
   GEOMUtils.hxx
   GEOMUtils_Hatcher.hxx
   GEOMUtils_HTrsfCurve2d.hxx
+  GEOMUtils_ShapeStatistics.hxx
   GEOMUtils_Trsf2d.hxx
   GEOMUtils_TrsfCurve2d.hxx
   GEOMUtils_XmlHandler.hxx
@@ -63,6 +64,7 @@ SET(GEOMUtils_SOURCES
   GEOMUtils.cxx
   GEOMUtils_Hatcher.cxx
   GEOMUtils_HTrsfCurve2d.cxx
+  GEOMUtils_ShapeStatistics.cxx
   GEOMUtils_Trsf2d.cxx
   GEOMUtils_TrsfCurve2d.cxx
   GEOMUtils_XmlHandler.cxx
index 3e0b18977de279e5b07a1e1e15efad56bcf371f2..c359c25676034168ea8bb651a3c41c5d9db17964 100644 (file)
 
 #define STD_SORT_ALGO 1
 
+#define DEFAULT_TOLERANCE_TOLERANCE     1.e-02
+#define DEFAULT_MAX_TOLERANCE_TOLERANCE 1.e-06
+
 // 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
@@ -1287,3 +1290,55 @@ bool GEOMUtils::IsOpenPath(const TopoDS_Shape &theShape)
 
   return isOpen;
 }
+
+//=======================================================================
+//function : CompareToleranceValues
+//purpose  : 
+//=======================================================================
+int GEOMUtils::CompareToleranceValues(const double theTolShape,
+                                      const double theTolRef)
+{
+  const double aTolTol = Min(DEFAULT_MAX_TOLERANCE_TOLERANCE,
+                             theTolRef*DEFAULT_TOLERANCE_TOLERANCE);
+
+  int aResult = 0;
+
+  if (theTolShape < theTolRef - aTolTol) {
+    aResult = -1;
+  } else if (theTolShape > theTolRef + aTolTol) {
+    aResult = 1;
+  }
+
+  return aResult;
+}
+
+//=======================================================================
+//function : IsFitCondition
+//purpose  : 
+//=======================================================================
+bool GEOMUtils::IsFitCondition(const ComparisonCondition theCondition,
+                               const double              theTolShape,
+                               const double              theTolRef)
+{
+  const int aCompValue = CompareToleranceValues(theTolShape, theTolRef);
+  bool      isFit      = false;
+
+  switch (theCondition) {
+    case CC_GT:
+      isFit = aCompValue == 1;
+      break;
+    case GEOMUtils::CC_GE:
+      isFit = aCompValue != -1;
+      break;
+    case GEOMUtils::CC_LT:
+      isFit = aCompValue == -1;
+      break;
+    case GEOMUtils::CC_LE:
+      isFit = aCompValue != 1;
+      break;
+    default:
+      break;
+  }
+
+  return isFit;
+}
index 8ffa25be2e10bb75ad3e2e2b9ed592c14d4b542d..184bc970395e4286397f2e9e10cac776ca343f65 100644 (file)
@@ -55,6 +55,16 @@ inline Standard_Boolean IsEqual (const TopoDS_Shape& S1, const TopoDS_Shape& S2)
 namespace GEOMUtils
 {
 
+  /**
+   * This enumeration represents comparison conditions.
+   */
+  enum ComparisonCondition {
+    CC_GT, ///< Greater then
+    CC_GE, ///< Greater then or equal to
+    CC_LT, ///< Less then
+    CC_LE  ///< Less then or equal to
+  };
+
   typedef std::vector<std::string> NodeLinks;
   typedef std::map<std::string, NodeLinks> LevelInfo;
   typedef std::vector<LevelInfo> LevelsList;
@@ -341,6 +351,36 @@ namespace GEOMUtils
    */
   Standard_EXPORT bool IsOpenPath(const TopoDS_Shape &theShape);
 
+  /**
+   * This function compares two tolerances. The shape tolerance (the first
+   * argument) is considered less than the reference tolerance (the second
+   * argument) if theTolShape < theTolRef - Tolerance(theTolRef). theTolShape is
+   * considered greater than theTolRef if theTolShape > theTolRef +
+   * Tolerance(theTolRef). Otherwise these tolerances are equal.
+   * Tolerance(theTolRef) = theTolRef*DEFAULT_TOLERANCE_TOLERANCE. But this value
+   * should not be greated than DEFAULT_MAX_TOLERANCE_TOLERANCE.
+   *
+   * \param theTolShape the shape tolerance
+   * \param theTolRef the reference tolerance
+   * \return -1 if theTolShape is less than theTolRef; 1 if theTolShape is greater
+   * than theTolRef; 0 if they are equal
+   */
+  Standard_EXPORT int CompareToleranceValues(const double theTolShape,
+                                             const double theTolRef);
+
+  /**
+   * Check if the comarison of tolerances fit the condition. The comparison of
+   * tolerances is performed using the function CompareToleranceValues.
+   *
+   * \param theCondition the condition
+   * \param theTolShape the shape tolerance
+   * \param theTolRef the reference tolerance
+   * \return true if the shape tolerance fits the condition; false otherwise.
+   */
+  Standard_EXPORT bool IsFitCondition(const ComparisonCondition theCondition,
+                                      const double              theTolShape,
+                                      const double              theTolRef);
+
 };
 
 #endif
diff --git a/src/GEOMUtils/GEOMUtils_ShapeStatistics.cxx b/src/GEOMUtils/GEOMUtils_ShapeStatistics.cxx
new file mode 100644 (file)
index 0000000..4ef3b86
--- /dev/null
@@ -0,0 +1,147 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File   : GEOMUtils_ShapeStatisticsDlg.cxx
+// Author : Alexander KOVALEV, OPEN CASCADE S.A.S.
+
+#include "GEOMUtils_ShapeStatistics.hxx"
+
+#include <BRepGProp.hxx>
+#include <GProp_GProps.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+
+namespace GEOMUtils
+{
+//=================================================================================
+// function : ComputeMeasures()
+// purpose  : gets measures of the given type for list of shapes in the range
+//=================================================================================
+  std::map<int,double> ComputeMeasures( std::list<TopoDS_Shape> shapes, 
+                             TopAbs_ShapeEnum entity, 
+                             Range &range)
+{
+  bool hasRange = (range.min != -1.0); // -1.0 means that range must not be used
+  if ( !hasRange )
+    range.min = 1e+32, range.max = 0.0;
+  // list of measures of entities
+  std::map<int, double> measures;
+    
+  std::list<TopoDS_Shape>::const_iterator it;
+  int shift = 0;
+  for ( it = shapes.begin(); it != shapes.end(); ++it ) {
+    double aMeasure;
+    TopTools_IndexedMapOfShape aSubShapesMap;
+    TopExp::MapShapes(*it, aSubShapesMap); // map of all global indices
+    TopTools_IndexedMapOfShape aMx;
+    TopExp::MapShapes( *it, entity, aMx ); // map of current type sub-shape indices 
+    int aNbS = aMx.Extent();
+    int index = -1;
+    for ( int i = 1; i <= aNbS; ++i ) {
+      aMeasure = 0.0;
+      const TopoDS_Shape& aSubShape = aMx( i );
+      //Get the measure: length, area or volume
+      GProp_GProps LProps, SProps, VProps;
+      if ( entity == TopAbs_EDGE ) {
+       BRepGProp::LinearProperties( aSubShape, LProps );
+       aMeasure = LProps.Mass();
+      } else if ( entity == TopAbs_FACE ) {
+       BRepGProp::SurfaceProperties( aSubShape, SProps );
+       aMeasure = SProps.Mass();
+      } else if ( entity == TopAbs_SOLID ) {
+       BRepGProp::VolumeProperties( aSubShape, VProps );
+       aMeasure = VProps.Mass();
+      }
+      // Don't pass sub-shapes with out of range measure, if range is used
+      if ( hasRange ) {
+       if ( aMeasure < range.min || aMeasure > range.max )
+         continue;
+      } else {
+       // get range min and max
+       if ( aMeasure < range.min ) range.min = aMeasure;
+       if ( aMeasure > range.max ) range.max = aMeasure;
+      }
+      // get global index of sub-shape
+      index = aSubShapesMap.FindIndex( aSubShape );
+      // keep measures to distribute it
+      measures[shift+index] = aMeasure;
+    }
+    shift += aSubShapesMap.Extent();
+  }
+  return measures;
+}
+
+//=================================================================================
+// function : ComputeDistribution()
+// purpose  : gets distribution data for single shape
+//=================================================================================
+Distribution ComputeDistribution( TopoDS_Shape shape, 
+                                 TopAbs_ShapeEnum entity, 
+                                 int intervals, 
+                                 Range range)
+{
+  std::list<TopoDS_Shape> aShapes;
+  aShapes.push_back( shape );
+  return ComputeDistribution( aShapes, entity, intervals, range );
+}
+
+//=================================================================================
+// function : ComputeDistribution()
+// purpose  : gets distribution data for list of shapes
+//=================================================================================
+Distribution ComputeDistribution( std::list<TopoDS_Shape> shapes, 
+                                 TopAbs_ShapeEnum entity, 
+                                 int nbIntervals, 
+                                 Range range)
+{
+  // get list of measures and compute range (if it was not specified)
+  std::map<int,double> measures = ComputeMeasures( shapes, entity, range );
+
+  // compute a step
+  double aStep = (range.max - range.min) / nbIntervals;
+
+  // compute distribution in intervals
+  Distribution aDistr;
+  std::map<int,double>::iterator dit;
+  for ( int i = 0; i < nbIntervals; i++ ) {
+    Range localRange; // range of current interval
+    localRange.min = range.min + ( i * aStep );
+    localRange.max = range.min + ( (i+1) * aStep );
+    localRange.count = 0;
+
+    std::vector<int> indicesToErase;
+    for ( dit = measures.begin(); dit != measures.end(); dit++ ) {
+      if ( ( dit->second >= localRange.min && dit->second < localRange.max ) || 
+          ( i == nbIntervals-1 && dit->second == localRange.max ) ) {
+       localRange.count++;
+       localRange.indices.push_back( dit->first );
+       // measure is in interval, so remove it from map of search
+       indicesToErase.push_back( dit->first );
+      }
+    }
+    aDistr.push_back( localRange );
+    for( int j=0; j < indicesToErase.size(); j++ )
+      measures.erase( indicesToErase[j] );
+  }
+
+  return aDistr;
+}
+
+} //namespace GEOMUtils
diff --git a/src/GEOMUtils/GEOMUtils_ShapeStatistics.hxx b/src/GEOMUtils/GEOMUtils_ShapeStatistics.hxx
new file mode 100644 (file)
index 0000000..703050e
--- /dev/null
@@ -0,0 +1,61 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File   : GEOMUtils_ShapeStatisticsDlg.hxx
+// Author : Alexander KOVALEV, OPEN CASCADE S.A.S.
+
+#ifndef _GEOMUtils_ShapeStatistics_HXX_
+#define _GEOMUtils_ShapeStatistics_HXX_
+
+#include <list>
+#include <map>
+#include <vector>
+
+#include <TopoDS_Shape.hxx>
+namespace GEOMUtils
+{
+  // struct to store range data
+  typedef struct { double min; double max; long count; std::list<long> indices; } Range;
+  // distribution is a set of ranges
+  typedef std::vector<Range> Distribution;
+
+  // function to get measures of entities and compute range for list of shapes
+  Standard_EXPORT std::map<int,double> ComputeMeasures(
+    std::list<TopoDS_Shape> shapes, 
+    TopAbs_ShapeEnum entity, 
+    Range &range );
+
+  // function to get distribution data for single shape
+  Standard_EXPORT Distribution ComputeDistribution(
+    TopoDS_Shape shape, 
+    TopAbs_ShapeEnum entity, 
+    int intervals, 
+    Range range );
+
+  // function to get distribution data for list of shapes
+  Standard_EXPORT Distribution ComputeDistribution(
+    std::list<TopoDS_Shape> shapes, 
+    TopAbs_ShapeEnum entity, 
+    int intervals, 
+    Range range );
+
+}
+
+#endif // _GEOMUtils_ShapeStatistics_HXX_
index 7a824de3510f6afc92d178e0751668ad3bb9ced5..7f60f803e615f54ee7c08eaba9049589ea582554 100755 (executable)
@@ -66,7 +66,6 @@
 
 #include <SALOMEDS_Tool.hxx>
 #include <SALOMEDS_wrap.hxx>
-#include <SALOME_DataContainer_i.hxx>
 #include <Basics_DirUtils.hxx>
 
 #include <set>
@@ -326,8 +325,8 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr   theStudy,
     std::string plgId;
     for ( size_t j = 0; j < infoSeq->length(); ++j )
       for ( size_t i = 0; i < infoSeq[j].params.length(); ++i ) {
-       std::string param_name  = infoSeq[j].params[i].name.in();
-       std::string param_value = infoSeq[j].params[i].value.in();
+        std::string param_name  = infoSeq[j].params[i].name.in();
+        std::string param_value = infoSeq[j].params[i].value.in();
         if( param_name == PLUGIN_NAME) {
           plgId = param_value;
           break;
@@ -684,8 +683,8 @@ CORBA::Boolean GEOM_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
     useCaseBuilder->SetRootCurrent();
     useCaseBuilder->Append( theComponent ); // component object is added as the top level item
   }
-  
-  SALOMEDS::ChildIterator_wrap it = study->NewChildIterator( theComponent ); 
+
+  SALOMEDS::ChildIterator_wrap it = study->NewChildIterator( theComponent );
   for ( it->InitEx(true); it->More(); it->Next() ) {
     if ( !useCaseBuilder->IsUseCaseNode( it->Value() ) ) {
       useCaseBuilder->AppendTo( it->Value()->GetFather(), it->Value() );
@@ -2459,7 +2458,7 @@ GEOM::GEOM_IOperations_ptr GEOM_Gen_i::GetPluginOperations(CORBA::Long theStudyI
       aServant = myOpCreatorMap[aLibName]->Create(_poa, theStudyID, engine, _impl);
       // activate the CORBA servant
       if (aServant)
-       operations = aServant->_this();
+        operations = aServant->_this();
     }
   }
   catch (SALOME_Exception& S_ex) {
@@ -2484,7 +2483,7 @@ void GEOM_Gen_i::LoadPlugin(const std::string& theLibName)
   aPlatformLibName += theLibName;
   aPlatformLibName += ".so";
 #endif
-  
+
   // check, if corresponding operations are already created
   if (myOpCreatorMap.find(theLibName) == myOpCreatorMap.end()) {
     // load plugin library
@@ -2497,7 +2496,7 @@ void GEOM_Gen_i::LoadPlugin(const std::string& theLibName)
       throw(SALOME_Exception(LOCALIZED( "Can't load server geometry plugin library" )));
 #endif
     }
-    
+
     // get method, returning operations creator
     typedef GEOM_GenericOperationsCreator* (*GetOperationsCreator)();
     GetOperationsCreator procHandle =
@@ -2506,7 +2505,7 @@ void GEOM_Gen_i::LoadPlugin(const std::string& theLibName)
       UnLoadLib(libHandle);
       throw(SALOME_Exception(LOCALIZED("bad geometry plugin library")));
     }
-    
+
     // get operations creator
     GEOM_GenericOperationsCreator* aCreator = procHandle();
     if (aCreator) {
@@ -2808,8 +2807,8 @@ char* GEOM_Gen_i::getVersion()
 // function : CreateFolder()
 // purpose  : Creates and returns a new folder object
 //=================================================================================
-SALOMEDS::SObject_ptr GEOM_Gen_i::CreateFolder(const char* theName, 
-                                              SALOMEDS::SObject_ptr theFather)
+SALOMEDS::SObject_ptr GEOM_Gen_i::CreateFolder(const char* theName,
+                                               SALOMEDS::SObject_ptr theFather)
 {
   SALOMEDS::SObject_var aFolderSO;
 
@@ -2861,8 +2860,8 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::CreateFolder(const char* theName,
 // function : MoveToFolder()
 // purpose  : Moves GEOM object to the specified folder
 //=================================================================================
-void GEOM_Gen_i::MoveToFolder(GEOM::GEOM_Object_ptr theObject, 
-                             SALOMEDS::SObject_ptr theFolder) {
+void GEOM_Gen_i::MoveToFolder(GEOM::GEOM_Object_ptr theObject,
+                              SALOMEDS::SObject_ptr theFolder) {
   GEOM::object_list_var objects = new GEOM::object_list();
   objects->length( 1 );
   SALOMEDS::SObject_var aSO = theFolder->GetStudy()->FindObjectID( theObject->GetStudyEntry() );
@@ -2874,8 +2873,8 @@ void GEOM_Gen_i::MoveToFolder(GEOM::GEOM_Object_ptr theObject,
 // function : MoveListToFolder()
 // purpose  : Moves list of GEOM objects to the specified folder
 //=================================================================================
-void GEOM_Gen_i::MoveListToFolder (const GEOM::ListOfGO& theListOfGO, 
-                                  SALOMEDS::SObject_ptr theFolder) {
+void GEOM_Gen_i::MoveListToFolder (const GEOM::ListOfGO& theListOfGO,
+                                   SALOMEDS::SObject_ptr theFolder) {
   int aLen = theListOfGO.length();
   GEOM::object_list_var objects = new GEOM::object_list();
   objects->length( aLen );
@@ -2892,12 +2891,12 @@ void GEOM_Gen_i::MoveListToFolder (const GEOM::ListOfGO& theListOfGO,
 
 //=================================================================================
 // function : Move()
-// purpose  : Moves objects to the specified position. 
+// purpose  : Moves objects to the specified position.
 //            Is used in the drag-n-drop functionality.
 //=================================================================================
 void GEOM_Gen_i::Move( const GEOM::object_list& what,
-                      SALOMEDS::SObject_ptr where,
-                      CORBA::Long row )
+                       SALOMEDS::SObject_ptr where,
+                       CORBA::Long row )
 {
   if ( CORBA::is_nil( where ) ) return;
 
@@ -2907,7 +2906,7 @@ void GEOM_Gen_i::Move( const GEOM::object_list& what,
   SALOMEDS::SComponent_var father = where->GetFatherComponent();
   std::string dataType = father->ComponentDataType();
   if ( dataType != "GEOM" ) return; // not a GEOM component
-  
+
   SALOMEDS::SObject_var objAfter;
   if ( row >= 0 && useCaseBuilder->HasChildren( where ) ) {
     // insert at given row -> find insertion position
@@ -2918,7 +2917,7 @@ void GEOM_Gen_i::Move( const GEOM::object_list& what,
       objAfter = useCaseIt->Value();
     }
   }
-  
+
   for ( int i = 0; i < what.length(); i++ ) {
     SALOMEDS::SObject_var sobj = what[i];
     if ( CORBA::is_nil( sobj ) ) continue; // skip bad object
@@ -2930,155 +2929,12 @@ void GEOM_Gen_i::Move( const GEOM::object_list& what,
   }
 }
 
-//=================================================================================
-// function : importData
-// purpose  : imports geometrical data file into the GEOM internal data structure
-//=================================================================================
-Engines::ListOfIdentifiers* GEOM_Gen_i::importData(
-  CORBA::Long studyId, Engines::DataContainer_ptr data, const Engines::ListOfOptions& options)
-{
-  CORBA::Object_var aSMObject = name_service->Resolve( "/myStudyManager" );
-  SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow( aSMObject );
-  SALOMEDS::Study_var aStudy = aStudyManager->GetStudyByID( studyId );
-
-  Engines::ListOfIdentifiers_var aResult = new Engines::ListOfIdentifiers;
-  GEOM::GEOM_IInsertOperations_var aInsOp = GetIInsertOperations(aStudy->StudyId());
-  if (aInsOp->_is_nil()) {
-    MESSAGE("No insert operations!");
-    return aResult._retn();
-  }
-
-  // Get a temporary directory to store a file
-  std::string aTmpDir = SALOMEDS_Tool::GetTmpDir();
-  std::string aFileName("file");
-  if (aFileName.rfind("/") != std::string::npos) { // remove folders from the name
-    aFileName = aFileName.substr(aFileName.rfind("/") + 1);
-  }
-
-  std::string anExtension(data->extension());
-  aFileName += "." + anExtension;
-  // convert extension to upper case
-  std::transform(anExtension.begin(), anExtension.end(), anExtension.begin(), ::toupper);
-  std::string aFullPath = aTmpDir + aFileName;
-
-  Engines::TMPFile* aFileStream = data->get();
-  const char *aBuffer = (const char*)aFileStream->NP_data();
-#ifdef WIN32
-  std::ofstream aFile(aFullPath.c_str(), std::ios::binary);
-#else
-  std::ofstream aFile(aFullPath.c_str());
-#endif
-  aFile.write(aBuffer, aFileStream->length());
-  aFile.close();
-
-  GEOM::ListOfGBO_var aObjects = aInsOp->ImportFile(aFullPath.c_str(), "XAO");
-
-  if ( aObjects->length() > 0 && aInsOp->IsDone() ) {
-    aResult->length(aObjects->length());
-    // publish main object (first in the list of returned geom objects)
-    CORBA::String_var aName = aObjects[0]->GetName();
-    SALOMEDS::SObject_var aSO = PublishInStudy(aStudy.in(), SALOMEDS::SObject::_nil(), aObjects[0].in(), aName.in());
-    aResult[0] = aSO->GetID();
-    // publish groups && fields
-    for (int i = 1; i < aObjects->length(); i++ ) {
-      aName = aObjects[i]->GetName();
-      aSO = AddInStudy(aStudy.in(), aObjects[0].in(), aName.in(), aObjects[0].in());
-      aResult[i] = aSO->GetID();
-    }
-  }
-  else {
-    if (aObjects->length() == 0)
-      MESSAGE("ImportXAO operation is failed for file "<<aFullPath.c_str());
-    if (!aInsOp->IsDone())
-      MESSAGE("Import operation is not done for file "<<aFullPath.c_str());
-    return aResult._retn();
-  }
-
-  // remove temporary file and directory
-  SALOMEDS::ListOfFileNames aTmpFiles;
-  aTmpFiles.length(1);
-  aTmpFiles[0] = aFileName.c_str();
-  SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aTmpFiles, true);
-
-  _impl->DocumentModified(studyId, false);
-  return aResult._retn();
-}
-
-//=================================================================================
-// function : getModifiedData
-// purpose  : exports all geometry of this GEOM module into one BRep file
-//=================================================================================
-Engines::ListOfData* GEOM_Gen_i::getModifiedData(CORBA::Long studyId)
-{
-  Engines::ListOfData_var aResult = new Engines::ListOfData;
-
-  if (!_impl->DocumentModified(studyId)) {
-    MESSAGE("Document is not modified")
-    return aResult._retn();
-  }
-
-  CORBA::Object_var aSMObject = name_service->Resolve("/myStudyManager");
-  SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow( aSMObject );
-  if (CORBA::is_nil(aStudyManager))
-    return aResult._retn();
-  SALOMEDS::Study_var aStudy = aStudyManager->GetStudyByID( studyId );
-  if (CORBA::is_nil(aStudy))
-    return aResult._retn();
-  SALOMEDS::SComponent_var aComponent = aStudy->FindComponent("GEOM");
-  if (CORBA::is_nil(aComponent))
-    return aResult._retn();
-  SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(aComponent); // check only published shapes
-
-  GEOM::GEOM_IInsertOperations_var aInsOp    = GetIInsertOperations(aStudy->StudyId());
-  if (aInsOp->_is_nil()) {
-    MESSAGE("No insert operations!");
-    return aResult._retn();
-  }
-
-  GEOM::GEOM_Object_var shapeObj;
-  
-  for(; anIter->More(); anIter->Next()) {
-    SALOMEDS::SObject_var aSO = anIter->Value();
-    SALOMEDS::SObject_var aRefSO;
-    // export only not referenced objects, or referenced outside of GEOM
-    if (!aSO->ReferencedObject(aRefSO) || aRefSO->GetFatherComponent()->GetID() != aComponent->GetID()) {
-      CORBA::Object_var anObj = aSO->GetObject();
-      if (!CORBA::is_nil(anObj)) {
-        GEOM::GEOM_Object_var aCORBAMainShape = GEOM::GEOM_Object::_narrow(anObj);
-        if(!aCORBAMainShape->_is_nil()) {
-          CORBA::String_var entry = aCORBAMainShape->GetEntry();
-          Handle(GEOM_Object) aMainShape = Handle(GEOM_Object)::DownCast(_impl->GetObject(studyId, entry));
-
-          GEOM::shape_type aCORBAShapeType = aCORBAMainShape->GetShapeType();
-          if (!aMainShape.IsNull() && !(aCORBAShapeType == GEOM::VERTEX) && !(aCORBAShapeType == GEOM::EDGE)) {
-            shapeObj = aCORBAMainShape;
-            break;
-          }
-        }
-      }
-    }
-  }
-
-  if (!CORBA::is_nil(shapeObj)) { // Shape is correct, write it to the temporary file
-    std::string aPath = Kernel_Utils::GetTmpFileName() + ".xao";
-    aInsOp->Export(shapeObj.in(), aPath.c_str(), "XAO");
-    aResult->length(1);
-    Engines::DataContainer_var aData = (new Engines_DataContainer_i(
-                    aPath.c_str(), "", "", true))->_this();
-    aResult[0] = aData;
-  } else {
-    MESSAGE("No shapes to export");
-  }
-
-  return aResult._retn();
-}
-                                                               
 //=======================================================================
 // function : GetDependencyTree
 // purpose  : Collects dependencies of the given objects from other ones
 //=======================================================================
 SALOMEDS::TMPFile* GEOM_Gen_i::GetDependencyTree( SALOMEDS::Study_ptr theStudy,
-                                                 const GEOM::string_array& theObjectEntries ) {
+                                                  const GEOM::string_array& theObjectEntries ) {
   // fill in the tree structure
   GEOMUtils::TreeModel tree;
 
@@ -3102,7 +2958,7 @@ SALOMEDS::TMPFile* GEOM_Gen_i::GetDependencyTree( SALOMEDS::Study_ptr theStudy,
   // translation the tree into string
   std::string treeStr;
   GEOMUtils::ConvertTreeToString( tree, treeStr );
-  
+
   // put string into stream
   char* aBuffer = (char*)CORBA::string_dup(treeStr.c_str());
   int aBufferSize = strlen((char*)aBuffer);
@@ -3118,10 +2974,10 @@ SALOMEDS::TMPFile* GEOM_Gen_i::GetDependencyTree( SALOMEDS::Study_ptr theStudy,
 // function : getUpwardDependency
 // purpose  : Collects the entries of objects on that the given one depends
 //=======================================================================
-void GEOM_Gen_i::getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo, 
-                                     GEOMUtils::LevelsList &upLevelList, 
-                                     std::map< std::string, std::set<std::string> > &passedEntries,
-                                     int level ) {
+void GEOM_Gen_i::getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
+                                      GEOMUtils::LevelsList &upLevelList,
+                                      std::map< std::string, std::set<std::string> > &passedEntries,
+                                      int level ) {
   std::string aGboEntry = gbo->GetEntry();
   GEOMUtils::NodeLinks anEntries;
   GEOMUtils::LevelInfo aLevelMap;
@@ -3133,7 +2989,7 @@ void GEOM_Gen_i::getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
       // get the existent map
       aLevelMap = upLevelList.at(level-1);
       if ( aLevelMap.count( aGboEntry ) > 0 ) {
-       anEntries = aLevelMap[ aGboEntry ];
+        anEntries = aLevelMap[ aGboEntry ];
       }
     }
   }
@@ -3144,7 +3000,7 @@ void GEOM_Gen_i::getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
     if ( depList[j]->_is_nil() )
       continue;
     aDepEntry = depList[j]->GetEntry();
-    if ( passedEntries.count( aGboEntry ) > 0 && 
+    if ( passedEntries.count( aGboEntry ) > 0 &&
          passedEntries[aGboEntry].count( aDepEntry ) > 0 ) {
       //avoid checking the passed objects
       continue;
@@ -3166,10 +3022,10 @@ void GEOM_Gen_i::getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
 // function : getDownwardDependency
 // purpose  : Collects the entries of objects that depends on the given one
 //=======================================================================
-void GEOM_Gen_i::getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo, 
-                                       GEOMUtils::LevelsList &downLevelList, 
-                                       std::map< std::string, std::set<std::string> > &passedEntries,
-                                       int level ) {
+void GEOM_Gen_i::getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
+                                        GEOMUtils::LevelsList &downLevelList,
+                                        std::map< std::string, std::set<std::string> > &passedEntries,
+                                        int level ) {
   std::string aGboEntry = gbo->GetEntry();
   Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument(gbo->GetStudyID());
   Handle(TDataStd_TreeNode) aNode, aRoot;
@@ -3201,7 +3057,7 @@ void GEOM_Gen_i::getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
           continue;
         if ( depList[i]->_is_equivalent( gbo ) ) {
           // yes, the current object depends on the given object
-          if ( passedEntries.count( aGoEntry ) > 0 && 
+          if ( passedEntries.count( aGoEntry ) > 0 &&
                passedEntries[aGoEntry].count( aGboEntry ) > 0 ) {
             //avoid checking the passed objects
             continue;
@@ -3234,10 +3090,10 @@ void GEOM_Gen_i::getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
 // purpose  : Fills 3 lists that is used to clean study of redundant objects
 //==============================================================================
 void GEOM_Gen_i::GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy,
-                                       GEOM::string_array& theSelectedEntries,
-                                       GEOM::string_array& theParentEntries,
-                                       GEOM::string_array& theSubEntries,
-                                       GEOM::string_array& theOtherEntries)
+                                        GEOM::string_array& theSelectedEntries,
+                                        GEOM::string_array& theParentEntries,
+                                        GEOM::string_array& theSubEntries,
+                                        GEOM::string_array& theOtherEntries)
 {
   std::set<std::string> aSelected, aParents, aChildren, anOthers;
   for ( int i = 0; i < theSelectedEntries.length(); i++ ) {
@@ -3271,7 +3127,7 @@ void GEOM_Gen_i::GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy,
       if ( aSelected.count( anEntry ) > 0 &&
            aParents.count( anEntry ) == 0 ) {
         includeParentDependencies( geomObj, aSelected, aParents, aChildren, anOthers );
-      } else if ( aParents.count( anEntry ) == 0 && 
+      } else if ( aParents.count( anEntry ) == 0 &&
                   aChildren.count( anEntry ) == 0 ) {
         anOthers.insert( geomObj->GetEntry() );
       }
@@ -3288,7 +3144,7 @@ void GEOM_Gen_i::GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy,
     }
 
     // if some selected object is not a main shape,
-    // we move it's main shapes into 'selected' list, 
+    // we move it's main shapes into 'selected' list,
     // because they could not be modified anyhow.
     std::set<std::string> aToBeInSelected;
     for ( it = aSelected.begin(); it != aSelected.end(); ++it ) {
@@ -3341,13 +3197,13 @@ void GEOM_Gen_i::GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy,
 
 //==============================================================================
 // function : includeParentDependencies
-// purpose  : 
+// purpose  :
 //==============================================================================
 void GEOM_Gen_i::includeParentDependencies(GEOM::GEOM_BaseObject_ptr geomObj,
-                                          std::set<std::string>& aSelected,
-                                          std::set<std::string>& aParents,
-                                          std::set<std::string>& aChildren,
-                                          std::set<std::string>& anOthers)
+                                           std::set<std::string>& aSelected,
+                                           std::set<std::string>& aParents,
+                                           std::set<std::string>& aChildren,
+                                           std::set<std::string>& anOthers)
 {
   std::string anEntry = geomObj->GetEntry();
   if ( aSelected.count( anEntry ) == 0 ) {
@@ -3369,10 +3225,10 @@ void GEOM_Gen_i::includeParentDependencies(GEOM::GEOM_BaseObject_ptr geomObj,
   for( int i = 0; i < depList->length(); i++ ) {
     aDepEntry = depList[i]->GetEntry();
     if ( depList[i]->_is_nil() ||
-        aDepEntry == anEntry ||             // skip self-depending
-        aSelected.count( aDepEntry ) > 0 || // skip selected objects
-        aParents.count( aDepEntry ) > 0     // skip already processed objects
-        )
+         aDepEntry == anEntry ||             // skip self-depending
+         aSelected.count( aDepEntry ) > 0 || // skip selected objects
+         aParents.count( aDepEntry ) > 0     // skip already processed objects
+         )
       continue;
     includeParentDependencies( depList[i], aSelected, aParents, aChildren, anOthers );
   }
@@ -3380,14 +3236,14 @@ void GEOM_Gen_i::includeParentDependencies(GEOM::GEOM_BaseObject_ptr geomObj,
 
 //==============================================================================
 // function : includeSubObjects
-// purpose  : 
+// purpose  :
 //==============================================================================
 void GEOM_Gen_i::includeSubObjects(SALOMEDS::Study_ptr theStudy,
-                                  const std::string& aSelectedEntry,
-                                  std::set<std::string>& aSelected,
-                                  std::set<std::string>& aParents,
-                                  std::set<std::string>& aChildren,
-                                  std::set<std::string>& anOthers)
+                                   const std::string& aSelectedEntry,
+                                   std::set<std::string>& aSelected,
+                                   std::set<std::string>& aParents,
+                                   std::set<std::string>& aChildren,
+                                   std::set<std::string>& anOthers)
 {
   std::set<std::string>::iterator foundIt;
   Handle(GEOM_BaseObject) handle_object = _impl->GetObject( theStudy->StudyId(), aSelectedEntry.c_str(), false);
@@ -3412,10 +3268,10 @@ void GEOM_Gen_i::includeSubObjects(SALOMEDS::Study_ptr theStudy,
     if ( foundIt == aParents.end() ) { // add to sub-objects if it is not in parents list
       foundIt = aSelected.find( aSubEntryStr );
       if ( foundIt == aSelected.end() ) { // add to sub-objects if it is not in selected list
-           aChildren.insert( aSubEntryStr );
-           foundIt = anOthers.find( aSubEntryStr );
-           if ( foundIt != anOthers.end() )
-             anOthers.erase( foundIt );
+            aChildren.insert( aSubEntryStr );
+            foundIt = anOthers.find( aSubEntryStr );
+            if ( foundIt != anOthers.end() )
+              anOthers.erase( foundIt );
       }
     }
     includeSubObjects( theStudy, aSubEntryStr, aSelected, aParents, aChildren, anOthers );
index f56712fb0283347405b45821e86d4a8db31beb05..25963bffdb06659f1bd2a55d217467587edf96cc 100644 (file)
@@ -201,7 +201,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
 
   //Collects dependencies of the given objects from other ones
   SALOMEDS::TMPFile* GetDependencyTree(SALOMEDS::Study_ptr theStudy,
-                                      const GEOM::string_array& theObjectEntries);
+                                       const GEOM::string_array& theObjectEntries);
 
   //-----------------------------------------------------------------------//
   // Transaction methods                                                   //
@@ -301,37 +301,30 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
   virtual char* getVersion();
 
   // Create a new folder object
-  SALOMEDS::SObject_ptr CreateFolder(const char* theName, 
-                                    SALOMEDS::SObject_ptr theFather);
+  SALOMEDS::SObject_ptr CreateFolder(const char* theName,
+                                     SALOMEDS::SObject_ptr theFather);
 
   // Move GEOM object to the specified folder
-  void MoveToFolder(GEOM::GEOM_Object_ptr theObject, 
-                   SALOMEDS::SObject_ptr theFolder);
+  void MoveToFolder(GEOM::GEOM_Object_ptr theObject,
+                    SALOMEDS::SObject_ptr theFolder);
 
   // Move list of GEOM objects to the specified folder
-  void MoveListToFolder (const GEOM::ListOfGO& theListOfGO, 
-                        SALOMEDS::SObject_ptr theFolder);
+  void MoveListToFolder (const GEOM::ListOfGO& theListOfGO,
+                         SALOMEDS::SObject_ptr theFolder);
 
   // Move objects to the specified position
   void Move( const GEOM::object_list& what,
-            SALOMEDS::SObject_ptr where,
-            CORBA::Long row );
-
-  // SIMAN-related functions (check out/check in) : import data to study
-  virtual Engines::ListOfIdentifiers* importData(CORBA::Long studyId,
-                                                Engines::DataContainer_ptr data,
-                                                const Engines::ListOfOptions& options);
-  // SIMAN-related functions (check out/check in) : get modified data
-  virtual Engines::ListOfData* getModifiedData(CORBA::Long studyId);
+             SALOMEDS::SObject_ptr where,
+             CORBA::Long row );
 
   /*! \brief Fills 3 lists that is used to clean study of redundant objects.
    *         To be used from GUI.
    */
   void GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy,
-                              GEOM::string_array& theSelectedEntries,
-                              GEOM::string_array& theParentEntries,
-                              GEOM::string_array& theSubEntries,
-                              GEOM::string_array& theOtherEntries);
+                               GEOM::string_array& theSelectedEntries,
+                               GEOM::string_array& theParentEntries,
+                               GEOM::string_array& theSubEntries,
+                               GEOM::string_array& theOtherEntries);
 
   //-----------------------------------------------------------------------//
   // Internal methods                                                      //
@@ -381,28 +374,28 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
                              const Standard_CString& GrName,
                              GEOM::ListOfGO_var aResList);
 
-  void getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo, 
-                            GEOMUtils::LevelsList &upLevelList,  
-                           std::map< std::string, std::set<std::string> > &passedEntries,
+  void getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
+                            GEOMUtils::LevelsList &upLevelList,
+                            std::map< std::string, std::set<std::string> > &passedEntries,
                             int level = 0 );
 
-  void getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo, 
-                              GEOMUtils::LevelsList &downLevelList, 
-                             std::map< std::string, std::set<std::string> > &passedEntries,
+  void getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
+                              GEOMUtils::LevelsList &downLevelList,
+                              std::map< std::string, std::set<std::string> > &passedEntries,
                               int level = 0 );
 
   void includeParentDependencies(GEOM::GEOM_BaseObject_ptr gbo,
-                                std::set<std::string>& aSelected,
-                                std::set<std::string>& aParents, 
-                                std::set<std::string>& aChildren, 
-                                std::set<std::string>& anOthers);
+                                 std::set<std::string>& aSelected,
+                                 std::set<std::string>& aParents,
+                                 std::set<std::string>& aChildren,
+                                 std::set<std::string>& anOthers);
 
   void includeSubObjects(SALOMEDS::Study_ptr theStudy,
-                        const std::string& aSelectedEntry,
-                        std::set<std::string>& aSelected,
-                        std::set<std::string>& aParents, 
-                        std::set<std::string>& aChildren, 
-                        std::set<std::string>& anOthers);
+                         const std::string& aSelectedEntry,
+                         std::set<std::string>& aSelected,
+                         std::set<std::string>& aParents,
+                         std::set<std::string>& aChildren,
+                         std::set<std::string>& anOthers);
 
   void LoadPlugin(const std::string& theLibName);
 
index 3d5969f71571ec7c954cdfb0fc6ce5204e2cb123..41b415ded85820cca037777466bb8d5a5fcc77ad 100644 (file)
@@ -987,6 +987,7 @@ GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
                                   GEOM::GEOM_Object_ptr  thePath,
                                   CORBA::Boolean         theWithContact,
                                   CORBA::Boolean         theWithCorrections,
+                                  CORBA::Boolean         IsBySteps,
                                   CORBA::Boolean         IsGenerateGroups)
 {
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
@@ -1029,7 +1030,7 @@ GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
     GetOperations()->MakePipeWithDifferentSections
               (aSeqBases, aSeqLocations,
                aPath, theWithContact,
-               theWithCorrections, IsGenerateGroups);
+               theWithCorrections, IsBySteps, IsGenerateGroups);
   if (!GetOperations()->IsDone() || aHSeq.IsNull())
     return aSeq._retn();
 
index d5d8ea84793a7c247cc8304019dc9398b880c9ed..3fe2951eb52c1a35e48cfbacef6d90024a150e5d 100644 (file)
@@ -186,6 +186,7 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
                                   GEOM::GEOM_Object_ptr  thePath,
                                   CORBA::Boolean         theWithContact,
                                   CORBA::Boolean         theWithCorrections,
+                                  CORBA::Boolean         IsBySteps,
                                   CORBA::Boolean         IsGenerateGroups);
 
   GEOM::ListOfGO* MakePipeWithShellSections
index 1dcf544f91f27d5f741e9745ab6372d57985a585..b48adfff4de063edbff06bc4f33d51e50d04c988 100644 (file)
@@ -135,7 +135,9 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnLinesIntersection
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurve
-                  (GEOM::GEOM_Object_ptr theCurve,  CORBA::Double theParameter)
+                  (GEOM::GEOM_Object_ptr theCurve,
+                   CORBA::Double         theParameter,
+                   CORBA::Boolean        takeOrientationIntoAccount)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -147,8 +149,8 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurve
   if (aReference.IsNull()) return aGEOMObject._retn();
 
   //Create the point
-  Handle(GEOM_Object) anObject =
-    GetOperations()->MakePointOnCurve(aReference, theParameter);
+  Handle(GEOM_Object) anObject = GetOperations()->MakePointOnCurve
+        (aReference, theParameter, takeOrientationIntoAccount);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
index ec55aee27574ae85e57a47530b8896f62b42e701..c3e1fa3ffda4d67ae4c0bd6114d093b7a1cbc306 100644 (file)
@@ -52,8 +52,10 @@ class GEOM_I_EXPORT GEOM_IBasicOperations_i :
                                                 CORBA::Double theY,
                                                 CORBA::Double theZ);
 
-   GEOM::GEOM_Object_ptr MakePointOnCurve (GEOM::GEOM_Object_ptr theCurve,
-                                          CORBA::Double theParameter);
+   GEOM::GEOM_Object_ptr MakePointOnCurve
+                      (GEOM::GEOM_Object_ptr theCurve,
+                                          CORBA::Double         theParameter,
+                       CORBA::Boolean        takeOrientationIntoAccount);
 
    GEOM::GEOM_Object_ptr MakePointOnCurveByLength (GEOM::GEOM_Object_ptr theCurve,
                                                   CORBA::Double         theLength,
index f75787a3c7317e1a65fdc78e04554c239331e68f..407d71f05f8c972ec0ab716d31181a70b6a0e0ec 100644 (file)
@@ -765,6 +765,49 @@ CORBA::Boolean GEOM_IMeasureOperations_i::CheckSelfIntersections (GEOM::GEOM_Obj
   return isGood;
 }
 
+//=============================================================================
+/*!
+ *  CheckSelfIntersectionsFast
+ */
+//=============================================================================
+CORBA::Boolean GEOM_IMeasureOperations_i::CheckSelfIntersectionsFast 
+  (GEOM::GEOM_Object_ptr theShape,
+   CORBA::Float          theDeflection,
+   CORBA::Double         theTolerance,
+   GEOM::ListOfLong_out  theIntersections)
+{
+  // Set a not done flag
+  GetOperations()->SetNotDone();
+
+  bool isGood = false;
+
+  // Allocate the CORBA arrays
+  GEOM::ListOfLong_var anIntegersArray = new GEOM::ListOfLong();
+
+  // Get the reference shape
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+
+  if (!aShape.IsNull()) {
+    Handle(TColStd_HSequenceOfInteger) anIntegers = new TColStd_HSequenceOfInteger;
+
+    // Detect self-intersections
+    isGood = GetOperations()->CheckSelfIntersectionsFast
+      (aShape, theDeflection, theTolerance, anIntegers);
+
+    int nbInts = anIntegers->Length();
+
+    anIntegersArray->length(nbInts);
+
+    for (int ii = 0; ii < nbInts; ii++) {
+      anIntegersArray[ii] = anIntegers->Value(ii + 1);
+    }
+  }
+
+  // Initialize out-parameters with local arrays
+  theIntersections = anIntegersArray._retn();
+  return isGood;
+}
+
 //=============================================================================
 /*!
  *  FastIntersect
index 27e2e5d429e67eacd5e4e4eb18d8e804df9ff2ed..71e6194bac7780562f53a23b4024fe35d34366cd 100644 (file)
@@ -100,6 +100,11 @@ class GEOM_I_EXPORT GEOM_IMeasureOperations_i :
                                          CORBA::Long           theCheckLevel,
                                          GEOM::ListOfLong_out  theIntersections);
 
+  CORBA::Boolean CheckSelfIntersectionsFast (GEOM::GEOM_Object_ptr theShape,
+                                            CORBA::Float          theDeflection,
+                                            CORBA::Double         theTolerance,
+                                            GEOM::ListOfLong_out  theIntersections);
+
   CORBA::Boolean FastIntersect (GEOM::GEOM_Object_ptr theShape1,
                                 GEOM::GEOM_Object_ptr theShape2,
                                 CORBA::Double         theTolerance,
index 1e88b88f904adebcd032ecf817d7cb1316ef6ab0..7561d9a168461e0fe90191c2214a5d216ddc28d9 100644 (file)
 #include <TColStd_HSequenceOfTransient.hxx>
 #include <TColStd_HArray1OfInteger.hxx>
 
+/**
+ * This function converts GEOM::comparison_condition type into
+ * GEOMUtils::ComparisonCondition type.
+ *
+ * \param theCondition the condition of GEOM::comparison_condition type
+ * \return the condition of GEOMUtils::ComparisonCondition type.
+ */
+static GEOMUtils::ComparisonCondition ComparisonCondition
+                    (const GEOM::comparison_condition theCondition)
+{
+  GEOMUtils::ComparisonCondition aResult = GEOMUtils::CC_GT;
+
+  switch (theCondition) {
+  case GEOM::CC_GE:
+    aResult = GEOMUtils::CC_GE;
+    break;
+  case GEOM::CC_LT:
+    aResult = GEOMUtils::CC_LT;
+    break;
+  case GEOM::CC_LE:
+    aResult = GEOMUtils::CC_LE;
+    break;
+  default:
+    break;
+  }
+
+  return aResult;
+}
+
 //=============================================================================
 /*!
  *   constructor:
@@ -2156,3 +2185,48 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSubShapeEdgeSorted
 
   return aSeq._retn();
 }
+
+//=============================================================================
+/*!
+ *  GetSubShapesWithTolerance
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSubShapesWithTolerance
+                     (GEOM::GEOM_Object_ptr      theShape,
+                      CORBA::Short               theShapeType,
+                      GEOM::comparison_condition theCondition,
+                      CORBA::Double              theTolerance)
+{
+  GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the reference objects
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+
+  if (aShape.IsNull()) {
+    return aSeq._retn();
+  }
+
+  //Get Shapes On Shape
+  const GEOMUtils::ComparisonCondition aCondition =
+                ComparisonCondition(theCondition);
+  Handle(TColStd_HSequenceOfTransient) aHSeq      =
+      GetOperations()->GetSubShapesWithTolerance
+                (aShape, theShapeType, aCondition, theTolerance);
+
+  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 f8dba7caf27354646c0b10cb899469831d97a535..0f36a38c3934aea05221cb243be714a0b59c1fd2 100644 (file)
@@ -300,6 +300,12 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
   GEOM::ListOfGO* GetSubShapeEdgeSorted (GEOM::GEOM_Object_ptr theShape,
                                          GEOM::GEOM_Object_ptr theStartPoint);
 
+  GEOM::ListOfGO* GetSubShapesWithTolerance
+                     (GEOM::GEOM_Object_ptr      theShape,
+                      CORBA::Short               theShapeType,
+                      GEOM::comparison_condition theCondition,
+                      CORBA::Double              theTolerance);
+
   ::GEOMImpl_IShapesOperations* GetOperations()
   { return (::GEOMImpl_IShapesOperations*)GetImpl(); }
 };
index c18c87b6c1588c31e85e18229ad5847b07cf0960..fbfe591f11d6f21f3a96c2bb0a93c95901977937 100644 (file)
@@ -1402,7 +1402,8 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MakeProjectionOnCylinder
                                    (GEOM::GEOM_Object_ptr theObject,
                                     CORBA::Double         theRadius,
                                     CORBA::Double         theStartAngle,
-                                    CORBA::Double         theAngleLength)
+                                    CORBA::Double         theAngleLength,
+                                    CORBA::Double         theAngleRotation)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -1418,7 +1419,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MakeProjectionOnCylinder
 
   //Perform the transformation
   Handle(GEOM_Object) aResObject = GetOperations()->MakeProjectionOnCylinder
-    (anObject, theRadius, theStartAngle, theAngleLength);
+    (anObject, theRadius, theStartAngle, theAngleLength, theAngleRotation);
 
   if (!GetOperations()->IsDone() || aResObject.IsNull()) {
     return aGEOMObject._retn();
index e507c1f7704cae94824c337bf16aabd8404feabd..96aa0c23df71ec0280c5e182c0928c68a669608c 100644 (file)
@@ -201,7 +201,8 @@ class GEOM_I_EXPORT GEOM_ITransformOperations_i :
                                    (GEOM::GEOM_Object_ptr theObject,
                                     CORBA::Double         theRadius,
                                     CORBA::Double         theStartAngle,
-                                    CORBA::Double         theAngleLength);
+                                    CORBA::Double         theAngleLength,
+                                    CORBA::Double         theAngleRotation);
 
   ::GEOMImpl_ITransformOperations* GetOperations() { return (::GEOMImpl_ITransformOperations*)GetImpl(); }
 };
index 8501474d80e79a0d858b3e47d9717ea648e2be75..662b2c76894adc3b0ed7a71bda8a0135934908eb 100644 (file)
@@ -722,7 +722,7 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointOnCurve (GEOM::GEOM_Object_ptr the
   beginService( " GEOM_Superv_i::MakePointOnCurve" );
   MESSAGE("GEOM_Superv_i::MakePointOnCurve");
   getBasicOp();
-  GEOM::GEOM_Object_ptr anObj = myBasicOp->MakePointOnCurve(theRefCurve, theParameter);
+  GEOM::GEOM_Object_ptr anObj = myBasicOp->MakePointOnCurve(theRefCurve, theParameter, false);
   endService( " GEOM_Superv_i::MakePointOnCurve" );
   return anObj;
 }
@@ -1512,7 +1512,7 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeWithDifferentSections
   beginService( " GEOM_Superv_i::MakePipeWithDifferentSections" );
   MESSAGE("GEOM_Superv_i::MakePipeWithDifferentSections");
   get3DPrimOp();
-  GEOM::ListOfGO_var aList = my3DPrimOp->MakePipeWithDifferentSections(theBases,theLocations, thePath,theWithContact,theWithCorrections, false);
+  GEOM::ListOfGO_var aList = my3DPrimOp->MakePipeWithDifferentSections(theBases,theLocations, thePath,theWithContact,theWithCorrections, false, false);
   endService( " GEOM_Superv_i::MakePipeWithDifferentSections" );
   return aList[0];
 }
@@ -3563,7 +3563,10 @@ void GEOM_Superv_i::ExportSTEP( GEOM::GEOM_Object_ptr theObject,
   beginService( " GEOM_Superv_i::ExportSTEP" );
   MESSAGE("GEOM_Superv_i::ExportSTEP");
   getSTEPPluginOp();
-  mySTEPOp->ExportSTEP( theObject, theFileName );
+
+  const GEOM::length_unit aUnit = GEOM::LU_METER;
+
+  mySTEPOp->ExportSTEP( theObject, theFileName, aUnit );
   endService( " GEOM_Superv_i::ExportSTEP" );
 }
 
index 47f2b6bcd64da75767caf6ffe8ce5aa33b5438a9..9fb94137638749e1f297f7057d8df96dba89a766 100644 (file)
@@ -109,6 +109,8 @@ from salome.geom.geomtools import getGeompy
 from salome.geom.structelem import parts
 from salome.geom.structelem.parts import InvalidParameterError
 
+import GEOM
+
 ## This class manages the structural elements in the study. It is used to
 #  create a new structural element from a list of commands. The parameter
 #  \em studyId defines the ID of the study in which the manager will create
index 5ab2f2474623bcf2ade57c6332b0d7704739b262..ae1e59d0f6f205947937b8dceba306f5495861b8 100644 (file)
@@ -361,7 +361,8 @@ class Beam(StructuralElementPart):
         face2 = self.geom.MakeFace(wire2, True)
         shell = self.geom.MakePipeWithDifferentSections([wire1, wire2],
                                                         [point1, point2],
-                                                        path, False, False)
+                                                        path, False, False,
+                                                        False)
         closedShell = self.geom.MakeShell([face1, face2, shell])
         solid = self.geom.MakeSolid([closedShell])
         return solid
index 683918508d443c7bd99d9b868e9f39194bb8654f..ea862293f2ab957bf8dfbef186691895e3e96ed7 100644 (file)
@@ -584,5 +584,11 @@ def TestAll (geompy, math):
   geompy.GetSubShapeEdgeSorted(Sketcher3d_1, p2, "OrderedEdges")
   geompy.GetSubShapeEdgeSorted(Sketcher3d_2, p3, "OrderedEdges")
 
+  # GetSubShapesWithTolerance
+  geompy.GetSubShapesWithTolerance(Box, GEOM.FACE, GEOM.CC_GT, 1.e-8, "gt")
+  geompy.GetSubShapesWithTolerance(Box, GEOM.FACE, GEOM.CC_GE, 1.e-7, "ge")
+  geompy.GetSubShapesWithTolerance(Box, GEOM.FACE, GEOM.CC_LT, 2.e-7, "lt")
+  geompy.GetSubShapesWithTolerance(Box, GEOM.FACE, GEOM.CC_LE, 1.e-7, "le")
+
 
   print "DONE"
index 87c9a0d1104fb2cbf075fcd59fb165d609a04597..7ad571552f9104b8b77ad2422c0a9cf514ac96cf 100644 (file)
@@ -33,8 +33,12 @@ def TestMeasureOperations (geompy, math):
   p678 = geompy.MakeVertex(60, 70, 80)
   p789 = geompy.MakeVertex(70, 80, 90)
 
+  vz = geompy.MakeVectorDXDYDZ(0, 0, 1)
+
   cube = geompy.MakeBoxTwoPnt(p678, p789)
 
+  cylinder = geompy.MakeCylinder(p0, vz, 5, 70)
+
   ####### PointCoordinates #######
 
   Coords = geompy.PointCoordinates(p137)
@@ -52,18 +56,20 @@ def TestMeasureOperations (geompy, math):
 
   ####### Detect Self-intersections #######
 
-  [Face_1,Face_2] = geompy.SubShapes(box, [33, 23])
-  Translation_1 = geompy.MakeTranslation(Face_1, 5, -15, -40)
-  Compound_1 = geompy.MakeCompound([Face_2, Translation_1])
-  if geompy.CheckSelfIntersections(Compound_1) == True:
+  selfIntersected = geompy.MakeCompound([box, cylinder])
+  if geompy.CheckSelfIntersections(selfIntersected):
     raise RuntimeError, "Existing self-intersection is not detected"
 
-  ####### Detect Fast intersection #######
+  ####### Detect Self-intersections fast #######
+
+  if salome_version.getXVersion() > "0x70600":
+    if geompy.CheckSelfIntersectionsFast(selfIntersected):
+      raise RuntimeError, "Existing self-intersection is not detected"
+
+  ####### Fast intersection #######
 
-  if salome_version.getXVersion() > "0x70501":
-    cylinder = geompy.MakeCylinderRH(100, 300)
-    if geompy.FastIntersect(box, cylinder)[0] == False:
-      raise RuntimeError, "Existing intersection is not detected"
+  if not geompy.FastIntersect(box, cylinder)[0]:
+    raise RuntimeError, "Existing intersection is not detected"
 
   ####### WhatIs #######
 
index 5501013f60e6747ff59d7053d7b59372449e6fbf..1ee4fc6c79a8d9f6c62150d482e1e682807e6400 100644 (file)
@@ -19,6 +19,7 @@
 #
 
 from GEOM import ISTEPOperations
+import GEOM
 
 # Engine Library Name
 __libraryName__ = "STEPPluginEngine"
@@ -30,17 +31,19 @@ def GetSTEPPluginOperations(self):
 ## Export the given shape into a file with given name in STEP format.
 #  @param theObject Shape to be stored in the file.
 #  @param theFileName Name of the file to store the given shape in.
+#  @param theUnit the length unit (see GEOM::length_unit). In meters by default.
 #  @ingroup l2_import_export
-def ExportSTEP(self, theObject, theFileName):
+def ExportSTEP(self, theObject, theFileName, theUnit=GEOM.LU_METER):
     """
     Export the given shape into a file with given name in STEP format.
 
     Parameters: 
         theObject Shape to be stored in the file.
         theFileName Name of the file to store the given shape in.
+        theUnit the length unit (see GEOM::length_unit). In meters by default.
     """
     anOp = GetSTEPPluginOperations(self)
-    anOp.ExportSTEP(theObject, theFileName)
+    anOp.ExportSTEP(theObject, theFileName, theUnit)
     if anOp.IsDone() == 0:
         raise RuntimeError,  "Export : " + anOp.GetErrorCode()
         pass
index f932a632a2147d3fdb7c85af77f1f971c30c5b88..0f90ef502729c5cd536a1c8c0cf915e1220f8f15 100644 (file)
@@ -295,7 +295,7 @@ def ManageTransactions(theOpeName):
 ## Raise an Error, containing the Method_name, if Operation is Failed
 ## @ingroup l1_geomBuilder_auxiliary
 def RaiseIfFailed (Method_name, Operation):
-    if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
+    if not Operation.IsDone() and Operation.GetErrorCode() != "NOT_FOUND_ANY":
         raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
 
 ## Return list of variables value from salome notebook
@@ -600,6 +600,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  - EDGE:                                                 [nb_vertices]
         #
         #  - VERTEX:       [x  y  z]
+        #
+        #  - LCS:          [x y z  xx xy xz  yx yy yz  zx zy zz]
         #  @ingroup l1_geomBuilder_auxiliary
         kind = GEOM.GEOM_IKindOfShape
 
@@ -1148,6 +1150,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         ## Create a point, corresponding to the given parameter on the given curve.
         #  @param theRefCurve The referenced curve.
         #  @param theParameter Value of parameter on the referenced curve.
+        #  @param takeOrientationIntoAccount flag that tells if it is necessary
+        #         to take the curve's orientation into account for the
+        #         operation. I.e. if this flag is set, the results for the same
+        #         parameters (except the value 0.5) is different for forward
+        #         and reversed curves. If it is not set the result is the same.
         #  @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.
@@ -1156,13 +1163,20 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_creation_point "Example"
         @ManageTransactions("BasicOp")
-        def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
+        def MakeVertexOnCurve(self, theRefCurve, theParameter,
+                              takeOrientationIntoAccount=False, theName=None):
             """
             Create a point, corresponding to the given parameter on the given curve.
 
             Parameters:
                 theRefCurve The referenced curve.
                 theParameter Value of parameter on the referenced curve.
+                takeOrientationIntoAccount flag that tells if it is necessary
+                        to take the curve's orientation into account for the
+                        operation. I.e. if this flag is set, the results for
+                        the same parameters (except the value 0.5) is different
+                        for forward and reversed curves. If it is not set
+                        the result is the same.
                 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.
@@ -1174,8 +1188,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
             """
             # Example: see GEOM_TestAll.py
-            theParameter, Parameters = ParseParameters(theParameter)
-            anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
+            theParameter, takeOrientationIntoAccount, Parameters = ParseParameters(
+                theParameter, takeOrientationIntoAccount)
+            anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter,
+                                                  takeOrientationIntoAccount)
             RaiseIfFailed("MakePointOnCurve", self.BasicOp)
             anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "vertex")
@@ -2398,7 +2414,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
               anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
             else:
               anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
-            RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
+            RaiseIfFailed("MakeCurveParametric", self.CurvesOp)
             anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "curve")
             return anObj
@@ -4023,7 +4039,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
                                                               theLocations, thePath,
                                                               theWithContact, theWithCorrection,
-                                                              IsGenerateGroups)
+                                                              False, IsGenerateGroups)
             RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
 
             if IsGenerateGroups:
@@ -4033,6 +4049,43 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(aList[0], theName, "pipe")
             return aList[0]
 
+        ## Create a shape by extrusion of the profile shape along
+        #  the path shape. This function is a version of
+        #  MakePipeWithDifferentSections() with the same parameters, except
+        #  eliminated theWithContact and theWithCorrection. So it is
+        #  possible to find the description of all parameters is in this
+        #  method. The difference is that this method performs the operation
+        #  step by step, i.e. it creates pipes between each pair of neighbor
+        #  sections and fuses them into a single shape.
+        #
+        #  @ref tui_creation_pipe_with_diff_sec "Example"
+        @ManageTransactions("PrimOp")
+        def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
+                                                 theLocations, thePath,
+                                                 IsGenerateGroups=False, theName=None):
+            """
+            Create a shape by extrusion of the profile shape along
+            the path shape. This function is a version of
+            MakePipeWithDifferentSections() with the same parameters, except
+            eliminated theWithContact and theWithCorrection. So it is
+            possible to find the description of all parameters is in this
+            method. The difference is that this method performs the operation
+            step by step, i.e. it creates pipes between each pair of neighbor
+            sections and fuses them into a single shape.
+            """
+            aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
+                                                              theLocations, thePath,
+                                                              False, False,
+                                                              True, IsGenerateGroups)
+            RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
+
+            if IsGenerateGroups:
+              self._autoPublish(aList, theName, "pipe")
+              return aList
+
+            self._autoPublish(aList[0], theName, "pipe")
+            return aList[0]
+
         ## Create a shape by extrusion of the profile shape along
         #  the path shape. The path shape can be a wire or an edge.
         #  the several profiles can be specified in the several locations of path.
@@ -4626,7 +4679,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created face.
+        #  @return New GEOM.GEOM_Object, containing the created face (compound of faces).
         #
         #  @ref tui_creation_face "Example"
         @ManageTransactions("ShapesOp")
@@ -4646,7 +4699,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created face.
+                New GEOM.GEOM_Object, containing the created face (compound of faces).
             """
             # Example: see GEOM_TestAll.py
             anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
@@ -4668,7 +4721,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created face.
+        #  @return New GEOM.GEOM_Object, containing the created face (compound of faces).
         #
         #  @ref tui_creation_face "Example"
         @ManageTransactions("ShapesOp")
@@ -4688,7 +4741,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created face.
+                New GEOM.GEOM_Object, containing the created face (compound of faces).
             """
             # Example: see GEOM_TestAll.py
             anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
@@ -4787,7 +4840,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created shell.
+        #  @return New GEOM.GEOM_Object, containing the created shell (compound of shells).
         #
         #  @ref tui_creation_shell "Example"
         @ManageTransactions("ShapesOp")
@@ -4802,7 +4855,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created shell.
+                New GEOM.GEOM_Object, containing the created shell (compound of shells).
             """
             # Example: see GEOM_TestAll.py
             anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
@@ -6521,6 +6574,57 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(ListObj, theName, "SortedEdges")
             return ListObj
 
+        ##
+        # Return the list of subshapes that satisfies a certain tolerance
+        # criterion. The user defines the type of shapes to be returned, the
+        # condition and the tolerance value. The operation is defined for
+        # faces, edges and vertices only. E.g. for theShapeType FACE,
+        # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
+        # all faces of theShape that have tolerances greater then 1.e7.
+        #
+        #  @param theShape the shape to be exploded
+        #  @param theShapeType the type of sub-shapes to be returned (see
+        #         ShapeType()). Can have the values FACE, EDGE and VERTEX only.
+        #  @param theCondition the condition type (see GEOM::comparison_condition).
+        #  @param theTolerance the tolerance filter.
+        #  @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 the list of shapes that satisfy the conditions.
+        #
+        #  @ref swig_GetSubShapesWithTolerance "Example"
+        @ManageTransactions("ShapesOp")
+        def GetSubShapesWithTolerance(self, theShape, theShapeType,
+                                      theCondition, theTolerance, theName=None):
+            """
+            Return the list of subshapes that satisfies a certain tolerance
+            criterion. The user defines the type of shapes to be returned, the
+            condition and the tolerance value. The operation is defined for
+            faces, edges and vertices only. E.g. for theShapeType FACE,
+            theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
+            all faces of theShape that have tolerances greater then 1.e7.
+            
+            Parameters:
+                theShape the shape to be exploded
+                theShapeType the type of sub-shapes to be returned (see
+                             ShapeType()). Can have the values FACE,
+                             EDGE and VERTEX only.
+                theCondition the condition type (see GEOM::comparison_condition).
+                theTolerance the tolerance filter.
+                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:
+                The list of shapes that satisfy the conditions.
+            """
+            # Example: see GEOM_TestAll.py
+            ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
+                                                              theCondition, theTolerance)
+            RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
+            self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
+            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).
@@ -9581,6 +9685,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         The angle in which to project the total length of the wire.
         #         If it is negative the projection is not scaled and natural
         #         wire length is kept for the projection.
+        #  @param theAngleRotation The desired angle in radians between
+        #         the tangent vector to the first curve at the first point of
+        #         the theObject's projection in 2D space and U-direction of
+        #         cylinder's 2D space.
         #  @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.
@@ -9592,6 +9700,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @ref tui_projection "Example"
         def MakeProjectionOnCylinder (self, theObject, theRadius,
                                       theStartAngle=0.0, theAngleLength=-1.0,
+                                      theAngleRotation=0.0,
                                       theName=None):
             """
             Compute a wire or a face that represents a projection of the source
@@ -9608,6 +9717,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         to project the total length of the wire. If it is negative the
                         projection is not scaled and natural wire length is kept for
                         the projection.
+                theAngleRotation The desired angle in radians between
+                        the tangent vector to the first curve at the first
+                        point of the theObject's projection in 2D space and
+                        U-direction of cylinder's 2D space.
                 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.
@@ -9624,14 +9737,19 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             flagAngleLength = False
             if isinstance(theAngleLength,str):
                 flagAngleLength = True
-            theRadius, theStartAngle, theAngleLength, Parameters = ParseParameters(
-              theRadius, theStartAngle, theAngleLength)
+            flagAngleRotation = False
+            if isinstance(theAngleRotation,str):
+                flagAngleRotation = True
+            theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
+              theRadius, theStartAngle, theAngleLength, theAngleRotation)
             if flagStartAngle:
                 theStartAngle = theStartAngle*math.pi/180.
             if flagAngleLength:
                 theAngleLength = theAngleLength*math.pi/180.
+            if flagAngleRotation:
+                theAngleRotation = theAngleRotation*math.pi/180.
             anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
-                theStartAngle, theAngleLength)
+                theStartAngle, theAngleLength, theAngleRotation)
             RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
             anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "projection")
@@ -11257,6 +11375,37 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
             return IsValid
 
+        ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
+        #  @param theShape Shape to check.
+        #  @param theDeflection Linear deflection coefficient that specifies quality of tesselation:
+        #         - if \a theDeflection <= 0, default deflection 0.001 is used
+        #  @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
+        #         - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
+        #         - if \a theTolerance > 0, algorithm detects gaps
+        #  @return TRUE, if the shape contains no self-intersections.
+        #
+        #  @ref tui_check_self_intersections_fast_page "Example"
+        @ManageTransactions("MeasuOp")
+        def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
+            """
+            Detect self-intersections of the given shape with algorithm based on mesh intersections.
+
+            Parameters:
+                theShape Shape to check.
+                theDeflection Linear deflection coefficient that specifies quality of tesselation:
+                    - if theDeflection <= 0, default deflection 0.001 is used
+                theTolerance Specifies a distance between shapes used for detecting gaps:
+                    - if theTolerance <= 0, algorithm detects intersections (default behavior)
+                    - if theTolerance > 0, algorithm detects gaps
+            Returns:
+                TRUE, if the shape contains no self-intersections.
+            """
+            # Example: see GEOM_TestMeasures.py
+            (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
+            RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
+            return IsValid
+
         ## Detect intersections of the given shapes with algorithm based on mesh intersections.
         #  @param theShape1 First source object
         #  @param theShape2 Second source object
index 99e8d185699de1d616214165dd3ac84546aa9d51..8580ae6ebb0ca701bb4440cdcf9af7e7f60fcd71 100755 (executable)
 #
 
 INCLUDE(${SWIG_USE_FILE})
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
index b60f1dde6b0d767bff471d15b103adf154ae4376..ce182691f75bc0671171febe912bd8687165d0cd 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -90,7 +89,7 @@ SET(_moc_HEADERS
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(GenerationGUI_SOURCES
   GenerationGUI.cxx
index e6348707fda41bf6775651f9beff7c7bcd1212f2..884b75d9df6d13f052c41d1e0d76bc2aa1752beb 100644 (file)
@@ -209,7 +209,7 @@ void GenerationGUI_FillingDlg::initSelection()
   needTypes.push_back( TopAbs_COMPOUND );
 
   globalSelection( aTypes );
-  localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+  localSelection( needTypes );
 }
 
 //=================================================================================
index 33b43b09fb49b85ad2c4f82c940f233460f6abd5..c00a0c27529c5f17f8e9656c381d07284d956373 100644 (file)
 //=================================================================================
 GenerationGUI_PipeDlg::GenerationGUI_PipeDlg (GeometryGUI* theGeometryGUI, QWidget* parent,
                                               bool modal, Qt::WindowFlags fl)
-  : GEOMBase_Skeleton  (theGeometryGUI, parent, modal, fl),
-    myGenGroupCheckGP  (0),
-    myPrefixLblGP      (0),
-    myPrefixEditGP     (0),
-    myGenGroupCheckGMP (0),
-    myPrefixLblGMP     (0),
-    myPrefixEditGMP    (0)
+  : GEOMBase_Skeleton    (theGeometryGUI, parent, modal, fl),
+    myGenGroupCheckGP    (0),
+    myPrefixLblGP        (0),
+    myPrefixEditGP       (0),
+    myStepByStepCheckGMP (0),
+    myGenGroupCheckGMP   (0),
+    myPrefixLblGMP       (0),
+    myPrefixEditGMP      (0)
 {
   QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_PIPE")));
   QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
@@ -124,15 +125,18 @@ GenerationGUI_PipeDlg::GenerationGUI_PipeDlg (GeometryGUI* theGeometryGUI, QWidg
   // Add widgets for group generation
   QGridLayout *aLayoutGMP = (QGridLayout *)GroupMakePoints->GroupBox1->layout();
 
-  myGenGroupCheckGMP =
+  myStepByStepCheckGMP =
+    new QCheckBox(tr("GEOM_STEP_BY_STEP"), GroupMakePoints->GroupBox1);
+  myGenGroupCheckGMP   =
     new QCheckBox(tr("GEOM_GENERATE_GROUPS"), GroupMakePoints->GroupBox1);
-  myPrefixLblGMP     =
+  myPrefixLblGMP       =
     new QLabel (tr("GEOM_GROUP_NAME_PREFIX"), GroupMakePoints->GroupBox1);
-  myPrefixEditGMP    = new QLineEdit(GroupMakePoints->GroupBox1);
+  myPrefixEditGMP      = new QLineEdit(GroupMakePoints->GroupBox1);
 
-  aLayoutGMP->addWidget(myGenGroupCheckGMP, 8, 0, 1, 3);
-  aLayoutGMP->addWidget(myPrefixLblGMP,     9, 0, 1, 2);
-  aLayoutGMP->addWidget(myPrefixEditGMP,    9, 2);
+  aLayoutGMP->addWidget(myStepByStepCheckGMP, 8,  0, 1, 3);
+  aLayoutGMP->addWidget(myGenGroupCheckGMP,   9,  0, 1, 3);
+  aLayoutGMP->addWidget(myPrefixLblGMP,       10, 0, 1, 2);
+  aLayoutGMP->addWidget(myPrefixEditGMP,      10, 2);
 
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
@@ -201,8 +205,10 @@ void GenerationGUI_PipeDlg::Init()
   connect(GroupMakePoints->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(GroupMakePoints->CheckBox1, SIGNAL(clicked()), this, SLOT(processPreview()));
   connect(GroupMakePoints->CheckBox2, SIGNAL(clicked()), this, SLOT(processPreview()));
-  connect(myGenGroupCheckGP,  SIGNAL(toggled(bool)), this, SLOT(GenGroupClicked(bool)));
-  connect(myGenGroupCheckGMP, SIGNAL(toggled(bool)), this, SLOT(GenGroupClicked(bool)));
+  connect(myStepByStepCheckGMP,       SIGNAL(clicked()), this, SLOT(processPreview()));
+  connect(myGenGroupCheckGP,    SIGNAL(toggled(bool)), this, SLOT(GenGroupClicked(bool)));
+  connect(myGenGroupCheckGMP,   SIGNAL(toggled(bool)), this, SLOT(GenGroupClicked(bool)));
+  connect(myStepByStepCheckGMP, SIGNAL(toggled(bool)), this, SLOT(StepByStepClicked(bool)));
 
   initName(tr("GEOM_PIPE"));
   resize(100,100);
@@ -250,6 +256,7 @@ void GenerationGUI_PipeDlg::ConstructorsClicked( int constructorId )
     GroupPoints->hide();
     GroupMakePoints->show();
     GroupMakePoints->PushButton1->click();
+    myStepByStepCheckGMP->setChecked(false);
     myGenGroupCheckGMP->setChecked(false);
     resetGenGroup(myGenGroupCheckGMP, false, true);
     break;
@@ -273,7 +280,7 @@ void GenerationGUI_PipeDlg::SelectionTypeButtonClicked()
 {
   globalSelection();
   if ( GroupPoints->CheckButton1->isChecked() ) {
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
   } else {
     TColStd_MapOfInteger aMap;
     aMap.Add(GEOM_COMPOUND);
@@ -375,7 +382,7 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
     }
   }
   else if ( myEditCurrentArgument == GroupMakePoints->LineEdit2 ) {
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+    localSelection( TopAbs_VERTEX );
     QList<GEOM::GeomObjPtr> objects = getSelected( TopAbs_VERTEX, -1 );
     GEOMBase::Synchronize( myLocations, objects );
     if ( !myLocations.isEmpty() ) {
@@ -421,7 +428,7 @@ void GenerationGUI_PipeDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupPoints->LineEdit2;
 
     if ( GroupPoints->CheckButton1->isChecked() ) {
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+      localSelection( TopAbs_EDGE );
     } else {
       TColStd_MapOfInteger aMap;
       aMap.Add(GEOM_COMPOUND);
@@ -434,7 +441,7 @@ void GenerationGUI_PipeDlg::SetEditCurrentArgument()
   else if(send == GroupPoints->PushButton3) {
     myEditCurrentArgument = GroupPoints->LineEdit3;
     GroupPoints->CheckButton1->setEnabled(false);
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
 
   GroupMakePoints->PushButton1->setDown(false);
@@ -583,10 +590,16 @@ bool GenerationGUI_PipeDlg::execute (ObjectList& objects)
                    myGenGroupCheckGMP->isChecked();
       }
 
+      bool isWithContact    = GroupMakePoints->CheckBox1->isEnabled() &&
+                              GroupMakePoints->CheckBox1->isChecked();
+      bool isWithCorrection = GroupMakePoints->CheckBox2->isEnabled() &&
+                              GroupMakePoints->CheckBox2->isChecked();
+
       aList = anOper->MakePipeWithDifferentSections
-                          (myBaseGO.in(), myLocationsGO.in(), myPath.get(), 
-                           GroupMakePoints->CheckBox1->isChecked(), 
-                           GroupMakePoints->CheckBox2->isChecked(), doGroups);
+                          (myBaseGO.in(), myLocationsGO.in(), myPath.get(),
+                           isWithContact, isWithCorrection,
+                           myStepByStepCheckGMP->isChecked(),
+                           doGroups);
 
       if (aList->length() > 0) {
         if (doGroups) {
@@ -706,6 +719,16 @@ void GenerationGUI_PipeDlg::GenGroupClicked(bool isChecked)
   resetGenGroup((QCheckBox *)sender(), isChecked, false);
 }
 
+//=================================================================================
+// function : StepByStepClicked
+// purpose  : Slot to treat checking "Step-by-step generation" check box.
+//=================================================================================
+void GenerationGUI_PipeDlg::StepByStepClicked(bool isChecked)
+{
+  GroupMakePoints->CheckBox1->setEnabled(!isChecked);
+  GroupMakePoints->CheckBox2->setEnabled(!isChecked);
+}
+
 //=================================================================================
 // function : updateGenGroup
 // purpose  : Update "Generate groups" widgets depending on the path.
index 4b2d88efdff68b6e0e93233e77433d820b7a09a0..341fb18f4f08710a39a9b72ab9bf5742149c955f 100644 (file)
@@ -81,6 +81,7 @@ private:
   QCheckBox                         *myGenGroupCheckGP;
   QLabel                            *myPrefixLblGP;
   QLineEdit                         *myPrefixEditGP;
+  QCheckBox                         *myStepByStepCheckGMP;
   QCheckBox                         *myGenGroupCheckGMP;
   QLabel                            *myPrefixLblGMP;
   QLineEdit                         *myPrefixEditGMP;
@@ -95,6 +96,7 @@ private slots:
   void                               ConstructorsClicked( int );
   void                               SelectionTypeButtonClicked();
   void                               GenGroupClicked(bool);
+  void                               StepByStepClicked(bool);
 };
 
 #endif // GENERATIONGUI_PIPEDLG_H
index a7889f101cd89240db19b9a22ef310eb311e9a47..5c465f3bb44d0320b8bf50f92b94b9b13ee2c69b 100644 (file)
@@ -148,7 +148,7 @@ void GenerationGUI_PipePathDlg::SelectionTypeButtonClicked()
 {
   globalSelection();
   if (GroupPoints->CheckButton1->isChecked()) {
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   else {
     TColStd_MapOfInteger aMap;
@@ -269,7 +269,7 @@ void GenerationGUI_PipePathDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupPoints->LineEdit2;
 
     if (GroupPoints->CheckButton1->isChecked()) {
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+      localSelection(TopAbs_EDGE);
     }
     else {
       TColStd_MapOfInteger aMap;
@@ -284,7 +284,7 @@ void GenerationGUI_PipePathDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupPoints->LineEdit3;
 
     if (GroupPoints->CheckButton1->isChecked()) {
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+      localSelection(TopAbs_EDGE);
     }
     else {
       TColStd_MapOfInteger aMap;
index e2de726115184b83f83793e7a82e14f313b4ccc1..11cfd2c6e3120a7b1b177e53b012a7bc44cd9403 100644 (file)
@@ -446,7 +446,7 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupVecH->LineEdit2;
     GroupVecH->PushButton1->setDown(false);
     GroupVecH->LineEdit1->setEnabled(false);
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   else if (send == Group2Points->PushButton1) {
     myEditCurrentArgument = Group2Points->LineEdit1;
@@ -461,7 +461,7 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
     Group2Points->PushButton3->setDown(false);
     Group2Points->LineEdit1->setEnabled(false);
     Group2Points->LineEdit3->setEnabled(false);
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == Group2Points->PushButton3) {
     myEditCurrentArgument = Group2Points->LineEdit3;
@@ -469,7 +469,7 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
     Group2Points->PushButton2->setDown(false);
     Group2Points->LineEdit1->setEnabled(false);
     Group2Points->LineEdit2->setEnabled(false);
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else   if (send == GroupDXDYDZ->PushButton1) {
     myEditCurrentArgument = GroupDXDYDZ->LineEdit1;
index 61246cf1132dfc111a79233af4c2887c1a2c14c1..2d798fcbfafd8547a42eee2ca98e3049ecdd23f6 100644 (file)
@@ -234,7 +234,7 @@ void GenerationGUI_RevolDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupPoints->LineEdit2;
     GroupPoints->PushButton1->setDown(false);
     GroupPoints->LineEdit1->setEnabled(false);
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
index acf593702c81fbebe5b6adecd7cfee965a6d5ab8..08ace43678f9755f6b90d0a94d2c297558914315 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-#INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -39,6 +37,7 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/GEOMImpl
   ${PROJECT_SOURCE_DIR}/src/GEOMGUI
   ${PROJECT_SOURCE_DIR}/src/GEOMBase
+  ${PROJECT_SOURCE_DIR}/src/MeasureGUI
   ${PROJECT_SOURCE_DIR}/src/DlgRef
   ${PROJECT_BINARY_DIR}/src/DlgRef
   ${CMAKE_CURRENT_SOURCE_DIR}
@@ -56,6 +55,7 @@ ADD_DEFINITIONS(
 SET(_link_LIBRARIES
   GEOMBase
   GEOMUtils
+  MeasureGUI
   )
 
 # --- resources ---
@@ -80,12 +80,12 @@ SET(_moc_HEADERS
   )
 
 # header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
+QT_WRAP_UIC(_uic_HEADERS ${_uic_files})
 
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(GroupGUI_SOURCES
   GroupGUI.cxx
index 68b6314b1ce93b2cb29ad882df7fa9e2e9a6415d..c856096150462d128e40d21b502073a69a356c01 100644 (file)
@@ -31,6 +31,9 @@
 #include <GeometryGUI.h>
 #include <GEOM_Displayer.h>
 #include <GEOMUtils.hxx>
+#ifndef DISABLE_PLOT2DVIEWER
+#include <MeasureGUI_ShapeStatisticsDlg.h>
+#endif
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
@@ -85,7 +88,8 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW
     myBusy(false),
     myIsShapeType(false),
     myIsHiddenMain(false),
-    myWasHiddenMain(true)
+    myWasHiddenMain(true),
+    myIsAccept(false)
 {
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
 
@@ -200,6 +204,9 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW
   myLessFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
   myGreaterFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
   myApplyFilterButton = new QPushButton(tr("GEOM_BUT_APPLY"), myFilterGrp);
+#ifndef DISABLE_PLOT2DVIEWER
+  myPlotDistributionButton = new QPushButton(tr("GEOM_PLOT_DISTRIBUTION"), myFilterGrp);
+#endif
 
   QGridLayout* filterLayout = new QGridLayout(myFilterGrp);
   filterLayout->addWidget(myLessFilterCheck,    0, 0);
@@ -209,6 +216,9 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW
   filterLayout->addWidget(myGreaterFilterCombo, 1, 1);
   filterLayout->addWidget(myGreaterFilterSpin,  1, 2);
   filterLayout->addWidget(myApplyFilterButton,  0, 3);
+#ifndef DISABLE_PLOT2DVIEWER
+  filterLayout->addWidget(myPlotDistributionButton,  1, 3);
+#endif
 
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
@@ -226,10 +236,10 @@ GroupGUI_GroupDlg::~GroupGUI_GroupDlg()
   GEOM_Displayer* aDisplayer = getDisplayer();
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
   bool isHideObjects = resMgr->booleanValue( "Geometry", "hide_input_object", true);
-  if (myWasHiddenMain) {
+  if (myWasHiddenMain || ( isHideObjects && myIsAccept ) ) {
     myIsHiddenMain = true;
   }
-  else if (!isHideObjects) {
+  else {
     aDisplayer->Display(myMainObj);
     myIsHiddenMain = false;
   }
@@ -326,6 +336,9 @@ void GroupGUI_GroupDlg::Init()
   connect(myIdList,        SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged()));
 
   connect(myApplyFilterButton, SIGNAL(clicked()),         this, SLOT(ClickOnOkFilter()));
+#ifndef DISABLE_PLOT2DVIEWER
+  connect(myPlotDistributionButton, SIGNAL(clicked()),    this, SLOT(ClickOnPlot()));
+#endif
   connect(myLessFilterCheck,   SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
   connect(myGreaterFilterCheck,   SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
 
@@ -383,7 +396,8 @@ bool GroupGUI_GroupDlg::ClickOnApply()
     setIsDisplayResult( false );
   }
     
-  if (!onAccept(myMode == CreateGroup, true, isApplyAndClose()))
+  myIsAccept = onAccept(myMode == CreateGroup, true, isApplyAndClose());
+  if (!myIsAccept)
     return false;
 
   if(!isApplyAndClose()) {
@@ -434,7 +448,7 @@ void GroupGUI_GroupDlg::ActivateThisDialog()
 //=================================================================================
 void GroupGUI_GroupDlg::SetEditCurrentArgument()
 {
-  QPushButton* send = (QPushButton*)sender();
+  QPushButton* send = qobject_cast<QPushButton*>( sender() );
 
   if (send == mySelBtn) {
     myEditCurrentArgument = myMainName;
@@ -460,7 +474,8 @@ void GroupGUI_GroupDlg::SetEditCurrentArgument()
   //  activateSelection();
   if(myEditCurrentArgument) {
     myEditCurrentArgument->setFocus();
-    send->setDown(true);
+    if ( send )
+      send->setDown(true);
   }
 
   updateState();
@@ -866,6 +881,12 @@ int GroupGUI_GroupDlg::getSelectedSubshapes (TColStd_IndexedMapOfInteger& theMap
         TopoDS_Shape aShape;
         if (GEOMBase::GetShape(aGeomObj, aShape)) {
           if (aGeomObj->GetType() == GEOM_GROUP || aShape.ShapeType() == getShapeType()) {
+            if (subSelectionWay() != ALL_SUBSHAPES &&
+                GEOMBase::GetName(aGeomObj) == myShape2Name->text()) {
+              // Skip selected in place object.
+              continue;
+            }
+
             TopTools_IndexedMapOfShape aMainMap;
             TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myMainObj);
             TopExp::MapShapes(aMainShape, aMainMap);
@@ -1077,7 +1098,7 @@ void GroupGUI_GroupDlg::activateSelection()
           int index = aSubShapesMap.FindIndex(aSubShape);
           QString anEntry = QString( "TEMP_" ) + anEntryBase + QString("_%1").arg(index);
           Handle(SALOME_InteractiveObject) io =
-            new SALOME_InteractiveObject(anEntry.toAscii(), "GEOM", "TEMP_IO");
+            new SALOME_InteractiveObject(anEntry.toLatin1(), "GEOM", "TEMP_IO");
           if ( myGroupIdList.contains( index ) ) {
             aDisplayer->SetColor( aCol );
           }
@@ -1149,6 +1170,18 @@ void GroupGUI_GroupDlg::updateState (bool isAdd)
                           subSelectionWay() == ALL_SUBSHAPES &&
                           myIsShapeType &&
                           getShapeType() != TopAbs_VERTEX);
+  // manage of 'Plot' button access
+  GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+  GEOM::ListOfLong_var aSubShapes = aShOp->SubShapeAllIDs( myMainObj, getShapeType(), false );
+  bool hasCurrentEntities = aSubShapes->length() > 0;
+#ifndef DISABLE_PLOT2DVIEWER
+  myPlotDistributionButton->setEnabled( myFilterGrp->isEnabled() &&
+                                       myIsShapeType &&
+                                       ( getShapeType() == TopAbs_EDGE || 
+                                         getShapeType() == TopAbs_FACE ||
+                                         getShapeType() == TopAbs_SOLID ) &&
+                                       hasCurrentEntities );
+#endif
   if (subSelectionWay() == ALL_SUBSHAPES)
     setInPlaceObj(GEOM::GEOM_Object::_nil());
 }
@@ -1437,6 +1470,21 @@ void GroupGUI_GroupDlg::ClickOnOkFilter()
   updateState(true);
 }
 
+#ifndef DISABLE_PLOT2DVIEWER
+//=================================================================================
+// function : ClickOnPlot()
+// purpose  : opens "Shape Statistics" dialog box in order to plot sub-shapes distribution.
+//=================================================================================
+void GroupGUI_GroupDlg::ClickOnPlot()
+{
+  TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myMainObj);
+  QDialog* dlg = new MeasureGUI_ShapeStatisticsDlg( this, aMainShape, getShapeType() );
+  if ( dlg ) {
+    dlg->show();
+  }
+}
+#endif
+
 void GroupGUI_GroupDlg::MeasureToggled()
 {
   myLessFilterSpin->setEnabled(myLessFilterCheck->isChecked());
index ad8f4e1598b804debb903745d9184ebf7f1cdf5d..4a2385b042dfdd11053bd9ddd2a1b9398e7a8c14 100644 (file)
@@ -83,6 +83,9 @@ private slots:
   void                                showOnlySelected();
   void                                selectionChanged();
   void                                ClickOnOkFilter();
+#ifndef DISABLE_PLOT2DVIEWER
+  void                                ClickOnPlot();
+#endif
   void                                MeasureToggled();
 
 private:
@@ -112,6 +115,7 @@ private:
   TColStd_DataMapOfIntegerInteger     myMain2InPlaceIndices;
   QList<int>                          myGroupIdList;
   int                                 myDmMode;
+  bool                                myIsAccept;
 
   QPushButton*                        mySelBtn;
   QLineEdit*                          myMainName;
@@ -133,6 +137,7 @@ private:
   SalomeApp_DoubleSpinBox*            myLessFilterSpin;
   SalomeApp_DoubleSpinBox*            myGreaterFilterSpin;
   QPushButton*                        myApplyFilterButton;
+  QPushButton*                        myPlotDistributionButton;
   QGroupBox*                          myFilterGrp;
 };
 
index b380989f415c12ccb4a01b02398bf6c46f6fef78..dc97a326fdf489486194f50c9a31196717f4eb42 100644 (file)
@@ -18,8 +18,7 @@
 #
 
 IF(SALOME_BUILD_GUI)
-  INCLUDE(UseQt4Ext)
-  INCLUDE(${QT_USE_FILE})
+  INCLUDE(UseQtExt)
 ENDIF()
 
 # --- options ---
@@ -39,7 +38,6 @@ INCLUDE_DIRECTORIES(
   
 IF(SALOME_BUILD_GUI)
   INCLUDE_DIRECTORIES(
-    ${QT_INCLUDE_DIRS}
     ${GUI_INCLUDE_DIRS}
     ${PROJECT_SOURCE_DIR}/src/OBJECT
     ${PROJECT_SOURCE_DIR}/src/GEOMGUI
@@ -110,7 +108,7 @@ ENDIF()
 
 IF(SALOME_BUILD_GUI)
   # sources / moc wrappings
-  QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+  QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
   SET(IGESPluginGUI_SOURCES
     IGESPlugin_GUI.cxx
@@ -147,7 +145,7 @@ IF(SALOME_BUILD_GUI)
   TARGET_LINK_LIBRARIES(IGESPluginGUI ${_link_gui_LIBRARIES})
   INSTALL(TARGETS IGESPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
   
-  QT4_INSTALL_TS_RESOURCES("${IGESPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+  QT_INSTALL_TS_RESOURCES("${IGESPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
 ENDIF()
 
 
index cb667070f99dfe86f83d92a7b5a8ae55e24d42ea..a49db7ffc2e1cd0fc461be328bf45d37e6f1236b 100644 (file)
@@ -69,7 +69,7 @@ QString IGESPlugin_ExportDlg::getFileName( const QString& initial, const QString
 
   IGESPlugin_ExportDlg fd( parent );
   fd.setFileMode( AnyFile );
-  fd.setFilters( fls );
+  fd.setNameFilters( fls );
   fd.setWindowTitle( caption );
   if ( !tmpfilename.isEmpty() )
     fd.processPath( tmpfilename );
index da70682b75a9ca019dadd306703b7cdc0f5b9af0..f3dd0d0accb9861e2d67f5bc620e543e6d743cf9 100644 (file)
 #include "GEOM_Operation.h"
 #include "GEOMBase.h"
 #include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(IGESPlugin)
 
+typedef GEOM::GenericObjPtr<GEOM::IIGESOperations> IGESOpPtr;
+
 //=======================================================================
 // function : IGESPlugin_GUI()
 // purpose  : Constructor
@@ -109,8 +112,8 @@ bool IGESPlugin_GUI::importIGES( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "IGESPluginEngine" );
-  GEOM::IIGESOperations_var igesOp = GEOM::IIGESOperations::_narrow( op );
-  if ( CORBA::is_nil( igesOp ) ) return false;
+  IGESOpPtr igesOp = GEOM::IIGESOperations::_narrow( op );
+  if ( igesOp.isNull() ) return false;
 
   QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
                                                 tr( "IGES_FILES" ),
@@ -126,7 +129,7 @@ bool IGESPlugin_GUI::importIGES( SUIT_Desktop* parent )
     {
       QString fileName = fileNames.at( i );
       SUIT_OverrideCursor wc;
-      GEOM_Operation transaction( app, igesOp.in() );
+      GEOM_Operation transaction( app, igesOp.get() );
       bool ignoreUnits = false;
       
       try
@@ -182,6 +185,7 @@ bool IGESPlugin_GUI::importIGES( SUIT_Desktop* parent )
          entryList.append( so->GetID() );
          transaction.commit();
          GEOM_Displayer( study ).Display( main.in() );
+          main->UnRegister();
        }
        else
        {
@@ -221,8 +225,8 @@ bool IGESPlugin_GUI::exportIGES( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "IGESPluginEngine" );
-  GEOM::IIGESOperations_var igesOp = GEOM::IIGESOperations::_narrow( op );
-  if ( CORBA::is_nil( igesOp ) ) return false;
+  IGESOpPtr igesOp = GEOM::IIGESOperations::_narrow( op );
+  if ( igesOp.isNull() ) return false;
 
   LightApp_SelectionMgr* sm = app->selectionMgr();
   if ( !sm ) return false;
@@ -251,7 +255,7 @@ bool IGESPlugin_GUI::exportIGES( SUIT_Desktop* parent )
     
     SUIT_OverrideCursor wc;
     
-    GEOM_Operation transaction( app, igesOp.in() );
+    GEOM_Operation transaction( app, igesOp.get() );
     
     try
     {
index f8957e5623f27760bb64ac97c6353f560d40afcd..c7f0291abcbe94a8622757a3df3cb7eb17bffd6b 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(${QT_USE_FILE})
-
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
   ${CAS_INCLUDE_DIRS}
@@ -65,7 +62,7 @@ SET(_moc_HEADERS Material_ResourceMgr.h)
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(Material_SOURCES
   Material_Model.cxx
index c7ab327c1b6a1106bb32adfa9ae8b73f46cc047c..b5045cebe7d11fb09ff9fd95f993e80a845f4e1c 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-#INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -104,6 +102,7 @@ SET(MeasureGUI_HEADERS
   MeasureGUI_DimensionCreateTool.h
   MeasureGUI_DimensionInteractor.h
   MeasureGUI_DimensionFilter.h
+  MeasureGUI_definitions.h
   )
 
 # header files / to be processed by moc
@@ -130,14 +129,20 @@ SET(_moc_HEADERS
   MeasureGUI_CreateDimensionDlg.h
   MeasureGUI_DimensionInteractor.h
   )
+  
+IF(SALOME_USE_PLOT2DVIEWER)
+  LIST(APPEND _moc_HEADERS
+    MeasureGUI_ShapeStatisticsDlg.h
+    )
+ENDIF()
 
 # header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
+QT_WRAP_UIC(_uic_HEADERS ${_uic_files})
 
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(MeasureGUI_SOURCES
   MeasureGUI.cxx
@@ -167,10 +172,14 @@ SET(MeasureGUI_SOURCES
   ${_uic_files}
   )
 
+IF(SALOME_USE_PLOT2DVIEWER)
+  LIST(APPEND MeasureGUI_SOURCES
+    MeasureGUI_ShapeStatisticsDlg.cxx
+    )
+ENDIF()
+
 # --- rules ---
 
 ADD_LIBRARY(MeasureGUI ${MeasureGUI_SOURCES})
 TARGET_LINK_LIBRARIES(MeasureGUI ${_link_LIBRARIES})
 INSTALL(TARGETS MeasureGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-
-
index 37c8ed4b22d5b03ed74dec05fd373ec70be0c2af..d76f132ff0e1c04bc5b5c55afb302507d08e9ed3 100644 (file)
@@ -53,6 +53,9 @@
 #include "MeasureGUI_FastCheckIntersectionsDlg.h" // Method FAST CHECK INTERSCTIONS
 #include "MeasureGUI_PointDlg.h"                  // Method POINTCOORDINATES
 #include "MeasureGUI_ManageDimensionsDlg.h"       // Method MANAGEDIMENSIONS
+#ifndef DISABLE_PLOT2DVIEWER
+#include "MeasureGUI_ShapeStatisticsDlg.h"        // Method SHAPE STATISTICS
+#endif
 
 #include <QApplication>
 
@@ -129,6 +132,11 @@ bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
   case GEOMOp::OpFastCheckInters:
     dlg = new MeasureGUI_FastCheckIntersectionsDlg( getGeometryGUI(), parent );
     break; // FAST CHECK INTERSCTIONS
+#ifndef DISABLE_PLOT2DVIEWER
+  case GEOMOp::OpShapeStatistics:
+    dlg = new MeasureGUI_ShapeStatisticsDlg( parent );
+    break; // SHAPE STATISTICS
+#endif
   case GEOMOp::OpPointCoordinates:
     dlg = new MeasureGUI_PointDlg( getGeometryGUI(), parent );
     break; // POINT COORDINATES
index 64c51cc78b4d3213e4a9320e4ebcc8304b05b578..2d8de0fcc5f6609f412da43b40954539a7035fbf 100644 (file)
@@ -404,5 +404,5 @@ bool MeasureGUI_AngleDlg::isValid (QString& msg)
 void MeasureGUI_AngleDlg::activateSelection()
 {
   globalSelection(GEOM_LINE);
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+  localSelection( TopAbs_EDGE );
 }
index 56b10a09266558c06319c3dd6100fa6ed24c42b2..ddb2e566a5ee9e66e669c745f00530dfa63a3eb5 100644 (file)
@@ -307,11 +307,7 @@ bool MeasureGUI_BndBoxDlg::execute (ObjectList& objects)
 void MeasureGUI_BndBoxDlg::activateSelection()
 {
   globalSelection( GEOM_ALLSHAPES );
-  std::list<int> needTypes;
-  needTypes.push_back( TopAbs_SHAPE ), needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ); 
-  needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL );
-  needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPSOLID ), needTypes.push_back( TopAbs_COMPOUND );
-  localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+  localSelection( TopAbs_SHAPE );
 }
 
 //=================================================================================
index c2f5f92c1b317b376d38c69dae843202949c6e58..0fdecafde5dd57660cdbee7f778e182525500aa5 100644 (file)
@@ -131,11 +131,7 @@ void MeasureGUI_CenterMassDlg::Init()
 void MeasureGUI_CenterMassDlg::activateSelection()
 {
   globalSelection( GEOM_ALLSHAPES );
-  std::list<int> needTypes;
-  needTypes.push_back( TopAbs_SHAPE ), needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ); 
-  needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL );
-  needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPSOLID ), needTypes.push_back( TopAbs_COMPOUND );
-  localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+  localSelection( TopAbs_SHAPE );
 }
 
 //=================================================================================
index a07e919e5be3e09e1e073d784fc593d011e49051..27bebf1812220057758bd8ccd48a390de92e212f 100644 (file)
@@ -26,6 +26,7 @@
 #include "MeasureGUI_CheckSelfIntersectionsDlg.h"
 #include "MeasureGUI.h"
 
+#include <SUIT_MessageBox.h>
 #include <SUIT_OverrideCursor.h>
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 //=================================================================================
 MeasureGUI_CheckSelfIntersectionsDlg::MeasureGUI_CheckSelfIntersectionsDlg (GeometryGUI* GUI, QWidget* parent)
   : GEOMBase_Skeleton (GUI, parent, false),
-    myTextView        (0),
-    mySelButton       (0),
-    myEditObjName     (0),
+    myTextView1       (0),
+    myTextView2       (0),
+    mySelButton1      (0),
+    mySelButton2      (0),
+    myEditObjName1    (0),
+    myEditObjName2    (0),
     myLevelBox        (0),
-    myComputeButton   (0),
-    myInteList        (0),
-    myShapeList       (0)
+    myComputeButton1  (0),
+    myComputeButton2  (0),
+    myInteList1       (0),
+    myShapeList1      (0),
+    myInteList2       (0),
+    myShapeList2      (0),
+    myCurrConstrId    (-1)
 {
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
   QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_CHECK_SELF_INTERSECTIONS")));
   QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
+  QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FAST_CHECK_INTERSECTIONS")));
 
   setWindowTitle(tr("GEOM_CHECK_SELF_INTERSECTIONS"));
 
   /***************************************************************/
-  mainFrame()->GroupConstructors->setTitle(tr("GEOM_CHECK_SELF_INTERSECTIONS"));
+  mainFrame()->GroupConstructors->setTitle(tr("GEOM_CHECK_INTERSECT_TYPE"));
   mainFrame()->RadioButton1->setIcon(image0);
-  mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
-  mainFrame()->RadioButton2->close();
+  mainFrame()->RadioButton2->setIcon(image2);;
   mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
   mainFrame()->RadioButton3->close();
 
-  QGroupBox *aGrp      = new QGroupBox(tr("GEOM_CHECK_INFOS"));
-  QLabel    *anObjLbl  = new QLabel(tr("GEOM_OBJECT"));
-  QLabel    *anInteLbl = new QLabel(tr("GEOM_CHECK_INTE_INTERSECTIONS"));
-  QLabel    *aShapeLbl = new QLabel(tr("GEOM_CHECK_INTE_SUBSHAPES"));
-  QLabel    *aLevelLbl = new QLabel(tr("GEOM_CHECK_INTE_CHECK_LEVEL"));
-  QLabel    *aSummaryLbl = new QLabel(tr("GEOM_CHECK_INTE_SUMMARY"));
+  /***************************************************************/
+  /* SIMPLE SELF-INTERSECTION constructor
+  /***************************************************************/
+  mySimpleGrp             = new QGroupBox(tr("GEOM_CHECK_INFOS"));
+  QLabel    *anObjLbl    = new QLabel(tr("GEOM_OBJECT"));
+  QLabel    *anInteLbl   = new QLabel(tr("GEOM_CHECK_INTE_INTERSECTIONS"));
+  QLabel    *aShapeLbl   = new QLabel(tr("GEOM_CHECK_INTE_SUBSHAPES"));
+  QLabel    *aLevelLbl   = new QLabel(tr("GEOM_CHECK_INTE_CHECK_LEVEL"));
+  QLabel    *aSummaryLbl1 = new QLabel(tr("GEOM_CHECK_INTE_SUMMARY"));
   QFont      aFont (TEXTEDIT_FONT_FAMILY, TEXTEDIT_FONT_SIZE);
 
   aFont.setStyleHint(QFont::TypeWriter, QFont::PreferAntialias);
-  myTextView = new QTextBrowser;
-  myTextView->setReadOnly(true);
-  myTextView->setFont(aFont);
+  myTextView1 = new QTextBrowser;
+  myTextView1->setReadOnly(true);
+  myTextView1->setFont(aFont);
 
-  mySelButton = new QPushButton;
-  mySelButton->setIcon(image1);
-  mySelButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+  mySelButton1 = new QPushButton;
+  mySelButton1->setIcon(image1);
+  mySelButton1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
 
-  myEditObjName = new QLineEdit;
-  myEditObjName->setReadOnly(true);
+  myEditObjName1 = new QLineEdit;
+  myEditObjName1->setReadOnly(true);
 
   myLevelBox = new QComboBox;
 
-  myComputeButton = new QPushButton(tr("GEOM_CHECK_INTE_COMPUTE"));
+  myComputeButton1 = new QPushButton(tr("GEOM_CHECK_INTE_COMPUTE"));
 
 
-  myInteList  = new QListWidget;
-  myInteList->setSelectionMode(QAbstractItemView::ExtendedSelection);
-  myShapeList = new QListWidget;
-  myShapeList->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  myInteList1  = new QListWidget;
+  myInteList1->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  myShapeList1 = new QListWidget;
+  myShapeList1->setSelectionMode(QAbstractItemView::ExtendedSelection);
 
-  QGridLayout *aGrpLayout = new QGridLayout(aGrp);
+  QGridLayout *aGrpLayout1 = new QGridLayout(mySimpleGrp);
 
-  aGrpLayout->setMargin(9);
-  aGrpLayout->setSpacing(6);
-  aGrpLayout->addWidget(anObjLbl,        0, 0);
-  aGrpLayout->addWidget(anInteLbl,       5, 0);
-  aGrpLayout->addWidget(aShapeLbl,       5, 2);
-  aGrpLayout->addWidget(aLevelLbl,       1, 0);
-  aGrpLayout->addWidget(myLevelBox,      1, 1, 1, 2);
-  aGrpLayout->addWidget(myComputeButton, 2, 0, 1, 3);
-  aGrpLayout->addWidget(aSummaryLbl,     3, 0);
-  aGrpLayout->addWidget(myTextView,      4, 0, 1, 3);
-  aGrpLayout->addWidget(mySelButton,     0, 1);
-  aGrpLayout->addWidget(myEditObjName,   0, 2);
-  aGrpLayout->addWidget(myInteList,      6, 0, 1, 2);
-  aGrpLayout->addWidget(myShapeList,     6, 2);
-
-  QVBoxLayout* layout = new QVBoxLayout (centralWidget());
-  layout->setMargin(0); layout->setSpacing(6);
-  layout->addWidget(aGrp);
+  aGrpLayout1->setMargin(9);
+  aGrpLayout1->setSpacing(6);
+  aGrpLayout1->addWidget(anObjLbl,         0, 0);
+  aGrpLayout1->addWidget(mySelButton1,     0, 1);
+  aGrpLayout1->addWidget(myEditObjName1,   0, 2);
+  aGrpLayout1->addWidget(aLevelLbl,        1, 0);
+  aGrpLayout1->addWidget(myLevelBox,       1, 1, 1, 2);
+  aGrpLayout1->addWidget(myComputeButton1, 2, 0, 1, 3);
+  aGrpLayout1->addWidget(aSummaryLbl1,     3, 0);
+  aGrpLayout1->addWidget(myTextView1,      4, 0, 1, 3);
+  aGrpLayout1->addWidget(anInteLbl,        5, 0);
+  aGrpLayout1->addWidget(aShapeLbl,        5, 2);
+  aGrpLayout1->addWidget(myInteList1,      6, 0, 1, 2);
+  aGrpLayout1->addWidget(myShapeList1,     6, 2);
 
+  /***************************************************************/
+  /* FAST SELF-INTERSECTION constructor
+  /***************************************************************/
+  
+  myFastGrp               = new QGroupBox(tr("GEOM_CHECK_INFOS"), centralWidget());
+  QLabel    *anObjLbl2    = new QLabel(tr("GEOM_OBJECT"), myFastGrp);
+  QLabel    *aDeflectLbl  = new QLabel(tr("GEOM_CHECK_INT_DEFLECT"), myFastGrp);
+  QLabel    *aSummaryLbl2 = new QLabel(tr("GEOM_CHECK_INTE_SUMMARY"));
+  QLabel    *anInteLbl2   = new QLabel(tr("GEOM_CHECK_INTE_INTERSECTIONS"), myFastGrp);
+  QLabel    *aShapeLbl2   = new QLabel(tr("GEOM_CHECK_INTE_SUBSHAPES"), myFastGrp);
+
+  mySelButton2 = new QPushButton(myFastGrp);
+  mySelButton2->setIcon(image1);
+  mySelButton2->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+
+  myEditObjName2 = new QLineEdit(myFastGrp);
+  myEditObjName2->setReadOnly(true);
+
+  myDeflection = new SalomeApp_DoubleSpinBox(myFastGrp);
+  myDetGaps = new QCheckBox(tr( "GEOM_CHECK_INT_DETECT_GAPS" ));
+  myTolerance = new SalomeApp_DoubleSpinBox(myFastGrp);
+
+  myComputeButton2 = new QPushButton(tr("GEOM_CHECK_INTE_COMPUTE"));
+
+  myTextView2 = new QTextBrowser;
+  myTextView2->setReadOnly(true);
+  myTextView2->setFont(aFont);
+
+  myInteList2  = new QListWidget(myFastGrp);
+  myInteList2->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  myShapeList2 = new QListWidget(myFastGrp);
+  myShapeList2->setSelectionMode(QAbstractItemView::ExtendedSelection);
+
+  QGridLayout *aGrpLayout2 = new QGridLayout(myFastGrp);
+  aGrpLayout2->setMargin(9);
+  aGrpLayout2->setSpacing(6);
+  aGrpLayout2->addWidget(anObjLbl2,        0, 0);
+  aGrpLayout2->addWidget(mySelButton2,     0, 1);
+  aGrpLayout2->addWidget(myEditObjName2,   0, 2);
+  aGrpLayout2->addWidget(aDeflectLbl,      1, 0);
+  aGrpLayout2->addWidget(myDeflection,     1, 1, 1, 2);
+  aGrpLayout2->addWidget(myDetGaps,        2, 0);
+  aGrpLayout2->addWidget(myTolerance,      2, 1, 1, 2);
+  aGrpLayout2->addWidget(myComputeButton2, 3, 0, 1, 3);
+  aGrpLayout2->addWidget(aSummaryLbl2,     4, 0);
+  aGrpLayout2->addWidget(myTextView2,      5, 0, 1, 3);
+  aGrpLayout2->addWidget(anInteLbl2,       6, 0);
+  aGrpLayout2->addWidget(aShapeLbl2,       6, 1, 1, 2);
+  aGrpLayout2->addWidget(myInteList2,      7, 0);
+  aGrpLayout2->addWidget(myShapeList2,     7, 1, 1, 2);
+  
   /***************************************************************/
 
+  QVBoxLayout* layout2 = new QVBoxLayout (centralWidget());
+  layout2->setMargin(0); layout2->setSpacing(6);
+  layout2->addWidget(mySimpleGrp);
+  layout2->addWidget(myFastGrp);
+
+ /***************************************************************/
+
   myHelpFileName = "check_self_intersections_page.html";
 
   /* Initialisation */
@@ -161,32 +226,65 @@ void MeasureGUI_CheckSelfIntersectionsDlg::Init()
   myLevelBox->insertItem(GEOM::SI_E_F, tr("GEOM_CHECK_INTE_E_F"));
   myLevelBox->insertItem(GEOM::SI_ALL, tr("GEOM_CHECK_INTE_ALL"));
   myLevelBox->setCurrentIndex(GEOM::SI_ALL);
+  myComputeButton1->setEnabled(false);
 
-  connect(myGeomGUI,          SIGNAL(SignalDeactivateActiveDialog()),
-          this,               SLOT(DeactivateActiveDialog()));
-  connect(myGeomGUI,          SIGNAL(SignalCloseAllDialogs()),
-          this,               SLOT(ClickOnCancel()));
-  connect(buttonOk(),         SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonApply(),      SIGNAL(clicked()), this, SLOT(ClickOnApply()));
-  connect(mySelButton,        SIGNAL(clicked()),
+  connect(mySelButton1,        SIGNAL(clicked()),
           this,               SLOT(SetEditCurrentArgument()));
-  connect(myInteList,         SIGNAL(itemSelectionChanged()),
+  connect(myInteList1,         SIGNAL(itemSelectionChanged()),
           SLOT(onInteListSelectionChanged()));
-  connect(myShapeList,        SIGNAL(itemSelectionChanged()),
+  connect(myShapeList1,        SIGNAL(itemSelectionChanged()),
           SLOT(onSubShapesListSelectionChanged()));
   connect(myLevelBox,         SIGNAL(currentIndexChanged(int)),
           this,               SLOT(clear()));
-  connect(myComputeButton,    SIGNAL(clicked()), this, SLOT(onCompute()));
+  connect(myComputeButton1,    SIGNAL(clicked()), this, SLOT(onCompute()));
 
-  LightApp_SelectionMgr* aSel = myGeomGUI->getApp()->selectionMgr();
+  /***************************************************************/
+  myObj2.nullify();
+  myEditObjName2->setText("");
+  myEditObjName2->setEnabled(true);
+
+  myDetGaps->setChecked(false);
+  initSpinBox(myTolerance, 0, MAX_NUMBER, 1);
+  myTolerance->setValue(0);
+  myTolerance->setEnabled(false);
+  myComputeButton2->setEnabled(false);
+
+  // Obtain deflection from preferences
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  initSpinBox(myDeflection, 1e-3, 1.0, 1e-3);
+  myDeflection->setValue(qMax(1e-3, resMgr->doubleValue("Geometry", "deflection_coeff", 1e-3)));
+
+  connect( mySelButton2,       SIGNAL(clicked()),
+          this,               SLOT(SetEditCurrentArgument()));
+  connect( myDetGaps,          SIGNAL(toggled(bool)), this, SLOT(OnGaps(bool))); 
+  connect( myTolerance,       SIGNAL(valueChanged(double)), this, SLOT(clear()));
+  connect( myDeflection,      SIGNAL(valueChanged(double)), this, SLOT(clear()));
+  connect( myInteList2,         SIGNAL(itemSelectionChanged()),
+          SLOT(onInteListSelectionChanged()));
+  connect( myShapeList2,       SIGNAL(itemSelectionChanged()),
+          SLOT(onSubShapesListSelectionChanged()));
+  connect( myComputeButton2,    SIGNAL(clicked()), this, SLOT(onCompute()));
 
+  /***************************************************************/
+
+  connect(this,               SIGNAL(constructorsClicked(int)), 
+         this,               SLOT(ConstructorsClicked(int)));
+  connect(myGeomGUI,          SIGNAL(SignalDeactivateActiveDialog()),
+          this,               SLOT(DeactivateActiveDialog()));
+  connect(myGeomGUI,          SIGNAL(SignalCloseAllDialogs()),
+          this,               SLOT(ClickOnCancel()));
+  connect(buttonOk(),         SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+  connect(buttonApply(),      SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+  LightApp_SelectionMgr* aSel = myGeomGUI->getApp()->selectionMgr();
   connect(aSel,               SIGNAL(currentSelectionChanged()),
           this,               SLOT(SelectionIntoArgument()));
 
   initName( tr( "GEOM_SELF_INTERSECTION_NAME") );
   buttonOk()->setEnabled(false);
   buttonApply()->setEnabled(false);
-  myComputeButton->setEnabled(false);
+
+  ConstructorsClicked(0);
+
   activateSelection();
   SelectionIntoArgument();
 }
@@ -197,20 +295,56 @@ void MeasureGUI_CheckSelfIntersectionsDlg::Init()
 //=================================================================================
 void MeasureGUI_CheckSelfIntersectionsDlg::clear()
 {
-  myTextView->setText("");
+  getTextView()->setText("");
+  getComputeButton()->setEnabled(true);
 
-  myInteList->blockSignals(true);
-  myShapeList->blockSignals(true);
-  myInteList->clear();
-  myShapeList->clear();
-  myInteList->blockSignals(false);
-  myShapeList->blockSignals(false);
+  getInteList()->blockSignals(true);
+  getShapeList()->blockSignals(true);
+  getInteList()->clear();
+  getShapeList()->clear();
+  getInteList()->blockSignals(false);
+  getShapeList()->blockSignals(false);
 
   erasePreview();
-
   buttonOk()->setEnabled(false);
   buttonApply()->setEnabled(false);
-  myComputeButton->setEnabled(true);
+}
+
+//=================================================================================
+// function : ConstructorsClicked()
+// purpose  : Radio button management
+//=================================================================================
+void MeasureGUI_CheckSelfIntersectionsDlg::ConstructorsClicked(int constructorId)
+{
+  if (myCurrConstrId == constructorId)
+    return;
+
+  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+
+  switch (constructorId) {
+  case 0:
+    mySimpleGrp->show();
+    myFastGrp->hide();
+    break;
+  case 1:
+    mySimpleGrp->hide();
+    myFastGrp->show();
+    break;
+  }
+
+  myCurrConstrId = constructorId;
+
+  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+           this, SLOT(SelectionIntoArgument()));
+
+  qApp->processEvents();
+  updateGeometry();
+  resize(minimumSizeHint());
+
+  processPreview();
+  //updateButtonState();
+  activateSelection();
+  SelectionIntoArgument();
 }
 
 //=================================================================================
@@ -223,7 +357,7 @@ void MeasureGUI_CheckSelfIntersectionsDlg::onCompute()
   QString anErrMsg("");
 
   if (!findSelfIntersections(hasSelfInte, anErrMsg)) {
-    myTextView->setText(anErrMsg);
+    getTextView()->setText(anErrMsg);
     return;
   }
 
@@ -243,12 +377,12 @@ void MeasureGUI_CheckSelfIntersectionsDlg::onCompute()
     aMsg += anErrMsg;
   }
 
-  myTextView->setText(aMsg);
+  getTextView()->setText(aMsg);
 
   // Pairs
   QStringList anInteList;
   QString anInteStr ("");
-  int nbPairs = myInters->length()/2;
+  int nbPairs = getInters()->length()/2;
 
   for (int i = 1; i <= nbPairs; i++) {
     anInteStr = "Intersection # ";
@@ -256,8 +390,8 @@ void MeasureGUI_CheckSelfIntersectionsDlg::onCompute()
     anInteList.append(anInteStr);
   }
 
-  myInteList->addItems(anInteList);
-  myComputeButton->setEnabled(false);
+  getInteList()->addItems(anInteList);
+  getComputeButton()->setEnabled(false);
 }
 
 //=================================================================================
@@ -291,7 +425,23 @@ void MeasureGUI_CheckSelfIntersectionsDlg::DeactivateActiveDialog()
 //=================================================================================
 void MeasureGUI_CheckSelfIntersectionsDlg::activateSelection()
 {
-  globalSelection(GEOM_ALLSHAPES);
+  switch (getConstructorId()) {
+  case 0:
+    globalSelection(GEOM_ALLSHAPES);
+    break;
+  case 1:
+    TColStd_MapOfInteger aTypes;
+    aTypes.Add(GEOM_COMPOUND );
+    aTypes.Add(GEOM_SOLID );
+    aTypes.Add(GEOM_SHELL);
+    aTypes.Add(GEOM_FACE);
+    globalSelection(aTypes);
+
+    std::list<int> needTypes;
+    needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
+    localSelection( needTypes );
+    break;
+  }
 }
 
 //=================================================================================
@@ -313,7 +463,11 @@ bool MeasureGUI_CheckSelfIntersectionsDlg::ClickOnApply()
   if ( !onAccept() )
     return false;
 
+  clear();
   initName();
+
+  ConstructorsClicked(getConstructorId());
+
   return true;
 }
 
@@ -341,7 +495,7 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_CheckSelfIntersectionsDlg::createOperation
 //=================================================================================
 bool MeasureGUI_CheckSelfIntersectionsDlg::isValid( QString& )
 {
-  return !myObj->_is_nil();
+  return !getObj().isNull();
 }
 
 //=================================================================================
@@ -350,37 +504,51 @@ bool MeasureGUI_CheckSelfIntersectionsDlg::isValid( QString& )
 //=================================================================================
 void MeasureGUI_CheckSelfIntersectionsDlg::SetEditCurrentArgument()
 {
-  myEditObjName->setFocus();
+  getEditObjName()->setFocus();
   SelectionIntoArgument();
 }
 
+//=================================================================================
+// function : OnGaps()
+// purpose  :
+//=================================================================================
+void MeasureGUI_CheckSelfIntersectionsDlg::OnGaps(bool checked)
+{
+  clear();
+  myTolerance->setEnabled(checked);
+}
 //=================================================================================
 // function : SelectionIntoArgument
 // purpose  :
 //=================================================================================
 void MeasureGUI_CheckSelfIntersectionsDlg::SelectionIntoArgument()
 {
+  QList<TopAbs_ShapeEnum> typesLst;
+
+  if ( getConstructorId() == 0 ) {
+    typesLst << TopAbs_COMPOUND
+            << TopAbs_COMPSOLID
+            << TopAbs_SOLID
+            << TopAbs_SHELL
+            << TopAbs_FACE
+            << TopAbs_WIRE
+            << TopAbs_EDGE
+            << TopAbs_VERTEX
+            << TopAbs_SHAPE;
+  } else {
+    typesLst << TopAbs_FACE
+            << TopAbs_SHELL
+            << TopAbs_SOLID
+            << TopAbs_COMPOUND;
+  }
+
   // Clear the dialog.
   clear();
-  myObj = GEOM::GEOM_Object::_nil();
-
-  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
-  SALOME_ListIO aSelList;
-  aSelMgr->selectedObjects(aSelList);
-
-  GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
 
-  if (aSelList.Extent() > 0) {
-    aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
-  }
-
-  if (aSelectedObject->_is_nil()) {
-    myEditObjName->setText("");
-    return;
-  }
+  GEOM::GeomObjPtr aSelectedObject = getSelected( typesLst );
 
-  myObj = aSelectedObject;
-  myEditObjName->setText(GEOMBase::GetName(myObj));
+  (getConstructorId() == 0 ? myObj1 :myObj2) = aSelectedObject;
+  getEditObjName()->setText(getObj() ? GEOMBase::GetName(getObj().get()) : "");
 }
 
 //=================================================================================
@@ -400,7 +568,7 @@ void MeasureGUI_CheckSelfIntersectionsDlg::enterEvent(QEvent *)
 bool MeasureGUI_CheckSelfIntersectionsDlg::findSelfIntersections
         (bool &HasSelfInte, QString &theErrMsg)
 {
-  if (myObj->_is_nil()) {
+  if (getObj()->_is_nil()) {
     return false;
   }
 
@@ -413,10 +581,14 @@ bool MeasureGUI_CheckSelfIntersectionsDlg::findSelfIntersections
   SUIT_OverrideCursor wc;
 
   try {
-    HasSelfInte = !anOper->CheckSelfIntersections(myObj, aLevel, myInters);
-    nbPairs = myInters->length()/2;
+    if ( getConstructorId() == 0 ) {
+      HasSelfInte = !anOper->CheckSelfIntersections(myObj1.get(), aLevel, myInters1);
+    } else {
+      HasSelfInte = !anOper->CheckSelfIntersectionsFast(myObj2.get(), getDeflection(), getTolerance(), myInters2);
+    }
+    nbPairs = getInters()->length()/2;
 
-    if (nbPairs*2 != myInters->length()) {
+    if (nbPairs*2 != getInters()->length()) {
       isOK = false;
     }
   }
@@ -426,7 +598,7 @@ bool MeasureGUI_CheckSelfIntersectionsDlg::findSelfIntersections
   }
 
   if (!anOper->IsDone()) {
-    if (myInters->length() == 0) {
+    if (getInters()->length() == 0) {
       theErrMsg = tr(anOper->GetErrorCode());
       isOK = false;
     } else {
@@ -447,24 +619,24 @@ bool MeasureGUI_CheckSelfIntersectionsDlg::findSelfIntersections
 void MeasureGUI_CheckSelfIntersectionsDlg::onInteListSelectionChanged()
 {
   erasePreview();
-  myShapeList->clear();
+  getShapeList()->clear();
 
   TopoDS_Shape aSelShape;
-  if (!myObj->_is_nil() && GEOMBase::GetShape(myObj, aSelShape)) {
+  if (!getObj()->_is_nil() && GEOMBase::GetShape(getObj().get(), aSelShape)) {
     TopTools_IndexedMapOfShape anIndices;
     TopExp::MapShapes(aSelShape, anIndices);
 
-    int nbSelected = myInteList->selectedItems().size();
+    int nbSelected = getInteList()->selectedItems().size();
 
-    for (int i = 0; i < myInteList->count(); i++) {
-      if ( myInteList->item(i)->isSelected() ) {
+    for (int i = 0; i < getInteList()->count(); i++) {
+      if ( getInteList()->item(i)->isSelected() ) {
         if ( nbSelected > 1 )
-          myShapeList->addItem(QString("--- #%1 ---").arg(i+1));
+          getShapeList()->addItem(QString("--- #%1 ---").arg(i+1));
         for (int j = 0; j < 2; j++) {
-          TopoDS_Shape aSubShape = anIndices.FindKey(myInters[i*2+j]);
+          TopoDS_Shape aSubShape = anIndices.FindKey(getInters()[i*2+j]);
           QString aType = GEOMBase::GetShapeTypeString(aSubShape);
-          myShapeList->addItem(QString("%1_%2").arg(aType).arg(myInters[i*2+j]));
-          myShapeList->item(myShapeList->count()-1)->setData(Qt::UserRole, myInters[i*2+j]);
+          getShapeList()->addItem(QString("%1_%2").arg(aType).arg(getInters()[i*2+j]));
+          getShapeList()->item(getShapeList()->count()-1)->setData(Qt::UserRole, getInters()[i*2+j]);
         }
       }
     }
@@ -480,7 +652,7 @@ void MeasureGUI_CheckSelfIntersectionsDlg::onSubShapesListSelectionChanged()
   erasePreview();
 
   // Selected IDs
-  QList<QListWidgetItem*> selected = myShapeList->selectedItems();
+  QList<QListWidgetItem*> selected = getShapeList()->selectedItems();
   QList<int> aIds;
   foreach(QListWidgetItem* item, selected) {
     int idx = item->data(Qt::UserRole).toInt();
@@ -492,7 +664,7 @@ void MeasureGUI_CheckSelfIntersectionsDlg::onSubShapesListSelectionChanged()
   TopoDS_Shape aSelShape;
   TopoDS_Shape aSubShape;
   TopTools_IndexedMapOfShape anIndices;
-  if (!myObj->_is_nil() && GEOMBase::GetShape(myObj, aSelShape)) {
+  if (!getObj()->_is_nil() && GEOMBase::GetShape(getObj().get(), aSelShape)) {
     TopExp::MapShapes(aSelShape, anIndices);
     getDisplayer()->SetColor(Quantity_NOC_RED);
     getDisplayer()->SetWidth(3);
@@ -500,11 +672,11 @@ void MeasureGUI_CheckSelfIntersectionsDlg::onSubShapesListSelectionChanged()
     foreach(int idx, aIds) {
       aSubShape = anIndices.FindKey(idx);
       try {
-        SALOME_Prs* aPrs = !aSubShape.IsNull() ? getDisplayer()->BuildPrs(aSubShape) : 0;
-        if (aPrs) displayPreview(aPrs, true);
+       SALOME_Prs* aPrs = !aSubShape.IsNull() ? getDisplayer()->BuildPrs(aSubShape) : 0;
+       if (aPrs) displayPreview(aPrs, true);
       }
       catch (const SALOME::SALOME_Exception& e) {
-        SalomeApp_Tools::QtCatchCorbaException(e);
+       SalomeApp_Tools::QtCatchCorbaException(e);
       }
     }
   }
@@ -526,15 +698,15 @@ bool MeasureGUI_CheckSelfIntersectionsDlg::execute(ObjectList& objects)
   TColStd_IndexedMapOfInteger aMapIndex;
   QList<int> pairs;
 
-  int nbSelected = myInteList->selectedItems().size();
+  int nbSelected = getInteList()->selectedItems().size();
 
   // Collect the map of indices
-  for (int i = 0; i < myInteList->count(); i++) {
-    if ( nbSelected < 1 || myInteList->item(i)->isSelected() ) {
-      aMapIndex.Add(myInters[i*2]);
-      aMapIndex.Add(myInters[i*2 + 1]);
-      pairs << myInters[i*2];
-      pairs << myInters[i*2 + 1];
+  for (int i = 0; i < getInteList()->count(); i++) {
+    if ( nbSelected < 1 || getInteList()->item(i)->isSelected() ) {
+      aMapIndex.Add(getInters()[i*2]);
+      aMapIndex.Add(getInters()[i*2 + 1]);
+      pairs << getInters()[i*2];
+      pairs << getInters()[i*2 + 1];
     }
   }
 
@@ -547,7 +719,7 @@ bool MeasureGUI_CheckSelfIntersectionsDlg::execute(ObjectList& objects)
   for (int i = 1; i <= aMapIndex.Extent(); i++)
     anArray[i-1] = aMapIndex.FindKey(i);
 
-  GEOM::ListOfGO_var aList = shapesOper->MakeSubShapes(myObj, anArray);
+  GEOM::ListOfGO_var aList = shapesOper->MakeSubShapes(getObj().get(), anArray);
 
   // Make compounds
   for (int i = 0; i < pairs.count()/2; i++) {
@@ -562,6 +734,27 @@ bool MeasureGUI_CheckSelfIntersectionsDlg::execute(ObjectList& objects)
   return true;
 }
 
+//=================================================================================
+// function : getDeflection
+// purpose  :
+//=================================================================================
+float MeasureGUI_CheckSelfIntersectionsDlg::getDeflection()
+{
+  return (float)myDeflection->value();
+}
+
+//=================================================================================
+// function : getTolerance
+// purpose  :
+//=================================================================================
+double MeasureGUI_CheckSelfIntersectionsDlg::getTolerance()
+{
+  double aVal = myTolerance->value();
+  if (!myDetGaps->isChecked() || aVal < 0.0)
+    return 0.0;
+  return aVal;
+}
+
 //================================================================
 // Function : getFather
 // Purpose  : Get father object for object to be added in study
@@ -570,5 +763,54 @@ bool MeasureGUI_CheckSelfIntersectionsDlg::execute(ObjectList& objects)
 GEOM::GEOM_Object_ptr MeasureGUI_CheckSelfIntersectionsDlg::getFather
                   (GEOM::GEOM_Object_ptr)
 {
-  return myObj;
+  return getObj().get();
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> MeasureGUI_CheckSelfIntersectionsDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << getObj();
+  return res;
+}
+
+//=================================================================================
+// GETTERS
+//=================================================================================
+QTextBrowser* MeasureGUI_CheckSelfIntersectionsDlg::getTextView()
+{
+  return ( getConstructorId() == 0 ? myTextView1 : myTextView2 );
+}
+
+QListWidget* MeasureGUI_CheckSelfIntersectionsDlg::getInteList()
+{
+  return ( getConstructorId() == 0 ? myInteList1 : myInteList2 );
+}
+
+QListWidget* MeasureGUI_CheckSelfIntersectionsDlg::getShapeList()
+{
+  return ( getConstructorId() == 0 ? myShapeList1 : myShapeList2 );
+}
+
+QPushButton* MeasureGUI_CheckSelfIntersectionsDlg::getComputeButton()
+{
+  return ( getConstructorId() == 0 ? myComputeButton1 : myComputeButton2 );
+}
+
+QLineEdit* MeasureGUI_CheckSelfIntersectionsDlg::getEditObjName()
+{
+  return ( getConstructorId() == 0 ? myEditObjName1 : myEditObjName2 );
+}
+
+GEOM::GeomObjPtr MeasureGUI_CheckSelfIntersectionsDlg::getObj()
+{
+  return ( getConstructorId() == 0 ? myObj1 : myObj2 );
+}
+
+GEOM::ListOfLong_var MeasureGUI_CheckSelfIntersectionsDlg::getInters()
+{
+  return ( getConstructorId() == 0 ? myInters1 : myInters2 );
 }
index f05dd81096e0950b074c10f17db9a7aac7efde6d..ac0f2d935d962d5f11a3a28010de29c70c4d283f 100644 (file)
@@ -54,6 +54,7 @@ protected:
   virtual bool                        execute(ObjectList &);
   virtual bool                        extractPrefix() const;
   virtual GEOM::GEOM_Object_ptr       getFather (GEOM::GEOM_Object_ptr);
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
 
 private slots:
 
@@ -67,6 +68,9 @@ private slots:
   void                                DeactivateActiveDialog();
   void                                SelectionIntoArgument();
   void                                SetEditCurrentArgument();
+  void                                ConstructorsClicked (int);
+  void                                OnGaps(bool);
+
 
 private:
 
@@ -76,18 +80,46 @@ private:
   bool                                findSelfIntersections
                                                     (bool    &HasSelfInte,
                                                      QString &theErrMsg);
+  float                               getDeflection();
+  double                              getTolerance();
+  
+// Getters
+  QTextBrowser*                       getTextView();
+  QListWidget*                        getInteList();
+  QListWidget*                        getShapeList();
+  QPushButton*                        getComputeButton();
+  QLineEdit*                          getEditObjName();
+  GEOM::GeomObjPtr                    getObj();
+  GEOM::ListOfLong_var                getInters();
 
-private:
 
-  QTextBrowser                       *myTextView;
-  QPushButton                        *mySelButton;
-  QLineEdit                          *myEditObjName;
+private:
+  int                                 myCurrConstrId;
+  // simple
+  QPushButton                        *myComputeButton1;
+  QGroupBox                          *mySimpleGrp;
+  QTextBrowser                       *myTextView1;
+  QPushButton                        *mySelButton1;
+  QLineEdit                          *myEditObjName1;
   QComboBox                          *myLevelBox;
-  QPushButton                        *myComputeButton;
-  QListWidget                        *myInteList;
-  QListWidget                        *myShapeList;
-  GEOM::GEOM_Object_var               myObj;
-  GEOM::ListOfLong_var                myInters;
+  QListWidget                        *myInteList1;
+  QListWidget                        *myShapeList1;
+  GEOM::GeomObjPtr                    myObj1;
+  GEOM::ListOfLong_var                myInters1;
+  // fast
+  QPushButton                        *myComputeButton2;
+  QGroupBox                          *myFastGrp;
+  QTextBrowser                       *myTextView2;
+  QPushButton                        *mySelButton2;
+  QLineEdit                          *myEditObjName2;
+  QCheckBox                          *myDetGaps;
+  SalomeApp_DoubleSpinBox            *myTolerance;
+  SalomeApp_DoubleSpinBox            *myDeflection;
+  QListWidget                        *myInteList2;
+  QListWidget                        *myShapeList2;
+  GEOM::GeomObjPtr                    myObj2;
+  GEOM::ListOfLong_var                myInters2;
+  GEOM::GEOM_IShapesOperations_var    myShapesOper;
 };
 
 #endif // MEASUREGUI_CHECKSELFINTERDLG_H
index 2576676b22cbebdb342cbe54df4fb91ea203afbc..45ef0135f56583e60dd216e26ed812e43a135322 100644 (file)
@@ -495,12 +495,13 @@ Handle(AIS_Dimension) MeasureGUI_CreateDimensionDlg::CreateDimension()
 
   QColor  aQColor       = aResMgr->colorValue  ( "Geometry", "dimensions_color", QColor( 0, 255, 0 ) );
   int     aLineWidth    = aResMgr->integerValue( "Geometry", "dimensions_line_width", 1 );
-  double  aFontHeight   = aResMgr->doubleValue ( "Geometry", "dimensions_font_height", 10 );
+  QFont   aFont         = aResMgr->fontValue   ( "Geometry", "dimensions_font", QFont("Y14.5M-2009", 14) );
   double  anArrowLength = aResMgr->doubleValue ( "Geometry", "dimensions_arrow_length", 5 );
   double  aDefFlyout    = aResMgr->doubleValue ( "Geometry", "dimensions_default_flyout", 20 );
   bool    isUnitsShown  = aResMgr->booleanValue( "Geometry", "dimensions_show_units", false );
   QString aUnitsLength  = aResMgr->stringValue ( "Geometry", "dimensions_length_units", "m" );
   QString aUnitsAngle   = aResMgr->stringValue ( "Geometry", "dimensions_angle_units", "deg" );
+  bool    aUseText3d    = aResMgr->booleanValue( "Geometry", "dimensions_use_text3d", false );
 
   OCCViewer_ViewWindow* anActiveView = NULL;
 
@@ -610,10 +611,12 @@ Handle(AIS_Dimension) MeasureGUI_CreateDimensionDlg::CreateDimension()
 
   aStyle->SetCommonColor( aColor );
   aStyle->MakeUnitsDisplayed( (Standard_Boolean) isUnitsShown );
-  aStyle->MakeText3d( Standard_True );
+  aStyle->MakeText3d( aUseText3d );
   aStyle->MakeTextShaded( Standard_True );
-  aStyle->SetExtensionSize( aFontHeight * 0.5 );
-  aStyle->TextAspect()->SetHeight( aFontHeight );
+  int fsize = aFont.pixelSize() != -1 ? aFont.pixelSize() : aFont.pointSize();
+  aStyle->SetExtensionSize( fsize * 0.5 );
+  aStyle->TextAspect()->SetFont( aFont.family().toLatin1().data() );
+  aStyle->TextAspect()->SetHeight( fsize );
   aStyle->ArrowAspect()->SetLength( anArrowLength );
   aStyle->LineAspect()->SetWidth( aLineWidth );
 
index a2b0dc16c54a8f6c07a5ede7670a03219715e2a0..8c7207f9a23d6aa4e94bbbf9adcf82d05e35777d 100644 (file)
@@ -489,11 +489,7 @@ bool MeasureGUI_DistanceDlg::execute (ObjectList& objects)
 void MeasureGUI_DistanceDlg::activateSelection()
 {
   globalSelection( GEOM_ALLSHAPES );
-  std::list<int> needTypes;
-  needTypes.push_back( TopAbs_SHAPE ), needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ); 
-  needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL );
-  needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPSOLID ), needTypes.push_back( TopAbs_COMPOUND );
-  localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+  localSelection( TopAbs_SHAPE );
 }
 
 //=================================================================================
index 459501c3c317cc91fab546f9ae1339bb9aaeee26..ff075bc175156e697c45a31aabd9ff16cace68bd 100644 (file)
@@ -317,7 +317,7 @@ void MeasureGUI_FastCheckIntersectionsDlg::activateSelection()
 
   std::list<int> needTypes;
   needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
-  localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+  localSelection( needTypes );
 
 }
 
index ee14238b3843f6f455e2040d6ef515c956d40dc5..61dcafdc39f55590de15f85f6cafabf9ef38887e 100644 (file)
@@ -129,9 +129,7 @@ void MeasureGUI_InertiaDlg::Init()
 void MeasureGUI_InertiaDlg::activateSelection()
 {
   MeasureGUI_Skeleton::activateSelection();
-  std::list<int> needTypes;
-  needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
-  localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+  localSelection( TopAbs_SHAPE );
 }
 
 
index b8954462a47086e2b200fc517793492fd24865f1..4618f9c808b1dce56a0985731f035d63b5020862 100644 (file)
@@ -29,6 +29,7 @@
 #include "MeasureGUI_DimensionFilter.h"
 
 #include <GEOMGUI_DimensionProperty.h>
+#include <GEOMGUI_TextTreeWdg.h>
 #include <GEOMUtils.hxx>
 #include <GEOMGUI_OCCSelector.h>
 #include <GEOM_AISDimension.hxx>
@@ -771,6 +772,8 @@ bool MeasureGUI_ManageDimensionsDlg::ClickOnApply()
 
   mySavedPropertyState.SaveToAttribute( aStudy, myEditObject->GetStudyEntry() );
 
+  myGeomGUI->emitDimensionsUpdated( QString( myEditObject->GetStudyEntry() ) );
+
   return true;
 }
 
@@ -805,9 +808,12 @@ void MeasureGUI_ManageDimensionsDlg::OnFinish()
                              myEditObject->GetStudyEntry(),
                              GEOM::propertyName( GEOM::Dimensions ),
                              QVariant() );
+
   if ( myIsNeedRedisplay ) {
-    redisplay( myEditObject.get());
+    redisplay( myEditObject.get() );
   }
+  
+  myGeomGUI->emitDimensionsUpdated( QString( myEditObject->GetStudyEntry() ) );
 }
 
 //=================================================================================
index 2c1d1dec31e825542e95de92dfb4e2b0ece01379..6fd821b71851362db856838fb6ee9a1c8fd694a7 100644 (file)
@@ -184,10 +184,7 @@ bool MeasureGUI_MaxToleranceDlg::getParameters( double& theMinFaceToler,
 void MeasureGUI_MaxToleranceDlg::activateSelection()
 {
   globalSelection( GEOM_ALLSHAPES );
-  std::list<int> needTypes;
-  needTypes.push_back( TopAbs_SHAPE ), needTypes.push_back( TopAbs_EDGE ); 
-  needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL );
-  needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPSOLID ), needTypes.push_back( TopAbs_COMPOUND );  localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+  localSelection( TopAbs_SHAPE );
 }
 
 void MeasureGUI_MaxToleranceDlg::SelectionIntoArgument()
index 03619dc038fe2f06605c1233a60ed38c2cb07da4..f2df1b3d342158de5080729a0833a9b4922be9f9 100644 (file)
@@ -267,7 +267,7 @@ void MeasureGUI_NormaleDlg::SetEditCurrentArgument()
     GroupArgs->PushButton2->setDown(false);
     GroupArgs->LineEdit2->setEnabled(false);
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE);
+    localSelection(TopAbs_FACE);
   }
   else if (send == GroupArgs->PushButton2) {
     myEditCurrentArgument = GroupArgs->LineEdit2;
@@ -275,7 +275,7 @@ void MeasureGUI_NormaleDlg::SetEditCurrentArgument()
     GroupArgs->PushButton1->setDown(false);
     GroupArgs->LineEdit1->setEnabled(false);
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
index a0bd2762bb68ed2bf742310e16ee5797561a07c6..d2acb6e3e2cb83391e202b10cddc9d60ad28bb46 100644 (file)
@@ -112,7 +112,7 @@ void MeasureGUI_PointDlg::Init()
 //=================================================================================
 void MeasureGUI_PointDlg::activateSelection()
 {
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
 }
 
 //=================================================================================
index 620103fdfc4f8e13093e884641cc839437d6dfae..ecaa437ba2fc96d62ad4cead7f738e5455b13bf1 100644 (file)
@@ -125,7 +125,7 @@ void MeasureGUI_PropertiesDlg::activateSelection()
 
   std::list<int> needTypes;
   needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
-  localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+  localSelection( needTypes );
 }
 
 void MeasureGUI_PropertiesDlg::SelectionIntoArgument()
diff --git a/src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.cxx b/src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.cxx
new file mode 100644 (file)
index 0000000..681c0ba
--- /dev/null
@@ -0,0 +1,533 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File   : MeasureGUI_ShapeStatisticsDlg.cxx
+// Author : Alexander KOVALEV, OPEN CASCADE S.A.S.
+
+// internal includes
+#include "MeasureGUI_ShapeStatisticsDlg.h"
+
+// GEOM includes
+#include <GEOMBase.h>
+#include <GEOMUtils_ShapeStatistics.hxx>
+#include <GeometryGUI.h>
+#include <DlgRef.h>
+
+// GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_ViewManager.h>
+#include <SUIT_ViewWindow.h>
+
+#include <LightApp_SelectionMgr.h>
+
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+
+#include <Plot2d_Histogram.h>
+#include <Plot2d_ViewFrame.h>
+#include <Plot2d_ViewModel.h>
+#include <Plot2d_ViewWindow.h>
+
+// Qt includes
+#include <QIcon>
+#include <QGridLayout>
+#include <QPushButton>
+#include <QLabel>
+
+// Qtx includes
+#include <QtxValidator.h>
+
+// OCC includes
+#include <TopoDS_Shape.hxx>
+
+#include <GEOMImpl_Types.hxx>
+
+//===========================================================================
+// class    : MeasureGUI_ShapeStatisticsDlg()
+//===========================================================================
+MeasureGUI_ShapeStatisticsDlg::MeasureGUI_ShapeStatisticsDlg( QWidget* parent, TopoDS_Shape aShape, TopAbs_ShapeEnum aSubShapeType )
+  : GEOMBase_Helper( SUIT_Session::session()->activeApplication()->desktop() ),
+    QDialog( parent ),
+    myHistogram ( 0 )
+{
+  myShapes.push_back( aShape );
+
+  QIcon iconSelect( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
+
+  setWindowTitle( tr( "GEOM_SHAPE_STATISTICS" ) );
+  setAttribute( Qt::WA_DeleteOnClose );
+
+  myApp = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+
+  QVBoxLayout* topLayout = new QVBoxLayout( this );
+
+  QGridLayout* settingsLayout = new QGridLayout();
+
+  /**********************   Selected Objects    **********************/
+
+  QLabel* objsLabel = new QLabel( tr( "GEOM_SELECTED_OBJECTS" ), this );
+  QPushButton* selBtn = new QPushButton( this );
+  selBtn->setIcon( iconSelect );
+  myEditMainShape = new QLineEdit( this );
+  myEditMainShape->setReadOnly(true);
+
+  settingsLayout->addWidget( objsLabel, 0, 0 );
+  settingsLayout->addWidget( selBtn, 0, 1 );
+  settingsLayout->addWidget( myEditMainShape, 0, 2 );
+
+  if ( !aShape.IsNull() ) {
+    objsLabel->hide();
+    selBtn->hide();
+    myEditMainShape->hide();
+  }
+
+  /**********************   Type    **********************/
+
+  QLabel* typeLabel = new QLabel( tr( "GEOM_SHAPE_STATISTICS_TYPE" ), this );
+  myCBTypes = new QtxComboBox( this );
+  myCBTypes->setCleared( true );
+  if ( aSubShapeType != TopAbs_SHAPE ) {
+    fillTypes( aSubShapeType == TopAbs_EDGE, 
+              aSubShapeType == TopAbs_FACE, 
+              aSubShapeType == TopAbs_SOLID );
+    myCBTypes->setEnabled( false );
+  }
+
+  settingsLayout->addWidget( typeLabel, 1, 0 );
+  settingsLayout->addWidget( myCBTypes, 1, 2 );
+
+  /**********************   Number of intervals    **********************/
+
+  QLabel* nbIntervalsLabel = new QLabel( tr( "GEOM_SHAPE_STATISTICS_NB_INTERVALS" ), this );
+  myNbIntervals = new QtxIntSpinBox( 1, 1000, 1, this );
+  myNbIntervals->setValue( 10 );
+
+  settingsLayout->addWidget( nbIntervalsLabel, 2, 0 );
+  settingsLayout->addWidget( myNbIntervals, 2, 2 );
+
+  /**********************   Scalar Range    **********************/
+
+  myScalarRangeBox = new QGroupBox( tr( "GEOM_SHAPE_STATISTICS_SCALAR_RANGE" ), this );
+  myScalarRangeBox->setCheckable( true );
+  myScalarRangeBox->setChecked( false );
+  QLabel* minLabel = new QLabel( tr( "GEOM_SHAPE_STATISTICS_MIN" ), this );
+  myMin = new QLineEdit( this );
+  QtxDoubleValidator* aValid = new QtxDoubleValidator( this );
+  aValid->setBottom( 0.0 );
+  myMin->setValidator( aValid );
+  QLabel* maxLabel = new QLabel( tr( "GEOM_SHAPE_STATISTICS_MAX" ), this );
+  myMax = new QLineEdit( this );
+  myMax->setValidator( aValid );
+  
+  QPushButton* buttonCompute = new QPushButton( tr( "GEOM_SHAPE_STATISTICS_COMPUTE" ), this );
+  connect( buttonCompute, SIGNAL( clicked() ), this, SLOT( clickOnCompute() ) );
+
+  QGridLayout* scalarRangeLayout = new QGridLayout();
+  scalarRangeLayout->setMargin( 11 ); settingsLayout->setSpacing( 6 );
+
+  scalarRangeLayout->addWidget( minLabel, 0, 0 );
+  scalarRangeLayout->addWidget( myMin,    0, 1 );
+  scalarRangeLayout->addWidget( maxLabel, 1, 0 );
+  scalarRangeLayout->addWidget( myMax,    1, 1 );
+  scalarRangeLayout->addWidget( buttonCompute, 0, 2, 2, 1 );
+
+  myScalarRangeBox->setLayout( scalarRangeLayout );
+
+  /**********************   Buttons    **********************/
+
+  myButtonPlot   = new QPushButton( tr( "GEOM_PLOT_DISTRIBUTION" ), this );
+  myButtonPlot->setDefault( true );
+  myButtonCreateGr = new QPushButton( tr( "GEOM_SHAPE_STATISTICS_CREATE_GROUPS" ), this );
+  QPushButton* buttonClose  = new QPushButton( tr( "GEOM_BUT_CLOSE" ), this );
+  QPushButton* buttonHelp   = new QPushButton( tr( "GEOM_BUT_HELP" ), this );
+
+  QHBoxLayout* buttonsLayout = new QHBoxLayout();
+  buttonsLayout->addWidget( myButtonPlot );
+  buttonsLayout->addWidget( myButtonCreateGr );
+  buttonsLayout->addWidget( buttonClose );
+  buttonsLayout->addWidget( buttonHelp );
+
+  if ( !aShape.IsNull() ) {
+    myButtonCreateGr->hide();
+  }
+  /**********************   Layouting    **********************/
+
+  topLayout->addLayout( settingsLayout );
+  topLayout->addWidget( myScalarRangeBox );
+  topLayout->addLayout( buttonsLayout );
+
+  // Signals and slots connections
+
+  connect( selBtn, SIGNAL( clicked() ), this, SLOT( onEditMainShape() ) );
+
+  connect( myButtonPlot,     SIGNAL( clicked() ), this, SLOT( clickOnPlot() ) );
+  connect( myButtonCreateGr, SIGNAL( clicked() ), this, SLOT( clickOnCreateGroups() ) );
+
+  connect( buttonClose,    SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( buttonHelp,     SIGNAL( clicked() ), this, SLOT( clickOnHelp() ) );
+
+  connect(myApp->selectionMgr(),
+          SIGNAL(currentSelectionChanged()), this, SLOT(onEditMainShape()));
+
+  if ( aShape.IsNull() )
+    onEditMainShape();
+}
+
+//===========================================================================
+// function : ~MeasureGUI_ShapeStatisticsDlg()
+// purpose  : Destroys the object and frees any allocated resources
+//===========================================================================
+MeasureGUI_ShapeStatisticsDlg::~MeasureGUI_ShapeStatisticsDlg()
+{
+}
+
+//=================================================================================
+// function : createOperation
+// purpose  :
+//=================================================================================
+GEOM::GEOM_IOperations_ptr MeasureGUI_ShapeStatisticsDlg::createOperation()
+{
+  return getGeomEngine()->GetIGroupOperations(getStudyId());
+}
+
+#define RETURN_WITH_MSG(a, b) \
+  if (!(a)) { \
+    theMessage += (b); \
+    return false; \
+  }
+
+//================================================================
+// Function : getFather
+// Purpose  : Get father object for object to be added in study
+//            (called with addInStudy method)
+//================================================================
+GEOM::GEOM_Object_ptr MeasureGUI_ShapeStatisticsDlg::getFather(GEOM::GEOM_Object_ptr theObj)
+{
+  GEOM::GEOM_Object_var aFatherObj;
+  if (theObj->GetType() == GEOM_GROUP) {
+    GEOM::GEOM_IGroupOperations_var anOper = GEOM::GEOM_IGroupOperations::_narrow(getOperation());
+    aFatherObj = anOper->GetMainShape(theObj);
+  }
+  return aFatherObj._retn();
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> MeasureGUI_ShapeStatisticsDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myMainObj;
+  return res;
+}
+
+//=================================================================================
+// function : onEditMainShape()
+// purpose  : called when selection button was clicked
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::onEditMainShape()
+{
+  // restore initial parameters for dialog box
+  myEditMainShape->setText("");
+  myEditMainShape->setFocus();
+
+  //get shapes from selection
+  QList<GEOM::GeomObjPtr> selShapes = getSelected( TopAbs_SHAPE, -1 );
+
+  myButtonPlot->setEnabled( !selShapes.isEmpty() );
+  myButtonCreateGr->setEnabled( selShapes.count() == 1 );
+
+  if ( !selShapes.isEmpty() ) {
+    if ( selShapes.count() == 1 )
+      myMainObj = selShapes[0];
+    QString aName = selShapes.count() > 1 ? QString( "%1_objects").arg( selShapes.count() ) : GEOMBase::GetName( myMainObj.get() );
+    myEditMainShape->setText( aName );
+  }
+
+  updateTypes( selShapes );
+}
+
+//=================================================================================
+// function : currentType()
+// purpose  : returns currently selected type of shapes in 'Type' combobox
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::fillTypes( bool hasEdges, bool hasFaces, bool hasSolids )
+{
+  if ( hasEdges )
+    myCBTypes->addItem( tr("GEOM_SHAPE_STATISTICS_LENGTH"), (int)TopAbs_EDGE );
+  if ( hasFaces )
+    myCBTypes->addItem( tr("GEOM_SHAPE_STATISTICS_AREA"), (int)TopAbs_FACE );
+  if ( hasSolids )
+    myCBTypes->addItem( tr("GEOM_SHAPE_STATISTICS_VOLUME"), (int)TopAbs_SOLID );
+
+  myCBTypes->setEnabled( myCBTypes->count() > 0 );
+}
+
+//=================================================================================
+// function : updateTypes()
+// purpose  : update 'Type' combobox with available types
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::updateTypes( QList<GEOM::GeomObjPtr> theShapes )
+{
+  myCBTypes->clear();
+  myCBTypes->setEnabled( false );
+
+  int hasEdges = -1, hasFaces = -1, hasSolids = -1;
+
+  myShapes.clear();
+  // get types of the shapes and its sub-shapes
+  foreach( GEOM::GeomObjPtr aShapePtr, theShapes ) {
+    if ( !aShapePtr )
+      return;
+
+    TopoDS_Shape aShape;
+    if ( !GEOMBase::GetShape( aShapePtr.get(), aShape ) || aShape.IsNull() )
+      return;
+
+    myShapes.push_back( aShape );
+
+    GEOM::ListOfLong_var aSubShapes;
+    GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+    if ( hasEdges != 0 )
+      hasEdges = aShOp->NumberOfSubShapes( aShapePtr.get(), TopAbs_EDGE ) > 0;
+    if ( hasFaces != 0 )
+      hasFaces = aShOp->NumberOfSubShapes( aShapePtr.get(), TopAbs_FACE ) > 0;
+    if ( hasSolids != 0 )
+      hasSolids = aShOp->NumberOfSubShapes( aShapePtr.get(), TopAbs_SOLID ) > 0;
+  }
+  fillTypes( hasEdges, hasFaces, hasSolids );
+}
+
+//=================================================================================
+// function : currentType()
+// purpose  : returns currently selected type of shapes in 'Type' combobox
+//=================================================================================
+TopAbs_ShapeEnum MeasureGUI_ShapeStatisticsDlg::currentType()
+{
+  return (TopAbs_ShapeEnum)( myCBTypes->itemData( myCBTypes->currentIndex() ).toInt() );
+}
+
+//=================================================================================
+// function : clickOnPlot()
+// purpose  : called when Plot button was clicked
+//=================================================================================
+bool MeasureGUI_ShapeStatisticsDlg::isValid(QString& theMessage)
+{
+  if ( myScalarRangeBox->isChecked() ) {
+    RETURN_WITH_MSG( !myMin->text().isEmpty(), tr("GEOM_SHAPE_STATISTICS_MIN_ERROR") )
+    RETURN_WITH_MSG( !myMax->text().isEmpty(), tr("GEOM_SHAPE_STATISTICS_MAX_ERROR") )
+    RETURN_WITH_MSG( myMin->text().toDouble() <= myMax->text().toDouble(), tr("GEOM_SHAPE_STATISTICS_MIN_MAX_ERROR") )
+  }
+  return true;
+}
+//=================================================================================
+// function : clickOnPlot()
+// purpose  : called when Plot button was clicked
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::clickOnPlot()
+{
+  GEOMUtils::Range aRange;
+  if ( myScalarRangeBox->isChecked() ) {
+    QString msg;
+    if ( !isValid( msg ) ) {
+      showError( msg );
+      return;
+    }
+    aRange.min = myMin->text().toDouble();
+    aRange.max = myMax->text().toDouble();
+  } else {
+    aRange.min = -1.0; // flag that range is empty
+    aRange.max = -1.0; // flag that range is empty
+  }
+
+  GEOMUtils::Distribution aShapesDistr = 
+    GEOMUtils::ComputeDistribution( myShapes, currentType(), myNbIntervals->value(), aRange );
+
+  QList<double> xVals, yVals;
+  double width = -1, min = -1;
+  double xmin = 1e+32, xmax = 0.0, ymax = 0.0;
+  int i=0;
+  GEOMUtils::Distribution::const_iterator it;
+  for (it = aShapesDistr.begin(); it != aShapesDistr.end(); it++) {
+    GEOMUtils::Range ran = *it;
+    if ( width < 0 ) width = ran.max - ran.min; // bar width
+    if ( min < 0 ) min = ran.min; // global min
+    xVals << width / 2. + i*width + min; // get a middle of bar
+    yVals << ran.count;
+    // get global boundary max values
+    if ( ran.min < xmin ) xmin = ran.min;
+    if ( ran.max > xmax ) xmax = ran.max;
+    if ( ran.count > ymax ) ymax = ran.count;
+    i++;
+  }
+
+  // plot the computed distribution
+  SUIT_ViewManager* aViewManager = myApp->getViewManager( Plot2d_Viewer::Type(), true ); // create if necessary
+  if( !aViewManager )
+    return;
+  Plot2d_ViewWindow* aViewWnd = dynamic_cast<Plot2d_ViewWindow*>(aViewManager->getActiveView());
+  if( !aViewWnd )
+    return;
+  Plot2d_ViewFrame* aPlot = aViewWnd->getViewFrame();
+  if ( !aPlot )
+    return;
+
+  aPlot->EraseAll();
+
+  // create or reuse histogram
+  if( !myHistogram )
+    myHistogram = new Plot2d_Histogram();
+  else
+    myHistogram->clearAllPoints();
+  // set histogram parameters
+  myHistogram->setData( xVals, yVals );
+  if ( width != 0.0 )
+    myHistogram->setWidth( width );
+  myHistogram->setAutoAssign(true);
+  myHistogram->setName( myEditMainShape->text() );
+  myHistogram->setHorTitle( myCBTypes->currentText() );
+  myHistogram->setVerTitle( tr("GEOM_SHAPE_STATISTICS_DISTRIBUTION_NB_ENT") );
+  myHistogram->setColor( QColor(0, 85, 0) );
+  // display histogram
+  aPlot->displayObject( myHistogram, true );
+  if ( width == 0.0 ) // only one X value
+    aPlot->fitAll();
+  else
+    aPlot->fitData( 0, xmin, xmax, 0.0, ymax );
+}
+
+//=================================================================================
+// function : clickOnCompute()
+// purpose  : called when Compute button was clicked
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::clickOnCompute()
+{
+  GEOMUtils::Range aRange;
+  aRange.min = -1.0; // flag that range is empty
+  aRange.max = -1.0; // flag that range is empty
+  std::map<int,double> measures = GEOMUtils::ComputeMeasures( myShapes, currentType(), aRange );
+  if ( measures.size() != 0 ) {
+    SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+    int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
+    myMin->setText( DlgRef::PrintDoubleValue( aRange.min, aPrecision ) );
+    myMax->setText( DlgRef::PrintDoubleValue( aRange.max, aPrecision ) );
+  }
+}
+
+//=================================================================================
+// function : clickOnCreateGroups()
+// purpose  : called when Create Groups button was clicked
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::clickOnCreateGroups()
+{
+  onAccept(false, false, false);
+}
+
+//=================================================================================
+// function : execute(ObjectList& objects)
+// purpose  : 
+//=================================================================================
+bool MeasureGUI_ShapeStatisticsDlg::execute(ObjectList& objects)
+{
+  if ( myMainObj.isNull() )
+    return false;
+
+  GEOM::GroupOpPtr anOper = GEOM::GEOM_IGroupOperations::_narrow(getOperation());
+
+  GEOMUtils::Range aRange;
+  if ( myScalarRangeBox->isChecked() ) {
+    QString msg;
+    if ( !isValid( msg ) ) {
+      showError( msg );
+      return false;
+    }
+    aRange.min = myMin->text().toDouble();
+    aRange.max = myMax->text().toDouble();
+  } else {
+    aRange.min = -1.0; // flag that range is empty
+    aRange.max = -1.0; // flag that range is empty
+  }
+
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
+  QString aTypePrefix = myCBTypes->currentText().replace(' ', '_');
+  QString objIOR, aMin, aMax, aGroupName;
+  SalomeApp_Study* study = getStudy();
+
+  GEOMUtils::Distribution aShapesDistr = 
+    GEOMUtils::ComputeDistribution( myShapes, currentType(), myNbIntervals->value(), aRange );
+
+  int nbGroups = 0;
+
+  GEOMUtils::Distribution::const_iterator it;
+  for (it = aShapesDistr.begin(); it != aShapesDistr.end(); it++) {
+    std::list<long> idList = (*it).indices;
+    int nn = idList.size();
+    if ( nn > 0 ) {
+      GEOM::ListOfLong_var aNewList = new GEOM::ListOfLong;
+      aNewList->length(nn);
+      int ii = 0;
+      std::list<long>::const_iterator id_it;
+      for ( id_it = idList.begin(); id_it != idList.end(); id_it++ ) {
+       aNewList[ii++] = *id_it;
+      }
+
+      // Create an empty group
+      GEOM::GEOM_Object_var aGroup;
+      aGroup = anOper->CreateGroup( myMainObj.get(), currentType() );
+
+      if (CORBA::is_nil(aGroup) || !anOper->IsDone())
+       return false;
+
+      // Add sub-shapes into group
+      anOper->UnionIDs(aGroup, aNewList);
+      if (!anOper->IsDone())
+       return false;
+
+      // publish group
+      aMin = DlgRef::PrintDoubleValue( (*it).min, aPrecision );
+      aMax = DlgRef::PrintDoubleValue( (*it).max, aPrecision );
+      aGroupName =  aTypePrefix + "_" + aMin + "_" + aMax;
+      GEOMBase::PublishSubObject( aGroup, aGroupName );
+
+      // this is needed just to avoid error message
+      objects.push_back(aGroup._retn());
+
+      nbGroups++;
+    }
+  }
+
+  SUIT_MessageBox::information( this, tr( "INF_INFO" ), tr( "GEOM_MSG_GROUPS_CREATED" ).arg( nbGroups ) );
+
+  return true;
+}
+
+//=================================================================================
+// function : clickOnHelp()
+// purpose  : called when Help button was clicked
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::clickOnHelp()
+{
+  GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( myApp->module( "Geometry" ) );
+  myApp->onHelpContextModule( aGeomGUI ? myApp->moduleName( aGeomGUI->moduleName() ) : QString(""), "shape_statistics_operation_page.html" );
+}
diff --git a/src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.h b/src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.h
new file mode 100644 (file)
index 0000000..8b604a2
--- /dev/null
@@ -0,0 +1,93 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File   : MeasureGUI_ShapeStatisticsDlg.h
+// Author : Alexander KOVALEV, Open CASCADE (alexander.kovalev@opencascade.com)
+//
+#ifndef MEASUREGUI_SHAPESTATISTICSDLG_H
+#define MEASUREGUI_SHAPESTATISTICSDLG_H
+
+// GEOM includes
+#include <GEOMBase_Helper.h>
+#include "GEOM_GenericObjPtr.h"
+#include "MeasureGUI_definitions.h"
+
+// Qt includes
+#include <QDialog>
+#include <QLineEdit>
+#include <QPointer>
+#include <QGroupBox>
+
+// Qtx includes
+#include <QtxIntSpinBox.h>
+#include <QtxComboBox.h>
+
+class Plot2d_Histogram;
+
+//==========================================================================
+// class    : MeasureGUI_ShapeStatisticsDlg
+// purpose  :
+//==========================================================================
+
+class MEASUREGUI_EXPORT MeasureGUI_ShapeStatisticsDlg : public QDialog, public GEOMBase_Helper
+{
+  Q_OBJECT
+
+public:
+  MeasureGUI_ShapeStatisticsDlg( QWidget*, TopoDS_Shape aShape = TopoDS_Shape(), TopAbs_ShapeEnum aSubShapeType = TopAbs_SHAPE );
+  ~MeasureGUI_ShapeStatisticsDlg();
+  
+protected:
+  // redefined from GEOMBase_Helper
+  virtual GEOM::GEOM_IOperations_ptr  createOperation();
+  virtual bool                        isValid (QString&);
+  virtual bool                        execute (ObjectList&);
+  virtual GEOM::GEOM_Object_ptr       getFather (GEOM::GEOM_Object_ptr);
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
+
+private slots:
+  void                    onEditMainShape();
+  void                    clickOnCompute();
+  void                    clickOnPlot();
+  void                    clickOnCreateGroups();
+  void                    clickOnHelp();
+  
+private:
+  void                    fillTypes( bool, bool, bool );
+  void                    updateTypes( QList<GEOM::GeomObjPtr> theShapes );
+  TopAbs_ShapeEnum        currentType();
+
+private:
+  SalomeApp_Application*     myApp;
+  QLineEdit*                 myEditMainShape;
+  QtxComboBox*               myCBTypes;
+  std::list<TopoDS_Shape>    myShapes;
+  GEOM::GeomObjPtr           myMainObj;
+  QtxIntSpinBox*             myNbIntervals;
+  QGroupBox*                 myScalarRangeBox;
+  QLineEdit*                 myMin;
+  QLineEdit*                 myMax;
+  QPushButton*               myButtonPlot;
+  QPushButton*               myButtonCreateGr;
+  Plot2d_Histogram*          myHistogram;
+
+};
+
+#endif // MEASUREGUI_SHAPESTATISTICSDLG_H
index 3bf5a2bf7ea6e9912aee9fb57b696f68704778cc..7b331751c49da51cdf31c436f23639743f30e12d 100644 (file)
@@ -193,10 +193,8 @@ void MeasureGUI_WhatisDlg::processObject()
 //=================================================================================
 void MeasureGUI_WhatisDlg::activateSelection()
 {
-  MeasureGUI_Skeleton::activateSelection();
-  std::list<int> needTypes;
-  needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
-  localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+  globalSelection(); // all types of objects
+  localSelection(TopAbs_SHAPE); // all types of sub-shapes
 }
 
 //=================================================================================
@@ -264,7 +262,9 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
   if ( !anOper->IsDone() )
     return aKindStr;
 
-#define PRINT_DOUBLE(val, tol) DlgRef::PrintDoubleValue( val, tol )
+#define PRINT_DOUBLE(val, tol) QString(" %1").arg( DlgRef::PrintDoubleValue( val, tol ) )
+#define TITLE(val) QString("<b>%1</b>").arg(tr(val))
+#define TITLE_I(val, i) QString("<b>%1</b>").arg(tr(val).arg(i))
   switch ( aKind )
   {
   case GEOM::GEOM_IKindOfShape::COMPOUND:
@@ -294,85 +294,85 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
   // SOLIDs
   case GEOM::GEOM_IKindOfShape::SPHERE:
     aKindStr = tr( "GEOM_SPHERE" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        tr( "GEOM_RADIUS" )       + PRINT_DOUBLE( aDbls[3], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS" )         + PRINT_DOUBLE( aDbls[3], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::CYLINDER:
     aKindStr = tr( "GEOM_CYLINDER" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_AXIS" )         +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        tr( "GEOM_RADIUS" )       + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_HEIGHT" )       + PRINT_DOUBLE( aDbls[7], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_AXIS" )        +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS" )         + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_HEIGHT" )         + PRINT_DOUBLE( aDbls[7], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::BOX:
     aKindStr = tr( "GEOM_BOX" );
-    theParameters = tr( "GEOM_CENTER") +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        "Ax :"                    + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        "Ay :"                    + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        "Az :"                    + PRINT_DOUBLE( aDbls[5], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + "Ax :"                      + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + "Ay :"                      + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + "Az :"                      + PRINT_DOUBLE( aDbls[5], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::ROTATED_BOX:
     aKindStr = tr( "GEOM_BOX" );
-    theParameters = tr( "GEOM_CENTER" )         +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\nZ Axis:"                               +
-      "\n" +        "Zx :"                      + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        "Zy :"                      + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        "Zz :"                      + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\nX Axis:"                               +
-      "\n" +        tr( "GEOM_X_I" ).arg( "x" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( "y" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( "z" ) + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
-      "\nDimensions along local axes:"          +
-      "\n" +        "Ax :"                      + PRINT_DOUBLE( aDbls[9],  aLenPrecision ) +
-      "\n" +        "Ay :"                      + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
-      "\n" +        "Az :"                      + PRINT_DOUBLE( aDbls[11], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_Z_AXIS")       +
+      "<br>" + tr( "GEOM_Z_I" ).arg( "x" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( "y" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( "z" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_X_AXIS")       +
+      "<br>" + tr( "GEOM_X_I" ).arg( "x" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( "y" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( "z" ) + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIM_AXES")     +
+      "<br>" + tr( "GEOM_A_I" ).arg( "x" ) + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
+      "<br>" + tr( "GEOM_A_I" ).arg( "y" ) + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
+      "<br>" + tr( "GEOM_A_I" ).arg( "z" ) + PRINT_DOUBLE( aDbls[11], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::TORUS:
     aKindStr = tr( "GEOM_TORUS" );
-    theParameters = tr( "GEOM_CENTER" )            +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_AXIS" )              +
-      "\n" +        tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )        +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" )    +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_AXIS" )           +
+      "<br>" + tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )     +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::CONE:
     aKindStr = tr( "GEOM_CONE" );
-    theParameters = tr( "GEOM_CENTER" )            +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_AXIS" )              +
-      "\n" +        tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )        +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
-      "\n" +        tr( "GEOM_HEIGHT" )            + PRINT_DOUBLE( aDbls[8], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" )    +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_AXIS" )           +
+      "<br>" + tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )     +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
+      "<br>" + tr( "GEOM_HEIGHT" )            + PRINT_DOUBLE( aDbls[8], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::POLYHEDRON:
     aKindStr = tr( "GEOM_POLYHEDRON" );
@@ -383,115 +383,115 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
   // FACEs
   case GEOM::GEOM_IKindOfShape::SPHERE2D:
     aKindStr = tr( "GEOM_SURFSPHERE" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        tr( "GEOM_RADIUS" )       + PRINT_DOUBLE( aDbls[3], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS" )         + PRINT_DOUBLE( aDbls[3], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::CYLINDER2D:
     aKindStr = tr( "GEOM_SURFCYLINDER" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_AXIS" )         +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        tr( "GEOM_RADIUS" )       + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_HEIGHT" )       + PRINT_DOUBLE( aDbls[7], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_AXIS" )        +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS" )         + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_HEIGHT" )         + PRINT_DOUBLE( aDbls[7], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::TORUS2D:
     aKindStr = tr( "GEOM_SURFTORUS" );
-    theParameters = tr( "GEOM_CENTER" )            +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_AXIS" )              +
-      "\n" +        tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )        +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" )    +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_AXIS" )           +
+      "<br>" + tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )     +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::CONE2D:
     aKindStr = tr( "GEOM_SURFCONE" );
-    theParameters = tr( "GEOM_CENTER" )            +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_AXIS" )              +
-      "\n" +        tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )        +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
-      "\n" +        tr( "GEOM_HEIGHT" )            + PRINT_DOUBLE( aDbls[8], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" )    +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_AXIS" )           +
+      "<br>" + tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )     +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
+      "<br>" + tr( "GEOM_HEIGHT" )            + PRINT_DOUBLE( aDbls[8], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::DISK_CIRCLE:
     aKindStr = tr( "GEOM_DISK_CIRCLE" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )       +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        tr( "GEOM_RADIUS" )      + PRINT_DOUBLE( aDbls[6], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS" )         + PRINT_DOUBLE( aDbls[6], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::DISK_ELLIPSE:
     aKindStr = tr( "GEOM_DISK_ELLIPSE" );
-    theParameters = tr( "GEOM_CENTER" )         +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )         +
-      "\n" +        tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )     +
-      "\n" +        tr( "GEOM_RADIUS_MAJOR" )   + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_MINOR" )   + PRINT_DOUBLE( aDbls[7], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS_MAJOR" )   + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_MINOR" )   + PRINT_DOUBLE( aDbls[7], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::POLYGON:
     aKindStr = tr( "GEOM_POLYGON" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )       +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::PLANE:
     aKindStr = tr( "GEOM_PLANE" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )       +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::PLANAR:
     aKindStr = tr( "GEOM_PLANAR_FACE" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )       +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::FACE:
     aKindStr = tr( "GEOM_FACE" );
@@ -499,105 +499,124 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
   // EDGEs
   case GEOM::GEOM_IKindOfShape::CIRCLE:
     aKindStr = tr( "GEOM_CIRCLE" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )       +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        tr( "GEOM_RADIUS" )       + PRINT_DOUBLE( aDbls[6], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS" )         + PRINT_DOUBLE( aDbls[6], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::ARC_CIRCLE:
     aKindStr = tr( "GEOM_ARC" );
-    theParameters = tr( "GEOM_CENTER" )           +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )           +
-      "\n" +        tr( "GEOM_DX" )               + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )               + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )               + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )       +
-      "\n" +        tr( "GEOM_RADIUS" )           + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_POINT_I" ).arg( 1 ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
-      "\n" +        tr( "GEOM_POINT_I" ).arg( 2 ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[11], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[12], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" )  +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )    + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )    + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )    + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )       +
+      "<br>" + tr( "GEOM_DX" )              + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )              + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )              + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )   +
+      "<br>" + tr( "GEOM_RADIUS" )          + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + TITLE_I( "GEOM_POINT_I", 1 ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 1 )    + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 1 )    + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 1 )    + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
+      "<br>" + TITLE_I( "GEOM_POINT_I", 2 ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 2 )    + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 2 )    + PRINT_DOUBLE( aDbls[11], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 2 )    + PRINT_DOUBLE( aDbls[12], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::ELLIPSE:
     aKindStr = tr( "GEOM_ELLIPSE" );
-    theParameters = tr( "GEOM_CENTER" )         +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )         +
-      "\n" +        tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )     +
-      "\n" +        tr( "GEOM_RADIUS_MAJOR" )   + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_MINOR" )   + PRINT_DOUBLE( aDbls[7], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS_MAJOR" )   + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_MINOR" )   + PRINT_DOUBLE( aDbls[7], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::ARC_ELLIPSE:
     aKindStr = tr( "GEOM_ARC_ELLIPSE" );
-    theParameters = tr( "GEOM_CENTER" )           +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )           +
-      "\n" +        tr( "GEOM_DX" )               + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )               + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )               + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )       +
-      "\n" +        tr( "GEOM_RADIUS_MAJOR" )     + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_MINOR" )     + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
-      "\n" +        tr( "GEOM_POINT_I" ).arg( 1 ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
-      "\n" +        tr( "GEOM_POINT_I" ).arg( 2 ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[11], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[12], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[13], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" )  +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )    + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )    + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )    + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )       +
+      "<br>" + tr( "GEOM_DX" )              + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )              + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )              + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )   +
+      "<br>" + tr( "GEOM_RADIUS_MAJOR" )    + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_MINOR" )    + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
+      "<br>" + TITLE_I( "GEOM_POINT_I", 1 ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 1 )    + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 1 )    + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 1 )    + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
+      "<br>" + TITLE_I( "GEOM_POINT_I", 2 ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 2 )    + PRINT_DOUBLE( aDbls[11], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 2 )    + PRINT_DOUBLE( aDbls[12], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 2 )    + PRINT_DOUBLE( aDbls[13], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::LINE:
     aKindStr = tr( "GEOM_LINE" );
-    theParameters = tr( "GEOM_POSITION" )     +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIRECTION" )    +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision );
+    theParameters = TITLE( "GEOM_POSITION" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIRECTION" )     +
+      "<br>" + tr( "GEOM_DX" )               + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )               + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )               + PRINT_DOUBLE( aDbls[5], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::SEGMENT:
     aKindStr = tr( "GEOM_SEGMENT" );
-    theParameters = tr( "GEOM_POINT_I" ).arg( 1 ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_POINT_I" ).arg( 2 ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[5], aLenPrecision );
+    theParameters = TITLE_I( "GEOM_POINT_I", 1 ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 1 )         + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 1 )         + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 1 )         + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE_I( "GEOM_POINT_I", 2 )      +
+      "<br>" + tr( "GEOM_X_I" ).arg( 2 )         + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 2 )         + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 2 )         + PRINT_DOUBLE( aDbls[5], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::EDGE:
     aKindStr = tr( "GEOM_EDGE" );
     break;
   case GEOM::GEOM_IKindOfShape::VERTEX:
     aKindStr = tr( "GEOM_VERTEX" );
-    theParameters = tr( "GEOM_COORDINATES" ) +
-      "\n" +        tr( "GEOM_X" )           + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y" )           + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z" )           + PRINT_DOUBLE( aDbls[2], aLenPrecision );
+    theParameters = TITLE( "GEOM_COORDINATES" ) +
+      "<br>" + tr( "GEOM_X" )                   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y" )                   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z" )                   + PRINT_DOUBLE( aDbls[2], aLenPrecision );
+    break;
+  case GEOM::GEOM_IKindOfShape::LCS:
+    aKindStr = tr( "GEOM_LCS" );
+    theParameters = TITLE("GEOM_POSITION")    +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_X_AXIS")     + 
+      "<br>" + "Xx :"                    + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + "Xy :"                    + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + "Xz :"                    + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_Y_AXIS")     + 
+      "<br>" + "Yx :"                    + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + "Yy :"                    + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
+      "<br>" + "Yz :"                    + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_Z_AXIS")     + 
+      "<br>" + "Zx :"                    + PRINT_DOUBLE( aDbls[9],  aLenPrecision ) +
+      "<br>" + "Zy :"                    + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
+      "<br>" + "Zz :"                    + PRINT_DOUBLE( aDbls[11], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::ADVANCED:
     {
@@ -629,4 +648,4 @@ void MeasureGUI_WhatisDlg::SelectionIntoArgument()
   mySelEdit->setText(GEOMBase::GetName(myObj.get()));
   processObject();
   redisplayPreview();
-}
\ No newline at end of file
+}
diff --git a/src/MeasureGUI/MeasureGUI_definitions.h b/src/MeasureGUI/MeasureGUI_definitions.h
new file mode 100644 (file)
index 0000000..f617200
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef  MEASUREGUI_DEF_HXX
+#define  MEASUREGUI_DEF_HXX
+
+#ifdef WIN32
+# if defined MEASUREGUI_EXPORTS || defined MeasureGUI_EXPORTS
+#  define MEASUREGUI_EXPORT __declspec( dllexport )
+# else
+#  define MEASUREGUI_EXPORT __declspec( dllimport )
+# endif
+#else
+# define MEASUREGUI_EXPORT
+#endif
+
+#endif
\ No newline at end of file
index 60a7497caaa2ef518d931010770104d63812fc79..4e2373e6625c6d49ea9708a7a20b8f60b3b8d469 100755 (executable)
@@ -17,7 +17,6 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(${QT_USE_FILE})
 INCLUDE(${VTK_USE_FILE})
 
 # --- options ---
@@ -26,7 +25,6 @@ INCLUDE(${VTK_USE_FILE})
 INCLUDE_DIRECTORIES(
   ${VTK_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
-  ${QT_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
   ${CAS_INCLUDE_DIRS}
   ${KERNEL_INCLUDE_DIRS}
index cc01eb7e8b2a3077351a3ad75c59fb8c70d3d6aa..a76c4e86fef27f419b26088cce6e321c3c0e47b8 100755 (executable)
@@ -126,11 +126,11 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
         pt2.Transform(edgeTransf);
       }
 
-      float aCoord1[3] = {pt1.X(), pt1.Y(), pt1.Z()};
+      float aCoord1[3] = {(float)pt1.X(), (float)pt1.Y(), (float)pt1.Z()};
       vtkIdType anIds[2];
       anIds[0] = thePts->InsertNextPoint(aCoord1);
 
-      float aCoord2[3] = {pt2.X(), pt2.Y(), pt2.Z()};
+      float aCoord2[3] = {(float)pt2.X(), (float)pt2.Y(), (float)pt2.Z()};
       anIds[1] = thePts->InsertNextPoint(aCoord2);
 
       thePolyData->InsertNextCell(VTK_LINE,2,anIds);
@@ -156,11 +156,11 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
         pt2.Transform(edgeTransf);
       }
       
-      float aCoord1[3] = {pt1.X(), pt1.Y(), pt1.Z()};
+      float aCoord1[3] = {(float)pt1.X(), (float)pt1.Y(), (float)pt1.Z()};
       vtkIdType anIds[2];
       anIds[0] = thePts->InsertNextPoint(aCoord1);
 
-      float aCoord2[3] = {pt2.X(), pt2.Y(), pt2.Z()};
+      float aCoord2[3] = {(float)pt2.X(), (float)pt2.Y(), (float)pt2.Z()};
       anIds[1] = thePts->InsertNextPoint(aCoord2);
 
       thePolyData->InsertNextCell(VTK_LINE,2,anIds);
@@ -226,7 +226,7 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
     // Add points and segments, composing the arrow
     Standard_Real cosinus, sinus, Tg = tan(anAngle);
 
-    float coord[3] = {xo, yo, zo};
+    float coord[3] = {(float)xo, (float)yo, (float)zo};
 
     vtkIdType ptLoc = thePts->InsertNextPoint(coord);
     vtkIdType ptFirst = 0;
index 4fa28ace00c1a105ae30669dbfc143dcf7eb7f99..0f26e722e0014619447145a730b3a1a798cc590b 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-#INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -94,12 +92,12 @@ SET(_moc_HEADERS
   )
 
 # header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
+QT_WRAP_UIC(_uic_HEADERS ${_uic_files})
 
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(OperationGUI_SOURCES
   OperationGUI.cxx
index e90b50c65780000b8ec98dfe7c05d33a412ffcba..876d2068f53a253bd73767e2e151be3a341ff520 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(${QT_USE_FILE})
-
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -84,7 +81,7 @@ SET(_moc_HEADERS
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(PrimitiveGUI_SOURCES
   PrimitiveGUI.cxx
index 7ee734a7b1c29381fba43b24ea337f147660960a..f18df7940ea3a08a2fca26cb0a0aca1554806974 100644 (file)
@@ -307,7 +307,7 @@ void PrimitiveGUI_BoxDlg::SetEditCurrentArgument()
 
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   globalSelection(); // close local contexts, if any
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+  localSelection(TopAbs_VERTEX);
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
 
@@ -323,7 +323,7 @@ void PrimitiveGUI_BoxDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
   if (getConstructorId() == 0) {
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
     connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
             this, SLOT(SelectionIntoArgument()));
   }
index a3c86ed62b6b951a235dc7ed25bca7205755580b..a69ddf95759af526137324609660a45e091d5ec4 100644 (file)
@@ -308,7 +308,7 @@ void PrimitiveGUI_ConeDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit2->setEnabled(false);
 
     globalSelection(GEOM_POINT); // to break previous local selection
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupPoints->PushButton2) {
     myEditCurrentArgument = GroupPoints->LineEdit2;
@@ -317,7 +317,7 @@ void PrimitiveGUI_ConeDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit1->setEnabled(false);
 
     globalSelection(GEOM_LINE);// to break previous local selection
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
index fd30c9b4462be889ee3fa99ed287cf06e6ee7e9d..fce60b91c95ffcd410d4d78eeda1eb4a84f71f59 100644 (file)
@@ -317,7 +317,7 @@ void PrimitiveGUI_CylinderDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit2->setEnabled(false);
 
     globalSelection(GEOM_POINT); // to break previous local selection
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupPoints->PushButton2) {
     myEditCurrentArgument = GroupPoints->LineEdit2;
@@ -326,7 +326,7 @@ void PrimitiveGUI_CylinderDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit1->setEnabled(false);
 
     globalSelection(GEOM_LINE);  // to break previous local selection
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
index 4101be2725a2bb94710f19eb510a4e0b50a7597b..d558048bf55229326626170aa23a1e7f1c818622 100755 (executable)
@@ -397,11 +397,11 @@ void PrimitiveGUI_DiskDlg::SetEditCurrentArgument()
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   if (myEditCurrentArgument == GroupPntVecR->LineEdit2) {
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   else {
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
index 6f6d17912ef09585bc3dab98a8cf8a7fc9d8429d..e36fd5fc0b5b5a20e4dc04adcd2f78c7c0c8e048 100755 (executable)
@@ -127,7 +127,7 @@ void PrimitiveGUI_FaceDlg::Init()
   myEdge.nullify();
   myFace.nullify();
   globalSelection(); // close local contexts, if any
-  //  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+  //  localSelection( TopAbs_EDGE );
 
   myOrientationType = 1;
 
@@ -224,12 +224,12 @@ void PrimitiveGUI_FaceDlg::TypeButtonClicked()
 {
   if ( GroupType->RadioButton1->isChecked() ) {
     globalSelection(); // close local contexts, if any
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
     GroupPlane->TextLabel1->setText( tr( "GEOM_EDGE" ) );
   }
   else if ( GroupType->RadioButton2->isChecked() ) {
     globalSelection(); // close local contexts, if any
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+    localSelection( TopAbs_FACE );
     GroupPlane->TextLabel1->setText( tr( "GEOM_FACE" ) );
   }
   myEditCurrentArgument = GroupPlane->LineEdit1;
@@ -288,7 +288,7 @@ void PrimitiveGUI_FaceDlg::ConstructorsClicked( int constructorId )
   case 1:
     {
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+      localSelection( TopAbs_EDGE );
       myEditCurrentArgument = GroupPlane->LineEdit1;
       myEditCurrentArgument->setText("");
       myEdge.nullify();
@@ -362,9 +362,9 @@ void PrimitiveGUI_FaceDlg::SetEditCurrentArgument()
   if ( send == GroupPlane->PushButton1 ) {
     myEditCurrentArgument = GroupPlane->LineEdit1;
     if (GroupType->RadioButton1->isChecked())
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+      localSelection( TopAbs_EDGE );
     else if (GroupType->RadioButton1->isChecked())
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+      localSelection( TopAbs_FACE );
   }
 
   myEditCurrentArgument->setFocus();
index ddd615ef932ba872db30a5640d9fcc01d965be1b..73e2c592fff8931a573283bc4b5673192698b8bb 100644 (file)
@@ -165,7 +165,7 @@ void PrimitiveGUI_SphereDlg::ConstructorsClicked( int constructorId )
   case 0:
     {
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+      localSelection( TopAbs_VERTEX );
 
       GroupDimensions->hide();
       GroupPoints->show();
@@ -268,7 +268,7 @@ void PrimitiveGUI_SphereDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit1->setFocus();
     myEditCurrentArgument = GroupPoints->LineEdit1;
     globalSelection(); // close local contexts, if any
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+    localSelection( TopAbs_VERTEX );
     SelectionIntoArgument();
   }
 }
index 3cc46d8e574c4d17bd582044bbd15ed759f13636..979e52412354e56da9d6c0d663443302cbe846eb 100644 (file)
@@ -296,7 +296,7 @@ void PrimitiveGUI_TorusDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit2->setEnabled(false);
 
     globalSelection(GEOM_POINT); // to break previous local selection
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupPoints->PushButton2) {
     myEditCurrentArgument = GroupPoints->LineEdit2;
@@ -305,7 +305,7 @@ void PrimitiveGUI_TorusDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit1->setEnabled(false);
 
     globalSelection(GEOM_LINE);  // to break previous local selection
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
index 34310cf4c0a697bd8362d1d310363ac9423e2dee..39cd01713358e140c7532fbcadaa4b0e6539e18e 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-#INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -41,6 +39,7 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/DlgRef
   ${PROJECT_BINARY_DIR}/src/DlgRef
   ${PROJECT_SOURCE_DIR}/src/GEOMAlgo
+  ${PROJECT_SOURCE_DIR}/src/GEOMUtils
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_BINARY_DIR}
   )
@@ -55,6 +54,7 @@ ADD_DEFINITIONS(
 # libraries to link to
 SET(_link_LIBRARIES
   GEOMBase
+  GEOMUtils
   )
 
 # --- resources ---
@@ -108,12 +108,12 @@ SET(_moc_HEADERS
   )
 
 # header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
+QT_WRAP_UIC(_uic_HEADERS ${_uic_files})
 
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(RepairGUI_SOURCES
   RepairGUI.cxx
index 6c177ab85bee6602a3793f7b925a6a9affae9f57..fff787d5c994f7dd5f3e21956769d91b54f3d281 100644 (file)
@@ -98,7 +98,7 @@ bool RepairGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
   case GEOMOp::OpRemoveExtraEdges: aDlg = new RepairGUI_RemoveExtraEdgesDlg  (getGeometryGUI(), parent); break;
   case GEOMOp::OpFuseEdges:        aDlg = new RepairGUI_FuseEdgesDlg         (getGeometryGUI(), parent); break;
   case GEOMOp::OpUnionFaces:       aDlg = new RepairGUI_UnionFacesDlg        (getGeometryGUI(), parent); break;
-  case GEOMOp::OpInspectObj:       aDlg = new RepairGUI_InspectObjectDlg     (parent); break;
+  case GEOMOp::OpInspectObj:       aDlg = new RepairGUI_InspectObjectDlg     (getGeometryGUI(), parent); break;
   default:
     app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
     break;
@@ -158,7 +158,11 @@ namespace
     const int nbCols = 2;
     QTableWidget* table = new QTableWidget( nbRows, nbCols, this );
     table->setEditTriggers( QAbstractItemView::NoEditTriggers );
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     table->horizontalHeader()->setResizeMode( 1, QHeaderView::Interactive );
+#else
+    table->horizontalHeader()->setSectionResizeMode( 1, QHeaderView::Interactive );
+#endif
     table->horizontalHeader()->setStretchLastSection( true );
 
     QStringList headers;
index 086874a9002389be43322501953204e49d38860d..21f39aef923e9d0fb9a59e2199d6f35954ce7ab1 100644 (file)
@@ -127,13 +127,13 @@ RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg( GeometryGUI* theGeometryGUI, Q
 //=======================================================================
 void RepairGUI_DivideEdgeDlg::ConstructorsClicked( int constructorId )
 {
-  myIsParameterGr->button( 0 )->setShown( constructorId == BY_PARAM );
-  myIsParameterGr->button( 1 )->setShown( constructorId == BY_PARAM );
-  myValEdt                    ->setShown( constructorId == BY_PARAM );
-  myValLbl                    ->setShown( constructorId == BY_PARAM );
-  GroupPoints->TextLabel2     ->setShown( constructorId == BY_POINT_PROJ );
-  GroupPoints->PushButton2    ->setShown( constructorId == BY_POINT_PROJ );
-  GroupPoints->LineEdit2      ->setShown( constructorId == BY_POINT_PROJ );
+  myIsParameterGr->button( 0 )->setVisible( constructorId == BY_PARAM );
+  myIsParameterGr->button( 1 )->setVisible( constructorId == BY_PARAM );
+  myValEdt                    ->setVisible( constructorId == BY_PARAM );
+  myValLbl                    ->setVisible( constructorId == BY_PARAM );
+  GroupPoints->TextLabel2     ->setVisible( constructorId == BY_POINT_PROJ );
+  GroupPoints->PushButton2    ->setVisible( constructorId == BY_POINT_PROJ );
+  GroupPoints->LineEdit2      ->setVisible( constructorId == BY_POINT_PROJ );
 
   initSelection();
 
@@ -550,12 +550,10 @@ bool RepairGUI_DivideEdgeDlg::getIsByParameter() const
 //=================================================================================
 void RepairGUI_DivideEdgeDlg::initSelection()
 {
-  TopAbs_ShapeEnum type = TopAbs_EDGE;
-  if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
-    type = TopAbs_VERTEX;
-
-  globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), type ); // load local selection on ALL objects
+  // close local contexts
+  globalSelection();
+  // load local selection on ALL objects
+  localSelection( myEditCurrentArgument == GroupPoints->LineEdit2 ? TopAbs_VERTEX : TopAbs_EDGE );
 }
 
 //=================================================================================
index ac1372811e1403a9d09a99955de34f124521d5d6..d6671dbbf4e7135598513d8d0b2284e3e797b2fe 100644 (file)
@@ -69,8 +69,8 @@ RepairGUI_FuseEdgesDlg::RepairGUI_FuseEdgesDlg (GeometryGUI* theGeometryGUI,
   GroupVertexes->LineEdit1->setReadOnly(true);
   GroupVertexes->LineEdit2->setReadOnly(true);
 
-  GroupVertexes->TextLabel3->setShown(false);
-  GroupVertexes->SpinBox_DX->setShown(false);
+  GroupVertexes->TextLabel3->setVisible(false);
+  GroupVertexes->SpinBox_DX->setVisible(false);
 
   QVBoxLayout* layout = new QVBoxLayout (centralWidget());
   layout->setMargin(0);
index 3d9c5cc1d425ba4093d46255e540f1063b96bafe..2c288851b38403a4a4585bc1ce0e6b61f4d2fd9a 100644 (file)
@@ -615,8 +615,6 @@ bool RepairGUI_GlueDlg::onAcceptLocal()
     return false;
   }
 
-  erasePreview(false);
-
   try {
     if (openCommand()) {
       SUIT_OverrideCursor wc;
@@ -672,6 +670,8 @@ bool RepairGUI_GlueDlg::onAcceptLocal()
     abortCommand();
   }
 
+  erasePreview(false);
+
   updateViewer();
   activateSelection();
   updateButtonState();
index e0c5ef0ba1b977fe81945d7a963de4ccb3b10ab7..897348edc33d63b984973e78d32839210ef94d19 100644 (file)
@@ -24,6 +24,7 @@
 #include <GEOMBase.h>
 #include <GEOM_Constants.h>
 #include <GeometryGUI.h>
+#include <GEOMUtils.hxx>
 
 // GUI includes
 #include <SUIT_Session.h>
 #include <LightApp_SelectionMgr.h>
 
 #include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
 #include <SalomeApp_Study.h>
 
 #include <OCCViewer_ViewModel.h>
 #include <SVTK_ViewModel.h>
 
 // OCCT includes
+#include <BRep_Tool.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
 #include <TopoDS_Iterator.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
 
 // Qt includes
+#include <QButtonGroup>
+#include <QComboBox>
 #include <QGridLayout>
+#include <QGroupBox>
 #include <QPushButton>
 #include <QHeaderView>
 #include <QItemDelegate>
+#include <QLineEdit>
+#include <QRadioButton>
+#include <QStackedLayout>
+#include <QTreeWidgetItem>
+
+// Shape type definitions (values are equal to corresponding types of TopAbs_ShapeEnum).
+#define TYPE_FACE   4
+#define TYPE_EDGE   6
+#define TYPE_VERTEX 7
+
+// Comparison type definitions
+#define COMPARE_GT 0
+#define COMPARE_GE 1
+#define COMPARE_LT 2
+#define COMPARE_LE 3
+
+// Default tolerance values
+#define DEFAULT_TOLERANCE_VALUE         1.e-07
 
 //=================================================================================
 // class    : RepairGUI_InspectObjectDlg::TreeWidgetItem
 class RepairGUI_InspectObjectDlg::TreeWidgetItem : public QTreeWidgetItem
 {
 public:
-  TreeWidgetItem( QTreeWidget*, const QStringList&, const TopoDS_Shape&, const Handle(SALOME_InteractiveObject)&, int = Type );
-  TreeWidgetItem( QTreeWidgetItem*, const QStringList&, const TopoDS_Shape&, const QString&, int = Type );
+  TreeWidgetItem(QTreeWidget*,
+                 const QStringList&,
+                 const TopoDS_Shape&,
+                 const Handle(SALOME_InteractiveObject)&,
+                 double = DEFAULT_TOLERANCE_VALUE,
+                 int = Type);
+
+  TreeWidgetItem(QTreeWidgetItem*,
+                 const QStringList&,
+                 const TopoDS_Shape&,
+                 const QString&,
+                 double = DEFAULT_TOLERANCE_VALUE,
+                 int = Type);
+
   ~TreeWidgetItem();
 
   bool                             isVisible();
@@ -66,29 +107,45 @@ public:
   TopoDS_Shape                     getShape() const;
   Handle(SALOME_InteractiveObject) getIO() const;
 
+  double                           getTolerance() const;
+  void                             setTolerance(double theTolerance);
+
 private:
   bool                             myIsVisible;
   TopoDS_Shape                     myShape;
   Handle(SALOME_InteractiveObject) myIO;
+  double                           myTolerance;
 
 };
 
-RepairGUI_InspectObjectDlg::TreeWidgetItem::TreeWidgetItem( QTreeWidget* view, const QStringList &strings, const TopoDS_Shape& shape,
-                                                            const Handle(SALOME_InteractiveObject)& io, int type )
+RepairGUI_InspectObjectDlg::TreeWidgetItem::TreeWidgetItem
+                     (QTreeWidget                            *view,
+                      const QStringList                      &strings,
+                      const TopoDS_Shape                     &shape,
+                      const Handle(SALOME_InteractiveObject) &io,
+                      double                                  theTolerance,
+                      int                                     type)
 : QTreeWidgetItem( view, strings, type ),
   myIsVisible( false ),
   myShape( shape ),
-  myIO( io )
+  myIO( io ),
+  myTolerance (theTolerance)
 {
 }
 
-RepairGUI_InspectObjectDlg::TreeWidgetItem::TreeWidgetItem( QTreeWidgetItem* parent, const QStringList &strings,
-                                                            const TopoDS_Shape& shape, const QString& entry, int type )
+RepairGUI_InspectObjectDlg::TreeWidgetItem::TreeWidgetItem
+                     (QTreeWidgetItem    *parent,
+                      const QStringList  &strings,
+                      const TopoDS_Shape &shape,
+                      const QString      &entry,
+                      double              theTolerance,
+                      int                 type)
 : QTreeWidgetItem( parent, strings, type ),
   myIsVisible( false ),
-  myShape( shape )
+  myShape( shape ),
+  myTolerance (theTolerance)
 {
-  myIO = new SALOME_InteractiveObject( entry.toAscii(), "GEOM", "TEMP_IO" );
+  myIO = new SALOME_InteractiveObject( entry.toLatin1(), "GEOM", "TEMP_IO" );
   setFlags( flags() | Qt::ItemIsEditable );
 }
 
@@ -117,6 +174,16 @@ Handle(SALOME_InteractiveObject) RepairGUI_InspectObjectDlg::TreeWidgetItem::get
   return myIO;
 }
 
+double RepairGUI_InspectObjectDlg::TreeWidgetItem::getTolerance() const
+{
+  return myTolerance;
+}
+
+void RepairGUI_InspectObjectDlg::TreeWidgetItem::setTolerance(double theTolerance)
+{
+  myTolerance = theTolerance;
+}
+
 //=================================================================================
 // class    : RepairGUI_InspectObjectDlg::Delegate
 // purpose  : class for "Inspect Object" tree item editing
@@ -169,120 +236,156 @@ QWidget* RepairGUI_InspectObjectDlg::Delegate::createEditor( QWidget* parent,
 // class    : RepairGUI_InspectObjectDlg()
 // purpose  : Constructs a RepairGUI_InspectObjectDlg which is a child of 'parent'.
 //=================================================================================
-RepairGUI_InspectObjectDlg::RepairGUI_InspectObjectDlg( SUIT_Desktop* parent )
-: GEOMBase_Helper( parent ),
-  QDialog( parent ),
-  myTransparency( 0.0 ),
-  myIsSelectAll( false )
+RepairGUI_InspectObjectDlg::RepairGUI_InspectObjectDlg(GeometryGUI *theGeomGUI, SUIT_Desktop* parent )
+: GEOMBase_Helper       (parent),
+  QDialog               (parent),
+  myGeomGUI             (theGeomGUI),
+  myTreeObjects         (0),
+  myFilteredTreeObjects (0),
+  myCurrentTreeObjects  (0),
+  myEditMainShape       (0),
+  myTolFilterGrp        (0),
+  myShapeTypeBtnGrp     (0),
+  myComparisonCompo     (0),
+  myMinTolValLabel      (0),
+  myMaxTolValLabel      (0),
+  myTolEdit             (0),
+  myTreesLayout         (0),
+  myTransparency        (0.0),
+  myIsSelectAll         (false),
+  myMaxTol              (-1.),
+  myMinTol              (-1.)
 {
-  QIcon iconSelect( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
-  myVisible = QIcon( SUIT_Session::session()->resourceMgr()->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) );
-  myInvisible = QIcon( SUIT_Session::session()->resourceMgr()->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_INVISIBLE" ) ) );
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  QIcon iconSelect( resMgr->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
+  myVisible = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) );
+  myInvisible = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_INVISIBLE" ) ) );
+
+  QPixmap anImageVtx(resMgr->loadPixmap("GEOM", tr("ICON_OBJBROWSER_VERTEX")));
+  QPixmap anImageEdge(resMgr->loadPixmap("GEOM", tr("ICON_OBJBROWSER_EDGE")));
+  QPixmap anImageFace(resMgr->loadPixmap("GEOM", tr("ICON_OBJBROWSER_FACE")));
 
   setWindowTitle( tr( "GEOM_INSPECT_OBJECT_TITLE" ) );
   setAttribute( Qt::WA_DeleteOnClose );
 
-  myApp = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
-  myViewWindow = myApp->desktop()->activeWindow();
+  myViewWindow = myGeomGUI->getApp()->desktop()->activeWindow();
 
   QGridLayout* topLayout = new QGridLayout( this );
   topLayout->setMargin( 11 ); topLayout->setSpacing( 6 );
 
   /**********************   Inspected Object    **********************/
 
-  QHBoxLayout* mainShapeLayout = new QHBoxLayout();
+  QHBoxLayout* mainShapeLayout = new QHBoxLayout(this);
 
-  QLabel* label = new QLabel( tr( "GEOM_INSPECT_OBJECT_MAIN_SHAPE" ) );
-  QPushButton* selBtn = new QPushButton();
+  QLabel* label = new QLabel( tr( "GEOM_INSPECT_OBJECT_MAIN_SHAPE" ), this );
+  QPushButton* selBtn = new QPushButton(this);
   selBtn->setIcon( iconSelect );
-  myEditMainShape = new QLineEdit();
+  myEditMainShape = new QLineEdit(this);
   myEditMainShape->setReadOnly(true);
 
   mainShapeLayout->addWidget( label );
   mainShapeLayout->addWidget( selBtn );
   mainShapeLayout->addWidget( myEditMainShape );
 
-  /**********************   Sub-objects tree    **********************/
-
-  myTreeObjects = new QTreeWidget();
-  myTreeObjects->setColumnCount( 2 );
-  QStringList columnNames;
-  columnNames.append( tr( "GEOM_INSPECT_OBJECT_NAME" ) );
-  columnNames.append("");
-  myTreeObjects->setHeaderLabels( columnNames );
-  QTreeWidgetItem* headerItem = new QTreeWidgetItem( columnNames );
-  myTreeObjects->setHeaderItem( headerItem );
-  myTreeObjects->header()->moveSection( 1, 0 );
-  myTreeObjects->header()->setClickable( true );
-  myTreeObjects->header()->setMovable( false );
-  myTreeObjects->header()->setResizeMode( 1, QHeaderView::ResizeToContents );
-  myTreeObjects->setSelectionMode( QAbstractItemView::ExtendedSelection );
-  myTreeObjects->setEditTriggers( QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed );
-  // set custom item delegate
-  myTreeObjects->setItemDelegate( new Delegate( myTreeObjects ) );
+  /**********************   Tolerance filter    **********************/
+
+  myTolFilterGrp    = new QGroupBox (tr("GEOM_INSPECT_TOLERANCE_FILTER"), this);
+  myShapeTypeBtnGrp = new QButtonGroup(myTolFilterGrp);
+
+  // Filter on shape type
+  QRadioButton *aVtx   = new QRadioButton(tr("GEOM_VERTEX"), myTolFilterGrp);
+  QRadioButton *anEdge = new QRadioButton(tr("GEOM_EDGE"),   myTolFilterGrp);
+  QRadioButton *aFace  = new QRadioButton(tr("GEOM_FACE"),   myTolFilterGrp);
+
+  aVtx->setIcon(anImageVtx);
+  anEdge->setIcon(anImageEdge);
+  aFace->setIcon(anImageFace);
+  myShapeTypeBtnGrp->addButton(aVtx,   TYPE_VERTEX);
+  myShapeTypeBtnGrp->addButton(anEdge, TYPE_EDGE);
+  myShapeTypeBtnGrp->addButton(aFace,  TYPE_FACE);
+
+  // Filter on sub-shape tolerance
+  QLabel      *aTolLabel     = new QLabel(tr("GEOM_TOLERANCE"), myTolFilterGrp);
+  QLabel      *aMinTolLabel  = new QLabel(tr("GEOM_MIN"), myTolFilterGrp);
+  QLabel      *aMaxTolLabel  = new QLabel(tr("GEOM_MAX"), myTolFilterGrp);
+  QGridLayout *aFilterLayout = new QGridLayout(myTolFilterGrp);
+
+  myMinTolValLabel  = new QLabel(myTolFilterGrp);
+  myMaxTolValLabel  = new QLabel(myTolFilterGrp);
+  myMinTolResetBtn  = new QPushButton(tr("GEOM_INSPECT_RESET_MIN"), myTolFilterGrp);
+  myMaxTolResetBtn  = new QPushButton(tr("GEOM_INSPECT_RESET_MAX"), myTolFilterGrp);
+  myComparisonCompo = new QComboBox(myTolFilterGrp);
+  myTolEdit         = new SalomeApp_DoubleSpinBox(myTolFilterGrp);
+  myTolEdit->setMinimumWidth(120);
+  aFilterLayout->addWidget(aVtx,   0, 0);
+  aFilterLayout->addWidget(anEdge, 0, 1);
+  aFilterLayout->addWidget(aFace,  0, 2);
+  aFilterLayout->addWidget(aMaxTolLabel,      1, 0, Qt::AlignRight);
+  aFilterLayout->addWidget(aTolLabel,         2, 0);
+  aFilterLayout->addWidget(aMinTolLabel,      3, 0, Qt::AlignRight);
+  aFilterLayout->addWidget(myMaxTolValLabel,  1, 1);
+  aFilterLayout->addWidget(myComparisonCompo, 2, 1);
+  aFilterLayout->addWidget(myMinTolValLabel,  3, 1);
+  aFilterLayout->addWidget(myMaxTolResetBtn,  1, 2);
+  aFilterLayout->addWidget(myTolEdit,         2, 2);
+  aFilterLayout->addWidget(myMinTolResetBtn,  3, 2);
+  aFilterLayout->setRowMinimumHeight(0, 30);
+
+  myTolFilterGrp->setCheckable(true);
+
+  /**********************   Sub-objects trees   **********************/
+  createTreeWidget(myTreeObjects);
+  createTreeWidget(myFilteredTreeObjects);
+
+  myTreesLayout = new QStackedLayout(this);
+  myTreesLayout->addWidget(myTreeObjects);
+  myTreesLayout->addWidget(myFilteredTreeObjects);
 
   /**********************        Buttons        **********************/
 
-  QVBoxLayout* buttonsLayout1 = new QVBoxLayout();
+  QVBoxLayout* buttonsLayout1 = new QVBoxLayout(this);
+
+  QPushButton* buttonShow = new QPushButton( tr( "GEOM_INSPECT_OBJECT_SHOW" ), this );
+  QPushButton* buttonShowOnly = new QPushButton( tr( "GEOM_INSPECT_OBJECT_SHOW_ONLY" ), this );
+  QPushButton* buttonHide = new QPushButton( tr( "GEOM_INSPECT_OBJECT_HIDE" ), this );
+  QPushButton* buttonPublish = new QPushButton( tr( "GEOM_INSPECT_OBJECT_PUBLISH" ), this );
+  QPushButton* aShowAllBtn = new QPushButton(tr("SHOW_ALL_BTN"), this);
+  QPushButton* aHideAllBtn = new QPushButton(tr("HIDE_ALL_BTN"), this);
 
-  QPushButton* buttonShow = new QPushButton( tr( "GEOM_INSPECT_OBJECT_SHOW" ) );
-  QPushButton* buttonShowOnly = new QPushButton( tr( "GEOM_INSPECT_OBJECT_SHOW_ONLY" ) );
-  QPushButton* buttonHide = new QPushButton( tr( "GEOM_INSPECT_OBJECT_HIDE" ) );
-  QPushButton* buttonPublish = new QPushButton( tr( "GEOM_INSPECT_OBJECT_PUBLISH" ) );
 
   buttonsLayout1->addWidget( buttonShow );
   buttonsLayout1->addWidget( buttonShowOnly );
   buttonsLayout1->addWidget( buttonHide );
-  buttonsLayout1->addStretch();
+  buttonsLayout1->addWidget( aShowAllBtn );
+  buttonsLayout1->addWidget( aHideAllBtn );
   buttonsLayout1->addWidget( buttonPublish );
   buttonsLayout1->addStretch();
 
-  QHBoxLayout* buttonsLayout2 = new QHBoxLayout();
+  QHBoxLayout* buttonsLayout2 = new QHBoxLayout(this);
 
-  QPushButton* buttonClose = new QPushButton( tr( "GEOM_BUT_CLOSE" ) );
-  QPushButton* buttonHelp = new QPushButton( tr( "GEOM_BUT_HELP" ) );
+  QPushButton* buttonClose = new QPushButton( tr( "GEOM_BUT_CLOSE" ), this );
+  QPushButton* buttonHelp = new QPushButton( tr( "GEOM_BUT_HELP" ), this );
 
   buttonsLayout2->addWidget( buttonClose );
   buttonsLayout2->addStretch();
   buttonsLayout2->addWidget( buttonHelp );
 
   topLayout->addLayout( mainShapeLayout, 0, 0 );
-  topLayout->addWidget( myTreeObjects, 1, 0 );
-  topLayout->addLayout( buttonsLayout1, 0, 1, 2, 1 );
-  topLayout->addLayout( buttonsLayout2, 2, 0, 1, 2 );
-
-  // Signals and slots connections
+  topLayout->addWidget( myTolFilterGrp, 1, 0);
+  topLayout->addLayout( myTreesLayout, 2, 0 );
+  topLayout->addLayout( buttonsLayout1, 0, 1, 3, 1 );
+  topLayout->addLayout( buttonsLayout2, 3, 0, 1, 2 );
 
   connect( selBtn, SIGNAL( clicked() ), this, SLOT( onEditMainShape() ) );
 
-  connect( myTreeObjects, SIGNAL( itemClicked( QTreeWidgetItem*, int ) ),
-           this, SLOT( onItemClicked( QTreeWidgetItem*, int ) ) );
-  connect( myTreeObjects, SIGNAL( itemChanged( QTreeWidgetItem*, int ) ),
-           this, SLOT( onItemChanged( QTreeWidgetItem*, int ) ) );
-  connect( myTreeObjects, SIGNAL( itemExpanded ( QTreeWidgetItem* ) ),
-           this, SLOT( onItemExpanded( QTreeWidgetItem* ) ) );
-  connect( myTreeObjects, SIGNAL( itemSelectionChanged() ),
-           this, SLOT( onItemSelectionChanged() ) );
-
-  connect( myTreeObjects->header(), SIGNAL( sectionClicked( int ) ), this, SLOT( onHeaderClicked( int ) ) );
-
   connect( buttonShow,     SIGNAL( clicked() ), this, SLOT( clickOnShow() ) );
   connect( buttonShowOnly, SIGNAL( clicked() ), this, SLOT( clickOnShowOnly() ) );
   connect( buttonHide,     SIGNAL( clicked() ), this, SLOT( clickOnHide() ) );
   connect( buttonPublish,  SIGNAL( clicked() ), this, SLOT( clickOnPublish() ) );
-
   connect( buttonClose,    SIGNAL( clicked() ), this, SLOT( reject() ) );
   connect( buttonHelp,     SIGNAL( clicked() ), this, SLOT( clickOnHelp() ) );
-
-  connect( myApp->selectionMgr(), SIGNAL( currentSelectionChanged() ),
-           this, SLOT( onViewSelectionChanged() ) );
-
-  connect( myApp->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
-           this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
-
-  if ( myViewWindow )
-    connect( myViewWindow->getViewManager(), SIGNAL( deleteView( SUIT_ViewWindow* ) ),
-             this, SLOT( onCloseView( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
+  connect( aShowAllBtn,   SIGNAL( clicked() ), this, SLOT( clickOnShowAll() ) );
+  connect( aHideAllBtn,   SIGNAL( clicked() ), this, SLOT( clickOnHideAll() ) );
 
   init();
 }
@@ -297,59 +400,139 @@ RepairGUI_InspectObjectDlg::~RepairGUI_InspectObjectDlg()
   // no need to delete child widgets, Qt does it all for us
 }
 
+//=================================================================================
+// function : createTreeWidget()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::createTreeWidget(QTreeWidget *&theTreeObjects)
+{
+  theTreeObjects = new QTreeWidget(this);
+  theTreeObjects->setColumnCount(2);
+  QStringList columnNames;
+  columnNames.append(tr("GEOM_INSPECT_OBJECT_NAME"));
+  columnNames.append("");
+  theTreeObjects->setHeaderLabels(columnNames);
+  QTreeWidgetItem* headerItem = new QTreeWidgetItem(columnNames);
+
+  headerItem->setIcon(1, myInvisible);
+  theTreeObjects->setHeaderItem(headerItem);
+  theTreeObjects->header()->moveSection(1, 0);
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+  theTreeObjects->header()->setClickable(true);
+  theTreeObjects->header()->setMovable(false);
+  theTreeObjects->header()->setResizeMode( 1, QHeaderView::ResizeToContents);
+#else
+  theTreeObjects->header()->setSectionsClickable(true);
+  theTreeObjects->header()->setSectionsMovable(false);
+  theTreeObjects->header()->setSectionResizeMode( 1, QHeaderView::ResizeToContents);
+#endif
+  theTreeObjects->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  theTreeObjects->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed);
+  // set custom item delegate
+  theTreeObjects->setItemDelegate(new Delegate(theTreeObjects));
+}
+
 //=================================================================================
 // function : init()
 // purpose  : initialize dialog data
 //=================================================================================
 void RepairGUI_InspectObjectDlg::init()
 {
-  //get shape from selection
-  SALOME_ListIO selected;
-  myApp->selectionMgr()->selectedObjects(selected);
+  myTolFilterGrp->setChecked(false);
+  myComparisonCompo->addItem(">",  GEOMUtils::CC_GT);
+  myComparisonCompo->addItem(">=", GEOMUtils::CC_GE);
+  myComparisonCompo->addItem("<",  GEOMUtils::CC_LT);
+  myComparisonCompo->addItem("<=", GEOMUtils::CC_LE);
 
-  if ( selected.Extent() != 1 )
-    return;
-
-  if ( !myViewWindow ) {
-    SUIT_ViewManager* occVm = myApp->getViewManager( OCCViewer_Viewer::Type(), true );
-    myViewWindow = occVm->getActiveView();
-    connect( occVm, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
-             this, SLOT( onCloseView( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
-  }
+  initSpinBox(myTolEdit, 0., 100., DEFAULT_TOLERANCE_VALUE, "len_tol_precision");
+  myTolEdit->setValue(DEFAULT_TOLERANCE_VALUE);
 
-  TopoDS_Shape aShape = GEOMBase::GetTopoFromSelection( selected );
-  if ( aShape.IsNull() )
-    return;
+  // Signals and slots connections
+  initTreeWidget(myTreeObjects);
+  initTreeWidget(myFilteredTreeObjects);
+  myCurrentTreeObjects = myTreeObjects;
+  myMaxTolResetBtn->setEnabled(false);
+  myMinTolResetBtn->setEnabled(false);
+
+  connect(myMinTolResetBtn,  SIGNAL(clicked()), this, SLOT(clickOnResetToMin()));
+  connect(myMaxTolResetBtn,  SIGNAL(clicked()), this, SLOT(clickOnResetToMax()));
+  connect(myShapeTypeBtnGrp, SIGNAL(buttonClicked(int)), this, SLOT(onInitFilteredData()));
+  connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+  connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()),        this, SLOT(reject()));
+
+  connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+           this, SLOT( onViewSelectionChanged() ) );
 
-  Handle(SALOME_InteractiveObject) anIO = selected.First();
-  GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( anIO );
-  QString aName = anObject->GetName();
-  CORBA::String_var anEntry = anObject->GetStudyEntry();
+  connect( myGeomGUI->getApp()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+           this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
 
-  myEditMainShape->setText( aName );
-  myEditMainShape->setEnabled( false );
+  // Connect signals and slots for filter group box elements.
+  connect(myTolFilterGrp, SIGNAL(toggled(bool)),
+          this, SLOT(onFilterToggled(bool)));
+  connect(myComparisonCompo, SIGNAL(currentIndexChanged(int)),
+          this, SLOT(onFilterData()));
+  connect(myTolEdit, SIGNAL(valueChanged(double)),
+          this, SLOT(onFilterData()));
 
-  // remember initial transparency value
-  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
-  QVariant v = aStudy->getObjectProperty( myViewWindow->getViewManager()->getGlobalId(),
-                                          QString( anEntry.in() ),
-                                          GEOM::propertyName( GEOM::Transparency ), myTransparency );
-  if ( v.canConvert( QVariant::Double ) )
-    myTransparency = v.toDouble();
+  if ( myViewWindow )
+    connect( myViewWindow->getViewManager(), SIGNAL( deleteView( SUIT_ViewWindow* ) ),
+             this, SLOT( onCloseView( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
 
-  TreeWidgetItem* anItem = new TreeWidgetItem( myTreeObjects, QStringList() << aName, aShape, anIO );
-  if ( getDisplayer()->IsDisplayed( anEntry.in() ) )
-    anItem->setVisible( true, myVisible );
-  else
-    anItem->setVisible( false, myInvisible );
+  // Initialize the dialog with current selection.
+  onViewSelectionChanged();
+}
 
-  setMainObjectTransparency( 0.5 );
+//=================================================================================
+// function : initSpinBox()
+// purpose  : 
+//=================================================================================
+void RepairGUI_InspectObjectDlg::initSpinBox(SalomeApp_DoubleSpinBox* spinBox, 
+                                             double min,  double max, 
+                                             double step, const char* quantity)
+{
+  // Obtain precision from preferences
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  int aPrecision = resMgr->integerValue( "Geometry", quantity, 6 );
+  
+  spinBox->setPrecision( aPrecision );
+  spinBox->setDecimals( qAbs( aPrecision ) ); // it's necessary to set decimals before the range setting,
+                                    // by default Qt rounds boundaries to 2 decimals at setRange
+  spinBox->setRange( min, max );
+  spinBox->setSingleStep( step );
+  
+  // Add a hint for the user saying how to tune precision
+  QString userPropName = QObject::tr( QString( "GEOM_PREF_%1" ).arg( quantity ).toLatin1().constData() );
+  spinBox->setProperty( "validity_tune_hint", 
+                        QVariant( QObject::tr( "GEOM_PRECISION_HINT" ).arg( userPropName ) ) );
+}
 
-  // add sub-objects in the tree
-  addSubObjects( anItem );
+//=================================================================================
+// function : initTreeWidget()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::initTreeWidget(QTreeWidget *theTreeObjects)
+{
+  connect(theTreeObjects, SIGNAL(itemClicked (QTreeWidgetItem *, int)),
+          this, SLOT(onItemClicked(QTreeWidgetItem *, int)));
+  connect(theTreeObjects, SIGNAL(itemChanged (QTreeWidgetItem *, int)),
+          this, SLOT(onItemChanged(QTreeWidgetItem *, int)));
+  connect(theTreeObjects, SIGNAL(itemExpanded (QTreeWidgetItem *)),
+          this, SLOT(onItemExpanded(QTreeWidgetItem *)));
+  connect(theTreeObjects, SIGNAL(itemSelectionChanged()),
+          this, SLOT(onItemSelectionChanged()));
+
+  connect(theTreeObjects->header(), SIGNAL(sectionClicked(int)),
+          this, SLOT(onHeaderClicked(int)));
+}
 
-  // check icon for tree header
-  checkVisibleIcon();
+//=================================================================================
+// function : enterEvent()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::enterEvent (QEvent*)
+{
+  if (!myTolFilterGrp->isEnabled())
+    ActivateThisDialog();
 }
 
 //=================================================================================
@@ -359,20 +542,22 @@ void RepairGUI_InspectObjectDlg::init()
 void RepairGUI_InspectObjectDlg::checkVisibleIcon()
 {
   bool isInvisible = false;
-  QTreeWidgetItemIterator it( myTreeObjects );
+  QTreeWidgetItemIterator it( myCurrentTreeObjects );
   while ( *it ) {
     TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
-    if ( !anItem->isVisible() )
+    if ( !anItem->isHidden() &&  !anItem->isVisible() ) {
       isInvisible = true;
+      break;
+    }
     ++it;
   }
 
   if ( isInvisible ) {
-    myTreeObjects->headerItem()->setIcon( 1, myInvisible );
+    myCurrentTreeObjects->headerItem()->setIcon( 1, myInvisible );
     myIsSelectAll = false;
   }
   else {
-    myTreeObjects->headerItem()->setIcon( 1, myVisible );
+    myCurrentTreeObjects->headerItem()->setIcon( 1, myVisible );
     myIsSelectAll = true;
   }
 }
@@ -381,20 +566,205 @@ void RepairGUI_InspectObjectDlg::checkVisibleIcon()
 // function : addSubObjects()
 // purpose  : add sub-objects to parent object in the tree
 //=================================================================================
-void RepairGUI_InspectObjectDlg::addSubObjects( TreeWidgetItem* theParentItem )
+void RepairGUI_InspectObjectDlg::addSubObjects
+                    (TreeWidgetItem                   *theParentItem,
+                     const TopTools_IndexedMapOfShape &theIndices)
 {
   TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myTreeObjects->topLevelItem(0) );
   TopoDS_Iterator it( theParentItem->getShape() );
   for ( ; it.More(); it.Next() ) {
     TopoDS_Shape aSubShape = it.Value();
-    int anIndex = GEOMBase::GetIndex( aSubShape, aMainItem->getShape() );
+    int anIndex = theIndices.FindIndex(aSubShape);
     QString anEntry = QString( "TEMP_" ) + aMainItem->getIO()->getEntry() + QString("_%1").arg( anIndex );
     TreeWidgetItem* anItem = new TreeWidgetItem( theParentItem, QStringList(), aSubShape, anEntry);
     anItem->setVisible( false, myInvisible );
-    addSubObjects( anItem );
+    addSubObjects(anItem, theIndices);
+  }
+}
+
+//=================================================================================
+// function : onInitFilteredData()
+// purpose  : add sub-objects to parent object in the filtered tree
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onInitFilteredData()
+{
+  TreeWidgetItem *aMainItem =
+          dynamic_cast<TreeWidgetItem*>(myFilteredTreeObjects->topLevelItem(0));
+
+  if (!aMainItem) {
+    return;
+  }
+
+  // Remove the children.
+  SALOME_ListIO           aListOfIO;
+  QTreeWidgetItemIterator it(aMainItem);
+
+  while (*it) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
+    if (aMainItem != anItem && (anItem->flags() & Qt::ItemIsSelectable) &&
+        anItem->isVisible() && !anItem->isHidden()) {
+      aListOfIO.Append(anItem->getIO());
+    }
+
+    ++it;
+  }
+
+  myFilteredTreeObjects->clearSelection();
+  myFilteredTreeObjects->headerItem()->setIcon(1, myInvisible);
+  getDisplayer()->Erase(aListOfIO);
+  getDisplayer()->UpdateViewer();
+
+  // Delete child items.
+  QList<QTreeWidgetItem *> aListItems = aMainItem->takeChildren();
+
+  foreach (QTreeWidgetItem *anItem, aListItems) {
+    delete anItem;
+  }
+
+  // Initialize the tree with a new list.
+  TopoDS_Shape      aShape     = aMainItem->getShape();
+  TopAbs_ShapeEnum  aShapeType = aShape.ShapeType();
+
+  myShapeTypeBtnGrp->button(TYPE_FACE)->setVisible(aShapeType < TYPE_FACE);
+  myShapeTypeBtnGrp->button(TYPE_EDGE)->setVisible(aShapeType < TYPE_EDGE);
+  myShapeTypeBtnGrp->button(TYPE_VERTEX)->setVisible(aShapeType < TYPE_VERTEX);
+
+  int anId = myShapeTypeBtnGrp->checkedId();
+
+  myMaxTol = -RealLast();
+  myMinTol =  RealLast();
+
+  if (anId != -1 && myShapeTypeBtnGrp->checkedButton()->isVisible()) {
+    // Get sub-shapes
+    TopTools_MapOfShape         aMapFence;
+    TopExp_Explorer             anExp(aShape, (TopAbs_ShapeEnum)anId);
+    TopTools_IndexedMapOfShape  anIndices;
+
+    TopExp::MapShapes(aShape, anIndices);
+
+    for (; anExp.More(); anExp.Next()) {
+      const TopoDS_Shape &aSubShape = anExp.Current();
+
+      if (aMapFence.Add(aSubShape)) {
+        // Compute tolerance
+        Standard_Real aTolerance = -1.;
+
+        switch (aSubShape.ShapeType()) {
+          case TYPE_FACE:
+            aTolerance = BRep_Tool::Tolerance(TopoDS::Face(aSubShape));
+            break;
+          case TYPE_EDGE:
+            aTolerance = BRep_Tool::Tolerance(TopoDS::Edge(aSubShape));
+            break;
+          case TYPE_VERTEX:
+            aTolerance = BRep_Tool::Tolerance(TopoDS::Vertex(aSubShape));
+            break;
+          default:
+            break;
+        }
+
+        if (aTolerance < 0.) {
+          continue;
+        }
+
+        if (aTolerance > myMaxTol) {
+          myMaxTol = aTolerance;
+        }
+
+        if (aTolerance < myMinTol) {
+          myMinTol = aTolerance;
+        }
+
+        int anIndex = anIndices.FindIndex(aSubShape);
+        QString anEntry = QString( "TEMP_" ) +
+                          aMainItem->getIO()->getEntry() +
+                          QString::number(anIndex);
+        TreeWidgetItem* anItem =
+            new TreeWidgetItem(aMainItem, QStringList(),
+                               aSubShape, anEntry, aTolerance);
+        anItem->setVisible( false, myInvisible );
+      }
+    }
+  }
+
+  // Compose names of sub-items if the main item is expanded.
+  if (aMainItem->isExpanded()) {
+    onItemExpanded(aMainItem);
+  }
+
+  myMaxTolResetBtn->setEnabled(myMaxTol >= myMinTol);
+  myMinTolResetBtn->setEnabled(myMaxTol >= myMinTol);
+
+  if (myMaxTol < myMinTol) {
+    myMinTol = DEFAULT_TOLERANCE_VALUE;
+    myMaxTol = DEFAULT_TOLERANCE_VALUE;
+    myMinTolValLabel->setText(QString::number(DEFAULT_TOLERANCE_VALUE));
+    myMaxTolValLabel->setText(QString::number(DEFAULT_TOLERANCE_VALUE));
+    myTolEdit->setValue(DEFAULT_TOLERANCE_VALUE);
+  } else {
+    myMinTolValLabel->setText(QString::number(myMinTol));
+    myMaxTolValLabel->setText(QString::number(myMaxTol));
+
+    if (GEOMUtils::CompareToleranceValues(myMinTol, myTolEdit->value()) == 1) {
+      clickOnResetToMin();
+    } else if (GEOMUtils::CompareToleranceValues
+                                         (myMaxTol, myTolEdit->value()) == -1) {
+      clickOnResetToMax();
+    } else {
+      onFilterData();
+    }
   }
 }
 
+//=================================================================================
+// function : onFilterData()
+// purpose  : filter objects in the filtered tree
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onFilterData()
+{
+  TreeWidgetItem *aMainItem =
+          dynamic_cast<TreeWidgetItem*>(myFilteredTreeObjects->topLevelItem(0));
+
+  if (!aMainItem) {
+    return;
+  }
+
+  SALOME_ListIO           aListOfIOToHide;
+  QTreeWidgetItemIterator anIt(aMainItem);
+  const int               aCompValue =
+         myComparisonCompo->itemData(myComparisonCompo->currentIndex()).toInt();
+  const double            aTolValue  = myTolEdit->value();
+
+  while (*anIt) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*anIt);
+
+    if (aMainItem != anItem) {
+      const bool isToFilter = !GEOMUtils::IsFitCondition
+        ((GEOMUtils::ComparisonCondition) aCompValue,
+         anItem->getTolerance(), aTolValue);
+
+      if (isToFilter && !anItem->isHidden()) {
+        if (anItem->isVisible()) {
+          aListOfIOToHide.Append(anItem->getIO());
+        }
+
+        anItem->setVisible(false, myInvisible);
+      }
+
+      anItem->setHidden(isToFilter);
+    }
+
+    ++anIt;
+  }
+
+  if (!aListOfIOToHide.IsEmpty()) {
+    getDisplayer()->Erase(aListOfIOToHide);
+    getDisplayer()->UpdateViewer();
+  }
+
+  checkVisibleIcon();
+}
+
 //=================================================================================
 // function : displayItem()
 // purpose  : display sub-object of inspected object according its tree item
@@ -402,7 +772,7 @@ void RepairGUI_InspectObjectDlg::addSubObjects( TreeWidgetItem* theParentItem )
 void RepairGUI_InspectObjectDlg::displayItem( TreeWidgetItem* theItem )
 {
   GEOM_Displayer* aDisplayer = getDisplayer();
-  if ( theItem == myTreeObjects->topLevelItem(0) ) {
+  if ( theItem == myCurrentTreeObjects->topLevelItem(0) ) {
     aDisplayer->UnsetColor();
     aDisplayer->UnsetWidth();
   }
@@ -423,7 +793,7 @@ void RepairGUI_InspectObjectDlg::displayItem( TreeWidgetItem* theItem )
 //=================================================================================
 void RepairGUI_InspectObjectDlg::setItemDisplayStatus( TreeWidgetItem* theItem, bool theIsVisible )
 {
-  QTreeWidgetItemIterator it( myTreeObjects );
+  QTreeWidgetItemIterator it( myCurrentTreeObjects );
   while (*it) {
     TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
     if ( anItem->getShape().IsSame( theItem->getShape() ) )
@@ -440,9 +810,14 @@ void RepairGUI_InspectObjectDlg::setMainObjectTransparency( double theTransparen
 {
   SUIT_ViewManager* aViewMan = myViewWindow->getViewManager();
   SALOME_View* aView = dynamic_cast<SALOME_View*>( aViewMan->getViewModel() );
-  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
+  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( myGeomGUI->getApp()->activeStudy() );
+
+  TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myCurrentTreeObjects->topLevelItem(0) );
+
+  if (!aMainItem) {
+    return;
+  }
 
-  TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myTreeObjects->topLevelItem(0) );
   aStudy->setObjectProperty( myViewWindow->getViewManager()->getGlobalId(),
                              QString( aMainItem->getIO()->getEntry() ),
                              GEOM::propertyName( GEOM::Transparency ), theTransparency );
@@ -468,8 +843,8 @@ void RepairGUI_InspectObjectDlg::restoreParam()
   setMainObjectTransparency( myTransparency );
 
   // erase sub-shapes
-  TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myTreeObjects->topLevelItem(0) );
-  QTreeWidgetItemIterator it( myTreeObjects );
+  TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myCurrentTreeObjects->topLevelItem(0) );
+  QTreeWidgetItemIterator it( myCurrentTreeObjects );
   while (*it) {
     if ( *it != aMainItem ) {
       TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
@@ -496,6 +871,7 @@ void RepairGUI_InspectObjectDlg::onEditMainShape()
   myEditMainShape->setText("");
   myEditMainShape->setFocus();
   myTreeObjects->clear();
+  myFilteredTreeObjects->clear();
 }
 
 //=================================================================================
@@ -533,7 +909,7 @@ void RepairGUI_InspectObjectDlg::onItemChanged( QTreeWidgetItem* theItem, int th
     return;
 
   // rename the same items in the tree
-  QTreeWidgetItemIterator it( myTreeObjects );
+  QTreeWidgetItemIterator it( myCurrentTreeObjects );
   while ( *it ) {
     TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
     if ( anItem->getShape().IsSame( dynamic_cast<TreeWidgetItem*>( theItem )->getShape() ) )
@@ -548,7 +924,7 @@ void RepairGUI_InspectObjectDlg::onItemChanged( QTreeWidgetItem* theItem, int th
 //=================================================================================
 void RepairGUI_InspectObjectDlg::onItemExpanded( QTreeWidgetItem* theItem )
 {
-  TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myTreeObjects->topLevelItem(0) );
+  TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myCurrentTreeObjects->topLevelItem(0) );
   GEOM::GEOM_Object_var aMainObject = GEOMBase::ConvertIOinGEOMObject( aMainItem->getIO() );
 
   for ( int i = 0; i < theItem->childCount(); i++ ) {
@@ -573,13 +949,13 @@ void RepairGUI_InspectObjectDlg::onItemSelectionChanged()
   if ( !myViewWindow )
     return;
 
-  QList<QTreeWidgetItem*> listItem = myTreeObjects->selectedItems();
+  QList<QTreeWidgetItem*> listItem = myCurrentTreeObjects->selectedItems();
   SALOME_ListIO aSelected;
   for ( int i = 0; i < listItem.size(); i++ ) {
     TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>( listItem.at(i) );
     aSelected.Append( anItem->getIO() );
   }
-  myApp->selectionMgr()->setSelectedObjects( aSelected );
+  myGeomGUI->getApp()->selectionMgr()->setSelectedObjects( aSelected );
 }
 
 //=================================================================================
@@ -595,12 +971,13 @@ void RepairGUI_InspectObjectDlg::onHeaderClicked( int theColumn )
 
   if ( myIsSelectAll ) {
     myIsSelectAll = false;
-    myTreeObjects->headerItem()->setIcon( 1, myInvisible );
+    myCurrentTreeObjects->headerItem()->setIcon( 1, myInvisible );
     SALOME_ListIO aListOfIO;
-    QTreeWidgetItemIterator it( myTreeObjects );
+    QTreeWidgetItemIterator it( myCurrentTreeObjects );
     while ( *it ) {
       TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
-      if ( ( anItem->flags() & Qt::ItemIsSelectable ) && anItem->isVisible() ) {
+      if ( !anItem->isHidden() && ( anItem->flags() & Qt::ItemIsSelectable ) &&
+          anItem->isVisible() ) {
         aListOfIO.Append( anItem->getIO() );
         anItem->setVisible( false, myInvisible );
       }
@@ -610,11 +987,12 @@ void RepairGUI_InspectObjectDlg::onHeaderClicked( int theColumn )
   }
   else {
     myIsSelectAll = true;
-    myTreeObjects->headerItem()->setIcon( 1, myVisible );
-    QTreeWidgetItemIterator it( myTreeObjects );
+    myCurrentTreeObjects->headerItem()->setIcon( 1, myVisible );
+    QTreeWidgetItemIterator it( myCurrentTreeObjects );
     while ( *it ) {
       TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
-      if ( ( anItem->flags() & Qt::ItemIsSelectable ) && !anItem->isVisible() ) {
+      if ( !anItem->isHidden() &&  ( anItem->flags() & Qt::ItemIsSelectable ) &&
+           !anItem->isVisible() ) {
         displayItem( anItem );
         anItem->setVisible( true, myVisible );
       }
@@ -631,8 +1009,68 @@ void RepairGUI_InspectObjectDlg::onHeaderClicked( int theColumn )
 //=================================================================================
 void RepairGUI_InspectObjectDlg::onViewSelectionChanged()
 {
-  if ( myEditMainShape->isEnabled() )
-    init();
+  if (!myEditMainShape->isEnabled())
+    return;
+
+  //get shape from selection
+  SALOME_ListIO selected;
+  myGeomGUI->getApp()->selectionMgr()->selectedObjects(selected);
+
+  if ( selected.Extent() != 1 )
+    return;
+
+  if ( !myViewWindow ) {
+    SUIT_ViewManager* occVm = myGeomGUI->getApp()->getViewManager( OCCViewer_Viewer::Type(), true );
+    myViewWindow = occVm->getActiveView();
+    connect( occVm, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
+             this, SLOT( onCloseView( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
+  }
+
+  TopoDS_Shape aShape = GEOMBase::GetTopoFromSelection( selected );
+  if ( aShape.IsNull() )
+    return;
+
+  Handle(SALOME_InteractiveObject) anIO = selected.First();
+  GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( anIO );
+  QString aName = anObject->GetName();
+  CORBA::String_var anEntry = anObject->GetStudyEntry();
+
+  myEditMainShape->setText( aName );
+  myEditMainShape->setEnabled( false );
+
+  // remember initial transparency value
+  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( myGeomGUI->getApp()->activeStudy() );
+  QVariant v = aStudy->getObjectProperty( myViewWindow->getViewManager()->getGlobalId(),
+                                          QString( anEntry.in() ),
+                                          GEOM::propertyName( GEOM::Transparency ), myTransparency );
+  if ( v.canConvert( QVariant::Double ) )
+    myTransparency = v.toDouble();
+
+  TreeWidgetItem* anItem         = new TreeWidgetItem
+              (myTreeObjects, QStringList() << aName, aShape, anIO);
+  TreeWidgetItem* anItemFiltered = new TreeWidgetItem
+              (myFilteredTreeObjects, QStringList() << aName, aShape, anIO);
+
+  if ( getDisplayer()->IsDisplayed( anEntry.in() ) ) {
+    anItem->setVisible( true, myVisible );
+    anItemFiltered->setVisible( true, myVisible );
+  } else {
+    anItem->setVisible( false, myInvisible );
+    anItemFiltered->setVisible( false, myInvisible );
+  }
+
+  setMainObjectTransparency( 0.5 );
+
+  // add sub-objects in the tree
+  TopTools_IndexedMapOfShape anIndices;
+
+  TopExp::MapShapes(aShape, anIndices);
+  addSubObjects(anItem, anIndices);
+  onInitFilteredData();
+  updateViewer(false);
+
+  // check icon for tree header
+  checkVisibleIcon();
 }
 
 //=================================================================================
@@ -654,9 +1092,9 @@ void RepairGUI_InspectObjectDlg::onWindowActivated( SUIT_ViewWindow* theViewWind
   }
   myViewWindow = theViewWindow;
 
-  if ( myTreeObjects->topLevelItemCount() > 0 ) {
+  if ( myCurrentTreeObjects->topLevelItemCount() > 0 ) {
     setMainObjectTransparency( 0.5 );
-    TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myTreeObjects->topLevelItem(0) );
+    TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myCurrentTreeObjects->topLevelItem(0) );
     if ( getDisplayer()->IsDisplayed( aMainItem->getIO()->getEntry() ) )
       aMainItem->setVisible( true, myVisible );
     else
@@ -671,7 +1109,7 @@ void RepairGUI_InspectObjectDlg::onWindowActivated( SUIT_ViewWindow* theViewWind
 //=================================================================================
 void RepairGUI_InspectObjectDlg::onCloseView( SUIT_ViewWindow* )
 {
-  if ( myApp->desktop()->windows().size() == 0 ) {
+  if ( myGeomGUI->getApp()->desktop()->windows().size() == 0 ) {
     restoreParam();
     myViewWindow = 0;
   }
@@ -686,7 +1124,7 @@ void RepairGUI_InspectObjectDlg::clickOnShow()
   if ( !myViewWindow )
     return;
 
-  QList<QTreeWidgetItem*> listItem = myTreeObjects->selectedItems();
+  QList<QTreeWidgetItem*> listItem = myCurrentTreeObjects->selectedItems();
   for ( int i = 0; i < listItem.size(); i++ ) {
     TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>( listItem.at(i) );
     if ( !anItem->isVisible() ) {
@@ -708,10 +1146,11 @@ void RepairGUI_InspectObjectDlg::clickOnShowOnly()
     return;
 
   SALOME_ListIO aListOfIO;
-  QTreeWidgetItemIterator it( myTreeObjects );
+  QTreeWidgetItemIterator it( myCurrentTreeObjects );
   while ( *it ) {
     TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
-    if ( ( anItem->flags() & Qt::ItemIsSelectable ) && anItem->isVisible() ) {
+    if ( !anItem->isHidden() && ( anItem->flags() & Qt::ItemIsSelectable ) &&
+         anItem->isVisible() ) {
       aListOfIO.Append( anItem->getIO() );
       anItem->setVisible( false, myInvisible );
     }
@@ -731,7 +1170,7 @@ void RepairGUI_InspectObjectDlg::clickOnHide()
   if ( !myViewWindow )
     return;
 
-  QList<QTreeWidgetItem*> listItem = myTreeObjects->selectedItems();
+  QList<QTreeWidgetItem*> listItem = myCurrentTreeObjects->selectedItems();
   for ( int i = 0; i < listItem.size(); i++ ) {
     TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>( listItem.at(i) );
     if ( anItem->isVisible() ) {
@@ -749,14 +1188,19 @@ void RepairGUI_InspectObjectDlg::clickOnHide()
 //=================================================================================
 void RepairGUI_InspectObjectDlg::clickOnPublish()
 {
-  _PTR(Study) studyDS = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() )->studyDS();
+  _PTR(Study) studyDS = dynamic_cast<SalomeApp_Study*>( myGeomGUI->getApp()->activeStudy() )->studyDS();
 
   // find main object
-  TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myTreeObjects->topLevelItem(0) );
+  TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myCurrentTreeObjects->topLevelItem(0) );
+
+  if (!aMainItem) {
+    return;
+  }
+
   GEOM::GEOM_Object_var aMainObject = GEOMBase::ConvertIOinGEOMObject( aMainItem->getIO() );
 
   // find unique indices of selected objects
-  QList<QTreeWidgetItem*> selectedItems = myTreeObjects->selectedItems();
+  QList<QTreeWidgetItem*> selectedItems = myCurrentTreeObjects->selectedItems();
   QMap< int, QString > anIndices;
   GEOM::ListOfLong_var anArray = new GEOM::ListOfLong;
   anArray->length( selectedItems.size() );
@@ -790,5 +1234,139 @@ void RepairGUI_InspectObjectDlg::clickOnPublish()
 //=================================================================================
 void RepairGUI_InspectObjectDlg::clickOnHelp()
 {
-  myApp->onHelpContextModule( "GEOM", "inspect_object_operation_page.html" );
+  myGeomGUI->getApp()->onHelpContextModule( "GEOM", "inspect_object_operation_page.html" );
+}
+
+//=================================================================================
+// function : clickOnResetToMin()
+// purpose  : called when Reset button was clicked to reset tolerance filter to minimal value.
+//=================================================================================
+void RepairGUI_InspectObjectDlg::clickOnResetToMin()
+{
+  if (myMinTol >= myTolEdit->minimum() && myMinTol <= myTolEdit->maximum()) {
+    myTolEdit->setValue(myMinTol);
+  }
+}
+
+//=================================================================================
+// function : clickOnResetToMax()
+// purpose  : called when Reset button was clicked to reset tolerance filter to maximal value.
+//=================================================================================
+void RepairGUI_InspectObjectDlg::clickOnResetToMax()
+{
+  if (myMaxTol >= myTolEdit->minimum() && myMaxTol <= myTolEdit->maximum()) {
+    myTolEdit->setValue(myMaxTol);
+  }
+}
+
+//=================================================================================
+// function : clickOnShowAll()
+// purpose  : called when Help button was clicked to show all shapes
+//=================================================================================
+void RepairGUI_InspectObjectDlg::clickOnShowAll()
+{
+  myIsSelectAll = false;
+  onHeaderClicked(1);
+}
+
+//=================================================================================
+// function : clickOnHideAll()
+// purpose  : called when Help button was clicked to hide all shapes
+//=================================================================================
+void RepairGUI_InspectObjectDlg::clickOnHideAll()
+{
+  myIsSelectAll = true;
+  onHeaderClicked(1);
+}
+
+//=================================================================================
+// function : DeactivateActiveDialog()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::DeactivateActiveDialog()
+{
+  setEnabled(false);
+  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+  myGeomGUI->SetActiveDialogBox(0);
+  globalSelection();
+  erasePreview();
+}
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::ActivateThisDialog()
+{
+  /* Emit a signal to deactivate the active dialog */
+  myGeomGUI->EmitSignalDeactivateDialog();
+  setEnabled(true);
+  myGeomGUI->SetActiveDialogBox( (QDialog*)this );
+
+  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+          this, SLOT(onViewSelectionChanged()));
+
+  updateViewer(false);
+}
+
+//=================================================================================
+// function : onFilterToggled()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onFilterToggled(bool isOn)
+{
+  if (isOn) {
+    myCurrentTreeObjects = myFilteredTreeObjects;
+    myTreesLayout->setCurrentIndex(1);
+  } else {
+    myCurrentTreeObjects = myTreeObjects;
+    myTreesLayout->setCurrentIndex(0);
+  }
+
+  updateViewer(true);
+}
+
+//=================================================================================
+// function : updateViewer()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::updateViewer(const bool theIsHideOtherTree)
+{
+  GEOM_Displayer *aDisplayer  = getDisplayer();
+
+  if (theIsHideOtherTree) {
+    QTreeWidget    *aTreeToHide = myCurrentTreeObjects == myTreeObjects ?
+                                          myFilteredTreeObjects: myTreeObjects;
+
+    // Hide the objects of disappeared tree, do not switch off flags.
+    SALOME_ListIO           aListOfIO;
+    QTreeWidgetItemIterator it(aTreeToHide);
+
+    while (*it) {
+      TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
+      if ((anItem->flags() & Qt::ItemIsSelectable) &&
+          anItem->isVisible() && !anItem->isHidden()) {
+        aListOfIO.Append(anItem->getIO());
+      }
+
+      ++it;
+    }
+
+    aDisplayer->Erase(aListOfIO);
+  }
+
+  // Show the objects that are marked as shown in the appeared tree.
+  QTreeWidgetItemIterator it2(myCurrentTreeObjects);
+
+  while (*it2) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it2);
+    if ((anItem->flags() & Qt::ItemIsSelectable) &&
+        anItem->isVisible() && !anItem->isHidden()) {
+      displayItem(anItem);
+    }
+
+    ++it2;
+  }
+
+  aDisplayer->UpdateViewer();
 }
index d696ac904a1c83dcdfe65ab591b71b3f17f6f532..d8ffff0d4835507537810b31c1f2faec97e7b42f 100644 (file)
 
 // Qt includes
 #include <QDialog>
-#include <QTreeWidget>
-#include <QLabel>
-#include <QLineEdit>
 #include <QPointer>
+#include <QIcon>
+
+class GeometryGUI;
+class SalomeApp_DoubleSpinBox;
+
+class QButtonGroup;
+class QComboBox;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QStackedLayout;
+class QTreeWidget;
+class QTreeWidgetItem;
+
+class TopTools_IndexedMapOfShape;
 
 class RepairGUI_InspectObjectDlg : public QDialog, public GEOMBase_Helper
 { 
@@ -38,7 +51,7 @@ class RepairGUI_InspectObjectDlg : public QDialog, public GEOMBase_Helper
   class Delegate;
 
 public:
-  RepairGUI_InspectObjectDlg( SUIT_Desktop* );
+  RepairGUI_InspectObjectDlg(GeometryGUI*, SUIT_Desktop* );
   ~RepairGUI_InspectObjectDlg();
 
 private slots:
@@ -60,25 +73,54 @@ private slots:
   void                    clickOnHide();
   void                    clickOnPublish();
   void                    clickOnHelp();
+  void                    clickOnResetToMin();
+  void                    clickOnResetToMax();
+  void                    clickOnShowAll();
+  void                    clickOnHideAll();
+  void                    DeactivateActiveDialog();
+  void                    ActivateThisDialog();
+  void                    onFilterToggled(bool);
+  void                    onInitFilteredData();
+  void                    onFilterData();
 
 private:
+  void                    createTreeWidget(QTreeWidget *&theTreeObjects);
   void                    init();
+  void                    initSpinBox(SalomeApp_DoubleSpinBox* spinBox, 
+                                      double min,  double max, 
+                                      double step, const char* quantity);
+  void                    initTreeWidget(QTreeWidget *theTopLevelItem);
+  void                    enterEvent( QEvent* );
   void                    checkVisibleIcon();
-  void                    addSubObjects( TreeWidgetItem* );
+  void                    addSubObjects( TreeWidgetItem*, const TopTools_IndexedMapOfShape &);
+
   void                    displayItem( TreeWidgetItem* );
   void                    setItemDisplayStatus( TreeWidgetItem* theItem, bool theIsVisible );
   void                    setMainObjectTransparency( double );
   void                    restoreParam();
+  void                    updateViewer(const bool theIsHideOtherTree);
 
-  SalomeApp_Application*     myApp;
   QPointer<SUIT_ViewWindow>  myViewWindow;
+  GeometryGUI*               myGeomGUI;
 
   QIcon                      myVisible;
   QIcon                      myInvisible;
 
-  QTreeWidget*               myTreeObjects;
-  QLineEdit*                 myEditMainShape;
-
+  QTreeWidget               *myTreeObjects;
+  QTreeWidget               *myFilteredTreeObjects;
+  QTreeWidget               *myCurrentTreeObjects;
+  QLineEdit                 *myEditMainShape;
+  QGroupBox                 *myTolFilterGrp;
+  QButtonGroup              *myShapeTypeBtnGrp;
+  QComboBox                 *myComparisonCompo;
+  SalomeApp_DoubleSpinBox   *myTolEdit;
+  QLabel                    *myMinTolValLabel;
+  QLabel                    *myMaxTolValLabel;
+  QStackedLayout            *myTreesLayout;
+  QPushButton               *myMinTolResetBtn;
+  QPushButton               *myMaxTolResetBtn;
+  double                     myMaxTol;
+  double                     myMinTol;
   bool                       myIsSelectAll;
   double                     myTransparency;
 
index e3df32f8a66842b0e03c89a37e8b85c9f78f6986..71d3ce0f2cfc476c1eb4772ca4a10b106dff07b8 100755 (executable)
@@ -361,7 +361,7 @@ void RepairGUI_ShapeProcessDlg::init()
   //myOpList->setCurrentRow( myOpList->findItem( 0 );
   reset();
 
-  myStack->setCurrentIndex( 0 );
+  myOpList->setCurrentRow(0);
 
   initName( tr( "PROCESS_SHAPE_NEW_OBJ_NAME" ));
   selectionChanged();
index 513f54a7487449ef3737f894a5f6a38b05745708..aa335dbf00d4462f478d36bf98b63e10bcb783b2 100644 (file)
@@ -18,8 +18,7 @@
 #
 
 IF(SALOME_BUILD_GUI)
-  INCLUDE(UseQt4Ext)
-  INCLUDE(${QT_USE_FILE})
+  INCLUDE(UseQtExt)
 ENDIF()
 
 # --- options ---
@@ -39,7 +38,6 @@ INCLUDE_DIRECTORIES(
   
 IF(SALOME_BUILD_GUI)
   INCLUDE_DIRECTORIES(
-    ${QT_INCLUDE_DIRS}
     ${GUI_INCLUDE_DIRS}
     ${PROJECT_SOURCE_DIR}/src/OBJECT
     ${PROJECT_SOURCE_DIR}/src/GEOMGUI
@@ -95,6 +93,7 @@ SET(STEPPluginEngine_HEADERS
   STEPPlugin_IExport.hxx 
   STEPPlugin_IImport.hxx
   STEPPlugin_ImportDriver.hxx 
+  STEPPlugin_ExportDlg.h
   STEPPlugin_ExportDriver.hxx
   STEPPlugin_IECallBack.hxx
   )
@@ -103,6 +102,7 @@ IF(SALOME_BUILD_GUI)
   # header files / to be processed by moc
   SET(_moc_HEADERS
     STEPPlugin_GUI.h
+    STEPPlugin_ExportDlg.h
     )
 ENDIF()
 
@@ -110,10 +110,11 @@ ENDIF()
 
 IF(SALOME_BUILD_GUI)
   # sources / moc wrappings
-  QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+  QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
   SET(STEPPluginGUI_SOURCES
     STEPPlugin_GUI.cxx
+    STEPPlugin_ExportDlg.cxx
     ${_moc_SOURCES}
     )
 ENDIF()
@@ -146,7 +147,7 @@ IF(SALOME_BUILD_GUI)
   TARGET_LINK_LIBRARIES(STEPPluginGUI ${_link_gui_LIBRARIES})
   INSTALL(TARGETS STEPPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
-  QT4_INSTALL_TS_RESOURCES("${STEPPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+  QT_INSTALL_TS_RESOURCES("${STEPPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
 ENDIF()
 
 
diff --git a/src/STEPPlugin/STEPPlugin_ExportDlg.cxx b/src/STEPPlugin/STEPPlugin_ExportDlg.cxx
new file mode 100644 (file)
index 0000000..476934d
--- /dev/null
@@ -0,0 +1,109 @@
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "STEPPlugin_ExportDlg.h"
+
+#include <QApplication>
+#include <QLabel>
+#include <QLayout>
+#include <QComboBox>
+
+//=============================================================================
+// Constructor
+//=============================================================================
+STEPPlugin_ExportDlg::STEPPlugin_ExportDlg(QWidget *parent)
+  : SUIT_FileDlg (parent, false, true, true),
+    myUnitCB     (0)
+{
+  QLabel* aUnitLabel = new QLabel(tr("STEP_LENGTH_UNITS"), this);
+
+  myUnitCB = new QComboBox(this);
+  myUnitCB->addItem(tr("STEP_UNITS_KILOMETER"),  GEOM::LU_KILOMETER);
+  myUnitCB->addItem(tr("STEP_UNITS_METER"),      GEOM::LU_METER);
+  myUnitCB->addItem(tr("STEP_UNITS_CENTIMETER"), GEOM::LU_CENTIMETER);
+  myUnitCB->addItem(tr("STEP_UNITS_MILLIMETER"), GEOM::LU_MILLIMETER);
+  myUnitCB->addItem(tr("STEP_UNITS_MICROMETER"), GEOM::LU_MICROMETER);
+  myUnitCB->addItem(tr("STEP_UNITS_MILE"),       GEOM::LU_MILE);
+  myUnitCB->addItem(tr("STEP_UNITS_FOOT"),       GEOM::LU_FOOT);
+  myUnitCB->addItem(tr("STEP_UNITS_INCH"),       GEOM::LU_INCH);
+  myUnitCB->addItem(tr("STEP_UNITS_MILLIINCH"),  GEOM::LU_MILLIINCH);
+  myUnitCB->addItem(tr("STEP_UNITS_MICROINCH"),  GEOM::LU_MICROINCH);
+
+  // Meters by default.
+  myUnitCB->setCurrentIndex(1);
+
+  layout()->addWidget(aUnitLabel);
+  layout()->addWidget(myUnitCB);
+}
+
+//=============================================================================
+// Destructor
+//=============================================================================
+STEPPlugin_ExportDlg::~STEPPlugin_ExportDlg()
+{
+}
+
+//=============================================================================
+// getUnits
+//=============================================================================
+GEOM::length_unit STEPPlugin_ExportDlg::getUnits() const
+{
+  const GEOM::length_unit anUnit =
+    (GEOM::length_unit) myUnitCB->itemData(myUnitCB->currentIndex()).toInt();
+
+  return anUnit;
+}
+
+//=============================================================================
+// getFileName
+//=============================================================================
+QString STEPPlugin_ExportDlg::getFileName(const QString           &theInitial,
+                                          const QString           &theFilters,
+                                                     const QString           &theCaption,
+                                                QWidget           *theParent,
+                                                GEOM::length_unit &theUnits)
+{
+  QStringList aFls         = theFilters.split(";;", QString::SkipEmptyParts);
+  QString     aTmpFileName = theInitial;
+
+  aTmpFileName = aTmpFileName.simplified();
+  aTmpFileName =
+    aTmpFileName.replace(QRegExp("\\*"), "").replace(QRegExp("\\?"), "");
+
+  STEPPlugin_ExportDlg aDlg(theParent);
+
+  aDlg.setFileMode(AnyFile);
+  aDlg.setNameFilters(aFls);
+  aDlg.setWindowTitle(theCaption);
+
+  if (!aTmpFileName.isEmpty()) {
+    aDlg.processPath(aTmpFileName);
+  }
+
+  QString aFileName;
+
+  if (aDlg.exec() == QDialog::Accepted) {
+    aFileName = aDlg.selectedFile();
+    theUnits  = aDlg.getUnits();
+  }
+
+  QApplication::processEvents();
+
+  return aFileName;
+}
diff --git a/src/STEPPlugin/STEPPlugin_ExportDlg.h b/src/STEPPlugin/STEPPlugin_ExportDlg.h
new file mode 100644 (file)
index 0000000..d310484
--- /dev/null
@@ -0,0 +1,52 @@
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef STEPPlugin_ExportDlg_H
+#define STEPPlugin_ExportDlg_H
+
+#include <SUIT_FileDlg.h>
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(STEPPlugin)
+
+class QComboBox;
+
+class STEPPlugin_ExportDlg: public SUIT_FileDlg
+{
+  Q_OBJECT
+
+public:
+
+  STEPPlugin_ExportDlg(QWidget *parent);
+  ~STEPPlugin_ExportDlg();
+
+  GEOM::length_unit getUnits() const;
+
+  static QString getFileName(const QString           &theInitial,
+                             const QString           &theFilters,
+                                        const QString           &theCaption,
+                                   QWidget           *theParent,
+                                   GEOM::length_unit &theUnits);
+
+private:
+
+  QComboBox *myUnitCB;
+
+};
+
+#endif // STEPPlugin_ExportDlg_H
index 8f5f0db18ca296283bd5fe79cb4015af3fcb97df..0adef6012efb030daa63b2be55395a85e2a01b17 100644 (file)
@@ -20,6 +20,7 @@
 // internal includes
 #include "STEPPlugin_ExportDriver.hxx"
 #include "STEPPlugin_IExport.hxx"
+#include "STEPPlugin_IOperations.hxx"
 
 // KERNEL includes
 #include <utilities.h>
@@ -74,6 +75,43 @@ Standard_Integer STEPPlugin_ExportDriver::Execute( TFunction_Logbook& log ) cons
   aFunction->SetValue( aShape );
 
   TCollection_AsciiString aFileName = aData.GetFileName();
+  Standard_Integer        anUnit    = aData.GetUnit();
+  TCollection_AsciiString aWriteUnit;
+
+  switch (anUnit) {
+  case STEPPlugin_IOperations::LengthUnit_Inch:
+    aWriteUnit = "INCH";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Millimeter:
+    aWriteUnit = "MM";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Foot:
+    aWriteUnit = "FT";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Mile:
+    aWriteUnit = "MI";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Meter:
+    aWriteUnit = "M";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Kilometer:
+    aWriteUnit = "KM";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Milliinch:
+    aWriteUnit = "MIL";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Micrometer:
+    aWriteUnit = "UM";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Centimeter:
+    aWriteUnit = "CM";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Microinch:
+    aWriteUnit = "UIN";
+    break;
+  default:
+    return 0;
+  }
 
   MESSAGE("Export STEP into file " << aFileName.ToCString());
 
@@ -86,7 +124,7 @@ Standard_Integer STEPPlugin_ExportDriver::Execute( TFunction_Logbook& log ) cons
     //VRV: OCC 4.0 migration
     STEPControl_Writer aWriter;
     Interface_Static::SetCVal("xstep.cascade.unit","M");
-    Interface_Static::SetCVal("write.step.unit", "M");
+    Interface_Static::SetCVal("write.step.unit", aWriteUnit.ToCString());
     Interface_Static::SetIVal("write.step.nonmanifold", 1);
     status = aWriter.Transfer( aShape, STEPControl_AsIs );
     //VRV: OCC 4.0 migration
index 88686838ec8315bda9392f171dcbb763ed771318..5543266d7845b41240aee421f25afd0948132210 100644 (file)
 #include "GEOM_Operation.h"
 #include "GEOMBase.h"
 #include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
+#include "STEPPlugin_ExportDlg.h"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(STEPPlugin)
 
+typedef GEOM::GenericObjPtr<GEOM::ISTEPOperations> STEPOpPtr;
+
 //=======================================================================
 // function : STEPPlugin_GUI()
 // purpose  : Constructor
@@ -111,8 +115,8 @@ bool STEPPlugin_GUI::importSTEP( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STEPPluginEngine" );
-  GEOM::ISTEPOperations_var stepOp = GEOM::ISTEPOperations::_narrow( op );
-  if ( CORBA::is_nil( stepOp ) ) return false;
+  STEPOpPtr stepOp = GEOM::ISTEPOperations::_narrow( op );
+  if ( stepOp.isNull() ) return false;
 
   QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
                                                 tr( "STEP_FILES" ),
@@ -128,7 +132,7 @@ bool STEPPlugin_GUI::importSTEP( SUIT_Desktop* parent )
     {
       QString fileName = fileNames.at( i );
       SUIT_OverrideCursor wc;
-      GEOM_Operation transaction( app, stepOp.in() );
+      GEOM_Operation transaction( app, stepOp.get() );
       bool ignoreUnits = false;
       
       try
@@ -189,6 +193,7 @@ bool STEPPlugin_GUI::importSTEP( SUIT_Desktop* parent )
          }
          transaction.commit();
          GEOM_Displayer( study ).Display( main.in() );
+          main->UnRegister();
        }
        else
        {
@@ -228,8 +233,8 @@ bool STEPPlugin_GUI::exportSTEP( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STEPPluginEngine" );
-  GEOM::ISTEPOperations_var stepOp = GEOM::ISTEPOperations::_narrow( op );
-  if ( CORBA::is_nil( stepOp ) ) return false;
+  STEPOpPtr stepOp = GEOM::ISTEPOperations::_narrow( op );
+  if ( stepOp.isNull() ) return false;
 
   LightApp_SelectionMgr* sm = app->selectionMgr();
   if ( !sm ) return false;
@@ -246,25 +251,26 @@ bool STEPPlugin_GUI::exportSTEP( SUIT_Desktop* parent )
     
     if ( CORBA::is_nil( obj ) ) continue;
     
-    QString fileName = app->getFileName( false,
-                                        QString( io->getName() ),
+    GEOM::length_unit anUnit;
+    QString fileName = STEPPlugin_ExportDlg::getFileName
+                                       (QString( io->getName() ),
                                         tr( "STEP_FILES" ),
                                         tr( "EXPORT_TITLE" ),
-                                        parent );
+                                        parent, anUnit);
     
     if ( fileName.isEmpty() )
       return false;
     
     SUIT_OverrideCursor wc;
     
-    GEOM_Operation transaction( app, stepOp.in() );
+    GEOM_Operation transaction( app, stepOp.get() );
     
     try
     {
       app->putInfo( tr( "GEOM_PRP_EXPORT" ).arg( fileName ) );
       transaction.start();
       
-      stepOp->ExportSTEP( obj, fileName.toUtf8().constData() );
+      stepOp->ExportSTEP( obj, fileName.toUtf8().constData(), anUnit);
       
       if ( stepOp->IsDone() )
       {
old mode 100755 (executable)
new mode 100644 (file)
index bc5c0ff..ac08697
@@ -52,7 +52,9 @@ STEPPlugin_IECallBack::Export( int                            theDocId,
                               const TCollection_AsciiString& theFormatName )
 {
   STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId );
-  aPluginOperations->ExportSTEP( theOriginal, theFileName );
+  const STEPPlugin_IOperations::LengthUnit aUnit = STEPPlugin_IOperations::LengthUnit_Meter;
+
+  aPluginOperations->ExportSTEP( theOriginal, theFileName, aUnit );
   return true;
 }
 
index 020b573adf3136321bab6d6248911d98c8d17ee7..77f01392b3d2808c8bc8449fcdca6eae8ac252f1 100644 (file)
@@ -24,6 +24,7 @@
 
 #define EXPORTSTEP_ARG_ORIGINAL   1
 #define EXPORTSTEP_ARG_FILENAME   2
+#define EXPORTSTEP_ARG_UNIT       3
 
 class STEPPlugin_IExport
 {
@@ -40,6 +41,11 @@ public:
     { _func->SetString( EXPORTSTEP_ARG_FILENAME, theFileName ); }
   TCollection_AsciiString GetFileName()
     { return _func->GetString( EXPORTSTEP_ARG_FILENAME ); }
+
+  void SetUnit(const Standard_Integer theUnit)
+  { _func->SetInteger(EXPORTSTEP_ARG_UNIT, theUnit); }
+  Standard_Integer GetUnit()
+  { return _func->GetInteger(EXPORTSTEP_ARG_UNIT); }
   
 private:
   Handle(GEOM_Function) _func;
index 86d1055e38d050200e17630832dde2ed70840fce..72064e8e3027fb780a0dd0518e3babec2d149d95 100644 (file)
@@ -54,18 +54,66 @@ STEPPlugin_IOperations::~STEPPlugin_IOperations()
   MESSAGE( "STEPPlugin_IOperations::~STEPPlugin_IOperations" );
 }
 
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+static GEOM::TPythonDump& operator<<
+          (GEOM::TPythonDump                        &theDump,
+           const STEPPlugin_IOperations::LengthUnit  theState)
+{
+  switch (theState) {
+  case STEPPlugin_IOperations::LengthUnit_Inch:
+    theDump << "GEOM.LU_INCH";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Millimeter:
+    theDump << "GEOM.LU_MILLIMETER";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Foot:
+    theDump << "GEOM.LU_FOOT";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Mile:
+    theDump << "GEOM.LU_MILE";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Meter:
+    theDump << "GEOM.LU_METER";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Kilometer:
+    theDump << "GEOM.LU_KILOMETER";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Milliinch:
+    theDump << "GEOM.LU_MILLIINCH";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Micrometer:
+    theDump << "GEOM.LU_MICROMETER";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Centimeter:
+    theDump << "GEOM.LU_CENTIMETER";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Microinch:
+    theDump << "GEOM.LU_MICROINCH";
+    break;
+  default:
+    break;
+  }
+
+  return theDump;
+}
+
 //=============================================================================
 /*!
  *  ExportSTEP
  *  Export a shape to STEP format
  *  \param theOriginal The shape to export
  *  \param theFileName The name of the file to exported
- *  \param theIsASCII The format of the exported file (ASCII or Binary)
- *  \param theDeflection The deflection of the shape to exported
+ *  \param theUnit the length unit
  */
 //=============================================================================
-void STEPPlugin_IOperations::ExportSTEP( const Handle(GEOM_Object)      theOriginal,
-                                        const TCollection_AsciiString& theFileName )
+void STEPPlugin_IOperations::ExportSTEP
+                    (const Handle(GEOM_Object)      theOriginal,
+                     const TCollection_AsciiString &theFileName,
+                     const LengthUnit               theUnit)
 {
   SetErrorCode(KO);
   if( theOriginal.IsNull() ) return;
@@ -87,6 +135,7 @@ void STEPPlugin_IOperations::ExportSTEP( const Handle(GEOM_Object)      theOrigi
   STEPPlugin_IExport aCI( aFunction );
   aCI.SetOriginal( aRefFunction );
   aCI.SetFileName( theFileName );
+  aCI.SetUnit( theUnit );
 
   //Perform the Export
   try {
@@ -104,7 +153,7 @@ void STEPPlugin_IOperations::ExportSTEP( const Handle(GEOM_Object)      theOrigi
 
   //Make a Python command
   GEOM::TPythonDump(aFunction) << "geompy.ExportSTEP(" << theOriginal << ", \""
-    << theFileName.ToCString() << "\" )";
+    << theFileName.ToCString() << "\", " << theUnit << " )";
 
   SetErrorCode(OK);
 }
index ca81fac29c0d04e1842c8ba365e5b9df73d5b3ed..92b3f160e78430fde83aa5b926f8557f17890de6 100644 (file)
 
 class STEPPLUGINENGINE_EXPORT STEPPlugin_IOperations: public GEOMImpl_IBaseIEOperations
 {
+
+public:
+
+  /*!
+   *  \brief Units of length
+   */
+  enum LengthUnit
+  {
+    LengthUnit_Inch,
+    LengthUnit_Millimeter,
+    LengthUnit_Foot,
+    LengthUnit_Mile,
+    LengthUnit_Meter,
+    LengthUnit_Kilometer,
+    LengthUnit_Milliinch,
+    LengthUnit_Micrometer,
+    LengthUnit_Centimeter,
+    LengthUnit_Microinch
+  };
+
+
 public:
   STEPPlugin_IOperations( GEOM_Engine*, int );
   ~STEPPlugin_IOperations();
 
   void ExportSTEP( const Handle(GEOM_Object),
-                  const TCollection_AsciiString& );
+                  const TCollection_AsciiString&, const LengthUnit );
   
   Handle(TColStd_HSequenceOfTransient) ImportSTEP( const TCollection_AsciiString&,
                                                   const bool );
index 7eeee1a944be4b248bacc8a2f0176a9ea42dd99a..fba3ce031e4fd7c2a2ea5d0cf282d4dde8df3daa 100644 (file)
@@ -53,10 +53,12 @@ STEPPlugin_IOperations_i::~STEPPlugin_IOperations_i()
  *  Export a shape to STEP format
  *  \param theOriginal The shape to export
  *  \param theFileName The name of the exported file
+ *  \param theUnit the length unit.
  */
 //=============================================================================
-void STEPPlugin_IOperations_i::ExportSTEP( GEOM::GEOM_Object_ptr theOriginal,
-                                          const char*           theFileName )
+void STEPPlugin_IOperations_i::ExportSTEP(GEOM::GEOM_Object_ptr theOriginal,
+                                          const char*           theFileName,
+                                          GEOM::length_unit     theUnit)
 {
   // duplicate the original shape
   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate( theOriginal );
@@ -68,8 +70,45 @@ void STEPPlugin_IOperations_i::ExportSTEP( GEOM::GEOM_Object_ptr theOriginal,
   Handle(GEOM_Object) anOriginal = GetObjectImpl( theOriginal );
   if (anOriginal.IsNull()) return;
 
+  STEPPlugin_IOperations::LengthUnit aUnit;
+
+  switch (theUnit) {
+  case GEOM::LU_INCH:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Inch;
+    break;
+  case GEOM::LU_MILLIMETER:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Millimeter;
+    break;
+  case GEOM::LU_FOOT:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Foot;
+    break;
+  case GEOM::LU_MILE:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Mile;
+    break;
+  case GEOM::LU_METER:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Meter;
+    break;
+  case GEOM::LU_KILOMETER:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Kilometer;
+    break;
+  case GEOM::LU_MILLIINCH:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Milliinch;
+    break;
+  case GEOM::LU_MICROMETER:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Micrometer;
+    break;
+  case GEOM::LU_CENTIMETER:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Centimeter;
+    break;
+  case GEOM::LU_MICROINCH:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Microinch;
+    break;
+  default:
+    return;
+  }
+
   //Export the shape to the file
-  GetOperations()->ExportSTEP( anOriginal, theFileName );
+  GetOperations()->ExportSTEP( anOriginal, theFileName, aUnit );
 }
 
 //=============================================================================
index e2c51c79a396c5e275dc8101b573082b974df85c..16e000909c8b134ce81573a3bd0640a06e789606 100644 (file)
@@ -43,7 +43,8 @@ public:
                            STEPPlugin_IOperations* theImpl );
   ~STEPPlugin_IOperations_i();
 
-  void            ExportSTEP( GEOM::GEOM_Object_ptr, const char* );
+  void            ExportSTEP( GEOM::GEOM_Object_ptr, const char*,
+                              GEOM::length_unit );
   GEOM::ListOfGO* ImportSTEP( const char*, const bool );
   char*           ReadValue( const char*, const char* );
 
index a00ccdcd8a801ddb0cb6206cc3bf361d837dea6c..961dd77be42d117980a790b60ce9cea2300b2fbe 100644 (file)
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
 
-//=============================================================================
-/*!
- *  GetShape()
- */
-//=============================================================================
-
-TopoDS_Shape GetShape(const Handle(Standard_Transient)        &theEnti,
-                      const Handle(Transfer_TransientProcess) &theTP)
+namespace
 {
-  TopoDS_Shape            aResult;
-  Handle(Transfer_Binder) aBinder = theTP->Find(theEnti);
-
-  if (aBinder.IsNull()) {
+  //=============================================================================
+  /*!
+   *  GetShape()
+   */
+  //=============================================================================
+  
+  TopoDS_Shape GetShape(const Handle(Standard_Transient)        &theEnti,
+                        const Handle(Transfer_TransientProcess) &theTP)
+  {
+    TopoDS_Shape            aResult;
+    Handle(Transfer_Binder) aBinder = theTP->Find(theEnti);
+    
+    if (aBinder.IsNull()) {
+      return aResult;
+    }
+    
+    aResult = TransferBRep::ShapeResult(aBinder);
+    
     return aResult;
   }
-
-  aResult = TransferBRep::ShapeResult(aBinder);
-
-  return aResult;
-}
-
-//=============================================================================
-/*!
- *  GetLabel()
- */
-//=============================================================================
-
-TDF_Label GetLabel(const Handle(Standard_Transient) &theEnti,
-                   const TDF_Label                  &theShapeLabel,
-                   const TopoDS_Shape               &aShape)
-{
-  TDF_Label aResult;
-
-  if (theEnti->IsKind
-            (STANDARD_TYPE(StepGeom_GeometricRepresentationItem))) {
-    // check all named shapes using iterator
-    TDF_ChildIDIterator anIt
-      (theShapeLabel, TDataStd_Name::GetID(), Standard_True);
-
-    for (; anIt.More(); anIt.Next()) {
-      Handle(TDataStd_Name) nameAttr =
-        Handle(TDataStd_Name)::DownCast(anIt.Value());
-
-      if (nameAttr.IsNull()) {
-        continue;
-      }
-
-      TDF_Label aLab = nameAttr->Label();
-      Handle(TNaming_NamedShape) shAttr;
-
-      if (aLab.FindAttribute(TNaming_NamedShape::GetID(), shAttr) &&
-          shAttr->Get().IsEqual(aShape)) {
-        aResult = aLab;
+  
+  //=============================================================================
+  /*!
+   *  GetLabel()
+   */
+  //=============================================================================
+  
+  TDF_Label GetLabel(const Handle(Standard_Transient) &theEnti,
+                     const TDF_Label                  &theShapeLabel,
+                     const TopoDS_Shape               &aShape)
+  {
+    TDF_Label aResult;
+    
+    if (theEnti->IsKind
+        (STANDARD_TYPE(StepGeom_GeometricRepresentationItem))) {
+      // check all named shapes using iterator
+      TDF_ChildIDIterator anIt
+        (theShapeLabel, TDataStd_Name::GetID(), Standard_True);
+      
+      for (; anIt.More(); anIt.Next()) {
+        Handle(TDataStd_Name) nameAttr =
+          Handle(TDataStd_Name)::DownCast(anIt.Value());
+        
+        if (nameAttr.IsNull()) {
+          continue;
+        }
+        
+        TDF_Label aLab = nameAttr->Label();
+        Handle(TNaming_NamedShape) shAttr;
+        
+        if (aLab.FindAttribute(TNaming_NamedShape::GetID(), shAttr) &&
+            shAttr->Get().IsEqual(aShape)) {
+          aResult = aLab;
+        }
       }
     }
-  }
-
-  // create label and set shape
-  if (aResult.IsNull()) {
-    TDF_TagSource aTag;
-
-    aResult = aTag.NewChild(theShapeLabel);
-
-    TNaming_Builder tnBuild (aResult);
-
-    tnBuild.Generated(aShape);
-  }
-
-  return aResult;
-}
-
-//=============================================================================
-/*!
- *  StoreName()
- */
-//=============================================================================
-
-void StoreName( const Handle(Standard_Transient)        &theEnti,
-                const TopTools_IndexedMapOfShape        &theIndices,
-                const Handle(Transfer_TransientProcess) &theTP,
-                const TDF_Label                         &theShapeLabel)
-{
-  Handle(TCollection_HAsciiString) aName;
-
-  if (theEnti->IsKind(STANDARD_TYPE(StepShape_TopologicalRepresentationItem)) ||
-      theEnti->IsKind(STANDARD_TYPE(StepGeom_GeometricRepresentationItem))) {
-    aName = Handle(StepRepr_RepresentationItem)::DownCast(theEnti)->Name();
-  } else {
-    Handle(StepBasic_ProductDefinition) PD =
-      Handle(StepBasic_ProductDefinition)::DownCast(theEnti);
-
-    if (PD.IsNull() == Standard_False) {
-      Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct();
-      aName = Prod->Name();
+    
+    // create label and set shape
+    if (aResult.IsNull()) {
+      TDF_TagSource aTag;
+      
+      aResult = aTag.NewChild(theShapeLabel);
+      
+      TNaming_Builder tnBuild (aResult);
+      
+      tnBuild.Generated(aShape);
     }
+    
+    return aResult;
   }
 
-  bool isValidName = false;
-
-  if (aName.IsNull() == Standard_False) {
-    isValidName = true;
-
-    if (aName->UsefullLength() < 1) {
-      isValidName = false;
-    } else if (aName->UsefullLength() == 4 &&
-               toupper (aName->Value(1)) == 'N' &&
-               toupper (aName->Value(2)) == 'O' &&
-               toupper (aName->Value(3)) == 'N' &&
-               toupper (aName->Value(4)) == 'E') {
-      // skip 'N0NE' name
-      isValidName = false;
+  //=============================================================================
+  /*!
+   *  StoreName()
+   */
+  //=============================================================================
+  
+  void StoreName( const Handle(Standard_Transient)        &theEnti,
+                  const TopTools_IndexedMapOfShape        &theIndices,
+                  const Handle(Transfer_TransientProcess) &theTP,
+                  const TDF_Label                         &theShapeLabel)
+  {
+    Handle(TCollection_HAsciiString) aName;
+    
+    if (theEnti->IsKind(STANDARD_TYPE(StepShape_TopologicalRepresentationItem)) ||
+        theEnti->IsKind(STANDARD_TYPE(StepGeom_GeometricRepresentationItem))) {
+      aName = Handle(StepRepr_RepresentationItem)::DownCast(theEnti)->Name();
     } else {
-      // special check to pass names like "Open CASCADE STEP translator 6.3 1"
-      TCollection_AsciiString aSkipName ("Open CASCADE STEP translator");
-
-      if (aName->Length() >= aSkipName.Length()) {
-        if (aName->String().SubString
-                            (1, aSkipName.Length()).IsEqual(aSkipName)) {
-          isValidName = false;
+      Handle(StepBasic_ProductDefinition) PD =
+        Handle(StepBasic_ProductDefinition)::DownCast(theEnti);
+      
+      if (PD.IsNull() == Standard_False) {
+        Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct();
+        aName = Prod->Name();
+      }
+    }
+    
+    bool isValidName = false;
+
+    if (aName.IsNull() == Standard_False) {
+      isValidName = true;
+
+      if (aName->UsefullLength() < 1) {
+        isValidName = false;
+      } else if (aName->UsefullLength() == 4 &&
+                 toupper (aName->Value(1)) == 'N' &&
+                 toupper (aName->Value(2)) == 'O' &&
+                 toupper (aName->Value(3)) == 'N' &&
+                 toupper (aName->Value(4)) == 'E') {
+        // skip 'N0NE' name
+        isValidName = false;
+      } else {
+        // special check to pass names like "Open CASCADE STEP translator 6.3 1"
+        TCollection_AsciiString aSkipName ("Open CASCADE STEP translator");
+
+        if (aName->Length() >= aSkipName.Length()) {
+          if (aName->String().SubString
+              (1, aSkipName.Length()).IsEqual(aSkipName)) {
+            isValidName = false;
+          }
         }
       }
     }
-  }
 
-  if (isValidName) {
-    TCollection_ExtendedString aNameExt (aName->ToCString());
+    if (isValidName) {
+      TCollection_ExtendedString aNameExt (aName->ToCString());
 
-    // find target shape
-    TopoDS_Shape S = GetShape(theEnti, theTP);
+      // find target shape
+      TopoDS_Shape S = GetShape(theEnti, theTP);
 
-    if (S.IsNull()) {
-      return;
-    }
+      if (S.IsNull()) {
+        return;
+      }
 
-    // as PRODUCT can be included in the main shape
-    // several times, we look here for all iclusions.
-    Standard_Integer isub, nbSubs = theIndices.Extent();
+      // as PRODUCT can be included in the main shape
+      // several times, we look here for all iclusions.
+      Standard_Integer isub, nbSubs = theIndices.Extent();
 
-    for (isub = 1; isub <= nbSubs; isub++) {
-      TopoDS_Shape aSub = theIndices.FindKey(isub);
+      for (isub = 1; isub <= nbSubs; isub++) {
+        TopoDS_Shape aSub = theIndices.FindKey(isub);
 
-      if (aSub.IsPartner(S)) {
-        TDF_Label L = GetLabel(theEnti, theShapeLabel, aSub);
+        if (aSub.IsPartner(S)) {
+          TDF_Label L = GetLabel(theEnti, theShapeLabel, aSub);
 
-        // set a name
-        TDataStd_Name::Set(L, aNameExt);
+          // set a name
+          TDataStd_Name::Set(L, aNameExt);
+        }
       }
     }
   }
-}
 
-//=============================================================================
-/*!
- *  StoreMaterial()
- */
-//=============================================================================
+  //=============================================================================
+  /*!
  *  StoreMaterial()
  */
+  //=============================================================================
 
-void StoreMaterial( const Handle(Standard_Transient)        &theEnti,
-                    const TopTools_IndexedMapOfShape        &theIndices,
-                    const Handle(Transfer_TransientProcess) &theTP,
-                    const TDF_Label                         &theShapeLabel )
-{
-  // Treat Product Definition Shape only.
-  Handle(StepRepr_ProductDefinitionShape) aPDS =
+  void StoreMaterial( const Handle(Standard_Transient)        &theEnti,
+                      const TopTools_IndexedMapOfShape        &theIndices,
+                      const Handle(Transfer_TransientProcess) &theTP,
+                      const TDF_Label                         &theShapeLabel )
+  {
+    // Treat Product Definition Shape only.
+    Handle(StepRepr_ProductDefinitionShape) aPDS =
       Handle(StepRepr_ProductDefinitionShape)::DownCast(theEnti);
-  Handle(StepBasic_ProductDefinition)     aProdDef;
+    Handle(StepBasic_ProductDefinition)     aProdDef;
 
-  if(aPDS.IsNull() == Standard_False) {
-    // Product Definition Shape ==> Product Definition
-    aProdDef = aPDS->Definition().ProductDefinition();
-  }
+    if(aPDS.IsNull() == Standard_False) {
+      // Product Definition Shape ==> Product Definition
+      aProdDef = aPDS->Definition().ProductDefinition();
+    }
 
-  if (aProdDef.IsNull() == Standard_False) {
-    // Product Definition ==> Property Definition
-    const Interface_Graph    &aGraph = theTP->Graph();
-    Interface_EntityIterator  aSubs  = aGraph.Sharings(aProdDef);
-    TopoDS_Shape              aShape;
+    if (aProdDef.IsNull() == Standard_False) {
+      // Product Definition ==> Property Definition
+      const Interface_Graph    &aGraph = theTP->Graph();
+      Interface_EntityIterator  aSubs  = aGraph.Sharings(aProdDef);
+      TopoDS_Shape              aShape;
 
-    for(aSubs.Start(); aSubs.More(); aSubs.Next()) {
-      Handle(StepRepr_PropertyDefinition) aPropD =
-        Handle(StepRepr_PropertyDefinition)::DownCast(aSubs.Value());
+      for(aSubs.Start(); aSubs.More(); aSubs.Next()) {
+        Handle(StepRepr_PropertyDefinition) aPropD =
+          Handle(StepRepr_PropertyDefinition)::DownCast(aSubs.Value());
 
-      if(aPropD.IsNull() == Standard_False) {
-        // Property Definition ==> Representation.
-        Interface_EntityIterator aSubs1 = aGraph.Sharings(aPropD);
+        if(aPropD.IsNull() == Standard_False) {
+          // Property Definition ==> Representation.
+          Interface_EntityIterator aSubs1 = aGraph.Sharings(aPropD);
 
-        for(aSubs1.Start(); aSubs1.More(); aSubs1.Next()) {
-          Handle(StepRepr_PropertyDefinitionRepresentation) aPDR =
-            Handle(StepRepr_PropertyDefinitionRepresentation)::
+          for(aSubs1.Start(); aSubs1.More(); aSubs1.Next()) {
+            Handle(StepRepr_PropertyDefinitionRepresentation) aPDR =
+              Handle(StepRepr_PropertyDefinitionRepresentation)::
               DownCast(aSubs1.Value());
 
-          if(aPDR.IsNull() == Standard_False) {
-            // Property Definition ==> Material Name.
-            Handle(StepRepr_Representation) aRepr = aPDR->UsedRepresentation();
+            if(aPDR.IsNull() == Standard_False) {
+              // Property Definition ==> Material Name.
+              Handle(StepRepr_Representation) aRepr = aPDR->UsedRepresentation();
 
-            if(aRepr.IsNull() == Standard_False) {
-              Standard_Integer ir;
+              if(aRepr.IsNull() == Standard_False) {
+                Standard_Integer ir;
 
-              for(ir = 1; ir <= aRepr->NbItems(); ir++) {
-                Handle(StepRepr_RepresentationItem) aRI = aRepr->ItemsValue(ir);
-                Handle(StepRepr_DescriptiveRepresentationItem) aDRI =
-                  Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(aRI);
+                for(ir = 1; ir <= aRepr->NbItems(); ir++) {
+                  Handle(StepRepr_RepresentationItem) aRI = aRepr->ItemsValue(ir);
+                  Handle(StepRepr_DescriptiveRepresentationItem) aDRI =
+                    Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(aRI);
 
-                if(aDRI.IsNull() == Standard_False) {
-                  // Get shape from Product Definition
-                  Handle(TCollection_HAsciiString) aMatName = aDRI->Name();
+                  if(aDRI.IsNull() == Standard_False) {
+                    // Get shape from Product Definition
+                    Handle(TCollection_HAsciiString) aMatName = aDRI->Name();
 
-                  if(aMatName.IsNull() == Standard_False) {
-                    TCollection_ExtendedString
-                                 aMatNameExt (aMatName->ToCString());
-
-                    if (aShape.IsNull()) {
-                      // Get the shape.
-                      aShape = GetShape(aProdDef, theTP);
+                    if(aMatName.IsNull() == Standard_False) {
+                      TCollection_ExtendedString
+                        aMatNameExt (aMatName->ToCString());
 
                       if (aShape.IsNull()) {
-                        return;
+                        // Get the shape.
+                        aShape = GetShape(aProdDef, theTP);
+
+                        if (aShape.IsNull()) {
+                          return;
+                        }
                       }
-                    }
 
-                    // as PRODUCT can be included in the main shape
-                    // several times, we look here for all iclusions.
-                    Standard_Integer isub, nbSubs = theIndices.Extent();
+                      // as PRODUCT can be included in the main shape
+                      // several times, we look here for all iclusions.
+                      Standard_Integer isub, nbSubs = theIndices.Extent();
 
-                    for (isub = 1; isub <= nbSubs; isub++) {
-                      TopoDS_Shape aSub = theIndices.FindKey(isub);
+                      for (isub = 1; isub <= nbSubs; isub++) {
+                        TopoDS_Shape aSub = theIndices.FindKey(isub);
 
-                      if (aSub.IsPartner(aShape)) {
-                        TDF_Label aLabel =
-                          GetLabel(aProdDef, theShapeLabel, aSub);
+                        if (aSub.IsPartner(aShape)) {
+                          TDF_Label aLabel =
+                            GetLabel(aProdDef, theShapeLabel, aSub);
 
-                        // set a name
-                        TDataStd_Comment::Set(aLabel, aMatNameExt);
+                          // set a name
+                          TDataStd_Comment::Set(aLabel, aMatNameExt);
+                        }
                       }
                     }
                   }
@@ -310,7 +313,53 @@ void StoreMaterial( const Handle(Standard_Transient)        &theEnti,
       }
     }
   }
-}
+
+  TCollection_AsciiString ToNamedUnit( const TCollection_AsciiString& unit )
+  {
+    TCollection_AsciiString result = unit;
+    result.LowerCase();
+    if ( result == "mil" ) result = "milliinch";
+    return result;
+  }
+
+  TCollection_AsciiString ToOcctUnit( const TCollection_AsciiString& unit, TCollection_AsciiString& error )
+  {
+    TCollection_AsciiString result = "M", u = ToNamedUnit(unit);
+    u.LowerCase();
+
+    if (u == "inch")
+      result = "INCH";
+    else if (u == "milliinch")
+      result = "MIL";
+    else if (u == "microinch")
+      result = "UIN";
+    else if (u == "foot")
+      result = "FT";
+    else if (u == "mile")
+      result = "MI";
+    else if (u == "metre")
+      result = "M";
+    else if (u == "kilometre")
+      result = "KM";
+    else if (u == "millimetre")
+      result = "MM";
+    else if (u == "centimetre")
+      result = "CM";
+    else if (u == "micrometre")
+      result = "UM";
+    else if (u.IsEmpty())
+      result = "M";
+    else
+      error = "The file contains not supported units";
+      
+    // TODO (for other units)
+    // else
+    //  result = "??"
+
+    return result;
+  }
+
+} // end of namespace
 
 //=======================================================================
 //function : GetID
@@ -377,21 +426,8 @@ Standard_Integer STEPPlugin_ImportDriver::Execute( TFunction_Logbook& log ) cons
         TColStd_SequenceOfAsciiString anUnitSolidAngleNames;
         aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames);
         if (anUnitLengthNames.Length() > 0) {
-          TCollection_AsciiString aLenUnits = anUnitLengthNames.First();
-          if (aLenUnits == "millimetre")
-            Interface_Static::SetCVal("xstep.cascade.unit", "MM");
-          else if (aLenUnits == "centimetre")
-            Interface_Static::SetCVal("xstep.cascade.unit", "CM");
-          else if (aLenUnits == "metre" || aLenUnits.IsEmpty())
-            Interface_Static::SetCVal("xstep.cascade.unit", "M");
-          else if (aLenUnits == "INCH")
-            Interface_Static::SetCVal("xstep.cascade.unit", "INCH");
-          else {
-            anError = "The file contains not supported units.";
-          }
-          // TODO (for other units than mm, cm, m or inch)
-          // else if (aLenUnits == "")
-          // Interface_Static::SetCVal("xstep.cascade.unit", "???");
+          TCollection_AsciiString aLenUnits = ToOcctUnit(anUnitLengthNames.First(), anError);
+          Interface_Static::SetCVal("xstep.cascade.unit", aLenUnits.ToCString());
         }
       }
       else {
@@ -548,10 +584,10 @@ GetCreationInformation( std::string&             theOperationName,
 
 TCollection_AsciiString
 STEPPlugin_ImportDriver::GetValue( const TCollection_AsciiString& theFileName,
-                                     const TCollection_AsciiString& theParameterName,
-                                     TCollection_AsciiString&       theError )
+                                   const TCollection_AsciiString& theParameterName,
+                                   TCollection_AsciiString&       theError )
 {
-  Handle(TCollection_HAsciiString) aValue;
+  TCollection_AsciiString aValue;
 
   if (theParameterName != "LEN_UNITS") {
     theError = theParameterName + " parameter reading is not supported by STEP plugin";
@@ -575,23 +611,8 @@ STEPPlugin_ImportDriver::GetValue( const TCollection_AsciiString& theFileName,
       TColStd_SequenceOfAsciiString anUnitAngleNames;
       TColStd_SequenceOfAsciiString anUnitSolidAngleNames;
       aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames);
-      if (anUnitLengthNames.Length() > 0) {
-        aValue = new TCollection_HAsciiString( anUnitLengthNames.First() );
-        /*
-        TCollection_AsciiString aLenUnits = anUnitLengthNames.First();
-        if (aLenUnits == "millimetre")
-          aValue = new TCollection_HAsciiString ("MM");
-        else if (aLenUnits == "centimetre")
-          aValue = new TCollection_HAsciiString ("CM");
-        else if (aLenUnits == "metre")
-          aValue = new TCollection_HAsciiString ("M");
-        else if (aLenUnits == "INCH")
-          aValue = new TCollection_HAsciiString ("INCH");
-        // TODO (for other units than mm, cm, m or inch)
-        //else if (aLenUnits == "")
-        //  aValue = new TCollection_HAsciiString ("");
-        */
-      }
+      if (anUnitLengthNames.Length() > 0)
+        aValue = ToNamedUnit( anUnitLengthNames.First() );
     }
     else {
       theError = theFileName + " reading failed";
@@ -601,10 +622,7 @@ STEPPlugin_ImportDriver::GetValue( const TCollection_AsciiString& theFileName,
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
     theError = aFail->GetMessageString();
   }
-  if (!aValue.IsNull())
-    return aValue->String();
-  else
-    return TCollection_AsciiString();
+  return aValue;
 }
 
 
index d24fc901469340d145f11cebcbafc8d7cf471f03..47d15c8f83ad0a3a55948f13613d4afd92fe57c3 100644 (file)
 Ignoring units will cause model scaling (as dimensions are supposed to be specified in meters).</translation>
     </message>
 </context>
+<context>
+    <name>STEPPlugin_ExportDlg</name>
+    <message>
+        <source>STEP_LENGTH_UNITS</source>
+        <translation>Length units</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_INCH</source>
+        <translation>inch</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_MILLIMETER</source>
+        <translation>millimeter</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_FOOT</source>
+        <translation>foot</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_MILE</source>
+        <translation>mile</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_METER</source>
+        <translation>meter</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_KILOMETER</source>
+        <translation>kilometer</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_MILLIINCH</source>
+        <translation>milliinch</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_MICROMETER</source>
+        <translation>micrometer</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_CENTIMETER</source>
+        <translation>centimeter</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_MICROINCH</source>
+        <translation>microinch</translation>
+    </message>
+</context>
 </TS>
index 954610a780e0a1589a9c9c0a67d533d9d37b5700..36deae994186252f2da87b4ad7c1d5d7c44f213e 100644 (file)
@@ -18,8 +18,7 @@
 #
 
 IF(SALOME_BUILD_GUI)
-  INCLUDE(UseQt4Ext)
-  INCLUDE(${QT_USE_FILE})
+  INCLUDE(UseQtExt)
 ENDIF()
 
 # --- options ---
@@ -39,7 +38,6 @@ INCLUDE_DIRECTORIES(
   
 IF(SALOME_BUILD_GUI)
   INCLUDE_DIRECTORIES(
-    ${QT_INCLUDE_DIRS}
     ${GUI_INCLUDE_DIRS}
     ${PROJECT_SOURCE_DIR}/src/OBJECT
     ${PROJECT_SOURCE_DIR}/src/GEOMGUI
@@ -110,7 +108,7 @@ ENDIF()
 
 IF(SALOME_BUILD_GUI)
   # sources / moc wrappings
-  QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+  QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
   SET(STLPluginGUI_SOURCES
     STLPlugin_GUI.cxx
@@ -147,7 +145,7 @@ IF(SALOME_BUILD_GUI)
   TARGET_LINK_LIBRARIES(STLPluginGUI ${_link_gui_LIBRARIES})
   INSTALL(TARGETS STLPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
   
-  QT4_INSTALL_TS_RESOURCES("${STLPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+  QT_INSTALL_TS_RESOURCES("${STLPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
 ENDIF()
 
 
index 05616e15d330a1d7fd8644f4ff640669cf0c41fe..0d36f35e7f96c034f37b42bc26fb97f26ddffad5 100644 (file)
@@ -175,7 +175,7 @@ QString STLPlugin_ExportDlg::getFileName( const Handle(SALOME_InteractiveObject)
 
   STLPlugin_ExportDlg fd( io, parent );
   fd.setFileMode( AnyFile );
-  fd.setFilters( fls );
+  fd.setNameFilters( fls );
   fd.setWindowTitle( caption );
   if ( !tmpfilename.isEmpty() )
     fd.processPath( tmpfilename );
index 27311769a0d3cffd75a7f451254674c63bb8bde4..d868adb9720aad1cae434e80cd90d48607beb3c3 100644 (file)
 #include "GEOM_Operation.h"
 #include "GEOMBase.h"
 #include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(STLPlugin)
 
+typedef GEOM::GenericObjPtr<GEOM::ISTLOperations> STLOpPtr;
+
 //=======================================================================
 // function : STLPlugin_GUI()
 // purpose  : Constructor
@@ -109,8 +112,8 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STLPluginEngine" );
-  GEOM::ISTLOperations_var stlOp = GEOM::ISTLOperations::_narrow( op );
-  if ( CORBA::is_nil( stlOp ) ) return false;
+  STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op );
+  if ( stlOp.isNull() ) return false;
   
   QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
                                                 tr( "STL_FILES" ),
@@ -124,7 +127,7 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent )
     foreach( QString fileName, fileNames )
     {
       SUIT_OverrideCursor wc;
-      GEOM_Operation transaction( app, stlOp.in() );
+      GEOM_Operation transaction( app, stlOp.get() );
       
       try
       {
@@ -143,6 +146,7 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent )
          entryList.append( so->GetID() );
          transaction.commit();
          GEOM_Displayer( study ).Display( main.in() );
+          main->UnRegister();
        }
        else
        {
@@ -181,8 +185,8 @@ bool STLPlugin_GUI::exportSTL( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STLPluginEngine" );
-  GEOM::ISTLOperations_var stlOp = GEOM::ISTLOperations::_narrow( op );
-  if ( CORBA::is_nil( stlOp ) ) return false;
+  STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op );
+  if ( stlOp.isNull() ) return false;
 
   LightApp_SelectionMgr* sm = app->selectionMgr();
   if ( !sm ) return false;
@@ -215,7 +219,7 @@ bool STLPlugin_GUI::exportSTL( SUIT_Desktop* parent )
     
     SUIT_OverrideCursor wc;
     
-    GEOM_Operation transaction( app, stlOp.in() );
+    GEOM_Operation transaction( app, stlOp.get() );
     
     try
     {
index 61f4072c682435c3bd92263ddbe4e2c624f2a2f4..7e4e7fd4ed36c4c7502069f2e66ced3ab50cc630 100755 (executable)
@@ -17,7 +17,6 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE( ${QT_USE_FILE} )
 
 # --- options ---
 
@@ -62,5 +61,3 @@ TARGET_LINK_LIBRARIES(GEOMShapeRec ${_link_LIBRARIES})
 INSTALL(TARGETS GEOMShapeRec EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 #INSTALL(FILES ${ShapeRecognition_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-
-
diff --git a/src/Tools/CMakeLists.txt b/src/Tools/CMakeLists.txt
new file mode 100644 (file)
index 0000000..57f854f
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright (C) 2012-2014  EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+ADD_SUBDIRECTORY(t_shape)
+
+
+IF(SALOME_BUILD_GUI)
+    # scripts / static
+    SET(plugin_SCRIPTS
+       geom_plugins.py
+    )
+
+    # --- rules ---
+    SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_GEOM_INSTALL_PLUGINS})
+ENDIF()
diff --git a/src/Tools/geom_plugins.py b/src/Tools/geom_plugins.py
new file mode 100644 (file)
index 0000000..3959615
--- /dev/null
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2010-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author : Renaud Nédélec (OpenCascade S.A.S)
+
+import salome_pluginsmanager
+
+def t_shape_fluid(context):
+    #from salome.geom.t_shape import t_shape_builder
+    from salome.geom.t_shape import t_shape_dialog
+    from salome.geom.t_shape import t_shape_progress
+    import xalome
+    from PyQt4.QtGui import QMessageBox
+    activeStudy = context.study
+    
+    dialog = t_shape_dialog.TShapeDialog()
+
+    # Get the parameter values from a gui dialog box. If the dialog is
+    # closed using the Ok button, then the data are requested from the
+    # gui and used to create the shape of the tube.
+    dialog.exec_()
+    if dialog.wasOk():
+      r1, r2, h1, h2, thickness = dialog.getData()
+      #QMessageBox.about(None, "Building in progress", "building shape, please be patient")
+      #shape = t_shape_builder.build_shape(activeStudy, r1, r2, h1, h2, thickness)
+      shapeBuilder = t_shape_progress.t_shape_progress()
+      shape = shapeBuilder.run(activeStudy, r1, r2, h1, h2, thickness)
+      entry = xalome.addToStudy(activeStudy, shape, "T_shape_fluid" )
+      xalome.displayShape(entry)
+    #if dialog.wasOk():
+        #radius, length, width = dialog.getData()
+        #shape = tubebuilder.createGeometry(activeStudy, radius, length, width)
+        #entry = xalome.addToStudy(activeStudy, shape, "Tube" )
+        #xalome.displayShape(entry)
+
+
+salome_pluginsmanager.AddFunction('T shape fluid',
+                                  'Creates the fluid part of a pipe T-shape',
+                                  t_shape_fluid)
\ No newline at end of file
diff --git a/src/Tools/t_shape/CMakeLists.txt b/src/Tools/t_shape/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e4332a5
--- /dev/null
@@ -0,0 +1,55 @@
+# Copyright (C) 2012-2014  EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+IF(SALOME_BUILD_GUI)
+  INCLUDE(UsePyQt)
+ENDIF()
+
+# --- scripts ---
+
+# base scripts
+SET(base_SCRIPTS
+  __init__.py
+  t_shape_builder.py
+  )
+
+IF(SALOME_BUILD_GUI)
+   # gui scripts 
+   SET(gui_SCRIPTS
+     t_shape_dialog.py
+     t_shape_dialog.ui
+     t_shape_progress.py
+     )
+
+  # uic files / to be processed by pyuic
+  SET(_pyuic_files
+    t_shape_dialog.ui
+    )
+
+  # scripts / pyuic wrappings
+  PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+ENDIF()
+
+# --- rules ---
+
+SALOME_INSTALL_SCRIPTS("${base_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/geom/t_shape)
+
+IF(SALOME_BUILD_GUI)
+  SALOME_INSTALL_SCRIPTS("${gui_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/geom/t_shape)
+  SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/geom/t_shape)
+ENDIF()
\ No newline at end of file
diff --git a/src/Tools/t_shape/__init__.py b/src/Tools/t_shape/__init__.py
new file mode 100644 (file)
index 0000000..40a96af
--- /dev/null
@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-
diff --git a/src/Tools/t_shape/t_shape_builder.py b/src/Tools/t_shape/t_shape_builder.py
new file mode 100644 (file)
index 0000000..0cff46b
--- /dev/null
@@ -0,0 +1,391 @@
+# -*- coding: utf-8 -*-
+
+import sys
+import salome
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+import time
+
+geompy = None
+
+def demidisk(study, r1, a1, roty=0, solid_thickness=0):
+  if solid_thickness < 1e-7:
+    with_solid = False
+  else:
+    with_solid = True
+
+  #geompy = geomBuilder.New(study)
+  
+  O = geompy.MakeVertex(0, 0, 0)
+  OX = geompy.MakeVectorDXDYDZ(1, 0, 0) 
+  OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+  OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+  
+  v=range(8)
+  l=range(8)
+  v0 = geompy.MakeVertex(0, 0, 0)
+  v[0] = geompy.MakeVertex(0, r1/2.0, 0)
+  v[1] = geompy.MakeVertex(0, r1, 0)
+  l[1] = geompy.MakeLineTwoPnt(v[0], v[1])
+  l[2] = geompy.MakeRotation(l[1], OX, a1*math.pi/180.0)
+  v[4] = geompy.MakeRotation(v[0], OX, a1*math.pi/180.0)
+  v[6] = geompy.MakeRotation(v[1], OX, a1*math.pi/180.0)
+
+  v[2] = geompy.MakeVertex(0, -r1/2.0, 0)
+  v[3] = geompy.MakeVertex(0, -r1, 0)
+  l[3] = geompy.MakeLineTwoPnt(v[2], v[3])
+  l[4] = geompy.MakeRotation(l[3], OX, -a1*math.pi/180.0)
+  v[5] = geompy.MakeRotation(v[2], OX, -a1*math.pi/180.0)
+  v[7] = geompy.MakeRotation(v[3], OX, -a1*math.pi/180.0)
+
+  l[5] = geompy.MakeLineTwoPnt(v[4], v[5])
+  l[6] = geompy.MakeLineTwoPnt(v[0], v[4])
+  l[7] = geompy.MakeLineTwoPnt(v[2], v[5])
+
+  v7 = geompy.MakeVertex(0, 0, r1)
+  arc1 = geompy.MakeArc(v[1], v7, v[3])
+  l[0] = geompy.MakeLineTwoPnt(v[1], v[3])
+  face1 = geompy.MakeFaceWires([arc1, l[0]], 1)
+  part1 = geompy.MakePartition([face1], [l[2], l[4], l[5], l[6], l[7]], [], [], geompy.ShapeType["FACE"], 0, [], 0, True)
+  
+  if with_solid:
+    # Add some faces corresponding to the solid layer outside
+    # the fluid part
+    
+    # --- Vertices
+    v0 = geompy.MakeVertex(0, r1 + solid_thickness, 0)
+    v1 = geompy.MakeRotation(v0, OX, a1*math.pi/180.0)
+    v2 = geompy.MakeRotation(v0, OX, math.pi - (a1*math.pi/180.0))
+    v3 = geompy.MakeRotation(v0, OX, math.pi)
+    v.extend([v0,v1,v3,v2]) # The order is important for use in pointsProjetes
+    # --- Lines
+    l0 = geompy.MakeLineTwoPnt(v[1], v0)
+    l2 = geompy.MakeRotation(l0, OX, a1*math.pi/180.0)
+    l3 = geompy.MakeRotation(l0, OX, math.pi - (a1*math.pi/180.0))
+    # --- Faces
+    face2 = geompy.MakeRevolution(l0, OX, a1*math.pi/180.0)
+    face3 = geompy.MakeRevolution(l2, OX, math.pi - 2*a1*math.pi/180.0)
+    face4 = geompy.MakeRevolution(l3, OX, a1*math.pi/180.0)
+    # --- Compound of the "fluid part" of the divided disk and the additional faces
+    compound1 = geompy.MakeCompound([part1, face2, face3, face4])
+    # --- Glue edges
+    part1 = geompy.MakeGlueEdges(compound1,1e-7)
+  if roty != 0:
+    vrot = [ geompy.MakeRotation(vert, OY, roty*math.pi/180.0) for vert in v ]
+    lrot = [ geompy.MakeRotation(lin, OY, roty*math.pi/180.0) for lin in l ]
+    arc = geompy.MakeRotation(arc1, OY, roty*math.pi/180.0)
+    part = geompy.MakeRotation(part1, OY, roty*math.pi/180.0)
+    return vrot, lrot, arc, part
+  else:
+    return v, l, arc1, part1
+
+def pointsProjetes(study, vref, face):
+  #geompy = geomBuilder.New(study)
+  vface = geompy.ExtractShapes(face, geompy.ShapeType["VERTEX"], True)
+  vord = range(len(vref))
+  plan = geompy.MakePlaneThreePnt(vref[0], vref[1], vref[-1], 10000)
+  vproj = [ geompy.MakeProjection(vert, plan) for vert in vface ]
+  for i,v in enumerate(vproj):
+    dist = [ (geompy.MinDistance(v, vr), j) for j,vr in enumerate(vref) ]
+    dist.sort()
+    if dist[0][0] < 1.e-3:
+      vord[dist[0][1]] = vface[i]
+  return vord
+
+def arcsProjetes(study, vf, face):
+  #geompy = geomBuilder.New(study)
+  lface = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True)
+  lord = range(3)
+  ends = [vf[1], vf[6], vf[7], vf[3]]
+  for i in range(3):
+    for lf in lface:
+      pts = geompy.ExtractShapes(lf, geompy.ShapeType["VERTEX"], True)
+      if (((geompy.MinDistance(pts[0], ends[i]) < 0.001) and (geompy.MinDistance(pts[1], ends[i+1]) < 0.001)) or
+          ((geompy.MinDistance(pts[1], ends[i]) < 0.001) and (geompy.MinDistance(pts[0], ends[i+1]) < 0.001))):
+        lord[i] = lf
+        #print "arc_%d OK"%i
+        break
+    pass
+  return lord
+def build_shape(study, r1, r2, h1, h2, solid_thickness=0, progressBar=None ):
+  """ Builds the final shape """
+
+  if progressBar is not None:
+    time0 = time.time()
+    print time.time() -time0
+    
+  if solid_thickness < 1e-7:
+    with_solid = False
+  else:
+    with_solid = True
+  
+  global geompy
+  geompy = geomBuilder.New(study)
+  
+  O = geompy.MakeVertex(0, 0, 0)
+  OX = geompy.MakeVectorDXDYDZ(1, 0, 0) 
+  OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+  OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+  
+  a1 = 45.0
+  seuilmax = 0.1
+  ratio = float(r2)/float(r1)
+  if ratio > (1.0 -seuilmax):
+    a1 = 45.0*(1.0 -ratio)/seuilmax
+
+  # --- Creation of the jonction faces
+  [faci, sect45, arc1, l1, lord90, lord45, edges, arcextru] = jonction(study, r1, r2,\
+                                                                       h1, h2, a1)
+  if progressBar is not None:
+    progressBar.addSteps(2)
+    print time.time() -time0
+    
+  if with_solid:
+    # The same code is executed again with different external radiuses in order
+    # to get the needed faces and edges to build the solid layer of the pipe
+    [faci_ext, sect45_ext, arc1_ext, l1_ext, \
+     lord90_ext, lord45_ext, edges_ext, arcextru_ext] = jonction(study, r1 + solid_thickness, r2 + solid_thickness,\
+                                                                 h1, h2, a1)
+    faces_jonction_ext = []
+    for i,l in enumerate(lord90):
+      faces_jonction_ext.append(geompy.MakeQuad2Edges(lord90[i],lord90_ext[i]))
+    for i in [1, 3, 6, 7]:
+      faces_jonction_ext.append(geompy.MakeQuad2Edges(edges[i],edges_ext[i]))
+    for i,l in enumerate(lord45):
+      faces_jonction_ext.append(geompy.MakeQuad2Edges(lord45[i],lord45_ext[i]))
+   
+  if progressBar is not None:
+    progressBar.addSteps(4)
+    print time.time() -time0
+    
+  # --- extrusion droite des faces de jonction, pour reconstituer les demi cylindres
+  if with_solid:    
+    sect45 = geompy.MakeCompound([sect45]+faces_jonction_ext[-3:])
+    sect45 = geompy.MakeGlueEdges(sect45, 1e-7)
+    
+  if progressBar is not None:
+    progressBar.addSteps(1)
+    print time.time() -time0
+    
+  extru1 = geompy.MakePrismVecH(sect45, OX, h1+10)
+
+  faces_coupe = faci[5:]
+  if with_solid:
+    faces_coupe = faci[5:]+faces_jonction_ext[:3]
+  base2 = geompy.MakePartition(faces_coupe, [], [], [], geompy.ShapeType["FACE"], 0, [], 0, True)
+  extru2 = geompy.MakePrismVecH(base2, OZ, h2)
+
+  if progressBar is not None:
+    progressBar.addSteps(1)
+    print time.time() -time0
+    
+  # --- partition et coupe
+
+  if with_solid:
+     demiDisque = geompy.MakeFaceWires([arc1_ext, l1_ext[0]], 1)
+  else:
+     demiDisque = geompy.MakeFaceWires([arc1, l1[0]], 1)
+  demiCylindre = geompy.MakePrismVecH(demiDisque, OX, h1)
+
+  if progressBar is not None:
+    progressBar.addSteps(1)
+    print time.time() -time0
+    
+  box = geompy.MakeBox(0, -2*(r1+h1), -2*(r1+h1), 2*(r1+h1), 2*(r1+h1), 2*(r1+h1))
+  rot = geompy.MakeRotation(box, OY, 45*math.pi/180.0)
+
+  # NOTE: The following Cut takes almost half of the total execution time
+  garder = geompy.MakeCutList(demiCylindre, [extru2, rot], True)
+  
+  if progressBar is not None:
+    progressBar.addSteps(9)
+    print time.time() -time0
+
+  faces_coupe = faci[:5]
+  if with_solid:
+    faces_coupe.extend(faces_jonction_ext[-7:])
+  raccord = geompy.MakePartition([garder], faces_coupe + [arcextru], [], [], geompy.ShapeType["SOLID"], 0, [], 0, True)
+  assemblage = geompy.MakeCompound([raccord, extru1, extru2])
+  assemblage = geompy.MakeGlueFaces(assemblage, 1e-7)
+
+  if progressBar is not None:
+    progressBar.addSteps(3)
+    print time.time() -time0
+
+  box = geompy.MakeBox(-1, -(r1+r2+2*solid_thickness), -1, h1, r1+r2+2*solid_thickness, h2)
+  
+  # NOTE: This operation takes about 1/4 of the total execution time
+  final = geompy.MakeCommonList([box, assemblage], True)
+  
+  if progressBar is not None:
+    progressBar.addSteps(5)
+    print time.time() -time0
+    
+  # --- Partie inférieure
+  
+  v3, l3, arc3, part3 = demidisk(study, r1, a1, 180.0, solid_thickness)
+  extru3 = geompy.MakePrismVecH(part3, OX, h1)
+
+  # --- Symétrie
+
+  compound = geompy.MakeCompound([final, extru3])
+  plane = geompy.MakePlane(O,OX,2000)
+  compound_mirrored = geompy.MakeMirrorByPlane(compound, plane)
+  compound_total = geompy.MakeCompound([compound, compound_mirrored])
+  final = geompy.MakeGlueFaces(compound_total, 1e-07)
+
+  if progressBar is not None:
+    progressBar.addSteps(1)
+    print time.time() -time0
+      
+  return final
+
+
+def jonction(study, r1, r2, h1, h2, a1):
+  """ Builds the jonction faces and
+  returns what is needed to build the whole pipe
+  """
+  #geompy = geomBuilder.New(study)
+  
+  O = geompy.MakeVertex(0, 0, 0)
+  OX = geompy.MakeVectorDXDYDZ(1, 0, 0) 
+  OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+  OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
+  
+  # --- sections droites des deux demi cylindres avec le partionnement
+  v1, l1, arc1, part1 = demidisk(study, r1, a1, 0.)
+  v2, l2, arc2, part2 = demidisk(study, r2, a1, 90.0)
+  # --- extrusion des sections --> demi cylindres de travail, pour en extraire les sections utilisées au niveau du Té
+  #     et enveloppe cylindrique du cylindre principal
+
+  demicyl1 = geompy.MakePrismVecH(part1, OX, h1)
+  demicyl2 = geompy.MakePrismVecH(part2, OZ, h2)
+  arcextru = geompy.MakePrismVecH(arc1, OX, h1)
+  
+  # --- plan de coupe à 45° sur le cylindre principal,
+  #     section à 45° du cylndre principal,
+  #     section du cylindre secondaire par l'enveloppe cylindrique du cylindre principal
+
+  plan1 = geompy.MakePlane(O, OX, 4*r1)
+  planr = geompy.MakeRotation(plan1, OY, 45*math.pi/180.0)
+
+  sect45 = geompy.MakeCommonList([demicyl1, planr], True)
+  sect90 = geompy.MakeCommonList([demicyl2, arcextru], True)
+  #geompy.addToStudy(sect90, "sect90")
+
+  # --- liste ordonnée des points projetés sur les deux sections
+
+  vord45 = pointsProjetes(study, v1, sect45)
+  vord90 = pointsProjetes(study, v2, sect90)
+
+  # --- identification des projections des trois arcs de cercle, sur les deux sections.
+  
+  lord45 = arcsProjetes(study, vord45, sect45)
+  lord90 = arcsProjetes(study, vord90, sect90)
+  # --- abaissement des quatre points centraux de la section du cylindre secondaire
+  
+  dz = -r2/2.0
+  for i in (0, 2, 4, 5):
+    vord90[i] = geompy.TranslateDXDYDZ(vord90[i], 0, 0, dz, True)
+    #geompy.addToStudyInFather(sect90, vord90[i], 'vm%d'%i)
+    
+  # --- création des deux arêtes curvilignes sur l'enveloppe cylindrique du cylindre principal, à la jonction
+
+  curv = [None for i in range(4)] # liaisons entre les points 1, 3, 6 et 7 des 2 sections
+
+  curv[0] = geompy.MakeArcCenter(O, vord90[1] , vord45[1], False)
+  curv[1] = geompy.MakeArcCenter(O, vord90[3] , vord45[3], False)
+
+  lipts = ((6, 6, 4), (7, 7, 5))
+  for i, ipts in enumerate(lipts):
+    #print i, ipts
+    p0 = vord90[ipts[0]]
+    p1 = vord45[ipts[1]]
+    p2 = vord45[ipts[2]]
+    plan = geompy.MakePlaneThreePnt(p0, p1, p2, 10000)
+    #geompy.addToStudy(plan, "plan%d"%i)
+    section = geompy.MakeSection(plan, arcextru, True)
+    secpart = geompy.MakePartition([section], [sect45, sect90], [], [], geompy.ShapeType["EDGE"], 0, [], 0, True)
+    #geompy.addToStudy(secpart, "secpart%d"%i)
+    lsec = geompy.ExtractShapes(secpart, geompy.ShapeType["EDGE"], True)
+
+    for l in lsec:
+      pts = geompy.ExtractShapes(l, geompy.ShapeType["VERTEX"], True)
+      if (((geompy.MinDistance(pts[0], p0) < 0.001) and (geompy.MinDistance(pts[1], p1) < 0.001)) or
+          ((geompy.MinDistance(pts[1], p0) < 0.001) and (geompy.MinDistance(pts[0], p1) < 0.001))):
+        curv[i+2] =l
+        #print "curv_%d OK"%i
+        break
+    
+  # --- creation des arêtes droites manquantes, des faces et volumes pour les quatre volumes de la jonction
+
+  edges = [None for i in range(8)]
+  edges[0] = geompy.MakeLineTwoPnt(vord45[0], vord90[0])
+  edges[1] = curv[0]
+  edges[2] = geompy.MakeLineTwoPnt(vord45[2], vord90[2])
+  edges[3] = curv[1]
+  edges[4] = geompy.MakeLineTwoPnt(vord45[4], vord90[4])
+  edges[5] = geompy.MakeLineTwoPnt(vord45[5], vord90[5])
+  edges[6] = curv[2]
+  edges[7] = curv[3]
+  ed45 = [None for i in range(8)]
+  ed45[0] = geompy.MakeLineTwoPnt(vord45[0], vord45[2])
+  ed45[1] = geompy.MakeLineTwoPnt(vord45[0], vord45[1])
+  ed45[2] = geompy.MakeLineTwoPnt(vord45[4], vord45[6])
+  ed45[3] = geompy.MakeLineTwoPnt(vord45[2], vord45[3])
+  ed45[4] = geompy.MakeLineTwoPnt(vord45[5], vord45[7])
+  ed45[5] = geompy.MakeLineTwoPnt(vord45[4], vord45[5])
+  ed45[6] = geompy.MakeLineTwoPnt(vord45[0], vord45[4])
+  ed45[7] = geompy.MakeLineTwoPnt(vord45[2], vord45[5])
+  ed90 = [None for i in range(8)]
+  ed90[0] = geompy.MakeLineTwoPnt(vord90[0], vord90[2])
+  ed90[1] = geompy.MakeLineTwoPnt(vord90[0], vord90[1])
+  ed90[2] = geompy.MakeLineTwoPnt(vord90[4], vord90[6])
+  ed90[3] = geompy.MakeLineTwoPnt(vord90[2], vord90[3])
+  ed90[4] = geompy.MakeLineTwoPnt(vord90[5], vord90[7])
+  ed90[5] = geompy.MakeLineTwoPnt(vord90[4], vord90[5])
+  ed90[6] = geompy.MakeLineTwoPnt(vord90[0], vord90[4])
+  ed90[7] = geompy.MakeLineTwoPnt(vord90[2], vord90[5])
+
+  faci = []
+  faci.append(geompy.MakeFaceWires([ed45[6], edges[0], ed90[6], edges[4]], 0))
+  faci.append(geompy.MakeFaceWires([ed45[7], edges[2], ed90[7], edges[5]], 0))
+  faci.append(geompy.MakeFaceWires([ed45[2], edges[4], ed90[2], edges[6]], 0))
+  faci.append(geompy.MakeFaceWires([ed45[5], edges[4], ed90[5], edges[5]], 0))
+  faci.append(geompy.MakeFaceWires([ed45[4], edges[5], ed90[4], edges[7]], 0))
+  faci.append(geompy.MakeFaceWires([ed90[0], ed90[6],  ed90[5], ed90[7]], 0))
+  faci.append(geompy.MakeFaceWires([ed90[1], ed90[6],  ed90[2], lord90[0]], 0))
+  faci.append(geompy.MakeFaceWires([ed90[2], ed90[5],  ed90[4], lord90[1]], 0))
+  faci.append(geompy.MakeFaceWires([ed90[3], ed90[7],  ed90[4], lord90[2]], 0))
+  return faci, sect45, arc1, l1, lord90, lord45, edges, arcextru
+
+def test_t_shape_builder():
+  """For testing purpose"""
+  salome.salome_init()
+  theStudy = salome.myStudy
+  geompy = geomBuilder.New(theStudy)
+  for r1 in [1., 100.]:
+    for r2 in [0.9*r1, 0.5*r1, 0.1*r1, 0.05*r1]:
+      for thickness in [r1/100., r1/10., r1/2.]:
+        print r1, r2, thickness
+        h1 = r1 * 2.0
+        h2 = h1
+        try:
+          res = build_shape(theStudy, r1, r2, h1, h2, thickness)
+          geompy.addToStudy(res, "res_%f_%f_%f"%(r1,r2, thickness))
+        except:
+          print "problem with res_%f_%f_%f"%(r1,r2, thickness)
+  
+if __name__=="__main__":
+  """For testing purpose"""
+  test_t_shape_builder()
diff --git a/src/Tools/t_shape/t_shape_dialog.py b/src/Tools/t_shape/t_shape_dialog.py
new file mode 100644 (file)
index 0000000..c385efd
--- /dev/null
@@ -0,0 +1,81 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2010-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author : Renaud Nédélec (OpenCascade S.A.S)
+
+import sys
+from PyQt4 import QtGui
+from PyQt4 import QtCore
+
+from t_shape_dialog_ui import Ui_Dialog
+
+
+class TShapeDialog(QtGui.QDialog):
+    def __init__(self):
+      QtGui.QDialog.__init__(self, None, QtCore.Qt.Tool)
+      # Set up the user interface from Designer.
+      self.ui = Ui_Dialog()
+      self.ui.setupUi(self)
+      self.show()
+      self._wasOk = False
+      self.ui.dsb_solidThickness.setEnabled(False)
+      self.ui.label_5.setEnabled(False)
+      self.ui.dsb_bigRadius.setValue(50.0)
+      self.ui.dsb_smallRadius.setValue(40.0)
+      self.ui.dsb_bigHeight.setValue(80.0)
+      self.ui.dsb_smallHeight.setValue(80.0)
+   
+    def accept(self):
+      self._wasOk = True
+      QtGui.QDialog.accept(self)
+      
+    def getData(self):
+      r1 = self.ui.dsb_bigRadius.value()
+      r2 = self.ui.dsb_smallRadius.value()
+      h1 = self.ui.dsb_bigHeight.value()
+      h2 = self.ui.dsb_smallHeight.value()
+      thickness = 0.0
+      if self.ui.cb_buildSolid.isChecked():
+        thickness = self.ui.dsb_solidThickness.value()
+      
+      return r1, r2, h1, h2, thickness
+
+    def reject(self):
+        self._wasOk = False
+        QtGui.QDialog.reject(self)
+
+    def wasOk(self):
+        return self._wasOk
+
+     
+# ================     
+# Tests
+# ================
+
+def main( args ):
+    import sys
+    app = QtGui.QApplication(sys.argv)
+    Dialog = TShapeDialog()
+    ui = Ui_Dialog()
+    ui.setupUi(Dialog)
+    Dialog.show()
+    sys.exit(app.exec_())
+
+if __name__=="__main__":
+    main(sys.argv)
diff --git a/src/Tools/t_shape/t_shape_dialog.ui b/src/Tools/t_shape/t_shape_dialog.ui
new file mode 100644 (file)
index 0000000..55a4823
--- /dev/null
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>349</width>
+    <height>283</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout_3">
+   <item row="0" column="0">
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="2" column="1">
+      <widget class="QDoubleSpinBox" name="dsb_smallRadius">
+       <property name="decimals">
+        <number>5</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="value">
+        <double>40.000000000000000</double>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="0">
+      <widget class="QLabel" name="label">
+       <property name="text">
+        <string>Big pipe radius</string>
+       </property>
+      </widget>
+     </item>
+     <item row="3" column="1">
+      <widget class="QDoubleSpinBox" name="dsb_bigHeight">
+       <property name="decimals">
+        <number>5</number>
+       </property>
+       <property name="maximum">
+        <double>1000000.000000000000000</double>
+       </property>
+       <property name="value">
+        <double>80.000000000000000</double>
+       </property>
+      </widget>
+     </item>
+     <item row="4" column="1">
+      <widget class="QDoubleSpinBox" name="dsb_smallHeight">
+       <property name="decimals">
+        <number>5</number>
+       </property>
+       <property name="maximum">
+        <double>1000000.000000000000000</double>
+       </property>
+       <property name="value">
+        <double>80.000000000000000</double>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QDoubleSpinBox" name="dsb_bigRadius">
+       <property name="decimals">
+        <number>5</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="value">
+        <double>50.000000000000000</double>
+       </property>
+      </widget>
+     </item>
+     <item row="3" column="0">
+      <widget class="QLabel" name="label_3">
+       <property name="text">
+        <string>Big pipe  height</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="0">
+      <widget class="QLabel" name="label_2">
+       <property name="text">
+        <string>Small pipe  radius</string>
+       </property>
+      </widget>
+     </item>
+     <item row="4" column="0">
+      <widget class="QLabel" name="label_4">
+       <property name="text">
+        <string>Small  pipe height</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="1" column="0">
+    <layout class="QGridLayout" name="gridLayout_2">
+     <item row="0" column="0">
+      <widget class="QCheckBox" name="cb_buildSolid">
+       <property name="text">
+        <string>Build solid part</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0">
+      <widget class="QLabel" name="label_5">
+       <property name="text">
+        <string>Solid thickness</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="QDoubleSpinBox" name="dsb_solidThickness">
+       <property name="decimals">
+        <number>5</number>
+       </property>
+       <property name="maximum">
+        <double>1000000.000000000000000</double>
+       </property>
+       <property name="value">
+        <double>5.000000000000000</double>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="2" column="0">
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>Dialog</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>205</x>
+     <y>241</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>250</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>Dialog</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>205</x>
+     <y>241</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>214</x>
+     <y>250</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>cb_buildSolid</sender>
+   <signal>clicked(bool)</signal>
+   <receiver>label_5</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>99</x>
+     <y>170</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>107</x>
+     <y>205</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>cb_buildSolid</sender>
+   <signal>clicked(bool)</signal>
+   <receiver>dsb_solidThickness</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>150</x>
+     <y>170</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>277</x>
+     <y>212</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
diff --git a/src/Tools/t_shape/t_shape_progress.py b/src/Tools/t_shape/t_shape_progress.py
new file mode 100644 (file)
index 0000000..38f8045
--- /dev/null
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2010-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author : Renaud Nédélec (OpenCascade S.A.S)
+
+from salome.geom.t_shape import t_shape_builder
+from PyQt4.QtGui import QProgressDialog
+from PyQt4 import QtCore
+
+class t_shape_progress(QProgressDialog):
+    _totSteps = 0
+    _nmaxSteps = 27
+    
+    def __init__(self, parent=None):
+      QProgressDialog.__init__(self, "t_shape fluid build", "stop", 0, self._nmaxSteps, parent, QtCore.Qt.Tool)
+      self.show()
+        
+    def run(self, activeStudy, r1, r2, h1, h2, thickness):
+      shape = t_shape_builder.build_shape(activeStudy, r1, r2, h1, h2, thickness, self)
+      self.setValue(self._nmaxSteps)
+      return shape
+      
+    def addSteps(self, nbSteps):
+      self._totSteps += nbSteps
+      self.setValue(self._totSteps)
index 2b4b75858891ce0f7f6ce2796e9b77d64e9642e6..94996f4bda0c22e6aa1109806fa6539d8cbd0034 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-#INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
@@ -95,12 +93,12 @@ SET(_moc_HEADERS
   )
 
 # header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
+QT_WRAP_UIC(_uic_HEADERS ${_uic_files})
 
 # --- sources ---
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 SET(TransformationGUI_SOURCES
   TransformationGUI.cxx
index 133d181d65140ea56698322aab74bfa9d86e2305..ebc844cc1bb3ccbfc36e9387caacf6a5836f1ef6 100644 (file)
@@ -266,14 +266,14 @@ void TransformationGUI_MirrorDlg::SetEditCurrentArgument()
 
     switch (getConstructorId()) {
     case 0:
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+      localSelection(TopAbs_VERTEX);
       break;
     case 1:
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+      localSelection(TopAbs_EDGE);
       break;
     case 2:
       globalSelection(GEOM_PLANE);
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE);
+      localSelection(TopAbs_FACE);
       break;
     }
 
index b3f04d0a0628a97c919017ec86494b452a4e844a..f54ee69a396be7a00e17452934e48a0cfaaa9795 100644 (file)
@@ -330,7 +330,7 @@ void TransformationGUI_MultiRotationDlg::SetEditCurrentArgument()
   else if (send == GroupArgs->PushButton2) {
     myEditCurrentArgument = GroupArgs->LineEdit2;
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
 
     GroupArgs->PushButton1->setDown(false);
     GroupArgs->LineEdit1->setEnabled(false);
index da234f21020b44e452f896bcb695247a10af6f88..1051b8abf542ae5a5c3816764a7bb167496875cf 100644 (file)
@@ -429,7 +429,7 @@ void TransformationGUI_MultiTranslationDlg::SetEditCurrentArgument()
   else if (send == GroupPoints->PushButton2) {
     myEditCurrentArgument = GroupPoints->LineEdit2;
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
 
     GroupPoints->PushButton1->setDown(false);
     GroupPoints->LineEdit1->setEnabled(false);
@@ -445,7 +445,7 @@ void TransformationGUI_MultiTranslationDlg::SetEditCurrentArgument()
   else if (send == GroupDimensions->PushButton2) {
     myEditCurrentArgument = GroupDimensions->LineEdit2;
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
 
     GroupDimensions->PushButton1->setDown(false);
     GroupDimensions->PushButton3->setDown(false);
@@ -455,7 +455,7 @@ void TransformationGUI_MultiTranslationDlg::SetEditCurrentArgument()
   else if (send == GroupDimensions->PushButton3) {
     myEditCurrentArgument = GroupDimensions->LineEdit3;
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
 
     GroupDimensions->PushButton1->setDown(false);
     GroupDimensions->PushButton2->setDown(false);
index 87d1555117174a043f316372182b1a98ea6844b0..fd0283e1407e314f4dd75efd98b715ad7b803a75 100644 (file)
@@ -259,7 +259,7 @@ void TransformationGUI_PositionDlg::ConstructorsClicked (int constructorId)
 void TransformationGUI_PositionDlg::SelectionTypeButtonClicked()
 {
   if ( Group1->CheckButton2->isChecked() ) {
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
   } else {
     TColStd_MapOfInteger aMap;
     aMap.Add(GEOM_WIRE);
@@ -433,7 +433,7 @@ void TransformationGUI_PositionDlg::SetEditCurrentArgument()
     Group1->CheckButton2->setEnabled(true);
 
     if ( Group1->CheckButton2->isChecked() ) {
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+      localSelection( TopAbs_EDGE );
     } else {
       TColStd_MapOfInteger aMap;
       aMap.Add(GEOM_WIRE);
index 2e91fc3daa8812676176055756403ada16343eee..186e9e0c827c5d00d10b9c4b198c2c59af97cbd2 100644 (file)
@@ -239,12 +239,12 @@ void TransformationGUI_ProjectionDlg::SetEditCurrentArgument()
       globalSelection( aMap );
       std::list<int> needTypes;
       needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE );
-      localSelection(GEOM::GEOM_Object::_nil(), needTypes );
+      localSelection(needTypes);
       break;
     }
     case PROJ_ON_WIRE:
     case PROJ_ON_EDGE: {
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+      localSelection(TopAbs_VERTEX);
       break;
     }
     default:;
@@ -258,9 +258,9 @@ void TransformationGUI_ProjectionDlg::SetEditCurrentArgument()
     myGroup->LineEdit1->setEnabled(false);
 
     switch ( getConstructorId() ) {
-    case PROJ_ON_FACE: localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE); break;
-    case PROJ_ON_WIRE: localSelection(GEOM::GEOM_Object::_nil(), TopAbs_WIRE); break;
-    case PROJ_ON_EDGE: localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE); break;
+    case PROJ_ON_FACE: localSelection(TopAbs_FACE); break;
+    case PROJ_ON_WIRE: localSelection(TopAbs_WIRE); break;
+    case PROJ_ON_EDGE: localSelection(TopAbs_EDGE); break;
     default:;
     }
   }
index 7c5dd617699e515d1e9fa6509832f3e1b30bb8e7..21125e57e4d1b506cd7b98385f9998174c4b64ca 100644 (file)
@@ -60,7 +60,8 @@ TransformationGUI_ProjectionOnCylDlg::TransformationGUI_ProjectionOnCylDlg
     myRadiusSpin      (0),
     myStartAngleSpin  (0),
     myUseAngleLen     (0),
-    myAngleLenSpin    (0)
+    myAngleLenSpin    (0),
+    myAngleRotSpin    (0)
 {
   SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
   QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICO_DLG_PROJ_ON_CYL")));
@@ -85,6 +86,8 @@ TransformationGUI_ProjectionOnCylDlg::TransformationGUI_ProjectionOnCylDlg
     new QLabel(tr("GEOM_PROJ_ON_CYL_START_ANGLE"), aGrpParams);
   QLabel      *anAngleLenLbl  =
     new QLabel(tr("GEOM_PROJ_ON_CYL_LENGTH_ANGLE"), aGrpParams);
+  QLabel      *anAngleRotLbl  =
+    new QLabel(tr("GEOM_PROJ_ON_CYL_ROTATION_ANGLE"), aGrpParams);
 
   myObjectName     = new QLineEdit(aGrpParams);
   mySelButton      = new QPushButton(aGrpParams);
@@ -92,6 +95,7 @@ TransformationGUI_ProjectionOnCylDlg::TransformationGUI_ProjectionOnCylDlg
   myStartAngleSpin = new SalomeApp_DoubleSpinBox(aGrpParams);
   myUseAngleLen    = new QCheckBox(aGrpParams);
   myAngleLenSpin   = new SalomeApp_DoubleSpinBox(aGrpParams);
+  myAngleRotSpin   = new SalomeApp_DoubleSpinBox(aGrpParams);
 
   myObjectName->setReadOnly(true);
   mySelButton->setIcon(image1);
@@ -110,6 +114,8 @@ TransformationGUI_ProjectionOnCylDlg::TransformationGUI_ProjectionOnCylDlg
   aParamsLayout->addWidget(myUseAngleLen,    3, 0);
   aParamsLayout->addWidget(anAngleLenLbl,    3, 1);
   aParamsLayout->addWidget(myAngleLenSpin,   3, 2, 1, 2);
+  aParamsLayout->addWidget(anAngleRotLbl,    4, 1);
+  aParamsLayout->addWidget(myAngleRotSpin,   4, 2, 1, 2);
 
   QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
   layout->setMargin( 0 ); layout->setSpacing( 6 );
@@ -145,14 +151,17 @@ void TransformationGUI_ProjectionOnCylDlg::Init()
   double aRadius       = 100.0;
   double aStartAngle   = 0.;
   double anAngleLen    = 360.;
+  double aRotAngle     = 0.;
 
   initSpinBox(myRadiusSpin, 0.00001, COORD_MAX, aStep, "length_precision");
   initSpinBox(myStartAngleSpin, -180., 180., aSpecificStep, "angle_precision");
   initSpinBox(myAngleLenSpin, 0.00001, COORD_MAX, aSpecificStep, "angle_precision");
+  initSpinBox(myAngleRotSpin, -180., 180., aSpecificStep, "angle_precision");
 
   myRadiusSpin->setValue(aRadius);
   myStartAngleSpin->setValue(aStartAngle);
   myAngleLenSpin->setValue(anAngleLen);
+  myAngleRotSpin->setValue(aRotAngle);
 
   myObjectName->setText("");
   myUseAngleLen->setChecked(true);
@@ -165,6 +174,7 @@ void TransformationGUI_ProjectionOnCylDlg::Init()
   connect(myRadiusSpin,     SIGNAL(valueChanged(double)), this, SLOT(processPreview()));
   connect(myStartAngleSpin, SIGNAL(valueChanged(double)), this, SLOT(processPreview()));
   connect(myAngleLenSpin,   SIGNAL(valueChanged(double)), this, SLOT(processPreview()));
+  connect(myAngleRotSpin,   SIGNAL(valueChanged(double)), this, SLOT(processPreview()));
   connect(myUseAngleLen,    SIGNAL(clicked()),            this, SLOT(SetUseLengthAngle()));
 
   connect(myGeomGUI->getApp()->selectionMgr(),SIGNAL(currentSelectionChanged()),
@@ -319,7 +329,8 @@ bool TransformationGUI_ProjectionOnCylDlg::isValid (QString &msg)
 
   if (!myObj->_is_nil()                      &&
        myRadiusSpin->isValid(msg, !IsPreview()) &&
-       myStartAngleSpin->isValid(msg, !IsPreview())) {
+       myStartAngleSpin->isValid(msg, !IsPreview()) &&
+       myAngleRotSpin->isValid(msg, !IsPreview())) {
     if (myUseAngleLen->isChecked()) {
       // Check length angle spin.
       isOk =  myAngleLenSpin->isValid(msg, !IsPreview());
@@ -343,6 +354,7 @@ bool TransformationGUI_ProjectionOnCylDlg::execute (ObjectList& objects)
 
   double aRadius      = myRadiusSpin->value();
   double aStartAngle  = myStartAngleSpin->value()*M_PI/180.;
+  double aRotAngle    = myAngleRotSpin->value()*M_PI/180.;
   double aLengthAngle = -1.;
 
   if (myUseAngleLen->isChecked()) {
@@ -350,7 +362,7 @@ bool TransformationGUI_ProjectionOnCylDlg::execute (ObjectList& objects)
   }
 
   GEOM::GEOM_Object_var anObj = anOper->MakeProjectionOnCylinder
-    (myObj, aRadius, aStartAngle, aLengthAngle);
+    (myObj, aRadius, aStartAngle, aLengthAngle, aRotAngle);
 
   if (!anObj->_is_nil()) {
     if (!IsPreview()) {
@@ -359,6 +371,7 @@ bool TransformationGUI_ProjectionOnCylDlg::execute (ObjectList& objects)
       aParameters << myStartAngleSpin->text();
       if (myUseAngleLen->isChecked())
         aParameters << myAngleLenSpin->text();
+      aParameters << myAngleRotSpin->text();
       anObj->SetParameters(aParameters.join(":").toUtf8().constData());
     }
     objects.push_back(anObj._retn());
index beb16d976fca268e50dbf894b5a878eb05377065..eab7ee34ac9d35b896fc8e9556a84f7ab3652a95 100644 (file)
@@ -72,6 +72,7 @@ private:
   SalomeApp_DoubleSpinBox           *myStartAngleSpin;
   QCheckBox                         *myUseAngleLen;
   SalomeApp_DoubleSpinBox           *myAngleLenSpin;
+  SalomeApp_DoubleSpinBox           *myAngleRotSpin;
 
 };
 
index 03ce4cecb944039d0f6dff07a0f05d016e4fe675..7e9617f3d280aab893d2c4bd3f5800af86efe453 100644 (file)
@@ -361,9 +361,9 @@ void TransformationGUI_RotationDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit5->setEnabled(false);
 
     if (getConstructorId() == 0)
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+      localSelection(TopAbs_EDGE);
     else
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+      localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupPoints->PushButton4) {
     myEditCurrentArgument = GroupPoints->LineEdit4;
@@ -375,7 +375,7 @@ void TransformationGUI_RotationDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit2->setEnabled(false);
     GroupPoints->LineEdit5->setEnabled(false);
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupPoints->PushButton5) {
     myEditCurrentArgument = GroupPoints->LineEdit5;
@@ -387,7 +387,7 @@ void TransformationGUI_RotationDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit2->setEnabled(false);
     GroupPoints->LineEdit4->setEnabled(false);
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
index e43169ba3488f1e448dbb2f627af00bce5f66f1a..50e338f1104f49921871f0f7b17f9e2b8f27e377 100644 (file)
@@ -325,7 +325,7 @@ void TransformationGUI_ScaleDlg::SetEditCurrentArgument()
   else if (send == PushButton2) {
     myEditCurrentArgument = LineEdit2;
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
 
     PushButton1->setDown(false);
     LineEdit1->setEnabled(false);
index f5622c716faa98923292efcfc79d4aa2d955e8d6..23bafef69d942b0183e5cfd8d2861c9d6dcddeae 100644 (file)
@@ -385,9 +385,9 @@ void TransformationGUI_TranslationDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit3->setEnabled(false);
 
     if (getConstructorId() == 1)
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+      localSelection(TopAbs_VERTEX);
     else
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+      localSelection(TopAbs_EDGE);
   }
   else if (send == GroupPoints->PushButton3) {
     myEditCurrentArgument = GroupPoints->LineEdit3;
@@ -397,7 +397,7 @@ void TransformationGUI_TranslationDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit1->setEnabled(false);
     GroupPoints->LineEdit2->setEnabled(false);
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
index 9f67135eb18e3d0c418b8bac026ee0b3db368869..dbf3c5bcb6ee35291108edd8ae4e32956da72cf2 100644 (file)
@@ -18,8 +18,7 @@
 #
 
 IF(SALOME_BUILD_GUI)
-  INCLUDE(UseQt4Ext)
-  INCLUDE(${QT_USE_FILE})
+  INCLUDE(UseQtExt)
 ENDIF()
 
 # --- options ---
@@ -41,7 +40,6 @@ INCLUDE_DIRECTORIES(
   
 IF(SALOME_BUILD_GUI)
   INCLUDE_DIRECTORIES(
-    ${QT_INCLUDE_DIRS}
     ${GUI_INCLUDE_DIRS}
     ${PROJECT_SOURCE_DIR}/src/OBJECT
     ${PROJECT_SOURCE_DIR}/src/GEOMGUI
@@ -112,7 +110,7 @@ ENDIF()
 
 IF(SALOME_BUILD_GUI)
   # sources / moc wrappings
-  QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+  QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
   SET(VTKPluginGUI_SOURCES
     VTKPlugin_GUI.cxx
@@ -148,7 +146,7 @@ IF(SALOME_BUILD_GUI)
   TARGET_LINK_LIBRARIES(VTKPluginGUI ${_link_gui_LIBRARIES})
   INSTALL(TARGETS VTKPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
   
-  QT4_INSTALL_TS_RESOURCES("${VTKPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+  QT_INSTALL_TS_RESOURCES("${VTKPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
 ENDIF()
 
 
index b4af670b54377dce401445a22d1ec0ac019378fe..40e69f4f1d225ad788fc2222fe84dc49ace880bb 100644 (file)
@@ -99,7 +99,7 @@ QString VTKPlugin_ExportDlg::getFileName( const Handle(SALOME_InteractiveObject)
 
   VTKPlugin_ExportDlg fd( io, parent );
   fd.setFileMode( AnyFile );
-  fd.setFilters( fls );
+  fd.setNameFilters( fls );
   fd.setWindowTitle( caption );
   if ( !tmpfilename.isEmpty() )
     fd.processPath( tmpfilename );
index ada1e297c0dac417506fac2c540f8b5a64988d6a..fbf7dfdc64ec4e7bc5339ebdf6a2c39a32b8bdf9 100644 (file)
 #include "GEOM_Operation.h"
 #include "GEOMBase.h"
 #include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(VTKPlugin)
 
+typedef GEOM::GenericObjPtr<GEOM::IVTKOperations> VTKOpPtr;
+
 //=======================================================================
 // function : VTKPlugin_GUI()
 // purpose  : Constructor
@@ -102,8 +105,8 @@ bool VTKPlugin_GUI::exportVTK( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "VTKPluginEngine" );
-  GEOM::IVTKOperations_var stlOp = GEOM::IVTKOperations::_narrow( op );
-  if ( CORBA::is_nil( stlOp ) ) return false;
+  VTKOpPtr vtkOp = GEOM::IVTKOperations::_narrow( op );
+  if ( vtkOp.isNull() ) return false;
 
   LightApp_SelectionMgr* sm = app->selectionMgr();
   if ( !sm ) return false;
@@ -132,16 +135,16 @@ bool VTKPlugin_GUI::exportVTK( SUIT_Desktop* parent )
     
     SUIT_OverrideCursor wc;
     
-    GEOM_Operation transaction( app, stlOp.in() );
+    GEOM_Operation transaction( app, vtkOp.get() );
     
     try
     {
       app->putInfo( tr( "GEOM_PRP_EXPORT" ).arg( fileName ) );
       transaction.start();
       
-      stlOp->ExportVTK( obj, fileName.toUtf8().constData(), deflection  );
+      vtkOp->ExportVTK( obj, fileName.toUtf8().constData(), deflection  );
       
-      if ( stlOp->IsDone() )
+      if ( vtkOp->IsDone() )
       {
        transaction.commit();
       }
@@ -150,7 +153,7 @@ bool VTKPlugin_GUI::exportVTK( SUIT_Desktop* parent )
        transaction.abort();
        SUIT_MessageBox::critical( parent,
                                   tr( "GEOM_ERROR" ),
-                                  tr( "GEOM_PRP_ABORT" ) + "\n" + tr( stlOp->GetErrorCode() ) );
+                                  tr( "GEOM_PRP_ABORT" ) + "\n" + tr( vtkOp->GetErrorCode() ) );
        return false;
       }
     }
index a541371bfb080a3bb288ee79fbf8847c0c2ec836..1661cc0bb777c9e39419486e8aada407a56f0b05 100644 (file)
@@ -40,7 +40,7 @@ namespace XAO
         {
             std::ifstream rstr;
             int length;
-            rstr.open(filePath.c_str());
+            rstr.open(filePath.c_str(), std::ios_base::binary);
             rstr.seekg(0, rstr.end);        // go to the end
             length = rstr.tellg();          // report location (this is the length)
             rstr.seekg(0, rstr.beg);        // go back to the beginning
index 47d6a2ff307ebe59801cb1138f8521ce6a175c74..1f9ed1375ff4ebaab6edda4550e77b9a2edc1d91 100644 (file)
@@ -18,8 +18,7 @@
 #
 
 IF(SALOME_BUILD_GUI)
-  INCLUDE(UseQt4Ext)
-  INCLUDE(${QT_USE_FILE})
+  INCLUDE(UseQtExt)
 ENDIF()
 
 # --- options ---
@@ -40,7 +39,6 @@ INCLUDE_DIRECTORIES(
   
 IF(SALOME_BUILD_GUI)
   INCLUDE_DIRECTORIES(
-    ${QT_INCLUDE_DIRS}
     ${GUI_INCLUDE_DIRS}
     ${PROJECT_SOURCE_DIR}/src/OBJECT
     ${PROJECT_SOURCE_DIR}/src/GEOMGUI
@@ -111,7 +109,7 @@ ENDIF()
 
 IF(SALOME_BUILD_GUI)
   # sources / moc wrappings
-  QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+  QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
   SET(XAOPluginGUI_SOURCES
     XAOPlugin_GUI.cxx
@@ -149,7 +147,7 @@ IF(SALOME_BUILD_GUI)
   TARGET_LINK_LIBRARIES(XAOPluginGUI ${_link_gui_LIBRARIES})
   INSTALL(TARGETS XAOPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
   
-  QT4_INSTALL_TS_RESOURCES("${XAOPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+  QT_INSTALL_TS_RESOURCES("${XAOPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
 ENDIF()
 
 
index 01803c13681969f6f33f4fd33e13e9855912171f..607c7b3df3b1f49448601554c3d0d46159be5448 100644 (file)
@@ -100,6 +100,23 @@ Standard_Integer XAOPlugin_Driver::Execute(TFunction_Logbook& log) const
   return 1;
 }
 
-IMPLEMENT_STANDARD_HANDLE (XAOPlugin_Driver, TFunction_Driver);
-IMPLEMENT_STANDARD_RTTIEXT(XAOPlugin_Driver, TFunction_Driver);
+//=======================================================================
+//function : GetCreationInformation
+//purpose  : Returns a name of creation operation and names and values of
+//           creation parameters
+//=======================================================================
+
+bool XAOPlugin_Driver::GetCreationInformation(std::string&             theOperationName,
+                                              std::vector<GEOM_Param>& theParams)
+{
+  if (Label().IsNull()) return false;
+  Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
+
+  theOperationName = "ImportXAO";
+  AddParam( theParams, "File name", function->GetString( GetFileNameTag() ));
+  return true;
+}
+
+IMPLEMENT_STANDARD_HANDLE (XAOPlugin_Driver, GEOM_BaseDriver);
+IMPLEMENT_STANDARD_RTTIEXT(XAOPlugin_Driver, GEOM_BaseDriver);
  
index 1d36b839bf6278575474a050b0402d8157b254a4..9a8885e96ad53fc5b54ed3ae01b2c3c148d1767d 100644 (file)
 #ifndef _XAOPlugin_Driver_HXX
 #define _XAOPlugin_Driver_HXX
 
-// OCCT includes
-#include <TFunction_Driver.hxx>
+#include "GEOM_BaseDriver.hxx"
 
-DEFINE_STANDARD_HANDLE(XAOPlugin_Driver, TFunction_Driver);
+DEFINE_STANDARD_HANDLE(XAOPlugin_Driver, GEOM_BaseDriver);
 
-class XAOPlugin_Driver: public TFunction_Driver
+class XAOPlugin_Driver: public GEOM_BaseDriver
 {
 public:
   XAOPlugin_Driver();
@@ -39,7 +38,12 @@ public:
   Standard_Boolean MustExecute(const TFunction_Logbook&) const;
   virtual void Validate(TFunction_Logbook&) const {}
 
-DEFINE_STANDARD_RTTI(XAOPlugin_Driver)
+  virtual bool GetCreationInformation(std::string&             theOperationName,
+                                     std::vector<GEOM_Param>& theParams);
+
+  static int GetFileNameTag() { return 1; } // where to store file name in GEOM_Function
+
+  DEFINE_STANDARD_RTTI(XAOPlugin_Driver)
 };
 
 #endif // _XAOPlugin_Driver_HXX
index d491cad2b49d02911a741359797061cc3ac0f928..d8c886274f57b19a6f7af9d30444b4f41ad78052 100644 (file)
@@ -470,6 +470,8 @@ bool XAOPlugin_IOperations::ImportXAO( const char* fileName,
   if (function.IsNull()) return false;
   if (function->GetDriverGUID() != XAOPlugin_Driver::GetID()) return false;
 
+  function->SetString( XAOPlugin_Driver::GetFileNameTag(), fileName );
+
   // set the geometry
   if (xaoGeometry->getFormat() == XAO::BREP)
   {
index 990386361f24655743a7def9f5cf964fcf7d30e7..2d061210ff07d28321e27cb06c3ea0653d05c17e 100644 (file)
@@ -280,13 +280,16 @@ bool XAOPlugin_ImportDlg::execute()
   {
     QStringList anEntryList;
     anEntryList << addInStudy(m_mainShape, m_mainShape->GetName());
+    m_mainShape->UnRegister();
     for (int i = 0; i < subShapes->length(); i++)
     {
       addInStudy(subShapes[i].in(), subShapes[i]->GetName());
+      subShapes[i]->UnRegister();
     }
     for (int i = 0; i < groups->length(); i++)
     {
       addInStudy(groups[i].in(), groups[i]->GetName());
+      groups[i]->UnRegister();
     }
     for (int i = 0; i < fields->length(); i++)
     {
@@ -316,6 +319,7 @@ QString XAOPlugin_ImportDlg::addFieldInStudy( GEOM::GEOM_Field_ptr theField, GEO
 
   SALOMEDS::SObject_var aSO =
     getGeomEngine()->AddInStudy(aStudyDS, theField, theField->GetName(), theFather);
+  theField->UnRegister();
 
   QString anEntry;
   if ( !aSO->_is_nil() ) {
@@ -331,6 +335,7 @@ QString XAOPlugin_ImportDlg::addFieldInStudy( GEOM::GEOM_Field_ptr theField, GEO
     QString stepName = (tr("XAOPLUGIN_STEP") + " %1 %2").arg( step->GetID() ).arg( step->GetStamp() );
     SALOMEDS::SObject_wrap aSOField =
       getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toLatin1().constData(), theField );
+    step->UnRegister();
   }
 
   aSO->UnRegister();